KWin
Loading...
Searching...
No Matches
mock_libinput.cpp
Go to the documentation of this file.
1/*
2 KWin - the KDE window manager
3 This file is part of the KDE project.
4
5 SPDX-FileCopyrightText: 2016 Martin Gräßlin <mgraesslin@kde.org>
6
7 SPDX-License-Identifier: GPL-2.0-or-later
8*/
9#include <config-kwin.h>
10
11#include "mock_libinput.h"
12
13#include <linux/input.h>
14
15int libinput_device_keyboard_has_key(struct libinput_device *device, uint32_t code)
16{
17 return device->keys.contains(code);
18}
19
20int libinput_device_has_capability(struct libinput_device *device, enum libinput_device_capability capability)
21{
22 switch (capability) {
23 case LIBINPUT_DEVICE_CAP_KEYBOARD:
24 return device->keyboard;
25 case LIBINPUT_DEVICE_CAP_POINTER:
26 return device->pointer;
27 case LIBINPUT_DEVICE_CAP_TOUCH:
28 return device->touch;
29 case LIBINPUT_DEVICE_CAP_GESTURE:
30 return device->gestureSupported;
31 case LIBINPUT_DEVICE_CAP_TABLET_TOOL:
32 return device->tabletTool;
33 case LIBINPUT_DEVICE_CAP_SWITCH:
34 return device->switchDevice;
35 default:
36 return 0;
37 }
38}
39
40const char *libinput_device_get_name(struct libinput_device *device)
41{
42 return device->name.constData();
43}
44
46{
47 return device->sysName.constData();
48}
49
51{
52 return device->outputName.constData();
53}
54
56{
57 return device->product;
58}
59
61{
62 return device->vendor;
63}
64
66{
67 return device->tapFingerCount;
68}
69
70enum libinput_config_tap_state libinput_device_config_tap_get_enabled(struct libinput_device *device)
71{
72 if (device->tapToClick) {
73 return LIBINPUT_CONFIG_TAP_ENABLED;
74 } else {
75 return LIBINPUT_CONFIG_TAP_DISABLED;
76 }
77}
78
79enum libinput_config_status libinput_device_config_tap_set_enabled(struct libinput_device *device, enum libinput_config_tap_state enable)
80{
81 if (device->setTapToClickReturnValue == 0) {
82 device->tapToClick = (enable == LIBINPUT_CONFIG_TAP_ENABLED);
83 return LIBINPUT_CONFIG_STATUS_SUCCESS;
84 }
85 return LIBINPUT_CONFIG_STATUS_INVALID;
86}
87
88enum libinput_config_tap_state libinput_device_config_tap_get_default_enabled(struct libinput_device *device)
89{
90 if (device->tapEnabledByDefault) {
91 return LIBINPUT_CONFIG_TAP_ENABLED;
92 } else {
93 return LIBINPUT_CONFIG_TAP_DISABLED;
94 }
95}
96
97enum libinput_config_drag_state libinput_device_config_tap_get_default_drag_enabled(struct libinput_device *device)
98{
99 if (device->tapAndDragEnabledByDefault) {
100 return LIBINPUT_CONFIG_DRAG_ENABLED;
101 } else {
102 return LIBINPUT_CONFIG_DRAG_DISABLED;
103 }
104}
105
106enum libinput_config_drag_state libinput_device_config_tap_get_drag_enabled(struct libinput_device *device)
107{
108 if (device->tapAndDrag) {
109 return LIBINPUT_CONFIG_DRAG_ENABLED;
110 } else {
111 return LIBINPUT_CONFIG_DRAG_DISABLED;
112 }
113}
114
115enum libinput_config_status libinput_device_config_tap_set_drag_enabled(struct libinput_device *device, enum libinput_config_drag_state enable)
116{
117 if (device->setTapAndDragReturnValue == 0) {
118 device->tapAndDrag = (enable == LIBINPUT_CONFIG_DRAG_ENABLED);
119 return LIBINPUT_CONFIG_STATUS_SUCCESS;
120 }
121 return LIBINPUT_CONFIG_STATUS_INVALID;
122}
123
124enum libinput_config_drag_lock_state libinput_device_config_tap_get_default_drag_lock_enabled(struct libinput_device *device)
125{
126 if (device->tapDragLockEnabledByDefault) {
127 return LIBINPUT_CONFIG_DRAG_LOCK_ENABLED;
128 } else {
129 return LIBINPUT_CONFIG_DRAG_LOCK_DISABLED;
130 }
131}
132
133enum libinput_config_drag_lock_state libinput_device_config_tap_get_drag_lock_enabled(struct libinput_device *device)
134{
135 if (device->tapDragLock) {
136 return LIBINPUT_CONFIG_DRAG_LOCK_ENABLED;
137 } else {
138 return LIBINPUT_CONFIG_DRAG_LOCK_DISABLED;
139 }
140}
141
142enum libinput_config_status libinput_device_config_tap_set_drag_lock_enabled(struct libinput_device *device, enum libinput_config_drag_lock_state enable)
143{
144 if (device->setTapDragLockReturnValue == 0) {
145 device->tapDragLock = (enable == LIBINPUT_CONFIG_DRAG_LOCK_ENABLED);
146 return LIBINPUT_CONFIG_STATUS_SUCCESS;
147 }
148 return LIBINPUT_CONFIG_STATUS_INVALID;
149}
150
155
156enum libinput_config_status libinput_device_config_dwt_set_enabled(struct libinput_device *device, enum libinput_config_dwt_state state)
157{
158 if (device->setDisableWhileTypingReturnValue == 0) {
159 if (!device->supportsDisableWhileTyping) {
160 return LIBINPUT_CONFIG_STATUS_INVALID;
161 }
162 device->disableWhileTyping = state;
163 return LIBINPUT_CONFIG_STATUS_SUCCESS;
164 }
165 return LIBINPUT_CONFIG_STATUS_INVALID;
166}
167
168enum libinput_config_dwt_state libinput_device_config_dwt_get_enabled(struct libinput_device *device)
169{
170 return device->disableWhileTyping;
171}
172
173enum libinput_config_dwt_state libinput_device_config_dwt_get_default_enabled(struct libinput_device *device)
174{
176}
177
182
187
188enum libinput_config_status libinput_device_config_calibration_set_matrix(struct libinput_device *device, const float matrix[6])
189{
190 for (std::size_t i = 0; i < 6; i++) {
191 device->calibrationMatrix[i] = matrix[i];
192 }
193 return LIBINPUT_CONFIG_STATUS_SUCCESS;
194}
195
197{
198 for (std::size_t i = 0; i < 6; i++) {
199 matrix[i] = device->defaultCalibrationMatrix[i];
200 }
201 return device->defaultCalibrationMatrixIsIdentity ? 0 : 1;
202}
203
205{
206 for (std::size_t i = 0; i < 6; i++) {
207 matrix[i] = device->calibrationMatrix[i];
208 }
209 return device->calibrationMatrixIsIdentity ? 0 : 1;
210}
211
216
218{
219 uint32_t modes = LIBINPUT_CONFIG_SEND_EVENTS_ENABLED;
220 if (device->supportsDisableEvents) {
221 modes |= LIBINPUT_CONFIG_SEND_EVENTS_DISABLED;
222 }
224 modes |= LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE;
225 }
226 return modes;
227}
228
230{
231 return device->leftHanded;
232}
233
238
243
245{
246 return device->pointerAcceleration;
247}
248
253
254enum libinput_config_accel_profile libinput_device_config_accel_get_default_profile(struct libinput_device *device)
255{
257}
258
259enum libinput_config_status libinput_device_config_accel_set_profile(struct libinput_device *device, enum libinput_config_accel_profile profile)
260{
262 if (!(device->supportedPointerAccelerationProfiles & profile) && profile != LIBINPUT_CONFIG_ACCEL_PROFILE_NONE) {
263 return LIBINPUT_CONFIG_STATUS_INVALID;
264 }
265 device->pointerAccelerationProfile = profile;
266 return LIBINPUT_CONFIG_STATUS_SUCCESS;
267 }
268 return LIBINPUT_CONFIG_STATUS_INVALID;
269}
270
271enum libinput_config_accel_profile libinput_device_config_accel_get_profile(struct libinput_device *device)
272{
273 return device->pointerAccelerationProfile;
274}
275
277{
278 return device->supportedClickMethods;
279}
280
281enum libinput_config_click_method libinput_device_config_click_get_default_method(struct libinput_device *device)
282{
283 return device->defaultClickMethod;
284}
285
286enum libinput_config_click_method libinput_device_config_click_get_method(struct libinput_device *device)
287{
288 return device->clickMethod;
289}
290
291enum libinput_config_status libinput_device_config_click_set_method(struct libinput_device *device, enum libinput_config_click_method method)
292{
293 if (device->setClickMethodReturnValue == 0) {
294 if (!(device->supportedClickMethods & method) && method != LIBINPUT_CONFIG_CLICK_METHOD_NONE) {
295 return LIBINPUT_CONFIG_STATUS_INVALID;
296 }
297 device->clickMethod = method;
298 return LIBINPUT_CONFIG_STATUS_SUCCESS;
299 }
300 return LIBINPUT_CONFIG_STATUS_INVALID;
301}
302
304{
305 if (device->enabled) {
306 return LIBINPUT_CONFIG_SEND_EVENTS_ENABLED;
307 } else {
308 // TODO: disabled on eternal mouse
309 return LIBINPUT_CONFIG_SEND_EVENTS_DISABLED;
310 }
311}
312
314{
315 return device;
316}
317
319{
320 return device;
321}
322
323int libinput_device_get_size(struct libinput_device *device, double *width, double *height)
324{
325 if (device->deviceSizeReturnValue) {
326 return device->deviceSizeReturnValue;
327 }
328 if (width) {
329 *width = device->deviceSize.width();
330 }
331 if (height) {
332 *height = device->deviceSize.height();
333 }
334 return device->deviceSizeReturnValue;
335}
336
337int libinput_device_pointer_has_button(struct libinput_device *device, uint32_t code)
338{
339 switch (code) {
340 case BTN_LEFT:
341 return device->supportedButtons.testFlag(Qt::LeftButton);
342 case BTN_MIDDLE:
343 return device->supportedButtons.testFlag(Qt::MiddleButton);
344 case BTN_RIGHT:
345 return device->supportedButtons.testFlag(Qt::RightButton);
346 case BTN_SIDE:
347 return device->supportedButtons.testFlag(Qt::ExtraButton1);
348 case BTN_EXTRA:
349 return device->supportedButtons.testFlag(Qt::ExtraButton2);
350 case BTN_FORWARD:
351 return device->supportedButtons.testFlag(Qt::ExtraButton3);
352 case BTN_BACK:
353 return device->supportedButtons.testFlag(Qt::ExtraButton4);
354 case BTN_TASK:
355 return device->supportedButtons.testFlag(Qt::ExtraButton5);
356 default:
357 return 0;
358 }
359}
360
361enum libinput_config_status libinput_device_config_left_handed_set(struct libinput_device *device, int left_handed)
362{
363 if (device->setLeftHandedReturnValue == 0) {
364 device->leftHanded = left_handed;
365 return LIBINPUT_CONFIG_STATUS_SUCCESS;
366 }
367 return LIBINPUT_CONFIG_STATUS_INVALID;
368}
369
370enum libinput_config_status libinput_device_config_accel_set_speed(struct libinput_device *device, double speed)
371{
372 if (device->setPointerAccelerationReturnValue == 0) {
373 device->pointerAcceleration = speed;
374 return LIBINPUT_CONFIG_STATUS_SUCCESS;
375 }
376 return LIBINPUT_CONFIG_STATUS_INVALID;
377}
378
379enum libinput_config_status libinput_device_config_send_events_set_mode(struct libinput_device *device, uint32_t mode)
380{
381 if (device->setEnableModeReturnValue == 0) {
382 device->enabled = (mode == LIBINPUT_CONFIG_SEND_EVENTS_ENABLED);
383 return LIBINPUT_CONFIG_STATUS_SUCCESS;
384 }
385 return LIBINPUT_CONFIG_STATUS_INVALID;
386}
387
388enum libinput_event_type libinput_event_get_type(struct libinput_event *event)
389{
390 return event->type;
391}
392
394{
395 return event->device;
396}
397
399{
400 delete event;
401}
402
404{
405 if (event->type == LIBINPUT_EVENT_KEYBOARD_KEY) {
406 return reinterpret_cast<libinput_event_keyboard *>(event);
407 }
408 return nullptr;
409}
410
412{
413 switch (event->type) {
414 case LIBINPUT_EVENT_POINTER_MOTION:
415 case LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE:
416 case LIBINPUT_EVENT_POINTER_BUTTON:
417 case LIBINPUT_EVENT_POINTER_SCROLL_WHEEL:
418 case LIBINPUT_EVENT_POINTER_SCROLL_FINGER:
419 case LIBINPUT_EVENT_POINTER_SCROLL_CONTINUOUS:
420 return reinterpret_cast<libinput_event_pointer *>(event);
421 default:
422 return nullptr;
423 }
424}
425
427{
428 switch (event->type) {
429 case LIBINPUT_EVENT_TOUCH_DOWN:
430 case LIBINPUT_EVENT_TOUCH_UP:
431 case LIBINPUT_EVENT_TOUCH_MOTION:
432 case LIBINPUT_EVENT_TOUCH_CANCEL:
433 case LIBINPUT_EVENT_TOUCH_FRAME:
434 return reinterpret_cast<libinput_event_touch *>(event);
435 default:
436 return nullptr;
437 }
438}
439
441{
442 switch (event->type) {
443 case LIBINPUT_EVENT_GESTURE_PINCH_BEGIN:
444 case LIBINPUT_EVENT_GESTURE_PINCH_UPDATE:
445 case LIBINPUT_EVENT_GESTURE_PINCH_END:
446 case LIBINPUT_EVENT_GESTURE_SWIPE_BEGIN:
447 case LIBINPUT_EVENT_GESTURE_SWIPE_UPDATE:
448 case LIBINPUT_EVENT_GESTURE_SWIPE_END:
449 return reinterpret_cast<libinput_event_gesture *>(event);
450 default:
451 return nullptr;
452 }
453}
454
456{
457 if (event->type == LIBINPUT_EVENT_GESTURE_PINCH_END || event->type == LIBINPUT_EVENT_GESTURE_SWIPE_END) {
458 return event->cancelled;
459 }
460 return 0;
461}
462
464{
465 return event->time.count();
466}
467
469{
470 return event->fingerCount;
471}
472
474{
475 if (event->type == LIBINPUT_EVENT_GESTURE_PINCH_UPDATE || event->type == LIBINPUT_EVENT_GESTURE_SWIPE_UPDATE) {
476 return event->delta.x();
477 }
478 return 0.0;
479}
480
482{
483 if (event->type == LIBINPUT_EVENT_GESTURE_PINCH_UPDATE || event->type == LIBINPUT_EVENT_GESTURE_SWIPE_UPDATE) {
484 return event->delta.y();
485 }
486 return 0.0;
487}
488
490{
491 switch (event->type) {
492 case LIBINPUT_EVENT_GESTURE_PINCH_BEGIN:
493 return 1.0;
494 case LIBINPUT_EVENT_GESTURE_PINCH_UPDATE:
495 case LIBINPUT_EVENT_GESTURE_PINCH_END:
496 return event->scale;
497 default:
498 return 0.0;
499 }
500}
501
503{
504 if (event->type == LIBINPUT_EVENT_GESTURE_PINCH_UPDATE) {
505 return event->angleDelta;
506 }
507 return 0.0;
508}
509
511{
512 return event->key;
513}
514
516{
517 return event->state;
518}
519
521{
522 return event->time.count();
523}
524
526{
527 return event->absolutePos.x();
528}
529
531{
532 return event->absolutePos.y();
533}
534
536{
537 double deviceWidth = 0.0;
538 double deviceHeight = 0.0;
539 libinput_device_get_size(event->device, &deviceWidth, &deviceHeight);
540 return event->absolutePos.x() / deviceWidth * width;
541}
542
544{
545 double deviceWidth = 0.0;
546 double deviceHeight = 0.0;
547 libinput_device_get_size(event->device, &deviceWidth, &deviceHeight);
548 return event->absolutePos.y() / deviceHeight * height;
549}
550
552{
553 return event->delta.x();
554}
555
557{
558 return event->delta.y();
559}
560
562{
563 return event->delta.x();
564}
565
567{
568 return event->delta.y();
569}
570
572{
573 return event->time.count();
574}
575
577{
578 return event->button;
579}
580
582{
583 return event->buttonState;
584}
585
586int libinput_event_pointer_has_axis(struct libinput_event_pointer *event, enum libinput_pointer_axis axis)
587{
588 if (axis == LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL) {
589 return event->verticalAxis;
590 } else {
591 return event->horizontalAxis;
592 }
593}
594
595double libinput_event_pointer_get_scroll_value(struct libinput_event_pointer *event, enum libinput_pointer_axis axis)
596{
597 if (axis == LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL) {
598 return event->verticalScrollValue;
599 } else {
600 return event->horizontalScrollValue;
601 }
602}
603
604double libinput_event_pointer_get_scroll_value_v120(struct libinput_event_pointer *event, enum libinput_pointer_axis axis)
605{
606 if (axis == LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL) {
607 return event->verticalScrollValueV120;
608 } else {
609 return event->horizontalScrollValueV120;
610 }
611}
612
614{
615 return event->time.count();
616}
617
619{
620 return event->absolutePos.x();
621}
622
624{
625 return event->absolutePos.y();
626}
627
629{
630 double deviceWidth = 0.0;
631 double deviceHeight = 0.0;
632 libinput_device_get_size(event->device, &deviceWidth, &deviceHeight);
633 return event->absolutePos.x() / deviceWidth * width;
634}
635
637{
638 double deviceWidth = 0.0;
639 double deviceHeight = 0.0;
640 libinput_device_get_size(event->device, &deviceWidth, &deviceHeight);
641 return event->absolutePos.y() / deviceHeight * height;
642}
643
645{
646 return event->slot;
647}
648
649struct libinput *libinput_udev_create_context(const struct libinput_interface *interface, void *user_data, struct udev *udev)
650{
651 if (!udev) {
652 return nullptr;
653 }
654 return new libinput;
655}
656
657void libinput_log_set_priority(struct libinput *libinput, enum libinput_log_priority priority)
658{
659}
660
661void libinput_log_set_handler(struct libinput *libinput, libinput_log_handler log_handler)
662{
663}
664
666{
668 if (libinput->refCount == 0) {
669 delete libinput;
670 return nullptr;
671 }
672 return libinput;
673}
674
675int libinput_udev_assign_seat(struct libinput *libinput, const char *seat_id)
676{
677 if (libinput->assignSeatRetVal == 0) {
678 libinput->seat = QByteArray(seat_id);
679 }
681}
682
684{
685 return -1;
686}
687
689{
690 return 0;
691}
692
694{
695 return nullptr;
696}
697
699{
700}
701
703{
704 return 0;
705}
706
711
712enum libinput_config_status libinput_device_config_middle_emulation_set_enabled(struct libinput_device *device, enum libinput_config_middle_emulation_state enable)
713{
716 return LIBINPUT_CONFIG_STATUS_INVALID;
717 }
718 device->middleEmulation = (enable == LIBINPUT_CONFIG_MIDDLE_EMULATION_ENABLED);
719 return LIBINPUT_CONFIG_STATUS_SUCCESS;
720 }
721 return LIBINPUT_CONFIG_STATUS_INVALID;
722}
723
724enum libinput_config_middle_emulation_state libinput_device_config_middle_emulation_get_enabled(struct libinput_device *device)
725{
726 if (device->middleEmulation) {
727 return LIBINPUT_CONFIG_MIDDLE_EMULATION_ENABLED;
728 } else {
729 return LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED;
730 }
731}
732
734{
736 return LIBINPUT_CONFIG_MIDDLE_EMULATION_ENABLED;
737 } else {
738 return LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED;
739 }
740}
741
746
748{
751 return LIBINPUT_CONFIG_STATUS_INVALID;
752 }
753 device->naturalScroll = enable;
754 return LIBINPUT_CONFIG_STATUS_SUCCESS;
755 }
756 return LIBINPUT_CONFIG_STATUS_INVALID;
757}
758
763
768
770{
772}
773
774enum libinput_config_status libinput_device_config_tap_set_button_map(struct libinput_device *device, enum libinput_config_tap_button_map map)
775{
777 if (device->tapFingerCount == 0) {
778 return LIBINPUT_CONFIG_STATUS_INVALID;
779 }
780 device->tapButtonMap = map;
781 return LIBINPUT_CONFIG_STATUS_SUCCESS;
782 }
783 return LIBINPUT_CONFIG_STATUS_INVALID;
784}
785
786enum libinput_config_tap_button_map libinput_device_config_tap_get_button_map(struct libinput_device *device)
787{
788 return device->tapButtonMap;
789}
790
795
797{
799}
800
801enum libinput_config_status libinput_device_config_scroll_set_method(struct libinput_device *device, enum libinput_config_scroll_method method)
802{
804 if (!(device->supportedScrollMethods & method) && method != LIBINPUT_CONFIG_SCROLL_NO_SCROLL) {
805 return LIBINPUT_CONFIG_STATUS_INVALID;
806 }
807 device->scrollMethod = method;
808 return LIBINPUT_CONFIG_STATUS_SUCCESS;
809 }
810 return LIBINPUT_CONFIG_STATUS_INVALID;
811}
812
813enum libinput_config_scroll_method libinput_device_config_scroll_get_method(struct libinput_device *device)
814{
815 return device->scrollMethod;
816}
817
818enum libinput_config_status libinput_device_config_scroll_set_button(struct libinput_device *device, uint32_t button)
819{
821 if (!(device->supportedScrollMethods & LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN)) {
822 return LIBINPUT_CONFIG_STATUS_UNSUPPORTED;
823 }
824 device->scrollButton = button;
825 return LIBINPUT_CONFIG_STATUS_SUCCESS;
826 }
827 return LIBINPUT_CONFIG_STATUS_INVALID;
828}
829
834
839
840int libinput_device_switch_has_switch(struct libinput_device *device, enum libinput_switch sw)
841{
842 switch (sw) {
843 case LIBINPUT_SWITCH_LID:
844 return device->lidSwitch;
845 case LIBINPUT_SWITCH_TABLET_MODE:
846 return device->tabletModeSwitch;
847 default:
848 Q_UNREACHABLE();
849 }
850 return 0;
851}
852
854{
855 if (event->type == LIBINPUT_EVENT_SWITCH_TOGGLE) {
856 return reinterpret_cast<libinput_event_switch *>(event);
857 } else {
858 return nullptr;
859 }
860}
861
862enum libinput_switch_state libinput_event_switch_get_switch_state(struct libinput_event_switch *event)
863{
864 switch (event->state) {
866 return LIBINPUT_SWITCH_STATE_ON;
868 return LIBINPUT_SWITCH_STATE_OFF;
869 default:
870 Q_UNREACHABLE();
871 }
872}
873
875{
876 return event->time.count();
877}
878
879struct libinput_event_tablet_pad *libinput_event_get_tablet_pad_event(struct libinput_event *event)
880{
881 if (event->type == LIBINPUT_EVENT_TABLET_PAD_BUTTON) {
882 return reinterpret_cast<libinput_event_tablet_pad *>(event);
883 }
884 return nullptr;
885}
886
887struct libinput_event_tablet_tool *
889{
890 switch (event->type) {
891 case LIBINPUT_EVENT_TABLET_TOOL_AXIS:
892 case LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY:
893 case LIBINPUT_EVENT_TABLET_TOOL_TIP:
894 return reinterpret_cast<libinput_event_tablet_tool *>(event);
895 default:
896 return nullptr;
897 }
898}
899
901{
902 return device->stripCount;
903}
904
906{
907 return device->ringCount;
908}
909
911{
912 return device->buttonCount;
913}
914
915struct libinput_device_group *
917{
918 return nullptr;
919}
920
921void *
922libinput_device_group_get_user_data(struct libinput_device_group *group)
923{
924 return nullptr;
925}
926
928 enum libinput_led leds)
929{
930}
931
932void libinput_device_set_user_data(struct libinput_device *device, void *user_data)
933{
934 device->userData = user_data;
935}
936
937void *
939{
940 return device->userData;
941}
942
943double
944libinput_event_tablet_tool_get_x_transformed(struct libinput_event_tablet_tool *event,
945 uint32_t width)
946{
947 // it's unused at the moment, it doesn't really matter what we return
948 return 0;
949}
950
951double
952libinput_event_tablet_tool_get_y_transformed(struct libinput_event_tablet_tool *event,
953 uint32_t height)
954{
955 return 4;
956}
enum libinput_config_drag_lock_state libinput_device_config_tap_get_drag_lock_enabled(struct libinput_device *device)
enum libinput_config_status libinput_device_config_calibration_set_matrix(struct libinput_device *device, const float matrix[6])
uint64_t libinput_event_gesture_get_time_usec(struct libinput_event_gesture *event)
int libinput_device_config_dwt_is_available(struct libinput_device *device)
struct libinput_event_keyboard * libinput_event_get_keyboard_event(struct libinput_event *event)
int libinput_device_config_tap_get_finger_count(struct libinput_device *device)
uint64_t libinput_event_keyboard_get_time_usec(struct libinput_event_keyboard *event)
struct libinput_device * libinput_device_unref(struct libinput_device *device)
const char * libinput_device_get_sysname(struct libinput_device *device)
enum libinput_config_drag_state libinput_device_config_tap_get_default_drag_enabled(struct libinput_device *device)
enum libinput_config_status libinput_device_config_accel_set_speed(struct libinput_device *device, double speed)
void libinput_event_destroy(struct libinput_event *event)
int libinput_event_pointer_has_axis(struct libinput_event_pointer *event, enum libinput_pointer_axis axis)
double libinput_event_pointer_get_absolute_x_transformed(struct libinput_event_pointer *event, uint32_t width)
int libinput_dispatch(struct libinput *libinput)
enum libinput_config_accel_profile libinput_device_config_accel_get_default_profile(struct libinput_device *device)
double libinput_event_pointer_get_dx(struct libinput_event_pointer *event)
double libinput_event_pointer_get_dy_unaccelerated(struct libinput_event_pointer *event)
int libinput_device_tablet_pad_get_num_buttons(struct libinput_device *device)
void * libinput_device_get_user_data(struct libinput_device *device)
double libinput_event_touch_get_y(struct libinput_event_touch *event)
uint32_t libinput_device_config_click_get_methods(struct libinput_device *device)
double libinput_event_pointer_get_scroll_value_v120(struct libinput_event_pointer *event, enum libinput_pointer_axis axis)
double libinput_event_touch_get_y_transformed(struct libinput_event_touch *event, uint32_t height)
double libinput_event_gesture_get_dx(struct libinput_event_gesture *event)
struct libinput_event_gesture * libinput_event_get_gesture_event(struct libinput_event *event)
double libinput_event_tablet_tool_get_x_transformed(struct libinput_event_tablet_tool *event, uint32_t width)
enum libinput_config_status libinput_device_config_tap_set_enabled(struct libinput_device *device, enum libinput_config_tap_state enable)
int libinput_device_config_calibration_get_default_matrix(struct libinput_device *device, float matrix[6])
double libinput_event_pointer_get_absolute_y(struct libinput_event_pointer *event)
enum libinput_button_state libinput_event_pointer_get_button_state(struct libinput_event_pointer *event)
enum libinput_event_type libinput_event_get_type(struct libinput_event *event)
void libinput_log_set_handler(struct libinput *libinput, libinput_log_handler log_handler)
enum libinput_config_middle_emulation_state libinput_device_config_middle_emulation_get_enabled(struct libinput_device *device)
enum libinput_config_status libinput_device_config_scroll_set_method(struct libinput_device *device, enum libinput_config_scroll_method method)
enum libinput_config_dwt_state libinput_device_config_dwt_get_default_enabled(struct libinput_device *device)
enum libinput_config_scroll_method libinput_device_config_scroll_get_method(struct libinput_device *device)
enum libinput_config_tap_button_map libinput_device_config_tap_get_button_map(struct libinput_device *device)
double libinput_event_gesture_get_angle_delta(struct libinput_event_gesture *event)
enum libinput_config_tap_button_map libinput_device_config_tap_get_default_button_map(struct libinput_device *device)
enum libinput_config_click_method libinput_device_config_click_get_default_method(struct libinput_device *device)
enum libinput_config_status libinput_device_config_middle_emulation_set_enabled(struct libinput_device *device, enum libinput_config_middle_emulation_state enable)
struct libinput_event_tablet_tool * libinput_event_get_tablet_tool_event(struct libinput_event *event)
int libinput_resume(struct libinput *libinput)
void * libinput_device_group_get_user_data(struct libinput_device_group *group)
struct libinput_event * libinput_get_event(struct libinput *libinput)
enum libinput_config_middle_emulation_state libinput_device_config_middle_emulation_get_default_enabled(struct libinput_device *device)
void libinput_suspend(struct libinput *libinput)
void libinput_device_set_user_data(struct libinput_device *device, void *user_data)
int libinput_device_tablet_pad_get_num_rings(struct libinput_device *device)
struct libinput * libinput_udev_create_context(const struct libinput_interface *interface, void *user_data, struct udev *udev)
double libinput_event_pointer_get_scroll_value(struct libinput_event_pointer *event, enum libinput_pointer_axis axis)
enum libinput_config_click_method libinput_device_config_click_get_method(struct libinput_device *device)
double libinput_event_tablet_tool_get_y_transformed(struct libinput_event_tablet_tool *event, uint32_t height)
uint32_t libinput_event_pointer_get_button(struct libinput_event_pointer *event)
int libinput_udev_assign_seat(struct libinput *libinput, const char *seat_id)
double libinput_device_config_accel_get_default_speed(struct libinput_device *device)
enum libinput_config_status libinput_device_config_dwt_set_enabled(struct libinput_device *device, enum libinput_config_dwt_state state)
int libinput_device_config_left_handed_is_available(struct libinput_device *device)
void libinput_log_set_priority(struct libinput *libinput, enum libinput_log_priority priority)
int libinput_device_config_accel_is_available(struct libinput_device *device)
int libinput_event_gesture_get_cancelled(struct libinput_event_gesture *event)
uint64_t libinput_event_switch_get_time_usec(struct libinput_event_switch *event)
enum libinput_config_accel_profile libinput_device_config_accel_get_profile(struct libinput_device *device)
struct libinput_device_group * libinput_device_get_device_group(struct libinput_device *device)
int libinput_device_keyboard_has_key(struct libinput_device *device, uint32_t code)
int libinput_device_config_scroll_has_natural_scroll(struct libinput_device *device)
uint32_t libinput_device_config_scroll_get_button(struct libinput_device *device)
uint64_t libinput_event_touch_get_time_usec(struct libinput_event_touch *event)
enum libinput_config_scroll_method libinput_device_config_scroll_get_default_method(struct libinput_device *device)
int libinput_get_fd(struct libinput *libinput)
enum libinput_config_status libinput_device_config_tap_set_drag_lock_enabled(struct libinput_device *device, enum libinput_config_drag_lock_state enable)
double libinput_event_pointer_get_dy(struct libinput_event_pointer *event)
enum libinput_config_tap_state libinput_device_config_tap_get_enabled(struct libinput_device *device)
double libinput_event_gesture_get_scale(struct libinput_event_gesture *event)
enum libinput_config_status libinput_device_config_scroll_set_natural_scroll_enabled(struct libinput_device *device, int enable)
int libinput_device_config_left_handed_get(struct libinput_device *device)
enum libinput_config_status libinput_device_config_left_handed_set(struct libinput_device *device, int left_handed)
struct libinput_event_touch * libinput_event_get_touch_event(struct libinput_event *event)
uint32_t libinput_device_config_send_events_get_modes(struct libinput_device *device)
int libinput_device_tablet_pad_get_num_strips(struct libinput_device *device)
int libinput_device_config_calibration_get_matrix(struct libinput_device *device, float matrix[6])
int libinput_device_has_capability(struct libinput_device *device, enum libinput_device_capability capability)
int libinput_device_config_left_handed_get_default(struct libinput_device *device)
double libinput_event_pointer_get_absolute_y_transformed(struct libinput_event_pointer *event, uint32_t height)
struct libinput_event_pointer * libinput_event_get_pointer_event(struct libinput_event *event)
enum libinput_config_drag_lock_state libinput_device_config_tap_get_default_drag_lock_enabled(struct libinput_device *device)
int libinput_device_config_scroll_get_default_natural_scroll_enabled(struct libinput_device *device)
double libinput_device_config_accel_get_speed(struct libinput_device *device)
enum libinput_config_status libinput_device_config_send_events_set_mode(struct libinput_device *device, uint32_t mode)
int libinput_device_pointer_has_button(struct libinput_device *device, uint32_t code)
int libinput_device_config_scroll_get_natural_scroll_enabled(struct libinput_device *device)
enum libinput_config_drag_state libinput_device_config_tap_get_drag_enabled(struct libinput_device *device)
const char * libinput_device_get_output_name(struct libinput_device *device)
int libinput_device_get_size(struct libinput_device *device, double *width, double *height)
int32_t libinput_event_touch_get_seat_slot(struct libinput_event_touch *event)
double libinput_event_gesture_get_dy(struct libinput_event_gesture *event)
struct libinput_device * libinput_event_get_device(struct libinput_event *event)
double libinput_event_pointer_get_absolute_x(struct libinput_event_pointer *event)
uint32_t libinput_device_config_accel_get_profiles(struct libinput_device *device)
double libinput_event_touch_get_x(struct libinput_event_touch *event)
enum libinput_config_status libinput_device_config_accel_set_profile(struct libinput_device *device, enum libinput_config_accel_profile profile)
enum libinput_config_status libinput_device_config_scroll_set_button(struct libinput_device *device, uint32_t button)
uint32_t libinput_device_config_scroll_get_methods(struct libinput_device *device)
int libinput_device_switch_has_switch(struct libinput_device *device, enum libinput_switch sw)
enum libinput_config_status libinput_device_config_tap_set_button_map(struct libinput_device *device, enum libinput_config_tap_button_map map)
int libinput_event_gesture_get_finger_count(struct libinput_event_gesture *event)
struct libinput_event_switch * libinput_event_get_switch_event(struct libinput_event *event)
uint32_t libinput_event_keyboard_get_key(struct libinput_event_keyboard *event)
enum libinput_config_status libinput_device_config_tap_set_drag_enabled(struct libinput_device *device, enum libinput_config_drag_state enable)
uint32_t libinput_device_config_scroll_get_default_button(struct libinput_device *device)
double libinput_event_pointer_get_dx_unaccelerated(struct libinput_event_pointer *event)
int libinput_device_config_middle_emulation_is_available(struct libinput_device *device)
unsigned int libinput_device_get_id_vendor(struct libinput_device *device)
double libinput_event_touch_get_x_transformed(struct libinput_event_touch *event, uint32_t width)
int libinput_device_config_calibration_has_matrix(struct libinput_device *device)
enum libinput_config_status libinput_device_config_click_set_method(struct libinput_device *device, enum libinput_config_click_method method)
unsigned int libinput_device_get_id_product(struct libinput_device *device)
struct libinput * libinput_unref(struct libinput *libinput)
uint32_t libinput_device_config_send_events_get_mode(struct libinput_device *device)
enum libinput_switch_state libinput_event_switch_get_switch_state(struct libinput_event_switch *event)
struct libinput_event_tablet_pad * libinput_event_get_tablet_pad_event(struct libinput_event *event)
uint64_t libinput_event_pointer_get_time_usec(struct libinput_event_pointer *event)
struct libinput_device * libinput_device_ref(struct libinput_device *device)
enum libinput_config_dwt_state libinput_device_config_dwt_get_enabled(struct libinput_device *device)
enum libinput_config_tap_state libinput_device_config_tap_get_default_enabled(struct libinput_device *device)
enum libinput_key_state libinput_event_keyboard_get_key_state(struct libinput_event_keyboard *event)
const char * libinput_device_get_name(struct libinput_device *device)
void libinput_device_led_update(struct libinput_device *device, enum libinput_led leds)
int setScrollMethodReturnValue
quint32 supportedScrollMethods
bool tapDragLockEnabledByDefault
int setNaturalScrollReturnValue
int setScrollButtonReturnValue
bool setClickMethodReturnValue
std::array< float, 6 > defaultCalibrationMatrix
QByteArray outputName
enum libinput_config_dwt_state disableWhileTypingEnabledByDefault
quint32 supportedClickMethods
QList< quint32 > keys
bool supportsCalibrationMatrix
enum libinput_config_scroll_method defaultScrollMethod
int setPointerAccelerationReturnValue
int setMiddleEmulationReturnValue
bool supportsDisableWhileTyping
enum libinput_config_scroll_method scrollMethod
bool setPointerAccelerationProfileReturnValue
qreal pointerAcceleration
int setTapButtonMapReturnValue
enum libinput_config_accel_profile pointerAccelerationProfile
enum libinput_config_dwt_state disableWhileTyping
enum libinput_config_accel_profile defaultPointerAccelerationProfile
bool calibrationMatrixIsIdentity
bool leftHandedEnabledByDefault
std::array< float, 6 > calibrationMatrix
quint32 defaultScrollButton
qreal defaultPointerAcceleration
QByteArray name
enum libinput_config_tap_button_map tapButtonMap
enum libinput_config_click_method clickMethod
bool supportsPointerAcceleration
bool tapAndDragEnabledByDefault
enum libinput_config_tap_button_map defaultTapButtonMap
bool naturalScrollEnabledByDefault
bool supportsDisableEventsOnExternalMouse
bool middleEmulationEnabledByDefault
bool defaultCalibrationMatrixIsIdentity
int setDisableWhileTypingReturnValue
QByteArray sysName
bool supportsMiddleEmulation
enum libinput_config_click_method defaultClickMethod
int setTapDragLockReturnValue
quint32 supportedPointerAccelerationProfiles
Qt::MouseButtons supportedButtons
libinput_device * device
libinput_event_type type
int assignSeatRetVal
QByteArray seat