summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-08-18 12:01:39 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-08-26 10:18:01 +0900
commit328151f999c8be4351e8f2664fa802e0512f1fac (patch)
tree20862b9939e6fcecef56c182be9cc4cab2992d2f /src
parentedd88292a49a02db660b62b1a72368a761f4f46b (diff)
evas events: Switch mouse in/out events to the new event type
Diffstat (limited to 'src')
-rw-r--r--src/lib/evas/canvas/evas_events.c255
1 files changed, 127 insertions, 128 deletions
diff --git a/src/lib/evas/canvas/evas_events.c b/src/lib/evas/canvas/evas_events.c
index a281eb3..1135c81 100644
--- a/src/lib/evas/canvas/evas_events.c
+++ b/src/lib/evas/canvas/evas_events.c
@@ -1082,51 +1082,51 @@ _evas_event_source_multi_move_events(Evas_Object *eo_obj, Evas *eo_e,
1082 1082
1083static void 1083static void
1084_evas_event_source_mouse_in_events(Evas_Object *eo_obj, Evas *eo_e, 1084_evas_event_source_mouse_in_events(Evas_Object *eo_obj, Evas *eo_e,
1085 Evas_Event_Mouse_In *ev, int event_id, 1085 Efl_Event_Pointer *parent_ev, int event_id)
1086 Efl_Event_Pointer *parent_pe)
1087{ 1086{
1088 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); 1087 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
1089 Evas_Object *eo_src = _evas_object_image_source_get(eo_obj); 1088 Evas_Object *eo_src = _evas_object_image_source_get(eo_obj);
1090 Evas_Object_Protected_Data *src = efl_data_scope_get(eo_src, EFL_CANVAS_OBJECT_CLASS); 1089 Evas_Object_Protected_Data *src = efl_data_scope_get(eo_src, EFL_CANVAS_OBJECT_CLASS);
1091 Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS); 1090 Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
1092 Evas_Coord_Point canvas = ev->canvas; 1091 Evas_Object_Protected_Data *child;
1093 Efl_Event_Pointer *pe = NULL;
1094 Evas_Object *eo_child; 1092 Evas_Object *eo_child;
1095 Eina_List *ins = NULL; 1093 Eina_List *ins = NULL, *l;
1096 Eina_List *l; 1094 Efl_Event_Pointer_Data *ev;
1097 Evas_Coord_Point point; 1095 Efl_Event_Pointer *evt;
1096 Eina_Vector2 point;
1098 1097
1099 if (obj->delete_me || src->delete_me || e->is_frozen) return; 1098 if (obj->delete_me || src->delete_me || e->is_frozen) return;
1100 1099
1101 _transform_to_src_space(obj, src, &ev->canvas.x, &ev->canvas.y); 1100 evt = efl_event_dup(parent_ev);
1101 ev = efl_data_scope_get(evt, EFL_EVENT_POINTER_CLASS);
1102 if (!ev) return;
1102 1103
1103 ev->event_src = eo_obj; 1104 _transform_to_src_space_f(obj, src, &ev->cur);
1105 point = ev->cur;
1106 ev->source = eo_obj;
1107 ev->action = EFL_POINTER_ACTION_IN;
1104 1108
1105 if (src->is_smart) 1109 if (src->is_smart)
1106 { 1110 {
1107 int no_rep = 0; 1111 int no_rep = 0;
1108 ins = _evas_event_object_list_raw_in_get(eo_e, ins, evas_object_smart_members_get_direct(eo_src), NULL, ev->canvas.x, ev->canvas.y, &no_rep, EINA_TRUE); 1112 ins = _evas_event_object_list_raw_in_get(eo_e, ins, evas_object_smart_members_get_direct(eo_src),
1113 NULL, ev->cur.x, ev->cur.y, &no_rep, EINA_TRUE);
1109 1114
1110 } 1115 }
1111 else 1116 else
1112 ins = eina_list_append(ins, eo_src); 1117 ins = eina_list_append(ins, eo_src);
1113 1118
1114 point = ev->canvas;
1115 EINA_LIST_FOREACH(ins, l, eo_child) 1119 EINA_LIST_FOREACH(ins, l, eo_child)
1116 { 1120 {
1117 Evas_Object_Protected_Data *child = efl_data_scope_get(eo_child, 1121 child = efl_data_scope_get(eo_child, EFL_CANVAS_OBJECT_CLASS);
1118 EFL_CANVAS_OBJECT_CLASS);
1119 if (!eina_list_data_find(src->proxy->src_event_in, eo_child)) 1122 if (!eina_list_data_find(src->proxy->src_event_in, eo_child))
1120 { 1123 {
1121 if(child->mouse_in) continue; 1124 if (child->mouse_in) continue;
1122
1123 child->mouse_in = 1; 1125 child->mouse_in = 1;
1124 ev->canvas = point; 1126 ev->cur = point;
1125 1127 _evas_event_havemap_adjust_f(eo_child, child, &ev->cur, child->mouse_grabbed);
1126 _evas_event_havemap_adjust(eo_child, child, &ev->canvas.x, 1128 evas_object_event_callback_call(eo_child, child, EVAS_CALLBACK_MOUSE_IN, NULL,
1127 &ev->canvas.y, 1129 event_id, EFL_EVENT_POINTER_IN, evt);
1128 child->mouse_grabbed);
1129 EV_CALL(eo_child, child, EVAS_CALLBACK_MOUSE_IN, ev, event_id, pe, parent_pe);
1130 if (e->delete_me || e->is_frozen) break; 1130 if (e->delete_me || e->is_frozen) break;
1131 } 1131 }
1132 } 1132 }
@@ -1138,60 +1138,56 @@ _evas_event_source_mouse_in_events(Evas_Object *eo_obj, Evas *eo_e,
1138 } 1138 }
1139 EINA_COW_WRITE_END(evas_object_proxy_cow, src->proxy, proxy_write); 1139 EINA_COW_WRITE_END(evas_object_proxy_cow, src->proxy, proxy_write);
1140 1140
1141 ev->canvas = canvas; 1141 efl_del(evt);
1142 EV_DEL(pe);
1143} 1142}
1144 1143
1145static void 1144static void
1146_evas_event_source_mouse_out_events(Evas_Object *eo_obj, Evas *eo_e, 1145_evas_event_source_mouse_out_events(Evas_Object *eo_obj, Evas *eo_e,
1147 Evas_Event_Mouse_Out *ev, int event_id, 1146 Efl_Event_Pointer *parent_ev, int event_id)
1148 Efl_Event_Pointer *parent_pe)
1149{ 1147{
1150 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); 1148 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
1151 Evas_Object *eo_src = _evas_object_image_source_get(eo_obj); 1149 Evas_Object *eo_src = _evas_object_image_source_get(eo_obj);
1152 Evas_Object_Protected_Data *src = efl_data_scope_get(eo_src, EFL_CANVAS_OBJECT_CLASS); 1150 Evas_Object_Protected_Data *src = efl_data_scope_get(eo_src, EFL_CANVAS_OBJECT_CLASS);
1153 Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS); 1151 Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
1154 Evas_Coord_Point canvas = ev->canvas; 1152 Evas_Object_Protected_Data *child;
1155 Efl_Event_Pointer *pe = NULL;
1156 Evas_Object *eo_child; 1153 Evas_Object *eo_child;
1157 Eina_List *l; 1154 Eina_List *copy, *l;
1158 Eina_List *copy; 1155 Efl_Event_Pointer_Data *ev;
1159 Evas_Coord_Point point; 1156 Efl_Event_Pointer *evt;
1157 Eina_Vector2 point;
1160 1158
1161 if (obj->delete_me || src->delete_me || e->is_frozen) return; 1159 if (obj->delete_me || src->delete_me || e->is_frozen) return;
1162 1160
1163 _transform_to_src_space(obj, src, &ev->canvas.x, &ev->canvas.y); 1161 evt = efl_event_dup(parent_ev);
1162 ev = efl_data_scope_get(evt, EFL_EVENT_POINTER_CLASS);
1163 if (!ev) return;
1164 1164
1165 ev->event_src = eo_obj; 1165 _transform_to_src_space_f(obj, src, &ev->cur);
1166 point = ev->cur;
1167 ev->source = eo_obj;
1168 ev->action = EFL_POINTER_ACTION_OUT;
1166 1169
1167 copy = evas_event_list_copy(src->proxy->src_event_in); 1170 copy = evas_event_list_copy(src->proxy->src_event_in);
1168 point = ev->canvas;
1169
1170 EINA_LIST_FOREACH(copy, l, eo_child) 1171 EINA_LIST_FOREACH(copy, l, eo_child)
1171 { 1172 {
1172 Evas_Object_Protected_Data *child = efl_data_scope_get(eo_child, 1173 child = efl_data_scope_get(eo_child, EFL_CANVAS_OBJECT_CLASS);
1173 EFL_CANVAS_OBJECT_CLASS);
1174 if (!child->mouse_in) continue; 1174 if (!child->mouse_in) continue;
1175 child->mouse_in = 0; 1175 child->mouse_in = 0;
1176
1177 if (child->delete_me) continue; 1176 if (child->delete_me) continue;
1178 1177
1179 ev->canvas = point; 1178 ev->cur = point;
1180 1179 _evas_event_havemap_adjust_f(eo_child, child, &ev->cur, child->mouse_grabbed);
1181 _evas_event_havemap_adjust(eo_child, child, &ev->canvas.x, 1180 evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_OUT, NULL,
1182 &ev->canvas.y, child->mouse_grabbed); 1181 event_id, EFL_EVENT_POINTER_OUT, ev->eo);
1183 EV_CALL(eo_child, child, EVAS_CALLBACK_MOUSE_OUT, ev, event_id, pe, parent_pe);
1184 if (e->is_frozen) continue; 1182 if (e->is_frozen) continue;
1185 } 1183 }
1186
1187 eina_list_free(copy); 1184 eina_list_free(copy);
1188 1185
1189 EINA_COW_WRITE_BEGIN(evas_object_proxy_cow, src->proxy, Evas_Object_Proxy_Data, proxy_write) 1186 EINA_COW_WRITE_BEGIN(evas_object_proxy_cow, src->proxy, Evas_Object_Proxy_Data, proxy_write)
1190 proxy_write->src_event_in = eina_list_free(proxy_write->src_event_in); 1187 proxy_write->src_event_in = eina_list_free(proxy_write->src_event_in);
1191 EINA_COW_WRITE_END(evas_object_proxy_cow, src->proxy, proxy_write); 1188 EINA_COW_WRITE_END(evas_object_proxy_cow, src->proxy, proxy_write);
1192 1189
1193 ev->canvas = canvas; 1190 efl_del(evt);
1194 EV_DEL(pe);
1195} 1191}
1196 1192
1197static Eina_List * 1193static Eina_List *
@@ -1483,11 +1479,7 @@ _post_up_handle(Evas_Public_Data *e, Efl_Event_Pointer *parent_ev)
1483 evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_OUT, NULL, 1479 evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_OUT, NULL,
1484 event_id, EFL_EVENT_POINTER_OUT, evt); 1480 event_id, EFL_EVENT_POINTER_OUT, evt);
1485 if ((obj->proxy->is_proxy) && (obj->proxy->src_events)) 1481 if ((obj->proxy->is_proxy) && (obj->proxy->src_events))
1486 { 1482 _evas_event_source_mouse_out_events(eo_obj, eo_e, evt, event_id);
1487 // FIXME: TEMPORARY
1488 void *ev_out = efl_event_pointer_legacy_info_fill(evt, EVAS_CALLBACK_MOUSE_IN, NULL);
1489 _evas_event_source_mouse_out_events(eo_obj, eo_e, ev_out, event_id, evt);
1490 }
1491 if (e->delete_me) break; 1483 if (e->delete_me) break;
1492 } 1484 }
1493 } 1485 }
@@ -1520,11 +1512,7 @@ _post_up_handle(Evas_Public_Data *e, Efl_Event_Pointer *parent_ev)
1520 event_id, EFL_EVENT_POINTER_IN, evt); 1512 event_id, EFL_EVENT_POINTER_IN, evt);
1521 if ((obj_itr->proxy->is_proxy) && 1513 if ((obj_itr->proxy->is_proxy) &&
1522 (obj_itr->proxy->src_events)) 1514 (obj_itr->proxy->src_events))
1523 { 1515 _evas_event_source_mouse_in_events(eo_obj_itr, eo_e, evt, event_id);
1524 // FIXME: TEMPORARY
1525 void *ev_in = efl_event_pointer_legacy_info_fill(evt, EVAS_CALLBACK_MOUSE_IN, NULL);
1526 _evas_event_source_mouse_in_events(eo_obj_itr, eo_e, ev_in, event_id, evt);
1527 }
1528 if (e->delete_me) break; 1516 if (e->delete_me) break;
1529 } 1517 }
1530 } 1518 }
@@ -1722,7 +1710,7 @@ _canvas_event_feed_mouse_cancel_internal(Eo *eo_e, unsigned int timestamp, const
1722 if ((point->state == EVAS_TOUCH_POINT_DOWN) || 1710 if ((point->state == EVAS_TOUCH_POINT_DOWN) ||
1723 (point->state == EVAS_TOUCH_POINT_MOVE)) 1711 (point->state == EVAS_TOUCH_POINT_MOVE))
1724 _canvas_event_feed_multi_up_internal(eo_e, e, point->id, point->x, point->y, 1712 _canvas_event_feed_multi_up_internal(eo_e, e, point->id, point->x, point->y,
1725 0, 0, 0, 0, 0, 0, 0, 0, timestamp, data, NULL); 1713 0, 0, 0, 0, 0, 0, 0, 0, timestamp, data, parent_pe);
1726 } 1714 }
1727 evas_event_default_flags_set(eo_e, flags); 1715 evas_event_default_flags_set(eo_e, flags);
1728 _evas_unwalk(e); 1716 _evas_unwalk(e);
@@ -1761,6 +1749,7 @@ _canvas_event_feed_mouse_wheel_internal(Eo *eo_e, Efl_Event_Pointer_Data *pe)
1761 ev->locks = &(e->locks); 1749 ev->locks = &(e->locks);
1762 ev->event_flags = e->default_event_flags; 1750 ev->event_flags = e->default_event_flags;
1763 ev->device = efl_ref(_evas_device_top_get(eo_e)); 1751 ev->device = efl_ref(_evas_device_top_get(eo_e));
1752 ev->action = EFL_POINTER_ACTION_WHEEL;
1764 1753
1765 _evas_walk(e); 1754 _evas_walk(e);
1766 copy = evas_event_list_copy(e->pointer.object.in); 1755 copy = evas_event_list_copy(e->pointer.object.in);
@@ -1941,7 +1930,7 @@ _canvas_event_feed_mouse_move_internal(Eo *eo_e, Evas_Public_Data *e, int x, int
1941 e->pointer.object.in = eina_list_remove(e->pointer.object.in, eo_obj); 1930 e->pointer.object.in = eina_list_remove(e->pointer.object.in, eo_obj);
1942 EV_CALL(eo_obj, obj, EVAS_CALLBACK_MOUSE_OUT, &ev, event_id, peout, parent_pe); 1931 EV_CALL(eo_obj, obj, EVAS_CALLBACK_MOUSE_OUT, &ev, event_id, peout, parent_pe);
1943 if ((obj->proxy->is_proxy) && (obj->proxy->src_events)) 1932 if ((obj->proxy->is_proxy) && (obj->proxy->src_events))
1944 _evas_event_source_mouse_out_events(eo_obj, eo_e, &ev, event_id, peout); 1933 _evas_event_source_mouse_out_events(eo_obj, eo_e, peout, event_id);
1945 } 1934 }
1946 } 1935 }
1947 _evas_post_event_callback_call(eo_e, e); 1936 _evas_post_event_callback_call(eo_e, e);
@@ -2053,7 +2042,7 @@ _canvas_event_feed_mouse_move_internal(Eo *eo_e, Evas_Public_Data *e, int x, int
2053 obj->mouse_grabbed); 2042 obj->mouse_grabbed);
2054 EV_CALL(eo_obj, obj, EVAS_CALLBACK_MOUSE_OUT, &ev2, event_id, peout, parent_pe); 2043 EV_CALL(eo_obj, obj, EVAS_CALLBACK_MOUSE_OUT, &ev2, event_id, peout, parent_pe);
2055 if ((obj->proxy->is_proxy) && (obj->proxy->src_events)) 2044 if ((obj->proxy->is_proxy) && (obj->proxy->src_events))
2056 _evas_event_source_mouse_out_events(eo_obj, eo_e, &ev2, event_id, peout); 2045 _evas_event_source_mouse_out_events(eo_obj, eo_e, peout, event_id);
2057 if (e->delete_me) break; 2046 if (e->delete_me) break;
2058 } 2047 }
2059 } 2048 }
@@ -2084,7 +2073,7 @@ _canvas_event_feed_mouse_move_internal(Eo *eo_e, Evas_Public_Data *e, int x, int
2084 EV_CALL(eo_obj, obj, EVAS_CALLBACK_MOUSE_IN, &ev3, event_id2, pein, parent_pe); 2073 EV_CALL(eo_obj, obj, EVAS_CALLBACK_MOUSE_IN, &ev3, event_id2, pein, parent_pe);
2085 if ((obj->proxy->is_proxy) && 2074 if ((obj->proxy->is_proxy) &&
2086 (obj->proxy->src_events)) 2075 (obj->proxy->src_events))
2087 _evas_event_source_mouse_in_events(eo_obj, eo_e, &ev3, event_id2, pein); 2076 _evas_event_source_mouse_in_events(eo_obj, eo_e, pein, event_id);
2088 if (e->delete_me) break; 2077 if (e->delete_me) break;
2089 } 2078 }
2090 } 2079 }
@@ -2239,7 +2228,7 @@ nogrep:
2239 &ev2.canvas.y, obj->mouse_grabbed); 2228 &ev2.canvas.y, obj->mouse_grabbed);
2240 EV_CALL(eo_obj, obj, EVAS_CALLBACK_MOUSE_OUT, &ev2, event_id, peout, parent_pe); 2229 EV_CALL(eo_obj, obj, EVAS_CALLBACK_MOUSE_OUT, &ev2, event_id, peout, parent_pe);
2241 if ((obj->proxy->is_proxy) && (obj->proxy->src_events)) 2230 if ((obj->proxy->is_proxy) && (obj->proxy->src_events))
2242 _evas_event_source_mouse_out_events(eo_obj, eo_e, &ev2, event_id, peout); 2231 _evas_event_source_mouse_out_events(eo_obj, eo_e, peout, event_id);
2243 } 2232 }
2244 if (e->delete_me) break; 2233 if (e->delete_me) break;
2245 } 2234 }
@@ -2266,7 +2255,7 @@ nogrep:
2266 &ev3.canvas.y, obj->mouse_grabbed); 2255 &ev3.canvas.y, obj->mouse_grabbed);
2267 EV_CALL(eo_obj, obj, EVAS_CALLBACK_MOUSE_IN, &ev3, event_id2, pein, parent_pe); 2256 EV_CALL(eo_obj, obj, EVAS_CALLBACK_MOUSE_IN, &ev3, event_id2, pein, parent_pe);
2268 if ((obj->proxy->is_proxy) && (obj->proxy->src_events)) 2257 if ((obj->proxy->is_proxy) && (obj->proxy->src_events))
2269 _evas_event_source_mouse_in_events(eo_obj, eo_e, &ev3, event_id2, pein); 2258 _evas_event_source_mouse_in_events(eo_obj, eo_e, pein, event_id2);
2270 if (e->delete_me) break; 2259 if (e->delete_me) break;
2271 } 2260 }
2272 } 2261 }
@@ -2299,40 +2288,34 @@ evas_event_feed_mouse_move(Eo *eo_e, int x, int y, unsigned int timestamp, const
2299} 2288}
2300 2289
2301static void 2290static void
2302_canvas_event_feed_mouse_in_internal(Eo *eo_e, unsigned int timestamp, const void *data, 2291_canvas_event_feed_mouse_in_internal(Evas *eo_e, Efl_Event_Pointer_Data *ev)
2303 Efl_Event_Pointer *parent_pe)
2304{ 2292{
2305 Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS); 2293 Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
2306 Efl_Event_Pointer *pe = NULL;
2307 Eina_List *ins; 2294 Eina_List *ins;
2308 Eina_List *l; 2295 Eina_List *l;
2309 Evas_Event_Mouse_In ev;
2310 Evas_Object *eo_obj; 2296 Evas_Object *eo_obj;
2311 int event_id = 0; 2297 int event_id;
2312 2298
2313 e->pointer.inside = 1; 2299 if (!e || !ev) return;
2314 2300
2301 e->pointer.inside = 1;
2315 if (e->is_frozen) return; 2302 if (e->is_frozen) return;
2316 e->last_timestamp = timestamp;
2317 2303
2304 e->last_timestamp = ev->timestamp;
2318 if (e->pointer.mouse_grabbed != 0) return; 2305 if (e->pointer.mouse_grabbed != 0) return;
2319 2306
2320 _evas_object_event_new(); 2307 ev->action = EFL_POINTER_ACTION_IN;
2308 ev->pressed_buttons = e->pointer.button;
2309 ev->cur.x = e->pointer.x;
2310 ev->cur.y = e->pointer.y;
2311 ev->modifiers = &(e->modifiers);
2312 ev->locks = &(e->locks);
2313 ev->event_flags = e->default_event_flags;
2314 if (ev->device) efl_ref(ev->device);
2321 2315
2316 _evas_object_event_new();
2322 event_id = _evas_event_counter; 2317 event_id = _evas_event_counter;
2323 ev.buttons = e->pointer.button; 2318
2324 ev.output.x = e->pointer.x;
2325 ev.output.y = e->pointer.y;
2326 ev.canvas.x = e->pointer.x;
2327 ev.canvas.y = e->pointer.y;
2328 ev.data = (void *)data;
2329 ev.modifiers = &(e->modifiers);
2330 ev.locks = &(e->locks);
2331 ev.timestamp = timestamp;
2332 ev.event_flags = e->default_event_flags;
2333 ev.dev = _evas_device_top_get(eo_e);
2334 if (ev.dev) efl_ref(ev.dev);
2335
2336 _evas_walk(e); 2319 _evas_walk(e);
2337 /* get new list of ins */ 2320 /* get new list of ins */
2338 ins = evas_event_objects_event_list(eo_e, NULL, e->pointer.x, e->pointer.y); 2321 ins = evas_event_objects_event_list(eo_e, NULL, e->pointer.x, e->pointer.y);
@@ -2343,13 +2326,13 @@ _canvas_event_feed_mouse_in_internal(Eo *eo_e, unsigned int timestamp, const voi
2343 { 2326 {
2344 if (obj->mouse_in) continue; 2327 if (obj->mouse_in) continue;
2345 obj->mouse_in = 1; 2328 obj->mouse_in = 1;
2346 ev.canvas.x = e->pointer.x; 2329 ev->cur.x = e->pointer.x;
2347 ev.canvas.y = e->pointer.y; 2330 ev->cur.y = e->pointer.y;
2348 _evas_event_havemap_adjust(eo_obj, obj, &ev.canvas.x, &ev.canvas.y, 2331 _evas_event_havemap_adjust_f(eo_obj, obj, &ev->cur, obj->mouse_grabbed);
2349 obj->mouse_grabbed); 2332 evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_IN, NULL,
2350 EV_CALL(eo_obj, obj, EVAS_CALLBACK_MOUSE_IN, &ev, event_id, pe, parent_pe); 2333 event_id, EFL_EVENT_POINTER_IN, ev->eo);
2351 if ((obj->proxy->is_proxy) && (obj->proxy->src_events)) 2334 if ((obj->proxy->is_proxy) && (obj->proxy->src_events))
2352 _evas_event_source_mouse_in_events(eo_obj, eo_e, &ev, event_id, pe); 2335 _evas_event_source_mouse_in_events(eo_obj, eo_e, ev->eo, event_id);
2353 if (e->delete_me || e->is_frozen) break; 2336 if (e->delete_me || e->is_frozen) break;
2354 } 2337 }
2355 } 2338 }
@@ -2358,54 +2341,42 @@ _canvas_event_feed_mouse_in_internal(Eo *eo_e, unsigned int timestamp, const voi
2358 /* and set up the new one */ 2341 /* and set up the new one */
2359 e->pointer.object.in = ins; 2342 e->pointer.object.in = ins;
2360 _evas_post_event_callback_call(eo_e, e); 2343 _evas_post_event_callback_call(eo_e, e);
2361 _canvas_event_feed_mouse_move_internal(eo_e, e, e->pointer.x, e->pointer.y, timestamp, data, pe); 2344 _canvas_event_feed_mouse_move_internal(eo_e, e, e->pointer.x, e->pointer.y, ev->timestamp, ev->data, ev->eo);
2362 if (ev.dev) efl_unref(ev.dev);
2363 _evas_unwalk(e); 2345 _evas_unwalk(e);
2364 EV_DEL(pe);
2365}
2366 2346
2367EAPI void 2347 if (ev->device) efl_unref(ev->device);
2368evas_event_feed_mouse_in(Eo *eo_e, unsigned int timestamp, const void *data)
2369{
2370 _canvas_event_feed_mouse_in_internal(eo_e, timestamp, data, NULL);
2371} 2348}
2372 2349
2373static void 2350static void
2374_canvas_event_feed_mouse_out_internal(Eo *eo_e, unsigned int timestamp, const void *data, 2351_canvas_event_feed_mouse_out_internal(Evas *eo_e, Efl_Event_Pointer_Data *ev)
2375 Efl_Event_Pointer *parent_pe)
2376{ 2352{
2377 Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS); 2353 Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
2378 Efl_Event_Pointer *pe = NULL; 2354 Efl_Event_Pointer *pe = NULL;
2379 Evas_Event_Mouse_Out ev; 2355 Eina_List *l, *copy;
2380 int event_id = 0; 2356 Evas_Object *eo_obj;
2357 int event_id;
2381 2358
2359 if (!e || !ev) return;
2382 e->pointer.inside = 0; 2360 e->pointer.inside = 0;
2383 2361
2384 if (e->is_frozen) return; 2362 if (e->is_frozen) return;
2385 e->last_timestamp = timestamp; 2363 e->last_timestamp = ev->timestamp;
2386 2364
2387 _evas_object_event_new(); 2365 _evas_object_event_new();
2388
2389 event_id = _evas_event_counter; 2366 event_id = _evas_event_counter;
2390 ev.buttons = e->pointer.button; 2367
2391 ev.output.x = e->pointer.x; 2368 ev->action = EFL_POINTER_ACTION_OUT;
2392 ev.output.y = e->pointer.y; 2369 ev->pressed_buttons = e->pointer.button;
2393 ev.canvas.x = e->pointer.x; 2370 ev->cur.x = e->pointer.x;
2394 ev.canvas.y = e->pointer.y; 2371 ev->cur.y = e->pointer.y;
2395 ev.data = (void *)data; 2372 ev->modifiers = &(e->modifiers);
2396 ev.modifiers = &(e->modifiers); 2373 ev->locks = &(e->locks);
2397 ev.locks = &(e->locks); 2374 ev->event_flags = e->default_event_flags;
2398 ev.timestamp = timestamp; 2375 if (ev->device) efl_ref(ev->device);
2399 ev.event_flags = e->default_event_flags;
2400 ev.dev = _evas_device_top_get(eo_e);
2401 if (ev.dev) efl_ref(ev.dev);
2402 2376
2403 _evas_walk(e); 2377 _evas_walk(e);
2404 /* if our mouse button is inside any objects */ 2378 /* if our mouse button is inside any objects */
2405 /* go thru old list of in objects */ 2379 /* go thru old list of in objects */
2406 Eina_List *l, *copy;
2407 Evas_Object *eo_obj;
2408
2409 copy = evas_event_list_copy(e->pointer.object.in); 2380 copy = evas_event_list_copy(e->pointer.object.in);
2410 EINA_LIST_FOREACH(copy, l, eo_obj) 2381 EINA_LIST_FOREACH(copy, l, eo_obj)
2411 { 2382 {
@@ -2414,13 +2385,13 @@ _canvas_event_feed_mouse_out_internal(Eo *eo_e, unsigned int timestamp, const vo
2414 obj->mouse_in = 0; 2385 obj->mouse_in = 0;
2415 if (!obj->delete_me) 2386 if (!obj->delete_me)
2416 { 2387 {
2417 ev.canvas.x = e->pointer.x; 2388 ev->cur.x = e->pointer.x;
2418 ev.canvas.y = e->pointer.y; 2389 ev->cur.y = e->pointer.y;
2419 _evas_event_havemap_adjust(eo_obj, obj, &ev.canvas.x, &ev.canvas.y, 2390 _evas_event_havemap_adjust_f(eo_obj, obj, &ev->cur, obj->mouse_grabbed);
2420 obj->mouse_grabbed); 2391 evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_OUT, NULL,
2421 EV_CALL(eo_obj, obj, EVAS_CALLBACK_MOUSE_OUT, &ev, event_id, pe, parent_pe); 2392 event_id, EFL_EVENT_POINTER_OUT, ev->eo);
2422 if ((obj->proxy->is_proxy) && (obj->proxy->src_events)) 2393 if ((obj->proxy->is_proxy) && (obj->proxy->src_events))
2423 _evas_event_source_mouse_out_events(eo_obj, eo_e, &ev, event_id, pe); 2394 _evas_event_source_mouse_out_events(eo_obj, eo_e, pe, event_id);
2424 if (e->delete_me || e->is_frozen) break; 2395 if (e->delete_me || e->is_frozen) break;
2425 } 2396 }
2426 obj->mouse_grabbed = 0; 2397 obj->mouse_grabbed = 0;
@@ -2431,15 +2402,43 @@ _canvas_event_feed_mouse_out_internal(Eo *eo_e, unsigned int timestamp, const vo
2431 e->pointer.object.in = eina_list_free(e->pointer.object.in); 2402 e->pointer.object.in = eina_list_free(e->pointer.object.in);
2432 e->pointer.mouse_grabbed = 0; 2403 e->pointer.mouse_grabbed = 0;
2433 _evas_post_event_callback_call(eo_e, e); 2404 _evas_post_event_callback_call(eo_e, e);
2434 if (ev.dev) efl_unref(ev.dev);
2435 _evas_unwalk(e); 2405 _evas_unwalk(e);
2436 EV_DEL(pe); 2406
2407 if (ev->device) efl_unref(ev->device);
2408}
2409
2410static void
2411_canvas_event_feed_mouse_inout_legacy(Eo *eo_e, unsigned int timestamp,
2412 const void *data, Eina_Bool in)
2413{
2414 Efl_Event_Pointer_Data *ev = NULL;
2415 Efl_Event_Pointer *evt;
2416
2417 evt = efl_event_instance_get(EFL_EVENT_POINTER_CLASS, eo_e, (void **) &ev);
2418 if (!ev) return;
2419
2420 ev->timestamp = timestamp;
2421 ev->data = (void *) data;
2422 ev->device = _evas_device_top_get(eo_e);
2423
2424 if (in)
2425 _canvas_event_feed_mouse_in_internal(eo_e, ev);
2426 else
2427 _canvas_event_feed_mouse_out_internal(eo_e, ev);
2428
2429 efl_del(evt);
2430}
2431
2432EAPI void
2433evas_event_feed_mouse_in(Eo *eo_e, unsigned int timestamp, const void *data)
2434{
2435 _canvas_event_feed_mouse_inout_legacy(eo_e, timestamp, data, EINA_TRUE);
2437} 2436}
2438 2437
2439EAPI void 2438EAPI void
2440evas_event_feed_mouse_out(Eo *eo_e, unsigned int timestamp, const void *data) 2439evas_event_feed_mouse_out(Eo *eo_e, unsigned int timestamp, const void *data)
2441{ 2440{
2442 _canvas_event_feed_mouse_out_internal(eo_e, timestamp, data, NULL); 2441 _canvas_event_feed_mouse_inout_legacy(eo_e, timestamp, data, EINA_FALSE);
2443} 2442}
2444 2443
2445static void 2444static void
@@ -3504,11 +3503,11 @@ _evas_canvas_event_pointer_cb(void *data, const Eo_Event *event)
3504 break; 3503 break;
3505 3504
3506 case EFL_POINTER_ACTION_IN: 3505 case EFL_POINTER_ACTION_IN:
3507 _canvas_event_feed_mouse_in_internal(eo_e, ev->timestamp, ev->data, ev->eo); 3506 _canvas_event_feed_mouse_in_internal(eo_e, ev);
3508 break; 3507 break;
3509 3508
3510 case EFL_POINTER_ACTION_OUT: 3509 case EFL_POINTER_ACTION_OUT:
3511 _canvas_event_feed_mouse_out_internal(eo_e, ev->timestamp, ev->data, ev->eo); 3510 _canvas_event_feed_mouse_out_internal(eo_e, ev);
3512 break; 3511 break;
3513 3512
3514 case EFL_POINTER_ACTION_WHEEL: 3513 case EFL_POINTER_ACTION_WHEEL: