[gtk+/native-layout] native-layout: Don't expose extra gtk_widget_* function that are similar to the GtkExtendedLayout in



commit 972436628981cb8cf16091db69b0e6e91d82448f
Author: Johannes Schmid <jhs gnome org>
Date:   Mon Dec 14 16:28:56 2009 +0100

    native-layout: Don't expose extra gtk_widget_* function that are similar to the GtkExtendedLayout interface

 gtk/gtkbox.c    |   16 ++++++------
 gtk/gtkwidget.c |   70 ++++++++++++++++++++++++++++--------------------------
 gtk/gtkwidget.h |    8 ------
 3 files changed, 44 insertions(+), 50 deletions(-)
---
diff --git a/gtk/gtkbox.c b/gtk/gtkbox.c
index f8dc28f..ba357ad 100644
--- a/gtk/gtkbox.c
+++ b/gtk/gtkbox.c
@@ -482,15 +482,15 @@ gtk_box_size_allocate (GtkWidget     *widget,
               if (GTK_WIDGET_VISIBLE (child->widget))
                 {
                   if (private->orientation == GTK_ORIENTATION_HORIZONTAL)
-                    gtk_widget_get_width_for_height (child->widget,
-                                                     allocation->height,
-                                                     &sizes[i].minimum_size,
-                                                     &sizes[i].natural_size);
+                    gtk_extended_layout_get_width_for_height (GTK_EXTENDED_LAYOUT (child->widget),
+                                                              allocation->height,
+                                                              &sizes[i].minimum_size,
+                                                              &sizes[i].natural_size);
                   else
-                    gtk_widget_get_height_for_width (child->widget,
-                                                     allocation->width,
-                                                     &sizes[i].minimum_size,
-                                                     &sizes[i].natural_size);
+                    gtk_extended_layout_get_width_for_height (GTK_EXTENDED_LAYOUT (child->widget),
+                                                                                   allocation->width,
+                                                                                   &sizes[i].minimum_size,
+                                                                                   &sizes[i].natural_size);
 
                   size -= sizes[i].minimum_size;
 
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 787ef27..1e819c5 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -10593,41 +10593,21 @@ gtk_widget_real_get_desired_size (GtkExtendedLayout *layout,
     *natural_size = requisition;
 }
 
-/**
- * gtk_widget_get_desired_size:
- * @widget: a #GtkWidget
- * @minimum_size: location for storing the @widget's minimum size, or %NULL
- * @natural_size: location for storing the @widget's preferred size, or %NULL
- *
- * Retreives a widget's desired size, considering restrictions imposed by
- * #GtkSizeGroup<!-- -->s. See also: gtk_extended_layout_get_desired_size().
- *
- * Since: 2.20
- */
-void
-gtk_widget_get_desired_size (GtkWidget      *widget,
-                             GtkRequisition *minimum_size,
-                             GtkRequisition *natural_size)
-{
-  g_return_if_fail (GTK_IS_WIDGET (widget));
-  _gtk_size_group_compute_desired_size (widget, minimum_size, natural_size);
-}
-
-void
-gtk_widget_get_height_for_width (GtkWidget *widget,
-                                 gint       width,
-                                 gint      *minimum_height,
-                                 gint      *natural_height)
+static void
+gtk_widget_real_get_height_for_width (GtkExtendedLayout *layout,
+                                      gint       width,
+                                      gint      *minimum_height,
+                                      gint      *natural_height)
 {
   GtkRequisition minimum_size;
   GtkRequisition natural_size;
 
-  g_return_if_fail (GTK_IS_WIDGET (widget));
+  g_return_if_fail (GTK_IS_WIDGET (layout));
 
 #if 0
   TODO: integrate height-for-width with size-groups
 #else
-  gtk_widget_get_desired_size (widget,
+  gtk_widget_get_desired_size (GTK_WIDGET(layout),
                                minimum_height ? &minimum_size : NULL,
                                natural_height ? &natural_size : NULL);
 
@@ -10638,21 +10618,21 @@ gtk_widget_get_height_for_width (GtkWidget *widget,
 #endif
 }
 
-void
-gtk_widget_get_width_for_height (GtkWidget *widget,
-                                 gint       height,
-                                 gint      *minimum_width,
-                                 gint      *natural_width)
+static void
+gtk_widget_real_get_width_for_height (GtkExtendedLayout *layout,
+                                      gint       height,
+                                      gint      *minimum_width,
+                                      gint      *natural_width)
 {
   GtkRequisition minimum_size;
   GtkRequisition natural_size;
  
-  g_return_if_fail (GTK_IS_WIDGET (widget));
+  g_return_if_fail (GTK_IS_WIDGET (layout));
 
 #if 0
   TODO: integrate width-for-height with size-groups
 #else
-  gtk_widget_get_desired_size (widget,
+  gtk_widget_get_desired_size (GTK_WIDGET(layout),
                                minimum_width ? &minimum_size : NULL,
                                natural_width ? &natural_size : NULL);
 
@@ -10663,10 +10643,32 @@ gtk_widget_get_width_for_height (GtkWidget *widget,
 #endif
 }
 
+/**
+ * gtk_widget_get_desired_size:
+ * @widget: a #GtkWidget
+ * @minimum_size: location for storing the @widget's minimum size, or %NULL
+ * @natural_size: location for storing the @widget's preferred size, or %NULL
+ *
+ * Retreives a widget's desired size, considering restrictions imposed by
+ * #GtkSizeGroup<!-- -->s. See also: gtk_extended_layout_get_desired_size().
+ *
+ * Since: 2.20
+ */
+void
+gtk_widget_get_desired_size (GtkWidget      *widget,
+                             GtkRequisition *minimum_size,
+                             GtkRequisition *natural_size)
+{
+  g_return_if_fail (GTK_IS_WIDGET (widget));
+  _gtk_size_group_compute_desired_size (widget, minimum_size, natural_size);
+}
+
 static void
 gtk_widget_layout_interface_init (GtkExtendedLayoutIface *iface)
 {
   iface->get_desired_size = gtk_widget_real_get_desired_size;
+  iface->get_width_for_height = gtk_widget_real_get_width_for_height;
+  iface->get_height_for_width = gtk_widget_real_get_height_for_width;  
 }
  
  
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index 7fd86d6..9e4c97d 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -777,14 +777,6 @@ void	   gtk_widget_size_allocate	  (GtkWidget	       *widget,
 void       gtk_widget_get_desired_size    (GtkWidget           *widget,
 					   GtkRequisition      *minimum_size,
 					   GtkRequisition      *natural_size);
-void       gtk_widget_get_height_for_width(GtkWidget           *widget,
-					   gint                 width,
-					   gint                *minimum_height,
-					   gint                *natural_height);
-void       gtk_widget_get_width_for_height(GtkWidget           *widget,
-					   gint                 height,
-					   gint                *minimum_width,
-					   gint                *natural_width);
 void       gtk_widget_get_child_requisition (GtkWidget	       *widget,
 					     GtkRequisition    *requisition);
 void	   gtk_widget_add_accelerator	  (GtkWidget           *widget,



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