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 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 #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 gboolean gtk_accelerator_valid (guint keyval,
89 GdkModifierType modifiers) G_GNUC_CONST;
90 void gtk_accelerator_parse (const gchar *accelerator,
91 guint *accelerator_key,
92 GdkModifierType *accelerator_mods);
93 gchar* gtk_accelerator_name (guint accelerator_key,
94 GdkModifierType accelerator_mods);
95 void gtk_accelerator_set_default_mod_mask (GdkModifierType default_mod_mask);
96 guint gtk_accelerator_get_default_mod_mask (void);
101 GtkAccelGroup* gtk_accel_group_new (void);
102 GtkAccelGroup* gtk_accel_group_get_default (void);
103 GtkAccelGroup* gtk_accel_group_ref (GtkAccelGroup *accel_group);
104 void gtk_accel_group_unref (GtkAccelGroup *accel_group);
105 void gtk_accel_group_lock (GtkAccelGroup *accel_group);
106 void gtk_accel_group_unlock (GtkAccelGroup *accel_group);
107 gboolean gtk_accel_groups_activate (GtkObject *object,
109 GdkModifierType accel_mods);
111 /* internal functions
113 gboolean gtk_accel_group_activate (GtkAccelGroup *accel_group,
115 GdkModifierType accel_mods);
116 void gtk_accel_group_attach (GtkAccelGroup *accel_group,
118 void gtk_accel_group_detach (GtkAccelGroup *accel_group,
121 /* Accelerator Group Entries (internal)
123 GtkAccelEntry* gtk_accel_group_get_entry (GtkAccelGroup *accel_group,
125 GdkModifierType accel_mods);
126 void gtk_accel_group_lock_entry (GtkAccelGroup *accel_group,
128 GdkModifierType accel_mods);
129 void gtk_accel_group_unlock_entry (GtkAccelGroup *accel_group,
131 GdkModifierType accel_mods);
132 void gtk_accel_group_add (GtkAccelGroup *accel_group,
134 GdkModifierType accel_mods,
135 GtkAccelFlags accel_flags,
137 const gchar *accel_signal);
138 void gtk_accel_group_remove (GtkAccelGroup *accel_group,
140 GdkModifierType accel_mods,
143 /* Accelerator Signals (internal)
145 void gtk_accel_group_handle_add (GtkObject *object,
146 guint accel_signal_id,
147 GtkAccelGroup *accel_group,
149 GdkModifierType accel_mods,
150 GtkAccelFlags accel_flags);
151 void gtk_accel_group_handle_remove (GtkObject *object,
152 GtkAccelGroup *accel_group,
154 GdkModifierType accel_mods);
155 guint gtk_accel_group_create_add (GtkType class_type,
156 GtkSignalRunType signal_flags,
157 guint handler_offset);
158 guint gtk_accel_group_create_remove (GtkType class_type,
159 GtkSignalRunType signal_flags,
160 guint handler_offset);
162 /* Miscellaneous (internal)
164 GSList* gtk_accel_groups_from_object (GtkObject *object);
165 GSList* gtk_accel_group_entries_from_object (GtkObject *object);
171 #endif /* __cplusplus */
174 #endif /* __GTK_ACCEL_GROUP_H__ */