]> Pileus Git - ~andy/gtk/blob - gtk/gtkaction.h
stylecontext: Do invalidation on first resize container
[~andy/gtk] / gtk / gtkaction.h
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
38 G_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
47 typedef struct _GtkAction      GtkAction;
48 typedef struct _GtkActionClass GtkActionClass;
49 typedef struct _GtkActionPrivate GtkActionPrivate;
50
51 struct _GtkAction
52 {
53   GObject object;
54
55   /*< private >*/
56   GtkActionPrivate *private_data;
57 };
58
59 struct _GtkActionClass
60 {
61   GObjectClass parent_class;
62
63   /* activation signal */
64   void       (* activate)           (GtkAction    *action);
65
66   GType      menu_item_type;
67   GType      toolbar_item_type;
68
69   /* widget creation routines (not signals) */
70   GtkWidget *(* create_menu_item)   (GtkAction *action);
71   GtkWidget *(* create_tool_item)   (GtkAction *action);
72   void       (* connect_proxy)      (GtkAction *action,
73                                      GtkWidget *proxy);
74   void       (* disconnect_proxy)   (GtkAction *action,
75                                      GtkWidget *proxy);
76
77   GtkWidget *(* create_menu)        (GtkAction *action);
78
79   /* Padding for future expansion */
80   void (*_gtk_reserved1) (void);
81   void (*_gtk_reserved2) (void);
82   void (*_gtk_reserved3) (void);
83   void (*_gtk_reserved4) (void);
84 };
85
86 GType        gtk_action_get_type               (void) G_GNUC_CONST;
87 GtkAction   *gtk_action_new                    (const gchar *name,
88                                                 const gchar *label,
89                                                 const gchar *tooltip,
90                                                 const gchar *stock_id);
91 const gchar* gtk_action_get_name               (GtkAction     *action);
92 gboolean     gtk_action_is_sensitive           (GtkAction     *action);
93 gboolean     gtk_action_get_sensitive          (GtkAction     *action);
94 void         gtk_action_set_sensitive          (GtkAction     *action,
95                                                 gboolean       sensitive);
96 gboolean     gtk_action_is_visible             (GtkAction     *action);
97 gboolean     gtk_action_get_visible            (GtkAction     *action);
98 void         gtk_action_set_visible            (GtkAction     *action,
99                                                 gboolean       visible);
100 void         gtk_action_activate               (GtkAction     *action);
101 GtkWidget *  gtk_action_create_icon            (GtkAction     *action,
102                                                 GtkIconSize    icon_size);
103 GtkWidget *  gtk_action_create_menu_item       (GtkAction     *action);
104 GtkWidget *  gtk_action_create_tool_item       (GtkAction     *action);
105 GtkWidget *  gtk_action_create_menu            (GtkAction     *action);
106 GSList *     gtk_action_get_proxies            (GtkAction     *action);
107 void         gtk_action_connect_accelerator    (GtkAction     *action);
108 void         gtk_action_disconnect_accelerator (GtkAction     *action);
109 const gchar *gtk_action_get_accel_path         (GtkAction     *action);
110 GClosure    *gtk_action_get_accel_closure      (GtkAction     *action);
111 void         gtk_action_block_activate         (GtkAction     *action);
112 void         gtk_action_unblock_activate       (GtkAction     *action);
113
114
115 void         _gtk_action_add_to_proxy_list     (GtkAction     *action,
116                                                 GtkWidget     *proxy);
117 void         _gtk_action_remove_from_proxy_list(GtkAction     *action,
118                                                 GtkWidget     *proxy);
119
120 /* protected ... for use by child actions */
121 void         _gtk_action_emit_activate         (GtkAction     *action);
122
123 /* protected ... for use by action groups */
124 void         gtk_action_set_accel_path         (GtkAction     *action,
125                                                 const gchar   *accel_path);
126 void         gtk_action_set_accel_group        (GtkAction     *action,
127                                                 GtkAccelGroup *accel_group);
128 void         _gtk_action_sync_menu_visible     (GtkAction     *action,
129                                                 GtkWidget     *proxy,
130                                                 gboolean       empty);
131
132 void                  gtk_action_set_label              (GtkAction   *action,
133                                                          const gchar *label);
134 const gchar *         gtk_action_get_label              (GtkAction   *action);
135 void                  gtk_action_set_short_label        (GtkAction   *action,
136                                                          const gchar *short_label);
137 const gchar *         gtk_action_get_short_label        (GtkAction   *action);
138 void                  gtk_action_set_tooltip            (GtkAction   *action,
139                                                          const gchar *tooltip);
140 const gchar *         gtk_action_get_tooltip            (GtkAction   *action);
141 void                  gtk_action_set_stock_id           (GtkAction   *action,
142                                                          const gchar *stock_id);
143 const gchar *         gtk_action_get_stock_id           (GtkAction   *action);
144 void                  gtk_action_set_gicon              (GtkAction   *action,
145                                                          GIcon       *icon);
146 GIcon                *gtk_action_get_gicon              (GtkAction   *action);
147 void                  gtk_action_set_icon_name          (GtkAction   *action,
148                                                          const gchar *icon_name);
149 const gchar *         gtk_action_get_icon_name          (GtkAction   *action);
150 void                  gtk_action_set_visible_horizontal (GtkAction   *action,
151                                                          gboolean     visible_horizontal);
152 gboolean              gtk_action_get_visible_horizontal (GtkAction   *action);
153 void                  gtk_action_set_visible_vertical   (GtkAction   *action,
154                                                          gboolean     visible_vertical);
155 gboolean              gtk_action_get_visible_vertical   (GtkAction   *action);
156 void                  gtk_action_set_is_important       (GtkAction   *action,
157                                                          gboolean     is_important);
158 gboolean              gtk_action_get_is_important       (GtkAction   *action);
159 void                  gtk_action_set_always_show_image  (GtkAction   *action,
160                                                          gboolean     always_show);
161 gboolean              gtk_action_get_always_show_image  (GtkAction   *action);
162
163
164 G_END_DECLS
165
166 #endif  /* __GTK_ACTION_H__ */