[gtk+] sizegroup: Remove GtkQueueResizeFlags



commit ab2d236d3dafb93ae8d25e415d6e0b9c8a55babc
Author: Benjamin Otte <otte redhat com>
Date:   Tue Mar 24 04:45:38 2015 +0100

    sizegroup: Remove GtkQueueResizeFlags
    
    They were only used with geometry widgets.

 gtk/gtkcontainer.c         |   60 +++++++++++++++----------------------------
 gtk/gtkcontainerprivate.h  |    1 -
 gtk/gtksizegroup-private.h |   19 +-------------
 gtk/gtksizegroup.c         |   30 +++++++++-------------
 gtk/gtkwidget.c            |   27 +++++++------------
 5 files changed, 44 insertions(+), 93 deletions(-)
---
diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c
index 1cacdb6..aed12b9 100644
--- a/gtk/gtkcontainer.c
+++ b/gtk/gtkcontainer.c
@@ -2105,32 +2105,6 @@ gtk_container_queue_resize_handler (GtkContainer *container)
     }
 }
 
-static void
-_gtk_container_queue_resize_internal (GtkContainer *container,
-                                      gboolean      invalidate_only)
-{
-  GtkWidget *widget;
-
-  widget = (GtkWidget*)container;
-
-  do
-    {
-      _gtk_widget_set_alloc_needed (widget, TRUE);
-      _gtk_size_request_cache_clear (_gtk_widget_peek_request_cache (widget));
-
-      G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-      if (((GtkContainer*)widget)->priv->resize_mode != GTK_RESIZE_PARENT)
-        break;
-      G_GNUC_END_IGNORE_DEPRECATIONS;
-
-      widget = _gtk_widget_get_parent (widget);
-    }
-  while (widget);
-
-  if (widget && !invalidate_only)
-    gtk_container_queue_resize_handler ((GtkContainer*)widget);
-}
-
 void
 _gtk_container_queue_restyle (GtkContainer *container)
 {
@@ -2161,20 +2135,28 @@ _gtk_container_queue_restyle (GtkContainer *container)
 void
 _gtk_container_queue_resize (GtkContainer *container)
 {
-  _gtk_container_queue_resize_internal (container, FALSE);
-}
+  GtkWidget *widget;
 
-/**
- * _gtk_container_resize_invalidate:
- * @container: a #GtkContainer
- *
- * Invalidates cached sizes like _gtk_container_queue_resize() but doesn't
- * actually queue the resize container for resize.
- */
-void
-_gtk_container_resize_invalidate (GtkContainer *container)
-{
-  _gtk_container_queue_resize_internal (container, TRUE);
+  g_return_if_fail (GTK_IS_CONTAINER (container));
+
+  widget = GTK_WIDGET (container);
+
+  do
+    {
+      _gtk_widget_set_alloc_needed (widget, TRUE);
+      _gtk_size_request_cache_clear (_gtk_widget_peek_request_cache (widget));
+
+      G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+      if (GTK_IS_RESIZE_CONTAINER (widget))
+        break;
+      G_GNUC_END_IGNORE_DEPRECATIONS;
+
+      widget = gtk_widget_get_parent (widget);
+    }
+  while (widget);
+
+  if (widget)
+    gtk_container_queue_resize_handler (GTK_CONTAINER (widget));
 }
 
 void
diff --git a/gtk/gtkcontainerprivate.h b/gtk/gtkcontainerprivate.h
index ec81720..244054f 100644
--- a/gtk/gtkcontainerprivate.h
+++ b/gtk/gtkcontainerprivate.h
@@ -27,7 +27,6 @@ G_BEGIN_DECLS
 
 void     _gtk_container_queue_resize           (GtkContainer *container);
 void     _gtk_container_queue_restyle          (GtkContainer *container);
-void     _gtk_container_resize_invalidate      (GtkContainer *container);
 void     _gtk_container_clear_resize_widgets   (GtkContainer *container);
 gchar*   _gtk_container_child_composite_name   (GtkContainer *container,
                                                 GtkWidget    *child);
diff --git a/gtk/gtksizegroup-private.h b/gtk/gtksizegroup-private.h
index 11b6fa8..6950844 100644
--- a/gtk/gtksizegroup-private.h
+++ b/gtk/gtksizegroup-private.h
@@ -23,26 +23,9 @@
 
 G_BEGIN_DECLS
 
-/*
- * GtkQueueResizeFlags:
- * @GTK_QUEUE_RESIZE_INVALIDATE_ONLY: invalidate all cached sizes
- *  as we would normally do when a widget is queued for resize,
- *  but don’t actually add the toplevel resize container to the
- *  resize queue. Useful if we want to change the size of a widget
- *  see how that would affect the overall layout, then restore
- *  the old size.
- *
- * Flags that affect the operation of queueing a widget for resize.
- */
-typedef enum
-{
-  GTK_QUEUE_RESIZE_INVALIDATE_ONLY = 1 << 0
-} GtkQueueResizeFlags;
-
 GHashTable * _gtk_size_group_get_widget_peers (GtkWidget           *for_widget,
                                                GtkOrientation       orientation);
-void _gtk_size_group_queue_resize             (GtkWidget           *widget,
-                                               GtkQueueResizeFlags  flags);
+void _gtk_size_group_queue_resize             (GtkWidget           *widget);
 
 G_END_DECLS
 
diff --git a/gtk/gtksizegroup.c b/gtk/gtksizegroup.c
index 8e1e33f..0136c11 100644
--- a/gtk/gtksizegroup.c
+++ b/gtk/gtksizegroup.c
@@ -204,8 +204,7 @@ _gtk_size_group_get_widget_peers (GtkWidget      *for_widget,
 }
 
 static void
-real_queue_resize (GtkWidget          *widget,
-                  GtkQueueResizeFlags flags)
+real_queue_resize (GtkWidget *widget)
 {
   GtkWidget *container;
 
@@ -219,17 +218,13 @@ real_queue_resize (GtkWidget          *widget,
 
   if (container)
     {
-      if (flags & GTK_QUEUE_RESIZE_INVALIDATE_ONLY)
-       _gtk_container_resize_invalidate (GTK_CONTAINER (container));
-      else
-       _gtk_container_queue_resize (GTK_CONTAINER (container));
+      _gtk_container_queue_resize (GTK_CONTAINER (container));
     }
 }
 
 static void
-queue_resize_on_widget (GtkWidget          *widget,
-                       gboolean            check_siblings,
-                       GtkQueueResizeFlags flags)
+queue_resize_on_widget (GtkWidget *widget,
+                       gboolean   check_siblings)
 {
   GHashTable *widgets;
   GHashTable *groups;
@@ -248,7 +243,7 @@ queue_resize_on_widget (GtkWidget          *widget,
 
       if (widget == parent && !check_siblings)
        {
-         real_queue_resize (widget, flags);
+         real_queue_resize (widget);
           parent = _gtk_widget_get_parent (parent);
          continue;
        }
@@ -257,7 +252,7 @@ queue_resize_on_widget (GtkWidget          *widget,
       if (!widget_groups)
        {
          if (widget == parent)
-           real_queue_resize (widget, flags);
+           real_queue_resize (widget);
 
           parent = _gtk_widget_get_parent (parent);
          continue;
@@ -273,14 +268,14 @@ queue_resize_on_widget (GtkWidget          *widget,
          if (current == parent)
            {
              if (widget == parent)
-               real_queue_resize (parent, flags);
+               real_queue_resize (parent);
            }
          else if (current == widget)
             {
               g_warning ("A container and its child are part of this SizeGroup");
             }
          else
-           queue_resize_on_widget (current, FALSE, flags);
+           queue_resize_on_widget (current, FALSE);
        }
 
       parent = _gtk_widget_get_parent (parent);
@@ -291,12 +286,12 @@ queue_resize_on_widget (GtkWidget          *widget,
 }
 
 static void
-queue_resize_on_group (GtkSizeGroup       *size_group)
+queue_resize_on_group (GtkSizeGroup *size_group)
 {
   GtkSizeGroupPrivate *priv = size_group->priv;
 
   if (priv->widgets)
-    queue_resize_on_widget (priv->widgets->data, TRUE, 0);
+    queue_resize_on_widget (priv->widgets->data, TRUE);
 }
 
 static void
@@ -611,10 +606,9 @@ gtk_size_group_get_widgets (GtkSizeGroup *size_group)
  * Queue a resize on a widget, and on all other widgets grouped with this widget.
  **/
 void
-_gtk_size_group_queue_resize (GtkWidget           *widget,
-                             GtkQueueResizeFlags  flags)
+_gtk_size_group_queue_resize (GtkWidget *widget)
 {
-  queue_resize_on_widget (widget, TRUE, flags);
+  queue_resize_on_widget (widget, TRUE);
 }
 
 typedef struct {
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 348e874..5cac170 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -806,8 +806,7 @@ static gboolean              setup_template_child              (GtkWidgetTemplat
 
 static void gtk_widget_set_usize_internal (GtkWidget          *widget,
                                           gint                width,
-                                          gint                height,
-                                          GtkQueueResizeFlags flags);
+                                          gint                height);
 
 static void gtk_widget_add_events_internal (GtkWidget *widget,
                                             GdkDevice *device,
@@ -3671,10 +3670,10 @@ gtk_widget_set_property (GObject         *object,
       gtk_container_add (GTK_CONTAINER (g_value_get_object (value)), widget);
       break;
     case PROP_WIDTH_REQUEST:
-      gtk_widget_set_usize_internal (widget, g_value_get_int (value), -2, 0);
+      gtk_widget_set_usize_internal (widget, g_value_get_int (value), -2);
       break;
     case PROP_HEIGHT_REQUEST:
-      gtk_widget_set_usize_internal (widget, -2, g_value_get_int (value), 0);
+      gtk_widget_set_usize_internal (widget, -2, g_value_get_int (value));
       break;
     case PROP_VISIBLE:
       gtk_widget_set_visible (widget, g_value_get_boolean (value));
@@ -5600,7 +5599,7 @@ gtk_widget_queue_resize (GtkWidget *widget)
   if (_gtk_widget_get_realized (widget))
     gtk_widget_queue_draw (widget);
 
-  _gtk_size_group_queue_resize (widget, 0);
+  _gtk_size_group_queue_resize (widget);
 }
 
 /**
@@ -5617,7 +5616,7 @@ gtk_widget_queue_resize_no_redraw (GtkWidget *widget)
 {
   g_return_if_fail (GTK_IS_WIDGET (widget));
 
-  _gtk_size_group_queue_resize (widget, 0);
+  _gtk_size_group_queue_resize (widget);
 }
 
 /**
@@ -10988,8 +10987,7 @@ gtk_widget_error_bell (GtkWidget *widget)
 static void
 gtk_widget_set_usize_internal (GtkWidget          *widget,
                               gint                width,
-                              gint                height,
-                              GtkQueueResizeFlags flags)
+                              gint                height)
 {
   GtkWidgetPrivate *priv = widget->priv;
   gboolean changed = FALSE;
@@ -10998,25 +10996,20 @@ gtk_widget_set_usize_internal (GtkWidget          *widget,
 
   if (width > -2 && priv->width != width)
     {
-      if ((flags & GTK_QUEUE_RESIZE_INVALIDATE_ONLY) == 0)
-       g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_WIDTH_REQUEST]);
+      g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_WIDTH_REQUEST]);
       priv->width = width;
       changed = TRUE;
     }
   if (height > -2 && priv->height != height)
     {
-      if ((flags & GTK_QUEUE_RESIZE_INVALIDATE_ONLY) == 0)
-       g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_HEIGHT_REQUEST]);
+      g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_HEIGHT_REQUEST]);
       priv->height = height;
       changed = TRUE;
     }
 
   if (_gtk_widget_get_visible (widget) && changed)
     {
-      if ((flags & GTK_QUEUE_RESIZE_INVALIDATE_ONLY) == 0)
-       gtk_widget_queue_resize (widget);
-      else
-       _gtk_size_group_queue_resize (widget, GTK_QUEUE_RESIZE_INVALIDATE_ONLY);
+      gtk_widget_queue_resize (widget);
     }
 
   g_object_thaw_notify (G_OBJECT (widget));
@@ -11073,7 +11066,7 @@ gtk_widget_set_size_request (GtkWidget *widget,
   if (height == 0)
     height = 1;
 
-  gtk_widget_set_usize_internal (widget, width, height, 0);
+  gtk_widget_set_usize_internal (widget, width, height);
 }
 
 


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