Commit 62a75dc17994933caa1bba42ccf8d1c78f07a373

Ran Benita 2012-04-10T23:08:49

Remove unused stuff from XKBcommonint.h Signed-off-by: Ran Benita <ran234@gmail.com>

diff --git a/src/XKBcommonint.h b/src/XKBcommonint.h
index 272274a..396c0bd 100644
--- a/src/XKBcommonint.h
+++ b/src/XKBcommonint.h
@@ -88,39 +88,28 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #include "xkbcommon/xkbcommon.h"
 
 /* From XKM.h */
-#define	XkmFileVersion		15
-
-#define	XkmIllegalFile		-1
 #define	XkmSemanticsFile	20
 #define	XkmLayoutFile		21
 #define	XkmKeymapFile		22
-#define	XkmGeometryFile		23
 #define	XkmRulesFile		24
 
 #define	XkmTypesIndex		0
 #define	XkmCompatMapIndex	1
 #define	XkmSymbolsIndex		2
-#define	XkmIndicatorsIndex	3
 #define	XkmKeyNamesIndex	4
 #define	XkmGeometryIndex	5
-#define	XkmVirtualModsIndex	6
-#define	XkmLastIndex		XkmVirtualModsIndex
 
 #define	XkmTypesMask		(1<<0)
 #define	XkmCompatMapMask	(1<<1)
 #define	XkmSymbolsMask		(1<<2)
-#define	XkmIndicatorsMask	(1<<3)
 #define	XkmKeyNamesMask		(1<<4)
 #define XkmGeometryMask         (1<<5)
-#define	XkmVirtualModsMask	(1<<6)
-#define	XkmLegalIndexMask	(0x7f)
-#define	XkmAllIndicesMask	(0x7f)
 
 #define	XkmSemanticsRequired	(XkmCompatMapMask)
-#define	XkmSemanticsOptional	(XkmTypesMask|XkmVirtualModsMask|XkmIndicatorsMask|XkmGeometryMask)
+#define	XkmSemanticsOptional	(XkmTypesMask|XkmGeometryMask)
 #define	XkmSemanticsLegal	(XkmSemanticsRequired|XkmSemanticsOptional)
 #define	XkmLayoutRequired	(XkmKeyNamesMask|XkmSymbolsMask|XkmTypesMask)
-#define	XkmLayoutOptional	(XkmVirtualModsMask|XkmGeometryMask)
+#define	XkmLayoutOptional	(XkmGeometryMask)
 #define	XkmLayoutLegal		(XkmLayoutRequired|XkmLayoutOptional)
 #define	XkmKeymapRequired	(XkmSemanticsRequired|XkmLayoutRequired)
 #define	XkmKeymapOptional	((XkmSemanticsOptional|XkmLayoutOptional)&(~XkmKeymapRequired))
@@ -293,13 +282,6 @@ struct xkb_sym_map {
         unsigned int     size_syms; /* size of 'syms' */
 };
 
-#define	XkbNumGroups(g)			((g)&0x0f)
-#define	XkbOutOfRangeGroupInfo(g)	((g)&0xf0)
-#define	XkbOutOfRangeGroupAction(g)	((g)&0xc0)
-#define	XkbOutOfRangeGroupNumber(g)	(((g)&0x30)>>4)
-#define	XkbSetGroupInfo(g,w,n)	(((w)&0xc0)|(((n)&3)<<4)|((g)&0x0f))
-#define	XkbSetNumGroups(g,n)	(((g)&0xf0)|((n)&0x0f))
-
 struct xkb_client_map {
     unsigned char            size_types;
     unsigned char            num_types;
@@ -317,17 +299,11 @@ struct xkb_server_map {
     unsigned short      num_acts;
     unsigned short      size_acts;
 
-#if defined(__cplusplus) || defined(c_plusplus)
-    /* explicit is a C++ reserved word */
-    unsigned char *     c_explicit;
-#else
     unsigned char *     explicit;
-#endif
 
     union xkb_action          *acts;
     struct xkb_behavior         *behaviors;
     unsigned short      *key_acts;
-    unsigned char       *explicits;
     uint32_t            vmods[XkbNumVirtualMods]; /* vmod -> mod mapping */
     uint32_t            *vmodmap; /* key -> vmod mapping */
 };
@@ -343,7 +319,6 @@ struct xkb_indicator_map {
 };
 
 struct xkb_indicator {
-	unsigned long	  	phys_indicators;
 	struct xkb_indicator_map	maps[XkbNumIndicators];
 };
 
@@ -391,7 +366,6 @@ struct xkb_keymap {
     struct xkb_context  *context;
 
     unsigned int        refcnt;
-    unsigned int        defined;
     unsigned short      flags;
     xkb_keycode_t       min_key_code;
     xkb_keycode_t       max_key_code;
@@ -404,6 +378,13 @@ struct xkb_keymap {
     struct xkb_compat_map *    compat;
 };
 
+#define	XkbNumGroups(g)			((g)&0x0f)
+#define	XkbOutOfRangeGroupInfo(g)	((g)&0xf0)
+#define	XkbOutOfRangeGroupAction(g)	((g)&0xc0)
+#define	XkbOutOfRangeGroupNumber(g)	(((g)&0x30)>>4)
+#define	XkbSetGroupInfo(g,w,n)	(((w)&0xc0)|(((n)&3)<<4)|((g)&0x0f))
+#define	XkbSetNumGroups(g,n)	(((g)&0xf0)|((n)&0x0f))
+
 #define	XkbKeyGroupInfo(d,k)    ((d)->map->key_sym_map[k].group_info)
 #define	XkbKeyNumGroups(d,k)    (XkbNumGroups((d)->map->key_sym_map[k].group_info))
 #define	XkbKeyGroupWidth(d,k,g) (XkbKeyType(d,k,g)->num_levels)
@@ -431,11 +412,6 @@ struct xkb_keymap {
 				 ((k)<=(d)->max_key_code))
 #define	XkbNumKeys(d)		((d)->max_key_code-(d)->min_key_code+1)
 
-struct xkb_component_name {
-	unsigned short		flags;
-	char *			name;
-};
-
 struct xkb_state {
 	xkb_group_index_t base_group; /**< depressed */
 	xkb_group_index_t latched_group;
@@ -455,13 +431,4 @@ struct xkb_state {
         struct xkb_keymap *xkb;
 };
 
-#define	XkbStateFieldFromRec(s)	XkbBuildCoreState((s)->lookup_mods,(s)->group)
-#define	XkbGrabStateFromRec(s)	XkbBuildCoreState((s)->grab_mods,(s)->group)
-
-#define	XkbNumGroups(g)			((g)&0x0f)
-#define	XkbOutOfRangeGroupInfo(g)	((g)&0xf0)
-#define	XkbOutOfRangeGroupAction(g)	((g)&0xc0)
-#define	XkbOutOfRangeGroupNumber(g)	(((g)&0x30)>>4)
-#define	XkbSetNumGroups(g,n)	(((g)&0xf0)|((n)&0x0f))
-
 #endif /* _XKBCOMMONINT_H_ */
diff --git a/src/text.c b/src/text.c
index d8c70a2..c4d81c5 100644
--- a/src/text.c
+++ b/src/text.c
@@ -206,12 +206,8 @@ XkbcConfigText(unsigned config)
         return "CompatMap";
     case XkmSymbolsIndex:
         return "Symbols";
-    case XkmIndicatorsIndex:
-        return "Indicators";
     case XkmKeyNamesIndex:
         return "KeyNames";
-    case XkmVirtualModsIndex:
-        return "VirtualMods";
     default:
         return "unknown";
     }
diff --git a/src/xkbcomp/indicators.c b/src/xkbcomp/indicators.c
index ce1606c..8f614f9 100644
--- a/src/xkbcomp/indicators.c
+++ b/src/xkbcomp/indicators.c
@@ -473,7 +473,6 @@ BindIndicators(struct xkb_keymap * xkb, bool force, LEDInfo *unbound,
                         {
                             xkb->names->indicators[i] = XkbcAtomGetString(led->name);
                             led->indicator = i + 1;
-                            xkb->indicators->phys_indicators &= ~(1 << i);
                             break;
                         }
                     }
diff --git a/src/xkbcomp/keycodes.c b/src/xkbcomp/keycodes.c
index b1e7937..4715645 100644
--- a/src/xkbcomp/keycodes.c
+++ b/src/xkbcomp/keycodes.c
@@ -918,15 +918,6 @@ CompileKeycodes(XkbFile *file, struct xkb_keymap * xkb, unsigned merge)
             {
                 free(UNCONSTIFY(xkb->names->indicators[ii->ndx - 1]));
                 xkb->names->indicators[ii->ndx - 1] = XkbcAtomGetString(ii->name);
-                if (xkb->indicators != NULL)
-                {
-                    unsigned bit;
-                    bit = 1 << (ii->ndx - 1);
-                    if (ii->virtual)
-                        xkb->indicators->phys_indicators &= ~bit;
-                    else
-                        xkb->indicators->phys_indicators |= bit;
-                }
             }
         }
         if (info.aliases)
diff --git a/src/xkbcomp/keymap.c b/src/xkbcomp/keymap.c
index e6cbf52..635167d 100644
--- a/src/xkbcomp/keymap.c
+++ b/src/xkbcomp/keymap.c
@@ -72,8 +72,8 @@ CompileKeymap(struct xkb_context *context, XkbFile *file)
         legal = XkmKeymapLegal;
         break;
     case XkmKeymapFile:
-        required = XkmKeyNamesIndex | XkmTypesIndex | XkmSymbolsIndex | \
-                   XkmCompatMapIndex | XkmVirtualModsIndex;
+        required = XkmKeyNamesIndex | XkmTypesIndex | XkmSymbolsIndex |
+                   XkmCompatMapIndex;
         legal = XkmKeymapLegal;
         break;
     default:
@@ -116,11 +116,6 @@ CompileKeymap(struct xkb_context *context, XkbFile *file)
             break;
         case XkmGeometryIndex:
             continue;
-        case XkmVirtualModsIndex:
-        case XkmIndicatorsIndex:
-            WSGO("Found an isolated %s section\n", XkbcConfigText(file->type));
-            ACTION("Ignored\n");
-            continue;
         default:
             WSGO("Unknown file type %d\n", file->type);
             ACTION("Ignored\n");
@@ -184,8 +179,6 @@ CompileKeymap(struct xkb_context *context, XkbFile *file)
         goto err;
     }
 
-    xkb->defined = have;
-
     ok = BindIndicators(xkb, true, unbound, NULL);
     if (!ok)
         goto err;
diff --git a/src/xkbcomp/parseutils.c b/src/xkbcomp/parseutils.c
index bc82a26..06183c5 100644
--- a/src/xkbcomp/parseutils.c
+++ b/src/xkbcomp/parseutils.c
@@ -838,7 +838,6 @@ FreeXKBFile(XkbFile *file)
         case XkmSymbolsIndex:
         case XkmKeyNamesIndex:
         case XkmGeometryIndex:
-        case XkmGeometryFile:
             FreeStmt(file->defs);
             break;
         }
diff --git a/src/xkbcomp/vmod.c b/src/xkbcomp/vmod.c
index 7765930..dfb6443 100644
--- a/src/xkbcomp/vmod.c
+++ b/src/xkbcomp/vmod.c
@@ -49,10 +49,10 @@ ClearVModInfo(VModInfo * info, struct xkb_keymap * xkb)
 
     info->newlyDefined = info->defined = info->available = 0;
 
-    if (XkbcAllocNames(xkb, XkbVirtualModNamesMask, 0) != Success)
+    if (XkbcAllocNames(xkb, 0, 0) != Success)
         return;
 
-    if (XkbcAllocServerMap(xkb, XkbVirtualModsMask, 0) != Success)
+    if (XkbcAllocServerMap(xkb, 0, 0) != Success)
         return;
 
     info->xkb = xkb;
diff --git a/src/xkbcomp/xkbpath.c b/src/xkbcomp/xkbpath.c
index 298f9be..884e08a 100644
--- a/src/xkbcomp/xkbpath.c
+++ b/src/xkbcomp/xkbpath.c
@@ -163,7 +163,6 @@ XkbDirectoryForInclude(unsigned type)
         return "symbols";
     case XkmCompatMapIndex:
         return "compat";
-    case XkmGeometryFile:
     case XkmGeometryIndex:
         return "geometry";
     case XkmRulesFile: