forked from enlightenment/efl
evas/gesture: Integrated gesture framework to evas.
This commit is contained in:
parent
9da7a7f0d2
commit
28869a9395
|
@ -378,6 +378,15 @@ evas_object_event_callback_call(Evas_Object *eo_obj, Evas_Object_Protected_Data
|
||||||
|
|
||||||
_evas_walk(e);
|
_evas_walk(e);
|
||||||
|
|
||||||
|
// gesture hook
|
||||||
|
if ( type == EVAS_CALLBACK_MOUSE_MOVE ||
|
||||||
|
type == EVAS_CALLBACK_MULTI_MOVE ||
|
||||||
|
type == EVAS_CALLBACK_MOUSE_DOWN ||
|
||||||
|
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);
|
||||||
|
|
||||||
if (!_evas_object_callback_has_by_type(obj, type))
|
if (!_evas_object_callback_has_by_type(obj, type))
|
||||||
goto nothing_here;
|
goto nothing_here;
|
||||||
|
|
||||||
|
@ -698,6 +707,9 @@ _check_event_catcher_add(void *data, const Efl_Event *event)
|
||||||
|
|
||||||
for (i = 0; array[i].desc != NULL; i++)
|
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);
|
||||||
|
|
||||||
if (array[i].desc == EFL_EVENT_ANIMATOR_TICK)
|
if (array[i].desc == EFL_EVENT_ANIMATOR_TICK)
|
||||||
{
|
{
|
||||||
if (obj->animator_ref++ > 0) break;
|
if (obj->animator_ref++ > 0) break;
|
||||||
|
@ -722,6 +734,9 @@ _check_event_catcher_del(void *data, const Efl_Event *event)
|
||||||
|
|
||||||
for (i = 0; array[i].desc != NULL; i++)
|
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);
|
||||||
|
|
||||||
if (array[i].desc == EFL_EVENT_ANIMATOR_TICK)
|
if (array[i].desc == EFL_EVENT_ANIMATOR_TICK)
|
||||||
{
|
{
|
||||||
if ((--obj->animator_ref) > 0) break;
|
if ((--obj->animator_ref) > 0) break;
|
||||||
|
|
|
@ -225,6 +225,8 @@ _evas_canvas_efl_object_constructor(Eo *eo_obj, Evas_Public_Data *e)
|
||||||
eina_clist_init(&e->calc_list);
|
eina_clist_init(&e->calc_list);
|
||||||
eina_clist_init(&e->calc_done);
|
eina_clist_init(&e->calc_done);
|
||||||
|
|
||||||
|
e->gesture_manager = efl_add(EFL_GESTURE_MANAGER_CLASS, eo_obj);
|
||||||
|
|
||||||
#define EVAS_ARRAY_SET(E, Array) \
|
#define EVAS_ARRAY_SET(E, Array) \
|
||||||
eina_array_step_set(&E->Array, sizeof (E->Array), \
|
eina_array_step_set(&E->Array, sizeof (E->Array), \
|
||||||
((1024 * sizeof (void*)) - sizeof (E->Array)) / sizeof (void*));
|
((1024 * sizeof (void*)) - sizeof (E->Array)) / sizeof (void*));
|
||||||
|
@ -295,6 +297,9 @@ _evas_canvas_efl_object_destructor(Eo *eo_e, Evas_Public_Data *e)
|
||||||
_evas_post_event_callback_free(eo_e);
|
_evas_post_event_callback_free(eo_e);
|
||||||
_evas_canvas_event_shutdown(eo_e, e);
|
_evas_canvas_event_shutdown(eo_e, e);
|
||||||
|
|
||||||
|
efl_del(e->gesture_manager);
|
||||||
|
e->gesture_manager = NULL;
|
||||||
|
|
||||||
del = EINA_TRUE;
|
del = EINA_TRUE;
|
||||||
e->walking_list++;
|
e->walking_list++;
|
||||||
e->cleanup = 1;
|
e->cleanup = 1;
|
||||||
|
|
|
@ -934,6 +934,7 @@ struct _Evas_Public_Data
|
||||||
int in_smart_calc;
|
int in_smart_calc;
|
||||||
int smart_calc_count;
|
int smart_calc_count;
|
||||||
|
|
||||||
|
Eo *gesture_manager;
|
||||||
Eo *pending_default_focus_obj;
|
Eo *pending_default_focus_obj;
|
||||||
Eina_Hash *focused_objects; //Key - seat; value - the focused object
|
Eina_Hash *focused_objects; //Key - seat; value - the focused object
|
||||||
Eina_List *focused_by; //Which seat has the canvas focus
|
Eina_List *focused_by; //Which seat has the canvas focus
|
||||||
|
@ -2015,6 +2016,12 @@ 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);
|
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);
|
||||||
|
|
||||||
|
|
||||||
extern Eina_Cow *evas_object_proxy_cow;
|
extern Eina_Cow *evas_object_proxy_cow;
|
||||||
extern Eina_Cow *evas_object_map_cow;
|
extern Eina_Cow *evas_object_map_cow;
|
||||||
extern Eina_Cow *evas_object_state_cow;
|
extern Eina_Cow *evas_object_state_cow;
|
||||||
|
|
Loading…
Reference in New Issue