devilhorns pushed a commit to branch master.

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

commit 0b2a32212a3e56d52a1d88c08edd646caa93a333
Author: Chris Michael <[email protected]>
Date:   Tue Dec 13 13:05:58 2016 -0500

    elput: Add API functions to enable/disable tap-and-drag
    
    This patch adds new API functions for Elput touch devices to get or set if
    tap-and-drag is enabled on a touchpad device
    
    @feature
    
    Signed-off-by: Chris Michael <[email protected]>
---
 src/Makefile_Elput.am       |  1 +
 src/lib/elput/Elput.h       | 35 +++++++++++++++++++++++++++++++++++
 src/lib/elput/elput_touch.c | 32 ++++++++++++++++++++++++++++++++
 3 files changed, 68 insertions(+)

diff --git a/src/Makefile_Elput.am b/src/Makefile_Elput.am
index 5d1fa8b..5997ae6 100644
--- a/src/Makefile_Elput.am
+++ b/src/Makefile_Elput.am
@@ -9,6 +9,7 @@ dist_installed_elputmainheaders_DATA = \
   lib/elput/Elput.h
 
 lib_elput_libelput_la_SOURCES = \
+lib/elput/elput_touch.c \
 lib/elput/elput_evdev.c \
 lib/elput/elput_input.c \
 lib/elput/elput_logind.c \
diff --git a/src/lib/elput/Elput.h b/src/lib/elput/Elput.h
index bd4fe7a..5d1bf6e 100644
--- a/src/lib/elput/Elput.h
+++ b/src/lib/elput/Elput.h
@@ -117,6 +117,7 @@ EAPI extern int ELPUT_EVENT_SESSION_ACTIVE;
  * @li @ref Elput_Init_Group
  * @li @ref Elput_Manager_Group
  * @li @ref Elput_Input_Group
+ * @li @ref Elput_Touch_Group
  *
  */
 
@@ -425,6 +426,40 @@ EAPI Eina_Stringshare 
*elput_input_device_output_name_get(Elput_Device *device);
  */
 EAPI void elput_input_pointer_accel_profile_set(Elput_Manager *manager, const 
char *seat, uint32_t profile);
 
+/**
+ * @defgroup Elput_Touch_Group Configuration of touch devices
+ *
+ * Functions related to configuration of touch devic 
+ */
+
+/**
+ * Enable or disable tap-and-drag on this device. When enabled, a
+ * single-finger tap immediately followed by a finger down results in a
+ * button down event, subsequent finger motion thus triggers a drag. The
+ * button is released on finger up.
+ *
+ * @param device
+ * @param enabled
+ *
+ * @return EINA_TRUE on success, EINA_FALSE otherwise
+ *
+ * @ingroup Elput_Touch_Group
+ * @since 1.19
+ */
+EAPI Eina_Bool elput_touch_drag_enabled_set(Elput_Device *device, Eina_Bool 
enabled);
+
+/**
+ * Get if tap-and-drag is enabled on this device
+ *
+ * @param device
+ *
+ * @return EINA_TRUE if enabled, EINA_FALSE otherwise
+ *
+ * @ingroup Elput_Touch_Group
+ * @since 1.19
+ */
+EAPI Eina_Bool elput_touch_drag_enabled_get(Elput_Device *device);
+
 # endif
 
 # undef EAPI
diff --git a/src/lib/elput/elput_touch.c b/src/lib/elput/elput_touch.c
new file mode 100644
index 0000000..330a1c5
--- /dev/null
+++ b/src/lib/elput/elput_touch.c
@@ -0,0 +1,32 @@
+#include "elput_private.h"
+
+EAPI Eina_Bool
+elput_touch_drag_enabled_set(Elput_Device *device, Eina_Bool enabled)
+{
+   Eina_Bool ret = EINA_FALSE;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(device, EINA_FALSE);
+
+   if (enabled)
+     {
+        ret =
+          libinput_device_config_tap_set_drag_enabled(device->device,
+                                                      
LIBINPUT_CONFIG_DRAG_ENABLED);
+     }
+   else
+     {
+        ret =
+          libinput_device_config_tap_set_drag_enabled(device->device,
+                                                      
LIBINPUT_CONFIG_DRAG_DISABLED);
+     }
+
+   return ret;
+}
+
+EAPI Eina_Bool
+elput_touch_drag_enabled_get(Elput_Device *device)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(device, EINA_FALSE);
+
+   return libinput_device_config_tap_get_drag_enabled(device->device);
+}

-- 


Reply via email to