forked from enlightenment/efl
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.
This commit is contained in:
parent
e64327bacc
commit
64986bccac
|
@ -2917,12 +2917,13 @@ EAPI Evas_Object *ecore_evas_extn_plug_new(Ecore_Evas *ee_target);
|
||||||
EAPI Eina_Bool ecore_evas_extn_plug_connect(Evas_Object *obj, const char *svcname, int svcnum, Eina_Bool svcsys);
|
EAPI Eina_Bool ecore_evas_extn_plug_connect(Evas_Object *obj, const char *svcname, int svcnum, Eina_Bool svcsys);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Retrieve the coordinates of the mouse pointer
|
* @brief Retrieve the coordinates of the default mouse pointer
|
||||||
*
|
*
|
||||||
* @param ee The Ecore_Evas containing the pointer
|
* @param ee The Ecore_Evas containing the pointer
|
||||||
* @param x Pointer to integer to store horizontal coordinate. May be @c NULL.
|
* @param x Pointer to integer to store horizontal coordinate. May be @c NULL.
|
||||||
* @param y Pointer to integer to store vertical coordinate. May be @c NULL.
|
* @param y Pointer to integer to store vertical coordinate. May be @c NULL.
|
||||||
*
|
*
|
||||||
|
* @see ecore_evas_pointer_device_xy_get
|
||||||
* @since 1.8
|
* @since 1.8
|
||||||
*/
|
*/
|
||||||
EAPI void ecore_evas_pointer_xy_get(const Ecore_Evas *ee, Evas_Coord *x, Evas_Coord *y);
|
EAPI void ecore_evas_pointer_xy_get(const Ecore_Evas *ee, Evas_Coord *x, Evas_Coord *y);
|
||||||
|
@ -2940,6 +2941,17 @@ EAPI void ecore_evas_pointer_xy_get(const Ecore_Evas *ee, Evas_Coord *x, Evas_Co
|
||||||
*/
|
*/
|
||||||
EAPI Eina_Bool ecore_evas_pointer_warp(const Ecore_Evas *ee, Evas_Coord x, Evas_Coord y);
|
EAPI Eina_Bool ecore_evas_pointer_warp(const Ecore_Evas *ee, Evas_Coord x, Evas_Coord y);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Retrieve the coordinates of the mouse pointer
|
||||||
|
*
|
||||||
|
* @param ee The Ecore_Evas containing the pointer
|
||||||
|
* @param pointer The pointer device, use @c NULL for the default pointer.
|
||||||
|
* @param x Pointer to integer to store horizontal coordinate. May be @c NULL.
|
||||||
|
* @param y Pointer to integer to store vertical coordinate. May be @c NULL.
|
||||||
|
* @since 1.19
|
||||||
|
*/
|
||||||
|
EAPI void ecore_evas_pointer_device_xy_get(const Ecore_Evas *ee, const Efl_Input_Device *pointer, Evas_Coord *x, Evas_Coord *y);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Retrieve the Visual used for pixmap creation
|
* @brief Retrieve the Visual used for pixmap creation
|
||||||
*
|
*
|
||||||
|
|
|
@ -2381,6 +2381,23 @@ ecore_evas_pointer_warp(const Ecore_Evas *ee, Evas_Coord x, Evas_Coord y)
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
ecore_evas_pointer_device_xy_get(const Ecore_Evas *ee,
|
||||||
|
const Efl_Input_Device *pointer, Evas_Coord *x,
|
||||||
|
Evas_Coord *y)
|
||||||
|
{
|
||||||
|
if (!pointer || pointer == evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_MOUSE))
|
||||||
|
ecore_evas_pointer_xy_get(ee, x, y);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (x) *x = 0;
|
||||||
|
if (y) *y = 0;
|
||||||
|
ECORE_EVAS_CHECK(ee);
|
||||||
|
if (ee->engine.func->fn_pointer_device_xy_get)
|
||||||
|
ee->engine.func->fn_pointer_device_xy_get(ee, pointer, x, y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
EAPI void *
|
EAPI void *
|
||||||
ecore_evas_pixmap_visual_get(const Ecore_Evas *ee)
|
ecore_evas_pixmap_visual_get(const Ecore_Evas *ee)
|
||||||
{
|
{
|
||||||
|
|
|
@ -607,6 +607,7 @@ static Ecore_Evas_Engine_Func _ecore_buffer_engine_func =
|
||||||
NULL, //fn_callback_focus_device_out_set
|
NULL, //fn_callback_focus_device_out_set
|
||||||
NULL, //fn_callback_device_mouse_in_set
|
NULL, //fn_callback_device_mouse_in_set
|
||||||
NULL, //fn_callback_device_mouse_out_set
|
NULL, //fn_callback_device_mouse_out_set
|
||||||
|
NULL, //fn_pointer_device_xy_get
|
||||||
};
|
};
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
|
|
|
@ -719,6 +719,7 @@ static const Ecore_Evas_Engine_Func _ecore_ews_engine_func =
|
||||||
NULL, //fn_callback_focus_device_out_set
|
NULL, //fn_callback_focus_device_out_set
|
||||||
NULL, //fn_callback_device_mouse_in_set
|
NULL, //fn_callback_device_mouse_in_set
|
||||||
NULL, //fn_callback_device_mouse_out_set
|
NULL, //fn_callback_device_mouse_out_set
|
||||||
|
NULL, //fn_pointer_device_xy_get
|
||||||
};
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -165,6 +165,7 @@ struct _Ecore_Evas_Engine_Func
|
||||||
|
|
||||||
void (*fn_callback_device_mouse_in_set) (Ecore_Evas *ee, Ecore_Evas_Mouse_IO_Cb func);
|
void (*fn_callback_device_mouse_in_set) (Ecore_Evas *ee, Ecore_Evas_Mouse_IO_Cb func);
|
||||||
void (*fn_callback_device_mouse_out_set) (Ecore_Evas *ee, Ecore_Evas_Mouse_IO_Cb func);
|
void (*fn_callback_device_mouse_out_set) (Ecore_Evas *ee, Ecore_Evas_Mouse_IO_Cb func);
|
||||||
|
void (*fn_pointer_device_xy_get)(const Ecore_Evas *ee, const Efl_Input_Device *pointer, Evas_Coord *x, Evas_Coord *y);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _Ecore_Evas_Interface
|
struct _Ecore_Evas_Interface
|
||||||
|
|
|
@ -675,6 +675,7 @@ static Ecore_Evas_Engine_Func _ecore_cocoa_engine_func =
|
||||||
NULL, //fn_callback_focus_device_out_set
|
NULL, //fn_callback_focus_device_out_set
|
||||||
NULL, //fn_callback_device_mouse_in_set
|
NULL, //fn_callback_device_mouse_in_set
|
||||||
NULL, //fn_callback_device_mouse_out_set
|
NULL, //fn_callback_device_mouse_out_set
|
||||||
|
NULL, //fn_pointer_device_xy_get
|
||||||
};
|
};
|
||||||
|
|
||||||
static Ecore_Cocoa_Window *
|
static Ecore_Cocoa_Window *
|
||||||
|
|
|
@ -796,6 +796,7 @@ static Ecore_Evas_Engine_Func _ecore_evas_drm_engine_func =
|
||||||
NULL, //fn_focus_device_set
|
NULL, //fn_focus_device_set
|
||||||
NULL, //fn_callback_focus_device_in_set
|
NULL, //fn_callback_focus_device_in_set
|
||||||
NULL, //fn_callback_focus_device_out_set
|
NULL, //fn_callback_focus_device_out_set
|
||||||
|
NULL, //fn_pointer_device_xy_get
|
||||||
};
|
};
|
||||||
|
|
||||||
static Ecore_Evas *
|
static Ecore_Evas *
|
||||||
|
|
|
@ -925,6 +925,7 @@ static const Ecore_Evas_Engine_Func _ecore_extn_plug_engine_func =
|
||||||
NULL, //fn_callback_focus_device_out_set
|
NULL, //fn_callback_focus_device_out_set
|
||||||
NULL, //fn_callback_device_mouse_in_set
|
NULL, //fn_callback_device_mouse_in_set
|
||||||
NULL, //fn_callback_device_mouse_out_set
|
NULL, //fn_callback_device_mouse_out_set
|
||||||
|
NULL, //fn_pointer_device_xy_get
|
||||||
};
|
};
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
|
|
|
@ -642,6 +642,7 @@ static Ecore_Evas_Engine_Func _ecore_fb_engine_func =
|
||||||
NULL, //fn_callback_focus_device_out_set
|
NULL, //fn_callback_focus_device_out_set
|
||||||
NULL, //fn_callback_device_mouse_in_set
|
NULL, //fn_callback_device_mouse_in_set
|
||||||
NULL, //fn_callback_device_mouse_out_set
|
NULL, //fn_callback_device_mouse_out_set
|
||||||
|
NULL, //fn_pointer_device_xy_get
|
||||||
};
|
};
|
||||||
|
|
||||||
EAPI Ecore_Evas *
|
EAPI Ecore_Evas *
|
||||||
|
|
|
@ -463,6 +463,7 @@ static Ecore_Evas_Engine_Func _ecore_psl1ght_engine_func =
|
||||||
NULL, //fn_callback_focus_device_out_set
|
NULL, //fn_callback_focus_device_out_set
|
||||||
NULL, //fn_callback_device_mouse_in_set
|
NULL, //fn_callback_device_mouse_in_set
|
||||||
NULL, //fn_callback_device_mouse_out_set
|
NULL, //fn_callback_device_mouse_out_set
|
||||||
|
NULL, //fn_pointer_device_xy_get
|
||||||
};
|
};
|
||||||
|
|
||||||
EAPI Ecore_Evas *
|
EAPI Ecore_Evas *
|
||||||
|
|
|
@ -555,6 +555,7 @@ static Ecore_Evas_Engine_Func _ecore_sdl_engine_func =
|
||||||
NULL, //fn_callback_focus_device_out_set
|
NULL, //fn_callback_focus_device_out_set
|
||||||
NULL, //fn_callback_device_mouse_in_set
|
NULL, //fn_callback_device_mouse_in_set
|
||||||
NULL, //fn_callback_device_mouse_out_set
|
NULL, //fn_callback_device_mouse_out_set
|
||||||
|
NULL, //fn_pointer_device_xy_get
|
||||||
};
|
};
|
||||||
|
|
||||||
static Ecore_Evas*
|
static Ecore_Evas*
|
||||||
|
|
|
@ -90,6 +90,7 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
|
||||||
NULL, //fn_callback_focus_device_out_set
|
NULL, //fn_callback_focus_device_out_set
|
||||||
NULL, //fn_callback_device_mouse_in_set
|
NULL, //fn_callback_device_mouse_in_set
|
||||||
NULL, //fn_callback_device_mouse_out_set
|
NULL, //fn_callback_device_mouse_out_set
|
||||||
|
NULL, //fn_pointer_device_xy_get
|
||||||
};
|
};
|
||||||
|
|
||||||
#define _smart_frame_type "ecore_evas_wl_frame"
|
#define _smart_frame_type "ecore_evas_wl_frame"
|
||||||
|
|
|
@ -1207,6 +1207,7 @@ static Ecore_Evas_Engine_Func _ecore_win32_engine_func =
|
||||||
NULL, //fn_callback_focus_device_out_set
|
NULL, //fn_callback_focus_device_out_set
|
||||||
NULL, //fn_callback_device_mouse_in_set
|
NULL, //fn_callback_device_mouse_in_set
|
||||||
NULL, //fn_callback_device_mouse_out_set
|
NULL, //fn_callback_device_mouse_out_set
|
||||||
|
NULL, //fn_pointer_device_xy_get
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* BUILD_ECORE_EVAS_WIN32 */
|
#endif /* BUILD_ECORE_EVAS_WIN32 */
|
||||||
|
|
|
@ -3788,6 +3788,7 @@ static Ecore_Evas_Engine_Func _ecore_x_engine_func =
|
||||||
NULL, //fn_callback_focus_device_out_set
|
NULL, //fn_callback_focus_device_out_set
|
||||||
NULL, //fn_callback_device_mouse_in_set
|
NULL, //fn_callback_device_mouse_in_set
|
||||||
NULL, //fn_callback_device_mouse_out_set
|
NULL, //fn_callback_device_mouse_out_set
|
||||||
|
NULL, //fn_pointer_device_xy_get
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue