From 9a6ee36e9c5db83ce2e216a89706e547d73efd93 Mon Sep 17 00:00:00 2001 From: Ryan Lortie Date: Tue, 9 Jul 2013 23:44:51 -0400 Subject: GtkApplication: a new approach to accels Rework how accels are handled on GtkApplicationWindow. Instead of having GtkApplication fill the GtkAccelMap which is then used by GtkApplicationWindow to create a GtkAccelGroup filled with closures that is then associated with the window, do it directly. GtkApplication now keeps a list of accels and their actions. Accelerators on a GtkApplicationWindow ask GtkApplication to execute the appropriate action. This saves a fair bit of complexity and memory use (due to not having to create all those closures and accelmap entries). The new approach also supports multiple accels per action (although there is not yet a public API for it). This patch (and the ones before) Reviewed and ACK'd by Matthias Clasen. --- gtk/gtkapplicationprivate.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'gtk/gtkapplicationprivate.h') diff --git a/gtk/gtkapplicationprivate.h b/gtk/gtkapplicationprivate.h index e0c278a49b..597b5a64e3 100644 --- a/gtk/gtkapplicationprivate.h +++ b/gtk/gtkapplicationprivate.h @@ -22,6 +22,7 @@ #define __GTK_APPLICATION_PRIVATE_H__ #include "gtkapplicationwindow.h" +#include "gtkwindowprivate.h" #include "gtkactionmuxer.h" @@ -45,4 +46,16 @@ const gchar * gtk_application_get_menubar_object_path (GtkAppl G_GNUC_INTERNAL GtkActionMuxer * gtk_application_get_parent_muxer_for_window (GtkWindow *window); +G_GNUC_INTERNAL +gboolean gtk_application_activate_accel (GtkApplication *application, + GActionGroup *action_group, + guint key, + GdkModifierType modifier); + +G_GNUC_INTERNAL +void gtk_application_foreach_accel_keys (GtkApplication *application, + GtkWindow *window, + GtkWindowKeysForeachFunc callback, + gpointer user_data); + #endif /* __GTK_APPLICATION_PRIVATE_H__ */ -- cgit v1.2.1