forked from enlightenment/efl
efl/gesture: formatting
some parts of this were entirely unreadable due to mixed tabs/spaces and other bizarre formatting issues which somehow made it into the tree Differential Revision: https://phab.enlightenment.org/D11053
This commit is contained in:
parent
f849c9637e
commit
c357bcc6dd
|
@ -28,7 +28,6 @@ _efl_canvas_gesture_hotspot_set(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Data *pd
|
||||||
pd->hotspot = hotspot;
|
pd->hotspot = hotspot;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
EOLIAN static Eina_Position2D
|
EOLIAN static Eina_Position2D
|
||||||
_efl_canvas_gesture_hotspot_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Data *pd)
|
_efl_canvas_gesture_hotspot_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Data *pd)
|
||||||
{
|
{
|
||||||
|
@ -41,7 +40,6 @@ _efl_canvas_gesture_timestamp_set(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Data *
|
||||||
pd->timestamp = timestamp;
|
pd->timestamp = timestamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
EOLIAN static unsigned int
|
EOLIAN static unsigned int
|
||||||
_efl_canvas_gesture_timestamp_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Data *pd)
|
_efl_canvas_gesture_timestamp_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Data *pd)
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,8 +28,8 @@ typedef struct _Efl_Canvas_Gesture_Manager_Data
|
||||||
|
|
||||||
static void _cleanup_cached_gestures(Efl_Canvas_Gesture_Manager_Data *pd,
|
static void _cleanup_cached_gestures(Efl_Canvas_Gesture_Manager_Data *pd,
|
||||||
Eo *target, const Efl_Event_Description *type);
|
Eo *target, const Efl_Event_Description *type);
|
||||||
static Efl_Canvas_Gesture*
|
static Efl_Canvas_Gesture *
|
||||||
_get_state(Efl_Canvas_Gesture_Manager_Data *pd, Eo *target,
|
_get_state(Efl_Canvas_Gesture_Manager_Data *pd, Eo *target,
|
||||||
Efl_Canvas_Gesture_Recognizer *recognizer, const Efl_Event_Description *type);
|
Efl_Canvas_Gesture_Recognizer *recognizer, const Efl_Event_Description *type);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -131,7 +131,7 @@ _efl_canvas_gesture_manager_callback_add_hook(void *data, Eo *target, const Efl_
|
||||||
{
|
{
|
||||||
Efl_Canvas_Gesture_Manager_Data *pd = data;
|
Efl_Canvas_Gesture_Manager_Data *pd = data;
|
||||||
//If there is a recognizer registered for that event then add it to the gesture context
|
//If there is a recognizer registered for that event then add it to the gesture context
|
||||||
Efl_Canvas_Gesture_Recognizer *recognizer = eina_hash_find (pd->m_recognizers, &type);
|
Efl_Canvas_Gesture_Recognizer *recognizer = eina_hash_find(pd->m_recognizers, &type);
|
||||||
if (recognizer)
|
if (recognizer)
|
||||||
{
|
{
|
||||||
//Add it to the gesture context.
|
//Add it to the gesture context.
|
||||||
|
@ -144,7 +144,7 @@ _efl_canvas_gesture_manager_callback_del_hook(void *data, Eo *target, const Efl_
|
||||||
{
|
{
|
||||||
Efl_Canvas_Gesture_Manager_Data *pd = data;
|
Efl_Canvas_Gesture_Manager_Data *pd = data;
|
||||||
//If there is a recognizer registered for that event then add it to the gesture context
|
//If there is a recognizer registered for that event then add it to the gesture context
|
||||||
Efl_Canvas_Gesture_Recognizer *recognizer = eina_hash_find (pd->m_recognizers, &type);
|
Efl_Canvas_Gesture_Recognizer *recognizer = eina_hash_find(pd->m_recognizers, &type);
|
||||||
if (recognizer)
|
if (recognizer)
|
||||||
{
|
{
|
||||||
eina_hash_list_remove(pd->m_gesture_contex, &target, type);
|
eina_hash_list_remove(pd->m_gesture_contex, &target, type);
|
||||||
|
@ -242,7 +242,6 @@ post_event:
|
||||||
//FIXME: delete it by object not list.
|
//FIXME: delete it by object not list.
|
||||||
_cleanup_object(pd->m_gestures_to_delete);
|
_cleanup_object(pd->m_gestures_to_delete);
|
||||||
pd->m_gestures_to_delete = NULL;
|
pd->m_gestures_to_delete = NULL;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -282,7 +281,7 @@ _efl_canvas_gesture_manager_recognizer_unregister(Eo *obj EINA_UNUSED, Efl_Canva
|
||||||
|
|
||||||
//Find the type of the recognizer
|
//Find the type of the recognizer
|
||||||
dummy = efl_gesture_recognizer_add(recognizer, 0);
|
dummy = efl_gesture_recognizer_add(recognizer, 0);
|
||||||
if (!dummy)return;
|
if (!dummy) return;
|
||||||
|
|
||||||
type = _efl_gesture_type_get(dummy);
|
type = _efl_gesture_type_get(dummy);
|
||||||
efl_del(dummy);
|
efl_del(dummy);
|
||||||
|
@ -318,36 +317,43 @@ _find_match_recognizer(Efl_Canvas_Gesture_Manager_Data *pd, Efl_Canvas_Gesture_R
|
||||||
event_type = EFL_EVENT_GESTURE_TAP;
|
event_type = EFL_EVENT_GESTURE_TAP;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case EFL_GESTURE_RECOGNIZER_TYPE_DOUBLETAP:
|
case EFL_GESTURE_RECOGNIZER_TYPE_DOUBLETAP:
|
||||||
{
|
{
|
||||||
event_type = EFL_EVENT_GESTURE_DOUBLE_TAP;
|
event_type = EFL_EVENT_GESTURE_DOUBLE_TAP;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case EFL_GESTURE_RECOGNIZER_TYPE_TRIPLETAP:
|
case EFL_GESTURE_RECOGNIZER_TYPE_TRIPLETAP:
|
||||||
{
|
{
|
||||||
event_type = EFL_EVENT_GESTURE_TRIPLE_TAP;
|
event_type = EFL_EVENT_GESTURE_TRIPLE_TAP;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case EFL_GESTURE_RECOGNIZER_TYPE_LONGTAP:
|
case EFL_GESTURE_RECOGNIZER_TYPE_LONGTAP:
|
||||||
{
|
{
|
||||||
event_type = EFL_EVENT_GESTURE_LONG_TAP;
|
event_type = EFL_EVENT_GESTURE_LONG_TAP;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case EFL_GESTURE_RECOGNIZER_TYPE_MOMENTUM:
|
case EFL_GESTURE_RECOGNIZER_TYPE_MOMENTUM:
|
||||||
{
|
{
|
||||||
event_type = EFL_EVENT_GESTURE_MOMENTUM;
|
event_type = EFL_EVENT_GESTURE_MOMENTUM;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case EFL_GESTURE_RECOGNIZER_TYPE_FLICK:
|
case EFL_GESTURE_RECOGNIZER_TYPE_FLICK:
|
||||||
{
|
{
|
||||||
event_type = EFL_EVENT_GESTURE_FLICK;
|
event_type = EFL_EVENT_GESTURE_FLICK;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case EFL_GESTURE_RECOGNIZER_TYPE_ZOOM:
|
case EFL_GESTURE_RECOGNIZER_TYPE_ZOOM:
|
||||||
{
|
{
|
||||||
event_type = EFL_EVENT_GESTURE_ZOOM;
|
event_type = EFL_EVENT_GESTURE_ZOOM;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -386,7 +392,7 @@ _efl_canvas_gesture_manager_recognizer_get(Eo *obj EINA_UNUSED, Efl_Canvas_Gestu
|
||||||
// }
|
// }
|
||||||
|
|
||||||
//Get or create a gesture object that will represent the state for a given object, used by the recognizer
|
//Get or create a gesture object that will represent the state for a given object, used by the recognizer
|
||||||
Efl_Canvas_Gesture*
|
Efl_Canvas_Gesture *
|
||||||
_get_state(Efl_Canvas_Gesture_Manager_Data *pd,
|
_get_state(Efl_Canvas_Gesture_Manager_Data *pd,
|
||||||
Eo *target, Efl_Canvas_Gesture_Recognizer *recognizer, const Efl_Event_Description *type)
|
Eo *target, Efl_Canvas_Gesture_Recognizer *recognizer, const Efl_Event_Description *type)
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,7 +13,6 @@ EOLIAN static void
|
||||||
_efl_canvas_gesture_recognizer_reset(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Recognizer_Data *pd EINA_UNUSED,
|
_efl_canvas_gesture_recognizer_reset(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Recognizer_Data *pd EINA_UNUSED,
|
||||||
Efl_Canvas_Gesture *gesture EINA_UNUSED)
|
Efl_Canvas_Gesture *gesture EINA_UNUSED)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static Efl_Object *
|
EOLIAN static Efl_Object *
|
||||||
|
|
|
@ -113,9 +113,9 @@ _efl_canvas_gesture_recognizer_double_tap_efl_canvas_gesture_recognizer_recogniz
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case EFL_GESTURE_TOUCH_STATE_END:
|
case EFL_GESTURE_TOUCH_STATE_END:
|
||||||
{
|
{
|
||||||
|
|
||||||
if (efl_gesture_state_get(gesture) != EFL_GESTURE_STATE_NONE &&
|
if (efl_gesture_state_get(gesture) != EFL_GESTURE_STATE_NONE &&
|
||||||
!efl_gesture_touch_multi_touch_get(event))
|
!efl_gesture_touch_multi_touch_get(event))
|
||||||
{
|
{
|
||||||
|
|
|
@ -135,8 +135,8 @@ _angle_get(Evas_Coord xx1,
|
||||||
if (xx2 < xx1) rt = 180;
|
if (xx2 < xx1) rt = 180;
|
||||||
else rt = 0.0;
|
else rt = 0.0;
|
||||||
}
|
}
|
||||||
else
|
else /* Vertical line */
|
||||||
{ /* Vertical line */
|
{
|
||||||
if (yy2 < yy1) rt = 90;
|
if (yy2 < yy1) rt = 90;
|
||||||
else rt = 270;
|
else rt = 270;
|
||||||
}
|
}
|
||||||
|
@ -153,7 +153,6 @@ _angle_get(Evas_Coord xx1,
|
||||||
return rt;
|
return rt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_vector_get(Eina_Position2D v1,
|
_vector_get(Eina_Position2D v1,
|
||||||
Eina_Position2D v2,
|
Eina_Position2D v2,
|
||||||
|
@ -262,7 +261,6 @@ _efl_canvas_gesture_recognizer_flick_efl_canvas_gesture_recognizer_recognize(Eo
|
||||||
|
|
||||||
if (pd->line_length >= line_min_length)
|
if (pd->line_length >= line_min_length)
|
||||||
fd->angle = pd->line_angle = angle;
|
fd->angle = pd->line_angle = angle;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pd->t_end)
|
if (pd->t_end)
|
||||||
|
|
|
@ -67,7 +67,6 @@ _efl_canvas_gesture_recognizer_long_tap_efl_canvas_gesture_recognizer_recognize(
|
||||||
else
|
else
|
||||||
timeout = pd->start_timeout;
|
timeout = pd->start_timeout;
|
||||||
|
|
||||||
|
|
||||||
switch (efl_gesture_touch_state_get(event))
|
switch (efl_gesture_touch_state_get(event))
|
||||||
{
|
{
|
||||||
case EFL_GESTURE_TOUCH_STATE_BEGIN:
|
case EFL_GESTURE_TOUCH_STATE_BEGIN:
|
||||||
|
|
|
@ -25,7 +25,6 @@ _tap_timeout_cb(void *data)
|
||||||
return ECORE_CALLBACK_CANCEL;
|
return ECORE_CALLBACK_CANCEL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
EOLIAN static Efl_Canvas_Gesture_Recognizer_Result
|
EOLIAN static Efl_Canvas_Gesture_Recognizer_Result
|
||||||
_efl_canvas_gesture_recognizer_tap_efl_canvas_gesture_recognizer_recognize(Eo *obj,
|
_efl_canvas_gesture_recognizer_tap_efl_canvas_gesture_recognizer_recognize(Eo *obj,
|
||||||
Efl_Canvas_Gesture_Recognizer_Tap_Data *pd,
|
Efl_Canvas_Gesture_Recognizer_Tap_Data *pd,
|
||||||
|
|
|
@ -113,9 +113,9 @@ _efl_canvas_gesture_recognizer_triple_tap_efl_canvas_gesture_recognizer_recogniz
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case EFL_GESTURE_TOUCH_STATE_END:
|
case EFL_GESTURE_TOUCH_STATE_END:
|
||||||
{
|
{
|
||||||
|
|
||||||
if (efl_gesture_state_get(gesture) != EFL_GESTURE_STATE_NONE &&
|
if (efl_gesture_state_get(gesture) != EFL_GESTURE_STATE_NONE &&
|
||||||
!efl_gesture_touch_multi_touch_get(event))
|
!efl_gesture_touch_multi_touch_get(event))
|
||||||
{
|
{
|
||||||
|
|
|
@ -67,7 +67,7 @@ _zoom_compute(Efl_Canvas_Gesture_Recognizer_Zoom_Data *pd,
|
||||||
//unsigned int tm_end = (pd->zoom_mv.cur.timestamp > pd->zoom_mv1.cur.timestamp) ?
|
//unsigned int tm_end = (pd->zoom_mv.cur.timestamp > pd->zoom_mv1.cur.timestamp) ?
|
||||||
// pd->zoom_mv.cur.timestamp : pd->zoom_mv1.cur.timestamp;
|
// pd->zoom_mv.cur.timestamp : pd->zoom_mv1.cur.timestamp;
|
||||||
|
|
||||||
int x,y; //Hot spot
|
int x, y; //Hot spot
|
||||||
Evas_Coord diam = _finger_gap_length_get(xx1, yy1, xx2, yy2,
|
Evas_Coord diam = _finger_gap_length_get(xx1, yy1, xx2, yy2,
|
||||||
&x, &y);
|
&x, &y);
|
||||||
|
|
||||||
|
@ -172,6 +172,7 @@ _efl_canvas_gesture_recognizer_zoom_efl_canvas_gesture_recognizer_recognize(Eo *
|
||||||
}
|
}
|
||||||
EINA_FALLTHROUGH;
|
EINA_FALLTHROUGH;
|
||||||
}
|
}
|
||||||
|
|
||||||
case EFL_GESTURE_TOUCH_STATE_BEGIN:
|
case EFL_GESTURE_TOUCH_STATE_BEGIN:
|
||||||
{
|
{
|
||||||
if (td->touch_down > 2)
|
if (td->touch_down > 2)
|
||||||
|
@ -194,7 +195,7 @@ _efl_canvas_gesture_recognizer_zoom_efl_canvas_gesture_recognizer_recognize(Eo *
|
||||||
memcpy(&pd->zoom_mv, p2, sizeof(Pointer_Data));
|
memcpy(&pd->zoom_mv, p2, sizeof(Pointer_Data));
|
||||||
memcpy(&pd->zoom_mv1, p1, sizeof(Pointer_Data));
|
memcpy(&pd->zoom_mv1, p1, sizeof(Pointer_Data));
|
||||||
|
|
||||||
int x,y; //Hot spot
|
int x, y; //Hot spot
|
||||||
zd->zoom = 1.0;
|
zd->zoom = 1.0;
|
||||||
pd->zoom_base = _finger_gap_length_get(pd->zoom_st1.cur.pos.x,
|
pd->zoom_base = _finger_gap_length_get(pd->zoom_st1.cur.pos.x,
|
||||||
pd->zoom_st1.cur.pos.y,
|
pd->zoom_st1.cur.pos.y,
|
||||||
|
@ -221,7 +222,6 @@ _efl_canvas_gesture_recognizer_zoom_efl_canvas_gesture_recognizer_recognize(Eo *
|
||||||
pd->zoom_mv.cur.pos.y, pd->zoom_mv1.cur.pos.x,
|
pd->zoom_mv.cur.pos.y, pd->zoom_mv1.cur.pos.x,
|
||||||
pd->zoom_mv1.cur.pos.y, pd->zoom_finger_factor);
|
pd->zoom_mv1.cur.pos.y, pd->zoom_finger_factor);
|
||||||
|
|
||||||
|
|
||||||
if (!pd->zoom_distance_tolerance)
|
if (!pd->zoom_distance_tolerance)
|
||||||
{
|
{
|
||||||
double d = zd->zoom - pd->next_step;
|
double d = zd->zoom - pd->next_step;
|
||||||
|
@ -238,6 +238,7 @@ _efl_canvas_gesture_recognizer_zoom_efl_canvas_gesture_recognizer_recognize(Eo *
|
||||||
|
|
||||||
return EFL_GESTURE_RECOGNIZER_RESULT_IGNORE;
|
return EFL_GESTURE_RECOGNIZER_RESULT_IGNORE;
|
||||||
}
|
}
|
||||||
|
|
||||||
case EFL_GESTURE_TOUCH_STATE_END:
|
case EFL_GESTURE_TOUCH_STATE_END:
|
||||||
{
|
{
|
||||||
if (td->touch_down == 0)
|
if (td->touch_down == 0)
|
||||||
|
|
|
@ -6,7 +6,8 @@
|
||||||
//that are directed to a particular object from the
|
//that are directed to a particular object from the
|
||||||
//first finger down to the last finger up
|
//first finger down to the last finger up
|
||||||
|
|
||||||
static void _hash_free_cb(Pointer_Data *point)
|
static void
|
||||||
|
_hash_free_cb(Pointer_Data *point)
|
||||||
{
|
{
|
||||||
free(point);
|
free(point);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue