diff options
Diffstat (limited to 'xc/programs/Xserver/mi/miinitext.c')
-rw-r--r-- | xc/programs/Xserver/mi/miinitext.c | 150 |
1 files changed, 96 insertions, 54 deletions
diff --git a/xc/programs/Xserver/mi/miinitext.c b/xc/programs/Xserver/mi/miinitext.c index 3570f6b59..79ec1a1ab 100644 --- a/xc/programs/Xserver/mi/miinitext.c +++ b/xc/programs/Xserver/mi/miinitext.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/mi/miinitext.c,v 3.43 1999/12/27 00:50:54 robin Exp $ */ +/* $XFree86: xc/programs/Xserver/mi/miinitext.c,v 3.49 2000/02/13 06:15:41 dawes Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -73,7 +73,36 @@ extern Bool noXkbExtension; #endif typedef void (*InitExtension)(INITARGS); #else /* XFree86Loader */ -#include "xf86Module.h" +#include "loaderProcs.h" +#endif + +#include "Xlib.h" +#ifdef MITSHM +#include "shmstr.h" +#endif +#ifdef XTEST +#include "XTest.h" +#endif +#ifdef XKB +#include "XKB.h" +#endif +#ifdef LBX +#include "lbxstr.h" +#endif +#ifdef XPRINT +#include "Print.h" +#endif +#ifdef XAPPGROUP +#include "Xagstr.h" +#endif +#ifdef XCSECURITY +#include "securstr.h" +#endif +#ifdef PANORAMIX +#include "panoramiXproto.h" +#endif +#ifdef XF86BIGFONT +#include "xf86bigfstr.h" #endif /* FIXME: this whole block of externs should be from the appropriate headers */ @@ -155,6 +184,9 @@ extern void SecurityExtensionInit(INITARGS); #ifdef XPRINT extern void XpExtensionInit(INITARGS); #endif +#ifdef XF86BIGFONT +extern void XFree86BigfontExtensionInit(INITARGS); +#endif #ifdef XF86VIDMODE extern void XFree86VidModeExtensionInit(INITARGS); #endif @@ -183,6 +215,9 @@ extern void XAntiExtensionInit(INITARGS); #ifdef DPS extern void DPSExtensionInit(INITARGS); #endif +#ifdef FONTCACHE +extern void FontCacheExtensionInit(INITARGS); +#endif #ifndef XFree86LOADER @@ -278,9 +313,15 @@ InitExtensions(argc, argv) #if defined(DPMSExtension) && !defined(NO_HW_ONLY_EXTS) DPMSExtensionInit(); #endif +#ifdef FONTCACHE + FontCacheExtensionInit(); +#endif #ifdef XANTI XAntiExtensionInit(); #endif +#ifdef XF86BIGFONT + XFree86BigfontExtensionInit(); +#endif #if !defined(PRINT_ONLY_SERVER) && !defined(NO_HW_ONLY_EXTS) #if defined(XF86VIDMODE) XFree86VidModeExtensionInit(); @@ -321,6 +362,7 @@ InitVisualWrap() } #else /* XFree86LOADER */ +#if 0 /* FIXME:The names here must come from the headers. those with ?? are not included in X11R6.3 sample implementation, so there's a problem... */ /* XXX use the correct #ifdefs for symbols not present when an extension @@ -368,89 +410,89 @@ ExtensionModule extension[] = { NULL, "NOXINERAMA", NULL, NULL }, #endif { NULL, "XAnti", NULL, NULL }, + { NULL, "XFree86-Bigfont", NULL, NULL }, { NULL, "XFree86-DRI", NULL, NULL }, { NULL, "Adobe-DPS-Extension", NULL, NULL }, + { NULL, "FontCache", NULL, NULL }, { NULL, NULL, NULL, NULL } }; +#endif -/*ARGSUSED*/ -void -InitExtensions(argc, argv) - int argc; - char *argv[]; -{ - int i; -#if 1 - /* Add static extensions */ +/* List of built-in (statically linked) extensions */ +static ExtensionModule staticExtensions[] = { #ifdef BEZIER - extension[0].initFunc = BezierExtensionInit; -#endif + { BezierExtensionInit, "BEZIER", NULL, NULL, NULL }, +#endif #ifdef XTESTEXT1 - extension[1].initFunc = XTestExtension1Init; + { XTestExtension1Init, "XTEST1", &noTestExtensions, NULL, NULL }, #endif - /* 2 - SHAPE */ #ifdef MITSHM - extension[3].initFunc = ShmExtensionInit; + { ShmExtensionInit, SHMNAME, NULL, NULL, NULL }, #endif - /* 4 - pex */ - /* 5 - multibuf */ #ifdef XINPUT - extension[6].initFunc = XInputExtensionInit; + { XInputExtensionInit, "XInputExtension", NULL, NULL, NULL }, #endif #ifdef XTEST - extension[7].initFunc = XTestExtensionInit; + { XTestExtensionInit, XTestExtensionName, &noTestExtensions, NULL, NULL }, #endif - /* 8 - BigReqs */ - /* 9 - MITMisc */ #ifdef XIDLE - extension[10].initFunc = XIdleExtensionInit; + { XIdleExtensionInit, "XIDLE", NULL, NULL, NULL }, #endif #ifdef XTRAP - extension[11].initFunc = DEC_XTRAPIbit; + { DEC_XTRAPIbit, "XTRAP", &noTestExtensions, NULL, NULL }, #endif - /* 12 - ScreenSaver */ - /* 13 - XVideo */ - /* 14 - XIE */ - /* 15 - XSYNC */ #ifdef XKB - extension[16].initFunc = XkbExtensionInit; + { XkbExtensionInit, XkbName, &noXkbExtension, NULL, NULL }, #endif - /* 17 - XCMISC */ - /* 18 - XRECORD */ #ifdef LBX - extension[19].initFunc = LbxExtensionInit; + { LbxExtensionInit, LBXNAME, NULL, NULL, NULL }, #endif - /* 20 - DBE */ #ifdef XAPPGROUP - extension[21].initFunc = XagExtensionInit; + { XagExtensionInit, XAGNAME, NULL, NULL, NULL }, #endif #ifdef XCSECURITY - extension[22].initFunc = SecurityExtensionInit; + { SecurityExtensionInit, SECURITY_EXTENSION_NAME, NULL, NULL, NULL }, #endif #ifdef XPRINT - extension[23].initFunc = XpExtensionInit; -#endif - /* 24 - XF86VidMode */ - /* 25 - XF86Misc */ - /* 26 - XF86DGA */ - /* 27 - DPMS */ - /* 28 - GLX */ - /* 29 - TOG-CUP */ - /* 30 - EVI */ + { XpExtensionInit, XP_PRINTNAME, NULL, NULL, NULL }, +#endif #ifdef PANORAMIX - extension[31].initFunc = PanoramiXExtensionInit; + { PanoramiXExtensionInit, PANORAMIX_PROTOCOL_NAME, &noPanoramiXExtension, NULL, NULL }, #endif - /* 31 - XAnti */ - /* 32 - XF86DRI */ - /* 33 - Adobe-DPS-Extension */ - +#ifdef XF86BIGFONT + { XFree86BigfontExtensionInit, XF86BIGFONTNAME, NULL, NULL, NULL }, #endif - for (i = 0; extension[i].name != NULL; i++) - if (extension[i].initFunc != NULL && - (extension[i].disablePtr == NULL || - (extension[i].disablePtr != NULL && !*extension[i].disablePtr))) { - (*extension[i].initFunc)(); + { NULL, NULL, NULL, NULL, NULL } +}; + +/*ARGSUSED*/ +void +InitExtensions(argc, argv) + int argc; + char *argv[]; +{ + int i, j, k, numExts, ii; + ExtensionModule *ext, *newList; + 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 *); |