2 * Copyright (C) 2007 Openismus GmbH
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
24 #include "gtktoolshell.h"
25 #include "gtkwidget.h"
30 * SECTION:gtktoolshell
31 * @short_description: Interface for containers containing GtkToolItem widgets.
33 * The #GtkToolShell interface allows container widgets to provide additional
34 * information when embedding #GtkToolItem widgets.
36 * @see_also: #GtkToolbar, #GtkToolItem
42 * Dummy structure for accessing instances of #GtkToolShellIface.
46 gtk_tool_shell_get_type (void)
48 static GType type = 0;
52 type = g_type_register_static_simple (G_TYPE_INTERFACE, I_("GtkToolShell"),
53 sizeof (GtkToolShellIface),
55 g_type_interface_add_prerequisite (type, GTK_TYPE_WIDGET);
62 * gtk_tool_shell_get_icon_size:
63 * @shell: a #GtkToolShell
65 * Retrieves the icon size for the tool shell. Tool items must not call this
66 * function directly, but rely on gtk_tool_item_get_icon_size() instead.
68 * Return value: the current size for icons of @shell
73 gtk_tool_shell_get_icon_size (GtkToolShell *shell)
75 return GTK_TOOL_SHELL_GET_IFACE (shell)->get_icon_size (shell);
79 * gtk_tool_shell_get_orientation:
80 * @shell: a #GtkToolShell
82 * Retrieves the current orientation for the tool shell. Tool items must not
83 * call this function directly, but rely on gtk_tool_item_get_orientation()
86 * Return value: the current orientation of @shell
91 gtk_tool_shell_get_orientation (GtkToolShell *shell)
93 return GTK_TOOL_SHELL_GET_IFACE (shell)->get_orientation (shell);
97 * gtk_tool_shell_get_style:
98 * @shell: a #GtkToolShell
100 * Retrieves whether the tool shell has text, icons, or both. Tool items must
101 * not call this function directly, but rely on gtk_tool_item_get_style()
104 * Return value: the current style of @shell
109 gtk_tool_shell_get_style (GtkToolShell *shell)
111 return GTK_TOOL_SHELL_GET_IFACE (shell)->get_style (shell);
115 * gtk_tool_shell_get_relief_style:
116 * @shell: a #GtkToolShell
118 * Returns the relief style of buttons on @shell. Tool items must not call this
119 * function directly, but rely on gtk_tool_item_get_relief_style() instead.
121 * Return value: The relief style of buttons on @shell.
126 gtk_tool_shell_get_relief_style (GtkToolShell *shell)
128 GtkToolShellIface *iface = GTK_TOOL_SHELL_GET_IFACE (shell);
130 if (iface->get_relief_style)
131 return iface->get_relief_style (shell);
133 return GTK_RELIEF_NONE;
137 * gtk_tool_shell_rebuild_menu:
138 * @shell: a #GtkToolShell
140 * Calling this function signals the tool shell that the overflow menu item for
141 * tool items have changed. If there is an overflow menu and if it is visible
142 * when this function it called, the menu will be rebuilt.
144 * Tool items must not call this function directly, but rely on
145 * gtk_tool_item_rebuild_menu() instead.
150 gtk_tool_shell_rebuild_menu (GtkToolShell *shell)
152 GtkToolShellIface *iface = GTK_TOOL_SHELL_GET_IFACE (shell);
154 if (iface->rebuild_menu)
155 iface->rebuild_menu (shell);
159 * gtk_tool_shell_get_text_orientation:
160 * @shell: a #GtkToolShell
162 * Retrieves the current text orientation for the tool shell. Tool items must not
163 * call this function directly, but rely on gtk_tool_item_get_text_orientation()
166 * Return value: the current text orientation of @shell
171 gtk_tool_shell_get_text_orientation (GtkToolShell *shell)
173 GtkToolShellIface *iface = GTK_TOOL_SHELL_GET_IFACE (shell);
175 if (iface->get_text_orientation)
176 return GTK_TOOL_SHELL_GET_IFACE (shell)->get_text_orientation (shell);
178 return GTK_ORIENTATION_HORIZONTAL;
182 * gtk_tool_shell_get_text_alignment:
183 * @shell: a #GtkToolShell
185 * Retrieves the current text alignment for the tool shell. Tool items must not
186 * call this function directly, but rely on gtk_tool_item_get_text_alignment()
189 * Return value: the current text alignment of @shell
194 gtk_tool_shell_get_text_alignment (GtkToolShell *shell)
196 GtkToolShellIface *iface = GTK_TOOL_SHELL_GET_IFACE (shell);
198 if (iface->get_text_alignment)
199 return GTK_TOOL_SHELL_GET_IFACE (shell)->get_text_alignment (shell);
205 * gtk_tool_shell_get_ellipsize_mode
206 * @shell: a #GtkToolShell
208 * Retrieves the current ellipsize mode for the tool shell. Tool items must not
209 * call this function directly, but rely on gtk_tool_item_get_ellipsize_mode()
212 * Return value: the current ellipsize mode of @shell
217 gtk_tool_shell_get_ellipsize_mode (GtkToolShell *shell)
219 GtkToolShellIface *iface = GTK_TOOL_SHELL_GET_IFACE (shell);
221 if (iface->get_ellipsize_mode)
222 return GTK_TOOL_SHELL_GET_IFACE (shell)->get_ellipsize_mode (shell);
224 return PANGO_ELLIPSIZE_NONE;
228 * gtk_tool_shell_get_text_size_group:
229 * @shell: a #GtkToolShell
231 * Retrieves the current text size group for the tool shell. Tool items must not
232 * call this function directly, but rely on gtk_tool_item_get_text_size_group()
235 * Return value: the current text size group of @shell
240 gtk_tool_shell_get_text_size_group (GtkToolShell *shell)
242 GtkToolShellIface *iface = GTK_TOOL_SHELL_GET_IFACE (shell);
244 if (iface->get_text_size_group)
245 return GTK_TOOL_SHELL_GET_IFACE (shell)->get_text_size_group (shell);
250 #define __GTK_TOOL_SHELL_C__
251 #include "gtkaliasdef.c"