diff options
author | Guilherme Iscaro <iscaro@profusion.mobi> | 2016-11-21 15:11:08 -0200 |
---|---|---|
committer | Bruno Dilly <bdilly@profusion.mobi> | 2016-12-20 18:34:39 -0200 |
commit | 64986bccac5bdaddaa46dc1b9c411e00191f6590 (patch) | |
tree | 2667e86b4c75279ef20e1cc5f7a1f85e3e9b8877 /src/lib/ecore_evas | |
parent | e64327bacc6feb7aa2ab74e3481ccf48094540f2 (diff) |
Ecore Evas: Add API to set/get the pointer position per device.
Since Ecore Evas now support multiple mouse devices new APIs were
added in order to fetch the mouse position.
Diffstat (limited to 'src/lib/ecore_evas')
-rw-r--r-- | src/lib/ecore_evas/Ecore_Evas.h | 14 | ||||
-rw-r--r-- | src/lib/ecore_evas/ecore_evas.c | 17 | ||||
-rw-r--r-- | src/lib/ecore_evas/ecore_evas_buffer.c | 1 | ||||
-rw-r--r-- | src/lib/ecore_evas/ecore_evas_ews.c | 1 | ||||
-rw-r--r-- | src/lib/ecore_evas/ecore_evas_private.h | 1 |
5 files changed, 33 insertions, 1 deletions
diff --git a/src/lib/ecore_evas/Ecore_Evas.h b/src/lib/ecore_evas/Ecore_Evas.h index c2295f8e78..19493f872b 100644 --- a/src/lib/ecore_evas/Ecore_Evas.h +++ b/src/lib/ecore_evas/Ecore_Evas.h | |||
@@ -2917,12 +2917,13 @@ EAPI Evas_Object *ecore_evas_extn_plug_new(Ecore_Evas *ee_target); | |||
2917 | EAPI Eina_Bool ecore_evas_extn_plug_connect(Evas_Object *obj, const char *svcname, int svcnum, Eina_Bool svcsys); | 2917 | EAPI Eina_Bool ecore_evas_extn_plug_connect(Evas_Object *obj, const char *svcname, int svcnum, Eina_Bool svcsys); |
2918 | 2918 | ||
2919 | /** | 2919 | /** |
2920 | * @brief Retrieve the coordinates of the mouse pointer | 2920 | * @brief Retrieve the coordinates of the default mouse pointer |
2921 | * | 2921 | * |
2922 | * @param ee The Ecore_Evas containing the pointer | 2922 | * @param ee The Ecore_Evas containing the pointer |
2923 | * @param x Pointer to integer to store horizontal coordinate. May be @c NULL. | 2923 | * @param x Pointer to integer to store horizontal coordinate. May be @c NULL. |
2924 | * @param y Pointer to integer to store vertical coordinate. May be @c NULL. | 2924 | * @param y Pointer to integer to store vertical coordinate. May be @c NULL. |
2925 | * | 2925 | * |
2926 | * @see ecore_evas_pointer_device_xy_get | ||
2926 | * @since 1.8 | 2927 | * @since 1.8 |
2927 | */ | 2928 | */ |
2928 | EAPI void ecore_evas_pointer_xy_get(const Ecore_Evas *ee, Evas_Coord *x, Evas_Coord *y); | 2929 | EAPI void ecore_evas_pointer_xy_get(const Ecore_Evas *ee, Evas_Coord *x, Evas_Coord *y); |
@@ -2941,6 +2942,17 @@ EAPI void ecore_evas_pointer_xy_get(const Ecore_Evas *ee, Evas_Coord *x, Evas_Co | |||
2941 | EAPI Eina_Bool ecore_evas_pointer_warp(const Ecore_Evas *ee, Evas_Coord x, Evas_Coord y); | 2942 | EAPI Eina_Bool ecore_evas_pointer_warp(const Ecore_Evas *ee, Evas_Coord x, Evas_Coord y); |
2942 | 2943 | ||
2943 | /** | 2944 | /** |
2945 | * @brief Retrieve the coordinates of the mouse pointer | ||
2946 | * | ||
2947 | * @param ee The Ecore_Evas containing the pointer | ||
2948 | * @param pointer The pointer device, use @c NULL for the default pointer. | ||
2949 | * @param x Pointer to integer to store horizontal coordinate. May be @c NULL. | ||
2950 | * @param y Pointer to integer to store vertical coordinate. May be @c NULL. | ||
2951 | * @since 1.19 | ||
2952 | */ | ||
2953 | EAPI void ecore_evas_pointer_device_xy_get(const Ecore_Evas *ee, const Efl_Input_Device *pointer, Evas_Coord *x, Evas_Coord *y); | ||
2954 | |||
2955 | /** | ||
2944 | * @brief Retrieve the Visual used for pixmap creation | 2956 | * @brief Retrieve the Visual used for pixmap creation |
2945 | * | 2957 | * |
2946 | * @param ee The Ecore_Evas containing the pixmap | 2958 | * @param ee The Ecore_Evas containing the pixmap |
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c index ea4ce4bcff..43ec72a6ad 100644 --- a/src/lib/ecore_evas/ecore_evas.c +++ b/src/lib/ecore_evas/ecore_evas.c | |||
@@ -2381,6 +2381,23 @@ ecore_evas_pointer_warp(const Ecore_Evas *ee, Evas_Coord x, Evas_Coord y) | |||
2381 | return EINA_FALSE; | 2381 | return EINA_FALSE; |
2382 | } | 2382 | } |
2383 | 2383 | ||
2384 | EAPI void | ||
2385 | ecore_evas_pointer_device_xy_get(const Ecore_Evas *ee, | ||
2386 | const Efl_Input_Device *pointer, Evas_Coord *x, | ||
2387 | Evas_Coord *y) | ||
2388 | { | ||
2389 | if (!pointer || pointer == evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_MOUSE)) | ||
2390 | ecore_evas_pointer_xy_get(ee, x, y); | ||
2391 | else | ||
2392 | { | ||
2393 | if (x) *x = 0; | ||
2394 | if (y) *y = 0; | ||
2395 | ECORE_EVAS_CHECK(ee); | ||
2396 | if (ee->engine.func->fn_pointer_device_xy_get) | ||
2397 | ee->engine.func->fn_pointer_device_xy_get(ee, pointer, x, y); | ||
2398 | } | ||
2399 | } | ||
2400 | |||
2384 | EAPI void * | 2401 | EAPI void * |
2385 | ecore_evas_pixmap_visual_get(const Ecore_Evas *ee) | 2402 | ecore_evas_pixmap_visual_get(const Ecore_Evas *ee) |
2386 | { | 2403 | { |
diff --git a/src/lib/ecore_evas/ecore_evas_buffer.c b/src/lib/ecore_evas/ecore_evas_buffer.c index 0d1643cdfb..979f92580d 100644 --- a/src/lib/ecore_evas/ecore_evas_buffer.c +++ b/src/lib/ecore_evas/ecore_evas_buffer.c | |||
@@ -607,6 +607,7 @@ static Ecore_Evas_Engine_Func _ecore_buffer_engine_func = | |||
607 | NULL, //fn_callback_focus_device_out_set | 607 | NULL, //fn_callback_focus_device_out_set |
608 | NULL, //fn_callback_device_mouse_in_set | 608 | NULL, //fn_callback_device_mouse_in_set |
609 | NULL, //fn_callback_device_mouse_out_set | 609 | NULL, //fn_callback_device_mouse_out_set |
610 | NULL, //fn_pointer_device_xy_get | ||
610 | }; | 611 | }; |
611 | 612 | ||
612 | static void * | 613 | static void * |
diff --git a/src/lib/ecore_evas/ecore_evas_ews.c b/src/lib/ecore_evas/ecore_evas_ews.c index 693e9db126..719d5ea6df 100644 --- a/src/lib/ecore_evas/ecore_evas_ews.c +++ b/src/lib/ecore_evas/ecore_evas_ews.c | |||
@@ -719,6 +719,7 @@ static const Ecore_Evas_Engine_Func _ecore_ews_engine_func = | |||
719 | NULL, //fn_callback_focus_device_out_set | 719 | NULL, //fn_callback_focus_device_out_set |
720 | NULL, //fn_callback_device_mouse_in_set | 720 | NULL, //fn_callback_device_mouse_in_set |
721 | NULL, //fn_callback_device_mouse_out_set | 721 | NULL, //fn_callback_device_mouse_out_set |
722 | NULL, //fn_pointer_device_xy_get | ||
722 | }; | 723 | }; |
723 | 724 | ||
724 | void | 725 | void |
diff --git a/src/lib/ecore_evas/ecore_evas_private.h b/src/lib/ecore_evas/ecore_evas_private.h index f9c66fea1d..919d2dac40 100644 --- a/src/lib/ecore_evas/ecore_evas_private.h +++ b/src/lib/ecore_evas/ecore_evas_private.h | |||
@@ -165,6 +165,7 @@ struct _Ecore_Evas_Engine_Func | |||
165 | 165 | ||
166 | void (*fn_callback_device_mouse_in_set) (Ecore_Evas *ee, Ecore_Evas_Mouse_IO_Cb func); | 166 | void (*fn_callback_device_mouse_in_set) (Ecore_Evas *ee, Ecore_Evas_Mouse_IO_Cb func); |
167 | void (*fn_callback_device_mouse_out_set) (Ecore_Evas *ee, Ecore_Evas_Mouse_IO_Cb func); | 167 | void (*fn_callback_device_mouse_out_set) (Ecore_Evas *ee, Ecore_Evas_Mouse_IO_Cb func); |
168 | void (*fn_pointer_device_xy_get)(const Ecore_Evas *ee, const Efl_Input_Device *pointer, Evas_Coord *x, Evas_Coord *y); | ||
168 | }; | 169 | }; |
169 | 170 | ||
170 | struct _Ecore_Evas_Interface | 171 | struct _Ecore_Evas_Interface |