summaryrefslogtreecommitdiff
path: root/gtk/gtkkeyhash.h
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2002-02-21 17:14:10 +0000
committerOwen Taylor <otaylor@src.gnome.org>2002-02-21 17:14:10 +0000
commit708e1a95749ad61cb0167f729a77e951a30388cf (patch)
tree772eb9a2ff7cdfd6e94d79973a0a7645c9d41861 /gtk/gtkkeyhash.h
parent3b94ae4be5e2efaae91446c365077e8f5f4ee90d (diff)
downloadgtk+-708e1a95749ad61cb0167f729a77e951a30388cf.tar.gz
Implement "fuzzy" key binding lookups; allow matches on key and level but
Wed Feb 20 14:26:47 2002 Owen Taylor <otaylor@redhat.com> * gtk/gtkkeyhash.[ch]: Implement "fuzzy" key binding lookups; allow matches on key and level but not group. Also, implement ignoring "consumed modifiers correctly." * gtk/gtkaccelgroup.c gtk/gtkbindings.c: Convert to using GtkKeyHash. * gtk/gtkdebug.h gtk/gtkmain.c: Support GTK_DEBUG=keybindings * gdk/x11/gdkevents-x11.c (gdk_event_translate): Fill in the group for key release events as well as key press events. * gdk/gdkkeys.h gdk/x11/gdkkeys-x11.c (gdk_keymap_translate_keyboard_state): Rename unused_modifiers to consumed_modifiers, make the docs and non-Xkb implementation match the Xkb implementation. * gdk/linux-fb/gdkkeyboard-fb.c gdk/win32/gdkkeys-win32.c: Propagate doc and parameter name changes. * gdk/x11/gdkkeys-x11.c (gdk_keymap_translate_keyboard_state): XkbTranslateKeyCode doesn't handle LockMask, we need to handle it ourselves. * gdk/x11/gdkkeys-x11.c (gdk_keymap_translate_keyboard_state): Force <Shift>Tab to give GDK_ISO_Left_Tab, since we need consistency to allow dealing with ISO_Left_Tab. * gtk/gtkwindow.c gtk/gtktextview.c gtk/gtkscrolledwindow.c gtk/gtkpaned.c gtk/gtkcombo.c gtk/gtknotebook.c: Remove inappropriate uses of GDK_ISO_Left_Tab. (GDK_ISO_Left_Tab or <Shift>Tab both are equivalent as a binding specifier.) * gtk/gtkbutton.c (gtk_button_class_init): Make ::activate GTK_RUN_ACTION, so you can bind an accelerator to it. * gtk/gtklabel.c (gtk_label_set_uline_text_internal): Call gdk_unicode_to_keyval on the mnemonic character. * tests/testgtk.c: Add a test for the new fuzzy key binding matching.
Diffstat (limited to 'gtk/gtkkeyhash.h')
-rw-r--r--gtk/gtkkeyhash.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/gtk/gtkkeyhash.h b/gtk/gtkkeyhash.h
new file mode 100644
index 0000000000..d02c9f5f66
--- /dev/null
+++ b/gtk/gtkkeyhash.h
@@ -0,0 +1,50 @@
+/* gtkkeyhash.h: Keymap aware matching of key bindings
+ *
+ * GTK - The GIMP Toolkit
+ * Copyright (C) 2002, Red Hat Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __GTK_KEY_HASH_H__
+#define __GTK_KEY_HASH_H__
+
+#include <gdk/gdk.h>
+
+G_BEGIN_DECLS
+
+typedef struct _GtkKeyHash GtkKeyHash;
+
+GtkKeyHash *_gtk_key_hash_new (GdkKeymap *keymap,
+ GDestroyNotify item_destroy_notify);
+void _gtk_key_hash_add_entry (GtkKeyHash *key_hash,
+ guint keyval,
+ GdkModifierType modifiers,
+ gpointer value);
+void _gtk_key_hash_remove_entry (GtkKeyHash *key_hash,
+ gpointer value);
+GSList * _gtk_key_hash_lookup (GtkKeyHash *key_hash,
+ guint16 hardware_keycode,
+ GdkModifierType state,
+ gint group);
+GSList * _gtk_key_hash_lookup_keyval (GtkKeyHash *key_hash,
+ guint keyval,
+ GdkModifierType modifiers);
+void _gtk_key_hash_free (GtkKeyHash *key_hash);
+
+G_END_DECLS
+
+#endif /* __GTK_KEY_HASH_H__ */