[gtk+/wip/baedert/drawing: 19/142] widget: Remove gtk_widget_set_allocation
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/baedert/drawing: 19/142] widget: Remove gtk_widget_set_allocation
- Date: Sun, 4 Jun 2017 16:59:09 +0000 (UTC)
commit 46f6d41eac5423cdf235d58ce82e35d488cfd87d
Author: Timm Bäder <mail baedert org>
Date: Fri May 5 19:27:50 2017 +0200
widget: Remove gtk_widget_set_allocation
docs/reference/gtk/gtk4-sections.txt | 1 -
gtk/gtkwidget.c | 41 ++-------------------------------
gtk/gtkwidget.h | 3 --
3 files changed, 3 insertions(+), 42 deletions(-)
---
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index 987b0e7..a3e1023 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -4589,7 +4589,6 @@ gtk_cairo_transform_to_window
gtk_widget_get_allocated_width
gtk_widget_get_allocated_height
gtk_widget_get_allocation
-gtk_widget_set_allocation
gtk_widget_get_allocated_baseline
gtk_widget_get_allocated_size
gtk_widget_get_clip
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index e69c98c..794f8bc 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -5578,7 +5578,8 @@ gtk_widget_size_allocate_with_baseline (GtkWidget *widget,
/* Set the widget allocation to real_allocation now, pass the smaller allocation to the vfunc */
- gtk_widget_set_allocation (widget, &real_allocation);
+ priv->allocation = real_allocation;
+ priv->clip = real_allocation;
style = gtk_css_node_get_style (priv->cssnode);
get_box_margin (style, &margin);
@@ -13430,8 +13431,6 @@ gtk_widget_get_clip (GtkWidget *widget,
*
* Sets the widget’s clip. This must not be used directly,
* but from within a widget’s size_allocate method.
- * It must be called after gtk_widget_set_allocation() (or after chaining up
- * to the parent class), because that function resets the clip.
*
* The clip set should be the area that @widget draws on. If @widget is a
* #GtkContainer, the area must contain all children's clips.
@@ -13501,8 +13500,7 @@ gtk_widget_set_clip (GtkWidget *widget,
* This is a convenience function for gtk_widget_set_clip(), if you
* just want to set the clip for @widget based on its allocation,
* CSS properties and - if the widget is a #GtkContainer - its
- * children. gtk_widget_set_allocation() must have been called
- * and all children must have been allocated with
+ * children. All children must have been allocated with
* gtk_widget_size_allocate() before calling this function.
* It is therefore a good idea to call this function last in
* your implementation of GtkWidget::size_allocate().
@@ -13693,39 +13691,6 @@ gtk_widget_get_margin_allocation (GtkWidget *widget,
}
/**
- * gtk_widget_set_allocation:
- * @widget: a #GtkWidget
- * @allocation: a pointer to a #GtkAllocation to copy from
- *
- * Sets the widget’s allocation. This should not be used
- * directly, but from within a widget’s size_allocate method.
- *
- * The allocation set should be the “adjusted” or actual
- * allocation. If you’re implementing a #GtkContainer, you want to use
- * gtk_widget_size_allocate() instead of gtk_widget_set_allocation().
- * The GtkWidgetClass::adjust_size_allocation virtual method adjusts the
- * allocation inside gtk_widget_size_allocate() to create an adjusted
- * allocation.
- *
- * Since: 2.18
- */
-void
-gtk_widget_set_allocation (GtkWidget *widget,
- const GtkAllocation *allocation)
-{
- GtkWidgetPrivate *priv;
-
- g_return_if_fail (GTK_IS_WIDGET (widget));
- g_return_if_fail (_gtk_widget_get_visible (widget) || _gtk_widget_is_toplevel (widget));
- g_return_if_fail (allocation != NULL);
-
- priv = widget->priv;
-
- priv->allocation = *allocation;
- priv->clip = *allocation;
-}
-
-/**
* gtk_widget_get_allocated_width:
* @widget: the widget to query
*
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index da5583f..175c58e 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -759,9 +759,6 @@ void gtk_widget_get_allocated_size (GtkWidget *widget,
GDK_AVAILABLE_IN_ALL
void gtk_widget_get_allocation (GtkWidget *widget,
GtkAllocation *allocation);
-GDK_AVAILABLE_IN_ALL
-void gtk_widget_set_allocation (GtkWidget *widget,
- const GtkAllocation *allocation);
GDK_AVAILABLE_IN_3_14
void gtk_widget_set_clip (GtkWidget *widget,
const GtkAllocation *clip);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]