jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=d7b8d97fd5259decb94d553e34c263cdff8ebf22

commit d7b8d97fd5259decb94d553e34c263cdff8ebf22
Author: Jean-Philippe Andre <jp.an...@samsung.com>
Date:   Thu Sep 1 18:34:10 2016 +0900

    evas events: Add "raw" x,y values for future extensions
    
    For pen tablets, this exposes the values as given by the driver
    (quite useless without knowledge of the device itself).
    
    For mice, this exposes x,y as set by the display manager, without
    any extra processing in terms of smoothing or prediction. IOW
    this returns the same as x,y until a smoothing algorithm is
    implemented (todo).
---
 src/lib/efl/interfaces/efl_common_internal.h |  4 ++++
 src/lib/efl/interfaces/efl_input_types.eot   | 14 ++++++++++++--
 src/lib/evas/canvas/efl_input_pointer.c      | 10 ++++++++++
 3 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/src/lib/efl/interfaces/efl_common_internal.h 
b/src/lib/efl/interfaces/efl_common_internal.h
index 4af02c1..dd1b29e 100644
--- a/src/lib/efl/interfaces/efl_common_internal.h
+++ b/src/lib/efl/interfaces/efl_common_internal.h
@@ -33,6 +33,10 @@ struct _Efl_Input_Pointer_Data
    double          radius, radius_x, radius_y;
    double          pressure, distance, azimuth, tilt, twist;
    double          angle;
+   /* current, previous positions in window coordinates.
+    * raw can be either un-smoothed, un-predicted x,y or a tablet's raw input.
+    * norm is the normalized value in [0..1] for tablet input.
+    */
    Eina_Vector2    cur, prev, raw, norm;
    struct {
       Efl_Orient   dir;
diff --git a/src/lib/efl/interfaces/efl_input_types.eot 
b/src/lib/efl/interfaces/efl_input_types.eot
index fdd9df2..60f0833 100644
--- a/src/lib/efl/interfaces/efl_input_types.eot
+++ b/src/lib/efl/interfaces/efl_input_types.eot
@@ -88,15 +88,25 @@ enum Efl.Input.Value {
    tool,       [[ID of the finger or tool (eg. pen) that triggered this event.
                  Prefer the property $tool to read this value. Default: 0.]]
    x,          [[Absolute X position where this event occurred, in pixels.
-                 Relative to the window. Default: last known position.]]
+                 Relative to the window. Default: last known position.
+                 This value may be smoothed out or even extrapolated by EFL.]]
    y,          [[Absolute Y position where this event occurred, in pixels.
-                 Relative to the window. Default: last known position.]]
+                 Relative to the window. Default: last known position.
+                 This value may be smoothed out or even extrapolated by EFL.]]
    dx,         [[Relative X movement, in pixels. Range: unbounded. Default: 
0.]]
    dy,         [[Relative Y movement, in pixels. Range: unbounded. Default: 
0.]]
    previous_x, [[Previous X position of the pointer, in pixels.
                  Default: last known position, may be equal to x.]]
    previous_y, [[Previous Y position of the pointer, in pixels.
                  Default: last known position, may be equal to y.]]
+   raw_x,      [[Absolute X position where this event occurred. Default: 0.
+                 This value will be set from the hardware input without any
+                 smoothing or extrapolation. For an axis input event, this is
+                 the raw value set by the driver (undefined range and unit).]]
+   raw_y,      [[Absolute X position where this event occurred. Default: 0.
+                 This value will be set from the hardware input without any
+                 smoothing or extrapolation. For an axis input event, this is
+                 the raw value set by the driver (undefined range and unit).]]
    radius,     [[Average radius of the pressed area under a finger or tool,
                  in pixels. Default is 1.]]
    radius_x,   [[Spread over X of the pressed area under a finger or tool,
diff --git a/src/lib/evas/canvas/efl_input_pointer.c 
b/src/lib/evas/canvas/efl_input_pointer.c
index cfbb6a0..2214871 100644
--- a/src/lib/evas/canvas/efl_input_pointer.c
+++ b/src/lib/evas/canvas/efl_input_pointer.c
@@ -525,6 +525,16 @@ _efl_input_pointer_value_get(Eo *obj EINA_UNUSED, 
Efl_Input_Pointer_Data *pd, Ef
       case EFL_INPUT_VALUE_PREVIOUS_Y:
         return pd->prev.y;
 
+      case EFL_INPUT_VALUE_RAW_X:
+        if (!_efl_input_value_has(pd, EFL_INPUT_VALUE_RAW_X))
+          return pd->cur.x;
+        return pd->raw.x;
+
+      case EFL_INPUT_VALUE_RAW_Y:
+        if (!_efl_input_value_has(pd, EFL_INPUT_VALUE_RAW_Y))
+          return pd->cur.y;
+        return pd->raw.y;
+
       case EFL_INPUT_VALUE_RADIUS:
         return pd->radius;
 

-- 


Reply via email to