touchpad: change motion history to typesafe coords
authorPeter Hutterer <peter.hutterer@who-t.net>
Tue, 10 Mar 2015 23:10:13 +0000 (09:10 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Mon, 16 Mar 2015 23:01:39 +0000 (09:01 +1000)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
src/evdev-mt-touchpad.c
src/evdev-mt-touchpad.h

index 8808850..ebe611f 100644 (file)
@@ -46,7 +46,7 @@ tp_hysteresis(int in, int center, int margin)
                return center + diff + margin;
 }
 
-static inline struct tp_motion *
+static inline struct device_coords *
 tp_motion_history_offset(struct tp_touch *t, int offset)
 {
        int offset_index =
index aa6de69..ec8c8b1 100644 (file)
@@ -122,11 +122,6 @@ enum tp_edge_scroll_touch_state {
        EDGE_SCROLL_TOUCH_STATE_AREA,
 };
 
-struct tp_motion {
-       int32_t x;
-       int32_t y;
-};
-
 struct tp_touch {
        struct tp_dispatch *tp;
        enum touch_state state;
@@ -137,7 +132,7 @@ struct tp_touch {
        uint64_t millis;
 
        struct {
-               struct tp_motion samples[TOUCHPAD_HISTORY_LENGTH];
+               struct device_coords samples[TOUCHPAD_HISTORY_LENGTH];
                unsigned int index;
                unsigned int count;
        } history;