adjustment: Add private gtk_adjustment_get_target_value() method

This call returns either the target value if there is an ongoing animation,
or the current value if there is no animation.
This commit is contained in:
Carlos Garnacho 2014-07-08 15:13:31 +02:00 committed by Matthias Clasen
parent 75b71869ae
commit ee0982ffe3
2 changed files with 12 additions and 0 deletions

View File

@ -428,6 +428,17 @@ gtk_adjustment_get_value (GtkAdjustment *adjustment)
return adjustment->priv->value;
}
gdouble
gtk_adjustment_get_target_value (GtkAdjustment *adjustment)
{
g_return_val_if_fail (GTK_IS_ADJUSTMENT (adjustment), 0.0);
if (adjustment->priv->tick_id)
return adjustment->priv->target;
else
return adjustment->priv->value;
}
static void
adjustment_set_value (GtkAdjustment *adjustment,
gdouble value)

View File

@ -29,6 +29,7 @@ void gtk_adjustment_enable_animation (GtkAdjustment *adjustment,
guint duration);
void gtk_adjustment_animate_to_value (GtkAdjustment *adjustment,
gdouble value);
gdouble gtk_adjustment_get_target_value (GtkAdjustment *adjustment);
G_END_DECLS