diff options
author | Benjamin Otte <otte@redhat.com> | 2011-11-08 14:55:46 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2011-11-08 21:14:05 +0100 |
commit | c9b1e00c30e486cddcc4a5e833ac35abdcd795d1 (patch) | |
tree | c7f2f58d9007fc6395ab8d0063ecccd97cda0dc1 /gtk/gtklayout.c | |
parent | f9c664c69bf079d804821fe15ea3253b508532b2 (diff) | |
download | gtk+-c9b1e00c30e486cddcc4a5e833ac35abdcd795d1.tar.gz |
layout: Work around deprecation warnings
Diffstat (limited to 'gtk/gtklayout.c')
-rw-r--r-- | gtk/gtklayout.c | 67 |
1 files changed, 39 insertions, 28 deletions
diff --git a/gtk/gtklayout.c b/gtk/gtklayout.c index f9ac989e9a..0f9cfed09b 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); |