Peter Hutterer
eb9fa07c10
scanner: add a filter to escape ei protocol names
...
By default escape them with backticks for markdown
2023-03-03 11:39:03 +10:00
Peter Hutterer
2fb1ff70e3
scanner: allow '-' for loading a template from stdin
2023-03-03 11:39:03 +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
c350ac2ee3
src: pass the headerfile as jinja extra data
...
This removes another special handling of the C bindings from the
scanner.
2023-03-03 11:38:40 +10:00
Peter Hutterer
d127f02f0a
scanner: add ability to pass extra data to the jinja templates
...
This makes generation of files with the scanner a lot more flexible -
e.g. one can run the scanner with
--jinja-extra-data='{ "interface": "ei_connection"}'
and then in the jinja template use an if condition to match on this
interface.
2023-03-03 11:38:40 +10:00
Peter Hutterer
2fa7792a33
scanner: drop duplicate import
...
We already import dedent globally
2023-03-03 11:27:01 +10:00
Peter Hutterer
2550a0b54d
scanner: raise SystemExit instead of calling sys.exit
...
Bit nicer (no import sys required for that call) and that's what sys.exit
does that anyway.
2023-03-03 11:27:01 +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
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
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
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
b5805c3e8a
protocol: improve a comment
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
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
dd5bc6b6e7
proto: add a bunch of error reasons for debugging
2023-03-03 11:22:09 +10:00
Peter Hutterer
579f0d07d2
Add a brei-proto.h generated header file
...
This will be needed to have access to the various disconnect reasons in
brei-shared.c.
2023-03-03 11:21:26 +10:00
Peter Hutterer
8a52cbbe10
scanner: detect duplicates in the XML file
2023-03-03 11:21:26 +10:00