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 | |
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>
38 files changed, 344 insertions, 998 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c index b136e0149..1802b1859 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -74,10 +74,8 @@ SOFTWARE. #include "listdev.h" /* for CopySwapXXXClass */ #include "xace.h" -#ifdef XKB #include <X11/extensions/XKBproto.h> #include "xkbsrv.h" -#endif #define WID(w) ((w) ? ((w)->drawable.id) : 0) #define AllModifiersMask ( \ @@ -304,11 +302,9 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to) (*k)->BellProc = it->BellProc; (*k)->CtrlProc = it->CtrlProc; (*k)->ctrl = it->ctrl; -#ifdef XKB if ((*k)->xkb_sli) XkbFreeSrvLedInfo((*k)->xkb_sli); (*k)->xkb_sli = XkbCopySrvLedInfo(from, it->xkb_sli, *k, NULL); -#endif k = &(*k)->next; } @@ -489,11 +485,9 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to) } (*l)->CtrlProc = it->CtrlProc; (*l)->ctrl = it->ctrl; -#ifdef XKB if ((*l)->xkb_sli) XkbFreeSrvLedInfo((*l)->xkb_sli); (*l)->xkb_sli = XkbCopySrvLedInfo(from, it->xkb_sli, NULL, *l); -#endif l = &(*l)->next; } @@ -529,9 +523,7 @@ DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to) { KeyCode *oldModKeyMap; KeySym *oldMap; -#ifdef XKB struct _XkbSrvInfo *oldXkbInfo; -#endif if (!to->key) { classes = dixLookupPrivate(&to->devPrivates, @@ -548,9 +540,7 @@ DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to) oldModKeyMap = to->key->modifierKeyMap; oldMap = to->key->curKeySyms.map; -#ifdef XKB oldXkbInfo = to->key->xkbInfo; -#endif if (!oldMap) /* newly created key struct */ { @@ -563,9 +553,7 @@ DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to) to->key->modifierKeyMap = oldModKeyMap; to->key->curKeySyms.map = oldMap; -#ifdef XKB to->key->xkbInfo = oldXkbInfo; -#endif CopyKeyClass(from, to); } else if (to->key && !from->key) @@ -624,7 +612,6 @@ DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to) classes->button = NULL; } -#ifdef XKB if (from->button->xkb_acts) { if (!to->button->xkb_acts) @@ -637,7 +624,6 @@ DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to) sizeof(XkbAction)); } else xfree(to->button->xkb_acts); -#endif } else if (to->button && !from->button) { ClassesPtr classes; @@ -1821,10 +1807,8 @@ SendDeviceMappingNotify(ClientPtr client, CARD8 request, ev->count = count; } -#ifdef XKB if (request == MappingKeyboard || request == MappingModifier) XkbApplyMappingChange(dev, request, firstKeyCode, count, client); -#endif SendEventToAllWindows(dev, DeviceMappingNotifyMask, (xEvent *) ev, 1); } diff --git a/configure.ac b/configure.ac index a9a67d804..a0a89d92c 100644 --- a/configure.ac +++ b/configure.ac @@ -1014,8 +1014,6 @@ AM_CONDITIONAL(XF86UTILS, test "x$XF86UTILS" = xyes) AC_DEFINE(SHAPE, 1, [Support SHAPE extension]) AC_DEFINE(XKB, 1, [Build XKB]) -AC_DEFINE(XKB_IN_SERVER, 1, [Build XKB server]) -AC_DEFINE(XKB_DFLT_DISABLED, 0, [Disable XKB per default]) AC_DEFINE_DIR(XKB_BASE_DIRECTORY, XKBPATH, [Path to XKB data]) AC_DEFINE_DIR(XKB_BIN_DIRECTORY, bindir, [Path to XKB bin dir]) diff --git a/dix/devices.c b/dix/devices.c index f2410fd5c..9d6651d48 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -63,12 +63,7 @@ SOFTWARE. #include "dixstruct.h" #include "ptrveloc.h" #include "site.h" -#ifndef XKB_IN_SERVER -#define XKB_IN_SERVER -#endif -#ifdef XKB -#include <xkbsrv.h> -#endif +#include "xkbsrv.h" #include "privates.h" #include "xace.h" #include "mi.h" @@ -490,9 +485,7 @@ CoreKeyboardProc(DeviceIntPtr pDev, int what) { CARD8 *modMap; KeySymsRec keySyms; -#ifdef XKB XkbComponentNamesRec names; -#endif ClassesPtr classes; switch (what) { @@ -523,19 +516,9 @@ CoreKeyboardProc(DeviceIntPtr pDev, int what) return BadAlloc; } -#ifdef XKB - if (!noXkbExtension) { - bzero(&names, sizeof(names)); - XkbInitKeyboardDeviceStruct(pDev, &names, &keySyms, modMap, - CoreKeyboardBell, CoreKeyboardCtl); - } - else -#endif - { - /* FIXME Our keymap here isn't exactly useful. */ - InitKeyboardDeviceStruct((DevicePtr)pDev, &keySyms, modMap, - CoreKeyboardBell, CoreKeyboardCtl); - } + bzero(&names, sizeof(names)); + XkbInitKeyboardDeviceStruct(pDev, &names, &keySyms, modMap, + CoreKeyboardBell, CoreKeyboardCtl); xfree(keySyms.map); xfree(modMap); @@ -661,13 +644,11 @@ FreeDeviceClass(int type, pointer *class) case KeyClass: { KeyClassPtr* k = (KeyClassPtr*)class; -#ifdef XKB if ((*k)->xkbInfo) { XkbFreeInfo((*k)->xkbInfo); (*k)->xkbInfo = NULL; } -#endif xfree((*k)->curKeySyms.map); xfree((*k)->modifierKeyMap); xfree((*k)); @@ -676,10 +657,8 @@ FreeDeviceClass(int type, pointer *class) case ButtonClass: { ButtonClassPtr *b = (ButtonClassPtr*)class; -#ifdef XKB if ((*b)->xkb_acts) xfree((*b)->xkb_acts); -#endif xfree((*b)); break; } @@ -724,10 +703,8 @@ FreeFeedbackClass(int type, pointer *class) KbdFeedbackPtr k, knext; for (k = (*kbdfeed); k; k = knext) { knext = k->next; -#ifdef XKB if (k->xkb_sli) XkbFreeSrvLedInfo(k->xkb_sli); -#endif xfree(k); } break; @@ -785,10 +762,8 @@ FreeFeedbackClass(int type, pointer *class) for (l = (*leds); l; l = lnext) { lnext = l->next; -#ifdef XKB if (l->xkb_sli) XkbFreeSrvLedInfo(l->xkb_sli); -#endif xfree(l); } break; @@ -859,11 +834,8 @@ CloseDevice(DeviceIntPtr dev) FreeAllDeviceClasses(classes); } - -#ifdef XKB while (dev->xkb_interest) XkbRemoveResourceClient((DevicePtr)dev,dev->xkb_interest->resource); -#endif if (DevHasCursor(dev) && dev->spriteInfo->sprite) { xfree(dev->spriteInfo->sprite->spriteTrace); @@ -920,9 +892,7 @@ CloseDownDevices(void) inputInfo.off_devices = NULL; inputInfo.keyboard = NULL; inputInfo.pointer = NULL; -#ifdef XKB XkbDeleteRulesDflts(); -#endif } /** @@ -1193,10 +1163,8 @@ InitKeyClassDeviceStruct(DeviceIntPtr dev, KeySymsPtr pKeySyms, CARD8 pModifiers return FALSE; } dev->key = keyc; -#ifdef XKB dev->key->xkbInfo= NULL; - if (!noXkbExtension) XkbInitDevice(dev); -#endif + XkbInitDevice(dev); return TRUE; } @@ -1392,19 +1360,14 @@ InitKbdFeedbackClassDeviceStruct(DeviceIntPtr dev, BellProcPtr bellProc, return FALSE; feedc->BellProc = bellProc; feedc->CtrlProc = controlProc; -#ifdef XKB defaultKeyboardControl.autoRepeat = TRUE; -#endif feedc->ctrl = defaultKeyboardControl; feedc->ctrl.id = 0; if ((feedc->next = dev->kbdfeed) != 0) feedc->ctrl.id = dev->kbdfeed->ctrl.id + 1; dev->kbdfeed = feedc; -#ifdef XKB feedc->xkb_sli= NULL; - if (!noXkbExtension) - XkbFinishDeviceInit(dev); -#endif + XkbFinishDeviceInit(dev); (*dev->kbdfeed->CtrlProc)(dev,&dev->kbdfeed->ctrl); return TRUE; } @@ -1517,9 +1480,7 @@ InitLedFeedbackClassDeviceStruct (DeviceIntPtr dev, LedCtrlProcPtr controlProc) feedc->ctrl.id = 0; if ( (feedc->next = dev->leds) ) feedc->ctrl.id = dev->leds->ctrl.id + 1; -#ifdef XKB feedc->xkb_sli= NULL; -#endif dev->leds = feedc; (*controlProc)(dev, &feedc->ctrl); return TRUE; @@ -1582,25 +1543,18 @@ SendMappingNotify(DeviceIntPtr pDev, unsigned request, unsigned firstKeyCode, event.u.mappingNotify.firstKeyCode = firstKeyCode; event.u.mappingNotify.count = count; } -#ifdef XKB - if (!noXkbExtension && - ((request == MappingKeyboard) || (request == MappingModifier))) { + if (request == MappingKeyboard || request == MappingModifier) XkbApplyMappingChange(pDev,request,firstKeyCode,count, client); - } -#endif /* 0 is the server client */ for (i=1; i<currentMaxClients; i++) { if (clients[i] && clients[i]->clientState == ClientStateRunning) { -#ifdef XKB - if (!noXkbExtension && - (request == MappingKeyboard) && - (clients[i]->xkbClientFlags != 0) && - (clients[i]->mapNotifyMask&XkbKeySymsMask)) + if (request == MappingKeyboard && + clients[i]->xkbClientFlags != 0 && + (clients[i]->mapNotifyMask & XkbKeySymsMask)) continue; -#endif event.u.u.sequenceNumber = clients[i]->sequence; WriteEventsToClient(clients[i], 1, &event); } @@ -2097,15 +2051,13 @@ DoChangeKeyboardControl (ClientPtr client, DeviceIntPtr keybd, XID *vlist, client->errorValue = t; return BadValue; } -#ifdef XKB - if (!noXkbExtension) { - XkbEventCauseRec cause; - XkbSetCauseCoreReq(&cause,X_ChangeKeyboardControl,client); - XkbSetIndicators(keybd,((led == DO_ALL) ? ~0L : (1L<<(led-1))), - ctrl.leds, &cause); - ctrl.leds = keybd->kbdfeed->ctrl.leds; - } -#endif + + XkbEventCauseRec cause; + XkbSetCauseCoreReq(&cause,X_ChangeKeyboardControl,client); + XkbSetIndicators(keybd,((led == DO_ALL) ? ~0L : (1L<<(led-1))), + ctrl.leds, &cause); + ctrl.leds = keybd->kbdfeed->ctrl.leds; + break; case KBKey: key = (KeyCode)*vlist; @@ -2123,10 +2075,8 @@ DoChangeKeyboardControl (ClientPtr client, DeviceIntPtr keybd, XID *vlist, mask = (1 << (key & 7)); t = (CARD8)*vlist; vlist++; -#ifdef XKB - if (!noXkbExtension && key != DO_ALL) + if (key != DO_ALL) XkbDisableComputedAutoRepeats(keybd,key); -#endif if (t == AutoRepeatModeOff) { if (key == DO_ALL) ctrl.autoRepeat = FALSE; @@ -2159,14 +2109,9 @@ DoChangeKeyboardControl (ClientPtr client, DeviceIntPtr keybd, XID *vlist, } keybd->kbdfeed->ctrl = ctrl; -#ifdef XKB /* The XKB RepeatKeys control and core protocol global autorepeat */ /* value are linked */ - if (!noXkbExtension) - XkbSetRepeatKeys(keybd, key, keybd->kbdfeed->ctrl.autoRepeat); - else -#endif - (*keybd->kbdfeed->CtrlProc)(keybd, &keybd->kbdfeed->ctrl); + XkbSetRepeatKeys(keybd, key, keybd->kbdfeed->ctrl.autoRepeat); return Success; @@ -2275,14 +2220,8 @@ ProcBell(ClientPtr client) rc = XaceHook(XACE_DEVICE_ACCESS, client, keybd, DixBellAccess); if (rc != Success) return rc; -#ifdef XKB - if (!noXkbExtension) - XkbHandleBell(FALSE, FALSE, keybd, newpercent, - &keybd->kbdfeed->ctrl, 0, None, NULL, client); - else -#endif - (*keybd->kbdfeed->BellProc)(newpercent, keybd, - &keybd->kbdfeed->ctrl, 0); + XkbHandleBell(FALSE, FALSE, keybd, newpercent, + &keybd->kbdfeed->ctrl, 0, None, NULL, client); } } @@ -2633,15 +2572,9 @@ AllocMasterDevice(ClientPtr client, char* name, DeviceIntPtr* ptr, DeviceIntPtr* strcpy(pointer->name, name); strcat(pointer->name, " pointer"); -#ifdef XKB pointer->public.processInputProc = ProcessOtherEvent; pointer->public.realInputProc = ProcessOtherEvent; - if (!noXkbExtension) - XkbSetExtension(pointer, ProcessPointerEvent); -#else - pointer->public.processInputProc = ProcessPointerEvent; - pointer->public.realInputProc = ProcessPointerEvent; -#endif + XkbSetExtension(pointer, ProcessPointerEvent); pointer->deviceGrab.ActivateGrab = ActivatePointerGrab; pointer->deviceGrab.DeactivateGrab = DeactivatePointerGrab; pointer->coreEvents = TRUE; @@ -2661,15 +2594,9 @@ AllocMasterDevice(ClientPtr client, char* name, DeviceIntPtr* ptr, DeviceIntPtr* strcpy(keyboard->name, name); strcat(keyboard->name, " keyboard"); -#ifdef XKB keyboard->public.processInputProc = ProcessOtherEvent; keyboard->public.realInputProc = ProcessOtherEvent; - if (!noXkbExtension) - XkbSetExtension(keyboard, ProcessKeyboardEvent); -#else - keyboard->public.processInputProc = ProcessKeyboardEvent; - keyboard->public.realInputProc = ProcessKeyboardEvent; -#endif + XkbSetExtension(keyboard, ProcessKeyboardEvent); keyboard->deviceGrab.ActivateGrab = ActivateKeyboardGrab; keyboard->deviceGrab.DeactivateGrab = DeactivateKeyboardGrab; keyboard->coreEvents = TRUE; diff --git a/dix/dispatch.c b/dix/dispatch.c index ee105f8dd..09fd3afc6 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -136,13 +136,8 @@ int ProcInitialConnection(); #endif #include "privates.h" #include "xace.h" -#ifdef XKB -#ifndef XKB_IN_SERVER -#define XKB_IN_SERVER -#endif #include "inputstr.h" -#include <xkbsrv.h> -#endif +#include "xkbsrv.h" #ifdef XSERVER_DTRACE #include "registry.h" @@ -3478,15 +3473,11 @@ void InitClient(ClientPtr client, int i, pointer ospriv) client->priority = 0; client->clientState = ClientStateInitial; client->devPrivates = NULL; -#ifdef XKB - if (!noXkbExtension) { - client->xkbClientFlags = 0; - client->mapNotifyMask = 0; - client->newKeyboardNotifyMask = 0; - client->vMinor = client->vMajor = 0; - QueryMinMaxKeyCodes(&client->minKC,&client->maxKC); - } -#endif + client->xkbClientFlags = 0; + client->mapNotifyMask = 0; + client->newKeyboardNotifyMask = 0; + client->vMinor = client->vMajor = 0; + QueryMinMaxKeyCodes(&client->minKC,&client->maxKC); client->replyBytesRemaining = 0; client->fontResFunc = NULL; client->smart_priority = 0; diff --git a/dix/events.c b/dix/events.c index a1aec2f8f..95bb3e9e4 100644 --- a/dix/events.c +++ b/dix/events.c @@ -133,11 +133,10 @@ of the copyright holder. #endif #include "globals.h" -#ifdef XKB #include <X11/extensions/XKBproto.h> -#include <xkbsrv.h> +#include "xkbsrv.h" +/* XKB FIXME: why is this here? */ extern Bool XkbFilterEvents(ClientPtr, int, xEvent *); -#endif #include "xace.h" @@ -1078,12 +1077,10 @@ EnqueueEvent(xEvent *xE, DeviceIntPtr device, int count) NoticeTime(xE); -#ifdef XKB /* Fix for key repeating bug. */ if (device->key != NULL && device->key->xkbInfo != NULL && xE->u.u.type == KeyRelease) AccessXCancelRepeatKey(device->key->xkbInfo, xE->u.u.detail); -#endif if (DeviceEventCallback) { @@ -2116,11 +2113,8 @@ DeliverEventsToWindow(DeviceIntPtr pDev, WindowPtr pWin, xEvent pDev->valuator->motionHintWindow = pWin; else { - if (((type == DeviceMotionNotify) -#ifdef XKB - || (type == DeviceButtonPress) -#endif - ) && deliveries) + if ((type == DeviceMotionNotify || type == DeviceButtonPress) && + deliveries) CheckDeviceGrabAndHintWindow (pWin, type, (deviceKeyButtonPointer*) pEvents, grab, client, deliveryMask); @@ -3246,7 +3240,6 @@ CheckPassiveGrabsOnWindow( tempGrab.next = NULL; for (; grab; grab = grab->next) { -#ifdef XKB DeviceIntPtr gdev; XkbSrvInfoPtr xkbi = NULL; @@ -3260,40 +3253,16 @@ CheckPassiveGrabsOnWindow( } if (gdev && gdev->key) xkbi= gdev->key->xkbInfo; -#endif tempGrab.modifierDevice = grab->modifierDevice; - if ((device == grab->modifierDevice) && - ((xE->u.u.type == KeyPress) || (xE->u.u.type == DeviceKeyPress))) - tempGrab.modifiersDetail.exact = -#ifdef XKB - (noXkbExtension) ? - ((gdev) ? gdev->key->prev_state : 0) : - ((xkbi) ? xkbi->state.grab_mods : 0); -#else - (gdev) ? gdev->key->prev_state : 0; -#endif - else - tempGrab.modifiersDetail.exact = -#ifdef XKB - (noXkbExtension) ? - ((gdev) ? gdev->key->state : 0) : - ((xkbi) ? xkbi->state.grab_mods : 0); -#else - (gdev) ? gdev->key->state : 0; -#endif - /* ignore the device for core events when comparing grabs */ + tempGrab.modifiersDetail.exact = xkbi ? xkbi->state.grab_mods : 0; + /* ignore the device for core events when comparing grabs */ if (GrabMatchesSecond(&tempGrab, grab, (xE->u.u.type < LASTEvent)) && (!grab->confineTo || (grab->confineTo->realized && BorderSizeNotEmpty(device, grab->confineTo)))) { -#ifdef XKB - if (!noXkbExtension) { - XE_KBPTR.state &= 0x1f00; - XE_KBPTR.state |= - tempGrab.modifiersDetail.exact&(~0x1f00); - } -#endif + XE_KBPTR.state &= 0x1f00; + XE_KBPTR.state |= tempGrab.modifiersDetail.exact&(~0x1f00); grabinfo = &device->deviceGrab; /* A passive grab may have been created for a different device than it is assigned to at this point in time. @@ -3690,11 +3659,7 @@ DeliverGrabbedEvent(xEvent *xE, DeviceIntPtr thisDev, * @param count Number of elements in xE. */ void -#ifdef XKB CoreProcessKeyboardEvent (xEvent *xE, DeviceIntPtr keybd, int count) -#else -ProcessKeyboardEvent (xEvent *xE, DeviceIntPtr keybd, int count) -#endif { int key, bit; BYTE *kptr; @@ -3765,7 +3730,6 @@ ProcessKeyboardEvent (xEvent *xE, DeviceIntPtr keybd, int count) XaceHook(XACE_KEY_AVAIL, xE, keybd, count); } -#ifdef XKB /* This function is used to set the key pressed or key released state - this is only used when the pressing of keys does not cause the device's processInputProc to be called, as in for example Mouse Keys. @@ -3795,7 +3759,6 @@ FixKeyState (xEvent *xE, DeviceIntPtr keybd) else FatalError("Impossible keyboard event"); } -#endif /** * Main pointer event processing function for core pointer events. @@ -3810,32 +3773,18 @@ FixKeyState (xEvent *xE, DeviceIntPtr keybd) * @param count Number of elements in xE. */ void -#ifdef XKB CoreProcessPointerEvent (xEvent *xE, DeviceIntPtr mouse, int count) -#else -ProcessPointerEvent (xEvent *xE, DeviceIntPtr mouse, int count) -#endif { GrabPtr grab = mouse->deviceGrab.grab; Bool deactivateGrab = FALSE; ButtonClassPtr butc = mouse->button; SpritePtr pSprite = mouse->spriteInfo->sprite; -#ifdef XKB XkbSrvInfoPtr xkbi= GetPairedDevice(mouse)->key->xkbInfo; -#endif if (!syncEvents.playingEvents) NoticeTime(xE) - XE_KBPTR.state = (butc->state | ( -#ifdef XKB - (noXkbExtension ? - inputInfo.keyboard->key->state : - xkbi->state.grab_mods) -#else - inputInfo.keyboard->key->state -#endif - )); + XE_KBPTR.state = (butc->state | xkbi->state.grab_mods); { NoticeTime(xE); if (DeviceEventCallback) @@ -4171,18 +4120,10 @@ CoreEnterLeaveEvent( event.u.enterLeave.child = child; event.u.enterLeave.flags = event.u.keyButtonPointer.sameScreen ? ELFlagSameScreen : 0; -#ifdef XKB - if (!noXkbExtension) { - event.u.enterLeave.state = mouse->button->state & 0x1f00; - if (keybd) - event.u.enterLeave.state |= + event.u.enterLeave.state = mouse->button->state & 0x1f00; + if (keybd) + event.u.enterLeave.state |= XkbGrabStateFromRec(&keybd->key->xkbInfo->state); - } else -#endif - { - event.u.enterLeave.state = (keybd) ? keybd->key->state : 0; - event.u.enterLeave.state |= mouse->button->state; - } event.u.enterLeave.mode = mode; focus = (keybd) ? keybd->focus->win : None; if ((focus != NoneWin) && @@ -4262,18 +4203,9 @@ DeviceEnterLeaveEvent( devEnterLeave->mode = mode; devEnterLeave->mode |= (sameScreen ? (ELFlagSameScreen << 4) : 0); -#ifdef XKB - if (!noXkbExtension) { - devEnterLeave->state = mouse->button->state & 0x1f00; - if (keybd) - devEnterLeave->state |= - XkbGrabStateFromRec(&keybd->key->xkbInfo->state); - } else -#endif - { - devEnterLeave->state = (keybd) ? keybd->key->state : 0; - devEnterLeave->state |= mouse->button->state; - } + devEnterLeave->state = mouse->button->state & 0x1f00; + if (keybd) + devEnterLeave->state |= XkbGrabStateFromRec(&keybd->key->xkbInfo->state); mskidx = mouse->id; inputMasks = wOtherInputMasks(pWin); @@ -5540,10 +5472,8 @@ WriteEventsToClient(ClientPtr pClient, int count, xEvent *events) int i, eventlength = sizeof(xEvent); -#ifdef XKB - if ((!noXkbExtension)&&(!XkbFilterEvents(pClient, count, events))) + if (!XkbFilterEvents(pClient, count, events)) return; -#endif #ifdef PANORAMIX if(!noPanoramiXExtension && diff --git a/dix/getevents.c b/dix/getevents.c index 44636d73b..112bb102c 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -42,10 +42,8 @@ #include "dixevents.h" #include "mipointer.h" -#ifdef XKB #include <X11/extensions/XKBproto.h> #include "xkbsrv.h" -#endif #ifdef PANORAMIX #include "panoramiX.h" @@ -454,15 +452,9 @@ updateMotionHistory(DeviceIntPtr pDev, CARD32 ms, int first_valuator, */ int GetMaximumEventsNum(void) { - /* One base event -- device, plus valuator events. - * Multiply by two if we're doing non-XKB key repeats. */ + /* One base event -- device, plus valuator events. */ int ret = 1 + MAX_VALUATOR_EVENTS; -#ifdef XKB - if (noXkbExtension) -#endif - ret *= 2; - /* One possible DeviceClassesChangedEvent */ ret++; @@ -814,25 +806,7 @@ GetKeyboardValuatorEvents(EventList *events, DeviceIntPtr pDev, int type, numEvents += countValuatorEvents(num_valuators); -#ifdef XKB - if (noXkbExtension) -#endif - { - switch (sym) { - case XK_Num_Lock: - case XK_Caps_Lock: - case XK_Scroll_Lock: - case XK_Shift_Lock: - if (type == KeyRelease) - return 0; - else if (type == KeyPress && key_is_down(pDev, key_code)) - type = KeyRelease; - } - } - - /* Handle core repeating, via press/release/press/release. - * FIXME: In theory, if you're repeating with two keyboards in non-XKB, - * you could get unbalanced events here. */ + /* Handle core repeating, via press/release/press/release. */ if (type == KeyPress && key_is_down(pDev, key_code)) { /* If autorepeating is disabled either globally or just for that key, * or we have a modifier, don't generate a repeat event. */ @@ -840,17 +814,6 @@ GetKeyboardValuatorEvents(EventList *events, DeviceIntPtr pDev, int type, !key_autorepeats(pDev, key_code) || pDev->key->modifierMap[key_code]) return 0; - -#ifdef XKB - if (noXkbExtension) -#endif - { - numEvents += GetKeyboardValuatorEvents(events, pDev, - KeyRelease, key_code, - first_valuator, num_valuators, - valuators); - events += numEvents; - } } ms = GetTimeInMillis(); 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)) diff --git a/include/dix-config.h.in b/include/dix-config.h.in index e1d226c84..1af477def 100644 --- a/include/dix-config.h.in +++ b/include/dix-config.h.in @@ -315,15 +315,6 @@ /* Support Xinerama extension */ #undef XINERAMA -/* Build XKB */ -#undef XKB - -/* Enable XKB per default */ -#undef XKB_DFLT_DISABLED - -/* Build XKB server */ -#undef XKB_IN_SERVER - /* Vendor release */ #undef XORG_RELEASE diff --git a/include/dix.h b/include/dix.h index 4aa03c2f5..b21084607 100644 --- a/include/dix.h +++ b/include/dix.h @@ -408,11 +408,9 @@ extern _X_EXPORT void DeliverGrabbedEvent( Bool /* deactivateGrab */, int /* count */); -#ifdef XKB extern _X_EXPORT void FixKeyState( xEvent * /* xE */, DeviceIntPtr /* keybd */); -#endif /* XKB */ extern _X_EXPORT void RecalculateDeliverableEvents( WindowPtr /* pWin */); diff --git a/include/dixstruct.h b/include/dixstruct.h index 4ca061b09..8bafcde0e 100644 --- a/include/dixstruct.h +++ b/include/dixstruct.h @@ -112,13 +112,11 @@ typedef struct _Client { int priority; ClientState clientState; PrivateRec *devPrivates; -#ifdef XKB unsigned short xkbClientFlags; unsigned short mapNotifyMask; unsigned short newKeyboardNotifyMask; unsigned short vMajor,vMinor; KeyCode minKC,maxKC; -#endif #ifdef DEBUG unsigned char requestLog[MAX_REQUEST_LOG]; diff --git a/include/globals.h b/include/globals.h index e70e7c69e..5ac3905d0 100644 --- a/include/globals.h +++ b/include/globals.h @@ -114,11 +114,6 @@ extern _X_EXPORT Bool noXFree86VidModeExtension; extern _X_EXPORT Bool noXFixesExtension; #endif -#ifdef XKB -/* noXkbExtension is defined in xkb/xkbInit.c */ -extern _X_EXPORT Bool noXkbExtension; -#endif - #ifdef PANORAMIX extern _X_EXPORT Bool noPanoramiXExtension; #endif diff --git a/include/input.h b/include/input.h index 2dd29f8e9..cf546e076 100644 --- a/include/input.h +++ b/include/input.h @@ -409,7 +409,6 @@ extern _X_EXPORT void ProcessKeyboardEvent( DeviceIntPtr /*keybd*/, int /*count*/); -#ifdef XKB extern _X_EXPORT void CoreProcessPointerEvent( xEventPtr /*xE*/, DeviceIntPtr /*mouse*/, @@ -419,7 +418,6 @@ extern _X_EXPORT _X_DEPRECATED void CoreProcessKeyboardEvent( xEventPtr /*xE*/, DeviceIntPtr /*keybd*/, int /*count*/) _X_DEPRECATED; -#endif extern _X_EXPORT Bool LegalModifier( unsigned int /*key*/, diff --git a/include/inputstr.h b/include/inputstr.h index bcfc09ed9..d1a965b28 100644 --- a/include/inputstr.h +++ b/include/inputstr.h @@ -144,11 +144,7 @@ typedef struct _KeyClassRec { CARD8 maxKeysPerModifier; unsigned short state; unsigned short prev_state; -#ifdef XKB struct _XkbSrvInfo *xkbInfo; -#else - void *pad0; -#endif } KeyClassRec, *KeyClassPtr; typedef struct _AxisInfo { @@ -192,11 +188,7 @@ typedef struct _ButtonClassRec { Mask motionMask; CARD8 down[DOWN_LENGTH]; CARD8 map[MAP_LENGTH]; -#ifdef XKB union _XkbAction *xkb_acts; -#else - void *pad0; -#endif } ButtonClassRec, *ButtonClassPtr; typedef struct _FocusClassRec { @@ -244,11 +236,7 @@ typedef struct _KbdFeedbackClassRec { KbdCtrlProcPtr CtrlProc; KeybdCtrl ctrl; KbdFeedbackPtr next; -#ifdef XKB struct _XkbSrvLedInfo *xkb_sli; -#else - void *pad0; -#endif } KbdFeedbackClassRec; typedef struct _PtrFeedbackClassRec { @@ -280,11 +268,7 @@ typedef struct _LedFeedbackClassRec { LedCtrlProcPtr CtrlProc; LedCtrl ctrl; LedFeedbackPtr next; -#ifdef XKB struct _XkbSrvLedInfo *xkb_sli; -#else - void *pad0; -#endif } LedFeedbackClassRec; @@ -446,11 +430,7 @@ typedef struct _DeviceIntRec { StringFeedbackPtr stringfeed; BellFeedbackPtr bell; LedFeedbackPtr leds; -#ifdef XKB struct _XkbInterest *xkb_interest; -#else - void *pad0; -#endif char *config_info; /* used by the hotplug layer */ PrivateRec *devPrivates; int nPrivates; diff --git a/include/site.h b/include/site.h index fec87070b..c07cbbfe6 100644 --- a/include/site.h +++ b/include/site.h @@ -90,11 +90,7 @@ SOFTWARE. #define DEFAULT_BELL 50 #define DEFAULT_BELL_PITCH 400 #define DEFAULT_BELL_DURATION 100 -#ifdef XKB #define DEFAULT_AUTOREPEAT TRUE -#else -#define DEFAULT_AUTOREPEAT FALSE -#endif #define DEFAULT_AUTOREPEATS {\ 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\ diff --git a/include/xkbsrv.h b/include/xkbsrv.h index c6f6e9e32..af87d8fa5 100644 --- a/include/xkbsrv.h +++ b/include/xkbsrv.h @@ -295,8 +295,6 @@ extern _X_EXPORT int XkbKeyboardErrorCode; extern _X_EXPORT char * XkbBaseDirectory; extern _X_EXPORT char * XkbBinDirectory; -extern _X_EXPORT Bool noXkbExtension; - extern _X_EXPORT pointer XkbLastRepeatEvent; extern _X_EXPORT CARD32 xkbDebugFlags; diff --git a/include/xorg-server.h.in b/include/xorg-server.h.in index 57b8a82a2..ca6aec2b6 100644 --- a/include/xorg-server.h.in +++ b/include/xorg-server.h.in @@ -103,15 +103,9 @@ /* Build XKB */ #undef XKB -/* Enable XKB per default */ -#undef XKB_DFLT_DISABLED - /* XKB default rules */ #undef XKB_DFLT_RULES -/* Build XKB support in server */ -#undef XKB_IN_SERVER - /* Support loadable input and output drivers */ #undef XLOADABLE diff --git a/mi/miinitext.c b/mi/miinitext.c index 92d6cd2f0..9520957ee 100644 --- a/mi/miinitext.c +++ b/mi/miinitext.c @@ -134,10 +134,6 @@ extern Bool noXFree86VidModeExtension; #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 @@ -167,9 +163,7 @@ typedef void (*InitExtension)(INITARGS); #define _XTEST_SERVER_ #include <X11/extensions/XTest.h> #endif -#ifdef XKB #include <X11/extensions/XKB.h> -#endif #ifdef XCSECURITY #include "securitysrv.h" #include <X11/extensions/securstr.h> @@ -213,9 +207,7 @@ extern void XvExtensionInit(INITARGS); extern void XvMCExtensionInit(INITARGS); #endif extern void SyncExtensionInit(INITARGS); -#ifdef XKB extern void XkbExtensionInit(INITARGS); -#endif extern void XCMiscExtensionInit(INITARGS); #ifdef XRECORD extern void RecordExtensionInit(INITARGS); @@ -340,9 +332,7 @@ static ExtensionToggle ExtensionToggleList[] = { "XINERAMA", &noPanoramiXExtension }, #endif { "XInputExtension", NULL }, -#ifdef XKB - { "XKEYBOARD", &noXkbExtension }, -#endif + { "XKEYBOARD", NULL }, #ifdef XSELINUX { "SELinux", &noSELinuxExtension }, #endif @@ -416,9 +406,7 @@ InitExtensions(int argc, char *argv[]) } #endif SyncExtensionInit(); -#if defined(XKB) - if (!noXkbExtension) XkbExtensionInit(); -#endif + XkbExtensionInit(); XCMiscExtensionInit(); #ifdef XRECORD if (!noTestExtensions) RecordExtensionInit(); @@ -493,9 +481,7 @@ static ExtensionModule staticExtensions[] = { #endif { BigReqExtensionInit, "BIG-REQUESTS", NULL, NULL, NULL }, { SyncExtensionInit, "SYNC", NULL, NULL, NULL }, -#ifdef XKB - { XkbExtensionInit, XkbName, &noXkbExtension, NULL, NULL }, -#endif + { XkbExtensionInit, XkbName, NULL, NULL, NULL }, { XCMiscExtensionInit, "XC-MISC", NULL, NULL, NULL }, #ifdef XCSECURITY { SecurityExtensionInit, SECURITY_EXTENSION_NAME, &noSecurityExtension, NULL, NULL }, diff --git a/os/utils.c b/os/utils.c index 55f8a9850..0ed89dd15 100644 --- a/os/utils.c +++ b/os/utils.c @@ -118,9 +118,7 @@ __stdcall unsigned long GetTickCount(void); #include "dixstruct.h" -#ifdef XKB -#include <xkbsrv.h> -#endif +#include "xkbsrv.h" #ifdef RENDER #include "picture.h" @@ -180,7 +178,6 @@ Bool noXFree86VidModeExtension = FALSE; #ifdef XFIXES Bool noXFixesExtension = FALSE; #endif -/* noXkbExtension is defined in xkb/xkbInit.c */ #ifdef PANORAMIX /* Xinerama is disabled by default unless enabled via +xinerama */ Bool noPanoramiXExtension = TRUE; @@ -551,9 +548,7 @@ void UseMsg(void) #ifdef XDMCP XdmcpUseMsg(); #endif -#ifdef XKB XkbUseMsg(); -#endif ddxUseMsg(); } @@ -722,13 +717,11 @@ ProcessCommandLine(int argc, char *argv[]) UseMsg(); exit(0); } -#ifdef XKB else if ( (skip=XkbProcessArguments(argc,argv,i))!=0 ) { if (skip>0) i+= skip-1; else UseMsg(); } -#endif #ifdef RLIMIT_DATA else if ( strcmp( argv[i], "-ld") == 0) { diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c index 573e731bd..e800482ac 100644 --- a/xkb/xkbInit.c +++ b/xkb/xkbInit.c @@ -85,9 +85,6 @@ typedef struct _SrvXkmInfo { /***====================================================================***/ -#ifndef XKB_DFLT_DISABLED -#define XKB_DFLT_DISABLED True -#endif #ifndef XKB_DFLT_RULES_PROP #define XKB_DFLT_RULES_PROP True #endif @@ -110,7 +107,6 @@ static char * XkbOptionsUsed= NULL; static XkbDescPtr xkb_cached_map = NULL; -Bool noXkbExtension= XKB_DFLT_DISABLED; static Bool XkbWantRulesProp= XKB_DFLT_RULES_PROP; /***====================================================================***/ @@ -817,15 +813,7 @@ extern unsigned char XkbDfltAccessXOptions; int XkbProcessArguments(int argc,char *argv[],int i) { - if (strcmp(argv[i],"-kb")==0) { - noXkbExtension= True; - return 1; - } - else if (strcmp(argv[i],"+kb")==0) { - noXkbExtension= False; - return 1; - } - else if (strncmp(argv[i], "-xkbdir", 7) == 0) { + if (strncmp(argv[i], "-xkbdir", 7) == 0) { if(++i < argc) { #if !defined(WIN32) && !defined(__CYGWIN__) if (getuid() != geteuid()) { |