Enums, bitfields and wl_arrays in the .xml file

Victor Berger victor.berger at m4x.org
Thu Sep 17 08:00:45 PDT 2015


Hi,

I would like to revive a previous discussion that apparently died a few 
months ago on this mailing-list: the question of adding information 
specifying when a (u)int argument in a message is supposed to be a value 
of an enum, and which is the associated enum, as well a specifying when 
an enum should be treated as a bitfield.

(see 
http://lists.freedesktop.org/archives/wayland-devel/2015-June/023008.html 
)

I'm in the process of writing a generator for wayland bindings for the 
Rust language, and such information would be a huge help to provide a 
safer interface.

On the same vein, I'm also having some issues with the wl_array type. To 
my understanding, it is itself a plain byte array. But can actually 
contain an arbitrary type. For example the array provided by the 
wl_keyboard::enter event is actually an array of keycodes, and as such 
of ints or uints (not sure about that). However this is never specified 
in the .xml protocol file.

Wouldn't it be appropriate to add this information in the file ? Maybe 
something like:

     <arg name="keys" type="array" summary="the currently pressed keys" 
content="uint"/>

I believe such an addition would be as backward-compatible as the 
previously suggested change about enums and bitfields.

Thanks,
Victor Berger



More information about the wayland-devel mailing list