#include "evas_common_private.h"
#include "evas_private.h"
+#define EFL_INTERNAL_UNSTABLE
+#include "interfaces/efl_common_internal.h"
+
int _evas_event_counter = 0;
EVAS_MEMPOOL(_mp_pc);
Evas_Callback_Type type;
} _eo_evas_object_cb_info;
+typedef struct
+{
+ EINA_INLIST;
+ Evas_Event_Cb func;
+ void *data;
+ Evas_Callback_Type type;
+} _eo_evas_cb_info;
+
+
static inline void *
_pointer_event_get(const _eo_evas_object_cb_info *info, const Eo_Event *event,
const Eo_Event_Description **pdesc)
}
+static void
+_event_flags_adjust(void *ev, const Efl_Pointer_Event_Data *pedata)
+{
+#define EV_CASE(NEWTYPE, Type) \
+ case EFL_POINTER_ACTION_ ## NEWTYPE: \
+ ((Evas_Event_ ## Type *) ev)->event_flags = pedata->event_flags; \
+ break;
+
+ switch (pedata->action)
+ {
+ EV_CASE(MOVE, Mouse_Move);
+ EV_CASE(OUT, Mouse_Out);
+ EV_CASE(IN, Mouse_In);
+ EV_CASE(DOWN, Mouse_Down);
+ EV_CASE(UP, Mouse_Up);
+ EV_CASE(WHEEL, Mouse_Wheel);
+ default: break;
+ }
+
+#undef EV_CASE
+}
+
static Eina_Bool
_eo_evas_object_cb(void *data, const Eo_Event *event)
{
_eo_evas_object_cb_info *info = data;
const Eo_Event_Description *desc;
- void *pe = _pointer_event_get(info, event, &desc);
- if (pe) eo_event_callback_call(event->object, desc, pe);
- if (info->func) info->func(info->data, evas_object_evas_get(event->object), event->object, event->info);
+ Evas *evas = evas_object_evas_get(event->object);
+ void *pe;
+
+ pe = _pointer_event_get(info, event, &desc);
+ if (pe)
+ {
+ Efl_Pointer_Event_Data *pedata;
+ Efl_Pointer_Event_Flags flags;
+
+ pedata = eo_data_scope_get(pe, EFL_POINTER_EVENT_CLASS);
+ flags = pedata->event_flags;
+ eo_event_callback_call(event->object, desc, pe);
+ if (flags != pedata->event_flags)
+ _event_flags_adjust(event->info, pedata);
+ }
+ if (info->func)
+ {
+ info->func(info->data, evas, event->object, event->info);
+ // if event_flags changed, pe will be fixed in evas_events.c
+ }
+
return EINA_TRUE;
}
-typedef struct
-{
- EINA_INLIST;
- Evas_Event_Cb func;
- void *data;
- Evas_Callback_Type type;
-} _eo_evas_cb_info;
-
static Eina_Bool
_eo_evas_cb(void *data, const Eo_Event *event)
{
return evt;
}
+static inline void
+_pointer_event_flags_adjust(Efl_Pointer_Event_Data *pedata,
+ Evas_Callback_Type type, const void *ev)
+{
+#define EV_CASE(TYPE, Type) \
+ case EVAS_CALLBACK_ ## TYPE: \
+ pedata->event_flags = ((Evas_Event_ ## Type *) ev)->event_flags; \
+ break;
+
+ switch (type)
+ {
+ EV_CASE(MOUSE_MOVE, Mouse_Move);
+ EV_CASE(MOUSE_OUT, Mouse_Out);
+ EV_CASE(MOUSE_IN, Mouse_In);
+ EV_CASE(MOUSE_DOWN, Mouse_Down);
+ EV_CASE(MOUSE_UP, Mouse_Up);
+ EV_CASE(MULTI_MOVE, Multi_Move);
+ EV_CASE(MULTI_DOWN, Multi_Down);
+ EV_CASE(MULTI_UP, Multi_Up);
+ EV_CASE(MOUSE_WHEEL, Mouse_Wheel);
+ default: break;
+ }
+
+#undef EV_CASE
+}
+
#define EV_CALL(_eo_obj, _obj, _typ, _ev, _id, _pe) do { \
if (!_pe) _pe = _pointer_event_create(_typ, _ev, parent_pe, & _pe ## data); \
else efl_pointer_event_legacy_info_set(_pe, _ev, _typ); \
evas_object_event_callback_call(_eo_obj, _obj, _typ, _ev, _id); \
+ _pointer_event_flags_adjust(_pe ## data, _typ, _ev); \
} while (0)
#define EV_RESET(a) do { if (a) efl_event_reset(a); } while (0)
#define EV_DEL(a) do { if (a) { eo_unref(a); } a = NULL; } while (0)