|
version 3.11, 1996/12/23 07:10:10
|
version 3.22, 2003/11/17 22:20:45
|
|
|
|
| /* $XConsortium: xkb.c /main/21 1996/08/31 12:44:16 kaleb $ */ |
/* $Xorg: xkb.c,v 1.3 2000/08/17 19:53:46 cpqbld Exp $ */ |
| /* $XFree86: xc/programs/Xserver/xkb/xkb.c,v 3.10 1996/10/13 11:32:24 dawes Exp $ */ |
|
| /************************************************************ | /************************************************************ |
| Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. | Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. |
| | |
|
|
|
| THE USE OR PERFORMANCE OF THIS SOFTWARE. | THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| | |
| ********************************************************/ | ********************************************************/ |
| |
/* $XFree86: xc/programs/Xserver/xkb/xkb.c,v 3.21 2003/11/06 18:38:16 tsi Exp $ */ |
| | |
| #include <stdio.h> | #include <stdio.h> |
| #include "X.h" | #include "X.h" |
|
|
|
| #define XKBSRV_NEED_FILE_FUNCS | #define XKBSRV_NEED_FILE_FUNCS |
| #include "XKBsrv.h" | #include "XKBsrv.h" |
| #include "extnsionst.h" | #include "extnsionst.h" |
| |
#include "modinit.h" |
| |
#include "xkb.h" |
| | |
| #include "XI.h" | #include "XI.h" |
| | |
|
|
|
| /***====================================================================***/ | /***====================================================================***/ |
| | |
| int | int |
| #if NeedFunctionPrototypes |
|
| ProcXkbUseExtension(ClientPtr client) | ProcXkbUseExtension(ClientPtr client) |
| #else |
|
| ProcXkbUseExtension(client) |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| REQUEST(xkbUseExtensionReq); | REQUEST(xkbUseExtensionReq); |
| xkbUseExtensionReply rep; | xkbUseExtensionReply rep; |
|
|
|
| client->vMinor= stuff->wantedMinor; | client->vMinor= stuff->wantedMinor; |
| } | } |
| else if (xkbDebugFlags&0x1) { | else if (xkbDebugFlags&0x1) { |
| ErrorF("Rejecting client %d (0x%x) (wants %d.%02d, have %d.%02d)\n", |
ErrorF("Rejecting client %d (0x%lx) (wants %d.%02d, have %d.%02d)\n", |
| client->index, client->clientAsMask, |
client->index, |
| |
(long)client->clientAsMask, |
| stuff->wantedMajor,stuff->wantedMinor, | stuff->wantedMajor,stuff->wantedMinor, |
| XkbMajorVersion,XkbMinorVersion); | XkbMajorVersion,XkbMinorVersion); |
| } | } |
|
|
|
| /***====================================================================***/ | /***====================================================================***/ |
| | |
| int | int |
| #if NeedFunctionPrototypes |
|
| ProcXkbSelectEvents(ClientPtr client) | ProcXkbSelectEvents(ClientPtr client) |
| #else |
|
| ProcXkbSelectEvents(client) |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| unsigned legal; | unsigned legal; |
| DeviceIntPtr dev; | DeviceIntPtr dev; |
|
|
|
| client->mapNotifyMask&= ~stuff->affectMap; | client->mapNotifyMask&= ~stuff->affectMap; |
| client->mapNotifyMask|= (stuff->affectMap&stuff->map); | client->mapNotifyMask|= (stuff->affectMap&stuff->map); |
| } | } |
| if (stuff->affectWhich&(~XkbMapNotifyMask)==0) |
if ((stuff->affectWhich&(~XkbMapNotifyMask))==0) |
| return client->noClientException; | return client->noClientException; |
| | |
| masks = XkbFindClientResource((DevicePtr)dev,client); | masks = XkbFindClientResource((DevicePtr)dev,client); |
|
|
|
| /***====================================================================***/ | /***====================================================================***/ |
| | |
| int | int |
| #if NeedFunctionPrototypes |
|
| ProcXkbBell(ClientPtr client) | ProcXkbBell(ClientPtr client) |
| #else |
|
| ProcXkbBell(client) |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| REQUEST(xkbBellReq); | REQUEST(xkbBellReq); |
| DeviceIntPtr dev; | DeviceIntPtr dev; |
|
|
|
| /***====================================================================***/ | /***====================================================================***/ |
| | |
| int | int |
| #if NeedFunctionPrototypes |
|
| ProcXkbGetState(ClientPtr client) | ProcXkbGetState(ClientPtr client) |
| #else |
|
| ProcXkbGetState(client) |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| REQUEST(xkbGetStateReq); | REQUEST(xkbGetStateReq); |
| DeviceIntPtr dev; | DeviceIntPtr dev; |
|
|
|
| /***====================================================================***/ | /***====================================================================***/ |
| | |
| int | int |
| #if NeedFunctionPrototypes |
|
| ProcXkbLatchLockState(ClientPtr client) | ProcXkbLatchLockState(ClientPtr client) |
| #else |
|
| ProcXkbLatchLockState(client) |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| int status; | int status; |
| DeviceIntPtr dev; | DeviceIntPtr dev; |
|
|
|
| /***====================================================================***/ | /***====================================================================***/ |
| | |
| int | int |
| #if NeedFunctionPrototypes |
|
| ProcXkbGetControls(ClientPtr client) | ProcXkbGetControls(ClientPtr client) |
| #else |
|
| ProcXkbGetControls(client) |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| xkbGetControlsReply rep; | xkbGetControlsReply rep; |
| XkbControlsPtr xkb; | XkbControlsPtr xkb; |
|
|
|
| } | } |
| | |
| int | int |
| #if NeedFunctionPrototypes |
|
| ProcXkbSetControls(ClientPtr client) | ProcXkbSetControls(ClientPtr client) |
| #else |
|
| ProcXkbSetControls(client) |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| DeviceIntPtr dev; | DeviceIntPtr dev; |
| XkbSrvInfoPtr xkbi; | XkbSrvInfoPtr xkbi; |
|
|
|
| } | } |
| | |
| int | int |
| #if NeedFunctionPrototypes |
|
| XkbSetRepeatRate(DeviceIntPtr dev,int timeout,int interval,int major,int minor) | XkbSetRepeatRate(DeviceIntPtr dev,int timeout,int interval,int major,int minor) |
| #else |
|
| XkbSetRepeatRate(dev,timeout,interval,major,minor) |
|
| DeviceIntPtr dev; |
|
| int timeout; |
|
| int interval; |
|
| int major; |
|
| int minor; |
|
| #endif |
|
| { | { |
| int changed= 0; | int changed= 0; |
| XkbControlsRec old,*xkb; | XkbControlsRec old,*xkb; |
|
|
|
| } | } |
| | |
| int | int |
| #if NeedFunctionPrototypes |
|
| XkbGetRepeatRate(DeviceIntPtr dev,int *timeout,int *interval) | XkbGetRepeatRate(DeviceIntPtr dev,int *timeout,int *interval) |
| #else |
|
| XkbGetRepeatRate(dev,timeout,interval) |
|
| DeviceIntPtr dev; |
|
| int * timeout; |
|
| int * interval; |
|
| #endif |
|
| { | { |
| XkbControlsPtr xkb; | XkbControlsPtr xkb; |
| | |
|
|
|
| /***====================================================================***/ | /***====================================================================***/ |
| | |
| static int | static int |
| #if NeedFunctionPrototypes |
|
| XkbSizeKeyTypes(XkbDescPtr xkb,xkbGetMapReply *rep) | XkbSizeKeyTypes(XkbDescPtr xkb,xkbGetMapReply *rep) |
| #else |
|
| XkbSizeKeyTypes(xkb,rep) |
|
| XkbDescPtr xkb; |
|
| xkbGetMapReply * rep; |
|
| #endif |
|
| { | { |
| XkbKeyTypeRec *type; | XkbKeyTypeRec *type; |
| unsigned i,len; | unsigned i,len; |
|
|
|
| } | } |
| | |
| static char * | static char * |
| #if NeedFunctionPrototypes |
|
| XkbWriteKeyTypes( XkbDescPtr xkb, | XkbWriteKeyTypes( XkbDescPtr xkb, |
| xkbGetMapReply * rep, | xkbGetMapReply * rep, |
| char * buf, | char * buf, |
| ClientPtr client) | ClientPtr client) |
| #else |
|
| XkbWriteKeyTypes(xkb,rep,buf,client) |
|
| XkbDescPtr xkb; |
|
| xkbGetMapReply * rep; |
|
| char * buf; |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| XkbKeyTypePtr type; | XkbKeyTypePtr type; |
| unsigned i; | unsigned i; |
|
|
|
| } | } |
| | |
| static int | static int |
| #if NeedFunctionPrototypes |
|
| XkbSizeKeySyms(XkbDescPtr xkb,xkbGetMapReply *rep) | XkbSizeKeySyms(XkbDescPtr xkb,xkbGetMapReply *rep) |
| #else |
|
| XkbSizeKeySyms(xkb,rep) |
|
| XkbDescPtr xkb; |
|
| xkbGetMapReply * rep; |
|
| #endif |
|
| { | { |
| XkbSymMapPtr symMap; | XkbSymMapPtr symMap; |
| unsigned i,len; | unsigned i,len; |
|
|
|
| } | } |
| | |
| static int | static int |
| #if NeedFunctionPrototypes |
|
| XkbSizeVirtualMods(XkbDescPtr xkb,xkbGetMapReply *rep) | XkbSizeVirtualMods(XkbDescPtr xkb,xkbGetMapReply *rep) |
| #else |
|
| XkbSizeVirtualMods(xkb,rep) |
|
| XkbDescPtr xkb; |
|
| xkbGetMapReply * rep; |
|
| #endif |
|
| { | { |
| register unsigned i,nMods,bit; | register unsigned i,nMods,bit; |
| | |
|
|
|
| } | } |
| | |
| static char * | static char * |
| #if NeedFunctionPrototypes |
|
| XkbWriteKeySyms(XkbDescPtr xkb,xkbGetMapReply *rep,char *buf,ClientPtr client) | XkbWriteKeySyms(XkbDescPtr xkb,xkbGetMapReply *rep,char *buf,ClientPtr client) |
| #else |
|
| XkbWriteKeySyms(xkb,rep,buf,client) |
|
| XkbDescPtr xkb; |
|
| xkbGetMapReply * rep; |
|
| char * buf; |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| register KeySym * pSym; | register KeySym * pSym; |
| XkbSymMapPtr symMap; | XkbSymMapPtr symMap; |
|
|
|
| } | } |
| | |
| static int | static int |
| #if NeedFunctionPrototypes |
|
| XkbSizeKeyActions(XkbDescPtr xkb,xkbGetMapReply *rep) | XkbSizeKeyActions(XkbDescPtr xkb,xkbGetMapReply *rep) |
| #else |
|
| XkbSizeKeyActions(xkb,rep) |
|
| XkbDescPtr xkb; |
|
| xkbGetMapReply * rep; |
|
| #endif |
|
| { | { |
| unsigned i,len,nActs; | unsigned i,len,nActs; |
| register KeyCode firstKey; | register KeyCode firstKey; |
|
|
|
| } | } |
| | |
| static char * | static char * |
| #if NeedFunctionPrototypes |
|
| XkbWriteKeyActions(XkbDescPtr xkb,xkbGetMapReply *rep,char *buf, | XkbWriteKeyActions(XkbDescPtr xkb,xkbGetMapReply *rep,char *buf, |
| ClientPtr client) | ClientPtr client) |
| #else |
|
| XkbWriteKeyActions(xkb,rep,buf,client) |
|
| XkbDescPtr xkb; |
|
| xkbGetMapReply * rep; |
|
| char * buf; |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| unsigned i; | unsigned i; |
| CARD8 * numDesc; | CARD8 * numDesc; |
|
|
|
| } | } |
| | |
| static int | static int |
| #if NeedFunctionPrototypes |
|
| XkbSizeKeyBehaviors(XkbDescPtr xkb,xkbGetMapReply *rep) | XkbSizeKeyBehaviors(XkbDescPtr xkb,xkbGetMapReply *rep) |
| #else |
|
| XkbSizeKeyBehaviors(xkb,rep) |
|
| XkbDescPtr xkb; |
|
| xkbGetMapReply * rep; |
|
| #endif |
|
| { | { |
| unsigned i,len,nBhvr; | unsigned i,len,nBhvr; |
| XkbBehavior * bhv; | XkbBehavior * bhv; |
|
|
|
| } | } |
| | |
| static char * | static char * |
| #if NeedFunctionPrototypes |
|
| XkbWriteKeyBehaviors(XkbDescPtr xkb,xkbGetMapReply *rep,char *buf, | XkbWriteKeyBehaviors(XkbDescPtr xkb,xkbGetMapReply *rep,char *buf, |
| ClientPtr client) | ClientPtr client) |
| #else |
|
| XkbWriteKeyBehaviors(xkb,rep,buf,client) |
|
| XkbDescRec *xkb; |
|
| xkbGetMapReply *rep; |
|
| char *buf; |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| unsigned i; | unsigned i; |
| xkbBehaviorWireDesc *wire; | xkbBehaviorWireDesc *wire; |
|
|
|
| } | } |
| | |
| static int | static int |
| #if NeedFunctionPrototypes |
|
| XkbSizeExplicit(XkbDescPtr xkb,xkbGetMapReply *rep) | XkbSizeExplicit(XkbDescPtr xkb,xkbGetMapReply *rep) |
| #else |
|
| XkbSizeExplicit(xkb,rep) |
|
| XkbDescPtr xkb; |
|
| xkbGetMapReply * rep; |
|
| #endif |
|
| { | { |
| unsigned i,len,nRtrn; | unsigned i,len,nRtrn; |
| | |
|
|
|
| } | } |
| | |
| static char * | static char * |
| #if NeedFunctionPrototypes |
|
| XkbWriteExplicit(XkbDescPtr xkb,xkbGetMapReply *rep,char *buf,ClientPtr client) | XkbWriteExplicit(XkbDescPtr xkb,xkbGetMapReply *rep,char *buf,ClientPtr client) |
| #else |
|
| XkbWriteExplicit(xkb,rep,buf,client) |
|
| XkbDescPtr xkb; |
|
| xkbGetMapReply *rep; |
|
| char *buf; |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| unsigned i; | unsigned i; |
| char * start; | char * start; |
|
|
|
| } | } |
| | |
| static int | static int |
| #if NeedFunctionPrototypes |
|
| XkbSizeModifierMap(XkbDescPtr xkb,xkbGetMapReply *rep) | XkbSizeModifierMap(XkbDescPtr xkb,xkbGetMapReply *rep) |
| #else |
|
| XkbSizeModifierMap(xkb,rep) |
|
| XkbDescPtr xkb; |
|
| xkbGetMapReply * rep; |
|
| #endif |
|
| { | { |
| unsigned i,len,nRtrn; | unsigned i,len,nRtrn; |
| | |
|
|
|
| } | } |
| | |
| static char * | static char * |
| #if NeedFunctionPrototypes |
|
| XkbWriteModifierMap(XkbDescPtr xkb,xkbGetMapReply *rep,char *buf, | XkbWriteModifierMap(XkbDescPtr xkb,xkbGetMapReply *rep,char *buf, |
| ClientPtr client) | ClientPtr client) |
| #else |
|
| XkbWriteModifierMap(xkb,rep,buf,client) |
|
| XkbDescPtr xkb; |
|
| xkbGetMapReply *rep; |
|
| char *buf; |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| unsigned i; | unsigned i; |
| char * start; | char * start; |
|
|
|
| } | } |
| | |
| static int | static int |
| #if NeedFunctionPrototypes |
|
| XkbSizeVirtualModMap(XkbDescPtr xkb,xkbGetMapReply *rep) | XkbSizeVirtualModMap(XkbDescPtr xkb,xkbGetMapReply *rep) |
| #else |
|
| XkbSizeVirtualModMap(xkb,rep) |
|
| XkbDescPtr xkb; |
|
| xkbGetMapReply * rep; |
|
| #endif |
|
| { | { |
| unsigned i,len,nRtrn; | unsigned i,len,nRtrn; |
| | |
|
|
|
| } | } |
| | |
| static char * | static char * |
| #if NeedFunctionPrototypes |
|
| XkbWriteVirtualModMap(XkbDescPtr xkb,xkbGetMapReply *rep,char *buf, | XkbWriteVirtualModMap(XkbDescPtr xkb,xkbGetMapReply *rep,char *buf, |
| ClientPtr client) | ClientPtr client) |
| #else |
|
| XkbWriteVirtualModMap(xkb,rep,buf,client) |
|
| XkbDescPtr xkb; |
|
| xkbGetMapReply *rep; |
|
| char *buf; |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| unsigned i; | unsigned i; |
| xkbVModMapWireDesc * wire; | xkbVModMapWireDesc * wire; |
|
|
|
| } | } |
| | |
| static Status | static Status |
| #if NeedFunctionPrototypes |
|
| XkbComputeGetMapReplySize(XkbDescPtr xkb,xkbGetMapReply *rep) | XkbComputeGetMapReplySize(XkbDescPtr xkb,xkbGetMapReply *rep) |
| #else |
|
| XkbComputeGetMapReplySize(xkb,rep) |
|
| XkbDescPtr xkb; |
|
| xkbGetMapReply * rep; |
|
| #endif |
|
| { | { |
| int len; | int len; |
| | |
|
|
|
| } | } |
| | |
| static int | static int |
| #if NeedFunctionPrototypes |
|
| XkbSendMap(ClientPtr client,XkbDescPtr xkb,xkbGetMapReply *rep) | XkbSendMap(ClientPtr client,XkbDescPtr xkb,xkbGetMapReply *rep) |
| #else |
|
| XkbSendMap(client,xkb,rep) |
|
| ClientPtr client; |
|
| XkbDescPtr xkb; |
|
| xkbGetMapReply * rep; |
|
| #endif |
|
| { | { |
| unsigned i,len; | unsigned i,len; |
| char *desc,*start; | char *desc,*start; |
|
|
|
| if ( rep->totalVModMapKeys>0 ) | if ( rep->totalVModMapKeys>0 ) |
| desc= XkbWriteVirtualModMap(xkb,rep,desc,client); | desc= XkbWriteVirtualModMap(xkb,rep,desc,client); |
| if ((desc-start)!=(len)) { | if ((desc-start)!=(len)) { |
| ErrorF("BOGUS LENGTH in write keyboard desc, expected %d, got %d\n", |
ErrorF("BOGUS LENGTH in write keyboard desc, expected %d, got %ld\n", |
| len, desc-start); |
len, (unsigned long)(desc-start)); |
| } | } |
| if (client->swapped) { | if (client->swapped) { |
| register int n; | register int n; |
|
|
|
| } | } |
| | |
| int | int |
| #if NeedFunctionPrototypes |
|
| ProcXkbGetMap(ClientPtr client) | ProcXkbGetMap(ClientPtr client) |
| #else |
|
| ProcXkbGetMap(client) |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| DeviceIntPtr dev; | DeviceIntPtr dev; |
| xkbGetMapReply rep; | xkbGetMapReply rep; |
|
|
|
| /***====================================================================***/ | /***====================================================================***/ |
| | |
| static int | static int |
| #if NeedFunctionPrototypes |
|
| CheckKeyTypes( ClientPtr client, | CheckKeyTypes( ClientPtr client, |
| XkbDescPtr xkb, | XkbDescPtr xkb, |
| xkbSetMapReq * req, | xkbSetMapReq * req, |
| xkbKeyTypeWireDesc **wireRtrn, | xkbKeyTypeWireDesc **wireRtrn, |
| int * nMapsRtrn, | int * nMapsRtrn, |
| CARD8 * mapWidthRtrn) | CARD8 * mapWidthRtrn) |
| #else |
|
| CheckKeyTypes(client,xkb,req,wireRtrn,nMapsRtrn,mapWidthRtrn) |
|
| ClientPtr client; |
|
| XkbDescPtr xkb; |
|
| xkbSetMapReq * req; |
|
| xkbKeyTypeWireDesc **wireRtrn; |
|
| int * nMapsRtrn; |
|
| CARD8 * mapWidthRtrn; |
|
| #endif |
|
| { | { |
| unsigned nMaps; | unsigned nMaps; |
| register unsigned i,n; | register unsigned i,n; |
|
|
|
| } | } |
| | |
| static int | static int |
| #if NeedFunctionPrototypes |
|
| CheckKeySyms( ClientPtr client, | CheckKeySyms( ClientPtr client, |
| XkbDescPtr xkb, | XkbDescPtr xkb, |
| xkbSetMapReq * req, | xkbSetMapReq * req, |
|
|
|
| CARD16 * symsPerKey, | CARD16 * symsPerKey, |
| xkbSymMapWireDesc ** wireRtrn, | xkbSymMapWireDesc ** wireRtrn, |
| int * errorRtrn) | int * errorRtrn) |
| #else |
|
| CheckKeySyms(client,xkb,req,nTypes,mapWidths,symsPerKey,wireRtrn,errorRtrn) |
|
| ClientPtr client; |
|
| XkbDescPtr xkb; |
|
| xkbSetMapReq * req; |
|
| int nTypes; |
|
| CARD8 * mapWidths; |
|
| CARD16 * symsPerKey; |
|
| xkbSymMapWireDesc **wireRtrn; |
|
| int * errorRtrn; |
|
| #endif |
|
| { | { |
| register unsigned i; | register unsigned i; |
| XkbSymMapPtr map; | XkbSymMapPtr map; |
|
|
|
| } | } |
| | |
| static int | static int |
| #if NeedFunctionPrototypes |
|
| CheckKeyActions( XkbDescPtr xkb, | CheckKeyActions( XkbDescPtr xkb, |
| xkbSetMapReq * req, | xkbSetMapReq * req, |
| int nTypes, | int nTypes, |
|
|
|
| CARD16 * symsPerKey, | CARD16 * symsPerKey, |
| CARD8 ** wireRtrn, | CARD8 ** wireRtrn, |
| int * nActsRtrn) | int * nActsRtrn) |
| #else |
|
| CheckKeyActions(xkb,req,nTypes,mapWidths,symsPerKey,wireRtrn,nActsRtrn) |
|
| XkbDescRec *xkb; |
|
| xkbSetMapReq *req; |
|
| int nTypes; |
|
| CARD8 *mapWidths; |
|
| CARD16 *symsPerKey; |
|
| CARD8 **wireRtrn; |
|
| int *nActsRtrn; |
|
| #endif |
|
| { | { |
| int nActs; | int nActs; |
| CARD8 * wire = *wireRtrn; | CARD8 * wire = *wireRtrn; |
|
|
|
| } | } |
| | |
| static int | static int |
| #if NeedFunctionPrototypes |
|
| CheckKeyBehaviors( XkbDescPtr xkb, | CheckKeyBehaviors( XkbDescPtr xkb, |
| xkbSetMapReq * req, | xkbSetMapReq * req, |
| xkbBehaviorWireDesc ** wireRtrn, | xkbBehaviorWireDesc ** wireRtrn, |
| int * errorRtrn) | int * errorRtrn) |
| #else |
|
| CheckKeyBehaviors(xkb,req,wireRtrn,errorRtrn) |
|
| XkbDescRec *xkb; |
|
| xkbSetMapReq *req; |
|
| xkbBehaviorWireDesc **wireRtrn; |
|
| int *errorRtrn; |
|
| #endif |
|
| { | { |
| register xkbBehaviorWireDesc * wire = *wireRtrn; | register xkbBehaviorWireDesc * wire = *wireRtrn; |
| register XkbServerMapPtr server = xkb->server; | register XkbServerMapPtr server = xkb->server; |
| register unsigned i; | register unsigned i; |
| unsigned first,last; | unsigned first,last; |
| | |
| if ((req->present&XkbKeyBehaviorsMask==0)||(req->nKeyBehaviors<1)) { |
if (((req->present&XkbKeyBehaviorsMask)==0)||(req->nKeyBehaviors<1)) { |
| req->present&= ~XkbKeyBehaviorsMask; | req->present&= ~XkbKeyBehaviorsMask; |
| req->nKeyBehaviors= 0; | req->nKeyBehaviors= 0; |
| return 1; | return 1; |
|
|
|
| } | } |
| | |
| static int | static int |
| #if NeedFunctionPrototypes |
|
| CheckVirtualMods( XkbDescRec * xkb, | CheckVirtualMods( XkbDescRec * xkb, |
| xkbSetMapReq * req, | xkbSetMapReq * req, |
| CARD8 ** wireRtrn, | CARD8 ** wireRtrn, |
| int * errorRtrn) | int * errorRtrn) |
| #else |
|
| CheckVirtualMods(xkb,req,wireRtrn,errorRtrn) |
|
| XkbDescPtr xkb; |
|
| xkbSetMapReq * req; |
|
| CARD8 ** wireRtrn; |
|
| int * errorRtrn; |
|
| #endif |
|
| { | { |
| register CARD8 *wire = *wireRtrn; | register CARD8 *wire = *wireRtrn; |
| register unsigned i,nMods,bit; | register unsigned i,nMods,bit; |
|
|
|
| } | } |
| | |
| static int | static int |
| #if NeedFunctionPrototypes |
|
| CheckKeyExplicit( XkbDescPtr xkb, | CheckKeyExplicit( XkbDescPtr xkb, |
| xkbSetMapReq * req, | xkbSetMapReq * req, |
| CARD8 ** wireRtrn, | CARD8 ** wireRtrn, |
| int * errorRtrn) | int * errorRtrn) |
| #else |
|
| CheckKeyExplicit(xkb,req,wireRtrn,errorRtrn) |
|
| XkbDescPtr xkb; |
|
| xkbSetMapReq * req; |
|
| CARD8 ** wireRtrn; |
|
| int * errorRtrn; |
|
| #endif |
|
| { | { |
| register CARD8 * wire = *wireRtrn; | register CARD8 * wire = *wireRtrn; |
| CARD8 * start; | CARD8 * start; |
|
|
|
| } | } |
| | |
| static int | static int |
| #if NeedFunctionPrototypes |
|
| CheckModifierMap(XkbDescPtr xkb,xkbSetMapReq *req,CARD8 **wireRtrn,int *errRtrn) | CheckModifierMap(XkbDescPtr xkb,xkbSetMapReq *req,CARD8 **wireRtrn,int *errRtrn) |
| #else |
|
| CheckModifierMap(xkb,req,wireRtrn,errRtrn) |
|
| XkbDescPtr xkb; |
|
| xkbSetMapReq * req; |
|
| CARD8 ** wireRtrn; |
|
| int * errRtrn; |
|
| #endif |
|
| { | { |
| register CARD8 * wire = *wireRtrn; | register CARD8 * wire = *wireRtrn; |
| CARD8 * start; | CARD8 * start; |
|
|
|
| } | } |
| | |
| static int | static int |
| #if NeedFunctionPrototypes |
|
| CheckVirtualModMap( XkbDescPtr xkb, | CheckVirtualModMap( XkbDescPtr xkb, |
| xkbSetMapReq *req, | xkbSetMapReq *req, |
| xkbVModMapWireDesc **wireRtrn, | xkbVModMapWireDesc **wireRtrn, |
| int *errRtrn) | int *errRtrn) |
| #else |
|
| CheckVirtualModMap(xkb,req,wireRtrn,errRtrn) |
|
| XkbDescPtr xkb; |
|
| xkbSetMapReq * req; |
|
| xkbVModMapWireDesc ** wireRtrn; |
|
| int * errRtrn; |
|
| #endif |
|
| { | { |
| register xkbVModMapWireDesc * wire = *wireRtrn; | register xkbVModMapWireDesc * wire = *wireRtrn; |
| register unsigned i; | register unsigned i; |
|
|
|
| } | } |
| | |
| static char * | static char * |
| #if NeedFunctionPrototypes |
|
| SetKeyTypes( XkbDescPtr xkb, | SetKeyTypes( XkbDescPtr xkb, |
| xkbSetMapReq * req, | xkbSetMapReq * req, |
| xkbKeyTypeWireDesc * wire, | xkbKeyTypeWireDesc * wire, |
| XkbChangesPtr changes) | XkbChangesPtr changes) |
| #else |
|
| SetKeyTypes(xkb,req,wire,changes) |
|
| XkbDescPtr xkb; |
|
| xkbSetMapReq * req; |
|
| xkbKeyTypeWireDesc *wire; |
|
| XkbChangesPtr changes; |
|
| #endif |
|
| { | { |
| register unsigned i; | register unsigned i; |
| unsigned first,last; | unsigned first,last; |
|
|
|
| } | } |
| | |
| static char * | static char * |
| #if NeedFunctionPrototypes |
|
| SetKeySyms( ClientPtr client, | SetKeySyms( ClientPtr client, |
| XkbDescPtr xkb, | XkbDescPtr xkb, |
| xkbSetMapReq * req, | xkbSetMapReq * req, |
| xkbSymMapWireDesc * wire, | xkbSymMapWireDesc * wire, |
| XkbChangesPtr changes, | XkbChangesPtr changes, |
| DeviceIntPtr dev) | DeviceIntPtr dev) |
| #else |
|
| SetKeySyms(client,xkb,req,wire,changes,dev) |
|
| ClientPtr client; |
|
| XkbDescPtr xkb; |
|
| xkbSetMapReq * req; |
|
| xkbSymMapWireDesc * wire; |
|
| XkbChangesPtr changes; |
|
| DeviceIntPtr dev; |
|
| #endif |
|
| { | { |
| register unsigned i,s; | register unsigned i,s; |
| XkbSymMapPtr oldMap; | XkbSymMapPtr oldMap; |
|
|
|
| } | } |
| | |
| static char * | static char * |
| #if NeedFunctionPrototypes |
|
| SetKeyActions( XkbDescPtr xkb, | SetKeyActions( XkbDescPtr xkb, |
| xkbSetMapReq * req, | xkbSetMapReq * req, |
| CARD8 * wire, | CARD8 * wire, |
| XkbChangesPtr changes) | XkbChangesPtr changes) |
| #else |
|
| SetKeyActions(xkb,req,wire,changes) |
|
| XkbDescPtr xkb; |
|
| xkbSetMapReq * req; |
|
| CARD8 * wire; |
|
| XkbChangesPtr changes; |
|
| #endif |
|
| { | { |
| register unsigned i,first,last; | register unsigned i,first,last; |
| CARD8 * nActs = wire; | CARD8 * nActs = wire; |
|
|
|
| } | } |
| | |
| static char * | static char * |
| #if NeedFunctionPrototypes |
|
| SetKeyBehaviors( XkbSrvInfoPtr xkbi, | SetKeyBehaviors( XkbSrvInfoPtr xkbi, |
| xkbSetMapReq *req, | xkbSetMapReq *req, |
| xkbBehaviorWireDesc *wire, | xkbBehaviorWireDesc *wire, |
| XkbChangesPtr changes) | XkbChangesPtr changes) |
| #else |
|
| SetKeyBehaviors(xkbi,req,wire,changes) |
|
| XkbSrvInfoPtr xkbi; |
|
| xkbSetMapReq * req; |
|
| xkbBehaviorWireDesc*wire; |
|
| XkbChangesPtr changes; |
|
| #endif |
|
| { | { |
| register unsigned i; | register unsigned i; |
| int maxRG = -1; | int maxRG = -1; |
|
|
|
| server->behaviors[wire->key].type= wire->type; | server->behaviors[wire->key].type= wire->type; |
| server->behaviors[wire->key].data= wire->data; | server->behaviors[wire->key].data= wire->data; |
| if ((wire->type==XkbKB_RadioGroup)&&(((int)wire->data)>maxRG)) | if ((wire->type==XkbKB_RadioGroup)&&(((int)wire->data)>maxRG)) |
| maxRG= wire->data; |
maxRG= wire->data + 1; |
| } | } |
| wire++; | wire++; |
| } | } |
| | |
| if (maxRG>(int)xkbi->nRadioGroups) { | if (maxRG>(int)xkbi->nRadioGroups) { |
| int sz = (maxRG+1)*sizeof(XkbRadioGroupRec); |
int sz = maxRG*sizeof(XkbRadioGroupRec); |
| if (xkbi->radioGroups) | if (xkbi->radioGroups) |
| xkbi->radioGroups=(XkbRadioGroupPtr)_XkbRealloc(xkbi->radioGroups,sz); | xkbi->radioGroups=(XkbRadioGroupPtr)_XkbRealloc(xkbi->radioGroups,sz); |
| else xkbi->radioGroups= (XkbRadioGroupPtr)_XkbCalloc(1, sz); | else xkbi->radioGroups= (XkbRadioGroupPtr)_XkbCalloc(1, sz); |
|
|
|
| if (xkbi->nRadioGroups) | if (xkbi->nRadioGroups) |
| bzero(&xkbi->radioGroups[xkbi->nRadioGroups], | bzero(&xkbi->radioGroups[xkbi->nRadioGroups], |
| (maxRG-xkbi->nRadioGroups)*sizeof(XkbRadioGroupRec)); | (maxRG-xkbi->nRadioGroups)*sizeof(XkbRadioGroupRec)); |
| xkbi->nRadioGroups= maxRG+1; |
xkbi->nRadioGroups= maxRG; |
| } | } |
| else xkbi->nRadioGroups= 0; | else xkbi->nRadioGroups= 0; |
| /* should compute members here */ | /* should compute members here */ |
|
|
|
| } | } |
| | |
| static char * | static char * |
| #if NeedFunctionPrototypes |
|
| SetVirtualMods(XkbSrvInfoPtr xkbi,xkbSetMapReq *req,CARD8 *wire, | SetVirtualMods(XkbSrvInfoPtr xkbi,xkbSetMapReq *req,CARD8 *wire, |
| XkbChangesPtr changes) | XkbChangesPtr changes) |
| #else |
|
| SetVirtualMods(xkbi,req,wire,changes) |
|
| XkbSrvInfoPtr xkbi; |
|
| xkbSetMapReq * req; |
|
| CARD8 * wire; |
|
| XkbChangesPtr changes; |
|
| #endif |
|
| { | { |
| register int i,bit,nMods; | register int i,bit,nMods; |
| XkbServerMapPtr srv = xkbi->desc->server; | XkbServerMapPtr srv = xkbi->desc->server; |
|
|
|
| } | } |
| | |
| static char * | static char * |
| #if NeedFunctionPrototypes |
|
| SetKeyExplicit(XkbSrvInfoPtr xkbi,xkbSetMapReq *req,CARD8 *wire, | SetKeyExplicit(XkbSrvInfoPtr xkbi,xkbSetMapReq *req,CARD8 *wire, |
| XkbChangesPtr changes) | XkbChangesPtr changes) |
| #else |
|
| SetKeyExplicit(xkbi,req,wire,changes) |
|
| XkbSrvInfoPtr xkbi; |
|
| xkbSetMapReq * req; |
|
| CARD8 * wire; |
|
| XkbChangesPtr changes; |
|
| #endif |
|
| { | { |
| register unsigned i,first,last; | register unsigned i,first,last; |
| XkbServerMapPtr xkb = xkbi->desc->server; | XkbServerMapPtr xkb = xkbi->desc->server; |
|
|
|
| } | } |
| | |
| static char * | static char * |
| #if NeedFunctionPrototypes |
|
| SetModifierMap( XkbSrvInfoPtr xkbi, | SetModifierMap( XkbSrvInfoPtr xkbi, |
| xkbSetMapReq * req, | xkbSetMapReq * req, |
| CARD8 * wire, | CARD8 * wire, |
| XkbChangesPtr changes) | XkbChangesPtr changes) |
| #else |
|
| SetModifierMap(xkbi,req,wire,changes) |
|
| XkbSrvInfoPtr xkbi; |
|
| xkbSetMapReq * req; |
|
| CARD8 * wire; |
|
| XkbChangesPtr changes; |
|
| #endif |
|
| { | { |
| register unsigned i,first,last; | register unsigned i,first,last; |
| XkbClientMapPtr xkb = xkbi->desc->map; | XkbClientMapPtr xkb = xkbi->desc->map; |
|
|
|
| } | } |
| | |
| static char * | static char * |
| #if NeedFunctionPrototypes |
|
| SetVirtualModMap( XkbSrvInfoPtr xkbi, | SetVirtualModMap( XkbSrvInfoPtr xkbi, |
| xkbSetMapReq * req, | xkbSetMapReq * req, |
| xkbVModMapWireDesc * wire, | xkbVModMapWireDesc * wire, |
| XkbChangesPtr changes) | XkbChangesPtr changes) |
| #else |
|
| SetVirtualModMap(xkbi,req,wire,changes) |
|
| XkbSrvInfoPtr xkbi; |
|
| xkbSetMapReq * req; |
|
| xkbVModMapWireDesc *wire; |
|
| XkbChangesPtr changes; |
|
| #endif |
|
| { | { |
| register unsigned i,first,last; | register unsigned i,first,last; |
| XkbServerMapPtr srv = xkbi->desc->server; | XkbServerMapPtr srv = xkbi->desc->server; |
|
|
|
| } | } |
| | |
| int | int |
| #if NeedFunctionPrototypes |
|
| ProcXkbSetMap(ClientPtr client) | ProcXkbSetMap(ClientPtr client) |
| #else |
|
| ProcXkbSetMap(client) |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| DeviceIntPtr dev; | DeviceIntPtr dev; |
| XkbSrvInfoPtr xkbi; | XkbSrvInfoPtr xkbi; |
|
|
|
| /***====================================================================***/ | /***====================================================================***/ |
| | |
| static Status | static Status |
| #if NeedFunctionPrototypes |
|
| XkbComputeGetCompatMapReplySize( XkbCompatMapPtr compat, | XkbComputeGetCompatMapReplySize( XkbCompatMapPtr compat, |
| xkbGetCompatMapReply * rep) | xkbGetCompatMapReply * rep) |
| #else |
|
| XkbComputeGetCompatMapReplySize(compat,rep) |
|
| XkbCompatMapPtr compat; |
|
| xkbGetCompatMapReply * rep; |
|
| #endif |
|
| { | { |
| unsigned size,nGroups; | unsigned size,nGroups; |
| | |
|
|
|
| } | } |
| | |
| static int | static int |
| #if NeedFunctionPrototypes |
|
| XkbSendCompatMap( ClientPtr client, | XkbSendCompatMap( ClientPtr client, |
| XkbCompatMapPtr compat, | XkbCompatMapPtr compat, |
| xkbGetCompatMapReply * rep) | xkbGetCompatMapReply * rep) |
| #else |
|
| XkbSendCompatMap(client,compat,rep) |
|
| ClientPtr client; |
|
| XkbCompatMapPtr compat; |
|
| xkbGetCompatMapReply * rep; |
|
| #endif |
|
| { | { |
| char * data; | char * data; |
| int size; | int size; |
|
|
|
| } | } |
| | |
| int | int |
| #if NeedFunctionPrototypes |
|
| ProcXkbGetCompatMap(ClientPtr client) | ProcXkbGetCompatMap(ClientPtr client) |
| #else |
|
| ProcXkbGetCompatMap(client) |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| xkbGetCompatMapReply rep; | xkbGetCompatMapReply rep; |
| DeviceIntPtr dev; | DeviceIntPtr dev; |
|
|
|
| } | } |
| | |
| int | int |
| #if NeedFunctionPrototypes |
|
| ProcXkbSetCompatMap(ClientPtr client) | ProcXkbSetCompatMap(ClientPtr client) |
| #else |
|
| ProcXkbSetCompatMap(client) |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| DeviceIntPtr dev; | DeviceIntPtr dev; |
| XkbSrvInfoPtr xkbi; | XkbSrvInfoPtr xkbi; |
|
|
|
| /***====================================================================***/ | /***====================================================================***/ |
| | |
| int | int |
| #if NeedFunctionPrototypes |
|
| ProcXkbGetIndicatorState(ClientPtr client) | ProcXkbGetIndicatorState(ClientPtr client) |
| #else |
|
| ProcXkbGetIndicatorState(client) |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| xkbGetIndicatorStateReply rep; | xkbGetIndicatorStateReply rep; |
| XkbSrvLedInfoPtr sli; | XkbSrvLedInfoPtr sli; |
|
|
|
| /***====================================================================***/ | /***====================================================================***/ |
| | |
| Status | Status |
| #if NeedFunctionPrototypes |
|
| XkbComputeGetIndicatorMapReplySize( | XkbComputeGetIndicatorMapReplySize( |
| XkbIndicatorPtr indicators, | XkbIndicatorPtr indicators, |
| xkbGetIndicatorMapReply *rep) | xkbGetIndicatorMapReply *rep) |
| #else |
|
| XkbComputeGetIndicatorMapReplySize(indicators,rep) |
|
| XkbIndicatorPtr indicators; |
|
| xkbGetIndicatorMapReply *rep; |
|
| #endif |
|
| { | { |
| register int i,bit; | register int i,bit; |
| int nIndicators; | int nIndicators; |
|
|
|
| } | } |
| | |
| int | int |
| #if NeedFunctionPrototypes |
|
| XkbSendIndicatorMap( ClientPtr client, | XkbSendIndicatorMap( ClientPtr client, |
| XkbIndicatorPtr indicators, | XkbIndicatorPtr indicators, |
| xkbGetIndicatorMapReply * rep) | xkbGetIndicatorMapReply * rep) |
| #else |
|
| XkbSendIndicatorMap(client,indicators,rep) |
|
| ClientPtr client; |
|
| XkbIndicatorPtr indicators; |
|
| xkbGetIndicatorMapReply * rep; |
|
| #endif |
|
| { | { |
| int length; | int length; |
| CARD8 * map; | CARD8 * map; |
|
|
|
| } | } |
| | |
| int | int |
| #if NeedFunctionPrototypes |
|
| ProcXkbGetIndicatorMap(ClientPtr client) | ProcXkbGetIndicatorMap(ClientPtr client) |
| #else |
|
| ProcXkbGetIndicatorMap(client) |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| xkbGetIndicatorMapReply rep; | xkbGetIndicatorMapReply rep; |
| DeviceIntPtr dev; | DeviceIntPtr dev; |
|
|
|
| } | } |
| | |
| int | int |
| #if NeedFunctionPrototypes |
|
| ProcXkbSetIndicatorMap(ClientPtr client) | ProcXkbSetIndicatorMap(ClientPtr client) |
| #else |
|
| ProcXkbSetIndicatorMap(client) |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| register int i,bit; | register int i,bit; |
| int nIndicators,why; | int nIndicators,why; |
|
|
|
| /***====================================================================***/ | /***====================================================================***/ |
| | |
| int | int |
| #if NeedFunctionPrototypes |
|
| ProcXkbGetNamedIndicator(ClientPtr client) | ProcXkbGetNamedIndicator(ClientPtr client) |
| #else |
|
| ProcXkbGetNamedIndicator(client) |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| DeviceIntPtr dev; | DeviceIntPtr dev; |
| xkbGetNamedIndicatorReply rep; | xkbGetNamedIndicatorReply rep; |
| register int i; |
register int i = 0; |
| XkbSrvLedInfoPtr sli; | XkbSrvLedInfoPtr sli; |
| XkbIndicatorMapPtr map; |
XkbIndicatorMapPtr map = NULL; |
| Bool supported; | Bool supported; |
| | |
| REQUEST(xkbGetNamedIndicatorReq); | REQUEST(xkbGetNamedIndicatorReq); |
|
|
|
| } | } |
| | |
| int | int |
| #if NeedFunctionPrototypes |
|
| ProcXkbSetNamedIndicator(ClientPtr client) | ProcXkbSetNamedIndicator(ClientPtr client) |
| #else |
|
| ProcXkbSetNamedIndicator(client) |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| DeviceIntPtr dev,kbd; | DeviceIntPtr dev,kbd; |
| XkbIndicatorMapPtr map; | XkbIndicatorMapPtr map; |
| XkbSrvLedInfoPtr sli; | XkbSrvLedInfoPtr sli; |
| register int led; |
register int led = 0; |
| unsigned extDevReason; | unsigned extDevReason; |
| unsigned statec,namec,mapc; | unsigned statec,namec,mapc; |
| XkbEventCauseRec cause; | XkbEventCauseRec cause; |
|
|
|
| /***====================================================================***/ | /***====================================================================***/ |
| | |
| static CARD32 | static CARD32 |
| #if NeedFunctionPrototypes |
|
| _XkbCountAtoms(Atom *atoms,int maxAtoms,int *count) | _XkbCountAtoms(Atom *atoms,int maxAtoms,int *count) |
| #else |
|
| _XkbCountAtoms(atoms,maxAtoms,count) |
|
| Atom *atoms; |
|
| int maxAtoms; |
|
| int *count; |
|
| #endif |
|
| { | { |
| register unsigned int i,bit,nAtoms; | register unsigned int i,bit,nAtoms; |
| register CARD32 atomsPresent; | register CARD32 atomsPresent; |
|
|
|
| } | } |
| | |
| static char * | static char * |
| #if NeedFunctionPrototypes |
|
| _XkbWriteAtoms(char *wire,Atom *atoms,int maxAtoms,int swap) | _XkbWriteAtoms(char *wire,Atom *atoms,int maxAtoms,int swap) |
| #else |
|
| _XkbWriteAtoms(wire,atoms,maxAtoms,swap) |
|
| char *wire; |
|
| Atom *atoms; |
|
| int maxAtoms; |
|
| int swap; |
|
| #endif |
|
| { | { |
| register unsigned int i; | register unsigned int i; |
| Atom *atm; | Atom *atm; |
|
|
|
| } | } |
| | |
| static Status | static Status |
| #if NeedFunctionPrototypes |
|
| XkbComputeGetNamesReplySize(XkbDescPtr xkb,xkbGetNamesReply *rep) | XkbComputeGetNamesReplySize(XkbDescPtr xkb,xkbGetNamesReply *rep) |
| #else |
|
| XkbComputeGetNamesReplySize(xkb,rep) |
|
| XkbDescPtr xkb; |
|
| xkbGetNamesReply * rep; |
|
| #endif |
|
| { | { |
| register unsigned which,length; | register unsigned which,length; |
| register int i; | register int i; |
|
|
|
| } | } |
| | |
| static int | static int |
| #if NeedFunctionPrototypes |
|
| XkbSendNames(ClientPtr client,XkbDescPtr xkb,xkbGetNamesReply *rep) | XkbSendNames(ClientPtr client,XkbDescPtr xkb,xkbGetNamesReply *rep) |
| #else |
|
| XkbSendNames(client,xkb,rep) |
|
| ClientPtr client; |
|
| XkbDescPtr xkb; |
|
| xkbGetNamesReply * rep; |
|
| #endif |
|
| { | { |
| register unsigned i,length,which; | register unsigned i,length,which; |
| char * start; | char * start; |
|
|
|
| desc+= rep->nRadioGroups*4; | desc+= rep->nRadioGroups*4; |
| } | } |
| if ((desc-start)!=(length)) { | if ((desc-start)!=(length)) { |
| ErrorF("BOGUS LENGTH in write names, expected %d, got %d\n", |
ErrorF("BOGUS LENGTH in write names, expected %d, got %ld\n", |
| length, desc-start); |
length, (unsigned long)(desc-start)); |
| } | } |
| WriteToClient(client, SIZEOF(xkbGetNamesReply), (char *)rep); | WriteToClient(client, SIZEOF(xkbGetNamesReply), (char *)rep); |
| WriteToClient(client, length, start); | WriteToClient(client, length, start); |
|
|
|
| } | } |
| | |
| int | int |
| #if NeedFunctionPrototypes |
|
| ProcXkbGetNames(ClientPtr client) | ProcXkbGetNames(ClientPtr client) |
| #else |
|
| ProcXkbGetNames(client) |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| DeviceIntPtr dev; | DeviceIntPtr dev; |
| XkbDescPtr xkb; | XkbDescPtr xkb; |
|
|
|
| /***====================================================================***/ | /***====================================================================***/ |
| | |
| static CARD32 * | static CARD32 * |
| #if NeedFunctionPrototypes |
|
| _XkbCheckAtoms(CARD32 *wire,int nAtoms,int swapped,Atom *pError) | _XkbCheckAtoms(CARD32 *wire,int nAtoms,int swapped,Atom *pError) |
| #else |
|
| _XkbCheckAtoms(wire,nAtoms,swapped,pError) |
|
| CARD32 *wire; |
|
| int nAtoms; |
|
| int swapped; |
|
| Atom *pError; |
|
| #endif |
|
| { | { |
| register int i; | register int i; |
| | |
|
|
|
| } | } |
| | |
| static CARD32 * | static CARD32 * |
| #if NeedFunctionPrototypes |
|
| _XkbCheckMaskedAtoms(CARD32 *wire,int nAtoms,CARD32 present,int swapped, | _XkbCheckMaskedAtoms(CARD32 *wire,int nAtoms,CARD32 present,int swapped, |
| Atom *pError) | Atom *pError) |
| #else |
|
| _XkbCheckMaskedAtoms(wire,nAtoms,present,swapped,pError) |
|
| CARD32 *wire; |
|
| int nAtoms; |
|
| CARD32 present; |
|
| int swapped; |
|
| Atom *pError; |
|
| #endif |
|
| { | { |
| register unsigned i,bit; | register unsigned i,bit; |
| | |
|
|
|
| } | } |
| | |
| static Atom * | static Atom * |
| #if NeedFunctionPrototypes |
|
| _XkbCopyMaskedAtoms( Atom *wire, | _XkbCopyMaskedAtoms( Atom *wire, |
| Atom *dest, | Atom *dest, |
| int nAtoms, | int nAtoms, |
| CARD32 present) | CARD32 present) |
| #else |
|
| _XkbCopyMaskedAtoms(wire,dest,nAtoms,present) |
|
| Atom *wire; |
|
| Atom *dest; |
|
| int nAtoms; |
|
| CARD32 present; |
|
| #endif |
|
| { | { |
| register int i,bit; | register int i,bit; |
| | |
|
|
|
| } | } |
| | |
| static Bool | static Bool |
| #if NeedFunctionPrototypes |
|
| _XkbCheckTypeName(Atom name,int typeNdx) | _XkbCheckTypeName(Atom name,int typeNdx) |
| #else |
|
| _XkbCheckTypeName(name,typeNdx) |
|
| Atom name; |
|
| int typeNdx; |
|
| #endif |
|
| { | { |
| char * str; | char * str; |
| | |
|
|
|
| } | } |
| | |
| int | int |
| #if NeedFunctionPrototypes |
|
| ProcXkbSetNames(ClientPtr client) | ProcXkbSetNames(ClientPtr client) |
| #else |
|
| ProcXkbSetNames(client) |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| DeviceIntPtr dev; | DeviceIntPtr dev; |
| XkbDescRec *xkb; | XkbDescRec *xkb; |
|
|
|
| #define XkbSizeCountedString(s) ((s)?((((2+strlen(s))+3)/4)*4):4) | #define XkbSizeCountedString(s) ((s)?((((2+strlen(s))+3)/4)*4):4) |
| | |
| static char * | static char * |
| #if NeedFunctionPrototypes |
|
| XkbWriteCountedString(char *wire,char *str,Bool swap) | XkbWriteCountedString(char *wire,char *str,Bool swap) |
| #else |
|
| XkbWriteCountedString(wire,str,swap) |
|
| char * wire; |
|
| char * str; |
|
| Bool swap; |
|
| #endif |
|
| { | { |
| CARD16 len,*pLen; | CARD16 len,*pLen; |
| | |
|
|
|
| } | } |
| | |
| static int | static int |
| #if NeedFunctionPrototypes |
|
| XkbSizeGeomProperties(XkbGeometryPtr geom) | XkbSizeGeomProperties(XkbGeometryPtr geom) |
| #else |
|
| XkbSizeGeomProperties(geom) |
|
| XkbGeometryPtr geom; |
|
| #endif |
|
| { | { |
| register int i,size; | register int i,size; |
| XkbPropertyPtr prop; | XkbPropertyPtr prop; |
|
|
|
| } | } |
| | |
| static char * | static char * |
| #if NeedFunctionPrototypes |
|
| XkbWriteGeomProperties(char *wire,XkbGeometryPtr geom,Bool swap) | XkbWriteGeomProperties(char *wire,XkbGeometryPtr geom,Bool swap) |
| #else |
|
| XkbWriteGeomProperties(wire,geom,swap) |
|
| char * wire; |
|
| XkbGeometryPtr geom; |
|
| Bool swap; |
|
| #endif |
|
| { | { |
| register int i; | register int i; |
| register XkbPropertyPtr prop; | register XkbPropertyPtr prop; |
|
|
|
| } | } |
| | |
| static int | static int |
| #if NeedFunctionPrototypes |
|
| XkbSizeGeomKeyAliases(XkbGeometryPtr geom) | XkbSizeGeomKeyAliases(XkbGeometryPtr geom) |
| #else |
|
| XkbSizeGeomKeyAliases(geom) |
|
| XkbGeometryPtr geom; |
|
| #endif |
|
| { | { |
| return geom->num_key_aliases*(2*XkbKeyNameLength); | return geom->num_key_aliases*(2*XkbKeyNameLength); |
| } | } |
| | |
| static char * | static char * |
| #if NeedFunctionPrototypes |
|
| XkbWriteGeomKeyAliases(char *wire,XkbGeometryPtr geom,Bool swap) | XkbWriteGeomKeyAliases(char *wire,XkbGeometryPtr geom,Bool swap) |
| #else |
|
| XkbWriteGeomKeyAliases(wire,geom,swap) |
|
| char * wire; |
|
| XkbGeometryPtr geom; |
|
| Bool swap; |
|
| #endif |
|
| { | { |
| register int sz; | register int sz; |
| | |
|
|
|
| } | } |
| | |
| static int | static int |
| #if NeedFunctionPrototypes |
|
| XkbSizeGeomColors(XkbGeometryPtr geom) | XkbSizeGeomColors(XkbGeometryPtr geom) |
| #else |
|
| XkbSizeGeomColors(geom) |
|
| XkbGeometryPtr geom; |
|
| #endif |
|
| { | { |
| register int i,size; | register int i,size; |
| register XkbColorPtr color; | register XkbColorPtr color; |
|
|
|
| } | } |
| | |
| static char * | static char * |
| #if NeedFunctionPrototypes |
|
| XkbWriteGeomColors(char *wire,XkbGeometryPtr geom,Bool swap) | XkbWriteGeomColors(char *wire,XkbGeometryPtr geom,Bool swap) |
| #else |
|
| XkbWriteGeomColors(wire,geom,swap) |
|
| char * wire; |
|
| XkbGeometryPtr geom; |
|
| Bool swap; |
|
| #endif |
|
| { | { |
| register int i; | register int i; |
| register XkbColorPtr color; | register XkbColorPtr color; |
|
|
|
| } | } |
| | |
| static int | static int |
| #if NeedFunctionPrototypes |
|
| XkbSizeGeomShapes(XkbGeometryPtr geom) | XkbSizeGeomShapes(XkbGeometryPtr geom) |
| #else |
|
| XkbSizeGeomShapes(geom) |
|
| XkbGeometryPtr geom; |
|
| #endif |
|
| { | { |
| register int i,size; | register int i,size; |
| register XkbShapePtr shape; | register XkbShapePtr shape; |
|
|
|
| } | } |
| | |
| static char * | static char * |
| #if NeedFunctionPrototypes |
|
| XkbWriteGeomShapes(char *wire,XkbGeometryPtr geom,Bool swap) | XkbWriteGeomShapes(char *wire,XkbGeometryPtr geom,Bool swap) |
| #else |
|
| XkbWriteGeomShapes(wire,geom,swap) |
|
| char * wire; |
|
| XkbGeometryPtr geom; |
|
| Bool swap; |
|
| #endif |
|
| { | { |
| int i; | int i; |
| XkbShapePtr shape; | XkbShapePtr shape; |
|
|
|
| } | } |
| | |
| static int | static int |
| #if NeedFunctionPrototypes |
|
| XkbSizeGeomDoodads(int num_doodads,XkbDoodadPtr doodad) | XkbSizeGeomDoodads(int num_doodads,XkbDoodadPtr doodad) |
| #else |
|
| XkbSizeGeomDoodads(num_doodads,doodad) |
|
| int num_doodads; |
|
| XkbDoodadPtr doodad; |
|
| #endif |
|
| { | { |
| register int i,size; | register int i,size; |
| | |
|
|
|
| } | } |
| | |
| static char * | static char * |
| #if NeedFunctionPrototypes |
|
| XkbWriteGeomDoodads(char *wire,int num_doodads,XkbDoodadPtr doodad,Bool swap) | XkbWriteGeomDoodads(char *wire,int num_doodads,XkbDoodadPtr doodad,Bool swap) |
| #else |
|
| XkbWriteGeomDoodads(wire,num_doodads,doodad,swap) |
|
| char * wire; |
|
| int num_doodads; |
|
| XkbDoodadPtr doodad; |
|
| Bool swap; |
|
| #endif |
|
| { | { |
| register int i; | register int i; |
| xkbDoodadWireDesc * doodadWire; | xkbDoodadWireDesc * doodadWire; |
|
|
|
| wire= XkbWriteCountedString(wire,doodad->logo.logo_name,swap); | wire= XkbWriteCountedString(wire,doodad->logo.logo_name,swap); |
| break; | break; |
| default: | default: |
| ErrorF("Unknown doodad type %d in XkbWriteGeomDoodads\n"); |
ErrorF("Unknown doodad type %d in XkbWriteGeomDoodads\n", |
| |
doodad->any.type); |
| ErrorF("Ignored\n"); | ErrorF("Ignored\n"); |
| break; | break; |
| } | } |
|
|
|
| } | } |
| | |
| static char * | static char * |
| #if NeedFunctionPrototypes |
|
| XkbWriteGeomOverlay(char *wire,XkbOverlayPtr ol,Bool swap) | XkbWriteGeomOverlay(char *wire,XkbOverlayPtr ol,Bool swap) |
| #else |
|
| XkbWriteGeomOverlay(wire,ol,swap) |
|
| char * wire; |
|
| XkbOverlayPtr ol; |
|
| Bool swap; |
|
| #endif |
|
| { | { |
| register int r; | register int r; |
| XkbOverlayRowPtr row; | XkbOverlayRowPtr row; |
|
|
|
| } | } |
| | |
| static int | static int |
| #if NeedFunctionPrototypes |
|
| XkbSizeGeomSections(XkbGeometryPtr geom) | XkbSizeGeomSections(XkbGeometryPtr geom) |
| #else |
|
| XkbSizeGeomSections(geom) |
|
| XkbGeometryPtr geom; |
|
| #endif |
|
| { | { |
| register int i,size; | register int i,size; |
| XkbSectionPtr section; | XkbSectionPtr section; |
|
|
|
| } | } |
| | |
| static char * | static char * |
| #if NeedFunctionPrototypes |
|
| XkbWriteGeomSections(char *wire,XkbGeometryPtr geom,Bool swap) | XkbWriteGeomSections(char *wire,XkbGeometryPtr geom,Bool swap) |
| #else |
|
| XkbWriteGeomSections(wire,geom,swap) |
|
| char * wire; |
|
| XkbGeometryPtr geom; |
|
| Bool swap; |
|
| #endif |
|
| { | { |
| register int i; | register int i; |
| XkbSectionPtr section; | XkbSectionPtr section; |
|
|
|
| } | } |
| | |
| static Status | static Status |
| #if NeedFunctionPrototypes |
|
| XkbComputeGetGeometryReplySize( XkbGeometryPtr geom, | XkbComputeGetGeometryReplySize( XkbGeometryPtr geom, |
| xkbGetGeometryReply * rep, | xkbGetGeometryReply * rep, |
| Atom name) | Atom name) |
| #else |
|
| XkbComputeGetGeometryReplySize(geom,rep,name) |
|
| XkbGeometryPtr geom; |
|
| xkbGetGeometryReply * rep; |
|
| Atom name; |
|
| #endif |
|
| { | { |
| int len; | int len; |
| | |
|
|
|
| } | } |
| | |
| static int | static int |
| #if NeedFunctionPrototypes |
|
| XkbSendGeometry( ClientPtr client, | XkbSendGeometry( ClientPtr client, |
| XkbGeometryPtr geom, | XkbGeometryPtr geom, |
| xkbGetGeometryReply * rep, | xkbGetGeometryReply * rep, |
| Bool freeGeom) | Bool freeGeom) |
| #else |
|
| XkbSendGeometry(client,geom,rep,freeGeom) |
|
| ClientPtr client; |
|
| XkbGeometryPtr geom; |
|
| xkbGetGeometryReply *rep; |
|
| Bool freeGeom; |
|
| #endif |
|
| { | { |
| char *desc,*start; | char *desc,*start; |
| int len; | int len; |
|
|
|
| if ( rep->nKeyAliases>0 ) | if ( rep->nKeyAliases>0 ) |
| desc = XkbWriteGeomKeyAliases(desc,geom,client->swapped); | desc = XkbWriteGeomKeyAliases(desc,geom,client->swapped); |
| if ((desc-start)!=(len)) { | if ((desc-start)!=(len)) { |
| ErrorF("BOGUS LENGTH in XkbSendGeometry, expected %d, got %d\n", |
ErrorF("BOGUS LENGTH in XkbSendGeometry, expected %d, got %ld\n", |
| len, desc-start); |
len, (unsigned long)(desc-start)); |
| } | } |
| } | } |
| else { | else { |
|
|
|
| } | } |
| | |
| int | int |
| #if NeedFunctionPrototypes |
|
| ProcXkbGetGeometry(ClientPtr client) | ProcXkbGetGeometry(ClientPtr client) |
| #else |
|
| ProcXkbGetGeometry(client) |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| DeviceIntPtr dev; | DeviceIntPtr dev; |
| xkbGetGeometryReply rep; | xkbGetGeometryReply rep; |
|
|
|
| /***====================================================================***/ | /***====================================================================***/ |
| | |
| static char * | static char * |
| #if NeedFunctionPrototypes |
|
| _GetCountedString(char **wire_inout,Bool swap) | _GetCountedString(char **wire_inout,Bool swap) |
| #else |
|
| _GetCountedString(wire_inout,swap) |
|
| char ** wire_inout; |
|
| Bool swap; |
|
| #endif |
|
| { | { |
| char * wire,*str; | char * wire,*str; |
| CARD16 len,*plen; | CARD16 len,*plen; |
|
|
|
| } | } |
| | |
| static Status | static Status |
| #if NeedFunctionPrototypes |
|
| _CheckSetDoodad( char ** wire_inout, | _CheckSetDoodad( char ** wire_inout, |
| XkbGeometryPtr geom, | XkbGeometryPtr geom, |
| XkbSectionPtr section, | XkbSectionPtr section, |
| ClientPtr client) | ClientPtr client) |
| #else |
|
| _CheckSetDoodad(wire_inout,geom,section,client) |
|
| char ** wire_inout; |
|
| XkbGeometryPtr geom; |
|
| XkbSectionPtr section; |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| char * wire; | char * wire; |
| xkbDoodadWireDesc * dWire; | xkbDoodadWireDesc * dWire; |
|
|
|
| } | } |
| | |
| static Status | static Status |
| #if NeedFunctionPrototypes |
|
| _CheckSetOverlay( char ** wire_inout, | _CheckSetOverlay( char ** wire_inout, |
| XkbGeometryPtr geom, | XkbGeometryPtr geom, |
| XkbSectionPtr section, | XkbSectionPtr section, |
| ClientPtr client) | ClientPtr client) |
| #else |
|
| _CheckSetOverlay(wire_inout,geom,section,client) |
|
| char ** wire_inout; |
|
| XkbGeometryPtr geom; |
|
| XkbSectionPtr section; |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| register int r; | register int r; |
| char * wire; | char * wire; |
|
|
|
| } | } |
| | |
| static Status | static Status |
| #if NeedFunctionPrototypes |
|
| _CheckSetSections( XkbGeometryPtr geom, | _CheckSetSections( XkbGeometryPtr geom, |
| xkbSetGeometryReq * req, | xkbSetGeometryReq * req, |
| char ** wire_inout, | char ** wire_inout, |
| ClientPtr client) | ClientPtr client) |
| #else |
|
| _CheckSetSections(geom,req,wire_inout,client) |
|
| XkbGeometryPtr geom; |
|
| xkbSetGeometryReq * req; |
|
| char ** wire_inout; |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| Status status; | Status status; |
| register int s; | register int s; |
|
|
|
| } | } |
| | |
| static Status | static Status |
| #if NeedFunctionPrototypes |
|
| _CheckSetShapes( XkbGeometryPtr geom, | _CheckSetShapes( XkbGeometryPtr geom, |
| xkbSetGeometryReq * req, | xkbSetGeometryReq * req, |
| char ** wire_inout, | char ** wire_inout, |
| ClientPtr client) | ClientPtr client) |
| #else |
|
| _CheckSetShapes(geom,req,wire_inout,client) |
|
| XkbGeometryPtr geom; |
|
| xkbSetGeometryReq * req; |
|
| char ** wire_inout; |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| register int i; | register int i; |
| char * wire; | char * wire; |
|
|
|
| } | } |
| | |
| static Status | static Status |
| #if NeedFunctionPrototypes |
|
| _CheckSetGeom( XkbGeometryPtr geom, | _CheckSetGeom( XkbGeometryPtr geom, |
| xkbSetGeometryReq * req, | xkbSetGeometryReq * req, |
| ClientPtr client) | ClientPtr client) |
| #else |
|
| _CheckSetGeom(geom,req,client) |
|
| XkbGeometryPtr geom; |
|
| xkbSetGeometryReq * req; |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| register int i; | register int i; |
| Status status; | Status status; |
|
|
|
| } | } |
| | |
| int | int |
| #if NeedFunctionPrototypes |
|
| ProcXkbSetGeometry(ClientPtr client) | ProcXkbSetGeometry(ClientPtr client) |
| #else |
|
| ProcXkbSetGeometry(client) |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| DeviceIntPtr dev; | DeviceIntPtr dev; |
| XkbGeometryPtr geom,old; | XkbGeometryPtr geom,old; |
|
|
|
| /***====================================================================***/ | /***====================================================================***/ |
| | |
| int | int |
| #if NeedFunctionPrototypes |
|
| ProcXkbPerClientFlags(ClientPtr client) | ProcXkbPerClientFlags(ClientPtr client) |
| #else |
|
| ProcXkbPerClientFlags(client) |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| DeviceIntPtr dev; | DeviceIntPtr dev; |
| xkbPerClientFlagsReply rep; | xkbPerClientFlagsReply rep; |
|
|
|
| /* all latin-1 alphanumerics, plus parens, minus, underscore, slash */ | /* all latin-1 alphanumerics, plus parens, minus, underscore, slash */ |
| /* and wildcards */ | /* and wildcards */ |
| static unsigned char componentSpecLegal[] = { | static unsigned char componentSpecLegal[] = { |
| 0x00, 0x00, 0x00, 0x00, 0x00, 0xa7, 0xff, 0x83, |
0x00, 0x00, 0x00, 0x00, 0x00, 0xa7, 0xff, 0x87, |
| 0xfe, 0xff, 0xff, 0x87, 0xfe, 0xff, 0xff, 0x07, | 0xfe, 0xff, 0xff, 0x87, 0xfe, 0xff, 0xff, 0x07, |
| 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0x7f, 0xff | 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0x7f, 0xff |
|
|
|
| | |
| /* same as above but accepts percent, plus and bar too */ | /* same as above but accepts percent, plus and bar too */ |
| static unsigned char componentExprLegal[] = { | static unsigned char componentExprLegal[] = { |
| 0x00, 0x00, 0x00, 0x00, 0x20, 0xaf, 0xff, 0x83, |
0x00, 0x00, 0x00, 0x00, 0x20, 0xaf, 0xff, 0x87, |
| 0xfe, 0xff, 0xff, 0x87, 0xfe, 0xff, 0xff, 0x17, | 0xfe, 0xff, 0xff, 0x87, 0xfe, 0xff, 0xff, 0x17, |
| 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0x7f, 0xff | 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0x7f, 0xff |
| }; | }; |
| | |
| static char * | static char * |
| #if NeedFunctionPrototypes |
|
| GetComponentSpec(unsigned char **pWire,Bool allowExpr,int *errRtrn) | GetComponentSpec(unsigned char **pWire,Bool allowExpr,int *errRtrn) |
| #else |
|
| GetComponentSpec(pWire,allowExpr,errRtrn) |
|
| unsigned char ** pWire; |
|
| Bool allowExpr; |
|
| int * errRtrn; |
|
| #endif |
|
| { | { |
| int len; | int len; |
| register int i; | register int i; |
|
|
|
| /***====================================================================***/ | /***====================================================================***/ |
| | |
| int | int |
| #if NeedFunctionPrototypes |
|
| ProcXkbListComponents(ClientPtr client) | ProcXkbListComponents(ClientPtr client) |
| #else |
|
| ProcXkbListComponents(client) |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| DeviceIntPtr dev; | DeviceIntPtr dev; |
| xkbListComponentsReply rep; | xkbListComponentsReply rep; |
|
|
|
| /***====================================================================***/ | /***====================================================================***/ |
| | |
| int | int |
| #if NeedFunctionPrototypes |
|
| ProcXkbGetKbdByName(ClientPtr client) | ProcXkbGetKbdByName(ClientPtr client) |
| #else |
|
| ProcXkbGetKbdByName(client) |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| DeviceIntPtr dev; | DeviceIntPtr dev; |
| XkbFileInfo finfo; | XkbFileInfo finfo; |
|
|
|
| if (stuff->load) | if (stuff->load) |
| fwant= XkbGBN_AllComponentsMask; | fwant= XkbGBN_AllComponentsMask; |
| else fwant= stuff->want|stuff->need; | else fwant= stuff->want|stuff->need; |
| |
if (!names.keymap) { |
| if ((!names.compat)&& | if ((!names.compat)&& |
| (fwant&(XkbGBN_CompatMapMask|XkbGBN_IndicatorMapMask))) { | (fwant&(XkbGBN_CompatMapMask|XkbGBN_IndicatorMapMask))) { |
| names.compat= _XkbDupString("%"); | names.compat= _XkbDupString("%"); |
|
|
|
| if ((!names.types)&&(fwant&(XkbGBN_TypesMask))) { | if ((!names.types)&&(fwant&(XkbGBN_TypesMask))) { |
| names.types= _XkbDupString("%"); | names.types= _XkbDupString("%"); |
| } | } |
| if ((!names.symbols)&&(fwant&XkbGBN_SymbolsMask)) |
if ((!names.symbols)&&(fwant&XkbGBN_SymbolsMask)) { |
| names.symbols= _XkbDupString("%"); | names.symbols= _XkbDupString("%"); |
| |
} |
| geom_changed= ((names.geometry!=NULL)&&(strcmp(names.geometry,"%")!=0)); | geom_changed= ((names.geometry!=NULL)&&(strcmp(names.geometry,"%")!=0)); |
| if ((!names.geometry)&&(fwant&XkbGBN_GeometryMask)) { | if ((!names.geometry)&&(fwant&XkbGBN_GeometryMask)) { |
| names.geometry= _XkbDupString("%"); | names.geometry= _XkbDupString("%"); |
| geom_changed= False; | geom_changed= False; |
| } | } |
| |
} |
| |
else { |
| |
geom_changed= True; |
| |
} |
| | |
| bzero(mapFile,PATH_MAX); | bzero(mapFile,PATH_MAX); |
| rep.type= X_Reply; | rep.type= X_Reply; |
|
|
|
| rep.loaded= True; | rep.loaded= True; |
| if (stuff->load || | if (stuff->load || |
| ((rep.reported&XkbGBN_SymbolsMask) && (finfo.xkb->compat))) { | ((rep.reported&XkbGBN_SymbolsMask) && (finfo.xkb->compat))) { |
| register int first,num,key; |
XkbChangesRec changes; |
| first= finfo.xkb->min_key_code; |
bzero(&changes,sizeof(changes)); |
| num= XkbNumKeys(finfo.xkb); |
XkbUpdateDescActions(finfo.xkb, |
| for (key=first;key<(first+num);key++) { |
finfo.xkb->min_key_code,XkbNumKeys(finfo.xkb), |
| XkbApplyCompatMapToKey(finfo.xkb,key,NULL); |
&changes); |
| } |
|
| } | } |
| | |
| if (finfo.xkb->map==NULL) | if (finfo.xkb->map==NULL) |
|
|
|
| if (rep.loaded) { | if (rep.loaded) { |
| XkbDescPtr old_xkb; | XkbDescPtr old_xkb; |
| xkbNewKeyboardNotify nkn; | xkbNewKeyboardNotify nkn; |
| |
int i,nG,nTG; |
| old_xkb= xkb; | old_xkb= xkb; |
| xkb= finfo.xkb; | xkb= finfo.xkb; |
| dev->key->xkbInfo->desc= xkb; | dev->key->xkbInfo->desc= xkb; |
| finfo.xkb= old_xkb; /* so it'll get freed automatically */ | finfo.xkb= old_xkb; /* so it'll get freed automatically */ |
| | |
| if (dev->kbdfeed && dev->kbdfeed->xkb_sli) { |
|
| XkbFreeSrvLedInfo(dev->kbdfeed->xkb_sli); |
|
| dev->kbdfeed->xkb_sli= NULL; |
|
| } |
|
| *xkb->ctrls= *old_xkb->ctrls; | *xkb->ctrls= *old_xkb->ctrls; |
| |
for (nG=nTG=0,i=xkb->min_key_code;i<=xkb->max_key_code;i++) { |
| |
nG= XkbKeyNumGroups(xkb,i); |
| |
if (nG>=XkbNumKbdGroups) { |
| |
nTG= XkbNumKbdGroups; |
| |
break; |
| |
} |
| |
if (nG>nTG) { |
| |
nTG= nG; |
| |
} |
| |
} |
| |
xkb->ctrls->num_groups= nTG; |
| | |
| memcpy(dev->key->modifierMap,xkb->map->modmap,xkb->max_key_code+1); | memcpy(dev->key->modifierMap,xkb->map->modmap,xkb->max_key_code+1); |
| XkbUpdateCoreDescription(dev,True); | XkbUpdateCoreDescription(dev,True); |
| | |
| |
if (dev->kbdfeed && dev->kbdfeed->xkb_sli) { |
| |
XkbSrvLedInfoPtr old_sli; |
| |
XkbSrvLedInfoPtr sli; |
| |
old_sli = dev->kbdfeed->xkb_sli; |
| |
dev->kbdfeed->xkb_sli = NULL; |
| |
sli = XkbAllocSrvLedInfo(dev,dev->kbdfeed,NULL,0); |
| |
if (sli) { |
| |
sli->explicitState = old_sli->explicitState; |
| |
sli->effectiveState = old_sli->effectiveState; |
| |
} |
| |
dev->kbdfeed->xkb_sli = sli; |
| |
XkbFreeSrvLedInfo(old_sli); |
| |
} |
| |
|
| nkn.deviceID= nkn.oldDeviceID= dev->id; | nkn.deviceID= nkn.oldDeviceID= dev->id; |
| nkn.minKeyCode= finfo.xkb->min_key_code; | nkn.minKeyCode= finfo.xkb->min_key_code; |
| nkn.maxKeyCode= finfo.xkb->max_key_code; | nkn.maxKeyCode= finfo.xkb->max_key_code; |
|
|
|
| /***====================================================================***/ | /***====================================================================***/ |
| | |
| static int | static int |
| #if NeedFunctionPrototypes |
|
| ComputeDeviceLedInfoSize( DeviceIntPtr dev, | ComputeDeviceLedInfoSize( DeviceIntPtr dev, |
| unsigned int what, | unsigned int what, |
| XkbSrvLedInfoPtr sli) | XkbSrvLedInfoPtr sli) |
| #else |
|
| ComputeDeviceLedInfoSize(dev,what,sli) |
|
| DeviceIntPtr dev; |
|
| unsigned int what; |
|
| XkbSrvLedInfoPtr sli; |
|
| #endif |
|
| { | { |
| int nNames,nMaps; | int nNames,nMaps; |
| register unsigned n,bit; | register unsigned n,bit; |
|
|
|
| } | } |
| | |
| static int | static int |
| #if NeedFunctionPrototypes |
|
| CheckDeviceLedFBs( DeviceIntPtr dev, | CheckDeviceLedFBs( DeviceIntPtr dev, |
| int class, | int class, |
| int id, | int id, |
| xkbGetDeviceInfoReply * rep, | xkbGetDeviceInfoReply * rep, |
| ClientPtr client) | ClientPtr client) |
| #else |
|
| CheckDeviceLedFBs(dev,class,id,rep,client) |
|
| DeviceIntPtr dev; |
|
| int class; |
|
| int id; |
|
| xkbGetDeviceInfoReply * rep; |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| int nFBs= 0; | int nFBs= 0; |
| int length= 0; | int length= 0; |
|
|
|
| } | } |
| | |
| static int | static int |
| #if NeedFunctionPrototypes |
|
| SendDeviceLedInfo( XkbSrvLedInfoPtr sli, | SendDeviceLedInfo( XkbSrvLedInfoPtr sli, |
| ClientPtr client) | ClientPtr client) |
| #else |
|
| SendDeviceLedInfo(sli,client) |
|
| XkbSrvLedInfoPtr sli; |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| xkbDeviceLedsWireDesc wire; | xkbDeviceLedsWireDesc wire; |
| int length; | int length; |
|
|
|
| } | } |
| | |
| static int | static int |
| #if NeedFunctionPrototypes |
|
| SendDeviceLedFBs( DeviceIntPtr dev, | SendDeviceLedFBs( DeviceIntPtr dev, |
| int class, | int class, |
| int id, | int id, |
| unsigned wantLength, | unsigned wantLength, |
| ClientPtr client) | ClientPtr client) |
| #else |
|
| SendDeviceLedFBs(dev,class,id,wantLength,client) |
|
| DeviceIntPtr dev; |
|
| int class; |
|
| int id; |
|
| unsigned wantLength; |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| int length= 0; | int length= 0; |
| | |
|
|
|
| } | } |
| | |
| int | int |
| #if NeedFunctionPrototypes |
|
| ProcXkbGetDeviceInfo(ClientPtr client) | ProcXkbGetDeviceInfo(ClientPtr client) |
| #else |
|
| ProcXkbGetDeviceInfo(client) |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| DeviceIntPtr dev; | DeviceIntPtr dev; |
| xkbGetDeviceInfoReply rep; | xkbGetDeviceInfoReply rep; |
|
|
|
| } | } |
| | |
| static char * | static char * |
| #if NeedFunctionPrototypes |
|
| CheckSetDeviceIndicators( char * wire, | CheckSetDeviceIndicators( char * wire, |
| DeviceIntPtr dev, | DeviceIntPtr dev, |
| int num, | int num, |
| int * status_rtrn, | int * status_rtrn, |
| ClientPtr client) | ClientPtr client) |
| #else |
|
| CheckSetDeviceIndicators(wire,dev,num,status_rtrn,client) |
|
| char * wire; |
|
| DeviceIntPtr dev; |
|
| int num; |
|
| int * status_rtrn; |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| xkbDeviceLedsWireDesc * ledWire; | xkbDeviceLedsWireDesc * ledWire; |
| int i; | int i; |
|
|
|
| } | } |
| | |
| static char * | static char * |
| #if NeedFunctionPrototypes |
|
| SetDeviceIndicators( char * wire, | SetDeviceIndicators( char * wire, |
| DeviceIntPtr dev, | DeviceIntPtr dev, |
| unsigned changed, | unsigned changed, |
|
|
|
| int * status_rtrn, | int * status_rtrn, |
| ClientPtr client, | ClientPtr client, |
| xkbExtensionDeviceNotify *ev) | xkbExtensionDeviceNotify *ev) |
| #else |
|
| SetDeviceIndicators(wire,dev,changed,num,status_rtrn,client,ev) |
|
| char * wire; |
|
| DeviceIntPtr dev; |
|
| unsigned changed; |
|
| int num; |
|
| ClientPtr client; |
|
| int * status_rtrn; |
|
| xkbExtensionDeviceNotify *ev; |
|
| #endif |
|
| { | { |
| xkbDeviceLedsWireDesc * ledWire; | xkbDeviceLedsWireDesc * ledWire; |
| int i; | int i; |
|
|
|
| } | } |
| | |
| int | int |
| #if NeedFunctionPrototypes |
|
| ProcXkbSetDeviceInfo(ClientPtr client) | ProcXkbSetDeviceInfo(ClientPtr client) |
| #else |
|
| ProcXkbSetDeviceInfo(client) |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| DeviceIntPtr dev; | DeviceIntPtr dev; |
| unsigned change; | unsigned change; |
|
|
|
| /***====================================================================***/ | /***====================================================================***/ |
| | |
| int | int |
| #if NeedFunctionPrototypes |
|
| ProcXkbSetDebuggingFlags(ClientPtr client) | ProcXkbSetDebuggingFlags(ClientPtr client) |
| #else |
|
| ProcXkbSetDebuggingFlags(client) |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| CARD32 newFlags,newCtrls,extraLength; | CARD32 newFlags,newCtrls,extraLength; |
| xkbSetDebuggingFlagsReply rep; | xkbSetDebuggingFlagsReply rep; |
|
|
|
| newCtrls= xkbDebugCtrls&(~stuff->affectCtrls); | newCtrls= xkbDebugCtrls&(~stuff->affectCtrls); |
| newCtrls|= (stuff->ctrls&stuff->affectCtrls); | newCtrls|= (stuff->ctrls&stuff->affectCtrls); |
| if (xkbDebugFlags || newFlags || stuff->msgLength) { | if (xkbDebugFlags || newFlags || stuff->msgLength) { |
| ErrorF("XkbDebug: Setting debug flags to 0x%x\n",newFlags); |
ErrorF("XkbDebug: Setting debug flags to 0x%lx\n",(long)newFlags); |
| if (newCtrls!=xkbDebugCtrls) | if (newCtrls!=xkbDebugCtrls) |
| ErrorF("XkbDebug: Setting debug controls to 0x%x\n",newCtrls); |
ErrorF("XkbDebug: Setting debug controls to 0x%lx\n",(long)newCtrls); |
| } | } |
| extraLength= (stuff->length<<2)-sz_xkbSetDebuggingFlagsReq; | extraLength= (stuff->length<<2)-sz_xkbSetDebuggingFlagsReq; |
| if (stuff->msgLength>0) { | if (stuff->msgLength>0) { |
| char *msg; | char *msg; |
| if (extraLength<XkbPaddedSize(stuff->msgLength)) { | if (extraLength<XkbPaddedSize(stuff->msgLength)) { |
| ErrorF("XkbDebug: msgLength= %d, length= %d (should be %d)\n", |
ErrorF("XkbDebug: msgLength= %d, length= %ld (should be %d)\n", |
| stuff->msgLength,extraLength, |
stuff->msgLength,(long)extraLength, |
| XkbPaddedSize(stuff->msgLength)); | XkbPaddedSize(stuff->msgLength)); |
| return BadLength; | return BadLength; |
| } | } |
|
|
|
| /***====================================================================***/ | /***====================================================================***/ |
| | |
| static int | static int |
| #if NeedFunctionPrototypes |
|
| ProcXkbDispatch (ClientPtr client) | ProcXkbDispatch (ClientPtr client) |
| #else |
|
| ProcXkbDispatch (client) |
|
| ClientPtr client; |
|
| #endif |
|
| { | { |
| REQUEST(xReq); | REQUEST(xReq); |
| switch (stuff->data) | switch (stuff->data) |
|
|
|
| } | } |
| | |
| static int | static int |
| #if NeedFunctionPrototypes |
|
| XkbClientGone(pointer data,XID id) | XkbClientGone(pointer data,XID id) |
| #else |
|
| XkbClientGone(data,id) |
|
| pointer data; |
|
| XID id; |
|
| #endif |
|
| { | { |
| DevicePtr pXDev = (DevicePtr)data; | DevicePtr pXDev = (DevicePtr)data; |
| | |
|
|
|
| | |
| /*ARGSUSED*/ | /*ARGSUSED*/ |
| static void | static void |
| #if NeedFunctionPrototypes |
|
| XkbResetProc(ExtensionEntry *extEntry) | XkbResetProc(ExtensionEntry *extEntry) |
| #else |
|
| XkbResetProc(extEntry) |
|
| ExtensionEntry *extEntry; |
|
| #endif |
|
| { | { |
| } | } |
| | |
| void | void |
| #if NeedFunctionPrototypes |
XkbExtensionInit(INITARGS) |
| XkbExtensionInit(void) |
|
| #else |
|
| XkbExtensionInit() |
|
| #endif |
|
| { | { |
| ExtensionEntry *extEntry; | ExtensionEntry *extEntry; |
| | |
| if (extEntry = AddExtension(XkbName, XkbNumberEvents, XkbNumberErrors, |
if ((extEntry = AddExtension(XkbName, XkbNumberEvents, XkbNumberErrors, |
| ProcXkbDispatch, SProcXkbDispatch, | ProcXkbDispatch, SProcXkbDispatch, |
| XkbResetProc, StandardMinorOpcode)) { |
XkbResetProc, StandardMinorOpcode))) { |
| XkbReqCode = (unsigned char)extEntry->base; | XkbReqCode = (unsigned char)extEntry->base; |
| XkbEventBase = (unsigned char)extEntry->eventBase; | XkbEventBase = (unsigned char)extEntry->eventBase; |
| XkbErrorBase = (unsigned char)extEntry->errorBase; | XkbErrorBase = (unsigned char)extEntry->errorBase; |