Commit graph

61 commits

Author SHA1 Message Date
Peter Hutterer
f4f6dabbe2 proto: fix references to ei_handshake.interface_version 2023-03-07 18:58:58 +10:00
Peter Hutterer
3b30c38a39 protocol: more protocol documentation 2023-03-07 15:26:36 +10:00
Peter Hutterer
442ce1edb8 proto: give a rough protocol overview as part of the docs 2023-03-07 11:33:35 +10:00
Peter Hutterer
4a3efa913a proto: more documentation improvements 2023-03-07 11:33:31 +10:00
Peter Hutterer
ebd7d102cd proto: clarify that the ei_seat capabilities depend on ei_device
Regardless of the ei_seat version, ei_seat.bind will support all
capablities of the negotiated ei_device interface. This means we don't need
to bump ei_seat just to add a new capability to ei_device.
2023-03-06 14:57:18 +10:00
Peter Hutterer
ea3ada1a80 proto: make the documentation an extractable set of XML tags
Instead of hiding this in a XML comment, let's make it a proper set of
tags so we can extract it and use it in generated documentation.
2023-03-03 11:38:40 +10:00
Peter Hutterer
70e2a9fbc2 protocol: fix two cross-references 2023-03-03 11:27:01 +10:00
Peter Hutterer
086f96a702 proto: split up message length and opcode again
Now that we have 64 bit integers on the wire and 64 bit object IDs,
we're already different to the Wayland protocol. So we might as well get
the full length and split message length and opcode again to make header
parsing and composing simpler.

This effectively reverts commit bf45a7182cb2f4c13f11e141fc846244d3ac6212.
2023-03-03 11:27:01 +10:00
Peter Hutterer
ba51f434a6 proto: switch object ids to 64 bits 2023-03-03 11:27:01 +10:00
Peter Hutterer
c832ce3ddc protocol: split the handshake version negotiation from the other interfaces
Previously, we'd send one interface_version event for "ei_handshake"
immediately but all others after the client requests handshake.finish.
This was too confusing to document and not clear how it would work, so
let's make this simpler by splitting it up.

There is now a handshake_version event from the server, sent immediately
on connection that denotes the maximum version number for the interface.
And a handshake_version request from the client which must be the first
one by the client.
2023-03-03 11:27:01 +10:00
Peter Hutterer
5d7f6ab188 protocol: more clarifications 2023-03-03 11:27:01 +10:00
Peter Hutterer
35f5fa102c proto: rename ei_connection_setup to ei_handshake
This is a better name for the initial handshake and easier to
distinguish from the ei_connection this way too.

Suggested by Jonas Ådahl.
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
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
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
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
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
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
b5805c3e8a protocol: improve a comment 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
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
dd5bc6b6e7 proto: add a bunch of error reasons for debugging 2023-03-03 11:22:09 +10:00
Peter Hutterer
5ee9f738a8 proto: document what a "protocol violation" means 2023-03-03 11:21:26 +10:00
Peter Hutterer
027f85e195 proto: switch connection_setup.version to mirror interface_version requests
For most interfaces, the client announcing its supported version is
sufficient - the objects are all created server-side. For some
interfaces (ei_connection_setup and ei_callback right now) the client
needs to know the server-supported version.

So let's switch the current ei_connection_setup.version event (used to
negotiate ei_connection_setup's version) to a generic
`interface_version` event. This way our EIS implementation can
eventually send a version for ei_callback as well.
2023-03-03 11:21:26 +10:00
Peter Hutterer
6ed610e30e Split the ping/pong request into its own interface
Leave the ei_callback as-is and instead add ei_pingpong for the same
thing initiated by the server. The interface is otherwise identical but
for the direction it is supposed to flow.

This reduces the possibility of a client accidentally sending a
request when it is supposed to handle an event or vice versa.
2023-03-03 11:21:26 +10:00
Peter Hutterer
f41cc91599 proto: add a ping/pong request
This is effectively the same as connection.sync, but goes the other way.
This adds the ei_callback.done request.

In libeis this is (currently) enforced immediately after sending the
connection object. Not required there and makes the code a bit messier
but this way we can ensure that any client library handles that part of
the code.
2023-03-03 11:21:26 +10:00
Peter Hutterer
50013b4b3c protocol: fix a typo 2023-03-03 11:21:26 +10:00
Peter Hutterer
8c85b8fc1f protocol: add ei_connection.invalid_object
This event is to notify the client that an object used in a request was
unknown. This allows the client to work around race conditions like
binding to a seat that was removed.

This is currently the server-side only which is probably enough for now.
The only client-side created objects we have are the callbacks.
2023-03-03 11:21:26 +10:00
Peter Hutterer
d84ddd51e5 protocol: complete documentation for the protocol XML file 2023-03-03 11:21:26 +10:00
Peter Hutterer
a590537c8a protocol: mark the various destroyed events as destructors 2023-03-03 11:21:26 +10:00
Peter Hutterer
0a8501d882 protocol: mark the disconnected event as destructor 2023-03-03 11:21:26 +10:00
Peter Hutterer
cfbb906358 protocol: rename type to context_type
type is a reserved keyword in many languages, let's not make this harder
to use than necessary
2023-03-03 11:21:26 +10:00
Peter Hutterer
bf77479c6a protocol: rename the interface request to interface_version
More descriptive this way
2023-03-03 11:21:26 +10:00
Peter Hutterer
21df02e499 protocol: add the "bitmask" enum type and check for it
Plus check for duplicate values in enums
2023-03-03 11:21:26 +10:00
Peter Hutterer
bde838fd1d protocol: rename the touch capability to touchscreen
This matches the interface name now, even though the public API right
now still uses TOUCH
2023-03-03 11:21:26 +10:00
Peter Hutterer
6721802059 protocol: require the "since" attribute for all messages
And generally improve the error message handling
2023-03-03 11:21:26 +10:00
Peter Hutterer
ebefdf903c protocol: document the protocol better 2023-03-03 11:21:26 +10:00
Peter Hutterer
0a347f433f protocol: make the connection setup the zero object with a proper handover
This changes the initial connection negotiation to have the
ei_connection_setup as the pre-existing object id 0. Once the client has
sent all the data to set up the connection, the EIS implementation
replies with a new object ID that is the ei_connection protocol object,
i.e. the main object.

This allows for version negotiation of our main protocol object.
2023-03-03 11:21:26 +10:00
Peter Hutterer
23433d3aff protocol: move the keymap into the keyboard interface 2023-03-03 11:21:26 +10:00
Peter Hutterer
4d9ca1796d protocol: move pointer/keyboard/touch into separate interfaces
This allows us to have a device support multiple interfaces and evolve
those interfaces individually, e.g. add things to the keyboard interface
without having to bump the touchscreen interface.

Note that due to a name clash with the existing struct ei_touch public
API the protocol interface is named touchscreen.
2023-03-03 11:21:26 +10:00