1706f2543Smrg/************************************************************ 2706f2543SmrgCopyright (c) 1993 by Silicon Graphics Computer Systems, Inc. 3706f2543Smrg 4706f2543SmrgPermission to use, copy, modify, and distribute this 5706f2543Smrgsoftware and its documentation for any purpose and without 6706f2543Smrgfee is hereby granted, provided that the above copyright 7706f2543Smrgnotice appear in all copies and that both that copyright 8706f2543Smrgnotice and this permission notice appear in supporting 9706f2543Smrgdocumentation, and that the name of Silicon Graphics not be 10706f2543Smrgused in advertising or publicity pertaining to distribution 11706f2543Smrgof the software without specific prior written permission. 12706f2543SmrgSilicon Graphics makes no representation about the suitability 13706f2543Smrgof this software for any purpose. It is provided "as is" 14706f2543Smrgwithout any express or implied warranty. 15706f2543Smrg 16706f2543SmrgSILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS 17706f2543SmrgSOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 18706f2543SmrgAND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON 19706f2543SmrgGRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL 20706f2543SmrgDAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 21706f2543SmrgDATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 22706f2543SmrgOR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH 23706f2543SmrgTHE USE OR PERFORMANCE OF THIS SOFTWARE. 24706f2543Smrg 25706f2543Smrg********************************************************/ 26706f2543Smrg 27706f2543Smrg#ifdef HAVE_DIX_CONFIG_H 28706f2543Smrg#include <dix-config.h> 29706f2543Smrg#endif 30706f2543Smrg 31706f2543Smrg#include "stdio.h" 32706f2543Smrg#include <X11/X.h> 33706f2543Smrg#include <X11/Xproto.h> 34706f2543Smrg#include "misc.h" 35706f2543Smrg#include "inputstr.h" 36706f2543Smrg#include <xkbsrv.h> 37706f2543Smrg#include "xkbstr.h" 38706f2543Smrg#include "extnsionst.h" 39706f2543Smrg#include "xkb.h" 40706f2543Smrg 41706f2543Smrg /* 42706f2543Smrg * REQUEST SWAPPING 43706f2543Smrg */ 44706f2543Smrgstatic int 45706f2543SmrgSProcXkbUseExtension(ClientPtr client) 46706f2543Smrg{ 47706f2543Smrgregister int n; 48706f2543Smrg 49706f2543Smrg REQUEST(xkbUseExtensionReq); 50706f2543Smrg 51706f2543Smrg swaps(&stuff->length,n); 52706f2543Smrg REQUEST_SIZE_MATCH(xkbUseExtensionReq); 53706f2543Smrg swaps(&stuff->wantedMajor,n); 54706f2543Smrg swaps(&stuff->wantedMinor,n); 55706f2543Smrg return ProcXkbUseExtension(client); 56706f2543Smrg} 57706f2543Smrg 58706f2543Smrgstatic int 59706f2543SmrgSProcXkbSelectEvents(ClientPtr client) 60706f2543Smrg{ 61706f2543Smrgregister int n; 62706f2543Smrg 63706f2543Smrg REQUEST(xkbSelectEventsReq); 64706f2543Smrg 65706f2543Smrg swaps(&stuff->length,n); 66706f2543Smrg REQUEST_AT_LEAST_SIZE(xkbSelectEventsReq); 67706f2543Smrg swaps(&stuff->deviceSpec,n); 68706f2543Smrg swaps(&stuff->affectWhich,n); 69706f2543Smrg swaps(&stuff->clear,n); 70706f2543Smrg swaps(&stuff->selectAll,n); 71706f2543Smrg swaps(&stuff->affectMap,n); 72706f2543Smrg swaps(&stuff->map,n); 73706f2543Smrg if ((stuff->affectWhich&(~XkbMapNotifyMask))!=0) { 74706f2543Smrg union { 75706f2543Smrg BOOL *b; 76706f2543Smrg CARD8 *c8; 77706f2543Smrg CARD16 *c16; 78706f2543Smrg CARD32 *c32; 79706f2543Smrg } from; 80706f2543Smrg register unsigned bit,ndx,maskLeft,dataLeft,size; 81706f2543Smrg 82706f2543Smrg from.c8= (CARD8 *)&stuff[1]; 83706f2543Smrg dataLeft= (stuff->length*4)-SIZEOF(xkbSelectEventsReq); 84706f2543Smrg maskLeft= (stuff->affectWhich&(~XkbMapNotifyMask)); 85706f2543Smrg for (ndx=0,bit=1; (maskLeft!=0); ndx++, bit<<=1) { 86706f2543Smrg if (((bit&maskLeft)==0)||(ndx==XkbMapNotify)) 87706f2543Smrg continue; 88706f2543Smrg maskLeft&= ~bit; 89706f2543Smrg if ((stuff->selectAll&bit)||(stuff->clear&bit)) 90706f2543Smrg continue; 91706f2543Smrg switch (ndx) { 92706f2543Smrg case XkbNewKeyboardNotify: 93706f2543Smrg case XkbStateNotify: 94706f2543Smrg case XkbNamesNotify: 95706f2543Smrg case XkbAccessXNotify: 96706f2543Smrg case XkbExtensionDeviceNotify: 97706f2543Smrg size= 2; 98706f2543Smrg break; 99706f2543Smrg case XkbControlsNotify: 100706f2543Smrg case XkbIndicatorStateNotify: 101706f2543Smrg case XkbIndicatorMapNotify: 102706f2543Smrg size= 4; 103706f2543Smrg break; 104706f2543Smrg case XkbBellNotify: 105706f2543Smrg case XkbActionMessage: 106706f2543Smrg case XkbCompatMapNotify: 107706f2543Smrg size= 1; 108706f2543Smrg break; 109706f2543Smrg default: 110706f2543Smrg client->errorValue = _XkbErrCode2(0x1,bit); 111706f2543Smrg return BadValue; 112706f2543Smrg } 113706f2543Smrg if (dataLeft<(size*2)) 114706f2543Smrg return BadLength; 115706f2543Smrg if (size==2) { 116706f2543Smrg swaps(&from.c16[0],n); 117706f2543Smrg swaps(&from.c16[1],n); 118706f2543Smrg } 119706f2543Smrg else if (size==4) { 120706f2543Smrg swapl(&from.c32[0],n); 121706f2543Smrg swapl(&from.c32[1],n); 122706f2543Smrg } 123706f2543Smrg else { 124706f2543Smrg size= 2; 125706f2543Smrg } 126706f2543Smrg from.c8+= (size*2); 127706f2543Smrg dataLeft-= (size*2); 128706f2543Smrg } 129706f2543Smrg if (dataLeft>2) { 130706f2543Smrg ErrorF("[xkb] Extra data (%d bytes) after SelectEvents\n",dataLeft); 131706f2543Smrg return BadLength; 132706f2543Smrg } 133706f2543Smrg } 134706f2543Smrg return ProcXkbSelectEvents(client); 135706f2543Smrg} 136706f2543Smrg 137706f2543Smrgstatic int 138706f2543SmrgSProcXkbBell(ClientPtr client) 139706f2543Smrg{ 140706f2543Smrgregister int n; 141706f2543Smrg 142706f2543Smrg REQUEST(xkbBellReq); 143706f2543Smrg 144706f2543Smrg swaps(&stuff->length,n); 145706f2543Smrg REQUEST_SIZE_MATCH(xkbBellReq); 146706f2543Smrg swaps(&stuff->deviceSpec,n); 147706f2543Smrg swaps(&stuff->bellClass,n); 148706f2543Smrg swaps(&stuff->bellID,n); 149706f2543Smrg swapl(&stuff->name,n); 150706f2543Smrg swapl(&stuff->window,n); 151706f2543Smrg swaps(&stuff->pitch,n); 152706f2543Smrg swaps(&stuff->duration,n); 153706f2543Smrg return ProcXkbBell(client); 154706f2543Smrg} 155706f2543Smrg 156706f2543Smrgstatic int 157706f2543SmrgSProcXkbGetState(ClientPtr client) 158706f2543Smrg{ 159706f2543Smrgregister int n; 160706f2543Smrg 161706f2543Smrg REQUEST(xkbGetStateReq); 162706f2543Smrg 163706f2543Smrg swaps(&stuff->length,n); 164706f2543Smrg REQUEST_SIZE_MATCH(xkbGetStateReq); 165706f2543Smrg swaps(&stuff->deviceSpec,n); 166706f2543Smrg return ProcXkbGetState(client); 167706f2543Smrg} 168706f2543Smrg 169706f2543Smrgstatic int 170706f2543SmrgSProcXkbLatchLockState(ClientPtr client) 171706f2543Smrg{ 172706f2543Smrgregister int n; 173706f2543Smrg 174706f2543Smrg REQUEST(xkbLatchLockStateReq); 175706f2543Smrg 176706f2543Smrg swaps(&stuff->length,n); 177706f2543Smrg REQUEST_SIZE_MATCH(xkbLatchLockStateReq); 178706f2543Smrg swaps(&stuff->deviceSpec,n); 179706f2543Smrg swaps(&stuff->groupLatch,n); 180706f2543Smrg return ProcXkbLatchLockState(client); 181706f2543Smrg} 182706f2543Smrg 183706f2543Smrgstatic int 184706f2543SmrgSProcXkbGetControls(ClientPtr client) 185706f2543Smrg{ 186706f2543Smrgregister int n; 187706f2543Smrg 188706f2543Smrg REQUEST(xkbGetControlsReq); 189706f2543Smrg 190706f2543Smrg swaps(&stuff->length,n); 191706f2543Smrg REQUEST_SIZE_MATCH(xkbGetControlsReq); 192706f2543Smrg swaps(&stuff->deviceSpec,n); 193706f2543Smrg return ProcXkbGetControls(client); 194706f2543Smrg} 195706f2543Smrg 196706f2543Smrgstatic int 197706f2543SmrgSProcXkbSetControls(ClientPtr client) 198706f2543Smrg{ 199706f2543Smrgregister int n; 200706f2543Smrg 201706f2543Smrg REQUEST(xkbSetControlsReq); 202706f2543Smrg 203706f2543Smrg swaps(&stuff->length,n); 204706f2543Smrg REQUEST_SIZE_MATCH(xkbSetControlsReq); 205706f2543Smrg swaps(&stuff->deviceSpec,n); 206706f2543Smrg swaps(&stuff->affectInternalVMods,n); 207706f2543Smrg swaps(&stuff->internalVMods,n); 208706f2543Smrg swaps(&stuff->affectIgnoreLockVMods,n); 209706f2543Smrg swaps(&stuff->ignoreLockVMods,n); 210706f2543Smrg swaps(&stuff->axOptions,n); 211706f2543Smrg swapl(&stuff->affectEnabledCtrls,n); 212706f2543Smrg swapl(&stuff->enabledCtrls,n); 213706f2543Smrg swapl(&stuff->changeCtrls,n); 214706f2543Smrg swaps(&stuff->repeatDelay,n); 215706f2543Smrg swaps(&stuff->repeatInterval,n); 216706f2543Smrg swaps(&stuff->slowKeysDelay,n); 217706f2543Smrg swaps(&stuff->debounceDelay,n); 218706f2543Smrg swaps(&stuff->mkDelay,n); 219706f2543Smrg swaps(&stuff->mkInterval,n); 220706f2543Smrg swaps(&stuff->mkTimeToMax,n); 221706f2543Smrg swaps(&stuff->mkMaxSpeed,n); 222706f2543Smrg swaps(&stuff->mkCurve,n); 223706f2543Smrg swaps(&stuff->axTimeout,n); 224706f2543Smrg swapl(&stuff->axtCtrlsMask,n); 225706f2543Smrg swapl(&stuff->axtCtrlsValues,n); 226706f2543Smrg swaps(&stuff->axtOptsMask,n); 227706f2543Smrg swaps(&stuff->axtOptsValues,n); 228706f2543Smrg return ProcXkbSetControls(client); 229706f2543Smrg} 230706f2543Smrg 231706f2543Smrgstatic int 232706f2543SmrgSProcXkbGetMap(ClientPtr client) 233706f2543Smrg{ 234706f2543Smrgregister int n; 235706f2543Smrg 236706f2543Smrg REQUEST(xkbGetMapReq); 237706f2543Smrg 238706f2543Smrg swaps(&stuff->length,n); 239706f2543Smrg REQUEST_SIZE_MATCH(xkbGetMapReq); 240706f2543Smrg swaps(&stuff->deviceSpec,n); 241706f2543Smrg swaps(&stuff->full,n); 242706f2543Smrg swaps(&stuff->partial,n); 243706f2543Smrg swaps(&stuff->virtualMods,n); 244706f2543Smrg return ProcXkbGetMap(client); 245706f2543Smrg} 246706f2543Smrg 247706f2543Smrgstatic int 248706f2543SmrgSProcXkbSetMap(ClientPtr client) 249706f2543Smrg{ 250706f2543Smrgregister int n; 251706f2543Smrg 252706f2543Smrg REQUEST(xkbSetMapReq); 253706f2543Smrg 254706f2543Smrg swaps(&stuff->length,n); 255706f2543Smrg REQUEST_AT_LEAST_SIZE(xkbSetMapReq); 256706f2543Smrg swaps(&stuff->deviceSpec,n); 257706f2543Smrg swaps(&stuff->present,n); 258706f2543Smrg swaps(&stuff->flags,n); 259706f2543Smrg swaps(&stuff->totalSyms,n); 260706f2543Smrg swaps(&stuff->totalActs,n); 261706f2543Smrg swaps(&stuff->virtualMods,n); 262706f2543Smrg return ProcXkbSetMap(client); 263706f2543Smrg} 264706f2543Smrg 265706f2543Smrg 266706f2543Smrgstatic int 267706f2543SmrgSProcXkbGetCompatMap(ClientPtr client) 268706f2543Smrg{ 269706f2543Smrgregister int n; 270706f2543Smrg 271706f2543Smrg REQUEST(xkbGetCompatMapReq); 272706f2543Smrg 273706f2543Smrg swaps(&stuff->length,n); 274706f2543Smrg REQUEST_SIZE_MATCH(xkbGetCompatMapReq); 275706f2543Smrg swaps(&stuff->deviceSpec,n); 276706f2543Smrg swaps(&stuff->firstSI,n); 277706f2543Smrg swaps(&stuff->nSI,n); 278706f2543Smrg return ProcXkbGetCompatMap(client); 279706f2543Smrg} 280706f2543Smrg 281706f2543Smrgstatic int 282706f2543SmrgSProcXkbSetCompatMap(ClientPtr client) 283706f2543Smrg{ 284706f2543Smrgregister int n; 285706f2543Smrg 286706f2543Smrg REQUEST(xkbSetCompatMapReq); 287706f2543Smrg 288706f2543Smrg swaps(&stuff->length,n); 289706f2543Smrg REQUEST_AT_LEAST_SIZE(xkbSetCompatMapReq); 290706f2543Smrg swaps(&stuff->deviceSpec,n); 291706f2543Smrg swaps(&stuff->firstSI,n); 292706f2543Smrg swaps(&stuff->nSI,n); 293706f2543Smrg return ProcXkbSetCompatMap(client); 294706f2543Smrg} 295706f2543Smrg 296706f2543Smrgstatic int 297706f2543SmrgSProcXkbGetIndicatorState(ClientPtr client) 298706f2543Smrg{ 299706f2543Smrgregister int n; 300706f2543Smrg 301706f2543Smrg REQUEST(xkbGetIndicatorStateReq); 302706f2543Smrg 303706f2543Smrg swaps(&stuff->length,n); 304706f2543Smrg REQUEST_SIZE_MATCH(xkbGetIndicatorStateReq); 305706f2543Smrg swaps(&stuff->deviceSpec,n); 306706f2543Smrg return ProcXkbGetIndicatorState(client); 307706f2543Smrg} 308706f2543Smrg 309706f2543Smrgstatic int 310706f2543SmrgSProcXkbGetIndicatorMap(ClientPtr client) 311706f2543Smrg{ 312706f2543Smrgregister int n; 313706f2543Smrg 314706f2543Smrg REQUEST(xkbGetIndicatorMapReq); 315706f2543Smrg 316706f2543Smrg swaps(&stuff->length,n); 317706f2543Smrg REQUEST_SIZE_MATCH(xkbGetIndicatorMapReq); 318706f2543Smrg swaps(&stuff->deviceSpec,n); 319706f2543Smrg swapl(&stuff->which,n); 320706f2543Smrg return ProcXkbGetIndicatorMap(client); 321706f2543Smrg} 322706f2543Smrg 323706f2543Smrgstatic int 324706f2543SmrgSProcXkbSetIndicatorMap(ClientPtr client) 325706f2543Smrg{ 326706f2543Smrgregister int n; 327706f2543Smrg 328706f2543Smrg REQUEST(xkbSetIndicatorMapReq); 329706f2543Smrg 330706f2543Smrg swaps(&stuff->length,n); 331706f2543Smrg REQUEST_AT_LEAST_SIZE(xkbSetIndicatorMapReq); 332706f2543Smrg swaps(&stuff->deviceSpec,n); 333706f2543Smrg swapl(&stuff->which,n); 334706f2543Smrg return ProcXkbSetIndicatorMap(client); 335706f2543Smrg} 336706f2543Smrg 337706f2543Smrgstatic int 338706f2543SmrgSProcXkbGetNamedIndicator(ClientPtr client) 339706f2543Smrg{ 340706f2543Smrgregister int n; 341706f2543Smrg 342706f2543Smrg REQUEST(xkbGetNamedIndicatorReq); 343706f2543Smrg 344706f2543Smrg swaps(&stuff->length,n); 345706f2543Smrg REQUEST_SIZE_MATCH(xkbGetNamedIndicatorReq); 346706f2543Smrg swaps(&stuff->deviceSpec,n); 347706f2543Smrg swaps(&stuff->ledClass,n); 348706f2543Smrg swaps(&stuff->ledID,n); 349706f2543Smrg swapl(&stuff->indicator,n); 350706f2543Smrg return ProcXkbGetNamedIndicator(client); 351706f2543Smrg} 352706f2543Smrg 353706f2543Smrgstatic int 354706f2543SmrgSProcXkbSetNamedIndicator(ClientPtr client) 355706f2543Smrg{ 356706f2543Smrgregister int n; 357706f2543Smrg 358706f2543Smrg REQUEST(xkbSetNamedIndicatorReq); 359706f2543Smrg 360706f2543Smrg swaps(&stuff->length,n); 361706f2543Smrg REQUEST_SIZE_MATCH(xkbSetNamedIndicatorReq); 362706f2543Smrg swaps(&stuff->deviceSpec,n); 363706f2543Smrg swaps(&stuff->ledClass,n); 364706f2543Smrg swaps(&stuff->ledID,n); 365706f2543Smrg swapl(&stuff->indicator,n); 366706f2543Smrg swaps(&stuff->virtualMods,n); 367706f2543Smrg swapl(&stuff->ctrls,n); 368706f2543Smrg return ProcXkbSetNamedIndicator(client); 369706f2543Smrg} 370706f2543Smrg 371706f2543Smrg 372706f2543Smrgstatic int 373706f2543SmrgSProcXkbGetNames(ClientPtr client) 374706f2543Smrg{ 375706f2543Smrgregister int n; 376706f2543Smrg 377706f2543Smrg REQUEST(xkbGetNamesReq); 378706f2543Smrg 379706f2543Smrg swaps(&stuff->length,n); 380706f2543Smrg REQUEST_SIZE_MATCH(xkbGetNamesReq); 381706f2543Smrg swaps(&stuff->deviceSpec,n); 382706f2543Smrg swapl(&stuff->which,n); 383706f2543Smrg return ProcXkbGetNames(client); 384706f2543Smrg} 385706f2543Smrg 386706f2543Smrgstatic int 387706f2543SmrgSProcXkbSetNames(ClientPtr client) 388706f2543Smrg{ 389706f2543Smrgregister int n; 390706f2543Smrg 391706f2543Smrg REQUEST(xkbSetNamesReq); 392706f2543Smrg 393706f2543Smrg swaps(&stuff->length,n); 394706f2543Smrg REQUEST_AT_LEAST_SIZE(xkbSetNamesReq); 395706f2543Smrg swaps(&stuff->deviceSpec,n); 396706f2543Smrg swaps(&stuff->virtualMods,n); 397706f2543Smrg swapl(&stuff->which,n); 398706f2543Smrg swapl(&stuff->indicators,n); 399706f2543Smrg swaps(&stuff->totalKTLevelNames,n); 400706f2543Smrg return ProcXkbSetNames(client); 401706f2543Smrg} 402706f2543Smrg 403706f2543Smrgstatic int 404706f2543SmrgSProcXkbGetGeometry(ClientPtr client) 405706f2543Smrg{ 406706f2543Smrgregister int n; 407706f2543Smrg 408706f2543Smrg REQUEST(xkbGetGeometryReq); 409706f2543Smrg 410706f2543Smrg swaps(&stuff->length,n); 411706f2543Smrg REQUEST_SIZE_MATCH(xkbGetGeometryReq); 412706f2543Smrg swaps(&stuff->deviceSpec,n); 413706f2543Smrg swapl(&stuff->name,n); 414706f2543Smrg return ProcXkbGetGeometry(client); 415706f2543Smrg} 416706f2543Smrg 417706f2543Smrgstatic int 418706f2543SmrgSProcXkbSetGeometry(ClientPtr client) 419706f2543Smrg{ 420706f2543Smrgregister int n; 421706f2543Smrg 422706f2543Smrg REQUEST(xkbSetGeometryReq); 423706f2543Smrg 424706f2543Smrg swaps(&stuff->length,n); 425706f2543Smrg REQUEST_AT_LEAST_SIZE(xkbSetGeometryReq); 426706f2543Smrg swaps(&stuff->deviceSpec,n); 427706f2543Smrg swapl(&stuff->name,n); 428706f2543Smrg swaps(&stuff->widthMM,n); 429706f2543Smrg swaps(&stuff->heightMM,n); 430706f2543Smrg swaps(&stuff->nProperties,n); 431706f2543Smrg swaps(&stuff->nColors,n); 432706f2543Smrg swaps(&stuff->nDoodads,n); 433706f2543Smrg swaps(&stuff->nKeyAliases,n); 434706f2543Smrg return ProcXkbSetGeometry(client); 435706f2543Smrg} 436706f2543Smrg 437706f2543Smrgstatic int 438706f2543SmrgSProcXkbPerClientFlags(ClientPtr client) 439706f2543Smrg{ 440706f2543Smrgregister int n; 441706f2543Smrg 442706f2543Smrg REQUEST(xkbPerClientFlagsReq); 443706f2543Smrg 444706f2543Smrg swaps(&stuff->length,n); 445706f2543Smrg REQUEST_SIZE_MATCH(xkbPerClientFlagsReq); 446706f2543Smrg swaps(&stuff->deviceSpec,n); 447706f2543Smrg swapl(&stuff->change,n); 448706f2543Smrg swapl(&stuff->value,n); 449706f2543Smrg swapl(&stuff->ctrlsToChange,n); 450706f2543Smrg swapl(&stuff->autoCtrls,n); 451706f2543Smrg swapl(&stuff->autoCtrlValues,n); 452706f2543Smrg return ProcXkbPerClientFlags(client); 453706f2543Smrg} 454706f2543Smrg 455706f2543Smrgstatic int 456706f2543SmrgSProcXkbListComponents(ClientPtr client) 457706f2543Smrg{ 458706f2543Smrgregister int n; 459706f2543Smrg 460706f2543Smrg REQUEST(xkbListComponentsReq); 461706f2543Smrg 462706f2543Smrg swaps(&stuff->length,n); 463706f2543Smrg REQUEST_AT_LEAST_SIZE(xkbListComponentsReq); 464706f2543Smrg swaps(&stuff->deviceSpec,n); 465706f2543Smrg swaps(&stuff->maxNames,n); 466706f2543Smrg return ProcXkbListComponents(client); 467706f2543Smrg} 468706f2543Smrg 469706f2543Smrgstatic int 470706f2543SmrgSProcXkbGetKbdByName(ClientPtr client) 471706f2543Smrg{ 472706f2543Smrgregister int n; 473706f2543Smrg 474706f2543Smrg REQUEST(xkbGetKbdByNameReq); 475706f2543Smrg 476706f2543Smrg swaps(&stuff->length,n); 477706f2543Smrg REQUEST_AT_LEAST_SIZE(xkbGetKbdByNameReq); 478706f2543Smrg swaps(&stuff->deviceSpec,n); 479706f2543Smrg swaps(&stuff->want,n); 480706f2543Smrg swaps(&stuff->need,n); 481706f2543Smrg return ProcXkbGetKbdByName(client); 482706f2543Smrg} 483706f2543Smrg 484706f2543Smrgstatic int 485706f2543SmrgSProcXkbGetDeviceInfo(ClientPtr client) 486706f2543Smrg{ 487706f2543Smrgregister int n; 488706f2543Smrg 489706f2543Smrg REQUEST(xkbGetDeviceInfoReq); 490706f2543Smrg 491706f2543Smrg swaps(&stuff->length,n); 492706f2543Smrg REQUEST_SIZE_MATCH(xkbGetDeviceInfoReq); 493706f2543Smrg swaps(&stuff->deviceSpec,n); 494706f2543Smrg swaps(&stuff->wanted,n); 495706f2543Smrg swaps(&stuff->ledClass,n); 496706f2543Smrg swaps(&stuff->ledID,n); 497706f2543Smrg return ProcXkbGetDeviceInfo(client); 498706f2543Smrg} 499706f2543Smrg 500706f2543Smrgstatic int 501706f2543SmrgSProcXkbSetDeviceInfo(ClientPtr client) 502706f2543Smrg{ 503706f2543Smrgregister int n; 504706f2543Smrg 505706f2543Smrg REQUEST(xkbSetDeviceInfoReq); 506706f2543Smrg 507706f2543Smrg swaps(&stuff->length,n); 508706f2543Smrg REQUEST_AT_LEAST_SIZE(xkbSetDeviceInfoReq); 509706f2543Smrg swaps(&stuff->deviceSpec,n); 510706f2543Smrg swaps(&stuff->change,n); 511706f2543Smrg swaps(&stuff->nDeviceLedFBs,n); 512706f2543Smrg return ProcXkbSetDeviceInfo(client); 513706f2543Smrg} 514706f2543Smrg 515706f2543Smrgstatic int 516706f2543SmrgSProcXkbSetDebuggingFlags(ClientPtr client) 517706f2543Smrg{ 518706f2543Smrgregister int n; 519706f2543Smrg 520706f2543Smrg REQUEST(xkbSetDebuggingFlagsReq); 521706f2543Smrg 522706f2543Smrg swaps(&stuff->length,n); 523706f2543Smrg REQUEST_AT_LEAST_SIZE(xkbSetDebuggingFlagsReq); 524706f2543Smrg swapl(&stuff->affectFlags,n); 525706f2543Smrg swapl(&stuff->flags,n); 526706f2543Smrg swapl(&stuff->affectCtrls,n); 527706f2543Smrg swapl(&stuff->ctrls,n); 528706f2543Smrg swaps(&stuff->msgLength,n); 529706f2543Smrg return ProcXkbSetDebuggingFlags(client); 530706f2543Smrg} 531706f2543Smrg 532706f2543Smrgint 533706f2543SmrgSProcXkbDispatch (ClientPtr client) 534706f2543Smrg{ 535706f2543Smrg REQUEST(xReq); 536706f2543Smrg switch (stuff->data) 537706f2543Smrg { 538706f2543Smrg case X_kbUseExtension: 539706f2543Smrg return SProcXkbUseExtension(client); 540706f2543Smrg case X_kbSelectEvents: 541706f2543Smrg return SProcXkbSelectEvents(client); 542706f2543Smrg case X_kbBell: 543706f2543Smrg return SProcXkbBell(client); 544706f2543Smrg case X_kbGetState: 545706f2543Smrg return SProcXkbGetState(client); 546706f2543Smrg case X_kbLatchLockState: 547706f2543Smrg return SProcXkbLatchLockState(client); 548706f2543Smrg case X_kbGetControls: 549706f2543Smrg return SProcXkbGetControls(client); 550706f2543Smrg case X_kbSetControls: 551706f2543Smrg return SProcXkbSetControls(client); 552706f2543Smrg case X_kbGetMap: 553706f2543Smrg return SProcXkbGetMap(client); 554706f2543Smrg case X_kbSetMap: 555706f2543Smrg return SProcXkbSetMap(client); 556706f2543Smrg case X_kbGetCompatMap: 557706f2543Smrg return SProcXkbGetCompatMap(client); 558706f2543Smrg case X_kbSetCompatMap: 559706f2543Smrg return SProcXkbSetCompatMap(client); 560706f2543Smrg case X_kbGetIndicatorState: 561706f2543Smrg return SProcXkbGetIndicatorState(client); 562706f2543Smrg case X_kbGetIndicatorMap: 563706f2543Smrg return SProcXkbGetIndicatorMap(client); 564706f2543Smrg case X_kbSetIndicatorMap: 565706f2543Smrg return SProcXkbSetIndicatorMap(client); 566706f2543Smrg case X_kbGetNamedIndicator: 567706f2543Smrg return SProcXkbGetNamedIndicator(client); 568706f2543Smrg case X_kbSetNamedIndicator: 569706f2543Smrg return SProcXkbSetNamedIndicator(client); 570706f2543Smrg case X_kbGetNames: 571706f2543Smrg return SProcXkbGetNames(client); 572706f2543Smrg case X_kbSetNames: 573706f2543Smrg return SProcXkbSetNames(client); 574706f2543Smrg case X_kbGetGeometry: 575706f2543Smrg return SProcXkbGetGeometry(client); 576706f2543Smrg case X_kbSetGeometry: 577706f2543Smrg return SProcXkbSetGeometry(client); 578706f2543Smrg case X_kbPerClientFlags: 579706f2543Smrg return SProcXkbPerClientFlags(client); 580706f2543Smrg case X_kbListComponents: 581706f2543Smrg return SProcXkbListComponents(client); 582706f2543Smrg case X_kbGetKbdByName: 583706f2543Smrg return SProcXkbGetKbdByName(client); 584706f2543Smrg case X_kbGetDeviceInfo: 585706f2543Smrg return SProcXkbGetDeviceInfo(client); 586706f2543Smrg case X_kbSetDeviceInfo: 587706f2543Smrg return SProcXkbSetDeviceInfo(client); 588706f2543Smrg case X_kbSetDebuggingFlags: 589706f2543Smrg return SProcXkbSetDebuggingFlags(client); 590706f2543Smrg default: 591706f2543Smrg return BadRequest; 592706f2543Smrg } 593706f2543Smrg} 594