native-layout: Don't expose extra gtk_widget_* function that are similar to the GtkExtendedLayout interface

This commit is contained in:
Johannes Schmid 2009-12-14 16:28:56 +01:00
parent c659d1a505
commit 9724366289
3 changed files with 60 additions and 66 deletions

View File

@ -482,15 +482,15 @@ gtk_box_size_allocate (GtkWidget *widget,
if (GTK_WIDGET_VISIBLE (child->widget))
{
if (private->orientation == GTK_ORIENTATION_HORIZONTAL)
gtk_widget_get_width_for_height (child->widget,
allocation->height,
&sizes[i].minimum_size,
&sizes[i].natural_size);
gtk_extended_layout_get_width_for_height (GTK_EXTENDED_LAYOUT (child->widget),
allocation->height,
&sizes[i].minimum_size,
&sizes[i].natural_size);
else
gtk_widget_get_height_for_width (child->widget,
allocation->width,
&sizes[i].minimum_size,
&sizes[i].natural_size);
gtk_extended_layout_get_width_for_height (GTK_EXTENDED_LAYOUT (child->widget),
allocation->width,
&sizes[i].minimum_size,
&sizes[i].natural_size);
size -= sizes[i].minimum_size;

View File

@ -10593,6 +10593,56 @@ gtk_widget_real_get_desired_size (GtkExtendedLayout *layout,
*natural_size = requisition;
}
static void
gtk_widget_real_get_height_for_width (GtkExtendedLayout *layout,
gint width,
gint *minimum_height,
gint *natural_height)
{
GtkRequisition minimum_size;
GtkRequisition natural_size;
g_return_if_fail (GTK_IS_WIDGET (layout));
#if 0
TODO: integrate height-for-width with size-groups
#else
gtk_widget_get_desired_size (GTK_WIDGET(layout),
minimum_height ? &minimum_size : NULL,
natural_height ? &natural_size : NULL);
if (minimum_height)
*minimum_height = minimum_size.height;
if (natural_height)
*natural_height = natural_size.height;
#endif
}
static void
gtk_widget_real_get_width_for_height (GtkExtendedLayout *layout,
gint height,
gint *minimum_width,
gint *natural_width)
{
GtkRequisition minimum_size;
GtkRequisition natural_size;
g_return_if_fail (GTK_IS_WIDGET (layout));
#if 0
TODO: integrate width-for-height with size-groups
#else
gtk_widget_get_desired_size (GTK_WIDGET(layout),
minimum_width ? &minimum_size : NULL,
natural_width ? &natural_size : NULL);
if (minimum_width)
*minimum_width = minimum_size.width;
if (natural_width)
*natural_width = natural_size.width;
#endif
}
/**
* gtk_widget_get_desired_size:
* @widget: a #GtkWidget
@ -10613,60 +10663,12 @@ gtk_widget_get_desired_size (GtkWidget *widget,
_gtk_size_group_compute_desired_size (widget, minimum_size, natural_size);
}
void
gtk_widget_get_height_for_width (GtkWidget *widget,
gint width,
gint *minimum_height,
gint *natural_height)
{
GtkRequisition minimum_size;
GtkRequisition natural_size;
g_return_if_fail (GTK_IS_WIDGET (widget));
#if 0
TODO: integrate height-for-width with size-groups
#else
gtk_widget_get_desired_size (widget,
minimum_height ? &minimum_size : NULL,
natural_height ? &natural_size : NULL);
if (minimum_height)
*minimum_height = minimum_size.height;
if (natural_height)
*natural_height = natural_size.height;
#endif
}
void
gtk_widget_get_width_for_height (GtkWidget *widget,
gint height,
gint *minimum_width,
gint *natural_width)
{
GtkRequisition minimum_size;
GtkRequisition natural_size;
g_return_if_fail (GTK_IS_WIDGET (widget));
#if 0
TODO: integrate width-for-height with size-groups
#else
gtk_widget_get_desired_size (widget,
minimum_width ? &minimum_size : NULL,
natural_width ? &natural_size : NULL);
if (minimum_width)
*minimum_width = minimum_size.width;
if (natural_width)
*natural_width = natural_size.width;
#endif
}
static void
gtk_widget_layout_interface_init (GtkExtendedLayoutIface *iface)
{
iface->get_desired_size = gtk_widget_real_get_desired_size;
iface->get_width_for_height = gtk_widget_real_get_width_for_height;
iface->get_height_for_width = gtk_widget_real_get_height_for_width;
}

View File

@ -777,14 +777,6 @@ void gtk_widget_size_allocate (GtkWidget *widget,
void gtk_widget_get_desired_size (GtkWidget *widget,
GtkRequisition *minimum_size,
GtkRequisition *natural_size);
void gtk_widget_get_height_for_width(GtkWidget *widget,
gint width,
gint *minimum_height,
gint *natural_height);
void gtk_widget_get_width_for_height(GtkWidget *widget,
gint height,
gint *minimum_width,
gint *natural_width);
void gtk_widget_get_child_requisition (GtkWidget *widget,
GtkRequisition *requisition);
void gtk_widget_add_accelerator (GtkWidget *widget,