Commit dad6e734 authored by Murray Cumming's avatar Murray Cumming

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.
parent 8a294b8b
2009-07-13 Murray Cumming <murrayc@murrayc.com>
reviewed by: <delete if not using a buddy>
* gtk/gtk-sections.txt:
=== ChangeLog discontinued ===
With the move to git, GTK+ is switching from a ChangeLog file
......
......@@ -4166,10 +4166,13 @@ gtk_toggle_button_get_type
<TITLE>GtkToolShell</TITLE>
GtkToolShell
GtkToolShellIface
gtk_tool_shell_get_ellipsize_mode
gtk_tool_shell_get_icon_size
gtk_tool_shell_get_orientation
gtk_tool_shell_get_relief_style
gtk_tool_shell_get_style
gtk_tool_shell_get_text_alignment
gtk_tool_shell_get_text_orientation
gtk_tool_shell_rebuild_menu
<SUBSECTION Standard>
......@@ -4257,10 +4260,13 @@ gtk_tool_item_set_visible_vertical
gtk_tool_item_get_visible_vertical
gtk_tool_item_set_is_important
gtk_tool_item_get_is_important
gtk_tool_item_get_ellipsize_mode
gtk_tool_item_get_icon_size
gtk_tool_item_get_orientation
gtk_tool_item_get_toolbar_style
gtk_tool_item_get_relief_style
gtk_tool_item_get_text_alignment
gtk_tool_item_get_text_orientation
gtk_tool_item_retrieve_proxy_menu_item
gtk_tool_item_get_proxy_menu_item
gtk_tool_item_set_proxy_menu_item
......
......@@ -4320,10 +4320,14 @@ gtk_toolbar_unset_style
#if IN_HEADER(__GTK_TOOL_SHELL_H__)
#if IN_FILE(__GTK_TOOL_SHELL_C__)
gtk_tool_shell_get_type G_GNUC_CONST
gtk_tool_shell_get_ellipsize_mode
gtk_tool_shell_get_icon_size
gtk_tool_shell_get_orientation
gtk_tool_shell_get_style
gtk_tool_shell_get_relief_style
gtk_tool_shell_get_text_alignment
gtk_tool_shell_get_text_orientation
gtk_tool_shell_get_text_size_group
gtk_tool_shell_rebuild_menu
#endif
#endif
......@@ -4350,6 +4354,7 @@ gtk_tool_button_set_use_underline
#if IN_HEADER(__GTK_TOOL_ITEM_H__)
#if IN_FILE(__GTK_TOOL_ITEM_C__)
gtk_tool_item_get_ellipsize_mode
gtk_tool_item_get_expand
gtk_tool_item_get_homogeneous
gtk_tool_item_get_icon_size
......@@ -4357,6 +4362,9 @@ gtk_tool_item_get_is_important
gtk_tool_item_get_orientation
gtk_tool_item_get_proxy_menu_item
gtk_tool_item_get_relief_style
gtk_tool_item_get_text_alignment
gtk_tool_item_get_text_orientation
gtk_tool_item_get_text_size_group
gtk_tool_item_get_toolbar_style
gtk_tool_item_get_type G_GNUC_CONST
gtk_tool_item_get_use_drag_window
......
......@@ -96,7 +96,9 @@ struct _GtkToolButtonPrivate
gchar *label_text;
GtkWidget *label_widget;
GtkWidget *icon_widget;
GtkSizeGroup *text_size_group;
guint use_underline : 1;
guint contents_invalid : 1;
};
......@@ -318,6 +320,8 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item)
GtkIconSize icon_size;
GtkWidget *box = NULL;
guint icon_spacing;
GtkOrientation text_orientation = GTK_ORIENTATION_HORIZONTAL;
GtkSizeGroup *size_group = NULL;
button->priv->contents_invalid = FALSE;
......@@ -355,7 +359,8 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item)
if (style == GTK_TOOLBAR_BOTH_HORIZ &&
(gtk_tool_item_get_is_important (GTK_TOOL_ITEM (button)) ||
gtk_tool_item_get_orientation (GTK_TOOL_ITEM (button)) == GTK_ORIENTATION_VERTICAL))
gtk_tool_item_get_orientation (GTK_TOOL_ITEM (button)) == GTK_ORIENTATION_VERTICAL ||
gtk_tool_item_get_text_orientation (GTK_TOOL_ITEM (button)) == GTK_ORIENTATION_VERTICAL))
{
need_label = TRUE;
}
......@@ -415,6 +420,28 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item)
gtk_widget_show (label);
}
gtk_label_set_ellipsize (GTK_LABEL (label),
gtk_tool_item_get_ellipsize_mode (GTK_TOOL_ITEM (button)));
text_orientation = gtk_tool_item_get_text_orientation (GTK_TOOL_ITEM (button));
if (text_orientation == GTK_ORIENTATION_HORIZONTAL)
{
gtk_label_set_angle (GTK_LABEL (label), 0);
gtk_misc_set_alignment (GTK_MISC (label),
gtk_tool_item_get_text_alignment (GTK_TOOL_ITEM (button)),
0.5);
}
else
{
gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_NONE);
if (gtk_widget_get_direction (GTK_WIDGET (tool_item)) == GTK_TEXT_DIR_RTL)
gtk_label_set_angle (GTK_LABEL (label), -90);
else
gtk_label_set_angle (GTK_LABEL (label), 90);
gtk_misc_set_alignment (GTK_MISC (label),
0.5,
1 - gtk_tool_item_get_text_alignment (GTK_TOOL_ITEM (button)));
}
}
icon_size = gtk_tool_item_get_icon_size (GTK_TOOL_ITEM (button));
......@@ -442,6 +469,22 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item)
icon = gtk_image_new_from_icon_name (button->priv->icon_name, icon_size);
gtk_widget_show (icon);
}
if (icon && text_orientation == GTK_ORIENTATION_HORIZONTAL)
gtk_misc_set_alignment (GTK_MISC (icon),
1.0 - gtk_tool_item_get_text_alignment (GTK_TOOL_ITEM (button)),
0.5);
else if (icon)
gtk_misc_set_alignment (GTK_MISC (icon),
0.5,
gtk_tool_item_get_text_alignment (GTK_TOOL_ITEM (button)));
if (icon)
{
size_group = gtk_tool_item_get_text_size_group (GTK_TOOL_ITEM (button));
if (size_group != NULL)
gtk_size_group_add_widget (size_group, icon);
}
}
switch (style)
......@@ -452,7 +495,10 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item)
break;
case GTK_TOOLBAR_BOTH:
box = gtk_vbox_new (FALSE, icon_spacing);
if (text_orientation == GTK_ORIENTATION_HORIZONTAL)
box = gtk_vbox_new (FALSE, icon_spacing);
else
box = gtk_hbox_new (FALSE, icon_spacing);
if (icon)
gtk_box_pack_start (GTK_BOX (box), icon, TRUE, TRUE, 0);
gtk_box_pack_end (GTK_BOX (box), label, FALSE, TRUE, 0);
......@@ -460,11 +506,22 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item)
break;
case GTK_TOOLBAR_BOTH_HORIZ:
box = gtk_hbox_new (FALSE, icon_spacing);
if (icon)
gtk_box_pack_start (GTK_BOX (box), icon, label? FALSE : TRUE, TRUE, 0);
if (label)
gtk_box_pack_start (GTK_BOX (box), label, TRUE, TRUE, 0);
if (text_orientation == GTK_ORIENTATION_HORIZONTAL)
{
box = gtk_hbox_new (FALSE, icon_spacing);
if (icon)
gtk_box_pack_start (GTK_BOX (box), icon, label? FALSE : TRUE, TRUE, 0);
if (label)
gtk_box_pack_end (GTK_BOX (box), label, TRUE, TRUE, 0);
}
else
{
box = gtk_vbox_new (FALSE, icon_spacing);
if (icon)
gtk_box_pack_end (GTK_BOX (box), icon, label ? FALSE : TRUE, TRUE, 0);
if (label)
gtk_box_pack_start (GTK_BOX (box), label, TRUE, TRUE, 0);
}
gtk_container_add (GTK_CONTAINER (button->priv->button), box);
break;
......
......@@ -687,6 +687,33 @@ gtk_tool_item_new (void)
return item;
}
/**
* gtk_tool_item_get_ellipsize_mode:
* @tool_item: a #GtkToolItem:
*
* Returns the ellipsize mode used for @tool_item. Custom subclasses of
* #GtkToolItem should call this function to find out how text should
* be ellipsized.
*
* Return value: a #PangoEllipsizeMode indicating how text in @tool_item
* should be ellipsized.
*
* Since: 2.14
**/
PangoEllipsizeMode
gtk_tool_item_get_ellipsize_mode (GtkToolItem *tool_item)
{
GtkWidget *parent;
g_return_val_if_fail (GTK_IS_TOOL_ITEM (tool_item), GTK_ORIENTATION_HORIZONTAL);
parent = GTK_WIDGET (tool_item)->parent;
if (!parent || !GTK_IS_TOOL_SHELL (parent))
return PANGO_ELLIPSIZE_NONE;
return gtk_tool_shell_get_ellipsize_mode (GTK_TOOL_SHELL (parent));
}
/**
* gtk_tool_item_get_icon_size:
* @tool_item: a #GtkToolItem
......@@ -811,6 +838,85 @@ gtk_tool_item_get_relief_style (GtkToolItem *tool_item)
return gtk_tool_shell_get_relief_style (GTK_TOOL_SHELL (parent));
}
/**
* gtk_tool_item_get_text_alignment:
* @tool_item: a #GtkToolItem:
*
* Returns the text alignment used for @tool_item. Custom subclasses of
* #GtkToolItem should call this function to find out how text should
* be aligned.
*
* Return value: a #gfloat indicating the horizontal text alignment
* used for @tool_item
*
* Since: 2.14
**/
gfloat
gtk_tool_item_get_text_alignment (GtkToolItem *tool_item)
{
GtkWidget *parent;
g_return_val_if_fail (GTK_IS_TOOL_ITEM (tool_item), GTK_ORIENTATION_HORIZONTAL);
parent = GTK_WIDGET (tool_item)->parent;
if (!parent || !GTK_IS_TOOL_SHELL (parent))
return 0.5;
return gtk_tool_shell_get_text_alignment (GTK_TOOL_SHELL (parent));
}
/**
* gtk_tool_item_get_text_orientation:
* @tool_item: a #GtkToolItem:
*
* Returns the text orientation used for @tool_item. Custom subclasses of
* #GtkToolItem should call this function to find out how text should
* be orientated.
*
* Return value: a #GtkOrientation indicating the text orientation
* used for @tool_item
*
* Since: 2.14
**/
GtkOrientation
gtk_tool_item_get_text_orientation (GtkToolItem *tool_item)
{
GtkWidget *parent;
g_return_val_if_fail (GTK_IS_TOOL_ITEM (tool_item), GTK_ORIENTATION_HORIZONTAL);
parent = GTK_WIDGET (tool_item)->parent;
if (!parent || !GTK_IS_TOOL_SHELL (parent))
return GTK_ORIENTATION_HORIZONTAL;
return gtk_tool_shell_get_text_orientation (GTK_TOOL_SHELL (parent));
}
/**
* gtk_tool_item_get_text_size_group:
* @tool_item: a #GtkToolItem:
*
* Returns the size group used for labels in @tool_item. Custom subclasses of
* #GtkToolItem should call this function and use the size group for labels.
*
* Return value: a #GtkSizeGroup
*
* Since: 2.14
**/
GtkSizeGroup *
gtk_tool_item_get_text_size_group (GtkToolItem *tool_item)
{
GtkWidget *parent;
g_return_val_if_fail (GTK_IS_TOOL_ITEM (tool_item), GTK_ORIENTATION_HORIZONTAL);
parent = GTK_WIDGET (tool_item)->parent;
if (!parent || !GTK_IS_TOOL_SHELL (parent))
return NULL;
return gtk_tool_shell_get_text_size_group (GTK_TOOL_SHELL (parent));
}
/**
* gtk_tool_item_set_expand:
* @tool_item: a #GtkToolItem
......
......@@ -30,6 +30,7 @@
#include <gtk/gtkbin.h>
#include <gtk/gtktooltips.h>
#include <gtk/gtkmenuitem.h>
#include <gtk/gtksizegroup.h>
G_BEGIN_DECLS
......@@ -113,10 +114,14 @@ gboolean gtk_tool_item_get_is_important (GtkToolItem *tool_item);
void gtk_tool_item_set_is_important (GtkToolItem *tool_item,
gboolean is_important);
PangoEllipsizeMode gtk_tool_item_get_ellipsize_mode (GtkToolItem *tool_item);
GtkIconSize gtk_tool_item_get_icon_size (GtkToolItem *tool_item);
GtkOrientation gtk_tool_item_get_orientation (GtkToolItem *tool_item);
GtkToolbarStyle gtk_tool_item_get_toolbar_style (GtkToolItem *tool_item);
GtkReliefStyle gtk_tool_item_get_relief_style (GtkToolItem *tool_item);
gfloat gtk_tool_item_get_text_alignment (GtkToolItem *tool_item);
GtkOrientation gtk_tool_item_get_text_orientation (GtkToolItem *tool_item);
GtkSizeGroup * gtk_tool_item_get_text_size_group (GtkToolItem *tool_item);
GtkWidget * gtk_tool_item_retrieve_proxy_menu_item (GtkToolItem *tool_item);
GtkWidget * gtk_tool_item_get_proxy_menu_item (GtkToolItem *tool_item,
......
......@@ -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"
......@@ -29,6 +29,8 @@
#include <gtk/gtkenums.h>
#include <pango/pango.h>
#include <gtk/gtksizegroup.h>
G_BEGIN_DECLS
......@@ -43,11 +45,15 @@ typedef struct _GtkToolShellIface GtkToolShellIface;
/**
* GtkToolShellIface:
* @get_icon_size: mandatory implementation of gtk_tool_shell_get_icon_size().
* @get_orientation: mandatory implementation of gtk_tool_shell_get_orientation().
* @get_style: mandatory implementation of gtk_tool_shell_get_style().
* @get_relief_style: optional implementation of gtk_tool_shell_get_relief_style().
* @rebuild_menu: optional implementation of gtk_tool_shell_rebuild_menu().
* @get_icon_size: mandatory implementation of gtk_tool_shell_get_icon_size().
* @get_orientation: mandatory implementation of gtk_tool_shell_get_orientation().
* @get_style: mandatory implementation of gtk_tool_shell_get_style().
* @get_relief_style: optional implementation of gtk_tool_shell_get_relief_style().
* @rebuild_menu: optional implementation of gtk_tool_shell_rebuild_menu().
* @get_text_orientation: optional implementation of gtk_tool_shell_get_text_orientation().
* @get_text_alignment: optional implementation of gtk_tool_shell_get_text_alignment().
* @get_ellipsize_mode: optional implementation of gtk_tool_shell_get_ellipsize_mode().
* @get_text_size_group: optional implementation of gtk_tool_shell_get_text_size_group().
*
* Virtual function table for the #GtkToolShell interface.
*/
......@@ -57,20 +63,28 @@ struct _GtkToolShellIface
GTypeInterface g_iface;
/*< public >*/
GtkIconSize (*get_icon_size) (GtkToolShell *shell);
GtkOrientation (*get_orientation) (GtkToolShell *shell);
GtkToolbarStyle (*get_style) (GtkToolShell *shell);
GtkReliefStyle (*get_relief_style) (GtkToolShell *shell);
void (*rebuild_menu) (GtkToolShell *shell);
GtkIconSize (*get_icon_size) (GtkToolShell *shell);
GtkOrientation (*get_orientation) (GtkToolShell *shell);
GtkToolbarStyle (*get_style) (GtkToolShell *shell);
GtkReliefStyle (*get_relief_style) (GtkToolShell *shell);
void (*rebuild_menu) (GtkToolShell *shell);
GtkOrientation (*get_text_orientation) (GtkToolShell *shell);
gfloat (*get_text_alignment) (GtkToolShell *shell);
PangoEllipsizeMode (*get_ellipsize_mode) (GtkToolShell *shell);
GtkSizeGroup * (*get_text_size_group) (GtkToolShell *shell);
};
GType gtk_tool_shell_get_type (void) G_GNUC_CONST;
GType gtk_tool_shell_get_type (void) G_GNUC_CONST;
GtkIconSize gtk_tool_shell_get_icon_size (GtkToolShell *shell);
GtkOrientation gtk_tool_shell_get_orientation (GtkToolShell *shell);
GtkToolbarStyle gtk_tool_shell_get_style (GtkToolShell *shell);
GtkReliefStyle gtk_tool_shell_get_relief_style (GtkToolShell *shell);
void gtk_tool_shell_rebuild_menu (GtkToolShell *shell);
GtkIconSize gtk_tool_shell_get_icon_size (GtkToolShell *shell);
GtkOrientation gtk_tool_shell_get_orientation (GtkToolShell *shell);
GtkToolbarStyle gtk_tool_shell_get_style (GtkToolShell *shell);
GtkReliefStyle gtk_tool_shell_get_relief_style (GtkToolShell *shell);
void gtk_tool_shell_rebuild_menu (GtkToolShell *shell);
GtkOrientation gtk_tool_shell_get_text_orientation (GtkToolShell *shell);
gfloat gtk_tool_shell_get_text_alignment (GtkToolShell *shell);
PangoEllipsizeMode gtk_tool_shell_get_ellipsize_mode (GtkToolShell *shell);
GtkSizeGroup * gtk_tool_shell_get_text_size_group (GtkToolShell *shell);
G_END_DECLS
......
This diff is collapsed.
/* GtkToolPalette -- A tool palette with categories and DnD support
* Copyright (C) 2008 Openismus GmbH
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* Authors:
* Mathias Hasselmann
*/
#ifndef __GTK_TOOL_ITEM_GROUP_H__
#define __GTK_TOOL_ITEM_GROUP_H__
#include <gtk/gtkcontainer.h>
#include <gtk/gtktoolitem.h>
G_BEGIN_DECLS
#define GTK_TYPE_TOOL_ITEM_GROUP (gtk_tool_item_group_get_type())
#define GTK_TOOL_ITEM_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST(obj, GTK_TYPE_TOOL_ITEM_GROUP, GtkToolItemGroup))
#define GTK_TOOL_ITEM_GROUP_CLASS(cls) (G_TYPE_CHECK_CLASS_CAST(cls, GTK_TYPE_TOOL_ITEM_GROUP, GtkToolItemGroupClass))
#define GTK_IS_TOOL_ITEM_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE(obj, GTK_TYPE_TOOL_ITEM_GROUP))
#define GTK_IS_TOOL_ITEM_GROUP_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE(obj, GTK_TYPE_TOOL_ITEM_GROUP))
#define GTK_TOOL_ITEM_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GTK_TYPE_TOOL_ITEM_GROUP, GtkToolItemGroupClass))
typedef struct _GtkToolItemGroup GtkToolItemGroup;
typedef struct _GtkToolItemGroupClass GtkToolItemGroupClass;
typedef struct _GtkToolItemGroupPrivate GtkToolItemGroupPrivate;
/**
* GtkToolItemGroup:
*
* This should not be accessed directly. Use the accessor functions below.
*/
struct _GtkToolItemGroup
{
GtkContainer parent_instance;
GtkToolItemGroupPrivate *priv;
};
struct _GtkToolItemGroupClass
{
GtkContainerClass parent_class;
};
GType gtk_tool_item_group_get_type (void) G_GNUC_CONST;
GtkWidget* gtk_tool_item_group_new (const gchar *name);
void gtk_tool_item_group_set_name (GtkToolItemGroup *group,
const gchar *name);
void gtk_tool_item_group_set_collapsed (GtkToolItemGroup *group,
gboolean collapsed);
void gtk_tool_item_group_set_ellipsize (GtkToolItemGroup *group,
PangoEllipsizeMode ellipsize);
void gtk_tool_item_group_set_header_relief (GtkToolItemGroup *group,
GtkReliefStyle style);
G_CONST_RETURN gchar* gtk_tool_item_group_get_name (GtkToolItemGroup *group);
gboolean gtk_tool_item_group_get_collapsed (GtkToolItemGroup *group);
PangoEllipsizeMode gtk_tool_item_group_get_ellipsize (GtkToolItemGroup *group);
GtkReliefStyle gtk_tool_item_group_get_header_relief (GtkToolItemGroup *group);
void gtk_tool_item_group_insert (GtkToolItemGroup *group,
GtkToolItem *item,
gint position);
void gtk_tool_item_group_set_item_position (GtkToolItemGroup *group,
GtkToolItem *item,
gint position);
gint gtk_tool_item_group_get_item_position (GtkToolItemGroup *group,
GtkToolItem *item);
guint gtk_tool_item_group_get_n_items (GtkToolItemGroup *group);
GtkToolItem* gtk_tool_item_group_get_nth_item (GtkToolItemGroup *group,
guint index);
GtkToolItem* gtk_tool_item_group_get_drop_item (GtkToolItemGroup *group,
gint x,
gint y);
G_END_DECLS
#endif /* __GTK_TOOL_ITEM_GROUP_H__ */
/* GtkToolPalette -- A tool palette with categories and DnD support
* Copyright (C) 2008 Openismus GmbH
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* Authors:
* Mathias Hasselmann
*/
#ifndef __GTK_TOOL_ITEM_GROUP_H__
#define __GTK_TOOL_ITEM_GROUP_H__
#include <gtk/gtkcontainer.h>
#include <gtk/gtktoolitem.h>
G_BEGIN_DECLS
#define GTK_TYPE_TOOL_ITEM_GROUP (gtk_tool_item_group_get_type())
#define GTK_TOOL_ITEM_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST(obj, GTK_TYPE_TOOL_ITEM_GROUP, GtkToolItemGroup))
#define GTK_TOOL_ITEM_GROUP_CLASS(cls) (G_TYPE_CHECK_CLASS_CAST(cls, GTK_TYPE_TOOL_ITEM_GROUP, GtkToolItemGroupClass))
#define GTK_IS_TOOL_ITEM_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE(obj, GTK_TYPE_TOOL_ITEM_GROUP))
#define GTK_IS_TOOL_ITEM_GROUP_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE(obj, GTK_TYPE_TOOL_ITEM_GROUP))
#define GTK_TOOL_ITEM_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GTK_TYPE_TOOL_ITEM_GROUP, GtkToolItemGroupClass))
typedef struct _GtkToolItemGroup GtkToolItemGroup;
typedef struct _GtkToolItemGroupClass GtkToolItemGroupClass;
typedef struct _GtkToolItemGroupPrivate GtkToolItemGroupPrivate;
/**
* GtkToolItemGroup:
*
* This should not be accessed directly. Use the accessor functions below.
*/
struct _GtkToolItemGroup
{
GtkContainer parent_instance;
GtkToolItemGroupPrivate *priv;
};
struct _GtkToolItemGroupClass
{
GtkContainerClass parent_class;
};
GType gtk_tool_item_group_get_type (void) G_GNUC_CONST;
GtkWidget* gtk_tool_item_group_new (const gchar *name);
void gtk_tool_item_group_set_name (GtkToolItemGroup *group,
const gchar *name);
void gtk_tool_item_group_set_collapsed (GtkToolItemGroup *group,
gboolean collapsed);
void gtk_tool_item_group_set_ellipsize (GtkToolItemGroup *group,
PangoEllipsizeMode ellipsize);
void gtk_tool_item_group_set_header_relief (GtkToolItemGroup *group,
GtkReliefStyle style);
G_CONST_RETURN gchar* gtk_tool_item_group_get_name (GtkToolItemGroup *group);
gboolean gtk_tool_item_group_get_collapsed (GtkToolItemGroup *group);
PangoEllipsizeMode gtk_tool_item_group_get_ellipsize (GtkToolItemGroup *group);
GtkReliefStyle gtk_tool_item_group_get_header_relief (GtkToolItemGroup *group);
void gtk_tool_item_group_insert (GtkToolItemGroup *group,
GtkToolItem *item,
gint position);
void gtk_tool_item_group_set_item_position (GtkToolItemGroup *group,
GtkToolItem *item,
gint position);
gint gtk_tool_item_group_get_item_position (GtkToolItemGroup *group,
GtkToolItem *item);
guint gtk_tool_item_group_get_n_items (GtkToolItemGroup *group);
GtkToolItem* gtk_tool_item_group_get_nth_item (GtkToolItemGroup *group,
guint index);
GtkToolItem* gtk_tool_item_group_get_drop_item (GtkToolItemGroup *group,
gint x,
gint y);
G_END_DECLS
#endif /* __GTK_TOOL_ITEM_GROUP_H__ */
/* GtkToolPalette -- A tool palette with categories and DnD support
* Copyright (C) 2008 Openismus GmbH
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* Authors:
* Mathias Hasselmann
*/
#ifndef __GTK_TOOL_ITEM_GROUP_H__
#define __GTK_TOOL_ITEM_GROUP_H__
#include <gtk/gtkcontainer.h>
#include <gtk/gtktoolitem.h>
G_BEGIN_DECLS
#define GTK_TYPE_TOOL_ITEM_GROUP (gtk_tool_item_group_get_type())
#define GTK_TOOL_ITEM_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST(obj, GTK_TYPE_TOOL_ITEM_GROUP, GtkToolItemGroup))
#define GTK_TOOL_ITEM_GROUP_CLASS(cls) (G_TYPE_CHECK_CLASS_CAST(cls, GTK_TYPE_TOOL_ITEM_GROUP, GtkToolItemGroupClass))
#define GTK_IS_TOOL_ITEM_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE(obj, GTK_TYPE_TOOL_ITEM_GROUP))
#define GTK_IS_TOOL_ITEM_GROUP_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE(obj, GTK_TYPE_TOOL_ITEM_GROUP))
#define GTK_TOOL_ITEM_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GTK_TYPE_TOOL_ITEM_GROUP, GtkToolItemGroupClass))
typedef struct _GtkToolItemGroup GtkToolItemGroup;
typedef struct _GtkToolItemGroupClass GtkToolItemGroupClass;
typedef struct _GtkToolItemGroupPrivate GtkToolItemGroupPrivate;
/**
* GtkToolItemGroup:
*
* This should not be accessed directly. Use the accessor functions below.
*/
struct _GtkToolItemGroup
{
GtkContainer parent_instance;
GtkToolItemGroupPrivate *priv;
};
struct _GtkToolItemGroupClass
{
GtkContainerClass parent_class;
};
GType gtk_tool_item_group_get_type (void) G_GNUC_CONST;
GtkWidget* gtk_tool_item_group_new (const gchar *name);
void gtk_tool_item_group_set_name (GtkToolItemGroup *group,
const gchar *name);
void gtk_tool_item_group_set_collapsed (GtkToolItemGroup *group,
gboolean collapsed);
void gtk_tool_item_group_set_ellipsize (GtkToolItemGroup *group,
PangoEllipsizeMode ellipsize);
void gtk_tool_item_group_set_header_relief (GtkToolItemGroup *group,
GtkReliefStyle style);