1/* gtktoolitem.c
2 *
3 * Copyright (C) 2002 Anders Carlsson <andersca@gnome.org>
4 * Copyright (C) 2002 James Henstridge <james@daa.com.au>
5 * Copyright (C) 2003 Soeren Sandmann <sandmann@daimi.au.dk>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef __GTK_TOOL_ITEM_H__
22#define __GTK_TOOL_ITEM_H__
23
24#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
25#error "Only <gtk/gtk.h> can be included directly."
26#endif
27
28#include <gtk/gtkbin.h>
29#include <gtk/gtkmenuitem.h>
30#include <gtk/gtksizegroup.h>
31
32G_BEGIN_DECLS
33
34#define GTK_TYPE_TOOL_ITEM (gtk_tool_item_get_type ())
35#define GTK_TOOL_ITEM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_TOOL_ITEM, GtkToolItem))
36#define GTK_TOOL_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TOOL_ITEM, GtkToolItemClass))
37#define GTK_IS_TOOL_ITEM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_TOOL_ITEM))
38#define GTK_IS_TOOL_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TOOL_ITEM))
39#define GTK_TOOL_ITEM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), GTK_TYPE_TOOL_ITEM, GtkToolItemClass))
40
41typedef struct _GtkToolItem GtkToolItem;
42typedef struct _GtkToolItemClass GtkToolItemClass;
43typedef struct _GtkToolItemPrivate GtkToolItemPrivate;
44
45struct _GtkToolItem
46{
47 GtkBin parent;
48
49 /*< private >*/
50 GtkToolItemPrivate *priv;
51};
52
53/**
54 * GtkToolItemClass:
55 * @parent_class: The parent class.
56 * @create_menu_proxy: Signal emitted when the toolbar needs
57 * information from tool_item about whether the item should appear in
58 * the toolbar overflow menu.
59 * @toolbar_reconfigured: Signal emitted when some property of the
60 * toolbar that the item is a child of changes.
61 */
62struct _GtkToolItemClass
63{
64 GtkBinClass parent_class;
65
66 /* signals */
67 gboolean (* create_menu_proxy) (GtkToolItem *tool_item);
68 void (* toolbar_reconfigured) (GtkToolItem *tool_item);
69
70 /*< private >*/
71
72 /* Padding for future expansion */
73 void (* _gtk_reserved1) (void);
74 void (* _gtk_reserved2) (void);
75 void (* _gtk_reserved3) (void);
76 void (* _gtk_reserved4) (void);
77};
78
79
80GDK_AVAILABLE_IN_ALL
81GType gtk_tool_item_get_type (void) G_GNUC_CONST;
82GDK_AVAILABLE_IN_ALL
83GtkToolItem *gtk_tool_item_new (void);
84
85GDK_AVAILABLE_IN_ALL
86void gtk_tool_item_set_homogeneous (GtkToolItem *tool_item,
87 gboolean homogeneous);
88GDK_AVAILABLE_IN_ALL
89gboolean gtk_tool_item_get_homogeneous (GtkToolItem *tool_item);
90
91GDK_AVAILABLE_IN_ALL
92void gtk_tool_item_set_expand (GtkToolItem *tool_item,
93 gboolean expand);
94GDK_AVAILABLE_IN_ALL
95gboolean gtk_tool_item_get_expand (GtkToolItem *tool_item);
96GDK_AVAILABLE_IN_ALL
97void gtk_tool_item_set_tooltip_text (GtkToolItem *tool_item,
98 const gchar *text);
99GDK_AVAILABLE_IN_ALL
100void gtk_tool_item_set_tooltip_markup (GtkToolItem *tool_item,
101 const gchar *markup);
102
103GDK_AVAILABLE_IN_ALL
104void gtk_tool_item_set_use_drag_window (GtkToolItem *tool_item,
105 gboolean use_drag_window);
106GDK_AVAILABLE_IN_ALL
107gboolean gtk_tool_item_get_use_drag_window (GtkToolItem *tool_item);
108
109GDK_AVAILABLE_IN_ALL
110void gtk_tool_item_set_visible_horizontal (GtkToolItem *tool_item,
111 gboolean visible_horizontal);
112GDK_AVAILABLE_IN_ALL
113gboolean gtk_tool_item_get_visible_horizontal (GtkToolItem *tool_item);
114
115GDK_AVAILABLE_IN_ALL
116void gtk_tool_item_set_visible_vertical (GtkToolItem *tool_item,
117 gboolean visible_vertical);
118GDK_AVAILABLE_IN_ALL
119gboolean gtk_tool_item_get_visible_vertical (GtkToolItem *tool_item);
120
121GDK_AVAILABLE_IN_ALL
122gboolean gtk_tool_item_get_is_important (GtkToolItem *tool_item);
123GDK_AVAILABLE_IN_ALL
124void gtk_tool_item_set_is_important (GtkToolItem *tool_item,
125 gboolean is_important);
126
127GDK_AVAILABLE_IN_ALL
128PangoEllipsizeMode gtk_tool_item_get_ellipsize_mode (GtkToolItem *tool_item);
129GDK_AVAILABLE_IN_ALL
130GtkIconSize gtk_tool_item_get_icon_size (GtkToolItem *tool_item);
131GDK_AVAILABLE_IN_ALL
132GtkOrientation gtk_tool_item_get_orientation (GtkToolItem *tool_item);
133GDK_AVAILABLE_IN_ALL
134GtkToolbarStyle gtk_tool_item_get_toolbar_style (GtkToolItem *tool_item);
135GDK_AVAILABLE_IN_ALL
136GtkReliefStyle gtk_tool_item_get_relief_style (GtkToolItem *tool_item);
137GDK_AVAILABLE_IN_ALL
138gfloat gtk_tool_item_get_text_alignment (GtkToolItem *tool_item);
139GDK_AVAILABLE_IN_ALL
140GtkOrientation gtk_tool_item_get_text_orientation (GtkToolItem *tool_item);
141GDK_AVAILABLE_IN_ALL
142GtkSizeGroup * gtk_tool_item_get_text_size_group (GtkToolItem *tool_item);
143
144GDK_AVAILABLE_IN_ALL
145GtkWidget * gtk_tool_item_retrieve_proxy_menu_item (GtkToolItem *tool_item);
146GDK_AVAILABLE_IN_ALL
147GtkWidget * gtk_tool_item_get_proxy_menu_item (GtkToolItem *tool_item,
148 const gchar *menu_item_id);
149GDK_AVAILABLE_IN_ALL
150void gtk_tool_item_set_proxy_menu_item (GtkToolItem *tool_item,
151 const gchar *menu_item_id,
152 GtkWidget *menu_item);
153GDK_AVAILABLE_IN_ALL
154void gtk_tool_item_rebuild_menu (GtkToolItem *tool_item);
155
156GDK_AVAILABLE_IN_ALL
157void gtk_tool_item_toolbar_reconfigured (GtkToolItem *tool_item);
158
159/* private */
160
161gboolean _gtk_tool_item_create_menu_proxy (GtkToolItem *tool_item);
162
163G_END_DECLS
164
165#endif /* __GTK_TOOL_ITEM_H__ */
166

source code of include/gtk-3.0/gtk/gtktoolitem.h