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 Lesser 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 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser 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-2000. 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 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
31 #error "Only <gtk/gtk.h> can be included directly."
34 #ifndef __GTK_BINDINGS_H__
35 #define __GTK_BINDINGS_H__
39 #include <gtk/gtkobject.h>
48 typedef struct _GtkBindingSet GtkBindingSet;
49 typedef struct _GtkBindingEntry GtkBindingEntry;
50 typedef struct _GtkBindingSignal GtkBindingSignal;
51 typedef struct _GtkBindingArg GtkBindingArg;
57 GSList *widget_path_pspecs;
58 GSList *widget_class_pspecs;
59 GSList *class_branch_pspecs;
60 GtkBindingEntry *entries;
61 GtkBindingEntry *current;
62 guint parsed : 1; /* From RC content */
65 struct _GtkBindingEntry
70 GdkModifierType modifiers;
72 GtkBindingSet *binding_set;
74 guint in_emission : 1;
75 guint marks_unbound : 1;
76 GtkBindingEntry *set_next;
77 GtkBindingEntry *hash_next;
78 GtkBindingSignal *signals;
91 struct _GtkBindingSignal
93 GtkBindingSignal *next;
99 /* Application-level methods */
101 GtkBindingSet* gtk_binding_set_new (const gchar *set_name);
102 GtkBindingSet* gtk_binding_set_by_class(gpointer object_class);
103 GtkBindingSet* gtk_binding_set_find (const gchar *set_name);
104 gboolean gtk_bindings_activate (GtkObject *object,
106 GdkModifierType modifiers);
107 gboolean gtk_bindings_activate_event (GtkObject *object,
109 gboolean gtk_binding_set_activate (GtkBindingSet *binding_set,
111 GdkModifierType modifiers,
114 void gtk_binding_entry_skip (GtkBindingSet *binding_set,
116 GdkModifierType modifiers);
117 void gtk_binding_entry_add_signal (GtkBindingSet *binding_set,
119 GdkModifierType modifiers,
120 const gchar *signal_name,
123 void gtk_binding_entry_add_signall (GtkBindingSet *binding_set,
125 GdkModifierType modifiers,
126 const gchar *signal_name,
127 GSList *binding_args);
128 void gtk_binding_entry_remove (GtkBindingSet *binding_set,
130 GdkModifierType modifiers);
132 void gtk_binding_set_add_path (GtkBindingSet *binding_set,
133 GtkPathType path_type,
134 const gchar *path_pattern,
135 GtkPathPriorityType priority);
138 /* Non-public methods */
140 guint _gtk_binding_parse_binding (GScanner *scanner);
141 void _gtk_binding_reset_parsed (void);
142 void _gtk_binding_entry_add_signall (GtkBindingSet *binding_set,
144 GdkModifierType modifiers,
145 const gchar *signal_name,
146 GSList *binding_args);
150 #endif /* __GTK_BINDINGS_H__ */