diff options
author | Matthias Clasen <mclasen@redhat.com> | 2014-01-05 11:12:09 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2014-01-05 11:12:09 -0500 |
commit | 7e3f68d950c3d29bcf2e630a0ebeaec67b4f5901 (patch) | |
tree | 1ba14c9f19bf176b4e6b1d7713c3840fdbed23ee | |
parent | 29cd52c8549dc1b41e29c5a2bbdad3701e751aeb (diff) | |
download | gtk+-7e3f68d950c3d29bcf2e630a0ebeaec67b4f5901.tar.gz |
GtkAccelLabel: Add a setter for manual accels
This is needed to keep the a11y keybinding code working.
-rw-r--r-- | docs/reference/gtk/gtk3-sections.txt | 1 | ||||
-rw-r--r-- | gtk/gtkaccellabel.c | 24 | ||||
-rw-r--r-- | gtk/gtkaccellabel.h | 4 |
3 files changed, 29 insertions, 0 deletions
diff --git a/docs/reference/gtk/gtk3-sections.txt b/docs/reference/gtk/gtk3-sections.txt index ae68281376..aaa9c8e630 100644 --- a/docs/reference/gtk/gtk3-sections.txt +++ b/docs/reference/gtk/gtk3-sections.txt @@ -140,6 +140,7 @@ gtk_accel_label_get_accel_widget gtk_accel_label_set_accel_widget gtk_accel_label_get_accel_width gtk_accel_label_set_accel +gtk_accel_label_get_accel gtk_accel_label_refetch <SUBSECTION Standard> GTK_ACCEL_LABEL diff --git a/gtk/gtkaccellabel.c b/gtk/gtkaccellabel.c index 0747f574e2..3dbfeb8b9b 100644 --- a/gtk/gtkaccellabel.c +++ b/gtk/gtkaccellabel.c @@ -981,8 +981,32 @@ gtk_accel_label_set_accel (GtkAccelLabel *accel_label, guint accelerator_key, GdkModifierType accelerator_mods) { + g_return_if_fail (GTK_IS_ACCEL_LABEL (accel_label)); + accel_label->priv->accel_key = accelerator_key; accel_label->priv->accel_mods = accelerator_mods; gtk_accel_label_reset (accel_label); } + +/** + * gtk_accel_label_get_accel: + * @accel_label: a #GtkAccelLabel + * @accelerator_key: return location for the keyval + * @accelerator_mods: return location for the modifier mask + * + * Returns the keyval and modifier mask set with + * gtk_accel_label_set_accel(). + * + * Since: 3.12 + */ +void +gtk_accel_label_get_accel (GtkAccelLabel *accel_label, + guint *accelerator_key, + GdkModifierType *accelerator_mods) +{ + g_return_if_fail (GTK_IS_ACCEL_LABEL (accel_label)); + + *accelerator_key = accel_label->priv->accel_key; + *accelerator_mods = accel_label->priv->accel_mods; +} diff --git a/gtk/gtkaccellabel.h b/gtk/gtkaccellabel.h index 2a56980c9d..27a5712ae7 100644 --- a/gtk/gtkaccellabel.h +++ b/gtk/gtkaccellabel.h @@ -101,6 +101,10 @@ GDK_AVAILABLE_IN_3_6 void gtk_accel_label_set_accel (GtkAccelLabel *accel_label, guint accelerator_key, GdkModifierType accelerator_mods); +GDK_AVAILABLE_IN_3_12 +void gtk_accel_label_get_accel (GtkAccelLabel *accel_label, + guint *accelerator_key, + GdkModifierType *accelerator_mods); /* private */ gchar * _gtk_accel_label_class_get_accelerator_label (GtkAccelLabelClass *klass, |