1/*
2 * GTK - The GIMP Toolkit
3 * Copyright (C) 1998, 1999 Red Hat, Inc.
4 * All rights reserved.
5 *
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.
10 *
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.
15 *
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20/*
21 * Author: James Henstridge <james@daa.com.au>
22 *
23 * Modified by the GTK+ Team and others 2003. See the AUTHORS
24 * file for a list of people on the GTK+ Team. See the ChangeLog
25 * files for a list of changes. These files are distributed with
26 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
27 */
28
29#ifndef __GTK_ACTION_H__
30#define __GTK_ACTION_H__
31
32#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
33#error "Only <gtk/gtk.h> can be included directly."
34#endif
35
36#include <gtk/gtkwidget.h>
37
38G_BEGIN_DECLS
39
40#define GTK_TYPE_ACTION (gtk_action_get_type ())
41#define GTK_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ACTION, GtkAction))
42#define GTK_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_ACTION, GtkActionClass))
43#define GTK_IS_ACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ACTION))
44#define GTK_IS_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ACTION))
45#define GTK_ACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GTK_TYPE_ACTION, GtkActionClass))
46
47typedef struct _GtkAction GtkAction;
48typedef struct _GtkActionClass GtkActionClass;
49typedef struct _GtkActionPrivate GtkActionPrivate;
50
51struct _GtkAction
52{
53 GObject object;
54
55 /*< private >*/
56 GtkActionPrivate *private_data;
57};
58
59/**
60 * GtkActionClass:
61 * @parent_class: The parent class.
62 * @activate: Signal emitted when the action is activated.
63 */
64struct _GtkActionClass
65{
66 GObjectClass parent_class;
67
68 /*< public >*/
69
70 /* activation signal */
71 void (* activate) (GtkAction *action);
72
73 /*< private >*/
74
75 GType menu_item_type;
76 GType toolbar_item_type;
77
78 /* widget creation routines (not signals) */
79 GtkWidget *(* create_menu_item) (GtkAction *action);
80 GtkWidget *(* create_tool_item) (GtkAction *action);
81 void (* connect_proxy) (GtkAction *action,
82 GtkWidget *proxy);
83 void (* disconnect_proxy) (GtkAction *action,
84 GtkWidget *proxy);
85
86 GtkWidget *(* create_menu) (GtkAction *action);
87
88 /* Padding for future expansion */
89 void (*_gtk_reserved1) (void);
90 void (*_gtk_reserved2) (void);
91 void (*_gtk_reserved3) (void);
92 void (*_gtk_reserved4) (void);
93};
94
95GDK_DEPRECATED_IN_3_10
96GType gtk_action_get_type (void) G_GNUC_CONST;
97GDK_DEPRECATED_IN_3_10
98GtkAction *gtk_action_new (const gchar *name,
99 const gchar *label,
100 const gchar *tooltip,
101 const gchar *stock_id);
102GDK_DEPRECATED_IN_3_10
103const gchar* gtk_action_get_name (GtkAction *action);
104GDK_DEPRECATED_IN_3_10
105gboolean gtk_action_is_sensitive (GtkAction *action);
106GDK_DEPRECATED_IN_3_10
107gboolean gtk_action_get_sensitive (GtkAction *action);
108GDK_DEPRECATED_IN_3_10
109void gtk_action_set_sensitive (GtkAction *action,
110 gboolean sensitive);
111GDK_DEPRECATED_IN_3_10
112gboolean gtk_action_is_visible (GtkAction *action);
113GDK_DEPRECATED_IN_3_10
114gboolean gtk_action_get_visible (GtkAction *action);
115GDK_DEPRECATED_IN_3_10
116void gtk_action_set_visible (GtkAction *action,
117 gboolean visible);
118GDK_DEPRECATED_IN_3_10
119void gtk_action_activate (GtkAction *action);
120GDK_DEPRECATED_IN_3_10
121GtkWidget * gtk_action_create_icon (GtkAction *action,
122 GtkIconSize icon_size);
123GDK_DEPRECATED_IN_3_10
124GtkWidget * gtk_action_create_menu_item (GtkAction *action);
125GDK_DEPRECATED_IN_3_10
126GtkWidget * gtk_action_create_tool_item (GtkAction *action);
127GDK_DEPRECATED_IN_3_10
128GtkWidget * gtk_action_create_menu (GtkAction *action);
129GDK_DEPRECATED_IN_3_10
130GSList * gtk_action_get_proxies (GtkAction *action);
131GDK_DEPRECATED_IN_3_10
132void gtk_action_connect_accelerator (GtkAction *action);
133GDK_DEPRECATED_IN_3_10
134void gtk_action_disconnect_accelerator (GtkAction *action);
135GDK_DEPRECATED_IN_3_10
136const gchar *gtk_action_get_accel_path (GtkAction *action);
137GDK_DEPRECATED_IN_3_10
138GClosure *gtk_action_get_accel_closure (GtkAction *action);
139GDK_DEPRECATED_IN_3_10
140void gtk_action_block_activate (GtkAction *action);
141GDK_DEPRECATED_IN_3_10
142void gtk_action_unblock_activate (GtkAction *action);
143
144void _gtk_action_add_to_proxy_list (GtkAction *action,
145 GtkWidget *proxy);
146void _gtk_action_remove_from_proxy_list(GtkAction *action,
147 GtkWidget *proxy);
148
149/* protected ... for use by child actions */
150void _gtk_action_emit_activate (GtkAction *action);
151
152/* protected ... for use by action groups */
153GDK_DEPRECATED_IN_3_10
154void gtk_action_set_accel_path (GtkAction *action,
155 const gchar *accel_path);
156GDK_DEPRECATED_IN_3_10
157void gtk_action_set_accel_group (GtkAction *action,
158 GtkAccelGroup *accel_group);
159void _gtk_action_sync_menu_visible (GtkAction *action,
160 GtkWidget *proxy,
161 gboolean empty);
162
163GDK_DEPRECATED_IN_3_10
164void gtk_action_set_label (GtkAction *action,
165 const gchar *label);
166GDK_DEPRECATED_IN_3_10
167const gchar * gtk_action_get_label (GtkAction *action);
168GDK_DEPRECATED_IN_3_10
169void gtk_action_set_short_label (GtkAction *action,
170 const gchar *short_label);
171GDK_DEPRECATED_IN_3_10
172const gchar * gtk_action_get_short_label (GtkAction *action);
173GDK_DEPRECATED_IN_3_10
174void gtk_action_set_tooltip (GtkAction *action,
175 const gchar *tooltip);
176GDK_DEPRECATED_IN_3_10
177const gchar * gtk_action_get_tooltip (GtkAction *action);
178GDK_DEPRECATED_IN_3_10
179void gtk_action_set_stock_id (GtkAction *action,
180 const gchar *stock_id);
181GDK_DEPRECATED_IN_3_10
182const gchar * gtk_action_get_stock_id (GtkAction *action);
183GDK_DEPRECATED_IN_3_10
184void gtk_action_set_gicon (GtkAction *action,
185 GIcon *icon);
186GDK_DEPRECATED_IN_3_10
187GIcon *gtk_action_get_gicon (GtkAction *action);
188GDK_DEPRECATED_IN_3_10
189void gtk_action_set_icon_name (GtkAction *action,
190 const gchar *icon_name);
191GDK_DEPRECATED_IN_3_10
192const gchar * gtk_action_get_icon_name (GtkAction *action);
193GDK_DEPRECATED_IN_3_10
194void gtk_action_set_visible_horizontal (GtkAction *action,
195 gboolean visible_horizontal);
196GDK_DEPRECATED_IN_3_10
197gboolean gtk_action_get_visible_horizontal (GtkAction *action);
198GDK_DEPRECATED_IN_3_10
199void gtk_action_set_visible_vertical (GtkAction *action,
200 gboolean visible_vertical);
201GDK_DEPRECATED_IN_3_10
202gboolean gtk_action_get_visible_vertical (GtkAction *action);
203GDK_DEPRECATED_IN_3_10
204void gtk_action_set_is_important (GtkAction *action,
205 gboolean is_important);
206GDK_DEPRECATED_IN_3_10
207gboolean gtk_action_get_is_important (GtkAction *action);
208GDK_DEPRECATED_IN_3_10
209void gtk_action_set_always_show_image (GtkAction *action,
210 gboolean always_show);
211GDK_DEPRECATED_IN_3_10
212gboolean gtk_action_get_always_show_image (GtkAction *action);
213
214
215G_END_DECLS
216
217#endif /* __GTK_ACTION_H__ */
218