[gtk+/wip/events: 14/16] xxx: sequence tracker
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/events: 14/16] xxx: sequence tracker
- Date: Sat, 10 Mar 2012 16:41:00 +0000 (UTC)
commit f353210ed8de6980ec682a21b70a5d6a940c392d
Author: Benjamin Otte <otte redhat com>
Date: Sat Mar 10 17:26:45 2012 +0100
xxx: sequence tracker
gtk/gtksequencetracker.c | 18 ++++++++++++++++++
gtk/gtksequencetrackerprivate.h | 5 +++++
2 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtksequencetracker.c b/gtk/gtksequencetracker.c
index bfc5f64..4071b42 100644
--- a/gtk/gtksequencetracker.c
+++ b/gtk/gtksequencetracker.c
@@ -257,3 +257,21 @@ _gtk_sequence_tracker_get_direction (GtkSequenceTracker *tracker)
return tracker->history[tracker->history_index].dir;
}
+
+void
+_gtk_sequence_tracker_compute_distance (GtkSequenceTracker *from,
+ GtkSequenceTracker *to,
+ double *x,
+ double *y)
+{
+ g_return_if_fail (from != NULL);
+ g_return_if_fail (to != NULL);
+ g_return_if_fail (from->klass == to->klass);
+ /* XXX: compare devices here? */
+
+ if (x)
+ *x = from->history[from->history_index].x - to->history[to->history_index].x;
+ if (y)
+ *y = from->history[from->history_index].y - to->history[to->history_index].y;
+}
+
diff --git a/gtk/gtksequencetrackerprivate.h b/gtk/gtksequencetrackerprivate.h
index 5ad632f..76d7bdf 100644
--- a/gtk/gtksequencetrackerprivate.h
+++ b/gtk/gtksequencetrackerprivate.h
@@ -47,6 +47,11 @@ double _gtk_sequence_tracker_get_y_offset (GtkSequenceTrac
GtkMovementDirection _gtk_sequence_tracker_get_direction (GtkSequenceTracker *tracker);
+void _gtk_sequence_tracker_compute_distance (GtkSequenceTracker *from,
+ GtkSequenceTracker *to,
+ double *x,
+ double *y);
+
G_END_DECLS
#endif /* __GTK_SEQUENCE_TRACKER_PRIVATE_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]