Index: programs/Xserver/hw/xfree86/common/xf86Config.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/common/xf86Config.c,v retrieving revision 1.4 diff -u -p -r1.4 xf86Config.c --- programs/Xserver/hw/xfree86/common/xf86Config.c 9 Aug 2004 02:08:35 -0000 1.4 +++ programs/Xserver/hw/xfree86/common/xf86Config.c 15 Aug 2004 02:13:43 -0000 @@ -374,13 +374,14 @@ xf86DriverlistFromConfig() Bool xf86BuiltinInputDriver(const char *name) { +#ifdef USE_DEPRECATED_KEYBOARD_DRIVER if (xf86NameCmp(name, "keyboard") == 0) return TRUE; else +#endif return FALSE; } - char ** xf86InputDriverlistFromConfig() { Index: programs/Xserver/hw/xfree86/common/xf86Init.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/common/xf86Init.c,v retrieving revision 1.7 diff -u -p -r1.7 xf86Init.c --- programs/Xserver/hw/xfree86/common/xf86Init.c 10 Aug 2004 21:37:35 -0000 1.7 +++ programs/Xserver/hw/xfree86/common/xf86Init.c 15 Aug 2004 02:13:44 -0000 @@ -1026,17 +1026,8 @@ InitInput(argc, argv) continue; } -#else - if (!xf86NameCmp(pDev->driver, "keyboard")) { - xf86MsgVerb(X_ERROR, 0, "*** ERROR the legacy keyboard driver \"keyboard\" is deprecated\n"); - xf86MsgVerb(X_ERROR, 0, "*** and has not been compiled into this X server. It will be removed\n"); - xf86MsgVerb(X_ERROR, 0, "*** in the next release of the Xorg server.\n"); - xf86MsgVerb(X_ERROR, 0, "*** Please consider using the the new \"kbd\" driver for \"%s\".\n", - pDev->identifier); - - continue; - } #endif + if ((pDrv = MatchInput(pDev)) == NULL) { xf86Msg(X_ERROR, "No Input driver matching `%s'\n", pDev->driver); /* XXX For now, just continue. */ Index: programs/Xserver/hw/xfree86/input/keyboard/Imakefile =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/input/keyboard/Imakefile,v retrieving revision 1.2 diff -u -p -r1.2 Imakefile --- programs/Xserver/hw/xfree86/input/keyboard/Imakefile 23 Apr 2004 19:54:03 -0000 1.2 +++ programs/Xserver/hw/xfree86/input/keyboard/Imakefile 15 Aug 2004 02:13:45 -0000 @@ -8,11 +8,17 @@ OBJS = kbd.o DRIVER = kbd +COMPAT_DRIVER = keyboard + +#if UseDeprecatedKeyboardDriver + KEYBOARD_DEFS = -DUSE_DEPRECATED_KEYBOARD_DRIVER +#endif + INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86SRC)/loader -I$(XF86OSSRC) \ -I$(SERVERSRC)/mi -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ -I$(EXTINCSRC) -DEFINES = $(XKBDEFRULESDEFS) +DEFINES = $(XKBDEFRULESDEFS) $(KEYBOARD_DEFS) #if MakeHasPosixVariableSubstitutions SubdirLibraryRule($(OBJS)) #endif @@ -20,8 +26,10 @@ SubdirLibraryRule($(OBJS)) ModuleObjectRule() ObjectModuleTarget($(DRIVER),$(OBJS)) +ObjectModuleTarget($(COMPAT_DRIVER),$(OBJS)) InstallObjectModule($(DRIVER),$(MODULEDIR),input) +InstallObjectModule($(COMPAT_DRIVER),$(MODULEDIR),input) #if !defined(XF86DriverSDK) InstallModuleManPage($(DRIVER)) Index: programs/Xserver/hw/xfree86/input/keyboard/kbd.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/input/keyboard/kbd.c,v retrieving revision 1.2 diff -u -p -r1.2 kbd.c --- programs/Xserver/hw/xfree86/input/keyboard/kbd.c 23 Apr 2004 19:54:03 -0000 1.2 +++ programs/Xserver/hw/xfree86/input/keyboard/kbd.c 15 Aug 2004 02:13:46 -0000 @@ -59,17 +59,6 @@ static void InitKBD(InputInfoPtr pInfo, static void SetXkbOption(InputInfoPtr pInfo, char *name, char **option); static void UpdateLeds(InputInfoPtr pInfo); -#undef KEYBOARD -InputDriverRec KEYBOARD = { - 1, - "kbd", - NULL, - KbdPreInit, - NULL, - NULL, - 0 -}; - typedef enum { OPTION_ALWAYS_CORE, OPTION_SEND_CORE_EVENTS, @@ -720,7 +709,17 @@ PostKbdEvent(InputInfoPtr pInfo, unsigne } #ifdef XFree86LOADER -ModuleInfoRec KeyboardInfo = { +InputDriverRec KBD = { + 1, + "kbd", + NULL, + KbdPreInit, + NULL, + NULL, + 0 +}; + +ModuleInfoRec KbdInfo = { 1, "KBD", NULL, @@ -746,6 +745,72 @@ xf86KbdPlug(pointer module, #ifndef REMOVE_LOADER_CHECK_MODULE_INFO if (xf86LoaderCheckSymbol("xf86AddModuleInfo")) #endif + xf86AddModuleInfo(&KbdInfo, module); + } + + xf86AddInputDriver(&KBD, module, 0); + + return module; +} + +static XF86ModuleVersionInfo xf86KbdVersionRec = +{ + "kbd", + MODULEVENDORSTRING, + MODINFOSTRING1, + MODINFOSTRING2, + XORG_VERSION_CURRENT, + 1, 0, 0, + ABI_CLASS_XINPUT, + ABI_XINPUT_VERSION, + MOD_CLASS_XINPUT, + {0, 0, 0, 0} /* signature, to be patched into the file by */ + /* a tool */ +}; + +XF86ModuleData kbdModuleData = { + &xf86KbdVersionRec, + xf86KbdPlug, + xf86KbdUnplug +}; + + +/* Compatibility section: we have a set of module structures here that + * allows us to load this module as the old keyboard driver. */ + +#ifndef USE_DEPRECATED_KEYBOARD_DRIVER + +InputDriverRec KEYBOARD = { + 1, + "keyboard", + NULL, + KbdPreInit, + NULL, + NULL, + 0 +}; + +ModuleInfoRec KeyboardInfo = { + 1, + "KEYBOARD", + NULL, + 0, + KeyboardAvailableOptions, +}; + +static pointer +xf86KeyboardPlug(pointer module, + pointer options, + int *errmaj, + int *errmin) +{ + static Bool Initialised = FALSE; + + if (!Initialised) { + Initialised = TRUE; +#ifndef REMOVE_LOADER_CHECK_MODULE_INFO + if (xf86LoaderCheckSymbol("xf86AddModuleInfo")) +#endif xf86AddModuleInfo(&KeyboardInfo, module); } @@ -756,7 +821,7 @@ xf86KbdPlug(pointer module, static XF86ModuleVersionInfo xf86KeyboardVersionRec = { - "kbd", + "keyboard", MODULEVENDORSTRING, MODINFOSTRING1, MODINFOSTRING2, @@ -769,8 +834,12 @@ static XF86ModuleVersionInfo xf86Keyboar /* a tool */ }; -XF86ModuleData kbdModuleData = {&xf86KeyboardVersionRec, - xf86KbdPlug, - xf86KbdUnplug}; +XF86ModuleData keyboardModuleData = { + &xf86KeyboardVersionRec, + xf86KeyboardPlug, + xf86KbdUnplug +}; + +#endif /* ! USE_DEPRECATED_KEYBOARD_DRIVER */ #endif /* XFree86LOADER */