[gtk+/rendering-cleanup-next] size-request: Rename functions to gtk_size_request_get_preferred_foo()
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/rendering-cleanup-next] size-request: Rename functions to gtk_size_request_get_preferred_foo()
- Date: Tue, 21 Sep 2010 17:25:57 +0000 (UTC)
commit 8d32b3356b21539f9d0fbcf0b3c4cd5ef4ab7616
Author: Benjamin Otte <otte redhat com>
Date: Tue Sep 21 16:35:17 2010 +0200
size-request: Rename functions to gtk_size_request_get_preferred_foo()
In language bindings where gtk_size_request_get_width(foo) would have
been translated to foo.get_width() and people agreed that this would
have been a too generic name.
So this patch renames the functions:
gtk_size_request_get_width() => gtk_size_request_get_preferred_width()
gtk_size_request_get_height() => gtk_size_request_get_preferred_height()
gtk_size_request_get_size() => gtk_size_request_get_preferred_size()
gtk_size_request_get_width_for_height() =>
gtk_size_request_get_preferred_width_for_height()
gtk_size_request_get_height_for_width() =>
gtk_size_request_get_preferred_height_for_width()
... and the corresponding vfuncs.
The patch also renames the implementations of these functions in widgets
to include the word "preferrred".
demos/gtk-demo/offscreen_window.c | 4 +-
demos/gtk-demo/offscreen_window2.c | 4 +-
docs/reference/gtk/gtk3-sections.txt | 10 +-
gtk/gtk.symbols | 10 +-
gtk/gtkaccellabel.c | 18 ++--
gtk/gtkalignment.c | 58 ++++++------
gtk/gtkarrow.c | 30 +++---
gtk/gtkaspectframe.c | 4 +-
gtk/gtkassistant.c | 12 ++--
gtk/gtkbbox.c | 4 +-
gtk/gtkbin.c | 75 ++++++++--------
gtk/gtkbox.c | 122 +++++++++++++-------------
gtk/gtkbutton.c | 28 +++---
gtk/gtkcellview.c | 70 +++++++-------
gtk/gtkcheckbutton.c | 4 +-
gtk/gtkcombobox.c | 98 ++++++++++----------
gtk/gtkentry.c | 8 +-
gtk/gtkexpander.c | 106 +++++++++++-----------
gtk/gtkfixed.c | 4 +-
gtk/gtkfontsel.c | 6 +-
gtk/gtkframe.c | 94 ++++++++++----------
gtk/gtkhandlebox.c | 10 +-
gtk/gtkimagemenuitem.c | 8 +-
gtk/gtklabel.c | 86 +++++++++---------
gtk/gtklayout.c | 4 +-
gtk/gtkmenu.c | 62 +++++++-------
gtk/gtkmenubar.c | 8 +-
gtk/gtkmenuitem.c | 63 +++++++------
gtk/gtknotebook.c | 8 +-
gtk/gtkpaned.c | 8 +-
gtk/gtkpathbar.c | 20 ++--
gtk/gtkscrolledwindow.c | 88 +++++++++---------
gtk/gtksizegroup.c | 4 +-
gtk/gtksizerequest.c | 84 +++++++++---------
gtk/gtksizerequest.h | 78 ++++++++--------
gtk/gtkspinbutton.c | 15 ++--
gtk/gtkspinner.c | 16 ++--
gtk/gtktable.c | 16 ++--
gtk/gtktextlayout.c | 4 +-
gtk/gtktextview.c | 16 ++--
gtk/gtktoolbar.c | 4 +-
gtk/gtktreeview.c | 6 +-
gtk/gtkviewport.c | 48 +++++-----
gtk/gtkwidget.c | 26 +++---
gtk/gtkwindow.c | 41 +++++----
gtk/gtkwrapbox.c | 166 +++++++++++++++++-----------------
tests/gtkoffscreenbox.c | 8 +-
tests/testellipsise.c | 4 +-
48 files changed, 842 insertions(+), 828 deletions(-)
---
diff --git a/demos/gtk-demo/offscreen_window.c b/demos/gtk-demo/offscreen_window.c
index 06ef5fc..00fc2fa 100644
--- a/demos/gtk-demo/offscreen_window.c
+++ b/demos/gtk-demo/offscreen_window.c
@@ -433,8 +433,8 @@ gtk_rotated_bin_size_allocate (GtkWidget *widget,
s = sin (bin->angle);
c = cos (bin->angle);
- gtk_size_request_get_size (GTK_SIZE_REQUEST (bin->child),
- &child_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (bin->child),
+ &child_requisition, NULL);
child_allocation.x = 0;
child_allocation.y = 0;
child_allocation.height = child_requisition.height;
diff --git a/demos/gtk-demo/offscreen_window2.c b/demos/gtk-demo/offscreen_window2.c
index a61fbc4..09d08ec 100644
--- a/demos/gtk-demo/offscreen_window2.c
+++ b/demos/gtk-demo/offscreen_window2.c
@@ -348,8 +348,8 @@ gtk_mirror_bin_size_allocate (GtkWidget *widget,
GtkRequisition child_requisition;
GtkAllocation child_allocation;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (bin->child),
- &child_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (bin->child),
+ &child_requisition, NULL);
child_allocation.x = 0;
child_allocation.y = 0;
child_allocation.height = child_requisition.height;
diff --git a/docs/reference/gtk/gtk3-sections.txt b/docs/reference/gtk/gtk3-sections.txt
index d73ee18..2bef6be 100644
--- a/docs/reference/gtk/gtk3-sections.txt
+++ b/docs/reference/gtk/gtk3-sections.txt
@@ -6291,12 +6291,12 @@ GtkSizeRequest
GtkSizeRequestIface
GtkSizeRequestMode
GtkRequestedSize
-gtk_size_request_get_height
-gtk_size_request_get_width
-gtk_size_request_get_height_for_width
-gtk_size_request_get_width_for_height
+gtk_size_request_get_preferred_height
+gtk_size_request_get_preferred_width
+gtk_size_request_get_preferred_height_for_width
+gtk_size_request_get_preferred_width_for_height
gtk_size_request_get_request_mode
-gtk_size_request_get_size
+gtk_size_request_get_preferred_size
gtk_distribute_natural_allocation
<SUBSECTION Standard>
diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols
index cdc3698..81aa528 100644
--- a/gtk/gtk.symbols
+++ b/gtk/gtk.symbols
@@ -3042,13 +3042,13 @@ gtk_size_group_set_mode
#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_preferred_height
+gtk_size_request_get_preferred_height_for_width
gtk_size_request_get_request_mode
-gtk_size_request_get_size
+gtk_size_request_get_preferred_size
gtk_size_request_get_type G_GNUC_CONST
-gtk_size_request_get_width
-gtk_size_request_get_width_for_height
+gtk_size_request_get_preferred_width
+gtk_size_request_get_preferred_width_for_height
#endif
#endif
diff --git a/gtk/gtkaccellabel.c b/gtk/gtkaccellabel.c
index 6305b57..4bfcc58 100644
--- a/gtk/gtkaccellabel.c
+++ b/gtk/gtkaccellabel.c
@@ -125,10 +125,10 @@ static gboolean gtk_accel_label_draw (GtkWidget *widget,
static const gchar *gtk_accel_label_get_string (GtkAccelLabel *accel_label);
-static void gtk_accel_label_size_request_init (GtkSizeRequestIface *iface);
-static void gtk_accel_label_get_width (GtkSizeRequest *widget,
- gint *min_width,
- gint *nat_width);
+static void gtk_accel_label_size_request_init (GtkSizeRequestIface *iface);
+static void gtk_accel_label_get_preferred_width (GtkSizeRequest *widget,
+ gint *min_width,
+ gint *nat_width);
#define GTK_ACCEL_LABEL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GTK_TYPE_ACCEL_LABEL, GtkAccelLabelPrivate))
@@ -352,19 +352,19 @@ static void
gtk_accel_label_size_request_init (GtkSizeRequestIface *iface)
{
parent_size_request_iface = g_type_interface_peek_parent (iface);
- iface->get_width = gtk_accel_label_get_width;
+ iface->get_preferred_width = gtk_accel_label_get_preferred_width;
}
static void
-gtk_accel_label_get_width (GtkSizeRequest *widget,
- gint *min_width,
- gint *nat_width)
+gtk_accel_label_get_preferred_width (GtkSizeRequest *widget,
+ gint *min_width,
+ gint *nat_width)
{
GtkAccelLabel *accel_label = GTK_ACCEL_LABEL (widget);
PangoLayout *layout;
gint width;
- parent_size_request_iface->get_width (widget, min_width, nat_width);
+ parent_size_request_iface->get_preferred_width (widget, min_width, nat_width);
layout = gtk_widget_create_pango_layout (GTK_WIDGET (widget),
gtk_accel_label_get_string (accel_label));
diff --git a/gtk/gtkalignment.c b/gtk/gtkalignment.c
index c863553..fb7d028 100644
--- a/gtk/gtkalignment.c
+++ b/gtk/gtkalignment.c
@@ -88,13 +88,13 @@ static void gtk_alignment_get_property (GObject *object,
GValue *value,
GParamSpec *pspec);
-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);
+static void gtk_alignment_size_request_init (GtkSizeRequestIface *iface);
+static void gtk_alignment_get_preferred_width (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size);
+static void gtk_alignment_get_preferred_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_SIZE_REQUEST,
@@ -517,21 +517,21 @@ gtk_alignment_size_allocate (GtkWidget *widget,
if (gtk_size_request_get_request_mode (child) == GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH)
{
- gtk_size_request_get_width (child, NULL, &child_nat_width);
+ gtk_size_request_get_preferred_width (child, NULL, &child_nat_width);
child_width = MIN (width, child_nat_width);
- gtk_size_request_get_height_for_width (child, child_width, NULL, &child_nat_height);
+ gtk_size_request_get_preferred_height_for_width (child, child_width, NULL, &child_nat_height);
child_height = MIN (height, child_nat_height);
}
else
{
- gtk_size_request_get_height (child, NULL, &child_nat_height);
+ gtk_size_request_get_preferred_height (child, NULL, &child_nat_height);
child_height = MIN (height, child_nat_height);
- gtk_size_request_get_width_for_height (child, child_height, NULL, &child_nat_width);
+ gtk_size_request_get_preferred_width_for_height (child, child_height, NULL, &child_nat_width);
child_width = MIN (width, child_nat_width);
}
@@ -565,15 +565,15 @@ gtk_alignment_size_allocate (GtkWidget *widget,
static void
gtk_alignment_size_request_init (GtkSizeRequestIface *iface)
{
- iface->get_width = gtk_alignment_get_width;
- iface->get_height = gtk_alignment_get_height;
+ iface->get_preferred_width = gtk_alignment_get_preferred_width;
+ iface->get_preferred_height = gtk_alignment_get_preferred_height;
}
static void
-gtk_alignment_get_size (GtkSizeRequest *widget,
- GtkOrientation orientation,
- gint *minimum_size,
- gint *natural_size)
+gtk_alignment_get_preferred_size (GtkSizeRequest *widget,
+ GtkOrientation orientation,
+ gint *minimum_size,
+ gint *natural_size)
{
GtkAlignment *alignment = GTK_ALIGNMENT (widget);
GtkAlignmentPrivate *priv = alignment->priv;
@@ -590,14 +590,14 @@ gtk_alignment_get_size (GtkSizeRequest *widget,
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
minimum += (priv->padding_left + priv->padding_right);
- gtk_size_request_get_width (GTK_SIZE_REQUEST (child),
- &child_min, &child_nat);
+ gtk_size_request_get_preferred_width (GTK_SIZE_REQUEST (child),
+ &child_min, &child_nat);
}
else
{
minimum += (priv->padding_top + priv->padding_bottom);
- gtk_size_request_get_height (GTK_SIZE_REQUEST (child),
- &child_min, &child_nat);
+ gtk_size_request_get_preferred_height (GTK_SIZE_REQUEST (child),
+ &child_min, &child_nat);
}
natural = minimum;
@@ -614,19 +614,19 @@ gtk_alignment_get_size (GtkSizeRequest *widget,
}
static void
-gtk_alignment_get_width (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size)
+gtk_alignment_get_preferred_width (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
{
- gtk_alignment_get_size (widget, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size);
+ gtk_alignment_get_preferred_size (widget, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size);
}
static void
-gtk_alignment_get_height (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size)
+gtk_alignment_get_preferred_height (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
{
- gtk_alignment_get_size (widget, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size);
+ gtk_alignment_get_preferred_size (widget, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size);
}
/**
diff --git a/gtk/gtkarrow.c b/gtk/gtkarrow.c
index 2b93803..4261420 100644
--- a/gtk/gtkarrow.c
+++ b/gtk/gtkarrow.c
@@ -77,13 +77,13 @@ static void gtk_arrow_get_property (GObject *object,
static gboolean gtk_arrow_draw (GtkWidget *widget,
cairo_t *cr);
-static void gtk_arrow_size_request_init (GtkSizeRequestIface *iface);
-static void gtk_arrow_get_width (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size);
-static void gtk_arrow_get_height (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size);
+static void gtk_arrow_size_request_init (GtkSizeRequestIface *iface);
+static void gtk_arrow_get_preferred_width (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size);
+static void gtk_arrow_get_preferred_height (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size);
G_DEFINE_TYPE_WITH_CODE (GtkArrow, gtk_arrow, GTK_TYPE_MISC,
G_IMPLEMENT_INTERFACE (GTK_TYPE_SIZE_REQUEST,
@@ -201,14 +201,14 @@ gtk_arrow_init (GtkArrow *arrow)
static void
gtk_arrow_size_request_init (GtkSizeRequestIface *iface)
{
- iface->get_width = gtk_arrow_get_width;
- iface->get_height = gtk_arrow_get_height;
+ iface->get_preferred_width = gtk_arrow_get_preferred_width;
+ iface->get_preferred_height = gtk_arrow_get_preferred_height;
}
static void
-gtk_arrow_get_width (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size)
+gtk_arrow_get_preferred_width (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
{
gint xpad;
@@ -222,9 +222,9 @@ gtk_arrow_get_width (GtkSizeRequest *widget,
}
static void
-gtk_arrow_get_height (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size)
+gtk_arrow_get_preferred_height (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
{
gint ypad;
diff --git a/gtk/gtkaspectframe.c b/gtk/gtkaspectframe.c
index 8eac437..2cbbabb 100644
--- a/gtk/gtkaspectframe.c
+++ b/gtk/gtkaspectframe.c
@@ -352,8 +352,8 @@ gtk_aspect_frame_compute_child_allocation (GtkFrame *frame,
{
GtkRequisition child_requisition;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
- &child_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (child),
+ &child_requisition, NULL);
if (child_requisition.height != 0)
{
ratio = ((gdouble) child_requisition.width /
diff --git a/gtk/gtkassistant.c b/gtk/gtkassistant.c
index 9dec9b6..75f6aa1 100644
--- a/gtk/gtkassistant.c
+++ b/gtk/gtkassistant.c
@@ -1225,8 +1225,8 @@ gtk_assistant_size_allocate (GtkWidget *widget,
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
/* Header */
- gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->header_image),
- &header_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (priv->header_image),
+ &header_requisition, NULL);
header_allocation.x = border_width + header_padding;
header_allocation.y = border_width + header_padding;
@@ -1236,8 +1236,8 @@ gtk_assistant_size_allocate (GtkWidget *widget,
gtk_widget_size_allocate (priv->header_image, &header_allocation);
/* Action area */
- gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->action_area),
- &action_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (priv->action_area),
+ &action_requisition, NULL);
child_allocation.x = border_width;
child_allocation.y = allocation->height - border_width - action_requisition.height;
@@ -1250,8 +1250,8 @@ gtk_assistant_size_allocate (GtkWidget *widget,
gtk_widget_get_allocation (priv->action_area, &action_area_allocation);
/* Sidebar */
- gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->sidebar_image),
- &sidebar_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (priv->sidebar_image),
+ &sidebar_requisition, NULL);
if (rtl)
child_allocation.x = allocation->width - border_width - sidebar_requisition.width;
diff --git a/gtk/gtkbbox.c b/gtk/gtkbbox.c
index 5b99cb6..d34b2f0 100644
--- a/gtk/gtkbbox.c
+++ b/gtk/gtkbbox.c
@@ -478,8 +478,8 @@ gtk_button_box_child_requisition (GtkWidget *widget,
if (is_secondary)
nsecondaries++;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
- &child_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (child),
+ &child_requisition, NULL);
if (homogeneous || (child_requisition.width + ipad_w < avg_w * 1.5))
{
diff --git a/gtk/gtkbin.c b/gtk/gtkbin.c
index b550009..02ed7e9 100644
--- a/gtk/gtkbin.c
+++ b/gtk/gtkbin.c
@@ -59,16 +59,16 @@ static void gtk_bin_forall (GtkContainer *container,
static GType gtk_bin_child_type (GtkContainer *container);
-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 void gtk_bin_size_request_init (GtkSizeRequestIface *iface);
+static GtkSizeRequestMode gtk_bin_get_request_mode (GtkSizeRequest *widget);
+static void gtk_bin_get_preferred_width_for_height (GtkSizeRequest *widget,
+ gint height,
+ gint *minimum_width,
+ gint *natural_width);
+static void gtk_bin_get_preferred_height_for_width (GtkSizeRequest *widget,
+ gint width,
+ gint *minimum_height,
+ gint *natural_height);
static GtkSizeRequestIface *parent_size_request_iface;
@@ -191,9 +191,9 @@ gtk_bin_size_request_init (GtkSizeRequestIface *iface)
{
parent_size_request_iface = g_type_interface_peek_parent (iface);
- 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;
+ iface->get_request_mode = gtk_bin_get_request_mode;
+ iface->get_preferred_width_for_height = gtk_bin_get_preferred_width_for_height;
+ iface->get_preferred_height_for_width = gtk_bin_get_preferred_height_for_width;
}
static GtkSizeRequestMode
@@ -216,26 +216,27 @@ get_child_padding_delta (GtkBin *bin,
GtkBinPrivate *priv = bin->priv;
gint hmin, vmin, hnat, vnat, child_hmin, child_vmin;
- /* we can't use gtk_size_request_get_width() wrapper because we want
- * our "original" request, not any external adjustments from
- * set_size_request() or whatever. we have to ask for natural also
- * because NULL isn't allowed for the direct vfuncs
+ /* we can't use gtk_size_request_get_preferred_width() wrapper
+ * because we want our "original" request, not any external
+ * adjustments from set_size_request() or whatever. we have
+ * to ask for natural also because NULL isn't allowed for the
+ * direct vfuncs
*/
- GTK_SIZE_REQUEST_GET_IFACE (bin)->get_width(GTK_SIZE_REQUEST (bin), &hmin, &hnat);
- GTK_SIZE_REQUEST_GET_IFACE (bin)->get_height (GTK_SIZE_REQUEST (bin), &vmin, &vnat);
+ GTK_SIZE_REQUEST_GET_IFACE (bin)->get_preferred_width (GTK_SIZE_REQUEST (bin), &hmin, &hnat);
+ GTK_SIZE_REQUEST_GET_IFACE (bin)->get_preferred_height (GTK_SIZE_REQUEST (bin), &vmin, &vnat);
- gtk_size_request_get_width (GTK_SIZE_REQUEST (priv->child), &child_hmin, NULL);
- gtk_size_request_get_height (GTK_SIZE_REQUEST (priv->child), &child_vmin, NULL);
+ gtk_size_request_get_preferred_width (GTK_SIZE_REQUEST (priv->child), &child_hmin, NULL);
+ gtk_size_request_get_preferred_height (GTK_SIZE_REQUEST (priv->child), &child_vmin, NULL);
*delta_h = hmin - child_hmin;
*delta_v = vmin - child_vmin;
}
static void
-gtk_bin_get_width_for_height (GtkSizeRequest *widget,
- gint height,
- gint *minimum_width,
- gint *natural_width)
+gtk_bin_get_preferred_width_for_height (GtkSizeRequest *widget,
+ gint height,
+ gint *minimum_width,
+ gint *natural_width)
{
GtkBin *bin = GTK_BIN (widget);
GtkBinPrivate *priv = bin->priv;
@@ -245,9 +246,9 @@ gtk_bin_get_width_for_height (GtkSizeRequest *widget,
{
get_child_padding_delta (bin, &hdelta, &vdelta);
- gtk_size_request_get_width_for_height (GTK_SIZE_REQUEST (priv->child),
- height - vdelta,
- &child_min, &child_nat);
+ gtk_size_request_get_preferred_width_for_height (GTK_SIZE_REQUEST (priv->child),
+ height - vdelta,
+ &child_min, &child_nat);
if (minimum_width)
*minimum_width = child_min + hdelta;
@@ -256,14 +257,14 @@ gtk_bin_get_width_for_height (GtkSizeRequest *widget,
*natural_width = child_nat + hdelta;
}
else
- GTK_SIZE_REQUEST_GET_IFACE (widget)->get_width (widget, minimum_width, natural_width);
+ GTK_SIZE_REQUEST_GET_IFACE (widget)->get_preferred_width (widget, minimum_width, natural_width);
}
static void
-gtk_bin_get_height_for_width (GtkSizeRequest *widget,
- gint width,
- gint *minimum_height,
- gint *natural_height)
+gtk_bin_get_preferred_height_for_width (GtkSizeRequest *widget,
+ gint width,
+ gint *minimum_height,
+ gint *natural_height)
{
GtkBin *bin = GTK_BIN (widget);
GtkBinPrivate *priv = bin->priv;
@@ -273,9 +274,9 @@ gtk_bin_get_height_for_width (GtkSizeRequest *widget,
{
get_child_padding_delta (bin, &hdelta, &vdelta);
- gtk_size_request_get_height_for_width (GTK_SIZE_REQUEST (priv->child),
- width - hdelta,
- &child_min, &child_nat);
+ gtk_size_request_get_preferred_height_for_width (GTK_SIZE_REQUEST (priv->child),
+ width - hdelta,
+ &child_min, &child_nat);
if (minimum_height)
*minimum_height = child_min + vdelta;
@@ -284,7 +285,7 @@ gtk_bin_get_height_for_width (GtkSizeRequest *widget,
*natural_height = child_nat + vdelta;
}
else
- GTK_SIZE_REQUEST_GET_IFACE (widget)->get_height (widget, minimum_height, natural_height);
+ GTK_SIZE_REQUEST_GET_IFACE (widget)->get_preferred_height (widget, minimum_height, natural_height);
}
diff --git a/gtk/gtkbox.c b/gtk/gtkbox.c
index 2f931f3..6a408f2 100644
--- a/gtk/gtkbox.c
+++ b/gtk/gtkbox.c
@@ -171,22 +171,22 @@ static void gtk_box_get_child_property (GtkContainer *container,
static GType gtk_box_child_type (GtkContainer *container);
-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 void gtk_box_size_request_init (GtkSizeRequestIface *iface);
+static GtkSizeRequestMode gtk_box_get_request_mode (GtkSizeRequest *widget);
+static void gtk_box_get_preferred_width (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size);
+static void gtk_box_get_preferred_height (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size);
+static void gtk_box_get_preferred_width_for_height (GtkSizeRequest *widget,
+ gint height,
+ gint *minimum_width,
+ gint *natural_width);
+static void gtk_box_get_preferred_height_for_width (GtkSizeRequest *widget,
+ gint width,
+ gint *minimum_height,
+ gint *natural_height);
static GtkSizeRequestIface *parent_size_request_iface;
@@ -446,15 +446,15 @@ gtk_box_size_allocate (GtkWidget *widget,
continue;
if (private->orientation == GTK_ORIENTATION_HORIZONTAL)
- gtk_size_request_get_width_for_height (GTK_SIZE_REQUEST (child->widget),
- allocation->height,
- &sizes[i].minimum_size,
- &sizes[i].natural_size);
+ gtk_size_request_get_preferred_width_for_height (GTK_SIZE_REQUEST (child->widget),
+ allocation->height,
+ &sizes[i].minimum_size,
+ &sizes[i].natural_size);
else
- gtk_size_request_get_height_for_width (GTK_SIZE_REQUEST (child->widget),
- allocation->width,
- &sizes[i].minimum_size,
- &sizes[i].natural_size);
+ gtk_size_request_get_preferred_height_for_width (GTK_SIZE_REQUEST (child->widget),
+ allocation->width,
+ &sizes[i].minimum_size,
+ &sizes[i].natural_size);
/* Assert the api is working properly */
@@ -807,11 +807,11 @@ gtk_box_size_request_init (GtkSizeRequestIface *iface)
{
parent_size_request_iface = g_type_interface_peek_parent (iface);
- 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;
+ iface->get_request_mode = gtk_box_get_request_mode;
+ iface->get_preferred_width = gtk_box_get_preferred_width;
+ iface->get_preferred_height = gtk_box_get_preferred_height;
+ iface->get_preferred_height_for_width = gtk_box_get_preferred_height_for_width;
+ iface->get_preferred_width_for_height = gtk_box_get_preferred_width_for_height;
}
static GtkSizeRequestMode
@@ -851,11 +851,11 @@ gtk_box_get_size (GtkSizeRequest *widget,
gint child_minimum, child_natural;
if (orientation == GTK_ORIENTATION_HORIZONTAL)
- gtk_size_request_get_width (GTK_SIZE_REQUEST (child->widget),
- &child_minimum, &child_natural);
+ gtk_size_request_get_preferred_width (GTK_SIZE_REQUEST (child->widget),
+ &child_minimum, &child_natural);
else
- gtk_size_request_get_height (GTK_SIZE_REQUEST (child->widget),
- &child_minimum, &child_natural);
+ gtk_size_request_get_preferred_height (GTK_SIZE_REQUEST (child->widget),
+ &child_minimum, &child_natural);
if (private->orientation == orientation)
{
@@ -905,17 +905,17 @@ gtk_box_get_size (GtkSizeRequest *widget,
}
static void
-gtk_box_get_width (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size)
+gtk_box_get_preferred_width (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
{
gtk_box_get_size (widget, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size);
}
static void
-gtk_box_get_height (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size)
+gtk_box_get_preferred_height (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
{
gtk_box_get_size (widget, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size);
}
@@ -954,13 +954,13 @@ gtk_box_compute_size_for_opposing_orientation (GtkBox *box,
if (gtk_widget_get_visible (child->widget))
{
if (private->orientation == GTK_ORIENTATION_HORIZONTAL)
- gtk_size_request_get_width (GTK_SIZE_REQUEST (child->widget),
- &sizes[i].minimum_size,
- &sizes[i].natural_size);
+ gtk_size_request_get_preferred_width (GTK_SIZE_REQUEST (child->widget),
+ &sizes[i].minimum_size,
+ &sizes[i].natural_size);
else
- gtk_size_request_get_height (GTK_SIZE_REQUEST (child->widget),
- &sizes[i].minimum_size,
- &sizes[i].natural_size);
+ gtk_size_request_get_preferred_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)
@@ -1074,11 +1074,11 @@ gtk_box_compute_size_for_opposing_orientation (GtkBox *box,
/* Assign the child's position. */
if (private->orientation == GTK_ORIENTATION_HORIZONTAL)
- gtk_size_request_get_height_for_width (GTK_SIZE_REQUEST (child->widget),
- child_size, &child_minimum, &child_natural);
+ gtk_size_request_get_preferred_height_for_width (GTK_SIZE_REQUEST (child->widget),
+ child_size, &child_minimum, &child_natural);
else /* (private->orientation == GTK_ORIENTATION_VERTICAL) */
- gtk_size_request_get_width_for_height (GTK_SIZE_REQUEST (child->widget),
- child_size, &child_minimum, &child_natural);
+ gtk_size_request_get_preferred_width_for_height (GTK_SIZE_REQUEST (child->widget),
+ child_size, &child_minimum, &child_natural);
computed_minimum = MAX (computed_minimum, child_minimum);
@@ -1115,11 +1115,11 @@ gtk_box_compute_size_for_orientation (GtkBox *box,
{
if (private->orientation == GTK_ORIENTATION_HORIZONTAL)
- gtk_size_request_get_width_for_height (GTK_SIZE_REQUEST (child->widget),
- avail_size, &child_size, &child_natural);
+ gtk_size_request_get_preferred_width_for_height (GTK_SIZE_REQUEST (child->widget),
+ avail_size, &child_size, &child_natural);
else
- gtk_size_request_get_height_for_width (GTK_SIZE_REQUEST (child->widget),
- avail_size, &child_size, &child_natural);
+ gtk_size_request_get_preferred_height_for_width (GTK_SIZE_REQUEST (child->widget),
+ avail_size, &child_size, &child_natural);
child_size += child->padding * 2;
@@ -1156,10 +1156,10 @@ gtk_box_compute_size_for_orientation (GtkBox *box,
}
static void
-gtk_box_get_width_for_height (GtkSizeRequest *widget,
- gint height,
- gint *minimum_width,
- gint *natural_width)
+gtk_box_get_preferred_width_for_height (GtkSizeRequest *widget,
+ gint height,
+ gint *minimum_width,
+ gint *natural_width)
{
GtkBox *box = GTK_BOX (widget);
GtkBoxPrivate *private = box->priv;
@@ -1171,10 +1171,10 @@ gtk_box_get_width_for_height (GtkSizeRequest *widget,
}
static void
-gtk_box_get_height_for_width (GtkSizeRequest *widget,
- gint width,
- gint *minimum_height,
- gint *natural_height)
+gtk_box_get_preferred_height_for_width (GtkSizeRequest *widget,
+ gint width,
+ gint *minimum_height,
+ gint *natural_height)
{
GtkBox *box = GTK_BOX (widget);
GtkBoxPrivate *private = box->priv;
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index d27904f..394f712 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -173,10 +173,10 @@ static void gtk_button_set_use_action_appearance (GtkButton *button,
gboolean use_appearance);
static void gtk_button_size_request_init (GtkSizeRequestIface *iface);
-static void gtk_button_get_width (GtkSizeRequest *widget,
+static void gtk_button_get_preferred_width (GtkSizeRequest *widget,
gint *minimum_size,
gint *natural_size);
-static void gtk_button_get_height (GtkSizeRequest *widget,
+static void gtk_button_get_preferred_height (GtkSizeRequest *widget,
gint *minimum_size,
gint *natural_size);
@@ -1893,8 +1893,8 @@ gtk_button_finish_activate (GtkButton *button,
static void
gtk_button_size_request_init (GtkSizeRequestIface *iface)
{
- iface->get_width = gtk_button_get_width;
- iface->get_height = gtk_button_get_height;
+ iface->get_preferred_width = gtk_button_get_preferred_width;
+ iface->get_preferred_height = gtk_button_get_preferred_height;
}
static void
@@ -1946,11 +1946,11 @@ gtk_button_get_size (GtkSizeRequest *widget,
gint child_min, child_nat;
if (orientation == GTK_ORIENTATION_HORIZONTAL)
- gtk_size_request_get_width (GTK_SIZE_REQUEST (child),
- &child_min, &child_nat);
+ gtk_size_request_get_preferred_width (GTK_SIZE_REQUEST (child),
+ &child_min, &child_nat);
else
- gtk_size_request_get_height (GTK_SIZE_REQUEST (child),
- &child_min, &child_nat);
+ gtk_size_request_get_preferred_height (GTK_SIZE_REQUEST (child),
+ &child_min, &child_nat);
minimum += child_min;
natural += child_nat;
@@ -1964,17 +1964,17 @@ gtk_button_get_size (GtkSizeRequest *widget,
}
static void
-gtk_button_get_width (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size)
+gtk_button_get_preferred_width (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
{
gtk_button_get_size (widget, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size);
}
static void
-gtk_button_get_height (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size)
+gtk_button_get_preferred_height (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
{
gtk_button_get_size (widget, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size);
}
diff --git a/gtk/gtkcellview.c b/gtk/gtkcellview.c
index 4e5fa2d..9c76606 100644
--- a/gtk/gtkcellview.c
+++ b/gtk/gtkcellview.c
@@ -122,17 +122,17 @@ static void gtk_cell_view_buildable_custom_tag_end (GtkBuildable
gpointer *data);
static void gtk_cell_view_size_request_init (GtkSizeRequestIface *iface);
-static void gtk_cell_view_get_width (GtkSizeRequest *widget,
+static void gtk_cell_view_get_preferred_width (GtkSizeRequest *widget,
gint *minimum_size,
gint *natural_size);
-static void gtk_cell_view_get_height (GtkSizeRequest *widget,
+static void gtk_cell_view_get_preferred_height (GtkSizeRequest *widget,
gint *minimum_size,
gint *natural_size);
-static void gtk_cell_view_get_width_for_height (GtkSizeRequest *widget,
+static void gtk_cell_view_get_preferred_width_for_height (GtkSizeRequest *widget,
gint avail_size,
gint *minimum_size,
gint *natural_size);
-static void gtk_cell_view_get_height_for_width (GtkSizeRequest *widget,
+static void gtk_cell_view_get_preferred_height_for_width (GtkSizeRequest *widget,
gint avail_size,
gint *minimum_size,
gint *natural_size);
@@ -1048,13 +1048,13 @@ gtk_cell_view_get_desired_width_of_row (GtkCellView *cell_view,
cell_view->priv->displayed_row =
gtk_tree_row_reference_new (cell_view->priv->model, path);
- gtk_cell_view_get_width (GTK_SIZE_REQUEST (cell_view), minimum_size, natural_size);
+ gtk_cell_view_get_preferred_width (GTK_SIZE_REQUEST (cell_view), minimum_size, natural_size);
gtk_tree_row_reference_free (cell_view->priv->displayed_row);
cell_view->priv->displayed_row = tmp;
/* Restore active size (this will restore the cellrenderer info->width/requested_width's) */
- gtk_cell_view_get_width (GTK_SIZE_REQUEST (cell_view), NULL, NULL);
+ gtk_cell_view_get_preferred_width (GTK_SIZE_REQUEST (cell_view), NULL, NULL);
}
@@ -1090,13 +1090,13 @@ gtk_cell_view_get_desired_height_for_width_of_row (GtkCellView *cell_view,
gtk_tree_row_reference_new (cell_view->priv->model, path);
/* Then get the collective height_for_width based on the cached values */
- gtk_cell_view_get_height_for_width (GTK_SIZE_REQUEST (cell_view), avail_size, minimum_size, natural_size);
+ gtk_cell_view_get_preferred_height_for_width (GTK_SIZE_REQUEST (cell_view), avail_size, minimum_size, natural_size);
gtk_tree_row_reference_free (cell_view->priv->displayed_row);
cell_view->priv->displayed_row = tmp;
/* Restore active size (this will restore the cellrenderer info->width/requested_width's) */
- gtk_cell_view_get_width (GTK_SIZE_REQUEST (cell_view), NULL, NULL);
+ gtk_cell_view_get_preferred_width (GTK_SIZE_REQUEST (cell_view), NULL, NULL);
}
/**
@@ -1191,16 +1191,16 @@ gtk_cell_view_buildable_custom_tag_end (GtkBuildable *buildable,
static void
gtk_cell_view_size_request_init (GtkSizeRequestIface *iface)
{
- iface->get_width = gtk_cell_view_get_width;
- iface->get_height = gtk_cell_view_get_height;
- iface->get_width_for_height = gtk_cell_view_get_width_for_height;
- iface->get_height_for_width = gtk_cell_view_get_height_for_width;
+ iface->get_preferred_width = gtk_cell_view_get_preferred_width;
+ iface->get_preferred_height = gtk_cell_view_get_preferred_height;
+ iface->get_preferred_width_for_height = gtk_cell_view_get_preferred_width_for_height;
+ iface->get_preferred_height_for_width = gtk_cell_view_get_preferred_height_for_width;
}
static void
-gtk_cell_view_get_width (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size)
+gtk_cell_view_get_preferred_width (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
{
GList *list;
gint cell_min, cell_nat;
@@ -1227,7 +1227,7 @@ gtk_cell_view_get_width (GtkSizeRequest *widget,
}
gtk_cell_size_request_get_width (GTK_CELL_SIZE_REQUEST (info->cell),
- GTK_WIDGET (cellview), &cell_min, &cell_nat);
+ GTK_WIDGET (cellview), &cell_min, &cell_nat);
info->requested_width = cell_min;
info->natural_width = cell_nat;
@@ -1247,34 +1247,34 @@ gtk_cell_view_get_width (GtkSizeRequest *widget,
}
static void
-gtk_cell_view_get_height (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size)
+gtk_cell_view_get_preferred_height (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
{
gint minimum_width;
/* CellViews only need to respond to height-for-width mode (cellview is pretty much
* an implementation detail of GtkComboBox) */
- gtk_cell_view_get_width (widget, &minimum_width, NULL);
- gtk_cell_view_get_height_for_width (widget, minimum_width, minimum_size, natural_size);
+ gtk_cell_view_get_preferred_width (widget, &minimum_width, NULL);
+ gtk_cell_view_get_preferred_height_for_width (widget, minimum_width, minimum_size, natural_size);
}
static void
-gtk_cell_view_get_width_for_height (GtkSizeRequest *widget,
- gint for_size,
- gint *minimum_size,
- gint *natural_size)
+gtk_cell_view_get_preferred_width_for_height (GtkSizeRequest *widget,
+ gint for_size,
+ gint *minimum_size,
+ gint *natural_size)
{
/* CellViews only need to respond to height-for-width mode (cellview is pretty much
* an implementation detail of GtkComboBox) */
- gtk_cell_view_get_width (widget, minimum_size, natural_size);
+ gtk_cell_view_get_preferred_width (widget, minimum_size, natural_size);
}
static void
-gtk_cell_view_get_height_for_width (GtkSizeRequest *widget,
- gint for_size,
- gint *minimum_size,
- gint *natural_size)
+gtk_cell_view_get_preferred_height_for_width (GtkSizeRequest *widget,
+ gint for_size,
+ gint *minimum_size,
+ gint *natural_size)
{
GtkCellView *cellview = GTK_CELL_VIEW (widget);
GList *list;
@@ -1303,9 +1303,9 @@ gtk_cell_view_get_height_for_width (GtkSizeRequest *widget,
GtkRequestedSize requested;
gtk_cell_size_request_get_width (GTK_CELL_SIZE_REQUEST (info->cell),
- GTK_WIDGET (cellview),
- &requested.minimum_size,
- &requested.natural_size);
+ GTK_WIDGET (cellview),
+ &requested.minimum_size,
+ &requested.natural_size);
requested.data = info;
g_array_append_val (array, requested);
@@ -1359,8 +1359,8 @@ gtk_cell_view_get_height_for_width (GtkSizeRequest *widget,
/* Get the height for the real width of this cell */
gtk_cell_size_request_get_height_for_width (GTK_CELL_SIZE_REQUEST (info->cell),
- GTK_WIDGET (widget),
- cell_width, &cell_minimum, &cell_natural);
+ GTK_WIDGET (widget),
+ cell_width, &cell_minimum, &cell_natural);
minimum = MAX (minimum, cell_minimum);
natural = MAX (natural, cell_natural);
diff --git a/gtk/gtkcheckbutton.c b/gtk/gtkcheckbutton.c
index efad508..6e7e2ee 100644
--- a/gtk/gtkcheckbutton.c
+++ b/gtk/gtkcheckbutton.c
@@ -285,8 +285,8 @@ gtk_check_button_size_allocate (GtkWidget *widget,
GtkRequisition child_requisition;
guint border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
- gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
- &child_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (child),
+ &child_requisition, NULL);
child_allocation.width = MIN (child_requisition.width,
allocation->width -
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index 5c2c4e6..bc4e8e1 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -468,17 +468,17 @@ static void gtk_combo_box_start_editing (GtkCellEditable *c
GdkEvent *event);
static void gtk_combo_box_size_request_init (GtkSizeRequestIface *iface);
-static void gtk_combo_box_get_width (GtkSizeRequest *widget,
+static void gtk_combo_box_get_preferred_width (GtkSizeRequest *widget,
gint *minimum_size,
gint *natural_size);
-static void gtk_combo_box_get_height (GtkSizeRequest *widget,
+static void gtk_combo_box_get_preferred_height (GtkSizeRequest *widget,
gint *minimum_size,
gint *natural_size);
-static void gtk_combo_box_get_width_for_height (GtkSizeRequest *widget,
+static void gtk_combo_box_get_preferred_width_for_height (GtkSizeRequest *widget,
gint avail_size,
gint *minimum_size,
gint *natural_size);
-static void gtk_combo_box_get_height_for_width (GtkSizeRequest *widget,
+static void gtk_combo_box_get_preferred_height_for_width (GtkSizeRequest *widget,
gint avail_size,
gint *minimum_size,
gint *natural_size);
@@ -1588,7 +1588,7 @@ gtk_combo_box_menu_position_over (GtkMenu *menu,
menu_xpos = allocation.x;
menu_ypos = allocation.y + allocation.height / 2 - 2;
- gtk_size_request_get_width (GTK_SIZE_REQUEST (menu), &menu_width, NULL);
+ gtk_size_request_get_preferred_width (GTK_SIZE_REQUEST (menu), &menu_width, NULL);
if (active != NULL)
{
@@ -1888,7 +1888,7 @@ gtk_combo_box_menu_popup (GtkComboBox *combo_box,
gtk_widget_get_allocation (GTK_WIDGET (combo_box), &allocation);
width = allocation.width;
gtk_widget_set_size_request (priv->popup_widget, -1, -1);
- gtk_size_request_get_width (GTK_SIZE_REQUEST (priv->popup_widget), &min_width, NULL);
+ gtk_size_request_get_preferred_width (GTK_SIZE_REQUEST (priv->popup_widget), &min_width, NULL);
gtk_widget_set_size_request (priv->popup_widget,
MAX (width, min_width), -1);
@@ -2297,7 +2297,7 @@ gtk_combo_box_size_allocate (GtkWidget *widget,
gtk_widget_get_allocation (GTK_WIDGET (combo_box), &combo_box_allocation);
width = combo_box_allocation.width;
gtk_widget_set_size_request (priv->popup_widget, -1, -1);
- gtk_size_request_get_width (GTK_SIZE_REQUEST (priv->popup_widget), &min_width, NULL);
+ gtk_size_request_get_preferred_width (GTK_SIZE_REQUEST (priv->popup_widget), &min_width, NULL);
gtk_widget_set_size_request (priv->popup_widget,
MAX (width, min_width), -1);
}
@@ -5947,10 +5947,10 @@ gtk_combo_box_buildable_custom_tag_end (GtkBuildable *buildable,
static void
gtk_combo_box_size_request_init (GtkSizeRequestIface *iface)
{
- iface->get_width = gtk_combo_box_get_width;
- iface->get_height = gtk_combo_box_get_height;
- iface->get_height_for_width = gtk_combo_box_get_height_for_width;
- iface->get_width_for_height = gtk_combo_box_get_width_for_height;
+ iface->get_preferred_width = gtk_combo_box_get_preferred_width;
+ iface->get_preferred_height = gtk_combo_box_get_preferred_height;
+ iface->get_preferred_height_for_width = gtk_combo_box_get_preferred_height_for_width;
+ iface->get_preferred_width_for_height = gtk_combo_box_get_preferred_width_for_height;
}
static void
@@ -6001,8 +6001,8 @@ gtk_combo_box_measure_height_for_width (GtkComboBox *combo_box,
child = gtk_bin_get_child (GTK_BIN (combo_box));
- gtk_size_request_get_height_for_width (GTK_SIZE_REQUEST (child), avail_width,
- &child_min, &child_nat);
+ gtk_size_request_get_preferred_height_for_width (GTK_SIZE_REQUEST (child), avail_width,
+ &child_min, &child_nat);
if (!priv->model ||
!gtk_tree_model_get_iter_first (priv->model, &iter))
@@ -6038,9 +6038,9 @@ gtk_combo_box_measure_height_for_width (GtkComboBox *combo_box,
static void
-gtk_combo_box_get_width (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size)
+gtk_combo_box_get_preferred_width (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
{
GtkComboBox *combo_box = GTK_COMBO_BOX (widget);
GtkComboBoxPrivate *priv = combo_box->priv;
@@ -6057,7 +6057,7 @@ gtk_combo_box_get_width (GtkSizeRequest *widget,
child = gtk_bin_get_child (GTK_BIN (widget));
/* common */
- gtk_size_request_get_width (GTK_SIZE_REQUEST (child), &child_min, &child_nat);
+ gtk_size_request_get_preferred_width (GTK_SIZE_REQUEST (child), &child_min, &child_nat);
gtk_combo_box_remeasure (combo_box);
child_min = MAX (child_min, priv->minimum_width);
@@ -6093,8 +6093,8 @@ gtk_combo_box_get_width (GtkSizeRequest *widget,
border_width = gtk_container_get_border_width (GTK_CONTAINER (combo_box));
xthickness = gtk_widget_get_style (priv->button)->xthickness;
- gtk_size_request_get_width (GTK_SIZE_REQUEST (priv->separator), &sep_width, NULL);
- gtk_size_request_get_width (GTK_SIZE_REQUEST (priv->arrow), &arrow_width, NULL);
+ gtk_size_request_get_preferred_width (GTK_SIZE_REQUEST (priv->separator), &sep_width, NULL);
+ gtk_size_request_get_preferred_width (GTK_SIZE_REQUEST (priv->arrow), &arrow_width, NULL);
xpad = 2*(border_width + xthickness + focus_width + focus_pad);
@@ -6105,8 +6105,8 @@ gtk_combo_box_get_width (GtkSizeRequest *widget,
{
gint but_width, but_nat_width;
- gtk_size_request_get_width (GTK_SIZE_REQUEST (priv->button),
- &but_width, &but_nat_width);
+ gtk_size_request_get_preferred_width (GTK_SIZE_REQUEST (priv->button),
+ &but_width, &but_nat_width);
minimum_width = child_min + but_width;
natural_width = child_nat + but_nat_width;
@@ -6137,8 +6137,8 @@ gtk_combo_box_get_width (GtkSizeRequest *widget,
}
/* the button */
- gtk_size_request_get_width (GTK_SIZE_REQUEST (priv->button),
- &button_width, &button_nat_width);
+ gtk_size_request_get_preferred_width (GTK_SIZE_REQUEST (priv->button),
+ &button_width, &button_nat_width);
minimum_width += button_width;
natural_width += button_nat_width;
@@ -6160,35 +6160,35 @@ gtk_combo_box_get_width (GtkSizeRequest *widget,
}
static void
-gtk_combo_box_get_height (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size)
+gtk_combo_box_get_preferred_height (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
{
gint min_width;
/* Combo box is height-for-width only
* (so we always just reserve enough height for the minimum width) */
- GTK_SIZE_REQUEST_GET_IFACE (widget)->get_width (widget, &min_width, NULL);
- GTK_SIZE_REQUEST_GET_IFACE (widget)->get_height_for_width (widget, min_width, minimum_size, natural_size);
+ GTK_SIZE_REQUEST_GET_IFACE (widget)->get_preferred_width (widget, &min_width, NULL);
+ GTK_SIZE_REQUEST_GET_IFACE (widget)->get_preferred_height_for_width (widget, min_width, minimum_size, natural_size);
}
static void
-gtk_combo_box_get_width_for_height (GtkSizeRequest *widget,
- gint avail_size,
- gint *minimum_size,
- gint *natural_size)
+gtk_combo_box_get_preferred_width_for_height (GtkSizeRequest *widget,
+ gint avail_size,
+ gint *minimum_size,
+ gint *natural_size)
{
/* Combo box is height-for-width only
* (so we assume we always reserved enough height for the minimum width) */
- GTK_SIZE_REQUEST_GET_IFACE (widget)->get_width (widget, minimum_size, natural_size);
+ GTK_SIZE_REQUEST_GET_IFACE (widget)->get_preferred_width (widget, minimum_size, natural_size);
}
static void
-gtk_combo_box_get_height_for_width (GtkSizeRequest *widget,
- gint avail_size,
- gint *minimum_size,
- gint *natural_size)
+gtk_combo_box_get_preferred_height_for_width (GtkSizeRequest *widget,
+ gint avail_size,
+ gint *minimum_size,
+ gint *natural_size)
{
GtkComboBox *combo_box = GTK_COMBO_BOX (widget);
GtkComboBoxPrivate *priv = combo_box->priv;
@@ -6223,12 +6223,12 @@ gtk_combo_box_get_height_for_width (GtkSizeRequest *widget,
xthickness = button_style->xthickness;
ythickness = button_style->ythickness;
- gtk_size_request_get_width (GTK_SIZE_REQUEST (priv->separator), &sep_width, NULL);
- gtk_size_request_get_width (GTK_SIZE_REQUEST (priv->arrow), &arrow_width, NULL);
- gtk_size_request_get_height_for_width (GTK_SIZE_REQUEST (priv->separator),
- sep_width, &sep_height, NULL);
- gtk_size_request_get_height_for_width (GTK_SIZE_REQUEST (priv->arrow),
- arrow_width, &arrow_height, NULL);
+ gtk_size_request_get_preferred_width (GTK_SIZE_REQUEST (priv->separator), &sep_width, NULL);
+ gtk_size_request_get_preferred_width (GTK_SIZE_REQUEST (priv->arrow), &arrow_width, NULL);
+ gtk_size_request_get_preferred_height_for_width (GTK_SIZE_REQUEST (priv->separator),
+ sep_width, &sep_height, NULL);
+ gtk_size_request_get_preferred_height_for_width (GTK_SIZE_REQUEST (priv->arrow),
+ arrow_width, &arrow_height, NULL);
xpad = 2*(border_width + xthickness + focus_width + focus_pad);
ypad = 2*(border_width + ythickness + focus_width + focus_pad);
@@ -6249,9 +6249,9 @@ gtk_combo_box_get_height_for_width (GtkSizeRequest *widget,
/* there is a custom child widget inside (no priv->cell_view) */
gint but_width, but_height;
- gtk_size_request_get_width (GTK_SIZE_REQUEST (priv->button), &but_width, NULL);
- gtk_size_request_get_height_for_width (GTK_SIZE_REQUEST (priv->button),
- but_width, &but_height, NULL);
+ gtk_size_request_get_preferred_width (GTK_SIZE_REQUEST (priv->button), &but_width, NULL);
+ gtk_size_request_get_preferred_height_for_width (GTK_SIZE_REQUEST (priv->button),
+ but_width, &but_height, NULL);
size -= but_width;
@@ -6267,9 +6267,9 @@ gtk_combo_box_get_height_for_width (GtkSizeRequest *widget,
gint but_width, but_height;
gint xpad = 0, ypad = 0;
- gtk_size_request_get_width (GTK_SIZE_REQUEST (priv->button), &but_width, NULL);
- gtk_size_request_get_height_for_width (GTK_SIZE_REQUEST (priv->button),
- but_width, &but_height, NULL);
+ gtk_size_request_get_preferred_width (GTK_SIZE_REQUEST (priv->button), &but_width, NULL);
+ gtk_size_request_get_preferred_height_for_width (GTK_SIZE_REQUEST (priv->button),
+ but_width, &but_height, NULL);
if (priv->cell_view_frame && priv->has_frame)
{
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 7e03bd3..16c4ae2 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -2992,8 +2992,8 @@ gtk_entry_get_text_area_size (GtkEntry *entry,
gint frame_height;
gint xborder, yborder;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (widget),
- &requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (widget),
+ &requisition, NULL);
gtk_widget_get_allocation (widget, &allocation);
_gtk_entry_get_borders (entry, &xborder, &yborder);
@@ -3047,8 +3047,8 @@ get_widget_window_size (GtkEntry *entry,
GtkRequisition requisition;
GtkWidget *widget = GTK_WIDGET (entry);
- gtk_size_request_get_size (GTK_SIZE_REQUEST (widget),
- &requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (widget),
+ &requisition, NULL);
gtk_widget_get_allocation (widget, &allocation);
if (x)
diff --git a/gtk/gtkexpander.c b/gtk/gtkexpander.c
index 5d8b692..f89daa7 100644
--- a/gtk/gtkexpander.c
+++ b/gtk/gtkexpander.c
@@ -135,21 +135,21 @@ static void gtk_expander_buildable_add_child (GtkBuildable *buildable,
/* GtkSizeRequest */
-static void gtk_expander_size_request_init (GtkSizeRequestIface *iface);
-static void gtk_expander_get_width (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size);
-static void gtk_expander_get_height (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size);
-static void gtk_expander_get_height_for_width (GtkSizeRequest *layout,
- gint width,
- gint *minimum_height,
- gint *natural_height);
-static void gtk_expander_get_width_for_height (GtkSizeRequest *layout,
- gint width,
- gint *minimum_height,
- gint *natural_height);
+static void gtk_expander_size_request_init (GtkSizeRequestIface *iface);
+static void gtk_expander_get_preferred_width (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size);
+static void gtk_expander_get_preferred_height (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size);
+static void gtk_expander_get_preferred_height_for_width (GtkSizeRequest *layout,
+ gint width,
+ gint *minimum_height,
+ gint *natural_height);
+static void gtk_expander_get_preferred_width_for_height (GtkSizeRequest *layout,
+ gint width,
+ gint *minimum_height,
+ gint *natural_height);
G_DEFINE_TYPE_WITH_CODE (GtkExpander, gtk_expander, GTK_TYPE_BIN,
G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
@@ -451,8 +451,8 @@ gtk_expander_realize (GtkWidget *widget)
{
GtkRequisition label_requisition;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->label_widget),
- &label_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (priv->label_widget),
+ &label_requisition, NULL);
label_height = label_requisition.height;
}
else
@@ -620,7 +620,7 @@ gtk_expander_size_allocate (GtkWidget *widget,
gint natural_label_width;
gboolean ltr;
- gtk_size_request_get_width (GTK_SIZE_REQUEST (priv->label_widget), NULL, &natural_label_width);
+ gtk_size_request_get_preferred_width (GTK_SIZE_REQUEST (priv->label_widget), NULL, &natural_label_width);
if (priv->label_fill)
label_allocation.width = allocation->width - label_xpad;
@@ -630,8 +630,8 @@ gtk_expander_size_allocate (GtkWidget *widget,
/* We distribute the minimum height to the label widget and prioritize
* the child widget giving it the remaining height */
- gtk_size_request_get_height_for_width (GTK_SIZE_REQUEST (priv->label_widget),
- label_allocation.width, &label_height, NULL);
+ gtk_size_request_get_preferred_height_for_width (GTK_SIZE_REQUEST (priv->label_widget),
+ label_allocation.width, &label_height, NULL);
ltr = gtk_widget_get_direction (widget) != GTK_TEXT_DIR_RTL;
@@ -1275,16 +1275,16 @@ gtk_expander_activate (GtkExpander *expander)
static void
gtk_expander_size_request_init (GtkSizeRequestIface *iface)
{
- iface->get_width = gtk_expander_get_width;
- iface->get_height = gtk_expander_get_height;
- iface->get_height_for_width = gtk_expander_get_height_for_width;
- iface->get_width_for_height = gtk_expander_get_width_for_height;
+ iface->get_preferred_width = gtk_expander_get_preferred_width;
+ iface->get_preferred_height = gtk_expander_get_preferred_height;
+ iface->get_preferred_height_for_width = gtk_expander_get_preferred_height_for_width;
+ iface->get_preferred_width_for_height = gtk_expander_get_preferred_width_for_height;
}
static void
-gtk_expander_get_width (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size)
+gtk_expander_get_preferred_width (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
{
GtkExpander *expander;
GtkWidget *child;
@@ -1318,8 +1318,8 @@ gtk_expander_get_width (GtkSizeRequest *widget,
{
gint label_min, label_nat;
- gtk_size_request_get_width (GTK_SIZE_REQUEST (priv->label_widget),
- &label_min, &label_nat);
+ gtk_size_request_get_preferred_width (GTK_SIZE_REQUEST (priv->label_widget),
+ &label_min, &label_nat);
*minimum_size += label_min;
*natural_size += label_nat;
@@ -1329,8 +1329,8 @@ gtk_expander_get_width (GtkSizeRequest *widget,
{
gint child_min, child_nat;
- gtk_size_request_get_width (GTK_SIZE_REQUEST (child),
- &child_min, &child_nat);
+ gtk_size_request_get_preferred_width (GTK_SIZE_REQUEST (child),
+ &child_min, &child_nat);
*minimum_size = MAX (*minimum_size, child_min);
*natural_size = MAX (*natural_size, child_nat);
@@ -1342,9 +1342,9 @@ gtk_expander_get_width (GtkSizeRequest *widget,
}
static void
-gtk_expander_get_height (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size)
+gtk_expander_get_preferred_height (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
{
GtkExpander *expander;
GtkWidget *child;
@@ -1378,8 +1378,8 @@ gtk_expander_get_height (GtkSizeRequest *widget,
{
gint label_min, label_nat;
- gtk_size_request_get_height (GTK_SIZE_REQUEST (priv->label_widget),
- &label_min, &label_nat);
+ gtk_size_request_get_preferred_height (GTK_SIZE_REQUEST (priv->label_widget),
+ &label_min, &label_nat);
*minimum_size += label_min;
*natural_size += label_nat;
@@ -1399,8 +1399,8 @@ gtk_expander_get_height (GtkSizeRequest *widget,
{
gint child_min, child_nat;
- gtk_size_request_get_height (GTK_SIZE_REQUEST (child),
- &child_min, &child_nat);
+ gtk_size_request_get_preferred_height (GTK_SIZE_REQUEST (child),
+ &child_min, &child_nat);
*minimum_size += child_min + priv->spacing;
*natural_size += child_nat + priv->spacing;
@@ -1412,10 +1412,10 @@ gtk_expander_get_height (GtkSizeRequest *widget,
}
static void
-gtk_expander_get_height_for_width (GtkSizeRequest *widget,
- gint width,
- gint *minimum_height,
- gint *natural_height)
+gtk_expander_get_preferred_height_for_width (GtkSizeRequest *widget,
+ gint width,
+ gint *minimum_height,
+ gint *natural_height)
{
GtkExpander *expander;
GtkWidget *child;
@@ -1452,9 +1452,9 @@ gtk_expander_get_height_for_width (GtkSizeRequest *widget,
{
gint label_min, label_nat;
- gtk_size_request_get_height_for_width (GTK_SIZE_REQUEST (priv->label_widget),
- MAX (width - label_xpad, 1),
- &label_min, &label_nat);
+ gtk_size_request_get_preferred_height_for_width (GTK_SIZE_REQUEST (priv->label_widget),
+ MAX (width - label_xpad, 1),
+ &label_min, &label_nat);
*minimum_height += label_min;
*natural_height += label_nat;
@@ -1474,9 +1474,9 @@ gtk_expander_get_height_for_width (GtkSizeRequest *widget,
{
gint child_min, child_nat;
- gtk_size_request_get_height_for_width (GTK_SIZE_REQUEST (child),
- MAX (width - 2 * border_width, 1),
- &child_min, &child_nat);
+ gtk_size_request_get_preferred_height_for_width (GTK_SIZE_REQUEST (child),
+ MAX (width - 2 * border_width, 1),
+ &child_min, &child_nat);
*minimum_height += child_min + priv->spacing;
*natural_height += child_nat + priv->spacing;
@@ -1487,12 +1487,12 @@ gtk_expander_get_height_for_width (GtkSizeRequest *widget,
}
static void
-gtk_expander_get_width_for_height (GtkSizeRequest *widget,
- gint height,
- gint *minimum_width,
- gint *natural_width)
+gtk_expander_get_preferred_width_for_height (GtkSizeRequest *widget,
+ gint height,
+ gint *minimum_width,
+ gint *natural_width)
{
- GTK_SIZE_REQUEST_GET_IFACE (widget)->get_width (widget, minimum_width, natural_width);
+ GTK_SIZE_REQUEST_GET_IFACE (widget)->get_preferred_width (widget, minimum_width, natural_width);
}
diff --git a/gtk/gtkfixed.c b/gtk/gtkfixed.c
index 597e952..5db680f 100644
--- a/gtk/gtkfixed.c
+++ b/gtk/gtkfixed.c
@@ -401,8 +401,8 @@ gtk_fixed_size_allocate (GtkWidget *widget,
if (gtk_widget_get_visible (child->widget))
{
- gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
- &child_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (child->widget),
+ &child_requisition, NULL);
child_allocation.x = child->x + border_width;
child_allocation.y = child->y + border_width;
diff --git a/gtk/gtkfontsel.c b/gtk/gtkfontsel.c
index 40a56f6..7da275a 100644
--- a/gtk/gtkfontsel.c
+++ b/gtk/gtkfontsel.c
@@ -1173,8 +1173,8 @@ gtk_font_selection_update_preview (GtkFontSelection *fontsel)
GtkWidget *preview_entry = priv->preview_entry;
const gchar *text;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (preview_entry),
- &old_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (preview_entry),
+ &old_requisition, NULL);
rc_style = gtk_rc_style_new ();
rc_style->font_desc = gtk_font_selection_get_font_description (fontsel);
@@ -1182,7 +1182,7 @@ gtk_font_selection_update_preview (GtkFontSelection *fontsel)
gtk_widget_modify_style (preview_entry, rc_style);
g_object_unref (rc_style);
- gtk_size_request_get_size (GTK_SIZE_REQUEST (preview_entry), &new_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (preview_entry), &new_requisition, NULL);
/* We don't ever want to be over MAX_PREVIEW_HEIGHT pixels high. */
new_height = CLAMP (new_requisition.height, INITIAL_PREVIEW_HEIGHT, MAX_PREVIEW_HEIGHT);
diff --git a/gtk/gtkframe.c b/gtk/gtkframe.c
index 29d2af3..bd86356 100644
--- a/gtk/gtkframe.c
+++ b/gtk/gtkframe.c
@@ -91,17 +91,17 @@ static void gtk_frame_buildable_add_child (GtkBuildable *buildable,
const gchar *type);
static void gtk_frame_size_request_init (GtkSizeRequestIface *iface);
-static void gtk_frame_get_width (GtkSizeRequest *widget,
+static void gtk_frame_get_preferred_width (GtkSizeRequest *widget,
gint *minimum_size,
gint *natural_size);
-static void gtk_frame_get_height (GtkSizeRequest *widget,
+static void gtk_frame_get_preferred_height (GtkSizeRequest *widget,
gint *minimum_size,
gint *natural_size);
-static void gtk_frame_get_height_for_width (GtkSizeRequest *layout,
+static void gtk_frame_get_preferred_height_for_width(GtkSizeRequest *layout,
gint width,
gint *minimum_height,
gint *natural_height);
-static void gtk_frame_get_width_for_height (GtkSizeRequest *layout,
+static void gtk_frame_get_preferred_width_for_height(GtkSizeRequest *layout,
gint width,
gint *minimum_height,
gint *natural_height);
@@ -681,12 +681,12 @@ gtk_frame_size_allocate (GtkWidget *widget,
else
xalign = 1 - priv->label_xalign;
- gtk_size_request_get_width (GTK_SIZE_REQUEST (priv->label_widget), NULL, &nat_width);
+ gtk_size_request_get_preferred_width (GTK_SIZE_REQUEST (priv->label_widget), NULL, &nat_width);
width = new_allocation.width - 2 * LABEL_PAD - 2 * LABEL_SIDE_PAD;
width = MIN (width, nat_width);
- gtk_size_request_get_height_for_width (GTK_SIZE_REQUEST (priv->label_widget), width,
- &height, NULL);
+ gtk_size_request_get_preferred_height_for_width (GTK_SIZE_REQUEST (priv->label_widget), width,
+ &height, NULL);
priv->label_allocation.x = priv->child_allocation.x + LABEL_SIDE_PAD +
@@ -732,7 +732,7 @@ gtk_frame_real_compute_child_allocation (GtkFrame *frame,
{
gint nat_width, width, height;
- gtk_size_request_get_width (GTK_SIZE_REQUEST (priv->label_widget), NULL, &nat_width);
+ gtk_size_request_get_preferred_width (GTK_SIZE_REQUEST (priv->label_widget), NULL, &nat_width);
width = allocation.width;
width -= 2 * LABEL_PAD + 2 * LABEL_SIDE_PAD;
@@ -740,8 +740,8 @@ gtk_frame_real_compute_child_allocation (GtkFrame *frame,
width = MIN (width, nat_width);
- gtk_size_request_get_height_for_width (GTK_SIZE_REQUEST (priv->label_widget), width,
- &height, NULL);
+ gtk_size_request_get_preferred_height_for_width (GTK_SIZE_REQUEST (priv->label_widget), width,
+ &height, NULL);
top_margin = MAX (height, style->ythickness);
}
@@ -759,10 +759,10 @@ gtk_frame_real_compute_child_allocation (GtkFrame *frame,
}
static void
-gtk_frame_get_size (GtkSizeRequest *request,
- GtkOrientation orientation,
- gint *minimum_size,
- gint *natural_size)
+gtk_frame_get_preferred_size (GtkSizeRequest *request,
+ GtkOrientation orientation,
+ gint *minimum_size,
+ gint *natural_size)
{
GtkFrame *frame = GTK_FRAME (request);
GtkFramePrivate *priv = frame->priv;
@@ -780,15 +780,15 @@ gtk_frame_get_size (GtkSizeRequest *request,
{
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
- gtk_size_request_get_width (GTK_SIZE_REQUEST (priv->label_widget),
- &child_min, &child_nat);
+ gtk_size_request_get_preferred_width (GTK_SIZE_REQUEST (priv->label_widget),
+ &child_min, &child_nat);
minimum = child_min + 2 * LABEL_PAD + 2 * LABEL_SIDE_PAD;
natural = child_nat + 2 * LABEL_PAD + 2 * LABEL_SIDE_PAD;
}
else
{
- gtk_size_request_get_height (GTK_SIZE_REQUEST (priv->label_widget),
- &child_min, &child_nat);
+ gtk_size_request_get_preferred_height (GTK_SIZE_REQUEST (priv->label_widget),
+ &child_min, &child_nat);
minimum = MAX (0, child_min - style->ythickness);
natural = MAX (0, child_nat - style->ythickness);
}
@@ -804,15 +804,15 @@ gtk_frame_get_size (GtkSizeRequest *request,
{
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
- gtk_size_request_get_width (GTK_SIZE_REQUEST (child),
- &child_min, &child_nat);
+ gtk_size_request_get_preferred_width (GTK_SIZE_REQUEST (child),
+ &child_min, &child_nat);
minimum = MAX (minimum, child_min);
natural = MAX (natural, child_nat);
}
else
{
- gtk_size_request_get_height (GTK_SIZE_REQUEST (child),
- &child_min, &child_nat);
+ gtk_size_request_get_preferred_height (GTK_SIZE_REQUEST (child),
+ &child_min, &child_nat);
minimum += child_min;
natural += child_nat;
}
@@ -839,27 +839,27 @@ gtk_frame_get_size (GtkSizeRequest *request,
}
static void
-gtk_frame_get_width (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size)
+gtk_frame_get_preferred_width (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
{
- gtk_frame_get_size (widget, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size);
+ gtk_frame_get_preferred_size (widget, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size);
}
static void
-gtk_frame_get_height (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size)
+gtk_frame_get_preferred_height (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
{
- gtk_frame_get_size (widget, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size);
+ gtk_frame_get_preferred_size (widget, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size);
}
static void
-gtk_frame_get_height_for_width (GtkSizeRequest *request,
- gint width,
- gint *minimum_height,
- gint *natural_height)
+gtk_frame_get_preferred_height_for_width (GtkSizeRequest *request,
+ gint width,
+ gint *minimum_height,
+ gint *natural_height)
{
GtkWidget *widget = GTK_WIDGET (request);
GtkWidget *child;
@@ -882,8 +882,8 @@ gtk_frame_get_height_for_width (GtkSizeRequest *request,
if (priv->label_widget && gtk_widget_get_visible (priv->label_widget))
{
- gtk_size_request_get_height_for_width (GTK_SIZE_REQUEST (priv->label_widget),
- label_width, &child_min, &child_nat);
+ gtk_size_request_get_preferred_height_for_width (GTK_SIZE_REQUEST (priv->label_widget),
+ label_width, &child_min, &child_nat);
minimum += child_min;
natural += child_nat;
}
@@ -891,8 +891,8 @@ gtk_frame_get_height_for_width (GtkSizeRequest *request,
child = gtk_bin_get_child (bin);
if (child && gtk_widget_get_visible (child))
{
- gtk_size_request_get_height_for_width (GTK_SIZE_REQUEST (child),
- width, &child_min, &child_nat);
+ gtk_size_request_get_preferred_height_for_width (GTK_SIZE_REQUEST (child),
+ width, &child_min, &child_nat);
minimum += child_min;
natural += child_nat;
}
@@ -905,19 +905,19 @@ gtk_frame_get_height_for_width (GtkSizeRequest *request,
}
static void
-gtk_frame_get_width_for_height (GtkSizeRequest *widget,
- gint height,
- gint *minimum_width,
- gint *natural_width)
+gtk_frame_get_preferred_width_for_height (GtkSizeRequest *widget,
+ gint height,
+ gint *minimum_width,
+ gint *natural_width)
{
- GTK_SIZE_REQUEST_GET_IFACE (widget)->get_width (widget, minimum_width, natural_width);
+ GTK_SIZE_REQUEST_GET_IFACE (widget)->get_preferred_width (widget, minimum_width, natural_width);
}
static void
gtk_frame_size_request_init (GtkSizeRequestIface *iface)
{
- iface->get_width = gtk_frame_get_width;
- iface->get_height = gtk_frame_get_height;
- iface->get_height_for_width = gtk_frame_get_height_for_width;
- iface->get_width_for_height = gtk_frame_get_width_for_height;
+ iface->get_preferred_width = gtk_frame_get_preferred_width;
+ iface->get_preferred_height = gtk_frame_get_preferred_height;
+ iface->get_preferred_height_for_width = gtk_frame_get_preferred_height_for_width;
+ iface->get_preferred_width_for_height = gtk_frame_get_preferred_width_for_height;
}
diff --git a/gtk/gtkhandlebox.c b/gtk/gtkhandlebox.c
index 28a5206..d9f2d8b 100644
--- a/gtk/gtkhandlebox.c
+++ b/gtk/gtkhandlebox.c
@@ -448,7 +448,7 @@ gtk_handle_box_realize (GtkWidget *widget)
if (child)
gtk_widget_set_parent_window (child, priv->bin_window);
- gtk_size_request_get_size (GTK_SIZE_REQUEST (widget), &requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (widget), &requisition, NULL);
attributes.x = 0;
attributes.y = 0;
@@ -639,8 +639,8 @@ gtk_handle_box_size_allocate (GtkWidget *widget,
if (child)
{
- gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
- &child_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (child),
+ &child_requisition, NULL);
}
else
{
@@ -1345,8 +1345,8 @@ gtk_handle_box_motion (GtkWidget *widget,
if (child)
{
- gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
- &child_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (child),
+ &child_requisition, NULL);
}
else
{
diff --git a/gtk/gtkimagemenuitem.c b/gtk/gtkimagemenuitem.c
index c1e778b..d561917 100644
--- a/gtk/gtkimagemenuitem.c
+++ b/gtk/gtkimagemenuitem.c
@@ -346,8 +346,8 @@ gtk_image_menu_item_toggle_size_request (GtkMenuItem *menu_item,
GtkRequisition image_requisition;
guint toggle_spacing;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->image),
- &image_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (priv->image),
+ &image_requisition, NULL);
gtk_widget_style_get (GTK_WIDGET (menu_item),
"toggle-spacing", &toggle_spacing,
@@ -501,8 +501,8 @@ gtk_image_menu_item_size_allocate (GtkWidget *widget,
* come up with a solution that's really better.
*/
- gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->image),
- &child_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (priv->image),
+ &child_requisition, NULL);
gtk_widget_get_allocation (widget, &widget_allocation);
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index aa7c748..9f40686 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -331,22 +331,22 @@ static void gtk_label_get_link_colors (GtkWidget *widget,
static void emit_activate_link (GtkLabel *label,
GtkLabelLink *link);
-static void gtk_label_size_request_init (GtkSizeRequestIface *iface);
-static GtkSizeRequestMode gtk_label_get_request_mode (GtkSizeRequest *widget);
-static void gtk_label_get_width (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size);
-static void gtk_label_get_height (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size);
-static void gtk_label_get_width_for_height (GtkSizeRequest *widget,
- gint height,
- gint *minimum_width,
- gint *natural_width);
-static void gtk_label_get_height_for_width (GtkSizeRequest *widget,
- gint width,
- gint *minimum_height,
- gint *natural_height);
+static void gtk_label_size_request_init (GtkSizeRequestIface *iface);
+static GtkSizeRequestMode gtk_label_get_request_mode (GtkSizeRequest *widget);
+static void gtk_label_get_preferred_width (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size);
+static void gtk_label_get_preferred_height (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size);
+static void gtk_label_get_preferred_width_for_height (GtkSizeRequest *widget,
+ gint height,
+ gint *minimum_width,
+ gint *natural_width);
+static void gtk_label_get_preferred_height_for_width (GtkSizeRequest *widget,
+ gint width,
+ gint *minimum_height,
+ gint *natural_height);
static GtkBuildableIface *buildable_parent_iface = NULL;
@@ -3356,11 +3356,11 @@ get_single_line_height (GtkWidget *widget,
static void
gtk_label_size_request_init (GtkSizeRequestIface *iface)
{
- iface->get_request_mode = gtk_label_get_request_mode;
- iface->get_width = gtk_label_get_width;
- iface->get_height = gtk_label_get_height;
- iface->get_width_for_height = gtk_label_get_width_for_height;
- iface->get_height_for_width = gtk_label_get_height_for_width;
+ iface->get_request_mode = gtk_label_get_request_mode;
+ iface->get_preferred_width = gtk_label_get_preferred_width;
+ iface->get_preferred_height = gtk_label_get_preferred_height;
+ iface->get_preferred_width_for_height = gtk_label_get_preferred_width_for_height;
+ iface->get_preferred_height_for_width = gtk_label_get_preferred_height_for_width;
}
static GtkSizeRequestMode
@@ -3419,10 +3419,10 @@ get_size_for_allocation (GtkLabel *label,
}
static void
-gtk_label_get_size (GtkSizeRequest *widget,
- GtkOrientation orientation,
- gint *minimum_size,
- gint *natural_size)
+gtk_label_get_preferred_size (GtkSizeRequest *widget,
+ GtkOrientation orientation,
+ gint *minimum_size,
+ gint *natural_size)
{
GtkLabel *label = GTK_LABEL (widget);
GtkLabelPrivate *priv = label->priv;
@@ -3567,26 +3567,26 @@ gtk_label_get_size (GtkSizeRequest *widget,
static void
-gtk_label_get_width (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size)
+gtk_label_get_preferred_width (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
{
- gtk_label_get_size (widget, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size);
+ gtk_label_get_preferred_size (widget, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size);
}
static void
-gtk_label_get_height (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size)
+gtk_label_get_preferred_height (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
{
- gtk_label_get_size (widget, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size);
+ gtk_label_get_preferred_size (widget, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size);
}
static void
-gtk_label_get_width_for_height (GtkSizeRequest *widget,
- gint height,
- gint *minimum_width,
- gint *natural_width)
+gtk_label_get_preferred_width_for_height (GtkSizeRequest *widget,
+ gint height,
+ gint *minimum_width,
+ gint *natural_width)
{
GtkLabel *label = GTK_LABEL (widget);
GtkLabelPrivate *priv = label->priv;
@@ -3611,14 +3611,14 @@ gtk_label_get_width_for_height (GtkSizeRequest *widget,
*natural_width += xpad * 2;
}
else
- GTK_SIZE_REQUEST_GET_IFACE (widget)->get_width (widget, minimum_width, natural_width);
+ GTK_SIZE_REQUEST_GET_IFACE (widget)->get_preferred_width (widget, minimum_width, natural_width);
}
static void
-gtk_label_get_height_for_width (GtkSizeRequest *widget,
- gint width,
- gint *minimum_height,
- gint *natural_height)
+gtk_label_get_preferred_height_for_width (GtkSizeRequest *widget,
+ gint width,
+ gint *minimum_height,
+ gint *natural_height)
{
GtkLabel *label = GTK_LABEL (widget);
GtkLabelPrivate *priv = label->priv;
@@ -3643,7 +3643,7 @@ gtk_label_get_height_for_width (GtkSizeRequest *widget,
*natural_height += ypad * 2;
}
else
- GTK_SIZE_REQUEST_GET_IFACE (widget)->get_height (widget, minimum_height, natural_height);
+ GTK_SIZE_REQUEST_GET_IFACE (widget)->get_preferred_height (widget, minimum_height, natural_height);
}
static void
diff --git a/gtk/gtklayout.c b/gtk/gtklayout.c
index a783fad..f53f504 100644
--- a/gtk/gtklayout.c
+++ b/gtk/gtklayout.c
@@ -1125,8 +1125,8 @@ gtk_layout_allocate_child (GtkLayout *layout,
allocation.x = child->x;
allocation.y = child->y;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
- &requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (child->widget),
+ &requisition, NULL);
allocation.width = requisition.width;
allocation.height = requisition.height;
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index 8555c4e..8da4f58 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -258,17 +258,17 @@ static gboolean gtk_menu_real_can_activate_accel (GtkWidget *widget,
static void _gtk_menu_refresh_accel_paths (GtkMenu *menu,
gboolean group_changed);
-static void gtk_menu_size_request_init (GtkSizeRequestIface *iface);
-static void gtk_menu_get_width (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size);
-static void gtk_menu_get_height (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size);
-static void gtk_menu_get_height_for_width (GtkSizeRequest *widget,
- gint for_size,
- gint *minimum_size,
- gint *natural_size);
+static void gtk_menu_size_request_init (GtkSizeRequestIface *iface);
+static void gtk_menu_get_preferred_width (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size);
+static void gtk_menu_get_preferred_height (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size);
+static void gtk_menu_get_preferred_height_for_width (GtkSizeRequest *widget,
+ gint for_size,
+ gint *minimum_size,
+ gint *natural_size);
static const gchar attach_data_key[] = "gtk-menu-attach-data";
@@ -1625,7 +1625,7 @@ gtk_menu_popup_for_device (GtkMenu *menu,
/* Instead of trusting the menu position function to queue a resize when the
* menu goes out of bounds, invalidate the cached size here. */
gtk_widget_queue_resize (GTK_WIDGET (menu));
- gtk_size_request_get_size (GTK_SIZE_REQUEST (menu->toplevel), &tmp_request, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (menu->toplevel), &tmp_request, NULL);
tmp_allocation.width = tmp_request.width;
tmp_allocation.height = tmp_request.height;
@@ -2599,8 +2599,8 @@ calculate_line_heights (GtkMenu *menu,
part = avail_width / (r - l);
- gtk_size_request_get_height_for_width (GTK_SIZE_REQUEST (child), part,
- &child_min, &child_nat);
+ gtk_size_request_get_preferred_height_for_width (GTK_SIZE_REQUEST (child), part,
+ &child_min, &child_nat);
gtk_menu_item_toggle_size_request (GTK_MENU_ITEM (child), &toggle_size);
@@ -3015,15 +3015,15 @@ gtk_menu_show (GtkWidget *widget)
static void
gtk_menu_size_request_init (GtkSizeRequestIface *iface)
{
- iface->get_width = gtk_menu_get_width;
- iface->get_height = gtk_menu_get_height;
- iface->get_height_for_width = gtk_menu_get_height_for_width;
+ iface->get_preferred_width = gtk_menu_get_preferred_width;
+ iface->get_preferred_height = gtk_menu_get_preferred_height;
+ iface->get_preferred_height_for_width = gtk_menu_get_preferred_height_for_width;
}
static void
-gtk_menu_get_width (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size)
+gtk_menu_get_preferred_width (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
{
GtkMenu *menu;
GtkMenuShell *menu_shell;
@@ -3071,7 +3071,7 @@ gtk_menu_get_width (GtkSizeRequest *widget,
*/
GTK_MENU_ITEM (child)->show_submenu_indicator = TRUE;
- gtk_size_request_get_width (GTK_SIZE_REQUEST (child), &child_min, &child_nat);
+ gtk_size_request_get_preferred_width (GTK_SIZE_REQUEST (child), &child_min, &child_nat);
gtk_menu_item_toggle_size_request (GTK_MENU_ITEM (child), &toggle_size);
max_toggle_size = MAX (max_toggle_size, toggle_size);
@@ -3136,22 +3136,22 @@ gtk_menu_get_width (GtkSizeRequest *widget,
}
static void
-gtk_menu_get_height (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size)
+gtk_menu_get_preferred_height (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
{
gint min_width;
/* Menus are height-for-width only, just return the height for the minimum width */
- GTK_SIZE_REQUEST_GET_IFACE (widget)->get_width (widget, &min_width, NULL);
- GTK_SIZE_REQUEST_GET_IFACE (widget)->get_height_for_width (widget, min_width, minimum_size, natural_size);
+ GTK_SIZE_REQUEST_GET_IFACE (widget)->get_preferred_width (widget, &min_width, NULL);
+ GTK_SIZE_REQUEST_GET_IFACE (widget)->get_preferred_height_for_width (widget, min_width, minimum_size, natural_size);
}
static void
-gtk_menu_get_height_for_width (GtkSizeRequest *widget,
- gint for_size,
- gint *minimum_size,
- gint *natural_size)
+gtk_menu_get_preferred_height_for_width (GtkSizeRequest *widget,
+ gint for_size,
+ gint *minimum_size,
+ gint *natural_size)
{
GtkMenu *menu = GTK_MENU (widget);
GtkMenuPrivate *private = gtk_menu_get_private (menu);
@@ -4522,7 +4522,7 @@ gtk_menu_position (GtkMenu *menu)
/* Get the minimum height for minimum width to figure out
* the right place to popup the menu.
*/
- gtk_size_request_get_size (GTK_SIZE_REQUEST (widget), &requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (widget), &requisition, NULL);
if (pointer_screen != screen)
{
diff --git a/gtk/gtkmenubar.c b/gtk/gtkmenubar.c
index 57069a2..09d0d67 100644
--- a/gtk/gtkmenubar.c
+++ b/gtk/gtkmenubar.c
@@ -426,8 +426,8 @@ gtk_menu_bar_size_allocate (GtkWidget *widget,
gtk_menu_item_toggle_size_request (GTK_MENU_ITEM (child),
&toggle_size);
- gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
- &child_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (child),
+ &child_requisition, NULL);
if (priv->child_pack_direction == GTK_PACK_DIRECTION_LTR ||
priv->child_pack_direction == GTK_PACK_DIRECTION_RTL)
@@ -477,8 +477,8 @@ gtk_menu_bar_size_allocate (GtkWidget *widget,
gtk_menu_item_toggle_size_request (GTK_MENU_ITEM (child),
&toggle_size);
- gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
- &child_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (child),
+ &child_requisition, NULL);
if (priv->child_pack_direction == GTK_PACK_DIRECTION_LTR ||
priv->child_pack_direction == GTK_PACK_DIRECTION_RTL)
diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c
index 763ef2f..ea52c60 100644
--- a/gtk/gtkmenuitem.c
+++ b/gtk/gtkmenuitem.c
@@ -127,17 +127,17 @@ static void gtk_real_menu_item_set_label (GtkMenuItem *menu_item,
const gchar *label);
static G_CONST_RETURN gchar * gtk_real_menu_item_get_label (GtkMenuItem *menu_item);
-static void gtk_menu_item_size_request_init (GtkSizeRequestIface *iface);
-static void gtk_menu_item_get_width (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size);
-static void gtk_menu_item_get_height (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size);
-static void gtk_menu_item_get_height_for_width (GtkSizeRequest *widget,
- gint for_size,
- gint *minimum_size,
- gint *natural_size);
+static void gtk_menu_item_size_request_init (GtkSizeRequestIface *iface);
+static void gtk_menu_item_get_preferred_width (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size);
+static void gtk_menu_item_get_preferred_height (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size);
+static void gtk_menu_item_get_preferred_height_for_width (GtkSizeRequest *widget,
+ gint for_size,
+ gint *minimum_size,
+ gint *natural_size);
static void gtk_menu_item_buildable_interface_init (GtkBuildableIface *iface);
static void gtk_menu_item_buildable_add_child (GtkBuildable *buildable,
@@ -662,15 +662,15 @@ get_minimum_width (GtkWidget *widget)
static void
gtk_menu_item_size_request_init (GtkSizeRequestIface *iface)
{
- iface->get_width = gtk_menu_item_get_width;
- iface->get_height = gtk_menu_item_get_height;
- iface->get_height_for_width = gtk_menu_item_get_height_for_width;
+ iface->get_preferred_width = gtk_menu_item_get_preferred_width;
+ iface->get_preferred_height = gtk_menu_item_get_preferred_height;
+ iface->get_preferred_height_for_width = gtk_menu_item_get_preferred_height_for_width;
}
static void
-gtk_menu_item_get_width (GtkSizeRequest *request,
- gint *minimum_size,
- gint *natural_size)
+gtk_menu_item_get_preferred_width (GtkSizeRequest *request,
+ gint *minimum_size,
+ gint *natural_size)
{
GtkMenuItem *menu_item;
GtkBin *bin;
@@ -720,7 +720,7 @@ gtk_menu_item_get_width (GtkSizeRequest *request,
{
gint child_min, child_nat;
- gtk_size_request_get_width (GTK_SIZE_REQUEST (child), &child_min, &child_nat);
+ gtk_size_request_get_preferred_width (GTK_SIZE_REQUEST (child), &child_min, &child_nat);
if (menu_item->submenu && menu_item->show_submenu_indicator)
{
@@ -762,9 +762,9 @@ gtk_menu_item_get_width (GtkSizeRequest *request,
}
static void
-gtk_menu_item_get_height (GtkSizeRequest *request,
- gint *minimum_size,
- gint *natural_size)
+gtk_menu_item_get_preferred_height (GtkSizeRequest *request,
+ gint *minimum_size,
+ gint *natural_size)
{
GtkMenuItem *menu_item;
GtkBin *bin;
@@ -816,7 +816,7 @@ gtk_menu_item_get_height (GtkSizeRequest *request,
{
gint child_min, child_nat;
- gtk_size_request_get_height (GTK_SIZE_REQUEST (child), &child_min, &child_nat);
+ gtk_size_request_get_preferred_height (GTK_SIZE_REQUEST (child), &child_min, &child_nat);
min_height += child_min;
nat_height += child_nat;
@@ -863,10 +863,10 @@ gtk_menu_item_get_height (GtkSizeRequest *request,
}
static void
-gtk_menu_item_get_height_for_width (GtkSizeRequest *request,
- gint for_size,
- gint *minimum_size,
- gint *natural_size)
+gtk_menu_item_get_preferred_height_for_width (GtkSizeRequest *request,
+ gint for_size,
+ gint *minimum_size,
+ gint *natural_size)
{
GtkMenuItem *menu_item;
GtkBin *bin;
@@ -941,7 +941,10 @@ gtk_menu_item_get_height_for_width (GtkSizeRequest *request,
avail_size -= arrow_spacing;
}
- gtk_size_request_get_height_for_width (GTK_SIZE_REQUEST (child), avail_size, &child_min, &child_nat);
+ gtk_size_request_get_preferred_height_for_width (GTK_SIZE_REQUEST (child),
+ avail_size,
+ &child_min,
+ &child_nat);
min_height += child_min;
nat_height += child_nat;
@@ -1392,8 +1395,8 @@ gtk_menu_item_size_allocate (GtkWidget *widget,
child_allocation.x += allocation->x;
child_allocation.y += allocation->y;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
- &child_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (child),
+ &child_requisition, NULL);
if (menu_item->submenu && menu_item->show_submenu_indicator)
{
if (direction == GTK_TEXT_DIR_RTL)
@@ -1999,7 +2002,7 @@ gtk_menu_item_position_menu (GtkMenu *menu,
direction = gtk_widget_get_direction (widget);
- gtk_size_request_get_size (GTK_SIZE_REQUEST (menu), &requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (menu), &requisition, NULL);
twidth = requisition.width;
theight = requisition.height;
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index cca74f8..8026145 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -2199,8 +2199,8 @@ gtk_notebook_size_allocate (GtkWidget *widget,
widget_allocation.y = allocation->y + border_width;
is_rtl = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->action_widget[i]),
- &requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (priv->action_widget[i]),
+ &requisition, NULL);
switch (tab_pos)
{
@@ -5880,8 +5880,8 @@ gtk_notebook_page_allocate (GtkNotebook *notebook,
xthickness = style->xthickness;
ythickness = style->ythickness;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (page->tab_label),
- &tab_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (page->tab_label),
+ &tab_requisition, NULL);
gtk_widget_style_get (widget,
"focus-line-width", &focus_width,
"tab-curvature", &tab_curvature,
diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c
index 636e973..0fd1606 100644
--- a/gtk/gtkpaned.c
+++ b/gtk/gtkpaned.c
@@ -887,10 +887,10 @@ gtk_paned_size_allocate (GtkWidget *widget,
gtk_widget_style_get (widget, "handle-size", &handle_size, NULL);
- gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->child1),
- &child1_requisition, NULL);
- gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->child2),
- &child2_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (priv->child1),
+ &child1_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (priv->child2),
+ &child2_requisition, NULL);
old_handle_pos = priv->handle_pos;
diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c
index 479120c..28b6112 100644
--- a/gtk/gtkpathbar.c
+++ b/gtk/gtkpathbar.c
@@ -497,8 +497,8 @@ gtk_path_bar_size_allocate (GtkWidget *widget,
{
child = BUTTON_DATA (list->data)->button;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
- &child_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (child),
+ &child_requisition, NULL);
width += child_requisition.width + path_bar->spacing;
if (list == path_bar->fake_root)
@@ -528,8 +528,8 @@ gtk_path_bar_size_allocate (GtkWidget *widget,
* button, then count backwards.
*/
/* Count down the path chain towards the end. */
- gtk_size_request_get_size (GTK_SIZE_REQUEST (BUTTON_DATA (first_button->data)->button),
- &child_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (BUTTON_DATA (first_button->data)->button),
+ &child_requisition, NULL);
width = child_requisition.width;
list = first_button->prev;
@@ -537,8 +537,8 @@ gtk_path_bar_size_allocate (GtkWidget *widget,
{
child = BUTTON_DATA (list->data)->button;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
- &child_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (child),
+ &child_requisition, NULL);
if (width + child_requisition.width +
path_bar->spacing + slider_space > allocation_width)
@@ -557,8 +557,8 @@ gtk_path_bar_size_allocate (GtkWidget *widget,
{
child = BUTTON_DATA (first_button->next->data)->button;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
- &child_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (child),
+ &child_requisition, NULL);
if (width + child_requisition.width + path_bar->spacing + slider_space > allocation_width)
{
@@ -605,8 +605,8 @@ gtk_path_bar_size_allocate (GtkWidget *widget,
button_data = BUTTON_DATA (list->data);
child = button_data->button;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
- &child_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (child),
+ &child_requisition, NULL);
child_allocation.width = MIN (child_requisition.width,
allocation_width - (path_bar->spacing + path_bar->slider_width) * 2);
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index 719db34..b5c2742 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -152,17 +152,17 @@ static void gtk_scrolled_window_adjustment_changed (GtkAdjustment *adjus
static void gtk_scrolled_window_update_real_placement (GtkScrolledWindow *scrolled_window);
static void gtk_scrolled_window_size_request_init (GtkSizeRequestIface *iface);
-static void gtk_scrolled_window_get_width (GtkSizeRequest *widget,
+static void gtk_scrolled_window_get_preferred_width (GtkSizeRequest *widget,
gint *minimum_size,
gint *natural_size);
-static void gtk_scrolled_window_get_height (GtkSizeRequest *widget,
+static void gtk_scrolled_window_get_preferred_height (GtkSizeRequest *widget,
gint *minimum_size,
gint *natural_size);
-static void gtk_scrolled_window_get_height_for_width (GtkSizeRequest *layout,
+static void gtk_scrolled_window_get_preferred_height_for_width (GtkSizeRequest *layout,
gint width,
gint *minimum_height,
gint *natural_height);
-static void gtk_scrolled_window_get_width_for_height (GtkSizeRequest *layout,
+static void gtk_scrolled_window_get_preferred_width_for_height (GtkSizeRequest *layout,
gint width,
gint *minimum_height,
gint *natural_height);
@@ -1333,8 +1333,8 @@ gtk_scrolled_window_relative_allocation (GtkWidget *widget,
GtkRequisition vscrollbar_requisition;
gboolean is_rtl;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->vscrollbar),
- &vscrollbar_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (priv->vscrollbar),
+ &vscrollbar_requisition, NULL);
is_rtl = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL;
if ((!is_rtl &&
@@ -1351,8 +1351,8 @@ gtk_scrolled_window_relative_allocation (GtkWidget *widget,
{
GtkRequisition hscrollbar_requisition;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->hscrollbar),
- &hscrollbar_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (priv->hscrollbar),
+ &hscrollbar_requisition, NULL);
if (priv->real_window_placement == GTK_CORNER_BOTTOM_LEFT ||
priv->real_window_placement == GTK_CORNER_BOTTOM_RIGHT)
@@ -1455,8 +1455,8 @@ gtk_scrolled_window_size_allocate (GtkWidget *widget,
{
GtkRequisition hscrollbar_requisition;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->hscrollbar),
- &hscrollbar_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (priv->hscrollbar),
+ &hscrollbar_requisition, NULL);
if (!gtk_widget_get_visible (priv->hscrollbar))
gtk_widget_show (priv->hscrollbar);
@@ -1506,8 +1506,8 @@ gtk_scrolled_window_size_allocate (GtkWidget *widget,
if (!gtk_widget_get_visible (priv->vscrollbar))
gtk_widget_show (priv->vscrollbar);
- gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->vscrollbar),
- &vscrollbar_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (priv->vscrollbar),
+ &vscrollbar_requisition, NULL);
if ((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL &&
(priv->real_window_placement == GTK_CORNER_TOP_RIGHT ||
@@ -1803,17 +1803,17 @@ _gtk_scrolled_window_get_scrollbar_spacing (GtkScrolledWindow *scrolled_window)
static void
gtk_scrolled_window_size_request_init (GtkSizeRequestIface *iface)
{
- iface->get_width = gtk_scrolled_window_get_width;
- iface->get_height = gtk_scrolled_window_get_height;
- iface->get_height_for_width = gtk_scrolled_window_get_height_for_width;
- iface->get_width_for_height = gtk_scrolled_window_get_width_for_height;
+ iface->get_preferred_width = gtk_scrolled_window_get_preferred_width;
+ iface->get_preferred_height = gtk_scrolled_window_get_preferred_height;
+ iface->get_preferred_height_for_width = gtk_scrolled_window_get_preferred_height_for_width;
+ iface->get_preferred_width_for_height = gtk_scrolled_window_get_preferred_width_for_height;
}
static void
-gtk_scrolled_window_get_size (GtkSizeRequest *widget,
- GtkOrientation orientation,
- gint *minimum_size,
- gint *natural_size)
+gtk_scrolled_window_get_preferred_size (GtkSizeRequest *widget,
+ GtkOrientation orientation,
+ gint *minimum_size,
+ gint *natural_size)
{
GtkScrolledWindow *scrolled_window = GTK_SCROLLED_WINDOW (widget);
GtkScrolledWindowPrivate *priv = scrolled_window->priv;
@@ -1848,9 +1848,9 @@ gtk_scrolled_window_get_size (GtkSizeRequest *widget,
{
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
- gtk_size_request_get_width (GTK_SIZE_REQUEST (child),
- &min_child_size,
- &nat_child_size);
+ gtk_size_request_get_preferred_width (GTK_SIZE_REQUEST (child),
+ &min_child_size,
+ &nat_child_size);
if (priv->hscrollbar_policy == GTK_POLICY_NEVER)
{
@@ -1876,9 +1876,9 @@ gtk_scrolled_window_get_size (GtkSizeRequest *widget,
}
else /* GTK_ORIENTATION_VERTICAL */
{
- gtk_size_request_get_height (GTK_SIZE_REQUEST (child),
- &min_child_size,
- &nat_child_size);
+ gtk_size_request_get_preferred_height (GTK_SIZE_REQUEST (child),
+ &min_child_size,
+ &nat_child_size);
if (priv->vscrollbar_policy == GTK_POLICY_NEVER)
{
@@ -1954,39 +1954,39 @@ gtk_scrolled_window_get_size (GtkSizeRequest *widget,
}
static void
-gtk_scrolled_window_get_width (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size)
+gtk_scrolled_window_get_preferred_width (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
{
- gtk_scrolled_window_get_size (widget, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size);
+ gtk_scrolled_window_get_preferred_size (widget, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size);
}
static void
-gtk_scrolled_window_get_height (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size)
+gtk_scrolled_window_get_preferred_height (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
{
- gtk_scrolled_window_get_size (widget, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size);
+ gtk_scrolled_window_get_preferred_size (widget, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size);
}
static void
-gtk_scrolled_window_get_height_for_width (GtkSizeRequest *widget,
- gint width,
- gint *minimum_height,
- gint *natural_height)
+gtk_scrolled_window_get_preferred_height_for_width (GtkSizeRequest *widget,
+ gint width,
+ gint *minimum_height,
+ gint *natural_height)
{
g_return_if_fail (GTK_IS_WIDGET (widget));
- GTK_SIZE_REQUEST_GET_IFACE (widget)->get_height (widget, minimum_height, natural_height);
+ GTK_SIZE_REQUEST_GET_IFACE (widget)->get_preferred_height (widget, minimum_height, natural_height);
}
static void
-gtk_scrolled_window_get_width_for_height (GtkSizeRequest *widget,
- gint height,
- gint *minimum_width,
- gint *natural_width)
+gtk_scrolled_window_get_preferred_width_for_height (GtkSizeRequest *widget,
+ gint height,
+ gint *minimum_width,
+ gint *natural_width)
{
g_return_if_fail (GTK_IS_WIDGET (widget));
- GTK_SIZE_REQUEST_GET_IFACE (widget)->get_width (widget, minimum_width, natural_width);
+ GTK_SIZE_REQUEST_GET_IFACE (widget)->get_preferred_width (widget, minimum_width, natural_width);
}
diff --git a/gtk/gtksizegroup.c b/gtk/gtksizegroup.c
index cc16476..a91fcaa 100644
--- a/gtk/gtksizegroup.c
+++ b/gtk/gtksizegroup.c
@@ -671,7 +671,7 @@ get_base_dimension (GtkWidget *widget,
/* XXX Possibly we should be using natural values and not minimums here. */
gint width;
- gtk_size_request_get_width (GTK_SIZE_REQUEST (widget), &width, NULL);
+ gtk_size_request_get_preferred_width (GTK_SIZE_REQUEST (widget), &width, NULL);
return width;
}
@@ -680,7 +680,7 @@ get_base_dimension (GtkWidget *widget,
/* XXX Possibly we should be using natural values and not minimums here. */
gint height;
- gtk_size_request_get_height (GTK_SIZE_REQUEST (widget), &height, NULL);
+ gtk_size_request_get_preferred_height (GTK_SIZE_REQUEST (widget), &height, NULL);
return height;
}
diff --git a/gtk/gtksizerequest.c b/gtk/gtksizerequest.c
index 543bbc1..87d32ba 100644
--- a/gtk/gtksizerequest.c
+++ b/gtk/gtksizerequest.c
@@ -54,12 +54,12 @@
* For instance when queried in the normal height-for-width mode:
* First the default minimum and natural width for each widget
* in the interface will computed and collectively returned to
- * the toplevel by way of gtk_size_request_get_width().
+ * the toplevel by way of gtk_size_request_get_preferred_width().
* Next, the toplevel will use the minimum width to query for the
* minimum height contextual to that width using
- * gtk_size_request_get_height_for_width(), which will also be a
- * highly recursive operation. This minimum-for-minimum size can be
- * used to set the minimum size constraint on the toplevel.
+ * gtk_size_request_get_preferred_height_for_width(), which will also
+ * be a highly recursive operation. This minimum-for-minimum size can
+ * be used to set the minimum size constraint on the toplevel.
*
* When allocating, each container can use the minimum and natural
* sizes reported by their children to allocate natural sizes and
@@ -265,20 +265,20 @@ compute_size_for_orientation (GtkSizeRequest *request,
requisition_size = requisition.width;
if (for_size < 0)
- GTK_SIZE_REQUEST_GET_IFACE (request)->get_width (request, &min_size, &nat_size);
+ GTK_SIZE_REQUEST_GET_IFACE (request)->get_preferred_width (request, &min_size, &nat_size);
else
- GTK_SIZE_REQUEST_GET_IFACE (request)->get_width_for_height (request, for_size,
- &min_size, &nat_size);
+ GTK_SIZE_REQUEST_GET_IFACE (request)->get_preferred_width_for_height (request, for_size,
+ &min_size, &nat_size);
}
else
{
requisition_size = requisition.height;
if (for_size < 0)
- GTK_SIZE_REQUEST_GET_IFACE (request)->get_height (request, &min_size, &nat_size);
+ GTK_SIZE_REQUEST_GET_IFACE (request)->get_preferred_height (request, &min_size, &nat_size);
else
- GTK_SIZE_REQUEST_GET_IFACE (request)->get_height_for_width (request, for_size,
- &min_size, &nat_size);
+ GTK_SIZE_REQUEST_GET_IFACE (request)->get_preferred_height_for_width (request, for_size,
+ &min_size, &nat_size);
}
pop_recursion_check (request, orientation);
@@ -413,7 +413,7 @@ gtk_size_request_get_request_mode (GtkSizeRequest *widget)
}
/**
- * gtk_size_request_get_width:
+ * gtk_size_request_get_preferred_width:
* @widget: a #GtkSizeRequest instance
* @minimum_width: (out) (allow-none): location to store the minimum width, or %NULL
* @natural_width: (out) (allow-none): location to store the natural width, or %NULL
@@ -426,9 +426,9 @@ gtk_size_request_get_request_mode (GtkSizeRequest *widget)
* Since: 3.0
*/
void
-gtk_size_request_get_width (GtkSizeRequest *widget,
- gint *minimum_width,
- gint *natural_width)
+gtk_size_request_get_preferred_width (GtkSizeRequest *widget,
+ gint *minimum_width,
+ gint *natural_width)
{
compute_size_for_orientation (widget, GTK_SIZE_GROUP_HORIZONTAL,
-1, minimum_width, natural_width);
@@ -436,7 +436,7 @@ gtk_size_request_get_width (GtkSizeRequest *widget,
/**
- * gtk_size_request_get_height:
+ * gtk_size_request_get_preferred_height:
* @widget: a #GtkSizeRequest instance
* @minimum_height: (out) (allow-none): location to store the minimum height, or %NULL
* @natural_height: (out) (allow-none): location to store the natural height, or %NULL
@@ -448,9 +448,9 @@ gtk_size_request_get_width (GtkSizeRequest *widget,
* Since: 3.0
*/
void
-gtk_size_request_get_height (GtkSizeRequest *widget,
- gint *minimum_height,
- gint *natural_height)
+gtk_size_request_get_preferred_height (GtkSizeRequest *widget,
+ gint *minimum_height,
+ gint *natural_height)
{
compute_size_for_orientation (widget, GTK_SIZE_GROUP_VERTICAL,
-1, minimum_height, natural_height);
@@ -459,7 +459,7 @@ gtk_size_request_get_height (GtkSizeRequest *widget,
/**
- * gtk_size_request_get_width_for_height:
+ * gtk_size_request_get_preferred_width_for_height:
* @widget: a #GtkSizeRequest instance
* @height: the height which is available for allocation
* @minimum_width: (out) (allow-none): location for storing the minimum width, or %NULL
@@ -471,17 +471,17 @@ gtk_size_request_get_height (GtkSizeRequest *widget,
* Since: 3.0
*/
void
-gtk_size_request_get_width_for_height (GtkSizeRequest *widget,
- gint height,
- gint *minimum_width,
- gint *natural_width)
+gtk_size_request_get_preferred_width_for_height (GtkSizeRequest *widget,
+ gint height,
+ gint *minimum_width,
+ gint *natural_width)
{
compute_size_for_orientation (widget, GTK_SIZE_GROUP_HORIZONTAL,
height, minimum_width, natural_width);
}
/**
- * gtk_size_request_get_height_for_width:
+ * gtk_size_request_get_preferred_height_for_width:
* @widget: a #GtkSizeRequest instance
* @width: the width which is available for allocation
* @minimum_height: (out) (allow-none): location for storing the minimum height, or %NULL
@@ -493,17 +493,17 @@ gtk_size_request_get_width_for_height (GtkSizeRequest *widget,
* Since: 3.0
*/
void
-gtk_size_request_get_height_for_width (GtkSizeRequest *widget,
- gint width,
- gint *minimum_height,
- gint *natural_height)
+gtk_size_request_get_preferred_height_for_width (GtkSizeRequest *widget,
+ gint width,
+ gint *minimum_height,
+ gint *natural_height)
{
compute_size_for_orientation (widget, GTK_SIZE_GROUP_VERTICAL,
width, minimum_height, natural_height);
}
/**
- * gtk_size_request_get_size:
+ * gtk_size_request_get_preferred_size:
* @widget: a #GtkSizeRequest instance
* @minimum_size: (out) (allow-none): location for storing the minimum size, or %NULL
* @natural_size: (out) (allow-none): location for storing the natural size, or %NULL
@@ -517,9 +517,9 @@ gtk_size_request_get_height_for_width (GtkSizeRequest *widget,
* Since: 3.0
*/
void
-gtk_size_request_get_size (GtkSizeRequest *widget,
- GtkRequisition *minimum_size,
- GtkRequisition *natural_size)
+gtk_size_request_get_preferred_size (GtkSizeRequest *widget,
+ GtkRequisition *minimum_size,
+ GtkRequisition *natural_size)
{
gint min_width, nat_width;
gint min_height, nat_height;
@@ -528,38 +528,38 @@ gtk_size_request_get_size (GtkSizeRequest *widget,
if (gtk_size_request_get_request_mode (widget) == GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH)
{
- gtk_size_request_get_width (widget, &min_width, &nat_width);
+ gtk_size_request_get_preferred_width (widget, &min_width, &nat_width);
if (minimum_size)
{
minimum_size->width = min_width;
- gtk_size_request_get_height_for_width (widget, min_width,
- &minimum_size->height, NULL);
+ gtk_size_request_get_preferred_height_for_width (widget, min_width,
+ &minimum_size->height, NULL);
}
if (natural_size)
{
natural_size->width = nat_width;
- gtk_size_request_get_height_for_width (widget, nat_width,
- NULL, &natural_size->height);
+ gtk_size_request_get_preferred_height_for_width (widget, nat_width,
+ NULL, &natural_size->height);
}
}
else /* GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT */
{
- gtk_size_request_get_height (widget, &min_height, &nat_height);
+ gtk_size_request_get_preferred_height (widget, &min_height, &nat_height);
if (minimum_size)
{
minimum_size->height = min_height;
- gtk_size_request_get_width_for_height (widget, min_height,
- &minimum_size->width, NULL);
+ gtk_size_request_get_preferred_width_for_height (widget, min_height,
+ &minimum_size->width, NULL);
}
if (natural_size)
{
natural_size->height = nat_height;
- gtk_size_request_get_width_for_height (widget, nat_height,
- NULL, &natural_size->width);
+ gtk_size_request_get_preferred_width_for_height (widget, nat_height,
+ NULL, &natural_size->width);
}
}
}
diff --git a/gtk/gtksizerequest.h b/gtk/gtksizerequest.h
index 2724589..096533f 100644
--- a/gtk/gtksizerequest.h
+++ b/gtk/gtksizerequest.h
@@ -61,50 +61,50 @@ struct _GtkSizeRequestIface
GTypeInterface g_iface;
/* virtual table */
- GtkSizeRequestMode (* get_request_mode) (GtkSizeRequest *widget);
-
- void (* get_height) (GtkSizeRequest *widget,
- gint *minimum_height,
- gint *natural_height);
- void (* get_width_for_height) (GtkSizeRequest *widget,
- gint height,
- gint *minimum_width,
- gint *natural_width);
- void (* get_width) (GtkSizeRequest *widget,
- gint *minimum_width,
- gint *natural_width);
- void (* get_height_for_width) (GtkSizeRequest *widget,
- gint width,
- gint *minimum_height,
- gint *natural_height);
+ GtkSizeRequestMode (* get_request_mode) (GtkSizeRequest *widget);
+
+ void (* get_preferred_height) (GtkSizeRequest *widget,
+ gint *minimum_height,
+ gint *natural_height);
+ void (* get_preferred_width_for_height) (GtkSizeRequest *widget,
+ gint height,
+ gint *minimum_width,
+ gint *natural_width);
+ void (* get_preferred_width) (GtkSizeRequest *widget,
+ gint *minimum_width,
+ gint *natural_width);
+ void (* get_preferred_height_for_width) (GtkSizeRequest *widget,
+ gint width,
+ gint *minimum_height,
+ gint *natural_height);
};
-GType gtk_size_request_get_type (void) G_GNUC_CONST;
-
-GtkSizeRequestMode gtk_size_request_get_request_mode (GtkSizeRequest *widget);
-void gtk_size_request_get_width (GtkSizeRequest *widget,
- gint *minimum_width,
- gint *natural_width);
-void gtk_size_request_get_height_for_width (GtkSizeRequest *widget,
- gint width,
- gint *minimum_height,
- gint *natural_height);
-void gtk_size_request_get_height (GtkSizeRequest *widget,
- gint *minimum_height,
- gint *natural_height);
-void gtk_size_request_get_width_for_height (GtkSizeRequest *widget,
- gint height,
- gint *minimum_width,
- gint *natural_width);
-void gtk_size_request_get_size (GtkSizeRequest *widget,
- GtkRequisition *minimum_size,
- GtkRequisition *natural_size);
+GType gtk_size_request_get_type (void) G_GNUC_CONST;
+
+GtkSizeRequestMode gtk_size_request_get_request_mode (GtkSizeRequest *widget);
+void gtk_size_request_get_preferred_width (GtkSizeRequest *widget,
+ gint *minimum_width,
+ gint *natural_width);
+void gtk_size_request_get_preferred_height_for_width (GtkSizeRequest *widget,
+ gint width,
+ gint *minimum_height,
+ gint *natural_height);
+void gtk_size_request_get_preferred_height (GtkSizeRequest *widget,
+ gint *minimum_height,
+ gint *natural_height);
+void gtk_size_request_get_preferred_width_for_height (GtkSizeRequest *widget,
+ gint height,
+ gint *minimum_width,
+ gint *natural_width);
+void gtk_size_request_get_preferred_size (GtkSizeRequest *widget,
+ GtkRequisition *minimum_size,
+ GtkRequisition *natural_size);
/* General convenience function to aid in allocating natural sizes */
-gint gtk_distribute_natural_allocation (gint extra_space,
- guint n_requested_sizes,
- GtkRequestedSize *sizes);
+gint gtk_distribute_natural_allocation (gint extra_space,
+ guint n_requested_sizes,
+ GtkRequestedSize *sizes);
G_END_DECLS
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index 6eb98f7..2d36e75 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -594,7 +594,8 @@ gtk_spin_button_realize (GtkWidget *widget)
arrow_size = spin_button_get_arrow_size (spin_button);
- gtk_size_request_get_size (GTK_SIZE_REQUEST (spin_button), &requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (spin_button),
+ &requisition, NULL);
gtk_widget_get_allocation (widget, &allocation);
gtk_widget_set_events (widget, gtk_widget_get_events (widget) |
@@ -754,7 +755,7 @@ gtk_spin_button_size_allocate (GtkWidget *widget,
arrow_size = spin_button_get_arrow_size (spin);
panel_width = arrow_size + 2 * gtk_widget_get_style (widget)->xthickness;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (widget), &requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (widget), &requisition, NULL);
gtk_widget_set_allocation (widget, allocation);
@@ -872,7 +873,7 @@ gtk_spin_button_draw_arrow (GtkSpinButton *spin_button,
widget = GTK_WIDGET (spin_button);
style = gtk_widget_get_style (widget);
- gtk_size_request_get_size (GTK_SIZE_REQUEST (widget), &requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (widget), &requisition, NULL);
width = spin_button_get_arrow_size (spin_button) + 2 * style->xthickness;
@@ -979,7 +980,7 @@ gtk_spin_button_enter_notify (GtkWidget *widget,
device = gdk_event_get_device ((GdkEvent *) event);
gdk_window_get_device_position (priv->panel, device, &x, &y, NULL);
- gtk_size_request_get_size (GTK_SIZE_REQUEST (widget), &requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (widget), &requisition, NULL);
if (y <= requisition.height / 2)
priv->in_child = GTK_ARROW_UP;
@@ -1160,7 +1161,7 @@ gtk_spin_button_button_press (GtkWidget *widget,
if (GTK_ENTRY (widget)->editable)
gtk_spin_button_update (spin);
- gtk_size_request_get_size (GTK_SIZE_REQUEST (widget), &requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (widget), &requisition, NULL);
if (event->y <= requisition.height / 2)
{
@@ -1208,7 +1209,7 @@ gtk_spin_button_button_release (GtkWidget *widget,
{
GtkRequisition requisition;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (widget), &requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (widget), &requisition, NULL);
if (event->y >= 0 && event->x >= 0 &&
event->y <= requisition.height &&
@@ -1259,7 +1260,7 @@ gtk_spin_button_motion_notify (GtkWidget *widget,
gdk_event_request_motions (event);
- gtk_size_request_get_size (GTK_SIZE_REQUEST (widget), &requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (widget), &requisition, NULL);
if (y <= requisition.height / 2 &&
priv->in_child == GTK_ARROW_DOWN)
diff --git a/gtk/gtkspinner.c b/gtk/gtkspinner.c
index ea6b90e..ebea4e1 100644
--- a/gtk/gtkspinner.c
+++ b/gtk/gtkspinner.c
@@ -215,9 +215,9 @@ gtk_spinner_init (GtkSpinner *spinner)
}
static void
-gtk_spinner_get_width (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size)
+gtk_spinner_get_preferred_width (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
{
if (minimum_size)
*minimum_size = SPINNER_SIZE;
@@ -227,9 +227,9 @@ gtk_spinner_get_width (GtkSizeRequest *widget,
}
static void
-gtk_spinner_get_height (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size)
+gtk_spinner_get_preferred_height (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
{
if (minimum_size)
*minimum_size = SPINNER_SIZE;
@@ -241,8 +241,8 @@ gtk_spinner_get_height (GtkSizeRequest *widget,
static void
gtk_spinner_size_request_init (GtkSizeRequestIface *iface)
{
- iface->get_width = gtk_spinner_get_width;
- iface->get_height = gtk_spinner_get_height;
+ iface->get_preferred_width = gtk_spinner_get_preferred_width;
+ iface->get_preferred_height = gtk_spinner_get_preferred_height;
}
diff --git a/gtk/gtktable.c b/gtk/gtktable.c
index 39b0a97..4bea349 100644
--- a/gtk/gtktable.c
+++ b/gtk/gtktable.c
@@ -1068,8 +1068,8 @@ gtk_table_size_request_pass1 (GtkTable *table)
{
GtkRequisition child_requisition;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
- &child_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (child->widget),
+ &child_requisition, NULL);
/* Child spans a single column.
*/
@@ -1139,8 +1139,8 @@ gtk_table_size_request_pass3 (GtkTable *table)
{
GtkRequisition child_requisition;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
- &child_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (child->widget),
+ &child_requisition, NULL);
/* Check and see if there is already enough space
* for the child.
@@ -1191,8 +1191,8 @@ gtk_table_size_request_pass3 (GtkTable *table)
{
GtkRequisition child_requisition;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
- &child_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (child->widget),
+ &child_requisition, NULL);
/* Check and see if there is already enough space
* for the child.
@@ -1669,8 +1669,8 @@ gtk_table_size_allocate_pass2 (GtkTable *table)
GtkRequisition child_requisition;
guint border_width;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
- &child_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (child->widget),
+ &child_requisition, NULL);
gtk_widget_get_allocation (GTK_WIDGET (table), &table_allocation);
border_width = gtk_container_get_border_width (GTK_CONTAINER (table));
diff --git a/gtk/gtktextlayout.c b/gtk/gtktextlayout.c
index 929810e..4ff16d6 100644
--- a/gtk/gtktextlayout.c
+++ b/gtk/gtktextlayout.c
@@ -1614,8 +1614,8 @@ add_child_attrs (GtkTextLayout *layout,
/* Found it */
GtkRequisition req;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
- &req, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (child),
+ &req, NULL);
width = req.width;
height = req.height;
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 205e870..96bf404 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -3310,13 +3310,13 @@ gtk_text_view_size_request (GtkWidget *widget,
GtkRequisition child_req;
GtkRequisition old_req;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
- &old_req, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (child->widget),
+ &old_req, NULL);
gtk_widget_size_request (child->widget, &child_req);
- gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
- &child_req, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (child->widget),
+ &child_req, NULL);
/* Invalidate layout lines if required */
if (priv->layout &&
@@ -3361,8 +3361,8 @@ gtk_text_view_compute_child_allocation (GtkTextView *text_view,
allocation->x = vc->from_left_of_buffer - text_view->priv->xoffset;
allocation->y = buffer_y - text_view->priv->yoffset;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (vc->widget),
- &req, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (vc->widget),
+ &req, NULL);
allocation->width = req.width;
allocation->height = req.height;
}
@@ -3463,8 +3463,8 @@ gtk_text_view_allocate_children (GtkTextView *text_view)
allocation.x = child->x;
allocation.y = child->y;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
- &child_req, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (child->widget),
+ &child_req, NULL);
allocation.width = child_req.width;
allocation.height = child_req.height;
diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c
index 75eaa02..3d9be3c 100644
--- a/gtk/gtktoolbar.c
+++ b/gtk/gtktoolbar.c
@@ -1452,8 +1452,8 @@ gtk_toolbar_size_allocate (GtkWidget *widget,
border_width += get_internal_padding (toolbar);
- gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->arrow_button),
- &arrow_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (priv->arrow_button),
+ &arrow_requisition, NULL);
shadow_type = get_shadow_type (toolbar);
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index a4f754c..351430c 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -5347,7 +5347,8 @@ gtk_tree_view_key_press (GtkWidget *widget,
GtkRequisition button_req;
gint old_width = column->resized_width;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (column->button), &button_req, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (column->button),
+ &button_req, NULL);
column->resized_width = MAX (column->resized_width,
column->width);
@@ -10529,7 +10530,8 @@ gtk_tree_view_new_column_width (GtkTreeView *tree_view,
/* Clamp down the value */
if (column->min_width == -1)
{
- gtk_size_request_get_size (GTK_SIZE_REQUEST (column->button), &button_req, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (column->button),
+ &button_req, NULL);
width = MAX (button_req.width, width);
}
else
diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c
index a00cd7d..332dee8 100644
--- a/gtk/gtkviewport.c
+++ b/gtk/gtkviewport.c
@@ -96,10 +96,10 @@ static void gtk_viewport_style_set (GtkWidget *widget,
GtkStyle *previous_style);
static void gtk_viewport_size_request_init (GtkSizeRequestIface *iface);
-static void gtk_viewport_get_width (GtkSizeRequest *widget,
+static void gtk_viewport_get_preferred_width (GtkSizeRequest *widget,
gint *minimum_size,
gint *natural_size);
-static void gtk_viewport_get_height (GtkSizeRequest *widget,
+static void gtk_viewport_get_preferred_height (GtkSizeRequest *widget,
gint *minimum_size,
gint *natural_size);
@@ -442,8 +442,8 @@ viewport_set_hadjustment_values (GtkViewport *viewport,
{
GtkRequisition child_requisition;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
- &child_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (child),
+ &child_requisition, NULL);
hadjustment->upper = MAX (child_requisition.width, view_allocation.width);
}
else
@@ -482,10 +482,10 @@ viewport_set_vadjustment_values (GtkViewport *viewport,
{
gint natural_height;
- gtk_size_request_get_height_for_width (GTK_SIZE_REQUEST (child),
- view_allocation.width,
- NULL,
- &natural_height);
+ gtk_size_request_get_preferred_height_for_width (GTK_SIZE_REQUEST (child),
+ view_allocation.width,
+ NULL,
+ &natural_height);
vadjustment->upper = MAX (natural_height, view_allocation.height);
}
else
@@ -937,15 +937,15 @@ gtk_viewport_style_set (GtkWidget *widget,
static void
gtk_viewport_size_request_init (GtkSizeRequestIface *iface)
{
- iface->get_width = gtk_viewport_get_width;
- iface->get_height = gtk_viewport_get_height;
+ iface->get_preferred_width = gtk_viewport_get_preferred_width;
+ iface->get_preferred_height = gtk_viewport_get_preferred_height;
}
static void
-gtk_viewport_get_size (GtkSizeRequest *widget,
- GtkOrientation orientation,
- gint *minimum_size,
- gint *natural_size)
+gtk_viewport_get_preferred_size (GtkSizeRequest *widget,
+ GtkOrientation orientation,
+ gint *minimum_size,
+ gint *natural_size)
{
GtkViewport *viewport = GTK_VIEWPORT (widget);
GtkViewportPrivate *priv = viewport->priv;
@@ -975,9 +975,9 @@ gtk_viewport_get_size (GtkSizeRequest *widget,
if (child && gtk_widget_get_visible (child))
{
if (orientation == GTK_ORIENTATION_HORIZONTAL)
- gtk_size_request_get_width (GTK_SIZE_REQUEST (child), &child_min, &child_nat);
+ gtk_size_request_get_preferred_width (GTK_SIZE_REQUEST (child), &child_min, &child_nat);
else
- gtk_size_request_get_height (GTK_SIZE_REQUEST (child), &child_min, &child_nat);
+ gtk_size_request_get_preferred_height (GTK_SIZE_REQUEST (child), &child_min, &child_nat);
minimum += child_min;
natural += child_nat;
@@ -991,17 +991,17 @@ gtk_viewport_get_size (GtkSizeRequest *widget,
}
static void
-gtk_viewport_get_width (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size)
+gtk_viewport_get_preferred_width (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
{
- gtk_viewport_get_size (widget, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size);
+ gtk_viewport_get_preferred_size (widget, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size);
}
static void
-gtk_viewport_get_height (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size)
+gtk_viewport_get_preferred_height (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
{
- gtk_viewport_get_size (widget, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size);
+ gtk_viewport_get_preferred_size (widget, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size);
}
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index cac7094..68e5231 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -4090,7 +4090,7 @@ gtk_widget_queue_resize_no_redraw (GtkWidget *widget)
* Also remember that the size request is not necessarily the size
* a widget will actually be allocated.
*
- * Deprecated: 3.0: Use gtk_size_request_get_size() instead.
+ * Deprecated: 3.0: Use gtk_size_request_get_preferred_size() instead.
**/
void
gtk_widget_size_request (GtkWidget *widget,
@@ -4098,7 +4098,8 @@ gtk_widget_size_request (GtkWidget *widget,
{
g_return_if_fail (GTK_IS_WIDGET (widget));
- gtk_size_request_get_size (GTK_SIZE_REQUEST (widget), requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (widget),
+ requisition, NULL);
}
/**
@@ -4126,13 +4127,14 @@ gtk_widget_size_request (GtkWidget *widget,
* gtk_widget_size_request().
*
*
- * Deprecated: 3.0: Use gtk_size_request_get_size() instead.
+ * Deprecated: 3.0: Use gtk_size_request_get_preferred_size() instead.
**/
void
gtk_widget_get_child_requisition (GtkWidget *widget,
GtkRequisition *requisition)
{
- gtk_size_request_get_size (GTK_SIZE_REQUEST (widget), requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (widget),
+ requisition, NULL);
}
static gboolean
@@ -4625,7 +4627,7 @@ gtk_widget_real_adjust_size_allocation (GtkWidget *widget,
aux_info = _gtk_widget_get_aux_info_or_defaults (widget);
- gtk_size_request_get_size (GTK_SIZE_REQUEST (widget), &min, &natural);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (widget), &min, &natural);
get_span_inside_border_horizontal (widget,
aux_info,
@@ -11242,7 +11244,7 @@ gtk_widget_real_get_height_for_width (GtkSizeRequest *layout,
gint *minimum_height,
gint *natural_height)
{
- GTK_SIZE_REQUEST_GET_IFACE (layout)->get_height(layout, minimum_height, natural_height);
+ GTK_SIZE_REQUEST_GET_IFACE (layout)->get_preferred_height(layout, minimum_height, natural_height);
}
static void
@@ -11251,16 +11253,16 @@ gtk_widget_real_get_width_for_height (GtkSizeRequest *layout,
gint *minimum_width,
gint *natural_width)
{
- GTK_SIZE_REQUEST_GET_IFACE (layout)->get_width(layout, minimum_width, natural_width);
+ GTK_SIZE_REQUEST_GET_IFACE (layout)->get_preferred_width(layout, minimum_width, natural_width);
}
static void
gtk_widget_size_request_init (GtkSizeRequestIface *iface)
{
- iface->get_width = gtk_widget_real_get_width;
- iface->get_height = gtk_widget_real_get_height;
- iface->get_width_for_height = gtk_widget_real_get_width_for_height;
- iface->get_height_for_width = gtk_widget_real_get_height_for_width;
+ iface->get_preferred_width = gtk_widget_real_get_width;
+ iface->get_preferred_height = gtk_widget_real_get_height;
+ iface->get_preferred_width_for_height = gtk_widget_real_get_width_for_height;
+ iface->get_preferred_height_for_width = gtk_widget_real_get_height_for_width;
}
GtkAlign
@@ -11989,7 +11991,7 @@ gtk_widget_get_requisition (GtkWidget *widget,
g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (requisition != NULL);
- gtk_size_request_get_size (GTK_SIZE_REQUEST (widget), requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (widget), requisition, NULL);
}
/**
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index f0a6675..7ab1326 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -433,10 +433,10 @@ static void gtk_window_buildable_custom_finished (GtkBuildable *buildable,
static void gtk_window_size_request_init (GtkSizeRequestIface *iface);
-static void gtk_window_get_width (GtkSizeRequest *widget,
+static void gtk_window_get_preferred_width (GtkSizeRequest *widget,
gint *minimum_size,
gint *natural_size);
-static void gtk_window_get_height (GtkSizeRequest *widget,
+static void gtk_window_get_preferred_height (GtkSizeRequest *widget,
gint *minimum_size,
gint *natural_size);
@@ -5505,15 +5505,15 @@ gtk_window_real_set_focus (GtkWindow *window,
static void
gtk_window_size_request_init (GtkSizeRequestIface *iface)
{
- iface->get_width = gtk_window_get_width;
- iface->get_height = gtk_window_get_height;
+ iface->get_preferred_width = gtk_window_get_preferred_width;
+ iface->get_preferred_height = gtk_window_get_preferred_height;
}
static void
-gtk_window_get_width (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size)
+gtk_window_get_preferred_width (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
{
GtkWindow *window;
GtkWidget *child;
@@ -5529,7 +5529,8 @@ gtk_window_get_width (GtkSizeRequest *widget,
if (child && gtk_widget_get_visible (child))
{
gint child_min, child_nat;
- gtk_size_request_get_width (GTK_SIZE_REQUEST (child), &child_min, &child_nat);
+ gtk_size_request_get_preferred_width (GTK_SIZE_REQUEST (child),
+ &child_min, &child_nat);
*minimum_size += child_min;
*natural_size += child_nat;
@@ -5537,9 +5538,9 @@ gtk_window_get_width (GtkSizeRequest *widget,
}
static void
-gtk_window_get_height (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size)
+gtk_window_get_preferred_height (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
{
GtkWindow *window;
GtkWidget *child;
@@ -5555,7 +5556,8 @@ gtk_window_get_height (GtkSizeRequest *widget,
if (child && gtk_widget_get_visible (child))
{
gint child_min, child_nat;
- gtk_size_request_get_height (GTK_SIZE_REQUEST (child), &child_min, &child_nat);
+ gtk_size_request_get_preferred_height (GTK_SIZE_REQUEST (child),
+ &child_min, &child_nat);
*minimum_size += child_min;
*natural_size += child_nat;
@@ -5632,8 +5634,8 @@ gtk_window_compute_configure_request_size (GtkWindow *window,
if (priv->need_default_size)
{
- gtk_size_request_get_size (GTK_SIZE_REQUEST (widget),
- &requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (widget),
+ &requisition, NULL);
/* Default to requisition */
*width = requisition.width;
@@ -6555,7 +6557,8 @@ gtk_window_compute_hints (GtkWindow *window,
widget = GTK_WIDGET (window);
- gtk_size_request_get_size (GTK_SIZE_REQUEST (widget), &requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (widget),
+ &requisition, NULL);
geometry_info = gtk_window_get_geometry_info (GTK_WINDOW (widget), FALSE);
if (geometry_info)
@@ -6585,11 +6588,11 @@ gtk_window_compute_hints (GtkWindow *window,
*
* Finding these answers would be a bit of a mess here. (Bug #68668)
*/
- gtk_size_request_get_size (GTK_SIZE_REQUEST (geometry_info->widget),
- &child_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (geometry_info->widget),
+ &child_requisition, NULL);
- gtk_size_request_get_size (GTK_SIZE_REQUEST (widget),
- &requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (widget),
+ &requisition, NULL);
extra_width = requisition.width - child_requisition.width;
extra_height = requisition.height - child_requisition.height;
}
diff --git a/gtk/gtkwrapbox.c b/gtk/gtkwrapbox.c
index 65afc64..e360115 100644
--- a/gtk/gtkwrapbox.c
+++ b/gtk/gtkwrapbox.c
@@ -117,22 +117,22 @@ static GType gtk_wrap_box_child_type (GtkContainer *container);
/* GtkSizeRequest */
-static void gtk_wrap_box_size_request_init (GtkSizeRequestIface *iface);
+static void gtk_wrap_box_size_request_init (GtkSizeRequestIface *iface);
static GtkSizeRequestMode gtk_wrap_box_get_request_mode (GtkSizeRequest *widget);
-static void gtk_wrap_box_get_width (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size);
-static void gtk_wrap_box_get_height (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size);
-static void gtk_wrap_box_get_height_for_width (GtkSizeRequest *box,
- gint width,
- gint *minimum_height,
- gint *natural_height);
-static void gtk_wrap_box_get_width_for_height (GtkSizeRequest *box,
- gint width,
- gint *minimum_height,
- gint *natural_height);
+static void gtk_wrap_box_get_preferred_width (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size);
+static void gtk_wrap_box_get_preferred_height (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size);
+static void gtk_wrap_box_get_preferred_height_for_width (GtkSizeRequest *box,
+ gint width,
+ gint *minimum_height,
+ gint *natural_height);
+static void gtk_wrap_box_get_preferred_width_for_height (GtkSizeRequest *box,
+ gint width,
+ gint *minimum_height,
+ gint *natural_height);
G_DEFINE_TYPE_WITH_CODE (GtkWrapBox, gtk_wrap_box, GTK_TYPE_CONTAINER,
@@ -456,11 +456,11 @@ get_average_item_size (GtkWrapBox *box,
continue;
if (orientation == GTK_ORIENTATION_HORIZONTAL)
- gtk_size_request_get_width (GTK_SIZE_REQUEST (child->widget),
- &child_min, &child_nat);
+ gtk_size_request_get_preferred_width (GTK_SIZE_REQUEST (child->widget),
+ &child_min, &child_nat);
else
- gtk_size_request_get_height (GTK_SIZE_REQUEST (child->widget),
- &child_min, &child_nat);
+ gtk_size_request_get_preferred_height (GTK_SIZE_REQUEST (child->widget),
+ &child_min, &child_nat);
max_min_size = MAX (max_min_size, child_min);
max_nat_size = MAX (max_nat_size, child_nat);
@@ -497,13 +497,13 @@ get_largest_size_for_opposing_orientation (GtkWrapBox *box,
continue;
if (orientation == GTK_ORIENTATION_HORIZONTAL)
- gtk_size_request_get_height_for_width (GTK_SIZE_REQUEST (child->widget),
- item_size,
- &child_min, &child_nat);
+ gtk_size_request_get_preferred_height_for_width (GTK_SIZE_REQUEST (child->widget),
+ item_size,
+ &child_min, &child_nat);
else
- gtk_size_request_get_width_for_height (GTK_SIZE_REQUEST (child->widget),
- item_size,
- &child_min, &child_nat);
+ gtk_size_request_get_preferred_width_for_height (GTK_SIZE_REQUEST (child->widget),
+ item_size,
+ &child_min, &child_nat);
max_min_size = MAX (max_min_size, child_min);
max_nat_size = MAX (max_nat_size, child_nat);
@@ -555,13 +555,13 @@ get_largest_size_for_line_in_opposing_orientation (GtkWrapBox *box,
}
if (orientation == GTK_ORIENTATION_HORIZONTAL)
- gtk_size_request_get_height_for_width (GTK_SIZE_REQUEST (child->widget),
- this_item_size,
- &child_min, &child_nat);
+ gtk_size_request_get_preferred_height_for_width (GTK_SIZE_REQUEST (child->widget),
+ this_item_size,
+ &child_min, &child_nat);
else
- gtk_size_request_get_width_for_height (GTK_SIZE_REQUEST (child->widget),
- this_item_size,
- &child_min, &child_nat);
+ gtk_size_request_get_preferred_width_for_height (GTK_SIZE_REQUEST (child->widget),
+ this_item_size,
+ &child_min, &child_nat);
max_min_size = MAX (max_min_size, child_min);
max_nat_size = MAX (max_nat_size, child_nat);
@@ -621,11 +621,11 @@ get_largest_size_for_free_line_in_opposing_orientation (GtkWrapBox *box,
continue;
if (orientation == GTK_ORIENTATION_HORIZONTAL)
- gtk_size_request_get_width (GTK_SIZE_REQUEST (child->widget),
- NULL, &child_size);
+ gtk_size_request_get_preferred_width (GTK_SIZE_REQUEST (child->widget),
+ NULL, &child_size);
else
- gtk_size_request_get_height (GTK_SIZE_REQUEST (child->widget),
- NULL, &child_size);
+ gtk_size_request_get_preferred_height (GTK_SIZE_REQUEST (child->widget),
+ NULL, &child_size);
if (i > 0)
child_size += spacing;
@@ -654,13 +654,13 @@ get_largest_size_for_free_line_in_opposing_orientation (GtkWrapBox *box,
requested.data = child;
if (orientation == GTK_ORIENTATION_HORIZONTAL)
- gtk_size_request_get_width (GTK_SIZE_REQUEST (child->widget),
- &requested.minimum_size,
- &requested.natural_size);
+ gtk_size_request_get_preferred_width (GTK_SIZE_REQUEST (child->widget),
+ &requested.minimum_size,
+ &requested.natural_size);
else
- gtk_size_request_get_height (GTK_SIZE_REQUEST (child->widget),
- &requested.minimum_size,
- &requested.natural_size);
+ gtk_size_request_get_preferred_height (GTK_SIZE_REQUEST (child->widget),
+ &requested.minimum_size,
+ &requested.natural_size);
if (i > 0)
size -= spacing;
@@ -723,13 +723,13 @@ get_largest_size_for_free_line_in_opposing_orientation (GtkWrapBox *box,
}
if (orientation == GTK_ORIENTATION_HORIZONTAL)
- gtk_size_request_get_height_for_width (GTK_SIZE_REQUEST (child->widget),
- sizes[i].minimum_size,
- &child_min, &child_nat);
+ gtk_size_request_get_preferred_height_for_width (GTK_SIZE_REQUEST (child->widget),
+ sizes[i].minimum_size,
+ &child_min, &child_nat);
else
- gtk_size_request_get_width_for_height (GTK_SIZE_REQUEST (child->widget),
- sizes[i].minimum_size,
- &child_min, &child_nat);
+ gtk_size_request_get_preferred_width_for_height (GTK_SIZE_REQUEST (child->widget),
+ sizes[i].minimum_size,
+ &child_min, &child_nat);
max_min_size = MAX (max_min_size, child_min);
max_nat_size = MAX (max_nat_size, child_nat);
@@ -810,11 +810,11 @@ gather_aligned_item_requests (GtkWrapBox *box,
continue;
if (orientation == GTK_ORIENTATION_HORIZONTAL)
- gtk_size_request_get_width (GTK_SIZE_REQUEST (child->widget),
- &child_min, &child_nat);
+ gtk_size_request_get_preferred_width (GTK_SIZE_REQUEST (child->widget),
+ &child_min, &child_nat);
else
- gtk_size_request_get_height (GTK_SIZE_REQUEST (child->widget),
- &child_min, &child_nat);
+ gtk_size_request_get_preferred_height (GTK_SIZE_REQUEST (child->widget),
+ &child_min, &child_nat);
/* Get the index and push it over for the last line when spreading to the end */
position = i % line_length;
@@ -1397,11 +1397,11 @@ gtk_wrap_box_get_child_property (GtkContainer *container,
static void
gtk_wrap_box_size_request_init (GtkSizeRequestIface *iface)
{
- iface->get_request_mode = gtk_wrap_box_get_request_mode;
- iface->get_width = gtk_wrap_box_get_width;
- iface->get_height = gtk_wrap_box_get_height;
- iface->get_height_for_width = gtk_wrap_box_get_height_for_width;
- iface->get_width_for_height = gtk_wrap_box_get_width_for_height;
+ iface->get_request_mode = gtk_wrap_box_get_request_mode;
+ iface->get_preferred_width = gtk_wrap_box_get_preferred_width;
+ iface->get_preferred_height = gtk_wrap_box_get_preferred_height;
+ iface->get_preferred_height_for_width = gtk_wrap_box_get_preferred_height_for_width;
+ iface->get_preferred_width_for_height = gtk_wrap_box_get_preferred_width_for_height;
}
static GtkSizeRequestMode
@@ -1452,11 +1452,11 @@ get_largest_line_length (GtkWrapBox *box,
continue;
if (orientation == GTK_ORIENTATION_HORIZONTAL)
- gtk_size_request_get_width (GTK_SIZE_REQUEST (child->widget),
- &child_min, &child_nat);
+ gtk_size_request_get_preferred_width (GTK_SIZE_REQUEST (child->widget),
+ &child_min, &child_nat);
else /* GTK_ORIENTATION_VERTICAL */
- gtk_size_request_get_height (GTK_SIZE_REQUEST (child->widget),
- &child_min, &child_nat);
+ gtk_size_request_get_preferred_height (GTK_SIZE_REQUEST (child->widget),
+ &child_min, &child_nat);
if (i > 0)
{
@@ -1483,9 +1483,9 @@ get_largest_line_length (GtkWrapBox *box,
static void
-gtk_wrap_box_get_width (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size)
+gtk_wrap_box_get_preferred_width (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
{
GtkWrapBox *box = GTK_WRAP_BOX (widget);
GtkWrapBoxPrivate *priv = box->priv;
@@ -1543,8 +1543,9 @@ gtk_wrap_box_get_width (GtkSizeRequest *widget,
/* Return the width for the minimum height */
gint min_height;
- GTK_SIZE_REQUEST_GET_IFACE (widget)->get_height (widget, &min_height, NULL);
- GTK_SIZE_REQUEST_GET_IFACE (widget)->get_width_for_height (widget, min_height, &min_width, &nat_width);
+ GTK_SIZE_REQUEST_GET_IFACE (widget)->get_preferred_height (widget, &min_height, NULL);
+ GTK_SIZE_REQUEST_GET_IFACE (widget)->get_preferred_width_for_height (widget, min_height,
+ &min_width, &nat_width);
}
@@ -1556,9 +1557,9 @@ gtk_wrap_box_get_width (GtkSizeRequest *widget,
}
static void
-gtk_wrap_box_get_height (GtkSizeRequest *widget,
- gint *minimum_size,
- gint *natural_size)
+gtk_wrap_box_get_preferred_height (GtkSizeRequest *widget,
+ gint *minimum_size,
+ gint *natural_size)
{
GtkWrapBox *box = GTK_WRAP_BOX (widget);
GtkWrapBoxPrivate *priv = box->priv;
@@ -1574,8 +1575,9 @@ gtk_wrap_box_get_height (GtkSizeRequest *widget,
/* Return the height for the minimum width */
gint min_width;
- GTK_SIZE_REQUEST_GET_IFACE (widget)->get_width (widget, &min_width, NULL);
- GTK_SIZE_REQUEST_GET_IFACE (widget)->get_height_for_width (widget, min_width, &min_height, &nat_height);
+ GTK_SIZE_REQUEST_GET_IFACE (widget)->get_preferred_width (widget, &min_width, NULL);
+ GTK_SIZE_REQUEST_GET_IFACE (widget)->get_preferred_height_for_width (widget, min_width,
+ &min_height, &nat_height);
}
else /* GTK_ORIENTATION_VERTICAL */
{
@@ -1628,10 +1630,10 @@ gtk_wrap_box_get_height (GtkSizeRequest *widget,
}
static void
-gtk_wrap_box_get_height_for_width (GtkSizeRequest *widget,
- gint width,
- gint *minimum_height,
- gint *natural_height)
+gtk_wrap_box_get_preferred_height_for_width (GtkSizeRequest *widget,
+ gint width,
+ gint *minimum_height,
+ gint *natural_height)
{
GtkWrapBox *box = GTK_WRAP_BOX (widget);
GtkWrapBoxPrivate *priv = box->priv;
@@ -1652,7 +1654,7 @@ gtk_wrap_box_get_height_for_width (GtkSizeRequest *widget,
n_children = get_visible_children (box);
/* Make sure its no smaller than the minimum */
- GTK_SIZE_REQUEST_GET_IFACE (widget)->get_width (widget, &min_width, NULL);
+ GTK_SIZE_REQUEST_GET_IFACE (widget)->get_preferred_width (widget, &min_width, NULL);
avail_size = MAX (width, min_width);
@@ -1793,7 +1795,7 @@ gtk_wrap_box_get_height_for_width (GtkSizeRequest *widget,
else /* GTK_ORIENTATION_VERTICAL */
{
/* Return the minimum height */
- GTK_SIZE_REQUEST_GET_IFACE (widget)->get_height (widget, &min_height, &nat_height);
+ GTK_SIZE_REQUEST_GET_IFACE (widget)->get_preferred_height (widget, &min_height, &nat_height);
}
if (minimum_height)
@@ -1804,10 +1806,10 @@ gtk_wrap_box_get_height_for_width (GtkSizeRequest *widget,
}
static void
-gtk_wrap_box_get_width_for_height (GtkSizeRequest *widget,
- gint height,
- gint *minimum_width,
- gint *natural_width)
+gtk_wrap_box_get_preferred_width_for_height (GtkSizeRequest *widget,
+ gint height,
+ gint *minimum_width,
+ gint *natural_width)
{
GtkWrapBox *box = GTK_WRAP_BOX (widget);
GtkWrapBoxPrivate *priv = box->priv;
@@ -1824,7 +1826,7 @@ gtk_wrap_box_get_width_for_height (GtkSizeRequest *widget,
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
{
/* Return the minimum width */
- GTK_SIZE_REQUEST_GET_IFACE (widget)->get_width (widget, &min_width, &nat_width);
+ GTK_SIZE_REQUEST_GET_IFACE (widget)->get_preferred_width (widget, &min_width, &nat_width);
}
else /* GTK_ORIENTATION_VERTICAL */
{
@@ -1833,7 +1835,7 @@ gtk_wrap_box_get_width_for_height (GtkSizeRequest *widget,
n_children = get_visible_children (box);
/* Make sure its no smaller than the minimum */
- GTK_SIZE_REQUEST_GET_IFACE (widget)->get_height (widget, &min_height, NULL);
+ GTK_SIZE_REQUEST_GET_IFACE (widget)->get_preferred_height (widget, &min_height, NULL);
avail_size = MAX (height, min_height);
diff --git a/tests/gtkoffscreenbox.c b/tests/gtkoffscreenbox.c
index ac0f4ba..80f4535 100644
--- a/tests/gtkoffscreenbox.c
+++ b/tests/gtkoffscreenbox.c
@@ -527,8 +527,8 @@ gtk_offscreen_box_size_allocate (GtkWidget *widget,
GtkRequisition child_requisition;
GtkAllocation child_allocation;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (offscreen_box->child1),
- &child_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (offscreen_box->child1),
+ &child_requisition, NULL);
child_allocation.x = child_requisition.width * (CHILD1_SIZE_SCALE - 1.0) / 2;
child_allocation.y = start_y + child_requisition.height * (CHILD1_SIZE_SCALE - 1.0) / 2;
child_allocation.width = MAX (1, (gint) allocation->width - 2 * border_width);
@@ -552,8 +552,8 @@ gtk_offscreen_box_size_allocate (GtkWidget *widget,
GtkRequisition child_requisition;
GtkAllocation child_allocation;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (offscreen_box->child2),
- &child_requisition, NULL);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (offscreen_box->child2),
+ &child_requisition, NULL);
child_allocation.x = child_requisition.width * (CHILD2_SIZE_SCALE - 1.0) / 2;
child_allocation.y = start_y + child_requisition.height * (CHILD2_SIZE_SCALE - 1.0) / 2;
child_allocation.width = MAX (1, (gint) allocation->width - 2 * border_width);
diff --git a/tests/testellipsise.c b/tests/testellipsise.c
index e4d2b8c..ef22b5e 100644
--- a/tests/testellipsise.c
+++ b/tests/testellipsise.c
@@ -84,8 +84,8 @@ ebox_draw_cb (GtkWidget *widget,
gtk_widget_translate_coordinates (label, widget, 0, 0, &x, &y);
layout = gtk_widget_create_pango_layout (widget, "");
- gtk_size_request_get_size (GTK_SIZE_REQUEST (label),
- &minimum_size, &natural_size);
+ gtk_size_request_get_preferred_size (GTK_SIZE_REQUEST (label),
+ &minimum_size, &natural_size);
pango_layout_set_markup (layout,
"<span color='#c33'>\342\227\217 requisition</span>\n"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]