1 /* GTK - The GIMP Toolkit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
4 * GtkAccelGroup: Accelerator 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_ACCEL_GROUP_H__
31 #define __GTK_ACCEL_GROUP_H__
35 #include <gtk/gtkobject.h>
36 #include <gtk/gtkenums.h>
41 #endif /* __cplusplus */
44 typedef struct _GtkAccelGroup GtkAccelGroup;
45 typedef struct _GtkAccelEntry GtkAccelEntry;
49 /* should the accelerator appear in
50 * the widget's display?
52 GTK_ACCEL_VISIBLE = 1 << 0,
53 /* should the signal associated with
54 * this accelerator be also visible?
56 GTK_ACCEL_SIGNAL_VISIBLE = 1 << 1,
57 /* may the accelerator be removed
60 GTK_ACCEL_LOCKED = 1 << 2,
68 GdkModifierType modifier_mask;
69 GSList *attach_objects;
76 GtkAccelGroup *accel_group;
77 guint accelerator_key;
78 GdkModifierType accelerator_mods;
80 GtkAccelFlags accel_flags;
88 GtkAccelGroup* gtk_accel_group_new (void);
89 GtkAccelGroup* gtk_accel_group_get_default (void);
90 GtkAccelGroup* gtk_accel_group_ref (GtkAccelGroup *accel_group);
91 void gtk_accel_group_unref (GtkAccelGroup *accel_group);
92 gboolean gtk_accel_group_activate (GtkAccelGroup *accel_group,
94 GdkModifierType accel_mods);
95 gboolean gtk_accel_groups_activate (GtkObject *object,
97 GdkModifierType accel_mods);
98 void gtk_accel_group_attach (GtkAccelGroup *accel_group,
100 void gtk_accel_group_detach (GtkAccelGroup *accel_group,
102 void gtk_accel_group_lock (GtkAccelGroup *accel_group);
103 void gtk_accel_group_unlock (GtkAccelGroup *accel_group);
105 /* Accelerator Group Entries
107 GtkAccelEntry* gtk_accel_group_get_entry (GtkAccelGroup *accel_group,
109 GdkModifierType accel_mods);
110 void gtk_accel_group_lock_entry (GtkAccelGroup *accel_group,
112 GdkModifierType accel_mods);
113 void gtk_accel_group_unlock_entry (GtkAccelGroup *accel_group,
115 GdkModifierType accel_mods);
116 void gtk_accel_group_add (GtkAccelGroup *accel_group,
118 GdkModifierType accel_mods,
119 GtkAccelFlags accel_flags,
121 const gchar *accel_signal);
122 void gtk_accel_group_remove (GtkAccelGroup *accel_group,
124 GdkModifierType accel_mods,
127 /* Accelerator Signals
129 void gtk_accel_group_handle_add (GtkObject *object,
130 guint accel_signal_id,
131 GtkAccelGroup *accel_group,
133 GdkModifierType accel_mods,
134 GtkAccelFlags accel_flags);
135 void gtk_accel_group_handle_remove (GtkObject *object,
136 GtkAccelGroup *accel_group,
138 GdkModifierType accel_mods);
139 guint gtk_accel_group_create_add (GtkType class_type,
140 GtkSignalRunType signal_flags,
141 guint handler_offset);
142 guint gtk_accel_group_create_remove (GtkType class_type,
143 GtkSignalRunType signal_flags,
144 guint handler_offset);
145 void gtk_accel_group_marshal_add (GtkObject *object,
149 void gtk_accel_group_marshal_remove (GtkObject *object,
156 GSList* gtk_accel_groups_from_object (GtkObject *object);
157 GSList* gtk_accel_group_entries_from_object (GtkObject *object);
162 gboolean gtk_accelerator_valid (guint keyval,
163 GdkModifierType modifiers);
164 void gtk_accelerator_parse (const gchar *accelerator,
165 guint *accelerator_key,
166 GdkModifierType *accelerator_mods);
167 gchar* gtk_accelerator_name (guint accelerator_key,
168 GdkModifierType accelerator_mods);
169 void gtk_accelerator_set_default_mod_mask (GdkModifierType default_mod_mask);
170 guint gtk_accelerator_get_default_mod_mask (void);
176 #endif /* __cplusplus */
179 #endif /* __GTK_ACCEL_GROUP_H__ */