Lines Matching refs:sw

113 	enum libinput_switch sw = _i; /* ranged test */
118 litest_switch_action(dev, sw, LIBINPUT_SWITCH_STATE_ON);
121 if (libinput_device_switch_has_switch(dev->libinput_device, sw) > 0) {
123 litest_is_switch_event(event, sw, LIBINPUT_SWITCH_STATE_ON);
129 litest_switch_action(dev, sw, LIBINPUT_SWITCH_STATE_OFF);
132 if (libinput_device_switch_has_switch(dev->libinput_device, sw) > 0) {
134 litest_is_switch_event(event, sw, LIBINPUT_SWITCH_STATE_OFF);
148 enum libinput_switch sw = _i; /* ranged test */
150 if (libinput_device_switch_has_switch(dev->libinput_device, sw) <= 0)
156 litest_switch_action(dev, sw, LIBINPUT_SWITCH_STATE_ON);
160 litest_is_switch_event(event, sw, LIBINPUT_SWITCH_STATE_ON);
165 litest_switch_action(dev, sw, LIBINPUT_SWITCH_STATE_ON);
194 enum libinput_switch sw = _i; /* ranged test */
196 if (libinput_device_switch_has_switch(dev->libinput_device, sw) <= 0)
199 if (sw == LIBINPUT_SWITCH_LID && !lid_switch_is_reliable(dev))
203 litest_switch_action(dev, sw, LIBINPUT_SWITCH_STATE_ON);
214 litest_is_switch_event(event, sw, LIBINPUT_SWITCH_STATE_ON);
223 litest_switch_action(dev, sw, LIBINPUT_SWITCH_STATE_OFF);
226 litest_is_switch_event(event, sw, LIBINPUT_SWITCH_STATE_OFF);
239 enum libinput_switch sw = LIBINPUT_SWITCH_LID;
241 if (libinput_device_switch_has_switch(dev->libinput_device, sw) <= 0)
244 if (sw == LIBINPUT_SWITCH_LID && lid_switch_is_reliable(dev))
248 litest_switch_action(dev, sw, LIBINPUT_SWITCH_STATE_ON);
263 litest_switch_action(dev, sw, LIBINPUT_SWITCH_STATE_OFF);
279 struct litest_device *sw = litest_current_device();
281 struct libinput *li = sw->libinput;
284 if (libinput_device_switch_has_switch(sw->libinput_device, which) <= 0)
292 litest_grab_device(sw);
295 litest_switch_action(sw, which, LIBINPUT_SWITCH_STATE_ON);
304 litest_switch_action(sw, which, LIBINPUT_SWITCH_STATE_OFF);
313 litest_ungrab_device(sw);
319 struct litest_device *sw = litest_current_device();
321 struct libinput *li = sw->libinput;
324 if (libinput_device_switch_has_switch(sw->libinput_device, which) <= 0)
336 litest_grab_device(sw);
337 litest_switch_action(sw, which, LIBINPUT_SWITCH_STATE_ON);
339 litest_ungrab_device(sw);
351 struct litest_device *sw = litest_current_device();
353 struct libinput *li = sw->libinput;
356 if (libinput_device_switch_has_switch(sw->libinput_device, which) <= 0)
364 litest_grab_device(sw);
365 litest_switch_action(sw, which, LIBINPUT_SWITCH_STATE_ON);
367 litest_ungrab_device(sw);
390 struct litest_device *sw = litest_current_device();
392 struct libinput *li = sw->libinput;
396 if (libinput_device_switch_has_switch(sw->libinput_device, which) <= 0)
411 litest_grab_device(sw);
412 litest_switch_action(sw, which, LIBINPUT_SWITCH_STATE_ON);
413 litest_ungrab_device(sw);
431 struct litest_device *sw = litest_current_device();
433 struct libinput *li = sw->libinput;
436 if (libinput_device_switch_has_switch(sw->libinput_device, which) <= 0)
452 litest_switch_action(sw, which, LIBINPUT_SWITCH_STATE_OFF);
466 struct litest_device *sw = litest_current_device();
468 struct libinput *li = sw->libinput;
471 if (libinput_device_switch_has_switch(sw->libinput_device, which) <= 0)
482 litest_grab_device(sw);
483 litest_switch_action(sw, which, LIBINPUT_SWITCH_STATE_ON);
484 litest_ungrab_device(sw);
493 litest_switch_action(sw, which, LIBINPUT_SWITCH_STATE_OFF);
507 struct litest_device *sw = litest_current_device();
509 struct libinput *li = sw->libinput;
512 if (libinput_device_switch_has_switch(sw->libinput_device, which) <= 0)
529 litest_grab_device(sw);
530 litest_switch_action(sw, which, LIBINPUT_SWITCH_STATE_ON);
531 litest_ungrab_device(sw);
540 litest_switch_action(sw, which, LIBINPUT_SWITCH_STATE_OFF);
555 struct litest_device *sw = litest_current_device();
557 struct libinput *li = sw->libinput;
560 if (!switch_has_lid(sw))
565 litest_grab_device(sw);
567 litest_switch_action(sw,
586 litest_switch_action(sw,
591 litest_ungrab_device(sw);
599 struct litest_device *sw = litest_current_device();
601 struct libinput *li = sw->libinput;
603 if (!switch_has_lid(sw))
611 litest_grab_device(sw);
612 litest_switch_action(sw,
615 litest_ungrab_device(sw);
641 struct litest_device *sw;
648 sw = litest_add_device(li, LITEST_LID_SWITCH);
651 sw = litest_add_device(li, LITEST_THINKPAD_EXTRABUTTONS);
662 litest_grab_device(sw);
663 litest_switch_action(sw, which, LIBINPUT_SWITCH_STATE_ON);
665 litest_switch_action(sw, which, LIBINPUT_SWITCH_STATE_OFF);
667 litest_ungrab_device(sw);
672 litest_delete_device(sw);
682 struct litest_device *touchpad, *sw;
689 sw = litest_add_device(li, LITEST_LID_SWITCH);
692 sw = litest_add_device(li, LITEST_THINKPAD_EXTRABUTTONS);
703 litest_grab_device(sw);
704 litest_switch_action(sw, which, LIBINPUT_SWITCH_STATE_ON);
706 litest_switch_action(sw, which, LIBINPUT_SWITCH_STATE_OFF);
708 litest_ungrab_device(sw);
710 litest_delete_device(sw);
721 struct litest_device *sw = litest_current_device();
722 struct libinput *li = sw->libinput;
729 if (!switch_has_lid(sw))
734 litest_grab_device(sw);
735 litest_switch_action(sw,
739 litest_ungrab_device(sw);
743 fd = open(libevdev_uinput_get_devnode(sw->uinput), O_RDONLY|O_NONBLOCK);
776 struct litest_device *sw = litest_current_device();
779 struct libevdev *evdev = sw->evdev;
784 litest_grab_device(sw);
785 litest_switch_action(sw,
788 litest_ungrab_device(sw);
792 fd = open(libevdev_uinput_get_devnode(sw->uinput), O_RDONLY|O_NONBLOCK);
797 keyboard = litest_add_device(sw->libinput, LITEST_KEYBOARD);
802 libevdev_uinput_get_devnode(sw->uinput));
844 struct litest_device *sw = litest_current_device();
845 struct libinput *li = sw->libinput;
847 struct libevdev *evdev = sw->evdev;
852 if (!switch_has_lid(sw))
862 litest_grab_device(sw);
863 litest_switch_action(sw,
867 litest_ungrab_device(sw);
871 fd = open(libevdev_uinput_get_devnode(sw->uinput), O_RDONLY|O_NONBLOCK);
905 struct litest_device *sw = litest_current_device();
906 struct libinput *li = sw->libinput;
910 litest_keyboard_key(sw, KEY_VOLUMEUP, true);
911 litest_keyboard_key(sw, KEY_VOLUMEUP, false);
921 struct litest_device *sw = litest_current_device();
923 struct libinput *li = sw->libinput;
925 if (!switch_has_tablet_mode(sw))
928 litest_grab_device(sw);
929 litest_switch_action(sw,
945 litest_switch_action(sw,
954 litest_ungrab_device(sw);
962 struct litest_device *sw = litest_current_device();
964 struct libinput *li = sw->libinput;
968 if (!switch_has_tablet_mode(sw))
977 litest_switch_action(sw,
1010 litest_switch_action(sw,
1031 struct litest_device *sw = litest_current_device();
1033 struct libinput *li = sw->libinput;
1036 if (!switch_has_tablet_mode(sw))
1043 litest_switch_action(sw,
1049 litest_switch_action(sw,
1067 litest_switch_action(sw,
1088 struct litest_device *sw = litest_current_device();
1090 struct libinput *li = sw->libinput;
1092 if (!switch_has_tablet_mode(sw))
1107 litest_switch_action(sw,
1121 litest_switch_action(sw,
1141 struct litest_device *sw = litest_current_device();
1143 struct libinput *li = sw->libinput;
1145 if (!switch_has_tablet_mode(sw))
1148 litest_switch_action(sw,
1161 litest_switch_action(sw,
1176 struct litest_device *sw = litest_current_device();
1178 struct libinput *li = sw->libinput;
1182 if (!switch_has_tablet_mode(sw))
1192 libevdev_grab(sw->evdev, LIBEVDEV_GRAB);
1193 litest_switch_action(sw,
1196 libevdev_grab(sw->evdev, LIBEVDEV_UNGRAB);
1227 litest_grab_device(sw);
1228 litest_switch_action(sw,
1231 litest_ungrab_device(sw);
1244 struct litest_device *sw = litest_current_device();
1246 struct libinput *li = sw->libinput;
1248 if (!switch_has_tablet_mode(sw))
1252 litest_grab_device(sw);
1253 litest_switch_action(sw,
1257 litest_ungrab_device(sw);
1261 litest_switch_action(sw,
1273 litest_switch_action(sw,
1288 struct litest_device *sw = litest_current_device();
1290 struct libinput *li = sw->libinput;
1292 if (!switch_has_tablet_mode(sw))
1304 litest_grab_device(sw);
1305 litest_switch_action(sw,
1316 litest_switch_action(sw,
1326 litest_ungrab_device(sw);
1334 struct litest_device *sw = litest_current_device();
1336 struct libinput *li = sw->libinput;
1338 if (!switch_has_tablet_mode(sw))
1341 litest_grab_device(sw);
1342 litest_switch_action(sw,
1357 litest_switch_action(sw,
1367 litest_ungrab_device(sw);
1375 struct litest_device *sw = litest_current_device();
1376 struct libinput *li = sw->libinput;
1378 if (!libevdev_has_event_code(sw->evdev, EV_SW, SW_DOCK))
1383 litest_grab_device(sw);
1384 litest_event(sw, EV_SW, SW_DOCK, 1);
1387 litest_event(sw, EV_SW, SW_DOCK, 0);
1389 litest_ungrab_device(sw);