libei/test
Peter Hutterer a902d5dbd8 protocol: replace the capabilities enum with an interface list
Previously we had ei_seat.capabilities and ei_device.capabilities,
both referring to the same enum. The seat caps were used to bind,
the device caps were used to announce capabilities.

The device caps were already mostly superfluous as the information
they carried was implicitly available by the set of interfaces
the device announced - if the device has a keyboard interface
it must also have the keyboard capability.

So let's drop the separate enum and make the capabilities
the set of supported interfaces. In the device we can drop the
event directly and just send the interface list. In the seat
we have a capability event that sends each *possible* interface
with a custom-assigned mask. The client can then use that mask
to bind to the capability as before.

For example:
   <- ei_seat.capability(0x1, "ei_pointer")
   <- ei_seat.capability(0x4, "ei_keyboard")
   <- ei_seat.capability(0x8, "ei_touchscreen")
   <- ei_seat.done()
   -> ei_seat.bind(0x4 | 0x8)  # bind to keyboard and touchscreen
   <- ei_seat.device()
   -> ei_device.interface("ei_keyboard")
   -> ei_device.interface("ei_touchscreen")
   <- ei_device.done()

In the generated bindings we simply use the interface index
to generate the masks, but the protocol at least states that
the mask may not be constant.

Because the button/scroll interfaces are not exposed by the C API, some
of the handling is a bit awkward since we need to use both depending
whether we have pointer/pointer_absolute selected.

Fixes #28

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-05-02 05:53:25 +00:00
..
templates test: drop a bunch of unused imports 2023-02-15 08:20:01 +10:00
buildtest.c Purge libreis from the repo 2023-02-09 11:48:28 +10:00
buildtest.cc Add C++ header guards 2020-09-29 17:30:49 +10:00
conftest.py test: run pytest with xdist where available 2023-03-03 11:27:01 +10:00
eierpecken.c test: fix a debug log typo 2023-04-27 15:22:07 +10:00
eierpecken.h Add a sequence number to START_EMULATING 2023-02-09 11:48:29 +10:00
eiproto.py.tmpl protocol: replace the capabilities enum with an interface list 2023-05-02 05:53:25 +00:00
meson.build scanner: add the protocol name so we can compile some #defines 2023-04-06 13:57:20 +10:00
test-ei-device.c config: Make memfd_create optional 2023-03-28 11:24:06 +00:00
test-ei-seat.c Remove empty trailing newlines from all files 2023-03-13 08:52:08 +10:00
test-ei.c Purge the properties from the protocol 2023-02-09 11:48:29 +10:00
test-eis.c Remove the public API to query the client version number 2023-02-13 13:55:44 +10:00
test-main.c Remove empty trailing newlines from all files 2023-03-13 08:52:08 +10:00
test_oeffis.py test: if we fail to load liboeffis.so, skip the rest of the pytests 2023-04-06 12:04:51 +10:00
test_protocol.py protocol: replace the capabilities enum with an interface list 2023-05-02 05:53:25 +00:00
unit-tests.c Add SPDX identifiers to all source files 2022-03-03 00:27:36 +00:00