summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-08-18 15:33:36 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-08-26 10:18:01 +0900
commit46c85b87fd65d0c9fc6f107cfc8748be386f8ad6 (patch)
treeea7d39b2eb056482df1ec8422d977edc4374decf
parent2857d7c2cfdb38d71f6870eb551d239a80af5331 (diff)
evas events: Switch multi move to new event type
Now only the single move remains. Almost done!
-rw-r--r--src/lib/evas/canvas/evas_events.c291
1 files changed, 120 insertions, 171 deletions
diff --git a/src/lib/evas/canvas/evas_events.c b/src/lib/evas/canvas/evas_events.c
index 8243607700..da39c98165 100644
--- a/src/lib/evas/canvas/evas_events.c
+++ b/src/lib/evas/canvas/evas_events.c
@@ -22,6 +22,9 @@ _canvas_event_feed_mouse_move_internal(Eo *eo_e, Evas_Public_Data *e, int x, int
22static void 22static void
23_canvas_event_feed_multi_up_internal(Evas_Public_Data *e, Efl_Event_Pointer_Data *ev); 23_canvas_event_feed_multi_up_internal(Evas_Public_Data *e, Efl_Event_Pointer_Data *ev);
24 24
25static void
26_canvas_event_feed_multi_move_internal(Evas_Public_Data *e, Efl_Event_Pointer_Data *ev);
27
25/* FIXME: remove this */ 28/* FIXME: remove this */
26static void 29static void
27_evas_event_havemap_adjust(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Evas_Coord *x, Evas_Coord *y, Eina_Bool mouse_grabbed) 30_evas_event_havemap_adjust(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Evas_Coord *x, Evas_Coord *y, Eina_Bool mouse_grabbed)
@@ -966,34 +969,37 @@ _evas_event_source_multi_up_events(Evas_Object_Protected_Data *obj, Evas_Public_
966} 969}
967 970
968static void 971static void
969_evas_event_source_multi_move_events(Evas_Object *eo_obj, Evas *eo_e, 972_evas_event_source_multi_move_events(Evas_Object_Protected_Data *obj, Evas_Public_Data *e,
970 Evas_Event_Multi_Move *ev, int event_id, 973 Efl_Event_Pointer *parent_ev, int event_id)
971 Efl_Event_Pointer *parent_pe)
972{ 974{
973 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); 975 Evas_Object *eo_src = _evas_object_image_source_get(obj->object);
974 Evas_Object *eo_src = _evas_object_image_source_get(eo_obj);
975 Evas_Object_Protected_Data *src = efl_data_scope_get(eo_src, EFL_CANVAS_OBJECT_CLASS); 976 Evas_Object_Protected_Data *src = efl_data_scope_get(eo_src, EFL_CANVAS_OBJECT_CLASS);
976 Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS); 977 Evas_Object_Protected_Data *child;
977 Evas_Coord_Precision_Point canvas = ev->cur.canvas; 978 Evas_Object *eo_child;
978 Efl_Event_Pointer *pe = NULL; 979 Eina_List *copy, *l;
980 Efl_Event_Pointer_Data *ev;
981 Efl_Event_Pointer *evt;
982 Eina_Vector2 point;
983 Evas *eo_e = e->evas;
979 984
980 if (obj->delete_me || src->delete_me || e->is_frozen) return; 985 if (obj->delete_me || src->delete_me || e->is_frozen) return;
981 986
982 _transform_to_src_space(obj, src, &ev->cur.canvas.x, &ev->cur.canvas.y); 987 evt = efl_event_dup(parent_ev);
983 988 ev = efl_data_scope_get(evt, EFL_EVENT_POINTER_CLASS);
984 //FIXME: transform precision 989 if (!ev) return;
985 990
986 Evas_Coord_Precision_Point point = ev->cur.canvas; 991 _transform_to_src_space_f(obj, src, &ev->cur);
992 point = ev->cur;
993 ev->source = obj->object;
994 ev->action = EFL_POINTER_ACTION_UP;
987 995
996 /* FIXME: Why a new event id here? Other 'source' events keep the same id. */
988 _evas_object_event_new(); 997 _evas_object_event_new();
989 event_id = _evas_event_counter; 998 event_id = _evas_event_counter;
990 Eina_List *l;
991 Evas_Object *eo_child;
992 Evas_Object_Protected_Data *child;
993 999
994 if (e->pointer.mouse_grabbed > 0) 1000 if (e->pointer.mouse_grabbed > 0)
995 { 1001 {
996 Eina_List *copy = evas_event_list_copy(src->proxy->src_event_in); 1002 copy = evas_event_list_copy(src->proxy->src_event_in);
997 EINA_LIST_FOREACH(copy, l, eo_child) 1003 EINA_LIST_FOREACH(copy, l, eo_child)
998 { 1004 {
999 child = efl_data_scope_get(eo_child, EFL_CANVAS_OBJECT_CLASS); 1005 child = efl_data_scope_get(eo_child, EFL_CANVAS_OBJECT_CLASS);
@@ -1003,13 +1009,11 @@ _evas_event_source_multi_move_events(Evas_Object *eo_obj, Evas *eo_e,
1003 (!evas_event_freezes_through(eo_child, child)) && 1009 (!evas_event_freezes_through(eo_child, child)) &&
1004 (!child->clip.clipees)))) 1010 (!child->clip.clipees))))
1005 { 1011 {
1006 ev->cur.canvas = point;
1007 _evas_event_havemap_adjust(eo_child, child,
1008 &ev->cur.canvas.x,
1009 &ev->cur.canvas.y,
1010 child->mouse_grabbed);
1011 child = efl_data_scope_get(eo_child, EFL_CANVAS_OBJECT_CLASS); 1012 child = efl_data_scope_get(eo_child, EFL_CANVAS_OBJECT_CLASS);
1012 EV_CALL(eo_child, child, EVAS_CALLBACK_MULTI_MOVE, ev, event_id, pe, parent_pe); 1013 ev->cur = point;
1014 _evas_event_havemap_adjust_f(eo_child, child, &ev->cur, child->mouse_grabbed);
1015 evas_object_event_callback_call(obj->object, obj, EVAS_CALLBACK_MULTI_MOVE, NULL,
1016 event_id, EFL_EVENT_POINTER_MOVE, ev->eo);
1013 if (e->delete_me || e->is_frozen) break; 1017 if (e->delete_me || e->is_frozen) break;
1014 } 1018 }
1015 } 1019 }
@@ -1022,19 +1026,20 @@ _evas_event_source_multi_move_events(Evas_Object *eo_obj, Evas *eo_e,
1022 if (src->is_smart) 1026 if (src->is_smart)
1023 { 1027 {
1024 int no_rep = 0; 1028 int no_rep = 0;
1025 ins = _evas_event_object_list_raw_in_get(eo_e, ins, evas_object_smart_members_get_direct(eo_src), NULL, ev->cur.canvas.x, ev->cur.canvas.y, &no_rep, EINA_TRUE); 1029 ins = _evas_event_object_list_raw_in_get
1030 (eo_e, ins, evas_object_smart_members_get_direct(eo_src), NULL,
1031 ev->cur.x, ev->cur.y, &no_rep, EINA_TRUE);
1026 } 1032 }
1027 else 1033 else
1028 ins = eina_list_append(ins, eo_src); 1034 ins = eina_list_append(ins, eo_src);
1029 Eina_List *copy = evas_event_list_copy(src->proxy->src_event_in); 1035
1036 copy = evas_event_list_copy(src->proxy->src_event_in);
1030 EINA_LIST_FOREACH(copy, l, eo_child) 1037 EINA_LIST_FOREACH(copy, l, eo_child)
1031 { 1038 {
1032 child = efl_data_scope_get(eo_child, EFL_CANVAS_OBJECT_CLASS); 1039 child = efl_data_scope_get(eo_child, EFL_CANVAS_OBJECT_CLASS);
1033 ev->cur.canvas = point; 1040 ev->cur = point;
1034 1041
1035 if (evas_object_is_in_output_rect(eo_child, child, 1042 if (evas_object_is_in_output_rect(eo_child, child, ev->cur.x, ev->cur.y, 1, 1) &&
1036 ev->cur.canvas.x,
1037 ev->cur.canvas.y, 1, 1) &&
1038 (evas_object_clippers_is_visible(eo_child, child) || 1043 (evas_object_clippers_is_visible(eo_child, child) ||
1039 child->mouse_grabbed) && 1044 child->mouse_grabbed) &&
1040 eina_list_data_find(ins, eo_child) && 1045 eina_list_data_find(ins, eo_child) &&
@@ -1042,15 +1047,11 @@ _evas_event_source_multi_move_events(Evas_Object *eo_obj, Evas *eo_e,
1042 (!evas_event_freezes_through(eo_child, child)) && 1047 (!evas_event_freezes_through(eo_child, child)) &&
1043 (!child->clip.clipees) && 1048 (!child->clip.clipees) &&
1044 ((!child->precise_is_inside) || 1049 ((!child->precise_is_inside) ||
1045 evas_object_is_inside(eo_child, child, ev->cur.canvas.x, 1050 evas_object_is_inside(eo_child, child, ev->cur.x, ev->cur.y)))
1046 ev->cur.canvas.y)))
1047 { 1051 {
1048 _evas_event_havemap_adjust(eo_child, child, 1052 _evas_event_havemap_adjust_f(eo_child, child, &ev->cur, child->mouse_grabbed);
1049 &ev->cur.canvas.x, 1053 evas_object_event_callback_call(obj->object, obj, EVAS_CALLBACK_MULTI_MOVE, NULL,
1050 &ev->cur.canvas.y, 1054 event_id, EFL_EVENT_POINTER_MOVE, ev->eo);
1051 child->mouse_grabbed);
1052 child = efl_data_scope_get(eo_child, EFL_CANVAS_OBJECT_CLASS);
1053 EV_CALL(eo_child, child, EVAS_CALLBACK_MULTI_MOVE, ev, event_id, pe, parent_pe);
1054 if (e->delete_me || e->is_frozen) break; 1055 if (e->delete_me || e->is_frozen) break;
1055 } 1056 }
1056 } 1057 }
@@ -1068,8 +1069,7 @@ _evas_event_source_multi_move_events(Evas_Object *eo_obj, Evas *eo_e,
1068 eina_list_free(ins); 1069 eina_list_free(ins);
1069 } 1070 }
1070 1071
1071 ev->cur.canvas = canvas; 1072 efl_del(evt);
1072 EV_DEL(pe);
1073} 1073}
1074 1074
1075static void 1075static void
@@ -2586,14 +2586,14 @@ _canvas_event_feed_multi_up_internal(Evas_Public_Data *e, Efl_Event_Pointer_Data
2586} 2586}
2587 2587
2588static inline void 2588static inline void
2589_canvas_event_feed_multi_updown_internal(Evas *eo_e, Evas_Public_Data *e, 2589_canvas_event_feed_multi_internal(Evas *eo_e, Evas_Public_Data *e,
2590 int d, int x, int y, 2590 int d, int x, int y,
2591 double rad, double radx, double rady, 2591 double rad, double radx, double rady,
2592 double pres, double ang, 2592 double pres, double ang,
2593 double fx, double fy, 2593 double fx, double fy,
2594 Evas_Button_Flags flags, 2594 Evas_Button_Flags flags,
2595 unsigned int timestamp, 2595 unsigned int timestamp,
2596 const void *data, Eina_Bool down) 2596 const void *data, Efl_Pointer_Action action)
2597{ 2597{
2598 Efl_Event_Pointer_Data *ev = NULL; 2598 Efl_Event_Pointer_Data *ev = NULL;
2599 Efl_Event_Pointer *evt; 2599 Efl_Event_Pointer *evt;
@@ -2604,6 +2604,7 @@ _canvas_event_feed_multi_updown_internal(Evas *eo_e, Evas_Public_Data *e,
2604 if (!fx) fx = x; 2604 if (!fx) fx = x;
2605 if (!fy) fy = y; 2605 if (!fy) fy = y;
2606 2606
2607 ev->action = action;
2607 ev->finger = d; 2608 ev->finger = d;
2608 ev->cur.x = fx; 2609 ev->cur.x = fx;
2609 ev->cur.y = fy; 2610 ev->cur.y = fy;
@@ -2617,15 +2618,21 @@ _canvas_event_feed_multi_updown_internal(Evas *eo_e, Evas_Public_Data *e,
2617 ev->data = (void *) data; 2618 ev->data = (void *) data;
2618 ev->device = _evas_device_top_get(eo_e); 2619 ev->device = _evas_device_top_get(eo_e);
2619 2620
2620 if (down) 2621 switch (action)
2621 { 2622 {
2622 ev->action = EFL_POINTER_ACTION_DOWN; 2623 case EFL_POINTER_ACTION_DOWN:
2623 _canvas_event_feed_multi_down_internal(e, ev); 2624 _canvas_event_feed_multi_down_internal(e, ev);
2624 } 2625 break;
2625 else 2626
2626 { 2627 case EFL_POINTER_ACTION_UP:
2627 ev->action = EFL_POINTER_ACTION_UP;
2628 _canvas_event_feed_multi_up_internal(e, ev); 2628 _canvas_event_feed_multi_up_internal(e, ev);
2629 break;
2630
2631 case EFL_POINTER_ACTION_MOVE:
2632 _canvas_event_feed_multi_move_internal(e, ev);
2633 break;
2634
2635 default: break;
2629 } 2636 }
2630 2637
2631 efl_del(evt); 2638 efl_del(evt);
@@ -2635,90 +2642,75 @@ EAPI void
2635evas_event_input_multi_down(Eo *eo_e, int d, int x, int y, double rad, double radx, double rady, double pres, double ang, double fx, double fy, Evas_Button_Flags flags, unsigned int timestamp, const void *data) 2642evas_event_input_multi_down(Eo *eo_e, int d, int x, int y, double rad, double radx, double rady, double pres, double ang, double fx, double fy, Evas_Button_Flags flags, unsigned int timestamp, const void *data)
2636{ 2643{
2637 Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS); 2644 Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
2638 _canvas_event_feed_multi_updown_internal(eo_e, e, d, 2645 _canvas_event_feed_multi_internal(eo_e, e, d,
2639 x - e->framespace.x, y - e->framespace.y, 2646 x - e->framespace.x, y - e->framespace.y,
2640 rad, radx, rady, pres, ang, 2647 rad, radx, rady, pres, ang,
2641 fx, fy, flags, timestamp, data, EINA_TRUE); 2648 fx, fy, flags, timestamp, data, EFL_POINTER_ACTION_DOWN);
2642} 2649}
2643 2650
2644EAPI void 2651EAPI void
2645evas_event_feed_multi_down(Eo *eo_e, int d, int x, int y, double rad, double radx, double rady, double pres, double ang, double fx, double fy, Evas_Button_Flags flags, unsigned int timestamp, const void *data) 2652evas_event_feed_multi_down(Eo *eo_e, int d, int x, int y, double rad, double radx, double rady, double pres, double ang, double fx, double fy, Evas_Button_Flags flags, unsigned int timestamp, const void *data)
2646{ 2653{
2647 Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS); 2654 Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
2648 _canvas_event_feed_multi_updown_internal(eo_e, e, d, x, y, rad, radx, rady, pres, ang, 2655 _canvas_event_feed_multi_internal(eo_e, e, d, x, y, rad, radx, rady, pres, ang,
2649 fx, fy, flags, timestamp, data, EINA_TRUE); 2656 fx, fy, flags, timestamp, data, EFL_POINTER_ACTION_DOWN);
2650} 2657}
2651 2658
2652EAPI void 2659EAPI void
2653evas_event_input_multi_up(Eo *eo_e, int d, int x, int y, double rad, double radx, double rady, double pres, double ang, double fx, double fy, Evas_Button_Flags flags, unsigned int timestamp, const void *data) 2660evas_event_input_multi_up(Eo *eo_e, int d, int x, int y, double rad, double radx, double rady, double pres, double ang, double fx, double fy, Evas_Button_Flags flags, unsigned int timestamp, const void *data)
2654{ 2661{
2655 Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS); 2662 Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
2656 _canvas_event_feed_multi_updown_internal(eo_e, e, d, 2663 _canvas_event_feed_multi_internal(eo_e, e, d,
2657 x - e->framespace.x, y - e->framespace.y, 2664 x - e->framespace.x, y - e->framespace.y,
2658 rad, radx, rady, pres, ang, 2665 rad, radx, rady, pres, ang,
2659 fx, fy, flags, timestamp, data, EINA_FALSE); 2666 fx, fy, flags, timestamp, data, EFL_POINTER_ACTION_UP);
2660} 2667}
2661 2668
2662EAPI void 2669EAPI void
2663evas_event_feed_multi_up(Eo *eo_e, int d, int x, int y, double rad, double radx, double rady, double pres, double ang, double fx, double fy, Evas_Button_Flags flags, unsigned int timestamp, const void *data) 2670evas_event_feed_multi_up(Eo *eo_e, int d, int x, int y, double rad, double radx, double rady, double pres, double ang, double fx, double fy, Evas_Button_Flags flags, unsigned int timestamp, const void *data)
2664{ 2671{
2665 Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS); 2672 Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
2666 _canvas_event_feed_multi_updown_internal(eo_e, e, d, x, y, rad, radx, rady, pres, ang, 2673 _canvas_event_feed_multi_internal(eo_e, e, d, x, y, rad, radx, rady, pres, ang,
2667 fx, fy, flags, timestamp, data, EINA_FALSE); 2674 fx, fy, flags, timestamp, data, EFL_POINTER_ACTION_UP);
2668} 2675}
2669 2676
2670static void 2677static void
2671_canvas_event_feed_multi_move_internal(Eo *eo_e, void *_pd, int d, int x, 2678_canvas_event_feed_multi_move_internal(Evas_Public_Data *e, Efl_Event_Pointer_Data *ev)
2672 int y, double rad, double radx,
2673 double rady, double pres, double ang,
2674 double fx, double fy,
2675 unsigned int timestamp,
2676 const void *data,
2677 Efl_Event_Pointer *parent_pe)
2678{ 2679{
2679 Evas_Public_Data *e = _pd; 2680 Eina_List *l, *copy;
2680 Efl_Event_Pointer *pe = NULL; 2681 Evas_Object *eo_obj;
2682 Eina_Vector2 point;
2683 Evas *eo_e;
2684 int event_id;
2685
2686 if (!e || !ev) return;
2687
2688 eo_e = e->evas;
2689 _evas_object_event_new();
2690 event_id = _evas_event_counter;
2681 2691
2682 if (e->is_frozen) return; 2692 if (e->is_frozen) return;
2683 e->last_timestamp = timestamp; 2693 e->last_timestamp = ev->timestamp;
2684 2694
2685 if ((!e->pointer.inside) && (e->pointer.mouse_grabbed == 0)) return; 2695 if ((!e->pointer.inside) && (e->pointer.mouse_grabbed == 0)) return;
2686 2696
2697 ev->cur.x = e->pointer.x;
2698 ev->cur.y = e->pointer.y;
2699 ev->modifiers = &(e->modifiers);
2700 ev->locks = &(e->locks);
2701 ev->event_flags = e->default_event_flags;
2702 ev->action = EFL_POINTER_ACTION_MOVE;
2703 if (ev->device) efl_ref(ev->device);
2704
2705 point = ev->cur;
2706
2687 _evas_walk(e); 2707 _evas_walk(e);
2688 /* update moved touch point */ 2708 /* update moved touch point */
2689 _evas_touch_point_update(eo_e, d, x, y, EVAS_TOUCH_POINT_MOVE); 2709 _evas_touch_point_update(eo_e, ev->finger, ev->cur.x, ev->cur.y, EVAS_TOUCH_POINT_MOVE);
2690 /* if our mouse button is grabbed to any objects */ 2710 /* if our mouse button is grabbed to any objects */
2691 if (e->pointer.mouse_grabbed > 0) 2711 if (e->pointer.mouse_grabbed > 0)
2692 { 2712 {
2693 /* go thru old list of in objects */ 2713 /* go thru old list of in objects */
2694 Eina_List *l, *copy;
2695 Evas_Event_Multi_Move ev;
2696 Evas_Object *eo_obj;
2697 int event_id = 0;
2698
2699 _evas_object_event_new();
2700
2701 event_id = _evas_event_counter;
2702 ev.device = d;
2703 ev.cur.output.x = x;
2704 ev.cur.output.y = y;
2705 ev.cur.canvas.x = x;
2706 ev.cur.canvas.y = y;
2707 ev.radius = rad;
2708 ev.radius_x = radx;
2709 ev.radius_y = rady;
2710 ev.pressure = pres;
2711 ev.angle = ang;
2712 ev.cur.canvas.xsub = fx;
2713 ev.cur.canvas.ysub = fy;
2714 ev.data = (void *)data;
2715 ev.modifiers = &(e->modifiers);
2716 ev.locks = &(e->locks);
2717 ev.timestamp = timestamp;
2718 ev.event_flags = e->default_event_flags;
2719 ev.dev = _evas_device_top_get(eo_e);
2720 if (ev.dev) efl_ref(ev.dev);
2721
2722 copy = evas_event_list_copy(e->pointer.object.in); 2714 copy = evas_event_list_copy(e->pointer.object.in);
2723 EINA_LIST_FOREACH(copy, l, eo_obj) 2715 EINA_LIST_FOREACH(copy, l, eo_obj)
2724 { 2716 {
@@ -2731,59 +2723,25 @@ _canvas_event_feed_multi_move_internal(Eo *eo_e, void *_pd, int d, int x,
2731 obj->mouse_grabbed) && 2723 obj->mouse_grabbed) &&
2732 (!obj->clip.clipees)) 2724 (!obj->clip.clipees))
2733 { 2725 {
2734 ev.cur.canvas.x = x; 2726 ev->cur = point;
2735 ev.cur.canvas.y = y; 2727 _evas_event_havemap_adjust_f(eo_obj, obj, &ev->cur, obj->mouse_grabbed);
2736 ev.cur.canvas.xsub = fx; 2728 evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MULTI_MOVE, NULL,
2737 ev.cur.canvas.ysub = fy; 2729 event_id, EFL_EVENT_POINTER_MOVE, ev->eo);
2738 _evas_event_havemap_adjust(eo_obj, obj, &ev.cur.canvas.x, &ev.cur.canvas.y, obj->mouse_grabbed);
2739 if (x != ev.cur.canvas.x)
2740 ev.cur.canvas.xsub = ev.cur.canvas.x; // fixme - lost precision
2741 if (y != ev.cur.canvas.y)
2742 ev.cur.canvas.ysub = ev.cur.canvas.y; // fixme - lost precision
2743 EV_CALL(eo_obj, obj, EVAS_CALLBACK_MULTI_MOVE, &ev, event_id, pe, parent_pe);
2744 if ((obj->proxy->is_proxy) || (obj->proxy->src_events)) 2730 if ((obj->proxy->is_proxy) || (obj->proxy->src_events))
2745 _evas_event_source_multi_move_events(eo_obj, eo_e, &ev, event_id, pe); 2731 _evas_event_source_multi_move_events(obj, e, ev->eo, event_id);
2746 2732
2747 if (e->delete_me || e->is_frozen) break; 2733 if (e->delete_me || e->is_frozen) break;
2748 } 2734 }
2749 } 2735 }
2750 eina_list_free(copy); 2736 eina_list_free(copy);
2751 _evas_post_event_callback_call(eo_e, e); 2737 _evas_post_event_callback_call(eo_e, e);
2752 if (ev.dev) efl_unref(ev.dev);
2753 } 2738 }
2754 else 2739 else
2755 { 2740 {
2756 Eina_List *ins; 2741 Eina_List *ins;
2757 Eina_List *l, *copy;
2758 Evas_Event_Multi_Move ev;
2759 Evas_Object *eo_obj;
2760 int event_id = 0;
2761
2762 _evas_object_event_new();
2763
2764 event_id = _evas_event_counter;
2765 ev.device = d;
2766 ev.cur.output.x = x;
2767 ev.cur.output.y = y;
2768 ev.cur.canvas.x = x;
2769 ev.cur.canvas.y = y;
2770 ev.radius = rad;
2771 ev.radius_x = radx;
2772 ev.radius_y = rady;
2773 ev.pressure = pres;
2774 ev.angle = ang;
2775 ev.cur.canvas.xsub = fx;
2776 ev.cur.canvas.ysub = fy;
2777 ev.data = (void *)data;
2778 ev.modifiers = &(e->modifiers);
2779 ev.locks = &(e->locks);
2780 ev.timestamp = timestamp;
2781 ev.event_flags = e->default_event_flags;
2782 ev.dev = _evas_device_top_get(eo_e);
2783 if (ev.dev) efl_ref(ev.dev);
2784 2742
2785 /* get all new in objects */ 2743 /* get all new in objects */
2786 ins = evas_event_objects_event_list(eo_e, NULL, x, y); 2744 ins = evas_event_objects_event_list(eo_e, NULL, ev->cur.x, ev->cur.y);
2787 /* go thru old list of in objects */ 2745 /* go thru old list of in objects */
2788 copy = evas_event_list_copy(e->pointer.object.in); 2746 copy = evas_event_list_copy(e->pointer.object.in);
2789 EINA_LIST_FOREACH(copy, l, eo_obj) 2747 EINA_LIST_FOREACH(copy, l, eo_obj)
@@ -2793,7 +2751,7 @@ _canvas_event_feed_multi_move_internal(Eo *eo_e, void *_pd, int d, int x,
2793 /* in list */ 2751 /* in list */
2794 // FIXME: i don't think we need this 2752 // FIXME: i don't think we need this
2795 // evas_object_clip_recalc(eo_obj); 2753 // evas_object_clip_recalc(eo_obj);
2796 if (evas_object_is_in_output_rect(eo_obj, obj, x, y, 1, 1) && 2754 if (evas_object_is_in_output_rect(eo_obj, obj, ev->cur.x, ev->cur.y, 1, 1) &&
2797 (evas_object_clippers_is_visible(eo_obj, obj) || 2755 (evas_object_clippers_is_visible(eo_obj, obj) ||
2798 obj->mouse_grabbed) && 2756 obj->mouse_grabbed) &&
2799 eina_list_data_find(ins, eo_obj) && 2757 eina_list_data_find(ins, eo_obj) &&
@@ -2802,21 +2760,15 @@ _canvas_event_feed_multi_move_internal(Eo *eo_e, void *_pd, int d, int x,
2802 (!evas_object_is_source_invisible(eo_obj, obj) || 2760 (!evas_object_is_source_invisible(eo_obj, obj) ||
2803 obj->mouse_grabbed) && 2761 obj->mouse_grabbed) &&
2804 (!obj->clip.clipees) && 2762 (!obj->clip.clipees) &&
2805 ((!obj->precise_is_inside) || evas_object_is_inside(eo_obj, obj, x, y)) 2763 ((!obj->precise_is_inside) || evas_object_is_inside(eo_obj, obj, ev->cur.x, ev->cur.y))
2806 ) 2764 )
2807 { 2765 {
2808 ev.cur.canvas.x = x; 2766 ev->cur = point;
2809 ev.cur.canvas.y = y; 2767 _evas_event_havemap_adjust_f(eo_obj, obj, &ev->cur, obj->mouse_grabbed);
2810 ev.cur.canvas.xsub = fx; 2768 evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MULTI_MOVE, NULL,
2811 ev.cur.canvas.ysub = fy; 2769 event_id, EFL_EVENT_POINTER_MOVE, ev->eo);
2812 _evas_event_havemap_adjust(eo_obj, obj, &ev.cur.canvas.x, &ev.cur.canvas.y, obj->mouse_grabbed);
2813 if (x != ev.cur.canvas.x)
2814 ev.cur.canvas.xsub = ev.cur.canvas.x; // fixme - lost precision
2815 if (y != ev.cur.canvas.y)
2816 ev.cur.canvas.ysub = ev.cur.canvas.y; // fixme - lost precision
2817 EV_CALL(eo_obj, obj, EVAS_CALLBACK_MULTI_MOVE, &ev, event_id, pe, parent_pe);
2818 if ((obj->proxy->is_proxy) || (obj->proxy->src_events)) 2770 if ((obj->proxy->is_proxy) || (obj->proxy->src_events))
2819 _evas_event_source_multi_move_events(eo_obj, eo_e, &ev, event_id, pe); 2771 _evas_event_source_multi_move_events(obj, e, ev->eo, event_id);
2820 } 2772 }
2821 if (e->delete_me || e->is_frozen) break; 2773 if (e->delete_me || e->is_frozen) break;
2822 } 2774 }
@@ -2834,28 +2786,31 @@ _canvas_event_feed_multi_move_internal(Eo *eo_e, void *_pd, int d, int x,
2834 eina_list_free(ins); 2786 eina_list_free(ins);
2835 } 2787 }
2836 _evas_post_event_callback_call(eo_e, e); 2788 _evas_post_event_callback_call(eo_e, e);
2837 if (ev.dev) efl_unref(ev.dev);
2838 } 2789 }
2839 _evas_unwalk(e); 2790 _evas_unwalk(e);
2840 EV_DEL(pe); 2791
2792 if (ev->device) efl_unref(ev->device);
2841} 2793}
2842 2794
2843EAPI void 2795EAPI void
2844evas_event_input_multi_move(Eo *eo_e, int d, int x, int y, double rad, double radx, double rady, double pres, double ang, double fx, double fy, unsigned int timestamp, const void *data) 2796evas_event_input_multi_move(Eo *eo_e, int d, int x, int y, double rad, double radx, double rady, double pres, double ang, double fx, double fy, unsigned int timestamp, const void *data)
2845{ 2797{
2798 EINA_SAFETY_ON_FALSE_RETURN(efl_isa(eo_e, EVAS_CANVAS_CLASS));
2846 Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS); 2799 Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
2847 _canvas_event_feed_multi_move_internal(eo_e, e, d, 2800 _canvas_event_feed_multi_internal(eo_e, e, d, x - e->framespace.x, y - e->framespace.y,
2848 x - e->framespace.x, y - e->framespace.y, 2801 rad, radx, rady,
2849 rad, radx, rady, 2802 pres, ang, fx, fy, EVAS_BUTTON_NONE, timestamp, data,
2850 pres, ang, fx, fy, timestamp, data, NULL); 2803 EFL_POINTER_ACTION_MOVE);
2851} 2804}
2852 2805
2853EAPI void 2806EAPI void
2854evas_event_feed_multi_move(Eo *eo_e, int d, int x, int y, double rad, double radx, double rady, double pres, double ang, double fx, double fy, unsigned int timestamp, const void *data) 2807evas_event_feed_multi_move(Eo *eo_e, int d, int x, int y, double rad, double radx, double rady, double pres, double ang, double fx, double fy, unsigned int timestamp, const void *data)
2855{ 2808{
2809 EINA_SAFETY_ON_FALSE_RETURN(efl_isa(eo_e, EVAS_CANVAS_CLASS));
2856 Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS); 2810 Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
2857 _canvas_event_feed_multi_move_internal(eo_e, e, d, x, y, rad, radx, rady, 2811 _canvas_event_feed_multi_internal(eo_e, e, d, x, y, rad, radx, rady,
2858 pres, ang, fx, fy, timestamp, data, NULL); 2812 pres, ang, fx, fy, EVAS_BUTTON_NONE, timestamp, data,
2813 EFL_POINTER_ACTION_MOVE);
2859} 2814}
2860 2815
2861static void 2816static void
@@ -3473,13 +3428,7 @@ _evas_canvas_event_pointer_cb(void *data, const Eo_Event *event)
3473 ev->timestamp, ev->data, ev->eo); 3428 ev->timestamp, ev->data, ev->eo);
3474 } 3429 }
3475 else 3430 else
3476 { 3431 _canvas_event_feed_multi_move_internal(e, ev);
3477 _canvas_event_feed_multi_move_internal(eo_e, e, ev->finger, ev->cur.x, ev->cur.y,
3478 ev->radius, ev->radius_x, ev->radius_y,
3479 ev->pressure, ev->angle,
3480 ev->cur.x, ev->cur.y,
3481 ev->timestamp, ev->data, ev->eo);
3482 }
3483 break; 3432 break;
3484 3433
3485 case EFL_POINTER_ACTION_DOWN: 3434 case EFL_POINTER_ACTION_DOWN: