2003-11-14 16:54:54 +01: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
|
2014-10-31 00:45:12 +01:00
|
|
|
documentation, and that the name of Silicon Graphics not be
|
|
|
|
used in advertising or publicity pertaining to distribution
|
2003-11-14 16:54:54 +01:00
|
|
|
of the software without specific prior written permission.
|
2014-10-31 00:45:12 +01:00
|
|
|
Silicon Graphics makes no representation about the suitability
|
2003-11-14 16:54:54 +01:00
|
|
|
of this software for any purpose. It is provided "as is"
|
|
|
|
without any express or implied warranty.
|
|
|
|
|
2014-10-31 00:45:12 +01:00
|
|
|
SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
|
|
|
|
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
2003-11-14 16:54:54 +01:00
|
|
|
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
|
2014-10-31 00:45:12 +01: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
|
2003-11-14 16:54:54 +01:00
|
|
|
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
|
|
|
|
THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
|
|
|
|
********************************************************/
|
|
|
|
|
2005-07-03 09:02:09 +02:00
|
|
|
#ifdef HAVE_DIX_CONFIG_H
|
|
|
|
#include <dix-config.h>
|
|
|
|
#endif
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
#include "stdio.h"
|
2005-04-20 14:25:48 +02:00
|
|
|
#include <X11/X.h>
|
|
|
|
#include <X11/Xproto.h>
|
2005-07-03 10:53:54 +02:00
|
|
|
#include "misc.h"
|
2003-11-14 16:54:54 +01:00
|
|
|
#include "inputstr.h"
|
2007-03-18 21:31:19 +01:00
|
|
|
#include <xkbsrv.h>
|
2008-02-03 13:12:15 +01:00
|
|
|
#include "xkbstr.h"
|
2003-11-14 16:54:54 +01:00
|
|
|
#include "extnsionst.h"
|
2003-11-25 20:29:01 +01:00
|
|
|
#include "xkb.h"
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
/*
|
|
|
|
* REQUEST SWAPPING
|
|
|
|
*/
|
2003-11-14 16:54:54 +01:00
|
|
|
static int
|
|
|
|
SProcXkbUseExtension(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbUseExtensionReq);
|
|
|
|
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->length);
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST_SIZE_MATCH(xkbUseExtensionReq);
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->wantedMajor);
|
|
|
|
swaps(&stuff->wantedMinor);
|
2003-11-14 16:54:54 +01:00
|
|
|
return ProcXkbUseExtension(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbSelectEvents(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbSelectEventsReq);
|
|
|
|
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->length);
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST_AT_LEAST_SIZE(xkbSelectEventsReq);
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swaps(&stuff->affectWhich);
|
|
|
|
swaps(&stuff->clear);
|
|
|
|
swaps(&stuff->selectAll);
|
|
|
|
swaps(&stuff->affectMap);
|
|
|
|
swaps(&stuff->map);
|
2012-03-21 20:55:09 +01:00
|
|
|
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;
|
|
|
|
}
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
return ProcXkbSelectEvents(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbBell(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbBellReq);
|
|
|
|
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->length);
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST_SIZE_MATCH(xkbBellReq);
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swaps(&stuff->bellClass);
|
|
|
|
swaps(&stuff->bellID);
|
|
|
|
swapl(&stuff->name);
|
|
|
|
swapl(&stuff->window);
|
|
|
|
swaps(&stuff->pitch);
|
|
|
|
swaps(&stuff->duration);
|
2003-11-14 16:54:54 +01:00
|
|
|
return ProcXkbBell(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbGetState(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbGetStateReq);
|
|
|
|
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->length);
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST_SIZE_MATCH(xkbGetStateReq);
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->deviceSpec);
|
2003-11-14 16:54:54 +01:00
|
|
|
return ProcXkbGetState(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbLatchLockState(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbLatchLockStateReq);
|
|
|
|
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->length);
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST_SIZE_MATCH(xkbLatchLockStateReq);
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swaps(&stuff->groupLatch);
|
2003-11-14 16:54:54 +01:00
|
|
|
return ProcXkbLatchLockState(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbGetControls(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbGetControlsReq);
|
|
|
|
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->length);
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST_SIZE_MATCH(xkbGetControlsReq);
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->deviceSpec);
|
2003-11-14 16:54:54 +01:00
|
|
|
return ProcXkbGetControls(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbSetControls(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbSetControlsReq);
|
|
|
|
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->length);
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST_SIZE_MATCH(xkbSetControlsReq);
|
2011-08-04 21:35:41 +02: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);
|
2003-11-14 16:54:54 +01:00
|
|
|
return ProcXkbSetControls(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbGetMap(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbGetMapReq);
|
|
|
|
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->length);
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST_SIZE_MATCH(xkbGetMapReq);
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swaps(&stuff->full);
|
|
|
|
swaps(&stuff->partial);
|
|
|
|
swaps(&stuff->virtualMods);
|
2003-11-14 16:54:54 +01:00
|
|
|
return ProcXkbGetMap(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbSetMap(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbSetMapReq);
|
|
|
|
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->length);
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST_AT_LEAST_SIZE(xkbSetMapReq);
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swaps(&stuff->present);
|
|
|
|
swaps(&stuff->flags);
|
|
|
|
swaps(&stuff->totalSyms);
|
|
|
|
swaps(&stuff->totalActs);
|
|
|
|
swaps(&stuff->virtualMods);
|
2003-11-14 16:54:54 +01:00
|
|
|
return ProcXkbSetMap(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbGetCompatMap(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbGetCompatMapReq);
|
|
|
|
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->length);
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST_SIZE_MATCH(xkbGetCompatMapReq);
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swaps(&stuff->firstSI);
|
|
|
|
swaps(&stuff->nSI);
|
2003-11-14 16:54:54 +01:00
|
|
|
return ProcXkbGetCompatMap(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbSetCompatMap(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbSetCompatMapReq);
|
|
|
|
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->length);
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST_AT_LEAST_SIZE(xkbSetCompatMapReq);
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swaps(&stuff->firstSI);
|
|
|
|
swaps(&stuff->nSI);
|
2003-11-14 16:54:54 +01:00
|
|
|
return ProcXkbSetCompatMap(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbGetIndicatorState(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbGetIndicatorStateReq);
|
|
|
|
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->length);
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST_SIZE_MATCH(xkbGetIndicatorStateReq);
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->deviceSpec);
|
2003-11-14 16:54:54 +01:00
|
|
|
return ProcXkbGetIndicatorState(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbGetIndicatorMap(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbGetIndicatorMapReq);
|
|
|
|
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->length);
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST_SIZE_MATCH(xkbGetIndicatorMapReq);
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swapl(&stuff->which);
|
2003-11-14 16:54:54 +01:00
|
|
|
return ProcXkbGetIndicatorMap(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbSetIndicatorMap(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbSetIndicatorMapReq);
|
|
|
|
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->length);
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST_AT_LEAST_SIZE(xkbSetIndicatorMapReq);
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swapl(&stuff->which);
|
2003-11-14 16:54:54 +01:00
|
|
|
return ProcXkbSetIndicatorMap(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbGetNamedIndicator(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbGetNamedIndicatorReq);
|
|
|
|
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->length);
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST_SIZE_MATCH(xkbGetNamedIndicatorReq);
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swaps(&stuff->ledClass);
|
|
|
|
swaps(&stuff->ledID);
|
|
|
|
swapl(&stuff->indicator);
|
2003-11-14 16:54:54 +01:00
|
|
|
return ProcXkbGetNamedIndicator(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbSetNamedIndicator(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbSetNamedIndicatorReq);
|
|
|
|
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->length);
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST_SIZE_MATCH(xkbSetNamedIndicatorReq);
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swaps(&stuff->ledClass);
|
|
|
|
swaps(&stuff->ledID);
|
|
|
|
swapl(&stuff->indicator);
|
|
|
|
swaps(&stuff->virtualMods);
|
|
|
|
swapl(&stuff->ctrls);
|
2003-11-14 16:54:54 +01:00
|
|
|
return ProcXkbSetNamedIndicator(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbGetNames(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbGetNamesReq);
|
|
|
|
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->length);
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST_SIZE_MATCH(xkbGetNamesReq);
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swapl(&stuff->which);
|
2003-11-14 16:54:54 +01:00
|
|
|
return ProcXkbGetNames(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbSetNames(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbSetNamesReq);
|
|
|
|
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->length);
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST_AT_LEAST_SIZE(xkbSetNamesReq);
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swaps(&stuff->virtualMods);
|
|
|
|
swapl(&stuff->which);
|
|
|
|
swapl(&stuff->indicators);
|
|
|
|
swaps(&stuff->totalKTLevelNames);
|
2003-11-14 16:54:54 +01:00
|
|
|
return ProcXkbSetNames(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbGetGeometry(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbGetGeometryReq);
|
|
|
|
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->length);
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST_SIZE_MATCH(xkbGetGeometryReq);
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swapl(&stuff->name);
|
2003-11-14 16:54:54 +01:00
|
|
|
return ProcXkbGetGeometry(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbSetGeometry(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbSetGeometryReq);
|
|
|
|
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->length);
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST_AT_LEAST_SIZE(xkbSetGeometryReq);
|
2011-08-04 21:35:41 +02: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);
|
2003-11-14 16:54:54 +01:00
|
|
|
return ProcXkbSetGeometry(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbPerClientFlags(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbPerClientFlagsReq);
|
|
|
|
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->length);
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST_SIZE_MATCH(xkbPerClientFlagsReq);
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swapl(&stuff->change);
|
|
|
|
swapl(&stuff->value);
|
|
|
|
swapl(&stuff->ctrlsToChange);
|
|
|
|
swapl(&stuff->autoCtrls);
|
|
|
|
swapl(&stuff->autoCtrlValues);
|
2003-11-14 16:54:54 +01:00
|
|
|
return ProcXkbPerClientFlags(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbListComponents(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbListComponentsReq);
|
|
|
|
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->length);
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST_AT_LEAST_SIZE(xkbListComponentsReq);
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swaps(&stuff->maxNames);
|
2003-11-14 16:54:54 +01:00
|
|
|
return ProcXkbListComponents(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbGetKbdByName(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbGetKbdByNameReq);
|
|
|
|
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->length);
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST_AT_LEAST_SIZE(xkbGetKbdByNameReq);
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swaps(&stuff->want);
|
|
|
|
swaps(&stuff->need);
|
2003-11-14 16:54:54 +01:00
|
|
|
return ProcXkbGetKbdByName(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbGetDeviceInfo(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbGetDeviceInfoReq);
|
|
|
|
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->length);
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST_SIZE_MATCH(xkbGetDeviceInfoReq);
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swaps(&stuff->wanted);
|
|
|
|
swaps(&stuff->ledClass);
|
|
|
|
swaps(&stuff->ledID);
|
2003-11-14 16:54:54 +01:00
|
|
|
return ProcXkbGetDeviceInfo(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbSetDeviceInfo(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbSetDeviceInfoReq);
|
|
|
|
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->length);
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST_AT_LEAST_SIZE(xkbSetDeviceInfoReq);
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->deviceSpec);
|
|
|
|
swaps(&stuff->change);
|
|
|
|
swaps(&stuff->nDeviceLedFBs);
|
2003-11-14 16:54:54 +01:00
|
|
|
return ProcXkbSetDeviceInfo(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
SProcXkbSetDebuggingFlags(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xkbSetDebuggingFlagsReq);
|
|
|
|
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->length);
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST_AT_LEAST_SIZE(xkbSetDebuggingFlagsReq);
|
2011-08-04 21:35:41 +02:00
|
|
|
swapl(&stuff->affectFlags);
|
|
|
|
swapl(&stuff->flags);
|
|
|
|
swapl(&stuff->affectCtrls);
|
|
|
|
swapl(&stuff->ctrls);
|
|
|
|
swaps(&stuff->msgLength);
|
2003-11-14 16:54:54 +01:00
|
|
|
return ProcXkbSetDebuggingFlags(client);
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
int
|
2012-03-21 20:55:09 +01:00
|
|
|
SProcXkbDispatch(ClientPtr client)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
REQUEST(xReq);
|
2012-03-21 20:55:09 +01:00
|
|
|
switch (stuff->data) {
|
2003-11-14 16:54:54 +01:00
|
|
|
case X_kbUseExtension:
|
2012-03-21 20:55:09 +01:00
|
|
|
return SProcXkbUseExtension(client);
|
2003-11-14 16:54:54 +01:00
|
|
|
case X_kbSelectEvents:
|
2012-03-21 20:55:09 +01:00
|
|
|
return SProcXkbSelectEvents(client);
|
2003-11-14 16:54:54 +01:00
|
|
|
case X_kbBell:
|
2012-03-21 20:55:09 +01:00
|
|
|
return SProcXkbBell(client);
|
2003-11-14 16:54:54 +01:00
|
|
|
case X_kbGetState:
|
2012-03-21 20:55:09 +01:00
|
|
|
return SProcXkbGetState(client);
|
2003-11-14 16:54:54 +01:00
|
|
|
case X_kbLatchLockState:
|
2012-03-21 20:55:09 +01:00
|
|
|
return SProcXkbLatchLockState(client);
|
2003-11-14 16:54:54 +01:00
|
|
|
case X_kbGetControls:
|
2012-03-21 20:55:09 +01:00
|
|
|
return SProcXkbGetControls(client);
|
2003-11-14 16:54:54 +01:00
|
|
|
case X_kbSetControls:
|
2012-03-21 20:55:09 +01:00
|
|
|
return SProcXkbSetControls(client);
|
2003-11-14 16:54:54 +01:00
|
|
|
case X_kbGetMap:
|
2012-03-21 20:55:09 +01:00
|
|
|
return SProcXkbGetMap(client);
|
2003-11-14 16:54:54 +01:00
|
|
|
case X_kbSetMap:
|
2012-03-21 20:55:09 +01:00
|
|
|
return SProcXkbSetMap(client);
|
2003-11-14 16:54:54 +01:00
|
|
|
case X_kbGetCompatMap:
|
2012-03-21 20:55:09 +01:00
|
|
|
return SProcXkbGetCompatMap(client);
|
2003-11-14 16:54:54 +01:00
|
|
|
case X_kbSetCompatMap:
|
2012-03-21 20:55:09 +01:00
|
|
|
return SProcXkbSetCompatMap(client);
|
2003-11-14 16:54:54 +01:00
|
|
|
case X_kbGetIndicatorState:
|
2012-03-21 20:55:09 +01:00
|
|
|
return SProcXkbGetIndicatorState(client);
|
2003-11-14 16:54:54 +01:00
|
|
|
case X_kbGetIndicatorMap:
|
2012-03-21 20:55:09 +01:00
|
|
|
return SProcXkbGetIndicatorMap(client);
|
2003-11-14 16:54:54 +01:00
|
|
|
case X_kbSetIndicatorMap:
|
2012-03-21 20:55:09 +01:00
|
|
|
return SProcXkbSetIndicatorMap(client);
|
2003-11-14 16:54:54 +01:00
|
|
|
case X_kbGetNamedIndicator:
|
2012-03-21 20:55:09 +01:00
|
|
|
return SProcXkbGetNamedIndicator(client);
|
2003-11-14 16:54:54 +01:00
|
|
|
case X_kbSetNamedIndicator:
|
2012-03-21 20:55:09 +01:00
|
|
|
return SProcXkbSetNamedIndicator(client);
|
2003-11-14 16:54:54 +01:00
|
|
|
case X_kbGetNames:
|
2012-03-21 20:55:09 +01:00
|
|
|
return SProcXkbGetNames(client);
|
2003-11-14 16:54:54 +01:00
|
|
|
case X_kbSetNames:
|
2012-03-21 20:55:09 +01:00
|
|
|
return SProcXkbSetNames(client);
|
2003-11-14 16:54:54 +01:00
|
|
|
case X_kbGetGeometry:
|
2012-03-21 20:55:09 +01:00
|
|
|
return SProcXkbGetGeometry(client);
|
2003-11-14 16:54:54 +01:00
|
|
|
case X_kbSetGeometry:
|
2012-03-21 20:55:09 +01:00
|
|
|
return SProcXkbSetGeometry(client);
|
2003-11-14 16:54:54 +01:00
|
|
|
case X_kbPerClientFlags:
|
2012-03-21 20:55:09 +01:00
|
|
|
return SProcXkbPerClientFlags(client);
|
2003-11-14 16:54:54 +01:00
|
|
|
case X_kbListComponents:
|
2012-03-21 20:55:09 +01:00
|
|
|
return SProcXkbListComponents(client);
|
2003-11-14 16:54:54 +01:00
|
|
|
case X_kbGetKbdByName:
|
2012-03-21 20:55:09 +01:00
|
|
|
return SProcXkbGetKbdByName(client);
|
2003-11-14 16:54:54 +01:00
|
|
|
case X_kbGetDeviceInfo:
|
2012-03-21 20:55:09 +01:00
|
|
|
return SProcXkbGetDeviceInfo(client);
|
2003-11-14 16:54:54 +01:00
|
|
|
case X_kbSetDeviceInfo:
|
2012-03-21 20:55:09 +01:00
|
|
|
return SProcXkbSetDeviceInfo(client);
|
2003-11-14 16:54:54 +01:00
|
|
|
case X_kbSetDebuggingFlags:
|
2012-03-21 20:55:09 +01:00
|
|
|
return SProcXkbSetDebuggingFlags(client);
|
2003-11-14 16:54:54 +01:00
|
|
|
default:
|
2012-03-21 20:55:09 +01:00
|
|
|
return BadRequest;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
}
|