Enums, bitfields and wl_arrays in the .xml file

Nils Chr. Brause nilschrbrause at gmail.com
Fri Sep 18 05:37:08 PDT 2015


There are even earlier discussions about including 'bitfield' and
'enum' fields into the XML protocol file, e.g:
But none of them led to any actual changes.

I still would very much like to see the 'bitfield' and 'enum' fields
to be included in the XML protocol file. This would greatly simplify
the creation of Wayland bindings for most high level programming
languages and thus increase the popularity of Wayland amongst
programmers who don't wish to use toolkits.
Without these information about bitfields and enumerations, language
bindings would have to maintain their own version of the XML protocol
file, like I am doing with my C++ bindings here:

Adding content information to the 'array' type is also a good idea in
my humble opinion.


On Thu, Sep 17, 2015 at 5:00 PM, Victor Berger <victor.berger at m4x.org> wrote:
> 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
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel

More information about the wayland-devel mailing list