-static void
-compute_dimension (GtkWidget *widget,
- GtkSizeGroupMode mode,
- gint *minimum, /* in-out */
- gint *natural) /* in-out */
-{
- GSList *widgets = NULL;
- GSList *groups = NULL;
- GSList *tmp_list;
- gint min_result = 0, nat_result = 0;
-
- add_widget_to_closure (widget, mode, &groups, &widgets);
- g_slist_foreach (widgets, (GFunc)mark_widget_unvisited, NULL);
- g_slist_foreach (groups, (GFunc)mark_group_unvisited, NULL);
-
- g_slist_foreach (widgets, (GFunc)g_object_ref, NULL);
-
- if (!groups)
- {
- min_result = *minimum;
- nat_result = *natural;
- }
- else
- {
- GtkSizeGroup *group = groups->data;
- GtkSizeGroupPrivate *priv = group->priv;
-
- tmp_list = widgets;
- while (tmp_list)
- {
- GtkWidget *tmp_widget = tmp_list->data;
- gint min_dimension, nat_dimension;
-
- if (tmp_widget == widget)
- {
- min_dimension = *minimum;
- nat_dimension = *natural;
- }
- else if (!gtk_widget_get_mapped (tmp_widget) && priv->ignore_hidden)
- {
- min_dimension = 0;
- nat_dimension = 0;
- }
- else
- {
- if (mode == GTK_SIZE_GROUP_HORIZONTAL)
- gtk_widget_get_preferred_width (tmp_widget, &min_dimension, &nat_dimension);
- else
- gtk_widget_get_preferred_height (tmp_widget, &min_dimension, &nat_dimension);
- }
-
- min_result = MAX (min_result, min_dimension);
- nat_result = MAX (nat_result, nat_dimension);
-
- tmp_list = tmp_list->next;
- }
- }
-
- g_slist_foreach (widgets, (GFunc)g_object_unref, NULL);
-
- g_slist_free (widgets);
- g_slist_free (groups);
-
- *minimum = min_result;
- *natural = nat_result;
-}
-
-/**
- * _gtk_size_group_bump_requisition:
- * @widget: a #GtkWidget
- * @mode: either %GTK_SIZE_GROUP_HORIZONTAL or %GTK_SIZE_GROUP_VERTICAL, depending
- * on the dimension in which to bump the size.
- * @minimum: a pointer to the widget's minimum size
- * @natural: a pointer to the widget's natural size
- *
- * Refreshes the sizegroup while returning the groups requested
- * value in the dimension @mode.
- *
- * This function is used both to update sizegroup minimum and natural size
- * information and widget minimum and natural sizes in multiple passes from
- * the size request apis.
- */
-void
-_gtk_size_group_bump_requisition (GtkWidget *widget,
- GtkSizeGroupMode mode,
- gint *minimum,
- gint *natural)
-{
- if (!_gtk_widget_get_sizegroup_bumping (widget))
- {
- /* Avoid recursion here */
- _gtk_widget_set_sizegroup_bumping (widget, TRUE);
-
- if (_gtk_widget_get_sizegroups (widget))
- compute_dimension (widget, mode, minimum, natural);
-
- _gtk_widget_set_sizegroup_bumping (widget, FALSE);
- }
-}
-
-
-