[gtk+] layout: Work around deprecation warnings



commit c9b1e00c30e486cddcc4a5e833ac35abdcd795d1
Author: Benjamin Otte <otte redhat com>
Date:   Tue Nov 8 14:55:46 2011 +0100

    layout: Work around deprecation warnings

 gtk/gtklayout.c |   67 ++++++++++++++++++++++++++++++++-----------------------
 1 files changed, 39 insertions(+), 28 deletions(-)
---
diff --git a/gtk/gtklayout.c b/gtk/gtklayout.c
index f9ac989..0f9cfed 100644
--- a/gtk/gtklayout.c
+++ b/gtk/gtklayout.c
@@ -322,26 +322,12 @@ gtk_layout_finalize (GObject *object)
   G_OBJECT_CLASS (gtk_layout_parent_class)->finalize (object);
 }
 
-/**
- * gtk_layout_set_hadjustment:
- * @layout: a #GtkLayout
- * @adjustment: (allow-none): new scroll adjustment
- *
- * Sets the horizontal scroll adjustment for the layout.
- *
- * See #GtkScrolledWindow, #GtkScrollbar, #GtkAdjustment for details.
- *
- * Deprecated: 3.0: Use gtk_scrollable_set_hadjustment()
- **/
-void
-gtk_layout_set_hadjustment (GtkLayout     *layout,
-                            GtkAdjustment *adjustment)
+static void
+gtk_layout_do_set_hadjustment (GtkLayout     *layout,
+                               GtkAdjustment *adjustment)
 {
   GtkLayoutPrivate *priv;
 
-  g_return_if_fail (GTK_IS_LAYOUT (layout));
-  g_return_if_fail (adjustment == NULL || GTK_IS_ADJUSTMENT (adjustment));
-
   priv = layout->priv;
 
   if (adjustment && priv->hadjustment == adjustment)
@@ -366,27 +352,33 @@ gtk_layout_set_hadjustment (GtkLayout     *layout,
   g_object_notify (G_OBJECT (layout), "hadjustment");
 }
 
-
 /**
- * gtk_layout_set_vadjustment:
+ * gtk_layout_set_hadjustment:
  * @layout: a #GtkLayout
  * @adjustment: (allow-none): new scroll adjustment
  *
- * Sets the vertical scroll adjustment for the layout.
+ * Sets the horizontal scroll adjustment for the layout.
  *
  * See #GtkScrolledWindow, #GtkScrollbar, #GtkAdjustment for details.
  *
- * Deprecated: 3.0: Use gtk_scrollable_set_vadjustment()
+ * Deprecated: 3.0: Use gtk_scrollable_set_hadjustment()
  **/
 void
-gtk_layout_set_vadjustment (GtkLayout     *layout,
+gtk_layout_set_hadjustment (GtkLayout     *layout,
                             GtkAdjustment *adjustment)
 {
-  GtkLayoutPrivate *priv;
-
   g_return_if_fail (GTK_IS_LAYOUT (layout));
   g_return_if_fail (adjustment == NULL || GTK_IS_ADJUSTMENT (adjustment));
 
+  gtk_layout_do_set_hadjustment (layout, adjustment);
+}
+
+static void
+gtk_layout_do_set_vadjustment (GtkLayout     *layout,
+                               GtkAdjustment *adjustment)
+{
+  GtkLayoutPrivate *priv;
+
   priv = layout->priv;
 
   if (adjustment && priv->vadjustment == adjustment)
@@ -411,6 +403,27 @@ gtk_layout_set_vadjustment (GtkLayout     *layout,
   g_object_notify (G_OBJECT (layout), "vadjustment");
 }
 
+/**
+ * gtk_layout_set_vadjustment:
+ * @layout: a #GtkLayout
+ * @adjustment: (allow-none): new scroll adjustment
+ *
+ * Sets the vertical scroll adjustment for the layout.
+ *
+ * See #GtkScrolledWindow, #GtkScrollbar, #GtkAdjustment for details.
+ *
+ * Deprecated: 3.0: Use gtk_scrollable_set_vadjustment()
+ **/
+void
+gtk_layout_set_vadjustment (GtkLayout     *layout,
+                            GtkAdjustment *adjustment)
+{
+  g_return_if_fail (GTK_IS_LAYOUT (layout));
+  g_return_if_fail (adjustment == NULL || GTK_IS_ADJUSTMENT (adjustment));
+
+  gtk_layout_do_set_vadjustment (layout, adjustment);
+}
+
 static GtkLayoutChild*
 get_child (GtkLayout  *layout,
            GtkWidget  *widget)
@@ -735,12 +748,10 @@ gtk_layout_set_property (GObject      *object,
   switch (prop_id)
     {
     case PROP_HADJUSTMENT:
-      gtk_layout_set_hadjustment (layout, 
-				  (GtkAdjustment*) g_value_get_object (value));
+      gtk_layout_do_set_hadjustment (layout, g_value_get_object (value));
       break;
     case PROP_VADJUSTMENT:
-      gtk_layout_set_vadjustment (layout, 
-				  (GtkAdjustment*) g_value_get_object (value));
+      gtk_layout_do_set_vadjustment (layout, g_value_get_object (value));
       break;
     case PROP_HSCROLL_POLICY:
       priv->hscroll_policy = g_value_get_enum (value);



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