summaryrefslogtreecommitdiff
path: root/legacy/evas/src/lib
diff options
context:
space:
mode:
authorChunEon Park <hermet@hermet.pe.kr>2012-10-28 14:48:43 +0000
committerChunEon Park <hermet@hermet.pe.kr>2012-10-28 14:48:43 +0000
commite48939bb652d884b4b3a572a9dd9df8dbb36faf0 (patch)
tree5f2822afac0c0a97bf449ca5ea08d8894b9a6d4d /legacy/evas/src/lib
parent0b036b4782e06f807b0e271386c50782e74ccfb4 (diff)
evas/events - do mouse_in/out for proxy source
SVN revision: 78590
Diffstat (limited to 'legacy/evas/src/lib')
-rw-r--r--legacy/evas/src/lib/canvas/evas_events.c91
1 files changed, 78 insertions, 13 deletions
diff --git a/legacy/evas/src/lib/canvas/evas_events.c b/legacy/evas/src/lib/canvas/evas_events.c
index e079eae..b8bcdb6 100644
--- a/legacy/evas/src/lib/canvas/evas_events.c
+++ b/legacy/evas/src/lib/canvas/evas_events.c
@@ -823,46 +823,108 @@ _evas_event_source_multi_move_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event
823} 823}
824 824
825static void 825static void
826_evas_event_source_mouse_in_events(Evas_Object *eo_obj, Evas *eo_e EINA_UNUSED, Evas_Event_Mouse_In *ev, int event_id) 826_evas_event_source_mouse_in_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event_Mouse_In *ev, int event_id)
827{ 827{
828 //FIXME: Should implement again.
829 Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS); 828 Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
830 Evas_Object *eo_src = _evas_object_image_source_get(eo_obj); 829 Evas_Object *eo_src = _evas_object_image_source_get(eo_obj);
831 Evas_Object_Protected_Data *src = eo_data_get(eo_src, EVAS_OBJ_CLASS); 830 Evas_Object_Protected_Data *src = eo_data_get(eo_src, EVAS_OBJ_CLASS);
831 Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
832 Evas_Point output = ev->output; 832 Evas_Point output = ev->output;
833 Evas_Coord_Point canvas = ev->canvas; 833 Evas_Coord_Point canvas = ev->canvas;
834 834
835 if (obj->delete_me || src->delete_me || obj->layer->evas->is_frozen) return; 835 if (obj->delete_me || src->delete_me || e->is_frozen) return;
836 836
837 _transform_to_src_space(obj, src, &ev->canvas.x, &ev->canvas.y); 837 _transform_to_src_space(obj, src, &ev->canvas.x, &ev->canvas.y);
838 838
839 ev->output.x = ev->canvas.x; 839 ev->output.x = ev->canvas.x;
840 ev->output.y = ev->canvas.y; 840 ev->output.y = ev->canvas.y;
841 841
842 _evas_event_source_events_call(src, EVAS_CALLBACK_MOUSE_IN, ev, event_id); 842 Eina_List *ins = NULL;
843 if (src->is_smart)
844 {
845 int no_rep = 0;
846 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);
847 }
848 else
849 ins = eina_list_append(ins, src);
850
851 Evas_Coord point_x = ev->canvas.x;
852 Evas_Coord point_y = ev->canvas.y;
853 Eina_List *l;
854 Evas_Object *eo_child;
855 EINA_LIST_FOREACH(ins, l, eo_child)
856 {
857 Evas_Object_Protected_Data *child = eo_data_get(eo_child,
858 EVAS_OBJ_CLASS);
859 if (!eina_list_data_find(src->proxy.src_event_in, eo_child))
860 {
861 if(child->mouse_in) continue;
862 child->mouse_in = 1;
863 ev->canvas.x = point_x;
864 ev->canvas.y = point_y;
865 _evas_event_framespace_adjust(eo_child, &ev->canvas.x,
866 &ev->canvas.y);
867 _evas_event_havemap_adjust(eo_child, child, &ev->canvas.x,
868 &ev->canvas.y,
869 child->mouse_grabbed);
870 evas_object_event_callback_call(eo_child, child,
871 EVAS_CALLBACK_MOUSE_IN, ev,
872 event_id);
873 if (e->delete_me || e->is_frozen) break;
874 }
875 }
876 src->proxy.src_event_in = eina_list_free(src->proxy.src_event_in);
877 src->proxy.src_event_in = ins;
843 878
844 ev->canvas = canvas; 879 ev->canvas = canvas;
845 ev->output = output; 880 ev->output = output;
846} 881}
847 882
848static void 883static void
849_evas_event_source_mouse_out_events(Evas_Object *eo_obj, Evas_Event_Mouse_Out *ev, int event_id) 884_evas_event_source_mouse_out_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event_Mouse_Out *ev, int event_id)
850{ 885{
851 //FIXME: Should implement again.
852 Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS); 886 Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
853 Evas_Object *eo_src = _evas_object_image_source_get(eo_obj); 887 Evas_Object *eo_src = _evas_object_image_source_get(eo_obj);
854 Evas_Object_Protected_Data *src = eo_data_get(eo_src, EVAS_OBJ_CLASS); 888 Evas_Object_Protected_Data *src = eo_data_get(eo_src, EVAS_OBJ_CLASS);
889 Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
855 Evas_Point output = ev->output; 890 Evas_Point output = ev->output;
856 Evas_Coord_Point canvas = ev->canvas; 891 Evas_Coord_Point canvas = ev->canvas;
857 892
858 if (obj->delete_me || src->delete_me || obj->layer->evas->is_frozen) return; 893 if (obj->delete_me || src->delete_me || e->is_frozen) return;
859 894
860 _transform_to_src_space(obj, src, &ev->canvas.x, &ev->canvas.y); 895 _transform_to_src_space(obj, src, &ev->canvas.x, &ev->canvas.y);
861 896
862 ev->output.x = ev->canvas.x; 897 ev->output.x = ev->canvas.x;
863 ev->output.y = ev->canvas.y; 898 ev->output.y = ev->canvas.y;
864 899
865 _evas_event_source_events_call(src, EVAS_CALLBACK_MOUSE_OUT, ev, event_id); 900 Eina_List *l;
901 Evas_Object *eo_child;
902 Eina_List *copy = evas_event_list_copy(src->proxy.src_event_in);
903 Evas_Coord point_x = ev->canvas.x;
904 Evas_Coord point_y = ev->canvas.y;
905
906 EINA_LIST_FOREACH(copy, l, eo_child)
907 {
908 Evas_Object_Protected_Data *child = eo_data_get(eo_child,
909 EVAS_OBJ_CLASS);
910 if (!child->mouse_in) continue;
911 child->mouse_in = 0;
912
913 if (child->delete_me) continue;
914
915 ev->canvas.x = point_x;
916 ev->canvas.y = point_y;
917
918 _evas_event_framespace_adjust(eo_child, &ev->canvas.x, &ev->canvas.y);
919 _evas_event_havemap_adjust(eo_child, child, &ev->canvas.x,
920 &ev->canvas.y, child->mouse_grabbed);
921 evas_object_event_callback_call(eo_child, child,
922 EVAS_CALLBACK_MOUSE_OUT, ev, event_id);
923 if (e->is_frozen) continue;
924 }
925
926 eina_list_free(copy);
927 src->proxy.src_event_in = eina_list_free(src->proxy.src_event_in);
866 928
867 ev->canvas = canvas; 929 ev->canvas = canvas;
868 ev->output = output; 930 ev->output = output;
@@ -1192,7 +1254,7 @@ _post_up_handle(Evas *eo_e, unsigned int timestamp, const void *data)
1192 EVAS_CALLBACK_MOUSE_OUT, 1254 EVAS_CALLBACK_MOUSE_OUT,
1193 &ev, event_id); 1255 &ev, event_id);
1194 if ((obj->proxy.is_proxy) && (obj->proxy.src_events)) 1256 if ((obj->proxy.is_proxy) && (obj->proxy.src_events))
1195 _evas_event_source_mouse_out_events(eo_obj, &ev, 1257 _evas_event_source_mouse_out_events(eo_obj, eo_e, &ev,
1196 event_id); 1258 event_id);
1197 if (e->delete_me) break; 1259 if (e->delete_me) break;
1198 } 1260 }
@@ -1651,7 +1713,8 @@ _canvas_event_feed_mouse_move(Eo *eo_e, void *_pd, va_list *list)
1651 &ev, event_id); 1713 &ev, event_id);
1652 if ((obj->proxy.is_proxy) && 1714 if ((obj->proxy.is_proxy) &&
1653 (obj->proxy.src_events)) 1715 (obj->proxy.src_events))
1654 _evas_event_source_mouse_out_events(eo_obj, &ev, event_id); 1716 _evas_event_source_mouse_out_events(eo_obj, eo_e, &ev,
1717 event_id);
1655 } 1718 }
1656 } 1719 }
1657 _evas_post_event_callback_call(eo_e, e); 1720 _evas_post_event_callback_call(eo_e, e);
@@ -1764,7 +1827,7 @@ _canvas_event_feed_mouse_move(Eo *eo_e, void *_pd, va_list *list)
1764 EVAS_CALLBACK_MOUSE_OUT, 1827 EVAS_CALLBACK_MOUSE_OUT,
1765 &ev2, event_id); 1828 &ev2, event_id);
1766 if ((obj->proxy.is_proxy) && (obj->proxy.src_events)) 1829 if ((obj->proxy.is_proxy) && (obj->proxy.src_events))
1767 _evas_event_source_mouse_out_events(eo_obj, &ev2, 1830 _evas_event_source_mouse_out_events(eo_obj, eo_e, &ev2,
1768 event_id); 1831 event_id);
1769 if (e->delete_me) break; 1832 if (e->delete_me) break;
1770 } 1833 }
@@ -1957,7 +2020,8 @@ nogrep:
1957 EVAS_CALLBACK_MOUSE_OUT, &ev2, 2020 EVAS_CALLBACK_MOUSE_OUT, &ev2,
1958 event_id); 2021 event_id);
1959 if ((obj->proxy.is_proxy) && (obj->proxy.src_events)) 2022 if ((obj->proxy.is_proxy) && (obj->proxy.src_events))
1960 _evas_event_source_mouse_out_events(eo_obj, &ev2, event_id); 2023 _evas_event_source_mouse_out_events(eo_obj, eo_e, &ev2,
2024 event_id);
1961 } 2025 }
1962 if (e->delete_me) break; 2026 if (e->delete_me) break;
1963 } 2027 }
@@ -2148,7 +2212,8 @@ _canvas_event_feed_mouse_out(Eo *eo_e, void *_pd, va_list *list)
2148 EVAS_CALLBACK_MOUSE_OUT, 2212 EVAS_CALLBACK_MOUSE_OUT,
2149 &ev, event_id); 2213 &ev, event_id);
2150 if ((obj->proxy.is_proxy) && (obj->proxy.src_events)) 2214 if ((obj->proxy.is_proxy) && (obj->proxy.src_events))
2151 _evas_event_source_mouse_out_events(eo_obj, &ev, event_id); 2215 _evas_event_source_mouse_out_events(eo_obj, eo_e, &ev,
2216 event_id);
2152 if (e->delete_me) break; 2217 if (e->delete_me) break;
2153 } 2218 }
2154 obj->mouse_grabbed = 0; 2219 obj->mouse_grabbed = 0;