[gtk+] widget: Remove gtk_widget_get_margin_allocation



commit 9c7e089fc2eb9d3b1d459a5673eeb25230c0a46c
Author: Timm Bäder <mail baedert org>
Date:   Mon Aug 14 10:18:14 2017 +0200

    widget: Remove gtk_widget_get_margin_allocation
    
    It's not needed anymore with get_outer_allocation (which will be
    replaced by something more appropriately named).

 gtk/gtknotebook.c      |    2 +-
 gtk/gtkrange.c         |   14 +++++++-------
 gtk/gtkwidget.c        |   22 +---------------------
 gtk/gtkwidgetprivate.h |    2 --
 4 files changed, 9 insertions(+), 31 deletions(-)
---
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 904dfe7..fc80e5a 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -2310,7 +2310,7 @@ gtk_notebook_gesture_pressed (GtkGestureMultiPress *gesture,
           priv->drag_begin_x = priv->mouse_x;
           priv->drag_begin_y = priv->mouse_y;
 
-          gtk_widget_get_margin_allocation (page->tab_widget, &allocation);
+          gtk_widget_get_outer_allocation (page->tab_widget, &allocation);
 
           priv->drag_offset_x = priv->drag_begin_x - allocation.x;
           priv->drag_offset_y = priv->drag_begin_y - allocation.y;
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index 2da3658..85a0312 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -954,7 +954,7 @@ gtk_range_get_slider_range (GtkRange *range,
 
   priv = range->priv;
 
-  gtk_widget_get_margin_allocation (priv->slider_widget, &slider_alloc);
+  gtk_widget_get_outer_allocation (priv->slider_widget, &slider_alloc);
 
   if (priv->orientation == GTK_ORIENTATION_VERTICAL)
     {
@@ -1831,7 +1831,7 @@ coord_to_value (GtkRange *range,
   gint    slider_length;
   GtkAllocation slider_alloc, trough_alloc;
 
-  gtk_widget_get_margin_allocation (priv->slider_widget, &slider_alloc);
+  gtk_widget_get_outer_allocation (priv->slider_widget, &slider_alloc);
   gtk_widget_get_content_allocation (priv->trough_widget, &trough_alloc);
 
   if (priv->orientation == GTK_ORIENTATION_VERTICAL)
@@ -1888,7 +1888,7 @@ gtk_range_key_press (GtkWidget   *widget,
     {
       GtkAllocation slider_alloc;
 
-      gtk_widget_get_margin_allocation (priv->slider_widget, &slider_alloc);
+      gtk_widget_get_outer_allocation (priv->slider_widget, &slider_alloc);
 
       if (priv->orientation == GTK_ORIENTATION_VERTICAL)
         priv->slide_initial_slider_position = slider_alloc.y;
@@ -1936,7 +1936,7 @@ gtk_range_long_press_gesture_pressed (GtkGestureLongPress *gesture,
     {
       GtkAllocation slider_alloc;
 
-      gtk_widget_get_margin_allocation (priv->slider_widget, &slider_alloc);
+      gtk_widget_get_outer_allocation (priv->slider_widget, &slider_alloc);
       update_initial_slider_position (range, x, y, &slider_alloc);
       update_zoom_state (range, TRUE);
     }
@@ -1977,7 +1977,7 @@ gtk_range_multipress_gesture_pressed (GtkGestureMultiPress *gesture,
   priv->mouse_y = y;
 
   gtk_range_update_mouse_location (range);
-  gtk_widget_get_margin_allocation (priv->slider_widget, &slider_alloc);
+  gtk_widget_get_outer_allocation (priv->slider_widget, &slider_alloc);
 
   g_object_get (gtk_widget_get_settings (widget),
                 "gtk-primary-button-warps-slider", &primary_warps,
@@ -2116,7 +2116,7 @@ update_slider_position (GtkRange *range,
     {
       GtkAllocation trough_alloc;
 
-      gtk_widget_get_margin_allocation (priv->trough_widget, &trough_alloc);
+      gtk_widget_get_outer_allocation (priv->trough_widget, &trough_alloc);
 
       zoom = MIN(1.0, (priv->orientation == GTK_ORIENTATION_VERTICAL ?
                        trough_alloc.height : trough_alloc.width) /
@@ -2135,7 +2135,7 @@ update_slider_position (GtkRange *range,
     {
       GtkAllocation slider_alloc;
 
-      gtk_widget_get_margin_allocation (priv->slider_widget, &slider_alloc);
+      gtk_widget_get_outer_allocation (priv->slider_widget, &slider_alloc);
 
       if (priv->orientation == GTK_ORIENTATION_VERTICAL)
         priv->slide_initial_slider_position = (zoom * (mouse_y - priv->slide_initial_coordinate_delta) - 
slider_alloc.y) / (zoom - 1.0);
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 14a9206..2ed54ab 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -948,7 +948,7 @@ gtk_widget_real_pick (GtkWidget *widget,
           !gtk_widget_is_drawable (child))
         continue;
 
-      gtk_widget_get_margin_allocation (child, &allocation);
+      gtk_widget_get_outer_allocation (child, &allocation);
 
       if (gdk_rectangle_contains_point (&allocation, tx, ty))
         {
@@ -13283,26 +13283,6 @@ gtk_widget_get_border_allocation (GtkWidget     *widget,
                         margin.bottom + border.bottom;
 }
 
-void
-gtk_widget_get_margin_allocation (GtkWidget     *widget,
-                                  GtkAllocation *allocation)
-{
-  GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
-  GtkBorder margin, border;
-  GtkCssStyle *style;
-
-  style = gtk_css_node_get_style (priv->cssnode);
-  get_box_margin (style, &margin);
-  get_box_border (style, &border);
-
-  *allocation = priv->allocation;
-
-  allocation->x += margin.left;
-  allocation->y += margin.top;
-  allocation->width -= margin.left + margin.right;
-  allocation->height -= margin.top + margin.bottom;
-}
-
 /**
  * gtk_widget_get_allocated_width:
  * @widget: the widget to query
diff --git a/gtk/gtkwidgetprivate.h b/gtk/gtkwidgetprivate.h
index 79d6437..d119aef 100644
--- a/gtk/gtkwidgetprivate.h
+++ b/gtk/gtkwidgetprivate.h
@@ -318,8 +318,6 @@ void              gtk_widget_get_content_allocation        (GtkWidget        *wi
                                                             GtkAllocation    *allocation);
 void              gtk_widget_get_border_allocation         (GtkWidget        *widget,
                                                             GtkAllocation    *allocation);
-void              gtk_widget_get_margin_allocation         (GtkWidget        *widget,
-                                                            GtkAllocation    *allocation);
 void              gtk_widget_get_outer_allocation          (GtkWidget        *widget,
                                                             GtkAllocation    *allocation);
 void              gtk_widget_get_own_allocation            (GtkWidget        *widget,


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