diff options
author | Ryan Lortie <desrt@desrt.ca> | 2013-07-09 23:44:51 -0400 |
---|---|---|
committer | Ryan Lortie <desrt@desrt.ca> | 2013-10-15 09:24:12 -0400 |
commit | 9a6ee36e9c5db83ce2e216a89706e547d73efd93 (patch) | |
tree | 2249f17440f8a7efb7e519664dc42886fb602acb /gtk/gtkapplicationprivate.h | |
parent | afa8b0178fa57b49eb13aa4c4e3b460bcedcd9c9 (diff) | |
download | gtk+-9a6ee36e9c5db83ce2e216a89706e547d73efd93.tar.gz |
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.
Diffstat (limited to 'gtk/gtkapplicationprivate.h')
-rw-r--r-- | gtk/gtkapplicationprivate.h | 13 |
1 files changed, 13 insertions, 0 deletions
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__ */ |