xkb: sed True -> TRUE and False -> FALSE

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
This commit is contained in:
Peter Hutterer 2010-01-15 10:07:38 +10:00
parent 0ea2b0bd02
commit db687f718f
19 changed files with 312 additions and 317 deletions

View File

@ -309,11 +309,6 @@ extern _X_EXPORT int DeviceButtonPress,DeviceButtonRelease;
#define Status int #define Status int
#ifndef True
#define True TRUE
#define False FALSE
#endif
extern _X_EXPORT void XkbUseMsg( extern _X_EXPORT void XkbUseMsg(
void void
); );

View File

@ -315,22 +315,22 @@ XkbFreeKeyboard(XkbDescPtr xkb,unsigned which,Bool freeAll)
if (freeAll) if (freeAll)
which= XkbAllComponentsMask; which= XkbAllComponentsMask;
if (which&XkbClientMapMask) if (which&XkbClientMapMask)
XkbFreeClientMap(xkb,XkbAllClientInfoMask,True); XkbFreeClientMap(xkb,XkbAllClientInfoMask,TRUE);
if (which&XkbServerMapMask) if (which&XkbServerMapMask)
XkbFreeServerMap(xkb,XkbAllServerInfoMask,True); XkbFreeServerMap(xkb,XkbAllServerInfoMask,TRUE);
if (which&XkbCompatMapMask) if (which&XkbCompatMapMask)
XkbFreeCompatMap(xkb,XkbAllCompatMask,True); XkbFreeCompatMap(xkb,XkbAllCompatMask,TRUE);
if (which&XkbIndicatorMapMask) if (which&XkbIndicatorMapMask)
XkbFreeIndicatorMaps(xkb); XkbFreeIndicatorMaps(xkb);
if (which&XkbNamesMask) if (which&XkbNamesMask)
XkbFreeNames(xkb,XkbAllNamesMask,True); XkbFreeNames(xkb,XkbAllNamesMask,TRUE);
if ((which&XkbGeometryMask) && (xkb->geom!=NULL)) { if ((which&XkbGeometryMask) && (xkb->geom!=NULL)) {
XkbFreeGeometry(xkb->geom,XkbGeomAllMask,True); XkbFreeGeometry(xkb->geom,XkbGeomAllMask,TRUE);
/* PERHAPS BONGHITS etc */ /* PERHAPS BONGHITS etc */
xkb->geom = NULL; xkb->geom = NULL;
} }
if (which&XkbControlsMask) if (which&XkbControlsMask)
XkbFreeControls(xkb,XkbAllControlsMask,True); XkbFreeControls(xkb,XkbAllControlsMask,TRUE);
if (freeAll) if (freeAll)
xfree(xkb); xfree(xkb);
return; return;

View File

@ -218,7 +218,7 @@ _XkbClearOutline(char *outline_in)
XkbOutlinePtr outline= (XkbOutlinePtr)outline_in; XkbOutlinePtr outline= (XkbOutlinePtr)outline_in;
if (outline->points!=NULL) if (outline->points!=NULL)
XkbFreeGeomPoints(outline,0,outline->num_points,True); XkbFreeGeomPoints(outline,0,outline->num_points,TRUE);
return; return;
} }
@ -241,7 +241,7 @@ _XkbClearShape(char *shape_in)
XkbShapePtr shape= (XkbShapePtr)shape_in; XkbShapePtr shape= (XkbShapePtr)shape_in;
if (shape->outlines) if (shape->outlines)
XkbFreeGeomOutlines(shape,0,shape->num_outlines,True); XkbFreeGeomOutlines(shape,0,shape->num_outlines,TRUE);
return; return;
} }
@ -275,7 +275,7 @@ _XkbClearOverlayRow(char *row_in)
XkbOverlayRowPtr row= (XkbOverlayRowPtr)row_in; XkbOverlayRowPtr row= (XkbOverlayRowPtr)row_in;
if (row->keys!=NULL) if (row->keys!=NULL)
XkbFreeGeomOverlayKeys(row,0,row->num_keys,True); XkbFreeGeomOverlayKeys(row,0,row->num_keys,TRUE);
return; return;
} }
@ -297,7 +297,7 @@ _XkbClearOverlay(char *overlay_in)
XkbOverlayPtr overlay= (XkbOverlayPtr)overlay_in; XkbOverlayPtr overlay= (XkbOverlayPtr)overlay_in;
if (overlay->rows!=NULL) if (overlay->rows!=NULL)
XkbFreeGeomOverlayRows(overlay,0,overlay->num_rows,True); XkbFreeGeomOverlayRows(overlay,0,overlay->num_rows,TRUE);
return; return;
} }
@ -331,7 +331,7 @@ _XkbClearRow(char *row_in)
XkbRowPtr row= (XkbRowPtr)row_in; XkbRowPtr row= (XkbRowPtr)row_in;
if (row->keys!=NULL) if (row->keys!=NULL)
XkbFreeGeomKeys(row,0,row->num_keys,True); XkbFreeGeomKeys(row,0,row->num_keys,TRUE);
return; return;
} }
@ -352,9 +352,9 @@ _XkbClearSection(char *section_in)
XkbSectionPtr section= (XkbSectionPtr)section_in; XkbSectionPtr section= (XkbSectionPtr)section_in;
if (section->rows!=NULL) if (section->rows!=NULL)
XkbFreeGeomRows(section,0,section->num_rows,True); XkbFreeGeomRows(section,0,section->num_rows,TRUE);
if (section->doodads!=NULL) { if (section->doodads!=NULL) {
XkbFreeGeomDoodads(section->doodads,section->num_doodads,True); XkbFreeGeomDoodads(section->doodads,section->num_doodads,TRUE);
section->doodads= NULL; section->doodads= NULL;
} }
return; return;
@ -426,20 +426,20 @@ XkbFreeGeometry(XkbGeometryPtr geom,unsigned which,Bool freeMap)
if (freeMap) if (freeMap)
which= XkbGeomAllMask; which= XkbGeomAllMask;
if ((which&XkbGeomPropertiesMask)&&(geom->properties!=NULL)) if ((which&XkbGeomPropertiesMask)&&(geom->properties!=NULL))
XkbFreeGeomProperties(geom,0,geom->num_properties,True); XkbFreeGeomProperties(geom,0,geom->num_properties,TRUE);
if ((which&XkbGeomColorsMask)&&(geom->colors!=NULL)) if ((which&XkbGeomColorsMask)&&(geom->colors!=NULL))
XkbFreeGeomColors(geom,0,geom->num_colors,True); XkbFreeGeomColors(geom,0,geom->num_colors,TRUE);
if ((which&XkbGeomShapesMask)&&(geom->shapes!=NULL)) if ((which&XkbGeomShapesMask)&&(geom->shapes!=NULL))
XkbFreeGeomShapes(geom,0,geom->num_shapes,True); XkbFreeGeomShapes(geom,0,geom->num_shapes,TRUE);
if ((which&XkbGeomSectionsMask)&&(geom->sections!=NULL)) if ((which&XkbGeomSectionsMask)&&(geom->sections!=NULL))
XkbFreeGeomSections(geom,0,geom->num_sections,True); XkbFreeGeomSections(geom,0,geom->num_sections,TRUE);
if ((which&XkbGeomDoodadsMask)&&(geom->doodads!= NULL)) { if ((which&XkbGeomDoodadsMask)&&(geom->doodads!= NULL)) {
XkbFreeGeomDoodads(geom->doodads,geom->num_doodads,True); XkbFreeGeomDoodads(geom->doodads,geom->num_doodads,TRUE);
geom->doodads= NULL; geom->doodads= NULL;
geom->num_doodads= geom->sz_doodads= 0; geom->num_doodads= geom->sz_doodads= 0;
} }
if ((which&XkbGeomKeyAliasesMask)&&(geom->key_aliases!=NULL)) if ((which&XkbGeomKeyAliasesMask)&&(geom->key_aliases!=NULL))
XkbFreeGeomKeyAliases(geom,0,geom->num_key_aliases,True); XkbFreeGeomKeyAliases(geom,0,geom->num_key_aliases,TRUE);
if (freeMap) { if (freeMap) {
if (geom->label_font!=NULL) { if (geom->label_font!=NULL) {
xfree(geom->label_font); xfree(geom->label_font);
@ -646,7 +646,7 @@ Status rtrn;
} }
return Success; return Success;
BAIL: BAIL:
XkbFreeGeometry(geom,XkbGeomAllMask,True); XkbFreeGeometry(geom,XkbGeomAllMask,TRUE);
xkb->geom= NULL; xkb->geom= NULL;
return rtrn; return rtrn;
} }
@ -919,9 +919,9 @@ Bool found;
if (row->row_under>=section->num_rows) if (row->row_under>=section->num_rows)
return NULL; return NULL;
row_under= &section->rows[row->row_under]; row_under= &section->rows[row->row_under];
for (i=0,found=False;i<row_under->num_keys;i++) { for (i=0,found=FALSE;i<row_under->num_keys;i++) {
if (strncmp(under,row_under->keys[i].name.name,XkbKeyNameLength)==0) { if (strncmp(under,row_under->keys[i].name.name,XkbKeyNameLength)==0) {
found= True; found= TRUE;
break; break;
} }
} }

View File

@ -187,7 +187,7 @@ BOOL replicated = FALSE;
if (syms[0]==NoSymbol) { if (syms[0]==NoSymbol) {
register int n; register int n;
Bool found; Bool found;
for (n=1,found=False;(!found)&&(n<nSyms[i]);n++) { for (n=1,found=FALSE;(!found)&&(n<nSyms[i]);n++) {
found= (syms[n]!=NoSymbol); found= (syms[n]!=NoSymbol);
} }
if (!found) if (!found)
@ -227,27 +227,27 @@ BOOL replicated = FALSE;
* the core replication. * the core replication.
*/ */
if (nGroups>1) { if (nGroups>1) {
Bool sameType,allOneLevel, canonical = True; Bool sameType,allOneLevel, canonical = TRUE;
allOneLevel= (xkb->map->types[types_inout[0]].num_levels==1); allOneLevel= (xkb->map->types[types_inout[0]].num_levels==1);
for (i=1,sameType=True;(allOneLevel||sameType)&&(i<nGroups);i++) { for (i=1,sameType=TRUE;(allOneLevel||sameType)&&(i<nGroups);i++) {
sameType=(sameType&&(types_inout[i]==types_inout[XkbGroup1Index])); sameType=(sameType&&(types_inout[i]==types_inout[XkbGroup1Index]));
if (allOneLevel) if (allOneLevel)
allOneLevel= (xkb->map->types[types_inout[i]].num_levels==1); allOneLevel= (xkb->map->types[types_inout[i]].num_levels==1);
if (types_inout[i] > XkbLastRequiredType) if (types_inout[i] > XkbLastRequiredType)
canonical = False; canonical = FALSE;
} }
if (((sameType) || canonical)&& if (((sameType) || canonical)&&
(!(protected&(XkbExplicitKeyTypesMask&~XkbExplicitKeyType1Mask)))){ (!(protected&(XkbExplicitKeyTypesMask&~XkbExplicitKeyType1Mask)))){
register int s; register int s;
Bool identical; Bool identical;
for (i=1,identical=True;identical&&(i<nGroups);i++) { for (i=1,identical=TRUE;identical&&(i<nGroups);i++) {
KeySym *syms; KeySym *syms;
if (nSyms[i] != nSyms[XkbGroup1Index]) if (nSyms[i] != nSyms[XkbGroup1Index])
identical = False; identical = FALSE;
syms= &xkb_syms_rtrn[XKB_OFFSET(i,0)]; syms= &xkb_syms_rtrn[XKB_OFFSET(i,0)];
for (s=0;identical&&(s<nSyms[i]);s++) { for (s=0;identical&&(s<nSyms[i]);s++) {
if (syms[s]!=xkb_syms_rtrn[s]) if (syms[s]!=xkb_syms_rtrn[s])
identical= False; identical= FALSE;
} }
} }
if (identical) if (identical)
@ -374,16 +374,16 @@ unsigned changed,tmp;
if ((!xkb)||(!xkb->map)||(!xkb->map->key_sym_map)|| if ((!xkb)||(!xkb->map)||(!xkb->map->key_sym_map)||
(!xkb->compat)||(!xkb->compat->sym_interpret)|| (!xkb->compat)||(!xkb->compat->sym_interpret)||
(key<xkb->min_key_code)||(key>xkb->max_key_code)) { (key<xkb->min_key_code)||(key>xkb->max_key_code)) {
return False; return FALSE;
} }
if (((!xkb->server)||(!xkb->server->key_acts))&& if (((!xkb->server)||(!xkb->server->key_acts))&&
(XkbAllocServerMap(xkb,XkbAllServerInfoMask,0)!=Success)) { (XkbAllocServerMap(xkb,XkbAllServerInfoMask,0)!=Success)) {
return False; return FALSE;
} }
changed= 0; /* keeps track of what has changed in _this_ call */ changed= 0; /* keeps track of what has changed in _this_ call */
explicit= xkb->server->explicit[key]; explicit= xkb->server->explicit[key];
if (explicit&XkbExplicitInterpretMask) /* nothing to do */ if (explicit&XkbExplicitInterpretMask) /* nothing to do */
return True; return TRUE;
mods= (xkb->map->modmap?xkb->map->modmap[key]:0); mods= (xkb->map->modmap?xkb->map->modmap[key]:0);
nSyms= XkbKeyNumSyms(xkb,key); nSyms= XkbKeyNumSyms(xkb,key);
syms= XkbKeySymsPtr(xkb,key); syms= XkbKeySymsPtr(xkb,key);
@ -423,7 +423,7 @@ unsigned changed,tmp;
if (!pActs) { if (!pActs) {
if (nSyms > IBUF_SIZE) if (nSyms > IBUF_SIZE)
xfree(interps); xfree(interps);
return False; return FALSE;
} }
new_vmodmask= 0; new_vmodmask= 0;
for (n=0;n<nSyms;n++) { for (n=0;n<nSyms;n++) {
@ -508,7 +508,7 @@ unsigned changed,tmp;
} }
if (interps!=ibuf) if (interps!=ibuf)
xfree(interps); xfree(interps);
return True; return TRUE;
} }
Status Status
@ -642,19 +642,19 @@ register int i,bit;
register unsigned mask; register unsigned mask;
if (xkb==NULL) if (xkb==NULL)
return False; return FALSE;
if (virtual_mask==0) { if (virtual_mask==0) {
*mask_rtrn= 0; *mask_rtrn= 0;
return True; return TRUE;
} }
if (xkb->server==NULL) if (xkb->server==NULL)
return False; return FALSE;
for (i=mask=0,bit=1;i<XkbNumVirtualMods;i++,bit<<=1) { for (i=mask=0,bit=1;i<XkbNumVirtualMods;i++,bit<<=1) {
if (virtual_mask&bit) if (virtual_mask&bit)
mask|= xkb->server->vmods[i]; mask|= xkb->server->vmods[i];
} }
*mask_rtrn= mask; *mask_rtrn= mask;
return True; return TRUE;
} }
/***====================================================================***/ /***====================================================================***/
@ -670,7 +670,7 @@ unsigned int tmp;
XkbVirtualModsToReal(xkb,tmp,&tmp); XkbVirtualModsToReal(xkb,tmp,&tmp);
act->mods.mask= act->mods.real_mods; act->mods.mask= act->mods.real_mods;
act->mods.mask|= tmp; act->mods.mask|= tmp;
return True; return TRUE;
} }
break; break;
case XkbSA_ISOLock: case XkbSA_ISOLock:
@ -678,11 +678,11 @@ unsigned int tmp;
XkbVirtualModsToReal(xkb,tmp,&tmp); XkbVirtualModsToReal(xkb,tmp,&tmp);
act->iso.mask= act->iso.real_mods; act->iso.mask= act->iso.real_mods;
act->iso.mask|= tmp; act->iso.mask|= tmp;
return True; return TRUE;
} }
break; break;
} }
return False; return FALSE;
} }
static void static void
@ -740,7 +740,7 @@ register int i;
unsigned int checkState = 0; unsigned int checkState = 0;
if ((!xkb) || (!xkb->map) || (changed==0)) if ((!xkb) || (!xkb->map) || (changed==0))
return False; return FALSE;
for (i=0;i<xkb->map->num_types;i++) { for (i=0;i<xkb->map->num_types;i++) {
if (xkb->map->types[i].mods.vmods & changed) if (xkb->map->types[i].mods.vmods & changed)
XkbUpdateKeyTypeVirtualMods(xkb,&xkb->map->types[i],changed,changes); XkbUpdateKeyTypeVirtualMods(xkb,&xkb->map->types[i],changed,changes);
@ -753,7 +753,7 @@ unsigned int checkState = 0;
xkb->ctrls->internal.mask= newMask; xkb->ctrls->internal.mask= newMask;
if (changes) { if (changes) {
changes->ctrls.changed_ctrls|= XkbInternalModsMask; changes->ctrls.changed_ctrls|= XkbInternalModsMask;
checkState= True; checkState= TRUE;
} }
} }
} }
@ -765,7 +765,7 @@ unsigned int checkState = 0;
xkb->ctrls->ignore_lock.mask= newMask; xkb->ctrls->ignore_lock.mask= newMask;
if (changes) { if (changes) {
changes->ctrls.changed_ctrls|= XkbIgnoreLockModsMask; changes->ctrls.changed_ctrls|= XkbIgnoreLockModsMask;
checkState= True; checkState= TRUE;
} }
} }
} }
@ -781,7 +781,7 @@ unsigned int checkState = 0;
map->mods.mask= newMask; map->mods.mask= newMask;
if (changes) { if (changes) {
changes->indicators.map_changes|= (1<<i); changes->indicators.map_changes|= (1<<i);
checkState= True; checkState= TRUE;
} }
} }
} }
@ -798,7 +798,7 @@ unsigned int checkState = 0;
compat->groups[i].mask= newMask; compat->groups[i].mask= newMask;
if (changes) { if (changes) {
changes->compat.changed_groups|= (1<<i); changes->compat.changed_groups|= (1<<i);
checkState= True; checkState= TRUE;
} }
} }
} }

View File

@ -89,7 +89,7 @@ static char doesPitch = 1;
#define STICKY_UNLOCK "AX_StickyUnlock" #define STICKY_UNLOCK "AX_StickyUnlock"
#define BOUNCE_REJECT "AX_BounceKeyReject" #define BOUNCE_REJECT "AX_BounceKeyReject"
#define MAKE_ATOM(a) MakeAtom(a,sizeof(a)-1,True) #define MAKE_ATOM(a) MakeAtom(a,sizeof(a)-1,TRUE)
static void static void
_XkbDDXBeepInitAtoms(void) _XkbDDXBeepInitAtoms(void)

View File

@ -148,7 +148,7 @@ char tmpname[PATH_MAX];
} }
in= NULL; in= NULL;
haveDir= True; haveDir= TRUE;
#ifdef WIN32 #ifdef WIN32
strcpy(tmpname, Win32TempDir()); strcpy(tmpname, Win32TempDir());
strcat(tmpname, "\\xkb_XXXXXX"); strcat(tmpname, "\\xkb_XXXXXX");
@ -160,7 +160,7 @@ char tmpname[PATH_MAX];
in= fopen(buf,"r"); in= fopen(buf,"r");
} }
if (!in) { if (!in) {
haveDir= False; haveDir= FALSE;
buf = Xprintf( buf = Xprintf(
"'%s/xkbcomp' '-R%s/%s' -w %ld -l -vlfhpR '%s'" W32_tmparg, "'%s/xkbcomp' '-R%s/%s' -w %ld -l -vlfhpR '%s'" W32_tmparg,
XkbBinDirectory,XkbBaseDirectory,componentDirs[what],(long) XkbBinDirectory,XkbBaseDirectory,componentDirs[what],(long)
@ -175,7 +175,7 @@ char tmpname[PATH_MAX];
in= fopen(buf,"r"); in= fopen(buf,"r");
} }
if (!in) { if (!in) {
haveDir= False; haveDir= FALSE;
buf = Xprintf( buf = Xprintf(
"xkbcomp -R%s -w %ld -l -vlfhpR '%s'" W32_tmparg, "xkbcomp -R%s -w %ld -l -vlfhpR '%s'" W32_tmparg,
componentDirs[what],(long) componentDirs[what],(long)

View File

@ -266,7 +266,7 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb,
} }
if (buf != NULL) if (buf != NULL)
xfree (buf); xfree (buf);
return True; return TRUE;
} }
else else
LogMessage(X_ERROR, "Error compiling keymap (%s)\n", keymap); LogMessage(X_ERROR, "Error compiling keymap (%s)\n", keymap);
@ -286,7 +286,7 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb,
nameRtrn[0]= '\0'; nameRtrn[0]= '\0';
if (buf != NULL) if (buf != NULL)
xfree (buf); xfree (buf);
return False; return FALSE;
} }
static FILE * static FILE *
@ -386,38 +386,38 @@ Bool complete;
XkbRF_RulesPtr rules; XkbRF_RulesPtr rules;
if (!rules_name) if (!rules_name)
return False; return FALSE;
if (strlen(XkbBaseDirectory) + strlen(rules_name) + 8 > PATH_MAX) { if (strlen(XkbBaseDirectory) + strlen(rules_name) + 8 > PATH_MAX) {
LogMessage(X_ERROR, "XKB: Rules name is too long\n"); LogMessage(X_ERROR, "XKB: Rules name is too long\n");
return False; return FALSE;
} }
sprintf(buf,"%s/rules/%s", XkbBaseDirectory, rules_name); sprintf(buf,"%s/rules/%s", XkbBaseDirectory, rules_name);
file = fopen(buf, "r"); file = fopen(buf, "r");
if (!file) { if (!file) {
LogMessage(X_ERROR, "XKB: Couldn't open rules file %s\n", buf); LogMessage(X_ERROR, "XKB: Couldn't open rules file %s\n", buf);
return False; return FALSE;
} }
rules = XkbRF_Create(); rules = XkbRF_Create();
if (!rules) { if (!rules) {
LogMessage(X_ERROR, "XKB: Couldn't create rules struct\n"); LogMessage(X_ERROR, "XKB: Couldn't create rules struct\n");
fclose(file); fclose(file);
return False; return FALSE;
} }
if (!XkbRF_LoadRules(file, rules)) { if (!XkbRF_LoadRules(file, rules)) {
LogMessage(X_ERROR, "XKB: Couldn't parse rules file %s\n", rules_name); LogMessage(X_ERROR, "XKB: Couldn't parse rules file %s\n", rules_name);
fclose(file); fclose(file);
XkbRF_Free(rules,True); XkbRF_Free(rules,TRUE);
return False; return FALSE;
} }
memset(names, 0, sizeof(*names)); memset(names, 0, sizeof(*names));
complete = XkbRF_GetComponents(rules,defs,names); complete = XkbRF_GetComponents(rules,defs,names);
fclose(file); fclose(file);
XkbRF_Free(rules, True); XkbRF_Free(rules, TRUE);
if (!complete) if (!complete)
LogMessage(X_ERROR, "XKB: Rules returned no components\n"); LogMessage(X_ERROR, "XKB: Rules returned no components\n");

View File

@ -113,15 +113,15 @@ GetInputLine(FILE *file,InputLine *line,Bool checkbang)
int ch; int ch;
Bool endOfFile,spacePending,slashPending,inComment; Bool endOfFile,spacePending,slashPending,inComment;
endOfFile= False; endOfFile= FALSE;
while ((!endOfFile)&&(line->num_line==0)) { while ((!endOfFile)&&(line->num_line==0)) {
spacePending= slashPending= inComment= False; spacePending= slashPending= inComment= FALSE;
while (((ch=getc(file))!='\n')&&(ch!=EOF)) { while (((ch=getc(file))!='\n')&&(ch!=EOF)) {
if (ch=='\\') { if (ch=='\\') {
if ((ch=getc(file))==EOF) if ((ch=getc(file))==EOF)
break; break;
if (ch=='\n') { if (ch=='\n') {
inComment= False; inComment= FALSE;
ch= ' '; ch= ' ';
line->line_num++; line->line_num++;
} }
@ -130,21 +130,21 @@ Bool endOfFile,spacePending,slashPending,inComment;
continue; continue;
if (ch=='/') { if (ch=='/') {
if (slashPending) { if (slashPending) {
inComment= True; inComment= TRUE;
slashPending= False; slashPending= FALSE;
} }
else { else {
slashPending= True; slashPending= TRUE;
} }
continue; continue;
} }
else if (slashPending) { else if (slashPending) {
if (spacePending) { if (spacePending) {
ADD_CHAR(line,' '); ADD_CHAR(line,' ');
spacePending= False; spacePending= FALSE;
} }
ADD_CHAR(line,'/'); ADD_CHAR(line,'/');
slashPending= False; slashPending= FALSE;
} }
if (isspace(ch)) { if (isspace(ch)) {
while (isspace(ch)&&(ch!='\n')&&(ch!=EOF)) { while (isspace(ch)&&(ch!='\n')&&(ch!=EOF)) {
@ -153,13 +153,13 @@ Bool endOfFile,spacePending,slashPending,inComment;
if (ch==EOF) if (ch==EOF)
break; break;
if ((ch!='\n')&&(line->num_line>0)) if ((ch!='\n')&&(line->num_line>0))
spacePending= True; spacePending= TRUE;
ungetc(ch,file); ungetc(ch,file);
} }
else { else {
if (spacePending) { if (spacePending) {
ADD_CHAR(line,' '); ADD_CHAR(line,' ');
spacePending= False; spacePending= FALSE;
} }
if (checkbang && ch=='!') { if (checkbang && ch=='!') {
if (line->num_line!=0) { if (line->num_line!=0) {
@ -175,13 +175,13 @@ Bool endOfFile,spacePending,slashPending,inComment;
} }
} }
if (ch==EOF) if (ch==EOF)
endOfFile= True; endOfFile= TRUE;
/* else line->num_line++;*/ /* else line->num_line++;*/
} }
if ((line->num_line==0)&&(endOfFile)) if ((line->num_line==0)&&(endOfFile))
return False; return FALSE;
ADD_CHAR(line,'\0'); ADD_CHAR(line,'\0');
return True; return TRUE;
} }
/***====================================================================***/ /***====================================================================***/
@ -273,7 +273,7 @@ Bool found;
bzero((char *)remap,sizeof(RemapSpec)); bzero((char *)remap,sizeof(RemapSpec));
remap->number = len; remap->number = len;
while ((tok=_XStrtok(str," ",strtok_buf))!=NULL) { while ((tok=_XStrtok(str," ",strtok_buf))!=NULL) {
found= False; found= FALSE;
str= NULL; str= NULL;
if (strcmp(tok,"=")==0) if (strcmp(tok,"=")==0)
continue; continue;
@ -294,7 +294,7 @@ Bool found;
} else { } else {
ndx = 0; ndx = 0;
} }
found= True; found= TRUE;
if (present&(1<<i)) { if (present&(1<<i)) {
if ((i == LAYOUT && l_ndx_present&(1<<ndx)) || if ((i == LAYOUT && l_ndx_present&(1<<ndx)) ||
(i == VARIANT && v_ndx_present&(1<<ndx)) ) { (i == VARIANT && v_ndx_present&(1<<ndx)) ) {
@ -358,9 +358,9 @@ int want_len= strlen(wanted);
len= strlen(str); len= strlen(str);
} }
if ((len==want_len)&&(strncmp(wanted,str,len)==0)) if ((len==want_len)&&(strncmp(wanted,str,len)==0))
return True; return TRUE;
} }
return False; return FALSE;
} }
/***====================================================================***/ /***====================================================================***/
@ -375,7 +375,7 @@ char * str,*tok;
register int nread, i; register int nread, i;
FileSpec tmp; FileSpec tmp;
_Xstrtokparams strtok_buf; _Xstrtokparams strtok_buf;
Bool append = False; Bool append = FALSE;
if (line->line[0]=='!') { if (line->line[0]=='!') {
if (line->line[1] == '$' || if (line->line[1] == '$' ||
@ -383,14 +383,14 @@ Bool append = False;
char *gname = strchr(line->line, '$'); char *gname = strchr(line->line, '$');
char *words = strchr(gname, ' '); char *words = strchr(gname, ' ');
if(!words) if(!words)
return False; return FALSE;
*words++ = '\0'; *words++ = '\0';
for (; *words; words++) { for (; *words; words++) {
if (*words != '=' && *words != ' ') if (*words != '=' && *words != ' ')
break; break;
} }
if (*words == '\0') if (*words == '\0')
return False; return FALSE;
group->name = _XkbDupString(gname); group->name = _XkbDupString(gname);
group->words = _XkbDupString(words); group->words = _XkbDupString(words);
for (i = 1, words = group->words; *words; words++) { for (i = 1, words = group->words; *words; words++) {
@ -400,17 +400,17 @@ Bool append = False;
} }
} }
group->number = i; group->number = i;
return True; return TRUE;
} else { } else {
SetUpRemap(line,remap); SetUpRemap(line,remap);
return False; return FALSE;
} }
} }
if (remap->num_remap==0) { if (remap->num_remap==0) {
DebugF("Must have a mapping before first line of data\n"); DebugF("Must have a mapping before first line of data\n");
DebugF("Illegal line of data ignored\n"); DebugF("Illegal line of data ignored\n");
return False; return FALSE;
} }
bzero((char *)&tmp,sizeof(FileSpec)); bzero((char *)&tmp,sizeof(FileSpec));
str= line->line; str= line->line;
@ -427,12 +427,12 @@ Bool append = False;
} }
tmp.name[remap->remap[nread].word]= tok; tmp.name[remap->remap[nread].word]= tok;
if (*tok == '+' || *tok == '|') if (*tok == '+' || *tok == '|')
append = True; append = TRUE;
} }
if (nread<remap->num_remap) { if (nread<remap->num_remap) {
DebugF("Too few words on a line: %s\n", line->line); DebugF("Too few words on a line: %s\n", line->line);
DebugF("line ignored\n"); DebugF("line ignored\n");
return False; return FALSE;
} }
rule->flags= 0; rule->flags= 0;
@ -463,7 +463,7 @@ Bool append = False;
rule->variant_num = remap->remap[i].index; rule->variant_num = remap->remap[i].index;
} }
} }
return True; return TRUE;
} }
static char * static char *
@ -508,7 +508,7 @@ MakeMultiDefs(XkbRF_MultiDefsPtr mdefs, XkbRF_VarDefsPtr defs)
int i; int i;
mdefs->layout[1] = _XkbDupString(defs->layout); mdefs->layout[1] = _XkbDupString(defs->layout);
if (mdefs->layout[1] == NULL) if (mdefs->layout[1] == NULL)
return False; return FALSE;
squeeze_spaces(mdefs->layout[1]); squeeze_spaces(mdefs->layout[1]);
p = mdefs->layout[1]; p = mdefs->layout[1];
for (i = 2; i <= XkbNumKbdGroups; i++) { for (i = 2; i <= XkbNumKbdGroups; i++) {
@ -532,7 +532,7 @@ MakeMultiDefs(XkbRF_MultiDefsPtr mdefs, XkbRF_VarDefsPtr defs)
int i; int i;
mdefs->variant[1] = _XkbDupString(defs->variant); mdefs->variant[1] = _XkbDupString(defs->variant);
if (mdefs->variant[1] == NULL) if (mdefs->variant[1] == NULL)
return False; return FALSE;
squeeze_spaces(mdefs->variant[1]); squeeze_spaces(mdefs->variant[1]);
p = mdefs->variant[1]; p = mdefs->variant[1];
for (i = 2; i <= XkbNumKbdGroups; i++) { for (i = 2; i <= XkbNumKbdGroups; i++) {
@ -547,7 +547,7 @@ MakeMultiDefs(XkbRF_MultiDefsPtr mdefs, XkbRF_VarDefsPtr defs)
*p = '\0'; *p = '\0';
} }
} }
return True; return TRUE;
} }
static void static void
@ -599,13 +599,13 @@ CheckGroup( XkbRF_RulesPtr rules,
} }
} }
if (i == rules->num_groups) if (i == rules->num_groups)
return False; return FALSE;
for (i = 0, p = group->words; i < group->number; i++, p += strlen(p)+1) { for (i = 0, p = group->words; i < group->number; i++, p += strlen(p)+1) {
if (! strcmp(p, name)) { if (! strcmp(p, name)) {
return True; return TRUE;
} }
} }
return False; return FALSE;
} }
static int static int
@ -614,13 +614,13 @@ XkbRF_CheckApplyRule( XkbRF_RulePtr rule,
XkbComponentNamesPtr names, XkbComponentNamesPtr names,
XkbRF_RulesPtr rules) XkbRF_RulesPtr rules)
{ {
Bool pending = False; Bool pending = FALSE;
if (rule->model != NULL) { if (rule->model != NULL) {
if(mdefs->model == NULL) if(mdefs->model == NULL)
return 0; return 0;
if (strcmp(rule->model, "*") == 0) { if (strcmp(rule->model, "*") == 0) {
pending = True; pending = TRUE;
} else { } else {
if (rule->model[0] == '$') { if (rule->model[0] == '$') {
if (!CheckGroup(rules, rule->model, mdefs->model)) if (!CheckGroup(rules, rule->model, mdefs->model))
@ -643,7 +643,7 @@ XkbRF_CheckApplyRule( XkbRF_RulePtr rule,
*mdefs->layout[rule->layout_num] == '\0') *mdefs->layout[rule->layout_num] == '\0')
return 0; return 0;
if (strcmp(rule->layout, "*") == 0) { if (strcmp(rule->layout, "*") == 0) {
pending = True; pending = TRUE;
} else { } else {
if (rule->layout[0] == '$') { if (rule->layout[0] == '$') {
if (!CheckGroup(rules, rule->layout, if (!CheckGroup(rules, rule->layout,
@ -660,7 +660,7 @@ XkbRF_CheckApplyRule( XkbRF_RulePtr rule,
*mdefs->variant[rule->variant_num] == '\0') *mdefs->variant[rule->variant_num] == '\0')
return 0; return 0;
if (strcmp(rule->variant, "*") == 0) { if (strcmp(rule->variant, "*") == 0) {
pending = True; pending = TRUE;
} else { } else {
if (rule->variant[0] == '$') { if (rule->variant[0] == '$') {
if (!CheckGroup(rules, rule->variant, if (!CheckGroup(rules, rule->variant,
@ -911,11 +911,11 @@ XkbRF_RuleRec trule,*rule;
XkbRF_GroupRec tgroup,*group; XkbRF_GroupRec tgroup,*group;
if (!(rules && file)) if (!(rules && file))
return False; return FALSE;
bzero((char *)&remap,sizeof(RemapSpec)); bzero((char *)&remap,sizeof(RemapSpec));
bzero((char *)&tgroup,sizeof(XkbRF_GroupRec)); bzero((char *)&tgroup,sizeof(XkbRF_GroupRec));
InitInputLine(&line); InitInputLine(&line);
while (GetInputLine(file,&line,True)) { while (GetInputLine(file,&line,TRUE)) {
if (CheckLine(&line,&remap,&trule,&tgroup)) { if (CheckLine(&line,&remap,&trule,&tgroup)) {
if (tgroup.number) { if (tgroup.number) {
if ((group= XkbRF_AddGroup(rules))!=NULL) { if ((group= XkbRF_AddGroup(rules))!=NULL) {
@ -932,7 +932,7 @@ XkbRF_GroupRec tgroup,*group;
line.num_line= 0; line.num_line= 0;
} }
FreeInputLine(&line); FreeInputLine(&line);
return True; return TRUE;
} }
Bool Bool
@ -943,15 +943,15 @@ char buf[PATH_MAX];
Bool ok; Bool ok;
if ((!base)||(!rules)) if ((!base)||(!rules))
return False; return FALSE;
if (locale) { if (locale) {
if (strlen(base)+strlen(locale)+2 > PATH_MAX) if (strlen(base)+strlen(locale)+2 > PATH_MAX)
return False; return FALSE;
sprintf(buf,"%s-%s", base, locale); sprintf(buf,"%s-%s", base, locale);
} }
else { else {
if (strlen(base)+1 > PATH_MAX) if (strlen(base)+1 > PATH_MAX)
return False; return FALSE;
strcpy(buf,base); strcpy(buf,base);
} }
@ -961,7 +961,7 @@ Bool ok;
file= fopen(buf, "r"); file= fopen(buf, "r");
} }
if (!file) if (!file)
return False; return FALSE;
ok= XkbRF_LoadRules(file,rules); ok= XkbRF_LoadRules(file,rules);
fclose(file); fclose(file);
return ok; return ok;

View File

@ -637,10 +637,10 @@ ProcXkbLatchLockState(ClientPtr client)
sn.requestMinor = X_kbLatchLockState; sn.requestMinor = X_kbLatchLockState;
sn.changed = changed; sn.changed = changed;
XkbSendStateNotify(tmpd, &sn); XkbSendStateNotify(tmpd, &sn);
changed = XkbIndicatorsToUpdate(tmpd, changed, False); changed = XkbIndicatorsToUpdate(tmpd, changed, FALSE);
if (changed) { if (changed) {
XkbSetCauseXkbReq(&cause, X_kbLatchLockState, client); XkbSetCauseXkbReq(&cause, X_kbLatchLockState, client);
XkbUpdateIndicators(tmpd, changed, True, NULL, &cause); XkbUpdateIndicators(tmpd, changed, TRUE, NULL, &cause);
} }
} }
} }
@ -922,7 +922,7 @@ ProcXkbSetControls(ClientPtr client)
*ctrl= new; *ctrl= new;
XkbDDXChangeControls(tmpd, &old, ctrl); XkbDDXChangeControls(tmpd, &old, ctrl);
if (XkbComputeControlsNotify(tmpd, &old, ctrl, &cn, False)) { if (XkbComputeControlsNotify(tmpd, &old, ctrl, &cn, FALSE)) {
cn.keycode = 0; cn.keycode = 0;
cn.eventType = 0; cn.eventType = 0;
cn.requestMajor = XkbReqCode; cn.requestMajor = XkbReqCode;
@ -932,13 +932,13 @@ ProcXkbSetControls(ClientPtr client)
sli = XkbFindSrvLedInfo(tmpd, XkbDfltXIClass, XkbDfltXIId, 0); sli = XkbFindSrvLedInfo(tmpd, XkbDfltXIClass, XkbDfltXIId, 0);
if (sli) if (sli)
XkbUpdateIndicators(tmpd, sli->usesControls, True, NULL, XkbUpdateIndicators(tmpd, sli->usesControls, TRUE, NULL,
&cause); &cause);
/* If sticky keys were disabled, clear all locks and latches */ /* If sticky keys were disabled, clear all locks and latches */
if ((old.enabled_ctrls & XkbStickyKeysMask) && if ((old.enabled_ctrls & XkbStickyKeysMask) &&
!(ctrl->enabled_ctrls & XkbStickyKeysMask)) !(ctrl->enabled_ctrls & XkbStickyKeysMask))
XkbClearAllLatchesAndLocks(tmpd, xkbi, True, &cause); XkbClearAllLatchesAndLocks(tmpd, xkbi, TRUE, &cause);
} }
} }
@ -2115,7 +2115,7 @@ unsigned first,last;
cn.requestMinor= X_kbSetMap; cn.requestMinor= X_kbSetMap;
old= *xkb->ctrls; old= *xkb->ctrls;
xkb->ctrls->num_groups= s; xkb->ctrls->num_groups= s;
if (XkbComputeControlsNotify(dev,&old,xkb->ctrls,&cn,False)) if (XkbComputeControlsNotify(dev,&old,xkb->ctrls,&cn,FALSE))
XkbSendControlsNotify(dev,&cn); XkbSendControlsNotify(dev,&cn);
} }
return (char *)wire; return (char *)wire;
@ -2439,7 +2439,7 @@ _XkbSetMap(ClientPtr client, DeviceIntPtr dev, xkbSetMapReq *req, char *values)
XkbSetCauseXkbReq(&cause,X_kbSetMap,client); XkbSetCauseXkbReq(&cause,X_kbSetMap,client);
bzero(&change, sizeof(change)); bzero(&change, sizeof(change));
sentNKN = False; sentNKN = FALSE;
if ((xkb->min_key_code!=req->minKeyCode)|| if ((xkb->min_key_code!=req->minKeyCode)||
(xkb->max_key_code!=req->maxKeyCode)) { (xkb->max_key_code!=req->maxKeyCode)) {
Status status; Status status;
@ -2457,7 +2457,7 @@ _XkbSetMap(ClientPtr client, DeviceIntPtr dev, xkbSetMapReq *req, char *values)
nkn.requestMinor = X_kbSetMap; nkn.requestMinor = X_kbSetMap;
nkn.changed = XkbNKN_KeycodesMask; nkn.changed = XkbNKN_KeycodesMask;
XkbSendNewKeyboardNotify(dev,&nkn); XkbSendNewKeyboardNotify(dev,&nkn);
sentNKN = True; sentNKN = TRUE;
} }
if (req->present&XkbKeyTypesMask) { if (req->present&XkbKeyTypesMask) {
@ -2727,7 +2727,7 @@ ProcXkbGetCompatMap(ClientPtr client)
/** /**
* Apply the given request on the given device. * Apply the given request on the given device.
* If dryRun is True, then value checks are performed, but the device isn't * If dryRun is TRUE, then value checks are performed, but the device isn't
* modified. * modified.
*/ */
static int static int
@ -3218,7 +3218,7 @@ ProcXkbGetNamedIndicator(ClientPtr client)
rep.deviceID = dev->id; rep.deviceID = dev->id;
rep.indicator= stuff->indicator; rep.indicator= stuff->indicator;
if (map!=NULL) { if (map!=NULL) {
rep.found= True; rep.found= TRUE;
rep.on= ((sli->effectiveState&(1<<i))!=0); rep.on= ((sli->effectiveState&(1<<i))!=0);
rep.realIndicator= ((sli->physIndicators&(1<<i))!=0); rep.realIndicator= ((sli->physIndicators&(1<<i))!=0);
rep.ndx= i; rep.ndx= i;
@ -3230,12 +3230,12 @@ ProcXkbGetNamedIndicator(ClientPtr client)
rep.realMods= map->mods.real_mods; rep.realMods= map->mods.real_mods;
rep.virtualMods= map->mods.vmods; rep.virtualMods= map->mods.vmods;
rep.ctrls= map->ctrls; rep.ctrls= map->ctrls;
rep.supported= True; rep.supported= TRUE;
} }
else { else {
rep.found= False; rep.found= FALSE;
rep.on= False; rep.on= FALSE;
rep.realIndicator= False; rep.realIndicator= FALSE;
rep.ndx= XkbNoIndicator; rep.ndx= XkbNoIndicator;
rep.flags= 0; rep.flags= 0;
rep.whichGroups= 0; rep.whichGroups= 0;
@ -3245,7 +3245,7 @@ ProcXkbGetNamedIndicator(ClientPtr client)
rep.realMods= 0; rep.realMods= 0;
rep.virtualMods= 0; rep.virtualMods= 0;
rep.ctrls= 0; rep.ctrls= 0;
rep.supported= True; rep.supported= TRUE;
} }
if ( client->swapped ) { if ( client->swapped ) {
register int n; register int n;
@ -3291,7 +3291,7 @@ _XkbFindNamedIndicatorMap(XkbSrvLedInfoPtr sli, Atom indicator,
} }
/** /**
* Creates an indicator map on the device. If dryRun is True, it only checks * Creates an indicator map on the device. If dryRun is TRUE, it only checks
* if creation is possible, but doesn't actually create it. * if creation is possible, but doesn't actually create it.
*/ */
static int static int
@ -3863,8 +3863,8 @@ const char * str;
str= NameForAtom(name); str= NameForAtom(name);
if ((strcmp(str,"ONE_LEVEL")==0)||(strcmp(str,"TWO_LEVEL")==0)|| if ((strcmp(str,"ONE_LEVEL")==0)||(strcmp(str,"TWO_LEVEL")==0)||
(strcmp(str,"ALPHABETIC")==0)||(strcmp(str,"KEYPAD")==0)) (strcmp(str,"ALPHABETIC")==0)||(strcmp(str,"KEYPAD")==0))
return False; return FALSE;
return True; return TRUE;
} }
/** /**
@ -4703,7 +4703,7 @@ int len;
len+= XkbSizeGeomDoodads(geom->num_doodads,geom->doodads); len+= XkbSizeGeomDoodads(geom->num_doodads,geom->doodads);
len+= XkbSizeGeomKeyAliases(geom); len+= XkbSizeGeomKeyAliases(geom);
rep->length= len/4; rep->length= len/4;
rep->found= True; rep->found= TRUE;
rep->name= geom->name; rep->name= geom->name;
rep->widthMM= geom->width_mm; rep->widthMM= geom->width_mm;
rep->heightMM= geom->height_mm; rep->heightMM= geom->height_mm;
@ -4718,7 +4718,7 @@ int len;
} }
else { else {
rep->length= 0; rep->length= 0;
rep->found= False; rep->found= FALSE;
rep->name= name; rep->name= name;
rep->widthMM= rep->heightMM= 0; rep->widthMM= rep->heightMM= 0;
rep->nProperties= rep->nColors= rep->nShapes= 0; rep->nProperties= rep->nColors= rep->nShapes= 0;
@ -4786,7 +4786,7 @@ XkbSendGeometry( ClientPtr client,
if (start!=NULL) if (start!=NULL)
xfree((char *)start); xfree((char *)start);
if (freeGeom) if (freeGeom)
XkbFreeGeometry(geom,XkbGeomAllMask,True); XkbFreeGeometry(geom,XkbGeomAllMask,TRUE);
return client->noClientException; return client->noClientException;
} }
@ -5280,14 +5280,14 @@ _XkbSetGeometry(ClientPtr client, DeviceIntPtr dev, xkbSetGeometryReq *stuff)
geom->width_mm= stuff->widthMM; geom->width_mm= stuff->widthMM;
geom->height_mm= stuff->heightMM; geom->height_mm= stuff->heightMM;
if ((status= _CheckSetGeom(geom,stuff,client))!=Success) { if ((status= _CheckSetGeom(geom,stuff,client))!=Success) {
XkbFreeGeometry(geom,XkbGeomAllMask,True); XkbFreeGeometry(geom,XkbGeomAllMask,TRUE);
xkb->geom= old; xkb->geom= old;
return status; return status;
} }
new_name= (xkb->names->geometry!=geom->name); new_name= (xkb->names->geometry!=geom->name);
xkb->names->geometry= geom->name; xkb->names->geometry= geom->name;
if (old) if (old)
XkbFreeGeometry(old,XkbGeomAllMask,True); XkbFreeGeometry(old,XkbGeomAllMask,TRUE);
if (new_name) { if (new_name) {
xkbNamesNotify nn; xkbNamesNotify nn;
bzero(&nn,sizeof(xkbNamesNotify)); bzero(&nn,sizeof(xkbNamesNotify));
@ -5499,11 +5499,11 @@ ProcXkbListComponents(ClientPtr client)
str= (unsigned char *)&stuff[1]; str= (unsigned char *)&stuff[1];
bzero(&list,sizeof(XkbSrvListInfoRec)); bzero(&list,sizeof(XkbSrvListInfoRec));
list.maxRtrn= stuff->maxNames; list.maxRtrn= stuff->maxNames;
list.pattern[_XkbListKeycodes]= GetComponentSpec(&str,False,&status); list.pattern[_XkbListKeycodes]= GetComponentSpec(&str,FALSE,&status);
list.pattern[_XkbListTypes]= GetComponentSpec(&str,False,&status); list.pattern[_XkbListTypes]= GetComponentSpec(&str,FALSE,&status);
list.pattern[_XkbListCompat]= GetComponentSpec(&str,False,&status); list.pattern[_XkbListCompat]= GetComponentSpec(&str,FALSE,&status);
list.pattern[_XkbListSymbols]= GetComponentSpec(&str,False,&status); list.pattern[_XkbListSymbols]= GetComponentSpec(&str,FALSE,&status);
list.pattern[_XkbListGeometry]= GetComponentSpec(&str,False,&status); list.pattern[_XkbListGeometry]= GetComponentSpec(&str,FALSE,&status);
if (status!=Success) if (status!=Success)
return status; return status;
len= str-((unsigned char *)stuff); len= str-((unsigned char *)stuff);
@ -5587,13 +5587,13 @@ ProcXkbGetKbdByName(ClientPtr client)
xkb = dev->key->xkbInfo->desc; xkb = dev->key->xkbInfo->desc;
status= Success; status= Success;
str= (unsigned char *)&stuff[1]; str= (unsigned char *)&stuff[1];
if (GetComponentSpec(&str,True,&status)) /* keymap, unsupported */ if (GetComponentSpec(&str,TRUE,&status)) /* keymap, unsupported */
return BadMatch; return BadMatch;
names.keycodes= GetComponentSpec(&str,True,&status); names.keycodes= GetComponentSpec(&str,TRUE,&status);
names.types= GetComponentSpec(&str,True,&status); names.types= GetComponentSpec(&str,TRUE,&status);
names.compat= GetComponentSpec(&str,True,&status); names.compat= GetComponentSpec(&str,TRUE,&status);
names.symbols= GetComponentSpec(&str,True,&status); names.symbols= GetComponentSpec(&str,TRUE,&status);
names.geometry= GetComponentSpec(&str,True,&status); names.geometry= GetComponentSpec(&str,TRUE,&status);
if (status!=Success) if (status!=Success)
return status; return status;
len= str-((unsigned char *)stuff); len= str-((unsigned char *)stuff);
@ -5619,7 +5619,7 @@ ProcXkbGetKbdByName(ClientPtr client)
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;
} }
bzero(mapFile,PATH_MAX); bzero(mapFile,PATH_MAX);
@ -5629,10 +5629,10 @@ ProcXkbGetKbdByName(ClientPtr client)
rep.length = 0; rep.length = 0;
rep.minKeyCode = xkb->min_key_code; rep.minKeyCode = xkb->min_key_code;
rep.maxKeyCode = xkb->max_key_code; rep.maxKeyCode = xkb->max_key_code;
rep.loaded= False; rep.loaded= FALSE;
fwant= XkbConvertGetByNameComponents(True,stuff->want)|XkmVirtualModsMask; fwant= XkbConvertGetByNameComponents(TRUE,stuff->want)|XkmVirtualModsMask;
fneed= XkbConvertGetByNameComponents(True,stuff->need); fneed= XkbConvertGetByNameComponents(TRUE,stuff->need);
rep.reported= XkbConvertGetByNameComponents(False,fwant|fneed); rep.reported= XkbConvertGetByNameComponents(FALSE,fwant|fneed);
if (stuff->load) { if (stuff->load) {
fneed|= XkmKeymapRequired; fneed|= XkmKeymapRequired;
fwant|= XkmKeymapLegal; fwant|= XkmKeymapLegal;
@ -5645,7 +5645,7 @@ ProcXkbGetKbdByName(ClientPtr client)
/* We pass dev in here so we can get the old names out if needed. */ /* We pass dev in here so we can get the old names out if needed. */
rep.found = XkbDDXLoadKeymapByNames(dev,&names,fwant,fneed,&new, rep.found = XkbDDXLoadKeymapByNames(dev,&names,fwant,fneed,&new,
mapFile,PATH_MAX); mapFile,PATH_MAX);
rep.newKeyboard= False; rep.newKeyboard= FALSE;
rep.pad1= rep.pad2= rep.pad3= rep.pad4= 0; rep.pad1= rep.pad2= rep.pad3= rep.pad4= 0;
stuff->want|= stuff->need; stuff->want|= stuff->need;
@ -5653,7 +5653,7 @@ ProcXkbGetKbdByName(ClientPtr client)
rep.reported= 0; rep.reported= 0;
else { else {
if (stuff->load) if (stuff->load)
rep.loaded= True; rep.loaded= TRUE;
if (stuff->load || if (stuff->load ||
((rep.reported&XkbGBN_SymbolsMask) && (new->compat))) { ((rep.reported&XkbGBN_SymbolsMask) && (new->compat))) {
XkbChangesRec changes; XkbChangesRec changes;
@ -5789,7 +5789,7 @@ ProcXkbGetKbdByName(ClientPtr client)
grep.deviceID= dev->id; grep.deviceID= dev->id;
grep.sequenceNumber= client->sequence; grep.sequenceNumber= client->sequence;
grep.length= 0; grep.length= 0;
grep.found= True; grep.found= TRUE;
grep.pad= 0; grep.pad= 0;
grep.widthMM= grep.heightMM= 0; grep.widthMM= grep.heightMM= 0;
grep.nProperties= grep.nColors= grep.nShapes= 0; grep.nProperties= grep.nColors= grep.nShapes= 0;
@ -5818,7 +5818,7 @@ ProcXkbGetKbdByName(ClientPtr client)
if (reported&(XkbGBN_KeyNamesMask|XkbGBN_OtherNamesMask)) if (reported&(XkbGBN_KeyNamesMask|XkbGBN_OtherNamesMask))
XkbSendNames(client,new,&nrep); XkbSendNames(client,new,&nrep);
if (reported&XkbGBN_GeometryMask) if (reported&XkbGBN_GeometryMask)
XkbSendGeometry(client,new->geom,&grep,False); XkbSendGeometry(client,new->geom,&grep,FALSE);
if (rep.loaded) { if (rep.loaded) {
XkbDescPtr old_xkb; XkbDescPtr old_xkb;
xkbNewKeyboardNotify nkn; xkbNewKeyboardNotify nkn;
@ -5883,7 +5883,7 @@ ProcXkbGetKbdByName(ClientPtr client)
} }
} }
if ((new!=NULL)&&(new!=xkb)) { if ((new!=NULL)&&(new!=xkb)) {
XkbFreeKeyboard(new,XkbAllComponentsMask,True); XkbFreeKeyboard(new,XkbAllComponentsMask,TRUE);
new= NULL; new= NULL;
} }
if (names.keycodes) { xfree(names.keycodes); names.keycodes= NULL; } if (names.keycodes) { xfree(names.keycodes); names.keycodes= NULL; }
@ -5944,10 +5944,10 @@ Bool classOk;
return XkbKeyboardErrorCode; return XkbKeyboardErrorCode;
} }
} }
classOk= False; classOk= FALSE;
if ((dev->kbdfeed)&&((class==KbdFeedbackClass)||(class==XkbAllXIClasses))) { if ((dev->kbdfeed)&&((class==KbdFeedbackClass)||(class==XkbAllXIClasses))) {
KbdFeedbackPtr kf; KbdFeedbackPtr kf;
classOk= True; classOk= TRUE;
for (kf= dev->kbdfeed;(kf);kf=kf->next) { for (kf= dev->kbdfeed;(kf);kf=kf->next) {
if ((id!=XkbAllXIIds)&&(id!=XkbDfltXIId)&&(id!=kf->ctrl.id)) if ((id!=XkbAllXIIds)&&(id!=XkbDfltXIId)&&(id!=kf->ctrl.id))
continue; continue;
@ -5962,7 +5962,7 @@ Bool classOk;
} }
if ((dev->leds)&&((class==LedFeedbackClass)||(class==XkbAllXIClasses))) { if ((dev->leds)&&((class==LedFeedbackClass)||(class==XkbAllXIClasses))) {
LedFeedbackPtr lf; LedFeedbackPtr lf;
classOk= True; classOk= TRUE;
for (lf= dev->leds;(lf);lf=lf->next) { for (lf= dev->leds;(lf);lf=lf->next) {
if ((id!=XkbAllXIIds)&&(id!=XkbDfltXIId)&&(id!=lf->ctrl.id)) if ((id!=XkbAllXIIds)&&(id!=XkbDfltXIId)&&(id!=lf->ctrl.id))
continue; continue;

View File

@ -161,14 +161,14 @@ XkbSrvLedInfoPtr sli;
old= *ctrls; old= *ctrls;
ctrls->enabled_ctrls |= (KRGControl&XkbAX_KRGMask); ctrls->enabled_ctrls |= (KRGControl&XkbAX_KRGMask);
if (XkbComputeControlsNotify(dev,&old,ctrls,pCN,False)) if (XkbComputeControlsNotify(dev,&old,ctrls,pCN,FALSE))
XkbSendControlsNotify(dev,pCN); XkbSendControlsNotify(dev,pCN);
cause.kc= pCN->keycode; cause.kc= pCN->keycode;
cause.event= pCN->eventType; cause.event= pCN->eventType;
cause.mjr= pCN->requestMajor; cause.mjr= pCN->requestMajor;
cause.mnr= pCN->requestMinor; cause.mnr= pCN->requestMinor;
sli= XkbFindSrvLedInfo(dev,XkbDfltXIClass,XkbDfltXIId,0); sli= XkbFindSrvLedInfo(dev,XkbDfltXIClass,XkbDfltXIId,0);
XkbUpdateIndicators(dev,sli->usesControls,True,NULL,&cause); XkbUpdateIndicators(dev,sli->usesControls,TRUE,NULL,&cause);
if (XkbAX_NeedFeedback(ctrls,XkbAX_FeatureFBMask)) if (XkbAX_NeedFeedback(ctrls,XkbAX_FeatureFBMask))
XkbDDXAccessXBeep(dev,_BEEP_FEATURE_ON,KRGControl); XkbDDXAccessXBeep(dev,_BEEP_FEATURE_ON,KRGControl);
return; return;
@ -193,14 +193,14 @@ XkbSrvLedInfoPtr sli;
old = *ctrls; old = *ctrls;
ctrls->enabled_ctrls &= ~XkbAX_KRGMask; ctrls->enabled_ctrls &= ~XkbAX_KRGMask;
if (XkbComputeControlsNotify(dev,&old,ctrls,pCN,False)) if (XkbComputeControlsNotify(dev,&old,ctrls,pCN,FALSE))
XkbSendControlsNotify(dev,pCN); XkbSendControlsNotify(dev,pCN);
cause.kc= pCN->keycode; cause.kc= pCN->keycode;
cause.event= pCN->eventType; cause.event= pCN->eventType;
cause.mjr= pCN->requestMajor; cause.mjr= pCN->requestMajor;
cause.mnr= pCN->requestMinor; cause.mnr= pCN->requestMinor;
sli= XkbFindSrvLedInfo(dev,XkbDfltXIClass,XkbDfltXIId,0); sli= XkbFindSrvLedInfo(dev,XkbDfltXIClass,XkbDfltXIId,0);
XkbUpdateIndicators(dev,sli->usesControls,True,NULL,&cause); XkbUpdateIndicators(dev,sli->usesControls,TRUE,NULL,&cause);
if (XkbAX_NeedFeedback(ctrls,XkbAX_FeatureFBMask)) { if (XkbAX_NeedFeedback(ctrls,XkbAX_FeatureFBMask)) {
unsigned changes= old.enabled_ctrls^ctrls->enabled_ctrls; unsigned changes= old.enabled_ctrls^ctrls->enabled_ctrls;
XkbDDXAccessXBeep(dev,_BEEP_FEATURE_OFF,changes); XkbDDXAccessXBeep(dev,_BEEP_FEATURE_OFF,changes);
@ -228,14 +228,14 @@ XkbSrvLedInfoPtr sli;
old = *ctrls; old = *ctrls;
ctrls->enabled_ctrls |= XkbStickyKeysMask; ctrls->enabled_ctrls |= XkbStickyKeysMask;
xkbi->shiftKeyCount = 0; xkbi->shiftKeyCount = 0;
if (XkbComputeControlsNotify(dev,&old,ctrls,pCN,False)) if (XkbComputeControlsNotify(dev,&old,ctrls,pCN,FALSE))
XkbSendControlsNotify(dev,pCN); XkbSendControlsNotify(dev,pCN);
cause.kc= pCN->keycode; cause.kc= pCN->keycode;
cause.event= pCN->eventType; cause.event= pCN->eventType;
cause.mjr= pCN->requestMajor; cause.mjr= pCN->requestMajor;
cause.mnr= pCN->requestMinor; cause.mnr= pCN->requestMinor;
sli= XkbFindSrvLedInfo(dev,XkbDfltXIClass,XkbDfltXIId,0); sli= XkbFindSrvLedInfo(dev,XkbDfltXIClass,XkbDfltXIId,0);
XkbUpdateIndicators(dev,sli->usesControls,True,NULL,&cause); XkbUpdateIndicators(dev,sli->usesControls,TRUE,NULL,&cause);
if (XkbAX_NeedFeedback(ctrls,XkbAX_FeatureFBMask)) { if (XkbAX_NeedFeedback(ctrls,XkbAX_FeatureFBMask)) {
XkbDDXAccessXBeep(dev,_BEEP_FEATURE_ON,XkbStickyKeysMask); XkbDDXAccessXBeep(dev,_BEEP_FEATURE_ON,XkbStickyKeysMask);
} }
@ -262,7 +262,7 @@ XkbSrvLedInfoPtr sli;
old = *ctrls; old = *ctrls;
ctrls->enabled_ctrls &= ~XkbStickyKeysMask; ctrls->enabled_ctrls &= ~XkbStickyKeysMask;
xkbi->shiftKeyCount = 0; xkbi->shiftKeyCount = 0;
if (XkbComputeControlsNotify(dev,&old,ctrls,pCN,False)) if (XkbComputeControlsNotify(dev,&old,ctrls,pCN,FALSE))
XkbSendControlsNotify(dev,pCN); XkbSendControlsNotify(dev,pCN);
cause.kc= pCN->keycode; cause.kc= pCN->keycode;
@ -270,12 +270,12 @@ XkbSrvLedInfoPtr sli;
cause.mjr= pCN->requestMajor; cause.mjr= pCN->requestMajor;
cause.mnr= pCN->requestMinor; cause.mnr= pCN->requestMinor;
sli= XkbFindSrvLedInfo(dev,XkbDfltXIClass,XkbDfltXIId,0); sli= XkbFindSrvLedInfo(dev,XkbDfltXIClass,XkbDfltXIId,0);
XkbUpdateIndicators(dev,sli->usesControls,True,NULL,&cause); XkbUpdateIndicators(dev,sli->usesControls,TRUE,NULL,&cause);
if (XkbAX_NeedFeedback(ctrls,XkbAX_FeatureFBMask)) { if (XkbAX_NeedFeedback(ctrls,XkbAX_FeatureFBMask)) {
XkbDDXAccessXBeep(dev,_BEEP_FEATURE_OFF,XkbStickyKeysMask); XkbDDXAccessXBeep(dev,_BEEP_FEATURE_OFF,XkbStickyKeysMask);
} }
#ifndef NO_CLEAR_LATCHES_FOR_STICKY_KEYS_OFF #ifndef NO_CLEAR_LATCHES_FOR_STICKY_KEYS_OFF
XkbClearAllLatchesAndLocks(dev,xkbi,False,&cause); XkbClearAllLatchesAndLocks(dev,xkbi,FALSE,&cause);
#endif #endif
return; return;
} /* AccessXStickyKeysTurnOff */ } /* AccessXStickyKeysTurnOff */
@ -311,7 +311,7 @@ XkbSrvInfoPtr xkbi = dev->key->xkbInfo;
if (xkbi->repeatKey == 0) if (xkbi->repeatKey == 0)
return 0; return 0;
AccessXKeyboardEvent(dev, ET_KeyPress, xkbi->repeatKey, True); AccessXKeyboardEvent(dev, ET_KeyPress, xkbi->repeatKey, TRUE);
return xkbi->desc->ctrls->repeat_interval; return xkbi->desc->ctrls->repeat_interval;
} }
@ -346,7 +346,7 @@ XkbControlsPtr ctrls;
XkbSendAccessXNotify(keybd,&ev); XkbSendAccessXNotify(keybd,&ev);
if (XkbAX_NeedFeedback(ctrls,XkbAX_SKAcceptFBMask)) if (XkbAX_NeedFeedback(ctrls,XkbAX_SKAcceptFBMask))
XkbDDXAccessXBeep(keybd,_BEEP_SLOW_ACCEPT,XkbSlowKeysMask); XkbDDXAccessXBeep(keybd,_BEEP_SLOW_ACCEPT,XkbSlowKeysMask);
AccessXKeyboardEvent(keybd, ET_KeyPress,xkbi->slowKey,False); AccessXKeyboardEvent(keybd, ET_KeyPress,xkbi->slowKey,FALSE);
/* check for magic sequences */ /* check for magic sequences */
if ((ctrls->enabled_ctrls&XkbAccessXKeysMask) && if ((ctrls->enabled_ctrls&XkbAccessXKeysMask) &&
((sym[0]==XK_Shift_R)||(sym[0]==XK_Shift_L))) ((sym[0]==XK_Shift_R)||(sym[0]==XK_Shift_L)))
@ -405,7 +405,7 @@ XkbSrvLedInfoPtr sli;
ctrls->ax_options&= ~ctrls->axt_opts_mask; ctrls->ax_options&= ~ctrls->axt_opts_mask;
ctrls->ax_options|= (ctrls->axt_opts_values&ctrls->axt_opts_mask); ctrls->ax_options|= (ctrls->axt_opts_values&ctrls->axt_opts_mask);
} }
if (XkbComputeControlsNotify(dev,&old,ctrls,&cn,False)) { if (XkbComputeControlsNotify(dev,&old,ctrls,&cn,FALSE)) {
cn.keycode = 0; cn.keycode = 0;
cn.eventType = 0; cn.eventType = 0;
cn.requestMajor = 0; cn.requestMajor = 0;
@ -414,7 +414,7 @@ XkbSrvLedInfoPtr sli;
} }
XkbSetCauseUnknown(&cause); XkbSetCauseUnknown(&cause);
sli= XkbFindSrvLedInfo(dev,XkbDfltXIClass,XkbDfltXIId,0); sli= XkbFindSrvLedInfo(dev,XkbDfltXIClass,XkbDfltXIId,0);
XkbUpdateIndicators(dev,sli->usesControls,True,NULL,&cause); XkbUpdateIndicators(dev,sli->usesControls,TRUE,NULL,&cause);
if (ctrls->ax_options!=old.ax_options) { if (ctrls->ax_options!=old.ax_options) {
unsigned set,cleared,bell; unsigned set,cleared,bell;
set= ctrls->ax_options&(~old.ax_options); set= ctrls->ax_options&(~old.ax_options);
@ -751,11 +751,11 @@ DeviceEvent *event = &ev->device_event;
XkbComputeDerivedState(xkbi); XkbComputeDerivedState(xkbi);
changed |= XkbStateChangedFlags(&oldState,&xkbi->state); changed |= XkbStateChangedFlags(&oldState,&xkbi->state);
if (changed&sli->usedComponents) { if (changed&sli->usedComponents) {
changed_leds= XkbIndicatorsToUpdate(dev,changed,False); changed_leds= XkbIndicatorsToUpdate(dev,changed,FALSE);
if (changed_leds) { if (changed_leds) {
XkbEventCauseRec cause; XkbEventCauseRec cause;
XkbSetCauseKey(&cause,(event->detail.key & 0x7), event->type); XkbSetCauseKey(&cause,(event->detail.key & 0x7), event->type);
XkbUpdateIndicators(dev,changed_leds,True,NULL,&cause); XkbUpdateIndicators(dev,changed_leds,TRUE,NULL,&cause);
} }
} }
} }

View File

@ -603,7 +603,7 @@ _XkbFilterPointerBtn( XkbSrvInfoPtr xkbi,
} }
if (XkbComputeControlsNotify(xkbi->device, if (XkbComputeControlsNotify(xkbi->device,
&old,xkbi->desc->ctrls, &old,xkbi->desc->ctrls,
&cn,False)) { &cn,FALSE)) {
cn.keycode = keycode; cn.keycode = keycode;
/* XXX: what about DeviceKeyPress? */ /* XXX: what about DeviceKeyPress? */
cn.eventType = KeyPress; cn.eventType = KeyPress;
@ -668,7 +668,7 @@ XkbEventCauseRec cause;
XkbSrvLedInfoPtr sli; XkbSrvLedInfoPtr sli;
ctrls->enabled_ctrls|= change; ctrls->enabled_ctrls|= change;
if (XkbComputeControlsNotify(kbd,&old,ctrls,&cn,False)) { if (XkbComputeControlsNotify(kbd,&old,ctrls,&cn,FALSE)) {
cn.keycode = keycode; cn.keycode = keycode;
/* XXX: what about DeviceKeyPress? */ /* XXX: what about DeviceKeyPress? */
cn.eventType = KeyPress; cn.eventType = KeyPress;
@ -682,10 +682,10 @@ XkbEventCauseRec cause;
/* If sticky keys were disabled, clear all locks and latches */ /* If sticky keys were disabled, clear all locks and latches */
if ((old.enabled_ctrls&XkbStickyKeysMask)&& if ((old.enabled_ctrls&XkbStickyKeysMask)&&
(!(ctrls->enabled_ctrls&XkbStickyKeysMask))) { (!(ctrls->enabled_ctrls&XkbStickyKeysMask))) {
XkbClearAllLatchesAndLocks(kbd,xkbi,False,&cause); XkbClearAllLatchesAndLocks(kbd,xkbi,FALSE,&cause);
} }
sli= XkbFindSrvLedInfo(kbd,XkbDfltXIClass,XkbDfltXIId,0); sli= XkbFindSrvLedInfo(kbd,XkbDfltXIClass,XkbDfltXIId,0);
XkbUpdateIndicators(kbd,sli->usesControls,True,NULL,&cause); XkbUpdateIndicators(kbd,sli->usesControls,TRUE,NULL,&cause);
if (XkbAX_NeedFeedback(ctrls,XkbAX_FeatureFBMask)) if (XkbAX_NeedFeedback(ctrls,XkbAX_FeatureFBMask))
XkbDDXAccessXBeep(kbd,_BEEP_FEATURE_ON,change); XkbDDXAccessXBeep(kbd,_BEEP_FEATURE_ON,change);
} }
@ -697,7 +697,7 @@ XkbEventCauseRec cause;
XkbSrvLedInfoPtr sli; XkbSrvLedInfoPtr sli;
ctrls->enabled_ctrls&= ~change; ctrls->enabled_ctrls&= ~change;
if (XkbComputeControlsNotify(kbd,&old,ctrls,&cn,False)) { if (XkbComputeControlsNotify(kbd,&old,ctrls,&cn,FALSE)) {
cn.keycode = keycode; cn.keycode = keycode;
cn.eventType = KeyRelease; cn.eventType = KeyRelease;
cn.requestMajor = 0; cn.requestMajor = 0;
@ -709,10 +709,10 @@ XkbEventCauseRec cause;
/* If sticky keys were disabled, clear all locks and latches */ /* If sticky keys were disabled, clear all locks and latches */
if ((old.enabled_ctrls&XkbStickyKeysMask)&& if ((old.enabled_ctrls&XkbStickyKeysMask)&&
(!(ctrls->enabled_ctrls&XkbStickyKeysMask))) { (!(ctrls->enabled_ctrls&XkbStickyKeysMask))) {
XkbClearAllLatchesAndLocks(kbd,xkbi,False,&cause); XkbClearAllLatchesAndLocks(kbd,xkbi,FALSE,&cause);
} }
sli= XkbFindSrvLedInfo(kbd,XkbDfltXIClass,XkbDfltXIId,0); sli= XkbFindSrvLedInfo(kbd,XkbDfltXIClass,XkbDfltXIId,0);
XkbUpdateIndicators(kbd,sli->usesControls,True,NULL,&cause); XkbUpdateIndicators(kbd,sli->usesControls,TRUE,NULL,&cause);
if (XkbAX_NeedFeedback(ctrls,XkbAX_FeatureFBMask)) if (XkbAX_NeedFeedback(ctrls,XkbAX_FeatureFBMask))
XkbDDXAccessXBeep(kbd,_BEEP_FEATURE_OFF,change); XkbDDXAccessXBeep(kbd,_BEEP_FEATURE_OFF,change);
} }
@ -964,7 +964,7 @@ int button;
if ((pAction->devbtn.flags&XkbSA_LockNoLock)|| if ((pAction->devbtn.flags&XkbSA_LockNoLock)||
BitIsOn(dev->button->down, button)) BitIsOn(dev->button->down, button))
return 0; return 0;
XkbDDXFakeDeviceButton(dev,True,button); XkbDDXFakeDeviceButton(dev,TRUE,button);
filter->upAction.type= XkbSA_NoAction; filter->upAction.type= XkbSA_NoAction;
break; break;
case XkbSA_DeviceBtn: case XkbSA_DeviceBtn:
@ -972,12 +972,12 @@ int button;
int nClicks,i; int nClicks,i;
nClicks= pAction->btn.count; nClicks= pAction->btn.count;
for (i=0;i<nClicks;i++) { for (i=0;i<nClicks;i++) {
XkbDDXFakeDeviceButton(dev,True,button); XkbDDXFakeDeviceButton(dev,TRUE,button);
XkbDDXFakeDeviceButton(dev,False,button); XkbDDXFakeDeviceButton(dev,FALSE,button);
} }
filter->upAction.type= XkbSA_NoAction; filter->upAction.type= XkbSA_NoAction;
} }
else XkbDDXFakeDeviceButton(dev,True,button); else XkbDDXFakeDeviceButton(dev,TRUE,button);
break; break;
} }
} }
@ -996,10 +996,10 @@ int button;
if ((filter->upAction.devbtn.flags&XkbSA_LockNoUnlock)|| if ((filter->upAction.devbtn.flags&XkbSA_LockNoUnlock)||
!BitIsOn(dev->button->down, button)) !BitIsOn(dev->button->down, button))
return 0; return 0;
XkbDDXFakeDeviceButton(dev,False,button); XkbDDXFakeDeviceButton(dev,FALSE,button);
break; break;
case XkbSA_DeviceBtn: case XkbSA_DeviceBtn:
XkbDDXFakeDeviceButton(dev,False,button); XkbDDXFakeDeviceButton(dev,FALSE,button);
break; break;
} }
filter->active = 0; filter->active = 0;
@ -1072,9 +1072,9 @@ xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(dev);
if ((xkbi->flags&_XkbStateNotifyInProgress)==0) { if ((xkbi->flags&_XkbStateNotifyInProgress)==0) {
xkbi->prev_state = xkbi->state; xkbi->prev_state = xkbi->state;
xkbi->flags|= _XkbStateNotifyInProgress; xkbi->flags|= _XkbStateNotifyInProgress;
genStateNotify= True; genStateNotify= TRUE;
} }
else genStateNotify= False; else genStateNotify= FALSE;
xkbi->clearMods = xkbi->setMods = 0; xkbi->clearMods = xkbi->setMods = 0;
xkbi->groupChange = 0; xkbi->groupChange = 0;
@ -1213,11 +1213,11 @@ xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(dev);
} }
xkbi->flags&= ~_XkbStateNotifyInProgress; xkbi->flags&= ~_XkbStateNotifyInProgress;
} }
changed= XkbIndicatorsToUpdate(dev,changed,False); changed= XkbIndicatorsToUpdate(dev,changed,FALSE);
if (changed) { if (changed) {
XkbEventCauseRec cause; XkbEventCauseRec cause;
XkbSetCauseKey(&cause, key, event->type); XkbSetCauseKey(&cause, key, event->type);
XkbUpdateIndicators(dev,changed,False,NULL,&cause); XkbUpdateIndicators(dev,changed,FALSE,NULL,&cause);
} }
return; return;
} }
@ -1308,9 +1308,9 @@ xkbStateNotify sn;
sn.requestMinor= cause->mnr; sn.requestMinor= cause->mnr;
sn.changed= XkbStateChangedFlags(&os,&xkbi->state); sn.changed= XkbStateChangedFlags(&os,&xkbi->state);
XkbSendStateNotify(dev,&sn); XkbSendStateNotify(dev,&sn);
changed= XkbIndicatorsToUpdate(dev,sn.changed,False); changed= XkbIndicatorsToUpdate(dev,sn.changed,FALSE);
if (changed) { if (changed) {
XkbUpdateIndicators(dev,changed,True,NULL,cause); XkbUpdateIndicators(dev,changed,TRUE,NULL,cause);
} }
} }
return; return;

View File

@ -1073,7 +1073,7 @@ Bool found;
unsigned long autoCtrls,autoValues; unsigned long autoCtrls,autoValues;
ClientPtr client = NULL; ClientPtr client = NULL;
found= False; found= FALSE;
if (!dev->key || !dev->key->xkbInfo) if (!dev->key || !dev->key->xkbInfo)
return found; return found;
@ -1087,7 +1087,7 @@ ClientPtr client = NULL;
autoValues= interest->autoCtrlValues; autoValues= interest->autoCtrlValues;
client= interest->client; client= interest->client;
xfree(interest); xfree(interest);
found= True; found= TRUE;
} }
while ((!found)&&(interest->next)) { while ((!found)&&(interest->next)) {
if (interest->next->resource==id) { if (interest->next->resource==id) {
@ -1097,7 +1097,7 @@ ClientPtr client = NULL;
autoValues= victim->autoCtrlValues; autoValues= victim->autoCtrlValues;
client= victim->client; client= victim->client;
xfree(victim); xfree(victim);
found= True; found= TRUE;
} }
interest = interest->next; interest = interest->next;
} }

View File

@ -84,7 +84,7 @@ typedef struct _SrvXkmInfo {
/***====================================================================***/ /***====================================================================***/
#ifndef XKB_DFLT_RULES_PROP #ifndef XKB_DFLT_RULES_PROP
#define XKB_DFLT_RULES_PROP True #define XKB_DFLT_RULES_PROP TRUE
#endif #endif
char * XkbBaseDirectory= XKB_BASE_DIRECTORY; char * XkbBaseDirectory= XKB_BASE_DIRECTORY;
@ -165,20 +165,20 @@ char * pval;
len+= (XkbVariantUsed?strlen(XkbVariantUsed):0); len+= (XkbVariantUsed?strlen(XkbVariantUsed):0);
len+= (XkbOptionsUsed?strlen(XkbOptionsUsed):0); len+= (XkbOptionsUsed?strlen(XkbOptionsUsed):0);
if (len<1) if (len<1)
return True; return TRUE;
len+= 5; /* trailing NULs */ len+= 5; /* trailing NULs */
name= MakeAtom(_XKB_RF_NAMES_PROP_ATOM,strlen(_XKB_RF_NAMES_PROP_ATOM),1); name= MakeAtom(_XKB_RF_NAMES_PROP_ATOM,strlen(_XKB_RF_NAMES_PROP_ATOM),1);
if (name==None) { if (name==None) {
ErrorF("[xkb] Atom error: %s not created\n",_XKB_RF_NAMES_PROP_ATOM); ErrorF("[xkb] Atom error: %s not created\n",_XKB_RF_NAMES_PROP_ATOM);
return True; return TRUE;
} }
pval= (char*) xalloc(len); pval= (char*) xalloc(len);
if (!pval) { if (!pval) {
ErrorF("[xkb] Allocation error: %s proprerty not created\n", ErrorF("[xkb] Allocation error: %s proprerty not created\n",
_XKB_RF_NAMES_PROP_ATOM); _XKB_RF_NAMES_PROP_ATOM);
return True; return TRUE;
} }
out= 0; out= 0;
if (XkbRulesUsed) { if (XkbRulesUsed) {
@ -211,9 +211,9 @@ char * pval;
out,len); out,len);
} }
dixChangeWindowProperty(serverClient, WindowTable[0], name, XA_STRING, 8, dixChangeWindowProperty(serverClient, WindowTable[0], name, XA_STRING, 8,
PropModeReplace, len, pval, True); PropModeReplace, len, pval, TRUE);
xfree(pval); xfree(pval);
return True; return TRUE;
} }
static void static void
@ -284,7 +284,7 @@ XkbDeleteRulesDflts(void)
xfree(XkbOptionsDflt); xfree(XkbOptionsDflt);
XkbOptionsDflt = NULL; XkbOptionsDflt = NULL;
XkbFreeKeyboard(xkb_cached_map, XkbAllComponentsMask, True); XkbFreeKeyboard(xkb_cached_map, XkbAllComponentsMask, TRUE);
xkb_cached_map = NULL; xkb_cached_map = NULL;
} }
@ -312,17 +312,17 @@ static Bool
XkbInitKeyTypes(XkbDescPtr xkb) XkbInitKeyTypes(XkbDescPtr xkb)
{ {
if (xkb->defined & XkmTypesMask) if (xkb->defined & XkmTypesMask)
return True; return TRUE;
initTypeNames(NULL); initTypeNames(NULL);
if (XkbAllocClientMap(xkb,XkbKeyTypesMask,num_dflt_types)!=Success) if (XkbAllocClientMap(xkb,XkbKeyTypesMask,num_dflt_types)!=Success)
return False; return FALSE;
if (XkbCopyKeyTypes(dflt_types,xkb->map->types,num_dflt_types)!= if (XkbCopyKeyTypes(dflt_types,xkb->map->types,num_dflt_types)!=
Success) { Success) {
return False; return FALSE;
} }
xkb->map->size_types= xkb->map->num_types= num_dflt_types; xkb->map->size_types= xkb->map->num_types= num_dflt_types;
return True; return TRUE;
} }
static void static void
@ -341,7 +341,7 @@ register int i;
XkbCompatMapPtr compat; XkbCompatMapPtr compat;
if (xkb->defined & XkmCompatMapMask) if (xkb->defined & XkmCompatMapMask)
return True; return TRUE;
if (XkbAllocCompatMap(xkb,XkbAllCompatMask,num_dfltSI)!=Success) if (XkbAllocCompatMap(xkb,XkbAllCompatMask,num_dfltSI)!=Success)
return BadAlloc; return BadAlloc;
@ -518,7 +518,7 @@ InitKeyboardDeviceStruct(DeviceIntPtr dev, XkbRMLVOSet *rmlvo,
dev->key = xcalloc(1, sizeof(*dev->key)); dev->key = xcalloc(1, sizeof(*dev->key));
if (!dev->key) { if (!dev->key) {
ErrorF("XKB: Failed to allocate key class\n"); ErrorF("XKB: Failed to allocate key class\n");
return False; return FALSE;
} }
dev->key->sourceid = dev->id; dev->key->sourceid = dev->id;
@ -536,7 +536,7 @@ InitKeyboardDeviceStruct(DeviceIntPtr dev, XkbRMLVOSet *rmlvo,
dev->key->xkbInfo = xkbi; dev->key->xkbInfo = xkbi;
if (xkb_cached_map && !XkbCompareUsedRMLVO(rmlvo)) { if (xkb_cached_map && !XkbCompareUsedRMLVO(rmlvo)) {
XkbFreeKeyboard(xkb_cached_map, XkbAllComponentsMask, True); XkbFreeKeyboard(xkb_cached_map, XkbAllComponentsMask, TRUE);
xkb_cached_map = NULL; xkb_cached_map = NULL;
} }
@ -674,7 +674,7 @@ XkbFreeInfo(XkbSrvInfoPtr xkbi)
xkbi->beepTimer= NULL; xkbi->beepTimer= NULL;
} }
if (xkbi->desc) { if (xkbi->desc) {
XkbFreeKeyboard(xkbi->desc,XkbAllComponentsMask,True); XkbFreeKeyboard(xkbi->desc,XkbAllComponentsMask,TRUE);
xkbi->desc= NULL; xkbi->desc= NULL;
} }
xfree(xkbi); xfree(xkbi);

View File

@ -103,8 +103,8 @@ Bool ctrlChange,stateChange;
XkbStatePtr state; XkbStatePtr state;
if ((map->flags&XkbIM_NoExplicit)||((map->flags&XkbIM_LEDDrivesKB)==0)) if ((map->flags&XkbIM_NoExplicit)||((map->flags&XkbIM_LEDDrivesKB)==0))
return False; return FALSE;
ctrlChange= stateChange= False; ctrlChange= stateChange= FALSE;
if (map->ctrls) { if (map->ctrls) {
XkbControlsPtr ctrls= xkbi->desc->ctrls; XkbControlsPtr ctrls= xkbi->desc->ctrls;
unsigned old; unsigned old;
@ -115,7 +115,7 @@ XkbStatePtr state;
if (old!=ctrls->enabled_ctrls) { if (old!=ctrls->enabled_ctrls) {
change->ctrls.changed_ctrls= XkbControlsEnabledMask; change->ctrls.changed_ctrls= XkbControlsEnabledMask;
change->ctrls.enabled_ctrls_changes= old^ctrls->enabled_ctrls; change->ctrls.enabled_ctrls_changes= old^ctrls->enabled_ctrls;
ctrlChange= True; ctrlChange= TRUE;
} }
} }
state= &xkbi->state; state= &xkbi->state;
@ -133,7 +133,7 @@ XkbStatePtr state;
if (map->which_groups&XkbIM_UseLatched) if (map->which_groups&XkbIM_UseLatched)
XkbLatchGroup(xkbi->device,0); /* unlatch group */ XkbLatchGroup(xkbi->device,0); /* unlatch group */
state->locked_group= i; state->locked_group= i;
stateChange= True; stateChange= TRUE;
} }
else if (map->which_groups&(XkbIM_UseLatched|XkbIM_UseEffective)) { else if (map->which_groups&(XkbIM_UseLatched|XkbIM_UseEffective)) {
for (i=0,bit=1;i<XkbNumKbdGroups;i++,bit<<=1) { for (i=0,bit=1;i<XkbNumKbdGroups;i++,bit<<=1) {
@ -142,7 +142,7 @@ XkbStatePtr state;
} }
state->locked_group= 0; state->locked_group= 0;
XkbLatchGroup(xkbi->device,i); XkbLatchGroup(xkbi->device,i);
stateChange= True; stateChange= TRUE;
} }
} }
if ((map->mods.mask)&&((map->which_mods&(~XkbIM_UseBase))!=0)) { if ((map->mods.mask)&&((map->which_mods&(~XkbIM_UseBase))!=0)) {
@ -152,7 +152,7 @@ XkbStatePtr state;
if (on) state->locked_mods|= map->mods.mask; if (on) state->locked_mods|= map->mods.mask;
else state->locked_mods&= ~map->mods.mask; else state->locked_mods&= ~map->mods.mask;
if (state->locked_mods!=old) if (state->locked_mods!=old)
stateChange= True; stateChange= TRUE;
} }
if (map->which_mods&(XkbIM_UseLatched|XkbIM_UseEffective)) { if (map->which_mods&(XkbIM_UseLatched|XkbIM_UseEffective)) {
register unsigned long newmods; register unsigned long newmods;
@ -162,7 +162,7 @@ XkbStatePtr state;
if (newmods!=state->locked_mods) { if (newmods!=state->locked_mods) {
newmods&= map->mods.mask; newmods&= map->mods.mask;
XkbLatchModifiers(xkbi->device,map->mods.mask,newmods); XkbLatchModifiers(xkbi->device,map->mods.mask,newmods);
stateChange= True; stateChange= TRUE;
} }
} }
} }
@ -186,7 +186,7 @@ ComputeAutoState( XkbIndicatorMapPtr map,
Bool on; Bool on;
CARD8 mods,group; CARD8 mods,group;
on= False; on= FALSE;
mods= group= 0; mods= group= 0;
if (map->which_mods&XkbIM_UseAnyMods) { if (map->which_mods&XkbIM_UseAnyMods) {
if (map->which_mods&XkbIM_UseBase) if (map->which_mods&XkbIM_UseBase)
@ -371,7 +371,7 @@ unsigned side_affected;
side_affected= 0; side_affected= 0;
if (changes.state_changes!=0) if (changes.state_changes!=0)
side_affected|= XkbIndicatorsToUpdate(dev,changes.state_changes,False); side_affected|= XkbIndicatorsToUpdate(dev,changes.state_changes,FALSE);
if (changes.ctrls.enabled_ctrls_changes) if (changes.ctrls.enabled_ctrls_changes)
side_affected|= sli->usesControls; side_affected|= sli->usesControls;
@ -402,7 +402,7 @@ unsigned side_affected;
* required to report the necessary changes, otherwise it simply * required to report the necessary changes, otherwise it simply
* notes the indicators with changed state. * notes the indicators with changed state.
* *
* If 'check_edevs' is True, this function also checks the indicator * If 'check_edevs' is TRUE, this function also checks the indicator
* maps for any open extension devices that have them, and updates * maps for any open extension devices that have them, and updates
* the state of any extension device indicators as necessary. * the state of any extension device indicators as necessary.
*/ */
@ -522,7 +522,7 @@ Bool checkAccel;
Bool checkNames; Bool checkNames;
sli= NULL; sli= NULL;
checkAccel= checkNames= False; checkAccel= checkNames= FALSE;
if ((kf!=NULL)&&(kf->xkb_sli==NULL)) { if ((kf!=NULL)&&(kf->xkb_sli==NULL)) {
kf->xkb_sli= sli= xcalloc(1, sizeof(XkbSrvLedInfoRec)); kf->xkb_sli= sli= xcalloc(1, sizeof(XkbSrvLedInfoRec));
if (sli==NULL) if (sli==NULL)
@ -545,7 +545,7 @@ Bool checkNames;
sli->physIndicators= xkb->indicators->phys_indicators; sli->physIndicators= xkb->indicators->phys_indicators;
sli->names= xkb->names->indicators; sli->names= xkb->names->indicators;
sli->maps= xkb->indicators->maps; sli->maps= xkb->indicators->maps;
checkNames= checkAccel= True; checkNames= checkAccel= TRUE;
} }
else { else {
sli->physIndicators= XkbAllIndicatorsMask; sli->physIndicators= XkbAllIndicatorsMask;
@ -558,11 +558,11 @@ Bool checkNames;
xkb= dev->key->xkbInfo->desc; xkb= dev->key->xkbInfo->desc;
sli->physIndicators= xkb->indicators->phys_indicators; sli->physIndicators= xkb->indicators->phys_indicators;
if (xkb->names->indicators!=sli->names) { if (xkb->names->indicators!=sli->names) {
checkNames= True; checkNames= TRUE;
sli->names= xkb->names->indicators; sli->names= xkb->names->indicators;
} }
if (xkb->indicators->maps!=sli->maps) { if (xkb->indicators->maps!=sli->maps) {
checkAccel= True; checkAccel= TRUE;
sli->maps= xkb->indicators->maps; sli->maps= xkb->indicators->maps;
} }
} }
@ -920,7 +920,7 @@ Bool kb_changed;
bzero((char *)changes,sizeof(XkbChangesRec)); bzero((char *)changes,sizeof(XkbChangesRec));
} }
kb_changed= False; kb_changed= FALSE;
affected= changed_leds; affected= changed_leds;
oldState= sli->effectiveState; oldState= sli->effectiveState;
for (i=0,bit=1;(i<XkbNumIndicators)&&(affected);i++,bit<<=1) { for (i=0,bit=1;(i<XkbNumIndicators)&&(affected);i++,bit<<=1) {
@ -935,7 +935,7 @@ Bool kb_changed;
if (map->flags&XkbIM_LEDDrivesKB) { if (map->flags&XkbIM_LEDDrivesKB) {
Bool on= ((sli->explicitState&bit)!=0); Bool on= ((sli->explicitState&bit)!=0);
if (XkbApplyLEDChangeToKeyboard(xkbi,map,on,changes)) if (XkbApplyLEDChangeToKeyboard(xkbi,map,on,changes))
kb_changed= True; kb_changed= TRUE;
} }
} }
sli->effectiveState= (sli->autoState|sli->explicitState); sli->effectiveState= (sli->autoState|sli->explicitState);

View File

@ -529,7 +529,7 @@ XkbSetRepeatKeys(DeviceIntPtr pXDev,int key,int onoff)
pXDev->kbdfeed->ctrl.autoRepeats[key/8]; pXDev->kbdfeed->ctrl.autoRepeats[key/8];
} }
if (XkbComputeControlsNotify(pXDev,&old,ctrls,&cn,True)) if (XkbComputeControlsNotify(pXDev,&old,ctrls,&cn,TRUE))
XkbSendControlsNotify(pXDev,&cn); XkbSendControlsNotify(pXDev,&cn);
} }
return; return;
@ -726,7 +726,7 @@ XkbCheckSecondaryEffects( XkbSrvInfoPtr xkbi,
XkbComputeDerivedState(xkbi); XkbComputeDerivedState(xkbi);
} }
if (which&XkbIndicatorStateNotifyMask) if (which&XkbIndicatorStateNotifyMask)
XkbUpdateIndicators(xkbi->device,XkbAllIndicatorsMask,True,changes, XkbUpdateIndicators(xkbi->device,XkbAllIndicatorsMask,TRUE,changes,
cause); cause);
return; return;
} }
@ -749,7 +749,7 @@ XkbSrvLedInfoPtr sli;
ctrls->enabled_ctrls&= ~change; ctrls->enabled_ctrls&= ~change;
ctrls->enabled_ctrls|= (change&newValues); ctrls->enabled_ctrls|= (change&newValues);
if (old==ctrls->enabled_ctrls) if (old==ctrls->enabled_ctrls)
return False; return FALSE;
if (cause!=NULL) { if (cause!=NULL) {
xkbControlsNotify cn; xkbControlsNotify cn;
cn.numGroups= ctrls->num_groups; cn.numGroups= ctrls->num_groups;
@ -774,8 +774,8 @@ XkbSrvLedInfoPtr sli;
else changes->ctrls.changed_ctrls&= ~XkbControlsEnabledMask; else changes->ctrls.changed_ctrls&= ~XkbControlsEnabledMask;
} }
sli= XkbFindSrvLedInfo(xkbi->device,XkbDfltXIClass,XkbDfltXIId,0); sli= XkbFindSrvLedInfo(xkbi->device,XkbDfltXIClass,XkbDfltXIId,0);
XkbUpdateIndicators(xkbi->device,sli->usesControls,True,changes,cause); XkbUpdateIndicators(xkbi->device,sli->usesControls,TRUE,changes,cause);
return True; return TRUE;
} }
/***====================================================================***/ /***====================================================================***/
@ -1152,7 +1152,7 @@ _XkbCopyClientMap(XkbDescPtr src, XkbDescPtr dst)
} }
else { else {
if (dst->map) if (dst->map)
XkbFreeClientMap(dst, XkbAllClientInfoMask, True); XkbFreeClientMap(dst, XkbAllClientInfoMask, TRUE);
} }
return TRUE; return TRUE;
@ -1288,7 +1288,7 @@ _XkbCopyServerMap(XkbDescPtr src, XkbDescPtr dst)
} }
else { else {
if (dst->server) if (dst->server)
XkbFreeServerMap(dst, XkbAllServerInfoMask, True); XkbFreeServerMap(dst, XkbAllServerInfoMask, TRUE);
} }
return TRUE; return TRUE;
@ -1389,7 +1389,7 @@ _XkbCopyNames(XkbDescPtr src, XkbDescPtr dst)
} }
else { else {
if (dst->names) if (dst->names)
XkbFreeNames(dst, XkbAllNamesMask, True); XkbFreeNames(dst, XkbAllNamesMask, TRUE);
} }
return TRUE; return TRUE;
@ -1441,7 +1441,7 @@ _XkbCopyCompat(XkbDescPtr src, XkbDescPtr dst)
} }
else { else {
if (dst->compat) if (dst->compat)
XkbFreeCompatMap(dst, XkbAllCompatMask, True); XkbFreeCompatMap(dst, XkbAllCompatMask, TRUE);
} }
return TRUE; return TRUE;
@ -1977,7 +1977,7 @@ _XkbCopyGeom(XkbDescPtr src, XkbDescPtr dst)
{ {
if (dst->geom) { if (dst->geom) {
/* I LOVE THE DIFFERENT CALL SIGNATURE. REALLY, I DO. */ /* I LOVE THE DIFFERENT CALL SIGNATURE. REALLY, I DO. */
XkbFreeGeometry(dst->geom, XkbGeomAllMask, True); XkbFreeGeometry(dst->geom, XkbGeomAllMask, TRUE);
dst->geom = NULL; dst->geom = NULL;
} }
} }

View File

@ -137,7 +137,7 @@ static Bool
XkbWriteSectionFromName(FILE *file,char *sectionName,char *name) XkbWriteSectionFromName(FILE *file,char *sectionName,char *name)
{ {
fprintf(file," xkb_%-20s { include \"%s\" };\n",sectionName,name); fprintf(file," xkb_%-20s { include \"%s\" };\n",sectionName,name);
return True; return TRUE;
} }
#define NEED_DESC(n) ((!n)||((n)[0]=='+')||((n)[0]=='|')||(strchr((n),'%'))) #define NEED_DESC(n) ((!n)||((n)[0]=='+')||((n)[0]=='|')||(strchr((n),'%')))
@ -181,7 +181,7 @@ unsigned wantNames,wantConfig,wantDflts;
want|= XkmKeyNamesMask|XkmTypesMask; want|= XkmKeyNamesMask|XkmTypesMask;
if (want==0) if (want==0)
return False; return FALSE;
if (xkb) { if (xkb) {
old_names = xkb->names; old_names = xkb->names;
@ -258,7 +258,7 @@ unsigned wantNames,wantConfig,wantDflts;
} }
if (wantNames&XkmSymbolsMask) { if (wantNames&XkmSymbolsMask) {
if (old_names->symbols==None) if (old_names->symbols==None)
return False; return FALSE;
tmp= NameForAtom(old_names->symbols); tmp= NameForAtom(old_names->symbols);
names->symbols= _XkbDupString(tmp); names->symbols= _XkbDupString(tmp);
complete|= XkmSymbolsMask; complete|= XkmSymbolsMask;
@ -273,7 +273,7 @@ unsigned wantNames,wantConfig,wantDflts;
} }
if (wantNames&XkmGeometryMask) { if (wantNames&XkmGeometryMask) {
if (old_names->geometry==None) if (old_names->geometry==None)
return False; return FALSE;
tmp= NameForAtom(old_names->geometry); tmp= NameForAtom(old_names->geometry);
names->geometry= _XkbDupString(tmp); names->geometry= _XkbDupString(tmp);
complete|= XkmGeometryMask; complete|= XkmGeometryMask;
@ -285,9 +285,9 @@ unsigned wantNames,wantConfig,wantDflts;
else if (complete&(XkmSymbolsMask|XkmTypesMask)) else if (complete&(XkmSymbolsMask|XkmTypesMask))
complete|= XkmVirtualModsMask; complete|= XkmVirtualModsMask;
if (need & (~complete)) if (need & (~complete))
return False; return FALSE;
if ((complete&XkmSymbolsMask)&&((XkmKeyNamesMask|XkmTypesMask)&(~complete))) if ((complete&XkmSymbolsMask)&&((XkmKeyNamesMask|XkmTypesMask)&(~complete)))
return False; return FALSE;
multi_section= 1; multi_section= 1;
if (((complete&XkmKeymapRequired)==XkmKeymapRequired)&& if (((complete&XkmKeymapRequired)==XkmKeymapRequired)&&
@ -306,44 +306,44 @@ unsigned wantNames,wantConfig,wantDflts;
multi_section= 0; multi_section= 0;
} }
else { else {
return False; return FALSE;
} }
wantNames= complete&(~(wantConfig|wantDflts)); wantNames= complete&(~(wantConfig|wantDflts));
if (wantConfig&XkmKeyNamesMask) if (wantConfig&XkmKeyNamesMask)
XkbWriteXKBKeycodes(file,xkb,False,False,_AddIncl,names->keycodes); XkbWriteXKBKeycodes(file,xkb,FALSE,FALSE,_AddIncl,names->keycodes);
else if (wantDflts&XkmKeyNamesMask) else if (wantDflts&XkmKeyNamesMask)
fprintf(stderr,"Default symbols not implemented yet!\n"); fprintf(stderr,"Default symbols not implemented yet!\n");
else if (wantNames&XkmKeyNamesMask) else if (wantNames&XkmKeyNamesMask)
XkbWriteSectionFromName(file,"keycodes",names->keycodes); XkbWriteSectionFromName(file,"keycodes",names->keycodes);
if (wantConfig&XkmTypesMask) if (wantConfig&XkmTypesMask)
XkbWriteXKBKeyTypes(file,xkb,False,False,_AddIncl,names->types); XkbWriteXKBKeyTypes(file,xkb,FALSE,FALSE,_AddIncl,names->types);
else if (wantDflts&XkmTypesMask) else if (wantDflts&XkmTypesMask)
fprintf(stderr,"Default types not implemented yet!\n"); fprintf(stderr,"Default types not implemented yet!\n");
else if (wantNames&XkmTypesMask) else if (wantNames&XkmTypesMask)
XkbWriteSectionFromName(file,"types",names->types); XkbWriteSectionFromName(file,"types",names->types);
if (wantConfig&XkmCompatMapMask) if (wantConfig&XkmCompatMapMask)
XkbWriteXKBCompatMap(file,xkb,False,False,_AddIncl,names->compat); XkbWriteXKBCompatMap(file,xkb,FALSE,FALSE,_AddIncl,names->compat);
else if (wantDflts&XkmCompatMapMask) else if (wantDflts&XkmCompatMapMask)
fprintf(stderr,"Default interps not implemented yet!\n"); fprintf(stderr,"Default interps not implemented yet!\n");
else if (wantNames&XkmCompatMapMask) else if (wantNames&XkmCompatMapMask)
XkbWriteSectionFromName(file,"compatibility",names->compat); XkbWriteSectionFromName(file,"compatibility",names->compat);
if (wantConfig&XkmSymbolsMask) if (wantConfig&XkmSymbolsMask)
XkbWriteXKBSymbols(file,xkb,False,False,_AddIncl,names->symbols); XkbWriteXKBSymbols(file,xkb,FALSE,FALSE,_AddIncl,names->symbols);
else if (wantNames&XkmSymbolsMask) else if (wantNames&XkmSymbolsMask)
XkbWriteSectionFromName(file,"symbols",names->symbols); XkbWriteSectionFromName(file,"symbols",names->symbols);
if (wantConfig&XkmGeometryMask) if (wantConfig&XkmGeometryMask)
XkbWriteXKBGeometry(file,xkb,False,False,_AddIncl,names->geometry); XkbWriteXKBGeometry(file,xkb,FALSE,FALSE,_AddIncl,names->geometry);
else if (wantNames&XkmGeometryMask) else if (wantNames&XkmGeometryMask)
XkbWriteSectionFromName(file,"geometry",names->geometry); XkbWriteSectionFromName(file,"geometry",names->geometry);
if (multi_section) if (multi_section)
fprintf(file,"};\n"); fprintf(file,"};\n");
return True; return TRUE;
} }
/***====================================================================***/ /***====================================================================***/
@ -366,7 +366,7 @@ register int i;
a= xkb->geom->key_aliases; a= xkb->geom->key_aliases;
for (i=0;i<xkb->geom->num_key_aliases;i++,a++) { for (i=0;i<xkb->geom->num_key_aliases;i++,a++) {
if (strncmp(name,a->alias,XkbKeyNameLength)==0) if (strncmp(name,a->alias,XkbKeyNameLength)==0)
return XkbFindKeycodeByName(xkb,a->real,False); return XkbFindKeycodeByName(xkb,a->real,FALSE);
} }
} }
if (xkb->names && xkb->names->key_aliases) { if (xkb->names && xkb->names->key_aliases) {
@ -374,7 +374,7 @@ register int i;
a= xkb->names->key_aliases; a= xkb->names->key_aliases;
for (i=0;i<xkb->names->num_key_aliases;i++,a++) { for (i=0;i<xkb->names->num_key_aliases;i++,a++) {
if (strncmp(name,a->alias,XkbKeyNameLength)==0) if (strncmp(name,a->alias,XkbKeyNameLength)==0)
return XkbFindKeycodeByName(xkb,a->real,False); return XkbFindKeycodeByName(xkb,a->real,FALSE);
} }
} }
return 0; return 0;
@ -420,19 +420,19 @@ XkbNameMatchesPattern(char *name,char *ptrn)
ptrn++; ptrn++;
continue; continue;
} }
return False; return FALSE;
} }
if (ptrn[0]=='?') { if (ptrn[0]=='?') {
if (UNMATCHABLE(name[0])) if (UNMATCHABLE(name[0]))
return False; return FALSE;
} }
else if (ptrn[0]=='*') { else if (ptrn[0]=='*') {
if ((!UNMATCHABLE(name[0]))&&XkbNameMatchesPattern(name+1,ptrn)) if ((!UNMATCHABLE(name[0]))&&XkbNameMatchesPattern(name+1,ptrn))
return True; return TRUE;
return XkbNameMatchesPattern(name,ptrn+1); return XkbNameMatchesPattern(name,ptrn+1);
} }
else if (ptrn[0]!=name[0]) else if (ptrn[0]!=name[0])
return False; return FALSE;
name++; name++;
ptrn++; ptrn++;
} }

View File

@ -58,7 +58,7 @@ register int i,nMods;
Atom * vmodNames; Atom * vmodNames;
if (xkb==NULL) if (xkb==NULL)
return False; return FALSE;
if (xkb->names!=NULL) if (xkb->names!=NULL)
vmodNames= xkb->names->vmods; vmodNames= xkb->names->vmods;
else vmodNames= NULL; else vmodNames= NULL;
@ -84,7 +84,7 @@ Atom * vmodNames;
} }
if (nMods>0) if (nMods>0)
fprintf(file,";\n\n"); fprintf(file,";\n\n");
return True; return TRUE;
} }
/***====================================================================***/ /***====================================================================***/
@ -93,7 +93,7 @@ static Bool
WriteXKBAction(FILE *file,XkbDescPtr xkb,XkbAnyAction *action) WriteXKBAction(FILE *file,XkbDescPtr xkb,XkbAnyAction *action)
{ {
fprintf(file,"%s",XkbActionText(xkb,(XkbAction *)action,XkbXKBFile)); fprintf(file,"%s",XkbActionText(xkb,(XkbAction *)action,XkbXKBFile));
return True; return TRUE;
} }
/***====================================================================***/ /***====================================================================***/
@ -112,7 +112,7 @@ char * alternate;
if ((!xkb)||(!xkb->names)||(!xkb->names->keys)) { if ((!xkb)||(!xkb->names)||(!xkb->names->keys)) {
_XkbLibError(_XkbErrMissingNames,"XkbWriteXKBKeycodes",0); _XkbLibError(_XkbErrMissingNames,"XkbWriteXKBKeycodes",0);
return False; return FALSE;
} }
kcName= xkb->names->keycodes; kcName= xkb->names->keycodes;
if (kcName!=None) if (kcName!=None)
@ -123,7 +123,7 @@ char * alternate;
fprintf(file," maximum = %d;\n",xkb->max_key_code); fprintf(file," maximum = %d;\n",xkb->max_key_code);
for (i=xkb->min_key_code;i<=xkb->max_key_code;i++) { for (i=xkb->min_key_code;i<=xkb->max_key_code;i++) {
if (xkb->names->keys[i].name[0]!='\0') { if (xkb->names->keys[i].name[0]!='\0') {
if (XkbFindKeycodeByName(xkb,xkb->names->keys[i].name,True)!=i) if (XkbFindKeycodeByName(xkb,xkb->names->keys[i].name,TRUE)!=i)
alternate= "alternate "; alternate= "alternate ";
else alternate= ""; else alternate= "";
fprintf(file," %s%6s = %d;\n",alternate, fprintf(file," %s%6s = %d;\n",alternate,
@ -155,7 +155,7 @@ char * alternate;
if (addOn) if (addOn)
(*addOn)(file,xkb,topLevel,showImplicit,XkmKeyNamesIndex,priv); (*addOn)(file,xkb,topLevel,showImplicit,XkmKeyNamesIndex,priv);
fprintf(file,"};\n\n"); fprintf(file,"};\n\n");
return True; return TRUE;
} }
Bool Bool
@ -172,7 +172,7 @@ XkbKTMapEntryPtr entry;
if ((!xkb)||(!xkb->map)||(!xkb->map->types)) { if ((!xkb)||(!xkb->map)||(!xkb->map->types)) {
_XkbLibError(_XkbErrMissingTypes,"XkbWriteXKBKeyTypes",0); _XkbLibError(_XkbErrMissingTypes,"XkbWriteXKBKeyTypes",0);
return False; return FALSE;
} }
if (xkb->map->num_types<XkbNumRequiredTypes) { if (xkb->map->num_types<XkbNumRequiredTypes) {
_XkbLibError(_XkbErrMissingReqTypes,"XkbWriteXKBKeyTypes",0); _XkbLibError(_XkbErrMissingReqTypes,"XkbWriteXKBKeyTypes",0);
@ -221,7 +221,7 @@ XkbKTMapEntryPtr entry;
if (addOn) if (addOn)
(*addOn)(file,xkb,topLevel,showImplicit,XkmTypesIndex,priv); (*addOn)(file,xkb,topLevel,showImplicit,XkmTypesIndex,priv);
fprintf(file,"};\n\n"); fprintf(file,"};\n\n");
return True; return TRUE;
} }
static Bool static Bool
@ -260,9 +260,9 @@ WriteXKBIndicatorMap( FILE * file,
XkbControlsMaskText(led->ctrls,XkbXKBFile)); XkbControlsMaskText(led->ctrls,XkbXKBFile));
} }
if (addOn) if (addOn)
(*addOn)(file,xkb,False,True,XkmIndicatorsIndex,priv); (*addOn)(file,xkb,FALSE,TRUE,XkmIndicatorsIndex,priv);
fprintf(file," };\n"); fprintf(file," };\n");
return True; return TRUE;
} }
Bool Bool
@ -278,7 +278,7 @@ XkbSymInterpretPtr interp;
if ((!xkb)||(!xkb->compat)||(!xkb->compat->sym_interpret)) { if ((!xkb)||(!xkb->compat)||(!xkb->compat->sym_interpret)) {
_XkbLibError(_XkbErrMissingCompatMap,"XkbWriteXKBCompatMap",0); _XkbLibError(_XkbErrMissingCompatMap,"XkbWriteXKBCompatMap",0);
return False; return FALSE;
} }
if ((xkb->names==NULL)||(xkb->names->compat==None)) if ((xkb->names==NULL)||(xkb->names->compat==None))
fprintf(file,"xkb_compatibility {\n\n"); fprintf(file,"xkb_compatibility {\n\n");
@ -288,8 +288,8 @@ XkbSymInterpretPtr interp;
(showImplicit?VMOD_COMMENT_VALUE:VMOD_HIDE_VALUE)); (showImplicit?VMOD_COMMENT_VALUE:VMOD_HIDE_VALUE));
fprintf(file," interpret.useModMapMods= AnyLevel;\n"); fprintf(file," interpret.useModMapMods= AnyLevel;\n");
fprintf(file," interpret.repeat= False;\n"); fprintf(file," interpret.repeat= FALSE;\n");
fprintf(file," interpret.locking= False;\n"); fprintf(file," interpret.locking= FALSE;\n");
interp= xkb->compat->sym_interpret; interp= xkb->compat->sym_interpret;
for (i=0;i<xkb->compat->num_si;i++,interp++) { for (i=0;i<xkb->compat->num_si;i++,interp++) {
fprintf(file," interpret %s+%s(%s) {\n", fprintf(file," interpret %s+%s(%s) {\n",
@ -304,9 +304,9 @@ XkbSymInterpretPtr interp;
if (interp->match&XkbSI_LevelOneOnly) if (interp->match&XkbSI_LevelOneOnly)
fprintf(file," useModMapMods=level1;\n"); fprintf(file," useModMapMods=level1;\n");
if (interp->flags&XkbSI_LockingKey) if (interp->flags&XkbSI_LockingKey)
fprintf(file," locking= True;\n"); fprintf(file," locking= TRUE;\n");
if (interp->flags&XkbSI_AutoRepeat) if (interp->flags&XkbSI_AutoRepeat)
fprintf(file," repeat= True;\n"); fprintf(file," repeat= TRUE;\n");
fprintf(file," action= "); fprintf(file," action= ");
WriteXKBAction(file,xkb,&interp->act); WriteXKBAction(file,xkb,&interp->act);
fprintf(file,";\n"); fprintf(file,";\n");
@ -337,7 +337,7 @@ XkbSymInterpretPtr interp;
if (addOn) if (addOn)
(*addOn)(file,xkb,topLevel,showImplicit,XkmCompatMapIndex,priv); (*addOn)(file,xkb,topLevel,showImplicit,XkmCompatMapIndex,priv);
fprintf(file,"};\n\n"); fprintf(file,"};\n\n");
return True; return TRUE;
} }
Bool Bool
@ -357,11 +357,11 @@ Bool showActions;
srv= xkb->server; srv= xkb->server;
if ((!xkb)||(!map)||(!map->syms)||(!map->key_sym_map)) { if ((!xkb)||(!map)||(!map->syms)||(!map->key_sym_map)) {
_XkbLibError(_XkbErrMissingSymbols,"XkbWriteXKBSymbols",0); _XkbLibError(_XkbErrMissingSymbols,"XkbWriteXKBSymbols",0);
return False; return FALSE;
} }
if ((!xkb->names)||(!xkb->names->keys)) { if ((!xkb->names)||(!xkb->names->keys)) {
_XkbLibError(_XkbErrMissingNames,"XkbWriteXKBSymbols",0); _XkbLibError(_XkbErrMissingNames,"XkbWriteXKBSymbols",0);
return False; return FALSE;
} }
if ((xkb->names==NULL)||(xkb->names->symbols==None)) if ((xkb->names==NULL)||(xkb->names->symbols==None))
fprintf(file,"xkb_symbols {\n\n"); fprintf(file,"xkb_symbols {\n\n");
@ -380,9 +380,9 @@ Bool showActions;
Bool simple; Bool simple;
if ((int)XkbKeyNumSyms(xkb,i)<1) if ((int)XkbKeyNumSyms(xkb,i)<1)
continue; continue;
if (XkbFindKeycodeByName(xkb,xkb->names->keys[i].name,True)!=i) if (XkbFindKeycodeByName(xkb,xkb->names->keys[i].name,TRUE)!=i)
continue; continue;
simple= True; simple= TRUE;
fprintf(file," key %6s {", fprintf(file," key %6s {",
XkbKeyNameText(xkb->names->keys[i].name,XkbXKBFile)); XkbKeyNameText(xkb->names->keys[i].name,XkbXKBFile));
if (srv->explicit) { if (srv->explicit) {
@ -394,11 +394,11 @@ Bool showActions;
if ((srv->explicit[i]&XkbExplicitKeyTypesMask)==0) if ((srv->explicit[i]&XkbExplicitKeyTypesMask)==0)
comment= "//"; comment= "//";
multi= False; multi= FALSE;
typeNdx= XkbKeyKeyTypeIndex(xkb,i,0); typeNdx= XkbKeyKeyTypeIndex(xkb,i,0);
for (g=1;(g<XkbKeyNumGroups(xkb,i))&&(!multi);g++) { for (g=1;(g<XkbKeyNumGroups(xkb,i))&&(!multi);g++) {
if (XkbKeyKeyTypeIndex(xkb,i,g)!=typeNdx) if (XkbKeyKeyTypeIndex(xkb,i,g)!=typeNdx)
multi= True; multi= TRUE;
} }
if (multi) { if (multi) {
for (g=0;g<XkbKeyNumGroups(xkb,i);g++) { for (g=0;g<XkbKeyNumGroups(xkb,i);g++) {
@ -421,14 +421,14 @@ Bool showActions;
XkbAtomText(map->types[typeNdx].name, XkbAtomText(map->types[typeNdx].name,
XkbXKBFile)); XkbXKBFile));
} }
simple= False; simple= FALSE;
} }
if (((srv->explicit[i]&XkbExplicitAutoRepeatMask)!=0)&& if (((srv->explicit[i]&XkbExplicitAutoRepeatMask)!=0)&&
(xkb->ctrls!=NULL)) { (xkb->ctrls!=NULL)) {
if (xkb->ctrls->per_key_repeat[i/8]&(1<<(i%8))) if (xkb->ctrls->per_key_repeat[i/8]&(1<<(i%8)))
fprintf(file,"\n repeat= Yes,"); fprintf(file,"\n repeat= Yes,");
else fprintf(file,"\n repeat= No,"); else fprintf(file,"\n repeat= No,");
simple= False; simple= FALSE;
} }
if ((xkb->server!=NULL)&&(xkb->server->vmodmap!=NULL)&& if ((xkb->server!=NULL)&&(xkb->server->vmodmap!=NULL)&&
(xkb->server->vmodmap[i]!=0)) { (xkb->server->vmodmap[i]!=0)) {
@ -460,7 +460,7 @@ Bool showActions;
type= srv->behaviors[i].type&XkbKB_OpMask; type= srv->behaviors[i].type&XkbKB_OpMask;
if (type!=XkbKB_Default) { if (type!=XkbKB_Default) {
simple= False; simple= FALSE;
fprintf(file,"\n %s,", fprintf(file,"\n %s,",
XkbBehaviorText(xkb,&srv->behaviors[i],XkbXKBFile)); XkbBehaviorText(xkb,&srv->behaviors[i],XkbXKBFile));
} }
@ -468,10 +468,10 @@ Bool showActions;
if ((srv->explicit==NULL) || showImplicit || if ((srv->explicit==NULL) || showImplicit ||
((srv->explicit[i]&XkbExplicitInterpretMask)!=0)) ((srv->explicit[i]&XkbExplicitInterpretMask)!=0))
showActions= XkbKeyHasActions(xkb,i); showActions= XkbKeyHasActions(xkb,i);
else showActions= False; else showActions= FALSE;
if (((unsigned)XkbKeyNumGroups(xkb,i)>1)||showActions) if (((unsigned)XkbKeyNumGroups(xkb,i)>1)||showActions)
simple= False; simple= FALSE;
if (simple) { if (simple) {
KeySym *syms; KeySym *syms;
unsigned s; unsigned s;
@ -535,7 +535,7 @@ Bool showActions;
if (addOn) if (addOn)
(*addOn)(file,xkb,topLevel,showImplicit,XkmSymbolsIndex,priv); (*addOn)(file,xkb,topLevel,showImplicit,XkmSymbolsIndex,priv);
fprintf(file,"};\n\n"); fprintf(file,"};\n\n");
return True; return TRUE;
} }
static Bool static Bool
@ -575,7 +575,7 @@ char * iStr;
XkbGeomFPText(pt->y,XkbXKBFile)); XkbGeomFPText(pt->y,XkbXKBFile));
} }
fprintf(file," }"); fprintf(file," }");
return True; return TRUE;
} }
static Bool static Bool
@ -665,7 +665,7 @@ XkbColorPtr color;
break; break;
} }
fprintf(file,"%s};\n",i_str); fprintf(file,"%s};\n",i_str);
return True; return TRUE;
} }
/*ARGSUSED*/ /*ARGSUSED*/
@ -700,7 +700,7 @@ XkbOverlayKeyPtr key;
} }
} }
fprintf(file,"\n%s};\n",i_str); fprintf(file,"\n%s};\n",i_str);
return True; return TRUE;
} }
static Bool static Bool
@ -788,7 +788,7 @@ int dfltKeyColor = 0;
} }
fprintf(file," }; // End of \"%s\" section\n\n", fprintf(file," }; // End of \"%s\" section\n\n",
XkbAtomText(s->name,XkbXKBFile)); XkbAtomText(s->name,XkbXKBFile));
return True; return TRUE;
} }
Bool Bool
@ -804,7 +804,7 @@ XkbGeometryPtr geom;
if ((!xkb)||(!xkb->geom)) { if ((!xkb)||(!xkb->geom)) {
_XkbLibError(_XkbErrMissingGeometry,"XkbWriteXKBGeometry",0); _XkbLibError(_XkbErrMissingGeometry,"XkbWriteXKBGeometry",0);
return False; return FALSE;
} }
geom= xkb->geom; geom= xkb->geom;
if (geom->name==None) if (geom->name==None)
@ -891,5 +891,5 @@ XkbGeometryPtr geom;
if (addOn) if (addOn)
(*addOn)(file,xkb,topLevel,showImplicit,XkmGeometryIndex,priv); (*addOn)(file,xkb,topLevel,showImplicit,XkmGeometryIndex,priv);
fprintf(file,"};\n\n"); fprintf(file,"};\n\n");
return True; return TRUE;
} }

View File

@ -527,9 +527,9 @@ Bool ok;
} }
else if (format==XkbXKMFile) else if (format==XkbXKMFile)
return str; return str;
for (ok= True,len=0,in=str;*in!='\0';in++,len++) { for (ok= TRUE,len=0,in=str;*in!='\0';in++,len++) {
if (!isprint(*in)) { if (!isprint(*in)) {
ok= False; ok= FALSE;
switch (*in) { switch (*in) {
case '\n': case '\t': case '\v': case '\n': case '\t': case '\v':
case '\b': case '\r': case '\f': case '\b': case '\r': case '\f':
@ -661,18 +661,18 @@ register int len;
if (len<((*pLeft)-3)) { if (len<((*pLeft)-3)) {
strcat(to,from); strcat(to,from);
*pLeft-= len; *pLeft-= len;
return True; return TRUE;
} }
} }
*pLeft= -1; *pLeft= -1;
return False; return FALSE;
} }
/*ARGSUSED*/ /*ARGSUSED*/
static Bool static Bool
CopyNoActionArgs(XkbDescPtr xkb,XkbAction *action,char *buf,int*sz) CopyNoActionArgs(XkbDescPtr xkb,XkbAction *action,char *buf,int*sz)
{ {
return True; return TRUE;
} }
static Bool static Bool
@ -694,12 +694,12 @@ unsigned tmp;
} }
else TryCopyStr(buf,"none",sz); else TryCopyStr(buf,"none",sz);
if (act->type==XkbSA_LockMods) if (act->type==XkbSA_LockMods)
return True; return TRUE;
if (act->flags&XkbSA_ClearLocks) if (act->flags&XkbSA_ClearLocks)
TryCopyStr(buf,",clearLocks",sz); TryCopyStr(buf,",clearLocks",sz);
if (act->flags&XkbSA_LatchToLock) if (act->flags&XkbSA_LatchToLock)
TryCopyStr(buf,",latchToLock",sz); TryCopyStr(buf,",latchToLock",sz);
return True; return TRUE;
} }
/*ARGSUSED*/ /*ARGSUSED*/
@ -719,12 +719,12 @@ char tbuf[32];
else sprintf(tbuf,"+%d",XkbSAGroup(act)); else sprintf(tbuf,"+%d",XkbSAGroup(act));
TryCopyStr(buf,tbuf,sz); TryCopyStr(buf,tbuf,sz);
if (act->type==XkbSA_LockGroup) if (act->type==XkbSA_LockGroup)
return True; return TRUE;
if (act->flags&XkbSA_ClearLocks) if (act->flags&XkbSA_ClearLocks)
TryCopyStr(buf,",clearLocks",sz); TryCopyStr(buf,",clearLocks",sz);
if (act->flags&XkbSA_LatchToLock) if (act->flags&XkbSA_LatchToLock)
TryCopyStr(buf,",latchToLock",sz); TryCopyStr(buf,",latchToLock",sz);
return True; return TRUE;
} }
/*ARGSUSED*/ /*ARGSUSED*/
@ -749,7 +749,7 @@ char tbuf[32];
TryCopyStr(buf,tbuf,sz); TryCopyStr(buf,tbuf,sz);
if (act->flags&XkbSA_NoAcceleration) if (act->flags&XkbSA_NoAcceleration)
TryCopyStr(buf,",!accel",sz); TryCopyStr(buf,",!accel",sz);
return True; return TRUE;
} }
/*ARGSUSED*/ /*ARGSUSED*/
@ -783,7 +783,7 @@ char tbuf[32];
} }
TryCopyStr(buf,tbuf,sz); TryCopyStr(buf,tbuf,sz);
} }
return True; return TRUE;
} }
/*ARGSUSED*/ /*ARGSUSED*/
@ -802,7 +802,7 @@ char tbuf[32];
else sprintf(tbuf,"+%d",XkbSAPtrDfltValue(act)); else sprintf(tbuf,"+%d",XkbSAPtrDfltValue(act));
TryCopyStr(buf,tbuf,sz); TryCopyStr(buf,tbuf,sz);
} }
return True; return TRUE;
} }
static Bool static Bool
@ -863,7 +863,7 @@ char tbuf[64];
nOut++; nOut++;
} }
} }
return True; return TRUE;
} }
/*ARGSUSED*/ /*ARGSUSED*/
@ -882,7 +882,7 @@ char tbuf[32];
if (act->flags&XkbSA_SwitchApplication) if (act->flags&XkbSA_SwitchApplication)
TryCopyStr(buf,",!same",sz); TryCopyStr(buf,",!same",sz);
else TryCopyStr(buf,",same",sz); else TryCopyStr(buf,",same",sz);
return True; return TRUE;
} }
/*ARGSUSED*/ /*ARGSUSED*/
@ -969,7 +969,7 @@ char tbuf[32];
nOut++; nOut++;
} }
} }
return True; return TRUE;
} }
/*ARGSUSED*/ /*ARGSUSED*/
@ -997,7 +997,7 @@ char tbuf[32];
sprintf(tbuf,",data[3]=0x%02x",act->message[3]); TryCopyStr(buf,tbuf,sz); sprintf(tbuf,",data[3]=0x%02x",act->message[3]); TryCopyStr(buf,tbuf,sz);
sprintf(tbuf,",data[4]=0x%02x",act->message[4]); TryCopyStr(buf,tbuf,sz); sprintf(tbuf,",data[4]=0x%02x",act->message[4]); TryCopyStr(buf,tbuf,sz);
sprintf(tbuf,",data[5]=0x%02x",act->message[5]); TryCopyStr(buf,tbuf,sz); sprintf(tbuf,",data[5]=0x%02x",act->message[5]); TryCopyStr(buf,tbuf,sz);
return True; return TRUE;
} }
static Bool static Bool
@ -1022,7 +1022,7 @@ unsigned vmods,vmods_mask;
else sprintf(tbuf,"key=%d",kc); else sprintf(tbuf,"key=%d",kc);
TryCopyStr(buf,tbuf,sz); TryCopyStr(buf,tbuf,sz);
if ((act->mods_mask==0)&&(vmods_mask==0)) if ((act->mods_mask==0)&&(vmods_mask==0))
return True; return TRUE;
if ((act->mods_mask==XkbAllModifiersMask)&& if ((act->mods_mask==XkbAllModifiersMask)&&
(vmods_mask==XkbAllVirtualModsMask)) { (vmods_mask==XkbAllVirtualModsMask)) {
tmp= XkbVModMaskText(xkb,act->mods,vmods,XkbXKBFile); tmp= XkbVModMaskText(xkb,act->mods,vmods,XkbXKBFile);
@ -1043,7 +1043,7 @@ unsigned vmods,vmods_mask;
TryCopyStr(buf,tmp,sz); TryCopyStr(buf,tmp,sz);
} }
} }
return True; return TRUE;
} }
/*ARGSUSED*/ /*ARGSUSED*/
@ -1076,7 +1076,7 @@ char tbuf[32];
} }
TryCopyStr(buf,tbuf,sz); TryCopyStr(buf,tbuf,sz);
} }
return True; return TRUE;
} }
/*ARGSUSED*/ /*ARGSUSED*/
@ -1095,7 +1095,7 @@ char tbuf[32];
sprintf(tbuf,",data[4]=0x%02x",act->data[4]); TryCopyStr(buf,tbuf,sz); sprintf(tbuf,",data[4]=0x%02x",act->data[4]); TryCopyStr(buf,tbuf,sz);
sprintf(tbuf,",data[5]=0x%02x",act->data[5]); TryCopyStr(buf,tbuf,sz); sprintf(tbuf,",data[5]=0x%02x",act->data[5]); TryCopyStr(buf,tbuf,sz);
sprintf(tbuf,",data[6]=0x%02x",act->data[6]); TryCopyStr(buf,tbuf,sz); sprintf(tbuf,",data[6]=0x%02x",act->data[6]); TryCopyStr(buf,tbuf,sz);
return True; return TRUE;
} }
typedef Bool (*actionCopy)( typedef Bool (*actionCopy)(
@ -1173,7 +1173,7 @@ char buf[256],*tmp;
permanent=((behavior->type&XkbKB_Permanent)!=0); permanent=((behavior->type&XkbKB_Permanent)!=0);
if (type==XkbKB_Lock) { if (type==XkbKB_Lock) {
sprintf(buf,"lock= %s",(permanent?"Permanent":"True")); sprintf(buf,"lock= %s",(permanent?"Permanent":"TRUE"));
} }
else if (type==XkbKB_RadioGroup) { else if (type==XkbKB_RadioGroup) {
int g; int g;

View File

@ -195,7 +195,7 @@ int nRead=0;
char name[100]; char name[100];
if (named&bit) { if (named&bit) {
if (nRead+=XkmGetCountedString(file,name,100)) { if (nRead+=XkmGetCountedString(file,name,100)) {
xkb->names->vmods[i]= XkbInternAtom(name,False); xkb->names->vmods[i]= XkbInternAtom(name,FALSE);
if (changes) if (changes)
changes->names.changed_vmods|= bit; changes->names.changed_vmods|= bit;
} }
@ -240,7 +240,7 @@ XkbKeyNamePtr pN;
return -1; return -1;
} }
if (name[0]!='\0') { if (name[0]!='\0') {
xkb->names->keycodes= XkbInternAtom(name,False); xkb->names->keycodes= XkbInternAtom(name,FALSE);
} }
for (pN=&xkb->names->keys[minKC],i=minKC;i<=(int)maxKC;i++,pN++) { for (pN=&xkb->names->keys[minKC],i=minKC;i<=(int)maxKC;i++,pN++) {
@ -294,7 +294,7 @@ char buf[100];
_XkbLibError(_XkbErrBadAlloc,"ReadXkmKeyTypes",0); _XkbLibError(_XkbErrBadAlloc,"ReadXkmKeyTypes",0);
return -1; return -1;
} }
xkb->names->types= XkbInternAtom(buf,False); xkb->names->types= XkbInternAtom(buf,FALSE);
} }
num_types= XkmGetCARD16(file,&nRead); num_types= XkmGetCARD16(file,&nRead);
nRead+= XkmSkipPadding(file,2); nRead+= XkmSkipPadding(file,2);
@ -349,7 +349,7 @@ char buf[100];
return -1; return -1;
} }
if (buf[0]!='\0') { if (buf[0]!='\0') {
type->name= XkbInternAtom(buf,False); type->name= XkbInternAtom(buf,FALSE);
} }
else type->name= None; else type->name= None;
@ -430,7 +430,7 @@ XkbAction *act;
_XkbLibError(_XkbErrBadAlloc,"ReadXkmCompatMap",0); _XkbLibError(_XkbErrBadAlloc,"ReadXkmCompatMap",0);
return -1; return -1;
} }
xkb->names->compat= XkbInternAtom(name,False); xkb->names->compat= XkbInternAtom(name,FALSE);
} }
num_si= XkmGetCARD16(file,&nRead); num_si= XkmGetCARD16(file,&nRead);
groups= XkmGetCARD8(file,&nRead); groups= XkmGetCARD8(file,&nRead);
@ -603,7 +603,7 @@ int nRead=0;
} }
nRead+= tmp; nRead+= tmp;
if (buf[0]!='\0') if (buf[0]!='\0')
name= XkbInternAtom(buf,False); name= XkbInternAtom(buf,FALSE);
else name= None; else name= None;
if ((tmp=fread(&wire,SIZEOF(xkmIndicatorMapDesc),1,file))<1) { if ((tmp=fread(&wire,SIZEOF(xkmIndicatorMapDesc),1,file))<1) {
_XkbLibError(_XkbErrBadLength,"ReadXkmIndicators",0); _XkbLibError(_XkbErrBadLength,"ReadXkmIndicators",0);
@ -822,7 +822,7 @@ int nRead=0;
nRead+= XkmGetCountedString(file,buf,100); nRead+= XkmGetCountedString(file,buf,100);
tmp= fread(&doodadWire,SIZEOF(xkmDoodadDesc),1,file); tmp= fread(&doodadWire,SIZEOF(xkmDoodadDesc),1,file);
nRead+= SIZEOF(xkmDoodadDesc)*tmp; nRead+= SIZEOF(xkmDoodadDesc)*tmp;
doodad= XkbAddGeomDoodad(geom,section,XkbInternAtom(buf,False)); doodad= XkbAddGeomDoodad(geom,section,XkbInternAtom(buf,FALSE));
if (!doodad) if (!doodad)
return nRead; return nRead;
doodad->any.type= doodadWire.any.type; doodad->any.type= doodadWire.any.type;
@ -882,7 +882,7 @@ register int r;
nRead+= XkmGetCountedString(file,buf,100); nRead+= XkmGetCountedString(file,buf,100);
tmp= fread(&olWire,SIZEOF(xkmOverlayDesc),1,file); tmp= fread(&olWire,SIZEOF(xkmOverlayDesc),1,file);
nRead+= tmp*SIZEOF(xkmOverlayDesc); nRead+= tmp*SIZEOF(xkmOverlayDesc);
ol= XkbAddGeomOverlay(section,XkbInternAtom(buf,False), ol= XkbAddGeomOverlay(section,XkbInternAtom(buf,FALSE),
olWire.num_rows); olWire.num_rows);
if (!ol) if (!ol)
return nRead; return nRead;
@ -920,7 +920,7 @@ char buf[100];
Atom nameAtom; Atom nameAtom;
nRead+= XkmGetCountedString(file,buf,100); nRead+= XkmGetCountedString(file,buf,100);
nameAtom= XkbInternAtom(buf,False); nameAtom= XkbInternAtom(buf,FALSE);
tmp= fread(&sectionWire,SIZEOF(xkmSectionDesc),1,file); tmp= fread(&sectionWire,SIZEOF(xkmSectionDesc),1,file);
nRead+= SIZEOF(xkmSectionDesc)*tmp; nRead+= SIZEOF(xkmSectionDesc)*tmp;
section= XkbAddGeomSection(geom,nameAtom,sectionWire.num_rows, section= XkbAddGeomSection(geom,nameAtom,sectionWire.num_rows,
@ -1014,7 +1014,7 @@ XkbGeometrySizesRec sizes;
return nRead; return nRead;
} }
geom= xkb->geom; geom= xkb->geom;
geom->name= XkbInternAtom(buf,False); geom->name= XkbInternAtom(buf,FALSE);
geom->width_mm= wireGeom.width_mm; geom->width_mm= wireGeom.width_mm;
geom->height_mm= wireGeom.height_mm; geom->height_mm= wireGeom.height_mm;
nRead+= XkmGetCountedString(file,buf,100); nRead+= XkmGetCountedString(file,buf,100);
@ -1050,7 +1050,7 @@ XkbGeometrySizesRec sizes;
XkbOutlinePtr ol; XkbOutlinePtr ol;
xkmOutlineDesc olWire; xkmOutlineDesc olWire;
nRead+= XkmGetCountedString(file,buf,100); nRead+= XkmGetCountedString(file,buf,100);
nameAtom= XkbInternAtom(buf,False); nameAtom= XkbInternAtom(buf,FALSE);
tmp= fread(&shapeWire,SIZEOF(xkmShapeDesc),1,file); tmp= fread(&shapeWire,SIZEOF(xkmShapeDesc),1,file);
nRead+= tmp*SIZEOF(xkmShapeDesc); nRead+= tmp*SIZEOF(xkmShapeDesc);
shape= XkbAddGeomShape(geom,nameAtom,shapeWire.num_outlines); shape= XkbAddGeomShape(geom,nameAtom,shapeWire.num_outlines);