Remove support for xkb_layout and xkb_semantics file types These are two aggregate file types which are not used anywhere. We maintain useful-enough backward compatibility in the parser, by treating them as xkb_keymap. The keymap type allows for all types of components, so they will still compile fine if they ever come up. Signed-off-by: Ran Benita <ran234@gmail.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
diff --git a/src/text.c b/src/text.c
index 7603a6a..2ca411b 100644
--- a/src/text.c
+++ b/src/text.c
@@ -189,10 +189,6 @@ const char *
XkbcConfigText(unsigned config)
{
switch (config) {
- case XkmSemanticsFile:
- return "Semantics";
- case XkmLayoutFile:
- return "Layout";
case XkmKeymapFile:
return "Keymap";
case XkmTypesIndex:
diff --git a/src/xkb-priv.h b/src/xkb-priv.h
index 35f7f8a..7527bf3 100644
--- a/src/xkb-priv.h
+++ b/src/xkb-priv.h
@@ -89,8 +89,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "utils.h"
/* From XKM.h */
-#define XkmSemanticsFile 20
-#define XkmLayoutFile 21
#define XkmKeymapFile 22
#define XkmRulesFile 24
@@ -106,14 +104,8 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#define XkmKeyNamesMask (1<<4)
#define XkmGeometryMask (1<<5)
-#define XkmSemanticsRequired (XkmCompatMapMask)
-#define XkmSemanticsOptional (XkmTypesMask|XkmGeometryMask)
-#define XkmSemanticsLegal (XkmSemanticsRequired|XkmSemanticsOptional)
-#define XkmLayoutRequired (XkmKeyNamesMask|XkmSymbolsMask|XkmTypesMask)
-#define XkmLayoutOptional (XkmGeometryMask)
-#define XkmLayoutLegal (XkmLayoutRequired|XkmLayoutOptional)
-#define XkmKeymapRequired (XkmSemanticsRequired|XkmLayoutRequired)
-#define XkmKeymapOptional ((XkmSemanticsOptional|XkmLayoutOptional)&(~XkmKeymapRequired))
+#define XkmKeymapRequired (XkmCompatMapMask|XkmKeyNamesMask|XkmSymbolsMask|XkmTypesMask)
+#define XkmKeymapOptional ((XkmTypesMask|XkmGeometryMask)&(~XkmKeymapRequired))
#define XkmKeymapLegal (XkmKeymapRequired|XkmKeymapOptional)
struct xkb_any_action {
diff --git a/src/xkbcomp/keymap.c b/src/xkbcomp/keymap.c
index 58141e0..9967f0e 100644
--- a/src/xkbcomp/keymap.c
+++ b/src/xkbcomp/keymap.c
@@ -57,14 +57,6 @@ CompileKeymap(struct xkb_ctx *ctx, XkbFile *file)
mainName = file->name ? file->name : "(unnamed)";
switch (mainType)
{
- case XkmSemanticsFile:
- required = XkmSemanticsRequired;
- legal = XkmSemanticsLegal;
- break;
- case XkmLayoutFile: /* standard type if setxkbmap -print */
- required = XkmLayoutRequired;
- legal = XkmKeymapLegal;
- break;
case XkmKeymapFile:
required = XkmKeyNamesIndex | XkmTypesIndex | XkmSymbolsIndex |
XkmCompatMapIndex;
@@ -114,8 +106,6 @@ CompileKeymap(struct xkb_ctx *ctx, XkbFile *file)
WSGO("Unknown file type %d\n", file->type);
ACTION("Ignored\n");
continue;
- case XkmSemanticsFile:
- case XkmLayoutFile:
case XkmKeymapFile:
WSGO("Illegal %s configuration in a %s file\n",
XkbcConfigText(file->type), XkbcConfigText(mainType));
diff --git a/src/xkbcomp/parser.y b/src/xkbcomp/parser.y
index 2810a13..9eb51fc 100644
--- a/src/xkbcomp/parser.y
+++ b/src/xkbcomp/parser.y
@@ -182,8 +182,8 @@ XkbCompositeMap : OptFlags XkbCompositeType OptMapName OBRACE
;
XkbCompositeType: XKB_KEYMAP { $$= XkmKeymapFile; }
- | XKB_SEMANTICS { $$= XkmSemanticsFile; }
- | XKB_LAYOUT { $$= XkmLayoutFile; }
+ | XKB_SEMANTICS { $$= XkmKeymapFile; }
+ | XKB_LAYOUT { $$= XkmKeymapFile; }
;
XkbMapConfigList : XkbMapConfigList XkbMapConfig
diff --git a/src/xkbcomp/parseutils.c b/src/xkbcomp/parseutils.c
index 8be29cb..82e74ca 100644
--- a/src/xkbcomp/parseutils.c
+++ b/src/xkbcomp/parseutils.c
@@ -850,8 +850,6 @@ FreeXKBFile(XkbFile *file)
switch (file->type)
{
case XkmKeymapFile:
- case XkmSemanticsFile:
- case XkmLayoutFile:
FreeXKBFile((XkbFile *)file->defs);
break;
case XkmTypesIndex:
diff --git a/src/xkbcomp/path.c b/src/xkbcomp/path.c
index e10d3cf..f45ab6b 100644
--- a/src/xkbcomp/path.c
+++ b/src/xkbcomp/path.c
@@ -146,10 +146,6 @@ XkbDirectoryForInclude(unsigned type)
{
switch (type)
{
- case XkmSemanticsFile:
- return "semantics";
- case XkmLayoutFile:
- return "layout";
case XkmKeymapFile:
return "keymap";
case XkmKeyNamesIndex:
@@ -176,7 +172,7 @@ XkbDirectoryForInclude(unsigned type)
*
* @param ctx the XKB ctx containing the include paths
* @param type one of XkbTypesIndex, XkbCompatMapIndex, ..., or
- * XkbSemanticsFile, XkmKeymapFile, ...
+ * XkmKeymapFile
* @param pathReturn is set to the full path of the file if found.
*
* @return an FD to the file or NULL. If NULL is returned, the value of
diff --git a/src/xkbcomp/xkbcomp.c b/src/xkbcomp/xkbcomp.c
index bf08b01..a18451f 100644
--- a/src/xkbcomp/xkbcomp.c
+++ b/src/xkbcomp/xkbcomp.c
@@ -199,15 +199,7 @@ compile_keymap(struct xkb_ctx *ctx, XkbFile *file)
/* Find map to use */
mapToUse = XkbChooseMap(file, NULL);
- if (!mapToUse)
- goto err;
-
- switch (mapToUse->type) {
- case XkmSemanticsFile:
- case XkmLayoutFile:
- case XkmKeymapFile:
- break;
- default:
+ if (!mapToUse || mapToUse->type != XkmKeymapFile) {
ERROR("file type %d not handled\n", mapToUse->type);
goto err;
}