Ardour  9.0-pre0-582-g084a23a80d
gtkaccelgroup.h
Go to the documentation of this file.
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 1998, 2001 Tim Janik
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19 
20 /*
21  * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
22  * file for a list of people on the GTK+ Team. See the ChangeLog
23  * files for a list of changes. These files are distributed with
24  * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
25  */
26 
27 #ifndef __GTK_ACCEL_GROUP_H__
28 #define __GTK_ACCEL_GROUP_H__
29 
30 
31 #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
32 #error "Only <gtk/gtk.h> can be included directly."
33 #endif
34 
35 #include <gdk/gdk.h>
36 #include <gtk/gtkenums.h>
37 
38 G_BEGIN_DECLS
39 
40 
41 /* --- type macros --- */
42 #define GTK_TYPE_ACCEL_GROUP (gtk_accel_group_get_type ())
43 #define GTK_ACCEL_GROUP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GTK_TYPE_ACCEL_GROUP, GtkAccelGroup))
44 #define GTK_ACCEL_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_ACCEL_GROUP, GtkAccelGroupClass))
45 #define GTK_IS_ACCEL_GROUP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GTK_TYPE_ACCEL_GROUP))
46 #define GTK_IS_ACCEL_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ACCEL_GROUP))
47 #define GTK_ACCEL_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ACCEL_GROUP, GtkAccelGroupClass))
48 
49 
50 /* --- accel flags --- */
51 typedef enum
52 {
53  GTK_ACCEL_VISIBLE = 1 << 0, /* display in GtkAccelLabel? */
54  GTK_ACCEL_LOCKED = 1 << 1, /* is it removable? */
55  GTK_ACCEL_MASK = 0x07
57 
58 
59 /* --- typedefs & structures --- */
60 typedef struct _GtkAccelGroup GtkAccelGroup;
62 typedef struct _GtkAccelKey GtkAccelKey;
64 typedef gboolean (*GtkAccelGroupActivate) (GtkAccelGroup *accel_group,
65  GObject *acceleratable,
66  guint keyval,
67  GdkModifierType modifier);
68 
77 typedef gboolean (*GtkAccelGroupFindFunc) (GtkAccelKey *key,
78  GClosure *closure,
79  gpointer data);
80 
87 {
88  GObject parent;
89 
90  guint GSEAL (lock_count);
91  GdkModifierType GSEAL (modifier_mask);
92  GSList *GSEAL (acceleratables);
93  guint GSEAL (n_accels);
94  GtkAccelGroupEntry *GSEAL (priv_accels);
95 };
96 
98 {
99  GObjectClass parent_class;
100 
101  void (*accel_changed) (GtkAccelGroup *accel_group,
102  guint keyval,
103  GdkModifierType modifier,
104  GClosure *accel_closure);
105 
106  /* Padding for future expansion */
107  void (*_gtk_reserved1) (void);
108  void (*_gtk_reserved2) (void);
109  void (*_gtk_reserved3) (void);
110  void (*_gtk_reserved4) (void);
111 };
112 
114 {
115  guint accel_key;
117  guint accel_flags : 16;
118 };
119 
120 
121 /* -- Accelerator Groups --- */
122 GType gtk_accel_group_get_type (void) G_GNUC_CONST;
130  guint accel_key,
131  GdkModifierType accel_mods,
132  GtkAccelFlags accel_flags,
133  GClosure *closure);
135  const gchar *accel_path,
136  GClosure *closure);
138  GClosure *closure);
140  guint accel_key,
141  GdkModifierType accel_mods);
143  GQuark accel_quark,
144  GObject *acceleratable,
145  guint accel_key,
146  GdkModifierType accel_mods);
147 
148 
149 /* --- GtkActivatable glue --- */
151  GObject *object);
153  GObject *object);
154 gboolean gtk_accel_groups_activate (GObject *object,
155  guint accel_key,
156  GdkModifierType accel_mods);
157 GSList* gtk_accel_groups_from_object (GObject *object);
159  GtkAccelGroupFindFunc find_func,
160  gpointer data);
162 
163 
164 /* --- Accelerators--- */
165 gboolean gtk_accelerator_valid (guint keyval,
166  GdkModifierType modifiers) G_GNUC_CONST;
167 void gtk_accelerator_parse (const gchar *accelerator,
168  guint *accelerator_key,
169  GdkModifierType *accelerator_mods);
170 gchar* gtk_accelerator_name (guint accelerator_key,
171  GdkModifierType accelerator_mods);
172 gchar* gtk_accelerator_get_label (guint accelerator_key,
173  GdkModifierType accelerator_mods);
176 
177 
178 /* --- internal --- */
180  guint accel_key,
181  GdkModifierType accel_mods,
182  guint *n_entries);
183 
185  GQuark accel_path_quark);
186 
188 {
190  GClosure *closure;
192 };
193 
194 
195 #ifndef GTK_DISABLE_DEPRECATED
203 #define gtk_accel_group_ref g_object_ref
204 
210 #define gtk_accel_group_unref g_object_unref
211 #endif /* GTK_DISABLE_DEPRECATED */
212 
213 G_END_DECLS
214 
215 
216 #endif /* __GTK_ACCEL_GROUP_H__ */
GdkModifierType
Definition: gdktypes.h:127
void gtk_accel_group_unlock(GtkAccelGroup *accel_group)
void _gtk_accel_group_detach(GtkAccelGroup *accel_group, GObject *object)
void gtk_accel_group_lock(GtkAccelGroup *accel_group)
gchar * gtk_accelerator_get_label(guint accelerator_key, GdkModifierType accelerator_mods)
gboolean gtk_accel_group_activate(GtkAccelGroup *accel_group, GQuark accel_quark, GObject *acceleratable, guint accel_key, GdkModifierType accel_mods)
gboolean gtk_accel_group_disconnect(GtkAccelGroup *accel_group, GClosure *closure)
gboolean gtk_accel_groups_activate(GObject *object, guint accel_key, GdkModifierType accel_mods)
GdkModifierType gtk_accel_group_get_modifier_mask(GtkAccelGroup *accel_group)
gboolean(* GtkAccelGroupFindFunc)(GtkAccelKey *key, GClosure *closure, gpointer data)
Definition: gtkaccelgroup.h:77
void gtk_accelerator_set_default_mod_mask(GdkModifierType default_mod_mask)
void _gtk_accel_group_attach(GtkAccelGroup *accel_group, GObject *object)
void gtk_accel_group_connect(GtkAccelGroup *accel_group, guint accel_key, GdkModifierType accel_mods, GtkAccelFlags accel_flags, GClosure *closure)
guint gtk_accelerator_get_default_mod_mask(void)
GtkAccelFlags
Definition: gtkaccelgroup.h:52
@ GTK_ACCEL_LOCKED
Definition: gtkaccelgroup.h:54
@ GTK_ACCEL_VISIBLE
Definition: gtkaccelgroup.h:53
@ GTK_ACCEL_MASK
Definition: gtkaccelgroup.h:55
void gtk_accelerator_parse(const gchar *accelerator, guint *accelerator_key, GdkModifierType *accelerator_mods)
gboolean gtk_accel_group_disconnect_key(GtkAccelGroup *accel_group, guint accel_key, GdkModifierType accel_mods)
gboolean gtk_accelerator_valid(guint keyval, GdkModifierType modifiers) G_GNUC_CONST
GtkAccelGroup * gtk_accel_group_new(void)
GSList * gtk_accel_groups_from_object(GObject *object)
GtkAccelGroupEntry * gtk_accel_group_query(GtkAccelGroup *accel_group, guint accel_key, GdkModifierType accel_mods, guint *n_entries)
void _gtk_accel_group_reconnect(GtkAccelGroup *accel_group, GQuark accel_path_quark)
gboolean(* GtkAccelGroupActivate)(GtkAccelGroup *accel_group, GObject *acceleratable, guint keyval, GdkModifierType modifier)
Definition: gtkaccelgroup.h:64
void gtk_accel_group_connect_by_path(GtkAccelGroup *accel_group, const gchar *accel_path, GClosure *closure)
GType gtk_accel_group_get_type(void) G_GNUC_CONST
gchar * gtk_accelerator_name(guint accelerator_key, GdkModifierType accelerator_mods)
GtkAccelKey * gtk_accel_group_find(GtkAccelGroup *accel_group, GtkAccelGroupFindFunc find_func, gpointer data)
gboolean gtk_accel_group_get_is_locked(GtkAccelGroup *accel_group)
GtkAccelGroup * gtk_accel_group_from_accel_closure(GClosure *closure)
void(* _gtk_reserved4)(void)
void(* _gtk_reserved3)(void)
void(* _gtk_reserved1)(void)
void(* _gtk_reserved2)(void)
void(* accel_changed)(GtkAccelGroup *accel_group, guint keyval, GdkModifierType modifier, GClosure *accel_closure)
GObjectClass parent_class
Definition: gtkaccelgroup.h:99
GtkAccelGroupEntry * GSEAL(priv_accels)
GdkModifierType GSEAL(modifier_mask)
guint GSEAL(n_accels)
guint GSEAL(lock_count)
GSList * GSEAL(acceleratables)
GdkModifierType accel_mods