1 /* GTK - The GIMP Toolkit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
4 * GtkBindingSet: Keybinding manager for GtkObjects.
5 * Copyright (C) 1998 Tim Janik
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
24 * Modified by the GTK+ Team and others 1997-1999. See the AUTHORS
25 * file for a list of people on the GTK+ Team. See the ChangeLog
26 * files for a list of changes. These files are distributed with
27 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
30 #ifndef __GTK_BINDINGS_H__
31 #define __GTK_BINDINGS_H__
35 #include <gtk/gtkobject.h>
36 #include <gtk/gtkenums.h>
41 #endif /* __cplusplus */
46 typedef struct _GtkPatternSpec GtkPatternSpec;
48 struct _GtkPatternSpec
50 GtkMatchType match_type;
53 gchar *pattern_reversed;
58 void gtk_pattern_spec_init (GtkPatternSpec *pspec,
59 const gchar *pattern);
60 void gtk_pattern_spec_free_segs (GtkPatternSpec *pspec);
61 gboolean gtk_pattern_match (GtkPatternSpec *pspec,
64 const gchar *string_reversed);
65 gboolean gtk_pattern_match_string (GtkPatternSpec *pspec,
67 gboolean gtk_pattern_match_simple (const gchar *pattern,
74 typedef struct _GtkBindingSet GtkBindingSet;
75 typedef struct _GtkBindingEntry GtkBindingEntry;
76 typedef struct _GtkBindingSignal GtkBindingSignal;
77 typedef struct _GtkBindingArg GtkBindingArg;
83 GSList *widget_path_pspecs;
84 GSList *widget_class_pspecs;
85 GSList *class_branch_pspecs;
86 GtkBindingEntry *entries;
87 GtkBindingEntry *current;
90 struct _GtkBindingEntry
97 GtkBindingSet *binding_set;
99 guint in_emission : 1;
100 GtkBindingEntry *set_next;
101 GtkBindingEntry *hash_next;
102 GtkBindingSignal *signals;
105 struct _GtkBindingSignal
107 GtkBindingSignal *next;
113 struct _GtkBindingArg
124 /* Application-level methods */
126 GtkBindingSet* gtk_binding_set_new (const gchar *set_name);
127 GtkBindingSet* gtk_binding_set_by_class(gpointer object_class);
128 GtkBindingSet* gtk_binding_set_find (const gchar *set_name);
129 gboolean gtk_bindings_activate (GtkObject *object,
132 gboolean gtk_binding_set_activate (GtkBindingSet *binding_set,
136 #define gtk_binding_entry_add gtk_binding_entry_clear
137 void gtk_binding_entry_clear (GtkBindingSet *binding_set,
140 void gtk_binding_entry_add_signal (GtkBindingSet *binding_set,
143 const gchar *signal_name,
146 void gtk_binding_set_add_path (GtkBindingSet *binding_set,
147 GtkPathType path_type,
148 const gchar *path_pattern,
149 GtkPathPriorityType priority);
152 /* Non-public methods */
154 void gtk_binding_entry_remove (GtkBindingSet *binding_set,
157 void gtk_binding_entry_add_signall (GtkBindingSet *binding_set,
160 const gchar *signal_name,
161 GSList *binding_args);
162 guint gtk_binding_parse_binding (GScanner *scanner);
169 #endif /* __cplusplus */
172 #endif /* __GTK_BINDINGS_H__ */