2016-06-20 21:26:15 -07:00
|
|
|
#define EFL_CANVAS_OBJECT_BETA
|
2016-06-13 22:59:57 -07:00
|
|
|
#define EVAS_CANVAS_BETA
|
2016-06-13 22:04:34 -07:00
|
|
|
|
2013-06-20 03:53:29 -07:00
|
|
|
#include "evas_common_private.h"
|
2002-11-08 00:02:15 -08:00
|
|
|
#include "evas_private.h"
|
|
|
|
|
2016-05-30 22:39:10 -07:00
|
|
|
#define EFL_INTERNAL_UNSTABLE
|
|
|
|
#include "interfaces/efl_common_internal.h"
|
|
|
|
|
2010-11-26 02:01:18 -08:00
|
|
|
EVAS_MEMPOOL(_mp_pc);
|
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
extern Eina_Hash* signals_hash_table;
|
|
|
|
|
2016-08-18 23:42:44 -07:00
|
|
|
/* Legacy events, do not use anywhere */
|
|
|
|
static const Efl_Event_Description _EVAS_OBJECT_EVENT_FREE = EFL_EVENT_DESCRIPTION("free");
|
|
|
|
static const Efl_Event_Description _EVAS_OBJECT_EVENT_DEL = EFL_EVENT_DESCRIPTION("del");
|
|
|
|
#define EVAS_OBJECT_EVENT_FREE (&(_EVAS_OBJECT_EVENT_FREE))
|
|
|
|
#define EVAS_OBJECT_EVENT_DEL (&(_EVAS_OBJECT_EVENT_DEL))
|
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
/**
|
|
|
|
* Evas events descriptions for Eo.
|
|
|
|
*/
|
2016-08-10 02:59:36 -07:00
|
|
|
#define DEFINE_EVAS_CALLBACKS(FUNC, LAST, ...) \
|
2016-08-10 19:58:42 -07:00
|
|
|
static const Efl_Event_Description *FUNC(unsigned int index) \
|
2016-06-15 11:41:09 -07:00
|
|
|
{ \
|
2016-08-10 19:58:42 -07:00
|
|
|
static const Efl_Event_Description *internals[LAST] = { NULL }; \
|
2016-06-15 11:41:09 -07:00
|
|
|
\
|
2016-08-10 02:59:36 -07:00
|
|
|
if (index >= LAST) return NULL; \
|
2016-06-15 11:41:09 -07:00
|
|
|
if (internals[0] == NULL) \
|
|
|
|
{ \
|
|
|
|
memcpy(internals, \
|
2016-08-10 19:58:42 -07:00
|
|
|
((const Efl_Event_Description*[]) { __VA_ARGS__ }), \
|
|
|
|
sizeof ((const Efl_Event_Description *[]) { __VA_ARGS__ })); \
|
2016-06-15 11:41:09 -07:00
|
|
|
} \
|
|
|
|
return internals[index]; \
|
|
|
|
}
|
|
|
|
|
2016-08-10 02:59:36 -07:00
|
|
|
DEFINE_EVAS_CALLBACKS(_legacy_evas_callback_table, EVAS_CALLBACK_LAST,
|
|
|
|
EFL_EVENT_POINTER_IN,
|
|
|
|
EFL_EVENT_POINTER_OUT,
|
|
|
|
EFL_EVENT_POINTER_DOWN,
|
|
|
|
EFL_EVENT_POINTER_UP,
|
|
|
|
EFL_EVENT_POINTER_MOVE,
|
|
|
|
EFL_EVENT_POINTER_WHEEL,
|
|
|
|
EFL_EVENT_POINTER_DOWN,
|
|
|
|
EFL_EVENT_POINTER_UP,
|
|
|
|
EFL_EVENT_POINTER_MOVE,
|
2016-08-18 23:42:44 -07:00
|
|
|
EVAS_OBJECT_EVENT_FREE,
|
2016-08-10 02:59:36 -07:00
|
|
|
EFL_EVENT_KEY_DOWN,
|
|
|
|
EFL_EVENT_KEY_UP,
|
2016-06-20 21:26:15 -07:00
|
|
|
EFL_CANVAS_OBJECT_EVENT_FOCUS_IN,
|
|
|
|
EFL_CANVAS_OBJECT_EVENT_FOCUS_OUT,
|
2016-06-15 11:41:09 -07:00
|
|
|
EFL_GFX_EVENT_SHOW,
|
|
|
|
EFL_GFX_EVENT_HIDE,
|
|
|
|
EFL_GFX_EVENT_MOVE,
|
|
|
|
EFL_GFX_EVENT_RESIZE,
|
|
|
|
EFL_GFX_EVENT_RESTACK,
|
2016-08-18 23:42:44 -07:00
|
|
|
EVAS_OBJECT_EVENT_DEL,
|
2016-08-10 02:59:36 -07:00
|
|
|
EFL_EVENT_HOLD,
|
2016-06-15 11:41:09 -07:00
|
|
|
EFL_GFX_EVENT_CHANGE_SIZE_HINTS,
|
|
|
|
EFL_IMAGE_EVENT_PRELOAD,
|
|
|
|
EFL_CANVAS_EVENT_FOCUS_IN,
|
|
|
|
EFL_CANVAS_EVENT_FOCUS_OUT,
|
|
|
|
EVAS_CANVAS_EVENT_RENDER_FLUSH_PRE,
|
|
|
|
EVAS_CANVAS_EVENT_RENDER_FLUSH_POST,
|
|
|
|
EFL_CANVAS_EVENT_OBJECT_FOCUS_IN,
|
|
|
|
EFL_CANVAS_EVENT_OBJECT_FOCUS_OUT,
|
|
|
|
EFL_IMAGE_EVENT_UNLOAD,
|
|
|
|
EFL_CANVAS_EVENT_RENDER_PRE,
|
|
|
|
EFL_CANVAS_EVENT_RENDER_POST,
|
|
|
|
EFL_IMAGE_EVENT_RESIZE,
|
|
|
|
EFL_CANVAS_EVENT_DEVICE_CHANGED,
|
|
|
|
EVAS_CANVAS_EVENT_AXIS_UPDATE,
|
|
|
|
EVAS_CANVAS_EVENT_VIEWPORT_RESIZE );
|
2013-04-11 12:08:24 -07:00
|
|
|
|
2016-08-19 00:40:57 -07:00
|
|
|
static inline Evas_Callback_Type
|
|
|
|
_legacy_evas_callback_type(const Efl_Event_Description *desc)
|
|
|
|
{
|
|
|
|
Evas_Callback_Type type;
|
|
|
|
|
|
|
|
for (type = 0; type < EVAS_CALLBACK_LAST; type++)
|
|
|
|
{
|
|
|
|
if (_legacy_evas_callback_table(type) == desc)
|
|
|
|
return type;
|
|
|
|
}
|
|
|
|
|
|
|
|
return EVAS_CALLBACK_LAST;
|
|
|
|
}
|
|
|
|
|
2013-04-11 12:08:24 -07:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
EINA_INLIST;
|
|
|
|
Evas_Object_Event_Cb func;
|
|
|
|
void *data;
|
|
|
|
Evas_Callback_Type type;
|
2016-08-10 02:59:36 -07:00
|
|
|
int efl_event_info; // for key, pointer and hold
|
2013-04-11 12:08:24 -07:00
|
|
|
} _eo_evas_object_cb_info;
|
|
|
|
|
2016-05-30 22:39:10 -07:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
EINA_INLIST;
|
|
|
|
Evas_Event_Cb func;
|
|
|
|
void *data;
|
|
|
|
Evas_Callback_Type type;
|
|
|
|
} _eo_evas_cb_info;
|
|
|
|
|
2016-08-10 02:59:36 -07:00
|
|
|
#define EFL_EVENT_TYPE_LEGACY 0
|
|
|
|
#define EFL_EVENT_TYPE_POINTER 1
|
|
|
|
#define EFL_EVENT_TYPE_KEY 2
|
|
|
|
#define EFL_EVENT_TYPE_HOLD 3
|
|
|
|
|
|
|
|
static int
|
|
|
|
_evas_event_efl_event_info_exists(Evas_Callback_Type type)
|
|
|
|
{
|
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case EVAS_CALLBACK_MOUSE_IN:
|
|
|
|
case EVAS_CALLBACK_MOUSE_OUT:
|
|
|
|
case EVAS_CALLBACK_MOUSE_DOWN:
|
|
|
|
case EVAS_CALLBACK_MOUSE_UP:
|
|
|
|
case EVAS_CALLBACK_MOUSE_MOVE:
|
|
|
|
case EVAS_CALLBACK_MOUSE_WHEEL:
|
|
|
|
case EVAS_CALLBACK_MULTI_DOWN:
|
|
|
|
case EVAS_CALLBACK_MULTI_UP:
|
|
|
|
case EVAS_CALLBACK_MULTI_MOVE:
|
|
|
|
return EFL_EVENT_TYPE_POINTER;
|
|
|
|
case EVAS_CALLBACK_KEY_DOWN:
|
|
|
|
case EVAS_CALLBACK_KEY_UP:
|
|
|
|
return EFL_EVENT_TYPE_KEY;
|
|
|
|
case EVAS_CALLBACK_HOLD:
|
|
|
|
return EFL_EVENT_TYPE_HOLD;
|
|
|
|
default:
|
|
|
|
return EFL_EVENT_TYPE_LEGACY;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-02-29 02:18:40 -08:00
|
|
|
_eo_evas_object_cb(void *data, const Eo_Event *event)
|
2013-04-11 12:08:24 -07:00
|
|
|
{
|
2016-08-10 02:59:36 -07:00
|
|
|
Evas_Event_Flags *event_flags = NULL, evflags = EVAS_EVENT_FLAG_NONE;
|
|
|
|
Efl_Event *efl_event_info = event->info;
|
2013-04-11 12:08:24 -07:00
|
|
|
_eo_evas_object_cb_info *info = data;
|
2016-08-10 02:59:36 -07:00
|
|
|
void *event_info;
|
|
|
|
Evas *evas;
|
|
|
|
|
|
|
|
evas = evas_object_evas_get(event->object);
|
|
|
|
|
|
|
|
if (!info->func) return;
|
|
|
|
switch (info->efl_event_info)
|
|
|
|
{
|
|
|
|
case EFL_EVENT_TYPE_POINTER:
|
2016-08-16 21:08:03 -07:00
|
|
|
event_info = efl_event_pointer_legacy_info_fill(efl_event_info, info->type, &event_flags);
|
2016-08-10 02:59:36 -07:00
|
|
|
break;
|
|
|
|
|
|
|
|
case EFL_EVENT_TYPE_KEY:
|
|
|
|
event_info = efl_event_key_legacy_info_fill(efl_event_info, &event_flags);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case EFL_EVENT_TYPE_HOLD:
|
|
|
|
event_info = efl_event_hold_legacy_info_fill(efl_event_info, &event_flags);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case EFL_EVENT_TYPE_LEGACY:
|
|
|
|
info->func(info->data, evas, event->object, event->info);
|
|
|
|
return;
|
|
|
|
|
|
|
|
default: return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!event_info) return;
|
|
|
|
if (event_flags) evflags = *event_flags;
|
|
|
|
info->func(info->data, evas, event->object, event_info);
|
|
|
|
if (event_flags && (evflags != *event_flags))
|
|
|
|
efl_event_flags_set(efl_event_info, *event_flags);
|
2013-04-11 12:08:24 -07:00
|
|
|
}
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-02-29 02:18:40 -08:00
|
|
|
_eo_evas_cb(void *data, const Eo_Event *event)
|
2013-04-11 12:08:24 -07:00
|
|
|
{
|
|
|
|
_eo_evas_cb_info *info = data;
|
2016-05-18 08:17:36 -07:00
|
|
|
if (info->func) info->func(info->data, event->object, event->info);
|
2013-04-11 12:08:24 -07:00
|
|
|
}
|
|
|
|
|
2010-05-04 08:58:10 -07:00
|
|
|
void
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_post_event_callback_call(Evas *eo_e, Evas_Public_Data *e)
|
2010-05-04 08:58:10 -07:00
|
|
|
{
|
|
|
|
Evas_Post_Callback *pc;
|
|
|
|
int skip = 0;
|
2013-06-06 14:35:12 -07:00
|
|
|
static int first_run = 1; // FIXME: This is a workaround to prevent this
|
|
|
|
// function from being called recursively.
|
2010-05-04 08:58:10 -07:00
|
|
|
|
2013-06-06 14:35:12 -07:00
|
|
|
if (e->delete_me || (!first_run)) return;
|
2010-05-04 08:58:10 -07:00
|
|
|
_evas_walk(e);
|
2013-06-06 14:35:12 -07:00
|
|
|
first_run = 0;
|
2010-05-04 08:58:10 -07:00
|
|
|
EINA_LIST_FREE(e->post_events, pc)
|
|
|
|
{
|
|
|
|
if ((!skip) && (!e->delete_me) && (!pc->delete_me))
|
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
if (!pc->func((void*)pc->data, eo_e)) skip = 1;
|
2010-05-04 08:58:10 -07:00
|
|
|
}
|
2011-12-14 21:56:19 -08:00
|
|
|
EVAS_MEMPOOL_FREE(_mp_pc, pc);
|
2010-05-04 08:58:10 -07:00
|
|
|
}
|
2013-06-06 14:35:12 -07:00
|
|
|
first_run = 1;
|
2010-05-04 08:58:10 -07:00
|
|
|
_evas_unwalk(e);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_post_event_callback_free(Evas *eo_e)
|
2010-05-04 08:58:10 -07:00
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
|
2010-05-04 08:58:10 -07:00
|
|
|
Evas_Post_Callback *pc;
|
2011-12-14 21:56:19 -08:00
|
|
|
|
2010-05-04 08:58:10 -07:00
|
|
|
EINA_LIST_FREE(e->post_events, pc)
|
|
|
|
{
|
2011-12-14 21:56:19 -08:00
|
|
|
EVAS_MEMPOOL_FREE(_mp_pc, pc);
|
2010-05-04 08:58:10 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-01-31 20:26:55 -08:00
|
|
|
void
|
2013-04-11 12:08:24 -07:00
|
|
|
evas_object_event_callback_all_del(Evas_Object *eo_obj)
|
2003-01-19 19:54:00 -08:00
|
|
|
{
|
2013-04-11 12:08:24 -07:00
|
|
|
_eo_evas_object_cb_info *info;
|
|
|
|
Eina_Inlist *itr;
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
|
2003-01-19 19:54:00 -08:00
|
|
|
|
2012-11-11 18:22:39 -08:00
|
|
|
if (!obj) return;
|
2003-02-08 20:22:45 -08:00
|
|
|
if (!obj->callbacks) return;
|
2013-04-11 12:08:24 -07:00
|
|
|
EINA_INLIST_FOREACH_SAFE(obj->callbacks, itr, info)
|
2007-01-22 04:44:57 -08:00
|
|
|
{
|
2016-08-10 07:23:04 -07:00
|
|
|
efl_event_callback_del(eo_obj, _legacy_evas_callback_table(info->type), _eo_evas_object_cb, info);
|
2003-01-19 19:54:00 -08:00
|
|
|
|
2013-04-11 12:08:24 -07:00
|
|
|
obj->callbacks =
|
|
|
|
eina_inlist_remove(obj->callbacks, EINA_INLIST_GET(info));
|
|
|
|
free(info);
|
2010-03-21 22:33:46 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-12-14 16:33:57 -08:00
|
|
|
void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_event_callback_cleanup(Evas_Object *eo_obj)
|
2002-12-14 16:33:57 -08:00
|
|
|
{
|
2013-04-11 12:08:24 -07:00
|
|
|
evas_object_event_callback_all_del(eo_obj);
|
2002-12-14 16:33:57 -08:00
|
|
|
}
|
|
|
|
|
2010-03-28 22:03:25 -07:00
|
|
|
void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_callback_all_del(Evas *eo_e)
|
2010-03-28 22:03:25 -07:00
|
|
|
{
|
2013-04-11 12:08:24 -07:00
|
|
|
_eo_evas_object_cb_info *info;
|
|
|
|
Eina_Inlist *itr;
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
|
2010-03-28 22:03:25 -07:00
|
|
|
|
2012-11-11 18:22:39 -08:00
|
|
|
if (!e) return;
|
2010-03-28 22:03:25 -07:00
|
|
|
if (!e->callbacks) return;
|
2013-04-11 12:08:24 -07:00
|
|
|
|
|
|
|
EINA_INLIST_FOREACH_SAFE(e->callbacks, itr, info)
|
|
|
|
{
|
2016-08-10 07:23:04 -07:00
|
|
|
efl_event_callback_del(eo_e, _legacy_evas_callback_table(info->type), _eo_evas_cb, info);
|
2013-04-11 12:08:24 -07:00
|
|
|
|
|
|
|
e->callbacks =
|
|
|
|
eina_inlist_remove(e->callbacks, EINA_INLIST_GET(info));
|
|
|
|
free(info);
|
|
|
|
}
|
2010-03-28 22:03:25 -07:00
|
|
|
}
|
|
|
|
|
2010-03-28 19:40:49 -07:00
|
|
|
void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_callback_cleanup(Evas *eo_e)
|
2010-03-28 19:40:49 -07:00
|
|
|
{
|
2013-04-11 12:08:24 -07:00
|
|
|
evas_event_callback_all_del(eo_e);
|
2010-03-28 19:40:49 -07:00
|
|
|
}
|
|
|
|
|
2010-01-31 20:26:55 -08:00
|
|
|
void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_callback_call(Evas *eo_e, Evas_Callback_Type type, void *event_info)
|
2010-01-31 20:26:55 -08:00
|
|
|
{
|
2016-08-10 07:23:04 -07:00
|
|
|
efl_event_callback_call(eo_e, _legacy_evas_callback_table(type), event_info);
|
2010-01-31 20:26:55 -08:00
|
|
|
}
|
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
void
|
2016-06-01 04:40:18 -07:00
|
|
|
evas_object_event_callback_call(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj,
|
|
|
|
Evas_Callback_Type type, void *event_info, int event_id,
|
2016-08-10 07:23:04 -07:00
|
|
|
const Efl_Event_Description *efl_event_desc, Efl_Event *efl_event_info)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2002-11-23 20:06:08 -08:00
|
|
|
/* MEM OK */
|
2016-08-17 04:29:39 -07:00
|
|
|
const Evas_Button_Flags mask = EVAS_BUTTON_DOUBLE_CLICK | EVAS_BUTTON_TRIPLE_CLICK;
|
2006-08-25 13:47:32 -07:00
|
|
|
Evas_Button_Flags flags = EVAS_BUTTON_NONE;
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Public_Data *e;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2012-11-11 18:22:39 -08:00
|
|
|
if (!obj) return;
|
2010-08-29 15:59:11 -07:00
|
|
|
if ((obj->delete_me) || (!obj->layer)) return;
|
2011-12-14 22:23:53 -08:00
|
|
|
if ((obj->last_event == event_id) &&
|
From: Hyoyoung Chang <hyoyoung.chang@samsung.com>
Subject: [E-devel] [patch] evas - add checking event type
Dear developers.
I found a bug about evas event handling.
In some situation, evas blocks some events by checking _evas_event_counter.
So I made a patch that is checking event type also event counter.
Reproduce steps:
1. make a window
2. show window before adding a elementary/genlist widget
--- codes ---
void _gl_mousedown_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info)
{
printf("_gl_mousedown_cb !! \n");
}
static Eina_Bool create_main_win(App *app)
{
app->win = elm_win_add(NULL, "genlist-win", ELM_WIN_BASIC);
evas_object_show(app->win); <-- position 1
Evas_Object *genlist = elm_genlist_add(app->win);
elm_win_resize_object_add(app->win, genlist);
evas_object_event_callback_add(genlist, EVAS_CALLBACK_MOUSE_DOWN, _gl_mousedown_cb, NULL);
evas_object_show(genlist);
evas_object_resize(app->win, 320, 240);
//evas_object_show(app->win); <-- position 2
return EINA_TRUE;
}
--- codes ---
In common use case, apps don't show main window at position 1.
However to reproduce, it can be at position 1. Then, focus is at just on main window.
In that situation, if a user clicks a genlist, its event is dropped by evas.
Because in mouse down callback, it give focus to genlist.
Then two events is made. First is mouse down, second is focus handling.
In event callback, evas processes mouse down after focus handling.
But evas found that mouse event is retarded event than focus handling.
So it ignores it.
This patch is introduce event handling type checking to
evas_object_event_callback_call.
SVN revision: 61026
2011-07-04 18:33:59 -07:00
|
|
|
(obj->last_event_type == type)) return;
|
2012-02-13 03:25:23 -08:00
|
|
|
if (obj->last_event > event_id)
|
|
|
|
{
|
|
|
|
if ((obj->last_event_type == EVAS_CALLBACK_MOUSE_OUT) &&
|
|
|
|
((type >= EVAS_CALLBACK_MOUSE_DOWN) &&
|
|
|
|
(type <= EVAS_CALLBACK_MULTI_MOVE)))
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2011-12-14 22:23:53 -08:00
|
|
|
obj->last_event = event_id;
|
From: Hyoyoung Chang <hyoyoung.chang@samsung.com>
Subject: [E-devel] [patch] evas - add checking event type
Dear developers.
I found a bug about evas event handling.
In some situation, evas blocks some events by checking _evas_event_counter.
So I made a patch that is checking event type also event counter.
Reproduce steps:
1. make a window
2. show window before adding a elementary/genlist widget
--- codes ---
void _gl_mousedown_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info)
{
printf("_gl_mousedown_cb !! \n");
}
static Eina_Bool create_main_win(App *app)
{
app->win = elm_win_add(NULL, "genlist-win", ELM_WIN_BASIC);
evas_object_show(app->win); <-- position 1
Evas_Object *genlist = elm_genlist_add(app->win);
elm_win_resize_object_add(app->win, genlist);
evas_object_event_callback_add(genlist, EVAS_CALLBACK_MOUSE_DOWN, _gl_mousedown_cb, NULL);
evas_object_show(genlist);
evas_object_resize(app->win, 320, 240);
//evas_object_show(app->win); <-- position 2
return EINA_TRUE;
}
--- codes ---
In common use case, apps don't show main window at position 1.
However to reproduce, it can be at position 1. Then, focus is at just on main window.
In that situation, if a user clicks a genlist, its event is dropped by evas.
Because in mouse down callback, it give focus to genlist.
Then two events is made. First is mouse down, second is focus handling.
In event callback, evas processes mouse down after focus handling.
But evas found that mouse event is retarded event than focus handling.
So it ignores it.
This patch is introduce event handling type checking to
evas_object_event_callback_call.
SVN revision: 61026
2011-07-04 18:33:59 -07:00
|
|
|
obj->last_event_type = type;
|
2010-08-29 15:59:11 -07:00
|
|
|
if (!(e = obj->layer->evas)) return;
|
2009-09-03 22:13:19 -07:00
|
|
|
|
2007-04-29 21:22:42 -07:00
|
|
|
_evas_walk(e);
|
2016-02-01 15:46:50 -08:00
|
|
|
|
2016-08-19 00:40:57 -07:00
|
|
|
if (!_evas_object_callback_has_by_type(obj, type))
|
2016-02-01 15:46:50 -08:00
|
|
|
goto nothing_here;
|
|
|
|
|
2016-08-17 04:29:39 -07:00
|
|
|
if ((type == EVAS_CALLBACK_MOUSE_DOWN) || (type == EVAS_CALLBACK_MOUSE_UP))
|
2003-12-11 03:20:40 -08:00
|
|
|
{
|
2016-08-17 04:29:39 -07:00
|
|
|
flags = efl_event_pointer_button_flags_get(efl_event_info);
|
|
|
|
if (flags & mask)
|
|
|
|
{
|
|
|
|
if (obj->last_mouse_down_counter < (e->last_mouse_down_counter - 1))
|
|
|
|
efl_event_pointer_button_flags_set(efl_event_info, flags & ~mask);
|
|
|
|
}
|
|
|
|
obj->last_mouse_down_counter = e->last_mouse_down_counter;
|
2016-05-18 12:27:58 -07:00
|
|
|
}
|
2009-09-03 22:13:19 -07:00
|
|
|
|
2016-08-10 02:59:36 -07:00
|
|
|
if (_evas_event_efl_event_info_exists(type))
|
2016-06-01 04:40:18 -07:00
|
|
|
{
|
2016-08-10 07:23:04 -07:00
|
|
|
efl_event_callback_call(eo_obj, efl_event_desc, efl_event_info);
|
2016-06-01 04:40:18 -07:00
|
|
|
}
|
2016-08-10 02:59:36 -07:00
|
|
|
else
|
|
|
|
{
|
|
|
|
efl_event_callback_call(eo_obj, _legacy_evas_callback_table(type), event_info);
|
2016-08-17 04:29:39 -07:00
|
|
|
if (efl_event_desc) CRI("Internal error with events!"); // FIXME
|
2016-08-10 02:59:36 -07:00
|
|
|
}
|
2016-06-01 04:40:18 -07:00
|
|
|
|
2016-08-17 04:29:39 -07:00
|
|
|
if ((type == EVAS_CALLBACK_MOUSE_DOWN) || (type == EVAS_CALLBACK_MOUSE_UP))
|
|
|
|
efl_event_pointer_button_flags_set(efl_event_info, flags);
|
2009-09-03 22:13:19 -07:00
|
|
|
|
2016-08-19 00:40:57 -07:00
|
|
|
nothing_here:
|
2013-04-11 12:08:24 -07:00
|
|
|
if (!obj->no_propagate)
|
2007-04-29 21:22:42 -07:00
|
|
|
{
|
2013-04-11 12:08:24 -07:00
|
|
|
if ((obj->smart.parent) && (type != EVAS_CALLBACK_FREE) &&
|
|
|
|
(type <= EVAS_CALLBACK_KEY_UP))
|
2011-12-14 21:56:19 -08:00
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Object_Protected_Data *smart_parent = efl_data_scope_get(obj->smart.parent, EFL_CANVAS_OBJECT_CLASS);
|
2016-08-10 07:23:04 -07:00
|
|
|
evas_object_event_callback_call(obj->smart.parent, smart_parent, type, event_info, event_id, efl_event_desc, efl_event_info);
|
2011-12-14 21:56:19 -08:00
|
|
|
}
|
2007-04-29 21:22:42 -07:00
|
|
|
}
|
|
|
|
_evas_unwalk(e);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_event_callback_add(Evas_Object *eo_obj, Evas_Callback_Type type, Evas_Object_Event_Cb func, const void *data)
|
2011-08-17 04:55:29 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_event_callback_priority_add(eo_obj, type,
|
2011-12-14 21:56:19 -08:00
|
|
|
EVAS_CALLBACK_PRIORITY_DEFAULT, func, data);
|
2011-08-17 04:55:29 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_event_callback_priority_add(Evas_Object *eo_obj, Evas_Callback_Type type, Evas_Callback_Priority priority, Evas_Object_Event_Cb func, const void *data)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
|
2002-11-08 00:02:15 -08:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2015-09-27 23:19:32 -07:00
|
|
|
if (!obj) return;
|
2002-11-08 00:02:15 -08:00
|
|
|
if (!func) return;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2013-04-11 12:08:24 -07:00
|
|
|
_eo_evas_object_cb_info *cb_info = calloc(1, sizeof(*cb_info));
|
|
|
|
cb_info->func = func;
|
|
|
|
cb_info->data = (void *)data;
|
|
|
|
cb_info->type = type;
|
2016-08-10 02:59:36 -07:00
|
|
|
cb_info->efl_event_info = _evas_event_efl_event_info_exists(type);
|
2011-12-14 21:56:19 -08:00
|
|
|
|
2016-08-10 07:23:04 -07:00
|
|
|
const Efl_Event_Description *desc = _legacy_evas_callback_table(type);
|
|
|
|
efl_event_callback_priority_add(eo_obj, desc, priority, _eo_evas_object_cb, cb_info);
|
2013-04-11 12:08:24 -07:00
|
|
|
|
|
|
|
obj->callbacks =
|
|
|
|
eina_inlist_append(obj->callbacks, EINA_INLIST_GET(cb_info));
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void *
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_event_callback_del(Evas_Object *eo_obj, Evas_Callback_Type type, Evas_Object_Event_Cb func)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2013-04-11 12:08:24 -07:00
|
|
|
_eo_evas_object_cb_info *info;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
|
2002-11-08 00:02:15 -08:00
|
|
|
return NULL;
|
|
|
|
MAGIC_CHECK_END();
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2012-11-11 18:22:39 -08:00
|
|
|
if (!obj) return NULL;
|
2002-11-08 00:02:15 -08:00
|
|
|
if (!func) return NULL;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2003-02-08 20:22:45 -08:00
|
|
|
if (!obj->callbacks) return NULL;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2015-04-20 00:31:36 -07:00
|
|
|
EINA_INLIST_REVERSE_FOREACH(obj->callbacks, info)
|
2007-01-22 04:44:57 -08:00
|
|
|
{
|
2013-04-11 12:08:24 -07:00
|
|
|
if ((info->func == func) && (info->type == type))
|
2011-12-14 21:56:19 -08:00
|
|
|
{
|
2013-04-11 12:08:24 -07:00
|
|
|
void *tmp = info->data;
|
2016-08-10 07:23:04 -07:00
|
|
|
efl_event_callback_del(eo_obj, _legacy_evas_callback_table(type), _eo_evas_object_cb, info);
|
2011-12-14 21:56:19 -08:00
|
|
|
|
2013-04-11 12:08:24 -07:00
|
|
|
obj->callbacks =
|
|
|
|
eina_inlist_remove(obj->callbacks, EINA_INLIST_GET(info));
|
|
|
|
free(info);
|
2011-12-14 21:56:19 -08:00
|
|
|
return tmp;
|
|
|
|
}
|
2007-01-22 04:44:57 -08:00
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
return NULL;
|
|
|
|
}
|
2008-06-03 13:33:40 -07:00
|
|
|
|
|
|
|
EAPI void *
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_event_callback_del_full(Evas_Object *eo_obj, Evas_Callback_Type type, Evas_Object_Event_Cb func, const void *data)
|
2008-06-03 13:33:40 -07:00
|
|
|
{
|
2013-04-11 12:08:24 -07:00
|
|
|
_eo_evas_object_cb_info *info;
|
2008-06-03 13:33:40 -07:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
|
2008-06-03 13:33:40 -07:00
|
|
|
return NULL;
|
|
|
|
MAGIC_CHECK_END();
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
|
2008-06-03 13:33:40 -07:00
|
|
|
|
2012-11-11 18:22:39 -08:00
|
|
|
if (!obj) return NULL;
|
2008-06-03 13:33:40 -07:00
|
|
|
if (!func) return NULL;
|
|
|
|
|
|
|
|
if (!obj->callbacks) return NULL;
|
|
|
|
|
2013-04-11 12:08:24 -07:00
|
|
|
EINA_INLIST_FOREACH(obj->callbacks, info)
|
2008-06-03 13:33:40 -07:00
|
|
|
{
|
2013-04-11 12:08:24 -07:00
|
|
|
if ((info->func == func) && (info->type == type) && info->data == data)
|
2011-12-14 21:56:19 -08:00
|
|
|
{
|
2013-04-11 12:08:24 -07:00
|
|
|
void *tmp = info->data;
|
2016-08-10 07:23:04 -07:00
|
|
|
efl_event_callback_del(eo_obj, _legacy_evas_callback_table(type), _eo_evas_object_cb, info);
|
2011-12-14 21:56:19 -08:00
|
|
|
|
2013-04-11 12:08:24 -07:00
|
|
|
obj->callbacks =
|
|
|
|
eina_inlist_remove(obj->callbacks, EINA_INLIST_GET(info));
|
|
|
|
free(info);
|
2011-12-14 21:56:19 -08:00
|
|
|
return tmp;
|
|
|
|
}
|
2008-06-03 13:33:40 -07:00
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
2008-11-01 14:50:36 -07:00
|
|
|
|
2010-01-31 20:26:55 -08:00
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_callback_add(Evas *eo_e, Evas_Callback_Type type, Evas_Event_Cb func, const void *data)
|
2011-08-17 04:55:29 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_callback_priority_add(eo_e, type, EVAS_CALLBACK_PRIORITY_DEFAULT,
|
2011-12-14 21:56:19 -08:00
|
|
|
func, data);
|
2011-08-17 04:55:29 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_callback_priority_add(Evas *eo_e, Evas_Callback_Type type, Evas_Callback_Priority priority, Evas_Event_Cb func, const void *data)
|
2010-01-31 20:26:55 -08:00
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
|
2010-01-31 20:26:55 -08:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
|
2010-01-31 20:26:55 -08:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
|
|
|
|
if (!func) return;
|
|
|
|
|
2013-04-11 12:08:24 -07:00
|
|
|
_eo_evas_cb_info *cb_info = calloc(1, sizeof(*cb_info));
|
|
|
|
cb_info->func = func;
|
|
|
|
cb_info->data = (void *)data;
|
|
|
|
cb_info->type = type;
|
2011-12-14 21:56:19 -08:00
|
|
|
|
2016-08-10 07:23:04 -07:00
|
|
|
const Efl_Event_Description *desc = _legacy_evas_callback_table(type);
|
|
|
|
efl_event_callback_priority_add(eo_e, desc, priority, _eo_evas_cb, cb_info);
|
2013-04-11 12:08:24 -07:00
|
|
|
|
|
|
|
e->callbacks = eina_inlist_append(e->callbacks, EINA_INLIST_GET(cb_info));
|
2010-01-31 20:26:55 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void *
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_callback_del(Evas *eo_e, Evas_Callback_Type type, Evas_Event_Cb func)
|
2010-01-31 20:26:55 -08:00
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
|
2013-04-11 12:08:24 -07:00
|
|
|
_eo_evas_cb_info *info;
|
2010-01-31 20:26:55 -08:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
|
2010-01-31 20:26:55 -08:00
|
|
|
return NULL;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
|
2012-11-11 18:22:39 -08:00
|
|
|
if (!e) return NULL;
|
2010-01-31 20:26:55 -08:00
|
|
|
if (!func) return NULL;
|
|
|
|
|
|
|
|
if (!e->callbacks) return NULL;
|
|
|
|
|
2015-12-16 23:03:26 -08:00
|
|
|
EINA_INLIST_REVERSE_FOREACH(e->callbacks, info)
|
2010-01-31 20:26:55 -08:00
|
|
|
{
|
2013-04-11 12:08:24 -07:00
|
|
|
if ((info->func == func) && (info->type == type))
|
2011-12-14 21:56:19 -08:00
|
|
|
{
|
2013-04-11 12:08:24 -07:00
|
|
|
void *tmp = info->data;
|
2016-08-10 07:23:04 -07:00
|
|
|
efl_event_callback_del(eo_e, _legacy_evas_callback_table(type), _eo_evas_cb, info);
|
2013-04-11 12:08:24 -07:00
|
|
|
|
|
|
|
e->callbacks =
|
|
|
|
eina_inlist_remove(e->callbacks, EINA_INLIST_GET(info));
|
|
|
|
free(info);
|
|
|
|
return tmp;
|
2011-12-14 21:56:19 -08:00
|
|
|
}
|
2010-01-31 20:26:55 -08:00
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void *
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_callback_del_full(Evas *eo_e, Evas_Callback_Type type, Evas_Event_Cb func, const void *data)
|
2010-01-31 20:26:55 -08:00
|
|
|
{
|
2013-04-11 12:08:24 -07:00
|
|
|
_eo_evas_cb_info *info;
|
2010-01-31 20:26:55 -08:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
|
2010-01-31 20:26:55 -08:00
|
|
|
return NULL;
|
|
|
|
MAGIC_CHECK_END();
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
|
2010-01-31 20:26:55 -08:00
|
|
|
|
2012-11-11 18:22:39 -08:00
|
|
|
if (!e) return NULL;
|
2010-01-31 20:26:55 -08:00
|
|
|
if (!func) return NULL;
|
|
|
|
|
|
|
|
if (!e->callbacks) return NULL;
|
|
|
|
|
2013-04-11 12:08:24 -07:00
|
|
|
EINA_INLIST_FOREACH(e->callbacks, info)
|
2010-01-31 20:26:55 -08:00
|
|
|
{
|
2013-04-11 12:08:24 -07:00
|
|
|
if ((info->func == func) && (info->type == type) && (info->data == data))
|
2011-12-14 21:56:19 -08:00
|
|
|
{
|
2013-04-11 12:08:24 -07:00
|
|
|
void *tmp = info->data;
|
2016-08-10 07:23:04 -07:00
|
|
|
efl_event_callback_del(eo_e, _legacy_evas_callback_table(type), _eo_evas_cb, info);
|
2011-12-14 21:56:19 -08:00
|
|
|
|
2013-04-11 12:08:24 -07:00
|
|
|
e->callbacks =
|
|
|
|
eina_inlist_remove(e->callbacks, EINA_INLIST_GET(info));
|
|
|
|
free(info);
|
2011-12-14 21:56:19 -08:00
|
|
|
return tmp;
|
|
|
|
}
|
2010-01-31 20:26:55 -08:00
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2010-05-04 08:58:10 -07:00
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_post_event_callback_push(Evas *eo_e, Evas_Object_Event_Post_Cb func, const void *data)
|
2010-05-04 08:58:10 -07:00
|
|
|
{
|
|
|
|
Evas_Post_Callback *pc;
|
2011-12-14 21:56:19 -08:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
|
2010-05-04 08:58:10 -07:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2011-12-14 21:56:19 -08:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
|
2012-11-11 18:22:39 -08:00
|
|
|
if (!e) return;
|
2010-11-26 02:01:18 -08:00
|
|
|
EVAS_MEMPOOL_INIT(_mp_pc, "evas_post_callback", Evas_Post_Callback, 64, );
|
|
|
|
pc = EVAS_MEMPOOL_ALLOC(_mp_pc, Evas_Post_Callback);
|
2010-05-04 08:58:10 -07:00
|
|
|
if (!pc) return;
|
2010-11-26 02:01:18 -08:00
|
|
|
EVAS_MEMPOOL_PREP(_mp_pc, pc, Evas_Post_Callback);
|
2010-05-04 08:58:10 -07:00
|
|
|
if (e->delete_me) return;
|
2011-12-14 21:56:19 -08:00
|
|
|
|
2010-05-04 08:58:10 -07:00
|
|
|
pc->func = func;
|
|
|
|
pc->data = data;
|
|
|
|
e->post_events = eina_list_prepend(e->post_events, pc);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_post_event_callback_remove(Evas *eo_e, Evas_Object_Event_Post_Cb func)
|
2010-05-04 08:58:10 -07:00
|
|
|
{
|
|
|
|
Evas_Post_Callback *pc;
|
|
|
|
Eina_List *l;
|
2011-12-14 21:56:19 -08:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
|
2010-05-04 08:58:10 -07:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2011-12-14 21:56:19 -08:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
|
2012-11-11 18:22:39 -08:00
|
|
|
if (!e) return;
|
2010-05-04 08:58:10 -07:00
|
|
|
EINA_LIST_FOREACH(e->post_events, l, pc)
|
|
|
|
{
|
|
|
|
if (pc->func == func)
|
|
|
|
{
|
|
|
|
pc->delete_me = 1;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_post_event_callback_remove_full(Evas *eo_e, Evas_Object_Event_Post_Cb func, const void *data)
|
2010-05-04 08:58:10 -07:00
|
|
|
{
|
|
|
|
Evas_Post_Callback *pc;
|
|
|
|
Eina_List *l;
|
2011-12-14 21:56:19 -08:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
|
2010-05-04 08:58:10 -07:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2011-12-14 21:56:19 -08:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
|
2012-11-11 18:22:39 -08:00
|
|
|
if (!e) return;
|
2010-05-04 08:58:10 -07:00
|
|
|
EINA_LIST_FOREACH(e->post_events, l, pc)
|
|
|
|
{
|
|
|
|
if ((pc->func == func) && (pc->data == data))
|
|
|
|
{
|
|
|
|
pc->delete_me = 1;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-08-19 00:20:39 -07:00
|
|
|
|
|
|
|
static void
|
|
|
|
_animator_repeater(void *data, const Eo_Event *event)
|
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *obj = data;
|
|
|
|
|
|
|
|
efl_event_callback_call(obj->object, EFL_EVENT_ANIMATOR_TICK, event->info);
|
|
|
|
DBG("Emitting animator tick on %p.", obj->object);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_check_event_catcher_add(void *data, const Eo_Event *event)
|
|
|
|
{
|
|
|
|
const Efl_Callback_Array_Item *array = event->info;
|
|
|
|
Evas_Object_Protected_Data *obj = data;
|
2016-08-19 00:40:57 -07:00
|
|
|
Evas_Callback_Type type = EVAS_CALLBACK_LAST;
|
2016-08-19 00:20:39 -07:00
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; array[i].desc != NULL; i++)
|
|
|
|
{
|
|
|
|
if (array[i].desc == EFL_EVENT_ANIMATOR_TICK)
|
|
|
|
{
|
|
|
|
if (obj->animator_ref++ > 0) break;
|
|
|
|
|
|
|
|
efl_event_callback_add(obj->layer->evas->evas, EFL_EVENT_ANIMATOR_TICK, _animator_repeater, obj);
|
|
|
|
INF("Registering an animator tick on canvas %p for object %p.",
|
|
|
|
obj->layer->evas->evas, obj->object);
|
|
|
|
}
|
2016-08-19 00:40:57 -07:00
|
|
|
else if ((type = _legacy_evas_callback_type(array[i].desc)) != EVAS_CALLBACK_LAST)
|
2016-08-19 00:20:39 -07:00
|
|
|
{
|
2016-08-19 00:40:57 -07:00
|
|
|
obj->callback_mask |= (1 << type);
|
2016-08-19 00:20:39 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_check_event_catcher_del(void *data, const Eo_Event *event)
|
|
|
|
{
|
|
|
|
const Efl_Callback_Array_Item *array = event->info;
|
|
|
|
Evas_Object_Protected_Data *obj = data;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; array[i].desc != NULL; i++)
|
|
|
|
{
|
|
|
|
if (array[i].desc == EFL_EVENT_ANIMATOR_TICK)
|
|
|
|
{
|
|
|
|
if ((--obj->animator_ref) > 0) break;
|
|
|
|
|
|
|
|
efl_event_callback_del(obj->layer->evas->evas, EFL_EVENT_ANIMATOR_TICK, _animator_repeater, obj);
|
|
|
|
INF("Unregistering an animator tick on canvas %p for object %p.",
|
|
|
|
obj->layer->evas->evas, obj->object);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
EFL_CALLBACKS_ARRAY_DEFINE(event_catcher_watch,
|
|
|
|
{ EFL_EVENT_CALLBACK_ADD, _check_event_catcher_add },
|
|
|
|
{ EFL_EVENT_CALLBACK_DEL, _check_event_catcher_del });
|
|
|
|
|
|
|
|
void
|
|
|
|
evas_object_callback_init(Efl_Canvas_Object *eo_obj, Evas_Object_Protected_Data *obj)
|
|
|
|
{
|
|
|
|
efl_event_callback_array_add(eo_obj, event_catcher_watch(), obj);
|
|
|
|
}
|