diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-02-17 22:11:56 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-02-21 00:51:03 -0500 |
commit | b1eaa502dfda1dd727e938ce710c3861f1cad8fe (patch) | |
tree | 3cb71e60ccf5c6fdae527c9c4ef2e9bee8f0cd15 /gdk/gdkkeys.c | |
parent | f1cf0eb3fc95c94d5594aa700cbcb12bc32ebc43 (diff) | |
download | gtk+-b1eaa502dfda1dd727e938ce710c3861f1cad8fe.tar.gz |
events: reorganize getters
Restructure the getters for event fields to
be more targeted at particular event types.
Update all callers, and replace all direct
event struct access with getters.
As a side-effect, this drops some unused getters.
Diffstat (limited to 'gdk/gdkkeys.c')
-rw-r--r-- | gdk/gdkkeys.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gdk/gdkkeys.c b/gdk/gdkkeys.c index a60a33be3e..25e9284e3c 100644 --- a/gdk/gdkkeys.c +++ b/gdk/gdkkeys.c @@ -559,11 +559,14 @@ gdk_keymap_lookup_key (GdkKeymap *keymap, * |[<!-- language="C" --> * // We want to ignore irrelevant modifiers like ScrollLock * #define ALL_ACCELS_MASK (GDK_CONTROL_MASK | GDK_SHIFT_MASK | GDK_MOD1_MASK) - * gdk_keymap_translate_keyboard_state (keymap, event->hardware_keycode, - * event->state, event->group, + * state = gdk_event_get_modifier_state (event); + * gdk_keymap_translate_keyboard_state (keymap, + * gdk_key_event_get_keycode (event), + * state, + * gdk_key_event_get_group (event), * &keyval, NULL, NULL, &consumed); * if (keyval == GDK_PLUS && - * (event->state & ~consumed & ALL_ACCELS_MASK) == GDK_CONTROL_MASK) + * (state & ~consumed & ALL_ACCELS_MASK) == GDK_CONTROL_MASK) * // Control was pressed * ]| * @@ -574,7 +577,7 @@ gdk_keymap_lookup_key (GdkKeymap *keymap, * |[<!-- language="C" --> * // XXX Don’t do this XXX * if (keyval == accel_keyval && - * (event->state & ~consumed & ALL_ACCELS_MASK) == (accel_mods & ~consumed)) + * (state & ~consumed & ALL_ACCELS_MASK) == (accel_mods & ~consumed)) * // Accelerator was pressed * ]| * |