2003-11-14 16:54:54 +01:00
|
|
|
/***********************************************************
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
******************************************************************/
|
|
|
|
|
2005-07-03 09:02:09 +02:00
|
|
|
#ifdef HAVE_DIX_CONFIG_H
|
|
|
|
#include <dix-config.h>
|
|
|
|
#endif
|
|
|
|
|
2005-07-16 05:49:59 +02:00
|
|
|
#ifdef HAVE_XORG_CONFIG_H
|
|
|
|
#include <xorg-config.h>
|
|
|
|
#endif
|
|
|
|
|
2005-07-12 02:52:48 +02:00
|
|
|
#ifdef HAVE_DMX_CONFIG_H
|
|
|
|
#include <dmx-config.h>
|
|
|
|
#endif
|
|
|
|
|
2005-07-14 05:36:44 +02:00
|
|
|
#ifdef HAVE_XNEST_CONFIG_H
|
|
|
|
#include <xnest-config.h>
|
|
|
|
#undef DPMSExtension
|
|
|
|
#endif
|
|
|
|
|
2005-12-28 11:02:54 +01:00
|
|
|
#ifdef HAVE_KDRIVE_CONFIG_H
|
|
|
|
#include <kdrive-config.h>
|
|
|
|
/* there must be a better way... */
|
|
|
|
#undef XF86MISC
|
|
|
|
#undef XFreeXDGA
|
|
|
|
#undef XF86DRI
|
|
|
|
#undef XF86VIDMODE
|
|
|
|
#endif
|
|
|
|
|
2005-12-29 01:19:33 +01:00
|
|
|
#ifdef HAVE_XGL_CONFIG_H
|
|
|
|
#include <xgl-config.h>
|
|
|
|
#undef XF86MISC
|
|
|
|
#undef XFreeXDGA
|
|
|
|
#undef XF86DRI
|
|
|
|
#undef XF86VIDMODE
|
|
|
|
#endif
|
|
|
|
|
2005-07-03 10:53:54 +02:00
|
|
|
#include "misc.h"
|
2003-11-14 17:49:22 +01:00
|
|
|
#include "extension.h"
|
|
|
|
#include "micmap.h"
|
2006-06-08 19:11:17 +02:00
|
|
|
#include "globals.h"
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
#if defined(QNX4) /* sleaze for Watcom on QNX4 ... */
|
|
|
|
#undef GLXEXT
|
|
|
|
#endif
|
|
|
|
|
2004-04-23 21:54:30 +02:00
|
|
|
/* Make sure Xprt only announces extensions it supports */
|
|
|
|
#ifdef PRINT_ONLY_SERVER
|
|
|
|
#undef MITSHM /* this is incompatible to the vector-based Xprint DDX */
|
|
|
|
#undef XKB
|
|
|
|
#undef PANORAMIX
|
|
|
|
#undef RES
|
|
|
|
#undef XINPUT
|
|
|
|
#undef XV
|
|
|
|
#undef SCREENSAVER
|
|
|
|
#undef XIDLE
|
|
|
|
#undef XRECORD
|
|
|
|
#undef XF86VIDMODE
|
|
|
|
#undef XF86MISC
|
|
|
|
#undef XFreeXDGA
|
|
|
|
#undef XF86DRI
|
|
|
|
#undef DPMSExtension
|
|
|
|
#undef FONTCACHE
|
2006-07-12 03:26:55 +02:00
|
|
|
#undef COMPOSITE
|
2004-07-29 20:49:42 +02:00
|
|
|
#undef DAMAGE
|
|
|
|
#undef XFIXES
|
2004-07-31 03:37:47 +02:00
|
|
|
#undef XEVIE
|
2005-04-24 03:10:12 +02:00
|
|
|
#else
|
|
|
|
#ifndef LOADABLEPRINTDDX
|
|
|
|
#undef XPRINT
|
|
|
|
#endif /* LOADABLEPRINTDDX */
|
2004-04-23 21:54:30 +02:00
|
|
|
#endif /* PRINT_ONLY_SERVER */
|
|
|
|
|
2004-09-14 02:51:25 +02:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
extern Bool noTestExtensions;
|
2004-09-14 02:51:25 +02:00
|
|
|
|
|
|
|
#ifdef BIGREQS
|
|
|
|
extern Bool noBigReqExtension;
|
|
|
|
#endif
|
|
|
|
#ifdef COMPOSITE
|
|
|
|
extern Bool noCompositeExtension;
|
|
|
|
#endif
|
|
|
|
#ifdef DBE
|
|
|
|
extern Bool noDbeExtension;
|
|
|
|
#endif
|
|
|
|
#ifdef DPMSExtension
|
|
|
|
extern Bool noDPMSExtension;
|
|
|
|
#endif
|
|
|
|
#ifdef FONTCACHE
|
|
|
|
extern Bool noFontCacheExtension;
|
|
|
|
#endif
|
|
|
|
#ifdef GLXEXT
|
|
|
|
extern Bool noGlxExtension;
|
|
|
|
#endif
|
|
|
|
#ifdef SCREENSAVER
|
|
|
|
extern Bool noScreenSaverExtension;
|
|
|
|
#endif
|
|
|
|
#ifdef MITSHM
|
|
|
|
extern Bool noMITShmExtension;
|
|
|
|
#endif
|
|
|
|
#ifdef MULTIBUFFER
|
|
|
|
extern Bool noMultibufferExtension;
|
|
|
|
#endif
|
|
|
|
#ifdef RANDR
|
|
|
|
extern Bool noRRExtension;
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
2004-07-31 06:23:21 +02:00
|
|
|
#ifdef RENDER
|
|
|
|
extern Bool noRenderExtension;
|
|
|
|
#endif
|
2004-09-14 02:51:25 +02:00
|
|
|
#ifdef SHAPE
|
|
|
|
extern Bool noShapeExtension;
|
|
|
|
#endif
|
|
|
|
#ifdef XCSECURITY
|
|
|
|
extern Bool noSecurityExtension;
|
|
|
|
#endif
|
|
|
|
#ifdef XSYNC
|
|
|
|
extern Bool noSyncExtension;
|
|
|
|
#endif
|
|
|
|
#ifdef RES
|
|
|
|
extern Bool noResExtension;
|
|
|
|
#endif
|
|
|
|
#ifdef XCMISC
|
|
|
|
extern Bool noXCMiscExtension;
|
|
|
|
#endif
|
2004-07-31 06:23:21 +02:00
|
|
|
#ifdef XEVIE
|
|
|
|
extern Bool noXevieExtension;
|
2004-06-30 22:06:56 +02:00
|
|
|
#endif
|
2004-09-14 02:51:25 +02:00
|
|
|
#ifdef XF86BIGFONT
|
|
|
|
extern Bool noXFree86BigfontExtension;
|
|
|
|
#endif
|
|
|
|
#ifdef XFreeXDGA
|
|
|
|
extern Bool noXFree86DGAExtension;
|
|
|
|
#endif
|
|
|
|
#ifdef XF86DRI
|
|
|
|
extern Bool noXFree86DRIExtension;
|
|
|
|
#endif
|
|
|
|
#ifdef XF86MISC
|
|
|
|
extern Bool noXFree86MiscExtension;
|
|
|
|
#endif
|
|
|
|
#ifdef XF86VIDMODE
|
|
|
|
extern Bool noXFree86VidModeExtension;
|
|
|
|
#endif
|
|
|
|
#ifdef XFIXES
|
|
|
|
extern Bool noXFixesExtension;
|
|
|
|
#endif
|
|
|
|
#ifdef XKB
|
|
|
|
/* |noXkbExtension| is defined in xc/programs/Xserver/xkb/xkbInit.c */
|
|
|
|
extern Bool noXkbExtension;
|
|
|
|
#endif
|
|
|
|
#ifdef PANORAMIX
|
|
|
|
extern Bool noPanoramiXExtension;
|
|
|
|
#endif
|
2007-12-21 10:24:06 +01:00
|
|
|
#ifdef INXQUARTZ
|
|
|
|
extern Bool noPseudoramiXExtension;
|
|
|
|
#endif
|
2004-09-14 02:51:25 +02:00
|
|
|
#ifdef XINPUT
|
|
|
|
extern Bool noXInputExtension;
|
|
|
|
#endif
|
|
|
|
#ifdef XIDLE
|
|
|
|
extern Bool noXIdleExtension;
|
|
|
|
#endif
|
2008-03-28 19:01:34 +01:00
|
|
|
#ifdef XSELINUX
|
|
|
|
extern Bool noSELinuxExtension;
|
|
|
|
#endif
|
2004-09-14 02:51:25 +02:00
|
|
|
#ifdef XV
|
|
|
|
extern Bool noXvExtension;
|
2004-07-31 11:14:06 +02:00
|
|
|
#endif
|
2004-06-30 22:06:56 +02:00
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
#ifndef XFree86LOADER
|
|
|
|
#define INITARGS void
|
|
|
|
typedef void (*InitExtension)(INITARGS);
|
|
|
|
#else /* XFree86Loader */
|
|
|
|
#include "loaderProcs.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef MITSHM
|
|
|
|
#define _XSHM_SERVER_
|
2005-04-20 14:25:48 +02:00
|
|
|
#include <X11/extensions/shmstr.h>
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef XTEST
|
|
|
|
#define _XTEST_SERVER_
|
2005-04-20 14:25:48 +02:00
|
|
|
#include <X11/extensions/XTest.h>
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef XKB
|
2005-04-20 14:25:48 +02:00
|
|
|
#include <X11/extensions/XKB.h>
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef XPRINT
|
2006-01-07 00:06:15 +01:00
|
|
|
#include <X11/extensions/Print.h>
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef XCSECURITY
|
2006-06-21 03:22:51 +02:00
|
|
|
#include "securitysrv.h"
|
2005-04-20 14:25:48 +02:00
|
|
|
#include <X11/extensions/securstr.h>
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
2006-09-08 21:17:01 +02:00
|
|
|
#ifdef XSELINUX
|
|
|
|
#include "xselinux.h"
|
|
|
|
#endif
|
2003-11-14 17:49:22 +01:00
|
|
|
#ifdef PANORAMIX
|
2005-04-20 14:25:48 +02:00
|
|
|
#include <X11/extensions/panoramiXproto.h>
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef XF86BIGFONT
|
2005-04-20 16:16:37 +02:00
|
|
|
#include <X11/extensions/xf86bigfstr.h>
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef RES
|
2005-04-20 14:25:48 +02:00
|
|
|
#include <X11/extensions/XResproto.h>
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* FIXME: this whole block of externs should be from the appropriate headers */
|
2003-11-14 16:54:54 +01:00
|
|
|
#ifdef MITSHM
|
2003-11-14 17:49:22 +01:00
|
|
|
extern void ShmExtensionInit(INITARGS);
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
#ifdef MULTIBUFFER
|
2003-11-14 17:49:22 +01:00
|
|
|
extern void MultibufferExtensionInit(INITARGS);
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
#ifdef PANORAMIX
|
2003-11-14 17:49:22 +01:00
|
|
|
extern void PanoramiXExtensionInit(INITARGS);
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
2007-12-21 10:24:06 +01:00
|
|
|
#ifdef INXQUARTZ
|
|
|
|
extern void PseudoramiXExtensionInit(INITARGS);
|
|
|
|
#endif
|
2003-11-14 16:54:54 +01:00
|
|
|
#ifdef XINPUT
|
2003-11-14 17:49:22 +01:00
|
|
|
extern void XInputExtensionInit(INITARGS);
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
#ifdef XTEST
|
2003-11-14 17:49:22 +01:00
|
|
|
extern void XTestExtensionInit(INITARGS);
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
#ifdef BIGREQS
|
2003-11-14 17:49:22 +01:00
|
|
|
extern void BigReqExtensionInit(INITARGS);
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
#ifdef XIDLE
|
2003-11-14 17:49:22 +01:00
|
|
|
extern void XIdleExtensionInit(INITARGS);
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
#ifdef XTRAP
|
2003-11-14 17:49:22 +01:00
|
|
|
extern void DEC_XTRAPInit(INITARGS);
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
#ifdef SCREENSAVER
|
2003-11-14 17:49:22 +01:00
|
|
|
extern void ScreenSaverExtensionInit (INITARGS);
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
#ifdef XV
|
2003-11-14 17:49:22 +01:00
|
|
|
extern void XvExtensionInit(INITARGS);
|
|
|
|
extern void XvMCExtensionInit(INITARGS);
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
#ifdef XSYNC
|
2003-11-14 17:49:22 +01:00
|
|
|
extern void SyncExtensionInit(INITARGS);
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
#ifdef XKB
|
2003-11-14 17:49:22 +01:00
|
|
|
extern void XkbExtensionInit(INITARGS);
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
#ifdef XCMISC
|
2003-11-14 17:49:22 +01:00
|
|
|
extern void XCMiscExtensionInit(INITARGS);
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
#ifdef XRECORD
|
2003-11-14 17:49:22 +01:00
|
|
|
extern void RecordExtensionInit(INITARGS);
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
#ifdef DBE
|
2003-11-14 17:49:22 +01:00
|
|
|
extern void DbeExtensionInit(INITARGS);
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
#ifdef XCSECURITY
|
2003-11-14 17:49:22 +01:00
|
|
|
extern void SecurityExtensionInit(INITARGS);
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
2006-09-08 21:17:01 +02:00
|
|
|
#ifdef XSELINUX
|
2007-12-28 19:26:26 +01:00
|
|
|
extern void SELinuxExtensionInit(INITARGS);
|
2006-09-08 21:17:01 +02:00
|
|
|
#endif
|
2003-11-14 16:54:54 +01:00
|
|
|
#ifdef XPRINT
|
2003-11-14 17:49:22 +01:00
|
|
|
extern void XpExtensionInit(INITARGS);
|
|
|
|
#endif
|
|
|
|
#ifdef XF86BIGFONT
|
|
|
|
extern void XFree86BigfontExtensionInit(INITARGS);
|
|
|
|
#endif
|
|
|
|
#ifdef XF86VIDMODE
|
|
|
|
extern void XFree86VidModeExtensionInit(INITARGS);
|
|
|
|
#endif
|
|
|
|
#ifdef XF86MISC
|
|
|
|
extern void XFree86MiscExtensionInit(INITARGS);
|
|
|
|
#endif
|
|
|
|
#ifdef XFreeXDGA
|
|
|
|
extern void XFree86DGAExtensionInit(INITARGS);
|
|
|
|
#endif
|
|
|
|
#ifdef GLXEXT
|
2006-03-12 01:11:34 +01:00
|
|
|
typedef struct __GLXprovider __GLXprovider;
|
|
|
|
extern __GLXprovider __glXMesaProvider;
|
|
|
|
extern void GlxPushProvider(__GLXprovider *impl);
|
2003-11-14 17:49:22 +01:00
|
|
|
extern void GlxExtensionInit(INITARGS);
|
2007-11-22 04:51:14 +01:00
|
|
|
#endif
|
2003-11-14 17:49:22 +01:00
|
|
|
#ifdef XF86DRI
|
|
|
|
extern void XFree86DRIExtensionInit(INITARGS);
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
#ifdef DPMSExtension
|
2003-11-14 17:49:22 +01:00
|
|
|
extern void DPMSExtensionInit(INITARGS);
|
|
|
|
#endif
|
|
|
|
#ifdef FONTCACHE
|
|
|
|
extern void FontCacheExtensionInit(INITARGS);
|
|
|
|
#endif
|
|
|
|
#ifdef RENDER
|
|
|
|
extern void RenderExtensionInit(INITARGS);
|
|
|
|
#endif
|
|
|
|
#ifdef RANDR
|
|
|
|
extern void RRExtensionInit(INITARGS);
|
|
|
|
#endif
|
|
|
|
#ifdef RES
|
|
|
|
extern void ResExtensionInit(INITARGS);
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
2004-06-30 22:06:56 +02:00
|
|
|
#ifdef DMXEXT
|
|
|
|
extern void DMXExtensionInit(INITARGS);
|
|
|
|
#endif
|
2004-07-31 03:37:47 +02:00
|
|
|
#ifdef XEVIE
|
|
|
|
extern void XevieExtensionInit(INITARGS);
|
|
|
|
#endif
|
2004-07-29 20:49:42 +02:00
|
|
|
#ifdef XFIXES
|
|
|
|
extern void XFixesExtensionInit(INITARGS);
|
|
|
|
#endif
|
|
|
|
#ifdef DAMAGE
|
|
|
|
extern void DamageExtensionInit(INITARGS);
|
|
|
|
#endif
|
2004-07-31 10:24:14 +02:00
|
|
|
#ifdef COMPOSITE
|
|
|
|
extern void CompositeExtensionInit(INITARGS);
|
|
|
|
#endif
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2004-07-31 06:23:21 +02:00
|
|
|
/* The following is only a small first step towards run-time
|
|
|
|
* configurable extensions.
|
|
|
|
*/
|
|
|
|
typedef struct {
|
|
|
|
char *name;
|
|
|
|
Bool *disablePtr;
|
|
|
|
} ExtensionToggle;
|
|
|
|
|
|
|
|
static ExtensionToggle ExtensionToggleList[] =
|
|
|
|
{
|
2004-09-14 02:51:25 +02:00
|
|
|
/* sort order is extension name string as shown in xdpyinfo */
|
|
|
|
#ifdef BIGREQS
|
|
|
|
{ "BIG-REQUESTS", &noBigReqExtension },
|
|
|
|
#endif
|
|
|
|
#ifdef COMPOSITE
|
|
|
|
{ "Composite", &noCompositeExtension },
|
|
|
|
#endif
|
|
|
|
#ifdef DAMAGE
|
|
|
|
{ "DAMAGE", &noDamageExtension },
|
|
|
|
#endif
|
|
|
|
#ifdef DBE
|
|
|
|
{ "DOUBLE-BUFFER", &noDbeExtension },
|
|
|
|
#endif
|
|
|
|
#ifdef DPMSExtension
|
|
|
|
{ "DPMS", &noDPMSExtension },
|
|
|
|
#endif
|
|
|
|
#ifdef FONTCACHE
|
|
|
|
{ "FontCache", &noFontCacheExtension },
|
|
|
|
#endif
|
|
|
|
#ifdef GLXEXT
|
|
|
|
{ "GLX", &noGlxExtension },
|
|
|
|
#endif
|
|
|
|
#ifdef SCREENSAVER
|
|
|
|
{ "MIT-SCREEN-SAVER", &noScreenSaverExtension },
|
|
|
|
#endif
|
|
|
|
#ifdef MITSHM
|
2004-12-08 06:48:16 +01:00
|
|
|
{ SHMNAME, &noMITShmExtension },
|
2004-09-14 02:51:25 +02:00
|
|
|
#endif
|
|
|
|
#ifdef MULTIBUFFER
|
|
|
|
{ "Multi-Buffering", &noMultibufferExtension },
|
|
|
|
#endif
|
|
|
|
#ifdef RANDR
|
|
|
|
{ "RANDR", &noRRExtension },
|
2004-07-31 06:23:21 +02:00
|
|
|
#endif
|
|
|
|
#ifdef RENDER
|
|
|
|
{ "RENDER", &noRenderExtension },
|
|
|
|
#endif
|
2004-09-14 02:51:25 +02:00
|
|
|
#ifdef SHAPE
|
|
|
|
{ "SHAPE", &noShapeExtension },
|
|
|
|
#endif
|
|
|
|
#ifdef XCSECURITY
|
|
|
|
{ "SECURITY", &noSecurityExtension },
|
|
|
|
#endif
|
|
|
|
#ifdef XSYNC
|
|
|
|
{ "SYNC", &noSyncExtension },
|
|
|
|
#endif
|
|
|
|
#ifdef RES
|
|
|
|
{ "X-Resource", &noResExtension },
|
|
|
|
#endif
|
|
|
|
#ifdef XCMISC
|
|
|
|
{ "XC-MISC", &noXCMiscExtension },
|
2004-07-31 06:23:21 +02:00
|
|
|
#endif
|
|
|
|
#ifdef XEVIE
|
|
|
|
{ "XEVIE", &noXevieExtension },
|
2004-07-31 11:14:06 +02:00
|
|
|
#endif
|
2004-09-14 02:51:25 +02:00
|
|
|
#ifdef XF86BIGFONT
|
|
|
|
{ "XFree86-Bigfont", &noXFree86BigfontExtension },
|
|
|
|
#endif
|
|
|
|
#ifdef XFreeXDGA
|
|
|
|
{ "XFree86-DGA", &noXFree86DGAExtension },
|
|
|
|
#endif
|
|
|
|
#ifdef XF86DRI
|
|
|
|
{ "XFree86-DRI", &noXFree86DRIExtension },
|
|
|
|
#endif
|
|
|
|
#ifdef XF86MISC
|
|
|
|
{ "XFree86-Misc", &noXFree86MiscExtension },
|
|
|
|
#endif
|
|
|
|
#ifdef XF86VIDMODE
|
|
|
|
{ "XFree86-VidModeExtension", &noXFree86VidModeExtension },
|
|
|
|
#endif
|
|
|
|
#ifdef XFIXES
|
|
|
|
{ "XFIXES", &noXFixesExtension },
|
|
|
|
#endif
|
|
|
|
#ifdef PANORAMIX
|
|
|
|
{ "XINERAMA", &noPanoramiXExtension },
|
|
|
|
#endif
|
|
|
|
#ifdef XINPUT
|
|
|
|
{ "XInputExtension", &noXInputExtension },
|
|
|
|
#endif
|
|
|
|
#ifdef XKB
|
|
|
|
{ "XKEYBOARD", &noXkbExtension },
|
2008-03-28 19:01:34 +01:00
|
|
|
#endif
|
|
|
|
#ifdef XSELINUX
|
|
|
|
{ "SELinux", &noSELinuxExtension },
|
2004-09-14 02:51:25 +02:00
|
|
|
#endif
|
|
|
|
{ "XTEST", &noTestExtensions },
|
|
|
|
#ifdef XV
|
|
|
|
{ "XVideo", &noXvExtension },
|
2004-07-31 06:23:21 +02:00
|
|
|
#endif
|
|
|
|
{ NULL, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
Bool EnableDisableExtension(char *name, Bool enable)
|
|
|
|
{
|
|
|
|
ExtensionToggle *ext = &ExtensionToggleList[0];
|
|
|
|
|
|
|
|
for (ext = &ExtensionToggleList[0]; ext->name != NULL; ext++) {
|
|
|
|
if (strcmp(name, ext->name) == 0) {
|
|
|
|
*ext->disablePtr = !enable;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-07-31 11:14:06 +02:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
void EnableDisableExtensionError(char *name, Bool enable)
|
|
|
|
{
|
|
|
|
ExtensionToggle *ext = &ExtensionToggleList[0];
|
|
|
|
|
2004-07-31 06:23:21 +02:00
|
|
|
ErrorF("Extension \"%s\" is not recognized\n", name);
|
|
|
|
ErrorF("Only the following extensions can be run-time %s:\n",
|
|
|
|
enable ? "enabled" : "disabled");
|
|
|
|
for (ext = &ExtensionToggleList[0]; ext->name != NULL; ext++)
|
|
|
|
ErrorF(" %s\n", ext->name);
|
|
|
|
}
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
#ifndef XFree86LOADER
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
/*ARGSUSED*/
|
|
|
|
void
|
|
|
|
InitExtensions(argc, argv)
|
|
|
|
int argc;
|
|
|
|
char *argv[];
|
|
|
|
{
|
|
|
|
#ifdef PANORAMIX
|
2003-11-14 17:49:22 +01:00
|
|
|
# if !defined(PRINT_ONLY_SERVER) && !defined(NO_PANORAMIX)
|
2003-11-14 16:54:54 +01:00
|
|
|
if (!noPanoramiXExtension) PanoramiXExtensionInit();
|
2003-11-14 17:49:22 +01:00
|
|
|
# endif
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
2007-12-21 10:24:06 +01:00
|
|
|
#ifdef INXQUARTZ
|
|
|
|
if(!noPseudoramiXExtension) PseudoramiXExtensionInit();
|
|
|
|
#endif
|
2003-11-14 16:54:54 +01:00
|
|
|
#ifdef SHAPE
|
2004-12-08 06:48:16 +01:00
|
|
|
if (!noShapeExtension) ShapeExtensionInit();
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
#ifdef MITSHM
|
2004-09-14 02:51:25 +02:00
|
|
|
if (!noMITShmExtension) ShmExtensionInit();
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
#ifdef MULTIBUFFER
|
2004-09-14 02:51:25 +02:00
|
|
|
if (!noMultibufferExtension) MultibufferExtensionInit();
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
2006-10-23 01:50:03 +02:00
|
|
|
#if defined(XINPUT)
|
2004-09-14 02:51:25 +02:00
|
|
|
if (!noXInputExtension) XInputExtensionInit();
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
#ifdef XTEST
|
|
|
|
if (!noTestExtensions) XTestExtensionInit();
|
|
|
|
#endif
|
|
|
|
#ifdef BIGREQS
|
2004-09-14 02:51:25 +02:00
|
|
|
if (!noBigReqExtension) BigReqExtensionInit();
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
#ifdef XIDLE
|
2004-09-14 02:51:25 +02:00
|
|
|
if (!noXIdleExtension) XIdleExtensionInit();
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
#ifdef XTRAP
|
|
|
|
if (!noTestExtensions) DEC_XTRAPInit();
|
|
|
|
#endif
|
|
|
|
#if defined(SCREENSAVER) && !defined(PRINT_ONLY_SERVER)
|
2004-09-14 02:51:25 +02:00
|
|
|
if (!noScreenSaverExtension) ScreenSaverExtensionInit ();
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
#ifdef XV
|
2004-09-14 02:51:25 +02:00
|
|
|
if (!noXvExtension) {
|
|
|
|
XvExtensionInit();
|
|
|
|
XvMCExtensionInit();
|
|
|
|
}
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
#ifdef XSYNC
|
2004-09-14 02:51:25 +02:00
|
|
|
if (!noSyncExtension) SyncExtensionInit();
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
2006-10-23 01:50:03 +02:00
|
|
|
#if defined(XKB) && !defined(PRINT_ONLY_SERVER)
|
2003-11-14 16:54:54 +01:00
|
|
|
if (!noXkbExtension) XkbExtensionInit();
|
|
|
|
#endif
|
|
|
|
#ifdef XCMISC
|
2004-09-14 02:51:25 +02:00
|
|
|
if (!noXCMiscExtension) XCMiscExtensionInit();
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
#ifdef XRECORD
|
|
|
|
if (!noTestExtensions) RecordExtensionInit();
|
|
|
|
#endif
|
|
|
|
#ifdef DBE
|
2004-09-14 02:51:25 +02:00
|
|
|
if (!noDbeExtension) DbeExtensionInit();
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
#ifdef XCSECURITY
|
2004-09-14 02:51:25 +02:00
|
|
|
if (!noSecurityExtension) SecurityExtensionInit();
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
2006-09-08 21:17:01 +02:00
|
|
|
#ifdef XSELINUX
|
2008-03-28 19:01:34 +01:00
|
|
|
if (!noSELinuxExtension) SELinuxExtensionInit();
|
2006-09-08 21:17:01 +02:00
|
|
|
#endif
|
2003-11-14 16:54:54 +01:00
|
|
|
#ifdef XPRINT
|
2004-09-14 02:51:25 +02:00
|
|
|
XpExtensionInit(); /* server-specific extension, cannot be disabled */
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
2003-11-14 17:49:22 +01:00
|
|
|
#if defined(DPMSExtension) && !defined(NO_HW_ONLY_EXTS)
|
2004-09-14 02:51:25 +02:00
|
|
|
if (!noDPMSExtension) DPMSExtensionInit();
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
2003-11-14 17:49:22 +01:00
|
|
|
#ifdef FONTCACHE
|
2004-09-14 02:51:25 +02:00
|
|
|
if (!noFontCacheExtension) FontCacheExtensionInit();
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef XF86BIGFONT
|
2004-09-14 02:51:25 +02:00
|
|
|
if (!noXFree86BigfontExtension) XFree86BigfontExtensionInit();
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#if !defined(PRINT_ONLY_SERVER) && !defined(NO_HW_ONLY_EXTS)
|
|
|
|
#if defined(XF86VIDMODE)
|
2004-09-14 02:51:25 +02:00
|
|
|
if (!noXFree86VidModeExtension) XFree86VidModeExtensionInit();
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#if defined(XF86MISC)
|
2004-09-14 02:51:25 +02:00
|
|
|
if (!noXFree86MiscExtension) XFree86MiscExtensionInit();
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#if defined(XFreeXDGA)
|
2004-09-14 02:51:25 +02:00
|
|
|
if (!noXFree86DGAExtension) XFree86DGAExtensionInit();
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef XF86DRI
|
2004-09-14 02:51:25 +02:00
|
|
|
if (!noXFree86DRIExtension) XFree86DRIExtensionInit();
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#endif
|
2004-07-31 10:24:14 +02:00
|
|
|
#ifdef XFIXES
|
|
|
|
/* must be before Render to layer DisplayCursor correctly */
|
2004-09-14 02:51:25 +02:00
|
|
|
if (!noXFixesExtension) XFixesExtensionInit();
|
2004-07-31 10:24:14 +02:00
|
|
|
#endif
|
2003-11-14 17:49:22 +01:00
|
|
|
#ifdef RENDER
|
2004-07-31 06:23:21 +02:00
|
|
|
if (!noRenderExtension) RenderExtensionInit();
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef RANDR
|
2004-09-14 02:51:25 +02:00
|
|
|
if (!noRRExtension) RRExtensionInit();
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef RES
|
2004-09-14 02:51:25 +02:00
|
|
|
if (!noResExtension) ResExtensionInit();
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
2004-06-30 22:06:56 +02:00
|
|
|
#ifdef DMXEXT
|
2004-09-14 02:51:25 +02:00
|
|
|
DMXExtensionInit(); /* server-specific extension, cannot be disabled */
|
2004-06-30 22:06:56 +02:00
|
|
|
#endif
|
2004-07-31 03:37:47 +02:00
|
|
|
#ifdef XEVIE
|
2004-07-31 06:23:21 +02:00
|
|
|
if (!noXevieExtension) XevieExtensionInit();
|
2004-07-31 03:37:47 +02:00
|
|
|
#endif
|
2004-07-31 10:24:14 +02:00
|
|
|
#ifdef COMPOSITE
|
2004-07-31 11:14:06 +02:00
|
|
|
if (!noCompositeExtension) CompositeExtensionInit();
|
2004-07-31 10:24:14 +02:00
|
|
|
#endif
|
2004-08-03 07:39:19 +02:00
|
|
|
#ifdef DAMAGE
|
2004-09-14 02:51:25 +02:00
|
|
|
if (!noDamageExtension) DamageExtensionInit();
|
2004-08-03 07:39:19 +02:00
|
|
|
#endif
|
2007-10-29 23:06:41 +01:00
|
|
|
|
|
|
|
#ifdef GLXEXT
|
|
|
|
GlxPushProvider(&__glXMesaProvider);
|
|
|
|
if (!noGlxExtension) GlxExtensionInit();
|
|
|
|
#endif
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
void
|
|
|
|
InitVisualWrap()
|
|
|
|
{
|
|
|
|
miResetInitVisuals();
|
|
|
|
}
|
|
|
|
|
|
|
|
#else /* XFree86LOADER */
|
|
|
|
/* List of built-in (statically linked) extensions */
|
|
|
|
static ExtensionModule staticExtensions[] = {
|
|
|
|
#ifdef MITSHM
|
2004-12-08 06:48:16 +01:00
|
|
|
{ ShmExtensionInit, SHMNAME, &noMITShmExtension, NULL, NULL },
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef XINPUT
|
2004-12-08 06:48:16 +01:00
|
|
|
{ XInputExtensionInit, "XInputExtension", &noXInputExtension, NULL, NULL },
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef XTEST
|
|
|
|
{ XTestExtensionInit, XTestExtensionName, &noTestExtensions, NULL, NULL },
|
|
|
|
#endif
|
|
|
|
#ifdef XIDLE
|
2004-12-08 06:48:16 +01:00
|
|
|
{ XIdleExtensionInit, "XIDLE", &noXIdleExtension, NULL, NULL },
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef XKB
|
|
|
|
{ XkbExtensionInit, XkbName, &noXkbExtension, NULL, NULL },
|
|
|
|
#endif
|
|
|
|
#ifdef XCSECURITY
|
2007-08-03 16:56:18 +02:00
|
|
|
{ SecurityExtensionInit, SECURITY_EXTENSION_NAME, &noSecurityExtension, NULL, NULL },
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef XPRINT
|
|
|
|
{ XpExtensionInit, XP_PRINTNAME, NULL, NULL, NULL },
|
|
|
|
#endif
|
|
|
|
#ifdef PANORAMIX
|
|
|
|
{ PanoramiXExtensionInit, PANORAMIX_PROTOCOL_NAME, &noPanoramiXExtension, NULL, NULL },
|
|
|
|
#endif
|
2004-07-31 10:24:14 +02:00
|
|
|
#ifdef XFIXES
|
|
|
|
/* must be before Render to layer DisplayCursor correctly */
|
2004-12-08 06:48:16 +01:00
|
|
|
{ XFixesExtensionInit, "XFIXES", &noXFixesExtension, NULL, NULL },
|
2004-07-31 10:24:14 +02:00
|
|
|
#endif
|
2003-11-14 17:49:22 +01:00
|
|
|
#ifdef XF86BIGFONT
|
2004-12-08 06:48:16 +01:00
|
|
|
{ XFree86BigfontExtensionInit, XF86BIGFONTNAME, &noXFree86BigfontExtension, NULL, NULL },
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef RENDER
|
2004-07-31 06:23:21 +02:00
|
|
|
{ RenderExtensionInit, "RENDER", &noRenderExtension, NULL, NULL },
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef RANDR
|
2004-12-08 06:48:16 +01:00
|
|
|
{ RRExtensionInit, "RANDR", &noRRExtension, NULL, NULL },
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
2004-07-31 10:24:14 +02:00
|
|
|
#ifdef COMPOSITE
|
2004-07-31 11:14:06 +02:00
|
|
|
{ CompositeExtensionInit, "COMPOSITE", &noCompositeExtension, NULL },
|
2004-07-31 10:24:14 +02:00
|
|
|
#endif
|
2004-08-03 07:39:19 +02:00
|
|
|
#ifdef DAMAGE
|
2004-12-08 06:48:16 +01:00
|
|
|
{ DamageExtensionInit, "DAMAGE", &noDamageExtension, NULL },
|
2004-08-03 07:39:19 +02:00
|
|
|
#endif
|
2004-07-31 03:37:47 +02:00
|
|
|
#ifdef XEVIE
|
2004-07-31 06:23:21 +02:00
|
|
|
{ XevieExtensionInit, "XEVIE", &noXevieExtension, NULL },
|
2004-07-29 20:49:42 +02:00
|
|
|
#endif
|
2003-11-14 17:49:22 +01:00
|
|
|
{ NULL, NULL, NULL, NULL, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
/*ARGSUSED*/
|
|
|
|
void
|
|
|
|
InitExtensions(argc, argv)
|
|
|
|
int argc;
|
|
|
|
char *argv[];
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
ExtensionModule *ext;
|
|
|
|
static Bool listInitialised = FALSE;
|
|
|
|
|
|
|
|
if (!listInitialised) {
|
|
|
|
/* Add built-in extensions to the list. */
|
|
|
|
for (i = 0; staticExtensions[i].name; i++)
|
|
|
|
LoadExtension(&staticExtensions[i], TRUE);
|
|
|
|
|
|
|
|
/* Sort the extensions according the init dependencies. */
|
|
|
|
LoaderSortExtensions();
|
|
|
|
listInitialised = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; ExtensionModuleList[i].name != NULL; i++) {
|
|
|
|
ext = &ExtensionModuleList[i];
|
|
|
|
if (ext->initFunc != NULL &&
|
|
|
|
(ext->disablePtr == NULL ||
|
|
|
|
(ext->disablePtr != NULL && !*ext->disablePtr))) {
|
|
|
|
(ext->initFunc)();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void (*__miHookInitVisualsFunction)(miInitVisualsProcPtr *);
|
|
|
|
|
|
|
|
void
|
|
|
|
InitVisualWrap()
|
|
|
|
{
|
|
|
|
miResetInitVisuals();
|
|
|
|
if (__miHookInitVisualsFunction)
|
|
|
|
(*__miHookInitVisualsFunction)(&miInitVisualsProc);
|
|
|
|
}
|
|
|
|
|
2006-02-15 20:05:55 +01:00
|
|
|
_X_EXPORT void
|
|
|
|
miHookInitVisuals(void (**old)(miInitVisualsProcPtr *),
|
|
|
|
void (*new)(miInitVisualsProcPtr *))
|
2003-11-14 17:49:22 +01:00
|
|
|
{
|
|
|
|
if (old)
|
|
|
|
*old = __miHookInitVisualsFunction;
|
|
|
|
__miHookInitVisualsFunction = new;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* XFree86LOADER */
|