efl/gesture: remove gesture_touch::multi_touch

this is redundant now that touch_count exists

ref T8554

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D11274
This commit is contained in:
Mike Blumenkrantz 2020-02-03 12:10:31 -05:00 committed by Marcel Hollerbach
parent 28b7ea6f0c
commit a136ab2e00
9 changed files with 15 additions and 25 deletions

View File

@ -14,6 +14,7 @@
const Efl_Event_Description * _efl_gesture_type_get(const Eo *obj);
int _direction_get(Evas_Coord xx1, Evas_Coord xx2);
Eina_Value *_recognizer_config_get(const Eo *obj, const char *name);
Eina_Bool _event_multi_touch_get(const Efl_Canvas_Gesture_Touch *event);
typedef struct _Efl_Canvas_Gesture_Manager_Data Efl_Canvas_Gesture_Manager_Data;
typedef struct _Efl_Canvas_Gesture_Recognizer_Data Efl_Canvas_Gesture_Recognizer_Data;
@ -37,7 +38,6 @@ typedef struct _Efl_Canvas_Gesture_Touch_Data
Eina_Array *touch_points;
Efl_Gesture_Touch_Point_Data *cur_touch;
Efl_Gesture_Touch_Point_Data *prev_touch;
Eina_Bool multi_touch;
Eo *target;
int touch_down;
} Efl_Canvas_Gesture_Touch_Data;

View File

@ -40,4 +40,10 @@ _direction_get(Evas_Coord xx1, Evas_Coord xx2)
return 0;
}
Eina_Bool
_event_multi_touch_get(const Efl_Canvas_Gesture_Touch *event)
{
return efl_gesture_touch_points_count_get(event) > 1;
}
#include "efl_canvas_gesture_recognizer.eo.c"

View File

@ -100,7 +100,7 @@ _efl_canvas_gesture_recognizer_double_tap_efl_canvas_gesture_recognizer_recogniz
result = EFL_GESTURE_RECOGNIZER_RESULT_IGNORE;
if (efl_gesture_state_get(gesture) != EFL_GESTURE_STATE_NONE &&
!efl_gesture_touch_multi_touch_get(event))
!_event_multi_touch_get(event))
{
dist = efl_gesture_touch_distance(event, 0);
length = fabs(dist.x) + fabs(dist.y);
@ -125,7 +125,7 @@ _efl_canvas_gesture_recognizer_double_tap_efl_canvas_gesture_recognizer_recogniz
case EFL_GESTURE_TOUCH_STATE_END:
{
if (efl_gesture_state_get(gesture) != EFL_GESTURE_STATE_NONE &&
!efl_gesture_touch_multi_touch_get(event))
!_event_multi_touch_get(event))
{
if (efl_gesture_touch_prev_data_get(event))
{

View File

@ -89,7 +89,7 @@ _efl_canvas_gesture_recognizer_long_tap_efl_canvas_gesture_recognizer_recognize(
dist = efl_gesture_touch_distance(event, 0);
length = fabs(dist.x) + fabs(dist.y);
if ((efl_gesture_touch_multi_touch_get(event)) || (length > pd->finger_size))
if ((_event_multi_touch_get(event)) || (length > pd->finger_size))
{
if (pd->timeout)
{
@ -116,7 +116,7 @@ _efl_canvas_gesture_recognizer_long_tap_efl_canvas_gesture_recognizer_recognize(
}
if (efl_gesture_state_get(gesture) != EFL_GESTURE_STATE_NONE &&
!efl_gesture_touch_multi_touch_get(event))
!_event_multi_touch_get(event))
{
dist = efl_gesture_touch_distance(event, 0);
length = fabs(dist.x) + fabs(dist.y);

View File

@ -77,7 +77,7 @@ new_tap:
ecore_timer_del(pd->timeout);
pd->timeout = NULL;
}
if (efl_gesture_touch_multi_touch_get(event)) return EFL_GESTURE_RECOGNIZER_RESULT_IGNORE;
if (_event_multi_touch_get(event)) return EFL_GESTURE_RECOGNIZER_RESULT_IGNORE;
if (efl_gesture_state_get(gesture) != EFL_GESTURE_STATE_NONE)
{
dist = efl_gesture_touch_distance(event, 0);

View File

@ -99,7 +99,7 @@ _efl_canvas_gesture_recognizer_triple_tap_efl_canvas_gesture_recognizer_recogniz
result = EFL_GESTURE_RECOGNIZER_RESULT_IGNORE;
if (efl_gesture_state_get(gesture) != EFL_GESTURE_STATE_NONE &&
!efl_gesture_touch_multi_touch_get(event))
!_event_multi_touch_get(event))
{
dist = efl_gesture_touch_distance(event, 0);
length = fabs(dist.x) + fabs(dist.y);
@ -124,7 +124,7 @@ _efl_canvas_gesture_recognizer_triple_tap_efl_canvas_gesture_recognizer_recogniz
case EFL_GESTURE_TOUCH_STATE_END:
{
if (efl_gesture_state_get(gesture) != EFL_GESTURE_STATE_NONE &&
!efl_gesture_touch_multi_touch_get(event))
!_event_multi_touch_get(event))
{
if (efl_gesture_touch_prev_data_get(event))
{

View File

@ -201,7 +201,7 @@ _efl_canvas_gesture_recognizer_zoom_efl_canvas_gesture_recognizer_recognize(Eo *
if (!pd->zoom_st.cur.timestamp) /* Now scan touched-devices list
* and find other finger */
{
if (!efl_gesture_touch_multi_touch_get(event))
if (!_event_multi_touch_get(event))
return EFL_GESTURE_RECOGNIZER_RESULT_IGNORE;
const Efl_Gesture_Touch_Point_Data *p1 = efl_gesture_touch_data_get(event, 0);

View File

@ -58,16 +58,12 @@ _efl_canvas_gesture_touch_point_record(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_T
{
if ((!point) || (!point->cur.pressed))
pd->touch_down++;
if (pd->touch_down >= 2)
pd->multi_touch = EINA_TRUE;
}
else if ((action == EFL_POINTER_ACTION_UP) ||
(action == EFL_POINTER_ACTION_CANCEL))
{
if (point && point->cur.pressed)
pd->touch_down--;
if (pd->multi_touch && pd->touch_down == 1)
pd->multi_touch = EINA_FALSE;
}
if (pd->touch_down < 0) goto finished_touch;
@ -122,12 +118,6 @@ finished_touch:
_touch_points_reset(pd);
}
EOLIAN static Eina_Bool
_efl_canvas_gesture_touch_multi_touch_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Touch_Data *pd)
{
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)
{

View File

@ -54,12 +54,6 @@ class @beta Efl.Canvas.Gesture_Touch extends Efl.Object
time: uint; [[The timestamp.]]
}
}
@property multi_touch {
[[This property tells if the event is multi touch.]]
get {
return: bool; [[returns $true if its a multi touch]]
}
}
@property touch_points_count {
[[This provides the number of touch points active.]]
get {