Remove half-implemented radio groups It looks like this could never have worked anyway, what with num_rg always being 0 everywhere. Remove it. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
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 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221
diff --git a/include/xkbcommon/xkbcommon.h b/include/xkbcommon/xkbcommon.h
index ac7b848..4ef3dd2 100644
--- a/include/xkbcommon/xkbcommon.h
+++ b/include/xkbcommon/xkbcommon.h
@@ -327,7 +327,6 @@ struct xkb_names {
xkb_keycode_t num_keys;
xkb_keycode_t num_key_aliases;
- unsigned short num_rg;
};
struct xkb_controls {
@@ -436,7 +435,6 @@ struct xkb_name_changes {
unsigned char first_lvl;
unsigned char num_lvls;
xkb_keycode_t num_aliases;
- unsigned char num_rg;
xkb_keycode_t first_key;
xkb_keycode_t num_keys;
unsigned short changed_vmods;
diff --git a/src/xkbcomp/expr.c b/src/xkbcomp/expr.c
index d912631..60467cd 100644
--- a/src/xkbcomp/expr.c
+++ b/src/xkbcomp/expr.c
@@ -188,33 +188,6 @@ SimpleLookup(const void * priv, xkb_atom_t field, unsigned type,
return False;
}
-static Bool
-RadioLookup(const void * priv, xkb_atom_t field, unsigned type, ExprResult * val_rtrn)
-{
- const char *str;
- int rg;
-
- if ((field == None) || (type != TypeInt))
- return False;
- str = XkbcAtomText(field);
- if (str)
- {
- if (uStrCasePrefix("group", str))
- str += strlen("group");
- else if (uStrCasePrefix("radiogroup", str))
- str += strlen("radiogroup");
- else if (uStrCasePrefix("rg", str))
- str += strlen("rg");
- else if (!isdigit(str[0]))
- str = NULL;
- }
- if ((!str) || (sscanf(str, "%i", &rg) < 1) || (rg < 1)
- || (rg > XkbMaxRadioGroups))
- return False;
- val_rtrn->uval = rg;
- return True;
-}
-
static const LookupEntry modIndexNames[] = {
{"shift", ShiftMapIndex},
{"control", ControlMapIndex},
@@ -509,9 +482,8 @@ ExprResolveKeyCode(ExprDef * expr,
* returned as millimetres (rather than points) in ival.
*
* If an ident or field reference is given, the lookup function (if given)
- * will be called. At the moment, only RadioLookup and SimpleLookup use
- * this, and they both return the results in uval. And don't support field
- * references.
+ * will be called. At the moment, only SimpleLookup use this, and they both
+ * return the results in uval. And don't support field references.
*
* Cool.
*/
@@ -632,13 +604,6 @@ ExprResolveInteger(ExprDef * expr,
}
int
-ExprResolveRadioGroup(ExprDef * expr,
- ExprResult * val_rtrn)
-{
- return ExprResolveIntegerLookup(expr, val_rtrn, RadioLookup, NULL);
-}
-
-int
ExprResolveGroup(ExprDef * expr,
ExprResult * val_rtrn)
{
diff --git a/src/xkbcomp/expr.h b/src/xkbcomp/expr.h
index c990351..414ff02 100644
--- a/src/xkbcomp/expr.h
+++ b/src/xkbcomp/expr.h
@@ -90,10 +90,6 @@ extern int ExprResolveInteger(ExprDef * /* expr */ ,
ExprResult * /* val_rtrn */
);
-extern int ExprResolveRadioGroup(ExprDef * /* expr */ ,
- ExprResult * /* val_rtrn */
- );
-
extern int ExprResolveLevel(ExprDef * /* expr */ ,
ExprResult * /* val_rtrn */
);
diff --git a/src/xkbcomp/symbols.c b/src/xkbcomp/symbols.c
index 0d430c4..dfaf547 100644
--- a/src/xkbcomp/symbols.c
+++ b/src/xkbcomp/symbols.c
@@ -1004,49 +1004,6 @@ AddActionsToKey(KeyInfo * key,
return True;
}
-static int
-SetAllowNone(KeyInfo * key, ExprDef * arrayNdx, ExprDef * value)
-{
- ExprResult tmp;
- unsigned radio_groups = 0;
-
- if (arrayNdx == NULL)
- {
- radio_groups = XkbAllRadioGroupsMask;
- }
- else
- {
- if (!ExprResolveRadioGroup(arrayNdx, &tmp))
- {
- ERROR("Illegal index in group name definition\n");
- ACTION("Definition with non-integer array index ignored\n");
- return False;
- }
- if ((tmp.uval < 1) || (tmp.uval > XkbMaxRadioGroups))
- {
- ERROR("Illegal radio group specified (must be 1..%d)\n",
- XkbMaxRadioGroups + 1);
- ACTION("Value of \"allow none\" for group %d ignored\n",
- tmp.uval);
- return False;
- }
- radio_groups |= (1 << (tmp.uval - 1));
- }
- if (!ExprResolveBoolean(value, &tmp))
- {
- ERROR("Illegal \"allow none\" value for %s\n",
- longText(key->name));
- ACTION("Non-boolean value ignored\n");
- return False;
- }
- if (tmp.uval)
- key->allowNone |= radio_groups;
- else
- key->allowNone &= ~radio_groups;
- return True;
-}
-
-
static const LookupEntry lockingEntries[] = {
{"true", XkbKB_Lock},
{"yes", XkbKB_Lock},
@@ -1139,51 +1096,12 @@ SetSymbolsField(KeyInfo * key,
key->defs.defined |= _Key_Behavior;
}
else if ((uStrCaseCmp(field, "radiogroup") == 0) ||
- (uStrCaseCmp(field, "permanentradiogroup") == 0))
+ (uStrCaseCmp(field, "permanentradiogroup") == 0) ||
+ (uStrCaseEqual(field, "allownone")))
{
- Bool permanent = False;
- if (uStrCaseCmp(field, "permanentradiogroup") == 0)
- permanent = True;
- if (ExprResolveString(value, &tmp)) {
- ok = (strcmp(tmp.str, "none") == 0);
- free(tmp.str);
- if (ok)
- tmp.uval = 0;
- }
- else {
- ok = ExprResolveInteger(value, &tmp);
- }
- if (!ok)
- {
- ERROR("Illegal radio group specification for %s\n",
- longText(key->name));
- ACTION("Non-integer radio group ignored\n");
- return False;
- }
- if (tmp.uval == 0)
- {
- key->behavior.type = XkbKB_Default;
- key->behavior.data = 0;
- return ok;
- }
- if ((tmp.uval < 1) || (tmp.uval > XkbMaxRadioGroups))
- {
- ERROR
- ("Radio group specification for %s out of range (1..32)\n",
- longText(key->name));
- ACTION("Illegal radio group %d ignored\n", tmp.uval);
- return False;
- }
- key->behavior.type =
- XkbKB_RadioGroup | (permanent ? XkbKB_Permanent : 0);
- key->behavior.data = tmp.uval - 1;
- if (key->allowNone & (1 << (tmp.uval - 1)))
- key->behavior.data |= XkbKB_RGAllowNone;
- key->defs.defined |= _Key_Behavior;
- }
- else if (uStrCaseEqual(field, "allownone"))
- {
- ok = SetAllowNone(key, arrayNdx, value);
+ ERROR("Radio groups not supported\n");
+ ACTION("Ignoring radio group specification for key %s\n", longText(key->name));
+ return False;
}
else if (uStrCasePrefix("overlay", field) ||
uStrCasePrefix("permanentoverlay", field))
@@ -1414,7 +1332,9 @@ HandleSymbolsVar(VarDef * stmt, struct xkb_desc * xkb, SymbolsInfo * info)
}
else if ((elem.str == NULL) && (uStrCaseCmp(field.str, "allownone") == 0))
{
- ret = SetAllowNone(&info->dflt, arrayNdx, stmt->value);
+ ERROR("Radio groups not supported\n");
+ ACTION("Ignoring \"allow none\" specification\n");
+ ret = False;
}
else {
ret = SetActionField(xkb, elem.str, field.str, arrayNdx, stmt->value,