1/* gtktoolitem.c
2 *
3 * Copyright (C) 2002 Anders Carlsson <[email protected]>
4 * Copyright (C) 2002 James Henstridge <[email protected]>
5 * Copyright (C) 2003 Soeren Sandmann <[email protected]>
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, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
21 */
22
23#ifndef __GTK_TOOL_ITEM_H__
24#define __GTK_TOOL_ITEM_H__
25
26#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
27#error "Only <gtk/gtk.h> can be included directly."
28#endif
29
30#include <gtk/gtkbin.h>
31#include <gtk/gtktooltips.h>
32#include <gtk/gtkmenuitem.h>
33#include <gtk/gtksizegroup.h>
34
35G_BEGIN_DECLS
36
37#define GTK_TYPE_TOOL_ITEM (gtk_tool_item_get_type ())
38#define GTK_TOOL_ITEM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_TOOL_ITEM, GtkToolItem))
39#define GTK_TOOL_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TOOL_ITEM, GtkToolItemClass))
40#define GTK_IS_TOOL_ITEM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_TOOL_ITEM))
41#define GTK_IS_TOOL_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TOOL_ITEM))
42#define GTK_TOOL_ITEM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), GTK_TYPE_TOOL_ITEM, GtkToolItemClass))
43
44typedef struct _GtkToolItem GtkToolItem;
45typedef struct _GtkToolItemClass GtkToolItemClass;
46typedef struct _GtkToolItemPrivate GtkToolItemPrivate;
47
48struct _GtkToolItem
49{
50 GtkBin parent;
51
52 /*< private >*/
53 GtkToolItemPrivate *GSEAL (priv);
54};
55
56struct _GtkToolItemClass
57{
58 GtkBinClass parent_class;
59
60 /* signals */
61 gboolean (* create_menu_proxy) (GtkToolItem *tool_item);
62 void (* toolbar_reconfigured) (GtkToolItem *tool_item);
63#ifndef GTK_DISABLE_DEPRECATED
64 gboolean (* set_tooltip) (GtkToolItem *tool_item,
65 GtkTooltips *tooltips,
66 const gchar *tip_text,
67 const gchar *tip_private);
68#else
69 gpointer _set_tooltip;
70#endif
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
79GType gtk_tool_item_get_type (void) G_GNUC_CONST;
80GtkToolItem *gtk_tool_item_new (void);
81
82void gtk_tool_item_set_homogeneous (GtkToolItem *tool_item,
83 gboolean homogeneous);
84gboolean gtk_tool_item_get_homogeneous (GtkToolItem *tool_item);
85
86void gtk_tool_item_set_expand (GtkToolItem *tool_item,
87 gboolean expand);
88gboolean gtk_tool_item_get_expand (GtkToolItem *tool_item);
89
90#ifndef GTK_DISABLE_DEPRECATED
91void gtk_tool_item_set_tooltip (GtkToolItem *tool_item,
92 GtkTooltips *tooltips,
93 const gchar *tip_text,
94 const gchar *tip_private);
95#endif /* GTK_DISABLE_DEPRECATED */
96void gtk_tool_item_set_tooltip_text (GtkToolItem *tool_item,
97 const gchar *text);
98void gtk_tool_item_set_tooltip_markup (GtkToolItem *tool_item,
99 const gchar *markup);
100
101void gtk_tool_item_set_use_drag_window (GtkToolItem *tool_item,
102 gboolean use_drag_window);
103gboolean gtk_tool_item_get_use_drag_window (GtkToolItem *tool_item);
104
105void gtk_tool_item_set_visible_horizontal (GtkToolItem *tool_item,
106 gboolean visible_horizontal);
107gboolean gtk_tool_item_get_visible_horizontal (GtkToolItem *tool_item);
108
109void gtk_tool_item_set_visible_vertical (GtkToolItem *tool_item,
110 gboolean visible_vertical);
111gboolean gtk_tool_item_get_visible_vertical (GtkToolItem *tool_item);
112
113gboolean gtk_tool_item_get_is_important (GtkToolItem *tool_item);
114void gtk_tool_item_set_is_important (GtkToolItem *tool_item,
115 gboolean is_important);
116
117PangoEllipsizeMode gtk_tool_item_get_ellipsize_mode (GtkToolItem *tool_item);
118GtkIconSize gtk_tool_item_get_icon_size (GtkToolItem *tool_item);
119GtkOrientation gtk_tool_item_get_orientation (GtkToolItem *tool_item);
120GtkToolbarStyle gtk_tool_item_get_toolbar_style (GtkToolItem *tool_item);
121GtkReliefStyle gtk_tool_item_get_relief_style (GtkToolItem *tool_item);
122gfloat gtk_tool_item_get_text_alignment (GtkToolItem *tool_item);
123GtkOrientation gtk_tool_item_get_text_orientation (GtkToolItem *tool_item);
124GtkSizeGroup * gtk_tool_item_get_text_size_group (GtkToolItem *tool_item);
125
126GtkWidget * gtk_tool_item_retrieve_proxy_menu_item (GtkToolItem *tool_item);
127GtkWidget * gtk_tool_item_get_proxy_menu_item (GtkToolItem *tool_item,
128 const gchar *menu_item_id);
129void gtk_tool_item_set_proxy_menu_item (GtkToolItem *tool_item,
130 const gchar *menu_item_id,
131 GtkWidget *menu_item);
132void gtk_tool_item_rebuild_menu (GtkToolItem *tool_item);
133
134void gtk_tool_item_toolbar_reconfigured (GtkToolItem *tool_item);
135
136/* private */
137
138gboolean _gtk_tool_item_create_menu_proxy (GtkToolItem *tool_item);
139
140G_END_DECLS
141
142#endif /* __GTK_TOOL_ITEM_H__ */
143