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>
This commit is contained in:
Daniel Stone 2008-03-18 10:05:57 +02:00
parent f9da417163
commit 40877c6680
38 changed files with 350 additions and 1004 deletions

View File

@ -74,10 +74,8 @@ SOFTWARE.
#include "listdev.h" /* for CopySwapXXXClass */ #include "listdev.h" /* for CopySwapXXXClass */
#include "xace.h" #include "xace.h"
#ifdef XKB
#include <X11/extensions/XKBproto.h> #include <X11/extensions/XKBproto.h>
#include "xkbsrv.h" #include "xkbsrv.h"
#endif
#define WID(w) ((w) ? ((w)->drawable.id) : 0) #define WID(w) ((w) ? ((w)->drawable.id) : 0)
#define AllModifiersMask ( \ #define AllModifiersMask ( \
@ -304,11 +302,9 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to)
(*k)->BellProc = it->BellProc; (*k)->BellProc = it->BellProc;
(*k)->CtrlProc = it->CtrlProc; (*k)->CtrlProc = it->CtrlProc;
(*k)->ctrl = it->ctrl; (*k)->ctrl = it->ctrl;
#ifdef XKB
if ((*k)->xkb_sli) if ((*k)->xkb_sli)
XkbFreeSrvLedInfo((*k)->xkb_sli); XkbFreeSrvLedInfo((*k)->xkb_sli);
(*k)->xkb_sli = XkbCopySrvLedInfo(from, it->xkb_sli, *k, NULL); (*k)->xkb_sli = XkbCopySrvLedInfo(from, it->xkb_sli, *k, NULL);
#endif
k = &(*k)->next; k = &(*k)->next;
} }
@ -489,11 +485,9 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to)
} }
(*l)->CtrlProc = it->CtrlProc; (*l)->CtrlProc = it->CtrlProc;
(*l)->ctrl = it->ctrl; (*l)->ctrl = it->ctrl;
#ifdef XKB
if ((*l)->xkb_sli) if ((*l)->xkb_sli)
XkbFreeSrvLedInfo((*l)->xkb_sli); XkbFreeSrvLedInfo((*l)->xkb_sli);
(*l)->xkb_sli = XkbCopySrvLedInfo(from, it->xkb_sli, NULL, *l); (*l)->xkb_sli = XkbCopySrvLedInfo(from, it->xkb_sli, NULL, *l);
#endif
l = &(*l)->next; l = &(*l)->next;
} }
@ -529,9 +523,7 @@ DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to)
{ {
KeyCode *oldModKeyMap; KeyCode *oldModKeyMap;
KeySym *oldMap; KeySym *oldMap;
#ifdef XKB
struct _XkbSrvInfo *oldXkbInfo; struct _XkbSrvInfo *oldXkbInfo;
#endif
if (!to->key) if (!to->key)
{ {
classes = dixLookupPrivate(&to->devPrivates, classes = dixLookupPrivate(&to->devPrivates,
@ -548,9 +540,7 @@ DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to)
oldModKeyMap = to->key->modifierKeyMap; oldModKeyMap = to->key->modifierKeyMap;
oldMap = to->key->curKeySyms.map; oldMap = to->key->curKeySyms.map;
#ifdef XKB
oldXkbInfo = to->key->xkbInfo; oldXkbInfo = to->key->xkbInfo;
#endif
if (!oldMap) /* newly created key struct */ if (!oldMap) /* newly created key struct */
{ {
@ -563,9 +553,7 @@ DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to)
to->key->modifierKeyMap = oldModKeyMap; to->key->modifierKeyMap = oldModKeyMap;
to->key->curKeySyms.map = oldMap; to->key->curKeySyms.map = oldMap;
#ifdef XKB
to->key->xkbInfo = oldXkbInfo; to->key->xkbInfo = oldXkbInfo;
#endif
CopyKeyClass(from, to); CopyKeyClass(from, to);
} else if (to->key && !from->key) } else if (to->key && !from->key)
@ -624,7 +612,6 @@ DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to)
classes->button = NULL; classes->button = NULL;
} }
#ifdef XKB
if (from->button->xkb_acts) if (from->button->xkb_acts)
{ {
if (!to->button->xkb_acts) if (!to->button->xkb_acts)
@ -637,7 +624,6 @@ DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to)
sizeof(XkbAction)); sizeof(XkbAction));
} else } else
xfree(to->button->xkb_acts); xfree(to->button->xkb_acts);
#endif
} else if (to->button && !from->button) } else if (to->button && !from->button)
{ {
ClassesPtr classes; ClassesPtr classes;
@ -1821,10 +1807,8 @@ SendDeviceMappingNotify(ClientPtr client, CARD8 request,
ev->count = count; ev->count = count;
} }
#ifdef XKB
if (request == MappingKeyboard || request == MappingModifier) if (request == MappingKeyboard || request == MappingModifier)
XkbApplyMappingChange(dev, request, firstKeyCode, count, client); XkbApplyMappingChange(dev, request, firstKeyCode, count, client);
#endif
SendEventToAllWindows(dev, DeviceMappingNotifyMask, (xEvent *) ev, 1); SendEventToAllWindows(dev, DeviceMappingNotifyMask, (xEvent *) ev, 1);
} }

View File

@ -1014,8 +1014,6 @@ AM_CONDITIONAL(XF86UTILS, test "x$XF86UTILS" = xyes)
AC_DEFINE(SHAPE, 1, [Support SHAPE extension]) AC_DEFINE(SHAPE, 1, [Support SHAPE extension])
AC_DEFINE(XKB, 1, [Build XKB]) 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_BASE_DIRECTORY, XKBPATH, [Path to XKB data])
AC_DEFINE_DIR(XKB_BIN_DIRECTORY, bindir, [Path to XKB bin dir]) AC_DEFINE_DIR(XKB_BIN_DIRECTORY, bindir, [Path to XKB bin dir])

View File

@ -63,12 +63,7 @@ SOFTWARE.
#include "dixstruct.h" #include "dixstruct.h"
#include "ptrveloc.h" #include "ptrveloc.h"
#include "site.h" #include "site.h"
#ifndef XKB_IN_SERVER #include "xkbsrv.h"
#define XKB_IN_SERVER
#endif
#ifdef XKB
#include <xkbsrv.h>
#endif
#include "privates.h" #include "privates.h"
#include "xace.h" #include "xace.h"
#include "mi.h" #include "mi.h"
@ -490,9 +485,7 @@ CoreKeyboardProc(DeviceIntPtr pDev, int what)
{ {
CARD8 *modMap; CARD8 *modMap;
KeySymsRec keySyms; KeySymsRec keySyms;
#ifdef XKB
XkbComponentNamesRec names; XkbComponentNamesRec names;
#endif
ClassesPtr classes; ClassesPtr classes;
switch (what) { switch (what) {
@ -523,19 +516,9 @@ CoreKeyboardProc(DeviceIntPtr pDev, int what)
return BadAlloc; return BadAlloc;
} }
#ifdef XKB bzero(&names, sizeof(names));
if (!noXkbExtension) { XkbInitKeyboardDeviceStruct(pDev, &names, &keySyms, modMap,
bzero(&names, sizeof(names)); CoreKeyboardBell, CoreKeyboardCtl);
XkbInitKeyboardDeviceStruct(pDev, &names, &keySyms, modMap,
CoreKeyboardBell, CoreKeyboardCtl);
}
else
#endif
{
/* FIXME Our keymap here isn't exactly useful. */
InitKeyboardDeviceStruct((DevicePtr)pDev, &keySyms, modMap,
CoreKeyboardBell, CoreKeyboardCtl);
}
xfree(keySyms.map); xfree(keySyms.map);
xfree(modMap); xfree(modMap);
@ -661,13 +644,11 @@ FreeDeviceClass(int type, pointer *class)
case KeyClass: case KeyClass:
{ {
KeyClassPtr* k = (KeyClassPtr*)class; KeyClassPtr* k = (KeyClassPtr*)class;
#ifdef XKB
if ((*k)->xkbInfo) if ((*k)->xkbInfo)
{ {
XkbFreeInfo((*k)->xkbInfo); XkbFreeInfo((*k)->xkbInfo);
(*k)->xkbInfo = NULL; (*k)->xkbInfo = NULL;
} }
#endif
xfree((*k)->curKeySyms.map); xfree((*k)->curKeySyms.map);
xfree((*k)->modifierKeyMap); xfree((*k)->modifierKeyMap);
xfree((*k)); xfree((*k));
@ -676,10 +657,8 @@ FreeDeviceClass(int type, pointer *class)
case ButtonClass: case ButtonClass:
{ {
ButtonClassPtr *b = (ButtonClassPtr*)class; ButtonClassPtr *b = (ButtonClassPtr*)class;
#ifdef XKB
if ((*b)->xkb_acts) if ((*b)->xkb_acts)
xfree((*b)->xkb_acts); xfree((*b)->xkb_acts);
#endif
xfree((*b)); xfree((*b));
break; break;
} }
@ -724,10 +703,8 @@ FreeFeedbackClass(int type, pointer *class)
KbdFeedbackPtr k, knext; KbdFeedbackPtr k, knext;
for (k = (*kbdfeed); k; k = knext) { for (k = (*kbdfeed); k; k = knext) {
knext = k->next; knext = k->next;
#ifdef XKB
if (k->xkb_sli) if (k->xkb_sli)
XkbFreeSrvLedInfo(k->xkb_sli); XkbFreeSrvLedInfo(k->xkb_sli);
#endif
xfree(k); xfree(k);
} }
break; break;
@ -785,10 +762,8 @@ FreeFeedbackClass(int type, pointer *class)
for (l = (*leds); l; l = lnext) { for (l = (*leds); l; l = lnext) {
lnext = l->next; lnext = l->next;
#ifdef XKB
if (l->xkb_sli) if (l->xkb_sli)
XkbFreeSrvLedInfo(l->xkb_sli); XkbFreeSrvLedInfo(l->xkb_sli);
#endif
xfree(l); xfree(l);
} }
break; break;
@ -859,11 +834,8 @@ CloseDevice(DeviceIntPtr dev)
FreeAllDeviceClasses(classes); FreeAllDeviceClasses(classes);
} }
#ifdef XKB
while (dev->xkb_interest) while (dev->xkb_interest)
XkbRemoveResourceClient((DevicePtr)dev,dev->xkb_interest->resource); XkbRemoveResourceClient((DevicePtr)dev,dev->xkb_interest->resource);
#endif
if (DevHasCursor(dev) && dev->spriteInfo->sprite) { if (DevHasCursor(dev) && dev->spriteInfo->sprite) {
xfree(dev->spriteInfo->sprite->spriteTrace); xfree(dev->spriteInfo->sprite->spriteTrace);
@ -920,9 +892,7 @@ CloseDownDevices(void)
inputInfo.off_devices = NULL; inputInfo.off_devices = NULL;
inputInfo.keyboard = NULL; inputInfo.keyboard = NULL;
inputInfo.pointer = NULL; inputInfo.pointer = NULL;
#ifdef XKB
XkbDeleteRulesDflts(); XkbDeleteRulesDflts();
#endif
} }
/** /**
@ -1193,10 +1163,8 @@ InitKeyClassDeviceStruct(DeviceIntPtr dev, KeySymsPtr pKeySyms, CARD8 pModifiers
return FALSE; return FALSE;
} }
dev->key = keyc; dev->key = keyc;
#ifdef XKB
dev->key->xkbInfo= NULL; dev->key->xkbInfo= NULL;
if (!noXkbExtension) XkbInitDevice(dev); XkbInitDevice(dev);
#endif
return TRUE; return TRUE;
} }
@ -1392,19 +1360,14 @@ InitKbdFeedbackClassDeviceStruct(DeviceIntPtr dev, BellProcPtr bellProc,
return FALSE; return FALSE;
feedc->BellProc = bellProc; feedc->BellProc = bellProc;
feedc->CtrlProc = controlProc; feedc->CtrlProc = controlProc;
#ifdef XKB
defaultKeyboardControl.autoRepeat = TRUE; defaultKeyboardControl.autoRepeat = TRUE;
#endif
feedc->ctrl = defaultKeyboardControl; feedc->ctrl = defaultKeyboardControl;
feedc->ctrl.id = 0; feedc->ctrl.id = 0;
if ((feedc->next = dev->kbdfeed) != 0) if ((feedc->next = dev->kbdfeed) != 0)
feedc->ctrl.id = dev->kbdfeed->ctrl.id + 1; feedc->ctrl.id = dev->kbdfeed->ctrl.id + 1;
dev->kbdfeed = feedc; dev->kbdfeed = feedc;
#ifdef XKB
feedc->xkb_sli= NULL; feedc->xkb_sli= NULL;
if (!noXkbExtension) XkbFinishDeviceInit(dev);
XkbFinishDeviceInit(dev);
#endif
(*dev->kbdfeed->CtrlProc)(dev,&dev->kbdfeed->ctrl); (*dev->kbdfeed->CtrlProc)(dev,&dev->kbdfeed->ctrl);
return TRUE; return TRUE;
} }
@ -1517,9 +1480,7 @@ InitLedFeedbackClassDeviceStruct (DeviceIntPtr dev, LedCtrlProcPtr controlProc)
feedc->ctrl.id = 0; feedc->ctrl.id = 0;
if ( (feedc->next = dev->leds) ) if ( (feedc->next = dev->leds) )
feedc->ctrl.id = dev->leds->ctrl.id + 1; feedc->ctrl.id = dev->leds->ctrl.id + 1;
#ifdef XKB
feedc->xkb_sli= NULL; feedc->xkb_sli= NULL;
#endif
dev->leds = feedc; dev->leds = feedc;
(*controlProc)(dev, &feedc->ctrl); (*controlProc)(dev, &feedc->ctrl);
return TRUE; return TRUE;
@ -1582,25 +1543,18 @@ SendMappingNotify(DeviceIntPtr pDev, unsigned request, unsigned firstKeyCode,
event.u.mappingNotify.firstKeyCode = firstKeyCode; event.u.mappingNotify.firstKeyCode = firstKeyCode;
event.u.mappingNotify.count = count; event.u.mappingNotify.count = count;
} }
#ifdef XKB if (request == MappingKeyboard || request == MappingModifier)
if (!noXkbExtension &&
((request == MappingKeyboard) || (request == MappingModifier))) {
XkbApplyMappingChange(pDev,request,firstKeyCode,count, client); XkbApplyMappingChange(pDev,request,firstKeyCode,count, client);
}
#endif
/* 0 is the server client */ /* 0 is the server client */
for (i=1; i<currentMaxClients; i++) for (i=1; i<currentMaxClients; i++)
{ {
if (clients[i] && clients[i]->clientState == ClientStateRunning) if (clients[i] && clients[i]->clientState == ClientStateRunning)
{ {
#ifdef XKB if (request == MappingKeyboard &&
if (!noXkbExtension && clients[i]->xkbClientFlags != 0 &&
(request == MappingKeyboard) && (clients[i]->mapNotifyMask & XkbKeySymsMask))
(clients[i]->xkbClientFlags != 0) &&
(clients[i]->mapNotifyMask&XkbKeySymsMask))
continue; continue;
#endif
event.u.u.sequenceNumber = clients[i]->sequence; event.u.u.sequenceNumber = clients[i]->sequence;
WriteEventsToClient(clients[i], 1, &event); WriteEventsToClient(clients[i], 1, &event);
} }
@ -2097,15 +2051,13 @@ DoChangeKeyboardControl (ClientPtr client, DeviceIntPtr keybd, XID *vlist,
client->errorValue = t; client->errorValue = t;
return BadValue; return BadValue;
} }
#ifdef XKB
if (!noXkbExtension) { XkbEventCauseRec cause;
XkbEventCauseRec cause; XkbSetCauseCoreReq(&cause,X_ChangeKeyboardControl,client);
XkbSetCauseCoreReq(&cause,X_ChangeKeyboardControl,client); XkbSetIndicators(keybd,((led == DO_ALL) ? ~0L : (1L<<(led-1))),
XkbSetIndicators(keybd,((led == DO_ALL) ? ~0L : (1L<<(led-1))), ctrl.leds, &cause);
ctrl.leds, &cause); ctrl.leds = keybd->kbdfeed->ctrl.leds;
ctrl.leds = keybd->kbdfeed->ctrl.leds;
}
#endif
break; break;
case KBKey: case KBKey:
key = (KeyCode)*vlist; key = (KeyCode)*vlist;
@ -2123,10 +2075,8 @@ DoChangeKeyboardControl (ClientPtr client, DeviceIntPtr keybd, XID *vlist,
mask = (1 << (key & 7)); mask = (1 << (key & 7));
t = (CARD8)*vlist; t = (CARD8)*vlist;
vlist++; vlist++;
#ifdef XKB if (key != DO_ALL)
if (!noXkbExtension && key != DO_ALL)
XkbDisableComputedAutoRepeats(keybd,key); XkbDisableComputedAutoRepeats(keybd,key);
#endif
if (t == AutoRepeatModeOff) { if (t == AutoRepeatModeOff) {
if (key == DO_ALL) if (key == DO_ALL)
ctrl.autoRepeat = FALSE; ctrl.autoRepeat = FALSE;
@ -2159,14 +2109,9 @@ DoChangeKeyboardControl (ClientPtr client, DeviceIntPtr keybd, XID *vlist,
} }
keybd->kbdfeed->ctrl = ctrl; keybd->kbdfeed->ctrl = ctrl;
#ifdef XKB
/* The XKB RepeatKeys control and core protocol global autorepeat */ /* The XKB RepeatKeys control and core protocol global autorepeat */
/* value are linked */ /* value are linked */
if (!noXkbExtension) XkbSetRepeatKeys(keybd, key, keybd->kbdfeed->ctrl.autoRepeat);
XkbSetRepeatKeys(keybd, key, keybd->kbdfeed->ctrl.autoRepeat);
else
#endif
(*keybd->kbdfeed->CtrlProc)(keybd, &keybd->kbdfeed->ctrl);
return Success; return Success;
@ -2275,14 +2220,8 @@ ProcBell(ClientPtr client)
rc = XaceHook(XACE_DEVICE_ACCESS, client, keybd, DixBellAccess); rc = XaceHook(XACE_DEVICE_ACCESS, client, keybd, DixBellAccess);
if (rc != Success) if (rc != Success)
return rc; return rc;
#ifdef XKB XkbHandleBell(FALSE, FALSE, keybd, newpercent,
if (!noXkbExtension) &keybd->kbdfeed->ctrl, 0, None, NULL, client);
XkbHandleBell(FALSE, FALSE, keybd, newpercent,
&keybd->kbdfeed->ctrl, 0, None, NULL, client);
else
#endif
(*keybd->kbdfeed->BellProc)(newpercent, keybd,
&keybd->kbdfeed->ctrl, 0);
} }
} }
@ -2633,15 +2572,9 @@ AllocMasterDevice(ClientPtr client, char* name, DeviceIntPtr* ptr, DeviceIntPtr*
strcpy(pointer->name, name); strcpy(pointer->name, name);
strcat(pointer->name, " pointer"); strcat(pointer->name, " pointer");
#ifdef XKB
pointer->public.processInputProc = ProcessOtherEvent; pointer->public.processInputProc = ProcessOtherEvent;
pointer->public.realInputProc = ProcessOtherEvent; pointer->public.realInputProc = ProcessOtherEvent;
if (!noXkbExtension) XkbSetExtension(pointer, ProcessPointerEvent);
XkbSetExtension(pointer, ProcessPointerEvent);
#else
pointer->public.processInputProc = ProcessPointerEvent;
pointer->public.realInputProc = ProcessPointerEvent;
#endif
pointer->deviceGrab.ActivateGrab = ActivatePointerGrab; pointer->deviceGrab.ActivateGrab = ActivatePointerGrab;
pointer->deviceGrab.DeactivateGrab = DeactivatePointerGrab; pointer->deviceGrab.DeactivateGrab = DeactivatePointerGrab;
pointer->coreEvents = TRUE; pointer->coreEvents = TRUE;
@ -2661,15 +2594,9 @@ AllocMasterDevice(ClientPtr client, char* name, DeviceIntPtr* ptr, DeviceIntPtr*
strcpy(keyboard->name, name); strcpy(keyboard->name, name);
strcat(keyboard->name, " keyboard"); strcat(keyboard->name, " keyboard");
#ifdef XKB
keyboard->public.processInputProc = ProcessOtherEvent; keyboard->public.processInputProc = ProcessOtherEvent;
keyboard->public.realInputProc = ProcessOtherEvent; keyboard->public.realInputProc = ProcessOtherEvent;
if (!noXkbExtension) XkbSetExtension(keyboard, ProcessKeyboardEvent);
XkbSetExtension(keyboard, ProcessKeyboardEvent);
#else
keyboard->public.processInputProc = ProcessKeyboardEvent;
keyboard->public.realInputProc = ProcessKeyboardEvent;
#endif
keyboard->deviceGrab.ActivateGrab = ActivateKeyboardGrab; keyboard->deviceGrab.ActivateGrab = ActivateKeyboardGrab;
keyboard->deviceGrab.DeactivateGrab = DeactivateKeyboardGrab; keyboard->deviceGrab.DeactivateGrab = DeactivateKeyboardGrab;
keyboard->coreEvents = TRUE; keyboard->coreEvents = TRUE;

View File

@ -136,13 +136,8 @@ int ProcInitialConnection();
#endif #endif
#include "privates.h" #include "privates.h"
#include "xace.h" #include "xace.h"
#ifdef XKB
#ifndef XKB_IN_SERVER
#define XKB_IN_SERVER
#endif
#include "inputstr.h" #include "inputstr.h"
#include <xkbsrv.h> #include "xkbsrv.h"
#endif
#ifdef XSERVER_DTRACE #ifdef XSERVER_DTRACE
#include "registry.h" #include "registry.h"
@ -3478,15 +3473,11 @@ void InitClient(ClientPtr client, int i, pointer ospriv)
client->priority = 0; client->priority = 0;
client->clientState = ClientStateInitial; client->clientState = ClientStateInitial;
client->devPrivates = NULL; client->devPrivates = NULL;
#ifdef XKB client->xkbClientFlags = 0;
if (!noXkbExtension) { client->mapNotifyMask = 0;
client->xkbClientFlags = 0; client->newKeyboardNotifyMask = 0;
client->mapNotifyMask = 0; client->vMinor = client->vMajor = 0;
client->newKeyboardNotifyMask = 0; QueryMinMaxKeyCodes(&client->minKC,&client->maxKC);
client->vMinor = client->vMajor = 0;
QueryMinMaxKeyCodes(&client->minKC,&client->maxKC);
}
#endif
client->replyBytesRemaining = 0; client->replyBytesRemaining = 0;
client->fontResFunc = NULL; client->fontResFunc = NULL;
client->smart_priority = 0; client->smart_priority = 0;

View File

@ -133,11 +133,10 @@ of the copyright holder.
#endif #endif
#include "globals.h" #include "globals.h"
#ifdef XKB
#include <X11/extensions/XKBproto.h> #include <X11/extensions/XKBproto.h>
#include <xkbsrv.h> #include "xkbsrv.h"
/* XKB FIXME: why is this here? */
extern Bool XkbFilterEvents(ClientPtr, int, xEvent *); extern Bool XkbFilterEvents(ClientPtr, int, xEvent *);
#endif
#include "xace.h" #include "xace.h"
@ -1078,12 +1077,10 @@ EnqueueEvent(xEvent *xE, DeviceIntPtr device, int count)
NoticeTime(xE); NoticeTime(xE);
#ifdef XKB
/* Fix for key repeating bug. */ /* Fix for key repeating bug. */
if (device->key != NULL && device->key->xkbInfo != NULL && if (device->key != NULL && device->key->xkbInfo != NULL &&
xE->u.u.type == KeyRelease) xE->u.u.type == KeyRelease)
AccessXCancelRepeatKey(device->key->xkbInfo, xE->u.u.detail); AccessXCancelRepeatKey(device->key->xkbInfo, xE->u.u.detail);
#endif
if (DeviceEventCallback) if (DeviceEventCallback)
{ {
@ -2116,11 +2113,8 @@ DeliverEventsToWindow(DeviceIntPtr pDev, WindowPtr pWin, xEvent
pDev->valuator->motionHintWindow = pWin; pDev->valuator->motionHintWindow = pWin;
else else
{ {
if (((type == DeviceMotionNotify) if ((type == DeviceMotionNotify || type == DeviceButtonPress) &&
#ifdef XKB deliveries)
|| (type == DeviceButtonPress)
#endif
) && deliveries)
CheckDeviceGrabAndHintWindow (pWin, type, CheckDeviceGrabAndHintWindow (pWin, type,
(deviceKeyButtonPointer*) pEvents, (deviceKeyButtonPointer*) pEvents,
grab, client, deliveryMask); grab, client, deliveryMask);
@ -3246,7 +3240,6 @@ CheckPassiveGrabsOnWindow(
tempGrab.next = NULL; tempGrab.next = NULL;
for (; grab; grab = grab->next) for (; grab; grab = grab->next)
{ {
#ifdef XKB
DeviceIntPtr gdev; DeviceIntPtr gdev;
XkbSrvInfoPtr xkbi = NULL; XkbSrvInfoPtr xkbi = NULL;
@ -3260,40 +3253,16 @@ CheckPassiveGrabsOnWindow(
} }
if (gdev && gdev->key) if (gdev && gdev->key)
xkbi= gdev->key->xkbInfo; xkbi= gdev->key->xkbInfo;
#endif
tempGrab.modifierDevice = grab->modifierDevice; tempGrab.modifierDevice = grab->modifierDevice;
if ((device == grab->modifierDevice) && tempGrab.modifiersDetail.exact = xkbi ? xkbi->state.grab_mods : 0;
((xE->u.u.type == KeyPress) || (xE->u.u.type == DeviceKeyPress))) /* ignore the device for core events when comparing grabs */
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 */
if (GrabMatchesSecond(&tempGrab, grab, (xE->u.u.type < LASTEvent)) && if (GrabMatchesSecond(&tempGrab, grab, (xE->u.u.type < LASTEvent)) &&
(!grab->confineTo || (!grab->confineTo ||
(grab->confineTo->realized && (grab->confineTo->realized &&
BorderSizeNotEmpty(device, grab->confineTo)))) BorderSizeNotEmpty(device, grab->confineTo))))
{ {
#ifdef XKB XE_KBPTR.state &= 0x1f00;
if (!noXkbExtension) { XE_KBPTR.state |= tempGrab.modifiersDetail.exact&(~0x1f00);
XE_KBPTR.state &= 0x1f00;
XE_KBPTR.state |=
tempGrab.modifiersDetail.exact&(~0x1f00);
}
#endif
grabinfo = &device->deviceGrab; grabinfo = &device->deviceGrab;
/* A passive grab may have been created for a different device /* A passive grab may have been created for a different device
than it is assigned to at this point in time. 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. * @param count Number of elements in xE.
*/ */
void void
#ifdef XKB
CoreProcessKeyboardEvent (xEvent *xE, DeviceIntPtr keybd, int count) CoreProcessKeyboardEvent (xEvent *xE, DeviceIntPtr keybd, int count)
#else
ProcessKeyboardEvent (xEvent *xE, DeviceIntPtr keybd, int count)
#endif
{ {
int key, bit; int key, bit;
BYTE *kptr; BYTE *kptr;
@ -3765,7 +3730,6 @@ ProcessKeyboardEvent (xEvent *xE, DeviceIntPtr keybd, int count)
XaceHook(XACE_KEY_AVAIL, xE, keybd, count); XaceHook(XACE_KEY_AVAIL, xE, keybd, count);
} }
#ifdef XKB
/* This function is used to set the key pressed or key released state - /* 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 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. the device's processInputProc to be called, as in for example Mouse Keys.
@ -3795,7 +3759,6 @@ FixKeyState (xEvent *xE, DeviceIntPtr keybd)
else else
FatalError("Impossible keyboard event"); FatalError("Impossible keyboard event");
} }
#endif
/** /**
* Main pointer event processing function for core pointer events. * 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. * @param count Number of elements in xE.
*/ */
void void
#ifdef XKB
CoreProcessPointerEvent (xEvent *xE, DeviceIntPtr mouse, int count) CoreProcessPointerEvent (xEvent *xE, DeviceIntPtr mouse, int count)
#else
ProcessPointerEvent (xEvent *xE, DeviceIntPtr mouse, int count)
#endif
{ {
GrabPtr grab = mouse->deviceGrab.grab; GrabPtr grab = mouse->deviceGrab.grab;
Bool deactivateGrab = FALSE; Bool deactivateGrab = FALSE;
ButtonClassPtr butc = mouse->button; ButtonClassPtr butc = mouse->button;
SpritePtr pSprite = mouse->spriteInfo->sprite; SpritePtr pSprite = mouse->spriteInfo->sprite;
#ifdef XKB
XkbSrvInfoPtr xkbi= GetPairedDevice(mouse)->key->xkbInfo; XkbSrvInfoPtr xkbi= GetPairedDevice(mouse)->key->xkbInfo;
#endif
if (!syncEvents.playingEvents) if (!syncEvents.playingEvents)
NoticeTime(xE) NoticeTime(xE)
XE_KBPTR.state = (butc->state | ( XE_KBPTR.state = (butc->state | xkbi->state.grab_mods);
#ifdef XKB
(noXkbExtension ?
inputInfo.keyboard->key->state :
xkbi->state.grab_mods)
#else
inputInfo.keyboard->key->state
#endif
));
{ {
NoticeTime(xE); NoticeTime(xE);
if (DeviceEventCallback) if (DeviceEventCallback)
@ -4171,18 +4120,10 @@ CoreEnterLeaveEvent(
event.u.enterLeave.child = child; event.u.enterLeave.child = child;
event.u.enterLeave.flags = event.u.keyButtonPointer.sameScreen ? event.u.enterLeave.flags = event.u.keyButtonPointer.sameScreen ?
ELFlagSameScreen : 0; ELFlagSameScreen : 0;
#ifdef XKB event.u.enterLeave.state = mouse->button->state & 0x1f00;
if (!noXkbExtension) { if (keybd)
event.u.enterLeave.state = mouse->button->state & 0x1f00; event.u.enterLeave.state |=
if (keybd)
event.u.enterLeave.state |=
XkbGrabStateFromRec(&keybd->key->xkbInfo->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; event.u.enterLeave.mode = mode;
focus = (keybd) ? keybd->focus->win : None; focus = (keybd) ? keybd->focus->win : None;
if ((focus != NoneWin) && if ((focus != NoneWin) &&
@ -4262,18 +4203,9 @@ DeviceEnterLeaveEvent(
devEnterLeave->mode = mode; devEnterLeave->mode = mode;
devEnterLeave->mode |= (sameScreen ? (ELFlagSameScreen << 4) : 0); devEnterLeave->mode |= (sameScreen ? (ELFlagSameScreen << 4) : 0);
#ifdef XKB devEnterLeave->state = mouse->button->state & 0x1f00;
if (!noXkbExtension) { if (keybd)
devEnterLeave->state = mouse->button->state & 0x1f00; devEnterLeave->state |= XkbGrabStateFromRec(&keybd->key->xkbInfo->state);
if (keybd)
devEnterLeave->state |=
XkbGrabStateFromRec(&keybd->key->xkbInfo->state);
} else
#endif
{
devEnterLeave->state = (keybd) ? keybd->key->state : 0;
devEnterLeave->state |= mouse->button->state;
}
mskidx = mouse->id; mskidx = mouse->id;
inputMasks = wOtherInputMasks(pWin); inputMasks = wOtherInputMasks(pWin);
@ -5540,10 +5472,8 @@ WriteEventsToClient(ClientPtr pClient, int count, xEvent *events)
int i, int i,
eventlength = sizeof(xEvent); eventlength = sizeof(xEvent);
#ifdef XKB if (!XkbFilterEvents(pClient, count, events))
if ((!noXkbExtension)&&(!XkbFilterEvents(pClient, count, events)))
return; return;
#endif
#ifdef PANORAMIX #ifdef PANORAMIX
if(!noPanoramiXExtension && if(!noPanoramiXExtension &&

View File

@ -42,10 +42,8 @@
#include "dixevents.h" #include "dixevents.h"
#include "mipointer.h" #include "mipointer.h"
#ifdef XKB
#include <X11/extensions/XKBproto.h> #include <X11/extensions/XKBproto.h>
#include "xkbsrv.h" #include "xkbsrv.h"
#endif
#ifdef PANORAMIX #ifdef PANORAMIX
#include "panoramiX.h" #include "panoramiX.h"
@ -454,15 +452,9 @@ updateMotionHistory(DeviceIntPtr pDev, CARD32 ms, int first_valuator,
*/ */
int int
GetMaximumEventsNum(void) { GetMaximumEventsNum(void) {
/* One base event -- device, plus valuator events. /* One base event -- device, plus valuator events. */
* Multiply by two if we're doing non-XKB key repeats. */
int ret = 1 + MAX_VALUATOR_EVENTS; int ret = 1 + MAX_VALUATOR_EVENTS;
#ifdef XKB
if (noXkbExtension)
#endif
ret *= 2;
/* One possible DeviceClassesChangedEvent */ /* One possible DeviceClassesChangedEvent */
ret++; ret++;
@ -814,25 +806,7 @@ GetKeyboardValuatorEvents(EventList *events, DeviceIntPtr pDev, int type,
numEvents += countValuatorEvents(num_valuators); numEvents += countValuatorEvents(num_valuators);
#ifdef XKB /* Handle core repeating, via press/release/press/release. */
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. */
if (type == KeyPress && key_is_down(pDev, key_code)) { if (type == KeyPress && key_is_down(pDev, key_code)) {
/* If autorepeating is disabled either globally or just for that key, /* If autorepeating is disabled either globally or just for that key,
* or we have a modifier, don't generate a repeat event. */ * 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) || !key_autorepeats(pDev, key_code) ||
pDev->key->modifierMap[key_code]) pDev->key->modifierMap[key_code])
return 0; return 0;
#ifdef XKB
if (noXkbExtension)
#endif
{
numEvents += GetKeyboardValuatorEvents(events, pDev,
KeyRelease, key_code,
first_valuator, num_valuators,
valuators);
events += numEvents;
}
} }
ms = GetTimeInMillis(); ms = GetTimeInMillis();

View File

@ -91,10 +91,8 @@ typedef XID KeySym64;
#undef PictFormatType #undef PictFormatType
#endif #endif
#ifdef XKB
#include <X11/extensions/XKB.h> #include <X11/extensions/XKB.h>
#include <X11/extensions/XKBstr.h> #include "xkbstr.h"
#endif
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
@ -134,14 +132,9 @@ extern int ChangeDeviceNotify;
/* Some protocol gets included last, after undefines. */ /* Some protocol gets included last, after undefines. */
#include <X11/XKBlib.h> #include <X11/XKBlib.h>
#ifdef XKB
#include <X11/extensions/XKBproto.h> #include <X11/extensions/XKBproto.h>
#ifndef XKB_IN_SERVER #include "xkbstr.h"
#define XKB_IN_SERVER
#endif
#include <xkbsrv.h>
#undef XPointer #undef XPointer
#endif
#include <X11/extensions/XIproto.h> #include <X11/extensions/XIproto.h>
#endif #endif

View File

@ -258,7 +258,6 @@ void dmxCommonKbdGetMap(DevicePtr pDev, KeySymsPtr pKeySyms, CARD8 *pModMap)
* specified \a pDev. */ * specified \a pDev. */
void dmxCommonKbdGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info) void dmxCommonKbdGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
{ {
#ifdef XKB
GETPRIVFROMPDEV; GETPRIVFROMPDEV;
GETDMXINPUTFROMPRIV; GETDMXINPUTFROMPRIV;
char *pt; char *pt;
@ -284,7 +283,6 @@ void dmxCommonKbdGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
if ((pt = strchr(info->names.keycodes, '+'))) *pt = '\0'; if ((pt = strchr(info->names.keycodes, '+'))) *pt = '\0';
} }
dmxCommonRestoreState(priv); dmxCommonRestoreState(priv);
#endif
} }
/** Turn \a pDev on (i.e., take input from \a pDev). */ /** 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 (dmxInput->console) priv = dmxInput->devs[0]->private;
if (!priv->display || priv->stateSaved) return; if (!priv->display || priv->stateSaved) return;
DMXDBG0("dmxCommonSaveState\n"); DMXDBG0("dmxCommonSaveState\n");
#ifdef XKB
if (dmxUseXKB && (priv->xkb = XkbAllocKeyboard())) { if (dmxUseXKB && (priv->xkb = XkbAllocKeyboard())) {
if (XkbGetIndicatorMap(priv->display, XkbAllIndicatorsMask, priv->xkb) if (XkbGetIndicatorMap(priv->display, XkbAllIndicatorsMask, priv->xkb)
|| XkbGetNames(priv->display, XkbAllNamesMask, priv->xkb)) { || XkbGetNames(priv->display, XkbAllNamesMask, priv->xkb)) {
@ -596,7 +593,6 @@ void dmxCommonSaveState(pointer private)
} }
} }
} }
#endif
XGetKeyboardControl(priv->display, &ks); XGetKeyboardControl(priv->display, &ks);
priv->savedKctrl.click = ks.key_click_percent; priv->savedKctrl.click = ks.key_click_percent;
@ -636,14 +632,12 @@ void dmxCommonRestoreState(pointer private)
priv->stateSaved = 0; priv->stateSaved = 0;
DMXDBG0("dmxCommonRestoreState\n"); DMXDBG0("dmxCommonRestoreState\n");
#ifdef XKB
if (priv->xkb) { if (priv->xkb) {
*priv->xkb->indicators = priv->savedIndicators; *priv->xkb->indicators = priv->savedIndicators;
XkbSetIndicatorMap(priv->display, ~0, priv->xkb); XkbSetIndicatorMap(priv->display, ~0, priv->xkb);
XkbFreeKeyboard(priv->xkb, 0, True); XkbFreeKeyboard(priv->xkb, 0, True);
priv->xkb = 0; priv->xkb = 0;
} }
#endif
for (start = GetTimeInMillis(); GetTimeInMillis() - start < 5000;) { for (start = GetTimeInMillis(); GetTimeInMillis() - start < 5000;) {
CARD32 tmp; CARD32 tmp;

View File

@ -54,14 +54,10 @@
XModifierKeymap *savedModMap; \ XModifierKeymap *savedModMap; \
int stateSaved int stateSaved
#ifdef XKB
#define DMX_COMMON_XKB \ #define DMX_COMMON_XKB \
DMX_COMMON_OTHER; \ DMX_COMMON_OTHER; \
XkbDescPtr xkb; \ XkbDescPtr xkb; \
XkbIndicatorRec savedIndicators XkbIndicatorRec savedIndicators
#else
#define DMX_COMMON_XKB DMX_COMMON_OTHER
#endif
#define DMX_COMMON_PRIVATE \ #define DMX_COMMON_PRIVATE \
DMX_COMMON_XKB; \ DMX_COMMON_XKB; \

View File

@ -60,9 +60,7 @@ void dmxDummyKbdGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
info->freemap = 0; info->freemap = 0;
info->focusClass = 1; info->focusClass = 1;
info->kbdFeedbackClass = 1; info->kbdFeedbackClass = 1;
#ifdef XKB
info->force = 1; info->force = 1;
#endif
} }
/** Return information about the dummy mouse device specified in \a pDev /** Return information about the dummy mouse device specified in \a pDev

View File

@ -306,15 +306,13 @@ static void _dmxKeyboardKbdCtrlProc(DMXLocalInputInfoPtr dmxLocal,
dmxLocal->kctrl = *ctrl; dmxLocal->kctrl = *ctrl;
if (dmxLocal->kCtrl) { if (dmxLocal->kCtrl) {
dmxLocal->kCtrl(&dmxLocal->pDevice->public, ctrl); dmxLocal->kCtrl(&dmxLocal->pDevice->public, ctrl);
#ifdef XKB if (dmxLocal->pDevice->kbdfeed) {
if (!noXkbExtension && dmxLocal->pDevice->kbdfeed) {
XkbEventCauseRec cause; XkbEventCauseRec cause;
XkbSetCauseUnknown(&cause); XkbSetCauseUnknown(&cause);
/* Generate XKB events, as necessary */ /* Generate XKB events, as necessary */
XkbUpdateIndicators(dmxLocal->pDevice, XkbAllIndicatorsMask, False, XkbUpdateIndicators(dmxLocal->pDevice, XkbAllIndicatorsMask, False,
NULL, &cause); NULL, &cause);
} }
#endif
} }
} }
@ -370,7 +368,6 @@ void dmxKeyboardBellProc(int percent, DeviceIntPtr pDevice,
} }
} }
#ifdef XKB
static void dmxKeyboardFreeNames(XkbComponentNamesPtr names) static void dmxKeyboardFreeNames(XkbComponentNamesPtr names)
{ {
if (names->keymap) XFree(names->keymap); if (names->keymap) XFree(names->keymap);
@ -380,76 +377,61 @@ static void dmxKeyboardFreeNames(XkbComponentNamesPtr names)
if (names->symbols) XFree(names->symbols); if (names->symbols) XFree(names->symbols);
if (names->geometry) XFree(names->geometry); if (names->geometry) XFree(names->geometry);
} }
#endif
static int dmxKeyboardOn(DeviceIntPtr pDevice, DMXLocalInitInfo *info) static int dmxKeyboardOn(DeviceIntPtr pDevice, DMXLocalInitInfo *info)
{ {
#ifdef XKB
GETDMXINPUTFROMPDEVICE; GETDMXINPUTFROMPDEVICE;
#else
DevicePtr pDev = &pDevice->public;
#endif
#ifdef XKB XkbSetRulesDflts(dmxConfigGetXkbRules(),
if (noXkbExtension) { dmxConfigGetXkbModel(),
#endif dmxConfigGetXkbLayout(),
if (!InitKeyboardDeviceStruct(pDev, &info->keySyms, info->modMap, dmxConfigGetXkbVariant(),
dmxKeyboardBellProc, dmxConfigGetXkbOptions());
dmxKeyboardKbdCtrlProc)) if (!info->force && (dmxInput->keycodes
return BadImplementation; || dmxInput->symbols
#ifdef XKB || 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 { } else {
XkbSetRulesDflts(dmxConfigGetXkbRules(), dmxLogInput(dmxInput, "XKEYBOARD: Defaults: %s %s %s %s %s\n",
dmxConfigGetXkbModel(), dmxConfigGetXkbRules(),
dmxConfigGetXkbLayout(), dmxConfigGetXkbLayout(),
dmxConfigGetXkbVariant(), dmxConfigGetXkbModel(),
dmxConfigGetXkbOptions()); dmxConfigGetXkbVariant()
if (!info->force && (dmxInput->keycodes ? dmxConfigGetXkbVariant() : "",
|| dmxInput->symbols dmxConfigGetXkbOptions()
|| dmxInput->geometry)) { ? dmxConfigGetXkbOptions() : "");
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);
} }
XkbInitKeyboardDeviceStruct(pDevice,
&info->names,
&info->keySyms,
info->modMap,
dmxKeyboardBellProc,
dmxKeyboardKbdCtrlProc);
if (info->freenames) dmxKeyboardFreeNames(&info->names); if (info->freenames) dmxKeyboardFreeNames(&info->names);
#endif
return Success; return Success;
} }
@ -552,9 +534,7 @@ static int dmxDeviceOnOff(DeviceIntPtr pDevice, int what)
XFree(info.keySyms.map); XFree(info.keySyms.map);
info.keySyms.map = NULL; info.keySyms.map = NULL;
} }
#ifdef XKB
if (info.xkb) XkbFreeKeyboard(info.xkb, 0, True); if (info.xkb) XkbFreeKeyboard(info.xkb, 0, True);
#endif
return Success; return Success;
} }

View File

@ -87,12 +87,10 @@ typedef struct _DMXLocalInitInfo {
KeySymsRec keySyms; /**< Key symbols */ KeySymsRec keySyms; /**< Key symbols */
int freemap; /**< If non-zero, free keySyms.map */ int freemap; /**< If non-zero, free keySyms.map */
CARD8 modMap[MAP_LENGTH]; /**< Modifier map */ CARD8 modMap[MAP_LENGTH]; /**< Modifier map */
#ifdef XKB
XkbDescPtr xkb; /**< XKB description */ XkbDescPtr xkb; /**< XKB description */
XkbComponentNamesRec names; /**< XKB component names */ XkbComponentNamesRec names; /**< XKB component names */
int freenames; /**< Non-zero if names should be free'd */ int freenames; /**< Non-zero if names should be free'd */
int force; /**< Do not allow command line override */ int force; /**< Do not allow command line override */
#endif
int buttonClass; /**< Non-zero if buttons are present */ int buttonClass; /**< Non-zero if buttons are present */
int numButtons; /**< Number of buttons */ int numButtons; /**< Number of buttons */

View File

@ -434,8 +434,6 @@ void kbdUSBGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
kbdUSBGetMap(pDev, &info->keySyms, info->modMap); kbdUSBGetMap(pDev, &info->keySyms, info->modMap);
info->focusClass = 1; info->focusClass = 1;
info->kbdFeedbackClass = 1; info->kbdFeedbackClass = 1;
#ifdef XKB
info->names.keycodes = xstrdup("powerpcps2"); info->names.keycodes = xstrdup("powerpcps2");
info->force = 1; info->force = 1;
#endif
} }

View File

@ -112,7 +112,6 @@ static const KeySym linux_to_x[256] = {
XK_udiaeresis, XK_yacute, XK_thorn, XK_ydiaeresis XK_udiaeresis, XK_yacute, XK_thorn, XK_ydiaeresis
}; };
#ifdef XKB
/* /*
* Getting a keycode from scancode * Getting a keycode from scancode
* *
@ -209,10 +208,6 @@ static unsigned char at2lnx[] =
#define NUM_AT_KEYS (sizeof(at2lnx)/sizeof(at2lnx[0])) #define NUM_AT_KEYS (sizeof(at2lnx)/sizeof(at2lnx[0]))
#define LNX_KEY_INDEX(n) n < NUM_AT_KEYS ? at2lnx[n] : 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] = static unsigned char tbl[KD_MAX_WIDTH] =
{ {
0, 0,
@ -491,8 +486,6 @@ readKernelMapping(KdKeyboardInfo *ki)
ki->maxScanCode = maxKeyCode; ki->maxScanCode = maxKeyCode;
} }
#ifdef XKB
/* /*
* We need these to handle extended scancodes correctly (I could just use the * We need these to handle extended scancodes correctly (I could just use the
* numbers below, but this makes the code more readable * numbers below, but this makes the code more readable
@ -555,9 +548,6 @@ readKernelMapping(KdKeyboardInfo *ki)
#define KEY_F17 /* F17 0x72 */ 114 #define KEY_F17 /* F17 0x72 */ 114
#define KEY_KP_DEC /* KP_DEC 0x73 */ 115 #define KEY_KP_DEC /* KP_DEC 0x73 */ 115
#endif /* XKB */
static void static void
LinuxKeyboardRead (int fd, void *closure) LinuxKeyboardRead (int fd, void *closure)
{ {
@ -568,164 +558,118 @@ LinuxKeyboardRead (int fd, void *closure)
while ((n = read (fd, buf, sizeof (buf))) > 0) { while ((n = read (fd, buf, sizeof (buf))) > 0) {
b = buf; b = buf;
while (n--) { while (n--) {
#ifdef XKB /*
if (!noXkbExtension) { * With xkb we use RAW mode for reading the console, which allows us
/* * process extended scancodes.
* 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
* */
* See if this is a prefix extending the following keycode if (!prefix && ((b[0] & 0x7f) == KEY_Prefix0))
*/ {
if (!prefix && ((b[0] & 0x7f) == KEY_Prefix0)) prefix = KEY_Prefix0;
{ /* swallow this up */
prefix = KEY_Prefix0; b++;
#ifdef DEBUG continue;
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;
}
default: /* should not happen*/
case 0: /* do nothing */
#ifdef DEBUG
ErrorF("Plain scancode: 0x%02x\n", scancode);
#endif
;
}
prefix = 0;
} }
/* without xkb we use mediumraw mode -- enqueue the scancode as is */ else if (!prefix && ((b[0] & 0x7f) == KEY_Prefix1))
else {
#endif prefix = KEY_Prefix1;
scancode = b[0] & 0x7f; /* swallow this up */
/* This is extended medium raw mode interpreter b++;
see linux/drivers/keyboard.c (kbd->kbdmode == VC_MEDIUMRAW) */ continue;
switch (mediumraw_state) }
{ scancode = b[0] & 0x7f;
case DEFAULT:
if (scancode == 0) switch (prefix) {
{ /* from xf86Events.c */
mediumraw_state = EXTBYTE1; case KEY_Prefix0:
mediumraw_up = b[0] & 0x80; {
} switch (scancode) {
else case KEY_KP_7:
KdEnqueueKeyboardEvent (closure, scancode, b[0] & 0x80); scancode = KEY_Home; break; /* curs home */
break; case KEY_KP_8:
case EXTBYTE1: scancode = KEY_Up; break; /* curs up */
mediumraw_data = scancode; case KEY_KP_9:
mediumraw_state = EXTBYTE2; scancode = KEY_PgUp; break; /* curs pgup */
break; case KEY_KP_4:
case EXTBYTE2: scancode = KEY_Left; break; /* curs left */
/* Note: Only codes < 256 will pass correctly through KdEnqueueKeyboardEvent() */ case KEY_KP_5:
KdEnqueueKeyboardEvent (closure, (int)mediumraw_data << 7 | scancode, mediumraw_up); scancode = KEY_Begin; break; /* curs begin */
mediumraw_state = DEFAULT; case KEY_KP_6:
break; 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;
}
case KEY_Prefix1:
{
/* we do no handle these */
b++;
prefix = 0;
continue;
}
default: /* should not happen*/
case 0: /* do nothing */
;
}
prefix = 0;
KdEnqueueKeyboardEvent (closure, scancode, b[0] & 0x80);
b++; b++;
} }
} }
@ -750,13 +694,7 @@ LinuxKeyboardEnable (KdKeyboardInfo *ki)
ioctl (fd, KDGKBMODE, &LinuxKbdTrans); ioctl (fd, KDGKBMODE, &LinuxKbdTrans);
tcgetattr (fd, &LinuxTermios); tcgetattr (fd, &LinuxTermios);
#ifdef XKB ioctl(fd, KDSKBMODE, K_RAW);
if (!noXkbExtension)
ioctl(fd, KDSKBMODE, K_RAW);
else
#else
ioctl(fd, KDSKBMODE, K_MEDIUMRAW);
#endif
nTty = LinuxTermios; nTty = LinuxTermios;
nTty.c_iflag = (IGNPAR | IGNBRK) & (~PARMRK) & (~ISTRIP); nTty.c_iflag = (IGNPAR | IGNBRK) & (~PARMRK) & (~ISTRIP);
nTty.c_oflag = 0; nTty.c_oflag = 0;

View File

@ -44,9 +44,7 @@
#include "randrstr.h" #include "randrstr.h"
#include "globals.h" #include "globals.h"
#ifdef XKB #include "xkbstr.h"
#include <X11/extensions/XKBstr.h>
#endif
#define KD_DPMS_NORMAL 0 #define KD_DPMS_NORMAL 0
#define KD_DPMS_STANDBY 1 #define KD_DPMS_STANDBY 1
@ -300,14 +298,12 @@ struct _KdKeyboardInfo {
char *name; char *name;
char *path; char *path;
int inputClass; int inputClass;
#ifdef XKB
XkbDescPtr xkb; XkbDescPtr xkb;
char *xkbRules; char *xkbRules;
char *xkbModel; char *xkbModel;
char *xkbLayout; char *xkbLayout;
char *xkbVariant; char *xkbVariant;
char *xkbOptions; char *xkbOptions;
#endif
int LockLed; int LockLed;
CARD8 keyState[KD_KEY_COUNT/8]; CARD8 keyState[KD_KEY_COUNT/8];

View File

@ -38,9 +38,7 @@
#include <sys/file.h> /* needed for FNONBLOCK & FASYNC */ #include <sys/file.h> /* needed for FNONBLOCK & FASYNC */
#endif #endif
#ifdef XKB #include "xkbsrv.h"
#include <xkbsrv.h>
#endif
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h> #include <X11/extensions/XIproto.h>
@ -748,9 +746,7 @@ KdKeyboardProc(DeviceIntPtr pDevice, int onoff)
DevicePtr pDev = (DevicePtr)pDevice; DevicePtr pDev = (DevicePtr)pDevice;
KdKeyboardInfo *ki; KdKeyboardInfo *ki;
Atom xiclass; Atom xiclass;
#ifdef XKB
XkbComponentNamesRec names; XkbComponentNamesRec names;
#endif
if (!pDev) if (!pDev)
return BadImplementation; return BadImplementation;
@ -799,25 +795,16 @@ KdKeyboardProc(DeviceIntPtr pDevice, int onoff)
KdInitModMap(ki); KdInitModMap(ki);
KdInitAutoRepeats(ki); KdInitAutoRepeats(ki);
#ifdef XKB memset(&names, 0, sizeof(XkbComponentNamesRec));
if (!noXkbExtension) {
memset(&names, 0, sizeof(XkbComponentNamesRec));
XkbSetRulesDflts (ki->xkbRules, ki->xkbModel, ki->xkbLayout, XkbSetRulesDflts (ki->xkbRules, ki->xkbModel, ki->xkbLayout,
ki->xkbVariant, ki->xkbOptions); ki->xkbVariant, ki->xkbOptions);
ret = XkbInitKeyboardDeviceStruct (pDevice, ret = XkbInitKeyboardDeviceStruct (pDevice,
&names, &names,
&ki->keySyms, &ki->keySyms,
ki->modmap, ki->modmap,
KdBell, KdKbdCtrl); KdBell, KdKbdCtrl);
}
else
#endif
ret = InitKeyboardDeviceStruct(pDev,
&ki->keySyms,
ki->modmap,
KdBell, KdKbdCtrl);
if (!ret) { if (!ret) {
ErrorF("Couldn't initialise keyboard %s\n", ki->name); ErrorF("Couldn't initialise keyboard %s\n", ki->name);
return BadImplementation; return BadImplementation;
@ -974,13 +961,11 @@ KdNewKeyboard (void)
ki->bellDuration = 200; ki->bellDuration = 200;
ki->next = NULL; ki->next = NULL;
ki->options = NULL; ki->options = NULL;
#ifdef XKB
ki->xkbRules = KdSaveString("base"); ki->xkbRules = KdSaveString("base");
ki->xkbModel = KdSaveString("pc105"); ki->xkbModel = KdSaveString("pc105");
ki->xkbLayout = KdSaveString("us"); ki->xkbLayout = KdSaveString("us");
ki->xkbVariant = NULL; ki->xkbVariant = NULL;
ki->xkbOptions = NULL; ki->xkbOptions = NULL;
#endif
return ki; return ki;
} }
@ -1160,7 +1145,6 @@ KdParseKbdOptions (KdKeyboardInfo *ki)
for (option = ki->options; option; option = option->next) for (option = ki->options; option; option = option->next)
{ {
#ifdef XKB
if (strcasecmp(option->key, "XkbRules") == 0) if (strcasecmp(option->key, "XkbRules") == 0)
ki->xkbRules = option->value; ki->xkbRules = option->value;
else if (strcasecmp(option->key, "XkbModel") == 0) else if (strcasecmp(option->key, "XkbModel") == 0)
@ -1174,7 +1158,6 @@ KdParseKbdOptions (KdKeyboardInfo *ki)
else if (!strcasecmp (option->key, "device")) else if (!strcasecmp (option->key, "device"))
ki->path = KdSaveString(option->value); ki->path = KdSaveString(option->value);
else else
#endif
ErrorF("Kbd option key (%s) of value (%s) not assigned!\n", ErrorF("Kbd option key (%s) of value (%s) not assigned!\n",
option->key, option->value); option->key, option->value);
} }
@ -1196,9 +1179,7 @@ KdParseKeyboard (char *arg)
ki->path = NULL; ki->path = NULL;
ki->driver = NULL; ki->driver = NULL;
ki->driverPrivate = NULL; ki->driverPrivate = NULL;
#ifdef XKB
ki->xkb = NULL; ki->xkb = NULL;
#endif
ki->next = NULL; ki->next = NULL;
if (!arg) if (!arg)
@ -1880,57 +1861,6 @@ CARD32 KdSpecialKeys = 0;
extern int nClients; 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 * kdEnqueueKeyboardEvent
* *
@ -2024,7 +1954,7 @@ KdEnqueueKeyboardEvent(KdKeyboardInfo *ki,
if (scan_code >= ki->minScanCode && scan_code <= ki->maxScanCode) if (scan_code >= ki->minScanCode && scan_code <= ki->maxScanCode)
{ {
key_code = scan_code + KD_MIN_KEYCODE - ki->minScanCode; key_code = scan_code + KD_MIN_KEYCODE - ki->minScanCode;
/* /*
* Set up this event -- the type may be modified below * Set up this event -- the type may be modified below
*/ */
@ -2032,16 +1962,9 @@ KdEnqueueKeyboardEvent(KdKeyboardInfo *ki,
type = KeyRelease; type = KeyRelease;
else else
type = KeyPress; type = KeyPress;
#ifdef XKB
if (noXkbExtension)
#endif
{
KdCheckSpecialKeys(ki, type, key_code);
KdHandleKeyboardEvent(ki, type, key_code);
}
GetEventList(&kdEvents); GetEventList(&kdEvents);
nEvents = GetKeyboardEvents(kdEvents, ki->dixdev, type, key_code); nEvents = GetKeyboardEvents(kdEvents, ki->dixdev, type, key_code);
for (i = 0; i < nEvents; i++) for (i = 0; i < nEvents; i++)
KdQueueEvent(ki->dixdev, (kdEvents + i)->event); KdQueueEvent(ki->dixdev, (kdEvents + i)->event);

View File

@ -65,11 +65,7 @@
#include "xf86Xinput.h" #include "xf86Xinput.h"
extern DeviceAssocRec mouse_assoc; extern DeviceAssocRec mouse_assoc;
#ifdef XKB #include "xkbsrv.h"
#undef XKB_IN_SERVER
#define XKB_IN_SERVER
#include <xkbsrv.h>
#endif
#ifdef RENDER #ifdef RENDER
#include "picture.h" #include "picture.h"
@ -697,7 +693,6 @@ typedef enum {
FLAG_ALLOWNONLOCAL, FLAG_ALLOWNONLOCAL,
FLAG_ALLOWMOUSEOPENFAIL, FLAG_ALLOWMOUSEOPENFAIL,
FLAG_VTSYSREQ, FLAG_VTSYSREQ,
FLAG_XKBDISABLE,
FLAG_SAVER_BLANKTIME, FLAG_SAVER_BLANKTIME,
FLAG_DPMS_STANDBYTIME, FLAG_DPMS_STANDBYTIME,
FLAG_DPMS_SUSPENDTIME, FLAG_DPMS_SUSPENDTIME,
@ -736,8 +731,6 @@ static OptionInfoRec FlagOptions[] = {
{0}, FALSE }, {0}, FALSE },
{ FLAG_VTSYSREQ, "VTSysReq", OPTV_BOOLEAN, { FLAG_VTSYSREQ, "VTSysReq", OPTV_BOOLEAN,
{0}, FALSE }, {0}, FALSE },
{ FLAG_XKBDISABLE, "XkbDisable", OPTV_BOOLEAN,
{0}, FALSE },
{ FLAG_SAVER_BLANKTIME, "BlankTime" , OPTV_INTEGER, { FLAG_SAVER_BLANKTIME, "BlankTime" , OPTV_INTEGER,
{0}, FALSE }, {0}, FALSE },
{ FLAG_DPMS_STANDBYTIME, "StandbyTime", OPTV_INTEGER, { FLAG_DPMS_STANDBYTIME, "StandbyTime", OPTV_INTEGER,
@ -887,16 +880,6 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
#endif #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; xf86Info.pmFlag = TRUE;
if (xf86GetOptValBool(FlagOptions, FLAG_NOPM, &value)) if (xf86GetOptValBool(FlagOptions, FLAG_NOPM, &value))
xf86Info.pmFlag = !value; xf86Info.pmFlag = !value;

View File

@ -42,9 +42,7 @@
#include "globals.h" #include "globals.h"
#include "servermd.h" #include "servermd.h"
#include "micmap.h" #include "micmap.h"
#ifdef XKB #include "xkbsrv.h"
#include <xkbsrv.h>
#endif
#include "xf86Xinput.h" #include "xf86Xinput.h"
#include "exglobals.h" #include "exglobals.h"
#include "exevents.h" #include "exevents.h"

View File

@ -379,10 +379,7 @@ xf86ActivateDevice(LocalDevicePtr local)
} }
RegisterOtherDevice(dev); RegisterOtherDevice(dev);
#ifdef XKB XkbSetExtension(dev, ProcessKeyboardEvent);
if (!noXkbExtension)
XkbSetExtension(dev, ProcessKeyboardEvent);
#endif
if (serverGeneration == 1) if (serverGeneration == 1)
xf86Msg(X_INFO, "XINPUT: Adding extended input device \"%s\" (type: %s)\n", xf86Msg(X_INFO, "XINPUT: Adding extended input device \"%s\" (type: %s)\n",

View File

@ -33,9 +33,8 @@ is" without express or implied warranty.
#include "Args.h" #include "Args.h"
#include "Events.h" #include "Events.h"
#ifdef XKB
#include <X11/extensions/XKB.h> #include <X11/extensions/XKB.h>
#include <xkbsrv.h> #include "xkbsrv.h"
#include <X11/extensions/XKBconfig.h> #include <X11/extensions/XKBconfig.h>
extern Bool extern Bool
@ -59,7 +58,6 @@ extern Status XkbGetControls(
unsigned long /* which */, unsigned long /* which */,
XkbDescPtr /* desc */ XkbDescPtr /* desc */
); );
#endif
DeviceIntPtr xnestKeyboardDevice = NULL; DeviceIntPtr xnestKeyboardDevice = NULL;
@ -124,6 +122,10 @@ xnestKeyboardProc(DeviceIntPtr pDev, int onoff)
CARD8 modmap[MAP_LENGTH]; CARD8 modmap[MAP_LENGTH];
int i, j; int i, j;
XKeyboardState values; XKeyboardState values;
XkbComponentNamesRec names;
XkbDescPtr xkb;
char *rules, *model, *layout, *variants, *options;
int op, event, error, major, minor;
switch (onoff) switch (onoff)
{ {
@ -168,50 +170,29 @@ xnestKeyboardProc(DeviceIntPtr pDev, int onoff)
keySyms.mapWidth = mapWidth; keySyms.mapWidth = mapWidth;
keySyms.map = keymap; keySyms.map = keymap;
#ifdef XKB if (XkbQueryExtension(xnestDisplay, &op, &event, &error, &major, &minor) == 0) {
if (noXkbExtension) { ErrorF("Unable to initialize XKEYBOARD extension.\n");
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");
goto XkbError; goto XkbError;
}
xkb = XkbGetKeyboard(xnestDisplay, XkbGBN_AllComponentsMask, XkbUseCoreKbd);
if (xkb == NULL || xkb->geom == NULL) {
ErrorF("Couldn't get keyboard.\n");
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;
XkbSetRulesDflts(rules, model, layout, variants, options);
XkbInitKeyboardDeviceStruct(pDev, &names, &keySyms, modmap,
xnestBell, xnestChangeKeyboardControl);
XkbDDXChangeControls(pDev, xkb->ctrls, xkb->ctrls);
XkbFreeKeyboard(xkb, 0, False);
} }
#endif xkb = XkbGetKeyboard(xnestDisplay, XkbGBN_AllComponentsMask, XkbUseCoreKbd);
if (xkb == NULL || xkb->geom == NULL) {
ErrorF("Couldn't get keyboard.\n");
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;
XkbSetRulesDflts(rules, model, layout, variants, options);
XkbInitKeyboardDeviceStruct(pDev, &names, &keySyms, modmap,
xnestBell, xnestChangeKeyboardControl);
XkbDDXChangeControls(pDev, xkb->ctrls, xkb->ctrls);
XkbFreeKeyboard(xkb, 0, False);
xfree(keymap); xfree(keymap);
break; break;
case DEVICE_ON: case DEVICE_ON:
@ -228,6 +209,17 @@ XkbError:
break; break;
} }
return Success; 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 Bool

View File

@ -42,8 +42,8 @@ from The Open Group.
#ifdef __CYGWIN__ #ifdef __CYGWIN__
#include <mntent.h> #include <mntent.h>
#endif #endif
#if defined(XKB) && defined(WIN32) #if defined(WIN32)
#include <xkbsrv.h> #include "xkbsrv.h"
#endif #endif
#ifdef RELOCATE_PROJECTROOT #ifdef RELOCATE_PROJECTROOT
#include <shlobj.h> #include <shlobj.h>
@ -667,7 +667,6 @@ winFixupPaths (void)
winMsg (X_DEFAULT, "Logfile set to \"%s\"\n", g_pszLogFile); winMsg (X_DEFAULT, "Logfile set to \"%s\"\n", g_pszLogFile);
} }
} }
#ifdef XKB
{ {
static char xkbbasedir[MAX_PATH]; static char xkbbasedir[MAX_PATH];
@ -677,7 +676,6 @@ winFixupPaths (void)
XkbBaseDirectory = xkbbasedir; XkbBaseDirectory = xkbbasedir;
XkbBinDirectory = basedir; XkbBinDirectory = basedir;
} }
#endif /* XKB */
#endif /* RELOCATE_PROJECTROOT */ #endif /* RELOCATE_PROJECTROOT */
} }
@ -857,7 +855,6 @@ winUseMsg (void)
"\tSpecify a keyboard device from the configuration file.\n"); "\tSpecify a keyboard device from the configuration file.\n");
#endif #endif
#ifdef XKB
ErrorF ("-xkbrules XKBRules\n" ErrorF ("-xkbrules XKBRules\n"
"\tEquivalent to XKBRules in XF86Config files.\n"); "\tEquivalent to XKBRules in XF86Config files.\n");
@ -874,7 +871,6 @@ winUseMsg (void)
ErrorF ("-xkboptions XKBOptions\n" ErrorF ("-xkboptions XKBOptions\n"
"\tEquivalent to XKBOptions in XF86Config files.\n"); "\tEquivalent to XKBOptions in XF86Config files.\n");
#endif
ErrorF ("-logfile filename\n" ErrorF ("-logfile filename\n"
"\tWrite logmessages to <filename> instead of /tmp/Xwin.log.\n"); "\tWrite logmessages to <filename> instead of /tmp/Xwin.log.\n");

View File

@ -36,12 +36,7 @@
#include "winmsg.h" #include "winmsg.h"
#include "globals.h" #include "globals.h"
#ifdef XKB #include "xkbsrv.h"
#ifndef XKB_IN_SERVER
#define XKB_IN_SERVER
#endif
#include <xkbsrv.h>
#endif
#ifdef XWIN_XF86CONFIG #ifdef XWIN_XF86CONFIG
#ifndef CONFIGPATH #ifndef CONFIGPATH
@ -67,15 +62,11 @@ WinCmdlineRec g_cmdline = {
#ifdef XWIN_XF86CONFIG #ifdef XWIN_XF86CONFIG
NULL, /* keyboard */ NULL, /* keyboard */
#endif #endif
#ifdef XKB
FALSE, /* noXkbExtension */
NULL, /* xkbMap */
NULL, /* xkbRules */ NULL, /* xkbRules */
NULL, /* xkbModel */ NULL, /* xkbModel */
NULL, /* xkbLayout */ NULL, /* xkbLayout */
NULL, /* xkbVariant */ NULL, /* xkbVariant */
NULL, /* xkbOptions */ NULL, /* xkbOptions */
#endif
NULL, /* screenname */ NULL, /* screenname */
NULL, /* mousename */ NULL, /* mousename */
FALSE, /* emulate3Buttons */ FALSE, /* emulate3Buttons */
@ -87,7 +78,6 @@ winInfoRec g_winInfo = {
0, /* leds */ 0, /* leds */
500, /* delay */ 500, /* delay */
30 /* rate */ 30 /* rate */
#ifdef XKB
} }
, ,
{ /* xkb */ { /* xkb */
@ -97,14 +87,6 @@ winInfoRec g_winInfo = {
NULL, /* layout */ NULL, /* layout */
NULL, /* variant */ NULL, /* variant */
NULL, /* options */ NULL, /* options */
NULL, /* initialMap */
NULL, /* keymap */
NULL, /* types */
NULL, /* compat */
NULL, /* keycodes */
NULL, /* symbols */
NULL /* geometry */
#endif
} }
, ,
{ {
@ -228,11 +210,9 @@ winReadConfigfile ()
Bool Bool
winConfigKeyboard (DeviceIntPtr pDevice) winConfigKeyboard (DeviceIntPtr pDevice)
{ {
#ifdef XKB
char layoutName[KL_NAMELENGTH]; char layoutName[KL_NAMELENGTH];
static unsigned int layoutNum = 0; static unsigned int layoutNum = 0;
int keyboardType; int keyboardType;
#endif
#ifdef XWIN_XF86CONFIG #ifdef XWIN_XF86CONFIG
XF86ConfInputPtr kbd = NULL; XF86ConfInputPtr kbd = NULL;
XF86ConfInputPtr input_list = NULL; XF86ConfInputPtr input_list = NULL;
@ -242,7 +222,6 @@ winConfigKeyboard (DeviceIntPtr pDevice)
char *s = NULL; char *s = NULL;
/* Setup defaults */ /* Setup defaults */
#ifdef XKB
g_winInfo.xkb.disable = FALSE; g_winInfo.xkb.disable = FALSE;
# ifdef PC98 /* japanese */ /* not implemented */ # ifdef PC98 /* japanese */ /* not implemented */
g_winInfo.xkb.rules = "xfree98"; 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 */ /* parse the configuration */
#ifdef XWIN_XF86CONFIG #ifdef XWIN_XF86CONFIG
if (g_cmdline.keyboard) if (g_cmdline.keyboard)
@ -418,168 +388,101 @@ winConfigKeyboard (DeviceIntPtr pDevice)
} }
#endif #endif
#ifdef XKB s = NULL;
from = X_DEFAULT; if (g_cmdline.xkbRules)
if (g_cmdline.noXkbExtension) {
{ s = g_cmdline.xkbRules;
from = X_CMDLINE; from = X_CMDLINE;
g_winInfo.xkb.disable = TRUE; }
}
#ifdef XWIN_XF86CONFIG #ifdef XWIN_XF86CONFIG
else if (kbd->inp_option_lst) else
{ {
int b = winSetBoolOption (kbd->inp_option_lst, "XkbDisable", FALSE); s = winSetStrOption (kbd->inp_option_lst, "XkbRules", NULL);
if (b) from = X_CONFIG;
{ }
from = X_CONFIG;
g_winInfo.xkb.disable = TRUE;
}
}
#endif #endif
if (g_winInfo.xkb.disable) if (s)
{ {
winMsg (from, "XkbExtension disabled\n"); g_winInfo.xkb.rules = NULL_IF_EMPTY (s);
} winMsg (from, "XKB: rules: \"%s\"\n", s);
else }
{
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;
}
#endif
if (s)
{
g_winInfo.xkb.rules = NULL_IF_EMPTY (s);
winMsg (from, "XKB: rules: \"%s\"\n", s);
}
s = NULL; s = NULL;
if (g_cmdline.xkbModel) if (g_cmdline.xkbModel)
{ {
s = g_cmdline.xkbModel; s = g_cmdline.xkbModel;
from = X_CMDLINE; from = X_CMDLINE;
} }
#ifdef XWIN_XF86CONFIG #ifdef XWIN_XF86CONFIG
else else
{ {
s = winSetStrOption (kbd->inp_option_lst, "XkbModel", NULL); s = winSetStrOption (kbd->inp_option_lst, "XkbModel", NULL);
from = X_CONFIG; from = X_CONFIG;
} }
#endif #endif
if (s) if (s)
{ {
g_winInfo.xkb.model = NULL_IF_EMPTY (s); g_winInfo.xkb.model = NULL_IF_EMPTY (s);
winMsg (from, "XKB: model: \"%s\"\n", s); winMsg (from, "XKB: model: \"%s\"\n", s);
} }
s = NULL; s = NULL;
if (g_cmdline.xkbLayout) if (g_cmdline.xkbLayout)
{ {
s = g_cmdline.xkbLayout; s = g_cmdline.xkbLayout;
from = X_CMDLINE; from = X_CMDLINE;
} }
#ifdef XWIN_XF86CONFIG #ifdef XWIN_XF86CONFIG
else else
{ {
s = winSetStrOption (kbd->inp_option_lst, "XkbLayout", NULL); s = winSetStrOption (kbd->inp_option_lst, "XkbLayout", NULL);
from = X_CONFIG; from = X_CONFIG;
} }
#endif #endif
if (s) if (s)
{ {
g_winInfo.xkb.layout = NULL_IF_EMPTY (s); g_winInfo.xkb.layout = NULL_IF_EMPTY (s);
winMsg (from, "XKB: layout: \"%s\"\n", s); winMsg (from, "XKB: layout: \"%s\"\n", s);
} }
s = NULL; s = NULL;
if (g_cmdline.xkbVariant) if (g_cmdline.xkbVariant)
{ {
s = g_cmdline.xkbVariant; s = g_cmdline.xkbVariant;
from = X_CMDLINE; from = X_CMDLINE;
} }
#ifdef XWIN_XF86CONFIG #ifdef XWIN_XF86CONFIG
else else
{ {
s = winSetStrOption (kbd->inp_option_lst, "XkbVariant", NULL); s = winSetStrOption (kbd->inp_option_lst, "XkbVariant", NULL);
from = X_CONFIG; from = X_CONFIG;
} }
#endif #endif
if (s) if (s)
{ {
g_winInfo.xkb.variant = NULL_IF_EMPTY (s); g_winInfo.xkb.variant = NULL_IF_EMPTY (s);
winMsg (from, "XKB: variant: \"%s\"\n", s); winMsg (from, "XKB: variant: \"%s\"\n", s);
} }
s = NULL; s = NULL;
if (g_cmdline.xkbOptions) if (g_cmdline.xkbOptions)
{ {
s = g_cmdline.xkbOptions; s = g_cmdline.xkbOptions;
from = X_CMDLINE; from = X_CMDLINE;
} }
#ifdef XWIN_XF86CONFIG #ifdef XWIN_XF86CONFIG
else else
{ {
s = winSetStrOption (kbd->inp_option_lst, "XkbOptions", NULL); s = winSetStrOption (kbd->inp_option_lst, "XkbOptions", NULL);
from = X_CONFIG; from = X_CONFIG;
} }
#endif #endif
if (s) if (s)
{ {
g_winInfo.xkb.options = NULL_IF_EMPTY (s); g_winInfo.xkb.options = NULL_IF_EMPTY (s);
winMsg (from, "XKB: options: \"%s\"\n", 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 = 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 #ifdef XWIN_XF86CONFIG
} }

View File

@ -194,15 +194,11 @@ typedef struct
#ifdef XWIN_XF86CONFIG #ifdef XWIN_XF86CONFIG
char *keyboard; char *keyboard;
#endif #endif
#ifdef XKB
Bool noXkbExtension;
char *xkbMap;
char *xkbRules; char *xkbRules;
char *xkbModel; char *xkbModel;
char *xkbLayout; char *xkbLayout;
char *xkbVariant; char *xkbVariant;
char *xkbOptions; char *xkbOptions;
#endif
/* layout */ /* layout */
char *screenname; char *screenname;
/* mouse settings */ /* mouse settings */
@ -309,7 +305,6 @@ typedef struct
long rate; long rate;
} }
keyboard; keyboard;
#ifdef XKB
struct struct
{ {
Bool disable; Bool disable;
@ -318,16 +313,8 @@ typedef struct
char *layout; char *layout;
char *variant; char *variant;
char *options; char *options;
char *initialMap;
char *keymap;
char *types;
char *compat;
char *keycodes;
char *symbols;
char *geometry;
} }
xkb; xkb;
#endif
struct struct
{ {
Bool emulate3Buttons; Bool emulate3Buttons;

View File

@ -40,12 +40,7 @@
#include "winconfig.h" #include "winconfig.h"
#include "winmsg.h" #include "winmsg.h"
#ifdef XKB #include "xkbsrv.h"
#ifndef XKB_IN_SERVER
#define XKB_IN_SERVER
#endif
#include <xkbsrv.h>
#endif
static Bool g_winKeyState[NUM_KEYCODES]; static Bool g_winKeyState[NUM_KEYCODES];
@ -224,11 +219,9 @@ winKeybdProc (DeviceIntPtr pDeviceInt, int iState)
KeySymsRec keySyms; KeySymsRec keySyms;
CARD8 modMap[MAP_LENGTH]; CARD8 modMap[MAP_LENGTH];
DevicePtr pDevice = (DevicePtr) pDeviceInt; DevicePtr pDevice = (DevicePtr) pDeviceInt;
#ifdef XKB
XkbComponentNamesRec names; XkbComponentNamesRec names;
XkbSrvInfoPtr xkbi; XkbSrvInfoPtr xkbi;
XkbControlsPtr ctrl; XkbControlsPtr ctrl;
#endif
switch (iState) switch (iState)
{ {
@ -237,23 +230,16 @@ winKeybdProc (DeviceIntPtr pDeviceInt, int iState)
winGetKeyMappings (&keySyms, modMap); winGetKeyMappings (&keySyms, modMap);
#ifdef XKB
/* FIXME: Maybe we should use winGetKbdLeds () here? */ /* FIXME: Maybe we should use winGetKbdLeds () here? */
defaultKeyboardControl.leds = g_winInfo.keyboard.leds; defaultKeyboardControl.leds = g_winInfo.keyboard.leds;
#else
defaultKeyboardControl.leds = g_winInfo.keyboard.leds;
#endif
#ifdef XKB
if (g_winInfo.xkb.disable) if (g_winInfo.xkb.disable)
{ {
#endif
InitKeyboardDeviceStruct (pDevice, InitKeyboardDeviceStruct (pDevice,
&keySyms, &keySyms,
modMap, modMap,
winKeybdBell, winKeybdBell,
winKeybdCtrl); winKeybdCtrl);
#ifdef XKB
} }
else else
{ {
@ -279,9 +265,7 @@ winKeybdProc (DeviceIntPtr pDeviceInt, int iState)
XkbInitKeyboardDeviceStruct (pDeviceInt, &names, &keySyms, XkbInitKeyboardDeviceStruct (pDeviceInt, &names, &keySyms,
modMap, winKeybdBell, winKeybdCtrl); modMap, winKeybdBell, winKeybdCtrl);
} }
#endif
#ifdef XKB
if (!g_winInfo.xkb.disable) if (!g_winInfo.xkb.disable)
{ {
xkbi = pDeviceInt->key->xkbInfo; xkbi = pDeviceInt->key->xkbInfo;
@ -296,7 +280,6 @@ winKeybdProc (DeviceIntPtr pDeviceInt, int iState)
winErrorFVerb (1, "winKeybdProc - Error initializing keyboard AutoRepeat (No XKB)\n"); winErrorFVerb (1, "winKeybdProc - Error initializing keyboard AutoRepeat (No XKB)\n");
} }
} }
#endif
g_winInternalModeKeyStatesPtr = &(pDeviceInt->key->state); g_winInternalModeKeyStatesPtr = &(pDeviceInt->key->state);
break; break;

View File

@ -1369,16 +1369,6 @@ ddxProcessArgument (int argc, char *argv[], int i)
} }
#endif #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")) if (IS_OPTION ("-xkbrules"))
{ {
CHECK_ARGS (1); CHECK_ARGS (1);
@ -1409,7 +1399,6 @@ ddxProcessArgument (int argc, char *argv[], int i)
g_cmdline.xkbOptions = argv[++i]; g_cmdline.xkbOptions = argv[++i];
return 2; return 2;
} }
#endif
if (IS_OPTION ("-keyhook")) if (IS_OPTION ("-keyhook"))
{ {

View File

@ -42,9 +42,7 @@
#include "winmsg.h" #include "winmsg.h"
#include "inputstr.h" #include "inputstr.h"
#ifdef XKB
extern BOOL winCheckKeyPressed(WPARAM wParam, LPARAM lParam); extern BOOL winCheckKeyPressed(WPARAM wParam, LPARAM lParam);
#endif
extern void winFixShiftKeys (int iScanCode); extern void winFixShiftKeys (int iScanCode);
@ -1031,7 +1029,6 @@ winWindowProc (HWND hwnd, UINT message,
if ((wParam == VK_LWIN || wParam == VK_RWIN) && !g_fKeyboardHookLL) if ((wParam == VK_LWIN || wParam == VK_RWIN) && !g_fKeyboardHookLL)
break; break;
#ifdef XKB
/* /*
* Discard presses generated from Windows auto-repeat * Discard presses generated from Windows auto-repeat
* ago: Only discard them if XKB is not disabled * ago: Only discard them if XKB is not disabled
@ -1052,7 +1049,6 @@ winWindowProc (HWND hwnd, UINT message,
return 0; return 0;
} }
} }
#endif
/* Discard fake Ctrl_L presses that precede AltGR on non-US keyboards */ /* Discard fake Ctrl_L presses that precede AltGR on non-US keyboards */
if (winIsFakeCtrl_L (message, wParam, lParam)) if (winIsFakeCtrl_L (message, wParam, lParam))

View File

@ -315,15 +315,6 @@
/* Support Xinerama extension */ /* Support Xinerama extension */
#undef XINERAMA #undef XINERAMA
/* Build XKB */
#undef XKB
/* Enable XKB per default */
#undef XKB_DFLT_DISABLED
/* Build XKB server */
#undef XKB_IN_SERVER
/* Vendor release */ /* Vendor release */
#undef XORG_RELEASE #undef XORG_RELEASE

View File

@ -408,11 +408,9 @@ extern _X_EXPORT void DeliverGrabbedEvent(
Bool /* deactivateGrab */, Bool /* deactivateGrab */,
int /* count */); int /* count */);
#ifdef XKB
extern _X_EXPORT void FixKeyState( extern _X_EXPORT void FixKeyState(
xEvent * /* xE */, xEvent * /* xE */,
DeviceIntPtr /* keybd */); DeviceIntPtr /* keybd */);
#endif /* XKB */
extern _X_EXPORT void RecalculateDeliverableEvents( extern _X_EXPORT void RecalculateDeliverableEvents(
WindowPtr /* pWin */); WindowPtr /* pWin */);

View File

@ -112,13 +112,11 @@ typedef struct _Client {
int priority; int priority;
ClientState clientState; ClientState clientState;
PrivateRec *devPrivates; PrivateRec *devPrivates;
#ifdef XKB
unsigned short xkbClientFlags; unsigned short xkbClientFlags;
unsigned short mapNotifyMask; unsigned short mapNotifyMask;
unsigned short newKeyboardNotifyMask; unsigned short newKeyboardNotifyMask;
unsigned short vMajor,vMinor; unsigned short vMajor,vMinor;
KeyCode minKC,maxKC; KeyCode minKC,maxKC;
#endif
#ifdef DEBUG #ifdef DEBUG
unsigned char requestLog[MAX_REQUEST_LOG]; unsigned char requestLog[MAX_REQUEST_LOG];

View File

@ -114,11 +114,6 @@ extern _X_EXPORT Bool noXFree86VidModeExtension;
extern _X_EXPORT Bool noXFixesExtension; extern _X_EXPORT Bool noXFixesExtension;
#endif #endif
#ifdef XKB
/* noXkbExtension is defined in xkb/xkbInit.c */
extern _X_EXPORT Bool noXkbExtension;
#endif
#ifdef PANORAMIX #ifdef PANORAMIX
extern _X_EXPORT Bool noPanoramiXExtension; extern _X_EXPORT Bool noPanoramiXExtension;
#endif #endif

View File

@ -409,7 +409,6 @@ extern _X_EXPORT void ProcessKeyboardEvent(
DeviceIntPtr /*keybd*/, DeviceIntPtr /*keybd*/,
int /*count*/); int /*count*/);
#ifdef XKB
extern _X_EXPORT void CoreProcessPointerEvent( extern _X_EXPORT void CoreProcessPointerEvent(
xEventPtr /*xE*/, xEventPtr /*xE*/,
DeviceIntPtr /*mouse*/, DeviceIntPtr /*mouse*/,
@ -419,7 +418,6 @@ extern _X_EXPORT _X_DEPRECATED void CoreProcessKeyboardEvent(
xEventPtr /*xE*/, xEventPtr /*xE*/,
DeviceIntPtr /*keybd*/, DeviceIntPtr /*keybd*/,
int /*count*/) _X_DEPRECATED; int /*count*/) _X_DEPRECATED;
#endif
extern _X_EXPORT Bool LegalModifier( extern _X_EXPORT Bool LegalModifier(
unsigned int /*key*/, unsigned int /*key*/,

View File

@ -144,11 +144,7 @@ typedef struct _KeyClassRec {
CARD8 maxKeysPerModifier; CARD8 maxKeysPerModifier;
unsigned short state; unsigned short state;
unsigned short prev_state; unsigned short prev_state;
#ifdef XKB
struct _XkbSrvInfo *xkbInfo; struct _XkbSrvInfo *xkbInfo;
#else
void *pad0;
#endif
} KeyClassRec, *KeyClassPtr; } KeyClassRec, *KeyClassPtr;
typedef struct _AxisInfo { typedef struct _AxisInfo {
@ -192,11 +188,7 @@ typedef struct _ButtonClassRec {
Mask motionMask; Mask motionMask;
CARD8 down[DOWN_LENGTH]; CARD8 down[DOWN_LENGTH];
CARD8 map[MAP_LENGTH]; CARD8 map[MAP_LENGTH];
#ifdef XKB
union _XkbAction *xkb_acts; union _XkbAction *xkb_acts;
#else
void *pad0;
#endif
} ButtonClassRec, *ButtonClassPtr; } ButtonClassRec, *ButtonClassPtr;
typedef struct _FocusClassRec { typedef struct _FocusClassRec {
@ -244,11 +236,7 @@ typedef struct _KbdFeedbackClassRec {
KbdCtrlProcPtr CtrlProc; KbdCtrlProcPtr CtrlProc;
KeybdCtrl ctrl; KeybdCtrl ctrl;
KbdFeedbackPtr next; KbdFeedbackPtr next;
#ifdef XKB
struct _XkbSrvLedInfo *xkb_sli; struct _XkbSrvLedInfo *xkb_sli;
#else
void *pad0;
#endif
} KbdFeedbackClassRec; } KbdFeedbackClassRec;
typedef struct _PtrFeedbackClassRec { typedef struct _PtrFeedbackClassRec {
@ -280,11 +268,7 @@ typedef struct _LedFeedbackClassRec {
LedCtrlProcPtr CtrlProc; LedCtrlProcPtr CtrlProc;
LedCtrl ctrl; LedCtrl ctrl;
LedFeedbackPtr next; LedFeedbackPtr next;
#ifdef XKB
struct _XkbSrvLedInfo *xkb_sli; struct _XkbSrvLedInfo *xkb_sli;
#else
void *pad0;
#endif
} LedFeedbackClassRec; } LedFeedbackClassRec;
@ -446,11 +430,7 @@ typedef struct _DeviceIntRec {
StringFeedbackPtr stringfeed; StringFeedbackPtr stringfeed;
BellFeedbackPtr bell; BellFeedbackPtr bell;
LedFeedbackPtr leds; LedFeedbackPtr leds;
#ifdef XKB
struct _XkbInterest *xkb_interest; struct _XkbInterest *xkb_interest;
#else
void *pad0;
#endif
char *config_info; /* used by the hotplug layer */ char *config_info; /* used by the hotplug layer */
PrivateRec *devPrivates; PrivateRec *devPrivates;
int nPrivates; int nPrivates;

View File

@ -90,11 +90,7 @@ SOFTWARE.
#define DEFAULT_BELL 50 #define DEFAULT_BELL 50
#define DEFAULT_BELL_PITCH 400 #define DEFAULT_BELL_PITCH 400
#define DEFAULT_BELL_DURATION 100 #define DEFAULT_BELL_DURATION 100
#ifdef XKB
#define DEFAULT_AUTOREPEAT TRUE #define DEFAULT_AUTOREPEAT TRUE
#else
#define DEFAULT_AUTOREPEAT FALSE
#endif
#define DEFAULT_AUTOREPEATS {\ #define DEFAULT_AUTOREPEATS {\
0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\ 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\

View File

@ -295,8 +295,6 @@ extern _X_EXPORT int XkbKeyboardErrorCode;
extern _X_EXPORT char * XkbBaseDirectory; extern _X_EXPORT char * XkbBaseDirectory;
extern _X_EXPORT char * XkbBinDirectory; extern _X_EXPORT char * XkbBinDirectory;
extern _X_EXPORT Bool noXkbExtension;
extern _X_EXPORT pointer XkbLastRepeatEvent; extern _X_EXPORT pointer XkbLastRepeatEvent;
extern _X_EXPORT CARD32 xkbDebugFlags; extern _X_EXPORT CARD32 xkbDebugFlags;

View File

@ -103,15 +103,9 @@
/* Build XKB */ /* Build XKB */
#undef XKB #undef XKB
/* Enable XKB per default */
#undef XKB_DFLT_DISABLED
/* XKB default rules */ /* XKB default rules */
#undef XKB_DFLT_RULES #undef XKB_DFLT_RULES
/* Build XKB support in server */
#undef XKB_IN_SERVER
/* Support loadable input and output drivers */ /* Support loadable input and output drivers */
#undef XLOADABLE #undef XLOADABLE

View File

@ -134,10 +134,6 @@ extern Bool noXFree86VidModeExtension;
#ifdef XFIXES #ifdef XFIXES
extern Bool noXFixesExtension; extern Bool noXFixesExtension;
#endif #endif
#ifdef XKB
/* |noXkbExtension| is defined in xc/programs/Xserver/xkb/xkbInit.c */
extern Bool noXkbExtension;
#endif
#ifdef PANORAMIX #ifdef PANORAMIX
extern Bool noPanoramiXExtension; extern Bool noPanoramiXExtension;
#endif #endif
@ -167,9 +163,7 @@ typedef void (*InitExtension)(INITARGS);
#define _XTEST_SERVER_ #define _XTEST_SERVER_
#include <X11/extensions/XTest.h> #include <X11/extensions/XTest.h>
#endif #endif
#ifdef XKB
#include <X11/extensions/XKB.h> #include <X11/extensions/XKB.h>
#endif
#ifdef XCSECURITY #ifdef XCSECURITY
#include "securitysrv.h" #include "securitysrv.h"
#include <X11/extensions/securstr.h> #include <X11/extensions/securstr.h>
@ -213,9 +207,7 @@ extern void XvExtensionInit(INITARGS);
extern void XvMCExtensionInit(INITARGS); extern void XvMCExtensionInit(INITARGS);
#endif #endif
extern void SyncExtensionInit(INITARGS); extern void SyncExtensionInit(INITARGS);
#ifdef XKB
extern void XkbExtensionInit(INITARGS); extern void XkbExtensionInit(INITARGS);
#endif
extern void XCMiscExtensionInit(INITARGS); extern void XCMiscExtensionInit(INITARGS);
#ifdef XRECORD #ifdef XRECORD
extern void RecordExtensionInit(INITARGS); extern void RecordExtensionInit(INITARGS);
@ -340,9 +332,7 @@ static ExtensionToggle ExtensionToggleList[] =
{ "XINERAMA", &noPanoramiXExtension }, { "XINERAMA", &noPanoramiXExtension },
#endif #endif
{ "XInputExtension", NULL }, { "XInputExtension", NULL },
#ifdef XKB { "XKEYBOARD", NULL },
{ "XKEYBOARD", &noXkbExtension },
#endif
#ifdef XSELINUX #ifdef XSELINUX
{ "SELinux", &noSELinuxExtension }, { "SELinux", &noSELinuxExtension },
#endif #endif
@ -416,9 +406,7 @@ InitExtensions(int argc, char *argv[])
} }
#endif #endif
SyncExtensionInit(); SyncExtensionInit();
#if defined(XKB) XkbExtensionInit();
if (!noXkbExtension) XkbExtensionInit();
#endif
XCMiscExtensionInit(); XCMiscExtensionInit();
#ifdef XRECORD #ifdef XRECORD
if (!noTestExtensions) RecordExtensionInit(); if (!noTestExtensions) RecordExtensionInit();
@ -493,9 +481,7 @@ static ExtensionModule staticExtensions[] = {
#endif #endif
{ BigReqExtensionInit, "BIG-REQUESTS", NULL, NULL, NULL }, { BigReqExtensionInit, "BIG-REQUESTS", NULL, NULL, NULL },
{ SyncExtensionInit, "SYNC", NULL, NULL, NULL }, { SyncExtensionInit, "SYNC", NULL, NULL, NULL },
#ifdef XKB { XkbExtensionInit, XkbName, NULL, NULL, NULL },
{ XkbExtensionInit, XkbName, &noXkbExtension, NULL, NULL },
#endif
{ XCMiscExtensionInit, "XC-MISC", NULL, NULL, NULL }, { XCMiscExtensionInit, "XC-MISC", NULL, NULL, NULL },
#ifdef XCSECURITY #ifdef XCSECURITY
{ SecurityExtensionInit, SECURITY_EXTENSION_NAME, &noSecurityExtension, NULL, NULL }, { SecurityExtensionInit, SECURITY_EXTENSION_NAME, &noSecurityExtension, NULL, NULL },

View File

@ -118,9 +118,7 @@ __stdcall unsigned long GetTickCount(void);
#include "dixstruct.h" #include "dixstruct.h"
#ifdef XKB #include "xkbsrv.h"
#include <xkbsrv.h>
#endif
#ifdef RENDER #ifdef RENDER
#include "picture.h" #include "picture.h"
@ -180,7 +178,6 @@ Bool noXFree86VidModeExtension = FALSE;
#ifdef XFIXES #ifdef XFIXES
Bool noXFixesExtension = FALSE; Bool noXFixesExtension = FALSE;
#endif #endif
/* noXkbExtension is defined in xkb/xkbInit.c */
#ifdef PANORAMIX #ifdef PANORAMIX
/* Xinerama is disabled by default unless enabled via +xinerama */ /* Xinerama is disabled by default unless enabled via +xinerama */
Bool noPanoramiXExtension = TRUE; Bool noPanoramiXExtension = TRUE;
@ -551,9 +548,7 @@ void UseMsg(void)
#ifdef XDMCP #ifdef XDMCP
XdmcpUseMsg(); XdmcpUseMsg();
#endif #endif
#ifdef XKB
XkbUseMsg(); XkbUseMsg();
#endif
ddxUseMsg(); ddxUseMsg();
} }
@ -722,13 +717,11 @@ ProcessCommandLine(int argc, char *argv[])
UseMsg(); UseMsg();
exit(0); exit(0);
} }
#ifdef XKB
else if ( (skip=XkbProcessArguments(argc,argv,i))!=0 ) { else if ( (skip=XkbProcessArguments(argc,argv,i))!=0 ) {
if (skip>0) if (skip>0)
i+= skip-1; i+= skip-1;
else UseMsg(); else UseMsg();
} }
#endif
#ifdef RLIMIT_DATA #ifdef RLIMIT_DATA
else if ( strcmp( argv[i], "-ld") == 0) else if ( strcmp( argv[i], "-ld") == 0)
{ {

View File

@ -85,9 +85,6 @@ typedef struct _SrvXkmInfo {
/***====================================================================***/ /***====================================================================***/
#ifndef XKB_DFLT_DISABLED
#define XKB_DFLT_DISABLED True
#endif
#ifndef XKB_DFLT_RULES_PROP #ifndef XKB_DFLT_RULES_PROP
#define XKB_DFLT_RULES_PROP True #define XKB_DFLT_RULES_PROP True
#endif #endif
@ -110,7 +107,6 @@ static char * XkbOptionsUsed= NULL;
static XkbDescPtr xkb_cached_map = NULL; static XkbDescPtr xkb_cached_map = NULL;
Bool noXkbExtension= XKB_DFLT_DISABLED;
static Bool XkbWantRulesProp= XKB_DFLT_RULES_PROP; static Bool XkbWantRulesProp= XKB_DFLT_RULES_PROP;
/***====================================================================***/ /***====================================================================***/
@ -817,15 +813,7 @@ extern unsigned char XkbDfltAccessXOptions;
int int
XkbProcessArguments(int argc,char *argv[],int i) XkbProcessArguments(int argc,char *argv[],int i)
{ {
if (strcmp(argv[i],"-kb")==0) { if (strncmp(argv[i], "-xkbdir", 7) == 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(++i < argc) { if(++i < argc) {
#if !defined(WIN32) && !defined(__CYGWIN__) #if !defined(WIN32) && !defined(__CYGWIN__)
if (getuid() != geteuid()) { if (getuid() != geteuid()) {