2 * GTK - The GIMP Toolkit
3 * Copyright (C) 1998, 1999 Red Hat, Inc.
6 * This Library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public License as
8 * published by the Free Software Foundation; either version 2 of the
9 * License, or (at your option) any later version.
11 * This Library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with the Gnome Library; see the file COPYING.LIB. If not,
18 * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
23 * Author: James Henstridge <james@daa.com.au>
25 * Modified by the GTK+ Team and others 2003. See the AUTHORS
26 * file for a list of people on the GTK+ Team. See the ChangeLog
27 * files for a list of changes. These files are distributed with
28 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
30 #ifndef __GTK_ACTION_GROUP_H__
31 #define __GTK_ACTION_GROUP_H__
33 #include <gtk/gtkaction.h>
34 #include <gtk/gtkitemfactory.h> /* for GtkTranslateFunc */
38 #define GTK_TYPE_ACTION_GROUP (gtk_action_group_get_type ())
39 #define GTK_ACTION_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ACTION_GROUP, GtkActionGroup))
40 #define GTK_ACTION_GROUP_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), GTK_TYPE_ACTION_GROUP, GtkActionGroupClass))
41 #define GTK_IS_ACTION_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ACTION_GROUP))
42 #define GTK_IS_ACTION_GROUP_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), GTK_TYPE_ACTION_GROUP))
43 #define GTK_ACTION_GROUP_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), GTK_TYPE_ACTION_GROUP, GtkActionGroupClass))
45 typedef struct _GtkActionGroup GtkActionGroup;
46 typedef struct _GtkActionGroupPrivate GtkActionGroupPrivate;
47 typedef struct _GtkActionGroupClass GtkActionGroupClass;
48 typedef struct _GtkActionEntry GtkActionEntry;
49 typedef struct _GtkToggleActionEntry GtkToggleActionEntry;
50 typedef struct _GtkRadioActionEntry GtkRadioActionEntry;
52 struct _GtkActionGroup
58 GtkActionGroupPrivate *private_data;
61 struct _GtkActionGroupClass
63 GObjectClass parent_class;
65 GtkAction *(* get_action) (GtkActionGroup *action_group,
66 const gchar *action_name);
68 /* Padding for future expansion */
69 void (*_gtk_reserved1) (void);
70 void (*_gtk_reserved2) (void);
71 void (*_gtk_reserved3) (void);
72 void (*_gtk_reserved4) (void);
75 struct _GtkActionEntry
78 const gchar *stock_id;
80 const gchar *accelerator;
85 struct _GtkToggleActionEntry
88 const gchar *stock_id;
90 const gchar *accelerator;
96 struct _GtkRadioActionEntry
99 const gchar *stock_id;
101 const gchar *accelerator;
102 const gchar *tooltip;
106 GType gtk_action_group_get_type (void);
107 GtkActionGroup *gtk_action_group_new (const gchar *name);
108 G_CONST_RETURN gchar *gtk_action_group_get_name (GtkActionGroup *action_group);
109 gboolean gtk_action_group_get_sensitive (GtkActionGroup *action_group);
110 void gtk_action_group_set_sensitive (GtkActionGroup *action_group,
112 gboolean gtk_action_group_get_visible (GtkActionGroup *action_group);
113 void gtk_action_group_set_visible (GtkActionGroup *action_group,
115 GtkAction *gtk_action_group_get_action (GtkActionGroup *action_group,
116 const gchar *action_name);
117 GList *gtk_action_group_list_actions (GtkActionGroup *action_group);
118 void gtk_action_group_add_action (GtkActionGroup *action_group,
120 void gtk_action_group_add_action_with_accel (GtkActionGroup *action_group,
122 const gchar *accelerator);
123 void gtk_action_group_remove_action (GtkActionGroup *action_group,
125 void gtk_action_group_add_actions (GtkActionGroup *action_group,
126 const GtkActionEntry *entries,
129 void gtk_action_group_add_toggle_actions (GtkActionGroup *action_group,
130 const GtkToggleActionEntry *entries,
133 void gtk_action_group_add_radio_actions (GtkActionGroup *action_group,
134 const GtkRadioActionEntry *entries,
139 void gtk_action_group_add_actions_full (GtkActionGroup *action_group,
140 const GtkActionEntry *entries,
143 GDestroyNotify destroy);
144 void gtk_action_group_add_toggle_actions_full (GtkActionGroup *action_group,
145 const GtkToggleActionEntry *entries,
148 GDestroyNotify destroy);
149 void gtk_action_group_add_radio_actions_full (GtkActionGroup *action_group,
150 const GtkRadioActionEntry *entries,
155 GDestroyNotify destroy);
156 void gtk_action_group_set_translate_func (GtkActionGroup *action_group,
157 GtkTranslateFunc func,
159 GtkDestroyNotify notify);
160 void gtk_action_group_set_translation_domain (GtkActionGroup *action_group,
161 const gchar *domain);
162 G_CONST_RETURN gchar *gtk_action_group_translate_string (GtkActionGroup *action_group,
163 const gchar *string);
165 /* Protected for use by GtkAction */
166 void _gtk_action_group_emit_connect_proxy (GtkActionGroup *action_group,
169 void _gtk_action_group_emit_disconnect_proxy (GtkActionGroup *action_group,
172 void _gtk_action_group_emit_pre_activate (GtkActionGroup *action_group,
174 void _gtk_action_group_emit_post_activate (GtkActionGroup *action_group,
179 #endif /* __GTK_ACTION_GROUP_H__ */