• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright © 2021 Red Hat, Inc.
3  * Copyright © 2021 José Expósito
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice (including the next
13  * paragraph) shall be included in all copies or substantial portions of the
14  * Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
19  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  * DEALINGS IN THE SOFTWARE.
23  */
24 
25 #ifndef LIBINPUT_PRIVATE_CONFIG_H
26 #define LIBINPUT_PRIVATE_CONFIG_H
27 
28 #include "config.h"
29 
30 #include "libinput.h"
31 
32 enum libinput_config_hold_state {
33 	/** Hold gestures are to be disabled, or are currently disabled */
34 	LIBINPUT_CONFIG_HOLD_DISABLED,
35 	/** Hold gestures are to be enabled, or are currently disabled */
36 	LIBINPUT_CONFIG_HOLD_ENABLED,
37 };
38 
39 /**
40  * @ingroup config
41  *
42  * Check whether a device can perform hold gestures.
43  *
44  * @param device The device to configure
45  * @return Non-zero if a device can perform hold gestures, zero otherwise.
46  *
47  * @see libinput_device_config_gesture_set_hold_enabled
48  * @see libinput_device_config_gesture_get_hold_enabled
49  * @see libinput_device_config_gesture_get_hold_default_enabled
50  */
51 int
52 libinput_device_config_gesture_hold_is_available(struct libinput_device *device);
53 
54 /**
55  * @ingroup config
56  *
57  * Enable or disable hold gestures on this device.
58  *
59  * @param device The device to configure
60  * @param enable @ref LIBINPUT_CONFIG_HOLD_ENABLED to enable hold gestures or
61  * @ref LIBINPUT_CONFIG_HOLD_DISABLED to disable them
62  *
63  * @return A config status code. Disabling hold gestures on a device that does
64  * not support them always succeeds.
65  *
66  * @see libinput_device_config_gesture_hold_is_available
67  * @see libinput_device_config_gesture_get_hold_enabled
68  * @see libinput_device_config_gesture_get_hold_default_enabled
69  */
70 enum libinput_config_status
71 libinput_device_config_gesture_set_hold_enabled(struct libinput_device *device,
72 						enum libinput_config_hold_state enable);
73 
74 /**
75  * @ingroup config
76  *
77  * Check if hold gestures are enabled on this device. If the device does not
78  * support hold gestures, this function always returns @ref
79  * LIBINPUT_CONFIG_HOLD_DISABLED.
80  *
81  * @param device The device to configure
82  *
83  * @retval LIBINPUT_CONFIG_HOLD_ENABLED If hold gestures are currently enabled
84  * @retval LIBINPUT_CONFIG_HOLD_DISABLED If hold gestures are currently disabled
85  *
86  * @see libinput_device_config_gesture_hold_is_available
87  * @see libinput_device_config_gesture_set_hold_enabled
88  * @see libinput_device_config_gesture_get_hold_default_enabled
89  */
90 enum libinput_config_hold_state
91 libinput_device_config_gesture_get_hold_enabled(struct libinput_device *device);
92 
93 /**
94  * @ingroup config
95  *
96  * Return the default setting for whether hold gestures are enabled on this
97  * device.
98  *
99  * @param device The device to configure
100  * @retval LIBINPUT_CONFIG_HOLD_ENABLED If hold gestures are enabled by default
101  * @retval LIBINPUT_CONFIG_HOLD_DISABLED If hold gestures are disabled by
102  * default
103  *
104  * @see libinput_device_config_gesture_hold_is_available
105  * @see libinput_device_config_gesture_set_hold_enabled
106  * @see libinput_device_config_gesture_get_hold_enabled
107  */
108 enum libinput_config_hold_state
109 libinput_device_config_gesture_get_hold_default_enabled(struct libinput_device *device);
110 
111 #endif /* LIBINPUT_PRIVATE_CONFIG_H */
112