summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-08-18 16:28:55 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-08-26 10:18:01 +0900
commitac26c7d4f382a968c505cfa317baf76c38f613a0 (patch)
treecc3b62682f5b46d3c64233a9a63ab1f78962523c /src
parent46c85b87fd65d0c9fc6f107cfc8748be386f8ad6 (diff)
evas events: Switch mouse move events to the new type
This is the last commit for this crazy input transformation series. The following commits will be cleaning up now unused code, and fixing bugs.
Diffstat (limited to 'src')
-rw-r--r--src/lib/evas/canvas/evas_events.c496
1 files changed, 193 insertions, 303 deletions
diff --git a/src/lib/evas/canvas/evas_events.c b/src/lib/evas/canvas/evas_events.c
index da39c98..60c1750 100644
--- a/src/lib/evas/canvas/evas_events.c
+++ b/src/lib/evas/canvas/evas_events.c
@@ -11,13 +11,12 @@ _evas_event_object_list_in_get(Evas *eo_e, Eina_List *in,
11 const Eina_Inlist *list, Evas_Object *stop, 11 const Eina_Inlist *list, Evas_Object *stop,
12 int x, int y, int *no_rep, Eina_Bool source); 12 int x, int y, int *no_rep, Eina_Bool source);
13 13
14/* FIXME: use eina_list_clone */
14static Eina_List * 15static Eina_List *
15evas_event_list_copy(Eina_List *list); 16evas_event_list_copy(Eina_List *list);
16 17
17static void 18static void
18_canvas_event_feed_mouse_move_internal(Eo *eo_e, Evas_Public_Data *e, int x, int y, 19_canvas_event_feed_mouse_move_internal(Evas_Public_Data *e, Efl_Event_Pointer_Data *ev);
19 unsigned int timestamp, const void *data,
20 Efl_Event_Pointer *parent_pe);
21 20
22static void 21static void
23_canvas_event_feed_multi_up_internal(Evas_Public_Data *e, Efl_Event_Pointer_Data *ev); 22_canvas_event_feed_multi_up_internal(Evas_Public_Data *e, Efl_Event_Pointer_Data *ev);
@@ -25,6 +24,10 @@ _canvas_event_feed_multi_up_internal(Evas_Public_Data *e, Efl_Event_Pointer_Data
25static void 24static void
26_canvas_event_feed_multi_move_internal(Evas_Public_Data *e, Efl_Event_Pointer_Data *ev); 25_canvas_event_feed_multi_move_internal(Evas_Public_Data *e, Efl_Event_Pointer_Data *ev);
27 26
27static void
28_canvas_event_feed_mouse_move_legacy(Evas *eo_e, Evas_Public_Data *e, int x, int y,
29 unsigned int timestamp, const void *data);
30
28/* FIXME: remove this */ 31/* FIXME: remove this */
29static void 32static void
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) 33_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)
@@ -1257,8 +1260,8 @@ _evas_canvas_event_default_flags_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
1257static inline void 1260static inline void
1258_canvas_event_thaw_eval_internal(Eo *eo_e, Evas_Public_Data *e) 1261_canvas_event_thaw_eval_internal(Eo *eo_e, Evas_Public_Data *e)
1259{ 1262{
1260 _canvas_event_feed_mouse_move_internal(eo_e, e, e->pointer.x, e->pointer.y, 1263 _canvas_event_feed_mouse_move_legacy(eo_e, e, e->pointer.x, e->pointer.y,
1261 e->last_timestamp, NULL, NULL); 1264 e->last_timestamp, NULL);
1262} 1265}
1263 1266
1264EAPI void 1267EAPI void
@@ -1529,7 +1532,7 @@ _post_up_handle(Evas_Public_Data *e, Efl_Event_Pointer *parent_ev)
1529 eina_list_free(ins); 1532 eina_list_free(ins);
1530 } 1533 }
1531 if (e->pointer.inside) 1534 if (e->pointer.inside)
1532 _canvas_event_feed_mouse_move_internal(eo_e, e, e->pointer.x, e->pointer.y, ev->timestamp, ev->data, evt); 1535 _canvas_event_feed_mouse_move_legacy(eo_e, e, e->pointer.x, e->pointer.y, ev->timestamp, ev->data);
1533 1536
1534 efl_del(evt); 1537 efl_del(evt);
1535 1538
@@ -1812,23 +1815,42 @@ evas_event_feed_mouse_wheel(Eo *eo_e, int direction, int z, unsigned int timesta
1812} 1815}
1813 1816
1814static void 1817static void
1815_canvas_event_feed_mouse_move_internal(Eo *eo_e, Evas_Public_Data *e, int x, int y, 1818_canvas_event_feed_mouse_move_internal(Evas_Public_Data *e, Efl_Event_Pointer_Data *ev)
1816 unsigned int timestamp, const void *data,
1817 Efl_Event_Pointer *parent_pe)
1818{ 1819{
1819 Evas_Object *nogrep_obj = NULL; 1820 Evas_Object *nogrep_obj = NULL;
1820 Efl_Event_Pointer *pemove = NULL, *peout = NULL, *pein = NULL; 1821 Evas_Object_Protected_Data *obj;
1821 int px, py; 1822 Efl_Event_Pointer *evt;
1822 1823 Eina_List *l, *copy;
1823 px = e->pointer.x; 1824 Evas_Object *eo_obj;
1824 py = e->pointer.y; 1825 Eina_Vector2 point;
1826 Evas *eo_e;
1827 int event_id;
1828 int x, y, px, py;
1825 1829
1830 if (!e || !ev) return;
1826 if (e->is_frozen) return; 1831 if (e->is_frozen) return;
1827 e->last_timestamp = timestamp;
1828 1832
1829 e->pointer.x = x; 1833 eo_e = e->evas;
1830 e->pointer.y = y; 1834 e->last_timestamp = ev->timestamp;
1835
1836 // prev pos
1837 px = ev->prev.x = e->pointer.x;
1838 py = ev->prev.y = e->pointer.y;
1839
1840 // new pos
1841 x = e->pointer.x = ev->cur.x;
1842 y = e->pointer.y = ev->cur.y;
1843 point = ev->cur;
1844
1831 if ((!e->pointer.inside) && (e->pointer.mouse_grabbed == 0)) return; 1845 if ((!e->pointer.inside) && (e->pointer.mouse_grabbed == 0)) return;
1846
1847 evt = ev->eo;
1848 ev->modifiers = &(e->modifiers);
1849 ev->locks = &(e->locks);
1850 ev->event_flags = e->default_event_flags;
1851 ev->pressed_buttons = e->pointer.button;
1852 if (ev->device) efl_ref(ev->device);
1853
1832 _evas_walk(e); 1854 _evas_walk(e);
1833 /* update moved touch point */ 1855 /* update moved touch point */
1834 if ((px != x) || (py != y)) 1856 if ((px != x) || (py != y))
@@ -1836,178 +1858,85 @@ _canvas_event_feed_mouse_move_internal(Eo *eo_e, Evas_Public_Data *e, int x, int
1836 /* if our mouse button is grabbed to any objects */ 1858 /* if our mouse button is grabbed to any objects */
1837 if (e->pointer.mouse_grabbed > 0) 1859 if (e->pointer.mouse_grabbed > 0)
1838 { 1860 {
1839 /* go thru old list of in objects */
1840 Eina_List *outs = NULL; 1861 Eina_List *outs = NULL;
1841 Eina_List *l, *copy;
1842
1843 {
1844 Evas_Event_Mouse_Move ev;
1845 Evas_Object *eo_obj;
1846 int event_id = 0;
1847
1848 _evas_object_event_new();
1849
1850 event_id = _evas_event_counter;
1851 ev.buttons = e->pointer.button;
1852 ev.cur.output.x = e->pointer.x;
1853 ev.cur.output.y = e->pointer.y;
1854 ev.cur.canvas.x = e->pointer.x;
1855 ev.cur.canvas.y = e->pointer.y;
1856 ev.prev.output.x = px;
1857 ev.prev.output.y = py;
1858 ev.prev.canvas.x = px;
1859 ev.prev.canvas.y = py;
1860 ev.data = (void *)data;
1861 ev.modifiers = &(e->modifiers);
1862 ev.locks = &(e->locks);
1863 ev.timestamp = timestamp;
1864 ev.event_flags = e->default_event_flags;
1865 ev.dev = _evas_device_top_get(eo_e);
1866 if (ev.dev) efl_ref(ev.dev);
1867
1868 copy = evas_event_list_copy(e->pointer.object.in);
1869 EINA_LIST_FOREACH(copy, l, eo_obj)
1870 {
1871 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
1872 if ((!e->is_frozen) &&
1873 (evas_object_clippers_is_visible(eo_obj, obj) ||
1874 obj->mouse_grabbed) &&
1875 (!evas_event_passes_through(eo_obj, obj)) &&
1876 (!evas_event_freezes_through(eo_obj, obj)) &&
1877 (!evas_object_is_source_invisible(eo_obj, obj) ||
1878 obj->mouse_grabbed) &&
1879 (!obj->clip.clipees))
1880 {
1881 ev.cur.canvas.x = e->pointer.x;
1882 ev.cur.canvas.y = e->pointer.y;
1883 _evas_event_havemap_adjust(eo_obj, obj, &ev.cur.canvas.x,
1884 &ev.cur.canvas.y,
1885 obj->mouse_grabbed);
1886 1862
1887 if ((px != x) || (py != y)) 1863 /* Send normal mouse move events */
1888 { 1864 ev->action = EFL_POINTER_ACTION_MOVE;
1889 EV_CALL(eo_obj, obj, EVAS_CALLBACK_MOUSE_MOVE, &ev, event_id, pemove, parent_pe); 1865
1890 if ((obj->proxy->is_proxy) && (obj->proxy->src_events)) 1866 _evas_object_event_new();
1891 _evas_event_source_mouse_move_events(eo_obj, eo_e, pemove, event_id); 1867 event_id = _evas_event_counter;
1892 } 1868
1893 } 1869 /* go thru old list of in objects */
1894 else 1870 copy = evas_event_list_copy(e->pointer.object.in);
1895 outs = eina_list_append(outs, eo_obj); 1871 EINA_LIST_FOREACH(copy, l, eo_obj)
1896 if ((obj->pointer_mode == EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN) && 1872 {
1897 (e->pointer.nogrep > 0)) 1873 obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
1874 if ((!e->is_frozen) &&
1875 (evas_object_clippers_is_visible(eo_obj, obj) ||
1876 obj->mouse_grabbed) &&
1877 (!evas_event_passes_through(eo_obj, obj)) &&
1878 (!evas_event_freezes_through(eo_obj, obj)) &&
1879 (!evas_object_is_source_invisible(eo_obj, obj) ||
1880 obj->mouse_grabbed) &&
1881 (!obj->clip.clipees))
1882 {
1883 if ((px != x) || (py != y))
1898 { 1884 {
1899 eina_list_free(copy); 1885 ev->cur = point;
1900 nogrep_obj = eo_obj; 1886 _evas_event_havemap_adjust_f(eo_obj, obj, &ev->cur, obj->mouse_grabbed);
1901 goto nogrep; 1887 evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_MOVE, NULL,
1888 event_id, EFL_EVENT_POINTER_MOVE, evt);
1889 if ((obj->proxy->is_proxy) && (obj->proxy->src_events))
1890 _evas_event_source_mouse_move_events(eo_obj, eo_e, evt, event_id);
1902 } 1891 }
1903 if (e->delete_me) break;
1904 } 1892 }
1905 _evas_post_event_callback_call(eo_e, e); 1893 else
1906 if (ev.dev) efl_unref(ev.dev); 1894 outs = eina_list_append(outs, eo_obj);
1907 EV_DEL(pemove); 1895 if ((obj->pointer_mode == EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN) &&
1896 (e->pointer.nogrep > 0))
1897 {
1898 eina_list_free(copy);
1899 eina_list_free(outs);
1900 nogrep_obj = eo_obj;
1901 goto nogrep;
1902 }
1903 if (e->delete_me) break;
1908 } 1904 }
1909 { 1905 eina_list_free(copy);
1910 Evas_Event_Mouse_Out ev; 1906 _evas_post_event_callback_call(eo_e, e);
1911 int event_id = 0;
1912 1907
1913 _evas_object_event_new();
1914 1908
1915 event_id = _evas_event_counter; 1909 /* Send mouse out events */
1916 ev.buttons = e->pointer.button; 1910 ev->action = EFL_POINTER_ACTION_OUT;
1917 ev.output.x = e->pointer.x;
1918 ev.output.y = e->pointer.y;
1919 ev.canvas.x = e->pointer.x;
1920 ev.canvas.y = e->pointer.y;
1921 ev.data = (void *)data;
1922 ev.modifiers = &(e->modifiers);
1923 ev.locks = &(e->locks);
1924 ev.timestamp = timestamp;
1925 ev.event_flags = e->default_event_flags;
1926 ev.dev = _evas_device_top_get(eo_e);
1927 if (ev.dev) efl_ref(ev.dev);
1928 1911
1929 eina_list_free(copy); 1912 _evas_object_event_new();
1913 event_id = _evas_event_counter;
1930 1914
1931 while (outs) 1915 EINA_LIST_FREE(outs, eo_obj)
1916 {
1917 obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
1918 if ((obj->mouse_grabbed == 0) && (!e->delete_me))
1932 { 1919 {
1933 Evas_Object *eo_obj; 1920 if (!obj->mouse_in) continue;
1934 eo_obj = outs->data; 1921 obj->mouse_in = 0;
1935 outs = eina_list_remove(outs, eo_obj); 1922 if (obj->delete_me || e->is_frozen) continue;
1936 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); 1923 e->pointer.object.in = eina_list_remove(e->pointer.object.in, eo_obj);
1937 if ((obj->mouse_grabbed == 0) && (!e->delete_me)) 1924 ev->cur = point;
1938 { 1925 _evas_event_havemap_adjust_f(eo_obj, obj, &ev->cur, obj->mouse_grabbed);
1939 if (!obj->mouse_in) continue; 1926 evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_OUT, NULL,
1940 obj->mouse_in = 0; 1927 event_id, EFL_EVENT_POINTER_OUT, evt);
1941 if (obj->delete_me || e->is_frozen) continue; 1928 if ((obj->proxy->is_proxy) && (obj->proxy->src_events))
1942 ev.canvas.x = e->pointer.x; 1929 _evas_event_source_mouse_out_events(eo_obj, eo_e, evt, event_id);
1943 ev.canvas.y = e->pointer.y;
1944 _evas_event_havemap_adjust(eo_obj, obj, &ev.canvas.x,
1945 &ev.canvas.y,
1946 obj->mouse_grabbed);
1947 e->pointer.object.in = eina_list_remove(e->pointer.object.in, eo_obj);
1948 EV_CALL(eo_obj, obj, EVAS_CALLBACK_MOUSE_OUT, &ev, event_id, peout, parent_pe);
1949 if ((obj->proxy->is_proxy) && (obj->proxy->src_events))
1950 _evas_event_source_mouse_out_events(eo_obj, eo_e, peout, event_id);
1951 }
1952 } 1930 }
1953 _evas_post_event_callback_call(eo_e, e);
1954 if (ev.dev) efl_unref(ev.dev);
1955 EV_DEL(peout);
1956 } 1931 }
1932 _evas_post_event_callback_call(eo_e, e);
1957 } 1933 }
1958 else 1934 else
1959 { 1935 {
1960 Eina_List *ins; 1936 Eina_List *ins;
1961 Eina_List *l, *copy;
1962 Evas_Event_Mouse_Move ev;
1963 Evas_Event_Mouse_Out ev2;
1964 Evas_Event_Mouse_In ev3;
1965 Evas_Object *eo_obj;
1966 int event_id = 0, event_id2 = 0;
1967 1937
1968 _evas_object_event_new(); 1938 _evas_object_event_new();
1969
1970 event_id = _evas_event_counter; 1939 event_id = _evas_event_counter;
1971 ev.buttons = e->pointer.button;
1972 ev.cur.output.x = e->pointer.x;
1973 ev.cur.output.y = e->pointer.y;
1974 ev.cur.canvas.x = e->pointer.x;
1975 ev.cur.canvas.y = e->pointer.y;
1976 ev.prev.output.x = px;
1977 ev.prev.output.y = py;
1978 ev.prev.canvas.x = px;
1979 ev.prev.canvas.y = py;
1980 ev.data = (void *)data;
1981 ev.modifiers = &(e->modifiers);
1982 ev.locks = &(e->locks);
1983 ev.timestamp = timestamp;
1984 ev.event_flags = e->default_event_flags;
1985 ev.dev = _evas_device_top_get(eo_e);
1986 if (ev.dev) efl_ref(ev.dev);
1987
1988 ev2.buttons = e->pointer.button;
1989 ev2.output.x = e->pointer.x;
1990 ev2.output.y = e->pointer.y;
1991 ev2.canvas.x = e->pointer.x;
1992 ev2.canvas.y = e->pointer.y;
1993 ev2.data = (void *)data;
1994 ev2.modifiers = &(e->modifiers);
1995 ev2.locks = &(e->locks);
1996 ev2.timestamp = timestamp;
1997 ev2.event_flags = e->default_event_flags;
1998 ev2.dev = ev.dev;
1999
2000 ev3.buttons = e->pointer.button;
2001 ev3.output.x = e->pointer.x;
2002 ev3.output.y = e->pointer.y;
2003 ev3.canvas.x = e->pointer.x;
2004 ev3.canvas.y = e->pointer.y;
2005 ev3.data = (void *)data;
2006 ev3.modifiers = &(e->modifiers);
2007 ev3.locks = &(e->locks);
2008 ev3.timestamp = timestamp;
2009 ev3.event_flags = e->default_event_flags;
2010 ev3.dev = ev.dev;
2011 1940
2012 /* get all new in objects */ 1941 /* get all new in objects */
2013 ins = evas_event_objects_event_list(eo_e, NULL, x, y); 1942 ins = evas_event_objects_event_list(eo_e, NULL, x, y);
@@ -2015,9 +1944,9 @@ _canvas_event_feed_mouse_move_internal(Eo *eo_e, Evas_Public_Data *e, int x, int
2015 copy = evas_event_list_copy(e->pointer.object.in); 1944 copy = evas_event_list_copy(e->pointer.object.in);
2016 EINA_LIST_FOREACH(copy, l, eo_obj) 1945 EINA_LIST_FOREACH(copy, l, eo_obj)
2017 { 1946 {
2018 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); 1947 obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
2019
2020 if (!obj) continue; 1948 if (!obj) continue;
1949
2021 /* if its under the pointer and its visible and its in the new */ 1950 /* if its under the pointer and its visible and its in the new */
2022 /* in list */ 1951 /* in list */
2023 // FIXME: i don't think we need this 1952 // FIXME: i don't think we need this
@@ -2037,44 +1966,41 @@ _canvas_event_feed_mouse_move_internal(Eo *eo_e, Evas_Public_Data *e, int x, int
2037 { 1966 {
2038 if ((px != x) || (py != y)) 1967 if ((px != x) || (py != y))
2039 { 1968 {
2040 ev.cur.canvas.x = e->pointer.x; 1969 ev->cur = point;
2041 ev.cur.canvas.y = e->pointer.y; 1970 _evas_event_havemap_adjust_f(eo_obj, obj, &ev->cur, obj->mouse_grabbed);
2042 _evas_event_havemap_adjust(eo_obj, obj, &ev.cur.canvas.x, &ev.cur.canvas.y, obj->mouse_grabbed); 1971 ev->action = EFL_POINTER_ACTION_MOVE;
2043 EV_CALL(eo_obj, obj, EVAS_CALLBACK_MOUSE_MOVE, &ev, event_id, pemove, parent_pe); 1972 evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_MOVE, NULL,
1973 event_id, EFL_EVENT_POINTER_MOVE, evt);
2044 if ((obj->proxy->is_proxy) && (obj->proxy->src_events)) 1974 if ((obj->proxy->is_proxy) && (obj->proxy->src_events))
2045 _evas_event_source_mouse_move_events(eo_obj, eo_e, pemove, event_id); 1975 _evas_event_source_mouse_move_events(eo_obj, eo_e, evt, event_id);
2046 } 1976 }
2047 } 1977 }
2048 /* otherwise it has left the object */ 1978 /* otherwise it has left the object */
2049 else 1979 else if (obj->mouse_in)
2050 { 1980 {
2051 if (obj->mouse_in) 1981 obj->mouse_in = 0;
2052 { 1982 if (e->is_frozen) continue;
2053 obj->mouse_in = 0; 1983 ev->cur = point;
2054 if (e->is_frozen) continue; 1984 _evas_event_havemap_adjust_f(eo_obj, obj, &ev->cur, obj->mouse_grabbed);
2055 ev2.canvas.x = e->pointer.x; 1985 ev->action = EFL_POINTER_ACTION_OUT;
2056 ev2.canvas.y = e->pointer.y; 1986 evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_OUT, NULL,
2057 _evas_event_havemap_adjust(eo_obj, obj, &ev2.canvas.x, 1987 event_id, EFL_EVENT_POINTER_OUT, evt);
2058 &ev2.canvas.y, 1988 if ((obj->proxy->is_proxy) && (obj->proxy->src_events))
2059 obj->mouse_grabbed); 1989 _evas_event_source_mouse_out_events(eo_obj, eo_e, evt, event_id);
2060 EV_CALL(eo_obj, obj, EVAS_CALLBACK_MOUSE_OUT, &ev2, event_id, peout, parent_pe); 1990 if (e->delete_me) break;
2061 if ((obj->proxy->is_proxy) && (obj->proxy->src_events))
2062 _evas_event_source_mouse_out_events(eo_obj, eo_e, peout, event_id);
2063 if (e->delete_me) break;
2064 }
2065 } 1991 }
2066 } 1992 }
1993 eina_list_free(copy);
2067 _evas_post_event_callback_call(eo_e, e); 1994 _evas_post_event_callback_call(eo_e, e);
2068 1995
1996 /* new event id for mouse in */
2069 _evas_object_event_new(); 1997 _evas_object_event_new();
2070 1998 event_id = _evas_event_counter;
2071 event_id2 = _evas_event_counter;
2072 eina_list_free(copy);
2073 1999
2074 /* go thru our current list of ins */ 2000 /* go thru our current list of ins */
2075 EINA_LIST_FOREACH(ins, l, eo_obj) 2001 EINA_LIST_FOREACH(ins, l, eo_obj)
2076 { 2002 {
2077 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); 2003 obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
2078 /* if its not in the old list of ins send an enter event */ 2004 /* if its not in the old list of ins send an enter event */
2079 if (!eina_list_data_find(e->pointer.object.in, eo_obj)) 2005 if (!eina_list_data_find(e->pointer.object.in, eo_obj))
2080 { 2006 {
@@ -2082,15 +2008,14 @@ _canvas_event_feed_mouse_move_internal(Eo *eo_e, Evas_Public_Data *e, int x, int
2082 { 2008 {
2083 obj->mouse_in = 1; 2009 obj->mouse_in = 1;
2084 if (e->is_frozen) continue; 2010 if (e->is_frozen) continue;
2085 ev3.canvas.x = e->pointer.x; 2011 ev->cur = point;
2086 ev3.canvas.y = e->pointer.y; 2012 _evas_event_havemap_adjust_f(eo_obj, obj, &ev->cur, obj->mouse_grabbed);
2087 _evas_event_havemap_adjust(eo_obj, obj, &ev3.canvas.x, 2013 ev->action = EFL_POINTER_ACTION_IN;
2088 &ev3.canvas.y, 2014 evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_IN, NULL,
2089 obj->mouse_grabbed); 2015 event_id, EFL_EVENT_POINTER_IN, evt);
2090 EV_CALL(eo_obj, obj, EVAS_CALLBACK_MOUSE_IN, &ev3, event_id2, pein, parent_pe);
2091 if ((obj->proxy->is_proxy) && 2016 if ((obj->proxy->is_proxy) &&
2092 (obj->proxy->src_events)) 2017 (obj->proxy->src_events))
2093 _evas_event_source_mouse_in_events(eo_obj, eo_e, pein, event_id); 2018 _evas_event_source_mouse_in_events(eo_obj, eo_e, evt, event_id);
2094 if (e->delete_me) break; 2019 if (e->delete_me) break;
2095 } 2020 }
2096 } 2021 }
@@ -2108,79 +2033,26 @@ _canvas_event_feed_mouse_move_internal(Eo *eo_e, Evas_Public_Data *e, int x, int
2108 eina_list_free(ins); 2033 eina_list_free(ins);
2109 } 2034 }
2110 _evas_post_event_callback_call(eo_e, e); 2035 _evas_post_event_callback_call(eo_e, e);
2111 if (ev.dev) efl_unref(ev.dev);
2112 EV_DEL(pemove);
2113 EV_DEL(peout);
2114 EV_DEL(pein);
2115 } 2036 }
2116 _evas_unwalk(e); 2037
2117 return;
2118nogrep: 2038nogrep:
2039 if (nogrep_obj)
2119 { 2040 {
2120 Eina_List *ins = NULL; 2041 Eina_List *ins = NULL, *newin = NULL, *lst = NULL;
2121 Eina_List *newin = NULL; 2042 Evas_Object *eo_below_obj;
2122 Eina_List *l, *copy, *lst = NULL;
2123 Evas_Event_Mouse_Move ev;
2124 Evas_Event_Mouse_Out ev2;
2125 Evas_Event_Mouse_In ev3;
2126 Evas_Object *eo_obj, *eo_below_obj;
2127 int event_id = 0, event_id2 = 0;
2128 int norep = 0, breaknext = 0;
2129 2043
2130 _evas_object_event_new(); 2044 _evas_object_event_new();
2131
2132 event_id = _evas_event_counter; 2045 event_id = _evas_event_counter;
2133 ev.buttons = e->pointer.button;
2134 ev.cur.output.x = e->pointer.x;
2135 ev.cur.output.y = e->pointer.y;
2136 ev.cur.canvas.x = e->pointer.x;
2137 ev.cur.canvas.y = e->pointer.y;
2138 ev.prev.output.x = px;
2139 ev.prev.output.y = py;
2140 ev.prev.canvas.x = px;
2141 ev.prev.canvas.y = py;
2142 ev.data = (void *)data;
2143 ev.modifiers = &(e->modifiers);
2144 ev.locks = &(e->locks);
2145 ev.timestamp = timestamp;
2146 ev.event_flags = e->default_event_flags;
2147 ev.dev = _evas_device_top_get(eo_e);
2148 if (ev.dev) efl_ref(ev.dev);
2149
2150 ev2.buttons = e->pointer.button;
2151 ev2.output.x = e->pointer.x;
2152 ev2.output.y = e->pointer.y;
2153 ev2.canvas.x = e->pointer.x;
2154 ev2.canvas.y = e->pointer.y;
2155 ev2.data = (void *)data;
2156 ev2.modifiers = &(e->modifiers);
2157 ev2.locks = &(e->locks);
2158 ev2.timestamp = timestamp;
2159 ev2.event_flags = e->default_event_flags;
2160 ev2.dev = ev.dev;
2161
2162 ev3.buttons = e->pointer.button;
2163 ev3.output.x = e->pointer.x;
2164 ev3.output.y = e->pointer.y;
2165 ev3.canvas.x = e->pointer.x;
2166 ev3.canvas.y = e->pointer.y;
2167 ev3.data = (void *)data;
2168 ev3.modifiers = &(e->modifiers);
2169 ev3.locks = &(e->locks);
2170 ev3.timestamp = timestamp;
2171 ev3.event_flags = e->default_event_flags;
2172 ev3.dev = ev.dev;
2173 2046
2174 /* go thru old list of in objects */ 2047 /* go thru old list of in objects */
2175 copy = evas_event_list_copy(e->pointer.object.in); 2048 copy = evas_event_list_copy(e->pointer.object.in);
2176 EINA_LIST_FOREACH(copy, l, eo_obj) 2049 EINA_LIST_FOREACH(copy, l, eo_obj)
2177 { 2050 {
2178 if (breaknext) 2051 if (eo_obj == nogrep_obj)
2179 { 2052 {
2180 lst = l; 2053 lst = l->next;
2181 break; 2054 break;
2182 } 2055 }
2183 if (eo_obj == nogrep_obj) breaknext = 1;
2184 } 2056 }
2185 2057
2186 /* get all new in objects */ 2058 /* get all new in objects */
@@ -2188,24 +2060,25 @@ nogrep:
2188 if (eo_below_obj) 2060 if (eo_below_obj)
2189 { 2061 {
2190 Evas_Object_Protected_Data *below_obj = efl_data_scope_get(eo_below_obj, EFL_CANVAS_OBJECT_CLASS); 2062 Evas_Object_Protected_Data *below_obj = efl_data_scope_get(eo_below_obj, EFL_CANVAS_OBJECT_CLASS);
2063 int norep = 0;
2191 ins = _evas_event_object_list_raw_in_get(eo_e, NULL, 2064 ins = _evas_event_object_list_raw_in_get(eo_e, NULL,
2192 EINA_INLIST_GET(below_obj), NULL, 2065 EINA_INLIST_GET(below_obj), NULL,
2193 e->pointer.x, e->pointer.y, 2066 e->pointer.x, e->pointer.y,
2194 &norep, EINA_FALSE); 2067 &norep, EINA_FALSE);
2195 } 2068 }
2069
2196 EINA_LIST_FOREACH(copy, l, eo_obj) 2070 EINA_LIST_FOREACH(copy, l, eo_obj)
2197 { 2071 {
2198 newin = eina_list_append(newin, eo_obj); 2072 newin = eina_list_append(newin, eo_obj);
2199 if (eo_obj == nogrep_obj) break; 2073 if (eo_obj == nogrep_obj) break;
2200 } 2074 }
2201 EINA_LIST_FOREACH(ins, l, eo_obj) 2075
2202 { 2076 // NOTE: was foreach + append without free (smelled bad)
2203 newin = eina_list_append(newin, eo_obj); 2077 newin = eina_list_merge(newin, ins);
2204 }
2205 2078
2206 EINA_LIST_FOREACH(lst, l, eo_obj) 2079 EINA_LIST_FOREACH(lst, l, eo_obj)
2207 { 2080 {
2208 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); 2081 obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
2209 /* if its under the pointer and its visible and its in the new */ 2082 /* if its under the pointer and its visible and its in the new */
2210 /* in list */ 2083 /* in list */
2211 // FIXME: i don't think we need this 2084 // FIXME: i don't think we need this
@@ -2225,54 +2098,54 @@ nogrep:
2225 { 2098 {
2226 if ((px != x) || (py != y)) 2099 if ((px != x) || (py != y))
2227 { 2100 {
2228 ev.cur.canvas.x = e->pointer.x; 2101 ev->cur = point;
2229 ev.cur.canvas.y = e->pointer.y; 2102 _evas_event_havemap_adjust_f(eo_obj, obj, &ev->cur, obj->mouse_grabbed);
2230 _evas_event_havemap_adjust(eo_obj, obj, &ev.cur.canvas.x, &ev.cur.canvas.y, obj->mouse_grabbed); 2103 ev->action = EFL_POINTER_ACTION_MOVE;
2231 EV_CALL(eo_obj, obj, EVAS_CALLBACK_MOUSE_MOVE, &ev, event_id, pemove, parent_pe); 2104 evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_MOVE, NULL,
2105 event_id, EFL_EVENT_POINTER_MOVE, evt);
2232 if ((obj->proxy->is_proxy) && (obj->proxy->src_events)) 2106 if ((obj->proxy->is_proxy) && (obj->proxy->src_events))
2233 _evas_event_source_mouse_move_events(eo_obj, eo_e, pemove, event_id); 2107 _evas_event_source_mouse_move_events(eo_obj, eo_e, evt, event_id);
2234 } 2108 }
2235 } 2109 }
2236 /* otherwise it has left the object */
2237 else 2110 else
2238 { 2111 {
2112 /* otherwise it has left the object */
2239 if (!obj->mouse_in) continue; 2113 if (!obj->mouse_in) continue;
2240 obj->mouse_in = 0; 2114 obj->mouse_in = 0;
2241 if (e->is_frozen) continue; 2115 if (e->is_frozen) continue;
2242 ev2.canvas.x = e->pointer.x; 2116 ev->cur = point;
2243 ev2.canvas.y = e->pointer.y; 2117 _evas_event_havemap_adjust_f(eo_obj, obj, &ev->cur, obj->mouse_grabbed);
2244 _evas_event_havemap_adjust(eo_obj, obj, &ev2.canvas.x, 2118 ev->action = EFL_POINTER_ACTION_OUT;
2245 &ev2.canvas.y, obj->mouse_grabbed); 2119 evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_OUT, NULL,
2246 EV_CALL(eo_obj, obj, EVAS_CALLBACK_MOUSE_OUT, &ev2, event_id, peout, parent_pe); 2120 event_id, EFL_EVENT_POINTER_OUT, evt);
2247 if ((obj->proxy->is_proxy) && (obj->proxy->src_events)) 2121 if ((obj->proxy->is_proxy) && (obj->proxy->src_events))
2248 _evas_event_source_mouse_out_events(eo_obj, eo_e, peout, event_id); 2122 _evas_event_source_mouse_out_events(eo_obj, eo_e, evt, event_id);
2249 } 2123 }
2250 if (e->delete_me) break; 2124 if (e->delete_me) break;
2251 } 2125 }
2126 eina_list_free(copy);
2252 _evas_post_event_callback_call(eo_e, e); 2127 _evas_post_event_callback_call(eo_e, e);
2253 2128
2254 _evas_object_event_new(); 2129 _evas_object_event_new();
2255 2130 event_id = _evas_event_counter;
2256 event_id2 = _evas_event_counter;
2257 eina_list_free(copy);
2258 2131
2259 /* go thru our current list of ins */ 2132 /* go thru our current list of ins */
2260 EINA_LIST_FOREACH(newin, l, eo_obj) 2133 EINA_LIST_FOREACH(newin, l, eo_obj)
2261 { 2134 {
2262 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); 2135 obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
2263 /* if its not in the old list of ins send an enter event */ 2136 /* if its not in the old list of ins send an enter event */
2264 if (!eina_list_data_find(e->pointer.object.in, eo_obj)) 2137 if (!eina_list_data_find(e->pointer.object.in, eo_obj))
2265 { 2138 {
2266 if (obj->mouse_in) continue; 2139 if (obj->mouse_in) continue;
2267 obj->mouse_in = 1; 2140 obj->mouse_in = 1;
2268 if (e->is_frozen) continue; 2141 if (e->is_frozen) continue;
2269 ev3.canvas.x = e->pointer.x; 2142 ev->cur = point;
2270 ev3.canvas.y = e->pointer.y; 2143 _evas_event_havemap_adjust_f(eo_obj, obj, &ev->cur, obj->mouse_grabbed);
2271 _evas_event_havemap_adjust(eo_obj, obj, &ev3.canvas.x, 2144 ev->action = EFL_POINTER_ACTION_IN;
2272 &ev3.canvas.y, obj->mouse_grabbed); 2145 evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_IN, NULL,
2273 EV_CALL(eo_obj, obj, EVAS_CALLBACK_MOUSE_IN, &ev3, event_id2, pein, parent_pe); 2146 event_id, EFL_EVENT_POINTER_IN, evt);
2274 if ((obj->proxy->is_proxy) && (obj->proxy->src_events)) 2147 if ((obj->proxy->is_proxy) && (obj->proxy->src_events))
2275 _evas_event_source_mouse_in_events(eo_obj, eo_e, pein, event_id2); 2148 _evas_event_source_mouse_in_events(eo_obj, eo_e, evt, event_id);
2276 if (e->delete_me) break; 2149 if (e->delete_me) break;
2277 } 2150 }
2278 } 2151 }
@@ -2282,26 +2155,47 @@ nogrep:
2282 e->pointer.object.in = newin; 2155 e->pointer.object.in = newin;
2283 2156
2284 _evas_post_event_callback_call(eo_e, e); 2157 _evas_post_event_callback_call(eo_e, e);
2285 if (ev.dev) efl_unref(ev.dev);
2286 EV_DEL(pemove);
2287 EV_DEL(peout);
2288 EV_DEL(pein);
2289 } 2158 }
2159
2290 _evas_unwalk(e); 2160 _evas_unwalk(e);
2161 if (ev->device) efl_unref(ev->device);
2162}
2163
2164static void
2165_canvas_event_feed_mouse_move_legacy(Evas *eo_e, Evas_Public_Data *e, int x, int y,
2166 unsigned int timestamp, const void *data)
2167{
2168 Efl_Event_Pointer_Data *ev = NULL;
2169 Efl_Event_Pointer *evt;
2170
2171 evt = efl_event_instance_get(EFL_EVENT_POINTER_CLASS, eo_e, (void **) &ev);
2172 if (!ev) return;
2173
2174 ev->data = (void *) data;
2175 ev->timestamp = timestamp;
2176 ev->device = _evas_device_top_get(eo_e);
2177 ev->cur.x = x;
2178 ev->cur.y = y;
2179
2180 _canvas_event_feed_mouse_move_internal(e, ev);
2181
2182 efl_del(evt);
2291} 2183}
2292 2184
2293EAPI void 2185EAPI void
2294evas_event_input_mouse_move(Eo *eo_e, int x, int y, unsigned int timestamp, const void *data) 2186evas_event_input_mouse_move(Eo *eo_e, int x, int y, unsigned int timestamp, const void *data)
2295{ 2187{
2188 EINA_SAFETY_ON_FALSE_RETURN(efl_isa(eo_e, EVAS_CANVAS_CLASS));
2296 Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS); 2189 Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
2297 _canvas_event_feed_mouse_move_internal(eo_e, e, x - e->framespace.x, y - e->framespace.y, timestamp, data, NULL); 2190 _canvas_event_feed_mouse_move_legacy(eo_e, e, x - e->framespace.x, y - e->framespace.y, timestamp, data);
2298} 2191}
2299 2192
2300EAPI void 2193EAPI void
2301evas_event_feed_mouse_move(Eo *eo_e, int x, int y, unsigned int timestamp, const void *data) 2194evas_event_feed_mouse_move(Eo *eo_e, int x, int y, unsigned int timestamp, const void *data)
2302{ 2195{
2196 EINA_SAFETY_ON_FALSE_RETURN(efl_isa(eo_e, EVAS_CANVAS_CLASS));
2303 Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS); 2197 Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
2304 _canvas_event_feed_mouse_move_internal(eo_e, e, x, y, timestamp, data, NULL); 2198 _canvas_event_feed_mouse_move_legacy(eo_e, e, x, y, timestamp, data);
2305} 2199}
2306 2200
2307static void 2201static void
@@ -2358,7 +2252,7 @@ _canvas_event_feed_mouse_in_internal(Evas *eo_e, Efl_Event_Pointer_Data *ev)
2358 /* and set up the new one */ 2252 /* and set up the new one */
2359 e->pointer.object.in = ins; 2253 e->pointer.object.in = ins;
2360 _evas_post_event_callback_call(eo_e, e); 2254 _evas_post_event_callback_call(eo_e, e);
2361 _canvas_event_feed_mouse_move_internal(eo_e, e, e->pointer.x, e->pointer.y, ev->timestamp, ev->data, ev->eo); 2255 _canvas_event_feed_mouse_move_internal(e, ev);
2362 _evas_unwalk(e); 2256 _evas_unwalk(e);
2363 2257
2364 if (ev->device) efl_unref(ev->device); 2258 if (ev->device) efl_unref(ev->device);
@@ -3166,10 +3060,9 @@ _feed_mouse_move_eval_internal(Eo *eo_obj, Evas_Object_Protected_Data *obj)
3166 evas->pointer.x, 3060 evas->pointer.x,
3167 evas->pointer.y)))) 3061 evas->pointer.y))))
3168 { 3062 {
3169 _canvas_event_feed_mouse_move_internal(evas->evas, evas, 3063 _canvas_event_feed_mouse_move_legacy(evas->evas, evas,
3170 evas->pointer.x, evas->pointer.y, 3064 evas->pointer.x, evas->pointer.y,
3171 evas->last_timestamp, 3065 evas->last_timestamp, NULL);
3172 NULL, NULL);
3173 } 3066 }
3174} 3067}
3175 3068
@@ -3423,10 +3316,7 @@ _evas_canvas_event_pointer_cb(void *data, const Eo_Event *event)
3423 { 3316 {
3424 case EFL_POINTER_ACTION_MOVE: 3317 case EFL_POINTER_ACTION_MOVE:
3425 if (ev->finger == 0) 3318 if (ev->finger == 0)
3426 { 3319 _canvas_event_feed_mouse_move_internal(e, ev);
3427 _canvas_event_feed_mouse_move_internal(eo_e, e, ev->cur.x, ev->cur.y,
3428 ev->timestamp, ev->data, ev->eo);
3429 }
3430 else 3320 else
3431 _canvas_event_feed_multi_move_internal(e, ev); 3321 _canvas_event_feed_multi_move_internal(e, ev);
3432 break; 3322 break;