[gtk/wip/otte/matrix: 1/5] widget: Remove gtk_widget_get_allocated_size()



commit cd3a905d89058d056b35b603c2c88fa5e0cbd0fb
Author: Benjamin Otte <otte redhat com>
Date:   Tue Feb 19 08:09:57 2019 +0100

    widget: Remove gtk_widget_get_allocated_size()
    
    Use gtk_widget_get_allocated_width/height in the only user (GtkStack),
    even though that isn't 100% correct.

 gtk/gtkstack.c  |  7 ++-----
 gtk/gtkwidget.c | 35 -----------------------------------
 gtk/gtkwidget.h |  4 ----
 3 files changed, 2 insertions(+), 44 deletions(-)
---
diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c
index 003bc2088e..94de6d830b 100644
--- a/gtk/gtkstack.c
+++ b/gtk/gtkstack.c
@@ -1195,12 +1195,9 @@ set_visible_child (GtkStack               *stack,
     {
       if (gtk_widget_is_visible (widget))
         {
-          GtkAllocation allocation;
-
           priv->last_visible_child = priv->visible_child;
-          gtk_widget_get_allocated_size (priv->last_visible_child->widget, &allocation, NULL);
-          priv->last_visible_widget_width = allocation.width;
-          priv->last_visible_widget_height = allocation.height;
+          priv->last_visible_widget_width = gtk_widget_get_allocated_width 
(priv->last_visible_child->widget);
+          priv->last_visible_widget_height = gtk_widget_get_allocated_height 
(priv->last_visible_child->widget);
         }
       else
         {
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index a139d29579..2b84290df4 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -11131,41 +11131,6 @@ gtk_widget_get_has_tooltip (GtkWidget *widget)
   return priv->has_tooltip;
 }
 
-/**
- * gtk_widget_get_allocated_size:
- * @widget: a #GtkWidget
- * @allocation: (out): a pointer to a #GtkAllocation to copy to
- * @baseline: (out) (allow-none): a pointer to an integer to copy to
- *
- * Retrieves the widget’s allocated size.
- *
- * This function returns the last values passed to
- * gtk_widget_size_allocate(). The value differs from
- * the size returned in gtk_widget_get_allocation() in that functions
- * like gtk_widget_set_halign() can adjust the allocation, but not
- * the value returned by this function.
- *
- * If a widget is not visible, its allocated size is 0.
- */
-void
-gtk_widget_get_allocated_size (GtkWidget     *widget,
-                               GtkAllocation *allocation,
-                               int           *baseline)
-{
-  GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
-
-  g_return_if_fail (GTK_IS_WIDGET (widget));
-  g_return_if_fail (allocation != NULL);
-
-  allocation->x = graphene_matrix_get_value (&priv->allocated_transform, 3, 0);
-  allocation->y = graphene_matrix_get_value (&priv->allocated_transform, 3, 1);
-  allocation->width = priv->allocated_width;
-  allocation->height = priv->allocated_height;
-
-  if (baseline)
-    *baseline = priv->allocated_size_baseline;
-}
-
 /**
  * gtk_widget_get_allocation:
  * @widget: a #GtkWidget
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index e912b6e612..057be5662f 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -605,10 +605,6 @@ GDK_AVAILABLE_IN_ALL
 int                   gtk_widget_get_allocated_height   (GtkWidget     *widget);
 GDK_AVAILABLE_IN_ALL
 int                   gtk_widget_get_allocated_baseline (GtkWidget     *widget);
-GDK_AVAILABLE_IN_ALL
-void                  gtk_widget_get_allocated_size     (GtkWidget     *widget,
-                                                         GtkAllocation *allocation,
-                                                         int           *baseline);
 
 GDK_AVAILABLE_IN_ALL
 void                  gtk_widget_get_allocation         (GtkWidget     *widget,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]