summaryrefslogtreecommitdiff
path: root/gtk/gtktoolshell.c
diff options
context:
space:
mode:
authorMurray Cumming <murrayc@murrayc.com>2009-07-13 19:13:59 +0200
committerMurray Cumming <murrayc@murrayc.com>2009-07-13 19:13:59 +0200
commitdad6e7343c1fbdbbe2a6ca765aabcf8b887933c9 (patch)
tree1f2565ca69346eccdac3580e16c75a717995e869 /gtk/gtktoolshell.c
parent8a294b8bb75236c52519dcb39794bedad15498df (diff)
downloadgtk+-dad6e7343c1fbdbbe2a6ca765aabcf8b887933c9.tar.gz
ToolShell: Add ellipsize, text-orientation, text-alignment and size-group.
* gtk/gtktoolshell.c: Added vfuncs to get/set ellipsize, text-orientation, text-alignment and size-group plus getter/setters to invoke these vfuncs. * gtk/gtktoolitem.[h|c]: Added getters and setters to get/set these from the parent GtkToolShell. This is in the style of the existing "properties". * gtk/gtktoolbutton.c: Updated to use the extra properties. * docs/reference/gtk/gtk-sections.txt * gtk/gtk.symbols: Updated to mention the new functions. These new "properties" are used by GtkToolPalette.
Diffstat (limited to 'gtk/gtktoolshell.c')
-rw-r--r--gtk/gtktoolshell.c92
1 files changed, 92 insertions, 0 deletions
diff --git a/gtk/gtktoolshell.c b/gtk/gtktoolshell.c
index e3e71c5086..f7be68a523 100644
--- a/gtk/gtktoolshell.c
+++ b/gtk/gtktoolshell.c
@@ -155,5 +155,97 @@ gtk_tool_shell_rebuild_menu (GtkToolShell *shell)
iface->rebuild_menu (shell);
}
+/**
+ * gtk_tool_shell_get_text_orientation:
+ * @shell: a #GtkToolShell
+ *
+ * Retrieves the current text orientation for the tool shell. Tool items must not
+ * call this function directly, but rely on gtk_tool_item_get_text_orientation()
+ * instead.
+ *
+ * Return value: the current text orientation of @shell
+ *
+ * Since: 2.14
+ **/
+GtkOrientation
+gtk_tool_shell_get_text_orientation (GtkToolShell *shell)
+{
+ GtkToolShellIface *iface = GTK_TOOL_SHELL_GET_IFACE (shell);
+
+ if (iface->get_text_orientation)
+ return GTK_TOOL_SHELL_GET_IFACE (shell)->get_text_orientation (shell);
+
+ return GTK_ORIENTATION_HORIZONTAL;
+}
+
+/**
+ * gtk_tool_shell_get_text_alignment:
+ * @shell: a #GtkToolShell
+ *
+ * Retrieves the current text alignment for the tool shell. Tool items must not
+ * call this function directly, but rely on gtk_tool_item_get_text_alignment()
+ * instead.
+ *
+ * Return value: the current text alignment of @shell
+ *
+ * Since: 2.14
+ **/
+gfloat
+gtk_tool_shell_get_text_alignment (GtkToolShell *shell)
+{
+ GtkToolShellIface *iface = GTK_TOOL_SHELL_GET_IFACE (shell);
+
+ if (iface->get_text_alignment)
+ return GTK_TOOL_SHELL_GET_IFACE (shell)->get_text_alignment (shell);
+
+ return 0.5f;
+}
+
+/**
+ * gtk_tool_shell_get_ellipsize_mode
+ * @shell: a #GtkToolShell
+ *
+ * Retrieves the current ellipsize mode for the tool shell. Tool items must not
+ * call this function directly, but rely on gtk_tool_item_get_ellipsize_mode()
+ * instead.
+ *
+ * Return value: the current ellipsize mode of @shell
+ *
+ * Since: 2.14
+ **/
+PangoEllipsizeMode
+gtk_tool_shell_get_ellipsize_mode (GtkToolShell *shell)
+{
+ GtkToolShellIface *iface = GTK_TOOL_SHELL_GET_IFACE (shell);
+
+ if (iface->get_ellipsize_mode)
+ return GTK_TOOL_SHELL_GET_IFACE (shell)->get_ellipsize_mode (shell);
+
+ return PANGO_ELLIPSIZE_NONE;
+}
+
+/**
+ * gtk_tool_shell_get_text_size_group:
+ * @shell: a #GtkToolShell
+ *
+ * Retrieves the current text size group for the tool shell. Tool items must not
+ * call this function directly, but rely on gtk_tool_item_get_text_size_group()
+ * instead.
+ *
+ * Return value: the current text size group of @shell
+ *
+ * Since: 2.14
+ **/
+GtkSizeGroup *
+gtk_tool_shell_get_text_size_group (GtkToolShell *shell)
+{
+ GtkToolShellIface *iface = GTK_TOOL_SHELL_GET_IFACE (shell);
+
+ if (iface->get_text_size_group)
+ return GTK_TOOL_SHELL_GET_IFACE (shell)->get_text_size_group (shell);
+
+ return NULL;
+}
+
#define __GTK_TOOL_SHELL_C__
#include "gtkaliasdef.c"