forked from enlightenment/efl
efl/gesture: add touch_count property for gesture event info
this allows us to provide the number of touch points active in any gesture so we can detect e.g., double-tap with two fingers Reviewed-by: woochan lee <wc0917.lee@samsung.com> Differential Revision: https://phab.enlightenment.org/D11126
This commit is contained in:
parent
aaaae57bf4
commit
38641ecd9b
|
@ -1,3 +1,4 @@
|
|||
#define EFL_CANVAS_GESTURE_PROTECTED
|
||||
#include "efl_canvas_gesture_private.h"
|
||||
|
||||
#define MY_CLASS EFL_CANVAS_GESTURE_CLASS
|
||||
|
@ -46,5 +47,17 @@ _efl_canvas_gesture_timestamp_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_
|
|||
return pd->timestamp;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_canvas_gesture_touch_count_set(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Data *pd, unsigned int touch_count)
|
||||
{
|
||||
pd->touch_count = touch_count;
|
||||
}
|
||||
|
||||
EOLIAN static unsigned int
|
||||
_efl_canvas_gesture_touch_count_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Data *pd)
|
||||
{
|
||||
return pd->touch_count;
|
||||
}
|
||||
|
||||
#include "efl_canvas_gesture.eo.c"
|
||||
#include "efl_canvas_gesture_events.eo.c"
|
||||
|
|
|
@ -46,5 +46,15 @@ abstract @beta Efl.Canvas.Gesture extends Efl.Object
|
|||
timestamp: uint;[[The time-stamp.]]
|
||||
}
|
||||
}
|
||||
@property touch_count {
|
||||
[[The current number of touch points recorded in the gesture.]]
|
||||
get {
|
||||
}
|
||||
set @protected {
|
||||
}
|
||||
values {
|
||||
touch_count: uint;[[The count of the touch points.]]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#define EFL_CANVAS_GESTURE_PROTECTED
|
||||
#include "efl_canvas_gesture_private.h"
|
||||
|
||||
#define MY_CLASS EFL_CANVAS_GESTURE_MANAGER_CLASS
|
||||
|
@ -192,6 +193,9 @@ _efl_canvas_gesture_manager_filter_event(void *data, Eo *target, void *event)
|
|||
if (!gesture)
|
||||
continue;
|
||||
|
||||
/* this is the "default" value for the event, recognizers may modify it if necessary */
|
||||
efl_gesture_touch_count_set(gesture, efl_gesture_touch_points_count_get(touch_event));
|
||||
|
||||
//Gesture detecting.
|
||||
recog_result = efl_gesture_recognizer_recognize(recognizer, gesture, target, touch_event);
|
||||
recog_state = recog_result & EFL_GESTURE_RECOGNIZER_RESULT_RESULT_MASK;
|
||||
|
|
|
@ -130,6 +130,7 @@ struct _Efl_Canvas_Gesture_Data
|
|||
Efl_Canvas_Gesture_State state;
|
||||
Eina_Position2D hotspot;
|
||||
unsigned int timestamp;
|
||||
unsigned int touch_count;
|
||||
};
|
||||
|
||||
struct _Efl_Canvas_Gesture_Momentum_Data
|
||||
|
|
|
@ -122,6 +122,12 @@ _efl_canvas_gesture_touch_multi_touch_get(const Eo *obj EINA_UNUSED, Efl_Canvas_
|
|||
return pd->multi_touch;
|
||||
}
|
||||
|
||||
EOLIAN static unsigned int
|
||||
_efl_canvas_gesture_touch_touch_points_count_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Touch_Data *pd)
|
||||
{
|
||||
return pd->touch_down;
|
||||
}
|
||||
|
||||
EOLIAN static const Efl_Gesture_Touch_Point_Data *
|
||||
_efl_canvas_gesture_touch_cur_data_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Touch_Data *pd)
|
||||
{
|
||||
|
|
|
@ -60,6 +60,14 @@ class @beta Efl.Canvas.Gesture_Touch extends Efl.Object
|
|||
return: bool; [[returns $true if its a multi touch]]
|
||||
}
|
||||
}
|
||||
@property touch_points_count {
|
||||
[[This provides the number of touch points active.]]
|
||||
get {
|
||||
}
|
||||
values {
|
||||
touch_count: uint; [[The number of active touch points.]]
|
||||
}
|
||||
}
|
||||
@property state {
|
||||
[[This property holds the state of the touch event.]]
|
||||
get {
|
||||
|
|
Loading…
Reference in New Issue