forked from AuroraMiddleware/gtk
toolpalette: fixed trailing whitespaces
This commit is contained in:
parent
0886416f26
commit
0e2a5509f6
@ -215,15 +215,15 @@ gtk_tool_item_group_screen_changed (GtkWidget *widget,
|
|||||||
GtkToolItemGroupPrivate* priv = group->priv;
|
GtkToolItemGroupPrivate* priv = group->priv;
|
||||||
GtkSettings *old_settings = priv->settings;
|
GtkSettings *old_settings = priv->settings;
|
||||||
GtkSettings *settings;
|
GtkSettings *settings;
|
||||||
|
|
||||||
if (gtk_widget_has_screen (GTK_WIDGET (group)))
|
if (gtk_widget_has_screen (GTK_WIDGET (group)))
|
||||||
settings = gtk_widget_get_settings (GTK_WIDGET (group));
|
settings = gtk_widget_get_settings (GTK_WIDGET (group));
|
||||||
else
|
else
|
||||||
settings = NULL;
|
settings = NULL;
|
||||||
|
|
||||||
if (settings == old_settings)
|
if (settings == old_settings)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (old_settings)
|
if (old_settings)
|
||||||
{
|
{
|
||||||
g_signal_handler_disconnect (old_settings, priv->settings_connection);
|
g_signal_handler_disconnect (old_settings, priv->settings_connection);
|
||||||
@ -372,7 +372,7 @@ gtk_tool_item_group_init (GtkToolItemGroup *group)
|
|||||||
{
|
{
|
||||||
GtkWidget *alignment;
|
GtkWidget *alignment;
|
||||||
GtkToolItemGroupPrivate* priv;
|
GtkToolItemGroupPrivate* priv;
|
||||||
|
|
||||||
gtk_widget_set_redraw_on_allocate (GTK_WIDGET (group), FALSE);
|
gtk_widget_set_redraw_on_allocate (GTK_WIDGET (group), FALSE);
|
||||||
|
|
||||||
group->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE (group,
|
group->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE (group,
|
||||||
@ -503,7 +503,7 @@ gtk_tool_item_group_dispose (GObject *object)
|
|||||||
{
|
{
|
||||||
GtkToolItemGroup *group = GTK_TOOL_ITEM_GROUP (object);
|
GtkToolItemGroup *group = GTK_TOOL_ITEM_GROUP (object);
|
||||||
GtkToolItemGroupPrivate* priv = group->priv;
|
GtkToolItemGroupPrivate* priv = group->priv;
|
||||||
|
|
||||||
if (priv->toplevel)
|
if (priv->toplevel)
|
||||||
{
|
{
|
||||||
/* disconnect focus tracking handler */
|
/* disconnect focus tracking handler */
|
||||||
@ -537,7 +537,7 @@ gtk_tool_item_group_size_request (GtkWidget *widget,
|
|||||||
{
|
{
|
||||||
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);
|
||||||
GtkToolItemGroupPrivate* priv = group->priv;
|
GtkToolItemGroupPrivate* priv = group->priv;
|
||||||
GtkOrientation orientation;
|
GtkOrientation orientation;
|
||||||
GtkRequisition item_size;
|
GtkRequisition item_size;
|
||||||
gint requested_rows;
|
gint requested_rows;
|
||||||
@ -603,7 +603,7 @@ gtk_tool_item_group_real_size_query (GtkWidget *widget,
|
|||||||
{
|
{
|
||||||
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);
|
||||||
GtkToolItemGroupPrivate* priv = group->priv;
|
GtkToolItemGroupPrivate* priv = group->priv;
|
||||||
|
|
||||||
GtkRequisition item_size;
|
GtkRequisition item_size;
|
||||||
GtkAllocation item_area;
|
GtkAllocation item_area;
|
||||||
@ -836,7 +836,7 @@ gtk_tool_item_group_real_size_allocate (GtkWidget *widget,
|
|||||||
{
|
{
|
||||||
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);
|
||||||
GtkToolItemGroupPrivate* priv = group->priv;
|
GtkToolItemGroupPrivate* priv = group->priv;
|
||||||
GtkRequisition child_requisition;
|
GtkRequisition child_requisition;
|
||||||
GtkAllocation child_allocation;
|
GtkAllocation child_allocation;
|
||||||
|
|
||||||
@ -1108,7 +1108,7 @@ static void
|
|||||||
gtk_tool_item_group_set_toplevel_window (GtkToolItemGroup *group,
|
gtk_tool_item_group_set_toplevel_window (GtkToolItemGroup *group,
|
||||||
GtkWidget *toplevel)
|
GtkWidget *toplevel)
|
||||||
{
|
{
|
||||||
GtkToolItemGroupPrivate* priv = group->priv;
|
GtkToolItemGroupPrivate* priv = group->priv;
|
||||||
|
|
||||||
if (toplevel != priv->toplevel)
|
if (toplevel != priv->toplevel)
|
||||||
{
|
{
|
||||||
@ -1224,7 +1224,7 @@ gtk_tool_item_group_remove (GtkContainer *container,
|
|||||||
|
|
||||||
g_return_if_fail (GTK_IS_TOOL_ITEM_GROUP (container));
|
g_return_if_fail (GTK_IS_TOOL_ITEM_GROUP (container));
|
||||||
group = GTK_TOOL_ITEM_GROUP (container);
|
group = GTK_TOOL_ITEM_GROUP (container);
|
||||||
priv = group->priv;
|
priv = group->priv;
|
||||||
|
|
||||||
for (it = priv->children; it != NULL; it = it->next)
|
for (it = priv->children; it != NULL; it = it->next)
|
||||||
{
|
{
|
||||||
@ -1251,7 +1251,7 @@ gtk_tool_item_group_forall (GtkContainer *container,
|
|||||||
gpointer callback_data)
|
gpointer callback_data)
|
||||||
{
|
{
|
||||||
GtkToolItemGroup *group = GTK_TOOL_ITEM_GROUP (container);
|
GtkToolItemGroup *group = GTK_TOOL_ITEM_GROUP (container);
|
||||||
GtkToolItemGroupPrivate* priv = group->priv;
|
GtkToolItemGroupPrivate* priv = group->priv;
|
||||||
GList *children;
|
GList *children;
|
||||||
|
|
||||||
if (internals && priv->header)
|
if (internals && priv->header)
|
||||||
@ -1263,7 +1263,7 @@ gtk_tool_item_group_forall (GtkContainer *container,
|
|||||||
GtkToolItemGroupChild *child = children->data;
|
GtkToolItemGroupChild *child = children->data;
|
||||||
children = children->next; /* store pointer before call to callback
|
children = children->next; /* store pointer before call to callback
|
||||||
because the child pointer is invalid if the
|
because the child pointer is invalid if the
|
||||||
child->item is removed from the item group
|
child->item is removed from the item group
|
||||||
in callback */
|
in callback */
|
||||||
|
|
||||||
callback (GTK_WIDGET (child->item), callback_data);
|
callback (GTK_WIDGET (child->item), callback_data);
|
||||||
@ -1640,7 +1640,7 @@ 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1700,7 +1700,7 @@ gtk_tool_item_group_set_label_widget (GtkToolItemGroup *group,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
alignment = gtk_tool_item_group_get_alignment (group);
|
alignment = gtk_tool_item_group_get_alignment (group);
|
||||||
|
|
||||||
if (priv->label_widget)
|
if (priv->label_widget)
|
||||||
{
|
{
|
||||||
gtk_widget_set_state (priv->label_widget, GTK_STATE_NORMAL);
|
gtk_widget_set_state (priv->label_widget, GTK_STATE_NORMAL);
|
||||||
@ -1712,7 +1712,7 @@ gtk_tool_item_group_set_label_widget (GtkToolItemGroup *group,
|
|||||||
gtk_container_add (GTK_CONTAINER (alignment), label_widget);
|
gtk_container_add (GTK_CONTAINER (alignment), label_widget);
|
||||||
|
|
||||||
priv->label_widget = label_widget;
|
priv->label_widget = label_widget;
|
||||||
|
|
||||||
if (GTK_WIDGET_VISIBLE (group))
|
if (GTK_WIDGET_VISIBLE (group))
|
||||||
gtk_widget_queue_resize (GTK_WIDGET (group));
|
gtk_widget_queue_resize (GTK_WIDGET (group));
|
||||||
|
|
||||||
@ -1757,13 +1757,13 @@ gtk_tool_item_group_get_animation_timestamp (GtkToolItemGroup *group)
|
|||||||
static void
|
static void
|
||||||
gtk_tool_item_group_force_expose (GtkToolItemGroup *group)
|
gtk_tool_item_group_force_expose (GtkToolItemGroup *group)
|
||||||
{
|
{
|
||||||
GtkToolItemGroupPrivate* priv = group->priv;
|
GtkToolItemGroupPrivate* priv = group->priv;
|
||||||
|
|
||||||
if (GTK_WIDGET_REALIZED (priv->header))
|
if (GTK_WIDGET_REALIZED (priv->header))
|
||||||
{
|
{
|
||||||
GtkWidget *alignment = gtk_tool_item_group_get_alignment (group);
|
GtkWidget *alignment = gtk_tool_item_group_get_alignment (group);
|
||||||
GdkRectangle area;
|
GdkRectangle area;
|
||||||
|
|
||||||
/* Find the header button's arrow area... */
|
/* Find the header button's arrow area... */
|
||||||
area.x = alignment->allocation.x;
|
area.x = alignment->allocation.x;
|
||||||
area.y = alignment->allocation.y + (alignment->allocation.height - priv->expander_size) / 2;
|
area.y = alignment->allocation.y + (alignment->allocation.height - priv->expander_size) / 2;
|
||||||
@ -1801,12 +1801,12 @@ static gboolean
|
|||||||
gtk_tool_item_group_animation_cb (gpointer data)
|
gtk_tool_item_group_animation_cb (gpointer data)
|
||||||
{
|
{
|
||||||
GtkToolItemGroup *group = GTK_TOOL_ITEM_GROUP (data);
|
GtkToolItemGroup *group = GTK_TOOL_ITEM_GROUP (data);
|
||||||
GtkToolItemGroupPrivate* priv = group->priv;
|
GtkToolItemGroupPrivate* priv = group->priv;
|
||||||
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));
|
||||||
|
|
||||||
@ -1843,7 +1843,7 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1865,7 +1865,7 @@ gtk_tool_item_group_set_collapsed (GtkToolItemGroup *group,
|
|||||||
|
|
||||||
g_return_if_fail (GTK_IS_TOOL_ITEM_GROUP (group));
|
g_return_if_fail (GTK_IS_TOOL_ITEM_GROUP (group));
|
||||||
|
|
||||||
priv = group->priv;
|
priv = group->priv;
|
||||||
|
|
||||||
parent = gtk_widget_get_parent (GTK_WIDGET (group));
|
parent = gtk_widget_get_parent (GTK_WIDGET (group));
|
||||||
if (GTK_IS_TOOL_PALETTE (parent) && !collapsed)
|
if (GTK_IS_TOOL_PALETTE (parent) && !collapsed)
|
||||||
@ -2090,7 +2090,7 @@ gtk_tool_item_group_set_item_position (GtkToolItemGroup *group,
|
|||||||
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);
|
||||||
priv = group->priv;
|
priv = group->priv;
|
||||||
|
|
||||||
g_return_if_fail (child != NULL);
|
g_return_if_fail (child != NULL);
|
||||||
|
|
||||||
@ -2173,7 +2173,7 @@ gtk_tool_item_group_get_nth_item (GtkToolItemGroup *group,
|
|||||||
return child != NULL ? child->item : NULL;
|
return child != NULL ? child->item : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gtk_tool_item_group_get_drop_item:
|
* gtk_tool_item_group_get_drop_item:
|
||||||
* @group: an #GtkToolItemGroup.
|
* @group: an #GtkToolItemGroup.
|
||||||
* @x: the x position.
|
* @x: the x position.
|
||||||
@ -2277,7 +2277,7 @@ _gtk_tool_item_group_paint (GtkToolItemGroup *group,
|
|||||||
cairo_t *cr)
|
cairo_t *cr)
|
||||||
{
|
{
|
||||||
GtkWidget *widget = GTK_WIDGET (group);
|
GtkWidget *widget = GTK_WIDGET (group);
|
||||||
GtkToolItemGroupPrivate* priv = group->priv;
|
GtkToolItemGroupPrivate* priv = group->priv;
|
||||||
|
|
||||||
gdk_cairo_set_source_pixmap (cr, widget->window,
|
gdk_cairo_set_source_pixmap (cr, widget->window,
|
||||||
widget->allocation.x,
|
widget->allocation.x,
|
||||||
@ -2340,7 +2340,7 @@ _gtk_tool_item_group_get_size_for_limit (GtkToolItemGroup *group,
|
|||||||
gboolean animation)
|
gboolean animation)
|
||||||
{
|
{
|
||||||
GtkRequisition requisition;
|
GtkRequisition requisition;
|
||||||
GtkToolItemGroupPrivate* priv = group->priv;
|
GtkToolItemGroupPrivate* priv = group->priv;
|
||||||
|
|
||||||
gtk_widget_size_request (GTK_WIDGET (group), &requisition);
|
gtk_widget_size_request (GTK_WIDGET (group), &requisition);
|
||||||
|
|
||||||
|
@ -92,4 +92,4 @@ GtkToolItem* gtk_tool_item_group_get_drop_item (GtkToolItemGroup
|
|||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __GTK_TOOL_ITEM_GROUP_H__ */
|
#endif /* __GTK_TOOL_ITEM_GROUP_H__ */
|
||||||
|
@ -92,7 +92,7 @@
|
|||||||
* target = gtk_drawing_area_new ();
|
* target = gtk_drawing_area_new ();
|
||||||
*
|
*
|
||||||
* g_signal_connect (G_OBJECT (target), "drag-data-received",
|
* g_signal_connect (G_OBJECT (target), "drag-data-received",
|
||||||
* G_CALLBACK (passive_canvas_drag_data_received), NULL);
|
* G_CALLBACK (passive_canvas_drag_data_received), NULL);
|
||||||
* gtk_tool_palette_add_drag_dest (GTK_TOOL_PALETTE (palette), target,
|
* gtk_tool_palette_add_drag_dest (GTK_TOOL_PALETTE (palette), target,
|
||||||
* GTK_DEST_DEFAULT_ALL,
|
* GTK_DEST_DEFAULT_ALL,
|
||||||
* GTK_TOOL_PALETTE_DRAG_ITEMS,
|
* GTK_TOOL_PALETTE_DRAG_ITEMS,
|
||||||
@ -147,7 +147,7 @@ struct _GtkToolPalettePrivate
|
|||||||
GtkWidget *expanding_child;
|
GtkWidget *expanding_child;
|
||||||
|
|
||||||
GtkSizeGroup *text_size_group;
|
GtkSizeGroup *text_size_group;
|
||||||
|
|
||||||
GtkSettings *settings;
|
GtkSettings *settings;
|
||||||
gulong settings_connection;
|
gulong settings_connection;
|
||||||
|
|
||||||
@ -225,7 +225,7 @@ gtk_tool_palette_set_property (GObject *object,
|
|||||||
gtk_tool_palette_reconfigured (palette);
|
gtk_tool_palette_reconfigured (palette);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PROP_ICON_SIZE_SET:
|
case PROP_ICON_SIZE_SET:
|
||||||
if ((guint) g_value_get_enum (value) != palette->priv->icon_size)
|
if ((guint) g_value_get_enum (value) != palette->priv->icon_size)
|
||||||
{
|
{
|
||||||
@ -269,7 +269,7 @@ gtk_tool_palette_get_property (GObject *object,
|
|||||||
case PROP_ICON_SIZE:
|
case PROP_ICON_SIZE:
|
||||||
g_value_set_enum (value, gtk_tool_palette_get_icon_size (palette));
|
g_value_set_enum (value, gtk_tool_palette_get_icon_size (palette));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PROP_ICON_SIZE_SET:
|
case PROP_ICON_SIZE_SET:
|
||||||
g_value_set_boolean (value, palette->priv->icon_size_set);
|
g_value_set_boolean (value, palette->priv->icon_size_set);
|
||||||
break;
|
break;
|
||||||
@ -394,7 +394,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);
|
||||||
|
|
||||||
@ -694,7 +694,7 @@ gtk_tool_palette_set_scroll_adjustments (GtkWidget *widget,
|
|||||||
g_object_unref (palette->priv->hadjustment);
|
g_object_unref (palette->priv->hadjustment);
|
||||||
if (palette->priv->vadjustment)
|
if (palette->priv->vadjustment)
|
||||||
g_object_unref (palette->priv->vadjustment);
|
g_object_unref (palette->priv->vadjustment);
|
||||||
|
|
||||||
palette->priv->hadjustment = hadjustment;
|
palette->priv->hadjustment = hadjustment;
|
||||||
palette->priv->vadjustment = vadjustment;
|
palette->priv->vadjustment = vadjustment;
|
||||||
|
|
||||||
@ -714,7 +714,7 @@ gtk_tool_palette_add (GtkContainer *container,
|
|||||||
{
|
{
|
||||||
GtkToolPalette *palette;
|
GtkToolPalette *palette;
|
||||||
GtkToolItemGroupInfo *info = g_new0(GtkToolItemGroupInfo, 1);
|
GtkToolItemGroupInfo *info = g_new0(GtkToolItemGroupInfo, 1);
|
||||||
|
|
||||||
g_return_if_fail (GTK_IS_TOOL_PALETTE (container));
|
g_return_if_fail (GTK_IS_TOOL_PALETTE (container));
|
||||||
g_return_if_fail (GTK_IS_TOOL_ITEM_GROUP (child));
|
g_return_if_fail (GTK_IS_TOOL_ITEM_GROUP (child));
|
||||||
|
|
||||||
@ -829,7 +829,7 @@ static void
|
|||||||
style_change_notify (GtkToolPalette *palette)
|
style_change_notify (GtkToolPalette *palette)
|
||||||
{
|
{
|
||||||
GtkToolPalettePrivate* priv = palette->priv;
|
GtkToolPalettePrivate* priv = palette->priv;
|
||||||
|
|
||||||
if (!priv->style_set)
|
if (!priv->style_set)
|
||||||
{
|
{
|
||||||
/* pretend it was set, then unset, thus reverting to new default */
|
/* pretend it was set, then unset, thus reverting to new default */
|
||||||
@ -842,7 +842,7 @@ static void
|
|||||||
icon_size_change_notify (GtkToolPalette *palette)
|
icon_size_change_notify (GtkToolPalette *palette)
|
||||||
{
|
{
|
||||||
GtkToolPalettePrivate* priv = palette->priv;
|
GtkToolPalettePrivate* priv = palette->priv;
|
||||||
|
|
||||||
if (!priv->icon_size_set)
|
if (!priv->icon_size_set)
|
||||||
{
|
{
|
||||||
/* pretend it was set, then unset, thus reverting to new default */
|
/* pretend it was set, then unset, thus reverting to new default */
|
||||||
@ -870,15 +870,15 @@ gtk_tool_palette_screen_changed (GtkWidget *widget,
|
|||||||
GtkToolPalettePrivate* priv = palette->priv;
|
GtkToolPalettePrivate* priv = palette->priv;
|
||||||
GtkSettings *old_settings = priv->settings;
|
GtkSettings *old_settings = priv->settings;
|
||||||
GtkSettings *settings;
|
GtkSettings *settings;
|
||||||
|
|
||||||
if (gtk_widget_has_screen (GTK_WIDGET (palette)))
|
if (gtk_widget_has_screen (GTK_WIDGET (palette)))
|
||||||
settings = gtk_widget_get_settings (GTK_WIDGET (palette));
|
settings = gtk_widget_get_settings (GTK_WIDGET (palette));
|
||||||
else
|
else
|
||||||
settings = NULL;
|
settings = NULL;
|
||||||
|
|
||||||
if (settings == old_settings)
|
if (settings == old_settings)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (old_settings)
|
if (old_settings)
|
||||||
{
|
{
|
||||||
g_signal_handler_disconnect (old_settings, priv->settings_connection);
|
g_signal_handler_disconnect (old_settings, priv->settings_connection);
|
||||||
@ -925,18 +925,18 @@ gtk_tool_palette_class_init (GtkToolPaletteClass *cls)
|
|||||||
cclass->get_child_property = gtk_tool_palette_get_child_property;
|
cclass->get_child_property = gtk_tool_palette_get_child_property;
|
||||||
|
|
||||||
cls->set_scroll_adjustments = gtk_tool_palette_set_scroll_adjustments;
|
cls->set_scroll_adjustments = gtk_tool_palette_set_scroll_adjustments;
|
||||||
|
|
||||||
/* Handle screen-changed so we can update our GtkSettings.
|
/* Handle screen-changed so we can update our GtkSettings.
|
||||||
*/
|
*/
|
||||||
wclass->screen_changed = gtk_tool_palette_screen_changed;
|
wclass->screen_changed = gtk_tool_palette_screen_changed;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GtkToolPalette::set-scroll-adjustments:
|
* GtkToolPalette::set-scroll-adjustments:
|
||||||
* @widget: the GtkToolPalette that received the signal
|
* @widget: the GtkToolPalette that received the signal
|
||||||
* @hadjustment: The horizontal adjustment
|
* @hadjustment: The horizontal adjustment
|
||||||
* @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 signal to
|
||||||
* connect two instances of GtkScrollbar to the scroll directions of the GtkToolpalette.
|
* connect two instances of GtkScrollbar to the scroll directions of the GtkToolpalette.
|
||||||
*
|
*
|
||||||
@ -955,14 +955,14 @@ gtk_tool_palette_class_init (GtkToolPaletteClass *cls)
|
|||||||
|
|
||||||
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 toolbar-icon-size setting. When this property is set, it
|
||||||
* overrides the setting.
|
* overrides the setting.
|
||||||
*
|
*
|
||||||
* This should only be used for special-purpose toolbars, normal
|
* This should only be used for special-purpose toolbars, normal
|
||||||
* application toolbars should respect the user preferences for the
|
* application toolbars should respect the user preferences for the
|
||||||
* size of icons.
|
* size of icons.
|
||||||
@ -994,7 +994,7 @@ gtk_tool_palette_class_init (GtkToolPaletteClass *cls)
|
|||||||
FALSE,
|
FALSE,
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_NAME |
|
G_PARAM_READWRITE | G_PARAM_STATIC_NAME |
|
||||||
G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
|
G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
|
||||||
|
|
||||||
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"),
|
||||||
@ -1003,7 +1003,7 @@ gtk_tool_palette_class_init (GtkToolPaletteClass *cls)
|
|||||||
DEFAULT_TOOLBAR_STYLE,
|
DEFAULT_TOOLBAR_STYLE,
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_NAME |
|
G_PARAM_READWRITE | G_PARAM_STATIC_NAME |
|
||||||
G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
|
G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
|
||||||
|
|
||||||
|
|
||||||
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",
|
||||||
@ -1056,26 +1056,26 @@ gtk_tool_palette_set_icon_size (GtkToolPalette *palette,
|
|||||||
GtkIconSize icon_size)
|
GtkIconSize icon_size)
|
||||||
{
|
{
|
||||||
GtkToolPalettePrivate *priv;
|
GtkToolPalettePrivate *priv;
|
||||||
|
|
||||||
g_return_if_fail (GTK_IS_TOOL_PALETTE (palette));
|
g_return_if_fail (GTK_IS_TOOL_PALETTE (palette));
|
||||||
g_return_if_fail (icon_size != GTK_ICON_SIZE_INVALID);
|
g_return_if_fail (icon_size != GTK_ICON_SIZE_INVALID);
|
||||||
|
|
||||||
priv = palette->priv;
|
priv = palette->priv;
|
||||||
|
|
||||||
if (!priv->icon_size_set)
|
if (!priv->icon_size_set)
|
||||||
{
|
{
|
||||||
priv->icon_size_set = TRUE;
|
priv->icon_size_set = TRUE;
|
||||||
g_object_notify (G_OBJECT (palette), "icon-size-set");
|
g_object_notify (G_OBJECT (palette), "icon-size-set");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (priv->icon_size == icon_size)
|
if (priv->icon_size == icon_size)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
priv->icon_size = icon_size;
|
priv->icon_size = icon_size;
|
||||||
g_object_notify (G_OBJECT (palette), "icon-size");
|
g_object_notify (G_OBJECT (palette), "icon-size");
|
||||||
|
|
||||||
gtk_tool_palette_reconfigured (palette);
|
gtk_tool_palette_reconfigured (palette);
|
||||||
|
|
||||||
gtk_widget_queue_resize (GTK_WIDGET (palette));
|
gtk_widget_queue_resize (GTK_WIDGET (palette));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1100,13 +1100,13 @@ gtk_tool_palette_unset_icon_size (GtkToolPalette *palette)
|
|||||||
{
|
{
|
||||||
GtkToolPalettePrivate* priv = palette->priv;
|
GtkToolPalettePrivate* priv = palette->priv;
|
||||||
GtkIconSize size;
|
GtkIconSize size;
|
||||||
|
|
||||||
g_return_if_fail (GTK_IS_TOOL_PALETTE (palette));
|
g_return_if_fail (GTK_IS_TOOL_PALETTE (palette));
|
||||||
|
|
||||||
if (palette->priv->icon_size_set)
|
if (palette->priv->icon_size_set)
|
||||||
{
|
{
|
||||||
GtkSettings *settings = toolpalette_get_settings (palette);
|
GtkSettings *settings = toolpalette_get_settings (palette);
|
||||||
|
|
||||||
if (settings)
|
if (settings)
|
||||||
{
|
{
|
||||||
g_object_get (settings,
|
g_object_get (settings,
|
||||||
@ -1115,20 +1115,20 @@ gtk_tool_palette_unset_icon_size (GtkToolPalette *palette)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
size = DEFAULT_ICON_SIZE;
|
size = DEFAULT_ICON_SIZE;
|
||||||
|
|
||||||
if (size != palette->priv->icon_size)
|
if (size != palette->priv->icon_size)
|
||||||
{
|
{
|
||||||
gtk_tool_palette_set_icon_size (palette, size);
|
gtk_tool_palette_set_icon_size (palette, size);
|
||||||
g_object_notify (G_OBJECT (palette), "icon-size");
|
g_object_notify (G_OBJECT (palette), "icon-size");
|
||||||
}
|
}
|
||||||
|
|
||||||
priv->icon_size_set = FALSE;
|
priv->icon_size_set = FALSE;
|
||||||
g_object_notify (G_OBJECT (palette), "icon-size-set");
|
g_object_notify (G_OBJECT (palette), "icon-size-set");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 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 emiting a signal instead of just calling a function,
|
||||||
* but I don't see how that is useful. murrayc.
|
* but I don't see how that is useful. murrayc.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
@ -1136,13 +1136,13 @@ gtk_tool_palette_change_style (GtkToolPalette *palette,
|
|||||||
GtkToolbarStyle style)
|
GtkToolbarStyle style)
|
||||||
{
|
{
|
||||||
GtkToolPalettePrivate* priv = palette->priv;
|
GtkToolPalettePrivate* priv = palette->priv;
|
||||||
|
|
||||||
if (priv->style != style)
|
if (priv->style != style)
|
||||||
{
|
{
|
||||||
priv->style = style;
|
priv->style = style;
|
||||||
|
|
||||||
gtk_tool_palette_reconfigured (palette);
|
gtk_tool_palette_reconfigured (palette);
|
||||||
|
|
||||||
gtk_widget_queue_resize (GTK_WIDGET (palette));
|
gtk_widget_queue_resize (GTK_WIDGET (palette));
|
||||||
g_object_notify (G_OBJECT (palette), "toolbar-style");
|
g_object_notify (G_OBJECT (palette), "toolbar-style");
|
||||||
}
|
}
|
||||||
@ -1164,7 +1164,7 @@ gtk_tool_palette_set_style (GtkToolPalette *palette,
|
|||||||
{
|
{
|
||||||
g_return_if_fail (GTK_IS_TOOL_PALETTE (palette));
|
g_return_if_fail (GTK_IS_TOOL_PALETTE (palette));
|
||||||
|
|
||||||
palette->priv->style_set = TRUE;
|
palette->priv->style_set = TRUE;
|
||||||
gtk_tool_palette_change_style (palette, style);
|
gtk_tool_palette_change_style (palette, style);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1172,7 +1172,7 @@ 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(), so that
|
||||||
* user preferences will be used to determine the toolbar style.
|
* user preferences will be used to determine the toolbar style.
|
||||||
**/
|
**/
|
||||||
@ -1181,23 +1181,23 @@ gtk_tool_palette_unset_style (GtkToolPalette *palette)
|
|||||||
{
|
{
|
||||||
GtkToolPalettePrivate* priv = palette->priv;
|
GtkToolPalettePrivate* priv = palette->priv;
|
||||||
GtkToolbarStyle style;
|
GtkToolbarStyle style;
|
||||||
|
|
||||||
g_return_if_fail (GTK_IS_TOOL_PALETTE (palette));
|
g_return_if_fail (GTK_IS_TOOL_PALETTE (palette));
|
||||||
|
|
||||||
if (priv->style_set)
|
if (priv->style_set)
|
||||||
{
|
{
|
||||||
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;
|
||||||
|
|
||||||
if (style != priv->style)
|
if (style != priv->style)
|
||||||
gtk_tool_palette_change_style (palette, style);
|
gtk_tool_palette_change_style (palette, style);
|
||||||
|
|
||||||
priv->style_set = FALSE;
|
priv->style_set = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1207,7 +1207,7 @@ gtk_tool_palette_unset_style (GtkToolPalette *palette)
|
|||||||
* @palette: an #GtkToolPalette.
|
* @palette: an #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
|
||||||
@ -1237,7 +1237,7 @@ gtk_tool_palette_get_style (GtkToolPalette *palette)
|
|||||||
}
|
}
|
||||||
|
|
||||||
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;
|
||||||
@ -1265,7 +1265,7 @@ gtk_tool_palette_set_group_position (GtkToolPalette *palette,
|
|||||||
gint position)
|
gint position)
|
||||||
{
|
{
|
||||||
GtkToolItemGroupInfo *group_new;
|
GtkToolItemGroupInfo *group_new;
|
||||||
GtkToolItemGroupInfo *group_old;
|
GtkToolItemGroupInfo *group_old;
|
||||||
gint old_position;
|
gint old_position;
|
||||||
|
|
||||||
g_return_if_fail (GTK_IS_TOOL_PALETTE (palette));
|
g_return_if_fail (GTK_IS_TOOL_PALETTE (palette));
|
||||||
@ -1279,11 +1279,11 @@ 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;
|
||||||
|
|
||||||
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);
|
||||||
@ -1458,7 +1458,7 @@ gtk_tool_palette_get_exclusive (GtkToolPalette *palette,
|
|||||||
g_return_val_if_fail (position >= 0, DEFAULT_CHILD_EXCLUSIVE);
|
g_return_val_if_fail (position >= 0, DEFAULT_CHILD_EXCLUSIVE);
|
||||||
|
|
||||||
info = g_ptr_array_index (palette->priv->groups, position);
|
info = g_ptr_array_index (palette->priv->groups, position);
|
||||||
|
|
||||||
return info->exclusive;
|
return info->exclusive;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1487,7 +1487,7 @@ gtk_tool_palette_get_expand (GtkToolPalette *palette,
|
|||||||
g_return_val_if_fail (position >= 0, DEFAULT_CHILD_EXPAND);
|
g_return_val_if_fail (position >= 0, DEFAULT_CHILD_EXPAND);
|
||||||
|
|
||||||
info = g_ptr_array_index (palette->priv->groups, position);
|
info = g_ptr_array_index (palette->priv->groups, position);
|
||||||
|
|
||||||
return info->expand;
|
return info->expand;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1572,7 +1572,7 @@ gtk_tool_palette_get_drop_group (GtkToolPalette *palette,
|
|||||||
* @palette: an #GtkToolPalette.
|
* @palette: an #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. This could be a #GtkToolItem or
|
||||||
* an #GtkToolItemGroup.
|
* an #GtkToolItemGroup.
|
||||||
*
|
*
|
||||||
* Returns: the dragged item in selection.
|
* Returns: the dragged item in selection.
|
||||||
@ -1654,7 +1654,7 @@ gtk_tool_palette_set_drag_source (GtkToolPalette *palette,
|
|||||||
* Sets the tool palette as drag source (see gtk_tool_palette_set_drag_source()) and
|
* Sets the tool palette as drag source (see gtk_tool_palette_set_drag_source()) and
|
||||||
* sets widget as a drag destination for drags from palette. With flags the actions
|
* 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
|
* (like highlighting and target checking) which should be performed by GTK+ for
|
||||||
* drops on widget can be specified. With targets the supported drag targets
|
* 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
|
* (groups and/or items) can be specified. With actions the supported drag actions
|
||||||
* (copy and move) can be specified.
|
* (copy and move) can be specified.
|
||||||
*
|
*
|
||||||
@ -1792,7 +1792,7 @@ _gtk_tool_palette_child_set_drag_source (GtkWidget *child,
|
|||||||
G_CALLBACK (gtk_tool_palette_item_drag_data_get),
|
G_CALLBACK (gtk_tool_palette_item_drag_data_get),
|
||||||
palette);
|
palette);
|
||||||
}
|
}
|
||||||
else if (GTK_IS_BUTTON (child) &&
|
else if (GTK_IS_BUTTON (child) &&
|
||||||
(palette->priv->drag_source & GTK_TOOL_PALETTE_DRAG_GROUPS))
|
(palette->priv->drag_source & GTK_TOOL_PALETTE_DRAG_GROUPS))
|
||||||
{
|
{
|
||||||
gtk_drag_source_set (child, GDK_BUTTON1_MASK | GDK_BUTTON3_MASK,
|
gtk_drag_source_set (child, GDK_BUTTON1_MASK | GDK_BUTTON3_MASK,
|
||||||
|
@ -44,7 +44,7 @@ typedef struct _GtkToolPalettePrivate GtkToolPalettePrivate;
|
|||||||
* @GTK_TOOL_PALETTE_DRAG_ITEMS: Support drag of items.
|
* @GTK_TOOL_PALETTE_DRAG_ITEMS: Support drag of items.
|
||||||
* @GTK_TOOL_PALETTE_DRAG_GROUPS: Support drag of groups.
|
* @GTK_TOOL_PALETTE_DRAG_GROUPS: Support drag of groups.
|
||||||
*
|
*
|
||||||
* Flags used to specify the supported drag targets.
|
* Flags used to specify the supported drag targets.
|
||||||
*/
|
*/
|
||||||
typedef enum /*< flags >*/
|
typedef enum /*< flags >*/
|
||||||
{
|
{
|
||||||
@ -71,14 +71,14 @@ struct _GtkToolPaletteClass
|
|||||||
void (*set_scroll_adjustments) (GtkWidget *widget,
|
void (*set_scroll_adjustments) (GtkWidget *widget,
|
||||||
GtkAdjustment *hadjustment,
|
GtkAdjustment *hadjustment,
|
||||||
GtkAdjustment *vadjustment);
|
GtkAdjustment *vadjustment);
|
||||||
|
|
||||||
/* Padding for future expansion */
|
/* Padding for future expansion */
|
||||||
void (*_gtk_reserved1) (void);
|
void (*_gtk_reserved1) (void);
|
||||||
void (*_gtk_reserved2) (void);
|
void (*_gtk_reserved2) (void);
|
||||||
void (*_gtk_reserved3) (void);
|
void (*_gtk_reserved3) (void);
|
||||||
void (*_gtk_reserved4) (void);
|
void (*_gtk_reserved4) (void);
|
||||||
void (*_gtk_reserved5) (void);
|
void (*_gtk_reserved5) (void);
|
||||||
void (*_gtk_reserved6) (void);
|
void (*_gtk_reserved6) (void);
|
||||||
};
|
};
|
||||||
|
|
||||||
GType gtk_tool_palette_get_type (void) G_GNUC_CONST;
|
GType gtk_tool_palette_get_type (void) G_GNUC_CONST;
|
||||||
@ -137,4 +137,4 @@ G_CONST_RETURN GtkTargetEntry* gtk_tool_palette_get_drag_target_group (void) G_G
|
|||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __GTK_TOOL_PALETTE_H__ */
|
#endif /* __GTK_TOOL_PALETTE_H__ */
|
||||||
|
Loading…
Reference in New Issue
Block a user