summaryrefslogtreecommitdiff
path: root/xkb
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2008-02-03 23:48:57 +1100
committerDaniel Stone <daniel@fooishbar.org>2008-02-17 22:52:07 +0200
commitab79110a84b2d299ecae0605fa535edbebd99565 (patch)
tree83c441e49a7fc52280348646b6dc94d9553b2660 /xkb
parent1332343910a1880854bae21a790cff198855cd24 (diff)
XKB: Remove support for pre-built keymaps
Don't load prebuilt keymaps anymore.
Diffstat (limited to 'xkb')
-rw-r--r--xkb/ddxLoad.c83
-rw-r--r--xkb/maprules.c4
-rw-r--r--xkb/xkb.c31
-rw-r--r--xkb/xkbInit.c21
4 files changed, 18 insertions, 121 deletions
diff --git a/xkb/ddxLoad.c b/xkb/ddxLoad.c
index 60a8d443a..760119dc9 100644
--- a/xkb/ddxLoad.c
+++ b/xkb/ddxLoad.c
@@ -178,74 +178,6 @@ OutputDirectory(
}
}
-static Bool
-XkbDDXCompileNamedKeymap( XkbDescPtr xkb,
- XkbComponentNamesPtr names,
- char * nameRtrn,
- int nameRtrnLen)
-{
-char *cmd = NULL,file[PATH_MAX],xkm_output_dir[PATH_MAX],*map,*outFile;
-
- if (names->keymap==NULL)
- return False;
- strncpy(file,names->keymap,PATH_MAX); file[PATH_MAX-1]= '\0';
- if ((map= strrchr(file,'('))!=NULL) {
- char *tmp;
- if ((tmp= strrchr(map,')'))!=NULL) {
- *map++= '\0';
- *tmp= '\0';
- }
- else {
- map= NULL;
- }
- }
- if ((outFile= strrchr(file,'/'))!=NULL)
- outFile= _XkbDupString(&outFile[1]);
- else outFile= _XkbDupString(file);
- XkbEnsureSafeMapName(outFile);
- OutputDirectory(xkm_output_dir, sizeof(xkm_output_dir));
-
- if (XkbBaseDirectory!=NULL) {
- char *xkbbasedir = XkbBaseDirectory;
- char *xkbbindir = XkbBinDirectory;
-
- cmd = Xprintf("\"%s" PATHSEPARATOR "xkbcomp\" -w %d \"-R%s\" -xkm %s%s -em1 %s -emp %s -eml %s keymap/%s \"%s%s.xkm\"",
- xkbbindir,
- ((xkbDebugFlags<2)?1:((xkbDebugFlags>10)?10:(int)xkbDebugFlags)),
- xkbbasedir,(map?"-m ":""),(map?map:""),
- PRE_ERROR_MSG,ERROR_PREFIX,POST_ERROR_MSG1,file,
- xkm_output_dir,outFile);
- }
- else {
- cmd = Xprintf("xkbcomp -w %d -xkm %s%s -em1 %s -emp %s -eml %s keymap/%s \"%s%s.xkm\"",
- ((xkbDebugFlags<2)?1:((xkbDebugFlags>10)?10:(int)xkbDebugFlags)),
- (map?"-m ":""),(map?map:""),
- PRE_ERROR_MSG,ERROR_PREFIX,POST_ERROR_MSG1,file,
- xkm_output_dir,outFile);
- }
- if (xkbDebugFlags) {
- DebugF("XkbDDXCompileNamedKeymap compiling keymap using:\n");
- DebugF(" \"cmd\"\n");
- }
- if (System(cmd)==0) {
- if (nameRtrn) {
- strncpy(nameRtrn,outFile,nameRtrnLen);
- nameRtrn[nameRtrnLen-1]= '\0';
- }
- if (outFile!=NULL)
- _XkbFree(outFile);
- if (cmd!=NULL)
- xfree(cmd);
- return True;
- }
- DebugF("Error compiling keymap (%s)\n",names->keymap);
- if (outFile!=NULL)
- _XkbFree(outFile);
- if (cmd!=NULL)
- xfree(cmd);
- return False;
-}
-
static Bool
XkbDDXCompileKeymapByNames( XkbDescPtr xkb,
XkbComponentNamesPtr names,
@@ -418,20 +350,7 @@ unsigned missing;
if ((names->keycodes==NULL)&&(names->types==NULL)&&
(names->compat==NULL)&&(names->symbols==NULL)&&
(names->geometry==NULL)) {
- if (names->keymap==NULL) {
- bzero(finfoRtrn,sizeof(XkbFileInfo));
- if (xkb && XkbDetermineFileType(finfoRtrn,XkbXKMFile,NULL) &&
- ((finfoRtrn->defined&need)==need) ) {
- finfoRtrn->xkb= xkb;
- nameRtrn[0]= '\0';
- return finfoRtrn->defined;
- }
- return 0;
- }
- else if (!XkbDDXCompileNamedKeymap(xkb,names,nameRtrn,nameRtrnLen)) {
- DebugF("Couldn't compile keymap file\n");
- return 0;
- }
+ return 0;
}
else if (!XkbDDXCompileKeymapByNames(xkb,names,want,need,
nameRtrn,nameRtrnLen)){
diff --git a/xkb/maprules.c b/xkb/maprules.c
index 72e642fbe..4c947f004 100644
--- a/xkb/maprules.c
+++ b/xkb/maprules.c
@@ -459,7 +459,7 @@ Bool append = False;
rule->types= _XkbDupString(tmp.name[TYPES]);
rule->compat= _XkbDupString(tmp.name[COMPAT]);
rule->geometry= _XkbDupString(tmp.name[GEOMETRY]);
- rule->keymap= _XkbDupString(tmp.name[KEYMAP]);
+ rule->keymap= NULL;
rule->layout_num = rule->variant_num = 0;
for (i = 0; i < nread; i++) {
@@ -589,7 +589,6 @@ XkbRF_ApplyRule( XkbRF_RulePtr rule,
Apply(rule->types, &names->types);
Apply(rule->compat, &names->compat);
Apply(rule->geometry, &names->geometry);
- Apply(rule->keymap, &names->keymap);
}
static Bool
@@ -1279,7 +1278,6 @@ XkbRF_GroupPtr group;
if (rule->types) _XkbFree(rule->types);
if (rule->compat) _XkbFree(rule->compat);
if (rule->geometry) _XkbFree(rule->geometry);
- if (rule->keymap) _XkbFree(rule->keymap);
bzero((char *)rule,sizeof(XkbRF_RuleRec));
}
_XkbFree(rules->rules);
diff --git a/xkb/xkb.c b/xkb/xkb.c
index bd9a87cf5..ea5189f2c 100644
--- a/xkb/xkb.c
+++ b/xkb/xkb.c
@@ -5157,25 +5157,20 @@ ProcXkbGetKbdByName(ClientPtr client)
if (stuff->load)
fwant= XkbGBN_AllComponentsMask;
else fwant= stuff->want|stuff->need;
- if (!names.keymap) {
- if ((!names.compat)&&
- (fwant&(XkbGBN_CompatMapMask|XkbGBN_IndicatorMapMask))) {
- names.compat= _XkbDupString("%");
- }
- if ((!names.types)&&(fwant&(XkbGBN_TypesMask))) {
- names.types= _XkbDupString("%");
- }
- if ((!names.symbols)&&(fwant&XkbGBN_SymbolsMask)) {
- names.symbols= _XkbDupString("%");
- }
- geom_changed= ((names.geometry!=NULL)&&(strcmp(names.geometry,"%")!=0));
- if ((!names.geometry)&&(fwant&XkbGBN_GeometryMask)) {
- names.geometry= _XkbDupString("%");
- geom_changed= False;
- }
+ if ((!names.compat)&&
+ (fwant&(XkbGBN_CompatMapMask|XkbGBN_IndicatorMapMask))) {
+ names.compat= _XkbDupString("%");
}
- else {
- geom_changed= True;
+ if ((!names.types)&&(fwant&(XkbGBN_TypesMask))) {
+ names.types= _XkbDupString("%");
+ }
+ if ((!names.symbols)&&(fwant&XkbGBN_SymbolsMask)) {
+ names.symbols= _XkbDupString("%");
+ }
+ geom_changed= ((names.geometry!=NULL)&&(strcmp(names.geometry,"%")!=0));
+ if ((!names.geometry)&&(fwant&XkbGBN_GeometryMask)) {
+ names.geometry= _XkbDupString("%");
+ geom_changed= False;
}
bzero(mapFile,PATH_MAX);
diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c
index 2ac51f26c..73dd32e35 100644
--- a/xkb/xkbInit.c
+++ b/xkb/xkbInit.c
@@ -591,7 +591,7 @@ XkbRF_VarDefsRec defs;
* generation. Eventually they will be freed at the end of this
* function.
*/
- if (names->keymap) names->keymap = _XkbDupString(names->keymap);
+ names->keymap = NULL;
if (names->keycodes) names->keycodes = _XkbDupString(names->keycodes);
if (names->types) names->types = _XkbDupString(names->types);
if (names->compat) names->compat = _XkbDupString(names->compat);
@@ -602,11 +602,6 @@ XkbRF_VarDefsRec defs;
XkbComponentNamesRec rNames;
bzero(&rNames,sizeof(XkbComponentNamesRec));
if (XkbDDXNamesFromRules(dev,rules,&defs,&rNames)) {
- if (rNames.keymap) {
- if (!names->keymap)
- names->keymap = rNames.keymap;
- else _XkbFree(rNames.keymap);
- }
if (rNames.keycodes) {
if (!names->keycodes)
names->keycodes = rNames.keycodes;
@@ -637,16 +632,8 @@ XkbRF_VarDefsRec defs;
}
}
- if (names->keymap) {
- XkbComponentNamesRec tmpNames;
- bzero(&tmpNames,sizeof(XkbComponentNamesRec));
- tmpNames.keymap = names->keymap;
- ok = (Bool) XkbDDXLoadKeymapByNames(dev,&tmpNames,XkmAllIndicesMask,0,
- &finfo,name,PATH_MAX);
- }
- if (!(ok && (finfo.xkb!=NULL)))
- ok = (Bool) XkbDDXLoadKeymapByNames(dev,names,XkmAllIndicesMask,0,
- &finfo,name,PATH_MAX);
+ ok = (Bool) XkbDDXLoadKeymapByNames(dev,names,XkmAllIndicesMask,0,
+ &finfo,name,PATH_MAX);
if (ok && (finfo.xkb!=NULL)) {
XkbDescPtr xkb;
@@ -694,8 +681,6 @@ XkbRF_VarDefsRec defs;
pSyms->map= NULL;
}
- if (names->keymap) _XkbFree(names->keymap);
- names->keymap = NULL;
if (names->keycodes) _XkbFree(names->keycodes);
names->keycodes = NULL;
if (names->types) _XkbFree(names->types);