* @param y where to return the vertical position. May be NULL. Returns 0 on error.
*
* @ingroup Ecore_Wl2_Window_Group
+ * @see ecore_wl2_window_pointer_device_xy_get
* @since 1.17
*/
EAPI void ecore_wl2_window_pointer_xy_get(Ecore_Wl2_Window *window, int *x, int *y);
/**
+ * Retrieves the mouse position of the current window.
+ *
+ * @param window The window on which to retrieve the mouse position.
+ * @param pointer The Efl.Input.Pointer device to fetch the position.
+ * @param x where to return the horizontal position. May be NULL. Returns 0 on error.
+ * @param y where to return the vertical position. May be NULL. Returns 0 on error.
+ * @ingroup Ecore_Wl2_Window_Group
+ * @since 1.19
+ */
+EAPI void ecore_wl2_window_pointer_device_xy_get(Ecore_Wl2_Window *window, const Eo *pointer, int *x, int *y);
+
+/**
* Set a given wl_surface to use as the pointer on a window
*
* @param window The window to set this surface as the pointer on
#include <sys/mman.h>
#include "ecore_wl2_private.h"
-typedef struct _Ecore_Wl2_Input_Devices
-{
- Eo *pointer_dev;
- Eo *keyboard_dev;
- Eo *touch_dev;
- Eo *seat_dev;
- int window_id;
-} Ecore_Wl2_Input_Devices;
-
typedef struct _Ecore_Wl2_Mouse_Down_Info
{
EINA_INLIST;
# endif
# define CRI(...) EINA_LOG_DOM_CRIT(_ecore_wl2_log_dom, __VA_ARGS__)
+typedef struct _Ecore_Wl2_Input_Devices
+{
+ Eo *pointer_dev;
+ Eo *keyboard_dev;
+ Eo *touch_dev;
+ Eo *seat_dev;
+ int window_id;
+} Ecore_Wl2_Input_Devices;
+
struct _Ecore_Wl2_Display
{
int refs;
}
EAPI void
+ecore_wl2_window_pointer_device_xy_get(Ecore_Wl2_Window *window,
+ const Eo *pointer,
+ int *x, int *y)
+{
+ Ecore_Wl2_Input_Devices *devs;
+ Eina_List *l;
+ Ecore_Wl2_Input *input;
+
+ EINA_SAFETY_ON_NULL_RETURN(window);
+ EINA_SAFETY_ON_NULL_RETURN(pointer);
+
+ if (x) *x = 0;
+ if (y) *y = 0;
+
+ EINA_INLIST_FOREACH(window->display->inputs, input)
+ {
+ if (!input->wl.pointer)
+ continue;
+
+ EINA_LIST_FOREACH(input->devices_list, l, devs)
+ {
+ if ((devs->window_id == window->id) &&
+ (devs->pointer_dev == pointer))
+ {
+ if (x) *x = input->pointer.sx;
+ if (y) *y = input->pointer.sy;
+ }
+ }
+ }
+}
+
+EAPI void
ecore_wl2_window_pointer_set(Ecore_Wl2_Window *window, struct wl_surface *surface, int hot_x, int hot_y)
{
Ecore_Wl2_Input *input;
NULL, //fn_callback_focus_device_out_set
NULL, //fn_callback_device_mouse_in_set
NULL, //fn_callback_device_mouse_out_set
- NULL, //fn_pointer_device_xy_get
+ _ecore_evas_wl_common_pointer_device_xy_get,
};
#define _smart_frame_type "ecore_evas_wl_frame"
}
void
+_ecore_evas_wl_common_pointer_device_xy_get(const Ecore_Evas *ee,
+ const Efl_Input_Device *pointer,
+ Evas_Coord *x, Evas_Coord *y)
+{
+ Ecore_Evas_Engine_Wl_Data *wdata;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ wdata = ee->engine.data;
+ ecore_wl2_window_pointer_device_xy_get(wdata->win, pointer, x, y);
+}
+
+void
_ecore_evas_wl_common_raise(Ecore_Evas *ee)
{
Ecore_Evas_Engine_Wl_Data *wdata;
void _ecore_evas_wl_common_frame_callback_clean(Ecore_Evas *ee);
void _ecore_evas_wl_common_pointer_xy_get(const Ecore_Evas *ee, Evas_Coord *x, Evas_Coord *y);
+void _ecore_evas_wl_common_pointer_device_xy_get(const Ecore_Evas *ee, const Efl_Input_Device *pointer, Evas_Coord *x, Evas_Coord *y);
+
Ecore_Evas *_ecore_evas_wl_common_new_internal(const char *disp_name, unsigned int parent, int x, int y, int w, int h, Eina_Bool frame, const char *engine_name);
extern Eina_List *ee_list;