diff options
author | Michael Natterer <mitch@gimp.org> | 2009-08-27 21:12:32 +0200 |
---|---|---|
committer | Michael Natterer <mitch@gimp.org> | 2009-08-27 21:14:21 +0200 |
commit | 591b37d7ced7eb857afd75e570318fb0a51e07e1 (patch) | |
tree | e3b91704d845cf98c5dd9d26cb9321a67b492bc6 /gtk | |
parent | d30c31d6e1f9391dbe320db0e5ebc110801d03a2 (diff) | |
download | gtk+-591b37d7ced7eb857afd75e570318fb0a51e07e1.tar.gz |
Add accessors for sealed member "flippable"
One step closer to makes GtkRange properly subclassable, but still
quite some accessors missing.
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtk.symbols | 2 | ||||
-rw-r--r-- | gtk/gtkrange.c | 46 | ||||
-rw-r--r-- | gtk/gtkrange.h | 4 |
3 files changed, 52 insertions, 0 deletions
diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols index a276bf8878..89e32400e4 100644 --- a/gtk/gtk.symbols +++ b/gtk/gtk.symbols @@ -3294,6 +3294,7 @@ gtk_radio_tool_button_set_group #if IN_FILE(__GTK_RANGE_C__) gtk_range_get_adjustment gtk_range_get_fill_level +gtk_range_get_flippable gtk_range_get_inverted gtk_range_get_lower_stepper_sensitivity gtk_range_get_restrict_to_fill_level @@ -3304,6 +3305,7 @@ gtk_range_get_upper_stepper_sensitivity gtk_range_get_value gtk_range_set_adjustment gtk_range_set_fill_level +gtk_range_set_flippable gtk_range_set_increments gtk_range_set_inverted gtk_range_set_lower_stepper_sensitivity diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c index ce4e5e4282..17c0d6f43a 100644 --- a/gtk/gtkrange.c +++ b/gtk/gtkrange.c @@ -844,6 +844,52 @@ gtk_range_get_inverted (GtkRange *range) } /** + * 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 * @sensitivity: the lower stepper's sensitivity policy. diff --git a/gtk/gtkrange.h b/gtk/gtkrange.h index f7f3b96aa7..268a5223e1 100644 --- a/gtk/gtkrange.h +++ b/gtk/gtkrange.h @@ -147,6 +147,10 @@ void gtk_range_set_inverted (GtkRange *range gboolean setting); gboolean gtk_range_get_inverted (GtkRange *range); +void gtk_range_set_flippable (GtkRange *range, + gboolean flippable); +gboolean gtk_range_get_flippable (GtkRange *range); + void gtk_range_set_lower_stepper_sensitivity (GtkRange *range, GtkSensitivityType sensitivity); GtkSensitivityType gtk_range_get_lower_stepper_sensitivity (GtkRange *range); |