devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=aabf45071cedba9e4e61d5690fb4537f11590ad2

commit aabf45071cedba9e4e61d5690fb4537f11590ad2
Author: Chris Michael <[email protected]>
Date:   Wed Mar 4 11:46:22 2015 -0500

    ecore-drm: Add function to return the pointer xy of Ecore_Drm_Device
    
    Summary: This adds a function (ecore_drm_device_pointer_xy_get) to we
    can return the mouse position inside ecore_evas_pointer_xy_get calls.
    This is going to be used for centering the mouse when E-Wl starts up.
    
    @feature
    
    Signed-off-by: Chris Michael <[email protected]>
---
 src/lib/ecore_drm/Ecore_Drm.h        | 14 ++++++++++++++
 src/lib/ecore_drm/ecore_drm_device.c | 29 +++++++++++++++++++++++++++++
 2 files changed, 43 insertions(+)

diff --git a/src/lib/ecore_drm/Ecore_Drm.h b/src/lib/ecore_drm/Ecore_Drm.h
index ed76983..10928ed 100644
--- a/src/lib/ecore_drm/Ecore_Drm.h
+++ b/src/lib/ecore_drm/Ecore_Drm.h
@@ -312,4 +312,18 @@ EAPI Eina_Stringshare 
*ecore_drm_output_model_get(Ecore_Drm_Output *output);
  */
 EAPI Eina_Stringshare *ecore_drm_output_make_get(Ecore_Drm_Output *output);
 
+/**
+ * Get the pointer position of Ecore_Drm_Device
+ *
+ * This function will give the pointer position of Ecore_Drm_Device
+ *
+ * @param dev The Ecore_Drm_Device to get pointer position for
+ * @param *x The parameter in which output x co-ordinate is stored
+ * @param *y The parameter in which output y co-ordinate is stored
+ *
+ * @ingroup Ecore_Drm_Device_Group
+ * @since 1.14
+ */
+EAPI void ecore_drm_device_pointer_xy_get(Ecore_Drm_Device *dev, int *x, int 
*y);
+
 #endif
diff --git a/src/lib/ecore_drm/ecore_drm_device.c 
b/src/lib/ecore_drm/ecore_drm_device.c
index 5d0c0bc..89c6b86 100644
--- a/src/lib/ecore_drm/ecore_drm_device.c
+++ b/src/lib/ecore_drm/ecore_drm_device.c
@@ -470,3 +470,32 @@ ecore_drm_device_name_get(Ecore_Drm_Device *dev)
 
    return dev->drm.name;
 }
+
+EAPI void
+ecore_drm_device_pointer_xy_get(Ecore_Drm_Device *dev, int *x, int *y)
+{
+   Ecore_Drm_Seat *seat;
+   Ecore_Drm_Evdev *edev;
+   Eina_List *l, *ll;
+
+   if (x) *x = 0;
+   if (y) *y = 0;
+
+   /* check for valid device */
+   if ((!dev) || (dev->drm.fd < 0)) return;
+
+   EINA_LIST_FOREACH(dev->seats, l, seat)
+     {
+        EINA_LIST_FOREACH(seat->devices, ll, edev)
+          {
+             if (!libinput_device_has_capability(edev->device, 
+                                                 LIBINPUT_DEVICE_CAP_POINTER))
+               continue;
+
+             if (x) *x = edev->mouse.dx;
+             if (y) *y = edev->mouse.dy;
+
+             return;
+          }
+     }
+}

-- 


Reply via email to