2006-11-26 11:13:41 -07:00
|
|
|
/************************************************************
|
|
|
|
Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
|
|
|
|
|
|
|
|
Permission to use, copy, modify, and distribute this
|
|
|
|
software and its documentation for any purpose and without
|
|
|
|
fee is hereby granted, provided that the above copyright
|
|
|
|
notice appear in all copies and that both that copyright
|
|
|
|
notice and this permission notice appear in supporting
|
2015-09-16 13:10:19 -06:00
|
|
|
documentation, and that the name of Silicon Graphics not be
|
|
|
|
used in advertising or publicity pertaining to distribution
|
2006-11-26 11:13:41 -07:00
|
|
|
of the software without specific prior written permission.
|
2015-09-16 13:10:19 -06:00
|
|
|
Silicon Graphics makes no representation about the suitability
|
2006-11-26 11:13:41 -07:00
|
|
|
of this software for any purpose. It is provided "as is"
|
|
|
|
without any express or implied warranty.
|
|
|
|
|
2015-09-16 13:10:19 -06:00
|
|
|
SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
|
|
|
|
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
2006-11-26 11:13:41 -07:00
|
|
|
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
|
2015-09-16 13:10:19 -06:00
|
|
|
GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
|
|
|
|
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
|
|
|
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
2006-11-26 11:13:41 -07:00
|
|
|
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
|
|
|
|
THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
|
|
|
|
********************************************************/
|
|
|
|
|
|
|
|
#ifdef HAVE_DIX_CONFIG_H
|
|
|
|
#include <dix-config.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "stdio.h"
|
|
|
|
#include <X11/X.h>
|
|
|
|
#include <X11/Xproto.h>
|
|
|
|
#include "misc.h"
|
|
|
|
#include "inputstr.h"
|
2007-11-24 10:55:21 -07:00
|
|
|
#include <xkbsrv.h>
|
2008-11-02 08:26:08 -07:00
|
|
|
#include "xkbstr.h"
|
2006-11-26 11:13:41 -07:00
|
|
|
#include "extnsionst.h"
|
|
|
|
#include "xkb.h"
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
/*
|
|
|
|
* REQUEST SWAPPING
|
|
|
|
*/
|
2006-11-26 11:13:41 -07:00
|
|
|
static int
|
|
|
|
SProcXkbUseExtension(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbUseExtensionReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xkbUseExtensionReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->wantedMajor);
|
|
|
|
swaps(&stuff->wantedMinor);
|
2006-11-26 11:13:41 -07:00
|
|
|
return ProcXkbUseExtension(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbSelectEvents(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbSelectEventsReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xkbSelectEventsReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swaps(&stuff->affectWhich);
|
|
|
|
swaps(&stuff->clear);
|
|
|
|
swaps(&stuff->selectAll);
|
|
|
|
swaps(&stuff->affectMap);
|
|
|
|
swaps(&stuff->map);
|
|
|
|
if ((stuff->affectWhich & (~XkbMapNotifyMask)) != 0) {
|
|
|
|
union {
|
|
|
|
BOOL *b;
|
|
|
|
CARD8 *c8;
|
|
|
|
CARD16 *c16;
|
|
|
|
CARD32 *c32;
|
|
|
|
} from;
|
|
|
|
register unsigned bit, ndx, maskLeft, dataLeft, size;
|
|
|
|
|
|
|
|
from.c8 = (CARD8 *) &stuff[1];
|
|
|
|
dataLeft = (stuff->length * 4) - SIZEOF(xkbSelectEventsReq);
|
|
|
|
maskLeft = (stuff->affectWhich & (~XkbMapNotifyMask));
|
|
|
|
for (ndx = 0, bit = 1; (maskLeft != 0); ndx++, bit <<= 1) {
|
|
|
|
if (((bit & maskLeft) == 0) || (ndx == XkbMapNotify))
|
|
|
|
continue;
|
|
|
|
maskLeft &= ~bit;
|
|
|
|
if ((stuff->selectAll & bit) || (stuff->clear & bit))
|
|
|
|
continue;
|
|
|
|
switch (ndx) {
|
|
|
|
case XkbNewKeyboardNotify:
|
|
|
|
case XkbStateNotify:
|
|
|
|
case XkbNamesNotify:
|
|
|
|
case XkbAccessXNotify:
|
|
|
|
case XkbExtensionDeviceNotify:
|
|
|
|
size = 2;
|
|
|
|
break;
|
|
|
|
case XkbControlsNotify:
|
|
|
|
case XkbIndicatorStateNotify:
|
|
|
|
case XkbIndicatorMapNotify:
|
|
|
|
size = 4;
|
|
|
|
break;
|
|
|
|
case XkbBellNotify:
|
|
|
|
case XkbActionMessage:
|
|
|
|
case XkbCompatMapNotify:
|
|
|
|
size = 1;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
client->errorValue = _XkbErrCode2(0x1, bit);
|
|
|
|
return BadValue;
|
|
|
|
}
|
|
|
|
if (dataLeft < (size * 2))
|
|
|
|
return BadLength;
|
|
|
|
if (size == 2) {
|
|
|
|
swaps(&from.c16[0]);
|
|
|
|
swaps(&from.c16[1]);
|
|
|
|
}
|
|
|
|
else if (size == 4) {
|
|
|
|
swapl(&from.c32[0]);
|
|
|
|
swapl(&from.c32[1]);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
size = 2;
|
|
|
|
}
|
|
|
|
from.c8 += (size * 2);
|
|
|
|
dataLeft -= (size * 2);
|
|
|
|
}
|
|
|
|
if (dataLeft > 2) {
|
|
|
|
ErrorF("[xkb] Extra data (%d bytes) after SelectEvents\n",
|
|
|
|
dataLeft);
|
|
|
|
return BadLength;
|
|
|
|
}
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
return ProcXkbSelectEvents(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbBell(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbBellReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xkbBellReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swaps(&stuff->bellClass);
|
|
|
|
swaps(&stuff->bellID);
|
|
|
|
swapl(&stuff->name);
|
|
|
|
swapl(&stuff->window);
|
|
|
|
swaps(&stuff->pitch);
|
|
|
|
swaps(&stuff->duration);
|
2006-11-26 11:13:41 -07:00
|
|
|
return ProcXkbBell(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbGetState(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbGetStateReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xkbGetStateReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->deviceSpec);
|
2006-11-26 11:13:41 -07:00
|
|
|
return ProcXkbGetState(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbLatchLockState(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbLatchLockStateReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xkbLatchLockStateReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swaps(&stuff->groupLatch);
|
2006-11-26 11:13:41 -07:00
|
|
|
return ProcXkbLatchLockState(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbGetControls(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbGetControlsReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xkbGetControlsReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->deviceSpec);
|
2006-11-26 11:13:41 -07:00
|
|
|
return ProcXkbGetControls(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbSetControls(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbSetControlsReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xkbSetControlsReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swaps(&stuff->affectInternalVMods);
|
|
|
|
swaps(&stuff->internalVMods);
|
|
|
|
swaps(&stuff->affectIgnoreLockVMods);
|
|
|
|
swaps(&stuff->ignoreLockVMods);
|
|
|
|
swaps(&stuff->axOptions);
|
|
|
|
swapl(&stuff->affectEnabledCtrls);
|
|
|
|
swapl(&stuff->enabledCtrls);
|
|
|
|
swapl(&stuff->changeCtrls);
|
|
|
|
swaps(&stuff->repeatDelay);
|
|
|
|
swaps(&stuff->repeatInterval);
|
|
|
|
swaps(&stuff->slowKeysDelay);
|
|
|
|
swaps(&stuff->debounceDelay);
|
|
|
|
swaps(&stuff->mkDelay);
|
|
|
|
swaps(&stuff->mkInterval);
|
|
|
|
swaps(&stuff->mkTimeToMax);
|
|
|
|
swaps(&stuff->mkMaxSpeed);
|
|
|
|
swaps(&stuff->mkCurve);
|
|
|
|
swaps(&stuff->axTimeout);
|
|
|
|
swapl(&stuff->axtCtrlsMask);
|
|
|
|
swapl(&stuff->axtCtrlsValues);
|
|
|
|
swaps(&stuff->axtOptsMask);
|
|
|
|
swaps(&stuff->axtOptsValues);
|
2006-11-26 11:13:41 -07:00
|
|
|
return ProcXkbSetControls(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbGetMap(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbGetMapReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xkbGetMapReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swaps(&stuff->full);
|
|
|
|
swaps(&stuff->partial);
|
|
|
|
swaps(&stuff->virtualMods);
|
2006-11-26 11:13:41 -07:00
|
|
|
return ProcXkbGetMap(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbSetMap(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbSetMapReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xkbSetMapReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swaps(&stuff->present);
|
|
|
|
swaps(&stuff->flags);
|
|
|
|
swaps(&stuff->totalSyms);
|
|
|
|
swaps(&stuff->totalActs);
|
|
|
|
swaps(&stuff->virtualMods);
|
2006-11-26 11:13:41 -07:00
|
|
|
return ProcXkbSetMap(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbGetCompatMap(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbGetCompatMapReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xkbGetCompatMapReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swaps(&stuff->firstSI);
|
|
|
|
swaps(&stuff->nSI);
|
2006-11-26 11:13:41 -07:00
|
|
|
return ProcXkbGetCompatMap(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbSetCompatMap(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbSetCompatMapReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xkbSetCompatMapReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swaps(&stuff->firstSI);
|
|
|
|
swaps(&stuff->nSI);
|
2006-11-26 11:13:41 -07:00
|
|
|
return ProcXkbSetCompatMap(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbGetIndicatorState(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbGetIndicatorStateReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xkbGetIndicatorStateReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->deviceSpec);
|
2006-11-26 11:13:41 -07:00
|
|
|
return ProcXkbGetIndicatorState(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbGetIndicatorMap(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbGetIndicatorMapReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xkbGetIndicatorMapReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swapl(&stuff->which);
|
2006-11-26 11:13:41 -07:00
|
|
|
return ProcXkbGetIndicatorMap(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbSetIndicatorMap(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbSetIndicatorMapReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xkbSetIndicatorMapReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swapl(&stuff->which);
|
2006-11-26 11:13:41 -07:00
|
|
|
return ProcXkbSetIndicatorMap(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbGetNamedIndicator(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbGetNamedIndicatorReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xkbGetNamedIndicatorReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swaps(&stuff->ledClass);
|
|
|
|
swaps(&stuff->ledID);
|
|
|
|
swapl(&stuff->indicator);
|
2006-11-26 11:13:41 -07:00
|
|
|
return ProcXkbGetNamedIndicator(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbSetNamedIndicator(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbSetNamedIndicatorReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xkbSetNamedIndicatorReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swaps(&stuff->ledClass);
|
|
|
|
swaps(&stuff->ledID);
|
|
|
|
swapl(&stuff->indicator);
|
|
|
|
swaps(&stuff->virtualMods);
|
|
|
|
swapl(&stuff->ctrls);
|
2006-11-26 11:13:41 -07:00
|
|
|
return ProcXkbSetNamedIndicator(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbGetNames(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbGetNamesReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xkbGetNamesReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swapl(&stuff->which);
|
2006-11-26 11:13:41 -07:00
|
|
|
return ProcXkbGetNames(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbSetNames(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbSetNamesReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xkbSetNamesReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swaps(&stuff->virtualMods);
|
|
|
|
swapl(&stuff->which);
|
|
|
|
swapl(&stuff->indicators);
|
|
|
|
swaps(&stuff->totalKTLevelNames);
|
2006-11-26 11:13:41 -07:00
|
|
|
return ProcXkbSetNames(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbGetGeometry(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbGetGeometryReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xkbGetGeometryReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swapl(&stuff->name);
|
2006-11-26 11:13:41 -07:00
|
|
|
return ProcXkbGetGeometry(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbSetGeometry(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbSetGeometryReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xkbSetGeometryReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swapl(&stuff->name);
|
|
|
|
swaps(&stuff->widthMM);
|
|
|
|
swaps(&stuff->heightMM);
|
|
|
|
swaps(&stuff->nProperties);
|
|
|
|
swaps(&stuff->nColors);
|
|
|
|
swaps(&stuff->nDoodads);
|
|
|
|
swaps(&stuff->nKeyAliases);
|
2006-11-26 11:13:41 -07:00
|
|
|
return ProcXkbSetGeometry(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbPerClientFlags(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbPerClientFlagsReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xkbPerClientFlagsReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swapl(&stuff->change);
|
|
|
|
swapl(&stuff->value);
|
|
|
|
swapl(&stuff->ctrlsToChange);
|
|
|
|
swapl(&stuff->autoCtrls);
|
|
|
|
swapl(&stuff->autoCtrlValues);
|
2006-11-26 11:13:41 -07:00
|
|
|
return ProcXkbPerClientFlags(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbListComponents(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbListComponentsReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xkbListComponentsReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swaps(&stuff->maxNames);
|
2006-11-26 11:13:41 -07:00
|
|
|
return ProcXkbListComponents(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbGetKbdByName(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbGetKbdByNameReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xkbGetKbdByNameReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swaps(&stuff->want);
|
|
|
|
swaps(&stuff->need);
|
2006-11-26 11:13:41 -07:00
|
|
|
return ProcXkbGetKbdByName(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbGetDeviceInfo(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbGetDeviceInfoReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xkbGetDeviceInfoReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swaps(&stuff->wanted);
|
|
|
|
swaps(&stuff->ledClass);
|
|
|
|
swaps(&stuff->ledID);
|
2006-11-26 11:13:41 -07:00
|
|
|
return ProcXkbGetDeviceInfo(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbSetDeviceInfo(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbSetDeviceInfoReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xkbSetDeviceInfoReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swaps(&stuff->change);
|
|
|
|
swaps(&stuff->nDeviceLedFBs);
|
2006-11-26 11:13:41 -07:00
|
|
|
return ProcXkbSetDeviceInfo(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbSetDebuggingFlags(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbSetDebuggingFlagsReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xkbSetDebuggingFlagsReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->affectFlags);
|
|
|
|
swapl(&stuff->flags);
|
|
|
|
swapl(&stuff->affectCtrls);
|
|
|
|
swapl(&stuff->ctrls);
|
|
|
|
swaps(&stuff->msgLength);
|
2006-11-26 11:13:41 -07:00
|
|
|
return ProcXkbSetDebuggingFlags(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2012-06-10 07:21:05 -06:00
|
|
|
SProcXkbDispatch(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
switch (stuff->data) {
|
2006-11-26 11:13:41 -07:00
|
|
|
case X_kbUseExtension:
|
2012-06-10 07:21:05 -06:00
|
|
|
return SProcXkbUseExtension(client);
|
2006-11-26 11:13:41 -07:00
|
|
|
case X_kbSelectEvents:
|
2012-06-10 07:21:05 -06:00
|
|
|
return SProcXkbSelectEvents(client);
|
2006-11-26 11:13:41 -07:00
|
|
|
case X_kbBell:
|
2012-06-10 07:21:05 -06:00
|
|
|
return SProcXkbBell(client);
|
2006-11-26 11:13:41 -07:00
|
|
|
case X_kbGetState:
|
2012-06-10 07:21:05 -06:00
|
|
|
return SProcXkbGetState(client);
|
2006-11-26 11:13:41 -07:00
|
|
|
case X_kbLatchLockState:
|
2012-06-10 07:21:05 -06:00
|
|
|
return SProcXkbLatchLockState(client);
|
2006-11-26 11:13:41 -07:00
|
|
|
case X_kbGetControls:
|
2012-06-10 07:21:05 -06:00
|
|
|
return SProcXkbGetControls(client);
|
2006-11-26 11:13:41 -07:00
|
|
|
case X_kbSetControls:
|
2012-06-10 07:21:05 -06:00
|
|
|
return SProcXkbSetControls(client);
|
2006-11-26 11:13:41 -07:00
|
|
|
case X_kbGetMap:
|
2012-06-10 07:21:05 -06:00
|
|
|
return SProcXkbGetMap(client);
|
2006-11-26 11:13:41 -07:00
|
|
|
case X_kbSetMap:
|
2012-06-10 07:21:05 -06:00
|
|
|
return SProcXkbSetMap(client);
|
2006-11-26 11:13:41 -07:00
|
|
|
case X_kbGetCompatMap:
|
2012-06-10 07:21:05 -06:00
|
|
|
return SProcXkbGetCompatMap(client);
|
2006-11-26 11:13:41 -07:00
|
|
|
case X_kbSetCompatMap:
|
2012-06-10 07:21:05 -06:00
|
|
|
return SProcXkbSetCompatMap(client);
|
2006-11-26 11:13:41 -07:00
|
|
|
case X_kbGetIndicatorState:
|
2012-06-10 07:21:05 -06:00
|
|
|
return SProcXkbGetIndicatorState(client);
|
2006-11-26 11:13:41 -07:00
|
|
|
case X_kbGetIndicatorMap:
|
2012-06-10 07:21:05 -06:00
|
|
|
return SProcXkbGetIndicatorMap(client);
|
2006-11-26 11:13:41 -07:00
|
|
|
case X_kbSetIndicatorMap:
|
2012-06-10 07:21:05 -06:00
|
|
|
return SProcXkbSetIndicatorMap(client);
|
2006-11-26 11:13:41 -07:00
|
|
|
case X_kbGetNamedIndicator:
|
2012-06-10 07:21:05 -06:00
|
|
|
return SProcXkbGetNamedIndicator(client);
|
2006-11-26 11:13:41 -07:00
|
|
|
case X_kbSetNamedIndicator:
|
2012-06-10 07:21:05 -06:00
|
|
|
return SProcXkbSetNamedIndicator(client);
|
2006-11-26 11:13:41 -07:00
|
|
|
case X_kbGetNames:
|
2012-06-10 07:21:05 -06:00
|
|
|
return SProcXkbGetNames(client);
|
2006-11-26 11:13:41 -07:00
|
|
|
case X_kbSetNames:
|
2012-06-10 07:21:05 -06:00
|
|
|
return SProcXkbSetNames(client);
|
2006-11-26 11:13:41 -07:00
|
|
|
case X_kbGetGeometry:
|
2012-06-10 07:21:05 -06:00
|
|
|
return SProcXkbGetGeometry(client);
|
2006-11-26 11:13:41 -07:00
|
|
|
case X_kbSetGeometry:
|
2012-06-10 07:21:05 -06:00
|
|
|
return SProcXkbSetGeometry(client);
|
2006-11-26 11:13:41 -07:00
|
|
|
case X_kbPerClientFlags:
|
2012-06-10 07:21:05 -06:00
|
|
|
return SProcXkbPerClientFlags(client);
|
2006-11-26 11:13:41 -07:00
|
|
|
case X_kbListComponents:
|
2012-06-10 07:21:05 -06:00
|
|
|
return SProcXkbListComponents(client);
|
2006-11-26 11:13:41 -07:00
|
|
|
case X_kbGetKbdByName:
|
2012-06-10 07:21:05 -06:00
|
|
|
return SProcXkbGetKbdByName(client);
|
2006-11-26 11:13:41 -07:00
|
|
|
case X_kbGetDeviceInfo:
|
2012-06-10 07:21:05 -06:00
|
|
|
return SProcXkbGetDeviceInfo(client);
|
2006-11-26 11:13:41 -07:00
|
|
|
case X_kbSetDeviceInfo:
|
2012-06-10 07:21:05 -06:00
|
|
|
return SProcXkbSetDeviceInfo(client);
|
2006-11-26 11:13:41 -07:00
|
|
|
case X_kbSetDebuggingFlags:
|
2012-06-10 07:21:05 -06:00
|
|
|
return SProcXkbSetDebuggingFlags(client);
|
2006-11-26 11:13:41 -07:00
|
|
|
default:
|
2012-06-10 07:21:05 -06:00
|
|
|
return BadRequest;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
}
|