summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeandro Dorileo <dorileo@profusion.mobi>2013-01-04 01:55:07 +0000
committerLeandro Dorileo <dorileo@profusion.mobi>2013-01-04 01:55:07 +0000
commite2ce20e9a4dfd12bb383a1b60032f2ef7b507850 (patch)
treeb8f955405f5e0ec868eae4bbf2e5e590509784c5
parent25bb274f1e3b5f5ad8e7cdf873913b7dbcd4a853 (diff)
evas: add event source evas object
This patch introduces fields to event Evas_Event_Mouse_* structures to hold the event source evas object in case of evas source events propagation. SVN revision: 82138
-rw-r--r--src/lib/evas/Evas.h5
-rw-r--r--src/lib/evas/canvas/evas_events.c10
2 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/evas/Evas.h b/src/lib/evas/Evas.h
index bd96481..459ea0e 100644
--- a/src/lib/evas/Evas.h
+++ b/src/lib/evas/Evas.h
@@ -1030,6 +1030,7 @@ struct _Evas_Event_Mouse_Down /** Mouse button press event */
1030 unsigned int timestamp; 1030 unsigned int timestamp;
1031 Evas_Event_Flags event_flags; 1031 Evas_Event_Flags event_flags;
1032 Evas_Device *dev; 1032 Evas_Device *dev;
1033 Evas_Object *event_src; /**< The Evas Object which actually triggered the event, used in cases of proxy event propagation */
1033}; 1034};
1034 1035
1035struct _Evas_Event_Mouse_Up /** Mouse button release event */ 1036struct _Evas_Event_Mouse_Up /** Mouse button release event */
@@ -1047,6 +1048,7 @@ struct _Evas_Event_Mouse_Up /** Mouse button release event */
1047 unsigned int timestamp; 1048 unsigned int timestamp;
1048 Evas_Event_Flags event_flags; 1049 Evas_Event_Flags event_flags;
1049 Evas_Device *dev; 1050 Evas_Device *dev;
1051 Evas_Object *event_src; /**< The Evas Object which actually triggered the event, used in cases of proxy event propagation */
1050}; 1052};
1051 1053
1052struct _Evas_Event_Mouse_In /** Mouse enter event */ 1054struct _Evas_Event_Mouse_In /** Mouse enter event */
@@ -1062,6 +1064,7 @@ struct _Evas_Event_Mouse_In /** Mouse enter event */
1062 unsigned int timestamp; 1064 unsigned int timestamp;
1063 Evas_Event_Flags event_flags; 1065 Evas_Event_Flags event_flags;
1064 Evas_Device *dev; 1066 Evas_Device *dev;
1067 Evas_Object *event_src; /**< The Evas Object which actually triggered the event, used in cases of proxy event propagation */
1065}; 1068};
1066 1069
1067struct _Evas_Event_Mouse_Out /** Mouse leave event */ 1070struct _Evas_Event_Mouse_Out /** Mouse leave event */
@@ -1077,6 +1080,7 @@ struct _Evas_Event_Mouse_Out /** Mouse leave event */
1077 unsigned int timestamp; 1080 unsigned int timestamp;
1078 Evas_Event_Flags event_flags; 1081 Evas_Event_Flags event_flags;
1079 Evas_Device *dev; 1082 Evas_Device *dev;
1083 Evas_Object *event_src; /**< The Evas Object which actually triggered the event, used in cases of proxy event propagation */
1080}; 1084};
1081 1085
1082struct _Evas_Event_Mouse_Move /** Mouse move event */ 1086struct _Evas_Event_Mouse_Move /** Mouse move event */
@@ -1092,6 +1096,7 @@ struct _Evas_Event_Mouse_Move /** Mouse move event */
1092 unsigned int timestamp; 1096 unsigned int timestamp;
1093 Evas_Event_Flags event_flags; 1097 Evas_Event_Flags event_flags;
1094 Evas_Device *dev; 1098 Evas_Device *dev;
1099 Evas_Object *event_src; /**< The Evas Object which actually triggered the event, used in cases of proxy event propagation */
1095}; 1100};
1096 1101
1097struct _Evas_Event_Mouse_Wheel /** Wheel event */ 1102struct _Evas_Event_Mouse_Wheel /** Wheel event */
diff --git a/src/lib/evas/canvas/evas_events.c b/src/lib/evas/canvas/evas_events.c
index 587071e..1494979 100644
--- a/src/lib/evas/canvas/evas_events.c
+++ b/src/lib/evas/canvas/evas_events.c
@@ -200,6 +200,8 @@ _evas_event_source_mouse_down_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event
200 200
201 _transform_to_src_space(obj, src, &ev->canvas.x, &ev->canvas.y); 201 _transform_to_src_space(obj, src, &ev->canvas.x, &ev->canvas.y);
202 202
203 ev->event_src = eo_obj;
204
203 if (src->proxy.src_event_in) 205 if (src->proxy.src_event_in)
204 src->proxy.src_event_in = eina_list_free(src->proxy.src_event_in); 206 src->proxy.src_event_in = eina_list_free(src->proxy.src_event_in);
205 207
@@ -270,6 +272,8 @@ _evas_event_source_mouse_move_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event
270 272
271 _transform_to_src_space(obj, src, &ev->cur.canvas.x, &ev->cur.canvas.y); 273 _transform_to_src_space(obj, src, &ev->cur.canvas.x, &ev->cur.canvas.y);
272 274
275 ev->event_src = eo_obj;
276
273 //FIXME: transform previous coords also. 277 //FIXME: transform previous coords also.
274 Eina_List *l; 278 Eina_List *l;
275 Evas_Object *eo_child; 279 Evas_Object *eo_child;
@@ -447,6 +451,8 @@ _evas_event_source_mouse_up_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event_M
447 451
448 _transform_to_src_space(obj, src, &ev->canvas.x, &ev->canvas.y); 452 _transform_to_src_space(obj, src, &ev->canvas.x, &ev->canvas.y);
449 453
454 ev->event_src = eo_obj;
455
450 Eina_List *l; 456 Eina_List *l;
451 Evas_Object *eo_child; 457 Evas_Object *eo_child;
452 Evas_Object_Protected_Data *child; 458 Evas_Object_Protected_Data *child;
@@ -771,6 +777,8 @@ _evas_event_source_mouse_in_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event_
771 777
772 _transform_to_src_space(obj, src, &ev->canvas.x, &ev->canvas.y); 778 _transform_to_src_space(obj, src, &ev->canvas.x, &ev->canvas.y);
773 779
780 ev->event_src = eo_obj;
781
774 Eina_List *ins = NULL; 782 Eina_List *ins = NULL;
775 if (src->is_smart) 783 if (src->is_smart)
776 { 784 {
@@ -825,6 +833,8 @@ _evas_event_source_mouse_out_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event_
825 833
826 _transform_to_src_space(obj, src, &ev->canvas.x, &ev->canvas.y); 834 _transform_to_src_space(obj, src, &ev->canvas.x, &ev->canvas.y);
827 835
836 ev->event_src = eo_obj;
837
828 Eina_List *l; 838 Eina_List *l;
829 Evas_Object *eo_child; 839 Evas_Object *eo_child;
830 Eina_List *copy = evas_event_list_copy(src->proxy.src_event_in); 840 Eina_List *copy = evas_event_list_copy(src->proxy.src_event_in);