Commit edd57602 authored by Tristan Van Berkom's avatar Tristan Van Berkom

Mass api change from GtkExtendedLayout --> GtkSizeRequest

This commit makes a few massive changes to the extended layout
code:
  a.) gtkextendedlayout.c --> gtksizerequest.c
  b.) _is_height_for_width --> get_request_mode()
  c.) get_desired_size(), get_desired_width(), get_desired_height() -->
      get_size(), get_width(), get_height()

This is the first partial commit and only effects portions
of the tree that have already been merged in master (in order to
easily cherry pick this commit).

Conflicts:

	gtk/Makefile.am
	gtk/gtk.h
	gtk/gtk.symbols
	gtk/gtkextendedlayout.h
parent cf75457f
......@@ -214,7 +214,6 @@ gtk_public_h_sources = \
gtkenums.h \
gtkeventbox.h \
gtkexpander.h \
gtkextendedlayout.h \
gtkfilechooser.h \
gtkfilechooserbutton.h \
gtkfilechooserdialog.h \
......@@ -299,6 +298,7 @@ gtk_public_h_sources = \
gtkshow.h \
gtksettings.h \
gtksizegroup.h \
gtksizerequest.h \
gtksocket.h \
gtkspinbutton.h \
gtkspinner.h \
......@@ -470,7 +470,6 @@ gtk_base_c_sources = \
gtkentrycompletion.c \
gtkeventbox.c \
gtkexpander.c \
gtkextendedlayout.c \
gtkfilechooser.c \
gtkfilechooserbutton.c \
gtkfilechooserdefault.c \
......@@ -570,6 +569,7 @@ gtk_base_c_sources = \
gtkseparatortoolitem.c \
gtksettings.c \
gtksizegroup.c \
gtksizerequest.c \
gtkshow.c \
gtksocket.c \
gtkspinbutton.c \
......
......@@ -84,7 +84,6 @@
#include <gtk/gtkenums.h>
#include <gtk/gtkeventbox.h>
#include <gtk/gtkexpander.h>
#include <gtk/gtkextendedlayout.h>
#include <gtk/gtkfixed.h>
#include <gtk/gtkfilechooser.h>
#include <gtk/gtkfilechooserbutton.h>
......@@ -167,6 +166,7 @@
#include <gtk/gtksettings.h>
#include <gtk/gtkshow.h>
#include <gtk/gtksizegroup.h>
#include <gtk/gtksizerequest.h>
#include <gtk/gtksocket.h>
#include <gtk/gtkspinbutton.h>
#include <gtk/gtkspinner.h>
......
......@@ -1218,18 +1218,6 @@ gtk_expander_set_use_underline
#endif
#endif
#if IN_HEADER(__GTK_EXTENDED_LAYOUT_H__)
#if IN_FILE(__GTK_EXTENDED_LAYOUT_C__)
gtk_extended_layout_get_type G_GNUC_CONST
gtk_extended_layout_get_desired_height
gtk_extended_layout_get_desired_size
gtk_extended_layout_get_desired_width
gtk_extended_layout_get_height_for_width
gtk_extended_layout_get_width_for_height
gtk_extended_layout_is_height_for_width
#endif
#endif
#if IN_HEADER(__GTK_FILE_CHOOSER_H__)
#if IN_FILE(__GTK_FILE_CHOOSER_C__)
gtk_file_chooser_add_filter
......@@ -3183,6 +3171,18 @@ gtk_size_group_set_mode
#endif
#endif
#if IN_HEADER(__GTK_SIZE_REQUEST_H__)
#if IN_FILE(__GTK_SIZE_REQUEST_C__)
gtk_size_request_get_height
gtk_size_request_get_height_for_width
gtk_size_request_get_request_mode
gtk_size_request_get_size
gtk_size_request_get_type G_GNUC_CONST
gtk_size_request_get_width
gtk_size_request_get_width_for_height
#endif
#endif
#if IN_HEADER(__GTK_SHOW_H__)
#if IN_FILE(__GTK_SHOW_C__)
gtk_show_uri
......
......@@ -45,7 +45,7 @@
#include "config.h"
#include "gtkalignment.h"
#include "gtkextendedlayout.h"
#include "gtksizerequest.h"
#include "gtkprivate.h"
#include "gtkintl.h"
#include "gtkalias.h"
......@@ -85,17 +85,17 @@ static void gtk_alignment_get_property (GObject *object,
GValue *value,
GParamSpec *pspec);
static void gtk_alignment_extended_layout_init (GtkExtendedLayoutIface *iface);
static void gtk_alignment_get_desired_width (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size);
static void gtk_alignment_get_desired_height (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size);
static void gtk_alignment_size_request_init (GtkSizeRequestIface *iface);
static void gtk_alignment_get_width (GtkSizeRequest *widget,
gint *minimum_size,
gint *natural_size);
static void gtk_alignment_get_height (GtkSizeRequest *widget,
gint *minimum_size,
gint *natural_size);
G_DEFINE_TYPE_WITH_CODE (GtkAlignment, gtk_alignment, GTK_TYPE_BIN,
G_IMPLEMENT_INTERFACE (GTK_TYPE_EXTENDED_LAYOUT,
gtk_alignment_extended_layout_init))
G_IMPLEMENT_INTERFACE (GTK_TYPE_SIZE_REQUEST,
gtk_alignment_size_request_init))
static void
gtk_alignment_class_init (GtkAlignmentClass *class)
......@@ -491,7 +491,7 @@ gtk_alignment_size_allocate (GtkWidget *widget,
if (bin->child && gtk_widget_get_visible (bin->child))
{
GtkExtendedLayout *layout = GTK_EXTENDED_LAYOUT (bin->child);
GtkSizeRequest *child = GTK_SIZE_REQUEST (bin->child);
gint child_nat_width;
gint child_nat_height;
gint child_width, child_height;
......@@ -505,23 +505,23 @@ gtk_alignment_size_allocate (GtkWidget *widget,
width = MAX (1, allocation->width - padding_horizontal - 2 * border_width);
height = MAX (1, allocation->height - padding_vertical - 2 * border_width);
if (gtk_extended_layout_is_height_for_width (layout))
if (gtk_size_request_get_request_mode (child) == GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH)
{
gtk_extended_layout_get_desired_width (layout, NULL, &child_nat_width);
gtk_size_request_get_width (child, NULL, &child_nat_width);
child_width = MIN (width, child_nat_width);
gtk_extended_layout_get_height_for_width (layout, child_width, NULL, &child_nat_height);
gtk_size_request_get_height_for_width (child, child_width, NULL, &child_nat_height);
child_height = MIN (height, child_nat_height);
}
else
{
gtk_extended_layout_get_desired_height (layout, NULL, &child_nat_height);
gtk_size_request_get_height (child, NULL, &child_nat_height);
child_height = MIN (height, child_nat_height);
gtk_extended_layout_get_width_for_height (layout, child_height, NULL, &child_nat_width);
gtk_size_request_get_width_for_height (child, child_height, NULL, &child_nat_width);
child_width = MIN (width, child_nat_width);
}
......@@ -553,27 +553,27 @@ gtk_alignment_size_allocate (GtkWidget *widget,
static void
gtk_alignment_extended_layout_init (GtkExtendedLayoutIface *iface)
gtk_alignment_size_request_init (GtkSizeRequestIface *iface)
{
iface->get_desired_width = gtk_alignment_get_desired_width;
iface->get_desired_height = gtk_alignment_get_desired_height;
iface->get_width = gtk_alignment_get_width;
iface->get_height = gtk_alignment_get_height;
}
static void
gtk_alignment_get_desired_size (GtkExtendedLayout *layout,
GtkOrientation orientation,
gint *minimum_size,
gint *natural_size)
gtk_alignment_get_size (GtkSizeRequest *widget,
GtkOrientation orientation,
gint *minimum_size,
gint *natural_size)
{
GtkWidget *child;
GtkAlignmentPrivate *priv;
gint minimum, natural;
priv = GTK_ALIGNMENT_GET_PRIVATE (layout);
priv = GTK_ALIGNMENT_GET_PRIVATE (widget);
natural = minimum = GTK_CONTAINER (layout)->border_width * 2;
natural = minimum = GTK_CONTAINER (widget)->border_width * 2;
if ((child = gtk_bin_get_child (GTK_BIN (layout))) && gtk_widget_get_visible (child))
if ((child = gtk_bin_get_child (GTK_BIN (widget))) && gtk_widget_get_visible (child))
{
gint child_min, child_nat;
......@@ -581,14 +581,14 @@ gtk_alignment_get_desired_size (GtkExtendedLayout *layout,
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
minimum += (priv->padding_left + priv->padding_right);
gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (child),
&child_min, &child_nat);
gtk_size_request_get_width (GTK_SIZE_REQUEST (child),
&child_min, &child_nat);
}
else
{
minimum += (priv->padding_top + priv->padding_bottom);
gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (child),
&child_min, &child_nat);
gtk_size_request_get_height (GTK_SIZE_REQUEST (child),
&child_min, &child_nat);
}
natural = minimum;
......@@ -605,19 +605,19 @@ gtk_alignment_get_desired_size (GtkExtendedLayout *layout,
}
static void
gtk_alignment_get_desired_width (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size)
gtk_alignment_get_width (GtkSizeRequest *widget,
gint *minimum_size,
gint *natural_size)
{
gtk_alignment_get_desired_size (layout, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size);
gtk_alignment_get_size (widget, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size);
}
static void
gtk_alignment_get_desired_height (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size)
gtk_alignment_get_height (GtkSizeRequest *widget,
gint *minimum_size,
gint *natural_size)
{
gtk_alignment_get_desired_size (layout, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size);
gtk_alignment_get_size (widget, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size);
}
/**
......
......@@ -39,7 +39,7 @@
#include "config.h"
#include "gtkbin.h"
#include "gtkextendedlayout.h"
#include "gtksizerequest.h"
#include "gtkintl.h"
#include "gtkalias.h"
......@@ -54,22 +54,22 @@ static void gtk_bin_forall (GtkContainer *container,
static GType gtk_bin_child_type (GtkContainer *container);
static void gtk_bin_extended_layout_init (GtkExtendedLayoutIface *iface);
static gboolean gtk_bin_is_height_for_width (GtkExtendedLayout *layout);
static void gtk_bin_get_width_for_height (GtkExtendedLayout *layout,
gint height,
gint *minimum_width,
gint *natural_width);
static void gtk_bin_get_height_for_width (GtkExtendedLayout *layout,
gint width,
gint *minimum_height,
gint *natural_height);
static void gtk_bin_size_request_init (GtkSizeRequestIface *iface);
static GtkSizeRequestMode gtk_bin_get_request_mode (GtkSizeRequest *widget);
static void gtk_bin_get_width_for_height (GtkSizeRequest *widget,
gint height,
gint *minimum_width,
gint *natural_width);
static void gtk_bin_get_height_for_width (GtkSizeRequest *widget,
gint width,
gint *minimum_height,
gint *natural_height);
static GtkExtendedLayoutIface *parent_extended_layout_iface;
static GtkSizeRequestIface *parent_size_request_iface;
G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GtkBin, gtk_bin, GTK_TYPE_CONTAINER,
G_IMPLEMENT_INTERFACE (GTK_TYPE_EXTENDED_LAYOUT,
gtk_bin_extended_layout_init))
G_IMPLEMENT_INTERFACE (GTK_TYPE_SIZE_REQUEST,
gtk_bin_size_request_init))
static void
gtk_bin_class_init (GtkBinClass *class)
......@@ -159,7 +159,7 @@ gtk_bin_forall (GtkContainer *container,
/* GtkBin widgets define the padding and borders independantly so
* we cannot provide a generic get_desired_size() for the same reason
* we cannot provide a generic get_size() for the same reason
* we never implemented size_request() here.
*
* But for cases where the GtkBin class's padding is constant and
......@@ -168,24 +168,24 @@ gtk_bin_forall (GtkContainer *container,
* cases by using the delta of the base size requsts.
*/
static void
gtk_bin_extended_layout_init (GtkExtendedLayoutIface *iface)
gtk_bin_size_request_init (GtkSizeRequestIface *iface)
{
parent_extended_layout_iface = g_type_interface_peek_parent (iface);
parent_size_request_iface = g_type_interface_peek_parent (iface);
iface->is_height_for_width = gtk_bin_is_height_for_width;
iface->get_request_mode = gtk_bin_get_request_mode;
iface->get_width_for_height = gtk_bin_get_width_for_height;
iface->get_height_for_width = gtk_bin_get_height_for_width;
}
static gboolean
gtk_bin_is_height_for_width (GtkExtendedLayout *layout)
static GtkSizeRequestMode
gtk_bin_get_request_mode (GtkSizeRequest *widget)
{
GtkBin *bin = GTK_BIN (layout);
GtkBin *bin = GTK_BIN (widget);
if (bin->child)
return gtk_extended_layout_is_height_for_width (GTK_EXTENDED_LAYOUT (bin->child));
return gtk_size_request_get_request_mode (GTK_SIZE_REQUEST (bin->child));
return TRUE;
return GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH;
}
static void
......@@ -195,30 +195,30 @@ get_child_padding_delta (GtkBin *bin,
{
gint hmin, vmin, child_hmin, child_vmin;
gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (bin), &hmin, NULL);
gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (bin), &vmin, NULL);
gtk_size_request_get_width (GTK_SIZE_REQUEST (bin), &hmin, NULL);
gtk_size_request_get_height (GTK_SIZE_REQUEST (bin), &vmin, NULL);
gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (bin->child), &child_hmin, NULL);
gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (bin->child), &child_vmin, NULL);
gtk_size_request_get_width (GTK_SIZE_REQUEST (bin->child), &child_hmin, NULL);
gtk_size_request_get_height (GTK_SIZE_REQUEST (bin->child), &child_vmin, NULL);
*delta_h = hmin - child_hmin;
*delta_v = vmin - child_vmin;
}
static void
gtk_bin_get_width_for_height (GtkExtendedLayout *layout,
gint height,
gint *minimum_width,
gint *natural_width)
gtk_bin_get_width_for_height (GtkSizeRequest *widget,
gint height,
gint *minimum_width,
gint *natural_width)
{
GtkBin *bin = GTK_BIN (layout);
GtkBin *bin = GTK_BIN (widget);
gint hdelta, vdelta, child_min, child_nat;
if (bin->child)
{
get_child_padding_delta (bin, &hdelta, &vdelta);
gtk_extended_layout_get_width_for_height (GTK_EXTENDED_LAYOUT (bin->child),
gtk_size_request_get_width_for_height (GTK_SIZE_REQUEST (bin->child),
height - vdelta,
&child_min, &child_nat);
......@@ -229,23 +229,23 @@ gtk_bin_get_width_for_height (GtkExtendedLayout *layout,
*natural_width = child_nat + hdelta;
}
else
GTK_EXTENDED_LAYOUT_GET_IFACE (layout)->get_desired_width (layout, minimum_width, natural_width);
GTK_SIZE_REQUEST_GET_IFACE (widget)->get_width (widget, minimum_width, natural_width);
}
static void
gtk_bin_get_height_for_width (GtkExtendedLayout *layout,
gint width,
gint *minimum_height,
gint *natural_height)
gtk_bin_get_height_for_width (GtkSizeRequest *widget,
gint width,
gint *minimum_height,
gint *natural_height)
{
GtkBin *bin = GTK_BIN (layout);
GtkBin *bin = GTK_BIN (widget);
gint hdelta, vdelta, child_min, child_nat;
if (bin->child)
{
get_child_padding_delta (bin, &hdelta, &vdelta);
gtk_extended_layout_get_height_for_width (GTK_EXTENDED_LAYOUT (bin->child),
gtk_size_request_get_height_for_width (GTK_SIZE_REQUEST (bin->child),
width - hdelta,
&child_min, &child_nat);
......@@ -256,7 +256,7 @@ gtk_bin_get_height_for_width (GtkExtendedLayout *layout,
*natural_height = child_nat + vdelta;
}
else
GTK_EXTENDED_LAYOUT_GET_IFACE (layout)->get_desired_height (layout, minimum_height, natural_height);
GTK_SIZE_REQUEST_GET_IFACE (widget)->get_height (widget, minimum_height, natural_height);
}
......
......@@ -77,7 +77,7 @@
#include "gtkbox.h"
#include "gtkorientable.h"
#include "gtkextendedlayout.h"
#include "gtksizerequest.h"
#include "gtkprivate.h"
#include "gtkintl.h"
#include "gtkalias.h"
......@@ -158,30 +158,30 @@ static void gtk_box_get_child_property (GtkContainer *container,
static GType gtk_box_child_type (GtkContainer *container);
static void gtk_box_extended_layout_init (GtkExtendedLayoutIface *iface);
static gboolean gtk_box_is_height_for_width (GtkExtendedLayout *layout);
static void gtk_box_get_desired_width (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size);
static void gtk_box_get_desired_height (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size);
static void gtk_box_get_width_for_height (GtkExtendedLayout *layout,
gint height,
gint *minimum_width,
gint *natural_width);
static void gtk_box_get_height_for_width (GtkExtendedLayout *layout,
gint width,
gint *minimum_height,
gint *natural_height);
static GtkExtendedLayoutIface *parent_extended_layout_iface;
static void gtk_box_size_request_init (GtkSizeRequestIface *iface);
static GtkSizeRequestMode gtk_box_get_request_mode (GtkSizeRequest *widget);
static void gtk_box_get_width (GtkSizeRequest *widget,
gint *minimum_size,
gint *natural_size);
static void gtk_box_get_height (GtkSizeRequest *widget,
gint *minimum_size,
gint *natural_size);
static void gtk_box_get_width_for_height (GtkSizeRequest *widget,
gint height,
gint *minimum_width,
gint *natural_width);
static void gtk_box_get_height_for_width (GtkSizeRequest *widget,
gint width,
gint *minimum_height,
gint *natural_height);
static GtkSizeRequestIface *parent_size_request_iface;
G_DEFINE_TYPE_WITH_CODE (GtkBox, gtk_box, GTK_TYPE_CONTAINER,
G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE,
NULL)
G_IMPLEMENT_INTERFACE (GTK_TYPE_EXTENDED_LAYOUT,
gtk_box_extended_layout_init));
G_IMPLEMENT_INTERFACE (GTK_TYPE_SIZE_REQUEST,
gtk_box_size_request_init));
static void
gtk_box_class_init (GtkBoxClass *class)
......@@ -445,12 +445,12 @@ gtk_box_size_allocate (GtkWidget *widget,
if (gtk_widget_get_visible (child->widget))
{
if (private->orientation == GTK_ORIENTATION_HORIZONTAL)
gtk_extended_layout_get_width_for_height (GTK_EXTENDED_LAYOUT (child->widget),
gtk_size_request_get_width_for_height (GTK_SIZE_REQUEST (child->widget),
allocation->height,
&sizes[i].minimum_size,
&sizes[i].natural_size);
else
gtk_extended_layout_get_height_for_width (GTK_EXTENDED_LAYOUT (child->widget),
gtk_size_request_get_height_for_width (GTK_SIZE_REQUEST (child->widget),
allocation->width,
&sizes[i].minimum_size,
&sizes[i].natural_size);
......@@ -835,30 +835,31 @@ gtk_box_pack (GtkBox *box,
static void
gtk_box_extended_layout_init (GtkExtendedLayoutIface *iface)
gtk_box_size_request_init (GtkSizeRequestIface *iface)
{
parent_extended_layout_iface = g_type_interface_peek_parent (iface);
parent_size_request_iface = g_type_interface_peek_parent (iface);
iface->is_height_for_width = gtk_box_is_height_for_width;
iface->get_desired_width = gtk_box_get_desired_width;
iface->get_desired_height = gtk_box_get_desired_height;
iface->get_request_mode = gtk_box_get_request_mode;
iface->get_width = gtk_box_get_width;
iface->get_height = gtk_box_get_height;
iface->get_height_for_width = gtk_box_get_height_for_width;
iface->get_width_for_height = gtk_box_get_width_for_height;
}
static gboolean
gtk_box_is_height_for_width (GtkExtendedLayout *layout)
static GtkSizeRequestMode
gtk_box_get_request_mode (GtkSizeRequest *widget)
{
GtkBoxPrivate *private = GTK_BOX_GET_PRIVATE (layout);
GtkBoxPrivate *private = GTK_BOX_GET_PRIVATE (widget);
return (private->orientation == GTK_ORIENTATION_VERTICAL);
return (private->orientation == GTK_ORIENTATION_VERTICAL) ?
GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH : GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT;
}
static void
gtk_box_get_desired_size (GtkExtendedLayout *layout,
GtkOrientation orientation,
gint *minimum_size,
gint *natural_size)
gtk_box_get_size (GtkSizeRequest *widget,
GtkOrientation orientation,
gint *minimum_size,
gint *natural_size)
{
GtkBox *box;
GtkBoxPrivate *private;
......@@ -867,7 +868,7 @@ gtk_box_get_desired_size (GtkExtendedLayout *layout,
gint border_width;
gint minimum, natural;
box = GTK_BOX (layout);
box = GTK_BOX (widget);
private = GTK_BOX_GET_PRIVATE (box);
border_width = GTK_CONTAINER (box)->border_width;
......@@ -884,11 +885,11 @@ gtk_box_get_desired_size (GtkExtendedLayout *layout,
gint child_minimum, child_natural;
if (orientation == GTK_ORIENTATION_HORIZONTAL)
gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (child->widget),
&child_minimum, &child_natural);
gtk_size_request_get_width (GTK_SIZE_REQUEST (child->widget),
&child_minimum, &child_natural);
else
gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (child->widget),
&child_minimum, &child_natural);
gtk_size_request_get_height (GTK_SIZE_REQUEST (child->widget),
&child_minimum, &child_natural);
if (private->orientation == orientation)
{
......@@ -941,19 +942,19 @@ gtk_box_get_desired_size (GtkExtendedLayout *layout,
}
static void
gtk_box_get_desired_width (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size)
gtk_box_get_width (GtkSizeRequest *widget,
gint *minimum_size,
gint *natural_size)
{
gtk_box_get_desired_size (layout, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size);
gtk_box_get_size (widget, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size);
}
static void
gtk_box_get_desired_height (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size)
gtk_box_get_height (GtkSizeRequest *widget,
gint *minimum_size,
gint *natural_size)
{
gtk_box_get_desired_size (layout, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size);
gtk_box_get_size (widget, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size);
}
static void
......@@ -991,13 +992,13 @@ gtk_box_compute_size_for_opposing_orientation (GtkBox *box,
if (gtk_widget_get_visible (child->widget))
{
if (private->orientation == GTK_ORIENTATION_HORIZONTAL)
gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (child->widget),
&sizes[i].minimum_size,
&sizes[i].natural_size);
gtk_size_request_get_width (GTK_SIZE_REQUEST (child->widget),
&sizes[i].minimum_size,
&sizes[i].natural_size);
else
gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (child->widget),
&sizes[i].minimum_size,
&sizes[i].natural_size);
gtk_size_request_get_height (GTK_SIZE_REQUEST (child->widget),
&sizes[i].minimum_size,
&sizes[i].natural_size);
/* Assert the api is working properly */
if (sizes[i].minimum_size < 0)
......@@ -1135,10 +1136,10 @@ gtk_box_compute_size_for_opposing_orientation (GtkBox *box,
/* Assign the child's position. */
if (private->orientation == GTK_ORIENTATION_HORIZONTAL)
gtk_extended_layout_get_height_for_width (GTK_EXTENDED_LAYOUT (child->widget),
gtk_size_request_get_height_for_width (GTK_SIZE_REQUEST (child->widget),
child_size, &child_minimum, &child_natural);
else /* (private->orientation == GTK_ORIENTATION_VERTICAL) */
gtk_extended_layout_get_width_for_height (GTK_EXTENDED_LAYOUT (child->widget),
gtk_size_request_get_width_for_height (GTK_SIZE_REQUEST (child->widget),
child_size, &child_minimum, &child_natural);
......@@ -1183,10 +1184,10 @@ gtk_box_compute_size_for_orientation (GtkBox *box,
{
if (private->orientation == GTK_ORIENTATION_HORIZONTAL)
gtk_extended_layout_get_width_for_height (GTK_EXTENDED_LAYOUT (child->widget),
gtk_size_request_get_width_for_height (GTK_SIZE_REQUEST (child->widget),
avail_size, &child_size, &child_natural);
else
gtk_extended_layout_get_height_for_width (GTK_EXTENDED_LAYOUT (child->widget),
gtk_size_request_get_height_for_width (GTK_SIZE_REQUEST (child->widget),
avail_size, &child_size, &child_natural);
......@@ -1227,13 +1228,13 @@ gtk_box_compute_size_for_orientation (GtkBox *box,
}
static void
gtk_box_get_width_for_height (GtkExtendedLayout *layout,
gint height,
gint *minimum_width,
gint *natural_width)
gtk_box_get_width_for_height (GtkSizeRequest *widget,
gint height,
gint *minimum_width,
gint *natural_width)
{
GtkBox *box = GTK_BOX (layout);
GtkBoxPrivate *private = GTK_BOX_GET_PRIVATE (layout);
GtkBox *box = GTK_BOX (widget);
GtkBoxPrivate *private = GTK_BOX_GET_PRIVATE (widget);
if (private->orientation == GTK_ORIENTATION_VERTICAL)
gtk_box_compute_size_for_opposing_orientation (box, height, minimum_width, natural_width);
......@@ -1242,13 +1243,13 @@ gtk_box_get_width_for_height (GtkExtendedLayout *layout,
}
static void
gtk_box_get_height_for_width (GtkExtendedLayout *layout,
gint width,
gint *minimum_height,
gint *natural_height)
gtk_box_get_height_for_width (GtkSizeRequest *widget,
gint width,
gint *minimum_height,
gint *natural_height)
{
GtkBox *box = GTK_BOX (layout);
GtkBoxPrivate *private = GTK_BOX_GET_PRIVATE (layout);
GtkBox *box = GTK_BOX (widget);
GtkBoxPrivate *private = GTK_BOX_GET_PRIVATE (widget);
if (private->orientation == GTK_ORIENTATION_HORIZONTAL)
gtk_box_compute_size_for_opposing_orientation (box, width, minimum_height, natural_height);
......
......@@ -37,7 +37,7 @@
#include "gtkstock.h"
#include "gtkiconfactory.h"
#include "gtkactivatable.h"
#include "gtkextendedlayout.h"
#include "gtksizerequest.h"
#include "gtkprivate.h"
#include "gtkintl.h"
#include "gtkalias.h"
......@@ -158,21 +158,21 @@ static void gtk_button_set_related_action (GtkButton *button,
static void gtk_button_set_use_action_appearance (GtkButton *button,
gboolean use_appearance);
static void gtk_button_extended_layout_init (GtkExtendedLayoutIface *iface);
static void gtk_button_get_desired_width (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size);
static void gtk_button_get_desired_height (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size);
static void gtk_button_size_request_init (GtkSizeRequestIface *iface);
static void gtk_button_get_width (GtkSizeRequest *widget,
gint *minimum_size,
gint *natural_size);
static void gtk_button_get_height (GtkSizeRequest *widget,
gint *minimum_size,
gint *natural_size);
static guint button_signals[LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE_WITH_CODE (GtkButton, gtk_button, GTK_TYPE_BIN,
G_IMPLEMENT_INTERFACE (GTK_TYPE_ACTIVATABLE,
gtk_button_activatable_interface_init)
G_IMPLEMENT_INTERFACE (GTK_TYPE_EXTENDED_LAYOUT,
gtk_button_extended_layout_init))
G_IMPLEMENT_INTERFACE (GTK_TYPE_SIZE_REQUEST,
gtk_button_size_request_init))
static void
gtk_button_class_init (GtkButtonClass *klass)
......@@ -1776,19 +1776,19 @@ gtk_button_finish_activate (GtkButton *button,
static void
gtk_button_extended_layout_init (GtkExtendedLayoutIface *iface)
gtk_button_size_request_init (GtkSizeRequestIface *iface)
{
iface->get_desired_width = gtk_button_get_desired_width;
iface->get_desired_height = gtk_button_get_desired_height;
iface->get_width = gtk_button_get_width;
iface->get_height = gtk_button_get_height;
}
static void
gtk_button_get_desired_size (GtkExtendedLayout *layout,
GtkOrientation orientation,
gint *minimum_size,
gint *natural_size)
gtk_button_get_size (GtkSizeRequest *widget,
GtkOrientation orientation,
gint *minimum_size,
gint *natural_size)
{
GtkButton *button = GTK_BUTTON (layout);
GtkButton *button = GTK_BUTTON (widget);