diff options
author | Chris Michael <cp.michael@samsung.com> | 2016-12-13 13:05:58 -0500 |
---|---|---|
committer | Chris Michael <cp.michael@samsung.com> | 2016-12-14 09:18:14 -0500 |
commit | 0b2a32212a3e56d52a1d88c08edd646caa93a333 (patch) | |
tree | a48148c50955741aa9d082fc153bb8c2c31fa467 /src/lib/elput | |
parent | 635544104e6f5048c6884c40365e7e922eb7bc77 (diff) |
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 <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/elput')
-rw-r--r-- | src/lib/elput/Elput.h | 35 | ||||
-rw-r--r-- | src/lib/elput/elput_touch.c | 32 |
2 files changed, 67 insertions, 0 deletions
diff --git a/src/lib/elput/Elput.h b/src/lib/elput/Elput.h index bd4fe7a254..5d1bf6e162 100644 --- a/src/lib/elput/Elput.h +++ b/src/lib/elput/Elput.h | |||
@@ -117,6 +117,7 @@ EAPI extern int ELPUT_EVENT_SESSION_ACTIVE; | |||
117 | * @li @ref Elput_Init_Group | 117 | * @li @ref Elput_Init_Group |
118 | * @li @ref Elput_Manager_Group | 118 | * @li @ref Elput_Manager_Group |
119 | * @li @ref Elput_Input_Group | 119 | * @li @ref Elput_Input_Group |
120 | * @li @ref Elput_Touch_Group | ||
120 | * | 121 | * |
121 | */ | 122 | */ |
122 | 123 | ||
@@ -425,6 +426,40 @@ EAPI Eina_Stringshare *elput_input_device_output_name_get(Elput_Device *device); | |||
425 | */ | 426 | */ |
426 | EAPI void elput_input_pointer_accel_profile_set(Elput_Manager *manager, const char *seat, uint32_t profile); | 427 | EAPI void elput_input_pointer_accel_profile_set(Elput_Manager *manager, const char *seat, uint32_t profile); |
427 | 428 | ||
429 | /** | ||
430 | * @defgroup Elput_Touch_Group Configuration of touch devices | ||
431 | * | ||
432 | * Functions related to configuration of touch devic | ||
433 | */ | ||
434 | |||
435 | /** | ||
436 | * Enable or disable tap-and-drag on this device. When enabled, a | ||
437 | * single-finger tap immediately followed by a finger down results in a | ||
438 | * button down event, subsequent finger motion thus triggers a drag. The | ||
439 | * button is released on finger up. | ||
440 | * | ||
441 | * @param device | ||
442 | * @param enabled | ||
443 | * | ||
444 | * @return EINA_TRUE on success, EINA_FALSE otherwise | ||
445 | * | ||
446 | * @ingroup Elput_Touch_Group | ||
447 | * @since 1.19 | ||
448 | */ | ||
449 | EAPI Eina_Bool elput_touch_drag_enabled_set(Elput_Device *device, Eina_Bool enabled); | ||
450 | |||
451 | /** | ||
452 | * Get if tap-and-drag is enabled on this device | ||
453 | * | ||
454 | * @param device | ||
455 | * | ||
456 | * @return EINA_TRUE if enabled, EINA_FALSE otherwise | ||
457 | * | ||
458 | * @ingroup Elput_Touch_Group | ||
459 | * @since 1.19 | ||
460 | */ | ||
461 | EAPI Eina_Bool elput_touch_drag_enabled_get(Elput_Device *device); | ||
462 | |||
428 | # endif | 463 | # endif |
429 | 464 | ||
430 | # undef EAPI | 465 | # undef EAPI |
diff --git a/src/lib/elput/elput_touch.c b/src/lib/elput/elput_touch.c new file mode 100644 index 0000000000..330a1c5ebb --- /dev/null +++ b/src/lib/elput/elput_touch.c | |||
@@ -0,0 +1,32 @@ | |||
1 | #include "elput_private.h" | ||
2 | |||
3 | EAPI Eina_Bool | ||
4 | elput_touch_drag_enabled_set(Elput_Device *device, Eina_Bool enabled) | ||
5 | { | ||
6 | Eina_Bool ret = EINA_FALSE; | ||
7 | |||
8 | EINA_SAFETY_ON_NULL_RETURN_VAL(device, EINA_FALSE); | ||
9 | |||
10 | if (enabled) | ||
11 | { | ||
12 | ret = | ||
13 | libinput_device_config_tap_set_drag_enabled(device->device, | ||
14 | LIBINPUT_CONFIG_DRAG_ENABLED); | ||
15 | } | ||
16 | else | ||
17 | { | ||
18 | ret = | ||
19 | libinput_device_config_tap_set_drag_enabled(device->device, | ||
20 | LIBINPUT_CONFIG_DRAG_DISABLED); | ||
21 | } | ||
22 | |||
23 | return ret; | ||
24 | } | ||
25 | |||
26 | EAPI Eina_Bool | ||
27 | elput_touch_drag_enabled_get(Elput_Device *device) | ||
28 | { | ||
29 | EINA_SAFETY_ON_NULL_RETURN_VAL(device, EINA_FALSE); | ||
30 | |||
31 | return libinput_device_config_tap_get_drag_enabled(device->device); | ||
32 | } | ||