summaryrefslogtreecommitdiff
path: root/gtk/gtkaccelmap.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2011-12-05 17:37:04 -0500
committerRyan Lortie <desrt@desrt.ca>2011-12-19 12:51:11 -0500
commit2398d7e900708bca24cf38bba9d87c920d7bb69f (patch)
tree956157ae1e52e1a8693f3782ef7d00e2a0bd2593 /gtk/gtkaccelmap.c
parentf05cfd55f0e3067e4df1bcabdcd80616b8d0e539 (diff)
downloadgtk+-2398d7e900708bca24cf38bba9d87c920d7bb69f.tar.gz
Introduce gtkaccelmapprivate.h
Move internal accel map API there and update all users. Also, add an internal function to create an accel path for an action and parameter, and use it in gtkapplication.c and gtkmodelmenuitem.c instead of duplicating that code.
Diffstat (limited to 'gtk/gtkaccelmap.c')
-rw-r--r--gtk/gtkaccelmap.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/gtk/gtkaccelmap.c b/gtk/gtkaccelmap.c
index efc06ba90a..2f33b92c66 100644
--- a/gtk/gtkaccelmap.c
+++ b/gtk/gtkaccelmap.c
@@ -19,7 +19,7 @@
#include "config.h"
-#include "gtkaccelmap.h"
+#include "gtkaccelmapprivate.h"
#include "gtkmarshalers.h"
#include "gtkwindowprivate.h"
@@ -1066,3 +1066,20 @@ do_accel_map_changed (AccelEntry *entry)
entry->accel_key,
entry->accel_mods);
}
+
+gchar *
+_gtk_accel_path_for_action (const gchar *action_name,
+ GVariant *parameter)
+{
+ GString *s;
+
+ s = g_string_new ("<Actions>/");
+ g_string_append (s, action_name);
+ if (parameter)
+ {
+ g_string_append_c (s, '/');
+ g_variant_print_string (parameter, s, FALSE);
+ }
+ return g_string_free (s, FALSE);
+}
+