]> Pileus Git - ~andy/gtk/commitdiff
Fix more SizeRequest implementations to avoid recursive calls to wrapper API
authorHavoc Pennington <hp@pobox.com>
Mon, 6 Sep 2010 02:19:31 +0000 (22:19 -0400)
committerHavoc Pennington <hp@pobox.com>
Mon, 13 Sep 2010 01:47:10 +0000 (21:47 -0400)
GtkFrame, GtkComboBox, GtkExpander, GtkMenu, GtkWrapBox

These are all the examples I could find so far.

https://bugzilla.gnome.org/show_bug.cgi?id=628829

gtk/gtkcombobox.c
gtk/gtkexpander.c
gtk/gtkframe.c
gtk/gtkmenu.c
gtk/gtkwrapbox.c

index 629861c802190a9c2156c84aabb02b02470f0169..6059e1e4451871c9390a270bbcda40681f5c8557 100644 (file)
@@ -6172,8 +6172,8 @@ gtk_combo_box_get_height (GtkSizeRequest      *widget,
 
   /* Combo box is height-for-width only 
    * (so we always just reserve enough height for the minimum width) */
-  gtk_size_request_get_width (widget, &min_width, NULL);
-  gtk_size_request_get_height_for_width (widget, min_width, minimum_size, natural_size);
+  GTK_SIZE_REQUEST_GET_IFACE (widget)->get_width (widget, &min_width, NULL);
+  GTK_SIZE_REQUEST_GET_IFACE (widget)->get_height_for_width (widget, min_width, minimum_size, natural_size);
 }
 
 static void
@@ -6184,7 +6184,7 @@ gtk_combo_box_get_width_for_height (GtkSizeRequest        *widget,
 {
   /* Combo box is height-for-width only 
    * (so we assume we always reserved enough height for the minimum width) */
-  gtk_size_request_get_width (widget, minimum_size, natural_size);
+  GTK_SIZE_REQUEST_GET_IFACE (widget)->get_width (widget, minimum_size, natural_size);
 }
 
 
index 735419eb74be39cbab683ab69978d97a66747467..bedab00d1e2cab2c9c5000b74b9c7f8376446d90 100644 (file)
@@ -1495,8 +1495,7 @@ gtk_expander_get_width_for_height (GtkSizeRequest *widget,
                                   gint      *minimum_width,
                                   gint      *natural_width)
 {
-  gtk_size_request_get_width (widget, minimum_width, natural_width);
-  //GTK_SIZE_REQUEST_GET_IFACE (widget)->get_width (widget, minimum_width, natural_width);
+  GTK_SIZE_REQUEST_GET_IFACE (widget)->get_width (widget, minimum_width, natural_width);
 }
 
 
index 8afb35ac9845d9e98ee6f1cf474e65cd65423205..a22c0578b86ba6093d1bd2ab20d978e1ce2ad096 100644 (file)
@@ -925,7 +925,7 @@ gtk_frame_get_width_for_height (GtkSizeRequest *widget,
                                gint      *minimum_width,
                                gint      *natural_width)
 {
-  gtk_size_request_get_width (widget, minimum_width, natural_width);
+  GTK_SIZE_REQUEST_GET_IFACE (widget)->get_width (widget, minimum_width, natural_width);
 }
 
 static void
index 0a4575cb8a30924fd3aaa664a34cea803a1ae602..acc00d09e9894ec1308aa1bd3fa2f531a10bbbe0 100644 (file)
@@ -3150,8 +3150,8 @@ gtk_menu_get_height (GtkSizeRequest      *widget,
   gint min_width;
 
   /* Menus are height-for-width only, just return the height for the minimum width */
-  gtk_size_request_get_width (widget, &min_width, NULL);
-  gtk_size_request_get_height_for_width (widget, min_width, minimum_size, natural_size);
+  GTK_SIZE_REQUEST_GET_IFACE (widget)->get_width (widget, &min_width, NULL);
+  GTK_SIZE_REQUEST_GET_IFACE (widget)->get_height_for_width (widget, min_width, minimum_size, natural_size);
 }
 
 static void
index df9f35e000e98fdab6ae8b51985d4f250b66c440..4611105654804b41de592c43677f8dfd6aeb60bb 100644 (file)
@@ -1527,8 +1527,8 @@ gtk_wrap_box_get_width (GtkSizeRequest      *widget,
       /* Return the width for the minimum height */
       gint min_height;
 
-      gtk_size_request_get_height (widget, &min_height, NULL);
-      gtk_size_request_get_width_for_height (widget, min_height, &min_width, &nat_width);
+      GTK_SIZE_REQUEST_GET_IFACE (widget)->get_height (widget, &min_height, NULL);
+      GTK_SIZE_REQUEST_GET_IFACE (widget)->get_width_for_height (widget, min_height, &min_width, &nat_width);
 
     }
 
@@ -1559,8 +1559,8 @@ gtk_wrap_box_get_height (GtkSizeRequest      *widget,
       /* Return the height for the minimum width */
       gint min_width;
 
-      gtk_size_request_get_width (widget, &min_width, NULL);
-      gtk_size_request_get_height_for_width (widget, min_width, &min_height, &nat_height);
+      GTK_SIZE_REQUEST_GET_IFACE (widget)->get_width (widget, &min_width, NULL);
+      GTK_SIZE_REQUEST_GET_IFACE (widget)->get_height_for_width (widget, min_width, &min_height, &nat_height);
     }
   else /* GTK_ORIENTATION_VERTICAL */
     {
@@ -1637,7 +1637,7 @@ gtk_wrap_box_get_height_for_width (GtkSizeRequest      *widget,
       gint min_width;
 
       /* Make sure its no smaller than the minimum */
-      gtk_size_request_get_width (widget, &min_width, NULL);
+      GTK_SIZE_REQUEST_GET_IFACE (widget)->get_width (widget, &min_width, NULL);
 
       border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
 
@@ -1771,7 +1771,7 @@ gtk_wrap_box_get_height_for_width (GtkSizeRequest      *widget,
   else /* GTK_ORIENTATION_VERTICAL */
     {
       /* Return the minimum height */
-      gtk_size_request_get_height (widget, &min_height, &nat_height);
+      GTK_SIZE_REQUEST_GET_IFACE (widget)->get_height (widget, &min_height, &nat_height);
     }
 
   if (minimum_height)
@@ -1803,14 +1803,14 @@ gtk_wrap_box_get_width_for_height (GtkSizeRequest      *widget,
   if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
     {
       /* Return the minimum width */
-      gtk_size_request_get_width (widget, &min_width, &nat_width);
+      GTK_SIZE_REQUEST_GET_IFACE (widget)->get_width (widget, &min_width, &nat_width);
     }
   else /* GTK_ORIENTATION_VERTICAL */
     {
       gint min_height;
 
       /* Make sure its no smaller than the minimum */
-      gtk_size_request_get_height (widget, &min_height, NULL);
+      GTK_SIZE_REQUEST_GET_IFACE (widget)->get_height (widget, &min_height, NULL);
 
       border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));