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>
master
Ran Benita 2012-05-09 17:54:37 +03:00 committed by Daniel Stone
parent e7bb1e5fd9
commit 5e59ef3f47
7 changed files with 6 additions and 42 deletions

View File

@ -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:

View File

@ -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 {

View File

@ -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));

View File

@ -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

View File

@ -850,8 +850,6 @@ FreeXKBFile(XkbFile *file)
switch (file->type)
{
case XkmKeymapFile:
case XkmSemanticsFile:
case XkmLayoutFile:
FreeXKBFile((XkbFile *)file->defs);
break;
case XkmTypesIndex:

View File

@ -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

View File

@ -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;
}