[gtk+/adjustment-animation-fixes: 1/5] adjustment: Add private gtk_adjustment_get_target_value() method
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/adjustment-animation-fixes: 1/5] adjustment: Add private gtk_adjustment_get_target_value() method
- Date: Tue, 8 Jul 2014 18:01:40 +0000 (UTC)
commit 0d9acd12d8061f9daa00f3b5d56ff7782f03a3b5
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Jul 8 15:13:31 2014 +0200
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.
gtk/gtkadjustment.c | 11 +++++++++++
gtk/gtkadjustmentprivate.h | 1 +
2 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkadjustment.c b/gtk/gtkadjustment.c
index 8cab120..6ae5405 100644
--- a/gtk/gtkadjustment.c
+++ b/gtk/gtkadjustment.c
@@ -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)
diff --git a/gtk/gtkadjustmentprivate.h b/gtk/gtkadjustmentprivate.h
index b36f13f..72ecaff 100644
--- a/gtk/gtkadjustmentprivate.h
+++ b/gtk/gtkadjustmentprivate.h
@@ -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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]