From 021fc5cb2cb4a7972b4a6fcb570c1da92787d68d Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Sun, 18 Mar 2007 16:31:19 -0400 Subject: Static markup and dead code cull over xkb/. The former has been pulled into the server now as include/xkbsrv.h, and the world updated to look for it in the new place, since it made no sense to define server API in an extension header. Any further work along this line will need to do similar things with XKBgeom.h and friends. --- xkb/Makefile.am | 3 +- xkb/XKBAlloc.c | 157 +------------------ xkb/XKBGAlloc.c | 2 +- xkb/XKBMAlloc.c | 80 +--------- xkb/XKBMisc.c | 183 +--------------------- xkb/ddxBeep.c | 2 +- xkb/ddxCtrls.c | 2 +- xkb/ddxDevBtn.c | 2 +- xkb/ddxFakeBtn.c | 2 +- xkb/ddxFakeMtn.c | 2 +- xkb/ddxInit.c | 2 +- xkb/ddxKeyClick.c | 2 +- xkb/ddxKillSrv.c | 2 +- xkb/ddxLEDs.c | 4 +- xkb/ddxList.c | 2 +- xkb/ddxLoad.c | 8 +- xkb/ddxPrivate.c | 2 +- xkb/ddxVT.c | 2 +- xkb/maprules.c | 2 +- xkb/xkb.c | 63 +------- xkb/xkb.h | 42 ----- xkb/xkbAccessX.c | 8 +- xkb/xkbActions.c | 8 +- xkb/xkbDflts.h | 37 ----- xkb/xkbEvents.c | 46 +----- xkb/xkbInit.c | 26 ++-- xkb/xkbLEDs.c | 453 +++++++++++++++++++----------------------------------- xkb/xkbPrKeyEv.c | 2 +- xkb/xkbSwap.c | 2 +- xkb/xkbUtils.c | 57 +------ xkb/xkberrs.c | 31 ---- xkb/xkbfmisc.c | 109 +------------ xkb/xkbout.c | 126 +-------------- xkb/xkbtext.c | 96 +----------- xkb/xkmread.c | 14 +- 35 files changed, 225 insertions(+), 1356 deletions(-) (limited to 'xkb') diff --git a/xkb/Makefile.am b/xkb/Makefile.am index 996d52761..78cdf7196 100644 --- a/xkb/Makefile.am +++ b/xkb/Makefile.am @@ -41,7 +41,8 @@ X11_SRCS = \ XKBGAlloc.c \ XKBMAlloc.c -XI_SRCS = xkbPrOtherEv.c +# ends up unused... +# XI_SRCS = xkbPrOtherEv.c libxkb_la_SOURCES = $(DDX_SRCS) $(DIX_SRCS) $(XI_SRCS) $(XKBFILE_SRCS) \ $(X11_SRCS) diff --git a/xkb/XKBAlloc.c b/xkb/XKBAlloc.c index c474733d0..f0a1f890e 100644 --- a/xkb/XKBAlloc.c +++ b/xkb/XKBAlloc.c @@ -35,7 +35,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include "misc.h" #include "inputstr.h" -#include +#include #include /***===================================================================***/ @@ -259,7 +259,7 @@ XkbAllocControls(XkbDescPtr xkb,unsigned which) } /*ARGSUSED*/ -void +static void XkbFreeControls(XkbDescPtr xkb,unsigned which,Bool freeMap) { if (freeMap && (xkb!=NULL) && (xkb->ctrls!=NULL)) { @@ -284,7 +284,7 @@ XkbAllocIndicatorMaps(XkbDescPtr xkb) return Success; } -void +static void XkbFreeIndicatorMaps(XkbDescPtr xkb) { if ((xkb!=NULL)&&(xkb->indicators!=NULL)) { @@ -335,154 +335,3 @@ XkbFreeKeyboard(XkbDescPtr xkb,unsigned which,Bool freeAll) _XkbFree(xkb); return; } - -/***====================================================================***/ - -XkbDeviceLedInfoPtr -XkbAddDeviceLedInfo(XkbDeviceInfoPtr devi,unsigned ledClass,unsigned ledId) -{ -XkbDeviceLedInfoPtr devli; -register int i; - - if ((!devi)||(!XkbSingleXIClass(ledClass))||(!XkbSingleXIId(ledId))) - return NULL; - for (i=0,devli=devi->leds;inum_leds;i++,devli++) { - if ((devli->led_class==ledClass)&&(devli->led_id==ledId)) - return devli; - } - if (devi->num_leds>=devi->sz_leds) { - XkbDeviceLedInfoRec *prev_leds = devi->leds; - - if (devi->sz_leds>0) devi->sz_leds*= 2; - else devi->sz_leds= 1; - devi->leds= _XkbTypedRealloc(devi->leds,devi->sz_leds, - XkbDeviceLedInfoRec); - if (!devi->leds) { - _XkbFree(prev_leds); - devi->sz_leds= devi->num_leds= 0; - return NULL; - } - i= devi->num_leds; - for (devli=&devi->leds[i];isz_leds;i++,devli++) { - bzero(devli,sizeof(XkbDeviceLedInfoRec)); - devli->led_class= XkbXINone; - devli->led_id= XkbXINone; - } - } - devli= &devi->leds[devi->num_leds++]; - bzero(devli,sizeof(XkbDeviceLedInfoRec)); - devli->led_class= ledClass; - devli->led_id= ledId; - return devli; -} - -Status -XkbResizeDeviceButtonActions(XkbDeviceInfoPtr devi,unsigned newTotal) -{ - XkbAction *prev_btn_acts; - - if ((!devi)||(newTotal>255)) - return BadValue; - if ((devi->btn_acts!=NULL)&&(newTotal==devi->num_btns)) - return Success; - if (newTotal==0) { - if (devi->btn_acts!=NULL) { - _XkbFree(devi->btn_acts); - devi->btn_acts= NULL; - } - devi->num_btns= 0; - return Success; - } - prev_btn_acts = devi->btn_acts; - devi->btn_acts= _XkbTypedRealloc(devi->btn_acts,newTotal,XkbAction); - if (devi->btn_acts==NULL) { - _XkbFree(prev_btn_acts); - devi->num_btns= 0; - return BadAlloc; - } - if (newTotal>devi->num_btns) { - XkbAction *act; - act= &devi->btn_acts[devi->num_btns]; - bzero((char *)act,(newTotal-devi->num_btns)*sizeof(XkbAction)); - } - devi->num_btns= newTotal; - return Success; -} - -/*ARGSUSED*/ -XkbDeviceInfoPtr -XkbAllocDeviceInfo(unsigned deviceSpec,unsigned nButtons,unsigned szLeds) -{ -XkbDeviceInfoPtr devi; - - devi= _XkbTypedCalloc(1,XkbDeviceInfoRec); - if (devi!=NULL) { - devi->device_spec= deviceSpec; - devi->has_own_state= False; - devi->num_btns= 0; - devi->btn_acts= NULL; - if (nButtons>0) { - devi->num_btns= nButtons; - devi->btn_acts= _XkbTypedCalloc(nButtons,XkbAction); - if (!devi->btn_acts) { - _XkbFree(devi); - return NULL; - } - } - devi->dflt_kbd_fb= XkbXINone; - devi->dflt_led_fb= XkbXINone; - devi->num_leds= 0; - devi->sz_leds= 0; - devi->leds= NULL; - if (szLeds>0) { - devi->sz_leds= szLeds; - devi->leds= _XkbTypedCalloc(szLeds,XkbDeviceLedInfoRec); - if (!devi->leds) { - if (devi->btn_acts) - _XkbFree(devi->btn_acts); - _XkbFree(devi); - return NULL; - } - } - } - return devi; -} - - -void -XkbFreeDeviceInfo(XkbDeviceInfoPtr devi,unsigned which,Bool freeDevI) -{ - if (devi) { - if (freeDevI) { - which= XkbXI_AllDeviceFeaturesMask; - if (devi->name) { - _XkbFree(devi->name); - devi->name= NULL; - } - } - if ((which&XkbXI_ButtonActionsMask)&&(devi->btn_acts)) { - _XkbFree(devi->btn_acts); - devi->num_btns= 0; - devi->btn_acts= NULL; - } - if ((which&XkbXI_IndicatorsMask)&&(devi->leds)) { - register int i; - if ((which&XkbXI_IndicatorsMask)==XkbXI_IndicatorsMask) { - _XkbFree(devi->leds); - devi->sz_leds= devi->num_leds= 0; - devi->leds= NULL; - } - else { - XkbDeviceLedInfoPtr devli; - for (i=0,devli=devi->leds;inum_leds;i++,devli++) { - if (which&XkbXI_IndicatorMapsMask) - bzero((char *)&devli->maps[0],sizeof(devli->maps)); - else bzero((char *)&devli->names[0],sizeof(devli->names)); - } - } - } - if (freeDevI) - _XkbFree(devi); - } - return; -} diff --git a/xkb/XKBGAlloc.c b/xkb/XKBGAlloc.c index edaed10f3..815cc95f5 100644 --- a/xkb/XKBGAlloc.c +++ b/xkb/XKBGAlloc.c @@ -36,7 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include "misc.h" #include "inputstr.h" -#include +#include #include #ifdef X_NOT_POSIX diff --git a/xkb/XKBMAlloc.c b/xkb/XKBMAlloc.c index ef4097dad..4b7428b2e 100644 --- a/xkb/XKBMAlloc.c +++ b/xkb/XKBMAlloc.c @@ -39,7 +39,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "inputstr.h" #include #define XKBSRV_NEED_FILE_FUNCS -#include +#include /***====================================================================***/ @@ -220,7 +220,7 @@ XkbServerMapPtr map; /***====================================================================***/ -Status +static Status XkbCopyKeyType(XkbKeyTypePtr from,XkbKeyTypePtr into) { if ((!from)||(!into)) @@ -275,82 +275,6 @@ register int i,rtrn; return Success; } -XkbKeyTypePtr -XkbAddKeyType( XkbDescPtr xkb, - Atom name, - int map_count, - Bool want_preserve, - int num_lvls) -{ -register int i; -unsigned tmp; -XkbKeyTypePtr type; -XkbClientMapPtr map; - - if ((!xkb)||(num_lvls<1)) - return NULL; - map= xkb->map; - if ((map)&&(map->types)) { - for (i=0;inum_types;i++) { - if (map->types[i].name==name) { - Status status; - status=XkbResizeKeyType(xkb,i,map_count,want_preserve,num_lvls); - return (status==Success?&map->types[i]:NULL); - } - } - } - if ((!map)||(!map->types)||(!map->num_typesmap; - tmp= 0; - if (map->num_types<=XkbKeypadIndex) - tmp|= XkbKeypadMask; - if (map->num_types<=XkbAlphabeticIndex) - tmp|= XkbAlphabeticMask; - if (map->num_types<=XkbTwoLevelIndex) - tmp|= XkbTwoLevelMask; - if (map->num_types<=XkbOneLevelIndex) - tmp|= XkbOneLevelMask; - if (XkbInitCanonicalKeyTypes(xkb,tmp,XkbNoModifier)==Success) { - for (i=0;inum_types;i++) { - Status status; - if (map->types[i].name!=name) - continue; - status=XkbResizeKeyType(xkb,i,map_count,want_preserve,num_lvls); - return (status==Success?&map->types[i]:NULL); - } - } - } - if ((map->num_types<=map->size_types)&& - (XkbAllocClientMap(xkb,XkbKeyTypesMask,map->num_types+1)!=Success)) { - return NULL; - } - type= &map->types[map->num_types]; - map->num_types++; - bzero((char *)type,sizeof(XkbKeyTypeRec)); - type->num_levels= num_lvls; - type->map_count= map_count; - type->name= name; - if (map_count>0) { - type->map= _XkbTypedCalloc(map_count,XkbKTMapEntryRec); - if (!type->map) { - map->num_types--; - return NULL; - } - if (want_preserve) { - type->preserve= _XkbTypedCalloc(map_count,XkbModsRec); - if (!type->preserve) { - _XkbFree(type->map); - map->num_types--; - return NULL; - } - } - } - return type; -} - Status XkbResizeKeyType( XkbDescPtr xkb, int type_ndx, diff --git a/xkb/XKBMisc.c b/xkb/XKBMisc.c index 7ed47697e..0404108a2 100644 --- a/xkb/XKBMisc.c +++ b/xkb/XKBMisc.c @@ -39,102 +39,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "inputstr.h" #include #define XKBSRV_NEED_FILE_FUNCS -#include - -/***====================================================================***/ - -#define mapSize(m) (sizeof(m)/sizeof(XkbKTMapEntryRec)) -static XkbKTMapEntryRec map2Level[]= { - { True, ShiftMask, {1, ShiftMask, 0} } -}; - -static XkbKTMapEntryRec mapAlpha[]= { - { True, ShiftMask, { 1, ShiftMask, 0 } }, - { True, LockMask, { 0, LockMask, 0 } } -}; - -static XkbModsRec preAlpha[]= { - { 0, 0, 0 }, - { LockMask, LockMask, 0 } -}; - -#define NL_VMOD_MASK 0 -static XkbKTMapEntryRec mapKeypad[]= { - { True, ShiftMask, { 1, ShiftMask, 0 } }, - { False, 0, { 1, 0, NL_VMOD_MASK } } -}; - -static XkbKeyTypeRec canonicalTypes[XkbNumRequiredTypes] = { - { { 0, 0, 0 }, - 1, /* num_levels */ - 0, /* map_count */ - NULL, NULL, - None, NULL - }, - { { ShiftMask, ShiftMask, 0 }, - 2, /* num_levels */ - mapSize(map2Level), /* map_count */ - map2Level, NULL, - None, NULL - }, - { { ShiftMask|LockMask, ShiftMask|LockMask, 0 }, - 2, /* num_levels */ - mapSize(mapAlpha), /* map_count */ - mapAlpha, preAlpha, - None, NULL - }, - { { ShiftMask, ShiftMask, NL_VMOD_MASK }, - 2, /* num_levels */ - mapSize(mapKeypad), /* map_count */ - mapKeypad, NULL, - None, NULL - } -}; - -Status -XkbInitCanonicalKeyTypes(XkbDescPtr xkb,unsigned which,int keypadVMod) -{ -XkbClientMapPtr map; -XkbKeyTypePtr from,to; -Status rtrn; - - if (!xkb) - return BadMatch; - rtrn= XkbAllocClientMap(xkb,XkbKeyTypesMask,XkbNumRequiredTypes); - if (rtrn!=Success) - return rtrn; - map= xkb->map; - if ((which&XkbAllRequiredTypes)==0) - return Success; - rtrn= Success; - from= canonicalTypes; - to= map->types; - if (which&XkbOneLevelMask) - rtrn= XkbCopyKeyType(&from[XkbOneLevelIndex],&to[XkbOneLevelIndex]); - if ((which&XkbTwoLevelMask)&&(rtrn==Success)) - rtrn= XkbCopyKeyType(&from[XkbTwoLevelIndex],&to[XkbTwoLevelIndex]); - if ((which&XkbAlphabeticMask)&&(rtrn==Success)) - rtrn= XkbCopyKeyType(&from[XkbAlphabeticIndex],&to[XkbAlphabeticIndex]); - if ((which&XkbKeypadMask)&&(rtrn==Success)) { - XkbKeyTypePtr type; - rtrn= XkbCopyKeyType(&from[XkbKeypadIndex],&to[XkbKeypadIndex]); - type= &to[XkbKeypadIndex]; - if ((keypadVMod>=0)&&(keypadVModmods.vmods= (1<map[0].active= True; - type->map[0].mods.mask= ShiftMask; - type->map[0].mods.real_mods= ShiftMask; - type->map[0].mods.vmods= 0; - type->map[0].level= 1; - type->map[1].active= False; - type->map[1].mods.mask= 0; - type->map[1].mods.real_mods= 0; - type->map[1].mods.vmods= (1<map[1].level= 1; - } - } - return Success; -} +#include /***====================================================================***/ @@ -558,88 +463,6 @@ unsigned changed,tmp; return True; } -Bool -XkbUpdateMapFromCore( XkbDescPtr xkb, - KeyCode first_key, - int num_keys, - int map_width, - KeySym * core_keysyms, - XkbChangesPtr changes) -{ -register int key,last_key; -KeySym * syms; - - syms= &core_keysyms[(first_key-xkb->min_key_code)*map_width]; - if (changes) { - if (changes->map.changed&XkbKeySymsMask) { - _XkbAddKeyChange(&changes->map.first_key_sym, - &changes->map.num_key_syms,first_key); - if (num_keys>1) { - _XkbAddKeyChange(&changes->map.first_key_sym, - &changes->map.num_key_syms, - first_key+num_keys-1); - } - } - else { - changes->map.changed|= XkbKeySymsMask; - changes->map.first_key_sym= first_key; - changes->map.num_key_syms= num_keys; - } - } - last_key= first_key+num_keys-1; - for (key=first_key;key<=last_key;key++,syms+= map_width) { - XkbMapChangesPtr mc; - unsigned explicit; - KeySym tsyms[XkbMaxSymsPerKey]; - int types[XkbNumKbdGroups]; - int nG; - - explicit= xkb->server->explicit[key]&XkbExplicitKeyTypesMask; - types[XkbGroup1Index]= XkbKeyKeyTypeIndex(xkb,key,XkbGroup1Index); - types[XkbGroup2Index]= XkbKeyKeyTypeIndex(xkb,key,XkbGroup2Index); - types[XkbGroup3Index]= XkbKeyKeyTypeIndex(xkb,key,XkbGroup3Index); - types[XkbGroup4Index]= XkbKeyKeyTypeIndex(xkb,key,XkbGroup4Index); - nG= XkbKeyTypesForCoreSymbols(xkb,map_width,syms,explicit,types,tsyms); - if (changes) - mc= &changes->map; - else mc= NULL; - XkbChangeTypesOfKey(xkb,key,nG,XkbAllGroupsMask,types,mc); - memcpy((char *)XkbKeySymsPtr(xkb,key),(char *)tsyms, - XkbKeyNumSyms(xkb,key)*sizeof(KeySym)); - XkbApplyCompatMapToKey(xkb,key,changes); - } - - if ((xkb->server->vmods!=NULL)&&(xkb->map->modmap!=NULL)&&(changes)&& - (changes->map.changed&(XkbVirtualModMapMask|XkbModifierMapMask))) { - unsigned char newVMods[XkbNumVirtualMods]; - register unsigned bit,i; - unsigned present; - - bzero(newVMods,XkbNumVirtualMods); - present= 0; - for (key=xkb->min_key_code;key<=xkb->max_key_code;key++) { - if (xkb->server->vmodmap[key]==0) - continue; - for (i=0,bit=1;iserver->vmodmap[key]) { - present|= bit; - newVMods[i]|= xkb->map->modmap[key]; - } - } - } - for (i=0,bit=1;iserver->vmods[i])) { - changes->map.changed|= XkbVirtualModsMask; - changes->map.vmods|= bit; - xkb->server->vmods[i]= newVMods[i]; - } - } - } - if (changes && (changes->map.changed&XkbVirtualModsMask)) - XkbApplyVirtualModChanges(xkb,changes->map.vmods,changes); - return True; -} - Status XkbChangeTypesOfKey( XkbDescPtr xkb, int key, @@ -788,7 +611,7 @@ register unsigned mask; /***====================================================================***/ -Bool +static Bool XkbUpdateActionVirtualMods(XkbDescPtr xkb,XkbAction *act,unsigned changed) { unsigned int tmp; @@ -814,7 +637,7 @@ unsigned int tmp; return False; } -void +static void XkbUpdateKeyTypeVirtualMods( XkbDescPtr xkb, XkbKeyTypePtr type, unsigned int changed, diff --git a/xkb/ddxBeep.c b/xkb/ddxBeep.c index 53f3a6f9c..331357ded 100644 --- a/xkb/ddxBeep.c +++ b/xkb/ddxBeep.c @@ -36,7 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "inputstr.h" #include "scrnintstr.h" #include "windowstr.h" -#include +#include #include /*#define FALLING_TONE 1*/ diff --git a/xkb/ddxCtrls.c b/xkb/ddxCtrls.c index 5a9ad4018..0f7f9187f 100644 --- a/xkb/ddxCtrls.c +++ b/xkb/ddxCtrls.c @@ -36,7 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "inputstr.h" #include "scrnintstr.h" #include "windowstr.h" -#include +#include #include void diff --git a/xkb/ddxDevBtn.c b/xkb/ddxDevBtn.c index 3de8f8721..7e27c5189 100644 --- a/xkb/ddxDevBtn.c +++ b/xkb/ddxDevBtn.c @@ -36,7 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "inputstr.h" #include "scrnintstr.h" #include "windowstr.h" -#include +#include #include #include diff --git a/xkb/ddxFakeBtn.c b/xkb/ddxFakeBtn.c index f7b746b05..77222236f 100644 --- a/xkb/ddxFakeBtn.c +++ b/xkb/ddxFakeBtn.c @@ -37,7 +37,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "inputstr.h" #include "scrnintstr.h" #include "windowstr.h" -#include +#include #include void diff --git a/xkb/ddxFakeMtn.c b/xkb/ddxFakeMtn.c index a19819fd7..1060afe99 100644 --- a/xkb/ddxFakeMtn.c +++ b/xkb/ddxFakeMtn.c @@ -36,7 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "inputstr.h" #include "scrnintstr.h" #include "windowstr.h" -#include +#include #include #ifdef PANORAMIX diff --git a/xkb/ddxInit.c b/xkb/ddxInit.c index 88c488c22..3bcf9d604 100644 --- a/xkb/ddxInit.c +++ b/xkb/ddxInit.c @@ -37,7 +37,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "inputstr.h" #include "scrnintstr.h" #include "windowstr.h" -#include +#include #include int diff --git a/xkb/ddxKeyClick.c b/xkb/ddxKeyClick.c index 528b20207..685ae1b42 100644 --- a/xkb/ddxKeyClick.c +++ b/xkb/ddxKeyClick.c @@ -37,7 +37,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "inputstr.h" #include "scrnintstr.h" #include "windowstr.h" -#include +#include #include void diff --git a/xkb/ddxKillSrv.c b/xkb/ddxKillSrv.c index 95d75897b..a573ecbd8 100644 --- a/xkb/ddxKillSrv.c +++ b/xkb/ddxKillSrv.c @@ -36,7 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "inputstr.h" #include "scrnintstr.h" #include "windowstr.h" -#include +#include int XkbDDXTerminateServer(DeviceIntPtr dev,KeyCode key,XkbAction *act) diff --git a/xkb/ddxLEDs.c b/xkb/ddxLEDs.c index fd0195882..22899d766 100644 --- a/xkb/ddxLEDs.c +++ b/xkb/ddxLEDs.c @@ -37,10 +37,10 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "inputstr.h" #include "scrnintstr.h" #include "windowstr.h" -#include +#include #include -void +static void XkbDDXUpdateIndicators(DeviceIntPtr dev,CARD32 new) { dev->kbdfeed->ctrl.leds= new; diff --git a/xkb/ddxList.c b/xkb/ddxList.c index 034f694ed..a91a9badf 100644 --- a/xkb/ddxList.c +++ b/xkb/ddxList.c @@ -40,7 +40,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "scrnintstr.h" #include "windowstr.h" #define XKBSRV_NEED_FILE_FUNCS -#include +#include #include #ifndef PATH_MAX diff --git a/xkb/ddxLoad.c b/xkb/ddxLoad.c index 6e8f8921c..c24c56c1c 100644 --- a/xkb/ddxLoad.c +++ b/xkb/ddxLoad.c @@ -44,7 +44,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "scrnintstr.h" #include "windowstr.h" #define XKBSRV_NEED_FILE_FUNCS -#include +#include #include #include "xkb.h" @@ -211,7 +211,7 @@ OutputDirectory( } } -Bool +static Bool XkbDDXCompileNamedKeymap( XkbDescPtr xkb, XkbComponentNamesPtr names, char * nameRtrn, @@ -298,7 +298,7 @@ char *cmd = NULL,file[PATH_MAX],xkm_output_dir[PATH_MAX],*map,*outFile; return False; } -Bool +static Bool XkbDDXCompileKeymapByNames( XkbDescPtr xkb, XkbComponentNamesPtr names, unsigned want, @@ -432,7 +432,7 @@ char tmpname[PATH_MAX]; return False; } -FILE * +static FILE * XkbDDXOpenConfigFile(char *mapName,char *fileNameRtrn,int fileNameRtrnLen) { char buf[PATH_MAX],xkm_output_dir[PATH_MAX]; diff --git a/xkb/ddxPrivate.c b/xkb/ddxPrivate.c index 7450b47ba..f67e20c27 100644 --- a/xkb/ddxPrivate.c +++ b/xkb/ddxPrivate.c @@ -6,7 +6,7 @@ #define NEED_EVENTS #include #include "windowstr.h" -#include +#include int XkbDDXPrivate(DeviceIntPtr dev,KeyCode key,XkbAction *act) diff --git a/xkb/ddxVT.c b/xkb/ddxVT.c index f56f0796d..55c82a865 100644 --- a/xkb/ddxVT.c +++ b/xkb/ddxVT.c @@ -36,7 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "inputstr.h" #include "scrnintstr.h" #include "windowstr.h" -#include +#include int XkbDDXSwitchScreen(DeviceIntPtr dev,KeyCode key,XkbAction *act) diff --git a/xkb/maprules.c b/xkb/maprules.c index b0a2225e2..0fa356ee5 100644 --- a/xkb/maprules.c +++ b/xkb/maprules.c @@ -48,7 +48,7 @@ #include "dix.h" #include #define XKBSRV_NEED_FILE_FUNCS -#include +#include #ifdef DEBUG #define PR_DEBUG(s) fprintf(stderr,s) diff --git a/xkb/xkb.c b/xkb/xkb.c index 2c97e05db..cf4243070 100644 --- a/xkb/xkb.c +++ b/xkb/xkb.c @@ -36,23 +36,20 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "misc.h" #include "inputstr.h" #define XKBSRV_NEED_FILE_FUNCS -#include +#include #include "extnsionst.h" #include "xkb.h" #include int XkbEventBase; - int XkbErrorBase; +static int XkbErrorBase; int XkbReqCode; - int XkbKeyboardErrorCode; -Atom xkbONE_LEVEL; -Atom xkbTWO_LEVEL; -Atom xkbKEYPAD; +static int XkbKeyboardErrorCode; CARD32 xkbDebugFlags = 0; -CARD32 xkbDebugCtrls = 0; +static CARD32 xkbDebugCtrls = 0; -RESTYPE RT_XKBCLIENT; +static RESTYPE RT_XKBCLIENT; /***====================================================================***/ @@ -895,52 +892,6 @@ ProcXkbSetControls(ClientPtr client) return client->noClientException; } -/* FIXME: Needs to set rate on all core-sending devices. */ -int -XkbSetRepeatRate(DeviceIntPtr dev,int timeout,int interval,int major,int minor) -{ -int changed= 0; -XkbControlsRec old,*xkb; - - if ((!dev)||(!dev->key)||(!dev->key->xkbInfo)) - return 0; - xkb= dev->key->xkbInfo->desc->ctrls; - old= *xkb; - if ((timeout!=0) && (xkb->repeat_delay!=timeout)) { - xkb->repeat_delay= timeout; - changed++; - } - if ((interval!=0) && (xkb->repeat_interval!=interval)) { - xkb->repeat_interval= interval; - changed++; - } - if (changed) { - xkbControlsNotify cn; - XkbDDXChangeControls(dev,&old,xkb); - if (XkbComputeControlsNotify(dev,&old,xkb,&cn,False)) { - cn.keycode= 0; - cn.eventType = 0; - cn.requestMajor = major; - cn.requestMinor = minor; - XkbSendControlsNotify(dev,&cn); - } - } - return 1; -} - -int -XkbGetRepeatRate(DeviceIntPtr dev,int *timeout,int *interval) -{ -XkbControlsPtr xkb; - - if ((!dev)||(!dev->key)||(!dev->key->xkbInfo)) - return 0; - xkb= dev->key->xkbInfo->desc->ctrls; - if (timeout) *timeout= xkb->repeat_delay; - if (interval) *interval= xkb->repeat_interval; - return 1; -} - /***====================================================================***/ static int @@ -2820,7 +2771,7 @@ ProcXkbGetIndicatorState(ClientPtr client) /***====================================================================***/ -Status +static Status XkbComputeGetIndicatorMapReplySize( XkbIndicatorPtr indicators, xkbGetIndicatorMapReply *rep) @@ -2837,7 +2788,7 @@ int nIndicators; return Success; } -int +static int XkbSendIndicatorMap( ClientPtr client, XkbIndicatorPtr indicators, xkbGetIndicatorMapReply * rep) diff --git a/xkb/xkb.h b/xkb/xkb.h index 2be42582d..99b60bf5e 100644 --- a/xkb/xkb.h +++ b/xkb/xkb.h @@ -1,5 +1,3 @@ -/* $XFree86$ */ - /* #include "XKBfile.h" */ extern int ProcXkbUseExtension(ClientPtr client); @@ -29,50 +27,10 @@ extern int ProcXkbGetDeviceInfo(ClientPtr client); extern int ProcXkbSetDeviceInfo(ClientPtr client); extern int ProcXkbSetDebuggingFlags(ClientPtr client); -extern int XkbSetRepeatRate(DeviceIntPtr dev, int timeout, int interval, int major, int minor); -extern int XkbGetRepeatRate(DeviceIntPtr dev, int *timeout, int *interval); - extern void XkbExtensionInit(void); -extern Status XkbComputeGetIndicatorMapReplySize( - XkbIndicatorPtr indicators, - xkbGetIndicatorMapReply *rep); -extern int XkbSendIndicatorMap( - ClientPtr client, - XkbIndicatorPtr indicators, - xkbGetIndicatorMapReply *rep); - -extern void XkbComputeCompatState(XkbSrvInfoPtr xkbi); -extern void XkbSetPhysicalLockingKey(DeviceIntPtr dev, unsigned key); - extern Bool XkbFilterEvents(ClientPtr pClient, int nEvents, xEvent *xE); -extern Bool XkbApplyLEDChangeToKeyboard( - XkbSrvInfoPtr xkbi, - XkbIndicatorMapPtr map, - Bool on, - XkbChangesPtr change); - -extern Bool XkbWriteRulesProp(ClientPtr client, pointer closure); - -extern XkbAction XkbGetButtonAction(DeviceIntPtr kbd, DeviceIntPtr dev, int button); - -/* extern Status XkbMergeFile(XkbDescPtr xkb, XkbFileInfo finfo); */ - -extern Bool XkbDDXCompileNamedKeymap( - XkbDescPtr xkb, - XkbComponentNamesPtr names, - char * nameRtrn, - int nameRtrnLen); - -extern Bool XkbDDXCompileKeymapByNames( - XkbDescPtr xkb, - XkbComponentNamesPtr names, - unsigned want, - unsigned need, - char * nameRtrn, - int nameRtrnLen); - extern Bool XkbCopyKeymap( XkbDescPtr src, XkbDescPtr dst, diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c index 0ab3dadf6..2954a0c0e 100644 --- a/xkb/xkbAccessX.c +++ b/xkb/xkbAccessX.c @@ -38,7 +38,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include "inputstr.h" -#include +#include #if !defined(WIN32) && !defined(Lynx) #include #endif @@ -52,9 +52,9 @@ pointer XkbLastRepeatEvent= NULL; unsigned short XkbDfltAccessXTimeout= 120; unsigned int XkbDfltAccessXTimeoutMask= DFLT_TIMEOUT_CTRLS; -unsigned int XkbDfltAccessXTimeoutValues= 0; -unsigned int XkbDfltAccessXTimeoutOptionsMask= DFLT_TIMEOUT_OPTS; -unsigned int XkbDfltAccessXTimeoutOptionsValues= 0; +static unsigned int XkbDfltAccessXTimeoutValues= 0; +static unsigned int XkbDfltAccessXTimeoutOptionsMask= DFLT_TIMEOUT_OPTS; +static unsigned int XkbDfltAccessXTimeoutOptionsValues= 0; unsigned int XkbDfltAccessXFeedback= XkbAccessXFeedbackMask; unsigned short XkbDfltAccessXOptions= XkbAX_AllOptionsMask & ~(XkbAX_IndicatorFBMask|XkbAX_SKReleaseFBMask|XkbAX_SKRejectFBMask); diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c index e0bf89c7b..2e0c89fc2 100644 --- a/xkb/xkbActions.c +++ b/xkb/xkbActions.c @@ -36,14 +36,14 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include "misc.h" #include "inputstr.h" -#include +#include #include "xkb.h" #include static unsigned int _xkbServerGeneration; -int xkbDevicePrivateIndex = -1; +static int xkbDevicePrivateIndex = -1; -void +static void xkbUnwrapProc(DeviceIntPtr device, DeviceHandleProc proc, pointer data) { @@ -216,7 +216,7 @@ static XkbAction fake; return fake; } -XkbAction +static XkbAction XkbGetButtonAction(DeviceIntPtr kbd,DeviceIntPtr dev,int button) { XkbAction fake; diff --git a/xkb/xkbDflts.h b/xkb/xkbDflts.h index e31568abb..5d8690650 100644 --- a/xkb/xkbDflts.h +++ b/xkb/xkbDflts.h @@ -456,43 +456,6 @@ static XkbCompatMapRec compatMap= { num_dfltSI, num_dfltSI }; -static XkbIndicatorRec indicators= { - 0x0, - { - { 0x80, 0, 0x00, XkbIM_UseEffective, { LockMask, LockMask, 0 }, 0 }, - { 0x80, 0, 0x00, XkbIM_UseEffective, { 0, 0, vmod_NumLockMask }, 0 }, - { 0x80, 0, 0x00, XkbIM_UseLocked, { ShiftMask, ShiftMask, 0 }, 0 }, - { 0x80, 0, 0x00, 0, { 0, 0, 0 }, XkbMouseKeysMask }, - { 0x80, 0, 0x00, XkbIM_UseLocked, { 0, 0, vmod_ScrollLockMask }, 0 }, - { 0x80, XkbIM_UseEffective, 0xfe, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 } - } -}; static void initIndicatorNames(DPYTYPE dpy,XkbDescPtr xkb) { diff --git a/xkb/xkbEvents.c b/xkb/xkbEvents.c index 139221f3f..11dc17ad3 100644 --- a/xkb/xkbEvents.c +++ b/xkb/xkbEvents.c @@ -36,7 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include "inputstr.h" #include "windowstr.h" -#include +#include #include "xkb.h" /***====================================================================***/ @@ -331,7 +331,7 @@ Time time = 0; return; } -void +static void XkbSendIndicatorNotify(DeviceIntPtr kbd,int xkbType,xkbIndicatorNotify *pEv) { int initialized; @@ -971,48 +971,6 @@ XkbInterestPtr interest; return NULL; } -int -XkbRemoveClient(DevicePtr inDev,ClientPtr client) -{ -XkbSrvInfoPtr xkbi; -DeviceIntPtr dev = (DeviceIntPtr)inDev; -XkbInterestPtr interest; -unsigned long autoCtrls,autoValues; -Bool found; - - found= False; - autoCtrls= autoValues= 0; - if ( dev->xkb_interest ) { - interest = dev->xkb_interest; - if (interest && (interest->client==client)){ - dev->xkb_interest = interest->next; - autoCtrls= interest->autoCtrls; - autoValues= interest->autoCtrlValues; - _XkbFree(interest); - found= True; - } - while ((!found)&&(interest->next)) { - if (interest->next->client==client) { - XkbInterestPtr victim = interest->next; - interest->next = victim->next; - autoCtrls= victim->autoCtrls; - autoValues= victim->autoCtrlValues; - _XkbFree(victim); - found= True; - } - interest = interest->next; - } - } - if (found && autoCtrls && dev->key && dev->key->xkbInfo ) { - XkbEventCauseRec cause; - - xkbi= dev->key->xkbInfo; - XkbSetCauseXkbReq(&cause,X_kbPerClientFlags,client); - XkbEnableDisableControls(xkbi,autoCtrls,autoValues,NULL,&cause); - } - return found; -} - int XkbRemoveResourceClient(DevicePtr inDev,XID id) { diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c index 5aa121da2..716bc26a5 100644 --- a/xkb/xkbInit.c +++ b/xkb/xkbInit.c @@ -47,7 +47,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "opaque.h" #include "property.h" #define XKBSRV_NEED_FILE_FUNCS -#include +#include #include #include #include @@ -124,7 +124,7 @@ typedef struct _SrvXkmInfo { char * XkbBaseDirectory= XKB_BASE_DIRECTORY; char * XkbBinDirectory= XKB_BIN_DIRECTORY; -int XkbWantAccessX= 0; +static int XkbWantAccessX= 0; static XkbFileInfo * _XkbInitFileInfo= NULL; static Bool rulesDefined= False; @@ -134,20 +134,17 @@ static char * XkbLayoutDflt= NULL; static char * XkbVariantDflt= NULL; static char * XkbOptionsDflt= NULL; -char * XkbModelUsed= NULL; -char * XkbLayoutUsed= NULL; -char * XkbVariantUsed= NULL; -char * XkbOptionsUsed= NULL; - -int _XkbClientMajor= XkbMajorVersion; -int _XkbClientMinor= XkbMinorVersion; +static char * XkbModelUsed= NULL; +static char * XkbLayoutUsed= NULL; +static char * XkbVariantUsed= NULL; +static char * XkbOptionsUsed= NULL; _X_EXPORT Bool noXkbExtension= XKB_DFLT_DISABLED; -Bool XkbWantRulesProp= XKB_DFLT_RULES_PROP; +static Bool XkbWantRulesProp= XKB_DFLT_RULES_PROP; /***====================================================================***/ -char * +static char * XkbGetRulesDflts(XkbRF_VarDefsPtr defs) { if (XkbModelDflt) defs->model= XkbModelDflt; @@ -161,7 +158,7 @@ XkbGetRulesDflts(XkbRF_VarDefsPtr defs) return (rulesDefined?XkbRulesFile:XKB_DFLT_RULES_FILE); } -Bool +static Bool XkbWriteRulesProp(ClientPtr client, pointer closure) { int len,out; @@ -230,7 +227,7 @@ char * pval; return True; } -void +static void XkbSetRulesUsed(XkbRF_VarDefsPtr defs) { if (XkbModelUsed) @@ -289,9 +286,6 @@ XkbSetRulesDflts(char *rulesFile,char *model,char *layout, #include "xkbDflts.h" -/* A dummy to keep the compiler quiet */ -pointer xkbBogus = &indicators; - static Bool XkbInitKeyTypes(XkbDescPtr xkb,SrvXkmInfo *file) { diff --git a/xkb/xkbLEDs.c b/xkb/xkbLEDs.c index e94e0bff4..d607d9066 100644 --- a/xkb/xkbLEDs.c +++ b/xkb/xkbLEDs.c @@ -38,7 +38,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "inputstr.h" #include -#include +#include #include "xkb.h" /***====================================================================***/ @@ -82,7 +82,7 @@ XkbSrvLedInfoPtr sli; /* * Bool - * XkbApplyLEDChangeToKeyboard(xkbi,map,on,change) + *XkbApplyLEDChangeToKeyboard(xkbi,map,on,change) * * Some indicators "drive" the keyboard when their state is explicitly * changed, as described in section 9.2.1 of the XKB protocol spec. @@ -91,7 +91,7 @@ XkbSrvLedInfoPtr sli; * when the indicator described by 'map' is turned on or off. The * extent of the changes is reported in change, which must be defined. */ -Bool +static Bool XkbApplyLEDChangeToKeyboard( XkbSrvInfoPtr xkbi, XkbIndicatorMapPtr map, Bool on, @@ -166,6 +166,164 @@ XkbStatePtr state; } return (stateChange || ctrlChange); } + + /* + * Bool + * ComputeAutoState(map,state,ctrls) + * + * This function reports the effect of applying the specified + * indicator map given the specified state and controls, as + * described in section 9.2 of the XKB protocol specification. + */ + +static Bool +ComputeAutoState( XkbIndicatorMapPtr map, + XkbStatePtr state, + XkbControlsPtr ctrls) +{ +Bool on; +CARD8 mods,group; + + on= False; + mods= group= 0; + if (map->which_mods&XkbIM_UseAnyMods) { + if (map->which_mods&XkbIM_UseBase) + mods|= state->base_mods; + if (map->which_mods&XkbIM_UseLatched) + mods|= state->latched_mods; + if (map->which_mods&XkbIM_UseLocked) + mods|= state->locked_mods; + if (map->which_mods&XkbIM_UseEffective) + mods|= state->mods; + if (map->which_mods&XkbIM_UseCompat) + mods|= state->compat_state; + on = ((map->mods.mask&mods)!=0); + on = on||((mods==0)&&(map->mods.mask==0)&&(map->mods.vmods==0)); + } + if (map->which_groups&XkbIM_UseAnyGroup) { + if (map->which_groups&XkbIM_UseBase) + group|= (1L << state->base_group); + if (map->which_groups&XkbIM_UseLatched) + group|= (1L << state->latched_group); + if (map->which_groups&XkbIM_UseLocked) + group|= (1L << state->locked_group); + if (map->which_groups&XkbIM_UseEffective) + group|= (1L << state->group); + on = on||(((map->groups&group)!=0)||(map->groups==0)); + } + if (map->ctrls) + on = on||(ctrls->enabled_ctrls&map->ctrls); + return on; +} + + +static void +XkbUpdateLedAutoState( DeviceIntPtr dev, + XkbSrvLedInfoPtr sli, + unsigned maps_to_check, + xkbExtensionDeviceNotify * ed, + XkbChangesPtr changes, + XkbEventCausePtr cause) +{ +DeviceIntPtr kbd; +XkbStatePtr state; +XkbControlsPtr ctrls; +XkbChangesRec my_changes; +xkbExtensionDeviceNotify my_ed; +register unsigned i,bit,affected; +register XkbIndicatorMapPtr map; +unsigned oldState; + + if ((maps_to_check==0)||(sli->maps==NULL)||(sli->mapsPresent==0)) + return; + + if (dev->key && dev->key->xkbInfo) + kbd= dev; + else kbd= (DeviceIntPtr)LookupKeyboardDevice(); + + state= &kbd->key->xkbInfo->state; + ctrls= kbd->key->xkbInfo->desc->ctrls; + affected= maps_to_check; + oldState= sli->effectiveState; + sli->autoState&= ~affected; + for (i=0,bit=1;(imaps[i]; + if((!(map->flags&XkbIM_NoAutomatic))&&ComputeAutoState(map,state,ctrls)) + sli->autoState|= bit; + } + sli->effectiveState= (sli->autoState|sli->explicitState); + affected= sli->effectiveState^oldState; + if (affected==0) + return; + + if (ed==NULL) { + ed= &my_ed; + bzero((char *)ed,sizeof(xkbExtensionDeviceNotify)); + } + else if ((ed->reason&XkbXI_IndicatorsMask)&& + ((ed->ledClass!=sli->class)||(ed->ledID!=sli->id))) { + XkbFlushLedEvents(dev,kbd,sli,ed,changes,cause); + } + + if ((kbd==dev)&&(sli->flags&XkbSLI_IsDefault)) { + if (changes==NULL) { + changes= &my_changes; + bzero((char *)changes,sizeof(XkbChangesRec)); + } + changes->indicators.state_changes|= affected; + } + + ed->reason|= XkbXI_IndicatorStateMask; + ed->ledClass= sli->class; + ed->ledID= sli->id; + ed->ledsDefined= sli->namesPresent|sli->mapsPresent; + ed->ledState= sli->effectiveState; + ed->unsupported|= XkbXI_IndicatorStateMask; + ed->supported= XkbXI_AllFeaturesMask; + + if (changes!=&my_changes) changes= NULL; + if (ed!=&my_ed) ed= NULL; + if (changes || ed) + XkbFlushLedEvents(dev,kbd,sli,ed,changes,cause); + return; +} + +static void +XkbUpdateAllDeviceIndicators(XkbChangesPtr changes,XkbEventCausePtr cause) +{ +DeviceIntPtr edev; +XkbSrvLedInfoPtr sli; + + for (edev=inputInfo.devices;edev!=NULL;edev=edev->next) { + if (edev->kbdfeed) { + KbdFeedbackPtr kf; + for (kf=edev->kbdfeed;kf!=NULL;kf=kf->next) { + if ((kf->xkb_sli==NULL)||(kf->xkb_sli->maps==NULL)) + continue; + sli= kf->xkb_sli; + XkbUpdateLedAutoState(edev,sli,sli->mapsPresent,NULL, + changes,cause); + + } + } + if (edev->leds) { + LedFeedbackPtr lf; + for (lf=edev->leds;lf!=NULL;lf=lf->next) { + if ((lf->xkb_sli==NULL)||(lf->xkb_sli->maps==NULL)) + continue; + sli= lf->xkb_sli; + XkbUpdateLedAutoState(edev,sli,sli->mapsPresent,NULL, + changes,cause); + + } + } + } + return; +} + /***====================================================================***/ @@ -228,55 +386,6 @@ unsigned side_affected; /***====================================================================***/ - /* - * Bool - * ComputeAutoState(map,state,ctrls) - * - * This function reports the effect of applying the specified - * indicator map given the specified state and controls, as - * described in section 9.2 of the XKB protocol specification. - */ - -static Bool -ComputeAutoState( XkbIndicatorMapPtr map, - XkbStatePtr state, - XkbControlsPtr ctrls) -{ -Bool on; -CARD8 mods,group; - - on= False; - mods= group= 0; - if (map->which_mods&XkbIM_UseAnyMods) { - if (map->which_mods&XkbIM_UseBase) - mods|= state->base_mods; - if (map->which_mods&XkbIM_UseLatched) - mods|= state->latched_mods; - if (map->which_mods&XkbIM_UseLocked) - mods|= state->locked_mods; - if (map->which_mods&XkbIM_UseEffective) - mods|= state->mods; - if (map->which_mods&XkbIM_UseCompat) - mods|= state->compat_state; - on = ((map->mods.mask&mods)!=0); - on = on||((mods==0)&&(map->mods.mask==0)&&(map->mods.vmods==0)); - } - if (map->which_groups&XkbIM_UseAnyGroup) { - if (map->which_groups&XkbIM_UseBase) - group|= (1L << state->base_group); - if (map->which_groups&XkbIM_UseLatched) - group|= (1L << state->latched_group); - if (map->which_groups&XkbIM_UseLocked) - group|= (1L << state->locked_group); - if (map->which_groups&XkbIM_UseEffective) - group|= (1L << state->group); - on = on||(((map->groups&group)!=0)||(map->groups==0)); - } - if (map->ctrls) - on = on||(ctrls->enabled_ctrls&map->ctrls); - return on; -} - /***====================================================================***/ /* @@ -314,39 +423,6 @@ XkbSrvLedInfoPtr sli; /***====================================================================***/ -void -XkbUpdateAllDeviceIndicators(XkbChangesPtr changes,XkbEventCausePtr cause) -{ -DeviceIntPtr edev; -XkbSrvLedInfoPtr sli; - - for (edev=inputInfo.devices;edev!=NULL;edev=edev->next) { - if (edev->kbdfeed) { - KbdFeedbackPtr kf; - for (kf=edev->kbdfeed;kf!=NULL;kf=kf->next) { - if ((kf->xkb_sli==NULL)||(kf->xkb_sli->maps==NULL)) - continue; - sli= kf->xkb_sli; - XkbUpdateLedAutoState(edev,sli,sli->mapsPresent,NULL, - changes,cause); - - } - } - if (edev->leds) { - LedFeedbackPtr lf; - for (lf=edev->leds;lf!=NULL;lf=lf->next) { - if ((lf->xkb_sli==NULL)||(lf->xkb_sli->maps==NULL)) - continue; - sli= lf->xkb_sli; - XkbUpdateLedAutoState(edev,sli,sli->mapsPresent,NULL, - changes,cause); - - } - } - } - return; -} - /***====================================================================***/ /* @@ -856,210 +932,3 @@ Bool kb_changed; XkbUpdateAllDeviceIndicators(NULL,cause); return; } - -/***====================================================================***/ - -void -XkbUpdateLedAutoState( DeviceIntPtr dev, - XkbSrvLedInfoPtr sli, - unsigned maps_to_check, - xkbExtensionDeviceNotify * ed, - XkbChangesPtr changes, - XkbEventCausePtr cause) -{ -DeviceIntPtr kbd; -XkbStatePtr state; -XkbControlsPtr ctrls; -XkbChangesRec my_changes; -xkbExtensionDeviceNotify my_ed; -register unsigned i,bit,affected; -register XkbIndicatorMapPtr map; -unsigned oldState; - - if ((maps_to_check==0)||(sli->maps==NULL)||(sli->mapsPresent==0)) - return; - - if (dev->key && dev->key->xkbInfo) - kbd= dev; - else kbd= (DeviceIntPtr)LookupKeyboardDevice(); - - state= &kbd->key->xkbInfo->state; - ctrls= kbd->key->xkbInfo->desc->ctrls; - affected= maps_to_check; - oldState= sli->effectiveState; - sli->autoState&= ~affected; - for (i=0,bit=1;(imaps[i]; - if((!(map->flags&XkbIM_NoAutomatic))&&ComputeAutoState(map,state,ctrls)) - sli->autoState|= bit; - } - sli->effectiveState= (sli->autoState|sli->explicitState); - affected= sli->effectiveState^oldState; - if (affected==0) - return; - - if (ed==NULL) { - ed= &my_ed; - bzero((char *)ed,sizeof(xkbExtensionDeviceNotify)); - } - else if ((ed->reason&XkbXI_IndicatorsMask)&& - ((ed->ledClass!=sli->class)||(ed->ledID!=sli->id))) { - XkbFlushLedEvents(dev,kbd,sli,ed,changes,cause); - } - - if ((kbd==dev)&&(sli->flags&XkbSLI_IsDefault)) { - if (changes==NULL) { - changes= &my_changes; - bzero((char *)changes,sizeof(XkbChangesRec)); - } - changes->indicators.state_changes|= affected; - } - - ed->reason|= XkbXI_IndicatorStateMask; - ed->ledClass= sli->class; - ed->ledID= sli->id; - ed->ledsDefined= sli->namesPresent|sli->mapsPresent; - ed->ledState= sli->effectiveState; - ed->unsupported|= XkbXI_IndicatorStateMask; - ed->supported= XkbXI_AllFeaturesMask; - - if (changes!=&my_changes) changes= NULL; - if (ed!=&my_ed) ed= NULL; - if (changes || ed) - XkbFlushLedEvents(dev,kbd,sli,ed,changes,cause); - return; -} - -/***====================================================================***/ - -static void -_UpdateButtonVMods( XkbDescPtr xkb, - unsigned num_btns, - XkbAction * acts, - unsigned changed, - xkbExtensionDeviceNotify * ed_inout) -{ -register int i; - - for (i=0;iany.type!=XkbSA_NoAction)&& - XkbUpdateActionVirtualMods(xkb,acts,changed)) { - if ((ed_inout->reason&XkbXI_ButtonActionsMask)==0) { - ed_inout->reason|= XkbXI_ButtonActionsMask; - ed_inout->firstBtn= i; - ed_inout->nBtns= 1; - } - else { - ed_inout->nBtns= (i-ed_inout->firstBtn)+1; - } - } - } - return; -} - -static void -_UpdateMapVMods( XkbDescPtr xkb, - register XkbIndicatorMapPtr map, - unsigned changed_vmods, - unsigned * changed_maps_rtrn) -{ -register int i; - - *changed_maps_rtrn= 0; - for (i=0;imods.vmods&changed_vmods) { - map->mods.mask= map->mods.real_mods; - map->mods.mask|= XkbMaskForVMask(xkb,map->mods.vmods); - *changed_maps_rtrn|= (1L<id; - if ((dev->button)&&(dev->button->xkb_acts)) { - _UpdateButtonVMods(xkb,dev->button->numButtons, - dev->button->xkb_acts,changed,&ed); - } - if (dev->kbdfeed) { - KbdFeedbackPtr kf; - for (kf=dev->kbdfeed;kf!=NULL;kf=kf->next) { - if ((kf->xkb_sli==NULL)||(kf->xkb_sli->maps==NULL)) - continue; - sli= kf->xkb_sli; - _UpdateMapVMods(xkb,sli->maps,changed,&changed_maps); - if (changed_maps) { - if (ed.reason&XkbXI_IndicatorsMask) { - XkbSendExtensionDeviceNotify(dev,NULL,&ed); - ed.reason= 0; - ed.firstBtn= ed.nBtns; - } - ed.ledClass= sli->class; - ed.ledID= sli->id; - ed.ledsDefined= sli->namesPresent|sli->mapsPresent; - ed.reason|= XkbXI_IndicatorMapsMask; - XkbUpdateLedAutoState(dev,sli,changed_maps,&ed,NULL,cause); - } - } - } - if (dev->leds) { - LedFeedbackPtr lf; - for (lf=dev->leds;lf!=NULL;lf=lf->next) { - if ((lf->xkb_sli==NULL)||(lf->xkb_sli->maps==NULL)) - continue; - sli= lf->xkb_sli; - _UpdateMapVMods(xkb,sli->maps,changed,&changed_maps); - if (changed_maps) { - if (ed.reason&XkbXI_IndicatorsMask) { - XkbSendExtensionDeviceNotify(dev,NULL,&ed); - ed.reason= 0; - ed.firstBtn= ed.nBtns; - } - ed.ledClass= sli->class; - ed.ledID= sli->id; - ed.ledsDefined= sli->namesPresent|sli->mapsPresent; - ed.reason|= XkbXI_IndicatorMapsMask; - XkbUpdateLedAutoState(dev,sli,changed_maps,&ed,NULL,cause); - } - } - } - if (ed.reason!=0) - XkbSendExtensionDeviceNotify(dev,NULL,&ed); - return; -} - -void -XkbApplyVModChangesToAllDevices( DeviceIntPtr dev, - XkbDescPtr xkb, - unsigned changed, - XkbEventCausePtr cause) -{ -DeviceIntPtr edev; - if (dev!=(DeviceIntPtr)LookupKeyboardDevice()) - return; - for (edev=inputInfo.devices;edev!=NULL;edev=edev->next) { - if (edev->key) - continue; - _UpdateDeviceVMods(edev,xkb,changed,cause); - } - for (edev=inputInfo.off_devices;edev!=NULL;edev=edev->next) { - if (edev->key) - continue; - _UpdateDeviceVMods(edev,xkb,changed,cause); - } - return; -} diff --git a/xkb/xkbPrKeyEv.c b/xkb/xkbPrKeyEv.c index 9944c8886..81124bcfb 100644 --- a/xkb/xkbPrKeyEv.c +++ b/xkb/xkbPrKeyEv.c @@ -36,7 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include "misc.h" #include "inputstr.h" -#include +#include #include diff --git a/xkb/xkbSwap.c b/xkb/xkbSwap.c index 9a04b77d5..da4c9053b 100644 --- a/xkb/xkbSwap.c +++ b/xkb/xkbSwap.c @@ -35,7 +35,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include "misc.h" #include "inputstr.h" -#include +#include #include #include "extnsionst.h" #include "xkb.h" diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c index 062159ec6..1d2366756 100644 --- a/xkb/xkbUtils.c +++ b/xkb/xkbUtils.c @@ -41,7 +41,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "inputstr.h" #define XKBSRV_NEED_FILE_FUNCS -#include +#include #include #include "xkb.h" @@ -172,44 +172,6 @@ register unsigned mask; return mask; } - -Bool -XkbApplyVModChanges( XkbSrvInfoPtr xkbi, - unsigned changed, - XkbChangesPtr changes, - unsigned * needChecksRtrn, - XkbEventCausePtr cause) -{ -XkbDescPtr xkb; -Bool check; - - xkb= xkbi->desc; -#ifdef DEBUG -{ -register unsigned i,bit; - for (i=0,bit=1;iserver->vmods[i]); - } -} -#endif - check= XkbApplyVirtualModChanges(xkb,changed,changes); - XkbApplyVModChangesToAllDevices(xkbi->device,xkb,changed,cause); - - if (needChecksRtrn!=NULL) { - if (check) - *needChecksRtrn= XkbStateNotifyMask|XkbIndicatorStateNotifyMask; - else *needChecksRtrn= 0; - } - else if (check) { - /* 7/12/95 (ef) -- XXX check compatibility and/or indicator state */ - } - return 1; -} - /***====================================================================***/ void @@ -658,7 +620,7 @@ int changed; return changed; } -void +static void XkbComputeCompatState(XkbSrvInfoPtr xkbi) { CARD16 grp_mask; @@ -772,21 +734,6 @@ XkbCheckSecondaryEffects( XkbSrvInfoPtr xkbi, /***====================================================================***/ -void -XkbSetPhysicalLockingKey(DeviceIntPtr dev,unsigned key) -{ -XkbDescPtr xkb; - - xkb= dev->key->xkbInfo->desc; - if ((key>=xkb->min_key_code) && (key<=xkb->max_key_code)) { - xkb->server->behaviors[key].type= XkbKB_Lock|XkbKB_Permanent; - } - else ErrorF("Internal Error! Bad XKB info in SetPhysicalLockingKey\n"); - return; -} - -/***====================================================================***/ - Bool XkbEnableDisableControls( XkbSrvInfoPtr xkbi, unsigned long change, diff --git a/xkb/xkberrs.c b/xkb/xkberrs.c index 095d573ea..3534356c6 100644 --- a/xkb/xkberrs.c +++ b/xkb/xkberrs.c @@ -32,37 +32,6 @@ #include #include -char * _XkbErrMessages[] = { - "success", /* _XkbSuccess */ - "key names not defined", /* _XkbErrMissingNames */ - "key types not defined", /* _XkbErrMissingTypes */ - "required key types not present", /* _XkbErrMissingReqTypes */ - "symbols not defined", /* _XkbErrMissingSymbols */ - "virtual modifier bindings not defined",/* _XkbErrMissingVMods */ - "indicators not defined", /* _XkbErrMissingIndicators */ - "compatibility map not defined", /* _XkbErrMissingCompatMap */ - "symbol interpretations not defined", /* _XkbErrMissingSymInterps */ - "geometry not defined", /* _XkbErrMissingGeometry */ - "illegal doodad type", /* _XkbErrIllegalDoodad */ - "illegal TOC type", /* _XkbErrIllegalTOCType */ - "illegal contents", /* _XkbErrIllegalContents */ - "empty file", /* _XkbErrEmptyFile */ - "file not found", /* _XkbErrFileNotFound */ - "cannot open", /* _XkbErrFileCannotOpen */ - "bad value", /* _XkbErrBadValue */ - "bad match", /* _XkbErrBadMatch */ - "illegal name for type", /* _XkbErrBadTypeName */ - "illegal width for type", /* _XkbErrBadTypeWidth */ - "bad file type", /* _XkbErrBadFileType */ - "bad file version", /* _XkbErrBadFileVersion */ - "error in Xkm file", /* _XkbErrBadFileFormat */ - "allocation failed", /* _XkbErrBadAlloc */ - "bad length", /* _XkbErrBadLength */ - "X request failed", /* _XkbErrXReqFailure */ - "not implemented" /* _XkbErrBadImplementation */ -}; - unsigned _XkbErrCode; char * _XkbErrLocation= NULL; unsigned _XkbErrData; - diff --git a/xkb/xkbfmisc.c b/xkb/xkbfmisc.c index 4130bd998..05344b475 100644 --- a/xkb/xkbfmisc.c +++ b/xkb/xkbfmisc.c @@ -44,7 +44,7 @@ #include "dix.h" #include #define XKBSRV_NEED_FILE_FUNCS 1 -#include +#include #include #include "xkb.h" @@ -133,76 +133,6 @@ unsigned set,rtrn; /***===================================================================***/ -Bool -XkbLookupGroupAndLevel( XkbDescPtr xkb, - int key, - int * mods_inout, - int * grp_inout, - int * lvl_rtrn) -{ -int nG,eG; - - if ((!xkb)||(!XkbKeycodeInRange(xkb,key))||(!grp_inout)) - return False; - - nG= XkbKeyNumGroups(xkb,key); - eG= *grp_inout; - - if ( nG==0 ) { - *grp_inout= 0; - if (lvl_rtrn!=NULL) - *lvl_rtrn= 0; - return False; - } - else if ( nG==1 ) { - eG= 0; - } - else if ( eG>=nG ) { - unsigned gI= XkbKeyGroupInfo(xkb,key); - switch (XkbOutOfRangeGroupAction(gI)) { - default: - eG %= nG; - break; - case XkbClampIntoRange: - eG = nG-1; - break; - case XkbRedirectIntoRange: - eG = XkbOutOfRangeGroupNumber(gI); - if (eG>=nG) - eG= 0; - break; - } - } - *grp_inout= eG; - if (mods_inout!=NULL) { - XkbKeyTypePtr type; - int preserve; - - type = XkbKeyKeyType(xkb,key,eG); - if (lvl_rtrn!=NULL) - *lvl_rtrn= 0; - preserve= 0; - if (type->map) { /* find the shift level */ - register int i; - register XkbKTMapEntryPtr entry; - for (i=0,entry=type->map;imap_count;i++,entry++) { - if ((entry->active)&& - (((*mods_inout)&type->mods.mask)==entry->mods.mask)){ - if (lvl_rtrn!=NULL) - *lvl_rtrn= entry->level; - if (type->preserve) - preserve= type->preserve[i].mask; - break; - } - } - } - (*mods_inout)&= ~(type->mods.mask&(~preserve)); - } - return True; -} - -/***===================================================================***/ - static Bool XkbWriteSectionFromName(FILE *file,char *sectionName,char *name) { @@ -416,15 +346,6 @@ XkbFileInfo finfo; /***====================================================================***/ -/*ARGSUSED*/ -Status -XkbMergeFile(XkbDescPtr xkb,XkbFileInfo finfo) -{ - return BadImplementation; -} - -/***====================================================================***/ - int XkbFindKeycodeByName(XkbDescPtr xkb,char *name,Bool use_aliases) { @@ -484,34 +405,6 @@ unsigned rtrn; return rtrn; } -unsigned -XkbConvertXkbComponents(Bool toXkm,unsigned orig) -{ -unsigned rtrn; - - rtrn= 0; - if (toXkm) { - if (orig&XkbClientMapMask) rtrn|= XkmTypesMask|XkmSymbolsMask; - if (orig&XkbServerMapMask) rtrn|= XkmTypesMask|XkmSymbolsMask; - if (orig&XkbCompatMapMask) rtrn|= XkmCompatMapMask; - if (orig&XkbIndicatorMapMask) rtrn|= XkmIndicatorsMask; - if (orig&XkbNamesMask) rtrn|= XkmKeyNamesMask; - if (orig&XkbGeometryMask) rtrn|= XkmGeometryMask; - } - else { - if (orig!=0) rtrn|= XkbNamesMask; - if (orig&XkmTypesMask) rtrn|= XkbClientMapMask; - if (orig&XkmCompatMapMask) - rtrn|= XkbCompatMapMask|XkbIndicatorMapMask; - if (orig&XkmSymbolsMask) rtrn|=XkbClientMapMask|XkbServerMapMask; - if (orig&XkmIndicatorsMask) rtrn|= XkbIndicatorMapMask; - if (orig&XkmKeyNamesMask) - rtrn|= XkbNamesMask|XkbIndicatorMapMask; - if (orig&XkmGeometryMask) rtrn|= XkbGeometryMask; - } - return rtrn; -} - Bool XkbDetermineFileType(XkbFileInfoPtr finfo,int format,int *opts_missing) { diff --git a/xkb/xkbout.c b/xkb/xkbout.c index 31cd4fae4..bdec8e7d3 100644 --- a/xkb/xkbout.c +++ b/xkb/xkbout.c @@ -44,7 +44,7 @@ #include "dix.h" #include #define XKBSRV_NEED_FILE_FUNCS 1 -#include +#include #include #include @@ -925,127 +925,3 @@ XkbGeometryPtr geom; fprintf(file,"};\n\n"); return True; } - -/*ARGSUSED*/ -Bool -XkbWriteXKBSemantics( FILE * file, - XkbFileInfo * result, - Bool topLevel, - Bool showImplicit, - XkbFileAddOnFunc addOn, - void * priv) -{ -Bool ok; - - fprintf(file,"xkb_semantics {\n"); - ok= XkbWriteXKBKeyTypes(file,result,False,False,addOn,priv); - ok= ok&&XkbWriteXKBCompatMap(file,result,False,False,addOn,priv); - fprintf(file,"};\n"); - return ok; -} - -/*ARGSUSED*/ -Bool -XkbWriteXKBLayout( FILE * file, - XkbFileInfo * result, - Bool topLevel, - Bool showImplicit, - XkbFileAddOnFunc addOn, - void * priv) -{ -Bool ok; -XkbDescPtr xkb; - - xkb= result->xkb; - fprintf(file,"xkb_layout {\n"); - ok= XkbWriteXKBKeycodes(file,result,False,showImplicit,addOn,priv); - ok= ok&&XkbWriteXKBKeyTypes(file,result,False,showImplicit,addOn,priv); - ok= ok&&XkbWriteXKBSymbols(file,result,False,showImplicit,addOn,priv); - if (xkb->geom) - ok= ok&&XkbWriteXKBGeometry(file,result,False,showImplicit,addOn,priv); - fprintf(file,"};\n"); - return ok; -} - -/*ARGSUSED*/ -Bool -XkbWriteXKBKeymap( FILE * file, - XkbFileInfo * result, - Bool topLevel, - Bool showImplicit, - XkbFileAddOnFunc addOn, - void * priv) -{ -Bool ok; -XkbDescPtr xkb; - - xkb= result->xkb; - fprintf(file,"xkb_keymap {\n"); - ok= XkbWriteXKBKeycodes(file,result,False,showImplicit,addOn,priv); - ok= ok&&XkbWriteXKBKeyTypes(file,result,False,showImplicit,addOn,priv); - ok= ok&&XkbWriteXKBCompatMap(file,result,False,showImplicit,addOn,priv); - ok= ok&&XkbWriteXKBSymbols(file,result,False,showImplicit,addOn,priv); - if (xkb->geom) - ok= ok&&XkbWriteXKBGeometry(file,result,False,showImplicit,addOn,priv); - fprintf(file,"};\n"); - return ok; -} - -Bool -XkbWriteXKBFile( FILE * out, - XkbFileInfo * result, - Bool showImplicit, - XkbFileAddOnFunc addOn, - void * priv) -{ -Bool ok = False; -Bool (*func)( - FILE * /* file */, - XkbFileInfo * /* result */, - Bool /* topLevel */, - Bool /* showImplicit */, - XkbFileAddOnFunc /* addOn */, - void * /* priv */ -) = NULL; - - switch (result->type) { - case XkmSemanticsFile: - func= XkbWriteXKBSemantics; - break; - case XkmLayoutFile: - func= XkbWriteXKBLayout; - break; - case XkmKeymapFile: - func= XkbWriteXKBKeymap; - break; - case XkmTypesIndex: - func= XkbWriteXKBKeyTypes; - break; - case XkmCompatMapIndex: - func= XkbWriteXKBCompatMap; - break; - case XkmSymbolsIndex: - func= XkbWriteXKBSymbols; - break; - case XkmKeyNamesIndex: - func= XkbWriteXKBKeycodes; - break; - case XkmGeometryFile: - case XkmGeometryIndex: - func= XkbWriteXKBGeometry; - break; - case XkmVirtualModsIndex: - case XkmIndicatorsIndex: - _XkbLibError(_XkbErrBadImplementation, - XkbConfigText(result->type,XkbMessage),0); - return False; - } - if (out==NULL) { - _XkbLibError(_XkbErrFileCannotOpen,"XkbWriteXkbFile",0); - ok= False; - } - else if (func) { - ok= (*func)(out,result,True,showImplicit,addOn,priv); - } - return ok; -} diff --git a/xkb/xkbtext.c b/xkb/xkbtext.c index defd45a64..3a5037150 100644 --- a/xkb/xkbtext.c +++ b/xkb/xkbtext.c @@ -44,7 +44,7 @@ #include "dix.h" #include #define XKBSRV_NEED_FILE_FUNCS 1 -#include +#include #include /***====================================================================***/ @@ -448,100 +448,6 @@ char * buf; return buf; } -char * -XkbAccessXDetailText(unsigned state,unsigned format) -{ -char *buf,*prefix; - - buf= tbGetBuffer(32); - if (format==XkbMessage) prefix= ""; - else prefix= "XkbAXN_"; - switch (state){ - case XkbAXN_SKPress: sprintf(buf,"%sSKPress",prefix); break; - case XkbAXN_SKAccept: sprintf(buf,"%sSKAccept",prefix); break; - case XkbAXN_SKRelease: sprintf(buf,"%sSKRelease",prefix); break; - case XkbAXN_SKReject: sprintf(buf,"%sSKReject",prefix); break; - case XkbAXN_BKAccept: sprintf(buf,"%sBKAccept",prefix); break; - case XkbAXN_BKReject: sprintf(buf,"%sBKReject",prefix); break; - case XkbAXN_AXKWarning: sprintf(buf,"%sAXKWarning",prefix); break; - default: sprintf(buf,"ILLEGAL"); break; - } - return buf; -} - -static char *nknNames[] = { - "keycodes", "geometry", "deviceID" -}; -#define NUM_NKN (sizeof(nknNames)/sizeof(char *)) - -char * -XkbNKNDetailMaskText(unsigned detail,unsigned format) -{ -char *buf,*prefix,*suffix; -register int i; -register unsigned bit; -int len,plen,slen; - - - if ((detail&XkbAllNewKeyboardEventsMask)==0) { - char *tmp = ""; - if (format==XkbCFile) tmp= "0"; - else if (format==XkbMessage) tmp= "none"; - buf= tbGetBuffer(strlen(tmp)+1); - strcpy(buf,tmp); - return buf; - } - else if ((detail&XkbAllNewKeyboardEventsMask)==XkbAllNewKeyboardEventsMask){ - char * tmp; - if (format==XkbCFile) tmp= "XkbAllNewKeyboardEventsMask"; - else tmp= "all"; - buf= tbGetBuffer(strlen(tmp)+1); - strcpy(buf,tmp); - return buf; - } - if (format==XkbMessage) { - prefix= ""; - suffix= ""; - slen= plen= 0; - } - else { - prefix= "XkbNKN_"; - plen= 7; - if (format==XkbCFile) - suffix= "Mask"; - else suffix= ""; - slen= strlen(suffix); - } - for (len=0,i=0,bit=1;i #define XKBSRV_NEED_FILE_FUNCS -#include +#include #include Atom @@ -1098,18 +1098,6 @@ unsigned i,size_toc; return 1; } -xkmSectionInfo * -XkmFindTOCEntry(xkmFileInfo *finfo,xkmSectionInfo *toc,unsigned type) -{ -register int i; - - for (i=0;inum_toc;i++) { - if (toc[i].type==type) - return &toc[i]; - } - return NULL; -} - Bool XkmReadFileSection( FILE * file, xkmSectionInfo * toc, -- cgit v1.2.3