]> Pileus Git - ~andy/gtk/blob - gtk/gtkaction.h
Apply egtk-format-protos. Doc tweaks.
[~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 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.
20  */
21
22 /*
23  * Author: James Henstridge <james@daa.com.au>
24  *
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/. 
29  */
30 #ifndef __GTK_ACTION_H__
31 #define __GTK_ACTION_H__
32
33 #include <gtk/gtkwidget.h>
34 #include <glib-object.h>
35
36 #define GTK_TYPE_ACTION            (gtk_action_get_type ())
37 #define GTK_ACTION(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ACTION, GtkAction))
38 #define GTK_ACTION_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_ACTION, GtkActionClass))
39 #define GTK_IS_ACTION(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ACTION))
40 #define GTK_IS_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), GTK_TYPE_ACTION))
41 #define GTK_ACTION_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), GTK_TYPE_ACTION, GtkActionClass))
42
43 typedef struct _GtkAction      GtkAction;
44 typedef struct _GtkActionClass GtkActionClass;
45 typedef struct _GtkActionPrivate GtkActionPrivate;
46
47 struct _GtkAction
48 {
49   GObject object;
50
51   /*< private >*/
52
53   GtkActionPrivate *private_data;
54 };
55
56 struct _GtkActionClass
57 {
58   GObjectClass parent_class;
59
60   /* activation signal */
61   void       (* activate)           (GtkAction    *action);
62
63   GType      menu_item_type;
64   GType      toolbar_item_type;
65
66   /* widget creation routines (not signals) */
67   GtkWidget *(* create_menu_item)   (GtkAction *action);
68   GtkWidget *(* create_tool_item)   (GtkAction *action);
69   void       (* connect_proxy)      (GtkAction *action,
70                                      GtkWidget *proxy);
71   void       (* disconnect_proxy)   (GtkAction *action,
72                                      GtkWidget *proxy);
73
74   /* Padding for future expansion */
75   void (*_gtk_reserved1) (void);
76   void (*_gtk_reserved2) (void);
77   void (*_gtk_reserved3) (void);
78   void (*_gtk_reserved4) (void);
79 };
80
81 GType        gtk_action_get_type              (void);
82 const gchar* gtk_action_get_name              (GtkAction   *action);
83 void         gtk_action_activate              (GtkAction   *action);
84 GtkWidget *  gtk_action_create_icon           (GtkAction   *action,
85                                                GtkIconSize  icon_size);
86 GtkWidget *  gtk_action_create_menu_item      (GtkAction   *action);
87 GtkWidget *  gtk_action_create_tool_item      (GtkAction   *action);
88 void         gtk_action_connect_proxy         (GtkAction   *action,
89                                                GtkWidget   *proxy);
90 void         gtk_action_disconnect_proxy      (GtkAction   *action,
91                                                GtkWidget   *proxy);
92 GSList    *  gtk_action_get_proxies           (GtkAction   *action);
93
94
95 /* protected ... for use by child actions */
96 void         gtk_action_block_activate_from   (GtkAction   *action,
97                                                GtkWidget   *proxy);
98 void         gtk_action_unblock_activate_from (GtkAction   *action,
99                                                GtkWidget   *proxy);
100
101
102 /* protected ... for use by action groups */
103 void         gtk_action_set_accel_path        (GtkAction   *action,
104                                                const gchar *accel_path);
105
106
107
108 #endif  /* __GTK_ACTION_H__ */