summaryrefslogtreecommitdiff
path: root/gtk/gtklayout.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2010-09-21 16:35:17 +0200
committerBenjamin Otte <otte@redhat.com>2010-09-26 15:11:45 +0200
commitd9c92598612714683eab96fecf6e90a9531607e5 (patch)
tree4091fc22f94eeed203385670e1eb05d43b6f264c /gtk/gtklayout.c
parentf52a1fcfbde5c1b1108d4a03a9bf5c409b59a73e (diff)
downloadgtk+-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/gtklayout.c')
-rw-r--r--gtk/gtklayout.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/gtk/gtklayout.c b/gtk/gtklayout.c
index c16d345a03..9a0943bdd0 100644
--- a/gtk/gtklayout.c
+++ b/gtk/gtklayout.c
@@ -34,8 +34,6 @@
#include "gdkconfig.h"
-#include "gtksizerequest.h"
-
#include "gtkprivate.h"
#include "gtkintl.h"
#include "gtkmarshalers.h"
@@ -993,8 +991,7 @@ gtk_layout_size_request (GtkWidget *widget,
tmp_list = tmp_list->next;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
- &child_requisition, NULL);
+ gtk_widget_get_preferred_size (child->widget, &child_requisition, NULL);
}
}
@@ -1126,8 +1123,7 @@ 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_widget_get_preferred_size (child->widget, &requisition, NULL);
allocation.width = requisition.width;
allocation.height = requisition.height;