summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/ecore_evas/Ecore_Evas.h50
-rw-r--r--src/lib/ecore_evas/ecore_evas.c530
-rw-r--r--src/lib/ecore_evas/ecore_evas_buffer.c5
-rw-r--r--src/lib/ecore_evas/ecore_evas_ews.c56
-rw-r--r--src/lib/ecore_evas/ecore_evas_private.h27
-rw-r--r--src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c69
-rw-r--r--src/modules/ecore_evas/engines/drm/ecore_evas_drm.c66
-rw-r--r--src/modules/ecore_evas/engines/fb/ecore_evas_fb.c100
-rw-r--r--src/modules/ecore_evas/engines/psl1ght/ecore_evas_psl1ght.c64
-rw-r--r--src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c64
-rw-r--r--src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c74
-rw-r--r--src/modules/ecore_evas/engines/win32/ecore_evas_win32.c67
-rw-r--r--src/modules/ecore_evas/engines/x/ecore_evas_x.c67
13 files changed, 607 insertions, 632 deletions
diff --git a/src/lib/ecore_evas/Ecore_Evas.h b/src/lib/ecore_evas/Ecore_Evas.h
index 19493f872b..0af4bccab8 100644
--- a/src/lib/ecore_evas/Ecore_Evas.h
+++ b/src/lib/ecore_evas/Ecore_Evas.h
@@ -2143,7 +2143,7 @@ EAPI void ecore_evas_size_step_set(Ecore_Evas *ee, int w, int h);
2143EAPI void ecore_evas_size_step_get(const Ecore_Evas *ee, int *w, int *h); 2143EAPI void ecore_evas_size_step_get(const Ecore_Evas *ee, int *w, int *h);
2144 2144
2145/** 2145/**
2146 * @brief Set the cursor of an Ecore_Evas. 2146 * @brief Set the cursor for the default pointer device.
2147 * 2147 *
2148 * @param ee The Ecore_Evas 2148 * @param ee The Ecore_Evas
2149 * @param file The path to an image file for the cursor. 2149 * @param file The path to an image file for the cursor.
@@ -2166,9 +2166,9 @@ EAPI void ecore_evas_size_step_get(const Ecore_Evas *ee, int *w, int *h);
2166 */ 2166 */
2167EAPI void ecore_evas_cursor_set(Ecore_Evas *ee, const char *file, int layer, int hot_x, int hot_y); 2167EAPI void ecore_evas_cursor_set(Ecore_Evas *ee, const char *file, int layer, int hot_x, int hot_y);
2168/** 2168/**
2169 * @brief Get information about an Ecore_Evas' cursor 2169 * @brief Get information about an Ecore_Evas' default pointer device.
2170 * 2170 *
2171 * @param ee The Ecore_Evas to set 2171 * @param ee The Ecore_Evas to get
2172 * @param obj A pointer to an Evas_Object to place the cursor Evas_Object. 2172 * @param obj A pointer to an Evas_Object to place the cursor Evas_Object.
2173 * @param layer A pointer to an int to place the cursor's layer in. 2173 * @param layer A pointer to an int to place the cursor's layer in.
2174 * @param hot_x A pointer to an int to place the cursor's hot_x coordinate in. 2174 * @param hot_x A pointer to an int to place the cursor's hot_x coordinate in.
@@ -2183,10 +2183,9 @@ EAPI void ecore_evas_cursor_set(Ecore_Evas *ee, const char *file, int lay
2183EAPI void ecore_evas_cursor_get(const Ecore_Evas *ee, Evas_Object **obj, int *layer, int *hot_x, int *hot_y); 2183EAPI void ecore_evas_cursor_get(const Ecore_Evas *ee, Evas_Object **obj, int *layer, int *hot_x, int *hot_y);
2184 2184
2185/** 2185/**
2186 * @brief Set the cursor of an Ecore_Evas 2186 * @brief Set the cursor for the default pointer device.
2187 * 2187 *
2188 * @param ee The Ecore_Evas 2188 * @param ee The Ecore_Evas
2189 *
2190 * @param obj The Evas_Object which will be the cursor. 2189 * @param obj The Evas_Object which will be the cursor.
2191 * @param layer The layer in which the cursor will appear. 2190 * @param layer The layer in which the cursor will appear.
2192 * @param hot_x The x coordinate of the cursor's hot spot. 2191 * @param hot_x The x coordinate of the cursor's hot spot.
@@ -2202,7 +2201,7 @@ EAPI void ecore_evas_cursor_get(const Ecore_Evas *ee, Evas_Object **obj,
2202EAPI void ecore_evas_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y); 2201EAPI void ecore_evas_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y);
2203 2202
2204/** 2203/**
2205 * @brief Unset the Ecore_Evas cursor 2204 * @brief Unset the cursor of the default pointer device.
2206 * 2205 *
2207 * @param ee The Ecore_Evas to unset the cursor. 2206 * @param ee The Ecore_Evas to unset the cursor.
2208 * 2207 *
@@ -2218,6 +2217,45 @@ EAPI void ecore_evas_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj,
2218EAPI Evas_Object* ecore_evas_cursor_unset(Ecore_Evas *ee); 2217EAPI Evas_Object* ecore_evas_cursor_unset(Ecore_Evas *ee);
2219 2218
2220/** 2219/**
2220 * @brief Set the cursor of an Ecore_Evas specified pointer device.
2221 *
2222 * @param ee The Ecore_Evas
2223 * @param pointer A pointer device to set the cursor. Use @c NULL for the default.
2224 * @param obj The Evas_Object which will be the cursor.
2225 * @param layer The layer in which the cursor will appear.
2226 * @param hot_x The x coordinate of the cursor's hot spot.
2227 * @param hot_y The y coordinate of the cursor's hot spot.
2228 *
2229 * This function makes the mouse cursor over @p ee be the object specified by
2230 * @p obj. The actual point within the object that the mouse is at is specified
2231 * by @p hot_x and @p hot_y, which are coordinates with respect to the top left
2232 * corner of the cursor object. Cursor object will be delete with the Ecore_Evas.
2233 *
2234 * @since 1.19
2235 */
2236EAPI void ecore_evas_object_cursor_device_set(Ecore_Evas *ee, Efl_Input_Device *pointer,
2237 Evas_Object *obj, int layer,
2238 int hot_x, int hot_y);
2239/**
2240 * @brief Get information about an Ecore_Evas' specified pointer device.
2241 *
2242 * @param ee The Ecore_Evas
2243 * @param pointer A pointer device to set the cursor. Use @c NULL for the default.
2244 * @param obj A pointer to an Evas_Object to place the cursor Evas_Object.
2245 * @param layer A pointer to an int to place the cursor's layer in.
2246 * @param hot_x A pointer to an int to place the cursor's hot_x coordinate in.
2247 * @param hot_y A pointer to an int to place the cursor's hot_y coordinate in.
2248 *
2249 * This function queries information about an Ecore_Evas' cursor.
2250 *
2251 * @see ecore_evas_cursor_device_set()
2252 * @since 1.19
2253 */
2254EAPI Eina_Bool ecore_evas_cursor_device_get(const Ecore_Evas *ee, Efl_Input_Device *pointer,
2255 Evas_Object **obj, int *layer,
2256 int *hot_x, int *hot_y);
2257
2258/**
2221 * @brief Tell the WM whether or not to ignore an Ecore_Evas' window 2259 * @brief Tell the WM whether or not to ignore an Ecore_Evas' window
2222 * 2260 *
2223 * @param ee The Ecore_Evas. 2261 * @param ee The Ecore_Evas.
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
index b493383b43..da485a8211 100644
--- a/src/lib/ecore_evas/ecore_evas.c
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -51,6 +51,13 @@
51 return __VA_ARGS__; \ 51 return __VA_ARGS__; \
52 } 52 }
53 53
54#define ECORE_EVAS_CHECK_GOTO(_ee, _label) \
55 if (!ECORE_MAGIC_CHECK(_ee, ECORE_MAGIC_EVAS)) \
56 { \
57 ECORE_MAGIC_FAIL(_ee, ECORE_MAGIC_EVAS, __FUNCTION__); \
58 goto _label; \
59 }
60
54EAPI Eina_Bool _ecore_evas_app_comp_sync = EINA_FALSE; 61EAPI Eina_Bool _ecore_evas_app_comp_sync = EINA_FALSE;
55EAPI int _ecore_evas_log_dom = -1; 62EAPI int _ecore_evas_log_dom = -1;
56static int _ecore_evas_init_count = 0; 63static int _ecore_evas_init_count = 0;
@@ -62,6 +69,8 @@ static Ecore_Idle_Enterer *ecore_evas_idle_enterer = NULL;
62static Ecore_Evas *ecore_evases = NULL; 69static Ecore_Evas *ecore_evases = NULL;
63static int _ecore_evas_fps_debug = 0; 70static int _ecore_evas_fps_debug = 0;
64 71
72static const Efl_Event_Description *_event_description_get(Efl_Pointer_Action action);
73
65//RENDER_SYNC 74//RENDER_SYNC
66static int _ecore_evas_render_sync = 1; 75static int _ecore_evas_render_sync = 1;
67 76
@@ -246,6 +255,87 @@ _ecore_evas_idle_enter(void *data EINA_UNUSED)
246 return ECORE_CALLBACK_RENEW; 255 return ECORE_CALLBACK_RENEW;
247} 256}
248 257
258static void
259_ecore_evas_object_cursor_del(void *data, Evas *e EINA_UNUSED,
260 Evas_Object *obj EINA_UNUSED,
261 void *event_info EINA_UNUSED)
262{
263 Ecore_Evas_Cursor *cursor = data;
264 cursor->object = NULL;
265}
266
267static void
268_ecore_evas_cursor_element_del(Ecore_Evas_Cursor *cursor)
269{
270 if (cursor->object)
271 {
272 evas_object_event_callback_del_full(cursor->object, EVAS_CALLBACK_DEL,
273 _ecore_evas_object_cursor_del,
274 cursor);
275 evas_object_del(cursor->object);
276 }
277 free(cursor);
278}
279
280static void
281_ecore_evas_cursor_add(Ecore_Evas *ee, Efl_Input_Device *dev)
282{
283 Ecore_Evas_Cursor *cursor = calloc(1, sizeof(Ecore_Evas_Cursor));
284 EINA_SAFETY_ON_NULL_RETURN(cursor);
285 eina_hash_add(ee->prop.cursors, &dev, cursor);
286 if (ee->prop.cursor_cache.object)
287 {
288 ecore_evas_object_cursor_device_set(ee, dev,
289 ee->prop.cursor_cache.object,
290 ee->prop.cursor_cache.layer,
291 ee->prop.cursor_cache.hot.x,
292 ee->prop.cursor_cache.hot.y);
293 memset(&ee->prop.cursor_cache, 0, sizeof(Ecore_Evas_Cursor));
294 }
295}
296
297static void
298_ecore_evas_dev_added_or_removed(void *data, const Efl_Event *event)
299{
300 Ecore_Evas *ee = data;
301
302 if (efl_input_device_type_get(event->info) != EFL_INPUT_DEVICE_CLASS_MOUSE)
303 return;
304
305 if (event->desc == EFL_CANVAS_EVENT_DEVICE_ADDED)
306 _ecore_evas_cursor_add(ee, event->info);
307 else
308 eina_hash_del_by_key(ee->prop.cursors, &event->info);
309}
310
311EFL_CALLBACKS_ARRAY_DEFINE(_ecore_evas_device_cbs,
312 { EFL_CANVAS_EVENT_DEVICE_ADDED, _ecore_evas_dev_added_or_removed },
313 { EFL_CANVAS_EVENT_DEVICE_REMOVED, _ecore_evas_dev_added_or_removed });
314Eina_Bool
315_ecore_evas_cursors_init(Ecore_Evas *ee)
316{
317 const Eina_List *devs, *l;
318 Efl_Input_Device *dev;
319
320 EINA_SAFETY_ON_NULL_RETURN_VAL(ee, EINA_FALSE);
321 ee->prop.cursors = eina_hash_pointer_new(EINA_FREE_CB(_ecore_evas_cursor_element_del));
322 EINA_SAFETY_ON_NULL_RETURN_VAL(ee->prop.cursors, EINA_FALSE);
323
324 devs = evas_device_list(ee->evas, NULL);
325
326 EINA_LIST_FOREACH(devs, l, dev)
327 {
328 if (efl_input_device_type_get(dev) != EFL_INPUT_DEVICE_CLASS_MOUSE)
329 continue;
330 _ecore_evas_cursor_add(ee, dev);
331 }
332
333 efl_event_callback_array_priority_add(ee->evas, _ecore_evas_device_cbs(),
334 EFL_CALLBACK_PRIORITY_BEFORE, ee);
335
336 return EINA_TRUE;
337}
338
249EAPI Ecore_Evas_Interface * 339EAPI Ecore_Evas_Interface *
250_ecore_evas_interface_get(const Ecore_Evas *ee, const char *iname) 340_ecore_evas_interface_get(const Ecore_Evas *ee, const char *iname)
251{ 341{
@@ -1534,13 +1624,106 @@ ecore_evas_size_step_get(const Ecore_Evas *ee, int *w, int *h)
1534 } 1624 }
1535} 1625}
1536 1626
1627EAPI Evas_Object *
1628_ecore_evas_default_cursor_image_get(Ecore_Evas *ee)
1629{
1630 Efl_Input_Device *pointer;
1631 Ecore_Evas_Cursor *cursor;
1632
1633 pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_MOUSE);
1634 cursor = eina_hash_find(ee->prop.cursors, &pointer);
1635 EINA_SAFETY_ON_NULL_RETURN_VAL(cursor, NULL);
1636 return cursor->object;
1637}
1638
1537EAPI void 1639EAPI void
1538ecore_evas_cursor_set(Ecore_Evas *ee, const char *file, int layer, int hot_x, int hot_y) 1640_ecore_evas_default_cursor_hide(Ecore_Evas *ee)
1641{
1642 Efl_Input_Device *pointer;
1643 Ecore_Evas_Cursor *cursor;
1644
1645 pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_MOUSE);
1646 cursor = eina_hash_find(ee->prop.cursors, &pointer);
1647 EINA_SAFETY_ON_NULL_RETURN(cursor);
1648 if (cursor->object)
1649 evas_object_hide(cursor->object);
1650}
1651
1652static void
1653_ecore_evas_object_cursor_device_set(Ecore_Evas *ee, Efl_Input_Device *pointer,
1654 Evas_Object *obj, int layer,
1655 int hot_x, int hot_y)
1539{ 1656{
1540 Evas_Object *obj = NULL; 1657 Ecore_Evas_Cursor *cursor;
1658 int x, y;
1659 Evas_Object *old;
1541 1660
1542 ECORE_EVAS_CHECK(ee); 1661 ECORE_EVAS_CHECK(ee);
1543 1662
1663 if (!pointer)
1664 {
1665 pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_MOUSE);
1666 if (!pointer)
1667 {
1668 ee->prop.cursor_cache.object = obj;
1669 ee->prop.cursor_cache.layer = layer;
1670 ee->prop.cursor_cache.hot.x = hot_x;
1671 ee->prop.cursor_cache.hot.y = hot_y;
1672 return;
1673 }
1674 }
1675
1676 if (obj && ee->engine.func->fn_object_cursor_set)
1677 ee->engine.func->fn_object_cursor_set(ee, obj, layer, hot_x, hot_y);
1678 else if (!obj && ee->engine.func->fn_object_cursor_unset)
1679 ee->engine.func->fn_object_cursor_unset(ee);
1680
1681 cursor = eina_hash_find(ee->prop.cursors, &pointer);
1682 EINA_SAFETY_ON_NULL_RETURN(cursor);
1683 old = cursor->object;
1684 if (!obj)
1685 {
1686 cursor->object = NULL;
1687 cursor->layer = 0;
1688 cursor->hot.x = 0;
1689 cursor->hot.y = 0;
1690 goto end;
1691 }
1692
1693 cursor->object = obj;
1694 cursor->layer = layer;
1695 cursor->hot.x = hot_x;
1696 cursor->hot.y = hot_y;
1697
1698 evas_pointer_output_xy_get(ee->evas, &x, &y);
1699
1700 if (obj != old)
1701 {
1702 evas_object_layer_set(cursor->object, cursor->layer);
1703 evas_object_pass_events_set(cursor->object, 1);
1704 if (evas_pointer_inside_get(ee->evas))
1705 evas_object_show(cursor->object);
1706 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
1707 _ecore_evas_object_cursor_del, cursor);
1708 }
1709
1710 evas_object_move(cursor->object, x - cursor->hot.x,
1711 y - cursor->hot.y);
1712
1713end:
1714 if ((old) && (obj != old))
1715 {
1716 evas_object_event_callback_del_full
1717 (old, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, cursor);
1718 evas_object_del(old);
1719 }
1720}
1721
1722EAPI void
1723ecore_evas_cursor_set(Ecore_Evas *ee, const char *file,
1724 int layer, int hot_x, int hot_y)
1725{
1726 Evas_Object *obj = NULL;
1544 if (file) 1727 if (file)
1545 { 1728 {
1546 int x, y; 1729 int x, y;
@@ -1552,41 +1735,82 @@ ecore_evas_cursor_set(Ecore_Evas *ee, const char *file, int layer, int hot_x, in
1552 evas_object_image_fill_set(obj, 0, 0, x, y); 1735 evas_object_image_fill_set(obj, 0, 0, x, y);
1553 } 1736 }
1554 1737
1555 IFC(ee, fn_object_cursor_set) (ee, obj, layer, hot_x, hot_y); 1738 _ecore_evas_object_cursor_device_set(ee, NULL, obj, layer, hot_x, hot_y);
1556 IFE;
1557} 1739}
1558 1740
1559EAPI void 1741EAPI void
1560ecore_evas_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y) 1742ecore_evas_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj,
1743 int layer, int hot_x, int hot_y)
1561{ 1744{
1562 ECORE_EVAS_CHECK(ee); 1745 _ecore_evas_object_cursor_device_set(ee, NULL, obj, layer, hot_x, hot_y);
1563 IFC(ee, fn_object_cursor_set) (ee, obj, layer, hot_x, hot_y); 1746}
1564 IFE; 1747
1748EAPI void
1749ecore_evas_object_cursor_device_set(Ecore_Evas *ee, Efl_Input_Device *pointer,
1750 Evas_Object *obj, int layer,
1751 int hot_x, int hot_y)
1752{
1753 _ecore_evas_object_cursor_device_set(ee, pointer, obj, layer, hot_x, hot_y);
1754}
1755
1756EAPI Eina_Bool
1757ecore_evas_cursor_device_get(const Ecore_Evas *ee, Efl_Input_Device *pointer,
1758 Evas_Object **obj, int *layer,
1759 int *hot_x, int *hot_y)
1760{
1761 Ecore_Evas_Cursor *cursor;
1762
1763 ECORE_EVAS_CHECK_GOTO(ee, err);
1764
1765 if (!pointer)
1766 pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_MOUSE);
1767 if (pointer)
1768 {
1769 cursor = eina_hash_find(ee->prop.cursors, &pointer);
1770 if (cursor)
1771 {
1772 if (obj) *obj = cursor->object;
1773 if (layer) *layer = cursor->layer;
1774 if (hot_x) *hot_x = cursor->hot.x;
1775 if (hot_y) *hot_y = cursor->hot.y;
1776 return EINA_TRUE;
1777 }
1778 }
1779
1780 err:
1781 if (obj) *obj = NULL;
1782 if (layer) *layer = 0;
1783 if (hot_x) *hot_x = 0;
1784 if (hot_y) *hot_y = 0;
1785 return EINA_FALSE;
1565} 1786}
1566 1787
1567EAPI void 1788EAPI void
1568ecore_evas_cursor_get(const Ecore_Evas *ee, Evas_Object **obj, int *layer, int *hot_x, int *hot_y) 1789ecore_evas_cursor_get(const Ecore_Evas *ee, Evas_Object **obj, int *layer, int *hot_x, int *hot_y)
1569{ 1790{
1570 ECORE_EVAS_CHECK(ee); 1791 ecore_evas_cursor_device_get(ee, NULL, obj, layer, hot_x, hot_y);
1571 if (obj) *obj = ee->prop.cursor.object;
1572 if (layer) *layer = ee->prop.cursor.layer;
1573 if (hot_x) *hot_x = ee->prop.cursor.hot.x;
1574 if (hot_y) *hot_y = ee->prop.cursor.hot.y;
1575} 1792}
1576 1793
1577EAPI Evas_Object * 1794EAPI Evas_Object *
1578ecore_evas_cursor_unset(Ecore_Evas *ee) 1795ecore_evas_cursor_unset(Ecore_Evas *ee)
1579{ 1796{
1797 Ecore_Evas_Cursor *cursor;
1798 Efl_Input_Device *pointer;
1580 Evas_Object *obj; 1799 Evas_Object *obj;
1581 1800
1582 ECORE_EVAS_CHECK(ee, NULL); 1801 ECORE_EVAS_CHECK(ee, NULL);
1583 1802
1584 obj = ee->prop.cursor.object; 1803 pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_MOUSE);
1585 IFC(ee, fn_object_cursor_unset) (ee); 1804 cursor = eina_hash_find(ee->prop.cursors, &pointer);
1805 EINA_SAFETY_ON_NULL_RETURN_VAL(cursor, NULL);
1806 obj = cursor->object;
1807 if (ee->engine.func->fn_object_cursor_unset)
1808 ee->engine.func->fn_object_cursor_unset(ee);
1586 evas_object_hide(obj); 1809 evas_object_hide(obj);
1587 ee->prop.cursor.object = NULL; 1810 cursor->object = NULL;
1588 } 1811 evas_object_event_callback_del_full(obj, EVAS_CALLBACK_DEL,
1589 1812 _ecore_evas_object_cursor_del,
1813 cursor);
1590 return obj; 1814 return obj;
1591} 1815}
1592 1816
@@ -2386,7 +2610,8 @@ ecore_evas_pointer_device_xy_get(const Ecore_Evas *ee,
2386 const Efl_Input_Device *pointer, Evas_Coord *x, 2610 const Efl_Input_Device *pointer, Evas_Coord *x,
2387 Evas_Coord *y) 2611 Evas_Coord *y)
2388{ 2612{
2389 if (!pointer || pointer == evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_MOUSE)) 2613 if ((!pointer) ||
2614 (pointer == evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_MOUSE)))
2390 ecore_evas_pointer_xy_get(ee, x, y); 2615 ecore_evas_pointer_xy_get(ee, x, y);
2391 else 2616 else
2392 { 2617 {
@@ -2853,8 +3078,9 @@ _ecore_evas_free(Ecore_Evas *ee)
2853 ecore_timer_del(ee->prop.wm_rot.manual_mode.timer); 3078 ecore_timer_del(ee->prop.wm_rot.manual_mode.timer);
2854 _ecore_evas_aux_hint_free(ee); 3079 _ecore_evas_aux_hint_free(ee);
2855 ee->prop.wm_rot.manual_mode.timer = NULL; 3080 ee->prop.wm_rot.manual_mode.timer = NULL;
2856 if (ee->prop.cursor.object) evas_object_del(ee->prop.cursor.object); 3081 efl_event_callback_array_del(ee->evas, _ecore_evas_device_cbs(), ee);
2857 ee->prop.cursor.object = NULL; 3082 eina_hash_free(ee->prop.cursors);
3083 ee->prop.cursors = NULL;
2858 if (ee->evas) evas_free(ee->evas); 3084 if (ee->evas) evas_free(ee->evas);
2859 ee->evas = NULL; 3085 ee->evas = NULL;
2860 ECORE_MAGIC_SET(ee, ECORE_MAGIC_NONE); 3086 ECORE_MAGIC_SET(ee, ECORE_MAGIC_NONE);
@@ -2904,49 +3130,98 @@ _ecore_evas_idle_timeout_update(Ecore_Evas *ee)
2904} 3130}
2905 3131
2906static void 3132static void
2907_ecore_evas_mouse_move_process_internal(Ecore_Evas *ee, int x, int y, unsigned int timestamp, Eina_Bool feed) 3133_ecore_evas_mouse_move_process_internal(Ecore_Evas *ee,
3134 Efl_Input_Device *pointer,
3135 int x, int y, unsigned int timestamp,
3136 Eina_Bool feed)
2908{ 3137{
2909 int fx, fy, fw, fh; 3138 Efl_Input_Pointer_Data *ev;
3139 Efl_Input_Pointer *evt;
3140 Eina_Bool send_event = EINA_TRUE;
3141 Ecore_Evas_Cursor *cursor;
3142 int fx, fy, fw, fh, evt_x, evt_y;
2910 ee->mouse.x = x; 3143 ee->mouse.x = x;
2911 ee->mouse.y = y; 3144 ee->mouse.y = y;
2912 3145
2913 evas_output_framespace_get(ee->evas, &fx, &fy, &fw, &fh); 3146 evas_output_framespace_get(ee->evas, &fx, &fy, &fw, &fh);
2914 3147
2915 if (ee->prop.cursor.object) 3148 if (!pointer)
3149 pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_MOUSE);
3150 cursor = eina_hash_find(ee->prop.cursors, &pointer);
3151 EINA_SAFETY_ON_NULL_RETURN(cursor);
3152 if (cursor->object)
2916 { 3153 {
2917 evas_object_show(ee->prop.cursor.object); 3154 evas_object_show(cursor->object);
2918 if (ee->rotation == 0) 3155 if (ee->rotation == 0)
2919 evas_object_move(ee->prop.cursor.object, 3156 evas_object_move(cursor->object,
2920 x - fx - ee->prop.cursor.hot.x, 3157 x - fx - cursor->hot.x,
2921 y - fy - ee->prop.cursor.hot.y); 3158 y - fy - cursor->hot.y);
2922 else if (ee->rotation == 90) 3159 else if (ee->rotation == 90)
2923 evas_object_move(ee->prop.cursor.object, 3160 evas_object_move(cursor->object,
2924 ee->h + fw - y - fx - 1 - ee->prop.cursor.hot.x, 3161 ee->h + fw - y - fx - 1 - cursor->hot.x,
2925 x - fy - ee->prop.cursor.hot.y); 3162 x - fy - cursor->hot.y);
2926 else if (ee->rotation == 180) 3163 else if (ee->rotation == 180)
2927 evas_object_move(ee->prop.cursor.object, 3164 evas_object_move(cursor->object,
2928 ee->w + fw - x - fx - 1 - ee->prop.cursor.hot.x, 3165 ee->w + fw - x - fx - 1 - cursor->hot.x,
2929 ee->h + fh - y - fy - 1 - ee->prop.cursor.hot.y); 3166 ee->h + fh - y - fy - 1 - cursor->hot.y);
2930 else if (ee->rotation == 270) 3167 else if (ee->rotation == 270)
2931 evas_object_move(ee->prop.cursor.object, 3168 evas_object_move(cursor->object,
2932 y - fx - ee->prop.cursor.hot.x, 3169 y - fx - cursor->hot.x,
2933 ee->w + fh - x - fy - 1 - ee->prop.cursor.hot.y); 3170 ee->w + fh - x - fy - 1 - cursor->hot.y);
2934 } 3171 }
3172
2935 if (!feed) return; 3173 if (!feed) return;
2936 if (ee->rotation == 0) 3174 if (ee->rotation == 0)
2937 evas_event_input_mouse_move(ee->evas, x, y, timestamp, NULL); 3175 {
3176 evt_x = x;
3177 evt_y = y;
3178 }
2938 else if (ee->rotation == 90) 3179 else if (ee->rotation == 90)
2939 evas_event_input_mouse_move(ee->evas, ee->h + fw - y - 1, x, timestamp, NULL); 3180 {
3181 evt_x = ee->h + fw - y - 1;
3182 evt_y = x;
3183 }
2940 else if (ee->rotation == 180) 3184 else if (ee->rotation == 180)
2941 evas_event_input_mouse_move(ee->evas, ee->w + fw - x - 1, ee->h + fh - y - 1, timestamp, NULL); 3185 {
3186 evt_x = ee->w + fw - x - 1;
3187 evt_y = ee->h + fh - y - 1;
3188 }
2942 else if (ee->rotation == 270) 3189 else if (ee->rotation == 270)
2943 evas_event_input_mouse_move(ee->evas, y, ee->w + fh - x - 1, timestamp, NULL); 3190 {
3191 evt_x = y;
3192 evt_y = ee->w + fh - x - 1;
3193 }
3194 else
3195 send_event = EINA_FALSE;
3196
3197 if (!send_event) return;
3198
3199 evt = efl_input_instance_get(EFL_INPUT_POINTER_CLASS, ee->evas, (void **) &ev);
3200 if (!evt) return;
3201
3202 ev->action = EFL_POINTER_ACTION_MOVE;
3203 ev->device = efl_ref(pointer);
3204 ev->timestamp = timestamp;
3205 ev->cur.x = evt_x;
3206 ev->cur.y = evt_y;
3207 efl_event_callback_legacy_call(ee->evas,
3208 _event_description_get(ev->action), evt);
3209 efl_del(evt);
2944} 3210}
2945 3211
2946EAPI void 3212EAPI void
2947_ecore_evas_mouse_move_process(Ecore_Evas *ee, int x, int y, unsigned int timestamp) 3213_ecore_evas_mouse_move_process(Ecore_Evas *ee, int x, int y, unsigned int timestamp)
2948{ 3214{
2949 _ecore_evas_mouse_move_process_internal(ee, x, y, timestamp, EINA_TRUE); 3215 _ecore_evas_mouse_move_process_internal(ee, NULL, x, y, timestamp,
3216 EINA_TRUE);
3217}
3218
3219EAPI void
3220_ecore_evas_mouse_device_move_process(Ecore_Evas *ee, Efl_Input_Device *pointer,
3221 int x, int y, unsigned int timestamp)
3222{
3223 _ecore_evas_mouse_move_process_internal(ee, pointer, x, y, timestamp,
3224 EINA_TRUE);
2950} 3225}
2951 3226
2952EAPI void 3227EAPI void
@@ -3203,6 +3478,7 @@ _ecore_evas_aux_hint_free(Ecore_Evas *ee)
3203EAPI Ecore_Evas * 3478EAPI Ecore_Evas *
3204ecore_evas_fb_new(const char *disp_name, int rotation, int w, int h) 3479ecore_evas_fb_new(const char *disp_name, int rotation, int w, int h)
3205{ 3480{
3481 Ecore_Evas *ee;
3206 Ecore_Evas *(*new)(const char *, int, int, int); 3482 Ecore_Evas *(*new)(const char *, int, int, int);
3207 Eina_Module *m = _ecore_evas_engine_load("fb"); 3483 Eina_Module *m = _ecore_evas_engine_load("fb");
3208 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL); 3484 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
@@ -3210,12 +3486,19 @@ ecore_evas_fb_new(const char *disp_name, int rotation, int w, int h)
3210 new = eina_module_symbol_get(m, "ecore_evas_fb_new_internal"); 3486 new = eina_module_symbol_get(m, "ecore_evas_fb_new_internal");
3211 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL); 3487 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
3212 3488
3213 return new(disp_name, rotation, w, h); 3489 ee = new(disp_name, rotation, w, h);
3490 if (!_ecore_evas_cursors_init(ee))
3491 {
3492 ecore_evas_free(ee);
3493 return NULL;
3494 }
3495 return ee;
3214} 3496}
3215 3497
3216EAPI Ecore_Evas * 3498EAPI Ecore_Evas *
3217ecore_evas_software_x11_new(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h) 3499ecore_evas_software_x11_new(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h)
3218{ 3500{
3501 Ecore_Evas *ee;
3219 Ecore_Evas *(*new)(const char *, Ecore_X_Window, int, int, int, int); 3502 Ecore_Evas *(*new)(const char *, Ecore_X_Window, int, int, int, int);
3220 Eina_Module *m = _ecore_evas_engine_load("x"); 3503 Eina_Module *m = _ecore_evas_engine_load("x");
3221 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL); 3504 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
@@ -3223,7 +3506,13 @@ ecore_evas_software_x11_new(const char *disp_name, Ecore_X_Window parent, int x,
3223 new = eina_module_symbol_get(m, "ecore_evas_software_x11_new_internal"); 3506 new = eina_module_symbol_get(m, "ecore_evas_software_x11_new_internal");
3224 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL); 3507 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
3225 3508
3226 return new(disp_name, parent, x, y, w, h); 3509 ee = new(disp_name, parent, x, y, w, h);
3510 if (!_ecore_evas_cursors_init(ee))
3511 {
3512 ecore_evas_free(ee);
3513 return NULL;
3514 }
3515 return ee;
3227} 3516}
3228 3517
3229EAPI Ecore_X_Window 3518EAPI Ecore_X_Window
@@ -3269,6 +3558,7 @@ ecore_evas_software_x11_extra_event_window_add(Ecore_Evas *ee, Ecore_X_Window wi
3269EAPI Ecore_Evas * 3558EAPI Ecore_Evas *
3270ecore_evas_software_x11_pixmap_new(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h) 3559ecore_evas_software_x11_pixmap_new(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h)
3271{ 3560{
3561 Ecore_Evas *ee;
3272 Ecore_Evas *(*new)(const char *, Ecore_X_Window, int, int, int, int); 3562 Ecore_Evas *(*new)(const char *, Ecore_X_Window, int, int, int, int);
3273 Eina_Module *m = _ecore_evas_engine_load("x"); 3563 Eina_Module *m = _ecore_evas_engine_load("x");
3274 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL); 3564 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
@@ -3276,7 +3566,14 @@ ecore_evas_software_x11_pixmap_new(const char *disp_name, Ecore_X_Window parent,
3276 new = eina_module_symbol_get(m, "ecore_evas_software_x11_pixmap_new_internal"); 3566 new = eina_module_symbol_get(m, "ecore_evas_software_x11_pixmap_new_internal");
3277 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL); 3567 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
3278 3568
3279 return new(disp_name, parent, x, y, w, h); 3569 ee = new(disp_name, parent, x, y, w, h);
3570 if (!_ecore_evas_cursors_init(ee))
3571 {
3572 ecore_evas_free(ee);
3573 return NULL;
3574 }
3575 return ee;
3576
3280} 3577}
3281 3578
3282EAPI Ecore_X_Pixmap 3579EAPI Ecore_X_Pixmap
@@ -3295,6 +3592,7 @@ ecore_evas_software_x11_pixmap_get(const Ecore_Evas *ee)
3295EAPI Ecore_Evas * 3592EAPI Ecore_Evas *
3296ecore_evas_gl_x11_new(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h) 3593ecore_evas_gl_x11_new(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h)
3297{ 3594{
3595 Ecore_Evas *ee;
3298 Ecore_Evas *(*new)(const char *, Ecore_X_Window, int, int, int, int); 3596 Ecore_Evas *(*new)(const char *, Ecore_X_Window, int, int, int, int);
3299 Eina_Module *m = _ecore_evas_engine_load("x"); 3597 Eina_Module *m = _ecore_evas_engine_load("x");
3300 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL); 3598 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
@@ -3302,12 +3600,20 @@ ecore_evas_gl_x11_new(const char *disp_name, Ecore_X_Window parent, int x, int y
3302 new = eina_module_symbol_get(m, "ecore_evas_gl_x11_new_internal"); 3600 new = eina_module_symbol_get(m, "ecore_evas_gl_x11_new_internal");
3303 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL); 3601 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
3304 3602
3305 return new(disp_name, parent, x, y, w, h); 3603 ee = new(disp_name, parent, x, y, w, h);
3604 if (!_ecore_evas_cursors_init(ee))
3605 {
3606 ecore_evas_free(ee);
3607 return NULL;
3608 }
3609 return ee;
3610
3306} 3611}
3307 3612
3308EAPI Ecore_Evas * 3613EAPI Ecore_Evas *
3309ecore_evas_gl_x11_options_new(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h, const int *opt) 3614ecore_evas_gl_x11_options_new(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h, const int *opt)
3310{ 3615{
3616 Ecore_Evas *ee;
3311 Ecore_Evas *(*new)(const char *, Ecore_X_Window, int, int, int, int, const int*); 3617 Ecore_Evas *(*new)(const char *, Ecore_X_Window, int, int, int, int, const int*);
3312 Eina_Module *m = _ecore_evas_engine_load("x"); 3618 Eina_Module *m = _ecore_evas_engine_load("x");
3313 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL); 3619 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
@@ -3315,12 +3621,19 @@ ecore_evas_gl_x11_options_new(const char *disp_name, Ecore_X_Window parent, int
3315 new = eina_module_symbol_get(m, "ecore_evas_gl_x11_options_new_internal"); 3621 new = eina_module_symbol_get(m, "ecore_evas_gl_x11_options_new_internal");
3316 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL); 3622 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
3317 3623
3318 return new(disp_name, parent, x, y, w, h, opt); 3624 ee = new(disp_name, parent, x, y, w, h, opt);
3625 if (!_ecore_evas_cursors_init(ee))
3626 {
3627 ecore_evas_free(ee);
3628 return NULL;
3629 }
3630 return ee;
3319} 3631}
3320 3632
3321EAPI Ecore_Evas * 3633EAPI Ecore_Evas *
3322ecore_evas_gl_x11_pixmap_new(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h) 3634ecore_evas_gl_x11_pixmap_new(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h)
3323{ 3635{
3636 Ecore_Evas *ee;
3324 Ecore_Evas *(*new)(const char *, Ecore_X_Window, int, int, int, int); 3637 Ecore_Evas *(*new)(const char *, Ecore_X_Window, int, int, int, int);
3325 Eina_Module *m = _ecore_evas_engine_load("x"); 3638 Eina_Module *m = _ecore_evas_engine_load("x");
3326 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL); 3639 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
@@ -3328,7 +3641,14 @@ ecore_evas_gl_x11_pixmap_new(const char *disp_name, Ecore_X_Window parent, int x
3328 new = eina_module_symbol_get(m, "ecore_evas_gl_x11_pixmap_new_internal"); 3641 new = eina_module_symbol_get(m, "ecore_evas_gl_x11_pixmap_new_internal");
3329 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL); 3642 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
3330 3643
3331 return new(disp_name, parent, x, y, w, h); 3644 ee = new(disp_name, parent, x, y, w, h);
3645 if (!_ecore_evas_cursors_init(ee))
3646 {
3647 ecore_evas_free(ee);
3648 return NULL;
3649 }
3650 return ee;
3651
3332} 3652}
3333 3653
3334EAPI Ecore_X_Pixmap 3654EAPI Ecore_X_Pixmap
@@ -3524,6 +3844,7 @@ ecore_evas_vnc_stop(Ecore_Evas *ee)
3524EAPI Ecore_Evas * 3844EAPI Ecore_Evas *
3525ecore_evas_extn_socket_new(int w, int h) 3845ecore_evas_extn_socket_new(int w, int h)
3526{ 3846{
3847 Ecore_Evas *ee;
3527 Ecore_Evas *(*new)(int, int); 3848 Ecore_Evas *(*new)(int, int);
3528 Eina_Module *m = _ecore_evas_engine_load("extn"); 3849 Eina_Module *m = _ecore_evas_engine_load("extn");
3529 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL); 3850 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
@@ -3531,7 +3852,14 @@ ecore_evas_extn_socket_new(int w, int h)
3531 new = eina_module_symbol_get(m, "ecore_evas_extn_socket_new_internal"); 3852 new = eina_module_symbol_get(m, "ecore_evas_extn_socket_new_internal");
3532 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL); 3853 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
3533 3854
3534 return new(w, h); 3855 ee = new(w, h);
3856 if (!_ecore_evas_cursors_init(ee))
3857 {
3858 ecore_evas_free(ee);
3859 return NULL;
3860 }
3861 return ee;
3862
3535} 3863}
3536 3864
3537EAPI Eina_Bool 3865EAPI Eina_Bool
@@ -3634,6 +3962,7 @@ EAPI Ecore_Evas *
3634ecore_evas_sdl_new(const char* name, int w, int h, int fullscreen, 3962ecore_evas_sdl_new(const char* name, int w, int h, int fullscreen,
3635 int hwsurface, int noframe, int alpha) 3963 int hwsurface, int noframe, int alpha)
3636{ 3964{
3965 Ecore_Evas *ee;
3637 Ecore_Evas *(*new)(const char *, int, int, int, int, int, int); 3966 Ecore_Evas *(*new)(const char *, int, int, int, int, int, int);
3638 Eina_Module *m = _ecore_evas_engine_load("sdl"); 3967 Eina_Module *m = _ecore_evas_engine_load("sdl");
3639 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL); 3968 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
@@ -3641,13 +3970,20 @@ ecore_evas_sdl_new(const char* name, int w, int h, int fullscreen,
3641 new = eina_module_symbol_get(m, "ecore_evas_sdl_new_internal"); 3970 new = eina_module_symbol_get(m, "ecore_evas_sdl_new_internal");
3642 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL); 3971 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
3643 3972
3644 return new(name, w, h, fullscreen, hwsurface, noframe, alpha); 3973 ee = new(name, w, h, fullscreen, hwsurface, noframe, alpha);
3974 if (!_ecore_evas_cursors_init(ee))
3975 {
3976 ecore_evas_free(ee);
3977 return NULL;
3978 }
3979 return ee;
3645} 3980}
3646 3981
3647EAPI Ecore_Evas * 3982EAPI Ecore_Evas *
3648ecore_evas_sdl16_new(const char* name, int w, int h, int fullscreen, 3983ecore_evas_sdl16_new(const char* name, int w, int h, int fullscreen,
3649 int hwsurface, int noframe, int alpha) 3984 int hwsurface, int noframe, int alpha)
3650{ 3985{
3986 Ecore_Evas *ee;
3651 Ecore_Evas *(*new)(const char *, int, int, int, int, int, int); 3987 Ecore_Evas *(*new)(const char *, int, int, int, int, int, int);
3652 Eina_Module *m = _ecore_evas_engine_load("sdl"); 3988 Eina_Module *m = _ecore_evas_engine_load("sdl");
3653 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL); 3989 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
@@ -3655,12 +3991,19 @@ ecore_evas_sdl16_new(const char* name, int w, int h, int fullscreen,
3655 new = eina_module_symbol_get(m, "ecore_evas_sdl16_new_internal"); 3991 new = eina_module_symbol_get(m, "ecore_evas_sdl16_new_internal");
3656 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL); 3992 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
3657 3993
3658 return new(name, w, h, fullscreen, hwsurface, noframe, alpha); 3994 ee = new(name, w, h, fullscreen, hwsurface, noframe, alpha);
3995 if (!_ecore_evas_cursors_init(ee))
3996 {
3997 ecore_evas_free(ee);
3998 return NULL;
3999 }
4000 return ee;
3659} 4001}
3660 4002
3661EAPI Ecore_Evas * 4003EAPI Ecore_Evas *
3662ecore_evas_gl_sdl_new(const char* name, int w, int h, int fullscreen, int noframe) 4004ecore_evas_gl_sdl_new(const char* name, int w, int h, int fullscreen, int noframe)
3663{ 4005{
4006 Ecore_Evas *ee;
3664 Ecore_Evas *(*new)(const char *, int, int, int, int); 4007 Ecore_Evas *(*new)(const char *, int, int, int, int);
3665 Eina_Module *m = _ecore_evas_engine_load("sdl"); 4008 Eina_Module *m = _ecore_evas_engine_load("sdl");
3666 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL); 4009 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
@@ -3668,13 +4011,20 @@ ecore_evas_gl_sdl_new(const char* name, int w, int h, int fullscreen, int nofram
3668 new = eina_module_symbol_get(m, "ecore_evas_gl_sdl_new_internal"); 4011 new = eina_module_symbol_get(m, "ecore_evas_gl_sdl_new_internal");
3669 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL); 4012 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
3670 4013
3671 return new(name, w, h, fullscreen, noframe); 4014 ee = new(name, w, h, fullscreen, noframe);
4015 if (!_ecore_evas_cursors_init(ee))
4016 {
4017 ecore_evas_free(ee);
4018 return NULL;
4019 }
4020 return ee;
3672} 4021}
3673 4022
3674EAPI Ecore_Evas * 4023EAPI Ecore_Evas *
3675ecore_evas_wayland_shm_new(const char *disp_name, unsigned int parent, 4024ecore_evas_wayland_shm_new(const char *disp_name, unsigned int parent,
3676 int x, int y, int w, int h, Eina_Bool frame) 4025 int x, int y, int w, int h, Eina_Bool frame)
3677{ 4026{
4027 Ecore_Evas *ee;
3678 Ecore_Evas *(*new)(const char *, unsigned int, int, int, int, int, Eina_Bool); 4028 Ecore_Evas *(*new)(const char *, unsigned int, int, int, int, int, Eina_Bool);
3679 Eina_Module *m = _ecore_evas_engine_load("wayland"); 4029 Eina_Module *m = _ecore_evas_engine_load("wayland");
3680 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL); 4030 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
@@ -3682,13 +4032,20 @@ ecore_evas_wayland_shm_new(const char *disp_name, unsigned int parent,
3682 new = eina_module_symbol_get(m, "ecore_evas_wayland_shm_new_internal"); 4032 new = eina_module_symbol_get(m, "ecore_evas_wayland_shm_new_internal");
3683 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL); 4033 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
3684 4034
3685 return new(disp_name, parent, x, y, w, h, frame); 4035 ee = new(disp_name, parent, x, y, w, h, frame);
4036 if (!_ecore_evas_cursors_init(ee))
4037 {
4038 ecore_evas_free(ee);
4039 return NULL;
4040 }
4041 return ee;
3686} 4042}
3687 4043
3688EAPI Ecore_Evas * 4044EAPI Ecore_Evas *
3689ecore_evas_wayland_egl_new(const char *disp_name, unsigned int parent, 4045ecore_evas_wayland_egl_new(const char *disp_name, unsigned int parent,
3690 int x, int y, int w, int h, Eina_Bool frame) 4046 int x, int y, int w, int h, Eina_Bool frame)
3691{ 4047{
4048 Ecore_Evas *ee;
3692 Ecore_Evas *(*new)(const char *, unsigned int, int, int, int, int, Eina_Bool); 4049 Ecore_Evas *(*new)(const char *, unsigned int, int, int, int, int, Eina_Bool);
3693 Eina_Module *m = _ecore_evas_engine_load("wayland"); 4050 Eina_Module *m = _ecore_evas_engine_load("wayland");
3694 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL); 4051 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
@@ -3696,7 +4053,13 @@ ecore_evas_wayland_egl_new(const char *disp_name, unsigned int parent,
3696 new = eina_module_symbol_get(m, "ecore_evas_wayland_egl_new_internal"); 4053 new = eina_module_symbol_get(m, "ecore_evas_wayland_egl_new_internal");
3697 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL); 4054 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
3698 4055
3699 return new(disp_name, parent, x, y, w, h, frame); 4056 ee = new(disp_name, parent, x, y, w, h, frame);
4057 if (!_ecore_evas_cursors_init(ee))
4058 {
4059 ecore_evas_free(ee);
4060 return NULL;
4061 }
4062 return ee;
3700} 4063}
3701 4064
3702EAPI void 4065EAPI void
@@ -3772,6 +4135,7 @@ EAPI Ecore_Evas *
3772ecore_evas_drm_new(const char *disp_name, unsigned int parent, 4135ecore_evas_drm_new(const char *disp_name, unsigned int parent,
3773 int x, int y, int w, int h) 4136 int x, int y, int w, int h)
3774{ 4137{
4138 Ecore_Evas *ee;
3775 Ecore_Evas *(*new)(const char *, unsigned int, int, int, int, int); 4139 Ecore_Evas *(*new)(const char *, unsigned int, int, int, int, int);
3776 Eina_Module *m = _ecore_evas_engine_load("drm"); 4140 Eina_Module *m = _ecore_evas_engine_load("drm");
3777 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL); 4141 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
@@ -3779,13 +4143,20 @@ ecore_evas_drm_new(const char *disp_name, unsigned int parent,
3779 new = eina_module_symbol_get(m, "ecore_evas_drm_new_internal"); 4143 new = eina_module_symbol_get(m, "ecore_evas_drm_new_internal");
3780 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL); 4144 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
3781 4145
3782 return new(disp_name, parent, x, y, w, h); 4146 ee = new(disp_name, parent, x, y, w, h);
4147 if (!_ecore_evas_cursors_init(ee))
4148 {
4149 ecore_evas_free(ee);
4150 return NULL;
4151 }
4152 return ee;
3783} 4153}
3784 4154
3785EAPI Ecore_Evas * 4155EAPI Ecore_Evas *
3786ecore_evas_gl_drm_new(const char *disp_name, unsigned int parent, 4156ecore_evas_gl_drm_new(const char *disp_name, unsigned int parent,
3787 int x, int y, int w, int h) 4157 int x, int y, int w, int h)
3788{ 4158{
4159 Ecore_Evas *ee;
3789 Ecore_Evas *(*new)(const char *, unsigned int, int, int, int, int); 4160 Ecore_Evas *(*new)(const char *, unsigned int, int, int, int, int);
3790 Eina_Module *m = _ecore_evas_engine_load("drm"); 4161 Eina_Module *m = _ecore_evas_engine_load("drm");
3791 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL); 4162 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
@@ -3793,7 +4164,14 @@ ecore_evas_gl_drm_new(const char *disp_name, unsigned int parent,
3793 new = eina_module_symbol_get(m, "ecore_evas_gl_drm_new_internal"); 4164 new = eina_module_symbol_get(m, "ecore_evas_gl_drm_new_internal");
3794 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL); 4165 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
3795 4166
3796 return new(disp_name, parent, x, y, w, h); 4167 ee = new(disp_name, parent, x, y, w, h);
4168 if (!_ecore_evas_cursors_init(ee))
4169 {
4170 ecore_evas_free(ee);
4171 return NULL;
4172 }
4173 return ee;
4174
3797} 4175}
3798 4176
3799EAPI Ecore_Evas * 4177EAPI Ecore_Evas *
@@ -3803,6 +4181,7 @@ ecore_evas_software_gdi_new(Ecore_Win32_Window *parent,
3803 int width, 4181 int width,
3804 int height) 4182 int height)
3805{ 4183{
4184 Ecore_Evas *ee;
3806 Ecore_Evas *(*new)(Ecore_Win32_Window *, int, int, int, int); 4185 Ecore_Evas *(*new)(Ecore_Win32_Window *, int, int, int, int);
3807 Eina_Module *m = _ecore_evas_engine_load("win32"); 4186 Eina_Module *m = _ecore_evas_engine_load("win32");
3808 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL); 4187 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
@@ -3810,7 +4189,14 @@ ecore_evas_software_gdi_new(Ecore_Win32_Window *parent,
3810 new = eina_module_symbol_get(m, "ecore_evas_software_gdi_new_internal"); 4189 new = eina_module_symbol_get(m, "ecore_evas_software_gdi_new_internal");
3811 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL); 4190 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
3812 4191
3813 return new(parent, x, y, width, height); 4192 ee = new(parent, x, y, width, height);
4193 if (!_ecore_evas_cursors_init(ee))
4194 {
4195 ecore_evas_free(ee);
4196 return NULL;
4197 }
4198 return ee;
4199
3814} 4200}
3815 4201
3816EAPI Ecore_Evas * 4202EAPI Ecore_Evas *
@@ -3820,6 +4206,7 @@ ecore_evas_software_ddraw_new(Ecore_Win32_Window *parent,
3820 int width, 4206 int width,
3821 int height) 4207 int height)
3822{ 4208{
4209 Ecore_Evas *ee;
3823 Ecore_Evas *(*new)(Ecore_Win32_Window *, int, int, int, int); 4210 Ecore_Evas *(*new)(Ecore_Win32_Window *, int, int, int, int);
3824 Eina_Module *m = _ecore_evas_engine_load("win32"); 4211 Eina_Module *m = _ecore_evas_engine_load("win32");
3825 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL); 4212 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
@@ -3827,7 +4214,13 @@ ecore_evas_software_ddraw_new(Ecore_Win32_Window *parent,
3827 new = eina_module_symbol_get(m, "ecore_evas_software_ddraw_new_internal"); 4214 new = eina_module_symbol_get(m, "ecore_evas_software_ddraw_new_internal");
3828 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL); 4215 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
3829 4216
3830 return new(parent, x, y, width, height); 4217 ee = new(parent, x, y, width, height);
4218 if (!_ecore_evas_cursors_init(ee))
4219 {
4220 ecore_evas_free(ee);
4221 return NULL;
4222 }
4223 return ee;
3831} 4224}
3832 4225
3833EAPI Ecore_Win32_Window * 4226EAPI Ecore_Win32_Window *
@@ -3843,6 +4236,7 @@ ecore_evas_win32_window_get(const Ecore_Evas *ee)
3843EAPI Ecore_Evas * 4236EAPI Ecore_Evas *
3844ecore_evas_cocoa_new(Ecore_Cocoa_Window *parent, int x, int y, int w, int h) 4237ecore_evas_cocoa_new(Ecore_Cocoa_Window *parent, int x, int y, int w, int h)
3845{ 4238{
4239 Ecore_Evas *ee;
3846 Ecore_Evas *(*new)(Ecore_Cocoa_Window *, int, int, int, int); 4240 Ecore_Evas *(*new)(Ecore_Cocoa_Window *, int, int, int, int);
3847 Eina_Module *m = _ecore_evas_engine_load("cocoa"); 4241 Eina_Module *m = _ecore_evas_engine_load("cocoa");
3848 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL); 4242 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
@@ -3850,12 +4244,19 @@ ecore_evas_cocoa_new(Ecore_Cocoa_Window *parent, int x, int y, int w, int h)
3850 new = eina_module_symbol_get(m, "ecore_evas_cocoa_new_internal"); 4244 new = eina_module_symbol_get(m, "ecore_evas_cocoa_new_internal");
3851 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL); 4245 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
3852 4246
3853 return new(parent, x, y, w, h); 4247 ee = new(parent, x, y, w, h);
4248 if (!_ecore_evas_cursors_init(ee))
4249 {
4250 ecore_evas_free(ee);
4251 return NULL;
4252 }
4253 return ee;
3854} 4254}
3855 4255
3856EAPI Ecore_Evas * 4256EAPI Ecore_Evas *
3857ecore_evas_psl1ght_new(const char* name, int w, int h) 4257ecore_evas_psl1ght_new(const char* name, int w, int h)
3858{ 4258{
4259 Ecore_Evas *ee;
3859 Ecore_Evas *(*new)(const char*, int, int); 4260 Ecore_Evas *(*new)(const char*, int, int);
3860 Eina_Module *m = _ecore_evas_engine_load("psl1ght"); 4261 Eina_Module *m = _ecore_evas_engine_load("psl1ght");
3861 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL); 4262 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
@@ -3863,7 +4264,13 @@ ecore_evas_psl1ght_new(const char* name, int w, int h)
3863 new = eina_module_symbol_get(m, "ecore_evas_psl1ght_new_internal"); 4264 new = eina_module_symbol_get(m, "ecore_evas_psl1ght_new_internal");
3864 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL); 4265 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
3865 4266
3866 return new(name, w, h); 4267 ee = new(name, w, h);
4268 if (!_ecore_evas_cursors_init(ee))
4269 {
4270 ecore_evas_free(ee);
4271 return NULL;
4272 }
4273 return ee;
3867} 4274}
3868 4275
3869 4276
@@ -3995,7 +4402,8 @@ _direct_mouse_move_cb(Ecore_Evas *ee, const Ecore_Event_Mouse_Move *info)
3995 Evas *e = ee->evas; 4402 Evas *e = ee->evas;
3996 Eina_Bool processed; 4403 Eina_Bool processed;
3997 4404
3998 _ecore_evas_mouse_move_process_internal(ee, info->x, info->y, info->timestamp, EINA_FALSE); 4405 _ecore_evas_mouse_move_process_internal(ee, info->dev, info->x, info->y,
4406 info->timestamp, EINA_FALSE);
3999 4407
4000 /* Unused information: 4408 /* Unused information:
4001 * same_screen 4409 * same_screen
diff --git a/src/lib/ecore_evas/ecore_evas_buffer.c b/src/lib/ecore_evas/ecore_evas_buffer.c
index 979f92580d..74bcdd748a 100644
--- a/src/lib/ecore_evas/ecore_evas_buffer.c
+++ b/src/lib/ecore_evas/ecore_evas_buffer.c
@@ -721,6 +721,11 @@ ecore_evas_buffer_allocfunc_new(int w, int h,
721 evas_key_lock_add(ee->evas, "Num_Lock"); 721 evas_key_lock_add(ee->evas, "Num_Lock");
722 evas_key_lock_add(ee->evas, "Scroll_Lock"); 722 evas_key_lock_add(ee->evas, "Scroll_Lock");
723 723
724 if (!_ecore_evas_cursors_init(ee))
725 {
726 ERR("Could not init the Ecore Evas cursors");
727 ecore_evas_free(ee);
728 }
724 evas_event_feed_mouse_in(ee->evas, 0, NULL); 729 evas_event_feed_mouse_in(ee->evas, 0, NULL);
725 730
726 _ecore_evas_register(ee); 731 _ecore_evas_register(ee);
diff --git a/src/lib/ecore_evas/ecore_evas_ews.c b/src/lib/ecore_evas/ecore_evas_ews.c
index 719d5ea6df..199c1d8507 100644
--- a/src/lib/ecore_evas/ecore_evas_ews.c
+++ b/src/lib/ecore_evas/ecore_evas_ews.c
@@ -400,50 +400,10 @@ _ecore_evas_ews_size_step_set(Ecore_Evas *ee, int w, int h)
400} 400}
401 401
402static void 402static void
403_ecore_evas_ews_object_cursor_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 403_ecore_evas_ews_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj EINA_UNUSED,
404 int layer EINA_UNUSED, int hot_x EINA_UNUSED,
405 int hot_y EINA_UNUSED)
404{ 406{
405 Ecore_Evas *ee = data;
406 ee->prop.cursor.object = NULL;
407}
408
409static void
410_ecore_evas_ews_object_cursor_unset(Ecore_Evas *ee)
411{
412 evas_object_event_callback_del_full(ee->prop.cursor.object, EVAS_CALLBACK_DEL, _ecore_evas_ews_object_cursor_del, ee);
413}
414
415static void
416_ecore_evas_ews_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
417{
418 int x, y;
419
420 if (ee->prop.cursor.object) evas_object_del(ee->prop.cursor.object);
421
422 if (!obj)
423 {
424 ee->prop.cursor.object = NULL;
425 ee->prop.cursor.layer = 0;
426 ee->prop.cursor.hot.x = 0;
427 ee->prop.cursor.hot.y = 0;
428 return;
429 }
430
431 ee->prop.cursor.object = obj;
432 ee->prop.cursor.layer = layer;
433 ee->prop.cursor.hot.x = hot_x;
434 ee->prop.cursor.hot.y = hot_y;
435 evas_pointer_output_xy_get(ee->evas, &x, &y);
436 evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer);
437 evas_object_move(ee->prop.cursor.object,
438 x - ee->prop.cursor.hot.x,
439 y - ee->prop.cursor.hot.y);
440 evas_object_pass_events_set(ee->prop.cursor.object, 1);
441 if (evas_pointer_inside_get(ee->evas))
442 evas_object_show(ee->prop.cursor.object);
443
444 evas_object_event_callback_add
445 (obj, EVAS_CALLBACK_DEL, _ecore_evas_ews_object_cursor_del, ee);
446
447 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_CONFIG_CHANGE); 407 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_CONFIG_CHANGE);
448} 408}
449 409
@@ -670,7 +630,7 @@ static const Ecore_Evas_Engine_Func _ecore_ews_engine_func =
670 _ecore_evas_ews_size_base_set, 630 _ecore_evas_ews_size_base_set,
671 _ecore_evas_ews_size_step_set, 631 _ecore_evas_ews_size_step_set,
672 _ecore_evas_ews_object_cursor_set, 632 _ecore_evas_ews_object_cursor_set,
673 _ecore_evas_ews_object_cursor_unset, 633 NULL,
674 _ecore_evas_ews_layer_set, 634 _ecore_evas_ews_layer_set,
675 _ecore_evas_ews_focus_set, 635 _ecore_evas_ews_focus_set,
676 _ecore_evas_ews_iconified_set, 636 _ecore_evas_ews_iconified_set,
@@ -883,7 +843,7 @@ _ecore_evas_ews_cb_mouse_out(void *data, Evas *e EINA_UNUSED, Evas_Object *obj E
883 if (ee->func.fn_mouse_out) ee->func.fn_mouse_out(ee); 843 if (ee->func.fn_mouse_out) ee->func.fn_mouse_out(ee);
884 _ecore_evas_ews_modifiers_apply(ee, ev->modifiers); 844 _ecore_evas_ews_modifiers_apply(ee, ev->modifiers);
885 evas_event_feed_mouse_out(ee->evas, ev->timestamp, NULL); 845 evas_event_feed_mouse_out(ee->evas, ev->timestamp, NULL);
886 if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object); 846 _ecore_evas_default_cursor_hide(ee);
887 _ecore_evas_mouse_move_process(ee, x, y, ev->timestamp); 847 _ecore_evas_mouse_move_process(ee, x, y, ev->timestamp);
888} 848}
889 849
@@ -1261,6 +1221,12 @@ ecore_evas_ews_new(int x, int y, int w, int h)
1261 evas_key_lock_add(ee->evas, "Num_Lock"); 1221 evas_key_lock_add(ee->evas, "Num_Lock");
1262 evas_key_lock_add(ee->evas, "Scroll_Lock"); 1222 evas_key_lock_add(ee->evas, "Scroll_Lock");
1263 1223
1224 if (!_ecore_evas_cursors_init(ee))
1225 {
1226 ERR("Could not init the Ecore Evas cursors");
1227 ecore_evas_free(ee);
1228 }
1229
1264 _ews_ee->sub_ecore_evas = eina_list_append(_ews_ee->sub_ecore_evas, ee); 1230 _ews_ee->sub_ecore_evas = eina_list_append(_ews_ee->sub_ecore_evas, ee);
1265 _ews_children = eina_list_append(_ews_children, ee); 1231 _ews_children = eina_list_append(_ews_children, ee);
1266 1232
diff --git a/src/lib/ecore_evas/ecore_evas_private.h b/src/lib/ecore_evas/ecore_evas_private.h
index 919d2dac40..74af4dccf3 100644
--- a/src/lib/ecore_evas/ecore_evas_private.h
+++ b/src/lib/ecore_evas/ecore_evas_private.h
@@ -76,6 +76,7 @@ typedef struct _Ecore_Evas_Engine Ecore_Evas_Engine;
76typedef struct _Ecore_Evas_Engine_Func Ecore_Evas_Engine_Func; 76typedef struct _Ecore_Evas_Engine_Func Ecore_Evas_Engine_Func;
77typedef struct _Ecore_Evas_Interface Ecore_Evas_Interface; 77typedef struct _Ecore_Evas_Interface Ecore_Evas_Interface;
78typedef struct _Ecore_Evas_Aux_Hint Ecore_Evas_Aux_Hint; 78typedef struct _Ecore_Evas_Aux_Hint Ecore_Evas_Aux_Hint;
79typedef struct _Ecore_Evas_Cursor Ecore_Evas_Cursor;
79 80
80/* Engines interfaces */ 81/* Engines interfaces */
81struct _Ecore_Evas_Engine_Func 82struct _Ecore_Evas_Engine_Func
@@ -187,6 +188,14 @@ struct _Ecore_Evas_Engine
187#endif 188#endif
188}; 189};
189 190
191struct _Ecore_Evas_Cursor {
192 Evas_Object *object;
193 int layer;
194 struct {
195 int x, y;
196 } hot;
197};
198
190struct _Ecore_Evas 199struct _Ecore_Evas
191{ 200{
192 EINA_INLIST; 201 EINA_INLIST;
@@ -227,6 +236,7 @@ struct _Ecore_Evas
227 } expecting_resize; 236 } expecting_resize;
228 237
229 struct { 238 struct {
239 Eina_Hash *cursors;
230 char *title; 240 char *title;
231 char *name; 241 char *name;
232 char *clas; 242 char *clas;
@@ -238,13 +248,7 @@ struct _Ecore_Evas
238 struct { 248 struct {
239 int w, h; 249 int w, h;
240 } min, max, base, step; 250 } min, max, base, step;
241 struct { 251 Ecore_Evas_Cursor cursor_cache;
242 Evas_Object *object;
243 int layer;
244 struct {
245 int x, y;
246 } hot;
247 } cursor;
248 struct { 252 struct {
249 Eina_Bool supported; // indicate that the underlying window system supports window manager rotation protocol 253 Eina_Bool supported; // indicate that the underlying window system supports window manager rotation protocol
250 Eina_Bool app_set; // indicate that the ee supports window manager rotation protocol 254 Eina_Bool app_set; // indicate that the ee supports window manager rotation protocol
@@ -390,6 +394,8 @@ EAPI void _ecore_evas_register_animators(Ecore_Evas *ee);
390EAPI void _ecore_evas_free(Ecore_Evas *ee); 394EAPI void _ecore_evas_free(Ecore_Evas *ee);
391EAPI void _ecore_evas_idle_timeout_update(Ecore_Evas *ee); 395EAPI void _ecore_evas_idle_timeout_update(Ecore_Evas *ee);
392EAPI void _ecore_evas_mouse_move_process(Ecore_Evas *ee, int x, int y, unsigned int timestamp); 396EAPI void _ecore_evas_mouse_move_process(Ecore_Evas *ee, int x, int y, unsigned int timestamp);
397EAPI void _ecore_evas_mouse_device_move_process(Ecore_Evas *ee, Efl_Input_Device *pointer,
398 int x, int y, unsigned int timestamp);
393EAPI void _ecore_evas_mouse_multi_move_process(Ecore_Evas *ee, int device, 399EAPI void _ecore_evas_mouse_multi_move_process(Ecore_Evas *ee, int device,
394 int x, int y, 400 int x, int y,
395 double radius, 401 double radius,
@@ -457,13 +463,18 @@ EAPI void ecore_evas_animator_tick(Ecore_Evas *ee, Eina_Rectangle *viewport, dou
457 463
458Eina_Module *_ecore_evas_vnc_server_module_load(void); 464Eina_Module *_ecore_evas_vnc_server_module_load(void);
459 465
460
461EAPI void _ecore_evas_focus_device_set(Ecore_Evas *ee, Efl_Input_Device *seat, 466EAPI void _ecore_evas_focus_device_set(Ecore_Evas *ee, Efl_Input_Device *seat,
462 Eina_Bool on); 467 Eina_Bool on);
463 468
464EAPI Eina_Bool _ecore_evas_mouse_in_check(Ecore_Evas *ee, Efl_Input_Device *mouse); 469EAPI Eina_Bool _ecore_evas_mouse_in_check(Ecore_Evas *ee, Efl_Input_Device *mouse);
465EAPI void _ecore_evas_mouse_inout_set(Ecore_Evas *ee, Efl_Input_Device *mouse, 470EAPI void _ecore_evas_mouse_inout_set(Ecore_Evas *ee, Efl_Input_Device *mouse,
466 Eina_Bool in, Eina_Bool force_out); 471 Eina_Bool in, Eina_Bool force_out);
472
473EAPI Evas_Object *_ecore_evas_default_cursor_image_get(Ecore_Evas *ee);
474EAPI void _ecore_evas_default_cursor_hide(Ecore_Evas *ee);
475
476Eina_Bool _ecore_evas_cursors_init(Ecore_Evas *ee);
477
467#undef EAPI 478#undef EAPI
468#define EAPI 479#define EAPI
469 480
diff --git a/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c b/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
index 488ed67a0d..6dabee4e42 100644
--- a/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
+++ b/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
@@ -464,69 +464,16 @@ _ecore_evas_title_set(Ecore_Evas *ee, const char *title)
464} 464}
465 465
466static void 466static void
467_ecore_evas_object_cursor_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 467_ecore_evas_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj,
468 int layer EINA_UNUSED, int hot_x EINA_UNUSED,
469 int hot_y EINA_UNUSED)
468{ 470{
469 Ecore_Evas *ee;
470
471 DBG("");
472
473 ee = data;
474 if (ee)
475 ee->prop.cursor.object = NULL;
476}
477
478static void
479_ecore_evas_object_cursor_unset(Ecore_Evas *ee)
480{
481 evas_object_event_callback_del_full(ee->prop.cursor.object, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee);
482}
483
484static void
485_ecore_evas_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
486{
487 int x, y;
488 Evas_Object *old;
489 Ecore_Cocoa_Window *win = (Ecore_Cocoa_Window *)(ee->prop.window); 471 Ecore_Cocoa_Window *win = (Ecore_Cocoa_Window *)(ee->prop.window);
490 DBG("");
491
492 old = ee->prop.cursor.object;
493 if (obj == NULL)
494 {
495 ee->prop.cursor.object = NULL;
496 ee->prop.cursor.layer = 0;
497 ee->prop.cursor.hot.x = 0;
498 ee->prop.cursor.hot.y = 0;
499 ecore_cocoa_window_cursor_show(win, EINA_TRUE);
500 goto end;
501 }
502
503 ee->prop.cursor.object = obj;
504 ee->prop.cursor.layer = layer;
505 ee->prop.cursor.hot.x = hot_x;
506 ee->prop.cursor.hot.y = hot_y;
507 472
508 evas_pointer_output_xy_get(ee->evas, &x, &y); 473 if (!obj)
509 if (obj != old) 474 ecore_cocoa_window_cursor_show(win, EINA_TRUE);
510 { 475 else if (obj != _ecore_evas_default_cursor_image_get(ee))
511 ecore_cocoa_window_cursor_show(win, EINA_FALSE); 476 ecore_cocoa_window_cursor_show(win, EINA_FALSE);
512 evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer);
513 evas_object_pass_events_set(ee->prop.cursor.object, 1);
514 if (evas_pointer_inside_get(ee->evas))
515 evas_object_show(ee->prop.cursor.object);
516 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
517 _ecore_evas_object_cursor_del, ee);
518 }
519 evas_object_move(ee->prop.cursor.object,
520 x - ee->prop.cursor.hot.x,
521 y - ee->prop.cursor.hot.y);
522
523end:
524 if ((old) && (obj != old))
525 {
526 evas_object_event_callback_del_full(old, EVAS_CALLBACK_DEL,
527 _ecore_evas_object_cursor_del, ee);
528 evas_object_del(old);
529 }
530} 477}
531 478
532static void 479static void
@@ -627,7 +574,7 @@ static Ecore_Evas_Engine_Func _ecore_cocoa_engine_func =
627 NULL, 574 NULL,
628 _ecore_evas_size_step_set, 575 _ecore_evas_size_step_set,
629 _ecore_evas_object_cursor_set, 576 _ecore_evas_object_cursor_set,
630 _ecore_evas_object_cursor_unset, 577 NULL,
631 NULL, 578 NULL,
632 NULL, 579 NULL,
633 _ecore_evas_iconified_set, 580 _ecore_evas_iconified_set,
diff --git a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
index b1ab702a01..d69c43009c 100644
--- a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
+++ b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
@@ -434,68 +434,6 @@ _drm_size_step_set(Ecore_Evas *ee, int w, int h)
434} 434}
435 435
436static void 436static void
437_drm_object_cursor_del(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
438{
439 Ecore_Evas *ee;
440
441 ee = data;
442 if (ee) ee->prop.cursor.object = NULL;
443}
444
445static void
446_drm_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
447{
448 Evas_Object *old;
449 int x, y;
450
451 old = ee->prop.cursor.object;
452 if (!obj)
453 {
454 ee->prop.cursor.object = NULL;
455 ee->prop.cursor.layer = 0;
456 ee->prop.cursor.hot.x = 0;
457 ee->prop.cursor.hot.y = 0;
458 goto end;
459 }
460
461 ee->prop.cursor.object = obj;
462 ee->prop.cursor.layer = layer;
463 ee->prop.cursor.hot.x = hot_x;
464 ee->prop.cursor.hot.y = hot_y;
465
466 ecore_evas_pointer_xy_get(ee, &x, &y);
467
468 if (obj != old)
469 {
470 evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer);
471 evas_object_pass_events_set(ee->prop.cursor.object, 1);
472 if (evas_pointer_inside_get(ee->evas))
473 evas_object_show(ee->prop.cursor.object);
474 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
475 _drm_object_cursor_del, ee);
476 }
477
478 evas_object_move(ee->prop.cursor.object, x - ee->prop.cursor.hot.x,
479 y - ee->prop.cursor.hot.y);
480
481end:
482 if ((old) && (obj != old))
483 {
484 evas_object_event_callback_del_full
485 (old, EVAS_CALLBACK_DEL, _drm_object_cursor_del, ee);
486 evas_object_del(old);
487 }
488}
489
490static void
491_drm_object_cursor_unset(Ecore_Evas *ee)
492{
493 evas_object_event_callback_del_full(ee->prop.cursor.object,
494 EVAS_CALLBACK_DEL,
495 _drm_object_cursor_del, ee);
496}
497
498static void
499_drm_layer_set(Ecore_Evas *ee, int layer) 437_drm_layer_set(Ecore_Evas *ee, int layer)
500{ 438{
501 if (layer < 1) layer = 1; 439 if (layer < 1) layer = 1;
@@ -747,8 +685,8 @@ static Ecore_Evas_Engine_Func _ecore_evas_drm_engine_func =
747 _drm_size_max_set, 685 _drm_size_max_set,
748 _drm_size_base_set, 686 _drm_size_base_set,
749 _drm_size_step_set, 687 _drm_size_step_set,
750 _drm_object_cursor_set, 688 NULL,
751 _drm_object_cursor_unset, 689 NULL,
752 _drm_layer_set, 690 _drm_layer_set,
753 NULL, //void (*fn_focus_set) (Ecore_Evas *ee, Eina_Bool on); 691 NULL, //void (*fn_focus_set) (Ecore_Evas *ee, Eina_Bool on);
754 _drm_iconified_set, 692 _drm_iconified_set,
diff --git a/src/modules/ecore_evas/engines/fb/ecore_evas_fb.c b/src/modules/ecore_evas/engines/fb/ecore_evas_fb.c
index 2e828624a8..d1ab63ab0b 100644
--- a/src/modules/ecore_evas/engines/fb/ecore_evas_fb.c
+++ b/src/modules/ecore_evas/engines/fb/ecore_evas_fb.c
@@ -56,30 +56,37 @@ struct _Ecore_Evas_Engine_FB_Data {
56static void 56static void
57_ecore_evas_mouse_move_process_fb(Ecore_Evas *ee, int x, int y) 57_ecore_evas_mouse_move_process_fb(Ecore_Evas *ee, int x, int y)
58{ 58{
59 Efl_Input_Device *pointer;
60 Ecore_Evas_Cursor *cursor;
59 int fbw, fbh; 61 int fbw, fbh;
60 62
61 ee->mouse.x = x; 63 ee->mouse.x = x;
62 ee->mouse.y = y; 64 ee->mouse.y = y;
63 ecore_fb_size_get(&fbw, &fbh); 65 ecore_fb_size_get(&fbw, &fbh);
64 if (ee->prop.cursor.object) 66
67 pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_MOUSE);
68 cursor = eina_hash_find(ee->prop.cursors, &pointer);
69 EINA_SAFETY_ON_NULL_RETURN(cursor);
70
71 if (cursor->object)
65 { 72 {
66 evas_object_show(ee->prop.cursor.object); 73 evas_object_show(cursor->object);
67 if (ee->rotation == 0) 74 if (ee->rotation == 0)
68 evas_object_move(ee->prop.cursor.object, 75 evas_object_move(cursor->object,
69 x - ee->prop.cursor.hot.x, 76 x - cursor->hot.x,
70 y - ee->prop.cursor.hot.y); 77 y - cursor->hot.y);
71 else if (ee->rotation == 90) 78 else if (ee->rotation == 90)
72 evas_object_move(ee->prop.cursor.object, 79 evas_object_move(cursor->object,
73 (fbh - ee->h) + ee->h - y - 1 - ee->prop.cursor.hot.x, 80 (fbh - ee->h) + ee->h - y - 1 - cursor->hot.x,
74 x - ee->prop.cursor.hot.y); 81 x - cursor->hot.y);
75 else if (ee->rotation == 180) 82 else if (ee->rotation == 180)
76 evas_object_move(ee->prop.cursor.object, 83 evas_object_move(cursor->object,
77 (fbw - ee->w) + ee->w - x - 1 - ee->prop.cursor.hot.x, 84 (fbw - ee->w) + ee->w - x - 1 - cursor->hot.x,
78 (fbh - ee->h) + ee->h - y - 1 - ee->prop.cursor.hot.y); 85 (fbh - ee->h) + ee->h - y - 1 - cursor->hot.y);
79 else if (ee->rotation == 270) 86 else if (ee->rotation == 270)
80 evas_object_move(ee->prop.cursor.object, 87 evas_object_move(cursor->object,
81 y - ee->prop.cursor.hot.x, 88 y - cursor->hot.x,
82 (fbw - ee->w) + ee->w - x - 1 - ee->prop.cursor.hot.y); 89 (fbw - ee->w) + ee->w - x - 1 - cursor->hot.y);
83 } 90 }
84} 91}
85 92
@@ -431,67 +438,6 @@ _ecore_evas_hide(Ecore_Evas *ee)
431} 438}
432 439
433static void 440static void
434_ecore_evas_object_cursor_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
435{
436 Ecore_Evas *ee;
437
438 ee = data;
439 if (ee)
440 ee->prop.cursor.object = NULL;
441}
442
443static void
444_ecore_evas_object_cursor_unset(Ecore_Evas *ee)
445{
446 evas_object_event_callback_del_full(ee->prop.cursor.object, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee);
447}
448
449static void
450_ecore_evas_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
451{
452 int x, y;
453 Evas_Object *old;
454
455 old = ee->prop.cursor.object;
456 if (obj == NULL)
457 {
458 ee->prop.cursor.object = NULL;
459 ee->prop.cursor.layer = 0;
460 ee->prop.cursor.hot.x = 0;
461 ee->prop.cursor.hot.y = 0;
462 goto end;
463 }
464
465 ee->prop.cursor.object = obj;
466 ee->prop.cursor.layer = layer;
467 ee->prop.cursor.hot.x = hot_x;
468 ee->prop.cursor.hot.y = hot_y;
469
470 evas_pointer_output_xy_get(ee->evas, &x, &y);
471
472 if (obj != old)
473 {
474 evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer);
475 evas_object_pass_events_set(ee->prop.cursor.object, 1);
476 if (evas_pointer_inside_get(ee->evas))
477 evas_object_show(ee->prop.cursor.object);
478 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
479 _ecore_evas_object_cursor_del, ee);
480 }
481
482 evas_object_move(ee->prop.cursor.object, x - ee->prop.cursor.hot.x,
483 y - ee->prop.cursor.hot.y);
484
485end:
486 if ((old) && (obj != old))
487 {
488 evas_object_event_callback_del_full
489 (old, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee);
490 evas_object_del(old);
491 }
492}
493
494static void
495_ecore_evas_fullscreen_set(Ecore_Evas *ee, Eina_Bool on) 441_ecore_evas_fullscreen_set(Ecore_Evas *ee, Eina_Bool on)
496{ 442{
497 Eina_List *l; 443 Eina_List *l;
@@ -592,8 +538,8 @@ static Ecore_Evas_Engine_Func _ecore_fb_engine_func =
592 NULL, 538 NULL,
593 NULL, 539 NULL,
594 NULL, 540 NULL,
595 _ecore_evas_object_cursor_set, 541 NULL,
596 _ecore_evas_object_cursor_unset, 542 NULL,
597 NULL, 543 NULL,
598 NULL, 544 NULL,
599 NULL, 545 NULL,
diff --git a/src/modules/ecore_evas/engines/psl1ght/ecore_evas_psl1ght.c b/src/modules/ecore_evas/engines/psl1ght/ecore_evas_psl1ght.c
index a65a61a776..935a7571ef 100644
--- a/src/modules/ecore_evas/engines/psl1ght/ecore_evas_psl1ght.c
+++ b/src/modules/ecore_evas/engines/psl1ght/ecore_evas_psl1ght.c
@@ -319,66 +319,6 @@ _ecore_evas_screen_geometry_get(const Ecore_Evas *ee EINA_UNUSED, int *x, int *y
319 ecore_psl1ght_screen_resolution_get (w, h); 319 ecore_psl1ght_screen_resolution_get (w, h);
320} 320}
321 321
322static void
323_ecore_evas_object_cursor_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
324{
325 Ecore_Evas *ee;
326
327 ee = data;
328 if (ee)
329 ee->prop.cursor.object = NULL;
330}
331
332static void
333_ecore_evas_object_cursor_unset(Ecore_Evas *ee)
334{
335 evas_object_event_callback_del_full(ee->prop.cursor.object, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee);
336}
337
338static void
339_ecore_evas_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
340{
341 int x, y;
342 Evas_Object *old;
343
344 old = ee->prop.cursor.object;
345 if (obj == NULL)
346 {
347 ee->prop.cursor.object = NULL;
348 ee->prop.cursor.layer = 0;
349 ee->prop.cursor.hot.x = 0;
350 ee->prop.cursor.hot.y = 0;
351 goto end;
352 }
353
354 ee->prop.cursor.object = obj;
355 ee->prop.cursor.layer = layer;
356 ee->prop.cursor.hot.x = hot_x;
357 ee->prop.cursor.hot.y = hot_y;
358
359 if (obj != old)
360 {
361 evas_pointer_output_xy_get(ee->evas, &x, &y);
362 evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer);
363 evas_object_pass_events_set(ee->prop.cursor.object, 1);
364 if (evas_pointer_inside_get(ee->evas))
365 evas_object_show(ee->prop.cursor.object);
366 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
367 _ecore_evas_object_cursor_del, ee);
368 }
369
370 evas_object_move(ee->prop.cursor.object, x - ee->prop.cursor.hot.x,
371 y - ee->prop.cursor.hot.y);
372
373end:
374 if ((old) && (obj != old))
375 {
376 evas_object_event_callback_del_full
377 (old, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee);
378 evas_object_del(old);
379 }
380}
381
382static Ecore_Evas_Engine_Func _ecore_psl1ght_engine_func = 322static Ecore_Evas_Engine_Func _ecore_psl1ght_engine_func =
383{ 323{
384 _ecore_evas_psl1ght_free, 324 _ecore_evas_psl1ght_free,
@@ -413,8 +353,8 @@ static Ecore_Evas_Engine_Func _ecore_psl1ght_engine_func =
413 NULL, 353 NULL,
414 NULL, 354 NULL,
415 NULL, 355 NULL,
416 _ecore_evas_object_cursor_set, 356 NULL,
417 _ecore_evas_object_cursor_unset, 357 NULL,
418 NULL, 358 NULL,
419 NULL, 359 NULL,
420 NULL, 360 NULL,
diff --git a/src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c b/src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c
index 782d06513e..e12307a425 100644
--- a/src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c
+++ b/src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c
@@ -411,66 +411,6 @@ _ecore_evas_show(Ecore_Evas *ee)
411 evas_event_feed_mouse_in(ee->evas, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL); 411 evas_event_feed_mouse_in(ee->evas, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL);
412} 412}
413 413
414static void
415_ecore_evas_object_cursor_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
416{
417 Ecore_Evas *ee;
418
419 ee = data;
420 if (ee) ee->prop.cursor.object = NULL;
421}
422
423static void
424_ecore_evas_object_cursor_unset(Ecore_Evas *ee)
425{
426 evas_object_event_callback_del_full(ee->prop.cursor.object, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee);
427}
428
429static void
430_ecore_evas_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
431{
432 int x, y;
433 Evas_Object *old;
434
435 old = ee->prop.cursor.object;
436 if (obj == NULL)
437 {
438 ee->prop.cursor.object = NULL;
439 ee->prop.cursor.layer = 0;
440 ee->prop.cursor.hot.x = 0;
441 ee->prop.cursor.hot.y = 0;
442 goto end;
443 }
444
445 ee->prop.cursor.object = obj;
446 ee->prop.cursor.layer = layer;
447 ee->prop.cursor.hot.x = hot_x;
448 ee->prop.cursor.hot.y = hot_y;
449
450 evas_pointer_output_xy_get(ee->evas, &x, &y);
451
452 if (obj != old)
453 {
454 evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer);
455 evas_object_pass_events_set(ee->prop.cursor.object, 1);
456 if (evas_pointer_inside_get(ee->evas))
457 evas_object_show(ee->prop.cursor.object);
458 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
459 _ecore_evas_object_cursor_del, ee);
460 }
461
462 evas_object_move(ee->prop.cursor.object, x - ee->prop.cursor.hot.x,
463 y - ee->prop.cursor.hot.y);
464
465end:
466 if ((old) && (obj != old))
467 {
468 evas_object_event_callback_del_full
469 (old, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee);
470 evas_object_del(old);
471 }
472}
473
474static Ecore_Evas_Engine_Func _ecore_sdl_engine_func = 414static Ecore_Evas_Engine_Func _ecore_sdl_engine_func =
475{ 415{
476 _ecore_evas_sdl_free, 416 _ecore_evas_sdl_free,
@@ -505,8 +445,8 @@ static Ecore_Evas_Engine_Func _ecore_sdl_engine_func =
505 NULL, 445 NULL,
506 NULL, 446 NULL,
507 NULL, 447 NULL,
508 _ecore_evas_object_cursor_set, 448 NULL,
509 _ecore_evas_object_cursor_unset, 449 NULL,
510 NULL, 450 NULL,
511 NULL, 451 NULL,
512 NULL, 452 NULL,
diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
index 6bd452854b..5eeae7c809 100644
--- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
+++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
@@ -43,7 +43,7 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
43 _ecore_evas_wl_common_size_base_set, 43 _ecore_evas_wl_common_size_base_set,
44 _ecore_evas_wl_common_size_step_set, 44 _ecore_evas_wl_common_size_step_set,
45 _ecore_evas_wl_common_object_cursor_set, 45 _ecore_evas_wl_common_object_cursor_set,
46 _ecore_evas_wl_common_object_cursor_unset, 46 NULL,
47 _ecore_evas_wl_common_layer_set, 47 _ecore_evas_wl_common_layer_set,
48 NULL, // focus set 48 NULL, // focus set
49 _ecore_evas_wl_common_iconified_set, 49 _ecore_evas_wl_common_iconified_set,
@@ -171,7 +171,7 @@ _ecore_evas_wl_common_cb_mouse_in(void *data EINA_UNUSED, int type EINA_UNUSED,
171 _ecore_evas_mouse_inout_set(ee, ev->dev, EINA_TRUE, EINA_FALSE); 171 _ecore_evas_mouse_inout_set(ee, ev->dev, EINA_TRUE, EINA_FALSE);
172 ecore_event_evas_seat_modifier_lock_update(ee->evas, ev->modifiers, ev->dev); 172 ecore_event_evas_seat_modifier_lock_update(ee->evas, ev->modifiers, ev->dev);
173 evas_event_feed_mouse_in(ee->evas, ev->timestamp, NULL); 173 evas_event_feed_mouse_in(ee->evas, ev->timestamp, NULL);
174 _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->timestamp); 174 _ecore_evas_mouse_device_move_process(ee, ev->dev, ev->x, ev->y, ev->timestamp);
175 return ECORE_CALLBACK_PASS_ON; 175 return ECORE_CALLBACK_PASS_ON;
176} 176}
177 177
@@ -191,10 +191,9 @@ _ecore_evas_wl_common_cb_mouse_out(void *data EINA_UNUSED, int type EINA_UNUSED,
191 191
192 ecore_event_evas_seat_modifier_lock_update(ee->evas, 192 ecore_event_evas_seat_modifier_lock_update(ee->evas,
193 ev->modifiers, ev->dev); 193 ev->modifiers, ev->dev);
194 _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->timestamp); 194 _ecore_evas_mouse_device_move_process(ee, ev->dev, ev->x, ev->y, ev->timestamp);
195 evas_event_feed_mouse_out(ee->evas, ev->timestamp, NULL); 195 evas_event_feed_mouse_out(ee->evas, ev->timestamp, NULL);
196 _ecore_evas_mouse_inout_set(ee, ev->dev, EINA_FALSE, EINA_FALSE); 196 _ecore_evas_mouse_inout_set(ee, ev->dev, EINA_FALSE, EINA_FALSE);
197 if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object);
198 return ECORE_CALLBACK_PASS_ON; 197 return ECORE_CALLBACK_PASS_ON;
199} 198}
200 199
@@ -1265,72 +1264,17 @@ _ecore_evas_wl_common_aspect_set(Ecore_Evas *ee, double aspect)
1265 ee->prop.aspect = aspect; 1264 ee->prop.aspect = aspect;
1266} 1265}
1267 1266
1268static void
1269_ecore_evas_object_cursor_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
1270{
1271 Ecore_Evas *ee;
1272
1273 ee = data;
1274 if (ee) ee->prop.cursor.object = NULL;
1275}
1276
1277void
1278_ecore_evas_wl_common_object_cursor_unset(Ecore_Evas *ee)
1279{
1280 evas_object_event_callback_del_full(ee->prop.cursor.object,
1281 EVAS_CALLBACK_DEL,
1282 _ecore_evas_object_cursor_del, ee);
1283}
1284
1285void 1267void
1286_ecore_evas_wl_common_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y) 1268_ecore_evas_wl_common_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj,
1269 int layer EINA_UNUSED,
1270 int hot_x EINA_UNUSED,
1271 int hot_y EINA_UNUSED)
1287{ 1272{
1288 int x, y, fx, fy;
1289 Ecore_Evas_Engine_Wl_Data *wdata; 1273 Ecore_Evas_Engine_Wl_Data *wdata;
1290 Evas_Object *old;
1291 1274
1292 if (!ee) return;
1293 wdata = ee->engine.data; 1275 wdata = ee->engine.data;
1294 old = ee->prop.cursor.object; 1276 if (obj != _ecore_evas_default_cursor_image_get(ee))
1295 if (obj == NULL) 1277 ecore_wl2_window_pointer_set(wdata->win, NULL, 0, 0);
1296 {
1297 ecore_wl2_window_pointer_set(wdata->win, NULL, 0, 0);
1298 ee->prop.cursor.object = NULL;
1299 ee->prop.cursor.layer = 0;
1300 ee->prop.cursor.hot.x = 0;
1301 ee->prop.cursor.hot.y = 0;
1302 goto end;
1303 }
1304
1305 ee->prop.cursor.object = obj;
1306 ee->prop.cursor.layer = layer;
1307 ee->prop.cursor.hot.x = hot_x;
1308 ee->prop.cursor.hot.y = hot_y;
1309
1310 evas_pointer_output_xy_get(ee->evas, &x, &y);
1311
1312 if (obj != old)
1313 {
1314 ecore_wl2_window_pointer_set(wdata->win, NULL, 0, 0);
1315 evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer);
1316 evas_object_pass_events_set(ee->prop.cursor.object, 1);
1317 if (evas_pointer_inside_get(ee->evas))
1318 evas_object_show(ee->prop.cursor.object);
1319 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
1320 _ecore_evas_object_cursor_del, ee);
1321 }
1322
1323 evas_output_framespace_get(ee->evas, &fx, &fy, NULL, NULL);
1324 evas_object_move(ee->prop.cursor.object, x - fx - ee->prop.cursor.hot.x,
1325 y - fy - ee->prop.cursor.hot.y);
1326
1327end:
1328 if ((old) && (obj != old))
1329 {
1330 evas_object_event_callback_del_full
1331 (old, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee);
1332 evas_object_del(old);
1333 }
1334} 1278}
1335 1279
1336void 1280void
diff --git a/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c b/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c
index 4469c66fca..e9dbd37693 100644
--- a/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c
+++ b/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c
@@ -220,7 +220,7 @@ _ecore_evas_win32_event_mouse_out(void *data EINA_UNUSED, int type EINA_UNUSED,
220 if (evas_event_down_count_get(ee->evas) > 0) return ECORE_CALLBACK_PASS_ON; 220 if (evas_event_down_count_get(ee->evas) > 0) return ECORE_CALLBACK_PASS_ON;
221 evas_event_feed_mouse_out(ee->evas, e->timestamp, NULL); 221 evas_event_feed_mouse_out(ee->evas, e->timestamp, NULL);
222 _ecore_evas_mouse_inout_set(ee, NULL, EINA_FALSE, EINA_FALSE); 222 _ecore_evas_mouse_inout_set(ee, NULL, EINA_FALSE, EINA_FALSE);
223 if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object); 223 _ecore_evas_default_cursor_hide(ee);
224 } 224 }
225 225
226 return ECORE_CALLBACK_PASS_ON; 226 return ECORE_CALLBACK_PASS_ON;
@@ -835,67 +835,6 @@ _ecore_evas_win32_size_step_set(Ecore_Evas *ee, int width, int height)
835} 835}
836 836
837static void 837static void
838_ecore_evas_object_cursor_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
839{
840 Ecore_Evas *ee;
841
842 ee = data;
843 if (ee) ee->prop.cursor.object = NULL;
844}
845
846static void
847_ecore_evas_win32_cursor_unset(Ecore_Evas *ee)
848{
849 evas_object_event_callback_del_full(ee->prop.cursor.object, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee);
850}
851
852static void
853_ecore_evas_win32_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
854{
855 int x, y;
856 Evas_Object *old;
857
858 old = ee->prop.cursor.object;
859 if (obj == NULL)
860 {
861 ee->prop.cursor.object = NULL;
862 ee->prop.cursor.layer = 0;
863 ee->prop.cursor.hot.x = 0;
864 ee->prop.cursor.hot.y = 0;
865 goto end;
866 }
867
868 ee->prop.cursor.object = obj;
869 ee->prop.cursor.layer = layer;
870 ee->prop.cursor.hot.x = hot_x;
871 ee->prop.cursor.hot.y = hot_y;
872
873 evas_pointer_output_xy_get(ee->evas, &x, &y);
874
875 if (obj != old)
876 {
877// ecore_win32_window_cursor_show(ee->prop.window, 0);
878 evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer);
879 evas_object_pass_events_set(ee->prop.cursor.object, 1);
880 if (evas_pointer_inside_get(ee->evas))
881 evas_object_show(ee->prop.cursor.object);
882 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
883 _ecore_evas_object_cursor_del, ee);
884 }
885
886 evas_object_move(ee->prop.cursor.object, x - ee->prop.cursor.hot.x,
887 y - ee->prop.cursor.hot.y);
888
889end:
890 if ((old) && (obj != old))
891 {
892 evas_object_event_callback_del_full
893 (old, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee);
894 evas_object_del(old);
895 }
896}
897
898static void
899_ecore_evas_win32_focus_set(Ecore_Evas *ee, Eina_Bool on EINA_UNUSED) 838_ecore_evas_win32_focus_set(Ecore_Evas *ee, Eina_Bool on EINA_UNUSED)
900{ 839{
901 ecore_win32_window_focus((struct _Ecore_Win32_Window *)ee->prop.window); 840 ecore_win32_window_focus((struct _Ecore_Win32_Window *)ee->prop.window);
@@ -1157,8 +1096,8 @@ static Ecore_Evas_Engine_Func _ecore_win32_engine_func =
1157 _ecore_evas_win32_size_max_set, 1096 _ecore_evas_win32_size_max_set,
1158 _ecore_evas_win32_size_base_set, 1097 _ecore_evas_win32_size_base_set,
1159 _ecore_evas_win32_size_step_set, 1098 _ecore_evas_win32_size_step_set,
1160 _ecore_evas_win32_cursor_set, 1099 NULL,
1161 _ecore_evas_win32_cursor_unset, 1100 NULL,
1162 NULL, /* _ecore_evas_x_layer_set */ 1101 NULL, /* _ecore_evas_x_layer_set */
1163 _ecore_evas_win32_focus_set, 1102 _ecore_evas_win32_focus_set,
1164 _ecore_evas_win32_iconified_set, 1103 _ecore_evas_win32_iconified_set,
diff --git a/src/modules/ecore_evas/engines/x/ecore_evas_x.c b/src/modules/ecore_evas/engines/x/ecore_evas_x.c
index 3c52034cb4..2b4e00bfd5 100644
--- a/src/modules/ecore_evas/engines/x/ecore_evas_x.c
+++ b/src/modules/ecore_evas/engines/x/ecore_evas_x.c
@@ -1315,7 +1315,7 @@ _fake_out(void *data)
1315 _feed_cancel_out(e, (e->mode == ECORE_X_EVENT_MODE_GRAB)); 1315 _feed_cancel_out(e, (e->mode == ECORE_X_EVENT_MODE_GRAB));
1316 1316
1317 _ecore_evas_mouse_inout_set(ee, NULL, EINA_FALSE, EINA_TRUE); 1317 _ecore_evas_mouse_inout_set(ee, NULL, EINA_FALSE, EINA_TRUE);
1318 if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object); 1318 _ecore_evas_default_cursor_hide(ee);
1319 return EINA_FALSE; 1319 return EINA_FALSE;
1320} 1320}
1321 1321
@@ -1480,7 +1480,7 @@ _ecore_evas_x_event_mouse_out(void *data EINA_UNUSED, int type EINA_UNUSED, void
1480 _ecore_evas_mouse_move_process(ee, e->x, e->y, e->time); 1480 _ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
1481 _ecore_evas_mouse_inout_set(ee, NULL, EINA_FALSE, EINA_FALSE); 1481 _ecore_evas_mouse_inout_set(ee, NULL, EINA_FALSE, EINA_FALSE);
1482 _feed_cancel_out(e, (e->mode == ECORE_X_EVENT_MODE_GRAB)); 1482 _feed_cancel_out(e, (e->mode == ECORE_X_EVENT_MODE_GRAB));
1483 if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object); 1483 _ecore_evas_default_cursor_hide(ee);
1484 } 1484 }
1485 return ECORE_CALLBACK_PASS_ON; 1485 return ECORE_CALLBACK_PASS_ON;
1486} 1486}
@@ -1800,7 +1800,7 @@ _ecore_evas_x_event_window_hide(void *data EINA_UNUSED, int type EINA_UNUSED, vo
1800 }; 1800 };
1801 _feed_cancel_out(&out, EINA_TRUE); 1801 _feed_cancel_out(&out, EINA_TRUE);
1802 _ecore_evas_mouse_inout_set(ee, NULL, EINA_FALSE, EINA_FALSE); 1802 _ecore_evas_mouse_inout_set(ee, NULL, EINA_FALSE, EINA_FALSE);
1803 if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object); 1803 _ecore_evas_default_cursor_hide(ee);
1804 } 1804 }
1805 if (ee->prop.override) 1805 if (ee->prop.override)
1806 { 1806 {
@@ -3153,65 +3153,18 @@ _ecore_evas_x_size_step_set(Ecore_Evas *ee, int w, int h)
3153} 3153}
3154 3154
3155static void 3155static void
3156_ecore_evas_object_cursor_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 3156_ecore_evas_x_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj,
3157 int layer EINA_UNUSED, int hot_x EINA_UNUSED,
3158 int hot_y EINA_UNUSED)
3157{ 3159{
3158 Ecore_Evas *ee; 3160 if (obj != _ecore_evas_default_cursor_image_get(ee))
3159 3161 ecore_x_window_cursor_show(ee->prop.window, 0);
3160 ee = data;
3161 if (ee) ee->prop.cursor.object = NULL;
3162} 3162}
3163 3163
3164static void 3164static void
3165_ecore_evas_x_object_cursor_unset(Ecore_Evas *ee) 3165_ecore_evas_x_object_cursor_unset(Ecore_Evas *ee EINA_UNUSED)
3166{ 3166{
3167 evas_object_event_callback_del_full(ee->prop.cursor.object, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee); 3167 ecore_x_window_cursor_show(ee->prop.window, 1);
3168}
3169
3170static void
3171_ecore_evas_x_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
3172{
3173 int x = 0, y = 0;
3174 Evas_Object *old;
3175
3176 old = ee->prop.cursor.object;
3177 if (!obj)
3178 {
3179 ee->prop.cursor.object = NULL;
3180 ee->prop.cursor.layer = 0;
3181 ee->prop.cursor.hot.x = 0;
3182 ee->prop.cursor.hot.y = 0;
3183 ecore_x_window_cursor_show(ee->prop.window, 1);
3184 goto end;
3185 }
3186
3187 ee->prop.cursor.object = obj;
3188 ee->prop.cursor.layer = layer;
3189 ee->prop.cursor.hot.x = hot_x;
3190 ee->prop.cursor.hot.y = hot_y;
3191
3192 evas_pointer_output_xy_get(ee->evas, &x, &y);
3193
3194 if (obj != old)
3195 {
3196 ecore_x_window_cursor_show(ee->prop.window, 0);
3197 evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer);
3198 evas_object_pass_events_set(ee->prop.cursor.object, 1);
3199 if (evas_pointer_inside_get(ee->evas))
3200 evas_object_show(ee->prop.cursor.object);
3201 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
3202 _ecore_evas_object_cursor_del, ee);
3203 }
3204
3205 evas_object_move(ee->prop.cursor.object, x - ee->prop.cursor.hot.x,
3206 y - ee->prop.cursor.hot.y);
3207
3208end:
3209 if ((old) && (obj != old))
3210 {
3211 evas_object_event_callback_del_full
3212 (old, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee);
3213 evas_object_del(old);
3214 }
3215} 3168}
3216 3169
3217/* 3170/*