summaryrefslogtreecommitdiff
path: root/gtk/gtktoolitemgroup.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/gtktoolitemgroup.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/gtktoolitemgroup.c')
-rw-r--r--gtk/gtktoolitemgroup.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/gtk/gtktoolitemgroup.c b/gtk/gtktoolitemgroup.c
index 0b8ad010a8..aa6558a548 100644
--- a/gtk/gtktoolitemgroup.c
+++ b/gtk/gtktoolitemgroup.c
@@ -554,8 +554,8 @@ gtk_tool_item_group_size_request (GtkWidget *widget,
if (priv->children && gtk_tool_item_group_get_label_widget (group))
{
- gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->header),
- requisition, NULL);
+ gtk_widget_get_preferred_size (priv->header,
+ requisition, NULL);
gtk_widget_show (priv->header);
}
else
@@ -688,8 +688,8 @@ gtk_tool_item_group_real_size_query (GtkWidget *widget,
GtkRequisition req = {0, 0};
guint width;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (child->item),
- &req, NULL);
+ gtk_widget_get_preferred_size (GTK_WIDGET (child->item),
+ &req, NULL);
width = udiv (req.width, item_size.width);
col += width;
@@ -747,8 +747,8 @@ gtk_tool_item_group_real_size_query (GtkWidget *widget,
GtkRequisition req = {0, 0};
guint width;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (child->item),
- &req, NULL);
+ gtk_widget_get_preferred_size (GTK_WIDGET (child->item),
+ &req, NULL);
width = udiv (req.width, item_size.width);
@@ -803,8 +803,8 @@ gtk_tool_item_group_real_size_query (GtkWidget *widget,
GtkRequisition req = {0, 0};
guint width;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (child->item),
- &req, NULL);
+ gtk_widget_get_preferred_size (GTK_WIDGET (child->item),
+ &req, NULL);
width = udiv (req.width, item_size.width);
col += width;
@@ -836,8 +836,8 @@ gtk_tool_item_group_real_size_query (GtkWidget *widget,
{
GtkRequisition child_requisition;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->header),
- &child_requisition, NULL);
+ gtk_widget_get_preferred_size (priv->header,
+ &child_requisition, NULL);
if (GTK_ORIENTATION_VERTICAL == orientation)
inquery->height += child_requisition.height;
@@ -887,8 +887,8 @@ gtk_tool_item_group_real_size_allocate (GtkWidget *widget,
/* place the header widget */
if (gtk_widget_get_visible (priv->header))
{
- gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->header),
- &child_requisition, NULL);
+ gtk_widget_get_preferred_size (priv->header,
+ &child_requisition, NULL);
if (GTK_ORIENTATION_VERTICAL == orientation)
{
@@ -972,8 +972,8 @@ gtk_tool_item_group_real_size_allocate (GtkWidget *widget,
if (!child->homogeneous)
{
- gtk_size_request_get_size (GTK_SIZE_REQUEST (child->item),
- &child_requisition, NULL);
+ gtk_widget_get_preferred_size (GTK_WIDGET (child->item),
+ &child_requisition, NULL);
child_requisition.width = MIN (child_requisition.width, item_area.width);
}
@@ -2303,8 +2303,8 @@ _gtk_tool_item_group_item_size_request (GtkToolItemGroup *group,
if (!child->homogeneous && child->expand)
new_row = TRUE;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (child->item),
- &child_requisition, NULL);
+ gtk_widget_get_preferred_size (GTK_WIDGET (child->item),
+ &child_requisition, NULL);
if (!homogeneous_only || child->homogeneous)
item_size->width = MAX (item_size->width, child_requisition.width);
@@ -2390,8 +2390,8 @@ _gtk_tool_item_group_get_size_for_limit (GtkToolItemGroup *group,
GtkRequisition requisition;
GtkToolItemGroupPrivate* priv = group->priv;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (group),
- &requisition, NULL);
+ gtk_widget_get_preferred_size (GTK_WIDGET (group),
+ &requisition, NULL);
if (!priv->collapsed || priv->animation_timeout)
{