[gtk+] Fix more SizeRequest implementations to avoid recursive calls to wrapper API



commit c29f0a13924daf7df1d6787ecba840e8a79e8b6f
Author: Havoc Pennington <hp pobox com>
Date:   Sun Sep 5 22:19:31 2010 -0400

    Fix more SizeRequest implementations to avoid recursive calls to wrapper API
    
    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 |    6 +++---
 gtk/gtkexpander.c |    3 +--
 gtk/gtkframe.c    |    2 +-
 gtk/gtkmenu.c     |    4 ++--
 gtk/gtkwrapbox.c  |   16 ++++++++--------
 5 files changed, 15 insertions(+), 16 deletions(-)
---
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index 629861c..6059e1e 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -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);
 }
 
 
diff --git a/gtk/gtkexpander.c b/gtk/gtkexpander.c
index 735419e..bedab00 100644
--- a/gtk/gtkexpander.c
+++ b/gtk/gtkexpander.c
@@ -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);
 }
 
 
diff --git a/gtk/gtkframe.c b/gtk/gtkframe.c
index 8afb35a..a22c057 100644
--- a/gtk/gtkframe.c
+++ b/gtk/gtkframe.c
@@ -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
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index 0a4575c..acc00d0 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -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
diff --git a/gtk/gtkwrapbox.c b/gtk/gtkwrapbox.c
index df9f35e..4611105 100644
--- a/gtk/gtkwrapbox.c
+++ b/gtk/gtkwrapbox.c
@@ -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));
 



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