Changeset View
Changeset View
Standalone View
Standalone View
autotests/libinput/mock_libinput.cpp
Show All 35 Lines | 32 | { | |||
---|---|---|---|---|---|
36 | case LIBINPUT_DEVICE_CAP_POINTER: | 36 | case LIBINPUT_DEVICE_CAP_POINTER: | ||
37 | return device->pointer; | 37 | return device->pointer; | ||
38 | case LIBINPUT_DEVICE_CAP_TOUCH: | 38 | case LIBINPUT_DEVICE_CAP_TOUCH: | ||
39 | return device->touch; | 39 | return device->touch; | ||
40 | case LIBINPUT_DEVICE_CAP_GESTURE: | 40 | case LIBINPUT_DEVICE_CAP_GESTURE: | ||
41 | return device->gestureSupported; | 41 | return device->gestureSupported; | ||
42 | case LIBINPUT_DEVICE_CAP_TABLET_TOOL: | 42 | case LIBINPUT_DEVICE_CAP_TABLET_TOOL: | ||
43 | return device->tabletTool; | 43 | return device->tabletTool; | ||
44 | #if HAVE_INPUT_1_9 | | |||
45 | case LIBINPUT_DEVICE_CAP_SWITCH: | 44 | case LIBINPUT_DEVICE_CAP_SWITCH: | ||
46 | return device->switchDevice; | 45 | return device->switchDevice; | ||
47 | #endif | | |||
48 | default: | 46 | default: | ||
49 | return 0; | 47 | return 0; | ||
50 | } | 48 | } | ||
51 | } | 49 | } | ||
52 | 50 | | |||
53 | const char *libinput_device_get_name(struct libinput_device *device) | 51 | const char *libinput_device_get_name(struct libinput_device *device) | ||
54 | { | 52 | { | ||
55 | return device->name.constData(); | 53 | return device->name.constData(); | ||
▲ Show 20 Lines • Show All 754 Lines • ▼ Show 20 Line(s) | 807 | { | |||
810 | return device->scrollButton; | 808 | return device->scrollButton; | ||
811 | } | 809 | } | ||
812 | 810 | | |||
813 | uint32_t libinput_device_config_scroll_get_default_button(struct libinput_device *device) | 811 | uint32_t libinput_device_config_scroll_get_default_button(struct libinput_device *device) | ||
814 | { | 812 | { | ||
815 | return device->defaultScrollButton; | 813 | return device->defaultScrollButton; | ||
816 | } | 814 | } | ||
817 | 815 | | |||
818 | #if HAVE_INPUT_1_9 | | |||
819 | | ||||
820 | int libinput_device_switch_has_switch(struct libinput_device *device, enum libinput_switch sw) | 816 | int libinput_device_switch_has_switch(struct libinput_device *device, enum libinput_switch sw) | ||
821 | { | 817 | { | ||
822 | switch (sw) { | 818 | switch (sw) { | ||
823 | case LIBINPUT_SWITCH_LID: | 819 | case LIBINPUT_SWITCH_LID: | ||
824 | return device->lidSwitch; | 820 | return device->lidSwitch; | ||
825 | case LIBINPUT_SWITCH_TABLET_MODE: | 821 | case LIBINPUT_SWITCH_TABLET_MODE: | ||
826 | return device->tabletModeSwitch; | 822 | return device->tabletModeSwitch; | ||
827 | default: | 823 | default: | ||
Show All 27 Lines | |||||
855 | { | 851 | { | ||
856 | return event->time;; | 852 | return event->time;; | ||
857 | } | 853 | } | ||
858 | 854 | | |||
859 | uint64_t libinput_event_switch_get_time_usec(struct libinput_event_switch *event) | 855 | uint64_t libinput_event_switch_get_time_usec(struct libinput_event_switch *event) | ||
860 | { | 856 | { | ||
861 | return event->timeMicroseconds; | 857 | return event->timeMicroseconds; | ||
862 | } | 858 | } | ||
863 | | ||||
864 | #endif | |