Fix up docs, and set up the aliasing machinery

This commit is contained in:
Matthias Clasen 2009-11-26 23:52:20 -05:00
parent 7f9b55710a
commit 837775af7b
9 changed files with 400 additions and 282 deletions

View File

@ -4198,6 +4198,7 @@ gtk_tool_shell_get_style
gtk_tool_shell_get_text_alignment gtk_tool_shell_get_text_alignment
gtk_tool_shell_get_text_orientation gtk_tool_shell_get_text_orientation
gtk_tool_shell_rebuild_menu gtk_tool_shell_rebuild_menu
gtk_tool_shell_get_text_size_group
<SUBSECTION Standard> <SUBSECTION Standard>
GTK_IS_TOOL_SHELL GTK_IS_TOOL_SHELL
@ -4460,42 +4461,6 @@ GTK_TOOLTIPS_GET_CLASS
gtk_tooltips_get_type gtk_tooltips_get_type
</SECTION> </SECTION>
<SECTION>
<FILE>gtktoolpalette</FILE>
<TITLE>GtkToolPalette</TITLE>
GtkToolPalette
gtk_tool_palette_new
gtk_tool_palette_get_exclusive
gtk_tool_palette_set_exclusive
gtk_tool_palette_get_expand
gtk_tool_palette_set_expand
gtk_tool_palette_get_group_position
gtk_tool_palette_set_group_position
gtk_tool_palette_get_icon_size
gtk_tool_palette_set_icon_size
gtk_tool_palette_get_style
gtk_tool_palette_set_style
gtk_tool_palette_unset_style
gtk_tool_palette_add_drag_dest
gtk_tool_palette_get_drag_item
gtk_tool_palette_get_drag_target_group
gtk_tool_palette_get_drag_target_item
gtk_tool_palette_get_drop_group
gtk_tool_palette_get_drop_item
gtk_tool_palette_set_drag_source
<SUBSECTION Standard>
GtkToolPaletteClass
GTK_TOOL_PALETTE
GTK_IS_TOOL_PALETTE
GTK_TYPE_TOOL_PALETTE
GTK_TOOL_PALETTE_CLASS
GTK_IS_TOOL_PALETTE_CLASS
GTK_TOOL_PALETTE_GET_CLASS
<SUBSECTION Private>
gtk_tool_palette_get_type
GtkToolPalettePrivate
</SECTION>
<SECTION> <SECTION>
<FILE>gtktoolitemgroup</FILE> <FILE>gtktoolitemgroup</FILE>
<TITLE>GtkToolItemGroup</TITLE> <TITLE>GtkToolItemGroup</TITLE>
@ -4508,6 +4473,7 @@ gtk_tool_item_group_get_n_items
gtk_tool_item_group_get_label gtk_tool_item_group_get_label
gtk_tool_item_group_get_label_widget gtk_tool_item_group_get_label_widget
gtk_tool_item_group_get_nth_item gtk_tool_item_group_get_nth_item
gtk_tool_item_group_get_header_relief
gtk_tool_item_group_insert gtk_tool_item_group_insert
gtk_tool_item_group_new gtk_tool_item_group_new
gtk_tool_item_group_set_collapsed gtk_tool_item_group_set_collapsed
@ -4515,6 +4481,7 @@ gtk_tool_item_group_set_ellipsize
gtk_tool_item_group_set_item_position gtk_tool_item_group_set_item_position
gtk_tool_item_group_set_label gtk_tool_item_group_set_label
gtk_tool_item_group_set_label_widget gtk_tool_item_group_set_label_widget
gtk_tool_item_group_set_header_relief
<SUBSECTION Standard> <SUBSECTION Standard>
GtkToolItemGroupClass GtkToolItemGroupClass
GTK_TOOL_ITEM_GROUP GTK_TOOL_ITEM_GROUP
@ -4528,7 +4495,7 @@ gtk_tool_item_group_get_type
</SECTION> </SECTION>
<SECTION> <SECTION>
<FILE>GtkToolPalette</FILE> <FILE>gtktoolpalette</FILE>
<TITLE>GtkToolPalette</TITLE> <TITLE>GtkToolPalette</TITLE>
GtkToolPalette GtkToolPalette
gtk_tool_palette_new gtk_tool_palette_new
@ -4541,17 +4508,19 @@ gtk_tool_palette_set_group_position
gtk_tool_palette_get_icon_size gtk_tool_palette_get_icon_size
gtk_tool_palette_set_icon_size gtk_tool_palette_set_icon_size
gtk_tool_palette_unset_icon_size gtk_tool_palette_unset_icon_size
gtk_tool_palette_get_orientation
gtk_tool_palette_set_orientation
gtk_tool_palette_get_style gtk_tool_palette_get_style
gtk_tool_palette_set_style gtk_tool_palette_set_style
gtk_tool_palette_unset_style
gtk_tool_palette_add_drag_dest gtk_tool_palette_add_drag_dest
gtk_tool_palette_get_drag_item gtk_tool_palette_get_drag_item
gtk_tool_palette_get_drag_target_group gtk_tool_palette_get_drag_target_group
gtk_tool_palette_get_drag_target_item gtk_tool_palette_get_drag_target_item
gtk_tool_palette_get_drop_group gtk_tool_palette_get_drop_group
gtk_tool_palette_get_drop_item gtk_tool_palette_get_drop_item
GtkToolPaletteDragTargets
gtk_tool_palette_set_drag_source gtk_tool_palette_set_drag_source
gtk_tool_palette_get_hadjustment
gtk_tool_palette_get_vadjustment
<SUBSECTION Standard> <SUBSECTION Standard>
GtkToolPaletteClass GtkToolPaletteClass
GTK_TOOL_PALETTE GTK_TOOL_PALETTE

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

View File

@ -729,6 +729,34 @@ create_toolbar (void)
return new_widget_info ("toolbar", widget, SMALL); return new_widget_info ("toolbar", widget, SMALL);
} }
static WidgetInfo *
create_toolpalette (void)
{
GtkWidget *widget, *group;
GtkToolItem *item;
widget = gtk_tool_palette_new ();
group = gtk_tool_item_group_new ("Tools");
gtk_container_add (GTK_CONTAINER (widget), group);
item = gtk_tool_button_new_from_stock (GTK_STOCK_ABOUT);
gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1);
item = gtk_tool_button_new_from_stock (GTK_STOCK_FILE);
gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1);
item = gtk_tool_button_new_from_stock (GTK_STOCK_CONNECT);
gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1);
group = gtk_tool_item_group_new ("More tools");
gtk_container_add (GTK_CONTAINER (widget), group);
item = gtk_tool_button_new_from_stock (GTK_STOCK_CUT);
gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1);
item = gtk_tool_button_new_from_stock (GTK_STOCK_EXECUTE);
gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1);
item = gtk_tool_button_new_from_stock (GTK_STOCK_CANCEL);
gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1);
return new_widget_info ("toolpalette", widget, MEDIUM);
}
static WidgetInfo * static WidgetInfo *
create_menubar (void) create_menubar (void)
{ {
@ -1005,6 +1033,7 @@ get_all_widgets (void)
{ {
GList *retval = NULL; GList *retval = NULL;
retval = g_list_prepend (retval, create_toolpalette ());
retval = g_list_prepend (retval, create_spinner ()); retval = g_list_prepend (retval, create_spinner ());
retval = g_list_prepend (retval, create_about_dialog ()); retval = g_list_prepend (retval, create_about_dialog ());
retval = g_list_prepend (retval, create_accel_label ()); retval = g_list_prepend (retval, create_accel_label ());

View File

@ -4442,6 +4442,56 @@ gtk_tool_item_toolbar_reconfigured
#endif #endif
#endif #endif
#if IN_HEADER(__GTK_TOOL_ITEM_GROUP_H__)
#if IN_FILE(__GTK_TOOL_ITEM_GROUP_C__)
gtk_tool_item_group_get_type G_GNUC_CONST
gtk_tool_item_group_new
gtk_tool_item_group_set_label
gtk_tool_item_group_set_label_widget
gtk_tool_item_group_set_collapsed
gtk_tool_item_group_set_ellipsize
gtk_tool_item_group_set_header_relief
gtk_tool_item_group_get_label
gtk_tool_item_group_get_label_widget
gtk_tool_item_group_get_ellipsize
gtk_tool_item_group_get_header_relief
gtk_tool_item_group_insert
gtk_tool_item_group_set_item_position
gtk_tool_item_group_get_item_position
gtk_tool_item_group_get_n_items
gtk_tool_item_group_get_nth_item
gtk_tool_item_group_get_drop_item
#endif
#endif
#if IN_HEADER(__GTK_TOOL_PALETTE_H__)
#if IN_FILE(__GTK_TOOL_PALETTE_C__)
gtk_tool_palette_get_type G_GNUC_CONST
gtk_tool_palette_new
gtk_tool_palette_set_group_position
gtk_tool_palette_set_exclusive
gtk_tool_palette_set_expand
gtk_tool_palette_get_group_position
gtk_tool_palette_get_exclusive
gtk_tool_palette_get_expand
gtk_tool_palette_set_icon_size
gtk_tool_palette_unset_icon_size
gtk_tool_palette_set_style
gtk_tool_palette_unset_style
gtk_tool_palette_get_icon_size
gtk_tool_palette_get_style
gtk_tool_palette_get_drop_item
gtk_tool_palette_get_drop_group
gtk_tool_palette_get_drag_item
gtk_tool_palette_set_drag_source
gtk_tool_palette_add_drag_dest
gtk_tool_palette_get_hadjustment
gtk_tool_palette_get_vadjustment
gtk_tool_palette_get_drag_target_item G_GNUC_CONST
gtk_tool_palette_get_drag_target_group G_GNUC_CONST
#endif
#endif
#if IN_HEADER(__GTK_TOOLTIP_H__) #if IN_HEADER(__GTK_TOOLTIP_H__)
#if IN_FILE(__GTK_TOOLTIP_C__) #if IN_FILE(__GTK_TOOLTIP_C__)
gtk_tooltip_get_type G_GNUC_CONST gtk_tooltip_get_type G_GNUC_CONST

View File

@ -20,13 +20,16 @@
* Jan Arne Petersen * Jan Arne Petersen
*/ */
#include "config.h"
#include "gtktoolpaletteprivate.h" #include "gtktoolpaletteprivate.h"
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <math.h> #include <math.h>
#include <string.h> #include <string.h>
#include "gtkprivate.h"
#define P_(msgid) (msgid) #include "gtkintl.h"
#include "gtkalias.h"
#define ANIMATION_TIMEOUT 50 #define ANIMATION_TIMEOUT 50
#define ANIMATION_DURATION (ANIMATION_TIMEOUT * 4) #define ANIMATION_DURATION (ANIMATION_TIMEOUT * 4)
@ -39,12 +42,13 @@
#define DEFAULT_ELLIPSIZE PANGO_ELLIPSIZE_NONE #define DEFAULT_ELLIPSIZE PANGO_ELLIPSIZE_NONE
/** /**
* SECTION:GtkToolItemGroup * SECTION:gtktoolitemgroup
* @short_description: A sub container used in a tool palette * @Short_description: A sub container used in a tool palette
* @include: gtktoolitemgroup.h * @Title: GtkToolItemGroup
* *
* An #GtkToolItemGroup is used together with #GtkToolPalette to add #GtkToolItem<!-- -->s to a palette like container * A #GtkToolItemGroup is used together with #GtkToolPalette to add
* with different categories and drag and drop support. * #GtkToolItem<!-- -->s to a palette like container with different
* categories and drag and drop support.
* *
* Since: 2.20 * Since: 2.20
*/ */
@ -427,17 +431,22 @@ gtk_tool_item_group_set_property (GObject *object,
case PROP_LABEL: case PROP_LABEL:
gtk_tool_item_group_set_label (group, g_value_get_string (value)); gtk_tool_item_group_set_label (group, g_value_get_string (value));
break; break;
case PROP_LABEL_WIDGET: case PROP_LABEL_WIDGET:
gtk_tool_item_group_set_label_widget (group, g_value_get_object (value)); gtk_tool_item_group_set_label_widget (group, g_value_get_object (value));
case PROP_COLLAPSED: case PROP_COLLAPSED:
gtk_tool_item_group_set_collapsed (group, g_value_get_boolean (value)); gtk_tool_item_group_set_collapsed (group, g_value_get_boolean (value));
break; break;
case PROP_ELLIPSIZE: case PROP_ELLIPSIZE:
gtk_tool_item_group_set_ellipsize (group, g_value_get_enum (value)); gtk_tool_item_group_set_ellipsize (group, g_value_get_enum (value));
break; break;
case PROP_RELIEF: case PROP_RELIEF:
gtk_tool_item_group_set_header_relief (group, g_value_get_enum(value)); gtk_tool_item_group_set_header_relief (group, g_value_get_enum(value));
break; break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break; break;
@ -828,8 +837,8 @@ gtk_tool_item_group_real_size_query (GtkWidget *widget,
} }
static void static void
gtk_tool_item_group_real_size_allocate (GtkWidget *widget, gtk_tool_item_group_real_size_allocate (GtkWidget *widget,
GtkAllocation *allocation) GtkAllocation *allocation)
{ {
const gint border_width = GTK_CONTAINER (widget)->border_width; const gint border_width = GTK_CONTAINER (widget)->border_width;
GtkToolItemGroup *group = GTK_TOOL_ITEM_GROUP (widget); GtkToolItemGroup *group = GTK_TOOL_ITEM_GROUP (widget);
@ -1524,40 +1533,35 @@ gtk_tool_item_group_class_init (GtkToolItemGroupClass *cls)
P_("Label"), P_("Label"),
P_("The human-readable title of this item group"), P_("The human-readable title of this item group"),
DEFAULT_LABEL, DEFAULT_LABEL,
G_PARAM_READWRITE | G_PARAM_STATIC_NAME | GTK_PARAM_READWRITE));
G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
g_object_class_install_property (oclass, PROP_LABEL_WIDGET, g_object_class_install_property (oclass, PROP_LABEL_WIDGET,
g_param_spec_object ("label-widget", g_param_spec_object ("label-widget",
P_("Label widget"), P_("Label widget"),
P_("A widget to display in place of the usual label"), P_("A widget to display in place of the usual label"),
GTK_TYPE_WIDGET, GTK_TYPE_WIDGET,
G_PARAM_READWRITE | G_PARAM_STATIC_NAME | GTK_PARAM_READWRITE));
G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
g_object_class_install_property (oclass, PROP_COLLAPSED, g_object_class_install_property (oclass, PROP_COLLAPSED,
g_param_spec_boolean ("collapsed", g_param_spec_boolean ("collapsed",
P_("Collapsed"), P_("Collapsed"),
P_("Wether the group has been collapsed and items are hidden"), P_("Wether the group has been collapsed and items are hidden"),
DEFAULT_COLLAPSED, DEFAULT_COLLAPSED,
G_PARAM_READWRITE | G_PARAM_STATIC_NAME | GTK_PARAM_READWRITE));
G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
g_object_class_install_property (oclass, PROP_ELLIPSIZE, g_object_class_install_property (oclass, PROP_ELLIPSIZE,
g_param_spec_enum ("ellipsize", g_param_spec_enum ("ellipsize",
P_("ellipsize"), P_("ellipsize"),
P_("Ellipsize for item group headers"), P_("Ellipsize for item group headers"),
PANGO_TYPE_ELLIPSIZE_MODE, DEFAULT_ELLIPSIZE, PANGO_TYPE_ELLIPSIZE_MODE, DEFAULT_ELLIPSIZE,
G_PARAM_READWRITE | G_PARAM_STATIC_NAME | GTK_PARAM_READWRITE));
G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
g_object_class_install_property (oclass, PROP_RELIEF, g_object_class_install_property (oclass, PROP_RELIEF,
g_param_spec_enum ("header-relief", g_param_spec_enum ("header-relief",
P_("Header Relief"), P_("Header Relief"),
P_("Relief of the group header button"), P_("Relief of the group header button"),
GTK_TYPE_RELIEF_STYLE, GTK_RELIEF_NORMAL, GTK_TYPE_RELIEF_STYLE, GTK_RELIEF_NORMAL,
G_PARAM_READWRITE | G_PARAM_STATIC_NAME | GTK_PARAM_READWRITE));
G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
gtk_widget_class_install_style_property (wclass, gtk_widget_class_install_style_property (wclass,
g_param_spec_int ("expander-size", g_param_spec_int ("expander-size",
@ -1566,8 +1570,7 @@ gtk_tool_item_group_class_init (GtkToolItemGroupClass *cls)
0, 0,
G_MAXINT, G_MAXINT,
DEFAULT_EXPANDER_SIZE, DEFAULT_EXPANDER_SIZE,
G_PARAM_READABLE | G_PARAM_STATIC_NAME | GTK_PARAM_READABLE));
G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
gtk_widget_class_install_style_property (wclass, gtk_widget_class_install_style_property (wclass,
g_param_spec_int ("header-spacing", g_param_spec_int ("header-spacing",
@ -1576,40 +1579,35 @@ gtk_tool_item_group_class_init (GtkToolItemGroupClass *cls)
0, 0,
G_MAXINT, G_MAXINT,
DEFAULT_HEADER_SPACING, DEFAULT_HEADER_SPACING,
G_PARAM_READABLE | G_PARAM_STATIC_NAME | GTK_PARAM_READABLE));
G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
gtk_container_class_install_child_property (cclass, CHILD_PROP_HOMOGENEOUS, gtk_container_class_install_child_property (cclass, CHILD_PROP_HOMOGENEOUS,
g_param_spec_boolean ("homogeneous", g_param_spec_boolean ("homogeneous",
P_("Homogeneous"), P_("Homogeneous"),
P_("Whether the item should be the same size as other homogeneous items"), P_("Whether the item should be the same size as other homogeneous items"),
TRUE, TRUE,
G_PARAM_READWRITE | G_PARAM_STATIC_NAME | GTK_PARAM_READWRITE));
G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
gtk_container_class_install_child_property (cclass, CHILD_PROP_EXPAND, gtk_container_class_install_child_property (cclass, CHILD_PROP_EXPAND,
g_param_spec_boolean ("expand", g_param_spec_boolean ("expand",
P_("Expand"), P_("Expand"),
P_("Whether the item should receive extra space when the toolbar grows"), P_("Whether the item should receive extra space when the group grows"),
FALSE, FALSE,
G_PARAM_READWRITE | G_PARAM_STATIC_NAME | GTK_PARAM_READWRITE));
G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
gtk_container_class_install_child_property (cclass, CHILD_PROP_FILL, gtk_container_class_install_child_property (cclass, CHILD_PROP_FILL,
g_param_spec_boolean ("fill", g_param_spec_boolean ("fill",
P_("Fill"), P_("Fill"),
P_("Whether the item should fill the avaiable space"), P_("Whether the item should fill the available space"),
TRUE, TRUE,
G_PARAM_READWRITE | G_PARAM_STATIC_NAME | GTK_PARAM_READWRITE));
G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
gtk_container_class_install_child_property (cclass, CHILD_PROP_NEW_ROW, gtk_container_class_install_child_property (cclass, CHILD_PROP_NEW_ROW,
g_param_spec_boolean ("new-row", g_param_spec_boolean ("new-row",
P_("New Row"), P_("New Row"),
P_("Whether the item should start a new row"), P_("Whether the item should start a new row"),
FALSE, FALSE,
G_PARAM_READWRITE | G_PARAM_STATIC_NAME | GTK_PARAM_READWRITE));
G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
gtk_container_class_install_child_property (cclass, CHILD_PROP_POSITION, gtk_container_class_install_child_property (cclass, CHILD_PROP_POSITION,
g_param_spec_int ("position", g_param_spec_int ("position",
@ -1618,15 +1616,14 @@ gtk_tool_item_group_class_init (GtkToolItemGroupClass *cls)
0, 0,
G_MAXINT, G_MAXINT,
0, 0,
G_PARAM_READWRITE | G_PARAM_STATIC_NAME | GTK_PARAM_READWRITE));
G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
g_type_class_add_private (cls, sizeof (GtkToolItemGroupPrivate)); g_type_class_add_private (cls, sizeof (GtkToolItemGroupPrivate));
} }
/** /**
* gtk_tool_item_group_new: * gtk_tool_item_group_new:
* @label: the label of the new group. * @label: the label of the new group
* *
* Creates a new tool item group with label @label. * Creates a new tool item group with label @label.
* *
@ -1637,14 +1634,13 @@ gtk_tool_item_group_class_init (GtkToolItemGroupClass *cls)
GtkWidget* GtkWidget*
gtk_tool_item_group_new (const gchar *label) gtk_tool_item_group_new (const gchar *label)
{ {
return g_object_new (GTK_TYPE_TOOL_ITEM_GROUP, "label", return g_object_new (GTK_TYPE_TOOL_ITEM_GROUP, "label", label, NULL);
label, NULL);
} }
/** /**
* gtk_tool_item_group_set_label: * gtk_tool_item_group_set_label:
* @group: an #GtkToolItemGroup. * @group: a #GtkToolItemGroup
* @label: the new human-readable label of of the group. * @label: the new human-readable label of of the group
* *
* Sets the label of the tool item group. The label is displayed in the header * Sets the label of the tool item group. The label is displayed in the header
* of the group. * of the group.
@ -1672,11 +1668,12 @@ gtk_tool_item_group_set_label (GtkToolItemGroup *group,
/** /**
* gtk_tool_item_group_set_label_widget: * gtk_tool_item_group_set_label_widget:
* @group: an #GtkToolItemGroup. * @group: a #GtkToolItemGroup
* @widget: the new human-readable label of of the group. * @label_widget: the widget to be displayed in place of the usual label
* *
* Sets the label of the tool item group. The label is displayed in the header * Sets the label of the tool item group.
* of the group. * The label widget is displayed in the header of the group, in place
* of the usual label.
* *
* Since: 2.20 * Since: 2.20
*/ */
@ -1727,26 +1724,28 @@ gtk_tool_item_group_set_label_widget (GtkToolItemGroup *group,
/** /**
* gtk_tool_item_group_header_relief: * gtk_tool_item_group_header_relief:
* @group: an #GtkToolItemGroup. * @group: a #GtkToolItemGroup
* @style: The GtkReliefStyle * @style: the #GtkReliefStyle
* *
* Set the button relief of the group header. See #gtk_button_set_relief for * Set the button relief of the group header.
* details * See gtk_button_set_relief() for details.
* *
* Since: 2.20 * Since: 2.20
*/ */
void void
gtk_tool_item_group_set_header_relief (GtkToolItemGroup *group, gtk_tool_item_group_set_header_relief (GtkToolItemGroup *group,
GtkReliefStyle style) GtkReliefStyle style)
{ {
g_return_if_fail (GTK_IS_TOOL_ITEM_GROUP (group)); g_return_if_fail (GTK_IS_TOOL_ITEM_GROUP (group));
gtk_button_set_relief (GTK_BUTTON(group->priv->header), style);
gtk_button_set_relief (GTK_BUTTON (group->priv->header), style);
} }
static gint64 static gint64
gtk_tool_item_group_get_animation_timestamp (GtkToolItemGroup *group) gtk_tool_item_group_get_animation_timestamp (GtkToolItemGroup *group)
{ {
GTimeVal now; GTimeVal now;
g_source_get_current_time (group->priv->animation_timeout, &now); g_source_get_current_time (group->priv->animation_timeout, &now);
return (now.tv_sec * G_USEC_PER_SEC + now.tv_usec - group->priv->animation_start) / 1000; return (now.tv_sec * G_USEC_PER_SEC + now.tv_usec - group->priv->animation_start) / 1000;
} }
@ -1802,7 +1801,7 @@ gtk_tool_item_group_animation_cb (gpointer data)
gint64 timestamp = gtk_tool_item_group_get_animation_timestamp (group); gint64 timestamp = gtk_tool_item_group_get_animation_timestamp (group);
gboolean retval; gboolean retval;
GDK_THREADS_ENTER(); GDK_THREADS_ENTER ();
/* Enque this early to reduce number of expose events. */ /* Enque this early to reduce number of expose events. */
gtk_widget_queue_resize_no_redraw (GTK_WIDGET (group)); gtk_widget_queue_resize_no_redraw (GTK_WIDGET (group));
@ -1831,15 +1830,15 @@ gtk_tool_item_group_animation_cb (gpointer data)
retval = (priv->animation_timeout != NULL); retval = (priv->animation_timeout != NULL);
GDK_THREADS_LEAVE(); GDK_THREADS_LEAVE ();
return retval; return retval;
} }
/** /**
* gtk_tool_item_group_set_collapsed: * gtk_tool_item_group_set_collapsed:
* @group: an #GtkToolItemGroup. * @group: a #GtkToolItemGroup
* @collapsed: whether the @group should be collapsed or expanded. * @collapsed: whether the @group should be collapsed or expanded
* *
* Sets whether the @group should be collapsed or expanded. * Sets whether the @group should be collapsed or expanded.
* *
@ -1893,8 +1892,8 @@ gtk_tool_item_group_set_collapsed (GtkToolItemGroup *group,
/** /**
* gtk_tool_item_group_set_ellipsize: * gtk_tool_item_group_set_ellipsize:
* @group: an #GtkToolItemGroup. * @group: a #GtkToolItemGroup
* @ellipsize: the #PangoEllipsizeMode labels in @group should use. * @ellipsize: the #PangoEllipsizeMode labels in @group should use
* *
* Sets the ellipsization mode which should be used by labels in @group. * Sets the ellipsization mode which should be used by labels in @group.
* *
@ -1917,12 +1916,13 @@ gtk_tool_item_group_set_ellipsize (GtkToolItemGroup *group,
/** /**
* gtk_tool_item_group_get_label: * gtk_tool_item_group_get_label:
* @group: an #GtkToolItemGroup. * @group: a #GtkToolItemGroup
* *
* Gets the label of @group. * Gets the label of @group.
* *
* Returns: the label of @group. The label is an internal string of @group and must not be modified. * Returns: the label of @group. The label is an internal string of @group
* Note that NULL is returned if a custom label has been set with gtk_tool_item_group_set_label_widget() * and must not be modified. Note that %NULL is returned if a custom
* label has been set with gtk_tool_item_group_set_label_widget()
* *
* Since: 2.20 * Since: 2.20
*/ */
@ -1943,11 +1943,12 @@ gtk_tool_item_group_get_label (GtkToolItemGroup *group)
/** /**
* gtk_tool_item_group_get_label_widget: * gtk_tool_item_group_get_label_widget:
* @group: an #GtkToolItemGroup. * @group: a #GtkToolItemGroup
* *
* Gets the label widget of @group. * Gets the label widget of @group.
* See gtk_tool_item_group_set_label_widget().
* *
* Returns: the label widget of @group. See gtk_tool_item_group_set_label_widget() * Returns: the label widget of @group
* *
* Since: 2.20 * Since: 2.20
*/ */
@ -1955,16 +1956,17 @@ GtkWidget*
gtk_tool_item_group_get_label_widget (GtkToolItemGroup *group) gtk_tool_item_group_get_label_widget (GtkToolItemGroup *group)
{ {
GtkWidget *alignment = gtk_tool_item_group_get_alignment (group); GtkWidget *alignment = gtk_tool_item_group_get_alignment (group);
return gtk_bin_get_child (GTK_BIN (alignment)); return gtk_bin_get_child (GTK_BIN (alignment));
} }
/** /**
* gtk_tool_item_group_get_collapsed: * gtk_tool_item_group_get_collapsed:
* @group: an GtkToolItemGroup. * @group: a GtkToolItemGroup
* *
* Gets whether @group is collapsed or expanded. * Gets whether @group is collapsed or expanded.
* *
* Returns: %TRUE if @group is collapsed, %FALSE if it is expanded. * Returns: %TRUE if @group is collapsed, %FALSE if it is expanded
* *
* Since: 2.20 * Since: 2.20
*/ */
@ -1972,16 +1974,17 @@ gboolean
gtk_tool_item_group_get_collapsed (GtkToolItemGroup *group) gtk_tool_item_group_get_collapsed (GtkToolItemGroup *group)
{ {
g_return_val_if_fail (GTK_IS_TOOL_ITEM_GROUP (group), DEFAULT_COLLAPSED); g_return_val_if_fail (GTK_IS_TOOL_ITEM_GROUP (group), DEFAULT_COLLAPSED);
return group->priv->collapsed; return group->priv->collapsed;
} }
/** /**
* gtk_tool_item_group_get_ellipsize: * gtk_tool_item_group_get_ellipsize:
* @group: an #GtkToolItemGroup. * @group: a #GtkToolItemGroup
* *
* Gets the ellipsization mode of @group. * Gets the ellipsization mode of @group.
* *
* Returns: the #PangoEllipsizeMode of @group. * Returns: the #PangoEllipsizeMode of @group
* *
* Since: 2.20 * Since: 2.20
*/ */
@ -1989,12 +1992,13 @@ PangoEllipsizeMode
gtk_tool_item_group_get_ellipsize (GtkToolItemGroup *group) gtk_tool_item_group_get_ellipsize (GtkToolItemGroup *group)
{ {
g_return_val_if_fail (GTK_IS_TOOL_ITEM_GROUP (group), DEFAULT_ELLIPSIZE); g_return_val_if_fail (GTK_IS_TOOL_ITEM_GROUP (group), DEFAULT_ELLIPSIZE);
return group->priv->ellipsize; return group->priv->ellipsize;
} }
/** /**
* gtk_tool_item_group_get_header_relief: * gtk_tool_item_group_get_header_relief:
* @group: an #GtkToolItemGroup. * @group: a #GtkToolItemGroup
* *
* Gets the relief mode of the header button of @group. * Gets the relief mode of the header button of @group.
* *
@ -2006,14 +2010,16 @@ GtkReliefStyle
gtk_tool_item_group_get_header_relief (GtkToolItemGroup *group) gtk_tool_item_group_get_header_relief (GtkToolItemGroup *group)
{ {
g_return_val_if_fail (GTK_IS_TOOL_ITEM_GROUP (group), GTK_RELIEF_NORMAL); g_return_val_if_fail (GTK_IS_TOOL_ITEM_GROUP (group), GTK_RELIEF_NORMAL);
return gtk_button_get_relief (GTK_BUTTON (group->priv->header)); return gtk_button_get_relief (GTK_BUTTON (group->priv->header));
} }
/** /**
* gtk_tool_item_group_insert: * gtk_tool_item_group_insert:
* @group: an #GtkToolItemGroup. * @group: a #GtkToolItemGroup
* @item: the #GtkToolItem to insert into @group. * @item: the #GtkToolItem to insert into @group
* @position: the position of @item in @group, starting with 0. The position -1 means end of list. * @position: the position of @item in @group, starting with 0.
* The position -1 means end of list.
* *
* Inserts @item at @position in the list of children of @group. * Inserts @item at @position in the list of children of @group.
* *
@ -2055,9 +2061,11 @@ gtk_tool_item_group_insert (GtkToolItemGroup *group,
/** /**
* gtk_tool_item_group_set_item_position: * gtk_tool_item_group_set_item_position:
* @group: an #GtkToolItemGroup. * @group: a #GtkToolItemGroup
* @item: the #GtkToolItem to move to a new position, should be a child of @group. * @item: the #GtkToolItem to move to a new position, should
* @position: the new position of @item in @group, starting with 0. The position -1 means end of list. * be a child of @group.
* @position: the new position of @item in @group, starting with 0.
* The position -1 means end of list.
* *
* Sets the position of @item in the list of children of @group. * Sets the position of @item in the list of children of @group.
* *
@ -2075,7 +2083,6 @@ gtk_tool_item_group_set_item_position (GtkToolItemGroup *group,
g_return_if_fail (GTK_IS_TOOL_ITEM_GROUP (group)); g_return_if_fail (GTK_IS_TOOL_ITEM_GROUP (group));
g_return_if_fail (GTK_IS_TOOL_ITEM (item)); g_return_if_fail (GTK_IS_TOOL_ITEM (item));
g_return_if_fail (position >= -1); g_return_if_fail (position >= -1);
child = gtk_tool_item_group_get_child (group, item, &old_position, &link); child = gtk_tool_item_group_get_child (group, item, &old_position, &link);
@ -2096,12 +2103,12 @@ gtk_tool_item_group_set_item_position (GtkToolItemGroup *group,
/** /**
* gtk_tool_item_group_get_item_position: * gtk_tool_item_group_get_item_position:
* @group: an #GtkToolItemGroup. * @group: a #GtkToolItemGroup
* @item: a #GtkToolItem. * @item: a #GtkToolItem
* *
* Gets the position of @item in @group as index. * Gets the position of @item in @group as index.
* *
* Returns: the index of @item in @group or -1 if @item is no child of @group. * Returns: the index of @item in @group or -1 if @item is no child of @group
* *
* Since: 2.20 * Since: 2.20
*/ */
@ -2122,11 +2129,11 @@ gtk_tool_item_group_get_item_position (GtkToolItemGroup *group,
/** /**
* gtk_tool_item_group_get_n_items: * gtk_tool_item_group_get_n_items:
* @group: an #GtkToolItemGroup. * @group: a #GtkToolItemGroup
* *
* Gets the number of tool items in group. * Gets the number of tool items in @group.
* *
* Returns: the number of tool items in group. * Returns: the number of tool items in @group
* *
* Since: 2.20 * Since: 2.20
*/ */
@ -2140,12 +2147,12 @@ gtk_tool_item_group_get_n_items (GtkToolItemGroup *group)
/** /**
* gtk_tool_item_group_get_nth_item: * gtk_tool_item_group_get_nth_item:
* @group: an #GtkToolItemGroup. * @group: a #GtkToolItemGroup
* @index: the index. * @index: the index
* *
* Gets the tool item at index in group. * Gets the tool item at @index in group.
* *
* Returns: the #GtkToolItem at index. * Returns: the #GtkToolItem at index
* *
* Since: 2.20 * Since: 2.20
*/ */
@ -2164,13 +2171,13 @@ gtk_tool_item_group_get_nth_item (GtkToolItemGroup *group,
/** /**
* gtk_tool_item_group_get_drop_item: * gtk_tool_item_group_get_drop_item:
* @group: an #GtkToolItemGroup. * @group: a #GtkToolItemGroup
* @x: the x position. * @x: the x position
* @y: the y position. * @y: the y position
* *
* Gets the tool item at position (x, y). * Gets the tool item at position (x, y).
* *
* Returns: the #GtkToolItem at position (x, y). * Returns: the #GtkToolItem at position (x, y)
* *
* Since: 2.20 * Since: 2.20
*/ */
@ -2413,3 +2420,7 @@ _gtk_tool_item_group_palette_reconfigured (GtkToolItemGroup *group)
gtk_tool_item_group_header_adjust_style (group); gtk_tool_item_group_header_adjust_style (group);
} }
#define __GTK_TOOL_ITEM_GROUP_C__
#include "gtkaliasdef.c"

View File

@ -27,12 +27,12 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define GTK_TYPE_TOOL_ITEM_GROUP (gtk_tool_item_group_get_type()) #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(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_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(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_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)) #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 _GtkToolItemGroup GtkToolItemGroup;
typedef struct _GtkToolItemGroupClass GtkToolItemGroupClass; typedef struct _GtkToolItemGroupClass GtkToolItemGroupClass;

View File

@ -19,11 +19,17 @@
* Mathias Hasselmann * Mathias Hasselmann
*/ */
#include "config.h"
#include <string.h>
#include <gtk/gtk.h>
#include "gtktoolpaletteprivate.h" #include "gtktoolpaletteprivate.h"
#include "gtkmarshalers.h" #include "gtkmarshalers.h"
#include <gtk/gtk.h> #include "gtkprivate.h"
#include <string.h> #include "gtkintl.h"
#include "gtkalias.h"
#define DEFAULT_ICON_SIZE GTK_ICON_SIZE_SMALL_TOOLBAR #define DEFAULT_ICON_SIZE GTK_ICON_SIZE_SMALL_TOOLBAR
#define DEFAULT_ORIENTATION GTK_ORIENTATION_VERTICAL #define DEFAULT_ORIENTATION GTK_ORIENTATION_VERTICAL
@ -32,21 +38,20 @@
#define DEFAULT_CHILD_EXCLUSIVE FALSE #define DEFAULT_CHILD_EXCLUSIVE FALSE
#define DEFAULT_CHILD_EXPAND FALSE #define DEFAULT_CHILD_EXPAND FALSE
#define P_(msgid) (msgid)
/** /**
* SECTION:GtkToolPalette * SECTION:gtktoolpalette
* @short_description: A tool palette with categories * @Short_description: A tool palette with categories
* @include: gtktoolpalette.h * @Title: GtkToolPalette
* *
* An #GtkToolPalette allows it to add #GtkToolItem<!-- -->s to a palette like container * A #GtkToolPalette allows it to add #GtkToolItem<!-- -->s to a palette-like
* with different categories and drag and drop support. * container with different categories and drag and drop support.
* *
* An #GtkToolPalette is created with a call to gtk_tool_palette_new(). * A #GtkToolPalette is created with a call to gtk_tool_palette_new().
* *
* #GtkToolItem<!-- -->s cannot be added directly to an #GtkToolPalette, instead they * #GtkToolItem<!-- -->s cannot be added directly to a #GtkToolPalette,
* are added to an #GtkToolItemGroup which can than be added to an #GtkToolPalette. To add * instead they are added to a #GtkToolItemGroup which can than be added
* an #GtkToolItemGroup to an #GtkToolPalette use gtk_container_add(). * to a #GtkToolPalette. To add a #GtkToolItemGroup to a #GtkToolPalette,
* use gtk_container_add().
* *
* |[ * |[
* GtkWidget *palette, *group; * GtkWidget *palette, *group;
@ -60,9 +65,11 @@
* gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1); * gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1);
* ]| * ]|
* *
* The easiest way to use drag and drop with GtkToolPalette is to call gtk_tool_palette_add_drag_dest() * The easiest way to use drag and drop with #GtkToolPalette is to call
* with the desired drag source @palette and the desired drag target @widget. Than gtk_tool_palette_get_drag_item() * gtk_tool_palette_add_drag_dest() with the desired drag source @palette
* can be used to get the dragged item in the #GtkWidget::drag-data-received signal handler of the drag target. * and the desired drag target @widget. Then gtk_tool_palette_get_drag_item()
* can be used to get the dragged item in the #GtkWidget::drag-data-received
* signal handler of the drag target.
* *
* |[ * |[
* static void * static void
@ -79,9 +86,11 @@
* GtkWidget *item; * GtkWidget *item;
* *
* /<!-- -->* Get the dragged item *<!-- -->/ * /<!-- -->* Get the dragged item *<!-- -->/
* palette = gtk_widget_get_ancestor (gtk_drag_get_source_widget (context), GTK_TYPE_TOOL_PALETTE); * palette = gtk_widget_get_ancestor (gtk_drag_get_source_widget (context),
* GTK_TYPE_TOOL_PALETTE);
* if (palette != NULL) * if (palette != NULL)
* item = gtk_tool_palette_get_drag_item (GTK_TOOL_PALETTE (palette), selection); * item = gtk_tool_palette_get_drag_item (GTK_TOOL_PALETTE (palette),
* selection);
* *
* /<!-- -->* Do something with item *<!-- -->/ * /<!-- -->* Do something with item *<!-- -->/
* } * }
@ -181,7 +190,7 @@ gtk_tool_palette_init (GtkToolPalette *palette)
GTK_TYPE_TOOL_PALETTE, GTK_TYPE_TOOL_PALETTE,
GtkToolPalettePrivate); GtkToolPalettePrivate);
palette->priv->groups = g_ptr_array_sized_new(4); palette->priv->groups = g_ptr_array_sized_new (4);
g_ptr_array_set_free_func (palette->priv->groups, g_free); g_ptr_array_set_free_func (palette->priv->groups, g_free);
palette->priv->icon_size = DEFAULT_ICON_SIZE; palette->priv->icon_size = DEFAULT_ICON_SIZE;
@ -200,7 +209,7 @@ gtk_tool_palette_reconfigured (GtkToolPalette *palette)
for (i = 0; i < palette->priv->groups->len; ++i) for (i = 0; i < palette->priv->groups->len; ++i)
{ {
GtkToolItemGroupInfo *info = g_ptr_array_index(palette->priv->groups, i); GtkToolItemGroupInfo *info = g_ptr_array_index (palette->priv->groups, i);
if (info->widget) if (info->widget)
_gtk_tool_item_group_palette_reconfigured (info->widget); _gtk_tool_item_group_palette_reconfigured (info->widget);
} }
@ -308,7 +317,7 @@ gtk_tool_palette_dispose (GObject *object)
for (i = 0; i < palette->priv->groups->len; ++i) for (i = 0; i < palette->priv->groups->len; ++i)
{ {
GtkToolItemGroupInfo *group = g_ptr_array_index(palette->priv->groups, i); GtkToolItemGroupInfo *group = g_ptr_array_index (palette->priv->groups, i);
if (group->notify_collapsed) if (group->notify_collapsed)
{ {
@ -331,7 +340,7 @@ gtk_tool_palette_finalize (GObject *object)
{ {
GtkToolPalette *palette = GTK_TOOL_PALETTE (object); GtkToolPalette *palette = GTK_TOOL_PALETTE (object);
g_ptr_array_free(palette->priv->groups, TRUE); g_ptr_array_free (palette->priv->groups, TRUE);
G_OBJECT_CLASS (gtk_tool_palette_parent_class)->finalize (object); G_OBJECT_CLASS (gtk_tool_palette_parent_class)->finalize (object);
} }
@ -350,7 +359,7 @@ gtk_tool_palette_size_request (GtkWidget *widget,
for (i = 0; i < palette->priv->groups->len; ++i) for (i = 0; i < palette->priv->groups->len; ++i)
{ {
GtkToolItemGroupInfo *group = g_ptr_array_index(palette->priv->groups, i); GtkToolItemGroupInfo *group = g_ptr_array_index (palette->priv->groups, i);
if (!group->widget) if (!group->widget)
continue; continue;
@ -394,7 +403,7 @@ gtk_tool_palette_size_allocate (GtkWidget *widget,
gint x; gint x;
gint *group_sizes = g_newa(gint, palette->priv->groups->len); gint *group_sizes = g_newa (gint, palette->priv->groups->len);
GtkTextDirection direction = gtk_widget_get_direction (widget); GtkTextDirection direction = gtk_widget_get_direction (widget);
@ -428,10 +437,11 @@ gtk_tool_palette_size_allocate (GtkWidget *widget,
remaining_space = allocation->width; remaining_space = allocation->width;
/* figure out the required size of all groups to be able to distribute the /* figure out the required size of all groups to be able to distribute the
* remaining space on allocation */ * remaining space on allocation
*/
for (i = 0; i < palette->priv->groups->len; ++i) for (i = 0; i < palette->priv->groups->len; ++i)
{ {
GtkToolItemGroupInfo *group = g_ptr_array_index(palette->priv->groups, i); GtkToolItemGroupInfo *group = g_ptr_array_index (palette->priv->groups, i);
gint size; gint size;
if (!group->widget) if (!group->widget)
@ -455,8 +465,9 @@ gtk_tool_palette_size_allocate (GtkWidget *widget,
remaining_space -= size; remaining_space -= size;
group_sizes[i] = size; group_sizes[i] = size;
/* if the widget is currently expanding an offset which allows to display as much of the /* if the widget is currently expanding an offset which allows to
* widget as possible is calculated */ * display as much of the widget as possible is calculated
*/
if (widget == palette->priv->expanding_child) if (widget == palette->priv->expanding_child)
{ {
gint limit = gint limit =
@ -512,7 +523,7 @@ gtk_tool_palette_size_allocate (GtkWidget *widget,
/* allocate all groups at the calculated positions */ /* allocate all groups at the calculated positions */
for (i = 0; i < palette->priv->groups->len; ++i) for (i = 0; i < palette->priv->groups->len; ++i)
{ {
GtkToolItemGroupInfo *group = g_ptr_array_index(palette->priv->groups, i); GtkToolItemGroupInfo *group = g_ptr_array_index (palette->priv->groups, i);
GtkWidget *widget; GtkWidget *widget;
if (!group->widget) if (!group->widget)
@ -623,7 +634,7 @@ gtk_tool_palette_expose_event (GtkWidget *widget,
for (i = 0; i < palette->priv->groups->len; ++i) for (i = 0; i < palette->priv->groups->len; ++i)
{ {
GtkToolItemGroupInfo *info = g_ptr_array_index(palette->priv->groups, i); GtkToolItemGroupInfo *info = g_ptr_array_index (palette->priv->groups, i);
if (info->widget) if (info->widget)
_gtk_tool_item_group_paint (info->widget, cr); _gtk_tool_item_group_paint (info->widget, cr);
} }
@ -739,7 +750,7 @@ gtk_tool_palette_remove (GtkContainer *container,
for (i = 0; i < palette->priv->groups->len; ++i) for (i = 0; i < palette->priv->groups->len; ++i)
{ {
GtkToolItemGroupInfo *info = g_ptr_array_index(palette->priv->groups, i); GtkToolItemGroupInfo *info = g_ptr_array_index (palette->priv->groups, i);
if (GTK_WIDGET(info->widget) == child) if (GTK_WIDGET(info->widget) == child)
{ {
g_object_unref (child); g_object_unref (child);
@ -762,7 +773,7 @@ gtk_tool_palette_forall (GtkContainer *container,
for (i = 0; i < palette->priv->groups->len; ++i) for (i = 0; i < palette->priv->groups->len; ++i)
{ {
GtkToolItemGroupInfo *info = g_ptr_array_index(palette->priv->groups, i); GtkToolItemGroupInfo *info = g_ptr_array_index (palette->priv->groups, i);
if (info->widget) if (info->widget)
callback (GTK_WIDGET (info->widget), callback (GTK_WIDGET (info->widget),
callback_data); callback_data);
@ -856,9 +867,9 @@ gtk_tool_palette_settings_change_notify (GtkSettings *settings,
const GParamSpec *pspec, const GParamSpec *pspec,
GtkToolPalette *palette) GtkToolPalette *palette)
{ {
if (! strcmp (pspec->name, "gtk-toolbar-style")) if (strcmp (pspec->name, "gtk-toolbar-style") == 0)
style_change_notify (palette); style_change_notify (palette);
else if (! strcmp (pspec->name, "gtk-toolbar-icon-size")) else if (strcmp (pspec->name, "gtk-toolbar-icon-size") == 0)
icon_size_change_notify (palette); icon_size_change_notify (palette);
} }
@ -937,8 +948,9 @@ gtk_tool_palette_class_init (GtkToolPaletteClass *cls)
* @vadjustment: The vertical adjustment * @vadjustment: The vertical adjustment
* *
* Set the scroll adjustments for the viewport. * Set the scroll adjustments for the viewport.
* Usually scrolled containers like GtkScrolledWindow will emit this signal to * Usually scrolled containers like GtkScrolledWindow will emit this
* connect two instances of GtkScrollbar to the scroll directions of the GtkToolpalette. * signal to connect two instances of GtkScrollbar to the scroll
* directions of the GtkToolpalette.
* *
* Since: 2.20 * Since: 2.20
*/ */
@ -953,18 +965,17 @@ gtk_tool_palette_class_init (GtkToolPaletteClass *cls)
GTK_TYPE_ADJUSTMENT, GTK_TYPE_ADJUSTMENT,
GTK_TYPE_ADJUSTMENT); GTK_TYPE_ADJUSTMENT);
g_object_class_override_property (oclass, PROP_ORIENTATION, g_object_class_override_property (oclass, PROP_ORIENTATION, "orientation");
"orientation");
/** /**
* GtkToolPalette:icon-size: * GtkToolPalette:icon-size:
* *
* The size of the icons in a tool palette is normally determined by * The size of the icons in a tool palette is normally determined by
* the toolbar-icon-size setting. When this property is set, it * the #GtkSettings:toolbar-icon-size setting. When this property is set,
* overrides the setting. * it overrides the setting.
* *
* This should only be used for special-purpose toolbars, normal * This should only be used for special-purpose tool palettes, normal
* application toolbars should respect the user preferences for the * application tool palettes should respect the user preferences for the
* size of icons. * size of icons.
* *
* Since: 2.20 * Since: 2.20
@ -976,13 +987,12 @@ gtk_tool_palette_class_init (GtkToolPaletteClass *cls)
P_("Size of icons in this tool palette"), P_("Size of icons in this tool palette"),
GTK_TYPE_ICON_SIZE, GTK_TYPE_ICON_SIZE,
DEFAULT_ICON_SIZE, DEFAULT_ICON_SIZE,
G_PARAM_READWRITE | G_PARAM_STATIC_NAME | GTK_PARAM_READWRITE));
G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
/** /**
* GtkToolPalette:icon-size-set: * GtkToolPalette:icon-size-set:
* *
* Is %TRUE if the icon-size property has been set. * Is %TRUE if the #GtkToolPalette:icon-size property has been set.
* *
* Since: 2.20 * Since: 2.20
*/ */
@ -992,34 +1002,53 @@ gtk_tool_palette_class_init (GtkToolPaletteClass *cls)
P_("Icon size set"), P_("Icon size set"),
P_("Whether the icon-size property has been set"), P_("Whether the icon-size property has been set"),
FALSE, FALSE,
G_PARAM_READWRITE | G_PARAM_STATIC_NAME | GTK_PARAM_READWRITE));
G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
/**
* GtkToolPalette:toolbar-style:
*
* The style of items in the tool palette.
*
* Since: 2.20
*/
g_object_class_install_property (oclass, PROP_TOOLBAR_STYLE, g_object_class_install_property (oclass, PROP_TOOLBAR_STYLE,
g_param_spec_enum ("toolbar-style", g_param_spec_enum ("toolbar-style",
P_("Toolbar Style"), P_("Toolbar Style"),
P_("Style of items in the tool palette"), P_("Style of items in the tool palette"),
GTK_TYPE_TOOLBAR_STYLE, GTK_TYPE_TOOLBAR_STYLE,
DEFAULT_TOOLBAR_STYLE, DEFAULT_TOOLBAR_STYLE,
G_PARAM_READWRITE | G_PARAM_STATIC_NAME | GTK_PARAM_READWRITE));
G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
/**
* GtkToolPalette:exclusive:
*
* Whether the item group should be the only one that is expanded
* at a given time.
*
* Since: 2.20
*/
gtk_container_class_install_child_property (cclass, CHILD_PROP_EXCLUSIVE, gtk_container_class_install_child_property (cclass, CHILD_PROP_EXCLUSIVE,
g_param_spec_boolean ("exclusive", g_param_spec_boolean ("exclusive",
P_("Exclusive"), P_("Exclusive"),
P_("Whether the item group should be the only expanded at a given time"), P_("Whether the item group should be the only expanded at a given time"),
DEFAULT_CHILD_EXCLUSIVE, DEFAULT_CHILD_EXCLUSIVE,
G_PARAM_READWRITE | G_PARAM_STATIC_NAME | GTK_PARAM_READWRITE));
G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
/**
* GtkToolPalette:expand:
*
* Whether the item group should receive extra space when the palette grows.
* at a given time.
*
* Since: 2.20
*/
gtk_container_class_install_child_property (cclass, CHILD_PROP_EXPAND, gtk_container_class_install_child_property (cclass, CHILD_PROP_EXPAND,
g_param_spec_boolean ("expand", g_param_spec_boolean ("expand",
P_("Expand"), P_("Expand"),
P_("Whether the item group should receive extra space when the palette grows"), P_("Whether the item group should receive extra space when the palette grows"),
DEFAULT_CHILD_EXPAND, DEFAULT_CHILD_EXPAND,
G_PARAM_READWRITE | G_PARAM_STATIC_NAME | GTK_PARAM_READWRITE));
G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
g_type_class_add_private (cls, sizeof (GtkToolPalettePrivate)); g_type_class_add_private (cls, sizeof (GtkToolPalettePrivate));
@ -1032,7 +1061,7 @@ gtk_tool_palette_class_init (GtkToolPaletteClass *cls)
* *
* Creates a new tool palette. * Creates a new tool palette.
* *
* Returns: a new #GtkToolPalette. * Returns: a new #GtkToolPalette
* *
* Since: 2.20 * Since: 2.20
*/ */
@ -1044,8 +1073,8 @@ gtk_tool_palette_new (void)
/** /**
* gtk_tool_palette_set_icon_size: * gtk_tool_palette_set_icon_size:
* @palette: an #GtkToolPalette. * @palette: a #GtkToolPalette
* @icon_size: the #GtkIconSize that icons in the tool palette shall have. * @icon_size: the #GtkIconSize that icons in the tool palette shall have
* *
* Sets the size of icons in the tool palette. * Sets the size of icons in the tool palette.
* *
@ -1088,10 +1117,10 @@ toolpalette_get_settings (GtkToolPalette *palette)
/** /**
* gtk_tool_palette_unset_icon_size: * gtk_tool_palette_unset_icon_size:
* @palette: an #GtkToolPalette. * @palette: a #GtkToolPalette
* *
* Unsets the tool palette icon size set with gtk_tool_palette_set_icon_size(), so that * Unsets the tool palette icon size set with gtk_tool_palette_set_icon_size(),
* user preferences will be used to determine the icon size. * so that user preferences will be used to determine the icon size.
* *
* Since: 2.20 * Since: 2.20
*/ */
@ -1128,12 +1157,12 @@ gtk_tool_palette_unset_icon_size (GtkToolPalette *palette)
} }
/* Set the "toolbar-style" property and do appropriate things. /* Set the "toolbar-style" property and do appropriate things.
* GtkToolbar does this by emiting a signal instead of just calling a function, * GtkToolbar does this by emitting a signal instead of just
* but I don't see how that is useful. murrayc. * calling a function...
*/ */
static void static void
gtk_tool_palette_change_style (GtkToolPalette *palette, gtk_tool_palette_change_style (GtkToolPalette *palette,
GtkToolbarStyle style) GtkToolbarStyle style)
{ {
GtkToolPalettePrivate* priv = palette->priv; GtkToolPalettePrivate* priv = palette->priv;
@ -1151,8 +1180,8 @@ gtk_tool_palette_change_style (GtkToolPalette *palette,
/** /**
* gtk_tool_palette_set_style: * gtk_tool_palette_set_style:
* @palette: a #GtkToolPalette. * @palette: a #GtkToolPalette
* @style: the #GtkToolbarStyle that items in the tool palette shall have. * @style: the #GtkToolbarStyle that items in the tool palette shall have
* *
* Sets the style (text, icons or both) of items in the tool palette. * Sets the style (text, icons or both) of items in the tool palette.
* *
@ -1171,11 +1200,13 @@ gtk_tool_palette_set_style (GtkToolPalette *palette,
/** /**
* gtk_tool_palette_unset_style: * gtk_tool_palette_unset_style:
* @palette: a #GtkToolPalette. * @palette: a #GtkToolPalette
* *
* Unsets a toolbar style set with gtk_tool_palette_set_style(), so that * Unsets a toolbar style set with gtk_tool_palette_set_style(),
* user preferences will be used to determine the toolbar style. * so that user preferences will be used to determine the toolbar style.
**/ *
* Since: 2.20
*/
void void
gtk_tool_palette_unset_style (GtkToolPalette *palette) gtk_tool_palette_unset_style (GtkToolPalette *palette)
{ {
@ -1189,9 +1220,9 @@ gtk_tool_palette_unset_style (GtkToolPalette *palette)
GtkSettings *settings = toolpalette_get_settings (palette); GtkSettings *settings = toolpalette_get_settings (palette);
if (settings) if (settings)
g_object_get (settings, g_object_get (settings,
"gtk-toolbar-style", &style, "gtk-toolbar-style", &style,
NULL); NULL);
else else
style = DEFAULT_TOOLBAR_STYLE; style = DEFAULT_TOOLBAR_STYLE;
@ -1204,11 +1235,12 @@ gtk_tool_palette_unset_style (GtkToolPalette *palette)
/** /**
* gtk_tool_palette_get_icon_size: * gtk_tool_palette_get_icon_size:
* @palette: an #GtkToolPalette. * @palette: a #GtkToolPalette
* *
* Gets the size of icons in the tool palette. See gtk_tool_palette_set_icon_size(). * Gets the size of icons in the tool palette.
* See gtk_tool_palette_set_icon_size().
* *
* Returns: the #GtkIconSize of icons in the tool palette. * Returns: the #GtkIconSize of icons in the tool palette
* *
* Since: 2.20 * Since: 2.20
*/ */
@ -1216,12 +1248,13 @@ GtkIconSize
gtk_tool_palette_get_icon_size (GtkToolPalette *palette) gtk_tool_palette_get_icon_size (GtkToolPalette *palette)
{ {
g_return_val_if_fail (GTK_IS_TOOL_PALETTE (palette), DEFAULT_ICON_SIZE); g_return_val_if_fail (GTK_IS_TOOL_PALETTE (palette), DEFAULT_ICON_SIZE);
return palette->priv->icon_size; return palette->priv->icon_size;
} }
/** /**
* gtk_tool_palette_get_style: * gtk_tool_palette_get_style:
* @palette: an #GtkToolPalette. * @palette: a #GtkToolPalette
* *
* Gets the style (icons, text or both) of items in the tool palette. * Gets the style (icons, text or both) of items in the tool palette.
* *
@ -1233,25 +1266,25 @@ GtkToolbarStyle
gtk_tool_palette_get_style (GtkToolPalette *palette) gtk_tool_palette_get_style (GtkToolPalette *palette)
{ {
g_return_val_if_fail (GTK_IS_TOOL_PALETTE (palette), DEFAULT_TOOLBAR_STYLE); g_return_val_if_fail (GTK_IS_TOOL_PALETTE (palette), DEFAULT_TOOLBAR_STYLE);
return palette->priv->style; return palette->priv->style;
} }
gint gint
_gtk_tool_palette_compare_groups (gconstpointer a, _gtk_tool_palette_compare_groups (gconstpointer a,
gconstpointer b) gconstpointer b)
{ {
const GtkToolItemGroupInfo *group_a = a; const GtkToolItemGroupInfo *group_a = a;
const GtkToolItemGroupInfo *group_b = b; const GtkToolItemGroupInfo *group_b = b;
return group_a->pos - group_b->pos; return group_a->pos - group_b->pos;
} }
/** /**
* gtk_tool_palette_set_group_position: * gtk_tool_palette_set_group_position:
* @palette: an #GtkToolPalette. * @palette: a #GtkToolPalette
* @group: an #GtkToolItemGroup which is a child of palette. * @group: a #GtkToolItemGroup which is a child of palette
* @position: a new index for group. * @position: a new index for group
* *
* Sets the position of the group as an index of the tool palette. * Sets the position of the group as an index of the tool palette.
* If position is 0 the group will become the first child, if position is * If position is 0 the group will become the first child, if position is
@ -1270,7 +1303,6 @@ gtk_tool_palette_set_group_position (GtkToolPalette *palette,
g_return_if_fail (GTK_IS_TOOL_PALETTE (palette)); g_return_if_fail (GTK_IS_TOOL_PALETTE (palette));
g_return_if_fail (GTK_IS_TOOL_ITEM_GROUP (group)); g_return_if_fail (GTK_IS_TOOL_ITEM_GROUP (group));
g_return_if_fail (position >= -1); g_return_if_fail (position >= -1);
if (-1 == position) if (-1 == position)
@ -1278,7 +1310,7 @@ gtk_tool_palette_set_group_position (GtkToolPalette *palette,
g_return_if_fail ((guint) position < palette->priv->groups->len); g_return_if_fail ((guint) position < palette->priv->groups->len);
group_new = g_ptr_array_index(palette->priv->groups, position); group_new = g_ptr_array_index (palette->priv->groups, position);
if (GTK_TOOL_ITEM_GROUP (group) == group_new->widget) if (GTK_TOOL_ITEM_GROUP (group) == group_new->widget)
return; return;
@ -1286,7 +1318,7 @@ gtk_tool_palette_set_group_position (GtkToolPalette *palette,
old_position = gtk_tool_palette_get_group_position (palette, group); old_position = gtk_tool_palette_get_group_position (palette, group);
g_return_if_fail (old_position >= 0); g_return_if_fail (old_position >= 0);
group_old = g_ptr_array_index(palette->priv->groups, old_position); group_old = g_ptr_array_index (palette->priv->groups, old_position);
group_new->pos = position; group_new->pos = position;
group_old->pos = old_position; group_old->pos = old_position;
@ -1319,12 +1351,12 @@ gtk_tool_palette_group_notify_collapsed (GtkToolItemGroup *group,
/** /**
* gtk_tool_palette_set_exclusive: * gtk_tool_palette_set_exclusive:
* @palette: an #GtkToolPalette. * @palette: a #GtkToolPalette
* @group: an #GtkToolItemGroup which is a child of palette. * @group: a #GtkToolItemGroup which is a child of palette
* @exclusive: whether the group should be exclusive or not. * @exclusive: whether the group should be exclusive or not
* *
* Sets whether the group should be exclusive or not. If an exclusive group is expanded * Sets whether the group should be exclusive or not.
* all other groups are collapsed. * If an exclusive group is expanded all other groups are collapsed.
* *
* Since: 2.20 * Since: 2.20
*/ */
@ -1371,9 +1403,9 @@ gtk_tool_palette_set_exclusive (GtkToolPalette *palette,
/** /**
* gtk_tool_palette_set_expand: * gtk_tool_palette_set_expand:
* @palette: an #GtkToolPalette. * @palette: a #GtkToolPalette
* @group: an #GtkToolItemGroup which is a child of palette. * @group: a #GtkToolItemGroup which is a child of palette
* @expand: whether the group should be given extra space. * @expand: whether the group should be given extra space
* *
* Sets whether the group should be given extra space. * Sets whether the group should be given extra space.
* *
@ -1405,12 +1437,13 @@ gtk_tool_palette_set_expand (GtkToolPalette *palette,
/** /**
* gtk_tool_palette_get_group_position: * gtk_tool_palette_get_group_position:
* @palette: an #GtkToolPalette. * @palette: a #GtkToolPalette
* @group: an #GtkToolItemGroup. * @group: a #GtkToolItemGroup
* *
* Gets the position of @group in @palette as index. see gtk_tool_palette_set_group_position(). * Gets the position of @group in @palette as index.
* See gtk_tool_palette_set_group_position().
* *
* Returns: the index of group or -1 if @group is not a child of @palette. * Returns: the index of group or -1 if @group is not a child of @palette
* *
* Since: 2.20 * Since: 2.20
*/ */
@ -1435,12 +1468,13 @@ gtk_tool_palette_get_group_position (GtkToolPalette *palette,
/** /**
* gtk_tool_palette_get_exclusive: * gtk_tool_palette_get_exclusive:
* @palette: an #GtkToolPalette. * @palette: a #GtkToolPalette
* @group: an #GtkToolItemGroup which is a child of palette. * @group: a #GtkToolItemGroup which is a child of palette
* *
* Gets whether group is exclusive or not. See gtk_tool_palette_set_exclusive(). * Gets whether @group is exclusive or not.
* See gtk_tool_palette_set_exclusive().
* *
* Returns: %TRUE if group is exclusive. * Returns: %TRUE if @group is exclusive
* *
* Since: 2.20 * Since: 2.20
*/ */
@ -1464,12 +1498,13 @@ gtk_tool_palette_get_exclusive (GtkToolPalette *palette,
/** /**
* gtk_tool_palette_get_expand: * gtk_tool_palette_get_expand:
* @palette: an #GtkToolPalette. * @palette: a #GtkToolPalette
* @group: an #GtkToolItemGroup which is a child of palette. * @group: a #GtkToolItemGroup which is a child of palette
* *
* Gets whether group should be given extra space. See gtk_tool_palette_set_expand(). * Gets whether group should be given extra space.
* See gtk_tool_palette_set_expand().
* *
* Returns: %TRUE if group should be given extra space, %FALSE otherwise. * Returns: %TRUE if group should be given extra space, %FALSE otherwise
* *
* Since: 2.20 * Since: 2.20
*/ */
@ -1493,13 +1528,14 @@ gtk_tool_palette_get_expand (GtkToolPalette *palette,
/** /**
* gtk_tool_palette_get_drop_item: * gtk_tool_palette_get_drop_item:
* @palette: an #GtkToolPalette. * @palette: a #GtkToolPalette
* @x: the x position. * @x: the x position
* @y: the y position. * @y: the y position
* *
* Gets the item at position (x, y). See gtk_tool_palette_get_drop_group(). * Gets the item at position (x, y).
* See gtk_tool_palette_get_drop_group().
* *
* Returns: the #GtkToolItem at position or %NULL if there is no such item. * Returns: the #GtkToolItem at position or %NULL if there is no such item
* *
* Since: 2.20 * Since: 2.20
*/ */
@ -1520,13 +1556,14 @@ gtk_tool_palette_get_drop_item (GtkToolPalette *palette,
/** /**
* gtk_tool_palette_get_drop_group: * gtk_tool_palette_get_drop_group:
* @palette: an #GtkToolPalette. * @palette: a #GtkToolPalette
* @x: the x position. * @x: the x position
* @y: the y position. * @y: the y position
* *
* Gets the group at position (x, y). * Gets the group at position (x, y).
* *
* Returns: the #GtkToolItemGroup at position or %NULL if there is no such group. * Returns: the #GtkToolItemGroup at position or %NULL
* if there is no such group
* *
* Since: 2.20 * Since: 2.20
*/ */
@ -1547,7 +1584,7 @@ gtk_tool_palette_get_drop_group (GtkToolPalette *palette,
for (i = 0; i < palette->priv->groups->len; ++i) for (i = 0; i < palette->priv->groups->len; ++i)
{ {
GtkToolItemGroupInfo *group = g_ptr_array_index(palette->priv->groups, i); GtkToolItemGroupInfo *group = g_ptr_array_index (palette->priv->groups, i);
GtkWidget *widget; GtkWidget *widget;
gint x0, y0; gint x0, y0;
@ -1569,13 +1606,13 @@ gtk_tool_palette_get_drop_group (GtkToolPalette *palette,
/** /**
* gtk_tool_palette_get_drag_item: * gtk_tool_palette_get_drag_item:
* @palette: an #GtkToolPalette. * @palette: a #GtkToolPalette
* @selection: a #GtkSelectionData. * @selection: a #GtkSelectionData
* *
* Get the dragged item from the selection. This could be a #GtkToolItem or * Get the dragged item from the selection.
* an #GtkToolItemGroup. * This could be a #GtkToolItem or a #GtkToolItemGroup.
* *
* Returns: the dragged item in selection. * Returns: the dragged item in selection
* *
* Since: 2.20 * Since: 2.20
*/ */
@ -1608,17 +1645,16 @@ gtk_tool_palette_get_drag_item (GtkToolPalette *palette,
/** /**
* gtk_tool_palette_set_drag_source: * gtk_tool_palette_set_drag_source:
* @palette: an #GtkToolPalette. * @palette: a #GtkToolPalette
* @targets: the #GtkToolPaletteDragTargets which the widget should support. * @targets: the #GtkToolPaletteDragTarget<!-- -->s
* * which the widget should support
* Sets the tool palette as a drag source. Enables all groups and items in
* the tool palette as drag sources on button 1 and button 3 press with copy
* and move actions.
* *
* Sets the tool palette as a drag source.
* Enables all groups and items in the tool palette as drag sources
* on button 1 and button 3 press with copy and move actions.
* See gtk_drag_source_set(). * See gtk_drag_source_set().
* *
* Since: 2.20 * Since: 2.20
*
*/ */
void void
gtk_tool_palette_set_drag_source (GtkToolPalette *palette, gtk_tool_palette_set_drag_source (GtkToolPalette *palette,
@ -1645,19 +1681,16 @@ gtk_tool_palette_set_drag_source (GtkToolPalette *palette,
/** /**
* gtk_tool_palette_add_drag_dest: * gtk_tool_palette_add_drag_dest:
* @palette: an #GtkToolPalette. * @palette: a #GtkToolPalette
* @widget: a #GtkWidget which should be a drag destination for palette. * @widget: a #GtkWidget which should be a drag destination for @palette
* @flags: the flags that specify what actions GTK+ should take for drops on that widget. * @flags: the flags that specify what actions GTK+ should take for drops
* @targets: the #GtkToolPaletteDragTargets which the widget should support. * on that widget
* @actions: the #GdkDragAction<!-- -->s which the widget should suppport. * @targets: the #GtkToolPaletteDragTarget<!-- -->s which the widget
* * should support
* Sets the tool palette as drag source (see gtk_tool_palette_set_drag_source()) and * @actions: the #GdkDragAction<!-- -->s which the widget should suppport
* sets widget as a drag destination for drags from palette. With flags the actions
* (like highlighting and target checking) which should be performed by GTK+ for
* drops on widget can be specified. With targets the supported drag targets
* (groups and/or items) can be specified. With actions the supported drag actions
* (copy and move) can be specified.
* *
* Sets @palette as drag source (see gtk_tool_palette_set_drag_source())
* and sets @widget as a drag destination for drags from @palette.
* See gtk_drag_dest_set(). * See gtk_drag_dest_set().
* *
* Since: 2.20 * Since: 2.20
@ -1708,7 +1741,7 @@ _gtk_tool_palette_get_item_size (GtkToolPalette *palette,
{ {
GtkRequisition requisition; GtkRequisition requisition;
gint rows; gint rows;
GtkToolItemGroupInfo *group = g_ptr_array_index(palette->priv->groups, i); GtkToolItemGroupInfo *group = g_ptr_array_index (palette->priv->groups, i);
if (!group->widget) if (!group->widget)
continue; continue;
@ -1807,7 +1840,7 @@ _gtk_tool_palette_child_set_drag_source (GtkWidget *child,
/** /**
* gtk_tool_palette_get_drag_target_item: * gtk_tool_palette_get_drag_target_item:
* *
* Get the target entry for a dragged #GtkToolItem. * Gets the target entry for a dragged #GtkToolItem.
* *
* Returns: the #GtkTargetEntry for a dragged item. * Returns: the #GtkTargetEntry for a dragged item.
* *
@ -1824,7 +1857,7 @@ gtk_tool_palette_get_drag_target_item (void)
* *
* Get the target entry for a dragged #GtkToolItemGroup. * Get the target entry for a dragged #GtkToolItemGroup.
* *
* Returns: the #GtkTargetEntry for a dragged group. * Returns: the #GtkTargetEntry for a dragged group
* *
* Since: 2.20 * Since: 2.20
*/ */
@ -1842,17 +1875,39 @@ _gtk_tool_palette_set_expanding_child (GtkToolPalette *palette,
palette->priv->expanding_child = widget; palette->priv->expanding_child = widget;
} }
/**
* gtk_tool_palette_get_hadjustment:
* @palette: a #GtkToolPalette
*
* Gets the horizontal adjustment of the tool palette.
*
* Returns: the horizontal adjustment of @palette
*
* Since: 2.20
*/
GtkAdjustment* GtkAdjustment*
gtk_tool_palette_get_hadjustment (GtkToolPalette *palette) gtk_tool_palette_get_hadjustment (GtkToolPalette *palette)
{ {
g_return_val_if_fail (GTK_IS_TOOL_PALETTE (palette), NULL); g_return_val_if_fail (GTK_IS_TOOL_PALETTE (palette), NULL);
return palette->priv->hadjustment; return palette->priv->hadjustment;
} }
/**
* gtk_tool_palette_get_vadjustment:
* @palette: a #GtkToolPalette
*
* Gets the vertical adjustment of the tool palette.
*
* Returns: the vertical adjustment of @palette
*
* Since: 2.20
*/
GtkAdjustment* GtkAdjustment*
gtk_tool_palette_get_vadjustment (GtkToolPalette *palette) gtk_tool_palette_get_vadjustment (GtkToolPalette *palette)
{ {
g_return_val_if_fail (GTK_IS_TOOL_PALETTE (palette), NULL); g_return_val_if_fail (GTK_IS_TOOL_PALETTE (palette), NULL);
return palette->priv->vadjustment; return palette->priv->vadjustment;
} }
@ -1863,3 +1918,7 @@ _gtk_tool_palette_get_size_group (GtkToolPalette *palette)
return palette->priv->text_size_group; return palette->priv->text_size_group;
} }
#define __GTK_TOOL_PALETTE_C__
#include "gtkaliasdef.c"

View File

@ -28,12 +28,12 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define GTK_TYPE_TOOL_PALETTE (gtk_tool_palette_get_type()) #define GTK_TYPE_TOOL_PALETTE (gtk_tool_palette_get_type ())
#define GTK_TOOL_PALETTE(obj) (G_TYPE_CHECK_INSTANCE_CAST(obj, GTK_TYPE_TOOL_PALETTE, GtkToolPalette)) #define GTK_TOOL_PALETTE(obj) (G_TYPE_CHECK_INSTANCE_CAST (obj, GTK_TYPE_TOOL_PALETTE, GtkToolPalette))
#define GTK_TOOL_PALETTE_CLASS(cls) (G_TYPE_CHECK_CLASS_CAST(cls, GTK_TYPE_TOOL_PALETTE, GtkToolPaletteClass)) #define GTK_TOOL_PALETTE_CLASS(cls) (G_TYPE_CHECK_CLASS_CAST (cls, GTK_TYPE_TOOL_PALETTE, GtkToolPaletteClass))
#define GTK_IS_TOOL_PALETTE(obj) (G_TYPE_CHECK_INSTANCE_TYPE(obj, GTK_TYPE_TOOL_PALETTE)) #define GTK_IS_TOOL_PALETTE(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, GTK_TYPE_TOOL_PALETTE))
#define GTK_IS_TOOL_PALETTE_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE(obj, GTK_TYPE_TOOL_PALETTE)) #define GTK_IS_TOOL_PALETTE_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE (obj, GTK_TYPE_TOOL_PALETTE))
#define GTK_TOOL_PALETTE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GTK_TYPE_TOOL_PALETTE, GtkToolPaletteClass)) #define GTK_TOOL_PALETTE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TOOL_PALETTE, GtkToolPaletteClass))
typedef struct _GtkToolPalette GtkToolPalette; typedef struct _GtkToolPalette GtkToolPalette;
typedef struct _GtkToolPaletteClass GtkToolPaletteClass; typedef struct _GtkToolPaletteClass GtkToolPaletteClass;

View File

@ -28,7 +28,7 @@
/** /**
* SECTION:gtktoolshell * SECTION:gtktoolshell
* @short_description: Interface for containers containing GtkToolItem widgets. * @Short_description: Interface for containers containing GtkToolItem widgets
* @Title: GtkToolShell * @Title: GtkToolShell
* *
* The #GtkToolShell interface allows container widgets to provide additional * The #GtkToolShell interface allows container widgets to provide additional