[gtk/wip/ebassi/shortcut: 228/267] accelgroup: Add gtk_accel_group_print_label()
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/ebassi/shortcut: 228/267] accelgroup: Add gtk_accel_group_print_label()
- Date: Thu, 6 Feb 2020 18:23:01 +0000 (UTC)
commit a96bcd3e00b5af7598d0397befeca10798624047
Author: Benjamin Otte <otte redhat com>
Date: Mon Aug 13 05:19:05 2018 +0200
accelgroup: Add gtk_accel_group_print_label()
gtk/gtkaccelgroup.c | 17 +++++++++++++----
gtk/gtkaccelgroupprivate.h | 9 ++++++---
2 files changed, 19 insertions(+), 7 deletions(-)
---
diff --git a/gtk/gtkaccelgroup.c b/gtk/gtkaccelgroup.c
index 554d87e6e3..2931a59081 100644
--- a/gtk/gtkaccelgroup.c
+++ b/gtk/gtkaccelgroup.c
@@ -1812,11 +1812,22 @@ gtk_accelerator_get_label (guint accelerator_key,
GdkModifierType accelerator_mods)
{
GString *gstring;
+
+ gstring = g_string_new (NULL);
+
+ gtk_accelerator_print_label (gstring, accelerator_key, accelerator_mods);
+
+ return g_string_free (gstring, FALSE);
+}
+
+void
+gtk_accelerator_print_label (GString *gstring,
+ guint accelerator_key,
+ GdkModifierType accelerator_mods)
+{
gboolean seen_mod = FALSE;
gunichar ch;
- gstring = g_string_sized_new (10); /* ~len('backspace') */
-
if (accelerator_mods & GDK_SHIFT_MASK)
{
#ifndef GDK_WINDOWING_QUARTZ
@@ -1996,8 +2007,6 @@ gtk_accelerator_get_label (guint accelerator_key,
}
}
}
-
- return g_string_free (gstring, FALSE);
}
/**
diff --git a/gtk/gtkaccelgroupprivate.h b/gtk/gtkaccelgroupprivate.h
index 15da43ae2b..e2b166378d 100644
--- a/gtk/gtkaccelgroupprivate.h
+++ b/gtk/gtkaccelgroupprivate.h
@@ -34,10 +34,13 @@ struct _GtkAccelGroupPrivate
GtkAccelGroupEntry *priv_accels;
};
-void _gtk_accel_group_reconnect (GtkAccelGroup *accel_group,
- GQuark accel_path_quark);
-GSList* _gtk_accel_group_get_accelerables (GtkAccelGroup *accel_group);
+void _gtk_accel_group_reconnect (GtkAccelGroup *accel_group,
+ GQuark accel_path_quark);
+GSList* _gtk_accel_group_get_accelerables (GtkAccelGroup *accel_group);
+void gtk_accelerator_print_label (GString *gstring,
+ guint accelerator_key,
+ GdkModifierType accelerator_mods);
G_END_DECLS
#endif /* __GTK_ACCEL_GROUP_PRIVATE_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]