legal = XkmKeymapLegal;
break;
case XkmKeymapFile:
- required = XkmKeymapRequired;
+ required = XkmKeyNamesIndex | XkmTypesIndex | XkmSymbolsIndex | \
+ XkmCompatMapIndex | XkmVirtualModsIndex;
legal = XkmKeymapLegal;
break;
default:
have |= (1 << file->type);
}
- /* compile the sections we have in the file one-by-one, or fail. */
- if (sections.keycodes != NULL &&
- !CompileKeycodes(sections.keycodes, xkb, MergeOverride))
- return False;
- if (sections.types != NULL &&
- !CompileKeyTypes(sections.types, xkb, MergeOverride))
- return False;
- if (sections.compat != NULL &&
- !CompileCompatMap(sections.compat, xkb, MergeOverride, &unbound))
- return False;
- if (sections.symbols != NULL &&
- !CompileSymbols(sections.symbols, xkb, MergeOverride))
- return False;
-
- xkb->defined = have;
if (required & (~have))
{
int i, bit;
return False;
}
+ /* compile the sections we have in the file one-by-one, or fail. */
+ if (sections.keycodes != NULL &&
+ !CompileKeycodes(sections.keycodes, xkb, MergeOverride))
+ return False;
+ if (sections.types != NULL &&
+ !CompileKeyTypes(sections.types, xkb, MergeOverride))
+ return False;
+ if (sections.compat != NULL &&
+ !CompileCompatMap(sections.compat, xkb, MergeOverride, &unbound))
+ return False;
+ if (sections.symbols != NULL &&
+ !CompileSymbols(sections.symbols, xkb, MergeOverride))
+ return False;
+
+ xkb->defined = have;
+
ok = BindIndicators(xkb, True, unbound, NULL);
return ok;
}
XkbFile *keycodes, *types, *compat, *symbols;
IncludeStmt *inc;
- if (!ktcsg) {
- ERROR("no components to generate keymap file from\n");
- return NULL;
- }
-
inc = IncludeCreate(ktcsg->keycodes, MergeDefault);
keycodes = CreateXKBFile(XkmKeyNamesIndex, NULL, (ParseCommon *)inc, 0);
{
XkbFile *file;
- if (!ktcsg || ISEMPTY(ktcsg->keycodes)) {
+ if (!ktcsg) {
+ ERROR("no components specified\n");
+ return NULL;
+ }
+
+ if (ISEMPTY(ktcsg->keycodes)) {
ERROR("keycodes required to generate XKB keymap\n");
return NULL;
}
+ if (ISEMPTY(ktcsg->compat)) {
+ ERROR("compat map required to generate XKB keymap\n");
+ return NULL;
+ }
+
+ if (ISEMPTY(ktcsg->types)) {
+ ERROR("types required to generate XKB keymap\n");
+ return NULL;
+ }
+
+ if (ISEMPTY(ktcsg->symbols)) {
+ ERROR("symbols required to generate XKB keymap\n");
+ return NULL;
+ }
+
if (!(file = XkbKeymapFileFromComponents(ktcsg))) {
ERROR("failed to generate parsed XKB file from components\n");
return NULL;