forked from enlightenment/efl
Efl.Gesture: rename to Efl.Canvas.Gesture
most C api remains unchanged ref T6714 ref T6716
This commit is contained in:
parent
a0a80fc74a
commit
bbbdfbecc4
|
@ -55,12 +55,12 @@ evas_canvas_eolian_pub_files = \
|
|||
$(NULL)
|
||||
|
||||
evas_gesture_eolian_pub_files = \
|
||||
lib/evas/gesture/efl_gesture_touch.eo \
|
||||
lib/evas/gesture/efl_gesture.eo \
|
||||
lib/evas/gesture/efl_gesture_tap.eo \
|
||||
lib/evas/gesture/efl_gesture_long_tap.eo \
|
||||
lib/evas/gesture/efl_gesture_recognizer.eo \
|
||||
lib/evas/gesture/efl_gesture_manager.eo \
|
||||
lib/evas/gesture/efl_canvas_gesture_touch.eo \
|
||||
lib/evas/gesture/efl_canvas_gesture.eo \
|
||||
lib/evas/gesture/efl_canvas_gesture_tap.eo \
|
||||
lib/evas/gesture/efl_canvas_gesture_long_tap.eo \
|
||||
lib/evas/gesture/efl_canvas_gesture_recognizer.eo \
|
||||
lib/evas/gesture/efl_canvas_gesture_manager.eo \
|
||||
$(NULL)
|
||||
|
||||
evas_eolian_legacy_files = \
|
||||
|
@ -78,15 +78,15 @@ evas_canvas_eolian_priv_files = \
|
|||
lib/evas/include/evas_ector_buffer.eo
|
||||
|
||||
evas_gesture_eolian_priv_files = \
|
||||
lib/evas/gesture/efl_gesture_recognizer_tap.eo \
|
||||
lib/evas/gesture/efl_gesture_recognizer_long_tap.eo
|
||||
lib/evas/gesture/efl_canvas_gesture_recognizer_tap.eo \
|
||||
lib/evas/gesture/efl_canvas_gesture_recognizer_long_tap.eo
|
||||
|
||||
evas_canvas_eolian_type_files = \
|
||||
lib/evas/canvas/evas_canvas3d_types.eot \
|
||||
lib/evas/canvas/efl_canvas_animation_types.eot
|
||||
|
||||
evas_gesture_eolian_type_files = \
|
||||
lib/evas/gesture/efl_gesture_types.eot
|
||||
lib/evas/gesture/efl_canvas_gesture_types.eot
|
||||
|
||||
evas_canvas_eolian_priv_c = $(evas_canvas_eolian_priv_files:%.eo=%.eo.c)
|
||||
evas_canvas_eolian_priv_h = $(evas_canvas_eolian_priv_files:%.eo=%.eo.h) \
|
||||
|
@ -182,7 +182,7 @@ lib/evas/canvas/efl_canvas_animation_group_parallel_private.h \
|
|||
lib/evas/canvas/efl_canvas_animation_group_sequential_private.h \
|
||||
lib/evas/canvas/efl_canvas_animation_player_private.h \
|
||||
lib/evas/canvas/evas_stack.x \
|
||||
lib/evas/gesture/efl_gesture_private.h
|
||||
lib/evas/gesture/efl_canvas_gesture_private.h
|
||||
|
||||
# Linebreak
|
||||
|
||||
|
@ -276,14 +276,14 @@ lib/evas/canvas/efl_canvas_animation_group.c \
|
|||
lib/evas/canvas/efl_canvas_animation_group_parallel.c \
|
||||
lib/evas/canvas/efl_canvas_animation_group_sequential.c \
|
||||
lib/evas/canvas/efl_canvas_animation_player.c \
|
||||
lib/evas/gesture/efl_gesture_touch.c \
|
||||
lib/evas/gesture/efl_gesture.c \
|
||||
lib/evas/gesture/efl_gesture_tap.c \
|
||||
lib/evas/gesture/efl_gesture_long_tap.c \
|
||||
lib/evas/gesture/efl_gesture_recognizer.c \
|
||||
lib/evas/gesture/efl_gesture_recognizer_tap.c \
|
||||
lib/evas/gesture/efl_gesture_recognizer_long_tap.c \
|
||||
lib/evas/gesture/efl_gesture_manager.c \
|
||||
lib/evas/gesture/efl_canvas_gesture_touch.c \
|
||||
lib/evas/gesture/efl_canvas_gesture.c \
|
||||
lib/evas/gesture/efl_canvas_gesture_tap.c \
|
||||
lib/evas/gesture/efl_canvas_gesture_long_tap.c \
|
||||
lib/evas/gesture/efl_canvas_gesture_recognizer.c \
|
||||
lib/evas/gesture/efl_canvas_gesture_recognizer_tap.c \
|
||||
lib/evas/gesture/efl_canvas_gesture_recognizer_long_tap.c \
|
||||
lib/evas/gesture/efl_canvas_gesture_manager.c \
|
||||
$(NULL)
|
||||
|
||||
EXTRA_DIST2 += \
|
||||
|
|
|
@ -173,7 +173,7 @@ _color_and_icon_set(infra_data *infra, char *name, int n, int max,
|
|||
|
||||
/* START - Callbacks for gestures */
|
||||
static void
|
||||
finger_tap_start(void *data , Efl_Gesture *tap)
|
||||
finger_tap_start(void *data , Efl_Canvas_Gesture *tap)
|
||||
{
|
||||
Eina_Vector2 pos = efl_gesture_hotspot_get(tap);
|
||||
|
||||
|
@ -182,13 +182,13 @@ finger_tap_start(void *data , Efl_Gesture *tap)
|
|||
}
|
||||
|
||||
static void
|
||||
finger_tap_update(void *data , Efl_Gesture *tap EINA_UNUSED)
|
||||
finger_tap_update(void *data , Efl_Canvas_Gesture *tap EINA_UNUSED)
|
||||
{
|
||||
_color_and_icon_set(data, TAP_NAME, 1, MAX_TAP, UPDATE_COLOR);
|
||||
}
|
||||
|
||||
static void
|
||||
finger_tap_end(void *data , Efl_Gesture *tap)
|
||||
finger_tap_end(void *data , Efl_Canvas_Gesture *tap)
|
||||
{
|
||||
Eina_Vector2 pos = efl_gesture_hotspot_get(tap);
|
||||
|
||||
|
@ -197,14 +197,14 @@ finger_tap_end(void *data , Efl_Gesture *tap)
|
|||
}
|
||||
|
||||
static void
|
||||
finger_tap_abort(void *data , Efl_Gesture *tap EINA_UNUSED)
|
||||
finger_tap_abort(void *data , Efl_Canvas_Gesture *tap EINA_UNUSED)
|
||||
{
|
||||
_color_and_icon_set(data, TAP_NAME, 1, MAX_TAP, ABORT_COLOR);
|
||||
printf("Tap Aborted\n");
|
||||
}
|
||||
|
||||
static void
|
||||
finger_long_tap_start(void *data , Efl_Gesture *tap)
|
||||
finger_long_tap_start(void *data , Efl_Canvas_Gesture *tap)
|
||||
{
|
||||
Eina_Vector2 pos = efl_gesture_hotspot_get(tap);
|
||||
|
||||
|
@ -213,14 +213,14 @@ finger_long_tap_start(void *data , Efl_Gesture *tap)
|
|||
}
|
||||
|
||||
static void
|
||||
finger_long_tap_update(void *data , Efl_Gesture *tap EINA_UNUSED)
|
||||
finger_long_tap_update(void *data , Efl_Canvas_Gesture *tap EINA_UNUSED)
|
||||
{
|
||||
_color_and_icon_set(data, LONG_TAP_NAME, 1, MAX_TAP, UPDATE_COLOR);
|
||||
printf("Long Tap Gesture updated\n");
|
||||
}
|
||||
|
||||
static void
|
||||
finger_long_tap_end(void *data , Efl_Gesture *tap)
|
||||
finger_long_tap_end(void *data , Efl_Canvas_Gesture *tap)
|
||||
{
|
||||
Eina_Vector2 pos = efl_gesture_hotspot_get(tap);
|
||||
|
||||
|
@ -229,7 +229,7 @@ finger_long_tap_end(void *data , Efl_Gesture *tap)
|
|||
}
|
||||
|
||||
static void
|
||||
finger_long_tap_abort(void *data , Efl_Gesture *tap EINA_UNUSED)
|
||||
finger_long_tap_abort(void *data , Efl_Canvas_Gesture *tap EINA_UNUSED)
|
||||
{
|
||||
_color_and_icon_set(data, LONG_TAP_NAME, 1, MAX_TAP, ABORT_COLOR);
|
||||
printf("Long Tap Aborted\n");
|
||||
|
@ -238,7 +238,7 @@ finger_long_tap_abort(void *data , Efl_Gesture *tap EINA_UNUSED)
|
|||
static void
|
||||
tap_gesture_cb(void *data , const Efl_Event *ev)
|
||||
{
|
||||
Efl_Gesture *g = ev->info;
|
||||
Efl_Canvas_Gesture *g = ev->info;
|
||||
switch(efl_gesture_state_get(g))
|
||||
{
|
||||
case EFL_GESTURE_STARTED:
|
||||
|
@ -261,7 +261,7 @@ tap_gesture_cb(void *data , const Efl_Event *ev)
|
|||
static void
|
||||
long_tap_gesture_cb(void *data , const Efl_Event *ev)
|
||||
{
|
||||
Efl_Gesture *g = ev->info;
|
||||
Efl_Canvas_Gesture *g = ev->info;
|
||||
switch(efl_gesture_state_get(g))
|
||||
{
|
||||
case EFL_GESTURE_STARTED:
|
||||
|
|
|
@ -321,11 +321,11 @@ typedef void (Evas_Canvas3D_Surface_Func)(Evas_Real *out_x,
|
|||
#endif /* EFL_EO_API_SUPPORT */
|
||||
|
||||
#ifdef EFL_EO_API_SUPPORT
|
||||
# include "gesture/efl_gesture_types.eot.h"
|
||||
# include "gesture/efl_gesture_touch.eo.h"
|
||||
# include "gesture/efl_gesture.eo.h"
|
||||
# include "gesture/efl_gesture_tap.eo.h"
|
||||
# include "gesture/efl_gesture_long_tap.eo.h"
|
||||
# include "gesture/efl_gesture_recognizer.eo.h"
|
||||
# include "gesture/efl_gesture_manager.eo.h"
|
||||
# include "gesture/efl_canvas_gesture_types.eot.h"
|
||||
# include "gesture/efl_canvas_gesture_touch.eo.h"
|
||||
# include "gesture/efl_canvas_gesture.eo.h"
|
||||
# include "gesture/efl_canvas_gesture_tap.eo.h"
|
||||
# include "gesture/efl_canvas_gesture_long_tap.eo.h"
|
||||
# include "gesture/efl_canvas_gesture_recognizer.eo.h"
|
||||
# include "gesture/efl_canvas_gesture_manager.eo.h"
|
||||
#endif /* EFL_EO_API_SUPPORT */
|
||||
|
|
|
@ -385,7 +385,7 @@ evas_object_event_callback_call(Evas_Object *eo_obj, Evas_Object_Protected_Data
|
|||
type == EVAS_CALLBACK_MULTI_DOWN ||
|
||||
type == EVAS_CALLBACK_MOUSE_UP ||
|
||||
type == EVAS_CALLBACK_MULTI_UP)
|
||||
_efl_gesture_manager_filter_event(e->gesture_manager, eo_obj, event_info);
|
||||
_efl_canvas_gesture_manager_filter_event(e->gesture_manager, eo_obj, event_info);
|
||||
|
||||
if (!_evas_object_callback_has_by_type(obj, type))
|
||||
goto nothing_here;
|
||||
|
@ -708,7 +708,7 @@ _check_event_catcher_add(void *data, const Efl_Event *event)
|
|||
for (i = 0; array[i].desc != NULL; i++)
|
||||
{
|
||||
if (obj->layer->evas->gesture_manager)
|
||||
_efl_gesture_manager_callback_add_hook(obj->layer->evas->gesture_manager, obj->object, array[i].desc);
|
||||
_efl_canvas_gesture_manager_callback_add_hook(obj->layer->evas->gesture_manager, obj->object, array[i].desc);
|
||||
|
||||
if (array[i].desc == EFL_EVENT_ANIMATOR_TICK)
|
||||
{
|
||||
|
@ -735,7 +735,7 @@ _check_event_catcher_del(void *data, const Efl_Event *event)
|
|||
for (i = 0; array[i].desc != NULL; i++)
|
||||
{
|
||||
if (obj->layer->evas->gesture_manager)
|
||||
_efl_gesture_manager_callback_del_hook(obj->layer->evas->gesture_manager, obj->object, array[i].desc);
|
||||
_efl_canvas_gesture_manager_callback_del_hook(obj->layer->evas->gesture_manager, obj->object, array[i].desc);
|
||||
|
||||
if (array[i].desc == EFL_EVENT_ANIMATOR_TICK)
|
||||
{
|
||||
|
|
|
@ -227,7 +227,7 @@ _evas_canvas_efl_object_constructor(Eo *eo_obj, Evas_Public_Data *e)
|
|||
eina_clist_init(&e->calc_list);
|
||||
eina_clist_init(&e->calc_done);
|
||||
|
||||
e->gesture_manager = efl_add(EFL_GESTURE_MANAGER_CLASS, eo_obj);
|
||||
e->gesture_manager = efl_add(EFL_CANVAS_GESTURE_MANAGER_CLASS, eo_obj);
|
||||
|
||||
#define EVAS_ARRAY_SET(E, Array) \
|
||||
eina_array_step_set(&E->Array, sizeof (E->Array), \
|
||||
|
@ -843,7 +843,7 @@ _evas_canvas_efl_object_provider_find(const Eo *eo_e,
|
|||
return (Eo *)eo_e;
|
||||
else if (klass == EFL_LOOP_CLASS)
|
||||
return efl_main_loop_get();
|
||||
else if (klass == EFL_GESTURE_MANAGER_CLASS)
|
||||
else if (klass == EFL_CANVAS_GESTURE_MANAGER_CLASS)
|
||||
return e->gesture_manager;
|
||||
return efl_provider_find(efl_super(eo_e, MY_CLASS), klass);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
#include "efl_canvas_gesture_private.h"
|
||||
|
||||
#define MY_CLASS EFL_CANVAS_GESTURE_CLASS
|
||||
|
||||
EOLIAN static const Efl_Event_Description *
|
||||
_efl_canvas_gesture_type_get(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Data *pd)
|
||||
{
|
||||
return pd->type;
|
||||
}
|
||||
|
||||
EOLIAN static Efl_Canvas_Gesture_State
|
||||
_efl_canvas_gesture_state_get(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Data *pd)
|
||||
{
|
||||
return pd->state;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_canvas_gesture_state_set(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Data *pd, Efl_Canvas_Gesture_State state)
|
||||
{
|
||||
pd->state = state;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_canvas_gesture_hotspot_set(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Data *pd, Eina_Vector2 hotspot)
|
||||
{
|
||||
pd->hotspot = hotspot;
|
||||
}
|
||||
|
||||
|
||||
EOLIAN static Eina_Vector2
|
||||
_efl_canvas_gesture_hotspot_get(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Data *pd)
|
||||
{
|
||||
return pd->hotspot;
|
||||
}
|
||||
|
||||
#include "efl_canvas_gesture.eo.c"
|
|
@ -1,8 +1,9 @@
|
|||
import efl_gesture_types;
|
||||
import efl_canvas_gesture_types;
|
||||
|
||||
abstract Efl.Gesture(Efl.Object)
|
||||
abstract Efl.Canvas.Gesture(Efl.Object)
|
||||
{
|
||||
[[EFL Gesture abstract class]]
|
||||
eo_prefix: efl_gesture;
|
||||
methods {
|
||||
@property type {
|
||||
[[This property holds the type of the gesture.]]
|
||||
|
@ -19,7 +20,7 @@ abstract Efl.Gesture(Efl.Object)
|
|||
set {
|
||||
}
|
||||
values {
|
||||
state: Efl.Gesture.State; [[gesture state]]
|
||||
state: Efl.Canvas.Gesture.State; [[gesture state]]
|
||||
}
|
||||
}
|
||||
@property hotspot {
|
|
@ -0,0 +1,27 @@
|
|||
#include "efl_canvas_gesture_private.h"
|
||||
|
||||
#define MY_CLASS EFL_CANVAS_GESTURE_LONG_TAP_CLASS
|
||||
|
||||
|
||||
EOLIAN static Efl_Object *
|
||||
_efl_canvas_gesture_long_tap_efl_object_constructor(Eo *obj, Efl_Canvas_Gesture_Long_Tap_Data *pd EINA_UNUSED)
|
||||
{
|
||||
Efl_Canvas_Gesture_Data *gd;
|
||||
|
||||
obj = efl_constructor(efl_super(obj, MY_CLASS));
|
||||
gd = efl_data_scope_get(obj, EFL_CANVAS_GESTURE_CLASS);
|
||||
gd->type = EFL_EVENT_GESTURE_LONG_TAP;
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_canvas_gesture_long_tap_efl_object_destructor(Eo *obj, Efl_Canvas_Gesture_Long_Tap_Data *pd)
|
||||
{
|
||||
if (pd->timeout)
|
||||
ecore_timer_del(pd->timeout);
|
||||
|
||||
efl_destructor(efl_super(obj, MY_CLASS));
|
||||
}
|
||||
|
||||
#include "efl_canvas_gesture_long_tap.eo.c"
|
|
@ -1,8 +1,9 @@
|
|||
import efl_gesture_types;
|
||||
import efl_canvas_gesture_types;
|
||||
|
||||
class Efl.Gesture.Long_Tap (Efl.Gesture)
|
||||
class Efl.Canvas.Gesture.Long_Tap (Efl.Canvas.Gesture)
|
||||
{
|
||||
[[EFL Gesture Long Tap class]]
|
||||
eo_prefix: efl_gesture_long_tap;
|
||||
event_prefix: efl;
|
||||
events {
|
||||
gesture,long_tap; [[Event for tap gesture]]
|
|
@ -1,16 +1,16 @@
|
|||
#include "efl_gesture_private.h"
|
||||
#include "efl_canvas_gesture_private.h"
|
||||
|
||||
#define MY_CLASS EFL_GESTURE_MANAGER_CLASS
|
||||
#define MY_CLASS EFL_CANVAS_GESTURE_MANAGER_CLASS
|
||||
|
||||
typedef struct _Object_Gesture
|
||||
{
|
||||
Eo *object;
|
||||
const Efl_Event_Description *type;
|
||||
Efl_Gesture *gesture;
|
||||
Efl_Gesture_Recognizer *recognizer;
|
||||
Efl_Canvas_Gesture *gesture;
|
||||
Efl_Canvas_Gesture_Recognizer *recognizer;
|
||||
}Object_Gesture;
|
||||
|
||||
typedef struct _Efl_Gesture_Manager_Data
|
||||
typedef struct _Efl_Canvas_Gesture_Manager_Data
|
||||
{
|
||||
// keeps track of all the gesture request for a particular target
|
||||
Eina_Hash *m_gesture_contex; // (*target, *event_desc)
|
||||
|
@ -24,13 +24,13 @@ typedef struct _Efl_Gesture_Manager_Data
|
|||
Eina_List *m_gestures_to_delete;
|
||||
|
||||
Eina_Hash *m_config;
|
||||
} Efl_Gesture_Manager_Data;
|
||||
} Efl_Canvas_Gesture_Manager_Data;
|
||||
|
||||
static void _cleanup_cached_gestures(Efl_Gesture_Manager_Data *pd,
|
||||
static void _cleanup_cached_gestures(Efl_Canvas_Gesture_Manager_Data *pd,
|
||||
Eo *target, const Efl_Event_Description *type);
|
||||
static Efl_Gesture*
|
||||
_get_state(Efl_Gesture_Manager_Data *pd, Eo *target,
|
||||
Efl_Gesture_Recognizer *recognizer, const Efl_Event_Description *type);
|
||||
static Efl_Canvas_Gesture*
|
||||
_get_state(Efl_Canvas_Gesture_Manager_Data *pd, Eo *target,
|
||||
Efl_Canvas_Gesture_Recognizer *recognizer, const Efl_Event_Description *type);
|
||||
|
||||
static void
|
||||
_cleanup_object(Eina_List *list)
|
||||
|
@ -53,7 +53,7 @@ _hash_free_cb(Eo *obj)
|
|||
}
|
||||
|
||||
EOLIAN static Efl_Object *
|
||||
_efl_gesture_manager_efl_object_constructor(Eo *obj, Efl_Gesture_Manager_Data *pd EINA_UNUSED)
|
||||
_efl_canvas_gesture_manager_efl_object_constructor(Eo *obj, Efl_Canvas_Gesture_Manager_Data *pd EINA_UNUSED)
|
||||
{
|
||||
obj = efl_constructor(efl_super(obj, MY_CLASS));
|
||||
|
||||
|
@ -65,21 +65,21 @@ _efl_gesture_manager_efl_object_constructor(Eo *obj, Efl_Gesture_Manager_Data *p
|
|||
|
||||
pd->m_config = eina_hash_string_superfast_new(EINA_FREE_CB(eina_value_free));
|
||||
|
||||
efl_gesture_manager_recognizer_register(obj, efl_add(EFL_GESTURE_RECOGNIZER_TAP_CLASS, obj));
|
||||
efl_gesture_manager_recognizer_register(obj, efl_add(EFL_GESTURE_RECOGNIZER_LONG_TAP_CLASS, obj));
|
||||
efl_gesture_manager_recognizer_register(obj, efl_add(EFL_CANVAS_GESTURE_RECOGNIZER_TAP_CLASS, obj));
|
||||
efl_gesture_manager_recognizer_register(obj, efl_add(EFL_CANVAS_GESTURE_RECOGNIZER_LONG_TAP_CLASS, obj));
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
EOLIAN static Eina_Value *
|
||||
_efl_gesture_manager_config_get(Eo *obj EINA_UNUSED, Efl_Gesture_Manager_Data *pd, const char *name)
|
||||
_efl_canvas_gesture_manager_config_get(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Manager_Data *pd, const char *name)
|
||||
{
|
||||
return eina_hash_find(pd->m_config, name);
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_gesture_manager_config_set(Eo *obj EINA_UNUSED, Efl_Gesture_Manager_Data *pd, const char *name, Eina_Value *value)
|
||||
_efl_canvas_gesture_manager_config_set(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Manager_Data *pd, const char *name, Eina_Value *value)
|
||||
{
|
||||
Eina_Value *v = eina_value_new(eina_value_type_get(value));
|
||||
eina_value_copy(value, v);
|
||||
|
@ -87,7 +87,7 @@ _efl_gesture_manager_config_set(Eo *obj EINA_UNUSED, Efl_Gesture_Manager_Data *p
|
|||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_gesture_manager_efl_object_destructor(Eo *obj, Efl_Gesture_Manager_Data *pd EINA_UNUSED)
|
||||
_efl_canvas_gesture_manager_efl_object_destructor(Eo *obj, Efl_Canvas_Gesture_Manager_Data *pd EINA_UNUSED)
|
||||
{
|
||||
eina_hash_free(pd->m_config);
|
||||
eina_hash_free(pd->m_recognizers);
|
||||
|
@ -98,11 +98,11 @@ _efl_gesture_manager_efl_object_destructor(Eo *obj, Efl_Gesture_Manager_Data *pd
|
|||
}
|
||||
|
||||
void
|
||||
_efl_gesture_manager_callback_add_hook(Eo *obj, Eo *target, const Efl_Event_Description *type)
|
||||
_efl_canvas_gesture_manager_callback_add_hook(Eo *obj, Eo *target, const Efl_Event_Description *type)
|
||||
{
|
||||
Efl_Gesture_Manager_Data *pd = efl_data_scope_get(obj, MY_CLASS);
|
||||
Efl_Canvas_Gesture_Manager_Data *pd = efl_data_scope_get(obj, MY_CLASS);
|
||||
// if there is a recognizer registered for that event then add it to the gesture context
|
||||
Efl_Gesture_Recognizer *recognizer = eina_hash_find (pd->m_recognizers, &type);
|
||||
Efl_Canvas_Gesture_Recognizer *recognizer = eina_hash_find (pd->m_recognizers, &type);
|
||||
if (recognizer)
|
||||
{
|
||||
// add it to the gesture context.
|
||||
|
@ -111,11 +111,11 @@ _efl_gesture_manager_callback_add_hook(Eo *obj, Eo *target, const Efl_Event_Desc
|
|||
}
|
||||
|
||||
void
|
||||
_efl_gesture_manager_callback_del_hook(Eo *obj, Eo *target, const Efl_Event_Description *type)
|
||||
_efl_canvas_gesture_manager_callback_del_hook(Eo *obj, Eo *target, const Efl_Event_Description *type)
|
||||
{
|
||||
Efl_Gesture_Manager_Data *pd = efl_data_scope_get(obj, MY_CLASS);
|
||||
Efl_Canvas_Gesture_Manager_Data *pd = efl_data_scope_get(obj, MY_CLASS);
|
||||
// if there is a recognizer registered for that event then add it to the gesture context
|
||||
Efl_Gesture_Recognizer *recognizer = eina_hash_find (pd->m_recognizers, &type);
|
||||
Efl_Canvas_Gesture_Recognizer *recognizer = eina_hash_find (pd->m_recognizers, &type);
|
||||
if (recognizer)
|
||||
{
|
||||
eina_hash_list_remove(pd->m_gesture_contex, &target, type);
|
||||
|
@ -124,16 +124,16 @@ _efl_gesture_manager_callback_del_hook(Eo *obj, Eo *target, const Efl_Event_Desc
|
|||
}
|
||||
|
||||
void
|
||||
_efl_gesture_manager_filter_event(Eo *obj, Eo *target, void *event)
|
||||
_efl_canvas_gesture_manager_filter_event(Eo *obj, Eo *target, void *event)
|
||||
{
|
||||
Eina_List *l, *gesture_context;
|
||||
Efl_Gesture_Manager_Data *pd;
|
||||
Efl_Canvas_Gesture_Manager_Data *pd;
|
||||
const Efl_Event_Description *gesture_type;
|
||||
Efl_Gesture_Recognizer *recognizer;
|
||||
Efl_Gesture *gesture;
|
||||
Efl_Gesture_Recognizer_Result recog_result;
|
||||
Efl_Gesture_Recognizer_Result recog_state;
|
||||
Efl_Gesture_Touch *touch_event;
|
||||
Efl_Canvas_Gesture_Recognizer *recognizer;
|
||||
Efl_Canvas_Gesture *gesture;
|
||||
Efl_Canvas_Gesture_Recognizer_Result recog_result;
|
||||
Efl_Canvas_Gesture_Recognizer_Result recog_state;
|
||||
Efl_Canvas_Gesture_Touch *touch_event;
|
||||
Efl_Input_Pointer_Data *pointer_data = efl_data_scope_get(event, EFL_INPUT_POINTER_CLASS);
|
||||
|
||||
pd = efl_data_scope_get(obj, MY_CLASS);
|
||||
|
@ -144,7 +144,7 @@ _efl_gesture_manager_filter_event(Eo *obj, Eo *target, void *event)
|
|||
touch_event = eina_hash_find(pd->m_object_events, &target);
|
||||
if (!touch_event)
|
||||
{
|
||||
touch_event = efl_add(EFL_GESTURE_TOUCH_CLASS, NULL);
|
||||
touch_event = efl_add(EFL_CANVAS_GESTURE_TOUCH_CLASS, NULL);
|
||||
eina_hash_add(pd->m_object_events, &target, touch_event);
|
||||
}
|
||||
|
||||
|
@ -207,11 +207,11 @@ _efl_gesture_manager_filter_event(Eo *obj, Eo *target, void *event)
|
|||
}
|
||||
|
||||
EOLIAN static const Efl_Event_Description *
|
||||
_efl_gesture_manager_recognizer_register(Eo *obj EINA_UNUSED, Efl_Gesture_Manager_Data *pd,
|
||||
Efl_Gesture_Recognizer *recognizer)
|
||||
_efl_canvas_gesture_manager_recognizer_register(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Manager_Data *pd,
|
||||
Efl_Canvas_Gesture_Recognizer *recognizer)
|
||||
{
|
||||
Efl_Gesture_Recognizer_Data *rpd;
|
||||
Efl_Gesture *dummy = efl_gesture_recognizer_create(recognizer, 0);
|
||||
Efl_Canvas_Gesture_Recognizer_Data *rpd;
|
||||
Efl_Canvas_Gesture *dummy = efl_gesture_recognizer_create(recognizer, 0);
|
||||
|
||||
if (!dummy)
|
||||
return NULL;
|
||||
|
@ -221,7 +221,7 @@ _efl_gesture_manager_recognizer_register(Eo *obj EINA_UNUSED, Efl_Gesture_Manage
|
|||
// Add the recognizer to the m_recognizers
|
||||
eina_hash_add(pd->m_recognizers, &type, recognizer);
|
||||
// update the manager
|
||||
rpd = efl_data_scope_get(recognizer, EFL_GESTURE_RECOGNIZER_CLASS);
|
||||
rpd = efl_data_scope_get(recognizer, EFL_CANVAS_GESTURE_RECOGNIZER_CLASS);
|
||||
rpd->manager = obj;
|
||||
|
||||
efl_del(dummy);
|
||||
|
@ -230,13 +230,13 @@ _efl_gesture_manager_recognizer_register(Eo *obj EINA_UNUSED, Efl_Gesture_Manage
|
|||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_gesture_manager_recognizer_unregister(Eo *obj EINA_UNUSED, Efl_Gesture_Manager_Data *pd,
|
||||
Efl_Gesture_Recognizer *recognizer)
|
||||
_efl_canvas_gesture_manager_recognizer_unregister(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Manager_Data *pd,
|
||||
Efl_Canvas_Gesture_Recognizer *recognizer)
|
||||
{
|
||||
Eina_List *l, *l_next;
|
||||
Object_Gesture *object_gesture;
|
||||
const Efl_Event_Description *type;
|
||||
Efl_Gesture *dummy;
|
||||
Efl_Canvas_Gesture *dummy;
|
||||
|
||||
if (!recognizer) return;
|
||||
|
||||
|
@ -266,7 +266,7 @@ _efl_gesture_manager_recognizer_unregister(Eo *obj EINA_UNUSED, Efl_Gesture_Mana
|
|||
}
|
||||
|
||||
// EOLIAN static void
|
||||
// _efl_gesture_manager_ungrab_all(Eo *obj EINA_UNUSED, Efl_Gesture_Manager_Data *pd,
|
||||
// _efl_canvas_gesture_manager_ungrab_all(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Manager_Data *pd,
|
||||
// Eo *target)
|
||||
// {
|
||||
// const Efl_Event_Description *type;
|
||||
|
@ -284,13 +284,13 @@ _efl_gesture_manager_recognizer_unregister(Eo *obj EINA_UNUSED, Efl_Gesture_Mana
|
|||
// }
|
||||
|
||||
// get or create a gesture object that will represent the state for a given object, used by the recognizer
|
||||
Efl_Gesture*
|
||||
_get_state(Efl_Gesture_Manager_Data *pd,
|
||||
Eo *target, Efl_Gesture_Recognizer *recognizer, const Efl_Event_Description *type)
|
||||
Efl_Canvas_Gesture*
|
||||
_get_state(Efl_Canvas_Gesture_Manager_Data *pd,
|
||||
Eo *target, Efl_Canvas_Gesture_Recognizer *recognizer, const Efl_Event_Description *type)
|
||||
{
|
||||
Eina_List *l;
|
||||
Object_Gesture *object_gesture;
|
||||
Efl_Gesture *gesture;
|
||||
Efl_Canvas_Gesture *gesture;
|
||||
|
||||
// if the widget is being deleted we should be careful not to
|
||||
// create a new state.
|
||||
|
@ -327,7 +327,7 @@ _get_state(Efl_Gesture_Manager_Data *pd,
|
|||
}
|
||||
|
||||
static void
|
||||
_cleanup_cached_gestures(Efl_Gesture_Manager_Data *pd,
|
||||
_cleanup_cached_gestures(Efl_Canvas_Gesture_Manager_Data *pd,
|
||||
Eo *target, const Efl_Event_Description *type)
|
||||
{
|
||||
Eina_List *l, *l_next;
|
||||
|
@ -345,4 +345,4 @@ _cleanup_cached_gestures(Efl_Gesture_Manager_Data *pd,
|
|||
}
|
||||
|
||||
|
||||
#include "efl_gesture_manager.eo.c"
|
||||
#include "efl_canvas_gesture_manager.eo.c"
|
|
@ -1,20 +1,21 @@
|
|||
import efl_gesture_types;
|
||||
import efl_canvas_gesture_types;
|
||||
|
||||
class Efl.Gesture.Manager (Efl.Object)
|
||||
class Efl.Canvas.Gesture.Manager (Efl.Object)
|
||||
{
|
||||
[[EFL Gesture Manager class]]
|
||||
eo_prefix: efl_gesture_manager;
|
||||
methods {
|
||||
recognizer_register {
|
||||
[[This function is called to register a new Efl.Gesture.Recognizer]]
|
||||
[[This function is called to register a new Efl.Canvas.Gesture.Recognizer]]
|
||||
params {
|
||||
@in recognizer: Efl.Gesture.Recognizer; [[The gesture recognizer object]]
|
||||
@in recognizer: Efl.Canvas.Gesture.Recognizer; [[The gesture recognizer object]]
|
||||
}
|
||||
return: ptr(const(Efl.Event.Description)); [[Returns the Efl.Event.Description type the recognizer supports]]
|
||||
}
|
||||
recognizer_unregister {
|
||||
[[This function is called to unregister a Efl.Gesture.Recognizer]]
|
||||
[[This function is called to unregister a Efl.Canvas.Gesture.Recognizer]]
|
||||
params {
|
||||
@in recognizer: Efl.Gesture.Recognizer; [[The gesture recognizer object]]
|
||||
@in recognizer: Efl.Canvas.Gesture.Recognizer; [[The gesture recognizer object]]
|
||||
}
|
||||
}
|
||||
@property config {
|
|
@ -0,0 +1,42 @@
|
|||
#ifndef EFL_GESTURE_PRIVATE_H_
|
||||
#define EFL_GESTURE_PRIVATE_H_
|
||||
|
||||
#include "evas_common_private.h"
|
||||
#include "evas_private.h"
|
||||
#define EFL_INTERNAL_UNSTABLE
|
||||
#include "interfaces/efl_common_internal.h"
|
||||
|
||||
#include <Ecore.h>
|
||||
|
||||
//private gesture classes
|
||||
#include "efl_canvas_gesture_recognizer_tap.eo.h"
|
||||
#include "efl_canvas_gesture_recognizer_long_tap.eo.h"
|
||||
|
||||
typedef struct _Efl_Canvas_Gesture_Recognizer_Data Efl_Canvas_Gesture_Recognizer_Data;
|
||||
typedef struct _Efl_Canvas_Gesture_Data Efl_Canvas_Gesture_Data;
|
||||
typedef struct _Efl_Canvas_Gesture_Tap_Data Efl_Canvas_Gesture_Tap_Data;
|
||||
typedef struct _Efl_Canvas_Gesture_Long_Tap_Data Efl_Canvas_Gesture_Long_Tap_Data;
|
||||
|
||||
struct _Efl_Canvas_Gesture_Recognizer_Data
|
||||
{
|
||||
Eo *manager; // keeps a reference of the manager
|
||||
};
|
||||
|
||||
struct _Efl_Canvas_Gesture_Data
|
||||
{
|
||||
const Efl_Event_Description *type;
|
||||
Efl_Canvas_Gesture_State state;
|
||||
Eina_Vector2 hotspot;
|
||||
};
|
||||
|
||||
struct _Efl_Canvas_Gesture_Tap_Data
|
||||
{
|
||||
};
|
||||
|
||||
struct _Efl_Canvas_Gesture_Long_Tap_Data
|
||||
{
|
||||
Ecore_Timer *timeout;
|
||||
Eina_Bool is_timeout;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,18 @@
|
|||
#include "efl_canvas_gesture_private.h"
|
||||
|
||||
#define MY_CLASS EFL_CANVAS_GESTURE_RECOGNIZER_CLASS
|
||||
|
||||
EOLIAN static Eina_Value *
|
||||
_efl_canvas_gesture_recognizer_config_get(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Recognizer_Data *pd, const char *name)
|
||||
{
|
||||
return efl_gesture_manager_config_get(pd->manager, name);
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_canvas_gesture_recognizer_reset(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Recognizer_Data *pd EINA_UNUSED,
|
||||
Efl_Canvas_Gesture *gesture EINA_UNUSED)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#include "efl_canvas_gesture_recognizer.eo.c"
|
|
@ -1,15 +1,16 @@
|
|||
import efl_gesture_types;
|
||||
import efl_canvas_gesture_types;
|
||||
|
||||
abstract Efl.Gesture.Recognizer (Efl.Object)
|
||||
abstract Efl.Canvas.Gesture.Recognizer (Efl.Object)
|
||||
{
|
||||
[[EFL Gesture Recognizer abstract class]]
|
||||
eo_prefix: efl_gesture_recognizer;
|
||||
methods {
|
||||
create @pure_virtual {
|
||||
[[This function is called to create a new Efl.Gesture object for the given target]]
|
||||
[[This function is called to create a new Efl.Canvas.Gesture object for the given target]]
|
||||
params {
|
||||
@in target: Efl.Object; [[The target widget]]
|
||||
}
|
||||
return: Efl.Gesture; [[Returns the Efl.Gesture event object]]
|
||||
return: Efl.Canvas.Gesture; [[Returns the Efl.Canvas.Gesture event object]]
|
||||
}
|
||||
recognize @pure_virtual {
|
||||
[[Handles the given event for the watched object.
|
||||
|
@ -18,17 +19,17 @@ abstract Efl.Gesture.Recognizer (Efl.Object)
|
|||
suitable result for the current recognition step.
|
||||
]]
|
||||
params {
|
||||
@in gesture: Efl.Gesture; [[The gesture object]]
|
||||
@in gesture: Efl.Canvas.Gesture; [[The gesture object]]
|
||||
@in watched: Efl.Object; [[The watched object]]
|
||||
@in event: Efl.Gesture.Touch; [[The pointer event]]
|
||||
@in event: Efl.Canvas.Gesture.Touch; [[The pointer event]]
|
||||
}
|
||||
return: Efl.Gesture.Recognizer_Result; [[Returns the Efl.Gesture event object]]
|
||||
return: Efl.Canvas.Gesture.Recognizer_Result; [[Returns the Efl.Canvas.Gesture event object]]
|
||||
}
|
||||
/* FIXME: This function is not used? */
|
||||
reset {
|
||||
[[This function is called by the framework to reset a given gesture.]]
|
||||
params {
|
||||
@in gesture: Efl.Gesture; [[The gesture object]]
|
||||
@in gesture: Efl.Canvas.Gesture; [[The gesture object]]
|
||||
}
|
||||
}
|
||||
@property config {
|
|
@ -1,20 +1,20 @@
|
|||
#include "efl_gesture_private.h"
|
||||
#include "efl_canvas_gesture_private.h"
|
||||
|
||||
#define MY_CLASS EFL_GESTURE_RECOGNIZER_LONG_TAP_CLASS
|
||||
#define MY_CLASS EFL_CANVAS_GESTURE_RECOGNIZER_LONG_TAP_CLASS
|
||||
|
||||
#define LONG_TAP_TIME_OUT 0.2
|
||||
|
||||
EOLIAN static Efl_Gesture *
|
||||
_efl_gesture_recognizer_long_tap_efl_gesture_recognizer_create(Eo *obj, void *pd EINA_UNUSED,
|
||||
EOLIAN static Efl_Canvas_Gesture *
|
||||
_efl_canvas_gesture_recognizer_long_tap_efl_canvas_gesture_recognizer_create(Eo *obj, void *pd EINA_UNUSED,
|
||||
Efl_Object *target EINA_UNUSED)
|
||||
{
|
||||
return efl_add(EFL_GESTURE_LONG_TAP_CLASS, obj);
|
||||
return efl_add(EFL_CANVAS_GESTURE_LONG_TAP_CLASS, obj);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_long_tap_timeout_cb(void *data)
|
||||
{
|
||||
Efl_Gesture_Long_Tap_Data *ltp = data;
|
||||
Efl_Canvas_Gesture_Long_Tap_Data *ltp = data;
|
||||
|
||||
/* FIXME: Needs to propagate this event back to evas! */
|
||||
ltp->is_timeout = EINA_TRUE;
|
||||
|
@ -22,16 +22,16 @@ _long_tap_timeout_cb(void *data)
|
|||
return ECORE_CALLBACK_RENEW;
|
||||
}
|
||||
|
||||
EOLIAN static Efl_Gesture_Recognizer_Result
|
||||
_efl_gesture_recognizer_long_tap_efl_gesture_recognizer_recognize(Eo *obj EINA_UNUSED,
|
||||
EOLIAN static Efl_Canvas_Gesture_Recognizer_Result
|
||||
_efl_canvas_gesture_recognizer_long_tap_efl_canvas_gesture_recognizer_recognize(Eo *obj EINA_UNUSED,
|
||||
void *pd EINA_UNUSED,
|
||||
Efl_Gesture *gesture, Efl_Object *watched EINA_UNUSED,
|
||||
Efl_Gesture_Touch *event)
|
||||
Efl_Canvas_Gesture *gesture, Efl_Object *watched EINA_UNUSED,
|
||||
Efl_Canvas_Gesture_Touch *event)
|
||||
{
|
||||
double length; // Manhattan distance
|
||||
Eina_Vector2 pos, dist;
|
||||
Efl_Gesture_Recognizer_Result result = EFL_GESTURE_CANCEL;
|
||||
Efl_Gesture_Long_Tap_Data *ltp = efl_data_scope_get(gesture, EFL_GESTURE_LONG_TAP_CLASS);
|
||||
Efl_Canvas_Gesture_Recognizer_Result result = EFL_GESTURE_CANCEL;
|
||||
Efl_Canvas_Gesture_Long_Tap_Data *ltp = efl_data_scope_get(gesture, EFL_CANVAS_GESTURE_LONG_TAP_CLASS);
|
||||
|
||||
switch (efl_gesture_touch_state_get(event))
|
||||
{
|
||||
|
@ -99,12 +99,12 @@ _efl_gesture_recognizer_long_tap_efl_gesture_recognizer_recognize(Eo *obj EINA_U
|
|||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_gesture_recognizer_long_tap_efl_gesture_recognizer_reset(Eo *obj,
|
||||
_efl_canvas_gesture_recognizer_long_tap_efl_canvas_gesture_recognizer_reset(Eo *obj,
|
||||
void *pd EINA_UNUSED,
|
||||
Efl_Gesture *gesture)
|
||||
Efl_Canvas_Gesture *gesture)
|
||||
{
|
||||
Efl_Gesture_Long_Tap_Data *ltp;
|
||||
ltp = efl_data_scope_get(gesture, EFL_GESTURE_LONG_TAP_CLASS);
|
||||
Efl_Canvas_Gesture_Long_Tap_Data *ltp;
|
||||
ltp = efl_data_scope_get(gesture, EFL_CANVAS_GESTURE_LONG_TAP_CLASS);
|
||||
if (ltp->timeout)
|
||||
ecore_timer_del(ltp->timeout);
|
||||
ltp->timeout = NULL;
|
||||
|
@ -112,4 +112,4 @@ _efl_gesture_recognizer_long_tap_efl_gesture_recognizer_reset(Eo *obj,
|
|||
efl_gesture_recognizer_reset(efl_super(obj, MY_CLASS), gesture);
|
||||
}
|
||||
|
||||
#include "efl_gesture_recognizer_long_tap.eo.c"
|
||||
#include "efl_canvas_gesture_recognizer_long_tap.eo.c"
|
|
@ -0,0 +1,11 @@
|
|||
class Efl.Canvas.Gesture.Recognizer_Long_Tap (Efl.Canvas.Gesture.Recognizer)
|
||||
{
|
||||
[[EFL Gesture Recognizer Long Tap class]]
|
||||
data: null;
|
||||
eo_prefix: efl_gesture_recognizer_long_tap;
|
||||
implements {
|
||||
Efl.Canvas.Gesture.Recognizer.create;
|
||||
Efl.Canvas.Gesture.Recognizer.recognize;
|
||||
Efl.Canvas.Gesture.Recognizer.reset;
|
||||
}
|
||||
}
|
|
@ -1,23 +1,23 @@
|
|||
#include "efl_gesture_private.h"
|
||||
#include "efl_canvas_gesture_private.h"
|
||||
|
||||
#define MY_CLASS EFL_GESTURE_RECOGNIZER_TAP_CLASS
|
||||
#define MY_CLASS EFL_CANVAS_GESTURE_RECOGNIZER_TAP_CLASS
|
||||
|
||||
EOLIAN static Efl_Gesture *
|
||||
_efl_gesture_recognizer_tap_efl_gesture_recognizer_create(Eo *obj, void *pd EINA_UNUSED,
|
||||
EOLIAN static Efl_Canvas_Gesture *
|
||||
_efl_canvas_gesture_recognizer_tap_efl_canvas_gesture_recognizer_create(Eo *obj, void *pd EINA_UNUSED,
|
||||
Efl_Object *target EINA_UNUSED)
|
||||
{
|
||||
return efl_add(EFL_GESTURE_TAP_CLASS, obj);
|
||||
return efl_add(EFL_CANVAS_GESTURE_TAP_CLASS, obj);
|
||||
}
|
||||
|
||||
EOLIAN static Efl_Gesture_Recognizer_Result
|
||||
_efl_gesture_recognizer_tap_efl_gesture_recognizer_recognize(Eo *obj EINA_UNUSED,
|
||||
EOLIAN static Efl_Canvas_Gesture_Recognizer_Result
|
||||
_efl_canvas_gesture_recognizer_tap_efl_canvas_gesture_recognizer_recognize(Eo *obj EINA_UNUSED,
|
||||
void *pd EINA_UNUSED,
|
||||
Efl_Gesture *gesture, Efl_Object *watched EINA_UNUSED,
|
||||
Efl_Gesture_Touch *event EINA_UNUSED)
|
||||
Efl_Canvas_Gesture *gesture, Efl_Object *watched EINA_UNUSED,
|
||||
Efl_Canvas_Gesture_Touch *event EINA_UNUSED)
|
||||
{
|
||||
double length;
|
||||
Eina_Vector2 pos, dist;
|
||||
Efl_Gesture_Recognizer_Result result = EFL_GESTURE_CANCEL;
|
||||
Efl_Canvas_Gesture_Recognizer_Result result = EFL_GESTURE_CANCEL;
|
||||
|
||||
switch (efl_gesture_touch_state_get(event))
|
||||
{
|
||||
|
@ -52,4 +52,4 @@ _efl_gesture_recognizer_tap_efl_gesture_recognizer_recognize(Eo *obj EINA_UNUSED
|
|||
return result;
|
||||
}
|
||||
|
||||
#include "efl_gesture_recognizer_tap.eo.c"
|
||||
#include "efl_canvas_gesture_recognizer_tap.eo.c"
|
|
@ -0,0 +1,10 @@
|
|||
class Efl.Canvas.Gesture.Recognizer_Tap (Efl.Canvas.Gesture.Recognizer)
|
||||
{
|
||||
[[EFL Gesture Recognizer Tap class]]
|
||||
data: null;
|
||||
eo_prefix: efl_gesture_recognizer_tap;
|
||||
implements {
|
||||
Efl.Canvas.Gesture.Recognizer.create;
|
||||
Efl.Canvas.Gesture.Recognizer.recognize;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
#include "efl_canvas_gesture_private.h"
|
||||
|
||||
#define MY_CLASS EFL_CANVAS_GESTURE_TAP_CLASS
|
||||
|
||||
|
||||
EOLIAN static Efl_Object *
|
||||
_efl_canvas_gesture_tap_efl_object_constructor(Eo *obj, Efl_Canvas_Gesture_Tap_Data *pd EINA_UNUSED)
|
||||
{
|
||||
Efl_Canvas_Gesture_Data *gd;
|
||||
|
||||
obj = efl_constructor(efl_super(obj, MY_CLASS));
|
||||
|
||||
gd = efl_data_scope_get(obj, EFL_CANVAS_GESTURE_CLASS);
|
||||
gd->type = EFL_EVENT_GESTURE_TAP;
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
#include "efl_canvas_gesture_tap.eo.c"
|
|
@ -1,8 +1,9 @@
|
|||
import efl_gesture_types;
|
||||
import efl_canvas_gesture_types;
|
||||
|
||||
class Efl.Gesture.Tap(Efl.Gesture)
|
||||
class Efl.Canvas.Gesture.Tap(Efl.Canvas.Gesture)
|
||||
{
|
||||
[[EFL Gesture Tap class]]
|
||||
eo_prefix: efl_gesture_tap;
|
||||
event_prefix: efl;
|
||||
events {
|
||||
gesture,tap; [[Event for tap gesture]]
|
|
@ -1,6 +1,6 @@
|
|||
#include "efl_gesture_private.h"
|
||||
#include "efl_canvas_gesture_private.h"
|
||||
|
||||
#define MY_CLASS EFL_GESTURE_TOUCH_CLASS
|
||||
#define MY_CLASS EFL_CANVAS_GESTURE_TOUCH_CLASS
|
||||
|
||||
typedef struct _Pointer_Data
|
||||
{
|
||||
|
@ -12,14 +12,14 @@ typedef struct _Pointer_Data
|
|||
Efl_Pointer_Action action;
|
||||
} Pointer_Data;
|
||||
|
||||
typedef struct _Efl_Gesture_Touch_Data
|
||||
typedef struct _Efl_Canvas_Gesture_Touch_Data
|
||||
{
|
||||
Efl_Gesture_Touch_State state;
|
||||
Efl_Canvas_Gesture_Touch_State state;
|
||||
Eina_Hash *touch_points;
|
||||
int touch_down;
|
||||
Eina_Bool multi_touch;
|
||||
Eo *target;
|
||||
} Efl_Gesture_Touch_Data;
|
||||
} Efl_Canvas_Gesture_Touch_Data;
|
||||
|
||||
|
||||
// This event object accumulates all the touch points
|
||||
|
@ -32,7 +32,7 @@ static void _hash_free_cb(Pointer_Data *point)
|
|||
}
|
||||
|
||||
static inline void
|
||||
_touch_points_reset(Efl_Gesture_Touch_Data *pd)
|
||||
_touch_points_reset(Efl_Canvas_Gesture_Touch_Data *pd)
|
||||
{
|
||||
eina_hash_free(pd->touch_points);
|
||||
pd->touch_points = eina_hash_int32_new(EINA_FREE_CB(_hash_free_cb));
|
||||
|
@ -41,7 +41,7 @@ _touch_points_reset(Efl_Gesture_Touch_Data *pd)
|
|||
}
|
||||
|
||||
EOLIAN static Efl_Object *
|
||||
_efl_gesture_touch_efl_object_constructor(Eo *obj, Efl_Gesture_Touch_Data *pd)
|
||||
_efl_canvas_gesture_touch_efl_object_constructor(Eo *obj, Efl_Canvas_Gesture_Touch_Data *pd)
|
||||
{
|
||||
obj = efl_constructor(efl_super(obj, MY_CLASS));
|
||||
_touch_points_reset(pd);
|
||||
|
@ -49,20 +49,20 @@ _efl_gesture_touch_efl_object_constructor(Eo *obj, Efl_Gesture_Touch_Data *pd)
|
|||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_gesture_touch_efl_object_destructor(Eo *obj, Efl_Gesture_Touch_Data *pd)
|
||||
_efl_canvas_gesture_touch_efl_object_destructor(Eo *obj, Efl_Canvas_Gesture_Touch_Data *pd)
|
||||
{
|
||||
eina_hash_free(pd->touch_points);
|
||||
efl_destructor(efl_super(obj, MY_CLASS));
|
||||
}
|
||||
|
||||
EOLIAN static Efl_Gesture_Touch_State
|
||||
_efl_gesture_touch_state_get(Eo *obj EINA_UNUSED, Efl_Gesture_Touch_Data *pd)
|
||||
EOLIAN static Efl_Canvas_Gesture_Touch_State
|
||||
_efl_canvas_gesture_touch_state_get(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Touch_Data *pd)
|
||||
{
|
||||
return pd->state;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_gesture_touch_point_record(Eo *obj EINA_UNUSED, Efl_Gesture_Touch_Data *pd,
|
||||
_efl_canvas_gesture_touch_point_record(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Touch_Data *pd,
|
||||
int id, Eina_Vector2 pos, double timestamp, Efl_Pointer_Action action)
|
||||
{
|
||||
Pointer_Data *point = eina_hash_find(pd->touch_points, &id);
|
||||
|
@ -122,13 +122,13 @@ bad_fingers:
|
|||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_efl_gesture_touch_multi_touch_get(Eo *obj EINA_UNUSED, Efl_Gesture_Touch_Data *pd)
|
||||
_efl_canvas_gesture_touch_multi_touch_get(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Touch_Data *pd)
|
||||
{
|
||||
return pd->multi_touch;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Vector2
|
||||
_efl_gesture_touch_start_point_get(Eo *obj EINA_UNUSED, Efl_Gesture_Touch_Data *pd)
|
||||
_efl_canvas_gesture_touch_start_point_get(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Touch_Data *pd)
|
||||
{
|
||||
int tool = 0;
|
||||
Pointer_Data *point = eina_hash_find(pd->touch_points, &tool);
|
||||
|
@ -141,7 +141,7 @@ _efl_gesture_touch_start_point_get(Eo *obj EINA_UNUSED, Efl_Gesture_Touch_Data *
|
|||
}
|
||||
|
||||
EOLIAN static Eina_Vector2
|
||||
_efl_gesture_touch_delta(const Eo *obj EINA_UNUSED, Efl_Gesture_Touch_Data *pd, int tool)
|
||||
_efl_canvas_gesture_touch_delta(const Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Touch_Data *pd, int tool)
|
||||
{
|
||||
Pointer_Data *point = eina_hash_find(pd->touch_points, &tool);
|
||||
Eina_Vector2 vec = { 0, 0 };
|
||||
|
@ -154,7 +154,7 @@ _efl_gesture_touch_delta(const Eo *obj EINA_UNUSED, Efl_Gesture_Touch_Data *pd,
|
|||
}
|
||||
|
||||
EOLIAN static Eina_Vector2
|
||||
_efl_gesture_touch_distance(const Eo *obj EINA_UNUSED, Efl_Gesture_Touch_Data *pd, int tool)
|
||||
_efl_canvas_gesture_touch_distance(const Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Touch_Data *pd, int tool)
|
||||
{
|
||||
Pointer_Data *point = eina_hash_find(pd->touch_points, &tool);
|
||||
Eina_Vector2 vec = { 0, 0 };
|
||||
|
@ -166,4 +166,4 @@ _efl_gesture_touch_distance(const Eo *obj EINA_UNUSED, Efl_Gesture_Touch_Data *p
|
|||
return vec;
|
||||
}
|
||||
|
||||
#include "efl_gesture_touch.eo.c"
|
||||
#include "efl_canvas_gesture_touch.eo.c"
|
|
@ -1,11 +1,12 @@
|
|||
import efl_gesture_types;
|
||||
import efl_canvas_gesture_types;
|
||||
import efl_input_types;
|
||||
|
||||
/* FIXME: This class lacks a lot of useful helpers. */
|
||||
|
||||
class Efl.Gesture.Touch(Efl.Object)
|
||||
class Efl.Canvas.Gesture.Touch(Efl.Object)
|
||||
{
|
||||
[[EFL Gesture Touch class]]
|
||||
eo_prefix: efl_gesture_touch;
|
||||
methods {
|
||||
point_record {
|
||||
[[Touch point record method]]
|
||||
|
@ -47,7 +48,7 @@ class Efl.Gesture.Touch(Efl.Object)
|
|||
@property state {
|
||||
[[This property holds the state of the touch event.]]
|
||||
get {
|
||||
return : Efl.Gesture.Touch.State; [[touch event state]]
|
||||
return : Efl.Canvas.Gesture.Touch.State; [[touch event state]]
|
||||
}
|
||||
}
|
||||
/* FIXME: finger_list was broken by design - TODO */
|
|
@ -1,4 +1,4 @@
|
|||
enum Efl.Gesture.Touch.State
|
||||
enum Efl.Canvas.Gesture.Touch.State
|
||||
{
|
||||
[[ This enum type describes the state of a touch event. ]]
|
||||
legacy: efl_gesture_touch;
|
||||
|
@ -8,7 +8,7 @@ enum Efl.Gesture.Touch.State
|
|||
end, [[Last fingure touch up]]
|
||||
}
|
||||
|
||||
enum Efl.Gesture.State
|
||||
enum Efl.Canvas.Gesture.State
|
||||
{
|
||||
[[ This enum type describes the state of a gesture. ]]
|
||||
legacy: efl_gesture;
|
||||
|
@ -19,7 +19,7 @@ enum Efl.Gesture.State
|
|||
canceled, [[A gesture was canceled.]]
|
||||
}
|
||||
|
||||
enum Efl.Gesture.Recognizer_Result
|
||||
enum Efl.Canvas.Gesture.Recognizer_Result
|
||||
{
|
||||
[[ This enum type describes the state of a gesture recognizer. ]]
|
||||
legacy: efl_gesture;
|
|
@ -1,36 +0,0 @@
|
|||
#include "efl_gesture_private.h"
|
||||
|
||||
#define MY_CLASS EFL_GESTURE_CLASS
|
||||
|
||||
EOLIAN static const Efl_Event_Description *
|
||||
_efl_gesture_type_get(Eo *obj EINA_UNUSED, Efl_Gesture_Data *pd)
|
||||
{
|
||||
return pd->type;
|
||||
}
|
||||
|
||||
EOLIAN static Efl_Gesture_State
|
||||
_efl_gesture_state_get(Eo *obj EINA_UNUSED, Efl_Gesture_Data *pd)
|
||||
{
|
||||
return pd->state;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_gesture_state_set(Eo *obj EINA_UNUSED, Efl_Gesture_Data *pd, Efl_Gesture_State state)
|
||||
{
|
||||
pd->state = state;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_gesture_hotspot_set(Eo *obj EINA_UNUSED, Efl_Gesture_Data *pd, Eina_Vector2 hotspot)
|
||||
{
|
||||
pd->hotspot = hotspot;
|
||||
}
|
||||
|
||||
|
||||
EOLIAN static Eina_Vector2
|
||||
_efl_gesture_hotspot_get(Eo *obj EINA_UNUSED, Efl_Gesture_Data *pd)
|
||||
{
|
||||
return pd->hotspot;
|
||||
}
|
||||
|
||||
#include "efl_gesture.eo.c"
|
|
@ -1,27 +0,0 @@
|
|||
#include "efl_gesture_private.h"
|
||||
|
||||
#define MY_CLASS EFL_GESTURE_LONG_TAP_CLASS
|
||||
|
||||
|
||||
EOLIAN static Efl_Object *
|
||||
_efl_gesture_long_tap_efl_object_constructor(Eo *obj, Efl_Gesture_Long_Tap_Data *pd EINA_UNUSED)
|
||||
{
|
||||
Efl_Gesture_Data *gd;
|
||||
|
||||
obj = efl_constructor(efl_super(obj, MY_CLASS));
|
||||
gd = efl_data_scope_get(obj, EFL_GESTURE_CLASS);
|
||||
gd->type = EFL_EVENT_GESTURE_LONG_TAP;
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_gesture_long_tap_efl_object_destructor(Eo *obj, Efl_Gesture_Long_Tap_Data *pd)
|
||||
{
|
||||
if (pd->timeout)
|
||||
ecore_timer_del(pd->timeout);
|
||||
|
||||
efl_destructor(efl_super(obj, MY_CLASS));
|
||||
}
|
||||
|
||||
#include "efl_gesture_long_tap.eo.c"
|
|
@ -1,42 +0,0 @@
|
|||
#ifndef EFL_GESTURE_PRIVATE_H_
|
||||
#define EFL_GESTURE_PRIVATE_H_
|
||||
|
||||
#include "evas_common_private.h"
|
||||
#include "evas_private.h"
|
||||
#define EFL_INTERNAL_UNSTABLE
|
||||
#include "interfaces/efl_common_internal.h"
|
||||
|
||||
#include <Ecore.h>
|
||||
|
||||
//private gesture classes
|
||||
#include "efl_gesture_recognizer_tap.eo.h"
|
||||
#include "efl_gesture_recognizer_long_tap.eo.h"
|
||||
|
||||
typedef struct _Efl_Gesture_Recognizer_Data Efl_Gesture_Recognizer_Data;
|
||||
typedef struct _Efl_Gesture_Data Efl_Gesture_Data;
|
||||
typedef struct _Efl_Gesture_Tap_Data Efl_Gesture_Tap_Data;
|
||||
typedef struct _Efl_Gesture_Long_Tap_Data Efl_Gesture_Long_Tap_Data;
|
||||
|
||||
struct _Efl_Gesture_Recognizer_Data
|
||||
{
|
||||
Eo *manager; // keeps a reference of the manager
|
||||
};
|
||||
|
||||
struct _Efl_Gesture_Data
|
||||
{
|
||||
const Efl_Event_Description *type;
|
||||
Efl_Gesture_State state;
|
||||
Eina_Vector2 hotspot;
|
||||
};
|
||||
|
||||
struct _Efl_Gesture_Tap_Data
|
||||
{
|
||||
};
|
||||
|
||||
struct _Efl_Gesture_Long_Tap_Data
|
||||
{
|
||||
Ecore_Timer *timeout;
|
||||
Eina_Bool is_timeout;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,18 +0,0 @@
|
|||
#include "efl_gesture_private.h"
|
||||
|
||||
#define MY_CLASS EFL_GESTURE_RECOGNIZER_CLASS
|
||||
|
||||
EOLIAN static Eina_Value *
|
||||
_efl_gesture_recognizer_config_get(Eo *obj EINA_UNUSED, Efl_Gesture_Recognizer_Data *pd, const char *name)
|
||||
{
|
||||
return efl_gesture_manager_config_get(pd->manager, name);
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_gesture_recognizer_reset(Eo *obj EINA_UNUSED, Efl_Gesture_Recognizer_Data *pd EINA_UNUSED,
|
||||
Efl_Gesture *gesture EINA_UNUSED)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#include "efl_gesture_recognizer.eo.c"
|
|
@ -1,10 +0,0 @@
|
|||
class Efl.Gesture.Recognizer_Long_Tap (Efl.Gesture.Recognizer)
|
||||
{
|
||||
[[EFL Gesture Recognizer Long Tap class]]
|
||||
data: null;
|
||||
implements {
|
||||
Efl.Gesture.Recognizer.create;
|
||||
Efl.Gesture.Recognizer.recognize;
|
||||
Efl.Gesture.Recognizer.reset;
|
||||
}
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
class Efl.Gesture.Recognizer_Tap (Efl.Gesture.Recognizer)
|
||||
{
|
||||
[[EFL Gesture Recognizer Tap class]]
|
||||
data: null;
|
||||
implements {
|
||||
Efl.Gesture.Recognizer.create;
|
||||
Efl.Gesture.Recognizer.recognize;
|
||||
}
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
#include "efl_gesture_private.h"
|
||||
|
||||
#define MY_CLASS EFL_GESTURE_TAP_CLASS
|
||||
|
||||
|
||||
EOLIAN static Efl_Object *
|
||||
_efl_gesture_tap_efl_object_constructor(Eo *obj, Efl_Gesture_Tap_Data *pd EINA_UNUSED)
|
||||
{
|
||||
Efl_Gesture_Data *gd;
|
||||
|
||||
obj = efl_constructor(efl_super(obj, MY_CLASS));
|
||||
|
||||
gd = efl_data_scope_get(obj, EFL_GESTURE_CLASS);
|
||||
gd->type = EFL_EVENT_GESTURE_TAP;
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
#include "efl_gesture_tap.eo.c"
|
|
@ -1905,9 +1905,9 @@ Eina_List *_evas_pointer_list_in_rect_get(Evas_Public_Data *edata,
|
|||
void efl_canvas_output_info_get(Evas_Public_Data *e, Efl_Canvas_Output *output);
|
||||
|
||||
// Gesture Manager
|
||||
void _efl_gesture_manager_filter_event(Eo *gesture_manager, Eo *target, void *event);
|
||||
void _efl_gesture_manager_callback_del_hook(Eo *gesture_manager, Eo *target, const Efl_Event_Description *type);
|
||||
void _efl_gesture_manager_callback_add_hook(Eo *gesture_manager, Eo *target, const Efl_Event_Description *type);
|
||||
void _efl_canvas_gesture_manager_filter_event(Eo *gesture_manager, Eo *target, void *event);
|
||||
void _efl_canvas_gesture_manager_callback_del_hook(Eo *gesture_manager, Eo *target, const Efl_Event_Description *type);
|
||||
void _efl_canvas_gesture_manager_callback_add_hook(Eo *gesture_manager, Eo *target, const Efl_Event_Description *type);
|
||||
|
||||
|
||||
extern Eina_Cow *evas_object_proxy_cow;
|
||||
|
|
Loading…
Reference in New Issue