summaryrefslogtreecommitdiff
path: root/xserver/mi/miinitext.c
diff options
context:
space:
mode:
Diffstat (limited to 'xserver/mi/miinitext.c')
-rw-r--r--xserver/mi/miinitext.c206
1 files changed, 67 insertions, 139 deletions
diff --git a/xserver/mi/miinitext.c b/xserver/mi/miinitext.c
index 5fc44e3f4..b7c702127 100644
--- a/xserver/mi/miinitext.c
+++ b/xserver/mi/miinitext.c
@@ -97,14 +97,6 @@ SOFTWARE.
#undef DPMSExtension
#endif
-#ifdef HAVE_KDRIVE_CONFIG_H
-#include <kdrive-config.h>
-#endif
-
-#ifdef HAVE_XGL_CONFIG_H
-#include <xgl-config.h>
-#endif
-
#include "misc.h"
#include "extension.h"
#include "extinit.h"
@@ -112,88 +104,93 @@ SOFTWARE.
#include "nonsdk_extinit.h"
#endif
#include "micmap.h"
+#include "os.h"
#include "globals.h"
-/* The following is only a small first step towards run-time
- * configurable extensions.
- */
-typedef struct {
- const char *name;
- Bool *disablePtr;
-} ExtensionToggle;
-
-static ExtensionToggle ExtensionToggleList[] = {
- /* sort order is extension name string as shown in xdpyinfo */
- {"Generic Events", &noGEExtension},
-#ifdef COMPOSITE
- {"Composite", &noCompositeExtension},
-#endif
-#ifdef DAMAGE
- {"DAMAGE", &noDamageExtension},
+/* List of built-in (statically linked) extensions */
+static const ExtensionModule staticExtensions[] = {
+ {GEExtensionInit, "Generic Event Extension", &noGEExtension},
+ {ShapeExtensionInit, "SHAPE", NULL},
+#ifdef MITSHM
+ {ShmExtensionInit, "MIT-SHM", &noMITShmExtension},
#endif
-#ifdef DBE
- {"DOUBLE-BUFFER", &noDbeExtension},
+ {XInputExtensionInit, "XInputExtension", NULL},
+#ifdef XTEST
+ {XTestExtensionInit, "XTEST", &noTestExtensions},
#endif
-#ifdef DPMSExtension
- {"DPMS", &noDPMSExtension},
+ {BigReqExtensionInit, "BIG-REQUESTS", NULL},
+ {SyncExtensionInit, "SYNC", NULL},
+ {XkbExtensionInit, "XKEYBOARD", NULL},
+ {XCMiscExtensionInit, "XC-MISC", NULL},
+#ifdef XCSECURITY
+ {SecurityExtensionInit, "SECURITY", &noSecurityExtension},
#endif
-#ifdef GLXEXT
- {"GLX", &noGlxExtension},
+#ifdef PANORAMIX
+ {PanoramiXExtensionInit, "XINERAMA", &noPanoramiXExtension},
#endif
-#ifdef SCREENSAVER
- {"MIT-SCREEN-SAVER", &noScreenSaverExtension},
+#ifdef INXQUARTZ
+ /* PseudoramiXExtensionInit must be done before RRExtensionInit, or
+ * XQuartz will render windows offscreen.
+ */
+ {PseudoramiXExtensionInit, "PseudoramiX", &noPseudoramiXExtension},
#endif
-#ifdef MITSHM
- {SHMNAME, &noMITShmExtension},
+ /* must be before Render to layer DisplayCursor correctly */
+ {XFixesExtensionInit, "XFIXES", &noXFixesExtension},
+#ifdef XF86BIGFONT
+ {XFree86BigfontExtensionInit, "XFree86-Bigfont", &noXFree86BigfontExtension},
#endif
+ {RenderExtensionInit, "RENDER", &noRenderExtension},
#ifdef RANDR
- {"RANDR", &noRRExtension},
+ {RRExtensionInit, "RANDR", &noRRExtension},
#endif
- {"RENDER", &noRenderExtension},
-#ifdef XCSECURITY
- {"SECURITY", &noSecurityExtension},
+#ifdef COMPOSITE
+ {CompositeExtensionInit, "COMPOSITE", &noCompositeExtension},
#endif
-#ifdef RES
- {"X-Resource", &noResExtension},
+#ifdef DAMAGE
+ {DamageExtensionInit, "DAMAGE", &noDamageExtension},
#endif
-#ifdef XF86BIGFONT
- {"XFree86-Bigfont", &noXFree86BigfontExtension},
+#ifdef SCREENSAVER
+ {ScreenSaverExtensionInit, "MIT-SCREEN-SAVER", &noScreenSaverExtension},
#endif
-#ifdef XORGSERVER
-#ifdef XFreeXDGA
- {"XFree86-DGA", &noXFree86DGAExtension},
+#ifdef DBE
+ {DbeExtensionInit, "DOUBLE-BUFFER", &noDbeExtension},
#endif
-#ifdef XF86DRI
- {"XFree86-DRI", &noXFree86DRIExtension},
+#ifdef XRECORD
+ {RecordExtensionInit, "RECORD", &noTestExtensions},
#endif
-#ifdef XF86VIDMODE
- {"XFree86-VidModeExtension", &noXFree86VidModeExtension},
+#ifdef DPMSExtension
+ {DPMSExtensionInit, "DPMS", &noDPMSExtension},
#endif
+#ifdef PRESENT
+ {present_extension_init, "Present", NULL},
#endif
- {"XFIXES", &noXFixesExtension},
-#ifdef PANORAMIX
- {"XINERAMA", &noPanoramiXExtension},
+#ifdef DRI3
+ {dri3_extension_init, "DRI3", NULL},
#endif
- {"XInputExtension", NULL},
- {"XKEYBOARD", NULL},
-#ifdef XSELINUX
- {"SELinux", &noSELinuxExtension},
+#ifdef RES
+ {ResExtensionInit, "X-Resource", &noResExtension},
#endif
- {"XTEST", &noTestExtensions},
#ifdef XV
- {"XVideo", &noXvExtension},
+ {XvExtensionInit, "XVideo", &noXvExtension},
+ {XvMCExtensionInit, "XVideo-MotionCompensation", &noXvExtension},
+#endif
+#ifdef XSELINUX
+ {SELinuxExtensionInit, "SELinux", &noSELinuxExtension},
+#endif
+#ifdef GLXEXT
+ {GlxExtensionInit, "GLX", &noGlxExtension},
#endif
};
Bool
EnableDisableExtension(const char *name, Bool enable)
{
- ExtensionToggle *ext;
+ const ExtensionModule *ext;
int i;
- for (i = 0; i < ARRAY_SIZE(ExtensionToggleList); i++) {
- ext = &ExtensionToggleList[i];
- if (strcmp(name, ext->name) == 0) {
+ for (i = 0; i < ARRAY_SIZE(staticExtensions); i++) {
+ ext = &staticExtensions[i];
+ if (strcasecmp(name, ext->name) == 0) {
if (ext->disablePtr != NULL) {
*ext->disablePtr = !enable;
return TRUE;
@@ -212,12 +209,12 @@ EnableDisableExtension(const char *name, Bool enable)
void
EnableDisableExtensionError(const char *name, Bool enable)
{
- ExtensionToggle *ext;
+ const ExtensionModule *ext;
int i;
Bool found = FALSE;
- for (i = 0; i < ARRAY_SIZE(ExtensionToggleList); i++) {
- ext = &ExtensionToggleList[i];
+ for (i = 0; i < ARRAY_SIZE(staticExtensions); i++) {
+ ext = &staticExtensions[i];
if ((strcmp(name, ext->name) == 0) && (ext->disablePtr == NULL)) {
ErrorF("[mi] Extension \"%s\" can not be disabled\n", name);
found = TRUE;
@@ -228,86 +225,14 @@ EnableDisableExtensionError(const char *name, Bool enable)
ErrorF("[mi] Extension \"%s\" is not recognized\n", name);
ErrorF("[mi] Only the following extensions can be run-time %s:\n",
enable ? "enabled" : "disabled");
- for (i = 0; i < ARRAY_SIZE(ExtensionToggleList); i++) {
- ext = &ExtensionToggleList[i];
+ for (i = 0; i < ARRAY_SIZE(staticExtensions); i++) {
+ ext = &staticExtensions[i];
if (ext->disablePtr != NULL) {
ErrorF("[mi] %s\n", ext->name);
}
}
}
-/* List of built-in (statically linked) extensions */
-static const ExtensionModule staticExtensions[] = {
- {GEExtensionInit, "Generic Event Extension", &noGEExtension},
- {ShapeExtensionInit, "SHAPE", NULL},
-#ifdef MITSHM
- {ShmExtensionInit, SHMNAME, &noMITShmExtension},
-#endif
- {XInputExtensionInit, "XInputExtension", NULL},
-#ifdef XTEST
- {XTestExtensionInit, XTestExtensionName, &noTestExtensions},
-#endif
- {BigReqExtensionInit, "BIG-REQUESTS", NULL},
- {SyncExtensionInit, "SYNC", NULL},
- {XkbExtensionInit, XkbName, NULL},
- {XCMiscExtensionInit, "XC-MISC", NULL},
-#ifdef XCSECURITY
- {SecurityExtensionInit, SECURITY_EXTENSION_NAME, &noSecurityExtension},
-#endif
-#ifdef PANORAMIX
- {PanoramiXExtensionInit, PANORAMIX_PROTOCOL_NAME, &noPanoramiXExtension},
-#endif
-#ifdef INXQUARTZ
- /* PseudoramiXExtensionInit must be done before RRExtensionInit, or
- * XQuartz will render windows offscreen.
- */
- {PseudoramiXExtensionInit, "PseudoramiX", &noPseudoramiXExtension},
-#endif
- /* must be before Render to layer DisplayCursor correctly */
- {XFixesExtensionInit, "XFIXES", &noXFixesExtension},
-#ifdef XF86BIGFONT
- {XFree86BigfontExtensionInit, XF86BIGFONTNAME, &noXFree86BigfontExtension},
-#endif
- {RenderExtensionInit, "RENDER", &noRenderExtension},
-#ifdef RANDR
- {RRExtensionInit, "RANDR", &noRRExtension},
-#endif
-#ifdef COMPOSITE
- {CompositeExtensionInit, "COMPOSITE", &noCompositeExtension},
-#endif
-#ifdef DAMAGE
- {DamageExtensionInit, "DAMAGE", &noDamageExtension},
-#endif
-#ifdef SCREENSAVER
- {ScreenSaverExtensionInit, ScreenSaverName, &noScreenSaverExtension},
-#endif
-#ifdef DBE
- {DbeExtensionInit, "DOUBLE-BUFFER", &noDbeExtension},
-#endif
-#ifdef XRECORD
- {RecordExtensionInit, "RECORD", &noTestExtensions},
-#endif
-#ifdef DPMSExtension
- {DPMSExtensionInit, DPMSExtensionName, &noDPMSExtension},
-#endif
-#ifdef PRESENT
- {present_extension_init, PRESENT_NAME, NULL},
-#endif
-#ifdef DRI3
- {dri3_extension_init, DRI3_NAME, NULL},
-#endif
-#ifdef RES
- {ResExtensionInit, XRES_NAME, &noResExtension},
-#endif
-#ifdef XV
- {XvExtensionInit, XvName, &noXvExtension},
- {XvMCExtensionInit, XvMCName, &noXvExtension},
-#endif
-#ifdef XSELINUX
- {SELinuxExtensionInit, SELINUX_EXTENSION_NAME, &noSELinuxExtension},
-#endif
-};
-
static ExtensionModule *ExtensionModuleList = NULL;
static int numExtensionModules = 0;
@@ -336,6 +261,9 @@ InitExtensions(int argc, char *argv[])
ext = &ExtensionModuleList[i];
if (ext->initFunc != NULL &&
(ext->disablePtr == NULL || !*ext->disablePtr)) {
+ LogMessageVerb(X_INFO, 3, "Initializing extension %s\n",
+ ext->name);
+
(ext->initFunc) ();
}
}