elput: Add API function to set max allowed pointer position
authorChris Michael <cpmichael@osg.samsung.com>
Tue, 10 May 2016 19:12:53 +0000 (15:12 -0400)
committerChris Michael <cpmichael@osg.samsung.com>
Tue, 10 May 2016 19:12:53 +0000 (15:12 -0400)
This patch adds an API function that can be used to restrict mouse
movement from going outside a screen

@feature

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
src/lib/elput/Elput.h
src/lib/elput/elput_input.c

index 87d3462..dfddf78 100644 (file)
@@ -298,6 +298,18 @@ EAPI void elput_input_pointer_xy_set(Elput_Manager *manager, const char *seat, i
 EAPI const Eina_List *elput_input_devices_get(Elput_Seat *seat);
 
 /**
+ * Set the maximum position of any existing mouse pointers
+ *
+ * @param manager
+ * @param maxw
+ * @param maxh
+ *
+ * @ingroup Elput_Input_Group
+ * @since 1.18
+ */
+EAPI void elput_input_pointer_max_set(Elput_Manager *manager, int maxw, int maxh);
+
+/**
  * @defgroup Elput_Device_Group
  *
  * Functions that deal with input devices.
index f90b4ed..2dd5607 100644 (file)
@@ -338,3 +338,20 @@ elput_input_devices_get(Elput_Seat *seat)
    EINA_SAFETY_ON_NULL_RETURN_VAL(seat, NULL);
    return seat->devices;
 }
+
+EAPI void
+elput_input_pointer_max_set(Elput_Manager *manager, int maxw, int maxh)
+{
+   Eina_List *l;
+   Elput_Seat *eseat;
+
+   EINA_SAFETY_ON_NULL_RETURN(manager);
+
+   EINA_LIST_FOREACH(manager->input.seats, l, eseat)
+     {
+        if (!eseat->ptr) continue;
+
+        eseat->ptr->maxw = maxw;
+        eseat->ptr->maxh = maxh;
+     }
+}