gtk: Stop using GDK_MODx_MASK

These are never used in practice, and we never want to
see them in the UI, so stop supporting them. This is
in preparation for cleaning up GdkModifierType.
This commit is contained in:
Matthias Clasen 2020-04-05 09:53:02 -04:00
parent b02db72e17
commit d110fddbce
2 changed files with 0 additions and 100 deletions

View File

@ -132,17 +132,6 @@ is_ctl (const gchar *string)
(string[4] == '>'));
}
static inline gboolean
is_modx (const gchar *string)
{
return ((string[0] == '<') &&
(string[1] == 'm' || string[1] == 'M') &&
(string[2] == 'o' || string[2] == 'O') &&
(string[3] == 'd' || string[3] == 'D') &&
(string[4] >= '1' && string[4] <= '5') &&
(string[5] == '>'));
}
static inline gboolean
is_ctrl (const gchar *string)
{
@ -335,18 +324,6 @@ gtk_accelerator_parse_with_keycode (const gchar *accelerator,
len -= 6;
mods |= GDK_CONTROL_MASK;
}
else if (len >= 6 && is_modx (accelerator))
{
static const guint mod_vals[] = {
GDK_ALT_MASK, GDK_MOD2_MASK, GDK_MOD3_MASK,
GDK_MOD4_MASK, GDK_MOD5_MASK
};
len -= 6;
accelerator += 4;
mods |= mod_vals[*accelerator - '1'];
accelerator += 2;
}
else if (len >= 5 && is_ctl (accelerator))
{
accelerator += 5;
@ -599,10 +576,6 @@ gtk_accelerator_name (guint accelerator_key,
static const gchar text_shift[] = "<Shift>";
static const gchar text_control[] = "<Control>";
static const gchar text_alt[] = "<Alt>";
static const gchar text_mod2[] = "<Mod2>";
static const gchar text_mod3[] = "<Mod3>";
static const gchar text_mod4[] = "<Mod4>";
static const gchar text_mod5[] = "<Mod5>";
static const gchar text_meta[] = "<Meta>";
static const gchar text_super[] = "<Super>";
static const gchar text_hyper[] = "<Hyper>";
@ -630,15 +603,6 @@ gtk_accelerator_name (guint accelerator_key,
l += sizeof (text_control) - 1;
if (accelerator_mods & GDK_ALT_MASK)
l += sizeof (text_alt) - 1;
if (accelerator_mods & GDK_MOD2_MASK)
l += sizeof (text_mod2) - 1;
if (accelerator_mods & GDK_MOD3_MASK)
l += sizeof (text_mod3) - 1;
if (accelerator_mods & GDK_MOD4_MASK)
l += sizeof (text_mod4) - 1;
if (accelerator_mods & GDK_MOD5_MASK)
l += sizeof (text_mod5) - 1;
l += strlen (keyval_name);
if (accelerator_mods & GDK_META_MASK)
l += sizeof (text_meta) - 1;
if (accelerator_mods & GDK_HYPER_MASK)
@ -672,26 +636,6 @@ gtk_accelerator_name (guint accelerator_key,
strcpy (accelerator + l, text_alt);
l += sizeof (text_alt) - 1;
}
if (accelerator_mods & GDK_MOD2_MASK)
{
strcpy (accelerator + l, text_mod2);
l += sizeof (text_mod2) - 1;
}
if (accelerator_mods & GDK_MOD3_MASK)
{
strcpy (accelerator + l, text_mod3);
l += sizeof (text_mod3) - 1;
}
if (accelerator_mods & GDK_MOD4_MASK)
{
strcpy (accelerator + l, text_mod4);
l += sizeof (text_mod4) - 1;
}
if (accelerator_mods & GDK_MOD5_MASK)
{
strcpy (accelerator + l, text_mod5);
l += sizeof (text_mod5) - 1;
}
if (accelerator_mods & GDK_META_MASK)
{
strcpy (accelerator + l, text_meta);
@ -964,42 +908,6 @@ gtk_accelerator_print_label (GString *gstring,
seen_mod = TRUE;
}
if (accelerator_mods & GDK_MOD2_MASK)
{
if (seen_mod)
append_separator (gstring);
g_string_append (gstring, "Mod2");
seen_mod = TRUE;
}
if (accelerator_mods & GDK_MOD3_MASK)
{
if (seen_mod)
append_separator (gstring);
g_string_append (gstring, "Mod3");
seen_mod = TRUE;
}
if (accelerator_mods & GDK_MOD4_MASK)
{
if (seen_mod)
append_separator (gstring);
g_string_append (gstring, "Mod4");
seen_mod = TRUE;
}
if (accelerator_mods & GDK_MOD5_MASK)
{
if (seen_mod)
append_separator (gstring);
g_string_append (gstring, "Mod5");
seen_mod = TRUE;
}
if (accelerator_mods & GDK_SUPER_MASK)
{
if (seen_mod)

View File

@ -139,14 +139,6 @@ get_labels (guint key, GdkModifierType modifier, guint *n_mods)
labels[i++] = C_("keyboard label", "Ctrl");
if (modifier & GDK_ALT_MASK)
labels[i++] = C_("keyboard label", "Alt");
if (modifier & GDK_MOD2_MASK)
labels[i++] = "Mod2";
if (modifier & GDK_MOD3_MASK)
labels[i++] = "Mod3";
if (modifier & GDK_MOD4_MASK)
labels[i++] = "Mod4";
if (modifier & GDK_MOD5_MASK)
labels[i++] = "Mod5";
if (modifier & GDK_SUPER_MASK)
labels[i++] = C_("keyboard label", "Super");
if (modifier & GDK_HYPER_MASK)