[gtk+] gtkoffscreenbox.c: Replace size_request by get_preferred_width/height



commit f427d6998d899c0a976f1c2fe678756cfa5c6d11
Author: Javier Jardón <jjardon gnome org>
Date:   Wed Nov 17 22:57:45 2010 +0100

    gtkoffscreenbox.c: Replace size_request by get_preferred_width/height

 tests/gtkoffscreenbox.c |   35 ++++++++++++++++++++++++++++++++---
 1 files changed, 32 insertions(+), 3 deletions(-)
---
diff --git a/tests/gtkoffscreenbox.c b/tests/gtkoffscreenbox.c
index 1c19fd9..a23a8bf 100644
--- a/tests/gtkoffscreenbox.c
+++ b/tests/gtkoffscreenbox.c
@@ -11,8 +11,12 @@
 
 static void        gtk_offscreen_box_realize       (GtkWidget       *widget);
 static void        gtk_offscreen_box_unrealize     (GtkWidget       *widget);
-static void        gtk_offscreen_box_size_request  (GtkWidget       *widget,
-                                                    GtkRequisition  *requisition);
+static void        gtk_offscreen_box_get_preferred_width  (GtkWidget *widget,
+                                                           gint      *minimum,
+                                                           gint      *maximum);
+static void        gtk_offscreen_box_get_preferred_height (GtkWidget *widget,
+                                                           gint      *minimum,
+                                                           gint      *maximum);
 static void        gtk_offscreen_box_size_allocate (GtkWidget       *widget,
                                                     GtkAllocation   *allocation);
 static gboolean    gtk_offscreen_box_damage        (GtkWidget       *widget,
@@ -119,7 +123,8 @@ gtk_offscreen_box_class_init (GtkOffscreenBoxClass *klass)
 
   widget_class->realize = gtk_offscreen_box_realize;
   widget_class->unrealize = gtk_offscreen_box_unrealize;
-  widget_class->size_request = gtk_offscreen_box_size_request;
+  widget_class->get_preferred_width = gtk_offscreen_box_get_preferred_width;
+  widget_class->get_preferred_height = gtk_offscreen_box_get_preferred_height;
   widget_class->size_allocate = gtk_offscreen_box_size_allocate;
   widget_class->draw = gtk_offscreen_box_draw;
 
@@ -518,6 +523,30 @@ gtk_offscreen_box_size_request (GtkWidget      *widget,
 }
 
 static void
+gtk_offscreen_box_get_preferred_width (GtkWidget *widget,
+                                       gint      *minimum,
+                                       gint      *natural)
+{
+  GtkRequisition requisition;
+
+  gtk_offscreen_box_size_request (widget, &requisition);
+
+  *minimum = *natural = requisition.width;
+}
+
+static void
+gtk_offscreen_box_get_preferred_height (GtkWidget *widget,
+                                        gint      *minimum,
+                                        gint      *natural)
+{
+  GtkRequisition requisition;
+
+  gtk_offscreen_box_size_request (widget, &requisition);
+
+  *minimum = *natural = requisition.height;
+}
+
+static void
 gtk_offscreen_box_size_allocate (GtkWidget     *widget,
 				 GtkAllocation *allocation)
 {



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