diff options
author | Benjamin Otte <otte@redhat.com> | 2010-09-21 16:35:17 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2010-09-26 15:11:45 +0200 |
commit | d9c92598612714683eab96fecf6e90a9531607e5 (patch) | |
tree | 4091fc22f94eeed203385670e1eb05d43b6f264c /gtk/gtkassistant.c | |
parent | f52a1fcfbde5c1b1108d4a03a9bf5c409b59a73e (diff) | |
download | gtk+-d9c92598612714683eab96fecf6e90a9531607e5.tar.gz |
Move GtkSizeRequest into GtkWidget
It doesn't make sense to keep them separate as GtkSizeRequest requires a
GtkWidget and GtkWidget implements GtkSizeRequest, so you can never have
one without the other.
It also makes the code a lot easier because no casts are required when
calling functions.
Also, the names would translate to gtk_widget_get_width() and people
agreed that this would be a too generic name, so a "preferred" was added
to the names.
So this patch moves the functions:
gtk_size_request_get_request_mode() => gtk_widget_get_request_mode()
gtk_size_request_get_width() => gtk_widget_get_preferred_width()
gtk_size_request_get_height() => gtk_widget_get_preferred_height()
gtk_size_request_get_size() => gtk_widget_get_preferred_size()
gtk_size_request_get_width_for_height() =>
gtk_widget_get_preferred_width_for_height()
gtk_size_request_get_height_for_width() =>
gtk_widget_get_preferred_height_for_width()
... and moves the corresponding vfuncs to the GtkWidgetClass.
The patch also renames the implementations of the vfuncs in widgets to
include the word "preferrred".
Diffstat (limited to 'gtk/gtkassistant.c')
-rw-r--r-- | gtk/gtkassistant.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/gtk/gtkassistant.c b/gtk/gtkassistant.c index 2a16a22eac..00b40606c9 100644 --- a/gtk/gtkassistant.c +++ b/gtk/gtkassistant.c @@ -1157,13 +1157,13 @@ gtk_assistant_size_request (GtkWidget *widget, GtkAssistantPage *page = list->data; gint w, h; - gtk_size_request_get_size (GTK_SIZE_REQUEST (page->page), - &child_requisition, NULL); + gtk_widget_get_preferred_size (page->page, + &child_requisition, NULL); width = MAX (width, child_requisition.width); height = MAX (height, child_requisition.height); - gtk_size_request_get_size (GTK_SIZE_REQUEST (page->title), - &child_requisition, NULL); + gtk_widget_get_preferred_size (page->title, + &child_requisition, NULL); w = child_requisition.width; h = child_requisition.height; @@ -1179,19 +1179,19 @@ gtk_assistant_size_request (GtkWidget *widget, list = list->next; } - gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->sidebar_image), - &child_requisition, NULL); + gtk_widget_get_preferred_size (priv->sidebar_image, + &child_requisition, NULL); width += child_requisition.width; height = MAX (height, child_requisition.height); gtk_widget_set_size_request (priv->header_image, header_width, header_height); - gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->header_image), - &child_requisition, NULL); + gtk_widget_get_preferred_size (priv->header_image, + &child_requisition, NULL); width = MAX (width, header_width) + 2 * header_padding; height += header_height + 2 * header_padding; - gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->action_area), - &child_requisition, NULL); + gtk_widget_get_preferred_size (priv->action_area, + &child_requisition, NULL); width = MAX (width, child_requisition.width); height += child_requisition.height + ACTION_AREA_SPACING; @@ -1230,8 +1230,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_widget_get_preferred_size (priv->header_image, + &header_requisition, NULL); header_allocation.x = border_width + header_padding; header_allocation.y = border_width + header_padding; @@ -1241,8 +1241,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_widget_get_preferred_size (priv->action_area, + &action_requisition, NULL); child_allocation.x = border_width; child_allocation.y = allocation->height - border_width - action_requisition.height; @@ -1255,8 +1255,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_widget_get_preferred_size (priv->sidebar_image, + &sidebar_requisition, NULL); if (rtl) child_allocation.x = allocation->width - border_width - sidebar_requisition.width; |