Peter Hutterer
2aaf7acdfc
test: fix a ruff warning - f-string without placeholder
2023-03-03 11:27:01 +10:00
Peter Hutterer
705c5d79ac
test: remove unused python import
2023-03-03 11:27:01 +10:00
Peter Hutterer
38dc5dc72f
proto: shift the capabilities down by one
...
These were previously (1 << cap) for convenience but that results in the
capability mask on the wire starting at 2 - which is a bit awkward.
Lets shift them down by one so we start the mask at 1.
2023-03-03 11:27:01 +10:00
Peter Hutterer
ae8faa9fbb
proto: improve the documentation
...
After some feedback from Jonas Ådahl and Julan Orth.
2023-03-03 11:27:01 +10:00
Peter Hutterer
11fb722e63
proto: fix wrong references to ei_callback in the pingpong interface
2023-03-03 11:27:01 +10:00
Peter Hutterer
47467bfe0e
proto: rename connection_setup.done to .finish
...
Avoids ambiguity with the .done events from e.g. the seat or the device.
2023-03-03 11:27:01 +10:00
Peter Hutterer
0897722493
proto: drop the seat caps and cross-reference device caps instead
2023-03-03 11:27:01 +10:00
Peter Hutterer
1db37c33d5
scanner: allow for cross-referencing enums
...
Add another run to the XML parser so we parse enums before Arguments
that cross-reference enums from other interfaces.
This also fixes a type bug - the enum name string was passed to
Argument.create() as Enum and no-one noticed.
2023-03-03 11:27:01 +10:00
Jonas Ådahl
eecf69af48
protocol: Make timestamps a single 64 bit argument
...
With 64 bit integers on the wire, we don't need to split timestamps in
milliseconds and microsecond parts.
2023-03-03 11:27:01 +10:00
Jonas Ådahl
03c0ab73dd
protocol: Add support for 64 bit integers on the wire
...
This is useful for e.g. not having to split timestamps.
2023-03-03 11:27:01 +10:00
Jonas Ådahl
e4f23f69fc
demos: Print timestamp
2023-03-03 11:27:01 +10:00
Jonas Ådahl
cad5bc81bb
protocol: Make integer explicitly sized
...
This means 'int' is explicitly 'int32' and 'uint' is explicitly
'uint32' in the protocol XML files.
2023-03-03 11:27:01 +10:00
Peter Hutterer
312ce6723b
CI: run pytest as separate job
...
Because we currently only run the test suite in valgrind, we skip the
python test suite there (we don't want to valgrind python itself, too
messy).
Fix this by specifically excluding the python test suite and having a
separate job that just runs that suite instead.
And because the protocol test suite needs the directory to the
eis-demo-server and isn't smart enough to split spaces correctly, let's
change the builddir to just that.
2023-03-03 11:27:01 +10:00
Peter Hutterer
3fa396c012
test: add a framework for doing protocol tests directly
...
This tests the protocol layer which is hard to test using libei/libeis.
Similar to the generated C bindings we compile a eiproto.py file that is
then used in the test to talk protocol directly to the eis-demo-server
that we start up.
By sending the specific messages and checking things happen as we expect
on the socket we can verify that the EIS implementation is correct (and
robust enough).
In theory this could also be used to test some other binary with an EIS
implementation and the scaffolding is there to set LIBEI_TEST_SERVER to
that binary. Wether this works is untested though...
2023-03-03 11:27:01 +10:00
Peter Hutterer
d319c3a725
protocol: rename "type" arguments and events
...
Type is a reserved keyword in many languages, let's make this easier for
those.
2023-03-03 11:27:01 +10:00
Peter Hutterer
658a861c2a
proto: add a serial number to the modifiers event
2023-03-03 11:27:01 +10:00
Peter Hutterer
36a3fd0166
meson: hook up a dtd check via xmllint
2023-03-03 11:27:01 +10:00
Peter Hutterer
b7ac763241
protocol: change type=bitmask to use the wayland protocol's bitfield=true
2023-03-03 11:27:01 +10:00
Peter Hutterer
5c860507e5
protocol: more explanations
2023-03-03 11:27:01 +10:00
Peter Hutterer
2227690287
scanner: parse the copyright tag
2023-03-03 11:27:01 +10:00
Peter Hutterer
8692e2592a
scanner: use the proper SAXException class
...
The one we get is an internal subclass, let's not do that.
2023-03-03 11:27:01 +10:00
Peter Hutterer
7ad74b9886
scanner: fix mypy errors
2023-03-03 11:27:01 +10:00
Peter Hutterer
5f69ee2417
proto: switch to use the Wayland message header
...
No real functional changes, this just changes the message header to be
header = [object_id, msglen << 16 | opcode].
The only difference to the wayland protocol is now the fixed vs float
but otherwise tools that can print/debug/mangle the wayland protocol
should be easily adjustable for this protocol too..
2023-03-03 11:27:01 +10:00
Peter Hutterer
30b9fec787
util: add iobuf_prepend()
2023-03-03 11:27:01 +10:00
Peter Hutterer
b5805c3e8a
protocol: improve a comment
2023-03-03 11:27:01 +10:00
Peter Hutterer
e5948856bf
CI: explicitly add the ei-scanner to the Python Black run
...
Without the file ending in .py, it won't be checked anymore.
2023-03-03 11:27:01 +10:00
Peter Hutterer
e592a3d85a
scanner: fix a few black complaints
2023-03-03 11:27:01 +10:00
Peter Hutterer
c8986b88ba
scanner: parse the descriptions as well
2023-03-03 11:27:01 +10:00
Peter Hutterer
164b2c0c00
doc: add generated BREI documentation
2023-03-03 11:27:01 +10:00
Peter Hutterer
e5b37dedc8
protocol: add serial numbers to the various destroy events
...
This should allow EIS to track whether events that were sent before or
after a destruction of a resource.
2023-03-03 11:27:01 +10:00
Peter Hutterer
cebf4ce048
protocol: correct some comments
2023-03-03 11:27:01 +10:00
Peter Hutterer
cc0a06aed6
scanner: rename to as_c_arg and c_type for the c-specific functions
2023-03-03 11:27:01 +10:00
Peter Hutterer
4293f2f040
scanner: factor out the protocol type mapping to be global
2023-03-03 11:27:01 +10:00
Peter Hutterer
5e6e4d8fc9
scanner: separate the parser from the actual protocol
...
Let's not leak anything related to XML parsing into the class
we use as the actual protocol description.
2023-03-03 11:27:01 +10:00
Peter Hutterer
4414c91fca
scanner: rename run to run_counter
2023-03-03 11:27:01 +10:00
Peter Hutterer
3499d26300
scanner: slightly clean up the XML error handling
...
Slight improvement in the code, nothing more.
2023-03-03 11:27:01 +10:00
Peter Hutterer
381bc9222a
scanner: don't allow incoming/outgoing for modes other than ei/eis
...
We support mode "brei" now but that doesn't have a definition of incoming or
outgoing.
2023-03-03 11:27:01 +10:00
Peter Hutterer
0e70d06706
scanner: comments and some more type annotations
2023-03-03 11:27:01 +10:00
Peter Hutterer
72c570e096
scanner: pass the Enum to the Entry class
...
So we can compose the fqdn (and possibly do value checks and whatnot)
2023-03-03 11:27:01 +10:00
Peter Hutterer
1c9ce9b680
Add serial numbers to the protocol
...
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-03-03 11:27:01 +10:00
Peter Hutterer
845f990883
protocol: change the context type enum to start at 1
...
This avoids future bugs for treating this as a boolean field.
2023-03-03 11:27:01 +10:00
Peter Hutterer
30c4b8d528
protocol: a few more minor comments
2023-03-03 11:27:01 +10:00
Peter Hutterer
403e40597d
Replace remaining errno-based errors to proper brei_results
2023-03-03 11:27:01 +10:00
Peter Hutterer
a6565fd86b
brei: change the various errors to PROTOCOL
2023-03-03 11:27:01 +10:00
Peter Hutterer
cc7a8cb95e
ei: make more ei_queue* functions semi-public for consistency
...
And drop the ei_add_seat() indirection.
2023-03-03 11:27:01 +10:00
Peter Hutterer
03d7f96ddd
eis: remove some indirection from the device event handling
...
Now that we only have one nice hook as entry point for those events,
let's move (and harden) the code there.
2023-03-03 11:26:51 +10:00
Peter Hutterer
876e4044ab
eis: error out if we're in the wrong state to start/stop emulating
2023-03-03 11:22:09 +10:00
Peter Hutterer
83b4902d9f
ei: error out if we're in the wrong device state for emulating
2023-03-03 11:22:09 +10:00
Peter Hutterer
d698ed2f75
ei: remove some indirection from device events
...
Now that we only have one nice hook as entry point for those events,
let's move (and harden) the code there.
2023-03-03 11:22:09 +10:00
Peter Hutterer
1846223991
eis: add eis_client_disconnect_with_reason
...
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-03-03 11:22:09 +10:00