From 591b37d7ced7eb857afd75e570318fb0a51e07e1 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Thu, 27 Aug 2009 21:12:32 +0200 Subject: Add accessors for sealed member "flippable" One step closer to makes GtkRange properly subclassable, but still quite some accessors missing. --- gtk/gtkrange.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'gtk/gtkrange.c') diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c index ce4e5e4282..17c0d6f43a 100644 --- a/gtk/gtkrange.c +++ b/gtk/gtkrange.c @@ -843,6 +843,52 @@ gtk_range_get_inverted (GtkRange *range) return range->inverted; } +/** + * gtk_range_set_flippable: + * @range: a #GtkRange + * @flippable: %TRUE to make the range flippable + * + * If a range is flippable, it will switch its direction if it is + * horizontal and its direction is %GTK_TEXT_DIR_RTL. + * + * See gtk_widget_get_direction(). + * + * Since: 2.18 + **/ +void +gtk_range_set_flippable (GtkRange *range, + gboolean flippable) +{ + g_return_if_fail (GTK_IS_RANGE (range)); + + flippable = flippable ? TRUE : FALSE; + + if (flippable != range->flippable) + { + range->flippable = flippable; + + gtk_widget_queue_draw (GTK_WIDGET (range)); + } +} + +/** + * gtk_range_get_flippable: + * @range: a #GtkRange + * + * Gets the value set by gtk_range_set_flippable(). + * + * Return value: %TRUE if the range is flippable + * + * Since: 2.18 + **/ +gboolean +gtk_range_get_flippable (GtkRange *range) +{ + g_return_val_if_fail (GTK_IS_RANGE (range), FALSE); + + return range->flippable; +} + /** * gtk_range_set_lower_stepper_sensitivity: * @range: a #GtkRange -- cgit v1.2.1