[gtk/wip/baedert/transforms6: 50/52] widget: Remove _gtk_widget_get_allocation



commit b2351f8fefb4baa5f57b0ae5073ff80f35a94cd6
Author: Timm Bäder <mail baedert org>
Date:   Thu Feb 14 07:40:51 2019 +0100

    widget: Remove _gtk_widget_get_allocation
    
    Getting the allocation is kind of discouraged until we have figured out
    what exactly we need to expose, so stop having an internal function for
    it. Most of the calls should be replaced by gtk_widget_compute_bounds.

 gtk/a11y/gtkentryaccessible.c |  2 +-
 gtk/gtkwidget.c               |  2 +-
 gtk/gtkwidgetprivate.h        |  7 -------
 gtk/gtkwindow.c               | 20 ++++++++++----------
 4 files changed, 12 insertions(+), 19 deletions(-)
---
diff --git a/gtk/a11y/gtkentryaccessible.c b/gtk/a11y/gtkentryaccessible.c
index f8aaabad87..3b8bcf3b23 100644
--- a/gtk/a11y/gtkentryaccessible.c
+++ b/gtk/a11y/gtkentryaccessible.c
@@ -961,7 +961,7 @@ gtk_entry_accessible_get_character_extents (AtkText      *text,
   pango_layout_index_to_pos (gtk_entry_get_layout (entry), index, &char_rect);
   pango_extents_to_pixels (&char_rect, NULL);
 
-  _gtk_widget_get_allocation (widget, &allocation);
+  gtk_widget_get_allocation (widget, &allocation);
 
   surface = gtk_widget_get_surface (widget);
   gdk_surface_get_origin (surface, &x_surface, &y_surface);
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index cd03fb814d..122e5429e1 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -13181,7 +13181,7 @@ gtk_widget_create_render_node (GtkWidget   *widget,
 
   snapshot = gtk_snapshot_new_with_parent (parent_snapshot);
 
-  _gtk_widget_get_allocation (widget, &allocation);
+  gtk_widget_get_allocation (widget, &allocation);
   gtk_snapshot_push_debug (snapshot,
                            "RenderNode for %s %p @ %d x %d",
                            G_OBJECT_TYPE_NAME (widget), widget,
diff --git a/gtk/gtkwidgetprivate.h b/gtk/gtkwidgetprivate.h
index 4e3c117d70..72cfa868da 100644
--- a/gtk/gtkwidgetprivate.h
+++ b/gtk/gtkwidgetprivate.h
@@ -454,13 +454,6 @@ _gtk_widget_get_surface (GtkWidget *widget)
   return widget->priv->surface;
 }
 
-static inline void
-_gtk_widget_get_allocation (GtkWidget     *widget,
-                            GtkAllocation *allocation)
-{
-  *allocation = widget->priv->allocation;
-}
-
 static inline GtkWidget *
 _gtk_widget_get_prev_sibling (GtkWidget *widget)
 {
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index db108c8a2d..24653650d3 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -1724,7 +1724,7 @@ edge_under_coordinates (GtkWindow     *window,
       (priv->edge_constraints & constraints) != constraints)
     return FALSE;
 
-  _gtk_widget_get_allocation (GTK_WIDGET (window), &allocation);
+  gtk_widget_get_allocation (GTK_WIDGET (window), &allocation);
   context = _gtk_widget_get_style_context (GTK_WIDGET (window));
   gtk_style_context_save_to_node (context, priv->decoration_node);
 
@@ -5224,7 +5224,7 @@ gtk_window_move (GtkWindow *window,
     {
       GtkAllocation allocation;
 
-      _gtk_widget_get_allocation (widget, &allocation);
+      gtk_widget_get_allocation (widget, &allocation);
 
       /* we have now sent a request with this position
        * with currently-active constraints, so toggle flag.
@@ -6017,7 +6017,7 @@ popover_get_rect (GtkWindowPopover      *popover,
   gdouble min, max;
 
   gtk_widget_get_preferred_size (popover->widget, NULL, &req);
-  _gtk_widget_get_allocation (GTK_WIDGET (window), &win_alloc);
+  gtk_widget_get_allocation (GTK_WIDGET (window), &win_alloc);
 
   get_shadow_width (window, &win_border);
   win_alloc.x += win_border.left;
@@ -6385,7 +6385,7 @@ gtk_window_realize (GtkWidget *widget)
   if (!priv->client_decorated && gtk_window_should_use_csd (window))
     create_decoration (widget);
 
-  _gtk_widget_get_allocation (widget, &allocation);
+  gtk_widget_get_allocation (widget, &allocation);
 
   /* ensure widget tree is properly size allocated */
   if (allocation.x == -1 &&
@@ -6411,12 +6411,12 @@ gtk_window_realize (GtkWidget *widget)
   if (priv->hardcoded_surface)
     {
       surface = priv->hardcoded_surface;
-      _gtk_widget_get_allocation (widget, &allocation);
+      gtk_widget_get_allocation (widget, &allocation);
       gdk_surface_resize (surface, allocation.width, allocation.height);
     }
   else
     {
-      _gtk_widget_get_allocation (widget, &allocation);
+      gtk_widget_get_allocation (widget, &allocation);
 
       switch (priv->type)
         {
@@ -6787,7 +6787,7 @@ gtk_window_configure (GtkWindow *window,
    * have been a queued resize from child widgets, and so we
    * need to reallocate our children in case *they* changed.
    */
-  _gtk_widget_get_allocation (widget, &allocation);
+  gtk_widget_get_allocation (widget, &allocation);
   if (priv->configure_request_count == 0 &&
       (allocation.width == width && allocation.height == height))
     {
@@ -7008,7 +7008,7 @@ get_active_region_type (GtkWindow *window, gint x, gint y)
       gtk_widget_get_visible (priv->title_box) &&
       gtk_widget_get_child_visible (priv->title_box))
     {
-      _gtk_widget_get_allocation (priv->title_box, &allocation);
+      gtk_widget_get_allocation (priv->title_box, &allocation);
       if (allocation.x <= x && allocation.x + allocation.width > x &&
           allocation.y <= y && allocation.y + allocation.height > y)
         return GTK_WINDOW_REGION_TITLE;
@@ -7386,7 +7386,7 @@ gtk_window_style_updated (GtkWidget *widget)
       GtkAllocation allocation;
       GtkBorder window_border;
 
-      _gtk_widget_get_allocation (widget, &allocation);
+      gtk_widget_get_allocation (widget, &allocation);
       get_shadow_width (window, &window_border);
 
       update_opaque_region (window, &window_border, &allocation);
@@ -7932,7 +7932,7 @@ gtk_window_compute_configure_request (GtkWindow    *window,
 
             gdk_surface_get_origin (surface, &ox, &oy);
 
-            _gtk_widget_get_allocation (parent_widget, &allocation);
+            gtk_widget_get_allocation (parent_widget, &allocation);
             x = ox + (allocation.width - w) / 2;
             y = oy + (allocation.height - h) / 2;
 


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