diff options
author | Daniel Stone <daniel@fooishbar.org> | 2008-03-18 10:05:57 +0200 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2009-01-22 15:06:25 +1100 |
commit | 40877c6680863bd6a8475f2bb0c54df55bcf0b0e (patch) | |
tree | 9f958934add153efc9f6e85900fd5ff9ab2320da /hw | |
parent | f9da417163b6b2d6234d2542c1f375e33db7159a (diff) |
XKB: Make XKB mandatory
No more #ifdef XKB, because you can't disable the build, and no more
noXkbExtension either.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/dmx/dmxclient.h | 11 | ||||
-rw-r--r-- | hw/dmx/input/dmxcommon.c | 6 | ||||
-rw-r--r-- | hw/dmx/input/dmxcommon.h | 4 | ||||
-rw-r--r-- | hw/dmx/input/dmxdummy.c | 2 | ||||
-rw-r--r-- | hw/dmx/input/dmxinputinit.c | 114 | ||||
-rw-r--r-- | hw/dmx/input/dmxinputinit.h | 2 | ||||
-rw-r--r-- | hw/dmx/input/usb-keyboard.c | 2 | ||||
-rw-r--r-- | hw/kdrive/linux/keyboard.c | 280 | ||||
-rw-r--r-- | hw/kdrive/src/kdrive.h | 6 | ||||
-rw-r--r-- | hw/kdrive/src/kinput.c | 101 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Config.c | 19 | ||||
-rw-r--r-- | hw/xfree86/common/xf86DGA.c | 4 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Xinput.c | 5 | ||||
-rw-r--r-- | hw/xnest/Keyboard.c | 76 | ||||
-rw-r--r-- | hw/xwin/InitOutput.c | 8 | ||||
-rw-r--r-- | hw/xwin/winconfig.c | 259 | ||||
-rw-r--r-- | hw/xwin/winconfig.h | 13 | ||||
-rw-r--r-- | hw/xwin/winkeybd.c | 19 | ||||
-rwxr-xr-x | hw/xwin/winprocarg.c | 11 | ||||
-rw-r--r-- | hw/xwin/winwndproc.c | 4 |
20 files changed, 292 insertions, 654 deletions
diff --git a/hw/dmx/dmxclient.h b/hw/dmx/dmxclient.h index f0c3608da..147d14ed8 100644 --- a/hw/dmx/dmxclient.h +++ b/hw/dmx/dmxclient.h @@ -91,10 +91,8 @@ typedef XID KeySym64; #undef PictFormatType #endif -#ifdef XKB #include <X11/extensions/XKB.h> -#include <X11/extensions/XKBstr.h> -#endif +#include "xkbstr.h" #include <X11/extensions/XI.h> @@ -134,14 +132,9 @@ extern int ChangeDeviceNotify; /* Some protocol gets included last, after undefines. */ #include <X11/XKBlib.h> -#ifdef XKB #include <X11/extensions/XKBproto.h> -#ifndef XKB_IN_SERVER -#define XKB_IN_SERVER -#endif -#include <xkbsrv.h> +#include "xkbstr.h" #undef XPointer -#endif #include <X11/extensions/XIproto.h> #endif diff --git a/hw/dmx/input/dmxcommon.c b/hw/dmx/input/dmxcommon.c index e77bb7918..2bffb17e7 100644 --- a/hw/dmx/input/dmxcommon.c +++ b/hw/dmx/input/dmxcommon.c @@ -258,7 +258,6 @@ void dmxCommonKbdGetMap(DevicePtr pDev, KeySymsPtr pKeySyms, CARD8 *pModMap) * specified \a pDev. */ void dmxCommonKbdGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info) { -#ifdef XKB GETPRIVFROMPDEV; GETDMXINPUTFROMPRIV; char *pt; @@ -284,7 +283,6 @@ void dmxCommonKbdGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info) if ((pt = strchr(info->names.keycodes, '+'))) *pt = '\0'; } dmxCommonRestoreState(priv); -#endif } /** Turn \a pDev on (i.e., take input from \a pDev). */ @@ -577,7 +575,6 @@ void dmxCommonSaveState(pointer private) if (dmxInput->console) priv = dmxInput->devs[0]->private; if (!priv->display || priv->stateSaved) return; DMXDBG0("dmxCommonSaveState\n"); -#ifdef XKB if (dmxUseXKB && (priv->xkb = XkbAllocKeyboard())) { if (XkbGetIndicatorMap(priv->display, XkbAllIndicatorsMask, priv->xkb) || XkbGetNames(priv->display, XkbAllNamesMask, priv->xkb)) { @@ -596,7 +593,6 @@ void dmxCommonSaveState(pointer private) } } } -#endif XGetKeyboardControl(priv->display, &ks); priv->savedKctrl.click = ks.key_click_percent; @@ -636,14 +632,12 @@ void dmxCommonRestoreState(pointer private) priv->stateSaved = 0; DMXDBG0("dmxCommonRestoreState\n"); -#ifdef XKB if (priv->xkb) { *priv->xkb->indicators = priv->savedIndicators; XkbSetIndicatorMap(priv->display, ~0, priv->xkb); XkbFreeKeyboard(priv->xkb, 0, True); priv->xkb = 0; } -#endif for (start = GetTimeInMillis(); GetTimeInMillis() - start < 5000;) { CARD32 tmp; diff --git a/hw/dmx/input/dmxcommon.h b/hw/dmx/input/dmxcommon.h index a9b260cd9..68f2b520d 100644 --- a/hw/dmx/input/dmxcommon.h +++ b/hw/dmx/input/dmxcommon.h @@ -54,14 +54,10 @@ XModifierKeymap *savedModMap; \ int stateSaved -#ifdef XKB #define DMX_COMMON_XKB \ DMX_COMMON_OTHER; \ XkbDescPtr xkb; \ XkbIndicatorRec savedIndicators -#else -#define DMX_COMMON_XKB DMX_COMMON_OTHER -#endif #define DMX_COMMON_PRIVATE \ DMX_COMMON_XKB; \ diff --git a/hw/dmx/input/dmxdummy.c b/hw/dmx/input/dmxdummy.c index 2afe2580d..971892b9f 100644 --- a/hw/dmx/input/dmxdummy.c +++ b/hw/dmx/input/dmxdummy.c @@ -60,9 +60,7 @@ void dmxDummyKbdGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info) info->freemap = 0; info->focusClass = 1; info->kbdFeedbackClass = 1; -#ifdef XKB info->force = 1; -#endif } /** Return information about the dummy mouse device specified in \a pDev diff --git a/hw/dmx/input/dmxinputinit.c b/hw/dmx/input/dmxinputinit.c index a0eb80fe9..bce886fd3 100644 --- a/hw/dmx/input/dmxinputinit.c +++ b/hw/dmx/input/dmxinputinit.c @@ -306,15 +306,13 @@ static void _dmxKeyboardKbdCtrlProc(DMXLocalInputInfoPtr dmxLocal, dmxLocal->kctrl = *ctrl; if (dmxLocal->kCtrl) { dmxLocal->kCtrl(&dmxLocal->pDevice->public, ctrl); -#ifdef XKB - if (!noXkbExtension && dmxLocal->pDevice->kbdfeed) { + if (dmxLocal->pDevice->kbdfeed) { XkbEventCauseRec cause; XkbSetCauseUnknown(&cause); /* Generate XKB events, as necessary */ XkbUpdateIndicators(dmxLocal->pDevice, XkbAllIndicatorsMask, False, NULL, &cause); } -#endif } } @@ -370,7 +368,6 @@ void dmxKeyboardBellProc(int percent, DeviceIntPtr pDevice, } } -#ifdef XKB static void dmxKeyboardFreeNames(XkbComponentNamesPtr names) { if (names->keymap) XFree(names->keymap); @@ -380,76 +377,61 @@ static void dmxKeyboardFreeNames(XkbComponentNamesPtr names) if (names->symbols) XFree(names->symbols); if (names->geometry) XFree(names->geometry); } -#endif static int dmxKeyboardOn(DeviceIntPtr pDevice, DMXLocalInitInfo *info) { -#ifdef XKB GETDMXINPUTFROMPDEVICE; -#else - DevicePtr pDev = &pDevice->public; -#endif -#ifdef XKB - if (noXkbExtension) { -#endif - if (!InitKeyboardDeviceStruct(pDev, &info->keySyms, info->modMap, - dmxKeyboardBellProc, - dmxKeyboardKbdCtrlProc)) - return BadImplementation; -#ifdef XKB + XkbSetRulesDflts(dmxConfigGetXkbRules(), + dmxConfigGetXkbModel(), + dmxConfigGetXkbLayout(), + dmxConfigGetXkbVariant(), + dmxConfigGetXkbOptions()); + if (!info->force && (dmxInput->keycodes + || dmxInput->symbols + || dmxInput->geometry)) { + if (info->freenames) dmxKeyboardFreeNames(&info->names); + info->freenames = 0; + info->names.keycodes = dmxInput->keycodes; + info->names.types = NULL; + info->names.compat = NULL; + info->names.symbols = dmxInput->symbols; + info->names.geometry = dmxInput->geometry; + + dmxLogInput(dmxInput, "XKEYBOARD: From command line: %s", + info->names.keycodes); + if (info->names.symbols && *info->names.symbols) + dmxLogInputCont(dmxInput, " %s", info->names.symbols); + if (info->names.geometry && *info->names.geometry) + dmxLogInputCont(dmxInput, " %s", info->names.geometry); + dmxLogInputCont(dmxInput, "\n"); + } else if (info->names.keycodes) { + dmxLogInput(dmxInput, "XKEYBOARD: From device: %s", + info->names.keycodes); + if (info->names.symbols && *info->names.symbols) + dmxLogInputCont(dmxInput, " %s", info->names.symbols); + if (info->names.geometry && *info->names.geometry) + dmxLogInputCont(dmxInput, " %s", info->names.geometry); + dmxLogInputCont(dmxInput, "\n"); } else { - XkbSetRulesDflts(dmxConfigGetXkbRules(), - dmxConfigGetXkbModel(), - dmxConfigGetXkbLayout(), - dmxConfigGetXkbVariant(), - dmxConfigGetXkbOptions()); - if (!info->force && (dmxInput->keycodes - || dmxInput->symbols - || dmxInput->geometry)) { - if (info->freenames) dmxKeyboardFreeNames(&info->names); - info->freenames = 0; - info->names.keycodes = dmxInput->keycodes; - info->names.types = NULL; - info->names.compat = NULL; - info->names.symbols = dmxInput->symbols; - info->names.geometry = dmxInput->geometry; - - dmxLogInput(dmxInput, "XKEYBOARD: From command line: %s", - info->names.keycodes); - if (info->names.symbols && *info->names.symbols) - dmxLogInputCont(dmxInput, " %s", info->names.symbols); - if (info->names.geometry && *info->names.geometry) - dmxLogInputCont(dmxInput, " %s", info->names.geometry); - dmxLogInputCont(dmxInput, "\n"); - } else if (info->names.keycodes) { - dmxLogInput(dmxInput, "XKEYBOARD: From device: %s", - info->names.keycodes); - if (info->names.symbols && *info->names.symbols) - dmxLogInputCont(dmxInput, " %s", info->names.symbols); - if (info->names.geometry && *info->names.geometry) - dmxLogInputCont(dmxInput, " %s", info->names.geometry); - dmxLogInputCont(dmxInput, "\n"); - } else { - dmxLogInput(dmxInput, "XKEYBOARD: Defaults: %s %s %s %s %s\n", - dmxConfigGetXkbRules(), - dmxConfigGetXkbLayout(), - dmxConfigGetXkbModel(), - dmxConfigGetXkbVariant() - ? dmxConfigGetXkbVariant() : "", - dmxConfigGetXkbOptions() - ? dmxConfigGetXkbOptions() : ""); - } - XkbInitKeyboardDeviceStruct(pDevice, - &info->names, - &info->keySyms, - info->modMap, - dmxKeyboardBellProc, - dmxKeyboardKbdCtrlProc); + dmxLogInput(dmxInput, "XKEYBOARD: Defaults: %s %s %s %s %s\n", + dmxConfigGetXkbRules(), + dmxConfigGetXkbLayout(), + dmxConfigGetXkbModel(), + dmxConfigGetXkbVariant() + ? dmxConfigGetXkbVariant() : "", + dmxConfigGetXkbOptions() + ? dmxConfigGetXkbOptions() : ""); } + XkbInitKeyboardDeviceStruct(pDevice, + &info->names, + &info->keySyms, + info->modMap, + dmxKeyboardBellProc, + dmxKeyboardKbdCtrlProc); + if (info->freenames) dmxKeyboardFreeNames(&info->names); -#endif return Success; } @@ -552,9 +534,7 @@ static int dmxDeviceOnOff(DeviceIntPtr pDevice, int what) XFree(info.keySyms.map); info.keySyms.map = NULL; } -#ifdef XKB if (info.xkb) XkbFreeKeyboard(info.xkb, 0, True); -#endif return Success; } diff --git a/hw/dmx/input/dmxinputinit.h b/hw/dmx/input/dmxinputinit.h index 6f491edf9..2e625cfd4 100644 --- a/hw/dmx/input/dmxinputinit.h +++ b/hw/dmx/input/dmxinputinit.h @@ -87,12 +87,10 @@ typedef struct _DMXLocalInitInfo { KeySymsRec keySyms; /**< Key symbols */ int freemap; /**< If non-zero, free keySyms.map */ CARD8 modMap[MAP_LENGTH]; /**< Modifier map */ -#ifdef XKB XkbDescPtr xkb; /**< XKB description */ XkbComponentNamesRec names; /**< XKB component names */ int freenames; /**< Non-zero if names should be free'd */ int force; /**< Do not allow command line override */ -#endif int buttonClass; /**< Non-zero if buttons are present */ int numButtons; /**< Number of buttons */ diff --git a/hw/dmx/input/usb-keyboard.c b/hw/dmx/input/usb-keyboard.c index efec2705b..455513d06 100644 --- a/hw/dmx/input/usb-keyboard.c +++ b/hw/dmx/input/usb-keyboard.c @@ -434,8 +434,6 @@ void kbdUSBGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info) kbdUSBGetMap(pDev, &info->keySyms, info->modMap); info->focusClass = 1; info->kbdFeedbackClass = 1; -#ifdef XKB info->names.keycodes = xstrdup("powerpcps2"); info->force = 1; -#endif } diff --git a/hw/kdrive/linux/keyboard.c b/hw/kdrive/linux/keyboard.c index ae981b776..d36c31d77 100644 --- a/hw/kdrive/linux/keyboard.c +++ b/hw/kdrive/linux/keyboard.c @@ -112,7 +112,6 @@ static const KeySym linux_to_x[256] = { XK_udiaeresis, XK_yacute, XK_thorn, XK_ydiaeresis }; -#ifdef XKB /* * Getting a keycode from scancode * @@ -209,10 +208,6 @@ static unsigned char at2lnx[] = #define NUM_AT_KEYS (sizeof(at2lnx)/sizeof(at2lnx[0])) #define LNX_KEY_INDEX(n) n < NUM_AT_KEYS ? at2lnx[n] : 0 -#else /* not XKB */ -#define LNX_KEY_INDEX(n) n -#endif - static unsigned char tbl[KD_MAX_WIDTH] = { 0, @@ -491,8 +486,6 @@ readKernelMapping(KdKeyboardInfo *ki) ki->maxScanCode = maxKeyCode; } -#ifdef XKB - /* * We need these to handle extended scancodes correctly (I could just use the * numbers below, but this makes the code more readable @@ -555,9 +548,6 @@ readKernelMapping(KdKeyboardInfo *ki) #define KEY_F17 /* F17 0x72 */ 114 #define KEY_KP_DEC /* KP_DEC 0x73 */ 115 -#endif /* XKB */ - - static void LinuxKeyboardRead (int fd, void *closure) { @@ -568,164 +558,118 @@ LinuxKeyboardRead (int fd, void *closure) while ((n = read (fd, buf, sizeof (buf))) > 0) { b = buf; while (n--) { -#ifdef XKB - if (!noXkbExtension) { - /* - * With xkb we use RAW mode for reading the console, which allows us - * process extended scancodes. - * - * See if this is a prefix extending the following keycode - */ - if (!prefix && ((b[0] & 0x7f) == KEY_Prefix0)) - { - prefix = KEY_Prefix0; -#ifdef DEBUG - ErrorF("Prefix0"); -#endif - /* swallow this up */ - b++; - continue; - } - else if (!prefix && ((b[0] & 0x7f) == KEY_Prefix1)) - { - prefix = KEY_Prefix1; - ErrorF("Prefix1"); - /* swallow this up */ - b++; - continue; - } - scancode = b[0] & 0x7f; - - switch (prefix) { - /* from xf86Events.c */ - case KEY_Prefix0: - { -#ifdef DEBUG - ErrorF("Prefix0 scancode: 0x%02x\n", scancode); -#endif - switch (scancode) { - case KEY_KP_7: - scancode = KEY_Home; break; /* curs home */ - case KEY_KP_8: - scancode = KEY_Up; break; /* curs up */ - case KEY_KP_9: - scancode = KEY_PgUp; break; /* curs pgup */ - case KEY_KP_4: - scancode = KEY_Left; break; /* curs left */ - case KEY_KP_5: - scancode = KEY_Begin; break; /* curs begin */ - case KEY_KP_6: - scancode = KEY_Right; break; /* curs right */ - case KEY_KP_1: - scancode = KEY_End; break; /* curs end */ - case KEY_KP_2: - scancode = KEY_Down; break; /* curs down */ - case KEY_KP_3: - scancode = KEY_PgDown; break; /* curs pgdown */ - case KEY_KP_0: - scancode = KEY_Insert; break; /* curs insert */ - case KEY_KP_Decimal: - scancode = KEY_Delete; break; /* curs delete */ - case KEY_Enter: - scancode = KEY_KP_Enter; break; /* keypad enter */ - case KEY_LCtrl: - scancode = KEY_RCtrl; break; /* right ctrl */ - case KEY_KP_Multiply: - scancode = KEY_Print; break; /* print */ - case KEY_Slash: - scancode = KEY_KP_Divide; break; /* keyp divide */ - case KEY_Alt: - scancode = KEY_AltLang; break; /* right alt */ - case KEY_ScrollLock: - scancode = KEY_Break; break; /* curs break */ - case 0x5b: - scancode = KEY_LMeta; break; - case 0x5c: - scancode = KEY_RMeta; break; - case 0x5d: - scancode = KEY_Menu; break; - case KEY_F3: - scancode = KEY_F13; break; - case KEY_F4: - scancode = KEY_F14; break; - case KEY_F5: - scancode = KEY_F15; break; - case KEY_F6: - scancode = KEY_F16; break; - case KEY_F7: - scancode = KEY_F17; break; - case KEY_KP_Plus: - scancode = KEY_KP_DEC; break; - /* Ignore virtual shifts (E0 2A, E0 AA, E0 36, E0 B6) */ - case 0x2A: - case 0x36: - b++; - prefix = 0; - continue; - default: -#ifdef DEBUG - ErrorF("Unreported Prefix0 scancode: 0x%02x\n", - scancode); -#endif - /* - * "Internet" keyboards are generating lots of new - * codes. Let them pass. There is little consistency - * between them, so don't bother with symbolic names at - * this level. - */ - scancode += 0x78; - } - break; - } - - case KEY_Prefix1: - { - /* we do no handle these */ -#ifdef DEBUG - ErrorF("Prefix1 scancode: 0x%02x\n", scancode); -#endif - b++; - prefix = 0; - continue; + /* + * With xkb we use RAW mode for reading the console, which allows us + * process extended scancodes. + * + * See if this is a prefix extending the following keycode + */ + if (!prefix && ((b[0] & 0x7f) == KEY_Prefix0)) + { + prefix = KEY_Prefix0; + /* swallow this up */ + b++; + continue; + } + else if (!prefix && ((b[0] & 0x7f) == KEY_Prefix1)) + { + prefix = KEY_Prefix1; + /* swallow this up */ + b++; + continue; + } + scancode = b[0] & 0x7f; + + switch (prefix) { + /* from xf86Events.c */ + case KEY_Prefix0: + { + switch (scancode) { + case KEY_KP_7: + scancode = KEY_Home; break; /* curs home */ + case KEY_KP_8: + scancode = KEY_Up; break; /* curs up */ + case KEY_KP_9: + scancode = KEY_PgUp; break; /* curs pgup */ + case KEY_KP_4: + scancode = KEY_Left; break; /* curs left */ + case KEY_KP_5: + scancode = KEY_Begin; break; /* curs begin */ + case KEY_KP_6: + scancode = KEY_Right; break; /* curs right */ + case KEY_KP_1: + scancode = KEY_End; break; /* curs end */ + case KEY_KP_2: + scancode = KEY_Down; break; /* curs down */ + case KEY_KP_3: + scancode = KEY_PgDown; break; /* curs pgdown */ + case KEY_KP_0: + scancode = KEY_Insert; break; /* curs insert */ + case KEY_KP_Decimal: + scancode = KEY_Delete; break; /* curs delete */ + case KEY_Enter: + scancode = KEY_KP_Enter; break; /* keypad enter */ + case KEY_LCtrl: + scancode = KEY_RCtrl; break; /* right ctrl */ + case KEY_KP_Multiply: + scancode = KEY_Print; break; /* print */ + case KEY_Slash: + scancode = KEY_KP_Divide; break; /* keyp divide */ + case KEY_Alt: + scancode = KEY_AltLang; break; /* right alt */ + case KEY_ScrollLock: + scancode = KEY_Break; break; /* curs break */ + case 0x5b: + scancode = KEY_LMeta; break; + case 0x5c: + scancode = KEY_RMeta; break; + case 0x5d: + scancode = KEY_Menu; break; + case KEY_F3: + scancode = KEY_F13; break; + case KEY_F4: + scancode = KEY_F14; break; + case KEY_F5: + scancode = KEY_F15; break; + case KEY_F6: + scancode = KEY_F16; break; + case KEY_F7: + scancode = KEY_F17; break; + case KEY_KP_Plus: + scancode = KEY_KP_DEC; break; + /* Ignore virtual shifts (E0 2A, E0 AA, E0 36, E0 B6) */ + case 0x2A: + case 0x36: + b++; + prefix = 0; + continue; + default: + /* + * "Internet" keyboards are generating lots of new + * codes. Let them pass. There is little consistency + * between them, so don't bother with symbolic names at + * this level. + */ + scancode += 0x78; } + break; + } - default: /* should not happen*/ - case 0: /* do nothing */ -#ifdef DEBUG - ErrorF("Plain scancode: 0x%02x\n", scancode); -#endif - ; - } + case KEY_Prefix1: + { + /* we do no handle these */ + b++; + prefix = 0; + continue; + } - prefix = 0; + default: /* should not happen*/ + case 0: /* do nothing */ + ; } - /* without xkb we use mediumraw mode -- enqueue the scancode as is */ - else -#endif - scancode = b[0] & 0x7f; - /* This is extended medium raw mode interpreter - see linux/drivers/keyboard.c (kbd->kbdmode == VC_MEDIUMRAW) */ - switch (mediumraw_state) - { - case DEFAULT: - if (scancode == 0) - { - mediumraw_state = EXTBYTE1; - mediumraw_up = b[0] & 0x80; - } - else - KdEnqueueKeyboardEvent (closure, scancode, b[0] & 0x80); - break; - case EXTBYTE1: - mediumraw_data = scancode; - mediumraw_state = EXTBYTE2; - break; - case EXTBYTE2: - /* Note: Only codes < 256 will pass correctly through KdEnqueueKeyboardEvent() */ - KdEnqueueKeyboardEvent (closure, (int)mediumraw_data << 7 | scancode, mediumraw_up); - mediumraw_state = DEFAULT; - break; - } + + prefix = 0; + KdEnqueueKeyboardEvent (closure, scancode, b[0] & 0x80); b++; } } @@ -750,13 +694,7 @@ LinuxKeyboardEnable (KdKeyboardInfo *ki) ioctl (fd, KDGKBMODE, &LinuxKbdTrans); tcgetattr (fd, &LinuxTermios); -#ifdef XKB - if (!noXkbExtension) - ioctl(fd, KDSKBMODE, K_RAW); - else -#else - ioctl(fd, KDSKBMODE, K_MEDIUMRAW); -#endif + ioctl(fd, KDSKBMODE, K_RAW); nTty = LinuxTermios; nTty.c_iflag = (IGNPAR | IGNBRK) & (~PARMRK) & (~ISTRIP); nTty.c_oflag = 0; diff --git a/hw/kdrive/src/kdrive.h b/hw/kdrive/src/kdrive.h index 4b9566970..774648490 100644 --- a/hw/kdrive/src/kdrive.h +++ b/hw/kdrive/src/kdrive.h @@ -44,9 +44,7 @@ #include "randrstr.h" #include "globals.h" -#ifdef XKB -#include <X11/extensions/XKBstr.h> -#endif +#include "xkbstr.h" #define KD_DPMS_NORMAL 0 #define KD_DPMS_STANDBY 1 @@ -300,14 +298,12 @@ struct _KdKeyboardInfo { char *name; char *path; int inputClass; -#ifdef XKB XkbDescPtr xkb; char *xkbRules; char *xkbModel; char *xkbLayout; char *xkbVariant; char *xkbOptions; -#endif int LockLed; CARD8 keyState[KD_KEY_COUNT/8]; diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c index 816e933e6..670cc372f 100644 --- a/hw/kdrive/src/kinput.c +++ b/hw/kdrive/src/kinput.c @@ -38,9 +38,7 @@ #include <sys/file.h> /* needed for FNONBLOCK & FASYNC */ #endif -#ifdef XKB -#include <xkbsrv.h> -#endif +#include "xkbsrv.h" #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> @@ -748,9 +746,7 @@ KdKeyboardProc(DeviceIntPtr pDevice, int onoff) DevicePtr pDev = (DevicePtr)pDevice; KdKeyboardInfo *ki; Atom xiclass; -#ifdef XKB XkbComponentNamesRec names; -#endif if (!pDev) return BadImplementation; @@ -799,25 +795,16 @@ KdKeyboardProc(DeviceIntPtr pDevice, int onoff) KdInitModMap(ki); KdInitAutoRepeats(ki); -#ifdef XKB - if (!noXkbExtension) { - memset(&names, 0, sizeof(XkbComponentNamesRec)); + memset(&names, 0, sizeof(XkbComponentNamesRec)); - XkbSetRulesDflts (ki->xkbRules, ki->xkbModel, ki->xkbLayout, - ki->xkbVariant, ki->xkbOptions); + XkbSetRulesDflts (ki->xkbRules, ki->xkbModel, ki->xkbLayout, + ki->xkbVariant, ki->xkbOptions); - ret = XkbInitKeyboardDeviceStruct (pDevice, - &names, - &ki->keySyms, - ki->modmap, - KdBell, KdKbdCtrl); - } - else -#endif - ret = InitKeyboardDeviceStruct(pDev, - &ki->keySyms, - ki->modmap, - KdBell, KdKbdCtrl); + ret = XkbInitKeyboardDeviceStruct (pDevice, + &names, + &ki->keySyms, + ki->modmap, + KdBell, KdKbdCtrl); if (!ret) { ErrorF("Couldn't initialise keyboard %s\n", ki->name); return BadImplementation; @@ -974,13 +961,11 @@ KdNewKeyboard (void) ki->bellDuration = 200; ki->next = NULL; ki->options = NULL; -#ifdef XKB ki->xkbRules = KdSaveString("base"); ki->xkbModel = KdSaveString("pc105"); ki->xkbLayout = KdSaveString("us"); ki->xkbVariant = NULL; ki->xkbOptions = NULL; -#endif return ki; } @@ -1160,7 +1145,6 @@ KdParseKbdOptions (KdKeyboardInfo *ki) for (option = ki->options; option; option = option->next) { -#ifdef XKB if (strcasecmp(option->key, "XkbRules") == 0) ki->xkbRules = option->value; else if (strcasecmp(option->key, "XkbModel") == 0) @@ -1174,7 +1158,6 @@ KdParseKbdOptions (KdKeyboardInfo *ki) else if (!strcasecmp (option->key, "device")) ki->path = KdSaveString(option->value); else -#endif ErrorF("Kbd option key (%s) of value (%s) not assigned!\n", option->key, option->value); } @@ -1196,9 +1179,7 @@ KdParseKeyboard (char *arg) ki->path = NULL; ki->driver = NULL; ki->driverPrivate = NULL; -#ifdef XKB ki->xkb = NULL; -#endif ki->next = NULL; if (!arg) @@ -1880,57 +1861,6 @@ CARD32 KdSpecialKeys = 0; extern int nClients; -static void -KdCheckSpecialKeys(KdKeyboardInfo *ki, int type, int sym) -{ - if (!ki) - return; - - /* - * Ignore key releases - */ - - if (type == KeyRelease) - return; - - /* Some iPaq keyboard -> mouse button mapping used to be here, but I - * refuse to perpetuate this madness. -daniels */ - - /* - * Check for control/alt pressed - */ - if ((ki->dixdev->key->state & (ControlMask|Mod1Mask)) != - (ControlMask|Mod1Mask)) - return; - - /* - * Let OS function see keysym first - */ - - if (kdOsFuncs->SpecialKey) - if ((*kdOsFuncs->SpecialKey) (sym)) - return; - - /* - * Now check for backspace or delete; these signal the - * X server to terminate - * - * I can't believe it's not XKB. -daniels - */ - switch (sym) { - case XK_BackSpace: - case XK_Delete: - case XK_KP_Delete: - /* - * Set the dispatch exception flag so the server will terminate the - * next time through the dispatch loop. - */ - if (kdAllowZap || party_like_its_1989) - dispatchException |= DE_TERMINATE; - break; - } -} - /* * kdEnqueueKeyboardEvent * @@ -2024,7 +1954,7 @@ KdEnqueueKeyboardEvent(KdKeyboardInfo *ki, if (scan_code >= ki->minScanCode && scan_code <= ki->maxScanCode) { key_code = scan_code + KD_MIN_KEYCODE - ki->minScanCode; - + /* * Set up this event -- the type may be modified below */ @@ -2032,16 +1962,9 @@ KdEnqueueKeyboardEvent(KdKeyboardInfo *ki, type = KeyRelease; else type = KeyPress; - -#ifdef XKB - if (noXkbExtension) -#endif - { - KdCheckSpecialKeys(ki, type, key_code); - KdHandleKeyboardEvent(ki, type, key_code); - } - + GetEventList(&kdEvents); + nEvents = GetKeyboardEvents(kdEvents, ki->dixdev, type, key_code); for (i = 0; i < nEvents; i++) KdQueueEvent(ki->dixdev, (kdEvents + i)->event); diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index bb6789846..8df9780e1 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -65,11 +65,7 @@ #include "xf86Xinput.h" extern DeviceAssocRec mouse_assoc; -#ifdef XKB -#undef XKB_IN_SERVER -#define XKB_IN_SERVER -#include <xkbsrv.h> -#endif +#include "xkbsrv.h" #ifdef RENDER #include "picture.h" @@ -697,7 +693,6 @@ typedef enum { FLAG_ALLOWNONLOCAL, FLAG_ALLOWMOUSEOPENFAIL, FLAG_VTSYSREQ, - FLAG_XKBDISABLE, FLAG_SAVER_BLANKTIME, FLAG_DPMS_STANDBYTIME, FLAG_DPMS_SUSPENDTIME, @@ -736,8 +731,6 @@ static OptionInfoRec FlagOptions[] = { {0}, FALSE }, { FLAG_VTSYSREQ, "VTSysReq", OPTV_BOOLEAN, {0}, FALSE }, - { FLAG_XKBDISABLE, "XkbDisable", OPTV_BOOLEAN, - {0}, FALSE }, { FLAG_SAVER_BLANKTIME, "BlankTime" , OPTV_INTEGER, {0}, FALSE }, { FLAG_DPMS_STANDBYTIME, "StandbyTime", OPTV_INTEGER, @@ -887,16 +880,6 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) #endif } - if (xf86GetOptValBool(FlagOptions, FLAG_XKBDISABLE, &value)) { -#ifdef XKB - noXkbExtension = value; - xf86Msg(X_CONFIG, "Xkb %s\n", value ? "disabled" : "enabled"); -#else - if (!value) - xf86Msg(X_WARNING, "Xserver doesn't support XKB\n"); -#endif - } - xf86Info.pmFlag = TRUE; if (xf86GetOptValBool(FlagOptions, FLAG_NOPM, &value)) xf86Info.pmFlag = !value; diff --git a/hw/xfree86/common/xf86DGA.c b/hw/xfree86/common/xf86DGA.c index 9c701c5d0..b7036cdb1 100644 --- a/hw/xfree86/common/xf86DGA.c +++ b/hw/xfree86/common/xf86DGA.c @@ -42,9 +42,7 @@ #include "globals.h" #include "servermd.h" #include "micmap.h" -#ifdef XKB -#include <xkbsrv.h> -#endif +#include "xkbsrv.h" #include "xf86Xinput.h" #include "exglobals.h" #include "exevents.h" diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index d5d06ad05..46b102bbe 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -379,10 +379,7 @@ xf86ActivateDevice(LocalDevicePtr local) } RegisterOtherDevice(dev); -#ifdef XKB - if (!noXkbExtension) - XkbSetExtension(dev, ProcessKeyboardEvent); -#endif + XkbSetExtension(dev, ProcessKeyboardEvent); if (serverGeneration == 1) xf86Msg(X_INFO, "XINPUT: Adding extended input device \"%s\" (type: %s)\n", diff --git a/hw/xnest/Keyboard.c b/hw/xnest/Keyboard.c index cedaa7a25..35be5212e 100644 --- a/hw/xnest/Keyboard.c +++ b/hw/xnest/Keyboard.c @@ -33,9 +33,8 @@ is" without express or implied warranty. #include "Args.h" #include "Events.h" -#ifdef XKB #include <X11/extensions/XKB.h> -#include <xkbsrv.h> +#include "xkbsrv.h" #include <X11/extensions/XKBconfig.h> extern Bool @@ -59,7 +58,6 @@ extern Status XkbGetControls( unsigned long /* which */, XkbDescPtr /* desc */ ); -#endif DeviceIntPtr xnestKeyboardDevice = NULL; @@ -124,6 +122,10 @@ xnestKeyboardProc(DeviceIntPtr pDev, int onoff) CARD8 modmap[MAP_LENGTH]; int i, j; XKeyboardState values; + XkbComponentNamesRec names; + XkbDescPtr xkb; + char *rules, *model, *layout, *variants, *options; + int op, event, error, major, minor; switch (onoff) { @@ -168,50 +170,29 @@ xnestKeyboardProc(DeviceIntPtr pDev, int onoff) keySyms.mapWidth = mapWidth; keySyms.map = keymap; -#ifdef XKB - if (noXkbExtension) { -XkbError: -#endif - XGetKeyboardControl(xnestDisplay, &values); - - memmove((char *) defaultKeyboardControl.autoRepeats, - (char *) values.auto_repeats, sizeof(values.auto_repeats)); - - InitKeyboardDeviceStruct(&pDev->public, &keySyms, modmap, - xnestBell, xnestChangeKeyboardControl); -#ifdef XKB - } else { - XkbComponentNamesRec names; - char *rules, *model, *layout, *variants, *options; - - XkbDescPtr xkb; - int op, event, error, major, minor; - - if (XkbQueryExtension(xnestDisplay, &op, &event, &error, &major, &minor) == 0) { - ErrorF("Unable to initialize XKEYBOARD extension.\n"); + if (XkbQueryExtension(xnestDisplay, &op, &event, &error, &major, &minor) == 0) { + ErrorF("Unable to initialize XKEYBOARD extension.\n"); goto XkbError; - } - xkb = XkbGetKeyboard(xnestDisplay, XkbGBN_AllComponentsMask, XkbUseCoreKbd); - if (xkb == NULL || xkb->geom == NULL) { + } + xkb = XkbGetKeyboard(xnestDisplay, XkbGBN_AllComponentsMask, XkbUseCoreKbd); + if (xkb == NULL || xkb->geom == NULL) { ErrorF("Couldn't get keyboard.\n"); - goto XkbError; - } - XkbGetControls(xnestDisplay, XkbAllControlsMask, xkb); + goto XkbError; + } + XkbGetControls(xnestDisplay, XkbAllControlsMask, xkb); - memset(&names, 0, sizeof(XkbComponentNamesRec)); - rules = XKB_DFLT_RULES; - model = XKB_DFLT_MODEL; - layout = XKB_DFLT_LAYOUT; - variants = XKB_DFLT_VARIANT; - options = XKB_DFLT_OPTIONS; + memset(&names, 0, sizeof(XkbComponentNamesRec)); + rules = XKB_DFLT_RULES; + model = XKB_DFLT_MODEL; + layout = XKB_DFLT_LAYOUT; + variants = XKB_DFLT_VARIANT; + options = XKB_DFLT_OPTIONS; - XkbSetRulesDflts(rules, model, layout, variants, options); - XkbInitKeyboardDeviceStruct(pDev, &names, &keySyms, modmap, + XkbSetRulesDflts(rules, model, layout, variants, options); + XkbInitKeyboardDeviceStruct(pDev, &names, &keySyms, modmap, xnestBell, xnestChangeKeyboardControl); - XkbDDXChangeControls(pDev, xkb->ctrls, xkb->ctrls); - XkbFreeKeyboard(xkb, 0, False); - } -#endif + XkbDDXChangeControls(pDev, xkb->ctrls, xkb->ctrls); + XkbFreeKeyboard(xkb, 0, False); xfree(keymap); break; case DEVICE_ON: @@ -228,6 +209,17 @@ XkbError: break; } return Success; + +XkbError: + XGetKeyboardControl(xnestDisplay, &values); + memmove((char *)defaultKeyboardControl.autoRepeats, + (char *)values.auto_repeats, + sizeof(values.auto_repeats)); + + InitKeyboardDeviceStruct(&pDev->public, &keySyms, + xnestBell, xnestChangeKeyboardControl); + xfree(keymap); + return Success; } Bool diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c index 291593bc9..1b37bb723 100644 --- a/hw/xwin/InitOutput.c +++ b/hw/xwin/InitOutput.c @@ -42,8 +42,8 @@ from The Open Group. #ifdef __CYGWIN__ #include <mntent.h> #endif -#if defined(XKB) && defined(WIN32) -#include <xkbsrv.h> +#if defined(WIN32) +#include "xkbsrv.h" #endif #ifdef RELOCATE_PROJECTROOT #include <shlobj.h> @@ -667,7 +667,6 @@ winFixupPaths (void) winMsg (X_DEFAULT, "Logfile set to \"%s\"\n", g_pszLogFile); } } -#ifdef XKB { static char xkbbasedir[MAX_PATH]; @@ -677,7 +676,6 @@ winFixupPaths (void) XkbBaseDirectory = xkbbasedir; XkbBinDirectory = basedir; } -#endif /* XKB */ #endif /* RELOCATE_PROJECTROOT */ } @@ -857,7 +855,6 @@ winUseMsg (void) "\tSpecify a keyboard device from the configuration file.\n"); #endif -#ifdef XKB ErrorF ("-xkbrules XKBRules\n" "\tEquivalent to XKBRules in XF86Config files.\n"); @@ -874,7 +871,6 @@ winUseMsg (void) ErrorF ("-xkboptions XKBOptions\n" "\tEquivalent to XKBOptions in XF86Config files.\n"); -#endif ErrorF ("-logfile filename\n" "\tWrite logmessages to <filename> instead of /tmp/Xwin.log.\n"); diff --git a/hw/xwin/winconfig.c b/hw/xwin/winconfig.c index 38966bf96..5f5b4825a 100644 --- a/hw/xwin/winconfig.c +++ b/hw/xwin/winconfig.c @@ -36,12 +36,7 @@ #include "winmsg.h" #include "globals.h" -#ifdef XKB -#ifndef XKB_IN_SERVER -#define XKB_IN_SERVER -#endif -#include <xkbsrv.h> -#endif +#include "xkbsrv.h" #ifdef XWIN_XF86CONFIG #ifndef CONFIGPATH @@ -67,15 +62,11 @@ WinCmdlineRec g_cmdline = { #ifdef XWIN_XF86CONFIG NULL, /* keyboard */ #endif -#ifdef XKB - FALSE, /* noXkbExtension */ - NULL, /* xkbMap */ NULL, /* xkbRules */ NULL, /* xkbModel */ NULL, /* xkbLayout */ NULL, /* xkbVariant */ NULL, /* xkbOptions */ -#endif NULL, /* screenname */ NULL, /* mousename */ FALSE, /* emulate3Buttons */ @@ -87,7 +78,6 @@ winInfoRec g_winInfo = { 0, /* leds */ 500, /* delay */ 30 /* rate */ -#ifdef XKB } , { /* xkb */ @@ -97,14 +87,6 @@ winInfoRec g_winInfo = { NULL, /* layout */ NULL, /* variant */ NULL, /* options */ - NULL, /* initialMap */ - NULL, /* keymap */ - NULL, /* types */ - NULL, /* compat */ - NULL, /* keycodes */ - NULL, /* symbols */ - NULL /* geometry */ -#endif } , { @@ -228,11 +210,9 @@ winReadConfigfile () Bool winConfigKeyboard (DeviceIntPtr pDevice) { -#ifdef XKB char layoutName[KL_NAMELENGTH]; static unsigned int layoutNum = 0; int keyboardType; -#endif #ifdef XWIN_XF86CONFIG XF86ConfInputPtr kbd = NULL; XF86ConfInputPtr input_list = NULL; @@ -242,7 +222,6 @@ winConfigKeyboard (DeviceIntPtr pDevice) char *s = NULL; /* Setup defaults */ -#ifdef XKB g_winInfo.xkb.disable = FALSE; # ifdef PC98 /* japanese */ /* not implemented */ g_winInfo.xkb.rules = "xfree98"; @@ -358,15 +337,6 @@ winConfigKeyboard (DeviceIntPtr pDevice) } } - g_winInfo.xkb.initialMap = NULL; - g_winInfo.xkb.keymap = NULL; - g_winInfo.xkb.types = NULL; - g_winInfo.xkb.compat = NULL; - g_winInfo.xkb.keycodes = NULL; - g_winInfo.xkb.symbols = NULL; - g_winInfo.xkb.geometry = NULL; -#endif /* XKB */ - /* parse the configuration */ #ifdef XWIN_XF86CONFIG if (g_cmdline.keyboard) @@ -418,168 +388,101 @@ winConfigKeyboard (DeviceIntPtr pDevice) } #endif -#ifdef XKB - from = X_DEFAULT; - if (g_cmdline.noXkbExtension) - { - from = X_CMDLINE; - g_winInfo.xkb.disable = TRUE; - } -#ifdef XWIN_XF86CONFIG - else if (kbd->inp_option_lst) - { - int b = winSetBoolOption (kbd->inp_option_lst, "XkbDisable", FALSE); - if (b) - { - from = X_CONFIG; - g_winInfo.xkb.disable = TRUE; - } - } -#endif - if (g_winInfo.xkb.disable) - { - winMsg (from, "XkbExtension disabled\n"); - } - else - { - s = NULL; - if (g_cmdline.xkbRules) - { - s = g_cmdline.xkbRules; - from = X_CMDLINE; - } + s = NULL; + if (g_cmdline.xkbRules) + { + s = g_cmdline.xkbRules; + from = X_CMDLINE; + } #ifdef XWIN_XF86CONFIG - else - { - s = winSetStrOption (kbd->inp_option_lst, "XkbRules", NULL); - from = X_CONFIG; - } + else + { + s = winSetStrOption (kbd->inp_option_lst, "XkbRules", NULL); + from = X_CONFIG; + } #endif - if (s) - { - g_winInfo.xkb.rules = NULL_IF_EMPTY (s); - winMsg (from, "XKB: rules: \"%s\"\n", s); - } + if (s) + { + g_winInfo.xkb.rules = NULL_IF_EMPTY (s); + winMsg (from, "XKB: rules: \"%s\"\n", s); + } - s = NULL; - if (g_cmdline.xkbModel) - { - s = g_cmdline.xkbModel; - from = X_CMDLINE; - } + s = NULL; + if (g_cmdline.xkbModel) + { + s = g_cmdline.xkbModel; + from = X_CMDLINE; + } #ifdef XWIN_XF86CONFIG - else - { - s = winSetStrOption (kbd->inp_option_lst, "XkbModel", NULL); - from = X_CONFIG; - } + else + { + s = winSetStrOption (kbd->inp_option_lst, "XkbModel", NULL); + from = X_CONFIG; + } #endif - if (s) - { - g_winInfo.xkb.model = NULL_IF_EMPTY (s); - winMsg (from, "XKB: model: \"%s\"\n", s); - } + if (s) + { + g_winInfo.xkb.model = NULL_IF_EMPTY (s); + winMsg (from, "XKB: model: \"%s\"\n", s); + } - s = NULL; - if (g_cmdline.xkbLayout) - { - s = g_cmdline.xkbLayout; - from = X_CMDLINE; - } + s = NULL; + if (g_cmdline.xkbLayout) + { + s = g_cmdline.xkbLayout; + from = X_CMDLINE; + } #ifdef XWIN_XF86CONFIG - else - { - s = winSetStrOption (kbd->inp_option_lst, "XkbLayout", NULL); - from = X_CONFIG; - } + else + { + s = winSetStrOption (kbd->inp_option_lst, "XkbLayout", NULL); + from = X_CONFIG; + } #endif - if (s) - { - g_winInfo.xkb.layout = NULL_IF_EMPTY (s); - winMsg (from, "XKB: layout: \"%s\"\n", s); - } + if (s) + { + g_winInfo.xkb.layout = NULL_IF_EMPTY (s); + winMsg (from, "XKB: layout: \"%s\"\n", s); + } - s = NULL; - if (g_cmdline.xkbVariant) - { - s = g_cmdline.xkbVariant; - from = X_CMDLINE; - } + s = NULL; + if (g_cmdline.xkbVariant) + { + s = g_cmdline.xkbVariant; + from = X_CMDLINE; + } #ifdef XWIN_XF86CONFIG - else - { - s = winSetStrOption (kbd->inp_option_lst, "XkbVariant", NULL); - from = X_CONFIG; - } + else + { + s = winSetStrOption (kbd->inp_option_lst, "XkbVariant", NULL); + from = X_CONFIG; + } #endif - if (s) - { - g_winInfo.xkb.variant = NULL_IF_EMPTY (s); - winMsg (from, "XKB: variant: \"%s\"\n", s); - } + if (s) + { + g_winInfo.xkb.variant = NULL_IF_EMPTY (s); + winMsg (from, "XKB: variant: \"%s\"\n", s); + } - s = NULL; - if (g_cmdline.xkbOptions) - { - s = g_cmdline.xkbOptions; - from = X_CMDLINE; - } + s = NULL; + if (g_cmdline.xkbOptions) + { + s = g_cmdline.xkbOptions; + from = X_CMDLINE; + } #ifdef XWIN_XF86CONFIG - else - { - s = winSetStrOption (kbd->inp_option_lst, "XkbOptions", NULL); - from = X_CONFIG; - } + else + { + s = winSetStrOption (kbd->inp_option_lst, "XkbOptions", NULL); + from = X_CONFIG; + } #endif - if (s) - { - g_winInfo.xkb.options = NULL_IF_EMPTY (s); - winMsg (from, "XKB: options: \"%s\"\n", s); - } - -#ifdef XWIN_XF86CONFIG - from = X_CMDLINE; - - if ((s = winSetStrOption (kbd->inp_option_lst, "XkbKeymap", NULL))) - { - g_winInfo.xkb.keymap = NULL_IF_EMPTY (s); - winMsg (X_CONFIG, "XKB: keymap: \"%s\" " - " (overrides other XKB settings)\n", s); - } - - if ((s = winSetStrOption (kbd->inp_option_lst, "XkbCompat", NULL))) - { - g_winInfo.xkb.compat = NULL_IF_EMPTY (s); - winMsg (X_CONFIG, "XKB: compat: \"%s\"\n", s); - } - - if ((s = winSetStrOption (kbd->inp_option_lst, "XkbTypes", NULL))) - { - g_winInfo.xkb.types = NULL_IF_EMPTY (s); - winMsg (X_CONFIG, "XKB: types: \"%s\"\n", s); - } - - if ((s = - winSetStrOption (kbd->inp_option_lst, "XkbKeycodes", NULL))) - { - g_winInfo.xkb.keycodes = NULL_IF_EMPTY (s); - winMsg (X_CONFIG, "XKB: keycodes: \"%s\"\n", s); - } - - if ((s = - winSetStrOption (kbd->inp_option_lst, "XkbGeometry", NULL))) - { - g_winInfo.xkb.geometry = NULL_IF_EMPTY (s); - winMsg (X_CONFIG, "XKB: geometry: \"%s\"\n", s); - } + if (s) + { + g_winInfo.xkb.options = NULL_IF_EMPTY (s); + winMsg (from, "XKB: options: \"%s\"\n", s); + } - if ((s = winSetStrOption (kbd->inp_option_lst, "XkbSymbols", NULL))) - { - g_winInfo.xkb.symbols = NULL_IF_EMPTY (s); - winMsg (X_CONFIG, "XKB: symbols: \"%s\"\n", s); - } -#endif -#endif } #ifdef XWIN_XF86CONFIG } diff --git a/hw/xwin/winconfig.h b/hw/xwin/winconfig.h index 4b56d639c..71c458200 100644 --- a/hw/xwin/winconfig.h +++ b/hw/xwin/winconfig.h @@ -194,15 +194,11 @@ typedef struct #ifdef XWIN_XF86CONFIG char *keyboard; #endif -#ifdef XKB - Bool noXkbExtension; - char *xkbMap; char *xkbRules; char *xkbModel; char *xkbLayout; char *xkbVariant; char *xkbOptions; -#endif /* layout */ char *screenname; /* mouse settings */ @@ -309,7 +305,6 @@ typedef struct long rate; } keyboard; -#ifdef XKB struct { Bool disable; @@ -318,16 +313,8 @@ typedef struct char *layout; char *variant; char *options; - char *initialMap; - char *keymap; - char *types; - char *compat; - char *keycodes; - char *symbols; - char *geometry; } xkb; -#endif struct { Bool emulate3Buttons; diff --git a/hw/xwin/winkeybd.c b/hw/xwin/winkeybd.c index 24a7b4393..f270431e6 100644 --- a/hw/xwin/winkeybd.c +++ b/hw/xwin/winkeybd.c @@ -40,12 +40,7 @@ #include "winconfig.h" #include "winmsg.h" -#ifdef XKB -#ifndef XKB_IN_SERVER -#define XKB_IN_SERVER -#endif -#include <xkbsrv.h> -#endif +#include "xkbsrv.h" static Bool g_winKeyState[NUM_KEYCODES]; @@ -224,11 +219,9 @@ winKeybdProc (DeviceIntPtr pDeviceInt, int iState) KeySymsRec keySyms; CARD8 modMap[MAP_LENGTH]; DevicePtr pDevice = (DevicePtr) pDeviceInt; -#ifdef XKB XkbComponentNamesRec names; XkbSrvInfoPtr xkbi; XkbControlsPtr ctrl; -#endif switch (iState) { @@ -237,23 +230,16 @@ winKeybdProc (DeviceIntPtr pDeviceInt, int iState) winGetKeyMappings (&keySyms, modMap); -#ifdef XKB /* FIXME: Maybe we should use winGetKbdLeds () here? */ defaultKeyboardControl.leds = g_winInfo.keyboard.leds; -#else - defaultKeyboardControl.leds = g_winInfo.keyboard.leds; -#endif -#ifdef XKB if (g_winInfo.xkb.disable) { -#endif InitKeyboardDeviceStruct (pDevice, &keySyms, modMap, winKeybdBell, winKeybdCtrl); -#ifdef XKB } else { @@ -279,9 +265,7 @@ winKeybdProc (DeviceIntPtr pDeviceInt, int iState) XkbInitKeyboardDeviceStruct (pDeviceInt, &names, &keySyms, modMap, winKeybdBell, winKeybdCtrl); } -#endif -#ifdef XKB if (!g_winInfo.xkb.disable) { xkbi = pDeviceInt->key->xkbInfo; @@ -296,7 +280,6 @@ winKeybdProc (DeviceIntPtr pDeviceInt, int iState) winErrorFVerb (1, "winKeybdProc - Error initializing keyboard AutoRepeat (No XKB)\n"); } } -#endif g_winInternalModeKeyStatesPtr = &(pDeviceInt->key->state); break; diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c index f346bed21..38ee9a2df 100755 --- a/hw/xwin/winprocarg.c +++ b/hw/xwin/winprocarg.c @@ -1369,16 +1369,6 @@ ddxProcessArgument (int argc, char *argv[], int i) } #endif -#ifdef XKB - /* - * Look for the '-kb' argument - */ - if (IS_OPTION ("-kb")) - { - g_cmdline.noXkbExtension = TRUE; - return 0; /* Let DIX parse this again */ - } - if (IS_OPTION ("-xkbrules")) { CHECK_ARGS (1); @@ -1409,7 +1399,6 @@ ddxProcessArgument (int argc, char *argv[], int i) g_cmdline.xkbOptions = argv[++i]; return 2; } -#endif if (IS_OPTION ("-keyhook")) { diff --git a/hw/xwin/winwndproc.c b/hw/xwin/winwndproc.c index 460efe650..36cde35e4 100644 --- a/hw/xwin/winwndproc.c +++ b/hw/xwin/winwndproc.c @@ -42,9 +42,7 @@ #include "winmsg.h" #include "inputstr.h" -#ifdef XKB extern BOOL winCheckKeyPressed(WPARAM wParam, LPARAM lParam); -#endif extern void winFixShiftKeys (int iScanCode); @@ -1031,7 +1029,6 @@ winWindowProc (HWND hwnd, UINT message, if ((wParam == VK_LWIN || wParam == VK_RWIN) && !g_fKeyboardHookLL) break; -#ifdef XKB /* * Discard presses generated from Windows auto-repeat * ago: Only discard them if XKB is not disabled @@ -1052,7 +1049,6 @@ winWindowProc (HWND hwnd, UINT message, return 0; } } -#endif /* Discard fake Ctrl_L presses that precede AltGR on non-US keyboards */ if (winIsFakeCtrl_L (message, wParam, lParam)) |