diff options
author | Benjamin Otte <otte@redhat.com> | 2013-04-16 15:24:02 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2013-04-16 15:30:14 +0200 |
commit | 065a8da87a30cc5195d7907f5dbf0c0c6fa3cfde (patch) | |
tree | f3cab3f1a6607bbf7c949a2ebe71847f5d1313ea /gdk/gdkkeys.c | |
parent | 441359b0a8046457c6f6207ba9f8deaec0d2a395 (diff) | |
download | gtk+-065a8da87a30cc5195d7907f5dbf0c0c6fa3cfde.tar.gz |
gdk: Refactor default key vfuncs
Instead of copying them all over the place, keep a default
implementation around.
Diffstat (limited to 'gdk/gdkkeys.c')
-rw-r--r-- | gdk/gdkkeys.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/gdk/gdkkeys.c b/gdk/gdkkeys.c index 60277b6c29..3026cfc7ad 100644 --- a/gdk/gdkkeys.c +++ b/gdk/gdkkeys.c @@ -674,6 +674,7 @@ gdk_keymap_get_modifier_mask (GdkKeymap *keymap, return GDK_KEYMAP_GET_CLASS (keymap)->get_modifier_mask (keymap, intent); } +#include "gdkkeynames.c" /** * gdk_keyval_name: @@ -692,10 +693,16 @@ gdk_keymap_get_modifier_mask (GdkKeymap *keymap, gchar * gdk_keyval_name (guint keyval) { - GdkDisplayManager *manager = gdk_display_manager_get (); + GdkDisplayManagerClass *manager_class; + GdkDisplayManager *manager; + + manager = gdk_display_manager_get (); + manager_class = GDK_DISPLAY_MANAGER_GET_CLASS (manager); - return GDK_DISPLAY_MANAGER_GET_CLASS (manager)->get_keyval_name (manager, - keyval); + if (manager_class->get_keyval_name) + return manager_class->get_keyval_name (manager, keyval); + else + return _gdk_keyval_name (keyval); } /** @@ -714,10 +721,16 @@ gdk_keyval_name (guint keyval) guint gdk_keyval_from_name (const gchar *keyval_name) { - GdkDisplayManager *manager = gdk_display_manager_get (); + GdkDisplayManagerClass *manager_class; + GdkDisplayManager *manager; + + manager = gdk_display_manager_get (); + manager_class = GDK_DISPLAY_MANAGER_GET_CLASS (manager); - return GDK_DISPLAY_MANAGER_GET_CLASS (manager)->lookup_keyval (manager, - keyval_name); + if (manager_class->lookup_keyval) + return manager_class->lookup_keyval (manager, keyval_name); + else + return _gdk_keyval_from_name (keyval_name); } /** |