Changeset View
Changeset View
Standalone View
Standalone View
autotests/libinput/mock_libinput.cpp
Context not available. | |||||
162 | return device->supportsDisableWhileTyping; | 162 | return device->supportsDisableWhileTyping; | ||
---|---|---|---|---|---|
163 | } | 163 | } | ||
164 | 164 | | |||
165 | enum libinput_config_status libinput_device_config_dwt_set_enabled(struct libinput_device *device, enum libinput_config_dwt_state state) | ||||
166 | { | ||||
167 | if (device->setDisableWhileTypingReturnValue == 0) { | ||||
168 | if (!device->supportsDisableWhileTyping) { | ||||
169 | return LIBINPUT_CONFIG_STATUS_INVALID; | ||||
170 | } | ||||
171 | device->disableWhileTyping = state; | ||||
172 | return LIBINPUT_CONFIG_STATUS_SUCCESS; | ||||
173 | } | ||||
174 | return LIBINPUT_CONFIG_STATUS_INVALID; | ||||
175 | } | ||||
176 | | ||||
177 | enum libinput_config_dwt_state libinput_device_config_dwt_get_enabled(struct libinput_device *device) | ||||
178 | { | ||||
179 | return device->disableWhileTyping; | ||||
180 | } | ||||
181 | | ||||
182 | enum libinput_config_dwt_state libinput_device_config_dwt_get_default_enabled(struct libinput_device *device) | ||||
183 | { | ||||
184 | return device->disableWhileTypingEnabledByDefault; | ||||
185 | } | ||||
186 | | ||||
165 | int libinput_device_config_accel_is_available(struct libinput_device *device) | 187 | int libinput_device_config_accel_is_available(struct libinput_device *device) | ||
166 | { | 188 | { | ||
167 | return device->supportsPointerAcceleration; | 189 | return device->supportsPointerAcceleration; | ||
Context not available. | |||||
194 | return device->leftHanded; | 216 | return device->leftHanded; | ||
195 | } | 217 | } | ||
196 | 218 | | |||
219 | double libinput_device_config_accel_get_default_speed(struct libinput_device *device) | ||||
220 | { | ||||
221 | return device->defaultPointerAcceleration; | ||||
222 | } | ||||
223 | | ||||
197 | int libinput_device_config_left_handed_get_default(struct libinput_device *device) | 224 | int libinput_device_config_left_handed_get_default(struct libinput_device *device) | ||
198 | { | 225 | { | ||
199 | return device->leftHandedEnabledByDefault; | 226 | return device->leftHandedEnabledByDefault; | ||
Context not available. | |||||
204 | return device->pointerAcceleration; | 231 | return device->pointerAcceleration; | ||
205 | } | 232 | } | ||
206 | 233 | | |||
234 | uint32_t libinput_device_config_accel_get_profiles(struct libinput_device *device) | ||||
235 | { | ||||
236 | return device->supportedPointerAccelerationProfiles; | ||||
237 | } | ||||
238 | | ||||
239 | enum libinput_config_accel_profile libinput_device_config_accel_get_default_profile(struct libinput_device *device) | ||||
240 | { | ||||
241 | return device->defaultPointerAccelerationProfile; | ||||
242 | } | ||||
243 | | ||||
244 | enum libinput_config_status libinput_device_config_accel_set_profile(struct libinput_device *device, enum libinput_config_accel_profile profile) | ||||
245 | { | ||||
246 | if (device->setPointerAccelerationProfileReturnValue == 0) { | ||||
247 | if (!(device->supportedPointerAccelerationProfiles & profile) && profile!= LIBINPUT_CONFIG_ACCEL_PROFILE_NONE) { | ||||
248 | return LIBINPUT_CONFIG_STATUS_INVALID; | ||||
249 | } | ||||
250 | device->pointerAccelerationProfile = profile; | ||||
251 | return LIBINPUT_CONFIG_STATUS_SUCCESS; | ||||
252 | } | ||||
253 | return LIBINPUT_CONFIG_STATUS_INVALID; | ||||
254 | } | ||||
255 | | ||||
256 | enum libinput_config_accel_profile libinput_device_config_accel_get_profile(struct libinput_device *device) | ||||
257 | { | ||||
258 | return device->pointerAccelerationProfile; | ||||
259 | } | ||||
260 | | ||||
207 | uint32_t libinput_device_config_send_events_get_mode(struct libinput_device *device) | 261 | uint32_t libinput_device_config_send_events_get_mode(struct libinput_device *device) | ||
208 | { | 262 | { | ||
209 | if (device->enabled) { | 263 | if (device->enabled) { | ||
Context not available. | |||||
670 | return device->naturalScrollEnabledByDefault; | 724 | return device->naturalScrollEnabledByDefault; | ||
671 | } | 725 | } | ||
672 | 726 | | |||
727 | enum libinput_config_tap_button_map libinput_device_config_tap_get_default_button_map(struct libinput_device *device) | ||||
728 | { | ||||
729 | return device->defaultTapButtonMap; | ||||
730 | } | ||||
731 | | ||||
732 | enum libinput_config_status libinput_device_config_tap_set_button_map(struct libinput_device *device, enum libinput_config_tap_button_map map) | ||||
733 | { | ||||
734 | if (device->setTapButtonMapReturnValue == 0) { | ||||
735 | if (device->tapFingerCount == 0) { | ||||
736 | return LIBINPUT_CONFIG_STATUS_INVALID; | ||||
737 | } | ||||
738 | device->tapButtonMap = map; | ||||
739 | return LIBINPUT_CONFIG_STATUS_SUCCESS; | ||||
740 | } | ||||
741 | return LIBINPUT_CONFIG_STATUS_INVALID; | ||||
742 | } | ||||
743 | | ||||
744 | enum libinput_config_tap_button_map libinput_device_config_tap_get_button_map(struct libinput_device *device) | ||||
745 | { | ||||
746 | return device->tapButtonMap; | ||||
747 | } | ||||
748 | | ||||
673 | uint32_t libinput_device_config_scroll_get_methods(struct libinput_device *device) | 749 | uint32_t libinput_device_config_scroll_get_methods(struct libinput_device *device) | ||
674 | { | 750 | { | ||
675 | return device->supportedScrollMethods; | 751 | return device->supportedScrollMethods; | ||
Context not available. |