diff options
author | Jon TURNEY <jon.turney@dronecode.org.uk> | 2013-03-20 14:35:24 +0000 |
---|---|---|
committer | Jon TURNEY <jon.turney@dronecode.org.uk> | 2013-03-20 14:35:24 +0000 |
commit | 072fb78c07da35eae6226d4304e905ec93d94312 (patch) | |
tree | cc2f0d72707558a7f86108b2f6edefe264597e48 | |
parent | 103b77c59e3638a45179bf6d7908f5c738d2d872 (diff) | |
parent | 6fc72f3b8edbcf4adf33de163e3d9881652b92c6 (diff) |
Merge branch 'cygwin-patches-for-1.14' into cygwin-release-1.14xserver-cygwin-1.14.0-1
94 files changed, 3828 insertions, 6223 deletions
diff --git a/Makefile.am b/Makefile.am index 9a628537d..7be4271d4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -27,6 +27,7 @@ SUBDIRS = \ Xext \ miext \ os \ + pseudoramiX \ randr \ render \ Xi \ @@ -77,6 +78,7 @@ DIST_SUBDIRS = \ Xext \ miext \ os \ + pseudoramiX \ randr \ render \ Xi \ diff --git a/composite/compwindow.c b/composite/compwindow.c index 0be7a1b34..f61600e9e 100644 --- a/composite/compwindow.c +++ b/composite/compwindow.c @@ -104,7 +104,7 @@ compRepaintBorder(ClientPtr pClient, pointer closure) RegionNull(&exposed); RegionSubtract(&exposed, &pWindow->borderClip, &pWindow->winSize); - miPaintWindow(pWindow, &exposed, PW_BORDER); + (*pWindow->drawable.pScreen->PaintWindow)(pWindow, &exposed, PW_BORDER); RegionUninit(&exposed); } return TRUE; diff --git a/configure.ac b/configure.ac index 6e1ff65c4..e9b3b6c8c 100644 --- a/configure.ac +++ b/configure.ac @@ -1061,7 +1061,7 @@ if test "x$GLX" = xyes; then AC_SUBST(XLIB_CFLAGS) AC_DEFINE(GLXEXT, 1, [Build GLX extension]) GLX_LIBS='$(top_builddir)/glx/libglx.la' - GLX_SYS_LIBS="$GLX_SYS_LIBS" + GLX_SYS_LIBS="$GLX_SYS_LIBS -lglapi" else GLX=no fi @@ -1896,7 +1896,7 @@ if test "x$XWIN" = xyes; then AC_DEFINE_UNQUOTED(__VENDORDWEBSUPPORT__, ["$VENDOR_WEB"], [Vendor web address for support]) AC_CHECK_TOOL(WINDRES, windres) - PKG_CHECK_MODULES([XWINMODULES],[x11 xdmcp xau]) + PKG_CHECK_MODULES([XWINMODULES],[x11 xdmcp xau x11-xcb xcb-image xcb-icccm]) if test "x$WINDOWSWM" = xauto; then PKG_CHECK_EXISTS($WINDOWSWMPROTO, [WINDOWSWM=yes], [WINDOWSWM=no]) @@ -2237,6 +2237,7 @@ miext/damage/Makefile miext/shadow/Makefile miext/rootless/Makefile os/Makefile +pseudoramiX/Makefile randr/Makefile render/Makefile xkb/Makefile @@ -2297,6 +2298,7 @@ hw/xnest/man/Makefile hw/xwin/Makefile hw/xwin/glx/Makefile hw/xwin/man/Makefile +hw/xwin/wmutil/Makefile hw/xquartz/Makefile hw/xquartz/GL/Makefile hw/xquartz/bundle/Makefile diff --git a/dix/Makefile.am b/dix/Makefile.am index b7358aa72..28bcd77d1 100644 --- a/dix/Makefile.am +++ b/dix/Makefile.am @@ -14,6 +14,7 @@ libdix_la_SOURCES = \ dispatch.c \ dispatch.h \ dixfonts.c \ + dixmain.c \ dixutils.c \ enterleave.c \ enterleave.h \ diff --git a/dix/dispatch.c b/dix/dispatch.c index 8d6173525..2dd1a6764 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -223,7 +223,7 @@ UpdateCurrentTimeIf(void) #define SMART_SCHEDULE_DEFAULT_INTERVAL 20 /* ms */ #define SMART_SCHEDULE_MAX_SLICE 200 /* ms */ -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(WIN32) || defined(__CYGWIN__) Bool SmartScheduleDisable = TRUE; #else Bool SmartScheduleDisable = FALSE; diff --git a/dix/dixmain.c b/dix/dixmain.c new file mode 100644 index 000000000..9a0bc8c5f --- /dev/null +++ b/dix/dixmain.c @@ -0,0 +1,373 @@ +/*********************************************************** + +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. + +******************************************************************/ + +#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> +#include <version-config.h> +#endif + +#include <X11/X.h> +#include <X11/Xos.h> /* for unistd.h */ +#include <X11/Xproto.h> +#include <pixman.h> +#include "scrnintstr.h" +#include "misc.h" +#include "os.h" +#include "windowstr.h" +#include "resource.h" +#include "dixstruct.h" +#include "gcstruct.h" +#include "extension.h" +#include "colormap.h" +#include "colormapst.h" +#include "cursorstr.h" +#include "selection.h" +#include <X11/fonts/font.h> +#include "opaque.h" +#include "servermd.h" +#include "hotplug.h" +#include "site.h" +#include "dixfont.h" +#include "extnsionst.h" +#include "privates.h" +#include "registry.h" +#include "client.h" +#include "exevents.h" +#ifdef PANORAMIX +#include "panoramiXsrv.h" +#else +#include "dixevents.h" /* InitEvents() */ +#endif + +#ifdef DPMSExtension +#include <X11/extensions/dpmsconst.h> +#include "dpmsproc.h" +#endif + +extern void Dispatch(void); + +#ifdef XQUARTZ +#include <pthread.h> + +BOOL serverRunning = FALSE; +pthread_mutex_t serverRunningMutex = PTHREAD_MUTEX_INITIALIZER; +pthread_cond_t serverRunningCond = PTHREAD_COND_INITIALIZER; + +#endif + +int +dix_main(int argc, char *argv[], char *envp[]) +{ + int i; + HWEventQueueType alwaysCheckForInput[2]; + + display = "0"; + + InitRegions(); + + CheckUserParameters(argc, argv, envp); + + CheckUserAuthorization(); + + InitConnectionLimits(); + + ProcessCommandLine(argc, argv); + + alwaysCheckForInput[0] = 0; + alwaysCheckForInput[1] = 1; + while (1) { + serverGeneration++; + ScreenSaverTime = defaultScreenSaverTime; + ScreenSaverInterval = defaultScreenSaverInterval; + ScreenSaverBlanking = defaultScreenSaverBlanking; + ScreenSaverAllowExposures = defaultScreenSaverAllowExposures; +#ifdef DPMSExtension + DPMSStandbyTime = DPMSSuspendTime = DPMSOffTime = ScreenSaverTime; + DPMSEnabled = TRUE; + DPMSPowerLevel = 0; +#endif + InitBlockAndWakeupHandlers(); + if (serverGeneration == 1) { + CreateWellKnownSockets(); + for (i = 1; i < MAXCLIENTS; i++) + clients[i] = NullClient; + serverClient = calloc(sizeof(ClientRec), 1); + if (!serverClient) + FatalError("couldn't create server client"); + InitClient(serverClient, 0, (pointer) NULL); + } + else + ResetWellKnownSockets(); + /* Perform any operating system dependent initializations you'd like */ + OsInit(); + clients[0] = serverClient; + currentMaxClients = 1; + + /* Initialize privates before first allocation */ + dixResetPrivates(); + + /* Initialize server client devPrivates, to be reallocated as + * more client privates are registered + */ + if (!dixAllocatePrivates(&serverClient->devPrivates, PRIVATE_CLIENT)) + FatalError("failed to create server client privates"); + + if (!InitClientResources(serverClient)) /* for root resources */ + FatalError("couldn't init server resources"); + + SetInputCheck(&alwaysCheckForInput[0], &alwaysCheckForInput[1]); + screenInfo.numScreens = 0; + + InitAtoms(); + InitEvents(); + InitSelections(); + InitGlyphCaching(); + dixResetRegistry(); + ResetFontPrivateIndex(); + InitCallbackManager(); + InitOutput(&screenInfo, argc, argv); + + if (screenInfo.numScreens < 1) + FatalError("no screens found"); + InitExtensions(argc, argv); + + for (i = 0; i < screenInfo.numGPUScreens; i++) { + ScreenPtr pScreen = screenInfo.gpuscreens[i]; + if (!CreateScratchPixmapsForScreen(pScreen)) + FatalError("failed to create scratch pixmaps"); + } + + for (i = 0; i < screenInfo.numScreens; i++) { + ScreenPtr pScreen = screenInfo.screens[i]; + + if (!CreateScratchPixmapsForScreen(pScreen)) + FatalError("failed to create scratch pixmaps"); + if (pScreen->CreateScreenResources && + !(*pScreen->CreateScreenResources) (pScreen)) + FatalError("failed to create screen resources"); + if (!CreateGCperDepth(i)) + FatalError("failed to create scratch GCs"); + if (!CreateDefaultStipple(i)) + FatalError("failed to create default stipple"); + if (!CreateRootWindow(pScreen)) + FatalError("failed to create root window"); + } + + InitFonts(); + if (SetDefaultFontPath(defaultFontPath) != Success) { + ErrorF("[dix] failed to set default font path '%s'", + defaultFontPath); + } + if (!SetDefaultFont(defaultTextFont)) { + FatalError("could not open default font '%s'", defaultTextFont); + } + + if (!(rootCursor = CreateRootCursor(NULL, 0))) { + FatalError("could not open default cursor font '%s'", + defaultCursorFont); + } + +#ifdef DPMSExtension + /* check all screens, looking for DPMS Capabilities */ + DPMSCapableFlag = DPMSSupported(); + if (!DPMSCapableFlag) + DPMSEnabled = FALSE; +#endif + +#ifdef PANORAMIX + /* + * Consolidate window and colourmap information for each screen + */ + if (!noPanoramiXExtension) + PanoramiXConsolidate(); +#endif + + for (i = 0; i < screenInfo.numScreens; i++) + InitRootWindow(screenInfo.screens[i]->root); + + InitCoreDevices(); + InitInput(argc, argv); + InitAndStartDevices(); + ReserveClientIds(serverClient); + + dixSaveScreens(serverClient, SCREEN_SAVER_FORCER, ScreenSaverReset); + +#ifdef PANORAMIX + if (!noPanoramiXExtension) { + if (!PanoramiXCreateConnectionBlock()) { + FatalError("could not create connection block info"); + } + } + else +#endif + { + if (!CreateConnectionBlock()) { + FatalError("could not create connection block info"); + } + } + +#ifdef XQUARTZ + /* Let the other threads know the server is done with its init */ + pthread_mutex_lock(&serverRunningMutex); + serverRunning = TRUE; + pthread_cond_broadcast(&serverRunningCond); + pthread_mutex_unlock(&serverRunningMutex); +#endif + + NotifyParentProcess(); + + Dispatch(); + +#ifdef XQUARTZ + /* Let the other threads know the server is no longer running */ + pthread_mutex_lock(&serverRunningMutex); + serverRunning = FALSE; + pthread_mutex_unlock(&serverRunningMutex); +#endif + + UndisplayDevices(); + DisableAllDevices(); + + /* Now free up whatever must be freed */ + if (screenIsSaved == SCREEN_SAVER_ON) + dixSaveScreens(serverClient, SCREEN_SAVER_OFF, ScreenSaverReset); + FreeScreenSaverTimer(); + CloseDownExtensions(); + +#ifdef PANORAMIX + { + Bool remember_it = noPanoramiXExtension; + + noPanoramiXExtension = TRUE; + FreeAllResources(); + noPanoramiXExtension = remember_it; + } +#else + FreeAllResources(); +#endif + + CloseInput(); + + for (i = 0; i < screenInfo.numScreens; i++) + screenInfo.screens[i]->root = NullWindow; + + CloseDownDevices(); + + CloseDownEvents(); + + for (i = screenInfo.numGPUScreens - 1; i >= 0; i--) { + ScreenPtr pScreen = screenInfo.gpuscreens[i]; + FreeScratchPixmapsForScreen(pScreen); + (*pScreen->CloseScreen) (pScreen); + dixFreePrivates(pScreen->devPrivates, PRIVATE_SCREEN); + free(pScreen); + screenInfo.numGPUScreens = i; + } + + for (i = screenInfo.numScreens - 1; i >= 0; i--) { + FreeScratchPixmapsForScreen(screenInfo.screens[i]); + FreeGCperDepth(i); + FreeDefaultStipple(i); + dixFreeScreenSpecificPrivates(screenInfo.screens[i]); + (*screenInfo.screens[i]->CloseScreen) (screenInfo.screens[i]); + dixFreePrivates(screenInfo.screens[i]->devPrivates, PRIVATE_SCREEN); + free(screenInfo.screens[i]); + screenInfo.numScreens = i; + } + + ReleaseClientIds(serverClient); + dixFreePrivates(serverClient->devPrivates, PRIVATE_CLIENT); + serverClient->devPrivates = NULL; + + FreeFonts(); + + FreeAuditTimer(); + + if (dispatchException & DE_TERMINATE) { + CloseWellKnownConnections(); + } + + OsCleanup((dispatchException & DE_TERMINATE) != 0); + + if (dispatchException & DE_TERMINATE) { + ddxGiveUp(EXIT_NO_ERROR); + break; + } + + free(ConnectionInfo); + ConnectionInfo = NULL; + } + return 0; +} diff --git a/dix/globals.c b/dix/globals.c index 332b91f5c..82d0e5977 100644 --- a/dix/globals.c +++ b/dix/globals.c @@ -129,6 +129,7 @@ int monitorResolution = 0; char *display; int displayfd; +Bool explicit_display = FALSE; char *ConnectionInfo; CARD32 TimeOutValue = DEFAULT_TIMEOUT * MILLI_PER_SECOND; diff --git a/dix/main.c b/dix/main.c index fb935c969..ea6c6e0c8 100644 --- a/dix/main.c +++ b/dix/main.c @@ -1,377 +1,33 @@ /*********************************************************** -Copyright 1987, 1998 The Open Group +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: -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, 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 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 -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. +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. ******************************************************************/ -#ifdef HAVE_DIX_CONFIG_H -#include <dix-config.h> -#include <version-config.h> -#endif - -#include <X11/X.h> -#include <X11/Xos.h> /* for unistd.h */ -#include <X11/Xproto.h> -#include <pixman.h> -#include "scrnintstr.h" -#include "misc.h" -#include "os.h" -#include "windowstr.h" -#include "resource.h" -#include "dixstruct.h" -#include "gcstruct.h" -#include "extension.h" -#include "colormap.h" -#include "colormapst.h" -#include "cursorstr.h" -#include "selection.h" -#include <X11/fonts/font.h> -#include "opaque.h" -#include "servermd.h" -#include "hotplug.h" -#include "site.h" -#include "dixfont.h" -#include "extnsionst.h" -#include "privates.h" -#include "registry.h" -#include "client.h" -#include "exevents.h" -#ifdef PANORAMIX -#include "panoramiXsrv.h" -#else -#include "dixevents.h" /* InitEvents() */ -#endif - -#ifdef DPMSExtension -#include <X11/extensions/dpmsconst.h> -#include "dpmsproc.h" -#endif - -extern void Dispatch(void); - -#ifdef XQUARTZ -#include <pthread.h> - -BOOL serverRunning = FALSE; -pthread_mutex_t serverRunningMutex = PTHREAD_MUTEX_INITIALIZER; -pthread_cond_t serverRunningCond = PTHREAD_COND_INITIALIZER; - int dix_main(int argc, char *argv[], char *envp[]); -int -dix_main(int argc, char *argv[], char *envp[]) -#else +/* + A default implementation of main, which can be overridden by DDX + */ int main(int argc, char *argv[], char *envp[]) -#endif { - int i; - HWEventQueueType alwaysCheckForInput[2]; - - display = "0"; - - InitRegions(); - - CheckUserParameters(argc, argv, envp); - - CheckUserAuthorization(); - - InitConnectionLimits(); - - ProcessCommandLine(argc, argv); - - alwaysCheckForInput[0] = 0; - alwaysCheckForInput[1] = 1; - while (1) { - serverGeneration++; - ScreenSaverTime = defaultScreenSaverTime; - ScreenSaverInterval = defaultScreenSaverInterval; - ScreenSaverBlanking = defaultScreenSaverBlanking; - ScreenSaverAllowExposures = defaultScreenSaverAllowExposures; -#ifdef DPMSExtension - DPMSStandbyTime = DPMSSuspendTime = DPMSOffTime = ScreenSaverTime; - DPMSEnabled = TRUE; - DPMSPowerLevel = 0; -#endif - InitBlockAndWakeupHandlers(); - /* Perform any operating system dependent initializations you'd like */ - OsInit(); - if (serverGeneration == 1) { - CreateWellKnownSockets(); - for (i = 1; i < MAXCLIENTS; i++) - clients[i] = NullClient; - serverClient = calloc(sizeof(ClientRec), 1); - if (!serverClient) - FatalError("couldn't create server client"); - InitClient(serverClient, 0, (pointer) NULL); - } - else - ResetWellKnownSockets(); - clients[0] = serverClient; - currentMaxClients = 1; - - /* Initialize privates before first allocation */ - dixResetPrivates(); - - /* Initialize server client devPrivates, to be reallocated as - * more client privates are registered - */ - if (!dixAllocatePrivates(&serverClient->devPrivates, PRIVATE_CLIENT)) - FatalError("failed to create server client privates"); - - if (!InitClientResources(serverClient)) /* for root resources */ - FatalError("couldn't init server resources"); - - SetInputCheck(&alwaysCheckForInput[0], &alwaysCheckForInput[1]); - screenInfo.numScreens = 0; - - InitAtoms(); - InitEvents(); - InitSelections(); - InitGlyphCaching(); - dixResetRegistry(); - ResetFontPrivateIndex(); - InitCallbackManager(); - InitOutput(&screenInfo, argc, argv); - - if (screenInfo.numScreens < 1) - FatalError("no screens found"); - InitExtensions(argc, argv); - - for (i = 0; i < screenInfo.numGPUScreens; i++) { - ScreenPtr pScreen = screenInfo.gpuscreens[i]; - if (!CreateScratchPixmapsForScreen(pScreen)) - FatalError("failed to create scratch pixmaps"); - } - - for (i = 0; i < screenInfo.numScreens; i++) { - ScreenPtr pScreen = screenInfo.screens[i]; - - if (!CreateScratchPixmapsForScreen(pScreen)) - FatalError("failed to create scratch pixmaps"); - if (pScreen->CreateScreenResources && - !(*pScreen->CreateScreenResources) (pScreen)) - FatalError("failed to create screen resources"); - if (!CreateGCperDepth(i)) - FatalError("failed to create scratch GCs"); - if (!CreateDefaultStipple(i)) - FatalError("failed to create default stipple"); - if (!CreateRootWindow(pScreen)) - FatalError("failed to create root window"); - } - - InitFonts(); - if (SetDefaultFontPath(defaultFontPath) != Success) { - ErrorF("[dix] failed to set default font path '%s'", - defaultFontPath); - } - if (!SetDefaultFont(defaultTextFont)) { - FatalError("could not open default font '%s'", defaultTextFont); - } - - if (!(rootCursor = CreateRootCursor(NULL, 0))) { - FatalError("could not open default cursor font '%s'", - defaultCursorFont); - } - -#ifdef DPMSExtension - /* check all screens, looking for DPMS Capabilities */ - DPMSCapableFlag = DPMSSupported(); - if (!DPMSCapableFlag) - DPMSEnabled = FALSE; -#endif - -#ifdef PANORAMIX - /* - * Consolidate window and colourmap information for each screen - */ - if (!noPanoramiXExtension) - PanoramiXConsolidate(); -#endif - - for (i = 0; i < screenInfo.numScreens; i++) - InitRootWindow(screenInfo.screens[i]->root); - - InitCoreDevices(); - InitInput(argc, argv); - InitAndStartDevices(); - ReserveClientIds(serverClient); - - dixSaveScreens(serverClient, SCREEN_SAVER_FORCER, ScreenSaverReset); - -#ifdef PANORAMIX - if (!noPanoramiXExtension) { - if (!PanoramiXCreateConnectionBlock()) { - FatalError("could not create connection block info"); - } - } - else -#endif - { - if (!CreateConnectionBlock()) { - FatalError("could not create connection block info"); - } - } - -#ifdef XQUARTZ - /* Let the other threads know the server is done with its init */ - pthread_mutex_lock(&serverRunningMutex); - serverRunning = TRUE; - pthread_cond_broadcast(&serverRunningCond); - pthread_mutex_unlock(&serverRunningMutex); -#endif - - NotifyParentProcess(); - - Dispatch(); - -#ifdef XQUARTZ - /* Let the other threads know the server is no longer running */ - pthread_mutex_lock(&serverRunningMutex); - serverRunning = FALSE; - pthread_mutex_unlock(&serverRunningMutex); -#endif - - UndisplayDevices(); - DisableAllDevices(); - - /* Now free up whatever must be freed */ - if (screenIsSaved == SCREEN_SAVER_ON) - dixSaveScreens(serverClient, SCREEN_SAVER_OFF, ScreenSaverReset); - FreeScreenSaverTimer(); - CloseDownExtensions(); - -#ifdef PANORAMIX - { - Bool remember_it = noPanoramiXExtension; - - noPanoramiXExtension = TRUE; - FreeAllResources(); - noPanoramiXExtension = remember_it; - } -#else - FreeAllResources(); -#endif - - CloseInput(); - - for (i = 0; i < screenInfo.numScreens; i++) - screenInfo.screens[i]->root = NullWindow; - - CloseDownDevices(); - - CloseDownEvents(); - - for (i = screenInfo.numGPUScreens - 1; i >= 0; i--) { - ScreenPtr pScreen = screenInfo.gpuscreens[i]; - FreeScratchPixmapsForScreen(pScreen); - (*pScreen->CloseScreen) (pScreen); - dixFreePrivates(pScreen->devPrivates, PRIVATE_SCREEN); - free(pScreen); - screenInfo.numGPUScreens = i; - } - - for (i = screenInfo.numScreens - 1; i >= 0; i--) { - FreeScratchPixmapsForScreen(screenInfo.screens[i]); - FreeGCperDepth(i); - FreeDefaultStipple(i); - dixFreeScreenSpecificPrivates(screenInfo.screens[i]); - (*screenInfo.screens[i]->CloseScreen) (screenInfo.screens[i]); - dixFreePrivates(screenInfo.screens[i]->devPrivates, PRIVATE_SCREEN); - free(screenInfo.screens[i]); - screenInfo.numScreens = i; - } - - ReleaseClientIds(serverClient); - dixFreePrivates(serverClient->devPrivates, PRIVATE_CLIENT); - serverClient->devPrivates = NULL; - - FreeFonts(); - - FreeAuditTimer(); - - if (dispatchException & DE_TERMINATE) { - CloseWellKnownConnections(); - } - - OsCleanup((dispatchException & DE_TERMINATE) != 0); - - if (dispatchException & DE_TERMINATE) { - ddxGiveUp(EXIT_NO_ERROR); - break; - } - - free(ConnectionInfo); - ConnectionInfo = NULL; - } - return 0; + return dix_main(argc, argv, envp); } diff --git a/dix/window.c b/dix/window.c index a5b28a630..944e6174b 100644 --- a/dix/window.c +++ b/dix/window.c @@ -122,7 +122,6 @@ Equipment Corporation. #endif #include "dixevents.h" #include "globals.h" -#include "mi.h" /* miPaintWindow */ #ifdef COMPOSITE #include "compint.h" #endif @@ -1466,7 +1465,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client) RegionNull(&exposed); RegionSubtract(&exposed, &pWin->borderClip, &pWin->winSize); - miPaintWindow(pWin, &exposed, PW_BORDER); + (*pWin->drawable.pScreen->PaintWindow)(pWin, &exposed, PW_BORDER); RegionUninit(&exposed); } return error; diff --git a/glx/Makefile.am b/glx/Makefile.am index 591c4ac66..c699581e0 100644 --- a/glx/Makefile.am +++ b/glx/Makefile.am @@ -38,11 +38,8 @@ glapi_sources = \ indirect_table.c \ dispatch.h \ glapitable.h \ - glapi.c \ glapi.h \ glapi_gentable.c \ - glprocs.h \ - glthread.c \ glthread.h libglxdri_la_SOURCES = diff --git a/glx/glapi.c b/glx/glapi.c deleted file mode 100644 index ad7329eff..000000000 --- a/glx/glapi.c +++ /dev/null @@ -1,504 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2006 Brian Paul 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 - * BRIAN PAUL 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 manages the OpenGL API dispatch layer. There are functions - * to set/get the current dispatch table for the current thread and to - * manage registration/dispatch of dynamically added extension functions. - * - * This code was originally general enough to be shared with Mesa, but - * they diverged long ago, so this is now just enough support to make - * indirect GLX work. - */ - -#include <dix-config.h> -#include <X11/Xfuncproto.h> -#include <os.h> -#define PUBLIC _X_EXPORT - -#include <stdlib.h> -#include <string.h> -#ifdef DEBUG -#include <assert.h> -#endif - -#include "glapi.h" -#include "dispatch.h" -#include "glapitable.h" - -#define FIRST_DYNAMIC_OFFSET (sizeof(struct _glapi_table) / sizeof(void *)) - -#if defined(PTHREADS) || defined(GLX_USE_TLS) -static void init_glapi_relocs(void); -#endif - -/** - * \name Current dispatch and current context control variables - * - * Depending on whether or not multithreading is support, and the type of - * support available, several variables are used to store the current context - * pointer and the current dispatch table pointer. In the non-threaded case, - * the variables \c _glapi_Dispatch and \c _glapi_Context are used for this - * purpose. - * - * In the "normal" threaded case, the variables \c _glapi_Dispatch and - * \c _glapi_Context will be \c NULL if an application is detected as being - * multithreaded. Single-threaded applications will use \c _glapi_Dispatch - * and \c _glapi_Context just like the case without any threading support. - * When \c _glapi_Dispatch and \c _glapi_Context are \c NULL, the thread state - * data \c _gl_DispatchTSD and \c ContextTSD are used. Drivers and the - * static dispatch functions access these variables via \c _glapi_get_dispatch - * and \c _glapi_get_context. - * - * In the TLS case, the variables \c _glapi_Dispatch and \c _glapi_Context are - * hardcoded to \c NULL. Instead the TLS variables \c _glapi_tls_Dispatch and - * \c _glapi_tls_Context are used. Having \c _glapi_Dispatch and - * \c _glapi_Context be hardcoded to \c NULL maintains binary compatability - * between TLS enabled loaders and non-TLS DRI drivers. - */ -/*@{*/ -#if defined(GLX_USE_TLS) - -PUBLIC TLS struct _glapi_table *_glapi_tls_Dispatch = NULL; - -PUBLIC TLS void *_glapi_tls_Context; - -PUBLIC const struct _glapi_table *_glapi_Dispatch = NULL; -PUBLIC const void *_glapi_Context = NULL; - -#else - -#if defined(THREADS) - -_glthread_TSD _gl_DispatchTSD; /**< Per-thread dispatch pointer */ -static _glthread_TSD ContextTSD; /**< Per-thread context pointer */ - -#if defined(WIN32_THREADS) -void FreeTSD(_glthread_TSD * p); -void -FreeAllTSD(void) -{ - FreeTSD(&_gl_DispatchTSD); - FreeTSD(&ContextTSD); -} -#endif /* defined(WIN32_THREADS) */ - -#endif /* defined(THREADS) */ - -PUBLIC struct _glapi_table *_glapi_Dispatch = NULL; -PUBLIC void *_glapi_Context = NULL; - -#endif /* defined(GLX_USE_TLS) */ -/*@}*/ - -/* - * xserver's gl is not multithreaded, we promise. - */ -PUBLIC void -_glapi_check_multithread(void) -{ -} - -/** - * Set the current context pointer for this thread. - * The context pointer is an opaque type which should be cast to - * void from the real context pointer type. - */ -PUBLIC void -_glapi_set_context(void *context) -{ -#if defined(GLX_USE_TLS) - _glapi_tls_Context = context; -#elif defined(THREADS) - _glthread_SetTSD(&ContextTSD, context); - _glapi_Context = context; -#else - _glapi_Context = context; -#endif -} - -/** - * Get the current context pointer for this thread. - * The context pointer is an opaque type which should be cast from - * void to the real context pointer type. - */ -PUBLIC void * -_glapi_get_context(void) -{ -#if defined(GLX_USE_TLS) - return _glapi_tls_Context; -#else - return _glapi_Context; -#endif -} - -/** - * Set the global or per-thread dispatch table pointer. - */ -PUBLIC void -_glapi_set_dispatch(struct _glapi_table *dispatch) -{ -#if defined(PTHREADS) || defined(GLX_USE_TLS) - static pthread_once_t once_control = PTHREAD_ONCE_INIT; - - pthread_once(&once_control, init_glapi_relocs); -#endif - -#if defined(GLX_USE_TLS) - _glapi_tls_Dispatch = dispatch; -#elif defined(THREADS) - _glthread_SetTSD(&_gl_DispatchTSD, (void *) dispatch); - _glapi_Dispatch = dispatch; -#else /*THREADS*/ - _glapi_Dispatch = dispatch; -#endif /*THREADS*/ -} - -/** - * Return pointer to current dispatch table for calling thread. - */ -PUBLIC struct _glapi_table * -_glapi_get_dispatch(void) -{ - struct _glapi_table *api; - -#if defined(GLX_USE_TLS) - api = _glapi_tls_Dispatch; -#else - api = _glapi_Dispatch; -#endif - return api; -} - -/*** - *** The rest of this file is pretty much concerned with GetProcAddress - *** functionality. - ***/ - -#if defined(USE_X64_64_ASM) && defined(GLX_USE_TLS) -#define DISPATCH_FUNCTION_SIZE 16 -#elif defined(USE_X86_ASM) -#if defined(THREADS) && !defined(GLX_USE_TLS) -#define DISPATCH_FUNCTION_SIZE 32 -#else -#define DISPATCH_FUNCTION_SIZE 16 -#endif -#endif - -/* The code in this file is auto-generated with Python */ -#include "glprocs.h" - -/** - * Search the table of static entrypoint functions for the named function - * and return the corresponding glprocs_table_t entry. - */ -static const glprocs_table_t * -find_entry(const char *n) -{ - GLuint i; - - for (i = 0; static_functions[i].Name_offset >= 0; i++) { - const char *testName = - gl_string_table + static_functions[i].Name_offset; - if (strcmp(testName, n) == 0) { - return &static_functions[i]; - } - } - return NULL; -} - -/** - * Return dispatch table offset of the named static (built-in) function. - * Return -1 if function not found. - */ -static GLint -get_static_proc_offset(const char *funcName) -{ - const glprocs_table_t *const f = find_entry(funcName); - - if (f) { - return f->Offset; - } - return -1; -} - -/********************************************************************** - * Extension function management. - */ - -/* - * Number of extension functions which we can dynamically add at runtime. - */ -#define MAX_EXTENSION_FUNCS 300 - -/* - * The dispatch table size (number of entries) is the size of the - * _glapi_table struct plus the number of dynamic entries we can add. - * The extra slots can be filled in by DRI drivers that register new extension - * functions. - */ -#define DISPATCH_TABLE_SIZE (sizeof(struct _glapi_table) / sizeof(void *) + MAX_EXTENSION_FUNCS) - -/** - * Track information about a function added to the GL API. - */ -struct _glapi_function { - /** - * Name of the function. - */ - const char *name; - - /** - * Text string that describes the types of the parameters passed to the - * named function. Parameter types are converted to characters using the - * following rules: - * - 'i' for \c GLint, \c GLuint, and \c GLenum - * - 'p' for any pointer type - * - 'f' for \c GLfloat and \c GLclampf - * - 'd' for \c GLdouble and \c GLclampd - */ - const char *parameter_signature; - - /** - * Offset in the dispatch table where the pointer to the real function is - * located. If the driver has not requested that the named function be - * added to the dispatch table, this will have the value ~0. - */ - unsigned dispatch_offset; -}; - -static struct _glapi_function ExtEntryTable[MAX_EXTENSION_FUNCS]; -static GLuint NumExtEntryPoints = 0; - -/** - * Generate new entrypoint - * - * Use a temporary dispatch offset of ~0 (i.e. -1). Later, when the driver - * calls \c _glapi_add_dispatch we'll put in the proper offset. If that - * never happens, and the user calls this function, he'll segfault. That's - * what you get when you try calling a GL function that doesn't really exist. - * - * \param funcName Name of the function to create an entry-point for. - * - * \sa _glapi_add_entrypoint - */ - -static struct _glapi_function * -add_function_name(const char *funcName) -{ - struct _glapi_function *entry = NULL; - - if (NumExtEntryPoints < MAX_EXTENSION_FUNCS) { - entry = &ExtEntryTable[NumExtEntryPoints]; - - ExtEntryTable[NumExtEntryPoints].name = strdup(funcName); - ExtEntryTable[NumExtEntryPoints].parameter_signature = NULL; - ExtEntryTable[NumExtEntryPoints].dispatch_offset = ~0; - NumExtEntryPoints++; - } - - return entry; -} - -/** - * Fill-in the dispatch stub for the named function. - * - * This function is intended to be called by a hardware driver. When called, - * a dispatch stub may be created created for the function. A pointer to this - * dispatch function will be returned by glXGetProcAddress. - * - * \param function_names Array of pointers to function names that should - * share a common dispatch offset. - * \param parameter_signature String representing the types of the parameters - * passed to the named function. Parameter types - * are converted to characters using the following - * rules: - * - 'i' for \c GLint, \c GLuint, and \c GLenum - * - 'p' for any pointer type - * - 'f' for \c GLfloat and \c GLclampf - * - 'd' for \c GLdouble and \c GLclampd - * - * \returns - * The offset in the dispatch table of the named function. A pointer to the - * driver's implementation of the named function should be stored at - * \c dispatch_table[\c offset]. - * - * \sa glXGetProcAddress - * - * \warning - * This function can only handle up to 8 names at a time. As far as I know, - * the maximum number of names ever associated with an existing GL function is - * 4 (\c glPointParameterfSGIS, \c glPointParameterfEXT, - * \c glPointParameterfARB, and \c glPointParameterf), so this should not be - * too painful of a limitation. - * - * \todo - * Determine whether or not \c parameter_signature should be allowed to be - * \c NULL. It doesn't seem like much of a hardship for drivers to have to - * pass in an empty string. - * - * \todo - * Determine if code should be added to reject function names that start with - * 'glX'. - * - * \bug - * Add code to compare \c parameter_signature with the parameter signature of - * a static function. In order to do that, we need to find a way to \b get - * the parameter signature of a static function. - */ - -PUBLIC int -_glapi_add_dispatch(const char *const *function_names, - const char *parameter_signature) -{ - static int next_dynamic_offset = FIRST_DYNAMIC_OFFSET; - const char *const real_sig = (parameter_signature != NULL) - ? parameter_signature : ""; - struct _glapi_function *entry[8]; - GLboolean is_static[8]; - unsigned i; - unsigned j; - int offset = ~0; - int new_offset; - - (void) memset(is_static, 0, sizeof(is_static)); - (void) memset(entry, 0, sizeof(entry)); - - for (i = 0; function_names[i] != NULL; i++) { - /* Do some trivial validation on the name of the function. */ - - if (function_names[i][0] != 'g' || function_names[i][1] != 'l') - return GL_FALSE; - - /* Determine if the named function already exists. If the function does - * exist, it must have the same parameter signature as the function - * being added. - */ - - new_offset = get_static_proc_offset(function_names[i]); - if (new_offset >= 0) { - /* FIXME: Make sure the parameter signatures match! How do we get - * FIXME: the parameter signature for static functions? - */ - - if ((offset != ~0) && (new_offset != offset)) { - return -1; - } - - is_static[i] = GL_TRUE; - offset = new_offset; - } - - for (j = 0; j < NumExtEntryPoints; j++) { - if (strcmp(ExtEntryTable[j].name, function_names[i]) == 0) { - /* The offset may be ~0 if the function name was added by - * glXGetProcAddress but never filled in by the driver. - */ - - if (ExtEntryTable[j].dispatch_offset != ~0) { - if (strcmp(real_sig, ExtEntryTable[j].parameter_signature) - != 0) - return -1; - - if ((offset != ~0) && - (ExtEntryTable[j].dispatch_offset != offset)) { - return -1; - } - - offset = ExtEntryTable[j].dispatch_offset; - } - - entry[i] = &ExtEntryTable[j]; - break; - } - } - } - - if (offset == ~0) { - offset = next_dynamic_offset; - next_dynamic_offset++; - } - - for (i = 0; function_names[i] != NULL; i++) { - if (!is_static[i]) { - if (entry[i] == NULL) { - entry[i] = add_function_name(function_names[i]); - if (entry[i] == NULL) - return -1; - } - - entry[i]->parameter_signature = strdup(real_sig); - entry[i]->dispatch_offset = offset; - } - } - - return offset; -} - -/* - * glXGetProcAddress doesn't exist in the protocol, the drivers never call - * this themselves, and neither does the server. warn if it happens though. - */ -PUBLIC _glapi_proc -_glapi_get_proc_address(const char *funcName) -{ - ErrorF("_glapi_get_proc_address called!\n"); - return NULL; -} - -/** - * Return size of dispatch table struct as number of functions (or - * slots). - */ -PUBLIC GLuint -_glapi_get_dispatch_table_size(void) -{ - return DISPATCH_TABLE_SIZE; -} - -#if defined(PTHREADS) || defined(GLX_USE_TLS) -/** - * Perform platform-specific GL API entry-point fixups. - */ -static void -init_glapi_relocs(void) -{ -#if defined(USE_X86_ASM) && defined(GLX_USE_TLS) && !defined(GLX_X86_READONLY_TEXT) - extern unsigned long _x86_get_dispatch(void); - - char run_time_patch[] = { - 0x65, 0xa1, 0, 0, 0, 0 /* movl %gs:0,%eax */ - }; - GLuint *offset = (GLuint *) &run_time_patch[2]; /* 32-bits for x86/32 */ - const GLubyte *const get_disp = (const GLubyte *) run_time_patch; - GLubyte *curr_func = (GLubyte *) gl_dispatch_functions_start; - - *offset = _x86_get_dispatch(); - while (curr_func != (GLubyte *) gl_dispatch_functions_end) { - (void) memcpy(curr_func, get_disp, sizeof(run_time_patch)); - curr_func += DISPATCH_FUNCTION_SIZE; - } -#endif -} -#endif /* defined(PTHREADS) || defined(GLX_USE_TLS) */ diff --git a/glx/glprocs.h b/glx/glprocs.h deleted file mode 100644 index 87063642c..000000000 --- a/glx/glprocs.h +++ /dev/null @@ -1,3534 +0,0 @@ -/* DO NOT EDIT - This file generated automatically by gl_procs.py (from Mesa) script */ - -/* - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. - * (C) Copyright IBM Corporation 2004, 2006 - * 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 - * BRIAN PAUL, IBM, - * AND/OR THEIR 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. - */ - -/* This file is only included by glapi.c and is used for - * the GetProcAddress() function - */ - -typedef struct { - GLint Name_offset; -#if defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING) - _glapi_proc Address; -#endif - GLuint Offset; -} glprocs_table_t; - -#if !defined(NEED_FUNCTION_POINTER) && !defined(GLX_INDIRECT_RENDERING) -#define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , o } -#elif defined(NEED_FUNCTION_POINTER) && !defined(GLX_INDIRECT_RENDERING) -#define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , (_glapi_proc) f1 , o } -#elif defined(NEED_FUNCTION_POINTER) && defined(GLX_INDIRECT_RENDERING) -#define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , (_glapi_proc) f2 , o } -#elif !defined(NEED_FUNCTION_POINTER) && defined(GLX_INDIRECT_RENDERING) -#define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , (_glapi_proc) f3 , o } -#endif - -static const char gl_string_table[] = - "glNewList\0" - "glEndList\0" - "glCallList\0" - "glCallLists\0" - "glDeleteLists\0" - "glGenLists\0" - "glListBase\0" - "glBegin\0" - "glBitmap\0" - "glColor3b\0" - "glColor3bv\0" - "glColor3d\0" - "glColor3dv\0" - "glColor3f\0" - "glColor3fv\0" - "glColor3i\0" - "glColor3iv\0" - "glColor3s\0" - "glColor3sv\0" - "glColor3ub\0" - "glColor3ubv\0" - "glColor3ui\0" - "glColor3uiv\0" - "glColor3us\0" - "glColor3usv\0" - "glColor4b\0" - "glColor4bv\0" - "glColor4d\0" - "glColor4dv\0" - "glColor4f\0" - "glColor4fv\0" - "glColor4i\0" - "glColor4iv\0" - "glColor4s\0" - "glColor4sv\0" - "glColor4ub\0" - "glColor4ubv\0" - "glColor4ui\0" - "glColor4uiv\0" - "glColor4us\0" - "glColor4usv\0" - "glEdgeFlag\0" - "glEdgeFlagv\0" - "glEnd\0" - "glIndexd\0" - "glIndexdv\0" - "glIndexf\0" - "glIndexfv\0" - "glIndexi\0" - "glIndexiv\0" - "glIndexs\0" - "glIndexsv\0" - "glNormal3b\0" - "glNormal3bv\0" - "glNormal3d\0" - "glNormal3dv\0" - "glNormal3f\0" - "glNormal3fv\0" - "glNormal3i\0" - "glNormal3iv\0" - "glNormal3s\0" - "glNormal3sv\0" - "glRasterPos2d\0" - "glRasterPos2dv\0" - "glRasterPos2f\0" - "glRasterPos2fv\0" - "glRasterPos2i\0" - "glRasterPos2iv\0" - "glRasterPos2s\0" - "glRasterPos2sv\0" - "glRasterPos3d\0" - "glRasterPos3dv\0" - "glRasterPos3f\0" - "glRasterPos3fv\0" - "glRasterPos3i\0" - "glRasterPos3iv\0" - "glRasterPos3s\0" - "glRasterPos3sv\0" - "glRasterPos4d\0" - "glRasterPos4dv\0" - "glRasterPos4f\0" - "glRasterPos4fv\0" - "glRasterPos4i\0" - "glRasterPos4iv\0" - "glRasterPos4s\0" - "glRasterPos4sv\0" - "glRectd\0" - "glRectdv\0" - "glRectf\0" - "glRectfv\0" - "glRecti\0" - "glRectiv\0" - "glRects\0" - "glRectsv\0" - "glTexCoord1d\0" - "glTexCoord1dv\0" - "glTexCoord1f\0" - "glTexCoord1fv\0" - "glTexCoord1i\0" - "glTexCoord1iv\0" - "glTexCoord1s\0" - "glTexCoord1sv\0" - "glTexCoord2d\0" - "glTexCoord2dv\0" - "glTexCoord2f\0" - "glTexCoord2fv\0" - "glTexCoord2i\0" - "glTexCoord2iv\0" - "glTexCoord2s\0" - "glTexCoord2sv\0" - "glTexCoord3d\0" - "glTexCoord3dv\0" - "glTexCoord3f\0" - "glTexCoord3fv\0" - "glTexCoord3i\0" - "glTexCoord3iv\0" - "glTexCoord3s\0" - "glTexCoord3sv\0" - "glTexCoord4d\0" - "glTexCoord4dv\0" - "glTexCoord4f\0" - "glTexCoord4fv\0" - "glTexCoord4i\0" - "glTexCoord4iv\0" - "glTexCoord4s\0" - "glTexCoord4sv\0" - "glVertex2d\0" - "glVertex2dv\0" - "glVertex2f\0" - "glVertex2fv\0" - "glVertex2i\0" - "glVertex2iv\0" - "glVertex2s\0" - "glVertex2sv\0" - "glVertex3d\0" - "glVertex3dv\0" - "glVertex3f\0" - "glVertex3fv\0" - "glVertex3i\0" - "glVertex3iv\0" - "glVertex3s\0" - "glVertex3sv\0" - "glVertex4d\0" - "glVertex4dv\0" - "glVertex4f\0" - "glVertex4fv\0" - "glVertex4i\0" - "glVertex4iv\0" - "glVertex4s\0" - "glVertex4sv\0" - "glClipPlane\0" - "glColorMaterial\0" - "glCullFace\0" - "glFogf\0" - "glFogfv\0" - "glFogi\0" - "glFogiv\0" - "glFrontFace\0" - "glHint\0" - "glLightf\0" - "glLightfv\0" - "glLighti\0" - "glLightiv\0" - "glLightModelf\0" - "glLightModelfv\0" - "glLightModeli\0" - "glLightModeliv\0" - "glLineStipple\0" - "glLineWidth\0" - "glMaterialf\0" - "glMaterialfv\0" - "glMateriali\0" - "glMaterialiv\0" - "glPointSize\0" - "glPolygonMode\0" - "glPolygonStipple\0" - "glScissor\0" - "glShadeModel\0" - "glTexParameterf\0" - "glTexParameterfv\0" - "glTexParameteri\0" - "glTexParameteriv\0" - "glTexImage1D\0" - "glTexImage2D\0" - "glTexEnvf\0" - "glTexEnvfv\0" - "glTexEnvi\0" - "glTexEnviv\0" - "glTexGend\0" - "glTexGendv\0" - "glTexGenf\0" - "glTexGenfv\0" - "glTexGeni\0" - "glTexGeniv\0" - "glFeedbackBuffer\0" - "glSelectBuffer\0" - "glRenderMode\0" - "glInitNames\0" - "glLoadName\0" - "glPassThrough\0" - "glPopName\0" - "glPushName\0" - "glDrawBuffer\0" - "glClear\0" - "glClearAccum\0" - "glClearIndex\0" - "glClearColor\0" - "glClearStencil\0" - "glClearDepth\0" - "glStencilMask\0" - "glColorMask\0" - "glDepthMask\0" - "glIndexMask\0" - "glAccum\0" - "glDisable\0" - "glEnable\0" - "glFinish\0" - "glFlush\0" - "glPopAttrib\0" - "glPushAttrib\0" - "glMap1d\0" - "glMap1f\0" - "glMap2d\0" - "glMap2f\0" - "glMapGrid1d\0" - "glMapGrid1f\0" - "glMapGrid2d\0" - "glMapGrid2f\0" - "glEvalCoord1d\0" - "glEvalCoord1dv\0" - "glEvalCoord1f\0" - "glEvalCoord1fv\0" - "glEvalCoord2d\0" - "glEvalCoord2dv\0" - "glEvalCoord2f\0" - "glEvalCoord2fv\0" - "glEvalMesh1\0" - "glEvalPoint1\0" - "glEvalMesh2\0" - "glEvalPoint2\0" - "glAlphaFunc\0" - "glBlendFunc\0" - "glLogicOp\0" - "glStencilFunc\0" - "glStencilOp\0" - "glDepthFunc\0" - "glPixelZoom\0" - "glPixelTransferf\0" - "glPixelTransferi\0" - "glPixelStoref\0" - "glPixelStorei\0" - "glPixelMapfv\0" - "glPixelMapuiv\0" - "glPixelMapusv\0" - "glReadBuffer\0" - "glCopyPixels\0" - "glReadPixels\0" - "glDrawPixels\0" - "glGetBooleanv\0" - "glGetClipPlane\0" - "glGetDoublev\0" - "glGetError\0" - "glGetFloatv\0" - "glGetIntegerv\0" - "glGetLightfv\0" - "glGetLightiv\0" - "glGetMapdv\0" - "glGetMapfv\0" - "glGetMapiv\0" - "glGetMaterialfv\0" - "glGetMaterialiv\0" - "glGetPixelMapfv\0" - "glGetPixelMapuiv\0" - "glGetPixelMapusv\0" - "glGetPolygonStipple\0" - "glGetString\0" - "glGetTexEnvfv\0" - "glGetTexEnviv\0" - "glGetTexGendv\0" - "glGetTexGenfv\0" - "glGetTexGeniv\0" - "glGetTexImage\0" - "glGetTexParameterfv\0" - "glGetTexParameteriv\0" - "glGetTexLevelParameterfv\0" - "glGetTexLevelParameteriv\0" - "glIsEnabled\0" - "glIsList\0" - "glDepthRange\0" - "glFrustum\0" - "glLoadIdentity\0" - "glLoadMatrixf\0" - "glLoadMatrixd\0" - "glMatrixMode\0" - "glMultMatrixf\0" - "glMultMatrixd\0" - "glOrtho\0" - "glPopMatrix\0" - "glPushMatrix\0" - "glRotated\0" - "glRotatef\0" - "glScaled\0" - "glScalef\0" - "glTranslated\0" - "glTranslatef\0" - "glViewport\0" - "glArrayElement\0" - "glBindTexture\0" - "glColorPointer\0" - "glDisableClientState\0" - "glDrawArrays\0" - "glDrawElements\0" - "glEdgeFlagPointer\0" - "glEnableClientState\0" - "glIndexPointer\0" - "glIndexub\0" - "glIndexubv\0" - "glInterleavedArrays\0" - "glNormalPointer\0" - "glPolygonOffset\0" - "glTexCoordPointer\0" - "glVertexPointer\0" - "glAreTexturesResident\0" - "glCopyTexImage1D\0" - "glCopyTexImage2D\0" - "glCopyTexSubImage1D\0" - "glCopyTexSubImage2D\0" - "glDeleteTextures\0" - "glGenTextures\0" - "glGetPointerv\0" - "glIsTexture\0" - "glPrioritizeTextures\0" - "glTexSubImage1D\0" - "glTexSubImage2D\0" - "glPopClientAttrib\0" - "glPushClientAttrib\0" - "glBlendColor\0" - "glBlendEquation\0" - "glDrawRangeElements\0" - "glColorTable\0" - "glColorTableParameterfv\0" - "glColorTableParameteriv\0" - "glCopyColorTable\0" - "glGetColorTable\0" - "glGetColorTableParameterfv\0" - "glGetColorTableParameteriv\0" - "glColorSubTable\0" - "glCopyColorSubTable\0" - "glConvolutionFilter1D\0" - "glConvolutionFilter2D\0" - "glConvolutionParameterf\0" - "glConvolutionParameterfv\0" - "glConvolutionParameteri\0" - "glConvolutionParameteriv\0" - "glCopyConvolutionFilter1D\0" - "glCopyConvolutionFilter2D\0" - "glGetConvolutionFilter\0" - "glGetConvolutionParameterfv\0" - "glGetConvolutionParameteriv\0" - "glGetSeparableFilter\0" - "glSeparableFilter2D\0" - "glGetHistogram\0" - "glGetHistogramParameterfv\0" - "glGetHistogramParameteriv\0" - "glGetMinmax\0" - "glGetMinmaxParameterfv\0" - "glGetMinmaxParameteriv\0" - "glHistogram\0" - "glMinmax\0" - "glResetHistogram\0" - "glResetMinmax\0" - "glTexImage3D\0" - "glTexSubImage3D\0" - "glCopyTexSubImage3D\0" - "glActiveTextureARB\0" - "glClientActiveTextureARB\0" - "glMultiTexCoord1dARB\0" - "glMultiTexCoord1dvARB\0" - "glMultiTexCoord1fARB\0" - "glMultiTexCoord1fvARB\0" - "glMultiTexCoord1iARB\0" - "glMultiTexCoord1ivARB\0" - "glMultiTexCoord1sARB\0" - "glMultiTexCoord1svARB\0" - "glMultiTexCoord2dARB\0" - "glMultiTexCoord2dvARB\0" - "glMultiTexCoord2fARB\0" - "glMultiTexCoord2fvARB\0" - "glMultiTexCoord2iARB\0" - "glMultiTexCoord2ivARB\0" - "glMultiTexCoord2sARB\0" - "glMultiTexCoord2svARB\0" - "glMultiTexCoord3dARB\0" - "glMultiTexCoord3dvARB\0" - "glMultiTexCoord3fARB\0" - "glMultiTexCoord3fvARB\0" - "glMultiTexCoord3iARB\0" - "glMultiTexCoord3ivARB\0" - "glMultiTexCoord3sARB\0" - "glMultiTexCoord3svARB\0" - "glMultiTexCoord4dARB\0" - "glMultiTexCoord4dvARB\0" - "glMultiTexCoord4fARB\0" - "glMultiTexCoord4fvARB\0" - "glMultiTexCoord4iARB\0" - "glMultiTexCoord4ivARB\0" - "glMultiTexCoord4sARB\0" - "glMultiTexCoord4svARB\0" - "glAttachShader\0" - "glCreateProgram\0" - "glCreateShader\0" - "glDeleteProgram\0" - "glDeleteShader\0" - "glDetachShader\0" - "glGetAttachedShaders\0" - "glGetProgramInfoLog\0" - "glGetProgramiv\0" - "glGetShaderInfoLog\0" - "glGetShaderiv\0" - "glIsProgram\0" - "glIsShader\0" - "glStencilFuncSeparate\0" - "glStencilMaskSeparate\0" - "glStencilOpSeparate\0" - "glUniformMatrix2x3fv\0" - "glUniformMatrix2x4fv\0" - "glUniformMatrix3x2fv\0" - "glUniformMatrix3x4fv\0" - "glUniformMatrix4x2fv\0" - "glUniformMatrix4x3fv\0" - "glClampColor\0" - "glClearBufferfi\0" - "glClearBufferfv\0" - "glClearBufferiv\0" - "glClearBufferuiv\0" - "glGetStringi\0" - "glTexBuffer\0" - "glFramebufferTexture\0" - "glGetBufferParameteri64v\0" - "glGetInteger64i_v\0" - "glVertexAttribDivisor\0" - "glLoadTransposeMatrixdARB\0" - "glLoadTransposeMatrixfARB\0" - "glMultTransposeMatrixdARB\0" - "glMultTransposeMatrixfARB\0" - "glSampleCoverageARB\0" - "glCompressedTexImage1DARB\0" - "glCompressedTexImage2DARB\0" - "glCompressedTexImage3DARB\0" - "glCompressedTexSubImage1DARB\0" - "glCompressedTexSubImage2DARB\0" - "glCompressedTexSubImage3DARB\0" - "glGetCompressedTexImageARB\0" - "glDisableVertexAttribArrayARB\0" - "glEnableVertexAttribArrayARB\0" - "glGetProgramEnvParameterdvARB\0" - "glGetProgramEnvParameterfvARB\0" - "glGetProgramLocalParameterdvARB\0" - "glGetProgramLocalParameterfvARB\0" - "glGetProgramStringARB\0" - "glGetProgramivARB\0" - "glGetVertexAttribdvARB\0" - "glGetVertexAttribfvARB\0" - "glGetVertexAttribivARB\0" - "glProgramEnvParameter4dARB\0" - "glProgramEnvParameter4dvARB\0" - "glProgramEnvParameter4fARB\0" - "glProgramEnvParameter4fvARB\0" - "glProgramLocalParameter4dARB\0" - "glProgramLocalParameter4dvARB\0" - "glProgramLocalParameter4fARB\0" - "glProgramLocalParameter4fvARB\0" - "glProgramStringARB\0" - "glVertexAttrib1dARB\0" - "glVertexAttrib1dvARB\0" - "glVertexAttrib1fARB\0" - "glVertexAttrib1fvARB\0" - "glVertexAttrib1sARB\0" - "glVertexAttrib1svARB\0" - "glVertexAttrib2dARB\0" - "glVertexAttrib2dvARB\0" - "glVertexAttrib2fARB\0" - "glVertexAttrib2fvARB\0" - "glVertexAttrib2sARB\0" - "glVertexAttrib2svARB\0" - "glVertexAttrib3dARB\0" - "glVertexAttrib3dvARB\0" - "glVertexAttrib3fARB\0" - "glVertexAttrib3fvARB\0" - "glVertexAttrib3sARB\0" - "glVertexAttrib3svARB\0" - "glVertexAttrib4NbvARB\0" - "glVertexAttrib4NivARB\0" - "glVertexAttrib4NsvARB\0" - "glVertexAttrib4NubARB\0" - "glVertexAttrib4NubvARB\0" - "glVertexAttrib4NuivARB\0" - "glVertexAttrib4NusvARB\0" - "glVertexAttrib4bvARB\0" - "glVertexAttrib4dARB\0" - "glVertexAttrib4dvARB\0" - "glVertexAttrib4fARB\0" - "glVertexAttrib4fvARB\0" - "glVertexAttrib4ivARB\0" - "glVertexAttrib4sARB\0" - "glVertexAttrib4svARB\0" - "glVertexAttrib4ubvARB\0" - "glVertexAttrib4uivARB\0" - "glVertexAttrib4usvARB\0" - "glVertexAttribPointerARB\0" - "glBindBufferARB\0" - "glBufferDataARB\0" - "glBufferSubDataARB\0" - "glDeleteBuffersARB\0" - "glGenBuffersARB\0" - "glGetBufferParameterivARB\0" - "glGetBufferPointervARB\0" - "glGetBufferSubDataARB\0" - "glIsBufferARB\0" - "glMapBufferARB\0" - "glUnmapBufferARB\0" - "glBeginQueryARB\0" - "glDeleteQueriesARB\0" - "glEndQueryARB\0" - "glGenQueriesARB\0" - "glGetQueryObjectivARB\0" - "glGetQueryObjectuivARB\0" - "glGetQueryivARB\0" - "glIsQueryARB\0" - "glAttachObjectARB\0" - "glCompileShaderARB\0" - "glCreateProgramObjectARB\0" - "glCreateShaderObjectARB\0" - "glDeleteObjectARB\0" - "glDetachObjectARB\0" - "glGetActiveUniformARB\0" - "glGetAttachedObjectsARB\0" - "glGetHandleARB\0" - "glGetInfoLogARB\0" - "glGetObjectParameterfvARB\0" - "glGetObjectParameterivARB\0" - "glGetShaderSourceARB\0" - "glGetUniformLocationARB\0" - "glGetUniformfvARB\0" - "glGetUniformivARB\0" - "glLinkProgramARB\0" - "glShaderSourceARB\0" - "glUniform1fARB\0" - "glUniform1fvARB\0" - "glUniform1iARB\0" - "glUniform1ivARB\0" - "glUniform2fARB\0" - "glUniform2fvARB\0" - "glUniform2iARB\0" - "glUniform2ivARB\0" - "glUniform3fARB\0" - "glUniform3fvARB\0" - "glUniform3iARB\0" - "glUniform3ivARB\0" - "glUniform4fARB\0" - "glUniform4fvARB\0" - "glUniform4iARB\0" - "glUniform4ivARB\0" - "glUniformMatrix2fvARB\0" - "glUniformMatrix3fvARB\0" - "glUniformMatrix4fvARB\0" - "glUseProgramObjectARB\0" - "glValidateProgramARB\0" - "glBindAttribLocationARB\0" - "glGetActiveAttribARB\0" - "glGetAttribLocationARB\0" - "glDrawBuffersARB\0" - "glClampColorARB\0" - "glDrawArraysInstancedARB\0" - "glDrawElementsInstancedARB\0" - "glRenderbufferStorageMultisample\0" - "glFramebufferTextureARB\0" - "glFramebufferTextureFaceARB\0" - "glProgramParameteriARB\0" - "glVertexAttribDivisorARB\0" - "glFlushMappedBufferRange\0" - "glMapBufferRange\0" - "glTexBufferARB\0" - "glBindVertexArray\0" - "glGenVertexArrays\0" - "glCopyBufferSubData\0" - "glClientWaitSync\0" - "glDeleteSync\0" - "glFenceSync\0" - "glGetInteger64v\0" - "glGetSynciv\0" - "glIsSync\0" - "glWaitSync\0" - "glDrawElementsBaseVertex\0" - "glDrawElementsInstancedBaseVertex\0" - "glDrawRangeElementsBaseVertex\0" - "glMultiDrawElementsBaseVertex\0" - "glBlendEquationSeparateiARB\0" - "glBlendEquationiARB\0" - "glBlendFuncSeparateiARB\0" - "glBlendFunciARB\0" - "glBindSampler\0" - "glDeleteSamplers\0" - "glGenSamplers\0" - "glGetSamplerParameterIiv\0" - "glGetSamplerParameterIuiv\0" - "glGetSamplerParameterfv\0" - "glGetSamplerParameteriv\0" - "glIsSampler\0" - "glSamplerParameterIiv\0" - "glSamplerParameterIuiv\0" - "glSamplerParameterf\0" - "glSamplerParameterfv\0" - "glSamplerParameteri\0" - "glSamplerParameteriv\0" - "glColorP3ui\0" - "glColorP3uiv\0" - "glColorP4ui\0" - "glColorP4uiv\0" - "glMultiTexCoordP1ui\0" - "glMultiTexCoordP1uiv\0" - "glMultiTexCoordP2ui\0" - "glMultiTexCoordP2uiv\0" - "glMultiTexCoordP3ui\0" - "glMultiTexCoordP3uiv\0" - "glMultiTexCoordP4ui\0" - "glMultiTexCoordP4uiv\0" - "glNormalP3ui\0" - "glNormalP3uiv\0" - "glSecondaryColorP3ui\0" - "glSecondaryColorP3uiv\0" - "glTexCoordP1ui\0" - "glTexCoordP1uiv\0" - "glTexCoordP2ui\0" - "glTexCoordP2uiv\0" - "glTexCoordP3ui\0" - "glTexCoordP3uiv\0" - "glTexCoordP4ui\0" - "glTexCoordP4uiv\0" - "glVertexAttribP1ui\0" - "glVertexAttribP1uiv\0" - "glVertexAttribP2ui\0" - "glVertexAttribP2uiv\0" - "glVertexAttribP3ui\0" - "glVertexAttribP3uiv\0" - "glVertexAttribP4ui\0" - "glVertexAttribP4uiv\0" - "glVertexP2ui\0" - "glVertexP2uiv\0" - "glVertexP3ui\0" - "glVertexP3uiv\0" - "glVertexP4ui\0" - "glVertexP4uiv\0" - "glBindTransformFeedback\0" - "glDeleteTransformFeedbacks\0" - "glDrawTransformFeedback\0" - "glGenTransformFeedbacks\0" - "glIsTransformFeedback\0" - "glPauseTransformFeedback\0" - "glResumeTransformFeedback\0" - "glClearDepthf\0" - "glDepthRangef\0" - "glGetShaderPrecisionFormat\0" - "glReleaseShaderCompiler\0" - "glShaderBinary\0" - "glGetGraphicsResetStatusARB\0" - "glGetnColorTableARB\0" - "glGetnCompressedTexImageARB\0" - "glGetnConvolutionFilterARB\0" - "glGetnHistogramARB\0" - "glGetnMapdvARB\0" - "glGetnMapfvARB\0" - "glGetnMapivARB\0" - "glGetnMinmaxARB\0" - "glGetnPixelMapfvARB\0" - "glGetnPixelMapuivARB\0" - "glGetnPixelMapusvARB\0" - "glGetnPolygonStippleARB\0" - "glGetnSeparableFilterARB\0" - "glGetnTexImageARB\0" - "glGetnUniformdvARB\0" - "glGetnUniformfvARB\0" - "glGetnUniformivARB\0" - "glGetnUniformuivARB\0" - "glReadnPixelsARB\0" - "glTexStorage1D\0" - "glTexStorage2D\0" - "glTexStorage3D\0" - "glTextureStorage1DEXT\0" - "glTextureStorage2DEXT\0" - "glTextureStorage3DEXT\0" - "glPolygonOffsetEXT\0" - "glGetPixelTexGenParameterfvSGIS\0" - "glGetPixelTexGenParameterivSGIS\0" - "glPixelTexGenParameterfSGIS\0" - "glPixelTexGenParameterfvSGIS\0" - "glPixelTexGenParameteriSGIS\0" - "glPixelTexGenParameterivSGIS\0" - "glSampleMaskSGIS\0" - "glSamplePatternSGIS\0" - "glColorPointerEXT\0" - "glEdgeFlagPointerEXT\0" - "glIndexPointerEXT\0" - "glNormalPointerEXT\0" - "glTexCoordPointerEXT\0" - "glVertexPointerEXT\0" - "glPointParameterfEXT\0" - "glPointParameterfvEXT\0" - "glLockArraysEXT\0" - "glUnlockArraysEXT\0" - "glSecondaryColor3bEXT\0" - "glSecondaryColor3bvEXT\0" - "glSecondaryColor3dEXT\0" - "glSecondaryColor3dvEXT\0" - "glSecondaryColor3fEXT\0" - "glSecondaryColor3fvEXT\0" - "glSecondaryColor3iEXT\0" - "glSecondaryColor3ivEXT\0" - "glSecondaryColor3sEXT\0" - "glSecondaryColor3svEXT\0" - "glSecondaryColor3ubEXT\0" - "glSecondaryColor3ubvEXT\0" - "glSecondaryColor3uiEXT\0" - "glSecondaryColor3uivEXT\0" - "glSecondaryColor3usEXT\0" - "glSecondaryColor3usvEXT\0" - "glSecondaryColorPointerEXT\0" - "glMultiDrawArraysEXT\0" - "glMultiDrawElementsEXT\0" - "glFogCoordPointerEXT\0" - "glFogCoorddEXT\0" - "glFogCoorddvEXT\0" - "glFogCoordfEXT\0" - "glFogCoordfvEXT\0" - "glPixelTexGenSGIX\0" - "glBlendFuncSeparateEXT\0" - "glFlushVertexArrayRangeNV\0" - "glVertexArrayRangeNV\0" - "glCombinerInputNV\0" - "glCombinerOutputNV\0" - "glCombinerParameterfNV\0" - "glCombinerParameterfvNV\0" - "glCombinerParameteriNV\0" - "glCombinerParameterivNV\0" - "glFinalCombinerInputNV\0" - "glGetCombinerInputParameterfvNV\0" - "glGetCombinerInputParameterivNV\0" - "glGetCombinerOutputParameterfvNV\0" - "glGetCombinerOutputParameterivNV\0" - "glGetFinalCombinerInputParameterfvNV\0" - "glGetFinalCombinerInputParameterivNV\0" - "glResizeBuffersMESA\0" - "glWindowPos2dMESA\0" - "glWindowPos2dvMESA\0" - "glWindowPos2fMESA\0" - "glWindowPos2fvMESA\0" - "glWindowPos2iMESA\0" - "glWindowPos2ivMESA\0" - "glWindowPos2sMESA\0" - "glWindowPos2svMESA\0" - "glWindowPos3dMESA\0" - "glWindowPos3dvMESA\0" - "glWindowPos3fMESA\0" - "glWindowPos3fvMESA\0" - "glWindowPos3iMESA\0" - "glWindowPos3ivMESA\0" - "glWindowPos3sMESA\0" - "glWindowPos3svMESA\0" - "glWindowPos4dMESA\0" - "glWindowPos4dvMESA\0" - "glWindowPos4fMESA\0" - "glWindowPos4fvMESA\0" - "glWindowPos4iMESA\0" - "glWindowPos4ivMESA\0" - "glWindowPos4sMESA\0" - "glWindowPos4svMESA\0" - "glMultiModeDrawArraysIBM\0" - "glMultiModeDrawElementsIBM\0" - "glDeleteFencesNV\0" - "glFinishFenceNV\0" - "glGenFencesNV\0" - "glGetFenceivNV\0" - "glIsFenceNV\0" - "glSetFenceNV\0" - "glTestFenceNV\0" - "glAreProgramsResidentNV\0" - "glBindProgramNV\0" - "glDeleteProgramsNV\0" - "glExecuteProgramNV\0" - "glGenProgramsNV\0" - "glGetProgramParameterdvNV\0" - "glGetProgramParameterfvNV\0" - "glGetProgramStringNV\0" - "glGetProgramivNV\0" - "glGetTrackMatrixivNV\0" - "glGetVertexAttribPointervNV\0" - "glGetVertexAttribdvNV\0" - "glGetVertexAttribfvNV\0" - "glGetVertexAttribivNV\0" - "glIsProgramNV\0" - "glLoadProgramNV\0" - "glProgramParameters4dvNV\0" - "glProgramParameters4fvNV\0" - "glRequestResidentProgramsNV\0" - "glTrackMatrixNV\0" - "glVertexAttrib1dNV\0" - "glVertexAttrib1dvNV\0" - "glVertexAttrib1fNV\0" - "glVertexAttrib1fvNV\0" - "glVertexAttrib1sNV\0" - "glVertexAttrib1svNV\0" - "glVertexAttrib2dNV\0" - "glVertexAttrib2dvNV\0" - "glVertexAttrib2fNV\0" - "glVertexAttrib2fvNV\0" - "glVertexAttrib2sNV\0" - "glVertexAttrib2svNV\0" - "glVertexAttrib3dNV\0" - "glVertexAttrib3dvNV\0" - "glVertexAttrib3fNV\0" - "glVertexAttrib3fvNV\0" - "glVertexAttrib3sNV\0" - "glVertexAttrib3svNV\0" - "glVertexAttrib4dNV\0" - "glVertexAttrib4dvNV\0" - "glVertexAttrib4fNV\0" - "glVertexAttrib4fvNV\0" - "glVertexAttrib4sNV\0" - "glVertexAttrib4svNV\0" - "glVertexAttrib4ubNV\0" - "glVertexAttrib4ubvNV\0" - "glVertexAttribPointerNV\0" - "glVertexAttribs1dvNV\0" - "glVertexAttribs1fvNV\0" - "glVertexAttribs1svNV\0" - "glVertexAttribs2dvNV\0" - "glVertexAttribs2fvNV\0" - "glVertexAttribs2svNV\0" - "glVertexAttribs3dvNV\0" - "glVertexAttribs3fvNV\0" - "glVertexAttribs3svNV\0" - "glVertexAttribs4dvNV\0" - "glVertexAttribs4fvNV\0" - "glVertexAttribs4svNV\0" - "glVertexAttribs4ubvNV\0" - "glGetTexBumpParameterfvATI\0" - "glGetTexBumpParameterivATI\0" - "glTexBumpParameterfvATI\0" - "glTexBumpParameterivATI\0" - "glAlphaFragmentOp1ATI\0" - "glAlphaFragmentOp2ATI\0" - "glAlphaFragmentOp3ATI\0" - "glBeginFragmentShaderATI\0" - "glBindFragmentShaderATI\0" - "glColorFragmentOp1ATI\0" - "glColorFragmentOp2ATI\0" - "glColorFragmentOp3ATI\0" - "glDeleteFragmentShaderATI\0" - "glEndFragmentShaderATI\0" - "glGenFragmentShadersATI\0" - "glPassTexCoordATI\0" - "glSampleMapATI\0" - "glSetFragmentShaderConstantATI\0" - "glPointParameteriNV\0" - "glPointParameterivNV\0" - "glActiveStencilFaceEXT\0" - "glBindVertexArrayAPPLE\0" - "glDeleteVertexArraysAPPLE\0" - "glGenVertexArraysAPPLE\0" - "glIsVertexArrayAPPLE\0" - "glGetProgramNamedParameterdvNV\0" - "glGetProgramNamedParameterfvNV\0" - "glProgramNamedParameter4dNV\0" - "glProgramNamedParameter4dvNV\0" - "glProgramNamedParameter4fNV\0" - "glProgramNamedParameter4fvNV\0" - "glPrimitiveRestartIndexNV\0" - "glPrimitiveRestartNV\0" - "glDepthBoundsEXT\0" - "glBlendEquationSeparateEXT\0" - "glBindFramebufferEXT\0" - "glBindRenderbufferEXT\0" - "glCheckFramebufferStatusEXT\0" - "glDeleteFramebuffersEXT\0" - "glDeleteRenderbuffersEXT\0" - "glFramebufferRenderbufferEXT\0" - "glFramebufferTexture1DEXT\0" - "glFramebufferTexture2DEXT\0" - "glFramebufferTexture3DEXT\0" - "glGenFramebuffersEXT\0" - "glGenRenderbuffersEXT\0" - "glGenerateMipmapEXT\0" - "glGetFramebufferAttachmentParameterivEXT\0" - "glGetRenderbufferParameterivEXT\0" - "glIsFramebufferEXT\0" - "glIsRenderbufferEXT\0" - "glRenderbufferStorageEXT\0" - "glBlitFramebufferEXT\0" - "glBufferParameteriAPPLE\0" - "glFlushMappedBufferRangeAPPLE\0" - "glBindFragDataLocationEXT\0" - "glGetFragDataLocationEXT\0" - "glGetUniformuivEXT\0" - "glGetVertexAttribIivEXT\0" - "glGetVertexAttribIuivEXT\0" - "glUniform1uiEXT\0" - "glUniform1uivEXT\0" - "glUniform2uiEXT\0" - "glUniform2uivEXT\0" - "glUniform3uiEXT\0" - "glUniform3uivEXT\0" - "glUniform4uiEXT\0" - "glUniform4uivEXT\0" - "glVertexAttribI1iEXT\0" - "glVertexAttribI1ivEXT\0" - "glVertexAttribI1uiEXT\0" - "glVertexAttribI1uivEXT\0" - "glVertexAttribI2iEXT\0" - "glVertexAttribI2ivEXT\0" - "glVertexAttribI2uiEXT\0" - "glVertexAttribI2uivEXT\0" - "glVertexAttribI3iEXT\0" - "glVertexAttribI3ivEXT\0" - "glVertexAttribI3uiEXT\0" - "glVertexAttribI3uivEXT\0" - "glVertexAttribI4bvEXT\0" - "glVertexAttribI4iEXT\0" - "glVertexAttribI4ivEXT\0" - "glVertexAttribI4svEXT\0" - "glVertexAttribI4ubvEXT\0" - "glVertexAttribI4uiEXT\0" - "glVertexAttribI4uivEXT\0" - "glVertexAttribI4usvEXT\0" - "glVertexAttribIPointerEXT\0" - "glFramebufferTextureLayerEXT\0" - "glColorMaskIndexedEXT\0" - "glDisableIndexedEXT\0" - "glEnableIndexedEXT\0" - "glGetBooleanIndexedvEXT\0" - "glGetIntegerIndexedvEXT\0" - "glIsEnabledIndexedEXT\0" - "glClearColorIiEXT\0" - "glClearColorIuiEXT\0" - "glGetTexParameterIivEXT\0" - "glGetTexParameterIuivEXT\0" - "glTexParameterIivEXT\0" - "glTexParameterIuivEXT\0" - "glBeginConditionalRenderNV\0" - "glEndConditionalRenderNV\0" - "glBeginTransformFeedbackEXT\0" - "glBindBufferBaseEXT\0" - "glBindBufferOffsetEXT\0" - "glBindBufferRangeEXT\0" - "glEndTransformFeedbackEXT\0" - "glGetTransformFeedbackVaryingEXT\0" - "glTransformFeedbackVaryingsEXT\0" - "glProvokingVertexEXT\0" - "glGetTexParameterPointervAPPLE\0" - "glTextureRangeAPPLE\0" - "glGetObjectParameterivAPPLE\0" - "glObjectPurgeableAPPLE\0" - "glObjectUnpurgeableAPPLE\0" - "glActiveProgramEXT\0" - "glCreateShaderProgramEXT\0" - "glUseShaderProgramEXT\0" - "glTextureBarrierNV\0" - "glStencilFuncSeparateATI\0" - "glProgramEnvParameters4fvEXT\0" - "glProgramLocalParameters4fvEXT\0" - "glGetQueryObjecti64vEXT\0" - "glGetQueryObjectui64vEXT\0" - "glEGLImageTargetRenderbufferStorageOES\0" - "glEGLImageTargetTexture2DOES\0" - "glArrayElementEXT\0" - "glBindTextureEXT\0" - "glDrawArraysEXT\0" - "glAreTexturesResidentEXT\0" - "glCopyTexImage1DEXT\0" - "glCopyTexImage2DEXT\0" - "glCopyTexSubImage1DEXT\0" - "glCopyTexSubImage2DEXT\0" - "glDeleteTexturesEXT\0" - "glGenTexturesEXT\0" - "glGetPointervEXT\0" - "glIsTextureEXT\0" - "glPrioritizeTexturesEXT\0" - "glTexSubImage1DEXT\0" - "glTexSubImage2DEXT\0" - "glBlendColorEXT\0" - "glBlendEquationEXT\0" - "glDrawRangeElementsEXT\0" - "glColorTableSGI\0" - "glColorTableEXT\0" - "glColorTableParameterfvSGI\0" - "glColorTableParameterivSGI\0" - "glCopyColorTableSGI\0" - "glGetColorTableSGI\0" - "glGetColorTableEXT\0" - "glGetColorTableParameterfvSGI\0" - "glGetColorTableParameterfvEXT\0" - "glGetColorTableParameterivSGI\0" - "glGetColorTableParameterivEXT\0" - "glColorSubTableEXT\0" - "glCopyColorSubTableEXT\0" - "glConvolutionFilter1DEXT\0" - "glConvolutionFilter2DEXT\0" - "glConvolutionParameterfEXT\0" - "glConvolutionParameterfvEXT\0" - "glConvolutionParameteriEXT\0" - "glConvolutionParameterivEXT\0" - "glCopyConvolutionFilter1DEXT\0" - "glCopyConvolutionFilter2DEXT\0" - "glGetConvolutionFilterEXT\0" - "glGetConvolutionParameterfvEXT\0" - "glGetConvolutionParameterivEXT\0" - "glGetSeparableFilterEXT\0" - "glSeparableFilter2DEXT\0" - "glGetHistogramEXT\0" - "glGetHistogramParameterfvEXT\0" - "glGetHistogramParameterivEXT\0" - "glGetMinmaxEXT\0" - "glGetMinmaxParameterfvEXT\0" - "glGetMinmaxParameterivEXT\0" - "glHistogramEXT\0" - "glMinmaxEXT\0" - "glResetHistogramEXT\0" - "glResetMinmaxEXT\0" - "glTexImage3DEXT\0" - "glTexSubImage3DEXT\0" - "glCopyTexSubImage3DEXT\0" - "glActiveTexture\0" - "glClientActiveTexture\0" - "glMultiTexCoord1d\0" - "glMultiTexCoord1dv\0" - "glMultiTexCoord1f\0" - "glMultiTexCoord1fv\0" - "glMultiTexCoord1i\0" - "glMultiTexCoord1iv\0" - "glMultiTexCoord1s\0" - "glMultiTexCoord1sv\0" - "glMultiTexCoord2d\0" - "glMultiTexCoord2dv\0" - "glMultiTexCoord2f\0" - "glMultiTexCoord2fv\0" - "glMultiTexCoord2i\0" - "glMultiTexCoord2iv\0" - "glMultiTexCoord2s\0" - "glMultiTexCoord2sv\0" - "glMultiTexCoord3d\0" - "glMultiTexCoord3dv\0" - "glMultiTexCoord3f\0" - "glMultiTexCoord3fv\0" - "glMultiTexCoord3i\0" - "glMultiTexCoord3iv\0" - "glMultiTexCoord3s\0" - "glMultiTexCoord3sv\0" - "glMultiTexCoord4d\0" - "glMultiTexCoord4dv\0" - "glMultiTexCoord4f\0" - "glMultiTexCoord4fv\0" - "glMultiTexCoord4i\0" - "glMultiTexCoord4iv\0" - "glMultiTexCoord4s\0" - "glMultiTexCoord4sv\0" - "glStencilOpSeparateATI\0" - "glLoadTransposeMatrixd\0" - "glLoadTransposeMatrixf\0" - "glMultTransposeMatrixd\0" - "glMultTransposeMatrixf\0" - "glSampleCoverage\0" - "glCompressedTexImage1D\0" - "glCompressedTexImage2D\0" - "glCompressedTexImage3D\0" - "glCompressedTexSubImage1D\0" - "glCompressedTexSubImage2D\0" - "glCompressedTexSubImage3D\0" - "glGetCompressedTexImage\0" - "glDisableVertexAttribArray\0" - "glEnableVertexAttribArray\0" - "glGetVertexAttribdv\0" - "glGetVertexAttribfv\0" - "glGetVertexAttribiv\0" - "glProgramParameter4dNV\0" - "glProgramParameter4dvNV\0" - "glProgramParameter4fNV\0" - "glProgramParameter4fvNV\0" - "glVertexAttrib1d\0" - "glVertexAttrib1dv\0" - "glVertexAttrib1f\0" - "glVertexAttrib1fv\0" - "glVertexAttrib1s\0" - "glVertexAttrib1sv\0" - "glVertexAttrib2d\0" - "glVertexAttrib2dv\0" - "glVertexAttrib2f\0" - "glVertexAttrib2fv\0" - "glVertexAttrib2s\0" - "glVertexAttrib2sv\0" - "glVertexAttrib3d\0" - "glVertexAttrib3dv\0" - "glVertexAttrib3f\0" - "glVertexAttrib3fv\0" - "glVertexAttrib3s\0" - "glVertexAttrib3sv\0" - "glVertexAttrib4Nbv\0" - "glVertexAttrib4Niv\0" - "glVertexAttrib4Nsv\0" - "glVertexAttrib4Nub\0" - "glVertexAttrib4Nubv\0" - "glVertexAttrib4Nuiv\0" - "glVertexAttrib4Nusv\0" - "glVertexAttrib4bv\0" - "glVertexAttrib4d\0" - "glVertexAttrib4dv\0" - "glVertexAttrib4f\0" - "glVertexAttrib4fv\0" - "glVertexAttrib4iv\0" - "glVertexAttrib4s\0" - "glVertexAttrib4sv\0" - "glVertexAttrib4ubv\0" - "glVertexAttrib4uiv\0" - "glVertexAttrib4usv\0" - "glVertexAttribPointer\0" - "glBindBuffer\0" - "glBufferData\0" - "glBufferSubData\0" - "glDeleteBuffers\0" - "glGenBuffers\0" - "glGetBufferParameteriv\0" - "glGetBufferPointerv\0" - "glGetBufferSubData\0" - "glIsBuffer\0" - "glMapBuffer\0" - "glUnmapBuffer\0" - "glBeginQuery\0" - "glDeleteQueries\0" - "glEndQuery\0" - "glGenQueries\0" - "glGetQueryObjectiv\0" - "glGetQueryObjectuiv\0" - "glGetQueryiv\0" - "glIsQuery\0" - "glCompileShader\0" - "glGetActiveUniform\0" - "glGetShaderSource\0" - "glGetUniformLocation\0" - "glGetUniformfv\0" - "glGetUniformiv\0" - "glLinkProgram\0" - "glShaderSource\0" - "glUniform1f\0" - "glUniform1fv\0" - "glUniform1i\0" - "glUniform1iv\0" - "glUniform2f\0" - "glUniform2fv\0" - "glUniform2i\0" - "glUniform2iv\0" - "glUniform3f\0" - "glUniform3fv\0" - "glUniform3i\0" - "glUniform3iv\0" - "glUniform4f\0" - "glUniform4fv\0" - "glUniform4i\0" - "glUniform4iv\0" - "glUniformMatrix2fv\0" - "glUniformMatrix3fv\0" - "glUniformMatrix4fv\0" - "glUseProgram\0" - "glValidateProgram\0" - "glBindAttribLocation\0" - "glGetActiveAttrib\0" - "glGetAttribLocation\0" - "glDrawBuffers\0" - "glDrawBuffersATI\0" - "glDrawBuffersNV\0" - "glDrawArraysInstancedEXT\0" - "glDrawArraysInstanced\0" - "glDrawElementsInstancedEXT\0" - "glDrawElementsInstanced\0" - "glRenderbufferStorageMultisampleEXT\0" - "glBlendEquationSeparateIndexedAMD\0" - "glBlendEquationIndexedAMD\0" - "glBlendFuncSeparateIndexedAMD\0" - "glBlendFuncIndexedAMD\0" - "glSampleMaskEXT\0" - "glSamplePatternEXT\0" - "glPointParameterf\0" - "glPointParameterfARB\0" - "glPointParameterfSGIS\0" - "glPointParameterfv\0" - "glPointParameterfvARB\0" - "glPointParameterfvSGIS\0" - "glSecondaryColor3b\0" - "glSecondaryColor3bv\0" - "glSecondaryColor3d\0" - "glSecondaryColor3dv\0" - "glSecondaryColor3f\0" - "glSecondaryColor3fv\0" - "glSecondaryColor3i\0" - "glSecondaryColor3iv\0" - "glSecondaryColor3s\0" - "glSecondaryColor3sv\0" - "glSecondaryColor3ub\0" - "glSecondaryColor3ubv\0" - "glSecondaryColor3ui\0" - "glSecondaryColor3uiv\0" - "glSecondaryColor3us\0" - "glSecondaryColor3usv\0" - "glSecondaryColorPointer\0" - "glMultiDrawArrays\0" - "glMultiDrawElements\0" - "glFogCoordPointer\0" - "glFogCoordd\0" - "glFogCoorddv\0" - "glFogCoordf\0" - "glFogCoordfv\0" - "glBlendFuncSeparate\0" - "glBlendFuncSeparateINGR\0" - "glWindowPos2d\0" - "glWindowPos2dARB\0" - "glWindowPos2dv\0" - "glWindowPos2dvARB\0" - "glWindowPos2f\0" - "glWindowPos2fARB\0" - "glWindowPos2fv\0" - "glWindowPos2fvARB\0" - "glWindowPos2i\0" - "glWindowPos2iARB\0" - "glWindowPos2iv\0" - "glWindowPos2ivARB\0" - "glWindowPos2s\0" - "glWindowPos2sARB\0" - "glWindowPos2sv\0" - "glWindowPos2svARB\0" - "glWindowPos3d\0" - "glWindowPos3dARB\0" - "glWindowPos3dv\0" - "glWindowPos3dvARB\0" - "glWindowPos3f\0" - "glWindowPos3fARB\0" - "glWindowPos3fv\0" - "glWindowPos3fvARB\0" - "glWindowPos3i\0" - "glWindowPos3iARB\0" - "glWindowPos3iv\0" - "glWindowPos3ivARB\0" - "glWindowPos3s\0" - "glWindowPos3sARB\0" - "glWindowPos3sv\0" - "glWindowPos3svARB\0" - "glBindProgramARB\0" - "glDeleteProgramsARB\0" - "glGenProgramsARB\0" - "glGetVertexAttribPointerv\0" - "glGetVertexAttribPointervARB\0" - "glIsProgramARB\0" - "glPointParameteri\0" - "glPointParameteriv\0" - "glDeleteVertexArrays\0" - "glIsVertexArray\0" - "glPrimitiveRestartIndex\0" - "glBlendEquationSeparate\0" - "glBlendEquationSeparateATI\0" - "glBindFramebuffer\0" - "glBindRenderbuffer\0" - "glCheckFramebufferStatus\0" - "glDeleteFramebuffers\0" - "glDeleteRenderbuffers\0" - "glFramebufferRenderbuffer\0" - "glFramebufferTexture1D\0" - "glFramebufferTexture2D\0" - "glFramebufferTexture3D\0" - "glGenFramebuffers\0" - "glGenRenderbuffers\0" - "glGenerateMipmap\0" - "glGetFramebufferAttachmentParameteriv\0" - "glGetRenderbufferParameteriv\0" - "glIsFramebuffer\0" - "glIsRenderbuffer\0" - "glRenderbufferStorage\0" - "glBlitFramebuffer\0" - "glBindFragDataLocation\0" - "glGetFragDataLocation\0" - "glGetUniformuiv\0" - "glGetVertexAttribIiv\0" - "glGetVertexAttribIuiv\0" - "glUniform1ui\0" - "glUniform1uiv\0" - "glUniform2ui\0" - "glUniform2uiv\0" - "glUniform3ui\0" - "glUniform3uiv\0" - "glUniform4ui\0" - "glUniform4uiv\0" - "glVertexAttribI1i\0" - "glVertexAttribI1iv\0" - "glVertexAttribI1ui\0" - "glVertexAttribI1uiv\0" - "glVertexAttribI2i\0" - "glVertexAttribI2iv\0" - "glVertexAttribI2ui\0" - "glVertexAttribI2uiv\0" - "glVertexAttribI3i\0" - "glVertexAttribI3iv\0" - "glVertexAttribI3ui\0" - "glVertexAttribI3uiv\0" - "glVertexAttribI4bv\0" - "glVertexAttribI4i\0" - "glVertexAttribI4iv\0" - "glVertexAttribI4sv\0" - "glVertexAttribI4ubv\0" - "glVertexAttribI4ui\0" - "glVertexAttribI4uiv\0" - "glVertexAttribI4usv\0" - "glVertexAttribIPointer\0" - "glFramebufferTextureLayer\0" - "glFramebufferTextureLayerARB\0" - "glColorMaski\0" - "glDisablei\0" - "glEnablei\0" - "glGetBooleani_v\0" - "glGetIntegeri_v\0" - "glIsEnabledi\0" - "glGetTexParameterIiv\0" - "glGetTexParameterIuiv\0" - "glTexParameterIiv\0" - "glTexParameterIuiv\0" - "glBeginConditionalRender\0" - "glEndConditionalRender\0" - "glBeginTransformFeedback\0" - "glBindBufferBase\0" - "glBindBufferRange\0" - "glEndTransformFeedback\0" - "glGetTransformFeedbackVarying\0" - "glTransformFeedbackVaryings\0" "glProvokingVertex\0"; - -#ifdef USE_MGL_NAMESPACE -#define gl_dispatch_stub_343 mgl_dispatch_stub_343 -#define gl_dispatch_stub_344 mgl_dispatch_stub_344 -#define gl_dispatch_stub_345 mgl_dispatch_stub_345 -#define gl_dispatch_stub_356 mgl_dispatch_stub_356 -#define gl_dispatch_stub_357 mgl_dispatch_stub_357 -#define gl_dispatch_stub_358 mgl_dispatch_stub_358 -#define gl_dispatch_stub_359 mgl_dispatch_stub_359 -#define gl_dispatch_stub_361 mgl_dispatch_stub_361 -#define gl_dispatch_stub_362 mgl_dispatch_stub_362 -#define gl_dispatch_stub_363 mgl_dispatch_stub_363 -#define gl_dispatch_stub_364 mgl_dispatch_stub_364 -#define gl_dispatch_stub_365 mgl_dispatch_stub_365 -#define gl_dispatch_stub_366 mgl_dispatch_stub_366 -#define gl_dispatch_stub_692 mgl_dispatch_stub_692 -#define gl_dispatch_stub_693 mgl_dispatch_stub_693 -#define gl_dispatch_stub_694 mgl_dispatch_stub_694 -#define gl_dispatch_stub_695 mgl_dispatch_stub_695 -#define gl_dispatch_stub_696 mgl_dispatch_stub_696 -#define gl_dispatch_stub_697 mgl_dispatch_stub_697 -#define gl_dispatch_stub_698 mgl_dispatch_stub_698 -#define gl_dispatch_stub_699 mgl_dispatch_stub_699 -#define gl_dispatch_stub_734 mgl_dispatch_stub_734 -#define gl_dispatch_stub_776 mgl_dispatch_stub_776 -#define gl_dispatch_stub_777 mgl_dispatch_stub_777 -#define gl_dispatch_stub_778 mgl_dispatch_stub_778 -#define gl_dispatch_stub_779 mgl_dispatch_stub_779 -#define gl_dispatch_stub_780 mgl_dispatch_stub_780 -#define gl_dispatch_stub_781 mgl_dispatch_stub_781 -#define gl_dispatch_stub_782 mgl_dispatch_stub_782 -#define gl_dispatch_stub_783 mgl_dispatch_stub_783 -#define gl_dispatch_stub_784 mgl_dispatch_stub_784 -#define gl_dispatch_stub_865 mgl_dispatch_stub_865 -#define gl_dispatch_stub_866 mgl_dispatch_stub_866 -#define gl_dispatch_stub_867 mgl_dispatch_stub_867 -#define gl_dispatch_stub_868 mgl_dispatch_stub_868 -#define gl_dispatch_stub_869 mgl_dispatch_stub_869 -#define gl_dispatch_stub_878 mgl_dispatch_stub_878 -#define gl_dispatch_stub_879 mgl_dispatch_stub_879 -#define gl_dispatch_stub_897 mgl_dispatch_stub_897 -#define gl_dispatch_stub_898 mgl_dispatch_stub_898 -#define gl_dispatch_stub_899 mgl_dispatch_stub_899 -#define gl_dispatch_stub_957 mgl_dispatch_stub_957 -#define gl_dispatch_stub_958 mgl_dispatch_stub_958 -#define gl_dispatch_stub_966 mgl_dispatch_stub_966 -#define gl_dispatch_stub_967 mgl_dispatch_stub_967 -#define gl_dispatch_stub_968 mgl_dispatch_stub_968 -#define gl_dispatch_stub_969 mgl_dispatch_stub_969 -#define gl_dispatch_stub_970 mgl_dispatch_stub_970 -#endif /* USE_MGL_NAMESPACE */ - -#if defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING) -void GLAPIENTRY gl_dispatch_stub_343(GLenum target, GLenum format, GLenum type, - GLvoid * table); -void GLAPIENTRY gl_dispatch_stub_344(GLenum target, GLenum pname, - GLfloat * params); -void GLAPIENTRY gl_dispatch_stub_345(GLenum target, GLenum pname, - GLint * params); -void GLAPIENTRY gl_dispatch_stub_356(GLenum target, GLenum format, GLenum type, - GLvoid * image); -void GLAPIENTRY gl_dispatch_stub_357(GLenum target, GLenum pname, - GLfloat * params); -void GLAPIENTRY gl_dispatch_stub_358(GLenum target, GLenum pname, - GLint * params); -void GLAPIENTRY gl_dispatch_stub_359(GLenum target, GLenum format, GLenum type, - GLvoid * row, GLvoid * column, - GLvoid * span); -void GLAPIENTRY gl_dispatch_stub_361(GLenum target, GLboolean reset, - GLenum format, GLenum type, - GLvoid * values); -void GLAPIENTRY gl_dispatch_stub_362(GLenum target, GLenum pname, - GLfloat * params); -void GLAPIENTRY gl_dispatch_stub_363(GLenum target, GLenum pname, - GLint * params); -void GLAPIENTRY gl_dispatch_stub_364(GLenum target, GLboolean reset, - GLenum format, GLenum type, - GLvoid * values); -void GLAPIENTRY gl_dispatch_stub_365(GLenum target, GLenum pname, - GLfloat * params); -void GLAPIENTRY gl_dispatch_stub_366(GLenum target, GLenum pname, - GLint * params); -void GLAPIENTRY gl_dispatch_stub_692(GLenum pname, GLfloat * params); -void GLAPIENTRY gl_dispatch_stub_693(GLenum pname, GLint * params); -void GLAPIENTRY gl_dispatch_stub_694(GLenum pname, GLfloat param); -void GLAPIENTRY gl_dispatch_stub_695(GLenum pname, const GLfloat * params); -void GLAPIENTRY gl_dispatch_stub_696(GLenum pname, GLint param); -void GLAPIENTRY gl_dispatch_stub_697(GLenum pname, const GLint * params); -void GLAPIENTRY gl_dispatch_stub_698(GLclampf value, GLboolean invert); -void GLAPIENTRY gl_dispatch_stub_699(GLenum pattern); -void GLAPIENTRY gl_dispatch_stub_734(GLenum mode); -void GLAPIENTRY gl_dispatch_stub_776(const GLenum * mode, const GLint * first, - const GLsizei * count, GLsizei primcount, - GLint modestride); -void GLAPIENTRY gl_dispatch_stub_777(const GLenum * mode, const GLsizei * count, - GLenum type, const GLvoid * const *indices, - GLsizei primcount, GLint modestride); -void GLAPIENTRY gl_dispatch_stub_778(GLsizei n, const GLuint * fences); -void GLAPIENTRY gl_dispatch_stub_779(GLuint fence); -void GLAPIENTRY gl_dispatch_stub_780(GLsizei n, GLuint * fences); -void GLAPIENTRY gl_dispatch_stub_781(GLuint fence, GLenum pname, - GLint * params); -GLboolean GLAPIENTRY gl_dispatch_stub_782(GLuint fence); -void GLAPIENTRY gl_dispatch_stub_783(GLuint fence, GLenum condition); -GLboolean GLAPIENTRY gl_dispatch_stub_784(GLuint fence); -void GLAPIENTRY gl_dispatch_stub_865(GLenum face); -void GLAPIENTRY gl_dispatch_stub_866(GLuint array); -void GLAPIENTRY gl_dispatch_stub_867(GLsizei n, const GLuint * arrays); -void GLAPIENTRY gl_dispatch_stub_868(GLsizei n, GLuint * arrays); -GLboolean GLAPIENTRY gl_dispatch_stub_869(GLuint array); -void GLAPIENTRY gl_dispatch_stub_878(GLclampd zmin, GLclampd zmax); -void GLAPIENTRY gl_dispatch_stub_879(GLenum modeRGB, GLenum modeA); -void GLAPIENTRY gl_dispatch_stub_897(GLint srcX0, GLint srcY0, GLint srcX1, - GLint srcY1, GLint dstX0, GLint dstY0, - GLint dstX1, GLint dstY1, GLbitfield mask, - GLenum filter); -void GLAPIENTRY gl_dispatch_stub_898(GLenum target, GLenum pname, GLint param); -void GLAPIENTRY gl_dispatch_stub_899(GLenum target, GLintptr offset, - GLsizeiptr size); -void GLAPIENTRY gl_dispatch_stub_957(GLenum target, GLenum pname, - GLvoid ** params); -void GLAPIENTRY gl_dispatch_stub_958(GLenum target, GLsizei length, - GLvoid * pointer); -void GLAPIENTRY gl_dispatch_stub_966(GLenum frontfunc, GLenum backfunc, - GLint ref, GLuint mask); -void GLAPIENTRY gl_dispatch_stub_967(GLenum target, GLuint index, GLsizei count, - const GLfloat * params); -void GLAPIENTRY gl_dispatch_stub_968(GLenum target, GLuint index, GLsizei count, - const GLfloat * params); -void GLAPIENTRY gl_dispatch_stub_969(GLuint id, GLenum pname, - GLint64EXT * params); -void GLAPIENTRY gl_dispatch_stub_970(GLuint id, GLenum pname, - GLuint64EXT * params); -#endif /* defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING) */ - -static const glprocs_table_t static_functions[] = { - NAME_FUNC_OFFSET(0, glNewList, glNewList, NULL, 0), - NAME_FUNC_OFFSET(10, glEndList, glEndList, NULL, 1), - NAME_FUNC_OFFSET(20, glCallList, glCallList, NULL, 2), - NAME_FUNC_OFFSET(31, glCallLists, glCallLists, NULL, 3), - NAME_FUNC_OFFSET(43, glDeleteLists, glDeleteLists, NULL, 4), - NAME_FUNC_OFFSET(57, glGenLists, glGenLists, NULL, 5), - NAME_FUNC_OFFSET(68, glListBase, glListBase, NULL, 6), - NAME_FUNC_OFFSET(79, glBegin, glBegin, NULL, 7), - NAME_FUNC_OFFSET(87, glBitmap, glBitmap, NULL, 8), - NAME_FUNC_OFFSET(96, glColor3b, glColor3b, NULL, 9), - NAME_FUNC_OFFSET(106, glColor3bv, glColor3bv, NULL, 10), - NAME_FUNC_OFFSET(117, glColor3d, glColor3d, NULL, 11), - NAME_FUNC_OFFSET(127, glColor3dv, glColor3dv, NULL, 12), - NAME_FUNC_OFFSET(138, glColor3f, glColor3f, NULL, 13), - NAME_FUNC_OFFSET(148, glColor3fv, glColor3fv, NULL, 14), - NAME_FUNC_OFFSET(159, glColor3i, glColor3i, NULL, 15), - NAME_FUNC_OFFSET(169, glColor3iv, glColor3iv, NULL, 16), - NAME_FUNC_OFFSET(180, glColor3s, glColor3s, NULL, 17), - NAME_FUNC_OFFSET(190, glColor3sv, glColor3sv, NULL, 18), - NAME_FUNC_OFFSET(201, glColor3ub, glColor3ub, NULL, 19), - NAME_FUNC_OFFSET(212, glColor3ubv, glColor3ubv, NULL, 20), - NAME_FUNC_OFFSET(224, glColor3ui, glColor3ui, NULL, 21), - NAME_FUNC_OFFSET(235, glColor3uiv, glColor3uiv, NULL, 22), - NAME_FUNC_OFFSET(247, glColor3us, glColor3us, NULL, 23), - NAME_FUNC_OFFSET(258, glColor3usv, glColor3usv, NULL, 24), - NAME_FUNC_OFFSET(270, glColor4b, glColor4b, NULL, 25), - NAME_FUNC_OFFSET(280, glColor4bv, glColor4bv, NULL, 26), - NAME_FUNC_OFFSET(291, glColor4d, glColor4d, NULL, 27), - NAME_FUNC_OFFSET(301, glColor4dv, glColor4dv, NULL, 28), - NAME_FUNC_OFFSET(312, glColor4f, glColor4f, NULL, 29), - NAME_FUNC_OFFSET(322, glColor4fv, glColor4fv, NULL, 30), - NAME_FUNC_OFFSET(333, glColor4i, glColor4i, NULL, 31), - NAME_FUNC_OFFSET(343, glColor4iv, glColor4iv, NULL, 32), - NAME_FUNC_OFFSET(354, glColor4s, glColor4s, NULL, 33), - NAME_FUNC_OFFSET(364, glColor4sv, glColor4sv, NULL, 34), - NAME_FUNC_OFFSET(375, glColor4ub, glColor4ub, NULL, 35), - NAME_FUNC_OFFSET(386, glColor4ubv, glColor4ubv, NULL, 36), - NAME_FUNC_OFFSET(398, glColor4ui, glColor4ui, NULL, 37), - NAME_FUNC_OFFSET(409, glColor4uiv, glColor4uiv, NULL, 38), - NAME_FUNC_OFFSET(421, glColor4us, glColor4us, NULL, 39), - NAME_FUNC_OFFSET(432, glColor4usv, glColor4usv, NULL, 40), - NAME_FUNC_OFFSET(444, glEdgeFlag, glEdgeFlag, NULL, 41), - NAME_FUNC_OFFSET(455, glEdgeFlagv, glEdgeFlagv, NULL, 42), - NAME_FUNC_OFFSET(467, glEnd, glEnd, NULL, 43), - NAME_FUNC_OFFSET(473, glIndexd, glIndexd, NULL, 44), - NAME_FUNC_OFFSET(482, glIndexdv, glIndexdv, NULL, 45), - NAME_FUNC_OFFSET(492, glIndexf, glIndexf, NULL, 46), - NAME_FUNC_OFFSET(501, glIndexfv, glIndexfv, NULL, 47), - NAME_FUNC_OFFSET(511, glIndexi, glIndexi, NULL, 48), - NAME_FUNC_OFFSET(520, glIndexiv, glIndexiv, NULL, 49), - NAME_FUNC_OFFSET(530, glIndexs, glIndexs, NULL, 50), - NAME_FUNC_OFFSET(539, glIndexsv, glIndexsv, NULL, 51), - NAME_FUNC_OFFSET(549, glNormal3b, glNormal3b, NULL, 52), - NAME_FUNC_OFFSET(560, glNormal3bv, glNormal3bv, NULL, 53), - NAME_FUNC_OFFSET(572, glNormal3d, glNormal3d, NULL, 54), - NAME_FUNC_OFFSET(583, glNormal3dv, glNormal3dv, NULL, 55), - NAME_FUNC_OFFSET(595, glNormal3f, glNormal3f, NULL, 56), - NAME_FUNC_OFFSET(606, glNormal3fv, glNormal3fv, NULL, 57), - NAME_FUNC_OFFSET(618, glNormal3i, glNormal3i, NULL, 58), - NAME_FUNC_OFFSET(629, glNormal3iv, glNormal3iv, NULL, 59), - NAME_FUNC_OFFSET(641, glNormal3s, glNormal3s, NULL, 60), - NAME_FUNC_OFFSET(652, glNormal3sv, glNormal3sv, NULL, 61), - NAME_FUNC_OFFSET(664, glRasterPos2d, glRasterPos2d, NULL, 62), - NAME_FUNC_OFFSET(678, glRasterPos2dv, glRasterPos2dv, NULL, 63), - NAME_FUNC_OFFSET(693, glRasterPos2f, glRasterPos2f, NULL, 64), - NAME_FUNC_OFFSET(707, glRasterPos2fv, glRasterPos2fv, NULL, 65), - NAME_FUNC_OFFSET(722, glRasterPos2i, glRasterPos2i, NULL, 66), - NAME_FUNC_OFFSET(736, glRasterPos2iv, glRasterPos2iv, NULL, 67), - NAME_FUNC_OFFSET(751, glRasterPos2s, glRasterPos2s, NULL, 68), - NAME_FUNC_OFFSET(765, glRasterPos2sv, glRasterPos2sv, NULL, 69), - NAME_FUNC_OFFSET(780, glRasterPos3d, glRasterPos3d, NULL, 70), - NAME_FUNC_OFFSET(794, glRasterPos3dv, glRasterPos3dv, NULL, 71), - NAME_FUNC_OFFSET(809, glRasterPos3f, glRasterPos3f, NULL, 72), - NAME_FUNC_OFFSET(823, glRasterPos3fv, glRasterPos3fv, NULL, 73), - NAME_FUNC_OFFSET(838, glRasterPos3i, glRasterPos3i, NULL, 74), - NAME_FUNC_OFFSET(852, glRasterPos3iv, glRasterPos3iv, NULL, 75), - NAME_FUNC_OFFSET(867, glRasterPos3s, glRasterPos3s, NULL, 76), - NAME_FUNC_OFFSET(881, glRasterPos3sv, glRasterPos3sv, NULL, 77), - NAME_FUNC_OFFSET(896, glRasterPos4d, glRasterPos4d, NULL, 78), - NAME_FUNC_OFFSET(910, glRasterPos4dv, glRasterPos4dv, NULL, 79), - NAME_FUNC_OFFSET(925, glRasterPos4f, glRasterPos4f, NULL, 80), - NAME_FUNC_OFFSET(939, glRasterPos4fv, glRasterPos4fv, NULL, 81), - NAME_FUNC_OFFSET(954, glRasterPos4i, glRasterPos4i, NULL, 82), - NAME_FUNC_OFFSET(968, glRasterPos4iv, glRasterPos4iv, NULL, 83), - NAME_FUNC_OFFSET(983, glRasterPos4s, glRasterPos4s, NULL, 84), - NAME_FUNC_OFFSET(997, glRasterPos4sv, glRasterPos4sv, NULL, 85), - NAME_FUNC_OFFSET(1012, glRectd, glRectd, NULL, 86), - NAME_FUNC_OFFSET(1020, glRectdv, glRectdv, NULL, 87), - NAME_FUNC_OFFSET(1029, glRectf, glRectf, NULL, 88), - NAME_FUNC_OFFSET(1037, glRectfv, glRectfv, NULL, 89), - NAME_FUNC_OFFSET(1046, glRecti, glRecti, NULL, 90), - NAME_FUNC_OFFSET(1054, glRectiv, glRectiv, NULL, 91), - NAME_FUNC_OFFSET(1063, glRects, glRects, NULL, 92), - NAME_FUNC_OFFSET(1071, glRectsv, glRectsv, NULL, 93), - NAME_FUNC_OFFSET(1080, glTexCoord1d, glTexCoord1d, NULL, 94), - NAME_FUNC_OFFSET(1093, glTexCoord1dv, glTexCoord1dv, NULL, 95), - NAME_FUNC_OFFSET(1107, glTexCoord1f, glTexCoord1f, NULL, 96), - NAME_FUNC_OFFSET(1120, glTexCoord1fv, glTexCoord1fv, NULL, 97), - NAME_FUNC_OFFSET(1134, glTexCoord1i, glTexCoord1i, NULL, 98), - NAME_FUNC_OFFSET(1147, glTexCoord1iv, glTexCoord1iv, NULL, 99), - NAME_FUNC_OFFSET(1161, glTexCoord1s, glTexCoord1s, NULL, 100), - NAME_FUNC_OFFSET(1174, glTexCoord1sv, glTexCoord1sv, NULL, 101), - NAME_FUNC_OFFSET(1188, glTexCoord2d, glTexCoord2d, NULL, 102), - NAME_FUNC_OFFSET(1201, glTexCoord2dv, glTexCoord2dv, NULL, 103), - NAME_FUNC_OFFSET(1215, glTexCoord2f, glTexCoord2f, NULL, 104), - NAME_FUNC_OFFSET(1228, glTexCoord2fv, glTexCoord2fv, NULL, 105), - NAME_FUNC_OFFSET(1242, glTexCoord2i, glTexCoord2i, NULL, 106), - NAME_FUNC_OFFSET(1255, glTexCoord2iv, glTexCoord2iv, NULL, 107), - NAME_FUNC_OFFSET(1269, glTexCoord2s, glTexCoord2s, NULL, 108), - NAME_FUNC_OFFSET(1282, glTexCoord2sv, glTexCoord2sv, NULL, 109), - NAME_FUNC_OFFSET(1296, glTexCoord3d, glTexCoord3d, NULL, 110), - NAME_FUNC_OFFSET(1309, glTexCoord3dv, glTexCoord3dv, NULL, 111), - NAME_FUNC_OFFSET(1323, glTexCoord3f, glTexCoord3f, NULL, 112), - NAME_FUNC_OFFSET(1336, glTexCoord3fv, glTexCoord3fv, NULL, 113), - NAME_FUNC_OFFSET(1350, glTexCoord3i, glTexCoord3i, NULL, 114), - NAME_FUNC_OFFSET(1363, glTexCoord3iv, glTexCoord3iv, NULL, 115), - NAME_FUNC_OFFSET(1377, glTexCoord3s, glTexCoord3s, NULL, 116), - NAME_FUNC_OFFSET(1390, glTexCoord3sv, glTexCoord3sv, NULL, 117), - NAME_FUNC_OFFSET(1404, glTexCoord4d, glTexCoord4d, NULL, 118), - NAME_FUNC_OFFSET(1417, glTexCoord4dv, glTexCoord4dv, NULL, 119), - NAME_FUNC_OFFSET(1431, glTexCoord4f, glTexCoord4f, NULL, 120), - NAME_FUNC_OFFSET(1444, glTexCoord4fv, glTexCoord4fv, NULL, 121), - NAME_FUNC_OFFSET(1458, glTexCoord4i, glTexCoord4i, NULL, 122), - NAME_FUNC_OFFSET(1471, glTexCoord4iv, glTexCoord4iv, NULL, 123), - NAME_FUNC_OFFSET(1485, glTexCoord4s, glTexCoord4s, NULL, 124), - NAME_FUNC_OFFSET(1498, glTexCoord4sv, glTexCoord4sv, NULL, 125), - NAME_FUNC_OFFSET(1512, glVertex2d, glVertex2d, NULL, 126), - NAME_FUNC_OFFSET(1523, glVertex2dv, glVertex2dv, NULL, 127), - NAME_FUNC_OFFSET(1535, glVertex2f, glVertex2f, NULL, 128), - NAME_FUNC_OFFSET(1546, glVertex2fv, glVertex2fv, NULL, 129), - NAME_FUNC_OFFSET(1558, glVertex2i, glVertex2i, NULL, 130), - NAME_FUNC_OFFSET(1569, glVertex2iv, glVertex2iv, NULL, 131), - NAME_FUNC_OFFSET(1581, glVertex2s, glVertex2s, NULL, 132), - NAME_FUNC_OFFSET(1592, glVertex2sv, glVertex2sv, NULL, 133), - NAME_FUNC_OFFSET(1604, glVertex3d, glVertex3d, NULL, 134), - NAME_FUNC_OFFSET(1615, glVertex3dv, glVertex3dv, NULL, 135), - NAME_FUNC_OFFSET(1627, glVertex3f, glVertex3f, NULL, 136), - NAME_FUNC_OFFSET(1638, glVertex3fv, glVertex3fv, NULL, 137), - NAME_FUNC_OFFSET(1650, glVertex3i, glVertex3i, NULL, 138), - NAME_FUNC_OFFSET(1661, glVertex3iv, glVertex3iv, NULL, 139), - NAME_FUNC_OFFSET(1673, glVertex3s, glVertex3s, NULL, 140), - NAME_FUNC_OFFSET(1684, glVertex3sv, glVertex3sv, NULL, 141), - NAME_FUNC_OFFSET(1696, glVertex4d, glVertex4d, NULL, 142), - NAME_FUNC_OFFSET(1707, glVertex4dv, glVertex4dv, NULL, 143), - NAME_FUNC_OFFSET(1719, glVertex4f, glVertex4f, NULL, 144), - NAME_FUNC_OFFSET(1730, glVertex4fv, glVertex4fv, NULL, 145), - NAME_FUNC_OFFSET(1742, glVertex4i, glVertex4i, NULL, 146), - NAME_FUNC_OFFSET(1753, glVertex4iv, glVertex4iv, NULL, 147), - NAME_FUNC_OFFSET(1765, glVertex4s, glVertex4s, NULL, 148), - NAME_FUNC_OFFSET(1776, glVertex4sv, glVertex4sv, NULL, 149), - NAME_FUNC_OFFSET(1788, glClipPlane, glClipPlane, NULL, 150), - NAME_FUNC_OFFSET(1800, glColorMaterial, glColorMaterial, NULL, 151), - NAME_FUNC_OFFSET(1816, glCullFace, glCullFace, NULL, 152), - NAME_FUNC_OFFSET(1827, glFogf, glFogf, NULL, 153), - NAME_FUNC_OFFSET(1834, glFogfv, glFogfv, NULL, 154), - NAME_FUNC_OFFSET(1842, glFogi, glFogi, NULL, 155), - NAME_FUNC_OFFSET(1849, glFogiv, glFogiv, NULL, 156), - NAME_FUNC_OFFSET(1857, glFrontFace, glFrontFace, NULL, 157), - NAME_FUNC_OFFSET(1869, glHint, glHint, NULL, 158), - NAME_FUNC_OFFSET(1876, glLightf, glLightf, NULL, 159), - NAME_FUNC_OFFSET(1885, glLightfv, glLightfv, NULL, 160), - NAME_FUNC_OFFSET(1895, glLighti, glLighti, NULL, 161), - NAME_FUNC_OFFSET(1904, glLightiv, glLightiv, NULL, 162), - NAME_FUNC_OFFSET(1914, glLightModelf, glLightModelf, NULL, 163), - NAME_FUNC_OFFSET(1928, glLightModelfv, glLightModelfv, NULL, 164), - NAME_FUNC_OFFSET(1943, glLightModeli, glLightModeli, NULL, 165), - NAME_FUNC_OFFSET(1957, glLightModeliv, glLightModeliv, NULL, 166), - NAME_FUNC_OFFSET(1972, glLineStipple, glLineStipple, NULL, 167), - NAME_FUNC_OFFSET(1986, glLineWidth, glLineWidth, NULL, 168), - NAME_FUNC_OFFSET(1998, glMaterialf, glMaterialf, NULL, 169), - NAME_FUNC_OFFSET(2010, glMaterialfv, glMaterialfv, NULL, 170), - NAME_FUNC_OFFSET(2023, glMateriali, glMateriali, NULL, 171), - NAME_FUNC_OFFSET(2035, glMaterialiv, glMaterialiv, NULL, 172), - NAME_FUNC_OFFSET(2048, glPointSize, glPointSize, NULL, 173), - NAME_FUNC_OFFSET(2060, glPolygonMode, glPolygonMode, NULL, 174), - NAME_FUNC_OFFSET(2074, glPolygonStipple, glPolygonStipple, NULL, 175), - NAME_FUNC_OFFSET(2091, glScissor, glScissor, NULL, 176), - NAME_FUNC_OFFSET(2101, glShadeModel, glShadeModel, NULL, 177), - NAME_FUNC_OFFSET(2114, glTexParameterf, glTexParameterf, NULL, 178), - NAME_FUNC_OFFSET(2130, glTexParameterfv, glTexParameterfv, NULL, 179), - NAME_FUNC_OFFSET(2147, glTexParameteri, glTexParameteri, NULL, 180), - NAME_FUNC_OFFSET(2163, glTexParameteriv, glTexParameteriv, NULL, 181), - NAME_FUNC_OFFSET(2180, glTexImage1D, glTexImage1D, NULL, 182), - NAME_FUNC_OFFSET(2193, glTexImage2D, glTexImage2D, NULL, 183), - NAME_FUNC_OFFSET(2206, glTexEnvf, glTexEnvf, NULL, 184), - NAME_FUNC_OFFSET(2216, glTexEnvfv, glTexEnvfv, NULL, 185), - NAME_FUNC_OFFSET(2227, glTexEnvi, glTexEnvi, NULL, 186), - NAME_FUNC_OFFSET(2237, glTexEnviv, glTexEnviv, NULL, 187), - NAME_FUNC_OFFSET(2248, glTexGend, glTexGend, NULL, 188), - NAME_FUNC_OFFSET(2258, glTexGendv, glTexGendv, NULL, 189), - NAME_FUNC_OFFSET(2269, glTexGenf, glTexGenf, NULL, 190), - NAME_FUNC_OFFSET(2279, glTexGenfv, glTexGenfv, NULL, 191), - NAME_FUNC_OFFSET(2290, glTexGeni, glTexGeni, NULL, 192), - NAME_FUNC_OFFSET(2300, glTexGeniv, glTexGeniv, NULL, 193), - NAME_FUNC_OFFSET(2311, glFeedbackBuffer, glFeedbackBuffer, NULL, 194), - NAME_FUNC_OFFSET(2328, glSelectBuffer, glSelectBuffer, NULL, 195), - NAME_FUNC_OFFSET(2343, glRenderMode, glRenderMode, NULL, 196), - NAME_FUNC_OFFSET(2356, glInitNames, glInitNames, NULL, 197), - NAME_FUNC_OFFSET(2368, glLoadName, glLoadName, NULL, 198), - NAME_FUNC_OFFSET(2379, glPassThrough, glPassThrough, NULL, 199), - NAME_FUNC_OFFSET(2393, glPopName, glPopName, NULL, 200), - NAME_FUNC_OFFSET(2403, glPushName, glPushName, NULL, 201), - NAME_FUNC_OFFSET(2414, glDrawBuffer, glDrawBuffer, NULL, 202), - NAME_FUNC_OFFSET(2427, glClear, glClear, NULL, 203), - NAME_FUNC_OFFSET(2435, glClearAccum, glClearAccum, NULL, 204), - NAME_FUNC_OFFSET(2448, glClearIndex, glClearIndex, NULL, 205), - NAME_FUNC_OFFSET(2461, glClearColor, glClearColor, NULL, 206), - NAME_FUNC_OFFSET(2474, glClearStencil, glClearStencil, NULL, 207), - NAME_FUNC_OFFSET(2489, glClearDepth, glClearDepth, NULL, 208), - NAME_FUNC_OFFSET(2502, glStencilMask, glStencilMask, NULL, 209), - NAME_FUNC_OFFSET(2516, glColorMask, glColorMask, NULL, 210), - NAME_FUNC_OFFSET(2528, glDepthMask, glDepthMask, NULL, 211), - NAME_FUNC_OFFSET(2540, glIndexMask, glIndexMask, NULL, 212), - NAME_FUNC_OFFSET(2552, glAccum, glAccum, NULL, 213), - NAME_FUNC_OFFSET(2560, glDisable, glDisable, NULL, 214), - NAME_FUNC_OFFSET(2570, glEnable, glEnable, NULL, 215), - NAME_FUNC_OFFSET(2579, glFinish, glFinish, NULL, 216), - NAME_FUNC_OFFSET(2588, glFlush, glFlush, NULL, 217), - NAME_FUNC_OFFSET(2596, glPopAttrib, glPopAttrib, NULL, 218), - NAME_FUNC_OFFSET(2608, glPushAttrib, glPushAttrib, NULL, 219), - NAME_FUNC_OFFSET(2621, glMap1d, glMap1d, NULL, 220), - NAME_FUNC_OFFSET(2629, glMap1f, glMap1f, NULL, 221), - NAME_FUNC_OFFSET(2637, glMap2d, glMap2d, NULL, 222), - NAME_FUNC_OFFSET(2645, glMap2f, glMap2f, NULL, 223), - NAME_FUNC_OFFSET(2653, glMapGrid1d, glMapGrid1d, NULL, 224), - NAME_FUNC_OFFSET(2665, glMapGrid1f, glMapGrid1f, NULL, 225), - NAME_FUNC_OFFSET(2677, glMapGrid2d, glMapGrid2d, NULL, 226), - NAME_FUNC_OFFSET(2689, glMapGrid2f, glMapGrid2f, NULL, 227), - NAME_FUNC_OFFSET(2701, glEvalCoord1d, glEvalCoord1d, NULL, 228), - NAME_FUNC_OFFSET(2715, glEvalCoord1dv, glEvalCoord1dv, NULL, 229), - NAME_FUNC_OFFSET(2730, glEvalCoord1f, glEvalCoord1f, NULL, 230), - NAME_FUNC_OFFSET(2744, glEvalCoord1fv, glEvalCoord1fv, NULL, 231), - NAME_FUNC_OFFSET(2759, glEvalCoord2d, glEvalCoord2d, NULL, 232), - NAME_FUNC_OFFSET(2773, glEvalCoord2dv, glEvalCoord2dv, NULL, 233), - NAME_FUNC_OFFSET(2788, glEvalCoord2f, glEvalCoord2f, NULL, 234), - NAME_FUNC_OFFSET(2802, glEvalCoord2fv, glEvalCoord2fv, NULL, 235), - NAME_FUNC_OFFSET(2817, glEvalMesh1, glEvalMesh1, NULL, 236), - NAME_FUNC_OFFSET(2829, glEvalPoint1, glEvalPoint1, NULL, 237), - NAME_FUNC_OFFSET(2842, glEvalMesh2, glEvalMesh2, NULL, 238), - NAME_FUNC_OFFSET(2854, glEvalPoint2, glEvalPoint2, NULL, 239), - NAME_FUNC_OFFSET(2867, glAlphaFunc, glAlphaFunc, NULL, 240), - NAME_FUNC_OFFSET(2879, glBlendFunc, glBlendFunc, NULL, 241), - NAME_FUNC_OFFSET(2891, glLogicOp, glLogicOp, NULL, 242), - NAME_FUNC_OFFSET(2901, glStencilFunc, glStencilFunc, NULL, 243), - NAME_FUNC_OFFSET(2915, glStencilOp, glStencilOp, NULL, 244), - NAME_FUNC_OFFSET(2927, glDepthFunc, glDepthFunc, NULL, 245), - NAME_FUNC_OFFSET(2939, glPixelZoom, glPixelZoom, NULL, 246), - NAME_FUNC_OFFSET(2951, glPixelTransferf, glPixelTransferf, NULL, 247), - NAME_FUNC_OFFSET(2968, glPixelTransferi, glPixelTransferi, NULL, 248), - NAME_FUNC_OFFSET(2985, glPixelStoref, glPixelStoref, NULL, 249), - NAME_FUNC_OFFSET(2999, glPixelStorei, glPixelStorei, NULL, 250), - NAME_FUNC_OFFSET(3013, glPixelMapfv, glPixelMapfv, NULL, 251), - NAME_FUNC_OFFSET(3026, glPixelMapuiv, glPixelMapuiv, NULL, 252), - NAME_FUNC_OFFSET(3040, glPixelMapusv, glPixelMapusv, NULL, 253), - NAME_FUNC_OFFSET(3054, glReadBuffer, glReadBuffer, NULL, 254), - NAME_FUNC_OFFSET(3067, glCopyPixels, glCopyPixels, NULL, 255), - NAME_FUNC_OFFSET(3080, glReadPixels, glReadPixels, NULL, 256), - NAME_FUNC_OFFSET(3093, glDrawPixels, glDrawPixels, NULL, 257), - NAME_FUNC_OFFSET(3106, glGetBooleanv, glGetBooleanv, NULL, 258), - NAME_FUNC_OFFSET(3120, glGetClipPlane, glGetClipPlane, NULL, 259), - NAME_FUNC_OFFSET(3135, glGetDoublev, glGetDoublev, NULL, 260), - NAME_FUNC_OFFSET(3148, glGetError, glGetError, NULL, 261), - NAME_FUNC_OFFSET(3159, glGetFloatv, glGetFloatv, NULL, 262), - NAME_FUNC_OFFSET(3171, glGetIntegerv, glGetIntegerv, NULL, 263), - NAME_FUNC_OFFSET(3185, glGetLightfv, glGetLightfv, NULL, 264), - NAME_FUNC_OFFSET(3198, glGetLightiv, glGetLightiv, NULL, 265), - NAME_FUNC_OFFSET(3211, glGetMapdv, glGetMapdv, NULL, 266), - NAME_FUNC_OFFSET(3222, glGetMapfv, glGetMapfv, NULL, 267), - NAME_FUNC_OFFSET(3233, glGetMapiv, glGetMapiv, NULL, 268), - NAME_FUNC_OFFSET(3244, glGetMaterialfv, glGetMaterialfv, NULL, 269), - NAME_FUNC_OFFSET(3260, glGetMaterialiv, glGetMaterialiv, NULL, 270), - NAME_FUNC_OFFSET(3276, glGetPixelMapfv, glGetPixelMapfv, NULL, 271), - NAME_FUNC_OFFSET(3292, glGetPixelMapuiv, glGetPixelMapuiv, NULL, 272), - NAME_FUNC_OFFSET(3309, glGetPixelMapusv, glGetPixelMapusv, NULL, 273), - NAME_FUNC_OFFSET(3326, glGetPolygonStipple, glGetPolygonStipple, NULL, 274), - NAME_FUNC_OFFSET(3346, glGetString, glGetString, NULL, 275), - NAME_FUNC_OFFSET(3358, glGetTexEnvfv, glGetTexEnvfv, NULL, 276), - NAME_FUNC_OFFSET(3372, glGetTexEnviv, glGetTexEnviv, NULL, 277), - NAME_FUNC_OFFSET(3386, glGetTexGendv, glGetTexGendv, NULL, 278), - NAME_FUNC_OFFSET(3400, glGetTexGenfv, glGetTexGenfv, NULL, 279), - NAME_FUNC_OFFSET(3414, glGetTexGeniv, glGetTexGeniv, NULL, 280), - NAME_FUNC_OFFSET(3428, glGetTexImage, glGetTexImage, NULL, 281), - NAME_FUNC_OFFSET(3442, glGetTexParameterfv, glGetTexParameterfv, NULL, 282), - NAME_FUNC_OFFSET(3462, glGetTexParameteriv, glGetTexParameteriv, NULL, 283), - NAME_FUNC_OFFSET(3482, glGetTexLevelParameterfv, glGetTexLevelParameterfv, - NULL, 284), - NAME_FUNC_OFFSET(3507, glGetTexLevelParameteriv, glGetTexLevelParameteriv, - NULL, 285), - NAME_FUNC_OFFSET(3532, glIsEnabled, glIsEnabled, NULL, 286), - NAME_FUNC_OFFSET(3544, glIsList, glIsList, NULL, 287), - NAME_FUNC_OFFSET(3553, glDepthRange, glDepthRange, NULL, 288), - NAME_FUNC_OFFSET(3566, glFrustum, glFrustum, NULL, 289), - NAME_FUNC_OFFSET(3576, glLoadIdentity, glLoadIdentity, NULL, 290), - NAME_FUNC_OFFSET(3591, glLoadMatrixf, glLoadMatrixf, NULL, 291), - NAME_FUNC_OFFSET(3605, glLoadMatrixd, glLoadMatrixd, NULL, 292), - NAME_FUNC_OFFSET(3619, glMatrixMode, glMatrixMode, NULL, 293), - NAME_FUNC_OFFSET(3632, glMultMatrixf, glMultMatrixf, NULL, 294), - NAME_FUNC_OFFSET(3646, glMultMatrixd, glMultMatrixd, NULL, 295), - NAME_FUNC_OFFSET(3660, glOrtho, glOrtho, NULL, 296), - NAME_FUNC_OFFSET(3668, glPopMatrix, glPopMatrix, NULL, 297), - NAME_FUNC_OFFSET(3680, glPushMatrix, glPushMatrix, NULL, 298), - NAME_FUNC_OFFSET(3693, glRotated, glRotated, NULL, 299), - NAME_FUNC_OFFSET(3703, glRotatef, glRotatef, NULL, 300), - NAME_FUNC_OFFSET(3713, glScaled, glScaled, NULL, 301), - NAME_FUNC_OFFSET(3722, glScalef, glScalef, NULL, 302), - NAME_FUNC_OFFSET(3731, glTranslated, glTranslated, NULL, 303), - NAME_FUNC_OFFSET(3744, glTranslatef, glTranslatef, NULL, 304), - NAME_FUNC_OFFSET(3757, glViewport, glViewport, NULL, 305), - NAME_FUNC_OFFSET(3768, glArrayElement, glArrayElement, NULL, 306), - NAME_FUNC_OFFSET(3783, glBindTexture, glBindTexture, NULL, 307), - NAME_FUNC_OFFSET(3797, glColorPointer, glColorPointer, NULL, 308), - NAME_FUNC_OFFSET(3812, glDisableClientState, glDisableClientState, NULL, - 309), - NAME_FUNC_OFFSET(3833, glDrawArrays, glDrawArrays, NULL, 310), - NAME_FUNC_OFFSET(3846, glDrawElements, glDrawElements, NULL, 311), - NAME_FUNC_OFFSET(3861, glEdgeFlagPointer, glEdgeFlagPointer, NULL, 312), - NAME_FUNC_OFFSET(3879, glEnableClientState, glEnableClientState, NULL, 313), - NAME_FUNC_OFFSET(3899, glIndexPointer, glIndexPointer, NULL, 314), - NAME_FUNC_OFFSET(3914, glIndexub, glIndexub, NULL, 315), - NAME_FUNC_OFFSET(3924, glIndexubv, glIndexubv, NULL, 316), - NAME_FUNC_OFFSET(3935, glInterleavedArrays, glInterleavedArrays, NULL, 317), - NAME_FUNC_OFFSET(3955, glNormalPointer, glNormalPointer, NULL, 318), - NAME_FUNC_OFFSET(3971, glPolygonOffset, glPolygonOffset, NULL, 319), - NAME_FUNC_OFFSET(3987, glTexCoordPointer, glTexCoordPointer, NULL, 320), - NAME_FUNC_OFFSET(4005, glVertexPointer, glVertexPointer, NULL, 321), - NAME_FUNC_OFFSET(4021, glAreTexturesResident, glAreTexturesResident, NULL, - 322), - NAME_FUNC_OFFSET(4043, glCopyTexImage1D, glCopyTexImage1D, NULL, 323), - NAME_FUNC_OFFSET(4060, glCopyTexImage2D, glCopyTexImage2D, NULL, 324), - NAME_FUNC_OFFSET(4077, glCopyTexSubImage1D, glCopyTexSubImage1D, NULL, 325), - NAME_FUNC_OFFSET(4097, glCopyTexSubImage2D, glCopyTexSubImage2D, NULL, 326), - NAME_FUNC_OFFSET(4117, glDeleteTextures, glDeleteTextures, NULL, 327), - NAME_FUNC_OFFSET(4134, glGenTextures, glGenTextures, NULL, 328), - NAME_FUNC_OFFSET(4148, glGetPointerv, glGetPointerv, NULL, 329), - NAME_FUNC_OFFSET(4162, glIsTexture, glIsTexture, NULL, 330), - NAME_FUNC_OFFSET(4174, glPrioritizeTextures, glPrioritizeTextures, NULL, - 331), - NAME_FUNC_OFFSET(4195, glTexSubImage1D, glTexSubImage1D, NULL, 332), - NAME_FUNC_OFFSET(4211, glTexSubImage2D, glTexSubImage2D, NULL, 333), - NAME_FUNC_OFFSET(4227, glPopClientAttrib, glPopClientAttrib, NULL, 334), - NAME_FUNC_OFFSET(4245, glPushClientAttrib, glPushClientAttrib, NULL, 335), - NAME_FUNC_OFFSET(4264, glBlendColor, glBlendColor, NULL, 336), - NAME_FUNC_OFFSET(4277, glBlendEquation, glBlendEquation, NULL, 337), - NAME_FUNC_OFFSET(4293, glDrawRangeElements, glDrawRangeElements, NULL, 338), - NAME_FUNC_OFFSET(4313, glColorTable, glColorTable, NULL, 339), - NAME_FUNC_OFFSET(4326, glColorTableParameterfv, glColorTableParameterfv, - NULL, 340), - NAME_FUNC_OFFSET(4350, glColorTableParameteriv, glColorTableParameteriv, - NULL, 341), - NAME_FUNC_OFFSET(4374, glCopyColorTable, glCopyColorTable, NULL, 342), - NAME_FUNC_OFFSET(4391, glGetColorTable, glGetColorTable, NULL, 343), - NAME_FUNC_OFFSET(4407, glGetColorTableParameterfv, - glGetColorTableParameterfv, NULL, 344), - NAME_FUNC_OFFSET(4434, glGetColorTableParameteriv, - glGetColorTableParameteriv, NULL, 345), - NAME_FUNC_OFFSET(4461, glColorSubTable, glColorSubTable, NULL, 346), - NAME_FUNC_OFFSET(4477, glCopyColorSubTable, glCopyColorSubTable, NULL, 347), - NAME_FUNC_OFFSET(4497, glConvolutionFilter1D, glConvolutionFilter1D, NULL, - 348), - NAME_FUNC_OFFSET(4519, glConvolutionFilter2D, glConvolutionFilter2D, NULL, - 349), - NAME_FUNC_OFFSET(4541, glConvolutionParameterf, glConvolutionParameterf, - NULL, 350), - NAME_FUNC_OFFSET(4565, glConvolutionParameterfv, glConvolutionParameterfv, - NULL, 351), - NAME_FUNC_OFFSET(4590, glConvolutionParameteri, glConvolutionParameteri, - NULL, 352), - NAME_FUNC_OFFSET(4614, glConvolutionParameteriv, glConvolutionParameteriv, - NULL, 353), - NAME_FUNC_OFFSET(4639, glCopyConvolutionFilter1D, glCopyConvolutionFilter1D, - NULL, 354), - NAME_FUNC_OFFSET(4665, glCopyConvolutionFilter2D, glCopyConvolutionFilter2D, - NULL, 355), - NAME_FUNC_OFFSET(4691, glGetConvolutionFilter, glGetConvolutionFilter, NULL, - 356), - NAME_FUNC_OFFSET(4714, glGetConvolutionParameterfv, - glGetConvolutionParameterfv, NULL, 357), - NAME_FUNC_OFFSET(4742, glGetConvolutionParameteriv, - glGetConvolutionParameteriv, NULL, 358), - NAME_FUNC_OFFSET(4770, glGetSeparableFilter, glGetSeparableFilter, NULL, - 359), - NAME_FUNC_OFFSET(4791, glSeparableFilter2D, glSeparableFilter2D, NULL, 360), - NAME_FUNC_OFFSET(4811, glGetHistogram, glGetHistogram, NULL, 361), - NAME_FUNC_OFFSET(4826, glGetHistogramParameterfv, glGetHistogramParameterfv, - NULL, 362), - NAME_FUNC_OFFSET(4852, glGetHistogramParameteriv, glGetHistogramParameteriv, - NULL, 363), - NAME_FUNC_OFFSET(4878, glGetMinmax, glGetMinmax, NULL, 364), - NAME_FUNC_OFFSET(4890, glGetMinmaxParameterfv, glGetMinmaxParameterfv, NULL, - 365), - NAME_FUNC_OFFSET(4913, glGetMinmaxParameteriv, glGetMinmaxParameteriv, NULL, - 366), - NAME_FUNC_OFFSET(4936, glHistogram, glHistogram, NULL, 367), - NAME_FUNC_OFFSET(4948, glMinmax, glMinmax, NULL, 368), - NAME_FUNC_OFFSET(4957, glResetHistogram, glResetHistogram, NULL, 369), - NAME_FUNC_OFFSET(4974, glResetMinmax, glResetMinmax, NULL, 370), - NAME_FUNC_OFFSET(4988, glTexImage3D, glTexImage3D, NULL, 371), - NAME_FUNC_OFFSET(5001, glTexSubImage3D, glTexSubImage3D, NULL, 372), - NAME_FUNC_OFFSET(5017, glCopyTexSubImage3D, glCopyTexSubImage3D, NULL, 373), - NAME_FUNC_OFFSET(5037, glActiveTextureARB, glActiveTextureARB, NULL, 374), - NAME_FUNC_OFFSET(5056, glClientActiveTextureARB, glClientActiveTextureARB, - NULL, 375), - NAME_FUNC_OFFSET(5081, glMultiTexCoord1dARB, glMultiTexCoord1dARB, NULL, - 376), - NAME_FUNC_OFFSET(5102, glMultiTexCoord1dvARB, glMultiTexCoord1dvARB, NULL, - 377), - NAME_FUNC_OFFSET(5124, glMultiTexCoord1fARB, glMultiTexCoord1fARB, NULL, - 378), - NAME_FUNC_OFFSET(5145, glMultiTexCoord1fvARB, glMultiTexCoord1fvARB, NULL, - 379), - NAME_FUNC_OFFSET(5167, glMultiTexCoord1iARB, glMultiTexCoord1iARB, NULL, - 380), - NAME_FUNC_OFFSET(5188, glMultiTexCoord1ivARB, glMultiTexCoord1ivARB, NULL, - 381), - NAME_FUNC_OFFSET(5210, glMultiTexCoord1sARB, glMultiTexCoord1sARB, NULL, - 382), - NAME_FUNC_OFFSET(5231, glMultiTexCoord1svARB, glMultiTexCoord1svARB, NULL, - 383), - NAME_FUNC_OFFSET(5253, glMultiTexCoord2dARB, glMultiTexCoord2dARB, NULL, - 384), - NAME_FUNC_OFFSET(5274, glMultiTexCoord2dvARB, glMultiTexCoord2dvARB, NULL, - 385), - NAME_FUNC_OFFSET(5296, glMultiTexCoord2fARB, glMultiTexCoord2fARB, NULL, - 386), - NAME_FUNC_OFFSET(5317, glMultiTexCoord2fvARB, glMultiTexCoord2fvARB, NULL, - 387), - NAME_FUNC_OFFSET(5339, glMultiTexCoord2iARB, glMultiTexCoord2iARB, NULL, - 388), - NAME_FUNC_OFFSET(5360, glMultiTexCoord2ivARB, glMultiTexCoord2ivARB, NULL, - 389), - NAME_FUNC_OFFSET(5382, glMultiTexCoord2sARB, glMultiTexCoord2sARB, NULL, - 390), - NAME_FUNC_OFFSET(5403, glMultiTexCoord2svARB, glMultiTexCoord2svARB, NULL, - 391), - NAME_FUNC_OFFSET(5425, glMultiTexCoord3dARB, glMultiTexCoord3dARB, NULL, - 392), - NAME_FUNC_OFFSET(5446, glMultiTexCoord3dvARB, glMultiTexCoord3dvARB, NULL, - 393), - NAME_FUNC_OFFSET(5468, glMultiTexCoord3fARB, glMultiTexCoord3fARB, NULL, - 394), - NAME_FUNC_OFFSET(5489, glMultiTexCoord3fvARB, glMultiTexCoord3fvARB, NULL, - 395), - NAME_FUNC_OFFSET(5511, glMultiTexCoord3iARB, glMultiTexCoord3iARB, NULL, - 396), - NAME_FUNC_OFFSET(5532, glMultiTexCoord3ivARB, glMultiTexCoord3ivARB, NULL, - 397), - NAME_FUNC_OFFSET(5554, glMultiTexCoord3sARB, glMultiTexCoord3sARB, NULL, - 398), - NAME_FUNC_OFFSET(5575, glMultiTexCoord3svARB, glMultiTexCoord3svARB, NULL, - 399), - NAME_FUNC_OFFSET(5597, glMultiTexCoord4dARB, glMultiTexCoord4dARB, NULL, - 400), - NAME_FUNC_OFFSET(5618, glMultiTexCoord4dvARB, glMultiTexCoord4dvARB, NULL, - 401), - NAME_FUNC_OFFSET(5640, glMultiTexCoord4fARB, glMultiTexCoord4fARB, NULL, - 402), - NAME_FUNC_OFFSET(5661, glMultiTexCoord4fvARB, glMultiTexCoord4fvARB, NULL, - 403), - NAME_FUNC_OFFSET(5683, glMultiTexCoord4iARB, glMultiTexCoord4iARB, NULL, - 404), - NAME_FUNC_OFFSET(5704, glMultiTexCoord4ivARB, glMultiTexCoord4ivARB, NULL, - 405), - NAME_FUNC_OFFSET(5726, glMultiTexCoord4sARB, glMultiTexCoord4sARB, NULL, - 406), - NAME_FUNC_OFFSET(5747, glMultiTexCoord4svARB, glMultiTexCoord4svARB, NULL, - 407), - NAME_FUNC_OFFSET(5769, glAttachShader, glAttachShader, NULL, 408), - NAME_FUNC_OFFSET(5784, glCreateProgram, glCreateProgram, NULL, 409), - NAME_FUNC_OFFSET(5800, glCreateShader, glCreateShader, NULL, 410), - NAME_FUNC_OFFSET(5815, glDeleteProgram, glDeleteProgram, NULL, 411), - NAME_FUNC_OFFSET(5831, glDeleteShader, glDeleteShader, NULL, 412), - NAME_FUNC_OFFSET(5846, glDetachShader, glDetachShader, NULL, 413), - NAME_FUNC_OFFSET(5861, glGetAttachedShaders, glGetAttachedShaders, NULL, - 414), - NAME_FUNC_OFFSET(5882, glGetProgramInfoLog, glGetProgramInfoLog, NULL, 415), - NAME_FUNC_OFFSET(5902, glGetProgramiv, glGetProgramiv, NULL, 416), - NAME_FUNC_OFFSET(5917, glGetShaderInfoLog, glGetShaderInfoLog, NULL, 417), - NAME_FUNC_OFFSET(5936, glGetShaderiv, glGetShaderiv, NULL, 418), - NAME_FUNC_OFFSET(5950, glIsProgram, glIsProgram, NULL, 419), - NAME_FUNC_OFFSET(5962, glIsShader, glIsShader, NULL, 420), - NAME_FUNC_OFFSET(5973, glStencilFuncSeparate, glStencilFuncSeparate, NULL, - 421), - NAME_FUNC_OFFSET(5995, glStencilMaskSeparate, glStencilMaskSeparate, NULL, - 422), - NAME_FUNC_OFFSET(6017, glStencilOpSeparate, glStencilOpSeparate, NULL, 423), - NAME_FUNC_OFFSET(6037, glUniformMatrix2x3fv, glUniformMatrix2x3fv, NULL, - 424), - NAME_FUNC_OFFSET(6058, glUniformMatrix2x4fv, glUniformMatrix2x4fv, NULL, - 425), - NAME_FUNC_OFFSET(6079, glUniformMatrix3x2fv, glUniformMatrix3x2fv, NULL, - 426), - NAME_FUNC_OFFSET(6100, glUniformMatrix3x4fv, glUniformMatrix3x4fv, NULL, - 427), - NAME_FUNC_OFFSET(6121, glUniformMatrix4x2fv, glUniformMatrix4x2fv, NULL, - 428), - NAME_FUNC_OFFSET(6142, glUniformMatrix4x3fv, glUniformMatrix4x3fv, NULL, - 429), - NAME_FUNC_OFFSET(6163, glClampColor, glClampColor, NULL, 430), - NAME_FUNC_OFFSET(6176, glClearBufferfi, glClearBufferfi, NULL, 431), - NAME_FUNC_OFFSET(6192, glClearBufferfv, glClearBufferfv, NULL, 432), - NAME_FUNC_OFFSET(6208, glClearBufferiv, glClearBufferiv, NULL, 433), - NAME_FUNC_OFFSET(6224, glClearBufferuiv, glClearBufferuiv, NULL, 434), - NAME_FUNC_OFFSET(6241, glGetStringi, glGetStringi, NULL, 435), - NAME_FUNC_OFFSET(6254, glTexBuffer, glTexBuffer, NULL, 436), - NAME_FUNC_OFFSET(6266, glFramebufferTexture, glFramebufferTexture, NULL, - 437), - NAME_FUNC_OFFSET(6287, glGetBufferParameteri64v, glGetBufferParameteri64v, - NULL, 438), - NAME_FUNC_OFFSET(6312, glGetInteger64i_v, glGetInteger64i_v, NULL, 439), - NAME_FUNC_OFFSET(6330, glVertexAttribDivisor, glVertexAttribDivisor, NULL, - 440), - NAME_FUNC_OFFSET(6352, glLoadTransposeMatrixdARB, glLoadTransposeMatrixdARB, - NULL, 441), - NAME_FUNC_OFFSET(6378, glLoadTransposeMatrixfARB, glLoadTransposeMatrixfARB, - NULL, 442), - NAME_FUNC_OFFSET(6404, glMultTransposeMatrixdARB, glMultTransposeMatrixdARB, - NULL, 443), - NAME_FUNC_OFFSET(6430, glMultTransposeMatrixfARB, glMultTransposeMatrixfARB, - NULL, 444), - NAME_FUNC_OFFSET(6456, glSampleCoverageARB, glSampleCoverageARB, NULL, 445), - NAME_FUNC_OFFSET(6476, glCompressedTexImage1DARB, glCompressedTexImage1DARB, - NULL, 446), - NAME_FUNC_OFFSET(6502, glCompressedTexImage2DARB, glCompressedTexImage2DARB, - NULL, 447), - NAME_FUNC_OFFSET(6528, glCompressedTexImage3DARB, glCompressedTexImage3DARB, - NULL, 448), - NAME_FUNC_OFFSET(6554, glCompressedTexSubImage1DARB, - glCompressedTexSubImage1DARB, NULL, 449), - NAME_FUNC_OFFSET(6583, glCompressedTexSubImage2DARB, - glCompressedTexSubImage2DARB, NULL, 450), - NAME_FUNC_OFFSET(6612, glCompressedTexSubImage3DARB, - glCompressedTexSubImage3DARB, NULL, 451), - NAME_FUNC_OFFSET(6641, glGetCompressedTexImageARB, - glGetCompressedTexImageARB, NULL, 452), - NAME_FUNC_OFFSET(6668, glDisableVertexAttribArrayARB, - glDisableVertexAttribArrayARB, NULL, 453), - NAME_FUNC_OFFSET(6698, glEnableVertexAttribArrayARB, - glEnableVertexAttribArrayARB, NULL, 454), - NAME_FUNC_OFFSET(6727, glGetProgramEnvParameterdvARB, - glGetProgramEnvParameterdvARB, NULL, 455), - NAME_FUNC_OFFSET(6757, glGetProgramEnvParameterfvARB, - glGetProgramEnvParameterfvARB, NULL, 456), - NAME_FUNC_OFFSET(6787, glGetProgramLocalParameterdvARB, - glGetProgramLocalParameterdvARB, NULL, 457), - NAME_FUNC_OFFSET(6819, glGetProgramLocalParameterfvARB, - glGetProgramLocalParameterfvARB, NULL, 458), - NAME_FUNC_OFFSET(6851, glGetProgramStringARB, glGetProgramStringARB, NULL, - 459), - NAME_FUNC_OFFSET(6873, glGetProgramivARB, glGetProgramivARB, NULL, 460), - NAME_FUNC_OFFSET(6891, glGetVertexAttribdvARB, glGetVertexAttribdvARB, NULL, - 461), - NAME_FUNC_OFFSET(6914, glGetVertexAttribfvARB, glGetVertexAttribfvARB, NULL, - 462), - NAME_FUNC_OFFSET(6937, glGetVertexAttribivARB, glGetVertexAttribivARB, NULL, - 463), - NAME_FUNC_OFFSET(6960, glProgramEnvParameter4dARB, - glProgramEnvParameter4dARB, NULL, 464), - NAME_FUNC_OFFSET(6987, glProgramEnvParameter4dvARB, - glProgramEnvParameter4dvARB, NULL, 465), - NAME_FUNC_OFFSET(7015, glProgramEnvParameter4fARB, - glProgramEnvParameter4fARB, NULL, 466), - NAME_FUNC_OFFSET(7042, glProgramEnvParameter4fvARB, - glProgramEnvParameter4fvARB, NULL, 467), - NAME_FUNC_OFFSET(7070, glProgramLocalParameter4dARB, - glProgramLocalParameter4dARB, NULL, 468), - NAME_FUNC_OFFSET(7099, glProgramLocalParameter4dvARB, - glProgramLocalParameter4dvARB, NULL, 469), - NAME_FUNC_OFFSET(7129, glProgramLocalParameter4fARB, - glProgramLocalParameter4fARB, NULL, 470), - NAME_FUNC_OFFSET(7158, glProgramLocalParameter4fvARB, - glProgramLocalParameter4fvARB, NULL, 471), - NAME_FUNC_OFFSET(7188, glProgramStringARB, glProgramStringARB, NULL, 472), - NAME_FUNC_OFFSET(7207, glVertexAttrib1dARB, glVertexAttrib1dARB, NULL, 473), - NAME_FUNC_OFFSET(7227, glVertexAttrib1dvARB, glVertexAttrib1dvARB, NULL, - 474), - NAME_FUNC_OFFSET(7248, glVertexAttrib1fARB, glVertexAttrib1fARB, NULL, 475), - NAME_FUNC_OFFSET(7268, glVertexAttrib1fvARB, glVertexAttrib1fvARB, NULL, - 476), - NAME_FUNC_OFFSET(7289, glVertexAttrib1sARB, glVertexAttrib1sARB, NULL, 477), - NAME_FUNC_OFFSET(7309, glVertexAttrib1svARB, glVertexAttrib1svARB, NULL, - 478), - NAME_FUNC_OFFSET(7330, glVertexAttrib2dARB, glVertexAttrib2dARB, NULL, 479), - NAME_FUNC_OFFSET(7350, glVertexAttrib2dvARB, glVertexAttrib2dvARB, NULL, - 480), - NAME_FUNC_OFFSET(7371, glVertexAttrib2fARB, glVertexAttrib2fARB, NULL, 481), - NAME_FUNC_OFFSET(7391, glVertexAttrib2fvARB, glVertexAttrib2fvARB, NULL, - 482), - NAME_FUNC_OFFSET(7412, glVertexAttrib2sARB, glVertexAttrib2sARB, NULL, 483), - NAME_FUNC_OFFSET(7432, glVertexAttrib2svARB, glVertexAttrib2svARB, NULL, - 484), - NAME_FUNC_OFFSET(7453, glVertexAttrib3dARB, glVertexAttrib3dARB, NULL, 485), - NAME_FUNC_OFFSET(7473, glVertexAttrib3dvARB, glVertexAttrib3dvARB, NULL, - 486), - NAME_FUNC_OFFSET(7494, glVertexAttrib3fARB, glVertexAttrib3fARB, NULL, 487), - NAME_FUNC_OFFSET(7514, glVertexAttrib3fvARB, glVertexAttrib3fvARB, NULL, - 488), - NAME_FUNC_OFFSET(7535, glVertexAttrib3sARB, glVertexAttrib3sARB, NULL, 489), - NAME_FUNC_OFFSET(7555, glVertexAttrib3svARB, glVertexAttrib3svARB, NULL, - 490), - NAME_FUNC_OFFSET(7576, glVertexAttrib4NbvARB, glVertexAttrib4NbvARB, NULL, - 491), - NAME_FUNC_OFFSET(7598, glVertexAttrib4NivARB, glVertexAttrib4NivARB, NULL, - 492), - NAME_FUNC_OFFSET(7620, glVertexAttrib4NsvARB, glVertexAttrib4NsvARB, NULL, - 493), - NAME_FUNC_OFFSET(7642, glVertexAttrib4NubARB, glVertexAttrib4NubARB, NULL, - 494), - NAME_FUNC_OFFSET(7664, glVertexAttrib4NubvARB, glVertexAttrib4NubvARB, NULL, - 495), - NAME_FUNC_OFFSET(7687, glVertexAttrib4NuivARB, glVertexAttrib4NuivARB, NULL, - 496), - NAME_FUNC_OFFSET(7710, glVertexAttrib4NusvARB, glVertexAttrib4NusvARB, NULL, - 497), - NAME_FUNC_OFFSET(7733, glVertexAttrib4bvARB, glVertexAttrib4bvARB, NULL, - 498), - NAME_FUNC_OFFSET(7754, glVertexAttrib4dARB, glVertexAttrib4dARB, NULL, 499), - NAME_FUNC_OFFSET(7774, glVertexAttrib4dvARB, glVertexAttrib4dvARB, NULL, - 500), - NAME_FUNC_OFFSET(7795, glVertexAttrib4fARB, glVertexAttrib4fARB, NULL, 501), - NAME_FUNC_OFFSET(7815, glVertexAttrib4fvARB, glVertexAttrib4fvARB, NULL, - 502), - NAME_FUNC_OFFSET(7836, glVertexAttrib4ivARB, glVertexAttrib4ivARB, NULL, - 503), - NAME_FUNC_OFFSET(7857, glVertexAttrib4sARB, glVertexAttrib4sARB, NULL, 504), - NAME_FUNC_OFFSET(7877, glVertexAttrib4svARB, glVertexAttrib4svARB, NULL, - 505), - NAME_FUNC_OFFSET(7898, glVertexAttrib4ubvARB, glVertexAttrib4ubvARB, NULL, - 506), - NAME_FUNC_OFFSET(7920, glVertexAttrib4uivARB, glVertexAttrib4uivARB, NULL, - 507), - NAME_FUNC_OFFSET(7942, glVertexAttrib4usvARB, glVertexAttrib4usvARB, NULL, - 508), - NAME_FUNC_OFFSET(7964, glVertexAttribPointerARB, glVertexAttribPointerARB, - NULL, 509), - NAME_FUNC_OFFSET(7989, glBindBufferARB, glBindBufferARB, NULL, 510), - NAME_FUNC_OFFSET(8005, glBufferDataARB, glBufferDataARB, NULL, 511), - NAME_FUNC_OFFSET(8021, glBufferSubDataARB, glBufferSubDataARB, NULL, 512), - NAME_FUNC_OFFSET(8040, glDeleteBuffersARB, glDeleteBuffersARB, NULL, 513), - NAME_FUNC_OFFSET(8059, glGenBuffersARB, glGenBuffersARB, NULL, 514), - NAME_FUNC_OFFSET(8075, glGetBufferParameterivARB, glGetBufferParameterivARB, - NULL, 515), - NAME_FUNC_OFFSET(8101, glGetBufferPointervARB, glGetBufferPointervARB, NULL, - 516), - NAME_FUNC_OFFSET(8124, glGetBufferSubDataARB, glGetBufferSubDataARB, NULL, - 517), - NAME_FUNC_OFFSET(8146, glIsBufferARB, glIsBufferARB, NULL, 518), - NAME_FUNC_OFFSET(8160, glMapBufferARB, glMapBufferARB, NULL, 519), - NAME_FUNC_OFFSET(8175, glUnmapBufferARB, glUnmapBufferARB, NULL, 520), - NAME_FUNC_OFFSET(8192, glBeginQueryARB, glBeginQueryARB, NULL, 521), - NAME_FUNC_OFFSET(8208, glDeleteQueriesARB, glDeleteQueriesARB, NULL, 522), - NAME_FUNC_OFFSET(8227, glEndQueryARB, glEndQueryARB, NULL, 523), - NAME_FUNC_OFFSET(8241, glGenQueriesARB, glGenQueriesARB, NULL, 524), - NAME_FUNC_OFFSET(8257, glGetQueryObjectivARB, glGetQueryObjectivARB, NULL, - 525), - NAME_FUNC_OFFSET(8279, glGetQueryObjectuivARB, glGetQueryObjectuivARB, NULL, - 526), - NAME_FUNC_OFFSET(8302, glGetQueryivARB, glGetQueryivARB, NULL, 527), - NAME_FUNC_OFFSET(8318, glIsQueryARB, glIsQueryARB, NULL, 528), - NAME_FUNC_OFFSET(8331, glAttachObjectARB, glAttachObjectARB, NULL, 529), - NAME_FUNC_OFFSET(8349, glCompileShaderARB, glCompileShaderARB, NULL, 530), - NAME_FUNC_OFFSET(8368, glCreateProgramObjectARB, glCreateProgramObjectARB, - NULL, 531), - NAME_FUNC_OFFSET(8393, glCreateShaderObjectARB, glCreateShaderObjectARB, - NULL, 532), - NAME_FUNC_OFFSET(8417, glDeleteObjectARB, glDeleteObjectARB, NULL, 533), - NAME_FUNC_OFFSET(8435, glDetachObjectARB, glDetachObjectARB, NULL, 534), - NAME_FUNC_OFFSET(8453, glGetActiveUniformARB, glGetActiveUniformARB, NULL, - 535), - NAME_FUNC_OFFSET(8475, glGetAttachedObjectsARB, glGetAttachedObjectsARB, - NULL, 536), - NAME_FUNC_OFFSET(8499, glGetHandleARB, glGetHandleARB, NULL, 537), - NAME_FUNC_OFFSET(8514, glGetInfoLogARB, glGetInfoLogARB, NULL, 538), - NAME_FUNC_OFFSET(8530, glGetObjectParameterfvARB, glGetObjectParameterfvARB, - NULL, 539), - NAME_FUNC_OFFSET(8556, glGetObjectParameterivARB, glGetObjectParameterivARB, - NULL, 540), - NAME_FUNC_OFFSET(8582, glGetShaderSourceARB, glGetShaderSourceARB, NULL, - 541), - NAME_FUNC_OFFSET(8603, glGetUniformLocationARB, glGetUniformLocationARB, - NULL, 542), - NAME_FUNC_OFFSET(8627, glGetUniformfvARB, glGetUniformfvARB, NULL, 543), - NAME_FUNC_OFFSET(8645, glGetUniformivARB, glGetUniformivARB, NULL, 544), - NAME_FUNC_OFFSET(8663, glLinkProgramARB, glLinkProgramARB, NULL, 545), - NAME_FUNC_OFFSET(8680, glShaderSourceARB, glShaderSourceARB, NULL, 546), - NAME_FUNC_OFFSET(8698, glUniform1fARB, glUniform1fARB, NULL, 547), - NAME_FUNC_OFFSET(8713, glUniform1fvARB, glUniform1fvARB, NULL, 548), - NAME_FUNC_OFFSET(8729, glUniform1iARB, glUniform1iARB, NULL, 549), - NAME_FUNC_OFFSET(8744, glUniform1ivARB, glUniform1ivARB, NULL, 550), - NAME_FUNC_OFFSET(8760, glUniform2fARB, glUniform2fARB, NULL, 551), - NAME_FUNC_OFFSET(8775, glUniform2fvARB, glUniform2fvARB, NULL, 552), - NAME_FUNC_OFFSET(8791, glUniform2iARB, glUniform2iARB, NULL, 553), - NAME_FUNC_OFFSET(8806, glUniform2ivARB, glUniform2ivARB, NULL, 554), - NAME_FUNC_OFFSET(8822, glUniform3fARB, glUniform3fARB, NULL, 555), - NAME_FUNC_OFFSET(8837, glUniform3fvARB, glUniform3fvARB, NULL, 556), - NAME_FUNC_OFFSET(8853, glUniform3iARB, glUniform3iARB, NULL, 557), - NAME_FUNC_OFFSET(8868, glUniform3ivARB, glUniform3ivARB, NULL, 558), - NAME_FUNC_OFFSET(8884, glUniform4fARB, glUniform4fARB, NULL, 559), - NAME_FUNC_OFFSET(8899, glUniform4fvARB, glUniform4fvARB, NULL, 560), - NAME_FUNC_OFFSET(8915, glUniform4iARB, glUniform4iARB, NULL, 561), - NAME_FUNC_OFFSET(8930, glUniform4ivARB, glUniform4ivARB, NULL, 562), - NAME_FUNC_OFFSET(8946, glUniformMatrix2fvARB, glUniformMatrix2fvARB, NULL, - 563), - NAME_FUNC_OFFSET(8968, glUniformMatrix3fvARB, glUniformMatrix3fvARB, NULL, - 564), - NAME_FUNC_OFFSET(8990, glUniformMatrix4fvARB, glUniformMatrix4fvARB, NULL, - 565), - NAME_FUNC_OFFSET(9012, glUseProgramObjectARB, glUseProgramObjectARB, NULL, - 566), - NAME_FUNC_OFFSET(9034, glValidateProgramARB, glValidateProgramARB, NULL, - 567), - NAME_FUNC_OFFSET(9055, glBindAttribLocationARB, glBindAttribLocationARB, - NULL, 568), - NAME_FUNC_OFFSET(9079, glGetActiveAttribARB, glGetActiveAttribARB, NULL, - 569), - NAME_FUNC_OFFSET(9100, glGetAttribLocationARB, glGetAttribLocationARB, NULL, - 570), - NAME_FUNC_OFFSET(9123, glDrawBuffersARB, glDrawBuffersARB, NULL, 571), - NAME_FUNC_OFFSET(9140, glClampColorARB, glClampColorARB, NULL, 572), - NAME_FUNC_OFFSET(9156, glDrawArraysInstancedARB, glDrawArraysInstancedARB, - NULL, 573), - NAME_FUNC_OFFSET(9181, glDrawElementsInstancedARB, - glDrawElementsInstancedARB, NULL, 574), - NAME_FUNC_OFFSET(9208, glRenderbufferStorageMultisample, - glRenderbufferStorageMultisample, NULL, 575), - NAME_FUNC_OFFSET(9241, glFramebufferTextureARB, glFramebufferTextureARB, - NULL, 576), - NAME_FUNC_OFFSET(9265, glFramebufferTextureFaceARB, - glFramebufferTextureFaceARB, NULL, 577), - NAME_FUNC_OFFSET(9293, glProgramParameteriARB, glProgramParameteriARB, NULL, - 578), - NAME_FUNC_OFFSET(9316, glVertexAttribDivisorARB, glVertexAttribDivisorARB, - NULL, 579), - NAME_FUNC_OFFSET(9341, glFlushMappedBufferRange, glFlushMappedBufferRange, - NULL, 580), - NAME_FUNC_OFFSET(9366, glMapBufferRange, glMapBufferRange, NULL, 581), - NAME_FUNC_OFFSET(9383, glTexBufferARB, glTexBufferARB, NULL, 582), - NAME_FUNC_OFFSET(9398, glBindVertexArray, glBindVertexArray, NULL, 583), - NAME_FUNC_OFFSET(9416, glGenVertexArrays, glGenVertexArrays, NULL, 584), - NAME_FUNC_OFFSET(9434, glCopyBufferSubData, glCopyBufferSubData, NULL, 585), - NAME_FUNC_OFFSET(9454, glClientWaitSync, glClientWaitSync, NULL, 586), - NAME_FUNC_OFFSET(9471, glDeleteSync, glDeleteSync, NULL, 587), - NAME_FUNC_OFFSET(9484, glFenceSync, glFenceSync, NULL, 588), - NAME_FUNC_OFFSET(9496, glGetInteger64v, glGetInteger64v, NULL, 589), - NAME_FUNC_OFFSET(9512, glGetSynciv, glGetSynciv, NULL, 590), - NAME_FUNC_OFFSET(9524, glIsSync, glIsSync, NULL, 591), - NAME_FUNC_OFFSET(9533, glWaitSync, glWaitSync, NULL, 592), - NAME_FUNC_OFFSET(9544, glDrawElementsBaseVertex, glDrawElementsBaseVertex, - NULL, 593), - NAME_FUNC_OFFSET(9569, glDrawElementsInstancedBaseVertex, - glDrawElementsInstancedBaseVertex, NULL, 594), - NAME_FUNC_OFFSET(9603, glDrawRangeElementsBaseVertex, - glDrawRangeElementsBaseVertex, NULL, 595), - NAME_FUNC_OFFSET(9633, glMultiDrawElementsBaseVertex, - glMultiDrawElementsBaseVertex, NULL, 596), - NAME_FUNC_OFFSET(9663, glBlendEquationSeparateiARB, - glBlendEquationSeparateiARB, NULL, 597), - NAME_FUNC_OFFSET(9691, glBlendEquationiARB, glBlendEquationiARB, NULL, 598), - NAME_FUNC_OFFSET(9711, glBlendFuncSeparateiARB, glBlendFuncSeparateiARB, - NULL, 599), - NAME_FUNC_OFFSET(9735, glBlendFunciARB, glBlendFunciARB, NULL, 600), - NAME_FUNC_OFFSET(9751, glBindSampler, glBindSampler, NULL, 601), - NAME_FUNC_OFFSET(9765, glDeleteSamplers, glDeleteSamplers, NULL, 602), - NAME_FUNC_OFFSET(9782, glGenSamplers, glGenSamplers, NULL, 603), - NAME_FUNC_OFFSET(9796, glGetSamplerParameterIiv, glGetSamplerParameterIiv, - NULL, 604), - NAME_FUNC_OFFSET(9821, glGetSamplerParameterIuiv, glGetSamplerParameterIuiv, - NULL, 605), - NAME_FUNC_OFFSET(9847, glGetSamplerParameterfv, glGetSamplerParameterfv, - NULL, 606), - NAME_FUNC_OFFSET(9871, glGetSamplerParameteriv, glGetSamplerParameteriv, - NULL, 607), - NAME_FUNC_OFFSET(9895, glIsSampler, glIsSampler, NULL, 608), - NAME_FUNC_OFFSET(9907, glSamplerParameterIiv, glSamplerParameterIiv, NULL, - 609), - NAME_FUNC_OFFSET(9929, glSamplerParameterIuiv, glSamplerParameterIuiv, NULL, - 610), - NAME_FUNC_OFFSET(9952, glSamplerParameterf, glSamplerParameterf, NULL, 611), - NAME_FUNC_OFFSET(9972, glSamplerParameterfv, glSamplerParameterfv, NULL, - 612), - NAME_FUNC_OFFSET(9993, glSamplerParameteri, glSamplerParameteri, NULL, 613), - NAME_FUNC_OFFSET(10013, glSamplerParameteriv, glSamplerParameteriv, NULL, - 614), - NAME_FUNC_OFFSET(10034, glColorP3ui, glColorP3ui, NULL, 615), - NAME_FUNC_OFFSET(10046, glColorP3uiv, glColorP3uiv, NULL, 616), - NAME_FUNC_OFFSET(10059, glColorP4ui, glColorP4ui, NULL, 617), - NAME_FUNC_OFFSET(10071, glColorP4uiv, glColorP4uiv, NULL, 618), - NAME_FUNC_OFFSET(10084, glMultiTexCoordP1ui, glMultiTexCoordP1ui, NULL, - 619), - NAME_FUNC_OFFSET(10104, glMultiTexCoordP1uiv, glMultiTexCoordP1uiv, NULL, - 620), - NAME_FUNC_OFFSET(10125, glMultiTexCoordP2ui, glMultiTexCoordP2ui, NULL, - 621), - NAME_FUNC_OFFSET(10145, glMultiTexCoordP2uiv, glMultiTexCoordP2uiv, NULL, - 622), - NAME_FUNC_OFFSET(10166, glMultiTexCoordP3ui, glMultiTexCoordP3ui, NULL, - 623), - NAME_FUNC_OFFSET(10186, glMultiTexCoordP3uiv, glMultiTexCoordP3uiv, NULL, - 624), - NAME_FUNC_OFFSET(10207, glMultiTexCoordP4ui, glMultiTexCoordP4ui, NULL, - 625), - NAME_FUNC_OFFSET(10227, glMultiTexCoordP4uiv, glMultiTexCoordP4uiv, NULL, - 626), - NAME_FUNC_OFFSET(10248, glNormalP3ui, glNormalP3ui, NULL, 627), - NAME_FUNC_OFFSET(10261, glNormalP3uiv, glNormalP3uiv, NULL, 628), - NAME_FUNC_OFFSET(10275, glSecondaryColorP3ui, glSecondaryColorP3ui, NULL, - 629), - NAME_FUNC_OFFSET(10296, glSecondaryColorP3uiv, glSecondaryColorP3uiv, NULL, - 630), - NAME_FUNC_OFFSET(10318, glTexCoordP1ui, glTexCoordP1ui, NULL, 631), - NAME_FUNC_OFFSET(10333, glTexCoordP1uiv, glTexCoordP1uiv, NULL, 632), - NAME_FUNC_OFFSET(10349, glTexCoordP2ui, glTexCoordP2ui, NULL, 633), - NAME_FUNC_OFFSET(10364, glTexCoordP2uiv, glTexCoordP2uiv, NULL, 634), - NAME_FUNC_OFFSET(10380, glTexCoordP3ui, glTexCoordP3ui, NULL, 635), - NAME_FUNC_OFFSET(10395, glTexCoordP3uiv, glTexCoordP3uiv, NULL, 636), - NAME_FUNC_OFFSET(10411, glTexCoordP4ui, glTexCoordP4ui, NULL, 637), - NAME_FUNC_OFFSET(10426, glTexCoordP4uiv, glTexCoordP4uiv, NULL, 638), - NAME_FUNC_OFFSET(10442, glVertexAttribP1ui, glVertexAttribP1ui, NULL, 639), - NAME_FUNC_OFFSET(10461, glVertexAttribP1uiv, glVertexAttribP1uiv, NULL, - 640), - NAME_FUNC_OFFSET(10481, glVertexAttribP2ui, glVertexAttribP2ui, NULL, 641), - NAME_FUNC_OFFSET(10500, glVertexAttribP2uiv, glVertexAttribP2uiv, NULL, - 642), - NAME_FUNC_OFFSET(10520, glVertexAttribP3ui, glVertexAttribP3ui, NULL, 643), - NAME_FUNC_OFFSET(10539, glVertexAttribP3uiv, glVertexAttribP3uiv, NULL, - 644), - NAME_FUNC_OFFSET(10559, glVertexAttribP4ui, glVertexAttribP4ui, NULL, 645), - NAME_FUNC_OFFSET(10578, glVertexAttribP4uiv, glVertexAttribP4uiv, NULL, - 646), - NAME_FUNC_OFFSET(10598, glVertexP2ui, glVertexP2ui, NULL, 647), - NAME_FUNC_OFFSET(10611, glVertexP2uiv, glVertexP2uiv, NULL, 648), - NAME_FUNC_OFFSET(10625, glVertexP3ui, glVertexP3ui, NULL, 649), - NAME_FUNC_OFFSET(10638, glVertexP3uiv, glVertexP3uiv, NULL, 650), - NAME_FUNC_OFFSET(10652, glVertexP4ui, glVertexP4ui, NULL, 651), - NAME_FUNC_OFFSET(10665, glVertexP4uiv, glVertexP4uiv, NULL, 652), - NAME_FUNC_OFFSET(10679, glBindTransformFeedback, glBindTransformFeedback, - NULL, 653), - NAME_FUNC_OFFSET(10703, glDeleteTransformFeedbacks, - glDeleteTransformFeedbacks, NULL, 654), - NAME_FUNC_OFFSET(10730, glDrawTransformFeedback, glDrawTransformFeedback, - NULL, 655), - NAME_FUNC_OFFSET(10754, glGenTransformFeedbacks, glGenTransformFeedbacks, - NULL, 656), - NAME_FUNC_OFFSET(10778, glIsTransformFeedback, glIsTransformFeedback, NULL, - 657), - NAME_FUNC_OFFSET(10800, glPauseTransformFeedback, glPauseTransformFeedback, - NULL, 658), - NAME_FUNC_OFFSET(10825, glResumeTransformFeedback, - glResumeTransformFeedback, NULL, 659), - NAME_FUNC_OFFSET(10851, glClearDepthf, glClearDepthf, NULL, 660), - NAME_FUNC_OFFSET(10865, glDepthRangef, glDepthRangef, NULL, 661), - NAME_FUNC_OFFSET(10879, glGetShaderPrecisionFormat, - glGetShaderPrecisionFormat, NULL, 662), - NAME_FUNC_OFFSET(10906, glReleaseShaderCompiler, glReleaseShaderCompiler, - NULL, 663), - NAME_FUNC_OFFSET(10930, glShaderBinary, glShaderBinary, NULL, 664), - NAME_FUNC_OFFSET(10945, glGetGraphicsResetStatusARB, - glGetGraphicsResetStatusARB, NULL, 665), - NAME_FUNC_OFFSET(10973, glGetnColorTableARB, glGetnColorTableARB, NULL, - 666), - NAME_FUNC_OFFSET(10993, glGetnCompressedTexImageARB, - glGetnCompressedTexImageARB, NULL, 667), - NAME_FUNC_OFFSET(11021, glGetnConvolutionFilterARB, - glGetnConvolutionFilterARB, NULL, 668), - NAME_FUNC_OFFSET(11048, glGetnHistogramARB, glGetnHistogramARB, NULL, 669), - NAME_FUNC_OFFSET(11067, glGetnMapdvARB, glGetnMapdvARB, NULL, 670), - NAME_FUNC_OFFSET(11082, glGetnMapfvARB, glGetnMapfvARB, NULL, 671), - NAME_FUNC_OFFSET(11097, glGetnMapivARB, glGetnMapivARB, NULL, 672), - NAME_FUNC_OFFSET(11112, glGetnMinmaxARB, glGetnMinmaxARB, NULL, 673), - NAME_FUNC_OFFSET(11128, glGetnPixelMapfvARB, glGetnPixelMapfvARB, NULL, - 674), - NAME_FUNC_OFFSET(11148, glGetnPixelMapuivARB, glGetnPixelMapuivARB, NULL, - 675), - NAME_FUNC_OFFSET(11169, glGetnPixelMapusvARB, glGetnPixelMapusvARB, NULL, - 676), - NAME_FUNC_OFFSET(11190, glGetnPolygonStippleARB, glGetnPolygonStippleARB, - NULL, 677), - NAME_FUNC_OFFSET(11214, glGetnSeparableFilterARB, glGetnSeparableFilterARB, - NULL, 678), - NAME_FUNC_OFFSET(11239, glGetnTexImageARB, glGetnTexImageARB, NULL, 679), - NAME_FUNC_OFFSET(11257, glGetnUniformdvARB, glGetnUniformdvARB, NULL, 680), - NAME_FUNC_OFFSET(11276, glGetnUniformfvARB, glGetnUniformfvARB, NULL, 681), - NAME_FUNC_OFFSET(11295, glGetnUniformivARB, glGetnUniformivARB, NULL, 682), - NAME_FUNC_OFFSET(11314, glGetnUniformuivARB, glGetnUniformuivARB, NULL, - 683), - NAME_FUNC_OFFSET(11334, glReadnPixelsARB, glReadnPixelsARB, NULL, 684), - NAME_FUNC_OFFSET(11351, glTexStorage1D, glTexStorage1D, NULL, 685), - NAME_FUNC_OFFSET(11366, glTexStorage2D, glTexStorage2D, NULL, 686), - NAME_FUNC_OFFSET(11381, glTexStorage3D, glTexStorage3D, NULL, 687), - NAME_FUNC_OFFSET(11396, glTextureStorage1DEXT, glTextureStorage1DEXT, NULL, - 688), - NAME_FUNC_OFFSET(11418, glTextureStorage2DEXT, glTextureStorage2DEXT, NULL, - 689), - NAME_FUNC_OFFSET(11440, glTextureStorage3DEXT, glTextureStorage3DEXT, NULL, - 690), - NAME_FUNC_OFFSET(11462, glPolygonOffsetEXT, glPolygonOffsetEXT, NULL, 691), - NAME_FUNC_OFFSET(11481, gl_dispatch_stub_692, gl_dispatch_stub_692, NULL, - 692), - NAME_FUNC_OFFSET(11513, gl_dispatch_stub_693, gl_dispatch_stub_693, NULL, - 693), - NAME_FUNC_OFFSET(11545, gl_dispatch_stub_694, gl_dispatch_stub_694, NULL, - 694), - NAME_FUNC_OFFSET(11573, gl_dispatch_stub_695, gl_dispatch_stub_695, NULL, - 695), - NAME_FUNC_OFFSET(11602, gl_dispatch_stub_696, gl_dispatch_stub_696, NULL, - 696), - NAME_FUNC_OFFSET(11630, gl_dispatch_stub_697, gl_dispatch_stub_697, NULL, - 697), - NAME_FUNC_OFFSET(11659, gl_dispatch_stub_698, gl_dispatch_stub_698, NULL, - 698), - NAME_FUNC_OFFSET(11676, gl_dispatch_stub_699, gl_dispatch_stub_699, NULL, - 699), - NAME_FUNC_OFFSET(11696, glColorPointerEXT, glColorPointerEXT, NULL, 700), - NAME_FUNC_OFFSET(11714, glEdgeFlagPointerEXT, glEdgeFlagPointerEXT, NULL, - 701), - NAME_FUNC_OFFSET(11735, glIndexPointerEXT, glIndexPointerEXT, NULL, 702), - NAME_FUNC_OFFSET(11753, glNormalPointerEXT, glNormalPointerEXT, NULL, 703), - NAME_FUNC_OFFSET(11772, glTexCoordPointerEXT, glTexCoordPointerEXT, NULL, - 704), - NAME_FUNC_OFFSET(11793, glVertexPointerEXT, glVertexPointerEXT, NULL, 705), - NAME_FUNC_OFFSET(11812, glPointParameterfEXT, glPointParameterfEXT, NULL, - 706), - NAME_FUNC_OFFSET(11833, glPointParameterfvEXT, glPointParameterfvEXT, NULL, - 707), - NAME_FUNC_OFFSET(11855, glLockArraysEXT, glLockArraysEXT, NULL, 708), - NAME_FUNC_OFFSET(11871, glUnlockArraysEXT, glUnlockArraysEXT, NULL, 709), - NAME_FUNC_OFFSET(11889, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, - 710), - NAME_FUNC_OFFSET(11911, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, - NULL, 711), - NAME_FUNC_OFFSET(11934, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, - 712), - NAME_FUNC_OFFSET(11956, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, - NULL, 713), - NAME_FUNC_OFFSET(11979, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, - 714), - NAME_FUNC_OFFSET(12001, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, - NULL, 715), - NAME_FUNC_OFFSET(12024, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, - 716), - NAME_FUNC_OFFSET(12046, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, - NULL, 717), - NAME_FUNC_OFFSET(12069, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, - 718), - NAME_FUNC_OFFSET(12091, glSecondaryColor3svEXT, glSecondaryColor3svEXT, - NULL, 719), - NAME_FUNC_OFFSET(12114, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, - NULL, 720), - NAME_FUNC_OFFSET(12137, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, - NULL, 721), - NAME_FUNC_OFFSET(12161, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, - NULL, 722), - NAME_FUNC_OFFSET(12184, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, - NULL, 723), - NAME_FUNC_OFFSET(12208, glSecondaryColor3usEXT, glSecondaryColor3usEXT, - NULL, 724), - NAME_FUNC_OFFSET(12231, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, - NULL, 725), - NAME_FUNC_OFFSET(12255, glSecondaryColorPointerEXT, - glSecondaryColorPointerEXT, NULL, 726), - NAME_FUNC_OFFSET(12282, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, - 727), - NAME_FUNC_OFFSET(12303, glMultiDrawElementsEXT, glMultiDrawElementsEXT, - NULL, 728), - NAME_FUNC_OFFSET(12326, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, - 729), - NAME_FUNC_OFFSET(12347, glFogCoorddEXT, glFogCoorddEXT, NULL, 730), - NAME_FUNC_OFFSET(12362, glFogCoorddvEXT, glFogCoorddvEXT, NULL, 731), - NAME_FUNC_OFFSET(12378, glFogCoordfEXT, glFogCoordfEXT, NULL, 732), - NAME_FUNC_OFFSET(12393, glFogCoordfvEXT, glFogCoordfvEXT, NULL, 733), - NAME_FUNC_OFFSET(12409, gl_dispatch_stub_734, gl_dispatch_stub_734, NULL, - 734), - NAME_FUNC_OFFSET(12427, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, - NULL, 735), - NAME_FUNC_OFFSET(12450, glFlushVertexArrayRangeNV, - glFlushVertexArrayRangeNV, NULL, 736), - NAME_FUNC_OFFSET(12476, glVertexArrayRangeNV, glVertexArrayRangeNV, NULL, - 737), - NAME_FUNC_OFFSET(12497, glCombinerInputNV, glCombinerInputNV, NULL, 738), - NAME_FUNC_OFFSET(12515, glCombinerOutputNV, glCombinerOutputNV, NULL, 739), - NAME_FUNC_OFFSET(12534, glCombinerParameterfNV, glCombinerParameterfNV, - NULL, 740), - NAME_FUNC_OFFSET(12557, glCombinerParameterfvNV, glCombinerParameterfvNV, - NULL, 741), - NAME_FUNC_OFFSET(12581, glCombinerParameteriNV, glCombinerParameteriNV, - NULL, 742), - NAME_FUNC_OFFSET(12604, glCombinerParameterivNV, glCombinerParameterivNV, - NULL, 743), - NAME_FUNC_OFFSET(12628, glFinalCombinerInputNV, glFinalCombinerInputNV, - NULL, 744), - NAME_FUNC_OFFSET(12651, glGetCombinerInputParameterfvNV, - glGetCombinerInputParameterfvNV, NULL, 745), - NAME_FUNC_OFFSET(12683, glGetCombinerInputParameterivNV, - glGetCombinerInputParameterivNV, NULL, 746), - NAME_FUNC_OFFSET(12715, glGetCombinerOutputParameterfvNV, - glGetCombinerOutputParameterfvNV, NULL, 747), - NAME_FUNC_OFFSET(12748, glGetCombinerOutputParameterivNV, - glGetCombinerOutputParameterivNV, NULL, 748), - NAME_FUNC_OFFSET(12781, glGetFinalCombinerInputParameterfvNV, - glGetFinalCombinerInputParameterfvNV, NULL, 749), - NAME_FUNC_OFFSET(12818, glGetFinalCombinerInputParameterivNV, - glGetFinalCombinerInputParameterivNV, NULL, 750), - NAME_FUNC_OFFSET(12855, glResizeBuffersMESA, glResizeBuffersMESA, NULL, - 751), - NAME_FUNC_OFFSET(12875, glWindowPos2dMESA, glWindowPos2dMESA, NULL, 752), - NAME_FUNC_OFFSET(12893, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, 753), - NAME_FUNC_OFFSET(12912, glWindowPos2fMESA, glWindowPos2fMESA, NULL, 754), - NAME_FUNC_OFFSET(12930, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, 755), - NAME_FUNC_OFFSET(12949, glWindowPos2iMESA, glWindowPos2iMESA, NULL, 756), - NAME_FUNC_OFFSET(12967, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, 757), - NAME_FUNC_OFFSET(12986, glWindowPos2sMESA, glWindowPos2sMESA, NULL, 758), - NAME_FUNC_OFFSET(13004, glWindowPos2svMESA, glWindowPos2svMESA, NULL, 759), - NAME_FUNC_OFFSET(13023, glWindowPos3dMESA, glWindowPos3dMESA, NULL, 760), - NAME_FUNC_OFFSET(13041, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, 761), - NAME_FUNC_OFFSET(13060, glWindowPos3fMESA, glWindowPos3fMESA, NULL, 762), - NAME_FUNC_OFFSET(13078, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, 763), - NAME_FUNC_OFFSET(13097, glWindowPos3iMESA, glWindowPos3iMESA, NULL, 764), - NAME_FUNC_OFFSET(13115, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, 765), - NAME_FUNC_OFFSET(13134, glWindowPos3sMESA, glWindowPos3sMESA, NULL, 766), - NAME_FUNC_OFFSET(13152, glWindowPos3svMESA, glWindowPos3svMESA, NULL, 767), - NAME_FUNC_OFFSET(13171, glWindowPos4dMESA, glWindowPos4dMESA, NULL, 768), - NAME_FUNC_OFFSET(13189, glWindowPos4dvMESA, glWindowPos4dvMESA, NULL, 769), - NAME_FUNC_OFFSET(13208, glWindowPos4fMESA, glWindowPos4fMESA, NULL, 770), - NAME_FUNC_OFFSET(13226, glWindowPos4fvMESA, glWindowPos4fvMESA, NULL, 771), - NAME_FUNC_OFFSET(13245, glWindowPos4iMESA, glWindowPos4iMESA, NULL, 772), - NAME_FUNC_OFFSET(13263, glWindowPos4ivMESA, glWindowPos4ivMESA, NULL, 773), - NAME_FUNC_OFFSET(13282, glWindowPos4sMESA, glWindowPos4sMESA, NULL, 774), - NAME_FUNC_OFFSET(13300, glWindowPos4svMESA, glWindowPos4svMESA, NULL, 775), - NAME_FUNC_OFFSET(13319, gl_dispatch_stub_776, gl_dispatch_stub_776, NULL, - 776), - NAME_FUNC_OFFSET(13344, gl_dispatch_stub_777, gl_dispatch_stub_777, NULL, - 777), - NAME_FUNC_OFFSET(13371, gl_dispatch_stub_778, gl_dispatch_stub_778, NULL, - 778), - NAME_FUNC_OFFSET(13388, gl_dispatch_stub_779, gl_dispatch_stub_779, NULL, - 779), - NAME_FUNC_OFFSET(13404, gl_dispatch_stub_780, gl_dispatch_stub_780, NULL, - 780), - NAME_FUNC_OFFSET(13418, gl_dispatch_stub_781, gl_dispatch_stub_781, NULL, - 781), - NAME_FUNC_OFFSET(13433, gl_dispatch_stub_782, gl_dispatch_stub_782, NULL, - 782), - NAME_FUNC_OFFSET(13445, gl_dispatch_stub_783, gl_dispatch_stub_783, NULL, - 783), - NAME_FUNC_OFFSET(13458, gl_dispatch_stub_784, gl_dispatch_stub_784, NULL, - 784), - NAME_FUNC_OFFSET(13472, glAreProgramsResidentNV, glAreProgramsResidentNV, - NULL, 785), - NAME_FUNC_OFFSET(13496, glBindProgramNV, glBindProgramNV, NULL, 786), - NAME_FUNC_OFFSET(13512, glDeleteProgramsNV, glDeleteProgramsNV, NULL, 787), - NAME_FUNC_OFFSET(13531, glExecuteProgramNV, glExecuteProgramNV, NULL, 788), - NAME_FUNC_OFFSET(13550, glGenProgramsNV, glGenProgramsNV, NULL, 789), - NAME_FUNC_OFFSET(13566, glGetProgramParameterdvNV, - glGetProgramParameterdvNV, NULL, 790), - NAME_FUNC_OFFSET(13592, glGetProgramParameterfvNV, - glGetProgramParameterfvNV, NULL, 791), - NAME_FUNC_OFFSET(13618, glGetProgramStringNV, glGetProgramStringNV, NULL, - 792), - NAME_FUNC_OFFSET(13639, glGetProgramivNV, glGetProgramivNV, NULL, 793), - NAME_FUNC_OFFSET(13656, glGetTrackMatrixivNV, glGetTrackMatrixivNV, NULL, - 794), - NAME_FUNC_OFFSET(13677, glGetVertexAttribPointervNV, - glGetVertexAttribPointervNV, NULL, 795), - NAME_FUNC_OFFSET(13705, glGetVertexAttribdvNV, glGetVertexAttribdvNV, NULL, - 796), - NAME_FUNC_OFFSET(13727, glGetVertexAttribfvNV, glGetVertexAttribfvNV, NULL, - 797), - NAME_FUNC_OFFSET(13749, glGetVertexAttribivNV, glGetVertexAttribivNV, NULL, - 798), - NAME_FUNC_OFFSET(13771, glIsProgramNV, glIsProgramNV, NULL, 799), - NAME_FUNC_OFFSET(13785, glLoadProgramNV, glLoadProgramNV, NULL, 800), - NAME_FUNC_OFFSET(13801, glProgramParameters4dvNV, glProgramParameters4dvNV, - NULL, 801), - NAME_FUNC_OFFSET(13826, glProgramParameters4fvNV, glProgramParameters4fvNV, - NULL, 802), - NAME_FUNC_OFFSET(13851, glRequestResidentProgramsNV, - glRequestResidentProgramsNV, NULL, 803), - NAME_FUNC_OFFSET(13879, glTrackMatrixNV, glTrackMatrixNV, NULL, 804), - NAME_FUNC_OFFSET(13895, glVertexAttrib1dNV, glVertexAttrib1dNV, NULL, 805), - NAME_FUNC_OFFSET(13914, glVertexAttrib1dvNV, glVertexAttrib1dvNV, NULL, - 806), - NAME_FUNC_OFFSET(13934, glVertexAttrib1fNV, glVertexAttrib1fNV, NULL, 807), - NAME_FUNC_OFFSET(13953, glVertexAttrib1fvNV, glVertexAttrib1fvNV, NULL, - 808), - NAME_FUNC_OFFSET(13973, glVertexAttrib1sNV, glVertexAttrib1sNV, NULL, 809), - NAME_FUNC_OFFSET(13992, glVertexAttrib1svNV, glVertexAttrib1svNV, NULL, - 810), - NAME_FUNC_OFFSET(14012, glVertexAttrib2dNV, glVertexAttrib2dNV, NULL, 811), - NAME_FUNC_OFFSET(14031, glVertexAttrib2dvNV, glVertexAttrib2dvNV, NULL, - 812), - NAME_FUNC_OFFSET(14051, glVertexAttrib2fNV, glVertexAttrib2fNV, NULL, 813), - NAME_FUNC_OFFSET(14070, glVertexAttrib2fvNV, glVertexAttrib2fvNV, NULL, - 814), - NAME_FUNC_OFFSET(14090, glVertexAttrib2sNV, glVertexAttrib2sNV, NULL, 815), - NAME_FUNC_OFFSET(14109, glVertexAttrib2svNV, glVertexAttrib2svNV, NULL, - 816), - NAME_FUNC_OFFSET(14129, glVertexAttrib3dNV, glVertexAttrib3dNV, NULL, 817), - NAME_FUNC_OFFSET(14148, glVertexAttrib3dvNV, glVertexAttrib3dvNV, NULL, - 818), - NAME_FUNC_OFFSET(14168, glVertexAttrib3fNV, glVertexAttrib3fNV, NULL, 819), - NAME_FUNC_OFFSET(14187, glVertexAttrib3fvNV, glVertexAttrib3fvNV, NULL, - 820), - NAME_FUNC_OFFSET(14207, glVertexAttrib3sNV, glVertexAttrib3sNV, NULL, 821), - NAME_FUNC_OFFSET(14226, glVertexAttrib3svNV, glVertexAttrib3svNV, NULL, - 822), - NAME_FUNC_OFFSET(14246, glVertexAttrib4dNV, glVertexAttrib4dNV, NULL, 823), - NAME_FUNC_OFFSET(14265, glVertexAttrib4dvNV, glVertexAttrib4dvNV, NULL, - 824), - NAME_FUNC_OFFSET(14285, glVertexAttrib4fNV, glVertexAttrib4fNV, NULL, 825), - NAME_FUNC_OFFSET(14304, glVertexAttrib4fvNV, glVertexAttrib4fvNV, NULL, - 826), - NAME_FUNC_OFFSET(14324, glVertexAttrib4sNV, glVertexAttrib4sNV, NULL, 827), - NAME_FUNC_OFFSET(14343, glVertexAttrib4svNV, glVertexAttrib4svNV, NULL, - 828), - NAME_FUNC_OFFSET(14363, glVertexAttrib4ubNV, glVertexAttrib4ubNV, NULL, - 829), - NAME_FUNC_OFFSET(14383, glVertexAttrib4ubvNV, glVertexAttrib4ubvNV, NULL, - 830), - NAME_FUNC_OFFSET(14404, glVertexAttribPointerNV, glVertexAttribPointerNV, - NULL, 831), - NAME_FUNC_OFFSET(14428, glVertexAttribs1dvNV, glVertexAttribs1dvNV, NULL, - 832), - NAME_FUNC_OFFSET(14449, glVertexAttribs1fvNV, glVertexAttribs1fvNV, NULL, - 833), - NAME_FUNC_OFFSET(14470, glVertexAttribs1svNV, glVertexAttribs1svNV, NULL, - 834), - NAME_FUNC_OFFSET(14491, glVertexAttribs2dvNV, glVertexAttribs2dvNV, NULL, - 835), - NAME_FUNC_OFFSET(14512, glVertexAttribs2fvNV, glVertexAttribs2fvNV, NULL, - 836), - NAME_FUNC_OFFSET(14533, glVertexAttribs2svNV, glVertexAttribs2svNV, NULL, - 837), - NAME_FUNC_OFFSET(14554, glVertexAttribs3dvNV, glVertexAttribs3dvNV, NULL, - 838), - NAME_FUNC_OFFSET(14575, glVertexAttribs3fvNV, glVertexAttribs3fvNV, NULL, - 839), - NAME_FUNC_OFFSET(14596, glVertexAttribs3svNV, glVertexAttribs3svNV, NULL, - 840), - NAME_FUNC_OFFSET(14617, glVertexAttribs4dvNV, glVertexAttribs4dvNV, NULL, - 841), - NAME_FUNC_OFFSET(14638, glVertexAttribs4fvNV, glVertexAttribs4fvNV, NULL, - 842), - NAME_FUNC_OFFSET(14659, glVertexAttribs4svNV, glVertexAttribs4svNV, NULL, - 843), - NAME_FUNC_OFFSET(14680, glVertexAttribs4ubvNV, glVertexAttribs4ubvNV, NULL, - 844), - NAME_FUNC_OFFSET(14702, glGetTexBumpParameterfvATI, - glGetTexBumpParameterfvATI, NULL, 845), - NAME_FUNC_OFFSET(14729, glGetTexBumpParameterivATI, - glGetTexBumpParameterivATI, NULL, 846), - NAME_FUNC_OFFSET(14756, glTexBumpParameterfvATI, glTexBumpParameterfvATI, - NULL, 847), - NAME_FUNC_OFFSET(14780, glTexBumpParameterivATI, glTexBumpParameterivATI, - NULL, 848), - NAME_FUNC_OFFSET(14804, glAlphaFragmentOp1ATI, glAlphaFragmentOp1ATI, NULL, - 849), - NAME_FUNC_OFFSET(14826, glAlphaFragmentOp2ATI, glAlphaFragmentOp2ATI, NULL, - 850), - NAME_FUNC_OFFSET(14848, glAlphaFragmentOp3ATI, glAlphaFragmentOp3ATI, NULL, - 851), - NAME_FUNC_OFFSET(14870, glBeginFragmentShaderATI, glBeginFragmentShaderATI, - NULL, 852), - NAME_FUNC_OFFSET(14895, glBindFragmentShaderATI, glBindFragmentShaderATI, - NULL, 853), - NAME_FUNC_OFFSET(14919, glColorFragmentOp1ATI, glColorFragmentOp1ATI, NULL, - 854), - NAME_FUNC_OFFSET(14941, glColorFragmentOp2ATI, glColorFragmentOp2ATI, NULL, - 855), - NAME_FUNC_OFFSET(14963, glColorFragmentOp3ATI, glColorFragmentOp3ATI, NULL, - 856), - NAME_FUNC_OFFSET(14985, glDeleteFragmentShaderATI, - glDeleteFragmentShaderATI, NULL, 857), - NAME_FUNC_OFFSET(15011, glEndFragmentShaderATI, glEndFragmentShaderATI, - NULL, 858), - NAME_FUNC_OFFSET(15034, glGenFragmentShadersATI, glGenFragmentShadersATI, - NULL, 859), - NAME_FUNC_OFFSET(15058, glPassTexCoordATI, glPassTexCoordATI, NULL, 860), - NAME_FUNC_OFFSET(15076, glSampleMapATI, glSampleMapATI, NULL, 861), - NAME_FUNC_OFFSET(15091, glSetFragmentShaderConstantATI, - glSetFragmentShaderConstantATI, NULL, 862), - NAME_FUNC_OFFSET(15122, glPointParameteriNV, glPointParameteriNV, NULL, - 863), - NAME_FUNC_OFFSET(15142, glPointParameterivNV, glPointParameterivNV, NULL, - 864), - NAME_FUNC_OFFSET(15163, gl_dispatch_stub_865, gl_dispatch_stub_865, NULL, - 865), - NAME_FUNC_OFFSET(15186, gl_dispatch_stub_866, gl_dispatch_stub_866, NULL, - 866), - NAME_FUNC_OFFSET(15209, gl_dispatch_stub_867, gl_dispatch_stub_867, NULL, - 867), - NAME_FUNC_OFFSET(15235, gl_dispatch_stub_868, gl_dispatch_stub_868, NULL, - 868), - NAME_FUNC_OFFSET(15258, gl_dispatch_stub_869, gl_dispatch_stub_869, NULL, - 869), - NAME_FUNC_OFFSET(15279, glGetProgramNamedParameterdvNV, - glGetProgramNamedParameterdvNV, NULL, 870), - NAME_FUNC_OFFSET(15310, glGetProgramNamedParameterfvNV, - glGetProgramNamedParameterfvNV, NULL, 871), - NAME_FUNC_OFFSET(15341, glProgramNamedParameter4dNV, - glProgramNamedParameter4dNV, NULL, 872), - NAME_FUNC_OFFSET(15369, glProgramNamedParameter4dvNV, - glProgramNamedParameter4dvNV, NULL, 873), - NAME_FUNC_OFFSET(15398, glProgramNamedParameter4fNV, - glProgramNamedParameter4fNV, NULL, 874), - NAME_FUNC_OFFSET(15426, glProgramNamedParameter4fvNV, - glProgramNamedParameter4fvNV, NULL, 875), - NAME_FUNC_OFFSET(15455, glPrimitiveRestartIndexNV, - glPrimitiveRestartIndexNV, NULL, 876), - NAME_FUNC_OFFSET(15481, glPrimitiveRestartNV, glPrimitiveRestartNV, NULL, - 877), - NAME_FUNC_OFFSET(15502, gl_dispatch_stub_878, gl_dispatch_stub_878, NULL, - 878), - NAME_FUNC_OFFSET(15519, gl_dispatch_stub_879, gl_dispatch_stub_879, NULL, - 879), - NAME_FUNC_OFFSET(15546, glBindFramebufferEXT, glBindFramebufferEXT, NULL, - 880), - NAME_FUNC_OFFSET(15567, glBindRenderbufferEXT, glBindRenderbufferEXT, NULL, - 881), - NAME_FUNC_OFFSET(15589, glCheckFramebufferStatusEXT, - glCheckFramebufferStatusEXT, NULL, 882), - NAME_FUNC_OFFSET(15617, glDeleteFramebuffersEXT, glDeleteFramebuffersEXT, - NULL, 883), - NAME_FUNC_OFFSET(15641, glDeleteRenderbuffersEXT, glDeleteRenderbuffersEXT, - NULL, 884), - NAME_FUNC_OFFSET(15666, glFramebufferRenderbufferEXT, - glFramebufferRenderbufferEXT, NULL, 885), - NAME_FUNC_OFFSET(15695, glFramebufferTexture1DEXT, - glFramebufferTexture1DEXT, NULL, 886), - NAME_FUNC_OFFSET(15721, glFramebufferTexture2DEXT, - glFramebufferTexture2DEXT, NULL, 887), - NAME_FUNC_OFFSET(15747, glFramebufferTexture3DEXT, - glFramebufferTexture3DEXT, NULL, 888), - NAME_FUNC_OFFSET(15773, glGenFramebuffersEXT, glGenFramebuffersEXT, NULL, - 889), - NAME_FUNC_OFFSET(15794, glGenRenderbuffersEXT, glGenRenderbuffersEXT, NULL, - 890), - NAME_FUNC_OFFSET(15816, glGenerateMipmapEXT, glGenerateMipmapEXT, NULL, - 891), - NAME_FUNC_OFFSET(15836, glGetFramebufferAttachmentParameterivEXT, - glGetFramebufferAttachmentParameterivEXT, NULL, 892), - NAME_FUNC_OFFSET(15877, glGetRenderbufferParameterivEXT, - glGetRenderbufferParameterivEXT, NULL, 893), - NAME_FUNC_OFFSET(15909, glIsFramebufferEXT, glIsFramebufferEXT, NULL, 894), - NAME_FUNC_OFFSET(15928, glIsRenderbufferEXT, glIsRenderbufferEXT, NULL, - 895), - NAME_FUNC_OFFSET(15948, glRenderbufferStorageEXT, glRenderbufferStorageEXT, - NULL, 896), - NAME_FUNC_OFFSET(15973, gl_dispatch_stub_897, gl_dispatch_stub_897, NULL, - 897), - NAME_FUNC_OFFSET(15994, gl_dispatch_stub_898, gl_dispatch_stub_898, NULL, - 898), - NAME_FUNC_OFFSET(16018, gl_dispatch_stub_899, gl_dispatch_stub_899, NULL, - 899), - NAME_FUNC_OFFSET(16048, glBindFragDataLocationEXT, - glBindFragDataLocationEXT, NULL, 900), - NAME_FUNC_OFFSET(16074, glGetFragDataLocationEXT, glGetFragDataLocationEXT, - NULL, 901), - NAME_FUNC_OFFSET(16099, glGetUniformuivEXT, glGetUniformuivEXT, NULL, 902), - NAME_FUNC_OFFSET(16118, glGetVertexAttribIivEXT, glGetVertexAttribIivEXT, - NULL, 903), - NAME_FUNC_OFFSET(16142, glGetVertexAttribIuivEXT, glGetVertexAttribIuivEXT, - NULL, 904), - NAME_FUNC_OFFSET(16167, glUniform1uiEXT, glUniform1uiEXT, NULL, 905), - NAME_FUNC_OFFSET(16183, glUniform1uivEXT, glUniform1uivEXT, NULL, 906), - NAME_FUNC_OFFSET(16200, glUniform2uiEXT, glUniform2uiEXT, NULL, 907), - NAME_FUNC_OFFSET(16216, glUniform2uivEXT, glUniform2uivEXT, NULL, 908), - NAME_FUNC_OFFSET(16233, glUniform3uiEXT, glUniform3uiEXT, NULL, 909), - NAME_FUNC_OFFSET(16249, glUniform3uivEXT, glUniform3uivEXT, NULL, 910), - NAME_FUNC_OFFSET(16266, glUniform4uiEXT, glUniform4uiEXT, NULL, 911), - NAME_FUNC_OFFSET(16282, glUniform4uivEXT, glUniform4uivEXT, NULL, 912), - NAME_FUNC_OFFSET(16299, glVertexAttribI1iEXT, glVertexAttribI1iEXT, NULL, - 913), - NAME_FUNC_OFFSET(16320, glVertexAttribI1ivEXT, glVertexAttribI1ivEXT, NULL, - 914), - NAME_FUNC_OFFSET(16342, glVertexAttribI1uiEXT, glVertexAttribI1uiEXT, NULL, - 915), - NAME_FUNC_OFFSET(16364, glVertexAttribI1uivEXT, glVertexAttribI1uivEXT, - NULL, 916), - NAME_FUNC_OFFSET(16387, glVertexAttribI2iEXT, glVertexAttribI2iEXT, NULL, - 917), - NAME_FUNC_OFFSET(16408, glVertexAttribI2ivEXT, glVertexAttribI2ivEXT, NULL, - 918), - NAME_FUNC_OFFSET(16430, glVertexAttribI2uiEXT, glVertexAttribI2uiEXT, NULL, - 919), - NAME_FUNC_OFFSET(16452, glVertexAttribI2uivEXT, glVertexAttribI2uivEXT, - NULL, 920), - NAME_FUNC_OFFSET(16475, glVertexAttribI3iEXT, glVertexAttribI3iEXT, NULL, - 921), - NAME_FUNC_OFFSET(16496, glVertexAttribI3ivEXT, glVertexAttribI3ivEXT, NULL, - 922), - NAME_FUNC_OFFSET(16518, glVertexAttribI3uiEXT, glVertexAttribI3uiEXT, NULL, - 923), - NAME_FUNC_OFFSET(16540, glVertexAttribI3uivEXT, glVertexAttribI3uivEXT, - NULL, 924), - NAME_FUNC_OFFSET(16563, glVertexAttribI4bvEXT, glVertexAttribI4bvEXT, NULL, - 925), - NAME_FUNC_OFFSET(16585, glVertexAttribI4iEXT, glVertexAttribI4iEXT, NULL, - 926), - NAME_FUNC_OFFSET(16606, glVertexAttribI4ivEXT, glVertexAttribI4ivEXT, NULL, - 927), - NAME_FUNC_OFFSET(16628, glVertexAttribI4svEXT, glVertexAttribI4svEXT, NULL, - 928), - NAME_FUNC_OFFSET(16650, glVertexAttribI4ubvEXT, glVertexAttribI4ubvEXT, - NULL, 929), - NAME_FUNC_OFFSET(16673, glVertexAttribI4uiEXT, glVertexAttribI4uiEXT, NULL, - 930), - NAME_FUNC_OFFSET(16695, glVertexAttribI4uivEXT, glVertexAttribI4uivEXT, - NULL, 931), - NAME_FUNC_OFFSET(16718, glVertexAttribI4usvEXT, glVertexAttribI4usvEXT, - NULL, 932), - NAME_FUNC_OFFSET(16741, glVertexAttribIPointerEXT, - glVertexAttribIPointerEXT, NULL, 933), - NAME_FUNC_OFFSET(16767, glFramebufferTextureLayerEXT, - glFramebufferTextureLayerEXT, NULL, 934), - NAME_FUNC_OFFSET(16796, glColorMaskIndexedEXT, glColorMaskIndexedEXT, NULL, - 935), - NAME_FUNC_OFFSET(16818, glDisableIndexedEXT, glDisableIndexedEXT, NULL, - 936), - NAME_FUNC_OFFSET(16838, glEnableIndexedEXT, glEnableIndexedEXT, NULL, 937), - NAME_FUNC_OFFSET(16857, glGetBooleanIndexedvEXT, glGetBooleanIndexedvEXT, - NULL, 938), - NAME_FUNC_OFFSET(16881, glGetIntegerIndexedvEXT, glGetIntegerIndexedvEXT, - NULL, 939), - NAME_FUNC_OFFSET(16905, glIsEnabledIndexedEXT, glIsEnabledIndexedEXT, NULL, - 940), - NAME_FUNC_OFFSET(16927, glClearColorIiEXT, glClearColorIiEXT, NULL, 941), - NAME_FUNC_OFFSET(16945, glClearColorIuiEXT, glClearColorIuiEXT, NULL, 942), - NAME_FUNC_OFFSET(16964, glGetTexParameterIivEXT, glGetTexParameterIivEXT, - NULL, 943), - NAME_FUNC_OFFSET(16988, glGetTexParameterIuivEXT, glGetTexParameterIuivEXT, - NULL, 944), - NAME_FUNC_OFFSET(17013, glTexParameterIivEXT, glTexParameterIivEXT, NULL, - 945), - NAME_FUNC_OFFSET(17034, glTexParameterIuivEXT, glTexParameterIuivEXT, NULL, - 946), - NAME_FUNC_OFFSET(17056, glBeginConditionalRenderNV, - glBeginConditionalRenderNV, NULL, 947), - NAME_FUNC_OFFSET(17083, glEndConditionalRenderNV, glEndConditionalRenderNV, - NULL, 948), - NAME_FUNC_OFFSET(17108, glBeginTransformFeedbackEXT, - glBeginTransformFeedbackEXT, NULL, 949), - NAME_FUNC_OFFSET(17136, glBindBufferBaseEXT, glBindBufferBaseEXT, NULL, - 950), - NAME_FUNC_OFFSET(17156, glBindBufferOffsetEXT, glBindBufferOffsetEXT, NULL, - 951), - NAME_FUNC_OFFSET(17178, glBindBufferRangeEXT, glBindBufferRangeEXT, NULL, - 952), - NAME_FUNC_OFFSET(17199, glEndTransformFeedbackEXT, - glEndTransformFeedbackEXT, NULL, 953), - NAME_FUNC_OFFSET(17225, glGetTransformFeedbackVaryingEXT, - glGetTransformFeedbackVaryingEXT, NULL, 954), - NAME_FUNC_OFFSET(17258, glTransformFeedbackVaryingsEXT, - glTransformFeedbackVaryingsEXT, NULL, 955), - NAME_FUNC_OFFSET(17289, glProvokingVertexEXT, glProvokingVertexEXT, NULL, - 956), - NAME_FUNC_OFFSET(17310, gl_dispatch_stub_957, gl_dispatch_stub_957, NULL, - 957), - NAME_FUNC_OFFSET(17341, gl_dispatch_stub_958, gl_dispatch_stub_958, NULL, - 958), - NAME_FUNC_OFFSET(17361, glGetObjectParameterivAPPLE, - glGetObjectParameterivAPPLE, NULL, 959), - NAME_FUNC_OFFSET(17389, glObjectPurgeableAPPLE, glObjectPurgeableAPPLE, - NULL, 960), - NAME_FUNC_OFFSET(17412, glObjectUnpurgeableAPPLE, glObjectUnpurgeableAPPLE, - NULL, 961), - NAME_FUNC_OFFSET(17437, glActiveProgramEXT, glActiveProgramEXT, NULL, 962), - NAME_FUNC_OFFSET(17456, glCreateShaderProgramEXT, glCreateShaderProgramEXT, - NULL, 963), - NAME_FUNC_OFFSET(17481, glUseShaderProgramEXT, glUseShaderProgramEXT, NULL, - 964), - NAME_FUNC_OFFSET(17503, glTextureBarrierNV, glTextureBarrierNV, NULL, 965), - NAME_FUNC_OFFSET(17522, gl_dispatch_stub_966, gl_dispatch_stub_966, NULL, - 966), - NAME_FUNC_OFFSET(17547, gl_dispatch_stub_967, gl_dispatch_stub_967, NULL, - 967), - NAME_FUNC_OFFSET(17576, gl_dispatch_stub_968, gl_dispatch_stub_968, NULL, - 968), - NAME_FUNC_OFFSET(17607, gl_dispatch_stub_969, gl_dispatch_stub_969, NULL, - 969), - NAME_FUNC_OFFSET(17631, gl_dispatch_stub_970, gl_dispatch_stub_970, NULL, - 970), - NAME_FUNC_OFFSET(17656, glEGLImageTargetRenderbufferStorageOES, - glEGLImageTargetRenderbufferStorageOES, NULL, 971), - NAME_FUNC_OFFSET(17695, glEGLImageTargetTexture2DOES, - glEGLImageTargetTexture2DOES, NULL, 972), - NAME_FUNC_OFFSET(17724, glArrayElement, glArrayElement, NULL, 306), - NAME_FUNC_OFFSET(17742, glBindTexture, glBindTexture, NULL, 307), - NAME_FUNC_OFFSET(17759, glDrawArrays, glDrawArrays, NULL, 310), - NAME_FUNC_OFFSET(17775, glAreTexturesResident, glAreTexturesResidentEXT, - glAreTexturesResidentEXT, 322), - NAME_FUNC_OFFSET(17800, glCopyTexImage1D, glCopyTexImage1D, NULL, 323), - NAME_FUNC_OFFSET(17820, glCopyTexImage2D, glCopyTexImage2D, NULL, 324), - NAME_FUNC_OFFSET(17840, glCopyTexSubImage1D, glCopyTexSubImage1D, NULL, - 325), - NAME_FUNC_OFFSET(17863, glCopyTexSubImage2D, glCopyTexSubImage2D, NULL, - 326), - NAME_FUNC_OFFSET(17886, glDeleteTextures, glDeleteTexturesEXT, - glDeleteTexturesEXT, 327), - NAME_FUNC_OFFSET(17906, glGenTextures, glGenTexturesEXT, glGenTexturesEXT, - 328), - NAME_FUNC_OFFSET(17923, glGetPointerv, glGetPointerv, NULL, 329), - NAME_FUNC_OFFSET(17940, glIsTexture, glIsTextureEXT, glIsTextureEXT, 330), - NAME_FUNC_OFFSET(17955, glPrioritizeTextures, glPrioritizeTextures, NULL, - 331), - NAME_FUNC_OFFSET(17979, glTexSubImage1D, glTexSubImage1D, NULL, 332), - NAME_FUNC_OFFSET(17998, glTexSubImage2D, glTexSubImage2D, NULL, 333), - NAME_FUNC_OFFSET(18017, glBlendColor, glBlendColor, NULL, 336), - NAME_FUNC_OFFSET(18033, glBlendEquation, glBlendEquation, NULL, 337), - NAME_FUNC_OFFSET(18052, glDrawRangeElements, glDrawRangeElements, NULL, - 338), - NAME_FUNC_OFFSET(18075, glColorTable, glColorTable, NULL, 339), - NAME_FUNC_OFFSET(18091, glColorTable, glColorTable, NULL, 339), - NAME_FUNC_OFFSET(18107, glColorTableParameterfv, glColorTableParameterfv, - NULL, 340), - NAME_FUNC_OFFSET(18134, glColorTableParameteriv, glColorTableParameteriv, - NULL, 341), - NAME_FUNC_OFFSET(18161, glCopyColorTable, glCopyColorTable, NULL, 342), - NAME_FUNC_OFFSET(18181, glGetColorTable, glGetColorTableEXT, - glGetColorTableEXT, 343), - NAME_FUNC_OFFSET(18200, glGetColorTable, glGetColorTableEXT, - glGetColorTableEXT, 343), - NAME_FUNC_OFFSET(18219, glGetColorTableParameterfv, - glGetColorTableParameterfvEXT, - glGetColorTableParameterfvEXT, 344), - NAME_FUNC_OFFSET(18249, glGetColorTableParameterfv, - glGetColorTableParameterfvEXT, - glGetColorTableParameterfvEXT, 344), - NAME_FUNC_OFFSET(18279, glGetColorTableParameteriv, - glGetColorTableParameterivEXT, - glGetColorTableParameterivEXT, 345), - NAME_FUNC_OFFSET(18309, glGetColorTableParameteriv, - glGetColorTableParameterivEXT, - glGetColorTableParameterivEXT, 345), - NAME_FUNC_OFFSET(18339, glColorSubTable, glColorSubTable, NULL, 346), - NAME_FUNC_OFFSET(18358, glCopyColorSubTable, glCopyColorSubTable, NULL, - 347), - NAME_FUNC_OFFSET(18381, glConvolutionFilter1D, glConvolutionFilter1D, NULL, - 348), - NAME_FUNC_OFFSET(18406, glConvolutionFilter2D, glConvolutionFilter2D, NULL, - 349), - NAME_FUNC_OFFSET(18431, glConvolutionParameterf, glConvolutionParameterf, - NULL, 350), - NAME_FUNC_OFFSET(18458, glConvolutionParameterfv, glConvolutionParameterfv, - NULL, 351), - NAME_FUNC_OFFSET(18486, glConvolutionParameteri, glConvolutionParameteri, - NULL, 352), - NAME_FUNC_OFFSET(18513, glConvolutionParameteriv, glConvolutionParameteriv, - NULL, 353), - NAME_FUNC_OFFSET(18541, glCopyConvolutionFilter1D, - glCopyConvolutionFilter1D, NULL, 354), - NAME_FUNC_OFFSET(18570, glCopyConvolutionFilter2D, - glCopyConvolutionFilter2D, NULL, 355), - NAME_FUNC_OFFSET(18599, glGetConvolutionFilter, gl_dispatch_stub_356, - gl_dispatch_stub_356, 356), - NAME_FUNC_OFFSET(18625, glGetConvolutionParameterfv, gl_dispatch_stub_357, - gl_dispatch_stub_357, 357), - NAME_FUNC_OFFSET(18656, glGetConvolutionParameteriv, gl_dispatch_stub_358, - gl_dispatch_stub_358, 358), - NAME_FUNC_OFFSET(18687, glGetSeparableFilter, gl_dispatch_stub_359, - gl_dispatch_stub_359, 359), - NAME_FUNC_OFFSET(18711, glSeparableFilter2D, glSeparableFilter2D, NULL, - 360), - NAME_FUNC_OFFSET(18734, glGetHistogram, gl_dispatch_stub_361, - gl_dispatch_stub_361, 361), - NAME_FUNC_OFFSET(18752, glGetHistogramParameterfv, gl_dispatch_stub_362, - gl_dispatch_stub_362, 362), - NAME_FUNC_OFFSET(18781, glGetHistogramParameteriv, gl_dispatch_stub_363, - gl_dispatch_stub_363, 363), - NAME_FUNC_OFFSET(18810, glGetMinmax, gl_dispatch_stub_364, - gl_dispatch_stub_364, 364), - NAME_FUNC_OFFSET(18825, glGetMinmaxParameterfv, gl_dispatch_stub_365, - gl_dispatch_stub_365, 365), - NAME_FUNC_OFFSET(18851, glGetMinmaxParameteriv, gl_dispatch_stub_366, - gl_dispatch_stub_366, 366), - NAME_FUNC_OFFSET(18877, glHistogram, glHistogram, NULL, 367), - NAME_FUNC_OFFSET(18892, glMinmax, glMinmax, NULL, 368), - NAME_FUNC_OFFSET(18904, glResetHistogram, glResetHistogram, NULL, 369), - NAME_FUNC_OFFSET(18924, glResetMinmax, glResetMinmax, NULL, 370), - NAME_FUNC_OFFSET(18941, glTexImage3D, glTexImage3D, NULL, 371), - NAME_FUNC_OFFSET(18957, glTexSubImage3D, glTexSubImage3D, NULL, 372), - NAME_FUNC_OFFSET(18976, glCopyTexSubImage3D, glCopyTexSubImage3D, NULL, - 373), - NAME_FUNC_OFFSET(18999, glActiveTextureARB, glActiveTextureARB, NULL, 374), - NAME_FUNC_OFFSET(19015, glClientActiveTextureARB, glClientActiveTextureARB, - NULL, 375), - NAME_FUNC_OFFSET(19037, glMultiTexCoord1dARB, glMultiTexCoord1dARB, NULL, - 376), - NAME_FUNC_OFFSET(19055, glMultiTexCoord1dvARB, glMultiTexCoord1dvARB, NULL, - 377), - NAME_FUNC_OFFSET(19074, glMultiTexCoord1fARB, glMultiTexCoord1fARB, NULL, - 378), - NAME_FUNC_OFFSET(19092, glMultiTexCoord1fvARB, glMultiTexCoord1fvARB, NULL, - 379), - NAME_FUNC_OFFSET(19111, glMultiTexCoord1iARB, glMultiTexCoord1iARB, NULL, - 380), - NAME_FUNC_OFFSET(19129, glMultiTexCoord1ivARB, glMultiTexCoord1ivARB, NULL, - 381), - NAME_FUNC_OFFSET(19148, glMultiTexCoord1sARB, glMultiTexCoord1sARB, NULL, - 382), - NAME_FUNC_OFFSET(19166, glMultiTexCoord1svARB, glMultiTexCoord1svARB, NULL, - 383), - NAME_FUNC_OFFSET(19185, glMultiTexCoord2dARB, glMultiTexCoord2dARB, NULL, - 384), - NAME_FUNC_OFFSET(19203, glMultiTexCoord2dvARB, glMultiTexCoord2dvARB, NULL, - 385), - NAME_FUNC_OFFSET(19222, glMultiTexCoord2fARB, glMultiTexCoord2fARB, NULL, - 386), - NAME_FUNC_OFFSET(19240, glMultiTexCoord2fvARB, glMultiTexCoord2fvARB, NULL, - 387), - NAME_FUNC_OFFSET(19259, glMultiTexCoord2iARB, glMultiTexCoord2iARB, NULL, - 388), - NAME_FUNC_OFFSET(19277, glMultiTexCoord2ivARB, glMultiTexCoord2ivARB, NULL, - 389), - NAME_FUNC_OFFSET(19296, glMultiTexCoord2sARB, glMultiTexCoord2sARB, NULL, - 390), - NAME_FUNC_OFFSET(19314, glMultiTexCoord2svARB, glMultiTexCoord2svARB, NULL, - 391), - NAME_FUNC_OFFSET(19333, glMultiTexCoord3dARB, glMultiTexCoord3dARB, NULL, - 392), - NAME_FUNC_OFFSET(19351, glMultiTexCoord3dvARB, glMultiTexCoord3dvARB, NULL, - 393), - NAME_FUNC_OFFSET(19370, glMultiTexCoord3fARB, glMultiTexCoord3fARB, NULL, - 394), - NAME_FUNC_OFFSET(19388, glMultiTexCoord3fvARB, glMultiTexCoord3fvARB, NULL, - 395), - NAME_FUNC_OFFSET(19407, glMultiTexCoord3iARB, glMultiTexCoord3iARB, NULL, - 396), - NAME_FUNC_OFFSET(19425, glMultiTexCoord3ivARB, glMultiTexCoord3ivARB, NULL, - 397), - NAME_FUNC_OFFSET(19444, glMultiTexCoord3sARB, glMultiTexCoord3sARB, NULL, - 398), - NAME_FUNC_OFFSET(19462, glMultiTexCoord3svARB, glMultiTexCoord3svARB, NULL, - 399), - NAME_FUNC_OFFSET(19481, glMultiTexCoord4dARB, glMultiTexCoord4dARB, NULL, - 400), - NAME_FUNC_OFFSET(19499, glMultiTexCoord4dvARB, glMultiTexCoord4dvARB, NULL, - 401), - NAME_FUNC_OFFSET(19518, glMultiTexCoord4fARB, glMultiTexCoord4fARB, NULL, - 402), - NAME_FUNC_OFFSET(19536, glMultiTexCoord4fvARB, glMultiTexCoord4fvARB, NULL, - 403), - NAME_FUNC_OFFSET(19555, glMultiTexCoord4iARB, glMultiTexCoord4iARB, NULL, - 404), - NAME_FUNC_OFFSET(19573, glMultiTexCoord4ivARB, glMultiTexCoord4ivARB, NULL, - 405), - NAME_FUNC_OFFSET(19592, glMultiTexCoord4sARB, glMultiTexCoord4sARB, NULL, - 406), - NAME_FUNC_OFFSET(19610, glMultiTexCoord4svARB, glMultiTexCoord4svARB, NULL, - 407), - NAME_FUNC_OFFSET(19629, glStencilOpSeparate, glStencilOpSeparate, NULL, - 423), - NAME_FUNC_OFFSET(19652, glLoadTransposeMatrixdARB, - glLoadTransposeMatrixdARB, NULL, 441), - NAME_FUNC_OFFSET(19675, glLoadTransposeMatrixfARB, - glLoadTransposeMatrixfARB, NULL, 442), - NAME_FUNC_OFFSET(19698, glMultTransposeMatrixdARB, - glMultTransposeMatrixdARB, NULL, 443), - NAME_FUNC_OFFSET(19721, glMultTransposeMatrixfARB, - glMultTransposeMatrixfARB, NULL, 444), - NAME_FUNC_OFFSET(19744, glSampleCoverageARB, glSampleCoverageARB, NULL, - 445), - NAME_FUNC_OFFSET(19761, glCompressedTexImage1DARB, - glCompressedTexImage1DARB, NULL, 446), - NAME_FUNC_OFFSET(19784, glCompressedTexImage2DARB, - glCompressedTexImage2DARB, NULL, 447), - NAME_FUNC_OFFSET(19807, glCompressedTexImage3DARB, - glCompressedTexImage3DARB, NULL, 448), - NAME_FUNC_OFFSET(19830, glCompressedTexSubImage1DARB, - glCompressedTexSubImage1DARB, NULL, 449), - NAME_FUNC_OFFSET(19856, glCompressedTexSubImage2DARB, - glCompressedTexSubImage2DARB, NULL, 450), - NAME_FUNC_OFFSET(19882, glCompressedTexSubImage3DARB, - glCompressedTexSubImage3DARB, NULL, 451), - NAME_FUNC_OFFSET(19908, glGetCompressedTexImageARB, - glGetCompressedTexImageARB, NULL, 452), - NAME_FUNC_OFFSET(19932, glDisableVertexAttribArrayARB, - glDisableVertexAttribArrayARB, NULL, 453), - NAME_FUNC_OFFSET(19959, glEnableVertexAttribArrayARB, - glEnableVertexAttribArrayARB, NULL, 454), - NAME_FUNC_OFFSET(19985, glGetVertexAttribdvARB, glGetVertexAttribdvARB, - NULL, 461), - NAME_FUNC_OFFSET(20005, glGetVertexAttribfvARB, glGetVertexAttribfvARB, - NULL, 462), - NAME_FUNC_OFFSET(20025, glGetVertexAttribivARB, glGetVertexAttribivARB, - NULL, 463), - NAME_FUNC_OFFSET(20045, glProgramEnvParameter4dARB, - glProgramEnvParameter4dARB, NULL, 464), - NAME_FUNC_OFFSET(20068, glProgramEnvParameter4dvARB, - glProgramEnvParameter4dvARB, NULL, 465), - NAME_FUNC_OFFSET(20092, glProgramEnvParameter4fARB, - glProgramEnvParameter4fARB, NULL, 466), - NAME_FUNC_OFFSET(20115, glProgramEnvParameter4fvARB, - glProgramEnvParameter4fvARB, NULL, 467), - NAME_FUNC_OFFSET(20139, glVertexAttrib1dARB, glVertexAttrib1dARB, NULL, - 473), - NAME_FUNC_OFFSET(20156, glVertexAttrib1dvARB, glVertexAttrib1dvARB, NULL, - 474), - NAME_FUNC_OFFSET(20174, glVertexAttrib1fARB, glVertexAttrib1fARB, NULL, - 475), - NAME_FUNC_OFFSET(20191, glVertexAttrib1fvARB, glVertexAttrib1fvARB, NULL, - 476), - NAME_FUNC_OFFSET(20209, glVertexAttrib1sARB, glVertexAttrib1sARB, NULL, - 477), - NAME_FUNC_OFFSET(20226, glVertexAttrib1svARB, glVertexAttrib1svARB, NULL, - 478), - NAME_FUNC_OFFSET(20244, glVertexAttrib2dARB, glVertexAttrib2dARB, NULL, - 479), - NAME_FUNC_OFFSET(20261, glVertexAttrib2dvARB, glVertexAttrib2dvARB, NULL, - 480), - NAME_FUNC_OFFSET(20279, glVertexAttrib2fARB, glVertexAttrib2fARB, NULL, - 481), - NAME_FUNC_OFFSET(20296, glVertexAttrib2fvARB, glVertexAttrib2fvARB, NULL, - 482), - NAME_FUNC_OFFSET(20314, glVertexAttrib2sARB, glVertexAttrib2sARB, NULL, - 483), - NAME_FUNC_OFFSET(20331, glVertexAttrib2svARB, glVertexAttrib2svARB, NULL, - 484), - NAME_FUNC_OFFSET(20349, glVertexAttrib3dARB, glVertexAttrib3dARB, NULL, - 485), - NAME_FUNC_OFFSET(20366, glVertexAttrib3dvARB, glVertexAttrib3dvARB, NULL, - 486), - NAME_FUNC_OFFSET(20384, glVertexAttrib3fARB, glVertexAttrib3fARB, NULL, - 487), - NAME_FUNC_OFFSET(20401, glVertexAttrib3fvARB, glVertexAttrib3fvARB, NULL, - 488), - NAME_FUNC_OFFSET(20419, glVertexAttrib3sARB, glVertexAttrib3sARB, NULL, - 489), - NAME_FUNC_OFFSET(20436, glVertexAttrib3svARB, glVertexAttrib3svARB, NULL, - 490), - NAME_FUNC_OFFSET(20454, glVertexAttrib4NbvARB, glVertexAttrib4NbvARB, NULL, - 491), - NAME_FUNC_OFFSET(20473, glVertexAttrib4NivARB, glVertexAttrib4NivARB, NULL, - 492), - NAME_FUNC_OFFSET(20492, glVertexAttrib4NsvARB, glVertexAttrib4NsvARB, NULL, - 493), - NAME_FUNC_OFFSET(20511, glVertexAttrib4NubARB, glVertexAttrib4NubARB, NULL, - 494), - NAME_FUNC_OFFSET(20530, glVertexAttrib4NubvARB, glVertexAttrib4NubvARB, - NULL, 495), - NAME_FUNC_OFFSET(20550, glVertexAttrib4NuivARB, glVertexAttrib4NuivARB, - NULL, 496), - NAME_FUNC_OFFSET(20570, glVertexAttrib4NusvARB, glVertexAttrib4NusvARB, - NULL, 497), - NAME_FUNC_OFFSET(20590, glVertexAttrib4bvARB, glVertexAttrib4bvARB, NULL, - 498), - NAME_FUNC_OFFSET(20608, glVertexAttrib4dARB, glVertexAttrib4dARB, NULL, - 499), - NAME_FUNC_OFFSET(20625, glVertexAttrib4dvARB, glVertexAttrib4dvARB, NULL, - 500), - NAME_FUNC_OFFSET(20643, glVertexAttrib4fARB, glVertexAttrib4fARB, NULL, - 501), - NAME_FUNC_OFFSET(20660, glVertexAttrib4fvARB, glVertexAttrib4fvARB, NULL, - 502), - NAME_FUNC_OFFSET(20678, glVertexAttrib4ivARB, glVertexAttrib4ivARB, NULL, - 503), - NAME_FUNC_OFFSET(20696, glVertexAttrib4sARB, glVertexAttrib4sARB, NULL, - 504), - NAME_FUNC_OFFSET(20713, glVertexAttrib4svARB, glVertexAttrib4svARB, NULL, - 505), - NAME_FUNC_OFFSET(20731, glVertexAttrib4ubvARB, glVertexAttrib4ubvARB, NULL, - 506), - NAME_FUNC_OFFSET(20750, glVertexAttrib4uivARB, glVertexAttrib4uivARB, NULL, - 507), - NAME_FUNC_OFFSET(20769, glVertexAttrib4usvARB, glVertexAttrib4usvARB, NULL, - 508), - NAME_FUNC_OFFSET(20788, glVertexAttribPointerARB, glVertexAttribPointerARB, - NULL, 509), - NAME_FUNC_OFFSET(20810, glBindBufferARB, glBindBufferARB, NULL, 510), - NAME_FUNC_OFFSET(20823, glBufferDataARB, glBufferDataARB, NULL, 511), - NAME_FUNC_OFFSET(20836, glBufferSubDataARB, glBufferSubDataARB, NULL, 512), - NAME_FUNC_OFFSET(20852, glDeleteBuffersARB, glDeleteBuffersARB, NULL, 513), - NAME_FUNC_OFFSET(20868, glGenBuffersARB, glGenBuffersARB, NULL, 514), - NAME_FUNC_OFFSET(20881, glGetBufferParameterivARB, - glGetBufferParameterivARB, NULL, 515), - NAME_FUNC_OFFSET(20904, glGetBufferPointervARB, glGetBufferPointervARB, - NULL, 516), - NAME_FUNC_OFFSET(20924, glGetBufferSubDataARB, glGetBufferSubDataARB, NULL, - 517), - NAME_FUNC_OFFSET(20943, glIsBufferARB, glIsBufferARB, NULL, 518), - NAME_FUNC_OFFSET(20954, glMapBufferARB, glMapBufferARB, NULL, 519), - NAME_FUNC_OFFSET(20966, glUnmapBufferARB, glUnmapBufferARB, NULL, 520), - NAME_FUNC_OFFSET(20980, glBeginQueryARB, glBeginQueryARB, NULL, 521), - NAME_FUNC_OFFSET(20993, glDeleteQueriesARB, glDeleteQueriesARB, NULL, 522), - NAME_FUNC_OFFSET(21009, glEndQueryARB, glEndQueryARB, NULL, 523), - NAME_FUNC_OFFSET(21020, glGenQueriesARB, glGenQueriesARB, NULL, 524), - NAME_FUNC_OFFSET(21033, glGetQueryObjectivARB, glGetQueryObjectivARB, NULL, - 525), - NAME_FUNC_OFFSET(21052, glGetQueryObjectuivARB, glGetQueryObjectuivARB, - NULL, 526), - NAME_FUNC_OFFSET(21072, glGetQueryivARB, glGetQueryivARB, NULL, 527), - NAME_FUNC_OFFSET(21085, glIsQueryARB, glIsQueryARB, NULL, 528), - NAME_FUNC_OFFSET(21095, glCompileShaderARB, glCompileShaderARB, NULL, 530), - NAME_FUNC_OFFSET(21111, glGetActiveUniformARB, glGetActiveUniformARB, NULL, - 535), - NAME_FUNC_OFFSET(21130, glGetShaderSourceARB, glGetShaderSourceARB, NULL, - 541), - NAME_FUNC_OFFSET(21148, glGetUniformLocationARB, glGetUniformLocationARB, - NULL, 542), - NAME_FUNC_OFFSET(21169, glGetUniformfvARB, glGetUniformfvARB, NULL, 543), - NAME_FUNC_OFFSET(21184, glGetUniformivARB, glGetUniformivARB, NULL, 544), - NAME_FUNC_OFFSET(21199, glLinkProgramARB, glLinkProgramARB, NULL, 545), - NAME_FUNC_OFFSET(21213, glShaderSourceARB, glShaderSourceARB, NULL, 546), - NAME_FUNC_OFFSET(21228, glUniform1fARB, glUniform1fARB, NULL, 547), - NAME_FUNC_OFFSET(21240, glUniform1fvARB, glUniform1fvARB, NULL, 548), - NAME_FUNC_OFFSET(21253, glUniform1iARB, glUniform1iARB, NULL, 549), - NAME_FUNC_OFFSET(21265, glUniform1ivARB, glUniform1ivARB, NULL, 550), - NAME_FUNC_OFFSET(21278, glUniform2fARB, glUniform2fARB, NULL, 551), - NAME_FUNC_OFFSET(21290, glUniform2fvARB, glUniform2fvARB, NULL, 552), - NAME_FUNC_OFFSET(21303, glUniform2iARB, glUniform2iARB, NULL, 553), - NAME_FUNC_OFFSET(21315, glUniform2ivARB, glUniform2ivARB, NULL, 554), - NAME_FUNC_OFFSET(21328, glUniform3fARB, glUniform3fARB, NULL, 555), - NAME_FUNC_OFFSET(21340, glUniform3fvARB, glUniform3fvARB, NULL, 556), - NAME_FUNC_OFFSET(21353, glUniform3iARB, glUniform3iARB, NULL, 557), - NAME_FUNC_OFFSET(21365, glUniform3ivARB, glUniform3ivARB, NULL, 558), - NAME_FUNC_OFFSET(21378, glUniform4fARB, glUniform4fARB, NULL, 559), - NAME_FUNC_OFFSET(21390, glUniform4fvARB, glUniform4fvARB, NULL, 560), - NAME_FUNC_OFFSET(21403, glUniform4iARB, glUniform4iARB, NULL, 561), - NAME_FUNC_OFFSET(21415, glUniform4ivARB, glUniform4ivARB, NULL, 562), - NAME_FUNC_OFFSET(21428, glUniformMatrix2fvARB, glUniformMatrix2fvARB, NULL, - 563), - NAME_FUNC_OFFSET(21447, glUniformMatrix3fvARB, glUniformMatrix3fvARB, NULL, - 564), - NAME_FUNC_OFFSET(21466, glUniformMatrix4fvARB, glUniformMatrix4fvARB, NULL, - 565), - NAME_FUNC_OFFSET(21485, glUseProgramObjectARB, glUseProgramObjectARB, NULL, - 566), - NAME_FUNC_OFFSET(21498, glValidateProgramARB, glValidateProgramARB, NULL, - 567), - NAME_FUNC_OFFSET(21516, glBindAttribLocationARB, glBindAttribLocationARB, - NULL, 568), - NAME_FUNC_OFFSET(21537, glGetActiveAttribARB, glGetActiveAttribARB, NULL, - 569), - NAME_FUNC_OFFSET(21555, glGetAttribLocationARB, glGetAttribLocationARB, - NULL, 570), - NAME_FUNC_OFFSET(21575, glDrawBuffersARB, glDrawBuffersARB, NULL, 571), - NAME_FUNC_OFFSET(21589, glDrawBuffersARB, glDrawBuffersARB, NULL, 571), - NAME_FUNC_OFFSET(21606, glDrawBuffersARB, glDrawBuffersARB, NULL, 571), - NAME_FUNC_OFFSET(21622, glDrawArraysInstancedARB, glDrawArraysInstancedARB, - NULL, 573), - NAME_FUNC_OFFSET(21647, glDrawArraysInstancedARB, glDrawArraysInstancedARB, - NULL, 573), - NAME_FUNC_OFFSET(21669, glDrawElementsInstancedARB, - glDrawElementsInstancedARB, NULL, 574), - NAME_FUNC_OFFSET(21696, glDrawElementsInstancedARB, - glDrawElementsInstancedARB, NULL, 574), - NAME_FUNC_OFFSET(21720, glRenderbufferStorageMultisample, - glRenderbufferStorageMultisample, NULL, 575), - NAME_FUNC_OFFSET(21756, glBlendEquationSeparateiARB, - glBlendEquationSeparateiARB, NULL, 597), - NAME_FUNC_OFFSET(21790, glBlendEquationiARB, glBlendEquationiARB, NULL, - 598), - NAME_FUNC_OFFSET(21816, glBlendFuncSeparateiARB, glBlendFuncSeparateiARB, - NULL, 599), - NAME_FUNC_OFFSET(21846, glBlendFunciARB, glBlendFunciARB, NULL, 600), - NAME_FUNC_OFFSET(21868, gl_dispatch_stub_698, gl_dispatch_stub_698, NULL, - 698), - NAME_FUNC_OFFSET(21884, gl_dispatch_stub_699, gl_dispatch_stub_699, NULL, - 699), - NAME_FUNC_OFFSET(21903, glPointParameterfEXT, glPointParameterfEXT, NULL, - 706), - NAME_FUNC_OFFSET(21921, glPointParameterfEXT, glPointParameterfEXT, NULL, - 706), - NAME_FUNC_OFFSET(21942, glPointParameterfEXT, glPointParameterfEXT, NULL, - 706), - NAME_FUNC_OFFSET(21964, glPointParameterfvEXT, glPointParameterfvEXT, NULL, - 707), - NAME_FUNC_OFFSET(21983, glPointParameterfvEXT, glPointParameterfvEXT, NULL, - 707), - NAME_FUNC_OFFSET(22005, glPointParameterfvEXT, glPointParameterfvEXT, NULL, - 707), - NAME_FUNC_OFFSET(22028, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, - 710), - NAME_FUNC_OFFSET(22047, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, - NULL, 711), - NAME_FUNC_OFFSET(22067, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, - 712), - NAME_FUNC_OFFSET(22086, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, - NULL, 713), - NAME_FUNC_OFFSET(22106, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, - 714), - NAME_FUNC_OFFSET(22125, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, - NULL, 715), - NAME_FUNC_OFFSET(22145, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, - 716), - NAME_FUNC_OFFSET(22164, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, - NULL, 717), - NAME_FUNC_OFFSET(22184, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, - 718), - NAME_FUNC_OFFSET(22203, glSecondaryColor3svEXT, glSecondaryColor3svEXT, - NULL, 719), - NAME_FUNC_OFFSET(22223, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, - NULL, 720), - NAME_FUNC_OFFSET(22243, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, - NULL, 721), - NAME_FUNC_OFFSET(22264, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, - NULL, 722), - NAME_FUNC_OFFSET(22284, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, - NULL, 723), - NAME_FUNC_OFFSET(22305, glSecondaryColor3usEXT, glSecondaryColor3usEXT, - NULL, 724), - NAME_FUNC_OFFSET(22325, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, - NULL, 725), - NAME_FUNC_OFFSET(22346, glSecondaryColorPointerEXT, - glSecondaryColorPointerEXT, NULL, 726), - NAME_FUNC_OFFSET(22370, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, - 727), - NAME_FUNC_OFFSET(22388, glMultiDrawElementsEXT, glMultiDrawElementsEXT, - NULL, 728), - NAME_FUNC_OFFSET(22408, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, - 729), - NAME_FUNC_OFFSET(22426, glFogCoorddEXT, glFogCoorddEXT, NULL, 730), - NAME_FUNC_OFFSET(22438, glFogCoorddvEXT, glFogCoorddvEXT, NULL, 731), - NAME_FUNC_OFFSET(22451, glFogCoordfEXT, glFogCoordfEXT, NULL, 732), - NAME_FUNC_OFFSET(22463, glFogCoordfvEXT, glFogCoordfvEXT, NULL, 733), - NAME_FUNC_OFFSET(22476, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, - NULL, 735), - NAME_FUNC_OFFSET(22496, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, - NULL, 735), - NAME_FUNC_OFFSET(22520, glWindowPos2dMESA, glWindowPos2dMESA, NULL, 752), - NAME_FUNC_OFFSET(22534, glWindowPos2dMESA, glWindowPos2dMESA, NULL, 752), - NAME_FUNC_OFFSET(22551, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, 753), - NAME_FUNC_OFFSET(22566, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, 753), - NAME_FUNC_OFFSET(22584, glWindowPos2fMESA, glWindowPos2fMESA, NULL, 754), - NAME_FUNC_OFFSET(22598, glWindowPos2fMESA, glWindowPos2fMESA, NULL, 754), - NAME_FUNC_OFFSET(22615, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, 755), - NAME_FUNC_OFFSET(22630, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, 755), - NAME_FUNC_OFFSET(22648, glWindowPos2iMESA, glWindowPos2iMESA, NULL, 756), - NAME_FUNC_OFFSET(22662, glWindowPos2iMESA, glWindowPos2iMESA, NULL, 756), - NAME_FUNC_OFFSET(22679, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, 757), - NAME_FUNC_OFFSET(22694, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, 757), - NAME_FUNC_OFFSET(22712, glWindowPos2sMESA, glWindowPos2sMESA, NULL, 758), - NAME_FUNC_OFFSET(22726, glWindowPos2sMESA, glWindowPos2sMESA, NULL, 758), - NAME_FUNC_OFFSET(22743, glWindowPos2svMESA, glWindowPos2svMESA, NULL, 759), - NAME_FUNC_OFFSET(22758, glWindowPos2svMESA, glWindowPos2svMESA, NULL, 759), - NAME_FUNC_OFFSET(22776, glWindowPos3dMESA, glWindowPos3dMESA, NULL, 760), - NAME_FUNC_OFFSET(22790, glWindowPos3dMESA, glWindowPos3dMESA, NULL, 760), - NAME_FUNC_OFFSET(22807, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, 761), - NAME_FUNC_OFFSET(22822, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, 761), - NAME_FUNC_OFFSET(22840, glWindowPos3fMESA, glWindowPos3fMESA, NULL, 762), - NAME_FUNC_OFFSET(22854, glWindowPos3fMESA, glWindowPos3fMESA, NULL, 762), - NAME_FUNC_OFFSET(22871, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, 763), - NAME_FUNC_OFFSET(22886, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, 763), - NAME_FUNC_OFFSET(22904, glWindowPos3iMESA, glWindowPos3iMESA, NULL, 764), - NAME_FUNC_OFFSET(22918, glWindowPos3iMESA, glWindowPos3iMESA, NULL, 764), - NAME_FUNC_OFFSET(22935, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, 765), - NAME_FUNC_OFFSET(22950, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, 765), - NAME_FUNC_OFFSET(22968, glWindowPos3sMESA, glWindowPos3sMESA, NULL, 766), - NAME_FUNC_OFFSET(22982, glWindowPos3sMESA, glWindowPos3sMESA, NULL, 766), - NAME_FUNC_OFFSET(22999, glWindowPos3svMESA, glWindowPos3svMESA, NULL, 767), - NAME_FUNC_OFFSET(23014, glWindowPos3svMESA, glWindowPos3svMESA, NULL, 767), - NAME_FUNC_OFFSET(23032, glBindProgramNV, glBindProgramNV, NULL, 786), - NAME_FUNC_OFFSET(23049, glDeleteProgramsNV, glDeleteProgramsNV, NULL, 787), - NAME_FUNC_OFFSET(23069, glGenProgramsNV, glGenProgramsNV, NULL, 789), - NAME_FUNC_OFFSET(23086, glGetVertexAttribPointervNV, - glGetVertexAttribPointervNV, NULL, 795), - NAME_FUNC_OFFSET(23112, glGetVertexAttribPointervNV, - glGetVertexAttribPointervNV, NULL, 795), - NAME_FUNC_OFFSET(23141, glIsProgramNV, glIsProgramNV, NULL, 799), - NAME_FUNC_OFFSET(23156, glPointParameteriNV, glPointParameteriNV, NULL, - 863), - NAME_FUNC_OFFSET(23174, glPointParameterivNV, glPointParameterivNV, NULL, - 864), - NAME_FUNC_OFFSET(23193, gl_dispatch_stub_867, gl_dispatch_stub_867, NULL, - 867), - NAME_FUNC_OFFSET(23214, gl_dispatch_stub_869, gl_dispatch_stub_869, NULL, - 869), - NAME_FUNC_OFFSET(23230, glPrimitiveRestartIndexNV, - glPrimitiveRestartIndexNV, NULL, 876), - NAME_FUNC_OFFSET(23254, gl_dispatch_stub_879, gl_dispatch_stub_879, NULL, - 879), - NAME_FUNC_OFFSET(23278, gl_dispatch_stub_879, gl_dispatch_stub_879, NULL, - 879), - NAME_FUNC_OFFSET(23305, glBindFramebufferEXT, glBindFramebufferEXT, NULL, - 880), - NAME_FUNC_OFFSET(23323, glBindRenderbufferEXT, glBindRenderbufferEXT, NULL, - 881), - NAME_FUNC_OFFSET(23342, glCheckFramebufferStatusEXT, - glCheckFramebufferStatusEXT, NULL, 882), - NAME_FUNC_OFFSET(23367, glDeleteFramebuffersEXT, glDeleteFramebuffersEXT, - NULL, 883), - NAME_FUNC_OFFSET(23388, glDeleteRenderbuffersEXT, glDeleteRenderbuffersEXT, - NULL, 884), - NAME_FUNC_OFFSET(23410, glFramebufferRenderbufferEXT, - glFramebufferRenderbufferEXT, NULL, 885), - NAME_FUNC_OFFSET(23436, glFramebufferTexture1DEXT, - glFramebufferTexture1DEXT, NULL, 886), - NAME_FUNC_OFFSET(23459, glFramebufferTexture2DEXT, - glFramebufferTexture2DEXT, NULL, 887), - NAME_FUNC_OFFSET(23482, glFramebufferTexture3DEXT, - glFramebufferTexture3DEXT, NULL, 888), - NAME_FUNC_OFFSET(23505, glGenFramebuffersEXT, glGenFramebuffersEXT, NULL, - 889), - NAME_FUNC_OFFSET(23523, glGenRenderbuffersEXT, glGenRenderbuffersEXT, NULL, - 890), - NAME_FUNC_OFFSET(23542, glGenerateMipmapEXT, glGenerateMipmapEXT, NULL, - 891), - NAME_FUNC_OFFSET(23559, glGetFramebufferAttachmentParameterivEXT, - glGetFramebufferAttachmentParameterivEXT, NULL, 892), - NAME_FUNC_OFFSET(23597, glGetRenderbufferParameterivEXT, - glGetRenderbufferParameterivEXT, NULL, 893), - NAME_FUNC_OFFSET(23626, glIsFramebufferEXT, glIsFramebufferEXT, NULL, 894), - NAME_FUNC_OFFSET(23642, glIsRenderbufferEXT, glIsRenderbufferEXT, NULL, - 895), - NAME_FUNC_OFFSET(23659, glRenderbufferStorageEXT, glRenderbufferStorageEXT, - NULL, 896), - NAME_FUNC_OFFSET(23681, gl_dispatch_stub_897, gl_dispatch_stub_897, NULL, - 897), - NAME_FUNC_OFFSET(23699, glBindFragDataLocationEXT, - glBindFragDataLocationEXT, NULL, 900), - NAME_FUNC_OFFSET(23722, glGetFragDataLocationEXT, glGetFragDataLocationEXT, - NULL, 901), - NAME_FUNC_OFFSET(23744, glGetUniformuivEXT, glGetUniformuivEXT, NULL, 902), - NAME_FUNC_OFFSET(23760, glGetVertexAttribIivEXT, glGetVertexAttribIivEXT, - NULL, 903), - NAME_FUNC_OFFSET(23781, glGetVertexAttribIuivEXT, glGetVertexAttribIuivEXT, - NULL, 904), - NAME_FUNC_OFFSET(23803, glUniform1uiEXT, glUniform1uiEXT, NULL, 905), - NAME_FUNC_OFFSET(23816, glUniform1uivEXT, glUniform1uivEXT, NULL, 906), - NAME_FUNC_OFFSET(23830, glUniform2uiEXT, glUniform2uiEXT, NULL, 907), - NAME_FUNC_OFFSET(23843, glUniform2uivEXT, glUniform2uivEXT, NULL, 908), - NAME_FUNC_OFFSET(23857, glUniform3uiEXT, glUniform3uiEXT, NULL, 909), - NAME_FUNC_OFFSET(23870, glUniform3uivEXT, glUniform3uivEXT, NULL, 910), - NAME_FUNC_OFFSET(23884, glUniform4uiEXT, glUniform4uiEXT, NULL, 911), - NAME_FUNC_OFFSET(23897, glUniform4uivEXT, glUniform4uivEXT, NULL, 912), - NAME_FUNC_OFFSET(23911, glVertexAttribI1iEXT, glVertexAttribI1iEXT, NULL, - 913), - NAME_FUNC_OFFSET(23929, glVertexAttribI1ivEXT, glVertexAttribI1ivEXT, NULL, - 914), - NAME_FUNC_OFFSET(23948, glVertexAttribI1uiEXT, glVertexAttribI1uiEXT, NULL, - 915), - NAME_FUNC_OFFSET(23967, glVertexAttribI1uivEXT, glVertexAttribI1uivEXT, - NULL, 916), - NAME_FUNC_OFFSET(23987, glVertexAttribI2iEXT, glVertexAttribI2iEXT, NULL, - 917), - NAME_FUNC_OFFSET(24005, glVertexAttribI2ivEXT, glVertexAttribI2ivEXT, NULL, - 918), - NAME_FUNC_OFFSET(24024, glVertexAttribI2uiEXT, glVertexAttribI2uiEXT, NULL, - 919), - NAME_FUNC_OFFSET(24043, glVertexAttribI2uivEXT, glVertexAttribI2uivEXT, - NULL, 920), - NAME_FUNC_OFFSET(24063, glVertexAttribI3iEXT, glVertexAttribI3iEXT, NULL, - 921), - NAME_FUNC_OFFSET(24081, glVertexAttribI3ivEXT, glVertexAttribI3ivEXT, NULL, - 922), - NAME_FUNC_OFFSET(24100, glVertexAttribI3uiEXT, glVertexAttribI3uiEXT, NULL, - 923), - NAME_FUNC_OFFSET(24119, glVertexAttribI3uivEXT, glVertexAttribI3uivEXT, - NULL, 924), - NAME_FUNC_OFFSET(24139, glVertexAttribI4bvEXT, glVertexAttribI4bvEXT, NULL, - 925), - NAME_FUNC_OFFSET(24158, glVertexAttribI4iEXT, glVertexAttribI4iEXT, NULL, - 926), - NAME_FUNC_OFFSET(24176, glVertexAttribI4ivEXT, glVertexAttribI4ivEXT, NULL, - 927), - NAME_FUNC_OFFSET(24195, glVertexAttribI4svEXT, glVertexAttribI4svEXT, NULL, - 928), - NAME_FUNC_OFFSET(24214, glVertexAttribI4ubvEXT, glVertexAttribI4ubvEXT, - NULL, 929), - NAME_FUNC_OFFSET(24234, glVertexAttribI4uiEXT, glVertexAttribI4uiEXT, NULL, - 930), - NAME_FUNC_OFFSET(24253, glVertexAttribI4uivEXT, glVertexAttribI4uivEXT, - NULL, 931), - NAME_FUNC_OFFSET(24273, glVertexAttribI4usvEXT, glVertexAttribI4usvEXT, - NULL, 932), - NAME_FUNC_OFFSET(24293, glVertexAttribIPointerEXT, - glVertexAttribIPointerEXT, NULL, 933), - NAME_FUNC_OFFSET(24316, glFramebufferTextureLayerEXT, - glFramebufferTextureLayerEXT, NULL, 934), - NAME_FUNC_OFFSET(24342, glFramebufferTextureLayerEXT, - glFramebufferTextureLayerEXT, NULL, 934), - NAME_FUNC_OFFSET(24371, glColorMaskIndexedEXT, glColorMaskIndexedEXT, NULL, - 935), - NAME_FUNC_OFFSET(24384, glDisableIndexedEXT, glDisableIndexedEXT, NULL, - 936), - NAME_FUNC_OFFSET(24395, glEnableIndexedEXT, glEnableIndexedEXT, NULL, 937), - NAME_FUNC_OFFSET(24405, glGetBooleanIndexedvEXT, glGetBooleanIndexedvEXT, - NULL, 938), - NAME_FUNC_OFFSET(24421, glGetIntegerIndexedvEXT, glGetIntegerIndexedvEXT, - NULL, 939), - NAME_FUNC_OFFSET(24437, glIsEnabledIndexedEXT, glIsEnabledIndexedEXT, NULL, - 940), - NAME_FUNC_OFFSET(24450, glGetTexParameterIivEXT, glGetTexParameterIivEXT, - NULL, 943), - NAME_FUNC_OFFSET(24471, glGetTexParameterIuivEXT, glGetTexParameterIuivEXT, - NULL, 944), - NAME_FUNC_OFFSET(24493, glTexParameterIivEXT, glTexParameterIivEXT, NULL, - 945), - NAME_FUNC_OFFSET(24511, glTexParameterIuivEXT, glTexParameterIuivEXT, NULL, - 946), - NAME_FUNC_OFFSET(24530, glBeginConditionalRenderNV, - glBeginConditionalRenderNV, NULL, 947), - NAME_FUNC_OFFSET(24555, glEndConditionalRenderNV, glEndConditionalRenderNV, - NULL, 948), - NAME_FUNC_OFFSET(24578, glBeginTransformFeedbackEXT, - glBeginTransformFeedbackEXT, NULL, 949), - NAME_FUNC_OFFSET(24603, glBindBufferBaseEXT, glBindBufferBaseEXT, NULL, - 950), - NAME_FUNC_OFFSET(24620, glBindBufferRangeEXT, glBindBufferRangeEXT, NULL, - 952), - NAME_FUNC_OFFSET(24638, glEndTransformFeedbackEXT, - glEndTransformFeedbackEXT, NULL, 953), - NAME_FUNC_OFFSET(24661, glGetTransformFeedbackVaryingEXT, - glGetTransformFeedbackVaryingEXT, NULL, 954), - NAME_FUNC_OFFSET(24691, glTransformFeedbackVaryingsEXT, - glTransformFeedbackVaryingsEXT, NULL, 955), - NAME_FUNC_OFFSET(24719, glProvokingVertexEXT, glProvokingVertexEXT, NULL, - 956), - NAME_FUNC_OFFSET(-1, NULL, NULL, NULL, 0) -}; - -#undef NAME_FUNC_OFFSET diff --git a/glx/glthread.c b/glx/glthread.c deleted file mode 100644 index fd4c6cc09..000000000 --- a/glx/glthread.c +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.1 - * - * Copyright (C) 1999-2006 Brian Paul 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 - * BRIAN PAUL 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. - */ - -/* - * XXX There's probably some work to do in order to make this file - * truly reusable outside of Mesa. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include <dix-config.h> -#include <X11/Xfuncproto.h> -#endif - -#include <stdlib.h> -#include <stdio.h> -#include "glthread.h" - -/* - * This file should still compile even when THREADS is not defined. - * This is to make things easier to deal with on the makefile scene.. - */ -#ifdef THREADS -#include <errno.h> - -/* - * Error messages - */ -#define INIT_TSD_ERROR "_glthread_: failed to allocate key for thread specific data" -#define GET_TSD_ERROR "_glthread_: failed to get thread specific data" -#define SET_TSD_ERROR "_glthread_: thread failed to set thread specific data" - -/* - * Magic number to determine if a TSD object has been initialized. - * Kind of a hack but there doesn't appear to be a better cross-platform - * solution. - */ -#define INIT_MAGIC 0xff8adc98 - -/* - * POSIX Threads -- The best way to go if your platform supports them. - * Solaris >= 2.5 have POSIX threads, IRIX >= 6.4 reportedly - * has them, and many of the free Unixes now have them. - * Be sure to use appropriate -mt or -D_REENTRANT type - * compile flags when building. - */ -#ifdef PTHREADS - -_X_EXPORT unsigned long -_glthread_GetID(void) -{ - return (unsigned long) pthread_self(); -} - -void -_glthread_InitTSD(_glthread_TSD * tsd) -{ - if (pthread_key_create(&tsd->key, NULL /*free */ ) != 0) { - perror(INIT_TSD_ERROR); - exit(-1); - } - tsd->initMagic = INIT_MAGIC; -} - -void * -_glthread_GetTSD(_glthread_TSD * tsd) -{ - if (tsd->initMagic != (int) INIT_MAGIC) { - _glthread_InitTSD(tsd); - } - return pthread_getspecific(tsd->key); -} - -void -_glthread_SetTSD(_glthread_TSD * tsd, void *ptr) -{ - if (tsd->initMagic != (int) INIT_MAGIC) { - _glthread_InitTSD(tsd); - } - if (pthread_setspecific(tsd->key, ptr) != 0) { - perror(SET_TSD_ERROR); - exit(-1); - } -} - -#endif /* PTHREADS */ - -/* - * Win32 Threads. The only available option for Windows 95/NT. - * Be sure that you compile using the Multithreaded runtime, otherwise - * bad things will happen. - */ -#ifdef WIN32_THREADS - -void -FreeTSD(_glthread_TSD * p) -{ - if (p->initMagic == INIT_MAGIC) { - TlsFree(p->key); - p->initMagic = 0; - } -} - -void -InsteadOf_exit(int nCode) -{ - DWORD dwErr = GetLastError(); -} - -unsigned long -_glthread_GetID(void) -{ - return GetCurrentThreadId(); -} - -void -_glthread_InitTSD(_glthread_TSD * tsd) -{ - tsd->key = TlsAlloc(); - if (tsd->key == TLS_OUT_OF_INDEXES) { - perror("Mesa:_glthread_InitTSD"); - InsteadOf_exit(-1); - } - tsd->initMagic = INIT_MAGIC; -} - -void * -_glthread_GetTSD(_glthread_TSD * tsd) -{ - if (tsd->initMagic != INIT_MAGIC) { - _glthread_InitTSD(tsd); - } - return TlsGetValue(tsd->key); -} - -void -_glthread_SetTSD(_glthread_TSD * tsd, void *ptr) -{ - /* the following code assumes that the _glthread_TSD has been initialized - to zero at creation */ - if (tsd->initMagic != INIT_MAGIC) { - _glthread_InitTSD(tsd); - } - if (TlsSetValue(tsd->key, ptr) == 0) { - perror("Mesa:_glthread_SetTSD"); - InsteadOf_exit(-1); - } -} - -#endif /* WIN32_THREADS */ - -#else /* THREADS */ - -/* - * no-op functions - */ - -_X_EXPORT unsigned long -_glthread_GetID(void) -{ - return 0; -} - -void -_glthread_InitTSD(_glthread_TSD * tsd) -{ - (void) tsd; -} - -void * -_glthread_GetTSD(_glthread_TSD * tsd) -{ - (void) tsd; - return NULL; -} - -void -_glthread_SetTSD(_glthread_TSD * tsd, void *ptr) -{ - (void) tsd; - (void) ptr; -} - -#endif /* THREADS */ diff --git a/glx/glxcmds.c b/glx/glxcmds.c index c1f4e22f8..92b4f05f7 100644 --- a/glx/glxcmds.c +++ b/glx/glxcmds.c @@ -215,6 +215,13 @@ __glXdirectContextCreate(__GLXscreen * screen, return context; } +void +FlushContext(__GLXcontext * cx) +{ + CALL_Flush(GET_DISPATCH(), ()); + cx->hasUnflushedCommands = GL_FALSE; +} + /** * Create a GL context with the given properties. This routine is used * to implement \c glXCreateContext, \c glXCreateNewContext, and diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c index b47839868..7eb537df4 100644 --- a/glx/glxdriswrast.c +++ b/glx/glxdriswrast.c @@ -75,6 +75,8 @@ struct __GLXDRIscreen { const __DRIcopySubBufferExtension *copySubBuffer; const __DRItexBufferExtension *texBuffer; const __DRIconfig **driConfigs; + + unsigned char glx_enable_bits[__GLX_EXT_BYTES]; }; struct __GLXDRIcontext { @@ -410,12 +412,27 @@ initializeExtensions(__GLXDRIscreen * screen) extensions = screen->core->getExtensions(screen->driScreen); + /* GLX_MESA_copy_sub_buffer is always enabled. */ + __glXEnableExtension(screen->glx_enable_bits, "GLX_MESA_copy_sub_buffer"); + for (i = 0; extensions[i]; i++) { +#ifdef __DRI_READ_DRAWABLE + if (strcmp(extensions[i]->name, __DRI_READ_DRAWABLE) == 0) { + __glXEnableExtension(screen->glx_enable_bits, + "GLX_SGI_make_current_read"); + + LogMessage(X_INFO, "AIGLX: enabled GLX_SGI_make_current_read\n"); + } +#endif + #ifdef __DRI_COPY_SUB_BUFFER if (strcmp(extensions[i]->name, __DRI_COPY_SUB_BUFFER) == 0) { screen->copySubBuffer = (const __DRIcopySubBufferExtension *) extensions[i]; - /* GLX_MESA_copy_sub_buffer is always enabled. */ + __glXEnableExtension(screen->glx_enable_bits, + "GLX_MESA_copy_sub_buffer"); + + LogMessage(X_INFO, "AIGLX: enabled GLX_MESA_copy_sub_buffer\n"); } #endif @@ -423,6 +440,7 @@ initializeExtensions(__GLXDRIscreen * screen) if (strcmp(extensions[i]->name, __DRI_TEX_BUFFER) == 0) { screen->texBuffer = (const __DRItexBufferExtension *) extensions[i]; /* GLX_EXT_texture_from_pixmap is always enabled. */ + LogMessage(X_INFO, "AIGLX: enabled GLX_EXT_texture_from_pixmap\n"); } #endif /* Ignore unknown extensions */ @@ -434,6 +452,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen) { const char *driverName = "swrast"; __GLXDRIscreen *screen; + size_t buffer_size; screen = calloc(1, sizeof *screen); if (screen == NULL) @@ -445,6 +464,8 @@ __glXDRIscreenProbe(ScreenPtr pScreen) screen->base.swapInterval = NULL; screen->base.pScreen = pScreen; + __glXInitExtensionEnableBits(screen->glx_enable_bits); + screen->driver = glxProbeDriver(driverName, (void **) &screen->core, __DRI_CORE, __DRI_CORE_VERSION, @@ -473,6 +494,19 @@ __glXDRIscreenProbe(ScreenPtr pScreen) __glXScreenInit(&screen->base, pScreen); + /* The first call simply determines the length of the extension string. + * This allows us to allocate some memory to hold the extension string, + * but it requires that we call __glXGetExtensionString a second time. + */ + buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL); + if (buffer_size > 0) { + free(screen->base.GLXextensions); + + screen->base.GLXextensions = xnfalloc(buffer_size); + (void) __glXGetExtensionString(screen->glx_enable_bits, + screen->base.GLXextensions); + } + screen->base.GLXmajor = 1; screen->base.GLXminor = 4; diff --git a/glx/glxext.c b/glx/glxext.c index bc7fe8217..3aba6996f 100644 --- a/glx/glxext.c +++ b/glx/glxext.c @@ -139,6 +139,7 @@ DrawableGone(__GLXdrawable * glxPriv, XID xid) for (c = glxAllContexts; c; c = next) { next = c->next; if (c->isCurrent && (c->drawPriv == glxPriv || c->readPriv == glxPriv)) { + FlushContext(c); (*c->loseCurrent) (c); c->isCurrent = GL_FALSE; if (c == __glXLastContext) diff --git a/glx/glxscreens.c b/glx/glxscreens.c index 61d590cc8..6a2382ad4 100644 --- a/glx/glxscreens.c +++ b/glx/glxscreens.c @@ -163,18 +163,6 @@ static const char GLServerExtensions[] = static char GLXServerVendorName[] = "SGI"; unsigned glxMajorVersion = SERVER_GLX_MAJOR_VERSION; unsigned glxMinorVersion = SERVER_GLX_MINOR_VERSION; -static char GLXServerExtensions[] = - "GLX_ARB_multisample " - "GLX_EXT_visual_info " - "GLX_EXT_visual_rating " - "GLX_EXT_import_context " - "GLX_EXT_texture_from_pixmap " - "GLX_OML_swap_method " "GLX_SGI_make_current_read " -#ifndef __APPLE__ - "GLX_SGIS_multisample " -#endif - "GLX_SGIX_fbconfig " - "GLX_SGIX_pbuffer " "GLX_MESA_copy_sub_buffer "; static Bool glxCloseScreen(ScreenPtr pScreen) @@ -331,7 +319,7 @@ __glXScreenInit(__GLXscreen * pGlxScreen, ScreenPtr pScreen) pGlxScreen->pScreen = pScreen; pGlxScreen->GLextensions = strdup(GLServerExtensions); pGlxScreen->GLXvendor = strdup(GLXServerVendorName); - pGlxScreen->GLXextensions = strdup(GLXServerExtensions); + pGlxScreen->GLXextensions = strdup(""); /* All GLX providers must support all of the functionality required for at * least GLX 1.2. If the provider supports a higher version, the GLXminor diff --git a/glx/rensize.c b/glx/rensize.c index bcc3a53ad..a78e60c8f 100644 --- a/glx/rensize.c +++ b/glx/rensize.c @@ -226,12 +226,14 @@ __glXImageSize(GLenum format, GLenum type, GLenum target, case GL_INTENSITY: elementsPerGroup = 1; break; + case GL_RG: case GL_422_EXT: case GL_422_REV_EXT: case GL_422_AVERAGE_EXT: case GL_422_REV_AVERAGE_EXT: case GL_DEPTH_STENCIL_NV: case GL_DEPTH_STENCIL_MESA: + case GL_YCBCR_422_APPLE: case GL_YCBCR_MESA: case GL_LUMINANCE_ALPHA: elementsPerGroup = 2; diff --git a/hw/dmx/doc/dmx.xml b/hw/dmx/doc/dmx.xml index 6d7df4133..c6c8544ff 100644 --- a/hw/dmx/doc/dmx.xml +++ b/hw/dmx/doc/dmx.xml @@ -1268,7 +1268,7 @@ default routine is chosen during GC validation. <para>Note that some pointers to functions that draw to the screen are stored in the Screen structure. They include GetImage(), GetSpans(), -CopyWindow() and RestoreAreas(). +PaintWindow(), CopyWindow() and RestoreAreas(). </para> </sect3> diff --git a/hw/xquartz/Makefile.am b/hw/xquartz/Makefile.am index a7cc012d9..2623a9db0 100644 --- a/hw/xquartz/Makefile.am +++ b/hw/xquartz/Makefile.am @@ -28,7 +28,6 @@ libXquartz_la_SOURCES = \ darwinEvents.c \ darwinXinput.c \ keysym2ucs.c \ - pseudoramiX.c \ quartz.c \ quartzCocoa.m \ quartzKeyboard.c \ @@ -44,7 +43,6 @@ EXTRA_DIST = \ darwinfb.h \ darwinEvents.h \ keysym2ucs.h \ - pseudoramiX.h \ quartz.h \ quartzCommon.h \ quartzKeyboard.h \ diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c index 5b977c7f9..1a493e178 100644 --- a/hw/xquartz/quartz.c +++ b/hw/xquartz/quartz.c @@ -300,7 +300,7 @@ QuartzUpdateScreens(void) quartzProcs->UpdateScreen(pScreen); /* miPaintWindow needs to be called after RootlessUpdateScreenPixmap (from xprUpdateScreen) */ - miPaintWindow(pRoot, &pRoot->borderClip, PW_BACKGROUND); + pScreen->PaintWindow(pRoot, &pRoot->borderClip, PW_BACKGROUND); /* Tell RandR about the new size, so new connections get the correct info */ RRScreenSizeNotify(pScreen); diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c index 04c17b702..1b50737e5 100644 --- a/hw/xwin/InitOutput.c +++ b/hw/xwin/InitOutput.c @@ -35,12 +35,10 @@ from The Open Group. #include "winmsg.h" #include "winconfig.h" #include "winprefs.h" -#ifdef XWIN_CLIPBOARD -#include "X11/Xlocale.h" -#endif #ifdef DPMSExtension #include "dpmsproc.h" #endif +#include <locale.h> #ifdef __CYGWIN__ #include <mntent.h> #endif @@ -54,6 +52,8 @@ typedef WINAPI HRESULT(*SHGETFOLDERPATHPROC) (HWND hwndOwner, HANDLE hToken, DWORD dwFlags, LPTSTR pszPath); #endif +#include "winmonitors.h" +#include "pseudoramiX/pseudoramiX.h" #include "glx_extinit.h" /* @@ -68,6 +68,8 @@ extern HWND g_hwndClipboard; extern Bool g_fClipboard; #endif +extern Bool noRRXineramaExtension; + /* * Function prototypes */ @@ -77,8 +79,6 @@ static void winClipboardShutdown(void); #endif -static Bool - winCheckDisplayNumber(void); void winLogCommandLine(int argc, char *argv[]); @@ -93,6 +93,8 @@ Bool const char *winGetBaseDir(void); #endif +static void winCheckMount(void); + /* * For the depth 24 pixmap we default to 32 bits per pixel, but * we change this pixmap format later if we detect that the display @@ -186,6 +188,27 @@ ddxBeforeReset(void) } #endif +int +main(int argc, char *argv[], char *envp[]) +{ + int iReturn; + + /* Create & acquire the termination mutex */ + iReturn = pthread_mutex_init(&g_pmTerminating, NULL); + if (iReturn != 0) { + ErrorF("ddxMain - pthread_mutex_init () failed: %d\n", iReturn); + } + + iReturn = pthread_mutex_lock(&g_pmTerminating); + if (iReturn != 0) { + ErrorF("ddxMain - pthread_mutex_lock () failed: %d\n", iReturn); + } + + winCheckMount(); + + return dix_main(argc, argv, envp); +} + /* See Porting Layer Definition - p. 57 */ void ddxGiveUp(enum ExitCode error) @@ -243,6 +266,19 @@ ddxGiveUp(enum ExitCode error) /* Tell Windows that we want to end the app */ PostQuitMessage(0); + + { + winDebug("ddxGiveUp - Releasing termination mutex\n"); + + int iReturn = pthread_mutex_unlock(&g_pmTerminating); + + if (iReturn != 0) { + ErrorF("winMsgWindowProc - pthread_mutex_unlock () failed: %d\n", + iReturn); + } + } + + winDebug("ddxGiveUp - End\n"); } /* See Porting Layer Definition - p. 57 */ @@ -256,6 +292,8 @@ AbortDDX(enum ExitCode error) } #ifdef __CYGWIN__ +extern Bool nolock; + /* hasmntopt is currently not implemented for cygwin */ static const char * winCheckMntOpt(const struct mntent *mnt, const char *opt) @@ -280,6 +318,9 @@ winCheckMntOpt(const struct mntent *mnt, const char *opt) return NULL; } +/* + Check mounts and issue warnings/activate workarounds as needed + */ static void winCheckMount(void) { @@ -289,6 +330,7 @@ winCheckMount(void) enum { none = 0, sys_root, user_root, sys_tmp, user_tmp } level = none, curlevel; BOOL binary = TRUE; + BOOL fat = TRUE; mnt = setmntent("/etc/mtab", "r"); if (mnt == NULL) { @@ -327,6 +369,11 @@ winCheckMount(void) binary = FALSE; else binary = TRUE; + + if (strcmp(ent->mnt_type, "vfat") == 0) + fat = TRUE; + else + fat = FALSE; } if (endmntent(mnt) != 1) { @@ -336,6 +383,12 @@ winCheckMount(void) if (!binary) winMsg(X_WARNING, "/tmp mounted in textmode\n"); + + if (fat) { + winMsg(X_WARNING, + "/tmp mounted on FAT filesystem, activating -nolock\n"); + nolock = TRUE; + } } #else static void @@ -747,6 +800,9 @@ winUseMsg(void) ErrorF("-fullscreen\n" "\tRun the server in fullscreen mode.\n"); + ErrorF("-hostintitle\n" + "\tIn multiwindow mode, add remote host names to window titles.\n"); + ErrorF("-ignoreinput\n" "\tIgnore keyboard and mouse input.\n"); #ifdef XWIN_MULTIWINDOWEXTWM @@ -915,14 +971,6 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) "Exiting.\n"); } - /* Check for duplicate invocation on same display number. */ - if (serverGeneration == 1 && !winCheckDisplayNumber()) { - if (g_fSilentDupError) - g_fSilentFatalError = TRUE; - FatalError("InitOutput - Duplicate invocation on display " - "number: %s. Exiting.\n", display); - } - #ifdef XWIN_XF86CONFIG /* Try to read the xorg.conf-style configuration file */ if (!winReadConfigfile()) @@ -962,6 +1010,10 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) /* Store the instance handle */ g_hInstance = GetModuleHandle(NULL); + /* Create the messaging window */ + if (serverGeneration == 1) + winCreateMsgWindowThread(); + /* Initialize each screen */ for (i = 0; i < g_iNumScreens; ++i) { /* Initialize the screen */ @@ -970,6 +1022,61 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) } } + /* + Unless full xinerama has been explicitly enabled, register all native screens with pseudoramiX + */ + if (!noPanoramiXExtension) + noPseudoramiXExtension = TRUE; + + if ((g_ScreenInfo[0].fMultipleMonitors) && !noPseudoramiXExtension) + { + int pass; + + noRRXineramaExtension = TRUE; + + PseudoramiXExtensionInit(argc, argv); + + /* Add primary monitor on pass 0, other monitors on pass 1, to ensure + the primary monitor is first in XINERAMA list */ + for (pass = 0; pass < 2; pass++) + { + int iMonitor; + + for (iMonitor = 1; ; iMonitor++) + { + struct GetMonitorInfoData data; + QueryMonitor(iMonitor, &data); + if (data.bMonitorSpecifiedExists) + { + MONITORINFO mi; + mi.cbSize = sizeof(MONITORINFO); + + if (GetMonitorInfo(data.monitorHandle, &mi)) + { + /* pass == 1 XOR primary monitor flags is set */ + if ((!(pass == 1)) != (!(mi.dwFlags & MONITORINFOF_PRIMARY))) + { + /* + Note the screen origin in a normalized coordinate space where (0,0) is at the top left + of the native virtual desktop area + */ + data.monitorOffsetX = data.monitorOffsetX - GetSystemMetrics(SM_XVIRTUALSCREEN); + data.monitorOffsetY = data.monitorOffsetY - GetSystemMetrics(SM_YVIRTUALSCREEN); + + winDebug ("InitOutput - screen %d added at virtual desktop coordinate (%d,%d) (pseudoramiX) \n", + iMonitor-1, data.monitorOffsetX, data.monitorOffsetY); + + PseudoramiXAddScreen(data.monitorOffsetX, data.monitorOffsetY, + data.monitorWidth, data.monitorHeight); + } + } + } + else + break; + } + } + } + #if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW) /* Generate a cookie used by internal clients for authorization */ @@ -978,11 +1085,24 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) /* Perform some one time initialization */ if (1 == serverGeneration) { + /* Allow multiple threads to access Xlib */ + if (XInitThreads() == 0) { + ErrorF("XInitThreads failed.\n"); + } + /* * setlocale applies to all threads in the current process. * Apply locale specified in LANG environment variable. */ - setlocale(LC_ALL, ""); + if (!setlocale(LC_ALL, "")) { + ErrorF("setlocale failed.\n"); + } + + /* See if X supports the current locale */ + if (XSupportsLocale() == FALSE) { + ErrorF("Warning: Locale not supported by X, falling back to 'C' locale.\n"); + setlocale(LC_ALL, "C"); + } } #endif @@ -990,70 +1110,3 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) winDebug("InitOutput - Returning.\n"); #endif } - -/* - * winCheckDisplayNumber - Check if another instance of Cygwin/X is - * already running on the same display number. If no one exists, - * make a mutex to prevent new instances from running on the same display. - * - * return FALSE if the display number is already used. - */ - -static Bool -winCheckDisplayNumber(void) -{ - int nDisp; - HANDLE mutex; - char name[MAX_PATH]; - char *pszPrefix = '\0'; - OSVERSIONINFO osvi = { 0 }; - - /* Check display range */ - nDisp = atoi(display); - if (nDisp < 0 || nDisp > 65535) { - ErrorF("winCheckDisplayNumber - Bad display number: %d\n", nDisp); - return FALSE; - } - - /* Set first character of mutex name to null */ - name[0] = '\0'; - - /* Get operating system version information */ - osvi.dwOSVersionInfoSize = sizeof(osvi); - GetVersionEx(&osvi); - - /* Want a mutex shared among all terminals on NT > 4.0 */ - if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT && osvi.dwMajorVersion >= 5) { - pszPrefix = "Global\\"; - } - - /* Setup Cygwin/X specific part of name */ - snprintf(name, sizeof(name), "%sCYGWINX_DISPLAY:%d", pszPrefix, nDisp); - - /* Windows automatically releases the mutex when this process exits */ - mutex = CreateMutex(NULL, FALSE, name); - if (!mutex) { - LPVOID lpMsgBuf; - - /* Display a fancy error message */ - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) &lpMsgBuf, 0, NULL); - ErrorF("winCheckDisplayNumber - CreateMutex failed: %s\n", - (LPSTR) lpMsgBuf); - LocalFree(lpMsgBuf); - - return FALSE; - } - if (GetLastError() == ERROR_ALREADY_EXISTS) { - ErrorF("winCheckDisplayNumber - " - PROJECT_NAME " is already running on display %d\n", nDisp); - return FALSE; - } - - return TRUE; -} diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am index 93ce57038..b5a0228b6 100644 --- a/hw/xwin/Makefile.am +++ b/hw/xwin/Makefile.am @@ -15,7 +15,7 @@ if XWIN_GLX_WINDOWS GLX_DIR = glx DEFS_GLX_WINDOWS = -DXWIN_GLX_WINDOWS XWIN_GLX_LIBS = $(top_builddir)/hw/xwin/glx/libXwinGLX.la -XWIN_GLX_LINK_FLAGS = -lopengl32 +XWIN_GLX_SYS_LIBS = -lopengl32 endif if XWIN_MULTIWINDOW @@ -27,7 +27,8 @@ SRCS_MULTIWINDOW = \ propertystore.h \ winSetAppUserModelID.c DEFS_MULTIWINDOW = -DXWIN_MULTIWINDOW -MULTIWINDOW_LIBS = -lshlwapi -lole32 +MULTIWINDOW_SYS_LIBS = -lshlwapi -lole32 +MULTIWINDOW_LIBS = $(top_builddir)/hw/xwin/wmutil/libXWinWMUtil.la endif if XWIN_MULTIWINDOWEXTWM @@ -92,6 +93,7 @@ SRCS = InitInput.c \ winmonitors.c \ winmouse.c \ winmsg.c \ + winmsgwindow.c \ winmultiwindowclass.c \ winmultiwindowicons.c \ winprefs.c \ @@ -113,8 +115,6 @@ SRCS = InitInput.c \ winconfig.h \ win.h \ winglobals.h \ - winkeybd.h \ - winkeynames.h \ winlayouts.h \ winmessages.h \ winmonitors.h \ @@ -125,6 +125,7 @@ SRCS = InitInput.c \ winprefs.h \ winresource.h \ winwindow.h \ + windisplay.c \ XWin.rc \ $(top_srcdir)/Xext/dpmsstubs.c \ $(top_srcdir)/Xi/stubs.c \ @@ -152,9 +153,11 @@ XWin_SOURCES = $(SRCS) INCLUDES = -I$(top_srcdir)/miext/rootless XWIN_SYS_LIBS += -ldxguid +XWIN_LIBS += $(top_builddir)/pseudoramiX/libPseudoramiX.la -XWin_DEPENDENCIES = $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS) -XWin_LDADD = $(MULTIWINDOW_LIBS) $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_GLX_LINK_FLAGS) $(XWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) $(XWIN_SYS_LIBS) +XWin_DEPENDENCIES = $(MULTIWINDOW_LIBS) $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS) +XWin_LDADD = $(MULTIWINDOW_LIBS) $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS) \ + $(XWIN_GLX_SYS_LIBS) $(XSERVER_SYS_LIBS) $(XWIN_SYS_LIBS) $(MULTIWINDOW_SYS_LIBS) XWin_LDFLAGS = -mwindows -static .rc.o: @@ -188,5 +191,5 @@ EXTRA_DIST = \ relink: $(AM_V_at)rm -f XWin$(EXEEXT) && $(MAKE) XWin$(EXEEXT) -SUBDIRS = man $(GLX_DIR) . +SUBDIRS = man $(GLX_DIR) wmutil . DIST_SUBDIRS = man glx . diff --git a/hw/xwin/glx/winpriv.c b/hw/xwin/glx/winpriv.c index 4f6e4ffd5..11612f905 100644 --- a/hw/xwin/glx/winpriv.c +++ b/hw/xwin/glx/winpriv.c @@ -14,6 +14,36 @@ void winCreateWindowsWindow(WindowPtr pWin); +static void +winCreateWindowsWindowHierarchy(WindowPtr pWin) +{ + winWindowPriv(pWin); + + winDebug("winCreateWindowsWindowHierarchy - pWin:%08x XID:0x%x \n", pWin, + pWin->drawable.id); + + /* recursively ensure parent window exists if it's not the root window */ + if (pWin->parent) { + if (pWin->parent != pWin->drawable.pScreen->root) + winCreateWindowsWindowHierarchy(pWin->parent); + } + + /* ensure this window exists */ + if (pWinPriv->hWnd == NULL) { + winCreateWindowsWindow(pWin); + + /* ... and if it's already been mapped, make sure it's visible */ + if (pWin->mapped) { + /* Display the window without activating it */ + if (pWin->drawable.class != InputOnly) + ShowWindow(pWinPriv->hWnd, SW_SHOWNOACTIVATE); + + /* Send first paint message */ + UpdateWindow(pWinPriv->hWnd); + } + } +} + /** * Return size and handles of a window. * If pWin is NULL, then the information for the root window is requested. @@ -50,8 +80,8 @@ winGetWindowInfo(WindowPtr pWin) } if (pWinPriv->hWnd == NULL) { - winCreateWindowsWindow(pWin); - ErrorF("winGetWindowInfo: forcing window to exist...\n"); + ErrorF("winGetWindowInfo: forcing window to exist\n"); + winCreateWindowsWindowHierarchy(pWin); } if (pWinPriv->hWnd != NULL) { diff --git a/hw/xwin/man/XWin.man b/hw/xwin/man/XWin.man index 18ee667d4..cf5324131 100644 --- a/hw/xwin/man/XWin.man +++ b/hw/xwin/man/XWin.man @@ -76,6 +76,9 @@ preceeding \fB\-screen\fP parameter. .B \-[no]multimonitors or \-[no]multiplemonitors Create a screen 0 that covers all monitors [the primary monitor] on a system with multiple monitors. +Fake XINERAMA data is created describing the individual monitors, +(This is similar to the 'merged framebuffer' or 'pseudo-xinerama' mode provided by +some drivers for the xorg X server). This option is currently enabled by default in \fB\-multiwindow\fP mode. .TP 8 .B "\-screen \fIscreen_number\fP [\fIW\fP \fIH\fP [\fIX\fP \fIY\fP] | [[\fIW\fPx\fIH\fP[+\fIX\fP+\fIY\fP]][@\fIM\fP]] ] " @@ -165,6 +168,12 @@ The maximum dimensions of the screen are the dimensions of the \fIWindows\fP vir on its own is equivalent to \fB\-resize=randr\fP .RE +.SH OPTIONS FOR MULTIWINDOW MODE +.TP 8 +.B \-hostintitle +Add the host name to the window title for X applications which are running +on remote hosts, when that information is available and it's useful to do so. + .SH OPTIONS CONTROLLING WINDOWS INTEGRATION .TP 8 .B \-[no]clipboard diff --git a/hw/xwin/man/XWinrc.man b/hw/xwin/man/XWinrc.man index 71d8dad23..0f641e92f 100644 --- a/hw/xwin/man/XWinrc.man +++ b/hw/xwin/man/XWinrc.man @@ -54,6 +54,35 @@ There are four kinds of instructions: miscellaneous, menu, icon and style. .SH Miscellaneous instruction .TP 8 +.B DPI \fIresolution\fP +Sets the resolution for all screens, in dots per inch. To be used when +the server cannot determine the screen size(s) from the hardware. + +.TP 8 +.B XKBLayout \fIlayout\fP +.TP 8 +.B XKBModel \fImodel\fP +.TP 8 +.B XKBOptions \fIoption\fP +.TP 8 +.B XKBRules \fIrule\fP +.TP 8 +.B XKBVariant \fIvariant\fp +These options configure the xkeyboard extension to load a particular +keyboard map as the X server starts. The behavior is similar to the +\fIsetxkbmap\fP(1) program. + +See the \fIxkeyboard-config\fP(__miscmansuffix__) manual page for a list of +keyboard configurations. + +Alternatively, you can use \fIsetxkbmap\fP(1) program after \fIXWin\fP +is running. + +The default is to select a keyboard configuration matching your current +layout as reported by \fIWindows\fP, if known, or the default X server +configuration if no matching keyboard configuration was found. + +.TP 8 .B DEBUG \fIString\fP The \fIString\fP is printed to the XWin log file. diff --git a/hw/xwin/system.XWinrc b/hw/xwin/system.XWinrc index f0771c610..5ff3abad6 100644 --- a/hw/xwin/system.XWinrc +++ b/hw/xwin/system.XWinrc @@ -89,9 +89,17 @@ menu apps { } menu root { + "Applications" menu apps // Comments fit here, too... + + SEPARATOR + FAQ EXEC "cygstart http://x.cygwin.com/docs/faq/cygwin-x-faq.html" + "User's Guide" EXEC "cygstart http://x.cygwin.com/docs/ug/cygwin-x-ug.html" + SEPARATOR + "View logfile" EXEC "xterm -e less +F $XWINLOGFILE" + SEPARATOR + "Reload .XWinrc" RELOAD - "Applications" menu apps SEParATOR } diff --git a/hw/xwin/win.h b/hw/xwin/win.h index fa774bc00..5e0ca8901 100644 --- a/hw/xwin/win.h +++ b/hw/xwin/win.h @@ -42,22 +42,16 @@ #define YES 1 #endif +/* We can handle WM_MOUSEHWHEEL even though _WIN32_WINNT < 0x0600 */ +#ifndef WM_MOUSEHWHEEL +#define WM_MOUSEHWHEEL 0x020E +#endif + /* Turn debug messages on or off */ #ifndef CYGDEBUG #define CYGDEBUG NO #endif -/* WM_XBUTTON Messages. They should go into w32api. */ -#ifndef WM_XBUTTONDOWN -#define WM_XBUTTONDOWN 523 -#endif -#ifndef WM_XBUTTONUP -#define WM_XBUTTONUP 524 -#endif -#ifndef WM_XBUTTONDBLCLK -#define WM_XBUTTONDBLCLK 525 -#endif - #define WIN_DEFAULT_BPP 0 #define WIN_DEFAULT_WHITEPIXEL 255 #define WIN_DEFAULT_BLACKPIXEL 0 @@ -460,6 +454,7 @@ typedef struct _winPrivScreenRec { Bool fBadDepth; int iDeltaZ; + int iDeltaV; int iConnectedClients; @@ -921,9 +916,6 @@ void * winkeybd.c */ -void - winTranslateKey(WPARAM wParam, LPARAM lParam, int *piScanCode); - int winKeybdProc(DeviceIntPtr pDeviceInt, int iState); @@ -933,20 +925,6 @@ void void winRestoreModeKeyStates(void); -Bool - winIsFakeCtrl_L(UINT message, WPARAM wParam, LPARAM lParam); - -void - winKeybdReleaseKeys(void); - -void - winSendKeyEvent(DWORD dwKey, Bool fDown); - -BOOL winCheckKeyPressed(WPARAM wParam, LPARAM lParam); - -void - winFixShiftKeys(int iScanCode); - /* * winkeyhook.c */ @@ -986,13 +964,6 @@ int winMouseProc(DeviceIntPtr pDeviceInt, int iState); int - winMouseWheel(ScreenPtr pScreen, int iDeltaZ); - -void - winMouseButtonsSendEvent(int iEventType, int iButton); - -int - winMouseButtonsHandle(ScreenPtr pScreen, int iEventType, int iButton, WPARAM wParam); @@ -1237,6 +1208,8 @@ int LRESULT CALLBACK winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); +LRESULT CALLBACK +winChildWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); #endif /* @@ -1401,6 +1374,18 @@ void winDoRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, CARD32 mmWidth, CARD32 mmHeight); +/* + * windisplay.c + */ + +void +winGetDisplayName(char *szDisplay, unsigned int screen); + +/* + * winmsgwindow.c + */ +Bool +winCreateMsgWindowThread(void); /* * END DDX and DIX Function Prototypes diff --git a/hw/xwin/winclipboard.h b/hw/xwin/winclipboard.h index 2cd775d6b..ad994d5ad 100644 --- a/hw/xwin/winclipboard.h +++ b/hw/xwin/winclipboard.h @@ -49,7 +49,6 @@ #include <X11/Xatom.h> #include <X11/Xproto.h> #include <X11/Xutil.h> -#include <X11/Xlocale.h> /* Windows headers */ #include <X11/Xwindows.h> diff --git a/hw/xwin/winclipboardtextconv.c b/hw/xwin/winclipboardtextconv.c index fd405a02e..7b8eb9826 100644 --- a/hw/xwin/winclipboardtextconv.c +++ b/hw/xwin/winclipboardtextconv.c @@ -48,11 +48,14 @@ void */ void -winClipboardDOStoUNIX(char *pszSrc, int iLength) +winClipboardDOStoUNIX(char *pszData, int iLength) { + char *pszSrc = pszData; char *pszDest = pszSrc; char *pszEnd = pszSrc + iLength; + winDebug("DOXtoUNIX() - Original data:'%s'\n", pszData); + /* Loop until the last character */ while (pszSrc < pszEnd) { /* Copy the current source character to current destination character */ @@ -68,6 +71,8 @@ winClipboardDOStoUNIX(char *pszSrc, int iLength) /* Move the terminating null */ *pszDest = '\0'; + + winDebug("DOStoUNIX() - Final string:'%s'\n", pszData); } /* @@ -101,8 +106,10 @@ winClipboardUNIXtoDOS(char **ppszData, int iLength) } /* Return if no naked \n's */ - if (iNewlineCount == 0) + if (iNewlineCount == 0) { + winDebug("UNIXtoDOS () - no conversion necessary\n"); return; + } /* Allocate a new string */ pszDestBegin = pszDest = malloc(iLength + iNewlineCount + 1); diff --git a/hw/xwin/winclipboardthread.c b/hw/xwin/winclipboardthread.c index c8508a9b8..b5ba16f4c 100644 --- a/hw/xwin/winclipboardthread.c +++ b/hw/xwin/winclipboardthread.c @@ -76,6 +76,9 @@ static int static int winClipboardIOErrorHandler(Display * pDisplay); +static void +winClipboardThreadExit(void *arg); + /* * Main thread function */ @@ -102,6 +105,8 @@ winClipboardProc(void *pvNotUsed) char szDisplay[512]; int iSelectError; + pthread_cleanup_push(&winClipboardThreadExit, NULL); + winDebug("winClipboardProc - Hello\n"); ++clipboardRestarts; @@ -111,16 +116,6 @@ winClipboardProc(void *pvNotUsed) /* Save the Unicode support flag in a global */ g_fUseUnicode = fUseUnicode; - /* Allow multiple threads to access Xlib */ - if (XInitThreads() == 0) { - ErrorF("winClipboardProc - XInitThreads failed.\n"); - goto winClipboardProc_Exit; - } - - /* See if X supports the current locale */ - if (XSupportsLocale() == False) { - ErrorF("winClipboardProc - Warning: Locale not supported by X.\n"); - } /* Set error handler */ XSetErrorHandler(winClipboardErrorHandler); @@ -140,7 +135,7 @@ winClipboardProc(void *pvNotUsed) else if (iReturn == WIN_JMP_ERROR_IO) { /* TODO: Cleanup the Win32 window and free any allocated memory */ ErrorF("winClipboardProc - setjmp returned for IO Error Handler.\n"); - pthread_exit(NULL); + goto winClipboardProc_Done; } /* Use our generated cookie for authentication */ @@ -157,7 +152,7 @@ winClipboardProc(void *pvNotUsed) * for all screens on the display. That is why there is only * one clipboard client thread. */ - snprintf(szDisplay, 512, "127.0.0.1:%s.0", display); + winGetDisplayName(szDisplay, 0); /* Print the display connection string */ ErrorF("winClipboardProc - DISPLAY=%s\n", szDisplay); @@ -183,7 +178,7 @@ winClipboardProc(void *pvNotUsed) goto winClipboardProc_Done; } - /* Save the display in the screen privates */ + /* Save the display in a global used by the wndproc */ g_pClipboardDisplay = pDisplay; ErrorF("winClipboardProc - XOpenDisplay () returned and " @@ -269,8 +264,10 @@ winClipboardProc(void *pvNotUsed) winClipboardFlushXEvents(hwnd, iWindow, pDisplay, fUseUnicode); /* Pre-flush Windows messages */ - if (!winClipboardFlushWindowsMessageQueue(hwnd)) - return 0; + if (!winClipboardFlushWindowsMessageQueue(hwnd)) { + ErrorF("winClipboardProc - winClipboardFlushWindowsMessageQueue failed\n"); + pthread_exit(NULL); + } /* Signal that the clipboard client has started */ g_fClipboardStarted = TRUE; @@ -292,6 +289,8 @@ winClipboardProc(void *pvNotUsed) tvTimeout.tv_usec = 100; #endif + winDebug("winClipboardProc - Waiting in select\n"); + /* Wait for a Windows event or an X event */ iReturn = select(iMaxDescriptor, /* Highest fds number */ &fdsRead, /* Read mask */ @@ -323,8 +322,13 @@ winClipboardProc(void *pvNotUsed) break; } + winDebug("winClipboardProc - select returned %d\n", iReturn); + /* Branch on which descriptor became active */ if (FD_ISSET(iConnectionNumber, &fdsRead)) { + winDebug + ("winClipboardProc - X connection ready, pumping X event queue\n"); + /* Process X events */ /* Exit when we see that server is shutting down */ iReturn = winClipboardFlushXEvents(hwnd, @@ -343,6 +347,9 @@ winClipboardProc(void *pvNotUsed) if (1) #endif { + winDebug + ("winClipboardProc - /dev/windows ready, pumping Windows message queue\n"); + /* Process Windows messages */ if (!winClipboardFlushWindowsMessageQueue(hwnd)) { ErrorF("winClipboardProc - " @@ -351,6 +358,13 @@ winClipboardProc(void *pvNotUsed) break; } } + +#ifdef HAS_DEVWINDOWS + if (!(FD_ISSET(iConnectionNumber, &fdsRead)) && + !(FD_ISSET(fdMessageQueue, &fdsRead))) { + winDebug("winClipboardProc - Spurious wake\n"); + } +#endif } winClipboardProc_Exit: @@ -435,6 +449,7 @@ winClipboardProc(void *pvNotUsed) raise(SIGTERM); } + pthread_cleanup_pop(0); return NULL; } @@ -461,7 +476,7 @@ winClipboardErrorHandler(Display * pDisplay, XErrorEvent * pErr) static int winClipboardIOErrorHandler(Display * pDisplay) { - ErrorF("winClipboardIOErrorHandler!\n\n"); + ErrorF("winClipboardIOErrorHandler!\n"); if (pthread_equal(pthread_self(), g_winClipboardProcThread)) { /* Restart at the main entry point */ @@ -473,3 +488,14 @@ winClipboardIOErrorHandler(Display * pDisplay) return 0; } + +/* + * winClipboardThreadExit - Thread exit handler + */ + +static void +winClipboardThreadExit(void *arg) +{ + /* clipboard thread has exited, stop server as well */ + kill(getpid(), SIGTERM); +} diff --git a/hw/xwin/winclipboardwndproc.c b/hw/xwin/winclipboardwndproc.c index e19f678a7..077b9f0bf 100644 --- a/hw/xwin/winclipboardwndproc.c +++ b/hw/xwin/winclipboardwndproc.c @@ -151,6 +151,11 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) static HWND s_hwndNextViewer; static Bool s_fCBCInitialized; +#if CYGDEBUG + winDebugWin32Message("winClipboardWindowProc", hwnd, message, wParam, + lParam); +#endif + /* Branch on message type */ switch (message) { case WM_DESTROY: @@ -325,6 +330,29 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) "Clipboard does not contain CF_TEXT nor " "CF_UNICODETEXT.\n"); + winDebug("winClipboardWindowProc: %d formats\n", + CountClipboardFormats()); + { + unsigned int format = 0; + + do { + format = EnumClipboardFormats(format); + if (GetLastError() != ERROR_SUCCESS) { + winDebug + ("winClipboardWindowProc: EnumClipboardFormats failed %x\n", + GetLastError()); + } + if (format > 0xc000) { + char buff[256]; + + GetClipboardFormatName(format, buff, 256); + winDebug("winClipboardWindowProc: %d %s\n", format, + buff); + } + else if (format > 0) + winDebug("winClipboardWindowProc: %d\n", format); + } while (format != 0); + } /* * We need to make sure that the X Server has processed * previous XSetSelectionOwner messages. @@ -337,24 +365,24 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) iReturn = XGetSelectionOwner(pDisplay, XA_PRIMARY); if (iReturn == g_iClipboardWindow) { winDebug("winClipboardWindowProc - WM_DRAWCLIPBOARD - " - "PRIMARY selection is owned by us.\n"); + "PRIMARY selection is owned by us, releasing\n"); XSetSelectionOwner(pDisplay, XA_PRIMARY, None, CurrentTime); } else if (BadWindow == iReturn || BadAtom == iReturn) winErrorFVerb(1, "winClipboardWindowProc - WM_DRAWCLIPBOARD - " - "XGetSelection failed for PRIMARY: %d\n", + "XGetSelectionOwner failed for PRIMARY: %d\n", iReturn); /* Release CLIPBOARD selection if owned */ iReturn = XGetSelectionOwner(pDisplay, atomClipboard); if (iReturn == g_iClipboardWindow) { winDebug("winClipboardWindowProc - WM_DRAWCLIPBOARD - " - "CLIPBOARD selection is owned by us.\n"); + "CLIPBOARD selection is owned by us, releasing\n"); XSetSelectionOwner(pDisplay, atomClipboard, None, CurrentTime); } else if (BadWindow == iReturn || BadAtom == iReturn) winErrorFVerb(1, "winClipboardWindowProc - WM_DRAWCLIPBOARD - " - "XGetSelection failed for CLIPBOARD: %d\n", + "XGetSelectionOwner failed for CLIPBOARD: %d\n", iReturn); winDebug("winClipboardWindowProc - WM_DRAWCLIPBOARD: Exit\n"); @@ -424,7 +452,11 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) Window iWindow = g_iClipboardWindow; Bool fConvertToUnicode; - winDebug("winClipboardWindowProc - WM_RENDER*FORMAT - Hello.\n"); + if (message == WM_RENDERALLFORMATS) + winDebug("winClipboardWindowProc - WM_RENDERALLFORMATS - Hello.\n"); + else + winDebug("winClipboardWindowProc - WM_RENDERFORMAT %d - Hello.\n", + wParam); /* Flag whether to convert to Unicode or not */ if (message == WM_RENDERALLFORMATS) diff --git a/hw/xwin/winclipboardwrappers.c b/hw/xwin/winclipboardwrappers.c index 008088b6a..27b9872ff 100644 --- a/hw/xwin/winclipboardwrappers.c +++ b/hw/xwin/winclipboardwrappers.c @@ -190,7 +190,9 @@ winProcSetSelectionOwner(ClientPtr client) REQUEST_SIZE_MATCH(xSetSelectionOwnerReq); - winDebug("winProcSetSelectionOwner - Hello.\n"); + winDebug + ("winProcSetSelectionOwner - Hello. atom 0x%08x window XID 0x%08x \n", + stuff->selection, stuff->window); /* Watch for server reset */ if (s_ulServerGeneration != serverGeneration) { @@ -241,8 +243,9 @@ winProcSetSelectionOwner(ClientPtr client) /* Save new selection owner or None */ s_iOwners[CLIP_OWN_PRIMARY] = stuff->window; - winDebug("winProcSetSelectionOwner - PRIMARY - Now owned by: %d\n", - stuff->window); + winDebug + ("winProcSetSelectionOwner - PRIMARY - Now owned by XID 0x%08x\n", + stuff->window); } else if (MakeAtom("CLIPBOARD", 9, TRUE) == stuff->selection) { /* Look for owned -> not owned transition */ @@ -262,8 +265,9 @@ winProcSetSelectionOwner(ClientPtr client) /* Save new selection owner or None */ s_iOwners[CLIP_OWN_CLIPBOARD] = stuff->window; - winDebug("winProcSetSelectionOwner - CLIPBOARD - Now owned by: %d\n", - stuff->window); + winDebug + ("winProcSetSelectionOwner - CLIPBOARD - Now owned by XID 0x%08x\n", + stuff->window); } else diff --git a/hw/xwin/winclipboardxevents.c b/hw/xwin/winclipboardxevents.c index 226c3f055..a4d193d93 100644 --- a/hw/xwin/winclipboardxevents.c +++ b/hw/xwin/winclipboardxevents.c @@ -122,6 +122,7 @@ winClipboardFlushXEvents(HWND hwnd, atomUTF8String, XA_STRING }; + winDebug("SelectionRequest - populating targets\n"); /* Try to change the property */ iReturn = XChangeProperty(pDisplay, @@ -367,6 +368,7 @@ winClipboardFlushXEvents(HWND hwnd, * client when we abort. */ if (fAbort) { + winDebug("SelectionRequest - aborting\n"); /* Setup selection notify event */ eventSelection.type = SelectionNotify; eventSelection.send_event = True; @@ -463,6 +465,23 @@ winClipboardFlushXEvents(HWND hwnd, } } + case SelectionClear: + winDebug("SelectionClear - doing nothing\n"); + break; + + case PropertyNotify: + { + char *pszAtomName; + + pszAtomName = XGetAtomName(pDisplay, event.xproperty.atom); + winDebug("winClipboardFlushXEvents - PropertyNotify - ATOM: %s\n", + pszAtomName); + XFree(pszAtomName); + } + + if (event.xproperty.atom != atomLocalProperty) + break; + /* Retrieve the size of the stored data */ iReturn = XGetWindowProperty(pDisplay, iWindow, atomLocalProperty, 0, 0, /* Don't get data, just size */ False, @@ -472,12 +491,12 @@ winClipboardFlushXEvents(HWND hwnd, &xtpText.nitems, &ulReturnBytesLeft, &xtpText.value); if (iReturn != Success) { - ErrorF("winClipboardFlushXEvents - SelectionNotify - " + ErrorF("winClipboardFlushXEvents - PropertyNotify - " "XGetWindowProperty () failed, aborting: %d\n", iReturn); break; } - winDebug("SelectionNotify - returned data %d left %d\n", + winDebug("PropertyNotify - returned data %d left %d\n", xtpText.nitems, ulReturnBytesLeft); /* Request the selection data */ @@ -493,7 +512,7 @@ winClipboardFlushXEvents(HWND hwnd, &xtpText.nitems, &ulReturnBytesLeft, &xtpText.value); if (iReturn != Success) { - ErrorF("winClipboardFlushXEvents - SelectionNotify - " + ErrorF("winClipboardFlushXEvents - PropertyNotify - " "XGetWindowProperty () failed, aborting: %d\n", iReturn); break; } @@ -501,10 +520,11 @@ winClipboardFlushXEvents(HWND hwnd, { char *pszAtomName = NULL; - winDebug("SelectionNotify - returned data %d left %d\n", + winDebug("PropertyNotify - returned data %d left %d\n", xtpText.nitems, ulReturnBytesLeft); pszAtomName = XGetAtomName(pDisplay, xtpText.encoding); - winDebug("Notify atom name %s\n", pszAtomName); + winDebug("PropertyNotify - encoding atom name %s\n", + pszAtomName); XFree(pszAtomName); pszAtomName = NULL; } @@ -536,14 +556,14 @@ winClipboardFlushXEvents(HWND hwnd, } } else { - ErrorF("winClipboardFlushXEvents - SelectionNotify - " + ErrorF("winClipboardFlushXEvents - PropertyNotify - " "X*TextPropertyToTextList list_return is NULL.\n"); pszReturnData = malloc(1); pszReturnData[0] = '\0'; } } else { - ErrorF("winClipboardFlushXEvents - SelectionNotify - " + ErrorF("winClipboardFlushXEvents - PropertyNotify - " "X*TextPropertyToTextList returned: "); switch (iReturn) { case XNoMemory: @@ -584,12 +604,12 @@ winClipboardFlushXEvents(HWND hwnd, pwszUnicodeStr = (wchar_t *) malloc(sizeof(wchar_t) * (iUnicodeLen + 1)); if (!pwszUnicodeStr) { - ErrorF("winClipboardFlushXEvents - SelectionNotify " + ErrorF("winClipboardFlushXEvents - PropertyNotify " "malloc failed for pwszUnicodeStr, aborting.\n"); /* Abort */ fAbort = TRUE; - goto winClipboardFlushXEvents_SelectionNotify_Done; + goto winClipboardFlushXEvents_PropertyNotify_Done; } /* Do the actual conversion */ @@ -614,12 +634,11 @@ winClipboardFlushXEvents(HWND hwnd, /* Check that global memory was allocated */ if (!hGlobal) { - ErrorF("winClipboardFlushXEvents - SelectionNotify " + ErrorF("winClipboardFlushXEvents - PropertyNotify " "GlobalAlloc failed, aborting: %ld\n", GetLastError()); - /* Abort */ fAbort = TRUE; - goto winClipboardFlushXEvents_SelectionNotify_Done; + goto winClipboardFlushXEvents_PropertyNotify_Done; } /* Obtain a pointer to the global memory */ @@ -630,7 +649,7 @@ winClipboardFlushXEvents(HWND hwnd, /* Abort */ fAbort = TRUE; - goto winClipboardFlushXEvents_SelectionNotify_Done; + goto winClipboardFlushXEvents_PropertyNotify_Done; } /* Copy the returned string into the global memory */ @@ -664,7 +683,7 @@ winClipboardFlushXEvents(HWND hwnd, * Windows after the call to SetClipboardData (). */ - winClipboardFlushXEvents_SelectionNotify_Done: + winClipboardFlushXEvents_PropertyNotify_Done: /* Free allocated resources */ if (ppszTextList) XFreeStringList(ppszTextList); @@ -683,13 +702,6 @@ winClipboardFlushXEvents(HWND hwnd, } return WIN_XEVENTS_NOTIFY; - case SelectionClear: - winDebug("SelectionClear - doing nothing\n"); - break; - - case PropertyNotify: - break; - case MappingNotify: break; diff --git a/hw/xwin/winconfig.c b/hw/xwin/winconfig.c index 9e38113a5..a60802d1f 100644 --- a/hw/xwin/winconfig.c +++ b/hw/xwin/winconfig.c @@ -70,6 +70,7 @@ WinCmdlineRec g_cmdline = { #ifdef XWIN_XF86CONFIG NULL, /* keyboard */ #endif + FALSE, /* customDPI */ NULL, /* xkbRules */ NULL, /* xkbModel */ NULL, /* xkbLayout */ diff --git a/hw/xwin/winconfig.h b/hw/xwin/winconfig.h index 94571ff71..4cf7ab1d6 100644 --- a/hw/xwin/winconfig.h +++ b/hw/xwin/winconfig.h @@ -160,6 +160,7 @@ typedef struct { #ifdef XWIN_XF86CONFIG char *keyboard; #endif + Bool customDPI; char *xkbRules; char *xkbModel; char *xkbLayout; @@ -200,7 +201,7 @@ typedef union { unsigned long num; char *str; double realnum; - Bool bool; + Bool bool_; OptFrequency freq; } ValueUnion; diff --git a/hw/xwin/wincursor.c b/hw/xwin/wincursor.c index 2962d06ad..8e870414e 100644 --- a/hw/xwin/wincursor.c +++ b/hw/xwin/wincursor.c @@ -34,14 +34,14 @@ #ifdef HAVE_XWIN_CONFIG_H #include <xwin-config.h> #endif + #include "win.h" #include "winmsg.h" #include <cursorstr.h> #include <mipointrst.h> #include <servermd.h> #include "misc.h" - -#define BRIGHTNESS(x) (x##Red * 0.299 + x##Green * 0.587 + x##Blue * 0.114) +#include "wmutil/cursor_convert.h" #if 0 #define WIN_DEBUG_MSG winDebug @@ -128,297 +128,30 @@ winCrossScreen(ScreenPtr pScreen, Bool fEntering) { } -static unsigned char -reverse(unsigned char c) -{ - int i; - unsigned char ret = 0; - - for (i = 0; i < 8; ++i) { - ret |= ((c >> i) & 1) << (7 - i); - } - return ret; -} - /* * Convert X cursor to Windows cursor - * FIXME: Perhaps there are more smart code */ static HCURSOR winLoadCursor(ScreenPtr pScreen, CursorPtr pCursor, int screen) { - winScreenPriv(pScreen); - HCURSOR hCursor = NULL; - unsigned char *pAnd; - unsigned char *pXor; - int nCX, nCY; - int nBytes; - double dForeY, dBackY; - BOOL fReverse; - HBITMAP hAnd, hXor; - ICONINFO ii; - unsigned char *pCur; - unsigned char bit; - HDC hDC; - BITMAPV4HEADER bi; - BITMAPINFO *pbmi; - unsigned long *lpBits; - - WIN_DEBUG_MSG("winLoadCursor: Win32: %dx%d X11: %dx%d hotspot: %d,%d\n", - pScreenPriv->cursor.sm_cx, pScreenPriv->cursor.sm_cy, - pCursor->bits->width, pCursor->bits->height, - pCursor->bits->xhot, pCursor->bits->yhot); - - /* We can use only White and Black, so calc brightness of color - * Also check if the cursor is inverted */ - dForeY = BRIGHTNESS(pCursor->fore); - dBackY = BRIGHTNESS(pCursor->back); - fReverse = dForeY < dBackY; - - /* Check wether the X11 cursor is bigger than the win32 cursor */ - if (pScreenPriv->cursor.sm_cx < pCursor->bits->width || - pScreenPriv->cursor.sm_cy < pCursor->bits->height) { - winErrorFVerb(3, - "winLoadCursor - Windows requires %dx%d cursor but X requires %dx%d\n", - pScreenPriv->cursor.sm_cx, pScreenPriv->cursor.sm_cy, - pCursor->bits->width, pCursor->bits->height); - } - - /* Get the number of bytes required to store the whole cursor image - * This is roughly (sm_cx * sm_cy) / 8 - * round up to 8 pixel boundary so we can convert whole bytes */ - nBytes = - bits_to_bytes(pScreenPriv->cursor.sm_cx) * pScreenPriv->cursor.sm_cy; - - /* Get the effective width and height */ - nCX = min(pScreenPriv->cursor.sm_cx, pCursor->bits->width); - nCY = min(pScreenPriv->cursor.sm_cy, pCursor->bits->height); - - /* Allocate memory for the bitmaps */ - pAnd = malloc(nBytes); - memset(pAnd, 0xFF, nBytes); - pXor = calloc(1, nBytes); - - /* Convert the X11 bitmap to a win32 bitmap - * The first is for an empty mask */ - if (pCursor->bits->emptyMask) { - int x, y, xmax = bits_to_bytes(nCX); - - for (y = 0; y < nCY; ++y) - for (x = 0; x < xmax; ++x) { - int nWinPix = bits_to_bytes(pScreenPriv->cursor.sm_cx) * y + x; - int nXPix = BitmapBytePad(pCursor->bits->width) * y + x; - - pAnd[nWinPix] = 0; - if (fReverse) - pXor[nWinPix] = reverse(~pCursor->bits->source[nXPix]); - else - pXor[nWinPix] = reverse(pCursor->bits->source[nXPix]); - } - } - else { - int x, y, xmax = bits_to_bytes(nCX); - - for (y = 0; y < nCY; ++y) - for (x = 0; x < xmax; ++x) { - int nWinPix = bits_to_bytes(pScreenPriv->cursor.sm_cx) * y + x; - int nXPix = BitmapBytePad(pCursor->bits->width) * y + x; - - unsigned char mask = pCursor->bits->mask[nXPix]; - - pAnd[nWinPix] = reverse(~mask); - if (fReverse) - pXor[nWinPix] = - reverse(~pCursor->bits->source[nXPix] & mask); - else - pXor[nWinPix] = - reverse(pCursor->bits->source[nXPix] & mask); - } - } - - /* prepare the pointers */ - hCursor = NULL; - lpBits = NULL; - - /* We have a truecolor alpha-blended cursor and can use it! */ - if (pCursor->bits->argb) { - WIN_DEBUG_MSG("winLoadCursor: Trying truecolor alphablended cursor\n"); - memset(&bi, 0, sizeof(BITMAPV4HEADER)); - bi.bV4Size = sizeof(BITMAPV4HEADER); - bi.bV4Width = pScreenPriv->cursor.sm_cx; - bi.bV4Height = -(pScreenPriv->cursor.sm_cy); /* right-side up */ - bi.bV4Planes = 1; - bi.bV4BitCount = 32; - bi.bV4V4Compression = BI_BITFIELDS; - bi.bV4RedMask = 0x00FF0000; - bi.bV4GreenMask = 0x0000FF00; - bi.bV4BlueMask = 0x000000FF; - bi.bV4AlphaMask = 0xFF000000; - - lpBits = - (unsigned long *) calloc(pScreenPriv->cursor.sm_cx * - pScreenPriv->cursor.sm_cy, - sizeof(unsigned long)); - - if (lpBits) { - int y; - for (y = 0; y < nCY; y++) { - unsigned long *src, *dst; - - src = &(pCursor->bits->argb[y * pCursor->bits->width]); - dst = &(lpBits[y * pScreenPriv->cursor.sm_cx]); - memcpy(dst, src, 4 * nCX); - } - } - } /* End if-truecolor-icon */ - - if (!lpBits) { - /* Bicolor, use a palettized DIB */ - WIN_DEBUG_MSG("winLoadCursor: Trying two color cursor\n"); - pbmi = (BITMAPINFO *) &bi; - memset(pbmi, 0, sizeof(BITMAPINFOHEADER)); - pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - pbmi->bmiHeader.biWidth = pScreenPriv->cursor.sm_cx; - pbmi->bmiHeader.biHeight = -abs(pScreenPriv->cursor.sm_cy); /* right-side up */ - pbmi->bmiHeader.biPlanes = 1; - pbmi->bmiHeader.biBitCount = 8; - pbmi->bmiHeader.biCompression = BI_RGB; - pbmi->bmiHeader.biSizeImage = 0; - pbmi->bmiHeader.biClrUsed = 3; - pbmi->bmiHeader.biClrImportant = 3; - pbmi->bmiColors[0].rgbRed = 0; /* Empty */ - pbmi->bmiColors[0].rgbGreen = 0; - pbmi->bmiColors[0].rgbBlue = 0; - pbmi->bmiColors[0].rgbReserved = 0; - pbmi->bmiColors[1].rgbRed = pCursor->backRed >> 8; /* Background */ - pbmi->bmiColors[1].rgbGreen = pCursor->backGreen >> 8; - pbmi->bmiColors[1].rgbBlue = pCursor->backBlue >> 8; - pbmi->bmiColors[1].rgbReserved = 0; - pbmi->bmiColors[2].rgbRed = pCursor->foreRed >> 8; /* Foreground */ - pbmi->bmiColors[2].rgbGreen = pCursor->foreGreen >> 8; - pbmi->bmiColors[2].rgbBlue = pCursor->foreBlue >> 8; - pbmi->bmiColors[2].rgbReserved = 0; - - lpBits = - (unsigned long *) calloc(pScreenPriv->cursor.sm_cx * - pScreenPriv->cursor.sm_cy, sizeof(char)); - - pCur = (unsigned char *) lpBits; - if (lpBits) { - int x, y; - for (y = 0; y < pScreenPriv->cursor.sm_cy; y++) { - for (x = 0; x < pScreenPriv->cursor.sm_cx; x++) { - if (x >= nCX || y >= nCY) /* Outside of X11 icon bounds */ - (*pCur++) = 0; - else { /* Within X11 icon bounds */ - - int nWinPix = - bits_to_bytes(pScreenPriv->cursor.sm_cx) * y + - (x / 8); - - bit = pAnd[nWinPix]; - bit = bit & (1 << (7 - (x & 7))); - if (!bit) { /* Within the cursor mask? */ - int nXPix = - BitmapBytePad(pCursor->bits->width) * y + - (x / 8); - bit = - ~reverse(~pCursor->bits-> - source[nXPix] & pCursor->bits-> - mask[nXPix]); - bit = bit & (1 << (7 - (x & 7))); - if (bit) /* Draw foreground */ - (*pCur++) = 2; - else /* Draw background */ - (*pCur++) = 1; - } - else /* Outside the cursor mask */ - (*pCur++) = 0; - } - } /* end for (x) */ - } /* end for (y) */ - } /* end if (lpbits) */ - } - - /* If one of the previous two methods gave us the bitmap we need, make a cursor */ - if (lpBits) { - WIN_DEBUG_MSG("winLoadCursor: Creating bitmap cursor: hotspot %d,%d\n", - pCursor->bits->xhot, pCursor->bits->yhot); - - hAnd = NULL; - hXor = NULL; - - hAnd = - CreateBitmap(pScreenPriv->cursor.sm_cx, pScreenPriv->cursor.sm_cy, - 1, 1, pAnd); - - hDC = GetDC(NULL); - if (hDC) { - hXor = - CreateCompatibleBitmap(hDC, pScreenPriv->cursor.sm_cx, - pScreenPriv->cursor.sm_cy); - SetDIBits(hDC, hXor, 0, pScreenPriv->cursor.sm_cy, lpBits, - (BITMAPINFO *) &bi, DIB_RGB_COLORS); - ReleaseDC(NULL, hDC); - } - free(lpBits); - - if (hAnd && hXor) { - ii.fIcon = FALSE; - ii.xHotspot = pCursor->bits->xhot; - ii.yHotspot = pCursor->bits->yhot; - ii.hbmMask = hAnd; - ii.hbmColor = hXor; - hCursor = (HCURSOR) CreateIconIndirect(&ii); - - if (hCursor == NULL) - winW32Error(2, "winLoadCursor - CreateIconIndirect failed:"); - else { - if (GetIconInfo(hCursor, &ii)) { - if (ii.fIcon) { - WIN_DEBUG_MSG - ("winLoadCursor: CreateIconIndirect returned no cursor. Trying again.\n"); - - DestroyCursor(hCursor); - - ii.fIcon = FALSE; - ii.xHotspot = pCursor->bits->xhot; - ii.yHotspot = pCursor->bits->yhot; - hCursor = (HCURSOR) CreateIconIndirect(&ii); - - if (hCursor == NULL) - winW32Error(2, - "winLoadCursor - CreateIconIndirect failed:"); - } - /* GetIconInfo creates new bitmaps. Destroy them again */ - if (ii.hbmMask) - DeleteObject(ii.hbmMask); - if (ii.hbmColor) - DeleteObject(ii.hbmColor); - } - } - } - - if (hAnd) - DeleteObject(hAnd); - if (hXor) - DeleteObject(hXor); - } - - if (!hCursor) { - /* We couldn't make a color cursor for this screen, use - black and white instead */ - hCursor = CreateCursor(g_hInstance, - pCursor->bits->xhot, pCursor->bits->yhot, - pScreenPriv->cursor.sm_cx, - pScreenPriv->cursor.sm_cy, pAnd, pXor); - if (hCursor == NULL) - winW32Error(2, "winLoadCursor - CreateCursor failed:"); - } - free(pAnd); - free(pXor); - - return hCursor; + WMUTIL_CURSOR cursor; + + cursor.width = pCursor->bits->width; + cursor.height = pCursor->bits->height; + cursor.xhot = pCursor->bits->xhot; + cursor.yhot = pCursor->bits->yhot; + cursor.argb = (uint32_t *)pCursor->bits->argb; + cursor.source = pCursor->bits->source; + cursor.mask = pCursor->bits->mask; + cursor.emptyMask = pCursor->bits->emptyMask; + cursor.foreRed = pCursor->foreRed; + cursor.foreGreen = pCursor->foreGreen; + cursor.foreBlue = pCursor->foreBlue; + cursor.backRed = pCursor->backRed; + cursor.backGreen = pCursor->backGreen; + cursor.backBlue = pCursor->backBlue; + + return winXCursorToHCURSOR(&cursor); } /* diff --git a/hw/xwin/windisplay.c b/hw/xwin/windisplay.c new file mode 100644 index 000000000..9fc4dac68 --- /dev/null +++ b/hw/xwin/windisplay.c @@ -0,0 +1,52 @@ +/* + * Copyright (C) Jon TURNEY 2009 + * + * 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. + * + */ + +#include <opaque.h> // for display +#include "win.h" + +/* + Generate a display name string referring to the display of this server, + using a transport we know is enabled +*/ + +void +winGetDisplayName(char *szDisplay, unsigned int screen) +{ + if (TransIsListening("local")) { + snprintf(szDisplay, 512, ":%s.%d", display, screen); + } + else if (TransIsListening("inet")) { + snprintf(szDisplay, 512, "127.0.0.1:%s.%d", display, screen); + } + else if (TransIsListening("inet6")) { + snprintf(szDisplay, 512, "::1:%s.%d", display, screen); + } + else { + // this can't happen! + ErrorF("winGetDisplay: Don't know what to use for DISPLAY\n"); + snprintf(szDisplay, 512, "localhost:%s.%d", display, screen); + } + + winDebug("winGetDisplay: DISPLAY=%s\n", szDisplay); +} diff --git a/hw/xwin/winerror.c b/hw/xwin/winerror.c index 1318b0f36..ff2919c27 100644 --- a/hw/xwin/winerror.c +++ b/hw/xwin/winerror.c @@ -48,6 +48,16 @@ OsVendorVErrorF(const char *pszFormat, va_list va_args) pthread_mutex_lock(&s_pmPrinting); #endif + /* If we want to silence it, + * detect if we are going to abort due to duplication error */ + if (g_fSilentDupError) { + if ((strcmp(pszFormat, "InitOutput - Duplicate invocation on display number: %s. Exiting.\n") == 0) + || (strcmp(pszFormat, "Server is already active for display %s\n%s %s\n%s\n") == 0) + || (strcmp(pszFormat, "MakeAllCOTSServerListeners: server already running\n") == 0)) { + g_fSilentFatalError = TRUE; + } + } + /* Print the error message to a log file, could be stderr */ LogVWrite(0, pszFormat, va_args); diff --git a/hw/xwin/winglobals.c b/hw/xwin/winglobals.c index b34d1a751..fd6c1b490 100644 --- a/hw/xwin/winglobals.c +++ b/hw/xwin/winglobals.c @@ -78,6 +78,8 @@ Bool g_fNoHelpMessageBox = FALSE; Bool g_fSoftwareCursor = FALSE; Bool g_fSilentDupError = FALSE; Bool g_fNativeGl = TRUE; +Bool g_fHostInTitle = FALSE; +pthread_mutex_t g_pmTerminating = PTHREAD_MUTEX_INITIALIZER; #ifdef XWIN_CLIPBOARD /* diff --git a/hw/xwin/winglobals.h b/hw/xwin/winglobals.h index d2e2ba2b4..d5da35f4a 100644 --- a/hw/xwin/winglobals.h +++ b/hw/xwin/winglobals.h @@ -52,6 +52,7 @@ extern Bool g_fXdmcpEnabled; extern Bool g_fNoHelpMessageBox; extern Bool g_fSilentDupError; extern Bool g_fNativeGl; +extern Bool g_fHostInTitle; extern HWND g_hDlgDepthChange; extern HWND g_hDlgExit; @@ -90,4 +91,6 @@ extern Bool g_fButton[3]; extern Bool g_fNoConfigureWindow; #endif +extern pthread_mutex_t g_pmTerminating; + #endif /* WINGLOBALS_H */ diff --git a/hw/xwin/winkeybd.c b/hw/xwin/winkeybd.c index 27c114c99..1f4518770 100644 --- a/hw/xwin/winkeybd.c +++ b/hw/xwin/winkeybd.c @@ -34,17 +34,24 @@ #ifdef HAVE_XWIN_CONFIG_H #include <xwin-config.h> #endif + #include "win.h" -#include "winkeybd.h" +#include "wmutil/scancodes.h" +#include "wmutil/keyboard.h" #include "winconfig.h" #include "winmsg.h" #include "xkbsrv.h" +#include "dixgrabs.h" /* C does not have a logical XOR operator, so we use a macro instead */ #define LOGICAL_XOR(a,b) ((!(a) && (b)) || ((a) && !(b))) -static Bool g_winKeyState[NUM_KEYCODES]; +#define AltMask Mod1Mask +#define NumLockMask Mod2Mask +#define AltLangMask Mod3Mask +#define KanaMask Mod4Mask +#define ScrollLockMask Mod5Mask /* * Local prototypes @@ -56,65 +63,6 @@ static void static void winKeybdCtrl(DeviceIntPtr pDevice, KeybdCtrl * pCtrl); -/* - * Translate a Windows WM_[SYS]KEY(UP/DOWN) message - * into an ASCII scan code. - * - * We do this ourselves, rather than letting Windows handle it, - * because Windows tends to munge the handling of special keys, - * like AltGr on European keyboards. - */ - -void -winTranslateKey(WPARAM wParam, LPARAM lParam, int *piScanCode) -{ - int iKeyFixup = g_iKeyMap[wParam * WIN_KEYMAP_COLS + 1]; - int iKeyFixupEx = g_iKeyMap[wParam * WIN_KEYMAP_COLS + 2]; - int iParam = HIWORD(lParam); - int iParamScanCode = LOBYTE(iParam); - - winDebug("winTranslateKey: wParam %08x lParam %08x\n", wParam, lParam); - -/* WM_ key messages faked by Vista speech recognition (WSR) don't have a - * scan code. - * - * Vocola 3 (Rick Mohr's supplement to WSR) uses - * System.Windows.Forms.SendKeys.SendWait(), which appears always to give a - * scan code of 1 - */ - if (iParamScanCode <= 1) { - if (VK_PRIOR <= wParam && wParam <= VK_DOWN) - /* Trigger special case table to translate to extended - * keycode, otherwise if num_lock is on, we can get keypad - * numbers instead of navigation keys. */ - iParam |= KF_EXTENDED; - else - iParamScanCode = MapVirtualKeyEx(wParam, - /*MAPVK_VK_TO_VSC */ 0, - GetKeyboardLayout(0)); - } - - /* Branch on special extended, special non-extended, or normal key */ - if ((iParam & KF_EXTENDED) && iKeyFixupEx) - *piScanCode = iKeyFixupEx; - else if (iKeyFixup) - *piScanCode = iKeyFixup; - else if (wParam == 0 && iParamScanCode == 0x70) - *piScanCode = KEY_HKTG; - else - switch (iParamScanCode) { - case 0x70: - *piScanCode = KEY_HKTG; - break; - case 0x73: - *piScanCode = KEY_BSlash2; - break; - default: - *piScanCode = iParamScanCode; - break; - } -} - /* Ring the keyboard bell (system speaker on PCs) */ static void winKeybdBell(int iPercent, DeviceIntPtr pDeviceInt, pointer pCtrl, int iClass) @@ -264,25 +212,38 @@ winRestoreModeKeyStates(void) /* Check if modifier keys are pressed, and if so, fake a press */ { - BOOL ctrl = (GetAsyncKeyState(VK_CONTROL) < 0); - BOOL shift = (GetAsyncKeyState(VK_SHIFT) < 0); + + BOOL lctrl = (GetAsyncKeyState(VK_LCONTROL) < 0); + BOOL rctrl = (GetAsyncKeyState(VK_RCONTROL) < 0); + BOOL lshift = (GetAsyncKeyState(VK_LSHIFT) < 0); + BOOL rshift = (GetAsyncKeyState(VK_RSHIFT) < 0); BOOL alt = (GetAsyncKeyState(VK_LMENU) < 0); BOOL altgr = (GetAsyncKeyState(VK_RMENU) < 0); - if (ctrl && altgr) - ctrl = FALSE; + /* + If AltGr and CtrlL appear to be pressed, assume the + CtrL is a fake one + */ + if (lctrl && altgr) + lctrl = FALSE; + + if (lctrl) + winSendKeyEvent(KEY_LCtrl, TRUE); + + if (rctrl) + winSendKeyEvent(KEY_RCtrl, TRUE); - if (LOGICAL_XOR(internalKeyStates & ControlMask, ctrl)) - winSendKeyEvent(KEY_LCtrl, ctrl); + if (lshift) + winSendKeyEvent(KEY_ShiftL, TRUE); - if (LOGICAL_XOR(internalKeyStates & ShiftMask, shift)) - winSendKeyEvent(KEY_ShiftL, shift); + if (rshift) + winSendKeyEvent(KEY_ShiftL, TRUE); - if (LOGICAL_XOR(internalKeyStates & Mod1Mask, alt)) - winSendKeyEvent(KEY_Alt, alt); + if (alt) + winSendKeyEvent(KEY_Alt, TRUE); - if (LOGICAL_XOR(internalKeyStates & Mod5Mask, altgr)) - winSendKeyEvent(KEY_AltLang, altgr); + if (altgr) + winSendKeyEvent(KEY_AltLang, TRUE); } /* @@ -313,213 +274,54 @@ winRestoreModeKeyStates(void) winSendKeyEvent(KEY_HKTG, TRUE); winSendKeyEvent(KEY_HKTG, FALSE); } -} - -/* - * Look for the lovely fake Control_L press/release generated by Windows - * when AltGr is pressed/released on a non-U.S. keyboard. - */ - -Bool -winIsFakeCtrl_L(UINT message, WPARAM wParam, LPARAM lParam) -{ - MSG msgNext; - LONG lTime; - Bool fReturn; - - static Bool lastWasControlL = FALSE; - static UINT lastMessage; - static LONG lastTime; - - /* - * Fake Ctrl_L presses will be followed by an Alt_R press - * with the same timestamp as the Ctrl_L press. - */ - if ((message == WM_KEYDOWN || message == WM_SYSKEYDOWN) - && wParam == VK_CONTROL && (HIWORD(lParam) & KF_EXTENDED) == 0) { - /* Got a Ctrl_L press */ - /* Get time of current message */ - lTime = GetMessageTime(); - - /* Look for next press message */ - fReturn = PeekMessage(&msgNext, NULL, - WM_KEYDOWN, WM_SYSKEYDOWN, PM_NOREMOVE); - - if (fReturn && msgNext.message != WM_KEYDOWN && - msgNext.message != WM_SYSKEYDOWN) - fReturn = 0; - - if (!fReturn) { - lastWasControlL = TRUE; - lastMessage = message; - lastTime = lTime; - } - else { - lastWasControlL = FALSE; - } - - /* Is next press an Alt_R with the same timestamp? */ - if (fReturn && msgNext.wParam == VK_MENU - && msgNext.time == lTime - && (HIWORD(msgNext.lParam) & KF_EXTENDED)) { - /* - * Next key press is Alt_R with same timestamp as current - * Ctrl_L message. Therefore, this Ctrl_L press is a fake - * event, so discard it. - */ - return TRUE; - } - } /* - * Sometimes, the Alt_R press message is not yet posted when the - * fake Ctrl_L press message arrives (even though it has the - * same timestamp), so check for an Alt_R press message that has - * arrived since the last Ctrl_L message. + For strict correctness, we should also press any non-modifier keys + which are already down when we gain focus, but nobody has complained + yet :-) */ - else if ((message == WM_KEYDOWN || message == WM_SYSKEYDOWN) - && wParam == VK_MENU && (HIWORD(lParam) & KF_EXTENDED)) { - /* Got a Alt_R press */ - - if (lastWasControlL) { - lTime = GetMessageTime(); - - if (lastTime == lTime) { - /* Undo the fake Ctrl_L press by sending a fake Ctrl_L release */ - winSendKeyEvent(KEY_LCtrl, FALSE); - } - lastWasControlL = FALSE; - } - } - /* - * Fake Ctrl_L releases will be followed by an Alt_R release - * with the same timestamp as the Ctrl_L release. - */ - else if ((message == WM_KEYUP || message == WM_SYSKEYUP) - && wParam == VK_CONTROL && (HIWORD(lParam) & KF_EXTENDED) == 0) { - /* Got a Ctrl_L release */ - - /* Get time of current message */ - lTime = GetMessageTime(); - - /* Look for next release message */ - fReturn = PeekMessage(&msgNext, NULL, - WM_KEYUP, WM_SYSKEYUP, PM_NOREMOVE); - - if (fReturn && msgNext.message != WM_KEYUP && - msgNext.message != WM_SYSKEYUP) - fReturn = 0; - - lastWasControlL = FALSE; - - /* Is next press an Alt_R with the same timestamp? */ - if (fReturn - && (msgNext.message == WM_KEYUP || msgNext.message == WM_SYSKEYUP) - && msgNext.wParam == VK_MENU - && msgNext.time == lTime - && (HIWORD(msgNext.lParam) & KF_EXTENDED)) { - /* - * Next key release is Alt_R with same timestamp as current - * Ctrl_L message. Therefore, this Ctrl_L release is a fake - * event, so discard it. - */ - return TRUE; - } - } - else { - /* On any other press or release message, we don't have a - potentially fake Ctrl_L to worry about anymore... */ - lastWasControlL = FALSE; - } - - /* Not a fake control left press/release */ - return FALSE; } -/* - * Lift any modifier keys that are pressed - */ - void -winKeybdReleaseKeys(void) +winSendKeyEventCallback(DWORD dwKey, bool fDown) { - int i; - #ifdef HAS_DEVWINDOWS /* Verify that the mi input system has been initialized */ if (g_fdMessageQueue == WIN_FD_INVALID) return; #endif - /* Loop through all keys */ - for (i = 0; i < NUM_KEYCODES; ++i) { - /* Pop key if pressed */ - if (g_winKeyState[i]) - winSendKeyEvent(i, FALSE); - - /* Reset pressed flag for keys */ - g_winKeyState[i] = FALSE; - } + QueueKeyboardEvents(g_pwinKeyboard, fDown ? KeyPress : KeyRelease, + dwKey, NULL); } /* - * Take a raw X key code and send an up or down event for it. - * - * Thanks to VNC for inspiration, though it is a simple function. */ - -void -winSendKeyEvent(DWORD dwKey, Bool fDown) -{ - /* - * When alt-tabing between screens we can get phantom key up messages - * Here we only pass them through it we think we should! - */ - if (g_winKeyState[dwKey] == FALSE && fDown == FALSE) - return; - - /* Update the keyState map */ - g_winKeyState[dwKey] = fDown; - - QueueKeyboardEvents(g_pwinKeyboard, fDown ? KeyPress : KeyRelease, - dwKey + MIN_KEYCODE, NULL); - - winDebug("winSendKeyEvent: dwKey: %d, fDown: %d\n", dwKey, fDown); -} - -BOOL -winCheckKeyPressed(WPARAM wParam, LPARAM lParam) +int +XkbDDXPrivate(DeviceIntPtr dev,KeyCode key,XkbAction *act) { - switch (wParam) { - case VK_CONTROL: - if ((lParam & 0x1ff0000) == 0x11d0000 && g_winKeyState[KEY_RCtrl]) - return TRUE; - if ((lParam & 0x1ff0000) == 0x01d0000 && g_winKeyState[KEY_LCtrl]) - return TRUE; - break; - case VK_SHIFT: - if ((lParam & 0x1ff0000) == 0x0360000 && g_winKeyState[KEY_ShiftR]) - return TRUE; - if ((lParam & 0x1ff0000) == 0x02a0000 && g_winKeyState[KEY_ShiftL]) - return TRUE; - break; - default: - return TRUE; + XkbAnyAction *xf86act = &(act->any); + char msgbuf[XkbAnyActionDataSize+1]; + + if (xf86act->type == XkbSA_XFree86Private) + { + memcpy(msgbuf, xf86act->data, XkbAnyActionDataSize); + msgbuf[XkbAnyActionDataSize]= '\0'; + if (strcasecmp(msgbuf, "prgrbs")==0) { + DeviceIntPtr tmp; + winMsg(X_INFO, "Printing all currently active device grabs:\n"); + for (tmp = inputInfo.devices; tmp; tmp = tmp->next) + if (tmp->deviceGrab.grab) + PrintDeviceGrabInfo(tmp); + winMsg(X_INFO, "End list of active device grabs\n"); + } + else if (strcasecmp(msgbuf, "ungrab")==0) + UngrabAllDevices(FALSE); + else if (strcasecmp(msgbuf, "clsgrb")==0) + UngrabAllDevices(TRUE); + else if (strcasecmp(msgbuf, "prwins")==0) + PrintWindowTree(); } - return FALSE; -} - -/* Only one shift release message is sent even if both are pressed. - * Fix this here - */ -void -winFixShiftKeys(int iScanCode) -{ - if (GetKeyState(VK_SHIFT) & 0x8000) - return; - if (iScanCode == KEY_ShiftL && g_winKeyState[KEY_ShiftR]) - winSendKeyEvent(KEY_ShiftR, FALSE); - if (iScanCode == KEY_ShiftR && g_winKeyState[KEY_ShiftL]) - winSendKeyEvent(KEY_ShiftL, FALSE); + return 0; } diff --git a/hw/xwin/winmessages.h b/hw/xwin/winmessages.h index 3d3fab274..8282f8b06 100644 --- a/hw/xwin/winmessages.h +++ b/hw/xwin/winmessages.h @@ -529,7 +529,7 @@ static const char *MESSAGE_NAMES[1024] = { "WM_XBUTTONDOWN", "WM_XBUTTONUP", "WM_XBUTTONDBLCLK", - "526", + "WM_MOUSEHWHEEL", "527", "WM_PARENTNOTIFY", "WM_ENTERMENULOOP", diff --git a/hw/xwin/winmouse.c b/hw/xwin/winmouse.c index 9d896c90e..c5de57788 100644 --- a/hw/xwin/winmouse.c +++ b/hw/xwin/winmouse.c @@ -41,6 +41,8 @@ #include "xserver-properties.h" #include "inpututils.h" +#include "wmutil/mouse.h" + /* Peek the internal button mapping */ static CARD8 const *g_winMouseButtonMap = NULL; @@ -65,7 +67,7 @@ int winMouseProc(DeviceIntPtr pDeviceInt, int iState) { int lngMouseButtons, i; - int lngWheelEvents = 2; + int lngWheelEvents = 4; CARD8 *map; DevicePtr pDevice = (DevicePtr) pDeviceInt; Atom *btn_labels; @@ -80,15 +82,23 @@ winMouseProc(DeviceIntPtr pDeviceInt, int iState) /* Mapping of windows events to X events: * LEFT:1 MIDDLE:2 RIGHT:3 * SCROLL_UP:4 SCROLL_DOWN:5 - * XBUTTON 1:6 XBUTTON 2:7 ... + * TILT_LEFT:6 TILT_RIGHT:7 + * XBUTTON 1:8 XBUTTON 2:9 (most commonly 'back' and 'forward') + * ... * + * The current Windows API only defines 2 extra buttons, so we don't + * expect more than 5 buttons to be reported, but more than that + * should be handled correctly + */ + + /* * To map scroll wheel correctly we need at least the 3 normal buttons */ if (lngMouseButtons < 3) lngMouseButtons = 3; - /* allocate memory: - * number of buttons + 2x mouse wheel event + 1 extra (offset for map) + /* allocate memory: + * number of buttons + 4 x mouse wheel event + 1 extra (offset for map) */ map = malloc(sizeof(CARD8) * (lngMouseButtons + lngWheelEvents + 1)); @@ -98,11 +108,16 @@ winMouseProc(DeviceIntPtr pDeviceInt, int iState) map[i] = i; btn_labels = calloc((lngMouseButtons + lngWheelEvents), sizeof(Atom)); + btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT); btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE); btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT); btn_labels[3] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_UP); btn_labels[4] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_DOWN); + btn_labels[5] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_LEFT); + btn_labels[6] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_RIGHT); + btn_labels[7] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_BACK); + btn_labels[8] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_FORWARD); axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X); axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y); @@ -133,90 +148,20 @@ winMouseProc(DeviceIntPtr pDeviceInt, int iState) return Success; } -/* Handle the mouse wheel */ -int -winMouseWheel(ScreenPtr pScreen, int iDeltaZ) -{ - winScreenPriv(pScreen); - int button; /* Button4 or Button5 */ - - /* Button4 = WheelUp */ - /* Button5 = WheelDown */ - - /* Do we have any previous delta stored? */ - if ((pScreenPriv->iDeltaZ > 0 && iDeltaZ > 0) - || (pScreenPriv->iDeltaZ < 0 && iDeltaZ < 0)) { - /* Previous delta and of same sign as current delta */ - iDeltaZ += pScreenPriv->iDeltaZ; - pScreenPriv->iDeltaZ = 0; - } - else { - /* - * Previous delta of different sign, or zero. - * We will set it to zero for either case, - * as blindly setting takes just as much time - * as checking, then setting if necessary :) - */ - pScreenPriv->iDeltaZ = 0; - } - - /* - * Only process this message if the wheel has moved further than - * WHEEL_DELTA - */ - if (iDeltaZ >= WHEEL_DELTA || (-1 * iDeltaZ) >= WHEEL_DELTA) { - pScreenPriv->iDeltaZ = 0; - - /* Figure out how many whole deltas of the wheel we have */ - iDeltaZ /= WHEEL_DELTA; - } - else { - /* - * Wheel has not moved past WHEEL_DELTA threshold; - * we will store the wheel delta until the threshold - * has been reached. - */ - pScreenPriv->iDeltaZ = iDeltaZ; - return 0; - } - - /* Set the button to indicate up or down wheel delta */ - if (iDeltaZ > 0) { - button = Button4; - } - else { - button = Button5; - } - - /* - * Flip iDeltaZ to positive, if negative, - * because always need to generate a *positive* number of - * button clicks for the Z axis. - */ - if (iDeltaZ < 0) { - iDeltaZ *= -1; - } - - /* Generate X input messages for each wheel delta we have seen */ - while (iDeltaZ--) { - /* Push the wheel button */ - winMouseButtonsSendEvent(ButtonPress, button); - - /* Release the wheel button */ - winMouseButtonsSendEvent(ButtonRelease, button); - } - - return 0; -} - /* * Enqueue a mouse button event */ void -winMouseButtonsSendEvent(int iEventType, int iButton) +winMouseButtonsSendEvent(bool bPress, int iButton) { ValuatorMask mask; + int iEventType; + + if (bPress) + iEventType = ButtonPress; + else + iEventType = ButtonRelease; if (g_winMouseButtonMap) iButton = g_winMouseButtonMap[iButton]; @@ -245,7 +190,7 @@ winMouseButtonsHandle(ScreenPtr pScreen, /* Send button events right away if emulate 3 buttons is off */ if (pScreenInfo->iE3BTimeout == WIN_E3B_OFF) { /* Emulate 3 buttons is off, send the button event */ - winMouseButtonsSendEvent(iEventType, iButton); + winMouseButtonsSendEvent((iEventType == ButtonPress), iButton); return 0; } @@ -282,7 +227,7 @@ winMouseButtonsHandle(ScreenPtr pScreen, pScreenPriv->iE3BCachedPress = 0; /* Send fake middle button */ - winMouseButtonsSendEvent(ButtonPress, Button2); + winMouseButtonsSendEvent(TRUE, Button2); /* Indicate that a fake middle button event was sent */ pScreenPriv->fE3BFakeButton2Sent = TRUE; @@ -297,8 +242,8 @@ winMouseButtonsHandle(ScreenPtr pScreen, pScreenPriv->iE3BCachedPress = 0; /* Send cached press, then send release */ - winMouseButtonsSendEvent(ButtonPress, iButton); - winMouseButtonsSendEvent(ButtonRelease, iButton); + winMouseButtonsSendEvent(TRUE, iButton); + winMouseButtonsSendEvent(FALSE, iButton); } else if (iEventType == ButtonRelease && pScreenPriv->fE3BFakeButton2Sent && !(wParam & MK_LBUTTON) @@ -309,7 +254,7 @@ winMouseButtonsHandle(ScreenPtr pScreen, pScreenPriv->fE3BFakeButton2Sent = FALSE; /* Send middle mouse button release */ - winMouseButtonsSendEvent(ButtonRelease, Button2); + winMouseButtonsSendEvent(FALSE, Button2); } else if (iEventType == ButtonRelease && pScreenPriv->iE3BCachedPress == 0 @@ -318,7 +263,7 @@ winMouseButtonsHandle(ScreenPtr pScreen, * Button was release, no button is cached, * and there is no fake button 2 release is pending. */ - winMouseButtonsSendEvent(ButtonRelease, iButton); + winMouseButtonsSendEvent(FALSE, iButton); } return 0; diff --git a/hw/xwin/winmsg.c b/hw/xwin/winmsg.c index 56e7a097c..36dc965e6 100644 --- a/hw/xwin/winmsg.c +++ b/hw/xwin/winmsg.c @@ -101,6 +101,16 @@ winErrorFVerb(int verb, const char *format, ...) } void +winError(const char *format, ...) +{ + va_list ap; + + va_start(ap, format); + LogVMessageVerb(X_NONE, -1, format, ap); + va_end(ap); +} + +void winDebug(const char *format, ...) { va_list ap; diff --git a/hw/xwin/winmsgwindow.c b/hw/xwin/winmsgwindow.c new file mode 100644 index 000000000..8067c693c --- /dev/null +++ b/hw/xwin/winmsgwindow.c @@ -0,0 +1,180 @@ +/* + * Copyright (C) Jon TURNEY 2011 + * + * 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. + * + */ + +#include "win.h" + +/* + * This is the messaging window, a hidden top-level window. We never do anything + * with it, but other programs may send messages to it. + */ + +/* + * winMsgWindowProc - Window procedure for msg window + */ + +static +LRESULT CALLBACK +winMsgWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +{ +#if CYGDEBUG + winDebugWin32Message("winMsgWindowProc", hwnd, message, wParam, lParam); +#endif + + switch (message) { + case WM_ENDSESSION: + if (!wParam) + return 0; /* shutdown is being cancelled */ + + /* + Send a WM_GIVEUP message to the X server thread so it wakes up if + blocked in select(), performs GiveUp(), and then notices that GiveUp() + has set the DE_TERMINATE flag so exits the msg dispatch loop. + */ + { + ScreenPtr pScreen = screenInfo.screens[0]; + + winScreenPriv(pScreen); + PostMessage(pScreenPriv->hwndScreen, WM_GIVEUP, 0, 0); + } + + /* + This process will be terminated by the system almost immediately + after the last thread with a message queue returns from processing + WM_ENDSESSION, so we cannot rely on any code executing after this + message is processed and need to wait here until ddxGiveUp() is called + and releases the termination mutex to guarantee that the lock file and + unix domain sockets have been removed + + ofc, Microsoft doesn't document this under WM_ENDSESSION, you are supposed + to read the source of CRSS to find out how it works :-) + + http://blogs.msdn.com/b/michen/archive/2008/04/04/application-termination-when-user-logs-off.aspx + */ + { + int iReturn = pthread_mutex_lock(&g_pmTerminating); + + if (iReturn != 0) { + ErrorF("winMsgWindowProc - pthread_mutex_lock () failed: %d\n", + iReturn); + } + winDebug + ("winMsgWindowProc - WM_ENDSESSION termination lock acquired\n"); + } + + return 0; + } + + return DefWindowProc(hwnd, message, wParam, lParam); +} + +static HWND +winCreateMsgWindow(void) +{ + HWND hwndMsg; + wATOM winClass; + + // register window class + { + WNDCLASSEX wcx; + + wcx.cbSize = sizeof(WNDCLASSEX); + wcx.style = CS_HREDRAW | CS_VREDRAW; + wcx.lpfnWndProc = winMsgWindowProc; + wcx.cbClsExtra = 0; + wcx.cbWndExtra = 0; + wcx.hInstance = g_hInstance; + wcx.hIcon = NULL; + wcx.hCursor = 0; + wcx.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH); + wcx.lpszMenuName = NULL; + wcx.lpszClassName = WINDOW_CLASS_X_MSG; + wcx.hIconSm = NULL; + winClass = RegisterClassEx(&wcx); + } + + // Create the msg window. + hwndMsg = CreateWindowEx(0, // no extended styles + WINDOW_CLASS_X_MSG, // class name + "XWin Msg Window", // window name + WS_OVERLAPPEDWINDOW, // overlapped window + CW_USEDEFAULT, // default horizontal position + CW_USEDEFAULT, // default vertical position + CW_USEDEFAULT, // default width + CW_USEDEFAULT, // default height + (HWND) NULL, // no parent or owner window + (HMENU) NULL, // class menu used + GetModuleHandle(NULL), // instance handle + NULL); // no window creation data + + if (!hwndMsg) { + ErrorF("winCreateMsgWindow - Create msg window failed\n"); + return NULL; + } + + winDebug("winCreateMsgWindow - Created msg window hwnd 0x%x\n", hwndMsg); + + return hwndMsg; +} + +static void * +winMsgWindowThreadProc(void *arg) +{ + HWND hwndMsg; + + winDebug("winMsgWindowThreadProc - Hello\n"); + + hwndMsg = winCreateMsgWindow(); + if (hwndMsg) { + MSG msg; + + /* Pump the msg window message queue */ + while (GetMessage(&msg, hwndMsg, 0, 0) > 0) { +#if CYGDEBUG + winDebugWin32Message("winMsgWindowThread", msg.hwnd, msg.message, + msg.wParam, msg.lParam); +#endif + DispatchMessage(&msg); + } + } + + winDebug("winMsgWindowThreadProc - Exit\n"); + + return NULL; +} + +Bool +winCreateMsgWindowThread(void) +{ + pthread_t ptMsgWindowThreadProc; + + /* Spawn a thread for the msg window */ + if (pthread_create(&ptMsgWindowThreadProc, + NULL, winMsgWindowThreadProc, NULL)) { + /* Bail if thread creation failed */ + ErrorF("winCreateMsgWindow - pthread_create failed.\n"); + return FALSE; + } + + return TRUE; +} diff --git a/hw/xwin/winmultiwindowclass.c b/hw/xwin/winmultiwindowclass.c index 1af104df9..93166fe3b 100644 --- a/hw/xwin/winmultiwindowclass.c +++ b/hw/xwin/winmultiwindowclass.c @@ -37,6 +37,12 @@ #include "winmultiwindowclass.h" #include "win.h" +#if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR) +#define strnlen(str, len) \ + (__extension__ ({ int _len = strlen(str); \ + _len > len ? len : _len; })) +#endif + /* * Local function */ @@ -68,7 +74,7 @@ winMultiWindowGetClassHint(WindowPtr pWin, char **res_name, char **res_class) while (prop) { if (prop->propertyName == XA_WM_CLASS && prop->type == XA_STRING && prop->format == 8 && prop->data) { - len_name = strlen((char *) prop->data); + len_name = strnlen((char *) prop->data, prop->size); (*res_name) = malloc(len_name + 1); @@ -77,13 +83,17 @@ winMultiWindowGetClassHint(WindowPtr pWin, char **res_name, char **res_class) return 0; } - /* Add one to len_name to allow copying of trailing 0 */ - strncpy((*res_name), prop->data, len_name + 1); - - if (len_name == prop->size) - len_name--; + /* Copy name and ensure null terminated */ + memcpy((*res_name), prop->data, len_name); + (*res_name)[len_name] = '\0'; - len_class = strlen(((char *) prop->data) + 1 + len_name); + /* Compute length of class name, it could be that it is not null terminated */ + if (len_name < prop->size - 1) { + len_class = strnlen(((char *) prop->data) + 1 + len_name, prop->size - 1 - len_name); + } + else { + len_class = 0; + } (*res_class) = malloc(len_class + 1); @@ -95,7 +105,9 @@ winMultiWindowGetClassHint(WindowPtr pWin, char **res_name, char **res_class) return 0; } - strcpy((*res_class), ((char *) prop->data) + 1 + len_name); + /* Copy class name and ensure null terminated */ + memcpy((*res_class), ((char *) prop->data) + 1 + len_name, len_class); + (*res_class)[len_class] = '\0'; return 1; } diff --git a/hw/xwin/winmultiwindowicons.c b/hw/xwin/winmultiwindowicons.c index 0322d9816..9684512da 100644 --- a/hw/xwin/winmultiwindowicons.c +++ b/hw/xwin/winmultiwindowicons.c @@ -32,510 +32,22 @@ #include <xwin-config.h> #endif -#ifndef WINVER -#define WINVER 0x0500 -#endif - #include <X11/Xwindows.h> #include <X11/Xlib.h> -#include <X11/Xutil.h> +#include <X11/Xlib-xcb.h> #include "winresource.h" #include "winprefs.h" -#include "winmsg.h" #include "winmultiwindowicons.h" #include "winglobals.h" +#include "wmutil/icon_convert.h" + /* * global variables */ extern HINSTANCE g_hInstance; /* - * Scale an X icon ZPixmap into a Windoze icon bitmap - */ - -static void -winScaleXImageToWindowsIcon(int iconSize, - int effBPP, - int stride, XImage * pixmap, unsigned char *image) -{ - int row, column, effXBPP, effXDepth; - unsigned char *outPtr; - unsigned char *iconData = 0; - int xStride; - float factX, factY; - int posX, posY; - unsigned char *ptr; - unsigned int zero; - unsigned int color; - - effXBPP = pixmap->bits_per_pixel; - if (pixmap->bits_per_pixel == 15) - effXBPP = 16; - - effXDepth = pixmap->depth; - if (pixmap->depth == 15) - effXDepth = 16; - - xStride = pixmap->bytes_per_line; - if (stride == 0 || xStride == 0) { - ErrorF("winScaleXBitmapToWindows - stride or xStride is zero. " - "Bailing.\n"); - return; - } - - /* Get icon data */ - iconData = (unsigned char *) pixmap->data; - - /* Keep aspect ratio */ - factX = ((float) pixmap->width) / ((float) iconSize); - factY = ((float) pixmap->height) / ((float) iconSize); - if (factX > factY) - factY = factX; - else - factX = factY; - - /* Out-of-bounds, fill icon with zero */ - zero = 0; - - for (row = 0; row < iconSize; row++) { - outPtr = image + stride * row; - for (column = 0; column < iconSize; column++) { - posX = factX * column; - posY = factY * row; - - ptr = (unsigned char *) iconData + posY * xStride; - if (effXBPP == 1) { - ptr += posX / 8; - - /* Out of X icon bounds, leave space blank */ - if (posX >= pixmap->width || posY >= pixmap->height) - ptr = (unsigned char *) &zero; - - if ((*ptr) & (1 << (posX & 7))) - switch (effBPP) { - case 32: - *(outPtr++) = 0; - case 24: - *(outPtr++) = 0; - case 16: - *(outPtr++) = 0; - case 8: - *(outPtr++) = 0; - break; - case 1: - outPtr[column / 8] &= ~(1 << (7 - (column & 7))); - break; - } - else - switch (effBPP) { - case 32: - *(outPtr++) = 255; - *(outPtr++) = 255; - *(outPtr++) = 255; - *(outPtr++) = 0; - break; - case 24: - *(outPtr++) = 255; - case 16: - *(outPtr++) = 255; - case 8: - *(outPtr++) = 255; - break; - case 1: - outPtr[column / 8] |= (1 << (7 - (column & 7))); - break; - } - } - else if (effXDepth == 24 || effXDepth == 32) { - ptr += posX * (effXBPP / 8); - - /* Out of X icon bounds, leave space blank */ - if (posX >= pixmap->width || posY >= pixmap->height) - ptr = (unsigned char *) &zero; - color = (((*ptr) << 16) - + ((*(ptr + 1)) << 8) - + ((*(ptr + 2)) << 0)); - switch (effBPP) { - case 32: - *(outPtr++) = *(ptr++); /* b */ - *(outPtr++) = *(ptr++); /* g */ - *(outPtr++) = *(ptr++); /* r */ - *(outPtr++) = (effXDepth == 32) ? *(ptr++) : 0x0; /* alpha */ - break; - case 24: - *(outPtr++) = *(ptr++); - *(outPtr++) = *(ptr++); - *(outPtr++) = *(ptr++); - break; - case 16: - color = ((((*ptr) >> 2) << 10) - + (((*(ptr + 1)) >> 2) << 5) - + (((*(ptr + 2)) >> 2))); - *(outPtr++) = (color >> 8); - *(outPtr++) = (color & 255); - break; - case 8: - color = (((*ptr))) + (((*(ptr + 1)))) + (((*(ptr + 2)))); - color /= 3; - *(outPtr++) = color; - break; - case 1: - if (color) - outPtr[column / 8] |= (1 << (7 - (column & 7))); - else - outPtr[column / 8] &= ~(1 << (7 - (column & 7))); - } - } - else if (effXDepth == 16) { - ptr += posX * (effXBPP / 8); - - /* Out of X icon bounds, leave space blank */ - if (posX >= pixmap->width || posY >= pixmap->height) - ptr = (unsigned char *) &zero; - color = ((*ptr) << 8) + (*(ptr + 1)); - switch (effBPP) { - case 32: - *(outPtr++) = (color & 31) << 2; - *(outPtr++) = ((color >> 5) & 31) << 2; - *(outPtr++) = ((color >> 10) & 31) << 2; - *(outPtr++) = 0; /* resvd */ - break; - case 24: - *(outPtr++) = (color & 31) << 2; - *(outPtr++) = ((color >> 5) & 31) << 2; - *(outPtr++) = ((color >> 10) & 31) << 2; - break; - case 16: - *(outPtr++) = *(ptr++); - *(outPtr++) = *(ptr++); - break; - case 8: - *(outPtr++) = (((color & 31) - + ((color >> 5) & 31) - + ((color >> 10) & 31)) / 3) << 2; - break; - case 1: - if (color) - outPtr[column / 8] |= (1 << (7 - (column & 7))); - else - outPtr[column / 8] &= ~(1 << (7 - (column & 7))); - break; - } /* end switch(effbpp) */ - } /* end if effxbpp==16) */ - } /* end for column */ - } /* end for row */ -} - -static HICON -NetWMToWinIconAlpha(uint32_t * icon) -{ - int width = icon[0]; - int height = icon[1]; - uint32_t *pixels = &icon[2]; - HICON result; - HDC hdc = GetDC(NULL); - uint32_t *DIB_pixels; - ICONINFO ii; - BITMAPV4HEADER bmh = { sizeof(bmh) }; - - /* Define an ARGB pixel format used for Color+Alpha icons */ - bmh.bV4Width = width; - bmh.bV4Height = -height; /* Invert the image */ - bmh.bV4Planes = 1; - bmh.bV4BitCount = 32; - bmh.bV4V4Compression = BI_BITFIELDS; - bmh.bV4AlphaMask = 0xFF000000; - bmh.bV4RedMask = 0x00FF0000; - bmh.bV4GreenMask = 0x0000FF00; - bmh.bV4BlueMask = 0x000000FF; - - ii.fIcon = TRUE; - ii.xHotspot = 0; /* ignored */ - ii.yHotspot = 0; /* ignored */ - ii.hbmColor = CreateDIBSection(hdc, (BITMAPINFO *) &bmh, - DIB_RGB_COLORS, (void **) &DIB_pixels, NULL, - 0); - ReleaseDC(NULL, hdc); - ii.hbmMask = CreateBitmap(width, height, 1, 1, NULL); - memcpy(DIB_pixels, pixels, height * width * 4); - - /* CreateIconIndirect() traditionally required DDBitmaps */ - /* Systems from WinXP accept 32-bit ARGB DIBitmaps with full 8-bit alpha support */ - /* The icon is created with a DIB + empty DDB mask (an MS example does the same) */ - result = CreateIconIndirect(&ii); - - DeleteObject(ii.hbmColor); - DeleteObject(ii.hbmMask); - - winDebug("NetWMToWinIconAlpha - %d x %d = %p\n", icon[0], icon[1], result); - return result; -} - -static HICON -NetWMToWinIconThreshold(uint32_t * icon) -{ - int width = icon[0]; - int height = icon[1]; - uint32_t *pixels = &icon[2]; - int row, col; - HICON result; - ICONINFO ii; - - HDC hdc = GetDC(NULL); - HDC xorDC = CreateCompatibleDC(hdc); - HDC andDC = CreateCompatibleDC(hdc); - - ii.fIcon = TRUE; - ii.xHotspot = 0; /* ignored */ - ii.yHotspot = 0; /* ignored */ - ii.hbmColor = CreateCompatibleBitmap(hdc, width, height); - ii.hbmMask = CreateCompatibleBitmap(hdc, width, height); - ReleaseDC(NULL, hdc); - SelectObject(xorDC, ii.hbmColor); - SelectObject(andDC, ii.hbmMask); - - for (row = 0; row < height; row++) { - for (col = 0; col < width; col++) { - if ((*pixels & 0xFF000000) > 31 << 24) { /* 31 alpha threshold, i.e. opaque above, transparent below */ - SetPixelV(xorDC, col, row, - RGB(((char *) pixels)[2], ((char *) pixels)[1], - ((char *) pixels)[0])); - SetPixelV(andDC, col, row, RGB(0, 0, 0)); /* black mask */ - } - else { - SetPixelV(xorDC, col, row, RGB(0, 0, 0)); - SetPixelV(andDC, col, row, RGB(255, 255, 255)); /* white mask */ - } - pixels++; - } - } - DeleteDC(xorDC); - DeleteDC(andDC); - - result = CreateIconIndirect(&ii); - - DeleteObject(ii.hbmColor); - DeleteObject(ii.hbmMask); - - winDebug("NetWMToWinIconThreshold - %d x %d = %p\n", icon[0], icon[1], - result); - return result; -} - -static HICON -NetWMToWinIcon(int bpp, uint32_t * icon) -{ - static Bool hasIconAlphaChannel = FALSE; - static BOOL versionChecked = FALSE; - - if (!versionChecked) { - OSVERSIONINFOEX osvi = { 0 }; - ULONGLONG dwlConditionMask = 0; - - osvi.dwOSVersionInfoSize = sizeof(osvi); - osvi.dwMajorVersion = 5; - osvi.dwMinorVersion = 1; - - /* Windows versions later than XP have icon alpha channel suport, 2000 does not */ - VER_SET_CONDITION(dwlConditionMask, VER_MAJORVERSION, - VER_GREATER_EQUAL); - VER_SET_CONDITION(dwlConditionMask, VER_MINORVERSION, - VER_GREATER_EQUAL); - hasIconAlphaChannel = - VerifyVersionInfo(&osvi, VER_MAJORVERSION | VER_MINORVERSION, - dwlConditionMask); - versionChecked = TRUE; - - ErrorF("OS has icon alpha channel support: %s\n", - hasIconAlphaChannel ? "yes" : "no"); - } - - if (hasIconAlphaChannel && (bpp == 32)) - return NetWMToWinIconAlpha(icon); - else - return NetWMToWinIconThreshold(icon); -} - -/* - * Attempt to create a custom icon from the WM_HINTS bitmaps - */ - -static - HICON -winXIconToHICON(Display * pDisplay, Window id, int iconSize) -{ - unsigned char *mask, *image = NULL, *imageMask; - unsigned char *dst, *src; - int planes, bpp, i; - int biggest_size = 0; - HDC hDC; - ICONINFO ii; - XWMHints *hints; - HICON hIcon = NULL; - uint32_t *biggest_icon = NULL; - - static Atom _XA_NET_WM_ICON; - static int generation; - uint32_t *icon, *icon_data = NULL; - unsigned long int size; - unsigned long int type; - int format; - unsigned long int left; - - hDC = GetDC(GetDesktopWindow()); - planes = GetDeviceCaps(hDC, PLANES); - bpp = GetDeviceCaps(hDC, BITSPIXEL); - ReleaseDC(GetDesktopWindow(), hDC); - - /* Always prefer _NET_WM_ICON icons */ - if (generation != serverGeneration) { - generation = serverGeneration; - _XA_NET_WM_ICON = XInternAtom(pDisplay, "_NET_WM_ICON", FALSE); - } - - if ((XGetWindowProperty(pDisplay, id, _XA_NET_WM_ICON, - 0, MAXINT, FALSE, - AnyPropertyType, &type, &format, &size, &left, - (unsigned char **) &icon_data) == Success) && - (icon_data != NULL)) { - for (icon = icon_data; icon < &icon_data[size] && *icon; - icon = &icon[icon[0] * icon[1] + 2]) { - /* Find an exact match to the size we require... */ - if (icon[0] == iconSize && icon[1] == iconSize) { - winDebug("winXIconToHICON: found %lu x %lu NetIcon\n", icon[0], - icon[1]); - hIcon = NetWMToWinIcon(bpp, icon); - break; - } - /* Otherwise, find the biggest icon and let Windows scale the size */ - else if (biggest_size < icon[0]) { - biggest_icon = icon; - biggest_size = icon[0]; - } - } - - if (!hIcon && biggest_icon) { - winDebug - ("winXIconToHICON: selected %lu x %lu NetIcon for scaling to %u x %u\n", - biggest_icon[0], biggest_icon[1], iconSize, iconSize); - - hIcon = NetWMToWinIcon(bpp, biggest_icon); - } - - XFree(icon_data); - } - - if (!hIcon) { - winDebug("winXIconToHICON: no suitable NetIcon\n"); - - hints = XGetWMHints(pDisplay, id); - if (hints) { - winDebug("winXIconToHICON: id 0x%x icon_pixmap hint %x\n", id, - hints->icon_pixmap); - - if (hints->icon_pixmap) { - Window root; - int x, y; - unsigned int width, height, border_width, depth; - XImage *xImageIcon; - XImage *xImageMask = NULL; - - XGetGeometry(pDisplay, hints->icon_pixmap, &root, &x, &y, - &width, &height, &border_width, &depth); - - xImageIcon = - XGetImage(pDisplay, hints->icon_pixmap, 0, 0, width, height, - 0xFFFFFFFF, ZPixmap); - winDebug("winXIconToHICON: id 0x%x icon Ximage 0x%x\n", id, - xImageIcon); - - if (hints->icon_mask) - xImageMask = - XGetImage(pDisplay, hints->icon_mask, 0, 0, width, - height, 0xFFFFFFFF, ZPixmap); - - if (xImageIcon) { - int effBPP, stride, maskStride; - - /* 15 BPP is really 16BPP as far as we care */ - if (bpp == 15) - effBPP = 16; - else - effBPP = bpp; - - /* Need 16-bit aligned rows for DDBitmaps */ - stride = ((iconSize * effBPP + 15) & (~15)) / 8; - - /* Mask is 1-bit deep */ - maskStride = ((iconSize * 1 + 15) & (~15)) / 8; - - image = malloc(stride * iconSize); - imageMask = malloc(stride * iconSize); - mask = malloc(maskStride * iconSize); - - /* Default to a completely black mask */ - memset(imageMask, 0, stride * iconSize); - memset(mask, 0, maskStride * iconSize); - - winScaleXImageToWindowsIcon(iconSize, effBPP, stride, - xImageIcon, image); - - if (xImageMask) { - winScaleXImageToWindowsIcon(iconSize, 1, maskStride, - xImageMask, mask); - winScaleXImageToWindowsIcon(iconSize, effBPP, stride, - xImageMask, imageMask); - } - - /* Now we need to set all bits of the icon which are not masked */ - /* on to 0 because Color is really an XOR, not an OR function */ - dst = image; - src = imageMask; - - for (i = 0; i < (stride * iconSize); i++) - if ((*(src++))) - *(dst++) = 0; - else - dst++; - - ii.fIcon = TRUE; - ii.xHotspot = 0; /* ignored */ - ii.yHotspot = 0; /* ignored */ - - /* Create Win32 mask from pixmap shape */ - ii.hbmMask = - CreateBitmap(iconSize, iconSize, planes, 1, mask); - - /* Create Win32 bitmap from pixmap */ - ii.hbmColor = - CreateBitmap(iconSize, iconSize, planes, bpp, image); - - /* Merge Win32 mask and bitmap into icon */ - hIcon = CreateIconIndirect(&ii); - - /* Release Win32 mask and bitmap */ - DeleteObject(ii.hbmMask); - DeleteObject(ii.hbmColor); - - /* Free X mask and bitmap */ - free(mask); - free(image); - free(imageMask); - - if (xImageMask) - XDestroyImage(xImageMask); - - XDestroyImage(xImageIcon); - } - } - XFree(hints); - } - } - return hIcon; -} - -/* * Change the Windows window icon */ @@ -545,16 +57,20 @@ winUpdateIcon(HWND hWnd, Display * pDisplay, Window id, HICON hIconNew) { HICON hIcon, hIconSmall = NULL, hIconOld; - /* Start with the icon from preferences, if any */ - hIcon = hIconNew; - hIconSmall = hIconNew; + if (hIconNew) + { + /* Start with the icon from preferences, if any */ + hIcon = hIconNew; + hIconSmall = hIconNew; + } + else + { + /* If we still need an icon, try and get the icon from WM_HINTS */ + xcb_connection_t *conn = XGetXCBConnection(pDisplay); - /* If we still need an icon, try and get the icon from WM_HINTS */ - if (!hIcon) - hIcon = winXIconToHICON(pDisplay, id, GetSystemMetrics(SM_CXICON)); - if (!hIconSmall) - hIconSmall = - winXIconToHICON(pDisplay, id, GetSystemMetrics(SM_CXSMICON)); + hIcon = winXIconToHICON(conn, id, GetSystemMetrics(SM_CXICON)); + hIconSmall = winXIconToHICON(conn, id, GetSystemMetrics(SM_CXSMICON)); + } /* If we got the small, but not the large one swap them */ if (!hIcon && hIconSmall) { diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c index c0c7db2b7..66b0c1ae4 100644 --- a/hw/xwin/winmultiwindowwindow.c +++ b/hw/xwin/winmultiwindowwindow.c @@ -55,11 +55,27 @@ static void static void winFindWindow(pointer value, XID id, pointer cdata); +static Bool +isToplevelWindow(WindowPtr pWin) +{ + assert(pWin->parent); /* root window isn't expected here */ + + /* If the immediate parent is the root window, this is a top-level window */ + if ((pWin->parent) && (pWin->parent->parent == NULL)) { + assert(pWin->parent == pWin->drawable.pScreen->root); + return TRUE; + } + + /* otherwise, a child window */ + return FALSE; +} + static void winInitMultiWindowClass(void) { static wATOM atomXWinClass = 0; + static wATOM atomXWinChildClass = 0; WNDCLASSEX wcx; if (atomXWinClass == 0) { @@ -83,11 +99,40 @@ winInitMultiWindowClass(void) wcx.hIconSm = hIconSmall; #if CYGMULTIWINDOW_DEBUG - ErrorF("winCreateWindowsWindow - Creating class: %s\n", WINDOW_CLASS_X); + ErrorF("winInitMultiWindowClass - Creating class: %s\n", + WINDOW_CLASS_X); #endif atomXWinClass = RegisterClassEx(&wcx); } + + if (atomXWinChildClass == 0) { + HICON hIcon, hIconSmall; + + /* Load the default icons */ + winSelectIcons(&hIcon, &hIconSmall); + + /* Setup our window class */ + wcx.cbSize = sizeof(WNDCLASSEX); + wcx.style = CS_HREDRAW | CS_VREDRAW | (g_fNativeGl ? CS_OWNDC : 0); + wcx.lpfnWndProc = winChildWindowProc; + wcx.cbClsExtra = 0; + wcx.cbWndExtra = 0; + wcx.hInstance = g_hInstance; + wcx.hIcon = hIcon; + wcx.hCursor = 0; + wcx.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH); + wcx.lpszMenuName = NULL; + wcx.lpszClassName = WINDOW_CLASS_X_CHILD; + wcx.hIconSm = hIconSmall; + +#if CYGMULTIWINDOW_DEBUG + ErrorF("winInitMultiWindowClass - Creating class: %s\n", + WINDOW_CLASS_X_CHILD); +#endif + + atomXWinChildClass = RegisterClassEx(&wcx); + } } /* @@ -202,6 +247,29 @@ winPositionWindowMultiWindow(WindowPtr pWin, int x, int y) return fResult; } + if (!isToplevelWindow(pWin)) { + POINT parentOrigin; + + /* Get the X and Y location of the X window */ + iX = pWin->drawable.x + GetSystemMetrics(SM_XVIRTUALSCREEN); + iY = pWin->drawable.y + GetSystemMetrics(SM_YVIRTUALSCREEN); + + /* Get the height and width of the X window */ + iWidth = pWin->drawable.width; + iHeight = pWin->drawable.height; + + /* Convert screen coordinates into client area co-ordinates of the parent */ + parentOrigin.x = 0; + parentOrigin.y = 0; + ClientToScreen(GetParent(hWnd), &parentOrigin); + + MoveWindow(hWnd, + iX - parentOrigin.x, iY - parentOrigin.y, iWidth, iHeight, + TRUE); + + return fResult; + } + /* Get the Windows window style and extended style */ dwExStyle = GetWindowLongPtr(hWnd, GWL_EXSTYLE); dwStyle = GetWindowLongPtr(hWnd, GWL_STYLE); @@ -470,12 +538,8 @@ winRestackWindowMultiWindow(WindowPtr pWin, WindowPtr pOldNextSib) #endif } -/* - * winCreateWindowsWindow - Create a Windows window associated with an X window - */ - -void -winCreateWindowsWindow(WindowPtr pWin) +static void +winCreateWindowsTopLevelWindow(WindowPtr pWin) { int iX, iY; int iWidth; @@ -513,8 +577,8 @@ winCreateWindowsWindow(WindowPtr pWin) iY = CW_USEDEFAULT; } - winDebug("winCreateWindowsWindow - %dx%d @ %dx%d\n", iWidth, iHeight, iX, - iY); + winDebug("winCreateWindowsTopLevelWindow - %dx%d @ %dx%d\n", iWidth, + iHeight, iX, iY); if (winMultiWindowGetTransientFor(pWin, &pDaddy)) { if (pDaddy) { @@ -534,7 +598,11 @@ winCreateWindowsWindow(WindowPtr pWin) } } - /* Make it WS_OVERLAPPED in create call since WS_POPUP doesn't support */ + winDebug("winCreateWindowsTopLevelWindow - %dx%d @ %dx%d\n", iWidth, + iHeight, iX, iY); + + /* Create the window */ + /* Make it OVERLAPPED in create call since WS_POPUP doesn't support */ /* CW_USEDEFAULT, change back to popup after creation */ dwStyle = WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS; dwExStyle = WS_EX_TOOLWINDOW; @@ -572,11 +640,14 @@ winCreateWindowsWindow(WindowPtr pWin) GetModuleHandle(NULL), /* Instance handle */ pWin); /* ScreenPrivates */ if (hWnd == NULL) { - ErrorF("winCreateWindowsWindow - CreateWindowExA () failed: %d\n", - (int) GetLastError()); + ErrorF + ("winCreateWindowsTopLevelWindow - CreateWindowExA () failed: %d\n", + (int) GetLastError()); } pWinPriv->hWnd = hWnd; + winDebug("winCreateWindowsTopLevelWindow - hwnd 0x%08x\n", hWnd); + /* Change style back to popup, already placed... */ SetWindowLongPtr(hWnd, GWL_STYLE, WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS); @@ -602,6 +673,107 @@ winCreateWindowsWindow(WindowPtr pWin) (*pScreenPriv->pwinFinishCreateWindowsWindow) (pWin); } +static void +winCreateWindowsChildWindow(WindowPtr pWin) +{ + int iX, iY, iWidth, iHeight; + HWND hWnd; + WindowPtr pParent = pWin->parent; + DWORD dwStyle = WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_DISABLED; + DWORD dwExStyle = WS_EX_TRANSPARENT; + + /* + WS_DISABLED means child window never gains the input focus, so only the + top-level window needs deal with passing input to the X server + + WS_EX_TRANSPARENT ensures that the contents of the top-level + Windows window (which will contain all non-OpenGL drawing for the hierarchy) + can be seen through any intermediate child windows which have nothing + drawn to them + */ + winPrivWinPtr pParentPriv, pWinPriv; + + winDebug("winCreateWindowsChildWindow - pWin:%08x XID:0x%x \n", pWin, + pWin->drawable.id); + + winInitMultiWindowClass(); + + assert(pParent); + + pParentPriv = winGetWindowPriv(pParent); + pWinPriv = winGetWindowPriv(pWin); + + iX = pWin->drawable.x - pParent->drawable.x; + iY = pWin->drawable.y - pParent->drawable.y; + iWidth = pWin->drawable.width; + iHeight = pWin->drawable.height; + + winDebug + ("winCreateWindowsChildWindow - parent pWin:%08x XID:0x%08x hWnd:0x%08x\n", + pParent, pParent->drawable.id, pParentPriv->hWnd); + winDebug("winCreateWindowsChildWindow - %dx%d @ %dx%d\n", iWidth, iHeight, + iX, iY); + + /* Create the window */ + hWnd = CreateWindowExA(dwExStyle, /* Extended styles */ + WINDOW_CLASS_X_CHILD, /* Class name */ + WINDOW_TITLE_X, /* Window name */ + dwStyle, /* Styles */ + iX, /* Horizontal position */ + iY, /* Vertical position */ + iWidth, /* Right edge */ + iHeight, /* Bottom edge */ + pParentPriv->hWnd, /* parent window */ + (HMENU) NULL, /* No menu */ + GetModuleHandle(NULL), /* Instance handle */ + pWin); /* ScreenPrivates */ + if (hWnd == NULL) { + ErrorF("winCreateWindowsChildWindow - CreateWindowExA () failed: %d\n", + (int) GetLastError()); + } + winDebug("winCreateWindowsChildWindow - hwnd 0x%08x\n", hWnd); + pWinPriv->hWnd = hWnd; + + SetProp(hWnd, WIN_WID_PROP, (HANDLE) winGetWindowID(pWin)); +} + +/* + * winCreateWindowsWindow - Create a Windows window associated with an X window + */ + +void +winCreateWindowsWindow(WindowPtr pWin) +{ + winDebug("winCreateWindowsWindow - pWin:%08x XID:0x%x \n", pWin, + pWin->drawable.id); + + if (isToplevelWindow(pWin)) { + winCreateWindowsTopLevelWindow(pWin); + } + else { + winCreateWindowsChildWindow(pWin); + } +} + +static int +winDestroyChildWindowsWindow(WindowPtr pWin, pointer data) +{ + winWindowPriv(pWin); + + winDebug("winDestroyChildWindowsWindow - pWin:%08x XID:0x%x \n", pWin, + pWin->drawable.id); + + /* Null our handle to the Window so referencing it will cause an error */ + pWinPriv->hWnd = NULL; + +#ifdef XWIN_GLX_WINDOWS + /* No longer note WGL used on this window */ + pWinPriv->fWglUsed = FALSE; +#endif + + return WT_WALKCHILDREN; /* continue enumeration */ +} + Bool winInDestroyWindowsWindow = FALSE; /* @@ -617,6 +789,7 @@ winDestroyWindowsWindow(WindowPtr pWin) BOOL oldstate = winInDestroyWindowsWindow; HICON hIcon; HICON hIconSm; + HWND hWnd; winDebug("winDestroyWindowsWindow - pWin:%08x XID:0x%x \n", pWin, pWin->drawable.id); @@ -631,21 +804,20 @@ winDestroyWindowsWindow(WindowPtr pWin) hIcon = (HICON) SendMessage(pWinPriv->hWnd, WM_GETICON, ICON_BIG, 0); hIconSm = (HICON) SendMessage(pWinPriv->hWnd, WM_GETICON, ICON_SMALL, 0); - /* Destroy the Windows window */ - DestroyWindow(pWinPriv->hWnd); + hWnd = pWinPriv->hWnd; - /* Null our handle to the Window so referencing it will cause an error */ - pWinPriv->hWnd = NULL; + /* DestroyWindow() implicitly destroys all child windows, + so first walk over the child tree of this window, clearing + any hWnds */ + TraverseTree(pWin, winDestroyChildWindowsWindow, 0); + + /* Destroy the Windows window */ + DestroyWindow(hWnd); /* Destroy any icons we created for this window */ winDestroyIcon(hIcon); winDestroyIcon(hIconSm); -#ifdef XWIN_GLX_WINDOWS - /* No longer note WGL used on this window */ - pWinPriv->fWglUsed = FALSE; -#endif - /* Process all messages on our queue */ while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { if (g_hDlgDepthChange == 0 || !IsDialogMessage(g_hDlgDepthChange, &msg)) { @@ -667,29 +839,58 @@ static void winUpdateWindowsWindow(WindowPtr pWin) { winWindowPriv(pWin); - HWND hWnd = pWinPriv->hWnd; #if CYGMULTIWINDOW_DEBUG ErrorF("winUpdateWindowsWindow\n"); #endif - /* Check if the Windows window's parents have been destroyed */ - if (pWin->parent != NULL && pWin->parent->parent == NULL && pWin->mapped) { - /* Create the Windows window if it has been destroyed */ - if (hWnd == NULL) { - winCreateWindowsWindow(pWin); - assert(pWinPriv->hWnd != NULL); + /* Ignore the root window */ + if (pWin->parent == NULL) + return; + + /* If it's mapped */ + if (pWin->mapped) { + /* If it's a top-level window */ + if (isToplevelWindow(pWin)) { + /* Create the Windows window if needed */ + if (pWinPriv->hWnd == NULL) { + winCreateWindowsWindow(pWin); + assert(pWinPriv->hWnd != NULL); + } + + /* Display the window without activating it */ + if (pWin->drawable.class != InputOnly) + ShowWindow(pWinPriv->hWnd, SW_SHOWNOACTIVATE); + + } + /* It's not a top-level window, but we created a window for GLX */ + else if (pWinPriv->hWnd) { + winPrivWinPtr pParentPriv = winGetWindowPriv(pWin->parent); + + /* XXX: This really belongs in winReparentWindow ??? */ + /* XXX: this assumes parent window has been made to exist */ + assert(pParentPriv->hWnd); + + /* Ensure we have the correct parent and position if reparented */ + SetParent(pWinPriv->hWnd, pParentPriv->hWnd); + SetWindowPos(pWinPriv->hWnd, NULL, + pWin->drawable.x - pWin->parent->drawable.x, + pWin->drawable.y - pWin->parent->drawable.y, 0, 0, + SWP_NOSIZE | SWP_NOZORDER | SWP_SHOWWINDOW); } - /* Display the window without activating it */ - if (pWin->drawable.class != InputOnly) - ShowWindow(pWinPriv->hWnd, SW_SHOWNOACTIVATE); + /* If it's top level, or a GLX window which has already been created getting mapped, show it */ + if (pWinPriv->hWnd != NULL) { + /* Display the window without activating it */ + if (pWin->drawable.class != InputOnly) + ShowWindow(pWinPriv->hWnd, SW_SHOWNOACTIVATE); - /* Send first paint message */ - UpdateWindow(pWinPriv->hWnd); + /* Send first paint message */ + UpdateWindow(pWinPriv->hWnd); + } } - else if (hWnd != NULL) { - /* Destroy the Windows window if its parents are destroyed */ + else if (pWinPriv->hWnd != NULL) { + /* If it's been reparented to an unmapped window when previously mapped, destroy the Windows window */ winDestroyWindowsWindow(pWin); assert(pWinPriv->hWnd == NULL); } @@ -929,6 +1130,14 @@ winAdjustXWindow(WindowPtr pWin, HWND hwnd) ErrorF("winAdjustXWindow\n"); #endif + if (!isToplevelWindow(pWin)) { +#if 1 + ErrorF + ("winAdjustXWindow - immediately return because not a top-level window\n"); +#endif + return 0; + } + if (IsIconic(hwnd)) { #if CYGWINDOWING_DEBUG ErrorF("\timmediately return because the window is iconized\n"); diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c index 4f6dec78b..c17cb073a 100644 --- a/hw/xwin/winmultiwindowwm.c +++ b/hw/xwin/winmultiwindowwm.c @@ -30,6 +30,10 @@ * Colin Harrison */ +#ifndef WINVER +#define WINVER 0x0500 +#endif + /* X headers */ #ifdef HAVE_XWIN_CONFIG_H #include <xwin-config.h> @@ -48,7 +52,6 @@ #include <X11/X.h> #include <X11/Xatom.h> #include <X11/Xlib.h> -#include <X11/Xlocale.h> #include <X11/Xproto.h> #include <X11/Xutil.h> #include <X11/cursorfont.h> @@ -60,6 +63,7 @@ #include "window.h" #include "pixmapstr.h" #include "windowstr.h" +#include "winglobals.h" #ifdef XWIN_MULTIWINDOWEXTWM #include <X11/extensions/windowswmstr.h> @@ -69,6 +73,10 @@ #define WINDOWSWM_NATIVE_HWND "_WINDOWSWM_NATIVE_HWND" #endif +#ifndef HOST_NAME_MAX +#define HOST_NAME_MAX 255 +#endif + extern void winDebug(const char *format, ...); extern void winReshapeMultiWindow(WindowPtr pWin); extern void winUpdateRgnMultiWindow(WindowPtr pWin); @@ -166,6 +174,9 @@ static int static int winMultiWindowXMsgProcIOErrorHandler(Display * pDisplay); +static void +winMultiWindowThreadExit(void *arg); + static int winRedirectErrorHandler(Display * pDisplay, XErrorEvent * pErr); @@ -183,6 +194,9 @@ CheckAnotherWindowManager(Display * pDisplay, DWORD dwScreen, Bool fAllowOtherWM); static void + winApplyUrgency(Display * pDisplay, Window iWindow, HWND hWnd); + +static void winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle); void @@ -429,7 +443,10 @@ GetWindowName(Display * pDisplay, Window iWin, char **ppWindowName) { int nResult; XTextProperty xtpWindowName; + XTextProperty xtpClientMachine; char *pszWindowName; + char *pszClientMachine; + char hostname[HOST_NAME_MAX + 1]; #if CYGMULTIWINDOW_DEBUG ErrorF("GetWindowName\n"); @@ -449,6 +466,40 @@ GetWindowName(Display * pDisplay, Window iWin, char **ppWindowName) pszWindowName = Xutf8TextPropertyToString(pDisplay, &xtpWindowName); XFree(xtpWindowName.value); + + if (g_fHostInTitle) { + /* Try to get client machine name */ + nResult = XGetWMClientMachine(pDisplay, iWin, &xtpClientMachine); + if (nResult && xtpClientMachine.value && xtpClientMachine.nitems) { + pszClientMachine = + Xutf8TextPropertyToString(pDisplay, &xtpClientMachine); + XFree(xtpClientMachine.value); + + /* + If we have a client machine name + and it's not the local host name... + */ + if (strlen(pszClientMachine) && + !gethostname(hostname, HOST_NAME_MAX + 1) && + strcmp(hostname, pszClientMachine)) { + /* ... add ' (on <clientmachine>)' to end of window name */ + *ppWindowName = + malloc(strlen(pszWindowName) + + strlen(pszClientMachine) + 7); + strcpy(*ppWindowName, pszWindowName); + strcat(*ppWindowName, " (on "); + strcat(*ppWindowName, pszClientMachine); + strcat(*ppWindowName, ")"); + + free(pszWindowName); + free(pszClientMachine); + + return; + } + } + } + + /* otherwise just return the window name */ *ppWindowName = pszWindowName; } @@ -627,6 +678,9 @@ UpdateStyle(WMInfoPtr pWMInfo, Window iWindow) winShowWindowOnTaskbar(hWnd, (GetWindowLongPtr(hWnd, GWL_EXSTYLE) & WS_EX_APPWINDOW) ? TRUE : FALSE); + + /* Check urgency hint */ + winApplyUrgency(pWMInfo->pDisplay, iWindow, hWnd); } #if 0 @@ -680,6 +734,8 @@ winMultiWindowWMProc(void *pArg) WMProcArgPtr pProcArg = (WMProcArgPtr) pArg; WMInfoPtr pWMInfo = pProcArg->pWMInfo; + pthread_cleanup_push(&winMultiWindowThreadExit, NULL); + /* Initialize the Window Manager */ winInitMultiWindowWM(pWMInfo, pProcArg); @@ -890,6 +946,9 @@ winMultiWindowWMProc(void *pArg) #if CYGMULTIWINDOW_DEBUG ErrorF("-winMultiWindowWMProc ()\n"); #endif + + pthread_cleanup_pop(0); + return NULL; } @@ -913,6 +972,8 @@ winMultiWindowXMsgProc(void *pArg) int iReturn; XIconSize *xis; + pthread_cleanup_push(&winMultiWindowThreadExit, NULL); + winDebug("winMultiWindowXMsgProc - Hello\n"); /* Check that argument pointer is not invalid */ @@ -933,17 +994,6 @@ winMultiWindowXMsgProc(void *pArg) ErrorF("winMultiWindowXMsgProc - pthread_mutex_lock () returned.\n"); - /* Allow multiple threads to access Xlib */ - if (XInitThreads() == 0) { - ErrorF("winMultiWindowXMsgProc - XInitThreads () failed. Exiting.\n"); - pthread_exit(NULL); - } - - /* See if X supports the current locale */ - if (XSupportsLocale() == False) { - ErrorF("winMultiWindowXMsgProc - Warning: locale not supported by X\n"); - } - /* Release the server started mutex */ pthread_mutex_unlock(pProcArg->ppmServerStarted); @@ -971,8 +1021,7 @@ winMultiWindowXMsgProc(void *pArg) } /* Setup the display connection string x */ - snprintf(pszDisplay, - 512, "127.0.0.1:%s.%d", display, (int) pProcArg->dwScreen); + winGetDisplayName(pszDisplay, (int) pProcArg->dwScreen); /* Print the display connection string */ ErrorF("winMultiWindowXMsgProc - DISPLAY=%s\n", pszDisplay); @@ -1168,6 +1217,10 @@ winMultiWindowXMsgProc(void *pArg) } } else if (event.type == PropertyNotify) { + char *atomName = + XGetAtomName(pProcArg->pDisplay, event.xproperty.atom); + winDebug("winMultiWindowXMsgProc: PropertyNotify %s\n", atomName); + XFree(atomName); if (event.xproperty.atom == atmWmName) { memset(&msg, 0, sizeof(msg)); @@ -1222,7 +1275,7 @@ winMultiWindowXMsgProc(void *pArg) } XCloseDisplay(pProcArg->pDisplay); - pthread_exit(NULL); + pthread_cleanup_pop(0); return NULL; } @@ -1328,17 +1381,6 @@ winInitMultiWindowWM(WMInfoPtr pWMInfo, WMProcArgPtr pProcArg) ErrorF("winInitMultiWindowWM - pthread_mutex_lock () returned.\n"); - /* Allow multiple threads to access Xlib */ - if (XInitThreads() == 0) { - ErrorF("winInitMultiWindowWM - XInitThreads () failed. Exiting.\n"); - pthread_exit(NULL); - } - - /* See if X supports the current locale */ - if (XSupportsLocale() == False) { - ErrorF("winInitMultiWindowWM - Warning: Locale not supported by X.\n"); - } - /* Release the server started mutex */ pthread_mutex_unlock(pProcArg->ppmServerStarted); @@ -1366,8 +1408,7 @@ winInitMultiWindowWM(WMInfoPtr pWMInfo, WMProcArgPtr pProcArg) } /* Setup the display connection string x */ - snprintf(pszDisplay, - 512, "127.0.0.1:%s.%d", display, (int) pProcArg->dwScreen); + winGetDisplayName(pszDisplay, (int) pProcArg->dwScreen); /* Print the display connection string */ ErrorF("winInitMultiWindowWM - DISPLAY=%s\n", pszDisplay); @@ -1470,7 +1511,7 @@ winMultiWindowWMErrorHandler(Display * pDisplay, XErrorEvent * pErr) static int winMultiWindowWMIOErrorHandler(Display * pDisplay) { - ErrorF("winMultiWindowWMIOErrorHandler!\n\n"); + ErrorF("winMultiWindowWMIOErrorHandler!\n"); if (pthread_equal(pthread_self(), g_winMultiWindowWMThread)) { if (g_shutdown) @@ -1510,7 +1551,7 @@ winMultiWindowXMsgProcErrorHandler(Display * pDisplay, XErrorEvent * pErr) static int winMultiWindowXMsgProcIOErrorHandler(Display * pDisplay) { - ErrorF("winMultiWindowXMsgProcIOErrorHandler!\n\n"); + ErrorF("winMultiWindowXMsgProcIOErrorHandler!\n"); if (pthread_equal(pthread_self(), g_winMultiWindowXMsgProcThread)) { /* Restart at the main entry point */ @@ -1524,6 +1565,17 @@ winMultiWindowXMsgProcIOErrorHandler(Display * pDisplay) } /* + * winMultiWindowThreadExit - Thread exit handler + */ + +static void +winMultiWindowThreadExit(void *arg) +{ + /* multiwindow client thread has exited, stop server as well */ + kill(getpid(), SIGTERM); +} + +/* * Catch RedirectError to detect other window manager running */ @@ -1578,6 +1630,40 @@ winDeinitMultiWindowWM(void) g_shutdown = TRUE; } +static void +winApplyUrgency(Display * pDisplay, Window iWindow, HWND hWnd) +{ + XWMHints *hints = XGetWMHints(pDisplay, iWindow); + + if (hints) { + FLASHWINFO fwi; + + fwi.cbSize = sizeof(FLASHWINFO); + fwi.hwnd = hWnd; + + winDebug("winApplyUrgency: window 0x%08x has urgency hint %s\n", + iWindow, (hints->flags & XUrgencyHint) ? "on" : "off"); + + if (hints->flags & XUrgencyHint) { + DWORD count = 3; + + SystemParametersInfo(SPI_GETFOREGROUNDFLASHCOUNT, 0, &count, 0); + fwi.dwFlags = FLASHW_TRAY; + fwi.uCount = count; + fwi.dwTimeout = 0; + } + else { + fwi.dwFlags = FLASHW_STOP; + fwi.uCount = 0; + fwi.dwTimeout = 0; + } + + FlashWindowEx(&fwi); + + XFree(hints); + } +} + /* Windows window styles */ #define HINT_NOFRAME (1l<<0) #define HINT_BORDER (1L<<1) @@ -1626,23 +1712,27 @@ winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle) } if (XGetWindowProperty(pDisplay, iWindow, windowState, 0L, - 1L, False, XA_ATOM, &type, &format, + MAXINT, False, XA_ATOM, &type, &format, &nitems, &left, (unsigned char **) &pAtom) == Success) { - if (pAtom && nitems == 1) { - if (*pAtom == skiptaskbarState) - hint |= HINT_SKIPTASKBAR; - if (*pAtom == hiddenState) - maxmin |= HINT_MIN; - else if (*pAtom == fullscreenState) - maxmin |= HINT_MAX; - if (*pAtom == belowState) - *zstyle = HWND_BOTTOM; - else if (*pAtom == aboveState) - *zstyle = HWND_TOPMOST; - } - if (pAtom) + if (pAtom ) { + unsigned long i; + + for (i = 0; i < nitems; i++) { + if (pAtom[i] == skiptaskbarState) + hint |= HINT_SKIPTASKBAR; + if (pAtom[i] == hiddenState) + maxmin |= HINT_MIN; + else if (pAtom[i] == fullscreenState) + maxmin |= HINT_MAX; + if (pAtom[i] == belowState) + *zstyle = HWND_BOTTOM; + else if (pAtom[i] == aboveState) + *zstyle = HWND_TOPMOST; + } + XFree(pAtom); + } } nitems = left = 0; diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c index 0e46ea7fe..c1efeb73d 100644 --- a/hw/xwin/winmultiwindowwndproc.c +++ b/hw/xwin/winmultiwindowwndproc.c @@ -316,6 +316,7 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) static Bool s_fTracking = FALSE; Bool needRestack = FALSE; LRESULT ret; + static Bool hasEnteredSizeMove = FALSE; #if CYGDEBUG winDebugWin32Message("winTopLevelWindowProc", hwnd, message, wParam, @@ -661,7 +662,7 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput) break; SetCapture(hwnd); - return winMouseButtonsHandle(s_pScreen, ButtonPress, HIWORD(wParam) + 5, + return winMouseButtonsHandle(s_pScreen, ButtonPress, HIWORD(wParam) + 7, wParam); case WM_XBUTTONUP: @@ -670,7 +671,7 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) ReleaseCapture(); winStartMousePolling(s_pScreenPriv); return winMouseButtonsHandle(s_pScreen, ButtonRelease, - HIWORD(wParam) + 5, wParam); + HIWORD(wParam) + 7, wParam); case WM_MOUSEWHEEL: if (SendMessage @@ -684,6 +685,18 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) else break; + case WM_MOUSEHWHEEL: + if (SendMessage + (hwnd, WM_NCHITTEST, 0, + MAKELONG(GET_X_LPARAM(lParam), + GET_Y_LPARAM(lParam))) == HTCLIENT) { + /* Pass the message to the root window */ + SendMessage(hwndScreen, message, wParam, lParam); + return 0; + } + else + break; + case WM_SETFOCUS: if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput) break; @@ -860,7 +873,9 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) case WM_MOVE: /* Adjust the X Window to the moved Windows window */ - winAdjustXWindow(pWin, hwnd); + if (!hasEnteredSizeMove) + winAdjustXWindow(pWin, hwnd); + /* else: Wait for WM_EXITSIZEMOVE */ return 0; case WM_SHOWWINDOW: @@ -993,6 +1008,16 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) */ break; + case WM_ENTERSIZEMOVE: + hasEnteredSizeMove = TRUE; + return 0; + + case WM_EXITSIZEMOVE: + /* Adjust the X Window to the moved Windows window */ + hasEnteredSizeMove = FALSE; + winAdjustXWindow(pWin, hwnd); + return 0; + case WM_SIZE: /* see dix/window.c */ #if CYGWINDOWING_DEBUG @@ -1017,8 +1042,13 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) (int) (GetTickCount())); } #endif - /* Adjust the X Window to the moved Windows window */ - winAdjustXWindow(pWin, hwnd); + if (!hasEnteredSizeMove) { + /* Adjust the X Window to the moved Windows window */ + winAdjustXWindow(pWin, hwnd); + if (wParam == SIZE_MINIMIZED) + winReorderWindowsMultiWindow(); + } + /* else: wait for WM_EXITSIZEMOVE */ return 0; /* end of WM_SIZE handler */ case WM_STYLECHANGING: @@ -1128,3 +1158,41 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) winReorderWindowsMultiWindow(); return ret; } + +/* + * winChildWindowProc - Window procedure for all top-level Windows windows. + */ + +LRESULT CALLBACK +winChildWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +{ +#if CYGDEBUG + winDebugWin32Message("winChildWindowProc", hwnd, message, wParam, lParam); +#endif + + switch (message) { + case WM_ERASEBKGND: + return TRUE; + + case WM_PAINT: + /* + We don't have the bits to draw into the window, they went straight into the OpenGL + surface + + XXX: For now, just leave it alone, but ideally we want to send an expose event to + the window so it really redraws the affected region... + */ + { + PAINTSTRUCT ps; + HDC hdcUpdate; + + hdcUpdate = BeginPaint(hwnd, &ps); + ValidateRect(hwnd, &(ps.rcPaint)); + EndPaint(hwnd, &ps); + return 0; + } + /* XXX: this is exactly what DefWindowProc does? */ + } + + return DefWindowProc(hwnd, message, wParam, lParam); +} diff --git a/hw/xwin/winprefs.c b/hw/xwin/winprefs.c index 6cbd7ad80..a39aad8f4 100644 --- a/hw/xwin/winprefs.c +++ b/hw/xwin/winprefs.c @@ -37,6 +37,8 @@ #include <stdlib.h> #ifdef __CYGWIN__ #include <sys/resource.h> +#include <sys/wait.h> +#include <pthread.h> #endif #include "win.h" @@ -300,6 +302,110 @@ HandleCustomWM_INITMENU(unsigned long hwndIn, unsigned long hmenuIn) } +#ifdef __CYGWIN__ +static void +LogLineFromFd(int fd, const char *fdname, int pid) +{ +#define BUFSIZE 512 /* must be less than internal buffer size used in LogVWrite */ + char buf[BUFSIZE]; + char *bufptr = buf; + + /* read from fd until eof, newline or our buffer is full */ + while ((read(fd, bufptr, 1) > 0) && (bufptr < &(buf[BUFSIZE - 1]))) { + if (*bufptr == '\n') + break; + bufptr++; + } + + /* null terminate and log */ + *bufptr = 0; + if (strlen(buf)) + ErrorF("(pid %d %s) %s\n", pid, fdname, buf); +} + +static void * +ExecAndLogThread(void *cmd) +{ + int pid; + int stdout_filedes[2]; + int stderr_filedes[2]; + int status; + + /* Create a pair of pipes */ + pipe(stdout_filedes); + pipe(stderr_filedes); + + switch (pid = fork()) { + case 0: /* child */ + { + struct rlimit rl; + unsigned int fd; + + /* dup write end of pipes onto stderr and stdout */ + close(STDOUT_FILENO); + close(STDERR_FILENO); + + dup2(stdout_filedes[1], STDOUT_FILENO); + dup2(stderr_filedes[1], STDERR_FILENO); + + /* Close any open descriptors except for STD* */ + getrlimit(RLIMIT_NOFILE, &rl); + for (fd = STDERR_FILENO + 1; fd < rl.rlim_cur; fd++) + close(fd); + + /* Disassociate any TTYs */ + setsid(); + + execl("/bin/sh", "/bin/sh", "-c", cmd, NULL); + perror("execl failed"); + exit(127); + } + break; + + default: /* parent */ + { + close(stdout_filedes[1]); + close(stderr_filedes[1]); + + ErrorF("executing '%s', pid %d\n", (char *) cmd, pid); + + /* read from pipes, write to log, until both are closed */ + while (TRUE) { + fd_set readfds, errorfds; + int nfds = max(stdout_filedes[0], stderr_filedes[0]) + 1; + + FD_ZERO(&readfds); + FD_SET(stdout_filedes[0], &readfds); + FD_SET(stderr_filedes[0], &readfds); + errorfds = readfds; + + if (select(nfds, &readfds, NULL, &errorfds, NULL) > 0) { + if (FD_ISSET(stdout_filedes[0], &readfds)) + LogLineFromFd(stdout_filedes[0], "stdout", pid); + if (FD_ISSET(stderr_filedes[0], &readfds)) + LogLineFromFd(stderr_filedes[0], "stderr", pid); + + if (FD_ISSET(stdout_filedes[0], &errorfds) && + FD_ISSET(stderr_filedes[0], &errorfds)) + break; + } + else { + break; + } + } + + waitpid(pid, &status, 0); + } + break; + + case -1: /* error */ + ErrorF("fork() to run command failed\n"); + } + + return (void *) status; +} +#endif + /* * Searches for the custom WM_COMMAND command ID and performs action. * Return TRUE if command is proccessed, FALSE otherwise. @@ -325,24 +431,17 @@ HandleCustomWM_COMMAND(unsigned long hwndIn, int command) switch (m->menuItem[j].cmd) { #ifdef __CYGWIN__ case CMD_EXEC: - if (fork() == 0) { - struct rlimit rl; - int fd; - - /* Close any open descriptors except for STD* */ - getrlimit(RLIMIT_NOFILE, &rl); - for (fd = STDERR_FILENO + 1; fd < rl.rlim_cur; fd++) - close(fd); - - /* Disassociate any TTYs */ - setsid(); + { + pthread_t t; - execl("/bin/sh", - "/bin/sh", "-c", m->menuItem[j].param, NULL); - exit(0); - } + if (!pthread_create + (&t, NULL, ExecAndLogThread, m->menuItem[j].param)) + pthread_detach(t); else - return TRUE; + ErrorF + ("Creating command output logging thread failed\n"); + } + return TRUE; break; #else case CMD_EXEC: @@ -651,11 +750,17 @@ winPrefsLoadPreferences(char *path) "MENU rmenu {\n" " \"How to customize this menu\" EXEC \"xterm +tb -e man XWinrc\"\n" " \"Launch xterm\" EXEC xterm\n" - " \"Load .XWinrc\" RELOAD\n" + " SEPARATOR\n" + " FAQ EXEC \"cygstart http://x.cygwin.com/docs/faq/cygwin-x-faq.html\"\n" + " \"User's Guide\" EXEC \"cygstart http://x.cygwin.com/docs/ug/cygwin-x-ug.html\"\n" + " SEPARATOR\n" + " \"Reload .XWinrc\" RELOAD\n" " SEPARATOR\n" "}\n" "\n" "ROOTMENU rmenu\n"; path = "built-in default"; prefFile = fmemopen(defaultPrefs, strlen(defaultPrefs), "r"); + + } #endif @@ -686,7 +791,7 @@ LoadPreferences(void) char *home; char fname[PATH_MAX + NAME_MAX + 2]; char szDisplay[512]; - char *szEnvDisplay; + char *szEnvDisplay, *szEnvLogFile; int i, j; char param[PARAM_MAX + 1]; char *srcParam, *dstParam; @@ -727,15 +832,19 @@ LoadPreferences(void) /* Setup a DISPLAY environment variable, need to allocate on heap */ /* because putenv doesn't copy the argument... */ - snprintf(szDisplay, 512, "DISPLAY=127.0.0.1:%s.0", display); - szEnvDisplay = (char *) (malloc(strlen(szDisplay) + 1)); + winGetDisplayName(szDisplay, 0); + szEnvDisplay = (char *) (malloc(strlen(szDisplay) + strlen("DISPLAY=") + 1)); if (szEnvDisplay) { - strcpy(szEnvDisplay, szDisplay); + snprintf(szEnvDisplay, 512, "DISPLAY=%s", szDisplay); putenv(szEnvDisplay); } + /* Setup XWINLOGFILE environment variable */ + szEnvLogFile = (char *) (malloc(strlen(g_pszLogFile) + strlen("XWINLOGFILE=") + 1)); + snprintf(szEnvLogFile, 512, "XWINLOGFILE=%s", g_pszLogFile); + putenv(szEnvLogFile); + /* Replace any "%display%" in menu commands with display string */ - snprintf(szDisplay, 512, "127.0.0.1:%s.0", display); for (i = 0; i < pref.menuItems; i++) { for (j = 0; j < pref.menu[i].menuItems; j++) { if (pref.menu[i].menuItem[j].cmd == CMD_EXEC) { diff --git a/hw/xwin/winprefslex.l b/hw/xwin/winprefslex.l index 15f707766..c51b61035 100644 --- a/hw/xwin/winprefslex.l +++ b/hw/xwin/winprefslex.l @@ -91,6 +91,12 @@ DEBUG { return DEBUGOUTPUT; } RELOAD { return RELOAD; } TRAYICON { return TRAYICON; } SILENTEXIT { return SILENTEXIT; } +DPI { return DPI; } +XKBLAYOUT { return XKBLAYOUT; } +XKBMODEL { return XKBMODEL; } +XKBOPTIONS { return XKBOPTIONS; } +XKBRULES { return XKBRULES; } +XKBVARIANT { return XKBVARIANT; } "{" { return LB; } "}" { return RB; } "\""[^\"\r\n]+"\"" { yylval.sVal = makestr(yytext+1); \ diff --git a/hw/xwin/winprefsyacc.y b/hw/xwin/winprefsyacc.y index 3b376b3e7..72677b54f 100644 --- a/hw/xwin/winprefsyacc.y +++ b/hw/xwin/winprefsyacc.y @@ -39,6 +39,8 @@ #include <stdlib.h> #define _STDLIB_H 1 /* bison checks this to know if stdlib has been included */ #include <string.h> +#include "globals.h" +#include "winconfig.h" #include "winprefs.h" /* The following give better error messages in bison at the cost of a few KB */ @@ -57,6 +59,13 @@ static MENUPARSED menu; /* Functions for parsing the tokens into out structure */ /* Defined at the end section of this file */ +static void SetDPI (char *dpi); +static void SetXKBLayout (char *layout); +static void SetXKBModel (char *model); +static void SetXKBOptions (char *options); +static void SetXKBRules (char *rules); +static void SetXKBVariant (char *variant); + static void SetIconDirectory (char *path); static void SetDefaultIcon (char *fname); static void SetRootMenu (char *menu); @@ -120,6 +129,12 @@ extern int yylex(void); %token TRAYICON %token FORCEEXIT %token SILENTEXIT +%token DPI +%token XKBLAYOUT +%token XKBMODEL +%token XKBOPTIONS +%token XKBRULES +%token XKBVARIANT %token <sVal> STRING %type <uVal> group1 @@ -154,6 +169,30 @@ command: defaulticon | trayicon | forceexit | silentexit + | dpi + | xkblayout + | xkbmodel + | xkboptions + | xkbrules + | xkbvariant + ; + +dpi: DPI STRING NEWLINE { SetDPI($2); free($2); } + ; + +xkblayout: XKBLAYOUT STRING NEWLINE { SetXKBLayout($2); } + ; + +xkbmodel: XKBMODEL STRING NEWLINE { SetXKBModel($2); } + ; + +xkboptions: XKBOPTIONS STRING NEWLINE { SetXKBOptions($2); } + ; + +xkbrules: XKBRULES STRING NEWLINE { SetXKBRules($2); } + ; + +xkbvariant: XKBVARIANT STRING NEWLINE { SetXKBVariant($2); } ; trayicon: TRAYICON STRING NEWLINE { SetTrayIcon($2); free($2); } @@ -260,6 +299,58 @@ yyerror (char *s) return 1; } +static void +SetDPI (char *dpi) +{ + if (!g_cmdline.customDPI) + monitorResolution = atoi (dpi); +} + +static void +SetXKBLayout (char *layout) +{ + if (!g_cmdline.xkbLayout) + g_cmdline.xkbLayout = layout; + else + free (layout); +} + +static void +SetXKBModel (char *model) +{ + if (!g_cmdline.xkbModel) + g_cmdline.xkbModel = model; + else + free (model); +} + +static void +SetXKBOptions (char *options) +{ + if (!g_cmdline.xkbOptions) + g_cmdline.xkbOptions = options; + else + free (options); +} + +static void +SetXKBRules (char *rules) +{ + if (!g_cmdline.xkbRules) + g_cmdline.xkbRules = rules; + else + free (rules); +} + +static void +SetXKBVariant (char *variant) +{ + if (!g_cmdline.xkbVariant) + g_cmdline.xkbVariant = variant; + else + free (variant); +} + /* Miscellaneous functions to store TOKENs into the structure */ static void SetIconDirectory (char *path) diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c index 858be4a56..75e901c1a 100644 --- a/hw/xwin/winprocarg.c +++ b/hw/xwin/winprocarg.c @@ -31,6 +31,10 @@ from The Open Group. #include <xwin-config.h> #endif +#ifdef HAVE_SYS_UTSNAME_H +#include <sys/utsname.h> +#endif + #include <../xfree86/common/xorgVersion.h> #include "win.h" #include "winconfig.h" @@ -938,6 +942,14 @@ ddxProcessArgument(int argc, char *argv[], int i) } /* + * Look for the '-dpi' argument + */ + if (IS_OPTION("-dpi")) { + g_cmdline.customDPI = TRUE; + return 0; /* Let DIX parse this again */ + } + + /* * Look for the '-config' argument */ if (IS_OPTION("-config") @@ -1074,6 +1086,11 @@ ddxProcessArgument(int argc, char *argv[], int i) return 1; } + if (IS_OPTION("-hostintitle")) { + g_fHostInTitle = TRUE; + return 1; + } + return 0; } @@ -1145,6 +1162,100 @@ winLogCommandLine(int argc, char *argv[]) } /* + * Detect the OS + */ + +typedef BOOL(WINAPI * LPFN_ISWOW64PROCESS) (HANDLE, PBOOL); + +static void +winOS(void) +{ + OSVERSIONINFOEX osvi = { 0 }; + char *windowstype = "Unknown"; + char *prodName = "Unknown"; + char *isWow = "Unknown"; + LPFN_ISWOW64PROCESS fnIsWow64Process; + + /* Get operating system version information */ + osvi.dwOSVersionInfoSize = sizeof(osvi); + GetVersionEx((LPOSVERSIONINFO) & osvi); + + /* Branch on platform ID */ + switch (osvi.dwPlatformId) { + case VER_PLATFORM_WIN32_NT: + windowstype = "Windows NT"; + + if (osvi.dwMajorVersion <= 4) + prodName = "Windows NT"; + else if (osvi.dwMajorVersion == 6) { + if (osvi.dwMinorVersion == 2) { + if (osvi.wProductType == VER_NT_WORKSTATION) + prodName = "Windows 8"; + else + prodName = "Windows Server 2012"; + } + else if (osvi.dwMinorVersion == 1) { + if (osvi.wProductType == VER_NT_WORKSTATION) + prodName = "Windows 7"; + else + prodName = "Windows Server 2008 R2"; + } + else if (osvi.dwMinorVersion == 0) { + if (osvi.wProductType == VER_NT_WORKSTATION) + prodName = "Windows Vista"; + else + prodName = "Windows Server 2008"; + } + } + else if (osvi.dwMajorVersion == 5) { + if (osvi.dwMinorVersion == 2) { + if (GetSystemMetrics(SM_SERVERR2)) + prodName = "Windows Server 2003 R2"; + else + prodName = "Windows Server 2003"; + } + else if (osvi.dwMinorVersion == 1) + prodName = "Windows XP"; + else if (osvi.dwMinorVersion == 0) { + prodName = "Windows 2000"; + break; + } + } + + break; + + case VER_PLATFORM_WIN32_WINDOWS: + windowstype = "Windows"; + break; + } + + /* Check if we are running under WoW64 */ + fnIsWow64Process = + (LPFN_ISWOW64PROCESS) GetProcAddress(GetModuleHandle("kernel32"), + "IsWow64Process"); + if (NULL != fnIsWow64Process) { + wBOOL bIsWow64 = FALSE; + + if (fnIsWow64Process(GetCurrentProcess(), &bIsWow64)) { + isWow = bIsWow64 ? " (WoW64)" : " (Win32)"; + } + else { + /* IsWow64Process() failed */ + isWow = " (WoWUnknown)"; + } + } + else { + /* OS doesn't support IsWow64Process() */ + isWow = ""; + } + + ErrorF("OS: %s %s [%s %ld.%ld build %ld]%s\n", + prodName, osvi.szCSDVersion, + windowstype, osvi.dwMajorVersion, osvi.dwMinorVersion, + osvi.dwBuildNumber, isWow); +} + +/* * winLogVersionInfo - Log version information */ @@ -1161,8 +1272,18 @@ winLogVersionInfo(void) ErrorF("Vendor: %s\n", XVENDORNAME); ErrorF("Release: %d.%d.%d.%d\n", XORG_VERSION_MAJOR, XORG_VERSION_MINOR, XORG_VERSION_PATCH, XORG_VERSION_SNAP); +#ifdef HAVE_SYS_UTSNAME_H + { + struct utsname name; + + if (uname(&name) >= 0) { + ErrorF("OS: %s %s %s %s %s\n", name.sysname, name.nodename, + name.release, name.version, name.machine); + } + } +#endif + winOS(); if (strlen(BUILDERSTRING)) ErrorF("%s\n", BUILDERSTRING); - ErrorF("Contact: %s\n", BUILDERADDR); ErrorF("\n"); } diff --git a/hw/xwin/winrandr.c b/hw/xwin/winrandr.c index 1b340850c..5624e7563 100644 --- a/hw/xwin/winrandr.c +++ b/hw/xwin/winrandr.c @@ -104,7 +104,7 @@ winDoRandRScreenSetSize(ScreenPtr pScreen, SetRootClip(pScreen, TRUE); // and arrange for it to be repainted - miPaintWindow(pRoot, &pRoot->borderClip, PW_BACKGROUND); + pScreen->PaintWindow(pRoot, &pRoot->borderClip, PW_BACKGROUND); /* Indicate that a screen size change took place */ RRScreenSizeNotify(pScreen); diff --git a/hw/xwin/winscrinit.c b/hw/xwin/winscrinit.c index e776bdba6..f61b8e0a4 100644 --- a/hw/xwin/winscrinit.c +++ b/hw/xwin/winscrinit.c @@ -216,15 +216,19 @@ winScreenInit(ScreenPtr pScreen, int argc, char **argv) else winErrorFVerb(2, "winScreenInit - Using software cursor\n"); - /* - Note the screen origin in a normalized coordinate space where (0,0) is at the top left - of the native virtual desktop area - */ - pScreen->x = pScreenInfo->dwInitialX - GetSystemMetrics(SM_XVIRTUALSCREEN); - pScreen->y = pScreenInfo->dwInitialY - GetSystemMetrics(SM_YVIRTUALSCREEN); + if (!noPanoramiXExtension) { + /* + Note the screen origin in a normalized coordinate space where (0,0) is at the top left + of the native virtual desktop area + */ + pScreen->x = + pScreenInfo->dwInitialX - GetSystemMetrics(SM_XVIRTUALSCREEN); + pScreen->y = + pScreenInfo->dwInitialY - GetSystemMetrics(SM_YVIRTUALSCREEN); - ErrorF("Screen %d added at virtual desktop coordinate (%d,%d).\n", - pScreen->myNum, pScreen->x, pScreen->y); + ErrorF("Screen %d added at virtual desktop coordinate (%d,%d).\n", + pScreen->myNum, pScreen->x, pScreen->y); + } #if CYGDEBUG || YES winDebug("winScreenInit - returning\n"); diff --git a/hw/xwin/winwin32rootlesswndproc.c b/hw/xwin/winwin32rootlesswndproc.c index 13df18677..be2958338 100644 --- a/hw/xwin/winwin32rootlesswndproc.c +++ b/hw/xwin/winwin32rootlesswndproc.c @@ -649,13 +649,13 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) if (pScreenPriv == NULL || pScreenInfo->fIgnoreInput) break; SetCapture(hwnd); - return winMouseButtonsHandle(pScreen, ButtonPress, HIWORD(wParam) + 5, + return winMouseButtonsHandle(pScreen, ButtonPress, HIWORD(wParam) + 7, wParam); case WM_XBUTTONUP: if (pScreenPriv == NULL || pScreenInfo->fIgnoreInput) break; ReleaseCapture(); - return winMouseButtonsHandle(pScreen, ButtonRelease, HIWORD(wParam) + 5, + return winMouseButtonsHandle(pScreen, ButtonRelease, HIWORD(wParam) + 7, wParam); case WM_MOUSEWHEEL: @@ -667,6 +667,15 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) SendMessage(hwndScreen, message, wParam, lParam); return 0; + case WM_MOUSEHWHEEL: +#if CYGMULTIWINDOW_DEBUG + winDebug("winMWExtWMWindowProc - WM_MOUSEHWHEEL\n"); +#endif + + /* Pass the message to the root window */ + SendMessage(hwndScreen, message, wParam, lParam); + return 0; + case WM_MOUSEACTIVATE: #if CYGMULTIWINDOW_DEBUG winDebug("winMWExtWMWindowProc - WM_MOUSEACTIVATE\n"); diff --git a/hw/xwin/winwindow.h b/hw/xwin/winwindow.h index 25826ecc7..431a127ee 100644 --- a/hw/xwin/winwindow.h +++ b/hw/xwin/winwindow.h @@ -49,6 +49,8 @@ #define WINDOW_TITLE_XDMCP "%s:%s.%d" #define WIN_SCR_PROP "cyg_screen_prop rl" #define WINDOW_CLASS_X "cygwin/x X rl" +#define WINDOW_CLASS_X_CHILD "cygwin/x X child" +#define WINDOW_CLASS_X_MSG "cygwin/x X msg" #define WINDOW_TITLE_X PROJECT_NAME " X" #define WIN_WINDOW_PROP "cyg_window_prop_rl" #ifdef HAS_DEVWINDOWS diff --git a/hw/xwin/winwndproc.c b/hw/xwin/winwndproc.c index 7ba028042..906055fd4 100644 --- a/hw/xwin/winwndproc.c +++ b/hw/xwin/winwndproc.c @@ -42,6 +42,7 @@ #include "winmsg.h" #include "winmonitors.h" #include "inputstr.h" +#include "wmutil/mouse.h" /* * Global variables @@ -896,7 +897,7 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) #endif ) SetCapture(hwnd); - return winMouseButtonsHandle(s_pScreen, ButtonPress, HIWORD(wParam) + 5, + return winMouseButtonsHandle(s_pScreen, ButtonPress, HIWORD(wParam) + 7, wParam); case WM_XBUTTONUP: if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput) @@ -908,7 +909,7 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) ) ReleaseCapture(); return winMouseButtonsHandle(s_pScreen, ButtonRelease, - HIWORD(wParam) + 5, wParam); + HIWORD(wParam) + 7, wParam); case WM_TIMER: if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput) @@ -918,7 +919,7 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) switch (wParam) { case WIN_E3B_TIMER_ID: /* Send delayed button press */ - winMouseButtonsSendEvent(ButtonPress, + winMouseButtonsSendEvent(TRUE, s_pScreenPriv->iE3BCachedPress); /* Kill this timer */ @@ -978,7 +979,20 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) #if CYGDEBUG winDebug("winWindowProc - WM_MOUSEWHEEL\n"); #endif - winMouseWheel(s_pScreen, GET_WHEEL_DELTA_WPARAM(wParam)); + /* Button4 = WheelUp */ + /* Button5 = WheelDown */ + winMouseWheel(&(s_pScreenPriv->iDeltaZ), GET_WHEEL_DELTA_WPARAM(wParam), Button4, Button5); + break; + + case WM_MOUSEHWHEEL: + if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput) + break; +#if CYGDEBUG + winDebug("winWindowProc - WM_MOUSEHWHEEL\n"); +#endif + /* Button7 = TiltRight */ + /* Button6 = TiltLeft */ + winMouseWheel(&(s_pScreenPriv->iDeltaV), GET_WHEEL_DELTA_WPARAM(wParam), 7, 6); break; case WM_SETFOCUS: @@ -1066,7 +1080,7 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) } /* Translate Windows key code to X scan code */ - winTranslateKey(wParam, lParam, &iScanCode); + iScanCode = winTranslateKey(wParam, lParam); /* Ignore repeats for CapsLock */ if (wParam == VK_CAPITAL) @@ -1095,7 +1109,7 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) return 0; /* Enqueue a keyup event */ - winTranslateKey(wParam, lParam, &iScanCode); + iScanCode = winTranslateKey(wParam, lParam); winSendKeyEvent(iScanCode, FALSE); /* Release all pressed shift keys */ @@ -1149,6 +1163,7 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) /* Clear any lingering wheel delta */ s_pScreenPriv->iDeltaZ = 0; + s_pScreenPriv->iDeltaV = 0; /* Reshow the Windows mouse cursor if we are being deactivated */ if (g_fSoftwareCursor && LOWORD(wParam) == WA_INACTIVE && !g_fCursor) { @@ -1223,7 +1238,6 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) } break; - case WM_ENDSESSION: case WM_GIVEUP: /* Tell X that we are giving up */ #ifdef XWIN_MULTIWINDOW diff --git a/hw/xwin/wmutil/Makefile.am b/hw/xwin/wmutil/Makefile.am new file mode 100644 index 000000000..5ccee32a6 --- /dev/null +++ b/hw/xwin/wmutil/Makefile.am @@ -0,0 +1,24 @@ +lib_LTLIBRARIES = libXWinWMUtil.la + +library_includedir=$(includedir)/XWinWMUtil + +library_include_HEADERS = \ + icon_convert.h \ + cursor_convert.h \ + mouse.h \ + keyboard.h + +libXWinWMUtil_la_SOURCES = \ + icon_convert.c \ + cursor_convert.c \ + mouse.c \ + keyboard.c \ + winvkmap.h \ + scancodes.h + +AM_CFLAGS = -DHAVE_XWIN_CONFIG_H \ + $(DIX_CFLAGS) \ + $(XWINMODULES_CFLAGS) \ + -I$(top_srcdir) -I$(top_srcdir)/miext/rootless -I$(srcdir)/.. + +libXWinWMUtil_la_LDFLAGS = -static diff --git a/hw/xwin/wmutil/cursor_convert.c b/hw/xwin/wmutil/cursor_convert.c new file mode 100644 index 000000000..118d9e849 --- /dev/null +++ b/hw/xwin/wmutil/cursor_convert.c @@ -0,0 +1,353 @@ +/* + *Copyright (C) 1994-2000 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. + * + * Authors: Dakshinamurthy Karra + * Suhaib M Siddiqi + * Peter Busch + * Harold L Hunt II + */ + +#ifdef HAVE_XWIN_CONFIG_H +#include <xwin-config.h> +#endif + +#include <X11/Xwindows.h> + +#include "win.h" +#include "winmsg.h" +#include <cursorstr.h> + +#include "cursor_convert.h" + +#define BRIGHTNESS(x) (x##Red * 0.299 + x##Green * 0.587 + x##Blue * 0.114) + +#if 1 +#define WIN_DEBUG_MSG winDebug +#else +#define WIN_DEBUG_MSG(...) +#endif + +static unsigned char +reverse(unsigned char c) +{ + int i; + unsigned char ret = 0; + + for (i = 0; i < 8; ++i) { + ret |= ((c >> i) & 1) << (7 - i); + } + return ret; +} + +/* + * Convert X cursor to Windows cursor + * FIXME: Perhaps there are more smart code + */ +HCURSOR +winXCursorToHCURSOR(WMUTIL_CURSOR *pCursor) +{ + HCURSOR hCursor = NULL; + unsigned char *pAnd; + unsigned char *pXor; + int nCX, nCY; + int nBytes; + double dForeY, dBackY; + BOOL fReverse; + HBITMAP hAnd, hXor; + ICONINFO ii; + unsigned char *pCur; + unsigned char bit; + HDC hDC; + BITMAPV4HEADER bi; + BITMAPINFO *pbmi; + unsigned long *lpBits; + + int sm_cx = GetSystemMetrics(SM_CXCURSOR); + int sm_cy = GetSystemMetrics(SM_CYCURSOR); + + WIN_DEBUG_MSG("winXCursorToHCURSOR: Win32 size: %dx%d X11 size: %dx%d hotspot: %d,%d\n", + sm_cx, sm_cy, + pCursor->width, pCursor->height, + pCursor->xhot, pCursor->yhot); + + /* We can use only White and Black, so calc brightness of color + * Also check if the cursor is inverted */ + dForeY = BRIGHTNESS(pCursor->fore); + dBackY = BRIGHTNESS(pCursor->back); + fReverse = dForeY < dBackY; + + /* Check whether the X11 cursor is bigger than the win32 cursor */ + if (sm_cx < pCursor->width || + sm_cy < pCursor->height) { + winError("winXCursorToHCURSOR - Windows requires %dx%d cursor but X requires %dx%d\n", + sm_cx, sm_cy, + pCursor->width, pCursor->height); + } + + /* Get the number of bytes required to store the whole cursor image + * This is roughly (sm_cx * sm_cy) / 8 + * round up to 8 pixel boundary so we can convert whole bytes */ + nBytes = + bits_to_bytes(sm_cx) * sm_cy; + + /* Get the effective width and height */ + nCX = min(sm_cx, pCursor->width); + nCY = min(sm_cy, pCursor->height); + + /* Allocate memory for the bitmaps */ + pAnd = malloc(nBytes); + memset(pAnd, 0xFF, nBytes); + pXor = calloc(1, nBytes); + memset(pXor, 0x00, nBytes); + + /* prepare the pointers */ + hCursor = NULL; + lpBits = NULL; + + /* We have a truecolor alpha-blended cursor and can use it! */ + if (pCursor->argb) { + WIN_DEBUG_MSG("winXCursorToHCURSOR: Trying truecolor alphablended cursor\n"); + memset(&bi, 0, sizeof(BITMAPV4HEADER)); + bi.bV4Size = sizeof(BITMAPV4HEADER); + bi.bV4Width = sm_cx; + bi.bV4Height = -(sm_cy); /* right-side up */ + bi.bV4Planes = 1; + bi.bV4BitCount = 32; + bi.bV4V4Compression = BI_BITFIELDS; + bi.bV4RedMask = 0x00FF0000; + bi.bV4GreenMask = 0x0000FF00; + bi.bV4BlueMask = 0x000000FF; + bi.bV4AlphaMask = 0xFF000000; + + lpBits = + (unsigned long *) calloc(sm_cx * + sm_cy, + sizeof(unsigned long)); + + if (lpBits) { + int y; + for (y = 0; y < nCY; y++) { + unsigned long *src, *dst; + + src = &(pCursor->argb[y * pCursor->width]); + dst = &(lpBits[y * sm_cx]); + memcpy(dst, src, 4 * nCX); + } + } + } /* End if-truecolor-icon */ + else + { + /* Convert the X11 bitmap to a win32 bitmap + * The first is for an empty mask */ + if (pCursor->emptyMask) { + int x, y, xmax = bits_to_bytes(nCX); + + for (y = 0; y < nCY; ++y) + for (x = 0; x < xmax; ++x) { + int nWinPix = bits_to_bytes(sm_cx) * y + x; + int nXPix = BitmapBytePad(pCursor->width) * y + x; + + pAnd[nWinPix] = 0; + if (fReverse) + pXor[nWinPix] = reverse(~pCursor->source[nXPix]); + else + pXor[nWinPix] = reverse(pCursor->source[nXPix]); + } + } + else { + int x, y, xmax = bits_to_bytes(nCX); + + for (y = 0; y < nCY; ++y) + for (x = 0; x < xmax; ++x) { + int nWinPix = bits_to_bytes(sm_cx) * y + x; + int nXPix = BitmapBytePad(pCursor->width) * y + x; + + unsigned char mask = pCursor->mask[nXPix]; + + pAnd[nWinPix] = reverse(~mask); + if (fReverse) + pXor[nWinPix] = + reverse(~pCursor->source[nXPix] & mask); + else + pXor[nWinPix] = + reverse(pCursor->source[nXPix] & mask); + } + } + } + + if (!lpBits) { + /* Bicolor, use a palettized DIB */ + WIN_DEBUG_MSG("winXCursorToHCURSOR: Trying two color cursor\n"); + pbmi = (BITMAPINFO *) &bi; + memset(pbmi, 0, sizeof(BITMAPINFOHEADER)); + pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + pbmi->bmiHeader.biWidth = sm_cx; + pbmi->bmiHeader.biHeight = -abs(sm_cy); /* right-side up */ + pbmi->bmiHeader.biPlanes = 1; + pbmi->bmiHeader.biBitCount = 8; + pbmi->bmiHeader.biCompression = BI_RGB; + pbmi->bmiHeader.biSizeImage = 0; + pbmi->bmiHeader.biClrUsed = 3; + pbmi->bmiHeader.biClrImportant = 3; + pbmi->bmiColors[0].rgbRed = 0; /* Empty */ + pbmi->bmiColors[0].rgbGreen = 0; + pbmi->bmiColors[0].rgbBlue = 0; + pbmi->bmiColors[0].rgbReserved = 0; + pbmi->bmiColors[1].rgbRed = pCursor->backRed >> 8; /* Background */ + pbmi->bmiColors[1].rgbGreen = pCursor->backGreen >> 8; + pbmi->bmiColors[1].rgbBlue = pCursor->backBlue >> 8; + pbmi->bmiColors[1].rgbReserved = 0; + pbmi->bmiColors[2].rgbRed = pCursor->foreRed >> 8; /* Foreground */ + pbmi->bmiColors[2].rgbGreen = pCursor->foreGreen >> 8; + pbmi->bmiColors[2].rgbBlue = pCursor->foreBlue >> 8; + pbmi->bmiColors[2].rgbReserved = 0; + + lpBits = + (unsigned long *) calloc(sm_cx * + sm_cy, sizeof(char)); + + pCur = (unsigned char *) lpBits; + if (lpBits) { + int x, y; + for (y = 0; y < sm_cy; y++) { + for (x = 0; x < sm_cx; x++) { + if (x >= nCX || y >= nCY) /* Outside of X11 icon bounds */ + (*pCur++) = 0; + else { /* Within X11 icon bounds */ + + int nWinPix = + bits_to_bytes(sm_cx) * y + + (x / 8); + + bit = pAnd[nWinPix]; + bit = bit & (1 << (7 - (x & 7))); + if (!bit) { /* Within the cursor mask? */ + int nXPix = + BitmapBytePad(pCursor->width) * y + + (x / 8); + bit = + ~reverse(~pCursor-> + source[nXPix] & pCursor-> + mask[nXPix]); + bit = bit & (1 << (7 - (x & 7))); + if (bit) /* Draw foreground */ + (*pCur++) = 2; + else /* Draw background */ + (*pCur++) = 1; + } + else /* Outside the cursor mask */ + (*pCur++) = 0; + } + } /* end for (x) */ + } /* end for (y) */ + } /* end if (lpbits) */ + } + + /* If one of the previous two methods gave us the bitmap we need, make a cursor */ + if (lpBits) { + WIN_DEBUG_MSG("winXCursorToHCURSOR: Creating bitmap cursor\n"); + + hAnd = NULL; + hXor = NULL; + + hAnd = + CreateBitmap(sm_cx, sm_cy, + 1, 1, pAnd); + + hDC = GetDC(NULL); + if (hDC) { + hXor = + CreateCompatibleBitmap(hDC, sm_cx, + sm_cy); + SetDIBits(hDC, hXor, 0, sm_cy, lpBits, + (BITMAPINFO *) &bi, DIB_RGB_COLORS); + ReleaseDC(NULL, hDC); + } + free(lpBits); + + if (hAnd && hXor) { + ii.fIcon = FALSE; + ii.xHotspot = pCursor->xhot; + ii.yHotspot = pCursor->yhot; + ii.hbmMask = hAnd; + ii.hbmColor = hXor; + hCursor = (HCURSOR) CreateIconIndirect(&ii); + + if (hCursor == NULL) + winError("winXCursorToHCURSOR - CreateIconIndirect failed: %x", GetLastError()); + else { + /* + Apparently, CreateIconIndirect() sometimes creates an Icon instead of a Cursor. + This breaks the hotspot and makes the cursor unusable. Discard the broken cursor + and revert to simple b&w cursor. (Seen on W2K in 2004...) + */ + if (GetIconInfo(hCursor, &ii)) { + if (ii.fIcon) { + winError + ("winXCursorToHCURSOR: CreateIconIndirect made an icon, not a cursor. Trying again.\n"); + + DestroyCursor(hCursor); + + ii.fIcon = FALSE; + ii.xHotspot = pCursor->xhot; + ii.yHotspot = pCursor->yhot; + hCursor = (HCURSOR) CreateIconIndirect(&ii); + + if (hCursor == NULL) + winError("winXCursorToHCURSOR - CreateIconIndirect failed: %x", GetLastError()); + } + /* GetIconInfo creates new bitmaps. Destroy them again */ + if (ii.hbmMask) + DeleteObject(ii.hbmMask); + if (ii.hbmColor) + DeleteObject(ii.hbmColor); + } + } + } + + if (hAnd) + DeleteObject(hAnd); + if (hXor) + DeleteObject(hXor); + } + + if (!hCursor) { + WIN_DEBUG_MSG("winXCursorToHCURSOR: Creating b&w cursor\n"); + /* We couldn't make a color cursor for this screen, use + black and white instead */ + hCursor = CreateCursor(GetModuleHandle(NULL), + pCursor->xhot, pCursor->yhot, + sm_cx, + sm_cy, pAnd, pXor); + if (hCursor == NULL) + winError("winXCursorToHCURSOR - CreateCursor failed: %x", GetLastError()); + } + free(pAnd); + free(pXor); + + return hCursor; +} diff --git a/hw/xwin/wmutil/cursor_convert.h b/hw/xwin/wmutil/cursor_convert.h new file mode 100644 index 000000000..a5ddba3c2 --- /dev/null +++ b/hw/xwin/wmutil/cursor_convert.h @@ -0,0 +1,54 @@ +/* + * File: cursor_convert.h + * Purpose: interface for X->Windows cursor conversion + * + * Copyright (c) Jon TURNEY 2012 + * + * 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. + */ + +#ifndef WMUTILS_CURSOR_H +#define WMUTILS_CURSOR_H + +#include <stdbool.h> +#include <stdint.h> + +typedef struct _WMUTIL_CURSOR +{ + // this is the data for cursor created with RENDER CreateCusor or read + // with XFIXES GetCursorImage + int width; + int height; + int xhot; + int yhot; + uint32_t *argb; + + // for a core CreateCursor, we might need the following... + unsigned char *source; + unsigned char *mask; + bool emptyMask; + unsigned short foreRed, foreGreen, foreBlue; + unsigned short backRed, backGreen, backBlue; + +} WMUTIL_CURSOR; + +HCURSOR +winXCursorToHCURSOR(WMUTIL_CURSOR *cursordata); + +#endif /* WMUTILS_CURSOR_H */ diff --git a/hw/xwin/wmutil/icon_convert.c b/hw/xwin/wmutil/icon_convert.c new file mode 100644 index 000000000..a2576304f --- /dev/null +++ b/hw/xwin/wmutil/icon_convert.c @@ -0,0 +1,553 @@ +/* + *Copyright (C) 1994-2000 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. + * + * Authors: Earle F. Philhower, III + */ + +#ifdef HAVE_XWIN_CONFIG_H +#include <xwin-config.h> +#endif + +#ifndef WINVER +#define WINVER 0x0500 +#endif + +#include <xcb/xcb.h> +#include <xcb/xcb_icccm.h> +#include <xcb/xcb_image.h> + +#include <windows.h> + +#include <limits.h> +#include <stdbool.h> + +#include "icon_convert.h" + +/* + * global variables + */ +extern int serverGeneration; + +/* + * Scale an X icon ZPixmap into a Windoze icon bitmap + */ + +static void +winScaleXImageToWindowsIcon(int iconSize, + int effBPP, + int stride, xcb_image_t* pixmap, unsigned char *image) +{ + int row, column, effXBPP, effXDepth; + unsigned char *outPtr; + unsigned char *iconData = 0; + int xStride; + float factX, factY; + int posX, posY; + unsigned char *ptr; + unsigned int zero; + unsigned int color; + + effXBPP = pixmap->bpp; + if (pixmap->bpp == 15) + effXBPP = 16; + + effXDepth = pixmap->depth; + if (pixmap->depth == 15) + effXDepth = 16; + + xStride = pixmap->stride; + if (stride == 0 || xStride == 0) { + winError("winScaleXBitmapToWindows - stride or xStride is zero. " + "Bailing.\n"); + return; + } + + /* Get icon data */ + iconData = (unsigned char *) pixmap->data; + + /* Keep aspect ratio */ + factX = ((float) pixmap->width) / ((float) iconSize); + factY = ((float) pixmap->height) / ((float) iconSize); + if (factX > factY) + factY = factX; + else + factX = factY; + + /* Out-of-bounds, fill icon with zero */ + zero = 0; + + for (row = 0; row < iconSize; row++) { + outPtr = image + stride * row; + for (column = 0; column < iconSize; column++) { + posX = factX * column; + posY = factY * row; + + ptr = (unsigned char *) iconData + posY * xStride; + if (effXBPP == 1) { + ptr += posX / 8; + + /* Out of X icon bounds, leave space blank */ + if (posX >= pixmap->width || posY >= pixmap->height) + ptr = (unsigned char *) &zero; + + if ((*ptr) & (1 << (posX & 7))) + switch (effBPP) { + case 32: + *(outPtr++) = 0; + case 24: + *(outPtr++) = 0; + case 16: + *(outPtr++) = 0; + case 8: + *(outPtr++) = 0; + break; + case 1: + outPtr[column / 8] &= ~(1 << (7 - (column & 7))); + break; + } + else + switch (effBPP) { + case 32: + *(outPtr++) = 255; + *(outPtr++) = 255; + *(outPtr++) = 255; + *(outPtr++) = 0; + break; + case 24: + *(outPtr++) = 255; + case 16: + *(outPtr++) = 255; + case 8: + *(outPtr++) = 255; + break; + case 1: + outPtr[column / 8] |= (1 << (7 - (column & 7))); + break; + } + } + else if (effXDepth == 24 || effXDepth == 32) { + ptr += posX * (effXBPP / 8); + + /* Out of X icon bounds, leave space blank */ + if (posX >= pixmap->width || posY >= pixmap->height) + ptr = (unsigned char *) &zero; + color = (((*ptr) << 16) + + ((*(ptr + 1)) << 8) + + ((*(ptr + 2)) << 0)); + switch (effBPP) { + case 32: + *(outPtr++) = *(ptr++); /* b */ + *(outPtr++) = *(ptr++); /* g */ + *(outPtr++) = *(ptr++); /* r */ + *(outPtr++) = (effXDepth == 32) ? *(ptr++) : 0x0; /* alpha */ + break; + case 24: + *(outPtr++) = *(ptr++); + *(outPtr++) = *(ptr++); + *(outPtr++) = *(ptr++); + break; + case 16: + color = ((((*ptr) >> 2) << 10) + + (((*(ptr + 1)) >> 2) << 5) + + (((*(ptr + 2)) >> 2))); + *(outPtr++) = (color >> 8); + *(outPtr++) = (color & 255); + break; + case 8: + color = (((*ptr))) + (((*(ptr + 1)))) + (((*(ptr + 2)))); + color /= 3; + *(outPtr++) = color; + break; + case 1: + if (color) + outPtr[column / 8] |= (1 << (7 - (column & 7))); + else + outPtr[column / 8] &= ~(1 << (7 - (column & 7))); + } + } + else if (effXDepth == 16) { + ptr += posX * (effXBPP / 8); + + /* Out of X icon bounds, leave space blank */ + if (posX >= pixmap->width || posY >= pixmap->height) + ptr = (unsigned char *) &zero; + color = ((*ptr) << 8) + (*(ptr + 1)); + switch (effBPP) { + case 32: + *(outPtr++) = (color & 31) << 2; + *(outPtr++) = ((color >> 5) & 31) << 2; + *(outPtr++) = ((color >> 10) & 31) << 2; + *(outPtr++) = 0; /* resvd */ + break; + case 24: + *(outPtr++) = (color & 31) << 2; + *(outPtr++) = ((color >> 5) & 31) << 2; + *(outPtr++) = ((color >> 10) & 31) << 2; + break; + case 16: + *(outPtr++) = *(ptr++); + *(outPtr++) = *(ptr++); + break; + case 8: + *(outPtr++) = (((color & 31) + + ((color >> 5) & 31) + + ((color >> 10) & 31)) / 3) << 2; + break; + case 1: + if (color) + outPtr[column / 8] |= (1 << (7 - (column & 7))); + else + outPtr[column / 8] &= ~(1 << (7 - (column & 7))); + break; + } /* end switch(effbpp) */ + } /* end if effxbpp==16) */ + } /* end for column */ + } /* end for row */ +} + +static HICON +NetWMToWinIconAlpha(uint32_t * icon) +{ + int width = icon[0]; + int height = icon[1]; + uint32_t *pixels = &icon[2]; + HICON result; + HDC hdc = GetDC(NULL); + uint32_t *DIB_pixels; + ICONINFO ii; + BITMAPV4HEADER bmh = { sizeof(bmh) }; + + /* Define an ARGB pixel format used for Color+Alpha icons */ + bmh.bV4Width = width; + bmh.bV4Height = -height; /* Invert the image */ + bmh.bV4Planes = 1; + bmh.bV4BitCount = 32; + bmh.bV4V4Compression = BI_BITFIELDS; + bmh.bV4AlphaMask = 0xFF000000; + bmh.bV4RedMask = 0x00FF0000; + bmh.bV4GreenMask = 0x0000FF00; + bmh.bV4BlueMask = 0x000000FF; + + ii.fIcon = TRUE; + ii.xHotspot = 0; /* ignored */ + ii.yHotspot = 0; /* ignored */ + ii.hbmColor = CreateDIBSection(hdc, (BITMAPINFO *) &bmh, + DIB_RGB_COLORS, (void **) &DIB_pixels, NULL, + 0); + ReleaseDC(NULL, hdc); + ii.hbmMask = CreateBitmap(width, height, 1, 1, NULL); + memcpy(DIB_pixels, pixels, height * width * 4); + + /* CreateIconIndirect() traditionally required DDBitmaps */ + /* Systems from WinXP accept 32-bit ARGB DIBitmaps with full 8-bit alpha support */ + /* The icon is created with a DIB + empty DDB mask (an MS example does the same) */ + result = CreateIconIndirect(&ii); + + DeleteObject(ii.hbmColor); + DeleteObject(ii.hbmMask); + + winDebug("NetWMToWinIconAlpha - %d x %d = %p\n", icon[0], icon[1], result); + return result; +} + +static HICON +NetWMToWinIconThreshold(uint32_t * icon) +{ + int width = icon[0]; + int height = icon[1]; + uint32_t *pixels = &icon[2]; + int row, col; + HICON result; + ICONINFO ii; + + HDC hdc = GetDC(NULL); + HDC xorDC = CreateCompatibleDC(hdc); + HDC andDC = CreateCompatibleDC(hdc); + + ii.fIcon = TRUE; + ii.xHotspot = 0; /* ignored */ + ii.yHotspot = 0; /* ignored */ + ii.hbmColor = CreateCompatibleBitmap(hdc, width, height); + ii.hbmMask = CreateCompatibleBitmap(hdc, width, height); + ReleaseDC(NULL, hdc); + SelectObject(xorDC, ii.hbmColor); + SelectObject(andDC, ii.hbmMask); + + for (row = 0; row < height; row++) { + for (col = 0; col < width; col++) { + if ((*pixels & 0xFF000000) > 31 << 24) { /* 31 alpha threshold, i.e. opaque above, transparent below */ + SetPixelV(xorDC, col, row, + RGB(((char *) pixels)[2], ((char *) pixels)[1], + ((char *) pixels)[0])); + SetPixelV(andDC, col, row, RGB(0, 0, 0)); /* black mask */ + } + else { + SetPixelV(xorDC, col, row, RGB(0, 0, 0)); + SetPixelV(andDC, col, row, RGB(255, 255, 255)); /* white mask */ + } + pixels++; + } + } + DeleteDC(xorDC); + DeleteDC(andDC); + + result = CreateIconIndirect(&ii); + + DeleteObject(ii.hbmColor); + DeleteObject(ii.hbmMask); + + winDebug("NetWMToWinIconThreshold - %d x %d = %p\n", icon[0], icon[1], + result); + return result; +} + +static HICON +NetWMToWinIcon(int bpp, uint32_t * icon) +{ + static bool hasIconAlphaChannel = FALSE; + static bool versionChecked = FALSE; + + if (!versionChecked) { + OSVERSIONINFOEX osvi = { 0 }; + ULONGLONG dwlConditionMask = 0; + + osvi.dwOSVersionInfoSize = sizeof(osvi); + osvi.dwMajorVersion = 5; + osvi.dwMinorVersion = 1; + + /* Windows versions later than XP have icon alpha channel suport, 2000 does not */ + VER_SET_CONDITION(dwlConditionMask, VER_MAJORVERSION, + VER_GREATER_EQUAL); + VER_SET_CONDITION(dwlConditionMask, VER_MINORVERSION, + VER_GREATER_EQUAL); + hasIconAlphaChannel = + VerifyVersionInfo(&osvi, VER_MAJORVERSION | VER_MINORVERSION, + dwlConditionMask); + versionChecked = TRUE; + + winError("OS has icon alpha channel support: %s\n", + hasIconAlphaChannel ? "yes" : "no"); + } + + if (hasIconAlphaChannel && (bpp == 32)) + return NetWMToWinIconAlpha(icon); + else + return NetWMToWinIconThreshold(icon); +} + +/* + * Attempt to create a custom icon from the WM_HINTS bitmaps + */ + +HICON +winXIconToHICON(xcb_connection_t *conn, xcb_window_t id, int iconSize) +{ + unsigned char *mask, *image = NULL, *imageMask; + unsigned char *dst, *src; + int planes, bpp, i; + int biggest_size = 0; + HDC hDC; + ICONINFO ii; + xcb_icccm_wm_hints_t hints; + HICON hIcon = NULL; + uint32_t *biggest_icon = NULL; + + static xcb_atom_t _XA_NET_WM_ICON; + static int generation; + uint32_t *icon, *icon_data = NULL; + unsigned long int size; + unsigned long int type; + int format; + unsigned long int left; + + hDC = GetDC(GetDesktopWindow()); + planes = GetDeviceCaps(hDC, PLANES); + bpp = GetDeviceCaps(hDC, BITSPIXEL); + ReleaseDC(GetDesktopWindow(), hDC); + + /* Always prefer _NET_WM_ICON icons */ + if (generation != serverGeneration) { + generation = serverGeneration; + + xcb_intern_atom_reply_t *atom_reply; + xcb_intern_atom_cookie_t atom_cookie; + const char *atomName = "_NET_WM_ICON"; + + _XA_NET_WM_ICON = XCB_NONE; + + atom_cookie = xcb_intern_atom(conn, 0, strlen(atomName), atomName); + atom_reply = xcb_intern_atom_reply(conn, atom_cookie, NULL); + if (atom_reply) { + _XA_NET_WM_ICON = atom_reply->atom; + free(atom_reply); + } + } + + xcb_get_property_cookie_t cookie = xcb_get_property(conn, FALSE, id, _XA_NET_WM_ICON, XCB_ATOM_CARDINAL, 0L, INT_MAX); + xcb_get_property_reply_t *reply = xcb_get_property_reply(conn, cookie, NULL); + + if (reply && + ((icon_data = xcb_get_property_value(reply)) != NULL)) { + size = xcb_get_property_value_length(reply)/sizeof(uint32_t); + for (icon = icon_data; icon < &icon_data[size] && *icon; + icon = &icon[icon[0] * icon[1] + 2]) { + /* Find an exact match to the size we require... */ + if (icon[0] == iconSize && icon[1] == iconSize) { + winDebug("winXIconToHICON: found %lu x %lu NetIcon\n", icon[0], + icon[1]); + hIcon = NetWMToWinIcon(bpp, icon); + break; + } + /* Otherwise, find the biggest icon and let Windows scale the size */ + else if (biggest_size < icon[0]) { + biggest_icon = icon; + biggest_size = icon[0]; + } + } + + if (!hIcon && biggest_icon) { + winDebug + ("winXIconToHICON: selected %lu x %lu NetIcon for scaling to %u x %u\n", + biggest_icon[0], biggest_icon[1], iconSize, iconSize); + + hIcon = NetWMToWinIcon(bpp, biggest_icon); + } + + free(reply); + } + + if (!hIcon) { + winDebug("winXIconToHICON: no suitable NetIcon\n"); + + xcb_get_property_cookie_t wm_hints_cookie = xcb_icccm_get_wm_hints(conn, id); + if (xcb_icccm_get_wm_hints_reply(conn, wm_hints_cookie, &hints, NULL)) { + winDebug("winXIconToHICON: id 0x%x icon_pixmap hint %x\n", id, + hints.icon_pixmap); + + if (hints.icon_pixmap) { + unsigned int width, height; + xcb_image_t *xImageIcon; + xcb_image_t *xImageMask = NULL; + + xcb_get_geometry_cookie_t geom_cookie = xcb_get_geometry(conn, hints.icon_pixmap); + xcb_get_geometry_reply_t *geom_reply = xcb_get_geometry_reply(conn, geom_cookie, NULL); + + if (geom_reply) { + width = geom_reply->width; + height = geom_reply->height; + + xImageIcon = xcb_image_get(conn, hints.icon_pixmap, + 0, 0, width, height, + 0xFFFFFF, XCB_IMAGE_FORMAT_Z_PIXMAP); + + winDebug("winXIconToHICON: id 0x%x icon Ximage 0x%x\n", id, + xImageIcon); + + if (hints.icon_mask) + xImageMask = xcb_image_get(conn, hints.icon_mask, + 0, 0, width, height, + 0xFFFFFFFF, XCB_IMAGE_FORMAT_Z_PIXMAP); + + if (xImageIcon) { + int effBPP, stride, maskStride; + + /* 15 BPP is really 16BPP as far as we care */ + if (bpp == 15) + effBPP = 16; + else + effBPP = bpp; + + /* Need 16-bit aligned rows for DDBitmaps */ + stride = ((iconSize * effBPP + 15) & (~15)) / 8; + + /* Mask is 1-bit deep */ + maskStride = ((iconSize * 1 + 15) & (~15)) / 8; + + image = malloc(stride * iconSize); + imageMask = malloc(stride * iconSize); + mask = malloc(maskStride * iconSize); + + /* Default to a completely black mask */ + memset(imageMask, 0, stride * iconSize); + memset(mask, 0, maskStride * iconSize); + + winScaleXImageToWindowsIcon(iconSize, effBPP, stride, + xImageIcon, image); + + if (xImageMask) { + winScaleXImageToWindowsIcon(iconSize, 1, maskStride, + xImageMask, mask); + winScaleXImageToWindowsIcon(iconSize, effBPP, stride, + xImageMask, imageMask); + } + + /* Now we need to set all bits of the icon which are not masked */ + /* on to 0 because Color is really an XOR, not an OR function */ + dst = image; + src = imageMask; + + for (i = 0; i < (stride * iconSize); i++) + if ((*(src++))) + *(dst++) = 0; + else + dst++; + + ii.fIcon = TRUE; + ii.xHotspot = 0; /* ignored */ + ii.yHotspot = 0; /* ignored */ + + /* Create Win32 mask from pixmap shape */ + ii.hbmMask = + CreateBitmap(iconSize, iconSize, planes, 1, mask); + + /* Create Win32 bitmap from pixmap */ + ii.hbmColor = + CreateBitmap(iconSize, iconSize, planes, bpp, image); + + /* Merge Win32 mask and bitmap into icon */ + hIcon = CreateIconIndirect(&ii); + + /* Release Win32 mask and bitmap */ + DeleteObject(ii.hbmMask); + DeleteObject(ii.hbmColor); + + /* Free X mask and bitmap */ + free(mask); + free(image); + free(imageMask); + + if (xImageMask) + xcb_image_destroy(xImageMask); + + xcb_image_destroy(xImageIcon); + } + } + } + } + } + return hIcon; +} diff --git a/hw/xwin/wmutil/icon_convert.h b/hw/xwin/wmutil/icon_convert.h new file mode 100644 index 000000000..0065326be --- /dev/null +++ b/hw/xwin/wmutil/icon_convert.h @@ -0,0 +1,34 @@ +/* + * File: icons.h + * Purpose: interface for X->Windows icon conversion + * + * Copyright (c) Jon TURNEY 2012 + * + * 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. + */ + +#ifndef WMUTILS_ICONS_H +#define WMUTILS_ICONS_H + +#include <xcb/xcb.h> + +HICON +winXIconToHICON(xcb_connection_t *conn, xcb_window_t id, int iconSize); + +#endif /* WMUTILS_ICONS_H */ diff --git a/hw/xwin/wmutil/keyboard.c b/hw/xwin/wmutil/keyboard.c new file mode 100644 index 000000000..e4d0bc61b --- /dev/null +++ b/hw/xwin/wmutil/keyboard.c @@ -0,0 +1,308 @@ +/* + *Copyright (C) 1994-2000 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. + * + * Authors: Dakshinamurthy Karra + * Suhaib M Siddiqi + * Peter Busch + * Harold L Hunt II + */ + +#ifdef HAVE_XWIN_CONFIG_H +#include <xwin-config.h> +#endif + +#include <X11/Xwindows.h> +#include <X11/Xmd.h> // to provide a BYTE type, since the Windows one is eclipsed + +#include "winvkmap.h" +#include "keyboard.h" + +static bool g_winKeyState[NUM_KEYCODES]; + +/* + * Translate a Windows WM_[SYS]KEY(UP/DOWN) message + * into an ASCII scan code. + * + * We do this ourselves, rather than letting Windows handle it, + * because Windows tends to munge the handling of special keys, + * like AltGr on European keyboards. + */ + +int +winTranslateKey(WPARAM wParam, LPARAM lParam) +{ + int iKeyFixup = g_iKeyMap[wParam * WIN_KEYMAP_COLS + 1]; + int iKeyFixupEx = g_iKeyMap[wParam * WIN_KEYMAP_COLS + 2]; + int iParam = HIWORD(lParam); + int iParamScanCode = LOBYTE(iParam); + int iScanCode; + + winDebug("winTranslateKey: wParam %08x lParam %08x\n", wParam, lParam); + +/* WM_ key messages faked by Vista speech recognition (WSR) don't have a + * scan code. + * + * Vocola 3 (Rick Mohr's supplement to WSR) uses + * System.Windows.Forms.SendKeys.SendWait(), which appears always to give a + * scan code of 1 + */ + if (iParamScanCode <= 1) { + if (VK_PRIOR <= wParam && wParam <= VK_DOWN) + /* Trigger special case table to translate to extended + * keycode, otherwise if num_lock is on, we can get keypad + * numbers instead of navigation keys. */ + iParam |= KF_EXTENDED; + else + iParamScanCode = MapVirtualKeyEx(wParam, + /*MAPVK_VK_TO_VSC */ 0, + GetKeyboardLayout(0)); + } + + /* Branch on special extended, special non-extended, or normal key */ + if ((iParam & KF_EXTENDED) && iKeyFixupEx) + iScanCode = iKeyFixupEx; + else if (iKeyFixup) + iScanCode = iKeyFixup; + else if (wParam == 0 && iParamScanCode == 0x70) + iScanCode = KEY_HKTG; + else + switch (iParamScanCode) { + case 0x70: + iScanCode = KEY_HKTG; + break; + case 0x73: + iScanCode = KEY_BSlash2; + break; + default: + iScanCode = iParamScanCode; + break; + } + + return iScanCode; +} + +/* + * Look for the lovely fake Control_L press/release generated by Windows + * when AltGr is pressed/released on a non-U.S. keyboard. + */ + +bool +winIsFakeCtrl_L(UINT message, WPARAM wParam, LPARAM lParam) +{ + MSG msgNext; + LONG lTime; + bool fReturn; + + static bool lastWasControlL = FALSE; + static UINT lastMessage; + static LONG lastTime; + + /* + * Fake Ctrl_L presses will be followed by an Alt_R press + * with the same timestamp as the Ctrl_L press. + */ + if ((message == WM_KEYDOWN || message == WM_SYSKEYDOWN) + && wParam == VK_CONTROL && (HIWORD(lParam) & KF_EXTENDED) == 0) { + /* Got a Ctrl_L press */ + + /* Get time of current message */ + lTime = GetMessageTime(); + + /* Look for next press message */ + fReturn = PeekMessage(&msgNext, NULL, + WM_KEYDOWN, WM_SYSKEYDOWN, PM_NOREMOVE); + + if (fReturn && msgNext.message != WM_KEYDOWN && + msgNext.message != WM_SYSKEYDOWN) + fReturn = 0; + + if (!fReturn) { + lastWasControlL = TRUE; + lastMessage = message; + lastTime = lTime; + } + else { + lastWasControlL = FALSE; + } + + /* Is next press an Alt_R with the same timestamp? */ + if (fReturn && msgNext.wParam == VK_MENU + && msgNext.time == lTime + && (HIWORD(msgNext.lParam) & KF_EXTENDED)) { + /* + * Next key press is Alt_R with same timestamp as current + * Ctrl_L message. Therefore, this Ctrl_L press is a fake + * event, so discard it. + */ + return TRUE; + } + } + /* + * Sometimes, the Alt_R press message is not yet posted when the + * fake Ctrl_L press message arrives (even though it has the + * same timestamp), so check for an Alt_R press message that has + * arrived since the last Ctrl_L message. + */ + else if ((message == WM_KEYDOWN || message == WM_SYSKEYDOWN) + && wParam == VK_MENU && (HIWORD(lParam) & KF_EXTENDED)) { + /* Got a Alt_R press */ + + if (lastWasControlL) { + lTime = GetMessageTime(); + + if (lastTime == lTime) { + /* Undo the fake Ctrl_L press by sending a fake Ctrl_L release */ + winSendKeyEvent(KEY_LCtrl, FALSE); + } + lastWasControlL = FALSE; + } + } + /* + * Fake Ctrl_L releases will be followed by an Alt_R release + * with the same timestamp as the Ctrl_L release. + */ + else if ((message == WM_KEYUP || message == WM_SYSKEYUP) + && wParam == VK_CONTROL && (HIWORD(lParam) & KF_EXTENDED) == 0) { + /* Got a Ctrl_L release */ + + /* Get time of current message */ + lTime = GetMessageTime(); + + /* Look for next release message */ + fReturn = PeekMessage(&msgNext, NULL, + WM_KEYUP, WM_SYSKEYUP, PM_NOREMOVE); + + if (fReturn && msgNext.message != WM_KEYUP && + msgNext.message != WM_SYSKEYUP) + fReturn = 0; + + lastWasControlL = FALSE; + + /* Is next press an Alt_R with the same timestamp? */ + if (fReturn + && (msgNext.message == WM_KEYUP || msgNext.message == WM_SYSKEYUP) + && msgNext.wParam == VK_MENU + && msgNext.time == lTime + && (HIWORD(msgNext.lParam) & KF_EXTENDED)) { + /* + * Next key release is Alt_R with same timestamp as current + * Ctrl_L message. Therefore, this Ctrl_L release is a fake + * event, so discard it. + */ + return TRUE; + } + } + else { + /* On any other press or release message, we don't have a + potentially fake Ctrl_L to worry about anymore... */ + lastWasControlL = FALSE; + } + + /* Not a fake control left press/release */ + return FALSE; +} + +/* + * Lift any modifier keys that are pressed + */ + +void +winKeybdReleaseKeys(void) +{ + int i; + + /* Loop through all keys */ + for (i = 0; i < NUM_KEYCODES; ++i) { + /* Pop key if pressed */ + if (g_winKeyState[i]) + winSendKeyEvent(i, FALSE); + + /* Reset pressed flag for keys */ + g_winKeyState[i] = FALSE; + } +} + +/* + * Take a raw X key code and send an up or down event for it. + * + * Thanks to VNC for inspiration, though it is a simple function. + */ + +void +winSendKeyEvent(DWORD dwKey, bool fDown) +{ + /* + * When alt-tabing between screens we can get phantom key up messages + * Here we only pass them through it we think we should! + */ + if (g_winKeyState[dwKey] == FALSE && fDown == FALSE) + return; + + /* Update the keyState map */ + g_winKeyState[dwKey] = fDown; + + winSendKeyEventCallback(dwKey + MIN_KEYCODE, fDown); + + winDebug("winSendKeyEvent: dwKey: %d, fDown: %d\n", dwKey, fDown); +} + +bool +winCheckKeyPressed(WPARAM wParam, LPARAM lParam) +{ + switch (wParam) { + case VK_CONTROL: + if ((lParam & 0x1ff0000) == 0x11d0000 && g_winKeyState[KEY_RCtrl]) + return TRUE; + if ((lParam & 0x1ff0000) == 0x01d0000 && g_winKeyState[KEY_LCtrl]) + return TRUE; + break; + case VK_SHIFT: + if ((lParam & 0x1ff0000) == 0x0360000 && g_winKeyState[KEY_ShiftR]) + return TRUE; + if ((lParam & 0x1ff0000) == 0x02a0000 && g_winKeyState[KEY_ShiftL]) + return TRUE; + break; + default: + return TRUE; + } + return FALSE; +} + +/* Only one shift release message is sent even if both are pressed. + * Fix this here + */ +void +winFixShiftKeys(int iScanCode) +{ + if (GetKeyState(VK_SHIFT) & 0x8000) + return; + + if (iScanCode == KEY_ShiftL && g_winKeyState[KEY_ShiftR]) + winSendKeyEvent(KEY_ShiftR, FALSE); + if (iScanCode == KEY_ShiftR && g_winKeyState[KEY_ShiftL]) + winSendKeyEvent(KEY_ShiftL, FALSE); +} diff --git a/hw/xwin/wmutil/keyboard.h b/hw/xwin/wmutil/keyboard.h new file mode 100644 index 000000000..5b229c25c --- /dev/null +++ b/hw/xwin/wmutil/keyboard.h @@ -0,0 +1,39 @@ +/* + * File: keyboard.h + * Purpose: interface for X->Windows keyboard event conversion + * + * Copyright (c) Jon TURNEY 2012 + * + * 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. + */ + +#ifndef WMUTILS_KEYBOARD_H +#define WMUTILS_KEYBOARD_H + +#include <stdbool.h> + +void winSendKeyEvent(DWORD dwKey, bool fDown); +void winSendKeyEventCallback(DWORD dwKey, bool fDown); +void winKeybdReleaseKeys(void); +bool winIsFakeCtrl_L(UINT message, WPARAM wParam, LPARAM lParam); +bool winCheckKeyPressed(WPARAM wParam, LPARAM lParam); +int winTranslateKey(WPARAM wParam, LPARAM lParam); +void winFixShiftKeys(int iScanCode); + +#endif /* WMUTILS_KEYBOARD_H */ diff --git a/hw/xwin/wmutil/mouse.c b/hw/xwin/wmutil/mouse.c new file mode 100644 index 000000000..b17a89013 --- /dev/null +++ b/hw/xwin/wmutil/mouse.c @@ -0,0 +1,111 @@ +/* + *Copyright (C) 1994-2000 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. + * + * Authors: Dakshinamurthy Karra + * Suhaib M Siddiqi + * Peter Busch + * Harold L Hunt II + */ + +#ifdef HAVE_XWIN_CONFIG_H +#include <xwin-config.h> +#endif + +#include <X11/Xwindows.h> +#include <X11/X.h> + +#include "mouse.h" + +/* Handle the mouse wheel */ +void +winMouseWheel(int *iTotalDeltaZ, int iDeltaZ, int iButtonUp, int iButtonDown) +{ + int button; + + /* Do we have any previous delta stored? */ + if (((*iTotalDeltaZ) > 0 && iDeltaZ > 0) + || ((*iTotalDeltaZ) < 0 && iDeltaZ < 0)) { + /* Previous delta and of same sign as current delta */ + iDeltaZ += (*iTotalDeltaZ); + (*iTotalDeltaZ) = 0; + } + else { + /* + * Previous delta of different sign, or zero. + * We will set it to zero for either case, + * as blindly setting takes just as much time + * as checking, then setting if necessary :) + */ + (*iTotalDeltaZ) = 0; + } + + /* + * Only process this message if the wheel has moved further than + * WHEEL_DELTA + */ + if (iDeltaZ >= WHEEL_DELTA || (-1 * iDeltaZ) >= WHEEL_DELTA) { + (*iTotalDeltaZ) = 0; + + /* Figure out how many whole deltas of the wheel we have */ + iDeltaZ /= WHEEL_DELTA; + } + else { + /* + * Wheel has not moved past WHEEL_DELTA threshold; + * we will store the wheel delta until the threshold + * has been reached. + */ + (*iTotalDeltaZ) = iDeltaZ; + return; + } + + /* Set the button to indicate up or down wheel delta */ + if (iDeltaZ > 0) { + button = iButtonUp; + } + else { + button = iButtonDown; + } + + /* + * Flip iDeltaZ to positive, if negative, + * because always need to generate a *positive* number of + * button clicks for the Z axis. + */ + if (iDeltaZ < 0) { + iDeltaZ *= -1; + } + + /* Generate X input messages for each wheel delta we have seen */ + while (iDeltaZ--) { + /* Push the wheel button */ + winMouseButtonsSendEvent(TRUE, button); + + /* Release the wheel button */ + winMouseButtonsSendEvent(FALSE, button); + } +} diff --git a/hw/xwin/wmutil/mouse.h b/hw/xwin/wmutil/mouse.h new file mode 100644 index 000000000..8bd6fe9eb --- /dev/null +++ b/hw/xwin/wmutil/mouse.h @@ -0,0 +1,36 @@ +/* + * File: mouse.h + * Purpose: interface for X->Windows mouse event conversion + * + * Copyright (c) Jon TURNEY 2012 + * + * 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. + */ + +#ifndef WMUTILS_MOUSE_H +#define WMUTILS_MOUSE_H + +#include <stdbool.h> + +void winMouseWheel(int *iTotalDeltaz, int iDeltaZ, int iButtonUp, int iButtonDown); + +/* Callback for sending mouse button events */ +void winMouseButtonsSendEvent(bool bPress, int iButton); + +#endif /* WMUTILS_MOUSE_H */ diff --git a/hw/xwin/winkeynames.h b/hw/xwin/wmutil/scancodes.h index bfed9d427..3215a4bcb 100644 --- a/hw/xwin/winkeynames.h +++ b/hw/xwin/wmutil/scancodes.h @@ -1,5 +1,3 @@ -#ifndef _WINKEYNAMES_H -#define _WINKEYNAMES_H /* * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * @@ -23,18 +21,8 @@ * */ -#define GLYPHS_PER_KEY 4 -#define NUM_KEYCODES 248 -#define MIN_KEYCODE 8 -#define MAX_KEYCODE (NUM_KEYCODES + MIN_KEYCODE - 1) - -#define AltMask Mod1Mask -#define NumLockMask Mod2Mask -#define AltLangMask Mod3Mask -#define KanaMask Mod4Mask -#define ScrollLockMask Mod5Mask - -#define ModifierDown(k) ((keyc->state & (k)) == (k)) +#ifndef SCANCODES_H +#define SCANCODES_H /* * NOTE: The AT/MF keyboards can generate (via the 8042) two (MF: three) @@ -203,4 +191,4 @@ #define KEY_NOTUSED 0 #define KEY_UNKNOWN 255 -#endif /* _WINKEYNAMES_H */ +#endif /* SCANCODES_H */ diff --git a/hw/xwin/winkeybd.h b/hw/xwin/wmutil/winvkmap.h index 6701f0959..eff61c7f9 100644 --- a/hw/xwin/winkeybd.h +++ b/hw/xwin/wmutil/winvkmap.h @@ -1,5 +1,3 @@ -#if !defined(WINKEYBD_H) -#define WINKEYBD_H /* *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. * @@ -30,10 +28,17 @@ * Authors: Harold L Hunt II */ +#ifndef WINVKMAP_H +#define WINVKMAP_H + /* * We need symbols for the scan codes of keys. */ -#include "winkeynames.h" +#include "scancodes.h" + +#define NUM_KEYCODES 248 +#define MIN_KEYCODE 8 +#define MAX_KEYCODE (NUM_KEYCODES + MIN_KEYCODE - 1) #define VK_FN 0xFF @@ -268,8 +273,7 @@ const int /* 220 */ 0, 0, 0, /* 221 */ 0, 0, 0, /* 222 */ 0, 0, 0, - /* 223 */ VK_OEM_8, 0, KEY_RCtrl, - /* at least on Canadian Multilingual Standard layout */ + /* 223 */ VK_OEM_8, 0, KEY_RCtrl, /* at least on Canadian Multilingual Standard layout */ /* 224 */ 0, 0, 0, /* 225 */ 0, 0, 0, /* 226 */ 0, 0, 0, @@ -301,8 +305,7 @@ const int /* 252 */ 0, 0, 0, /* 253 */ 0, 0, 0, /* 254 */ 0, 0, 0, - /* 255 */ VK_FN, 0, KEY_Fn - /* Most keyboards don't generate a scancode for Fn, but a few do... */ + /* 255 */ VK_FN, 0, KEY_Fn /* Most keyboards don't generate a scancode for Fn, but a few do... */ }; -#endif /* WINKEYBD_H */ +#endif /* WINVKMAP_H */ diff --git a/include/opaque.h b/include/opaque.h index b76ab6e6b..5b73a24c7 100644 --- a/include/opaque.h +++ b/include/opaque.h @@ -51,6 +51,7 @@ extern _X_EXPORT int defaultScreenSaverBlanking; extern _X_EXPORT int defaultScreenSaverAllowExposures; extern _X_EXPORT char *display; extern _X_EXPORT int displayfd; +extern _X_EXPORT Bool explicit_display; extern _X_EXPORT int defaultBackingStore; extern _X_EXPORT Bool disableBackingStore; diff --git a/include/os.h b/include/os.h index c7108a5d3..31ab44698 100644 --- a/include/os.h +++ b/include/os.h @@ -115,6 +115,8 @@ extern _X_EXPORT int WriteToClient(ClientPtr /*who */ , int /*count */ , extern _X_EXPORT void ResetOsBuffers(void); +extern _X_EXPORT int TransIsListening(char *protocol); + extern _X_EXPORT void InitConnectionLimits(void); extern _X_EXPORT void NotifyParentProcess(void); diff --git a/include/scrnintstr.h b/include/scrnintstr.h index df7407391..3885a7771 100644 --- a/include/scrnintstr.h +++ b/include/scrnintstr.h @@ -158,6 +158,10 @@ typedef void (*WindowExposuresProcPtr) (WindowPtr /*pWindow */ , RegionPtr /*prgn */ , RegionPtr /*other_exposed */ ); +typedef void (* PaintWindowProcPtr) (WindowPtr /*pWindow*/ , + RegionPtr /*pRegion*/ , + int /*what*/ ); + typedef void (*CopyWindowProcPtr) (WindowPtr /*pWindow */ , DDXPointRec /*ptOldOrg */ , RegionPtr /*prgnSrc */ ); @@ -403,6 +407,7 @@ typedef struct _Screen { ValidateTreeProcPtr ValidateTree; PostValidateTreeProcPtr PostValidateTree; WindowExposuresProcPtr WindowExposures; + PaintWindowProcPtr PaintWindow; CopyWindowProcPtr CopyWindow; ClearToBackgroundProcPtr ClearToBackground; ClipNotifyProcPtr ClipNotify; diff --git a/man/Xserver.man b/man/Xserver.man index b103551fa..a4020139b 100644 --- a/man/Xserver.man +++ b/man/Xserver.man @@ -563,9 +563,6 @@ Outline font directories .I /tmp/.X11-unix/X\fBn\fP Unix domain socket for display number \fBn\fP .TP 30 -.I /usr/adm/X\fBn\fPmsgs -Error log file for display number \fBn\fP if run from \fIinit\fP(__adminmansuffix__) -.TP 30 .I __projectroot__/lib/X11/xdm/xdm-errors Default error log file if the server is run from \fIxdm\fP(1) .SH "SEE ALSO" diff --git a/mi/miexpose.c b/mi/miexpose.c index 8b7c93fb8..881c9698f 100644 --- a/mi/miexpose.c +++ b/mi/miexpose.c @@ -277,7 +277,7 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, /* miPaintWindow doesn't clip, so we have to */ RegionIntersect(&rgnExposed, &rgnExposed, &pWin->clipList); } - miPaintWindow((WindowPtr) pDstDrawable, &rgnExposed, PW_BACKGROUND); + (*pWin->drawable.pScreen->PaintWindow)(pWin, &rgnExposed, PW_BACKGROUND); if (extents) { RegionReset(&rgnExposed, &expBox); @@ -467,7 +467,7 @@ miWindowExposures(WindowPtr pWin, RegionPtr prgn, RegionPtr other_exposed) RegionIntersect(prgn, prgn, &pWin->clipList); } if (prgn && !RegionNil(prgn)) - miPaintWindow(pWin, prgn, PW_BACKGROUND); + (*pWin->drawable.pScreen->PaintWindow)(pWin, prgn, PW_BACKGROUND); if (clientInterested && exposures && !RegionNil(exposures)) miSendExposures(pWin, exposures, pWin->drawable.x, pWin->drawable.y); @@ -483,14 +483,6 @@ miWindowExposures(WindowPtr pWin, RegionPtr prgn, RegionPtr other_exposed) RegionDestroy(exposures); } -#ifdef ROOTLESS -/* Ugly, ugly, but we lost our hooks into miPaintWindow... =/ */ -void RootlessSetPixmapOfAncestors(WindowPtr pWin); -void RootlessStartDrawing(WindowPtr pWin); -void RootlessDamageRegion(WindowPtr pWin, RegionPtr prgn); -Bool IsFramedWindow(WindowPtr pWin); -#endif - void miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) { @@ -518,22 +510,6 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) Bool solid = TRUE; DrawablePtr drawable = &pWin->drawable; -#ifdef ROOTLESS - if (!drawable || drawable->type == UNDRAWABLE_WINDOW) - return; - - if (IsFramedWindow(pWin)) { - RootlessStartDrawing(pWin); - RootlessDamageRegion(pWin, prgn); - - if (pWin->backgroundState == ParentRelative) { - if ((what == PW_BACKGROUND) || - (what == PW_BORDER && !pWin->borderIsPixel)) - RootlessSetPixmapOfAncestors(pWin); - } - } -#endif - if (what == PW_BACKGROUND) { while (pWin->backgroundState == ParentRelative) pWin = pWin->parent; diff --git a/mi/mioverlay.c b/mi/mioverlay.c index 2bfd5e401..018f78a15 100644 --- a/mi/mioverlay.c +++ b/mi/mioverlay.c @@ -844,8 +844,8 @@ miOverlayHandleExposures(WindowPtr pWin) if ((mival = pTree->valdata)) { if (!((*pPriv->InOverlay) (pTree->pWin))) { if (RegionNotEmpty(&mival->borderExposed)) { - miPaintWindow(pTree->pWin, &mival->borderExposed, - PW_BORDER); + (*pTree->pWin->drawable.pScreen->PaintWindow)(pTree->pWin, &mival->borderExposed, + PW_BORDER); } RegionUninit(&mival->borderExposed); @@ -884,7 +884,7 @@ miOverlayHandleExposures(WindowPtr pWin) } else { if (RegionNotEmpty(&val->after.borderExposed)) { - miPaintWindow(pChild, &val->after.borderExposed, PW_BORDER); + (*pChild->drawable.pScreen->PaintWindow)(pChild, &val->after.borderExposed, PW_BORDER); } (*WindowExposures) (pChild, &val->after.exposed, NullRegion); } @@ -984,6 +984,7 @@ miOverlayWindowExposures(WindowPtr pWin, RegionPtr prgn, RegionPtr other_exposed) { RegionPtr exposures = prgn; + ScreenPtr pScreen = pWin->drawable.pScreen; if ((prgn && !RegionNil(prgn)) || (exposures && !RegionNil(exposures)) || other_exposed) { @@ -1002,7 +1003,6 @@ miOverlayWindowExposures(WindowPtr pWin, } if (clientInterested && exposures && (RegionNumRects(exposures) > RECTLIMIT)) { - ScreenPtr pScreen = pWin->drawable.pScreen; miOverlayScreenPtr pPriv = MIOVERLAY_GET_SCREEN_PRIVATE(pScreen); BoxRec box; @@ -1028,7 +1028,7 @@ miOverlayWindowExposures(WindowPtr pWin, RegionIntersect(prgn, prgn, &pWin->clipList); } if (prgn && !RegionNil(prgn)) - miPaintWindow(pWin, prgn, PW_BACKGROUND); + (*pScreen->PaintWindow)(pWin, prgn, PW_BACKGROUND); if (clientInterested && exposures && !RegionNil(exposures)) miSendExposures(pWin, exposures, pWin->drawable.x, pWin->drawable.y); @@ -1638,7 +1638,7 @@ miOverlayClearToBackground(WindowPtr pWin, if (generateExposures) (*pScreen->WindowExposures) (pWin, ®, pBSReg); else if (pWin->backgroundState != None) - miPaintWindow(pWin, ®, PW_BACKGROUND); + (*pScreen->PaintWindow)(pWin, ®, PW_BACKGROUND); RegionUninit(®); if (pBSReg) RegionDestroy(pBSReg); diff --git a/mi/miscrinit.c b/mi/miscrinit.c index 4698b532f..f8e6706ee 100644 --- a/mi/miscrinit.c +++ b/mi/miscrinit.c @@ -249,6 +249,7 @@ miScreenInit(ScreenPtr pScreen, pointer pbits, /* pointer to screen bits */ pScreen->ValidateTree = miValidateTree; pScreen->PostValidateTree = (PostValidateTreeProcPtr) 0; pScreen->WindowExposures = miWindowExposures; + pScreen->PaintWindow = miPaintWindow; /* CopyWindow */ pScreen->ClearToBackground = miClearToBackground; pScreen->ClipNotify = (ClipNotifyProcPtr) 0; diff --git a/mi/miwindow.c b/mi/miwindow.c index 8dd99dbf0..4b33ca6a4 100644 --- a/mi/miwindow.c +++ b/mi/miwindow.c @@ -112,7 +112,7 @@ miClearToBackground(WindowPtr pWin, if (generateExposures) (*pWin->drawable.pScreen->WindowExposures) (pWin, ®, NULL); else if (pWin->backgroundState != None) - miPaintWindow(pWin, ®, PW_BACKGROUND); + (*pWin->drawable.pScreen->PaintWindow)(pWin, ®, PW_BACKGROUND); RegionUninit(®); } @@ -218,7 +218,7 @@ miHandleValidateExposures(WindowPtr pWin) while (1) { if ((val = pChild->valdata)) { if (RegionNotEmpty(&val->after.borderExposed)) - miPaintWindow(pChild, &val->after.borderExposed, PW_BORDER); + (*pChild->drawable.pScreen->PaintWindow)(pChild, &val->after.borderExposed, PW_BORDER); RegionUninit(&val->after.borderExposed); (*WindowExposures) (pChild, &val->after.exposed, NullRegion); RegionUninit(&val->after.exposed); diff --git a/miext/rootless/rootlessCommon.h b/miext/rootless/rootlessCommon.h index fd9c941f4..dadeab3cb 100644 --- a/miext/rootless/rootlessCommon.h +++ b/miext/rootless/rootlessCommon.h @@ -96,6 +96,7 @@ typedef struct _RootlessScreenRec { ChangeWindowAttributesProcPtr ChangeWindowAttributes; CreateGCProcPtr CreateGC; + PaintWindowProcPtr PaintWindow; CopyWindowProcPtr CopyWindow; GetImageProcPtr GetImage; SourceValidateProcPtr SourceValidate; diff --git a/miext/rootless/rootlessScreen.c b/miext/rootless/rootlessScreen.c index a1af3e7ac..4e7ecf4d3 100644 --- a/miext/rootless/rootlessScreen.c +++ b/miext/rootless/rootlessScreen.c @@ -473,7 +473,7 @@ expose_1(WindowPtr pWin) if (!pWin->realized) return; - miPaintWindow(pWin, &pWin->borderClip, PW_BACKGROUND); + (*pWin->drawable.pScreen->PaintWindow)(pWin, &pWin->borderClip, PW_BACKGROUND); /* FIXME: comments in windowstr.h indicate that borderClip doesn't include subwindow visibility. But I'm not so sure.. so we may @@ -668,6 +668,7 @@ RootlessWrap(ScreenPtr pScreen) WRAP(CreateScreenResources); WRAP(CloseScreen); WRAP(CreateGC); + WRAP(PaintWindow); WRAP(CopyWindow); WRAP(GetImage); WRAP(SourceValidate); diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c index cfcb6e558..dde285666 100644 --- a/miext/rootless/rootlessWindow.c +++ b/miext/rootless/rootlessWindow.c @@ -1636,3 +1636,38 @@ RootlessSetPixmapOfAncestors(WindowPtr pWin) pScreen->SetWindowPixmap(pWin, topWinRec->pixmap); } } + +/* + * RootlessPaintWindow + * + * Wrapper for miPaintWindow + * + * Returns directly if there is nothing more for miPaintWindow() to do + * + */ +void +RootlessPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what) +{ + DrawablePtr drawable = &pWin->drawable; + + if (!drawable || drawable->type == UNDRAWABLE_WINDOW) + return; + + if (IsFramedWindow(pWin)) { + RootlessStartDrawing(pWin); + RootlessDamageRegion(pWin, pRegion); + + // For ParentRelative windows, if painting background, or with + // tiled borders, we have to make sure the window pixmap is + // set correctly all the way up the ancestor chain. + if (pWin->backgroundState == ParentRelative) { + if ((what == PW_BACKGROUND) || + (what == PW_BORDER && !pWin->borderIsPixel)) + RootlessSetPixmapOfAncestors(pWin); + } + } + + SCREEN_UNWRAP(pWin->drawable.pScreen, PaintWindow); + pWin->drawable.pScreen->PaintWindow(pWin, pRegion, what); + SCREEN_WRAP(pWin->drawable.pScreen, PaintWindow); +} diff --git a/miext/rootless/rootlessWindow.h b/miext/rootless/rootlessWindow.h index d3955fc89..3b7ea42d3 100644 --- a/miext/rootless/rootlessWindow.h +++ b/miext/rootless/rootlessWindow.h @@ -53,6 +53,7 @@ void RootlessMoveWindow(WindowPtr pWin, int x, int y, WindowPtr pSib, void RootlessResizeWindow(WindowPtr pWin, int x, int y, unsigned int w, unsigned int h, WindowPtr pSib); void RootlessReparentWindow(WindowPtr pWin, WindowPtr pPriorParent); +void RootlessPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what); void RootlessChangeBorderWidth(WindowPtr pWin, unsigned int width); #ifdef __APPLE__ diff --git a/os/Makefile.am b/os/Makefile.am index 88914852f..30ce9e1be 100644 --- a/os/Makefile.am +++ b/os/Makefile.am @@ -1,6 +1,6 @@ noinst_LTLIBRARIES = libos.la -AM_CFLAGS = $(DIX_CFLAGS) $(SHA1_CFLAGS) +AM_CFLAGS = $(DIX_CFLAGS) $(SHA1_CFLAGS) -DBINDIR=\"$(bindir)\" SECURERPC_SRCS = rpcauth.c XDMCP_SRCS = xdmcp.c diff --git a/os/backtrace.c b/os/backtrace.c index daac60cf6..4c57c6fe6 100644 --- a/os/backtrace.c +++ b/os/backtrace.c @@ -30,6 +30,14 @@ #include <errno.h> #include <string.h> +#include <sys/types.h> +#if !defined(__WIN32__) || defined(__CYGWIN__) +#include <sys/wait.h> +#endif +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> + #ifdef HAVE_BACKTRACE #ifndef _GNU_SOURCE #define _GNU_SOURCE @@ -147,10 +155,17 @@ xorg_backtrace_frame(uintptr_t pc, int signo, void *arg) } #endif /* HAVE_WALKCONTEXT */ -#ifdef HAVE_PSTACK +/* + fork/exec a program to create a backtrace + Returns 0 if successful. +*/ static int -xorg_backtrace_pstack(void) +xorg_backtrace_exec_wrapper(const char *path) { +#if defined(WIN32) && !defined(__CYGWIN__) + ErrorFSigSafe("Backtrace not implemented on Windows"); + return -1; +#else pid_t kidpid; int pipefd[2]; @@ -158,7 +173,7 @@ xorg_backtrace_pstack(void) return -1; } - kidpid = fork1(); + kidpid = fork(); if (kidpid == -1) { /* ERROR */ @@ -171,11 +186,13 @@ xorg_backtrace_pstack(void) seteuid(0); close(STDIN_FILENO); close(STDOUT_FILENO); + close(STDERR_FILENO); dup2(pipefd[1], STDOUT_FILENO); - closefrom(STDERR_FILENO); + dup2(pipefd[1], STDERR_FILENO); + close(pipefd[1]); snprintf(parent, sizeof(parent), "%d", getppid()); - execle("/usr/bin/pstack", "pstack", parent, NULL); + execle(path, path, parent, NULL, NULL); exit(1); } else { @@ -194,17 +211,35 @@ xorg_backtrace_pstack(void) btline[bytesread] = 0; ErrorFSigSafe("%s", btline); } - else if ((bytesread < 0) || ((errno != EINTR) && (errno != EAGAIN))) + else if ((bytesread == 0) || + ((errno != EINTR) && (errno != EAGAIN))) done = 1; } close(pipefd[0]); waitpid(kidpid, &kidstat, 0); - if (kidstat != 0) + if (!(WIFEXITED(kidstat) && WEXITSTATUS(kidstat) == 0)) { + ErrorFSigSafe("%s failed with returncode %d\n", path, + WEXITSTATUS(kidstat)); return -1; + } } return 0; +#endif +} + +#ifdef HAVE_PSTACK +static int +xorg_backtrace_pstack(void) +{ + return xorg_backtrace_exec_wrapper("/usr/bin/pstack"); +} +#endif + +static int +xorg_backtrace_script(void) +{ + return xorg_backtrace_exec_wrapper(BINDIR "/xorg-backtrace"); } -#endif /* HAVE_PSTACK */ #if defined(HAVE_PSTACK) || defined(HAVE_WALKCONTEXT) @@ -241,7 +276,8 @@ xorg_backtrace(void) void xorg_backtrace(void) { - return; + if (xorg_backtrace_script() == 0) + return; } #endif diff --git a/os/connection.c b/os/connection.c index 6cd8bcf43..c8c15f6e4 100644 --- a/os/connection.c +++ b/os/connection.c @@ -269,6 +269,21 @@ lookup_trans_conn(int fd) return NULL; } +int +TransIsListening(char *protocol) +{ + /* look for this transport in the list of listeners */ + int i; + + for (i = 0; i < ListenTransCount; i++) { + if (!strcmp(protocol, ListenTransConns[i]->transptr->TransName)) { + return 1; + } + } + + return 0; +} + /* Set MaxClients and lastfdesc, and allocate ConnectionTranslation */ void @@ -351,8 +366,8 @@ void NotifyParentProcess(void) { #if !defined(WIN32) - if (dynamic_display[0]) { - write(displayfd, dynamic_display, strlen(dynamic_display)); + if (displayfd) { + write(displayfd, display, strlen(display)); write(displayfd, "\n", 1); close(displayfd); } @@ -404,9 +419,8 @@ CreateWellKnownSockets(void) FD_ZERO(&WellKnownConnections); /* display is initialized to "0" by main(). It is then set to the display - * number if specified on the command line, or to NULL when the -displayfd - * option is used. */ - if (display) { + * number if specified on the command line. */ + if ((displayfd == 0) || explicit_display) { if (TryCreateSocket(atoi(display), &partial) && ListenTransCount >= 1) if (!PartialNetwork && partial) @@ -415,6 +429,7 @@ CreateWellKnownSockets(void) else { /* -displayfd */ Bool found = 0; for (i = 0; i < 65535 - X_TCP_PORT; i++) { + ErrorF("Trying to create socket for display number %d\n", i); if (TryCreateSocket(i, &partial) && !partial) { found = 1; break; @@ -216,6 +216,9 @@ LogInit(const char *fname, const char *backup) free(oldLog); } } + else { + unlink(logFileName); + } if ((logFile = fopen(logFileName, "w")) == NULL) FatalError("Cannot open log file \"%s\"\n", logFileName); setvbuf(logFile, NULL, _IONBF, 0); @@ -781,9 +784,9 @@ FatalError(const char *f, ...) static Bool beenhere = FALSE; if (beenhere) - ErrorF("\nFatalError re-entered, aborting\n"); + ErrorF("FatalError re-entered, aborting\n"); else - ErrorF("\nFatal server error:\n"); + ErrorF("Fatal server error: "); va_start(args, f); @@ -802,7 +805,8 @@ FatalError(const char *f, ...) #endif VErrorF(f, args); va_end(args); - ErrorF("\n"); + if (f[strlen(f) - 1] != '\n') + ErrorF("\n"); if (!beenhere) OsVendorFatalError(f, args2); va_end(args2); diff --git a/os/osinit.c b/os/osinit.c index 6c66f9c12..353c06a53 100644 --- a/os/osinit.c +++ b/os/osinit.c @@ -70,10 +70,6 @@ SOFTWARE. #include <sys/resource.h> #endif -#ifndef ADMPATH -#define ADMPATH "/usr/adm/X%smsgs" -#endif - extern char *display; #ifdef RLIMIT_DATA @@ -85,6 +81,7 @@ int limitStackSpace = -1; #ifdef RLIMIT_NOFILE int limitNoFile = -1; #endif +extern Bool install_os_signal_handler; static OsSigWrapperPtr OsSigWrapper = NULL; @@ -125,8 +122,7 @@ OsSigHandler(int signo) } } - /* log, cleanup, and abort */ - xorg_backtrace(); + ErrorF("Fatal signal received in thread 0x%x\n", pthread_self()); #ifdef SA_SIGINFO if (sip->si_code == SI_USER) { @@ -144,6 +140,9 @@ OsSigHandler(int signo) } #endif + /* log, cleanup, and abort */ + xorg_backtrace(); + FatalError("Caught signal %d (%s). Server aborting\n", signo, strsignal(signo)); } @@ -158,30 +157,33 @@ OsInit(void) if (!been_here) { #if !defined(WIN32) || defined(__CYGWIN__) - struct sigaction act, oact; - int i; - - int siglist[] = { SIGSEGV, SIGQUIT, SIGILL, SIGFPE, SIGBUS, - SIGSYS, - SIGXCPU, - SIGXFSZ, + if (install_os_signal_handler) { + struct sigaction act, oact; + int i; + + int siglist[] = { SIGSEGV, SIGQUIT, SIGILL, SIGFPE, SIGBUS, + SIGSYS, + SIGXCPU, + SIGXFSZ, #ifdef SIGEMT - SIGEMT, + SIGEMT, #endif - 0 /* must be last */ - }; - sigemptyset(&act.sa_mask); + 0 /* must be last */ + }; + sigemptyset(&act.sa_mask); #ifdef SA_SIGINFO - act.sa_sigaction = OsSigHandler; - act.sa_flags = SA_SIGINFO; + act.sa_sigaction = OsSigHandler; + act.sa_flags = SA_SIGINFO; #else - act.sa_handler = OsSigHandler; - act.sa_flags = 0; + act.sa_handler = OsSigHandler; + act.sa_flags = 0; #endif - for (i = 0; siglist[i] != 0; i++) { - if (sigaction(siglist[i], &act, &oact)) { - ErrorF("failed to install signal handler for signal %d: %s\n", - siglist[i], strerror(errno)); + for (i = 0; siglist[i] != 0; i++) { + if (sigaction(siglist[i], &act, &oact)) { + ErrorF + ("failed to install signal handler for signal %d: %s\n", + siglist[i], strerror(errno)); + } } } #endif /* !WIN32 || __CYGWIN__ */ @@ -212,39 +214,6 @@ OsInit(void) fclose(stdin); fclose(stdout); #endif - /* - * If a write of zero bytes to stderr returns non-zero, i.e. -1, - * then writing to stderr failed, and we'll write somewhere else - * instead. (Apparently this never happens in the Real World.) - */ - if (write(2, fname, 0) == -1) { - FILE *err; - - if (strlen(display) + strlen(ADMPATH) + 1 < sizeof fname) - snprintf(fname, sizeof(fname), ADMPATH, display); - else - strcpy(fname, devnull); - /* - * uses stdio to avoid os dependencies here, - * a real os would use - * open (fname, O_WRONLY|O_APPEND|O_CREAT, 0666) - */ - if (!(err = fopen(fname, "a+"))) - err = fopen(devnull, "w"); - if (err && (fileno(err) != 2)) { - dup2(fileno(err), 2); - fclose(err); - } -#if defined(SYSV) || defined(SVR4) || defined(WIN32) || defined(__CYGWIN__) - { - static char buf[BUFSIZ]; - - setvbuf(stderr, buf, _IOLBF, BUFSIZ); - } -#else - setlinebuf(stderr); -#endif - } #if !defined(WIN32) || defined(__CYGWIN__) if (getpgrp() == 0) diff --git a/os/utils.c b/os/utils.c index 60e828e28..d96acded3 100644 --- a/os/utils.c +++ b/os/utils.c @@ -122,6 +122,8 @@ __stdcall unsigned long GetTickCount(void); #include "picture.h" +Bool install_os_signal_handler = TRUE; + Bool noTestExtensions; #ifdef COMPOSITE @@ -255,7 +257,7 @@ UnlockServer(void) #else /* LOCK_SERVER */ static Bool StillLocking = FALSE; static char LockFile[PATH_MAX]; -static Bool nolock = FALSE; +Bool nolock = FALSE; /* * LockServer -- @@ -522,6 +524,7 @@ UseMsg(void) #ifdef RLIMIT_STACK ErrorF("-ls int limit stack space to N Kb\n"); #endif + ErrorF("-notrapsignals disable catching of fatal signals\n"); #ifdef LOCK_SERVER ErrorF("-nolock disable the locking mechanism\n"); #endif @@ -614,6 +617,7 @@ ProcessCommandLine(int argc, char *argv[]) else if (argv[i][0] == ':') { /* initialize display */ display = argv[i]; + explicit_display = TRUE; display++; if (!VerifyDisplayName(display)) { ErrorF("Bad display name: %s\n", display); @@ -684,7 +688,6 @@ ProcessCommandLine(int argc, char *argv[]) else if (strcmp(argv[i], "-displayfd") == 0) { if (++i < argc) { displayfd = atoi(argv[i]); - display = NULL; #ifdef LOCK_SERVER nolock = TRUE; #endif @@ -767,6 +770,9 @@ ProcessCommandLine(int argc, char *argv[]) UseMsg(); } #endif + else if (strcmp(argv[i], "-notrapsignals") == 0) { + install_os_signal_handler = FALSE; + } #ifdef LOCK_SERVER else if (strcmp(argv[i], "-nolock") == 0) { #if !defined(WIN32) && !defined(__CYGWIN__) @@ -905,6 +911,7 @@ ProcessCommandLine(int argc, char *argv[]) } else if (strcmp(argv[i], "-schedInterval") == 0) { if (++i < argc) { + SmartScheduleDisable = FALSE; SmartScheduleInterval = atoi(argv[i]); SmartScheduleSlice = SmartScheduleInterval; } @@ -913,6 +920,7 @@ ProcessCommandLine(int argc, char *argv[]) } else if (strcmp(argv[i], "-schedMax") == 0) { if (++i < argc) { + SmartScheduleDisable = FALSE; SmartScheduleMaxSlice = atoi(argv[i]); } else @@ -1310,6 +1318,26 @@ OsAbort(void) * as well. As it is now, xkbcomp messages don't end up in the log file. */ +#ifdef __CYGWIN__ +#include <process.h> +int +System(const char *command) +{ + int status; + + if (!command) + return 1; + + DebugF("System: `%s'\n", command); + + /* + Use spawnl() rather than execl() to implement System() on cygwin to + avoid fork emulation overhead and brittleness + */ + status = spawnl(_P_WAIT, "/bin/sh", "sh", "-c", command, (char *) NULL); + return status; +} +#else int System(const char *command) { @@ -1351,6 +1379,7 @@ System(const char *command) return p == -1 ? -1 : status; } +#endif static struct pid { struct pid *next; @@ -1662,6 +1691,17 @@ System(const char *cmdline) return dwExitCode; } +#elif defined(__CYGWIN__) +const char* +Win32TempDir(void) +{ + if (getenv("TEMP") != NULL) + return getenv("TEMP"); + else if (getenv("TMP") != NULL) + return getenv("TMP"); + else + return "/tmp"; +} #endif /* diff --git a/pseudoramiX/Makefile.am b/pseudoramiX/Makefile.am new file mode 100644 index 000000000..17b664b9e --- /dev/null +++ b/pseudoramiX/Makefile.am @@ -0,0 +1,7 @@ +# Fake Xinerama extension + +AM_CFLAGS = $(DIX_CFLAGS) + +noinst_LTLIBRARIES = libPseudoramiX.la + +libPseudoramiX_la_SOURCES = pseudoramiX.c pseudoramiX.h diff --git a/hw/xquartz/pseudoramiX.c b/pseudoramiX/pseudoramiX.c index 23dbc7328..23dbc7328 100644 --- a/hw/xquartz/pseudoramiX.c +++ b/pseudoramiX/pseudoramiX.c diff --git a/hw/xquartz/pseudoramiX.h b/pseudoramiX/pseudoramiX.h index f063919dd..f063919dd 100644 --- a/hw/xquartz/pseudoramiX.h +++ b/pseudoramiX/pseudoramiX.h diff --git a/randr/rrxinerama.c b/randr/rrxinerama.c index 76d728c70..128459850 100644 --- a/randr/rrxinerama.c +++ b/randr/rrxinerama.c @@ -84,6 +84,8 @@ static int ProcRRXineramaIsActive(ClientPtr client); static int ProcRRXineramaQueryScreens(ClientPtr client); static int SProcRRXineramaDispatch(ClientPtr client); +Bool noRRXineramaExtension = FALSE; + /* Proc */ int @@ -480,6 +482,9 @@ RRXineramaExtensionInit(void) return; #endif + if (noRRXineramaExtension) + return; + /* * Xinerama isn't capable enough to have multiple protocol screens each * with their own output geometry. So if there's more than one protocol diff --git a/xkb/ddxLoad.c b/xkb/ddxLoad.c index d462957f4..2d00a3430 100644 --- a/xkb/ddxLoad.c +++ b/xkb/ddxLoad.c @@ -104,7 +104,7 @@ XkbDDXCompileKeymapByNames(XkbDescPtr xkb, const char *xkbbindir = emptystring; const char *xkbbindirsep = emptystring; -#ifdef WIN32 +#if defined(WIN32) || defined(__CYGWIN__) /* 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 tmpname[PATH_MAX]; @@ -117,9 +117,9 @@ XkbDDXCompileKeymapByNames(XkbDescPtr xkb, OutputDirectory(xkm_output_dir, sizeof(xkm_output_dir)); -#ifdef WIN32 +#if defined(WIN32) || defined(__CYGWIN__) strcpy(tmpname, Win32TempDir()); - strcat(tmpname, "\\xkb_XXXXXX"); + strcat(tmpname, PATHSEPARATOR "xkb_XXXXXX"); (void) mktemp(tmpname); #endif @@ -158,7 +158,7 @@ XkbDDXCompileKeymapByNames(XkbDescPtr xkb, return FALSE; } -#ifndef WIN32 +#if !defined(WIN32) && !defined(__CYGWIN__) out = Popen(buf, "w"); #else out = fopen(tmpname, "w"); @@ -172,7 +172,7 @@ XkbDDXCompileKeymapByNames(XkbDescPtr xkb, } #endif XkbWriteXKBKeymapForNames(out, names, xkb, want, need); -#ifndef WIN32 +#if !defined(WIN32) && !defined(__CYGWIN__) if (Pclose(out) == 0) #else if (fclose(out) == 0 && System(buf) >= 0) @@ -184,14 +184,14 @@ XkbDDXCompileKeymapByNames(XkbDescPtr xkb, strlcpy(nameRtrn, keymap, nameRtrnLen); } free(buf); -#ifdef WIN32 +#if defined(WIN32) || defined(__CYGWIN__) unlink(tmpname); #endif return TRUE; } else LogMessage(X_ERROR, "Error compiling keymap (%s)\n", keymap); -#ifdef WIN32 +#if defined(WIN32) || defined(__CYGWIN__) /* remove the temporary file */ unlink(tmpname); #endif |