[PATCH wayland] Add "enum" attribute to "arg" elements

Auke Booij auke at tulcod.com
Sat May 2 14:52:22 PDT 2015


On 19 April 2015 at 14:51, Jeroen Bollen <jbinero at gmail.com> wrote:
> Hello,
>
> It seems like this discussion died off. Currently there is no way to tell,
> from the Wayland XML specification whether an argument is a bitfield, or
> whether the argument takes an enum and what enum this is.
>
> I am currently in the progress of writing a Wayland binding generator for
> the Rust language. This language, like many others is strongly typed. To
> make full usage of this type system, it would be beneficial to know from the
> specification whether an argument is a bitfield, and what enum type it
> takes.
>
> Surely there are more people who generate bindings to these strongly typed
> languages. How have you fixed the issue? Are there patched versions
> available, and maybe pending to be merged? I have looked around a bit, and
> didn't find anything, but then again, I'm not familiar with Wayland
> development. (This is the first time I use a mailing list!)
>
> Much appreciated,
> Jeroen Bollen
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
>

Based on the discussion I wrote two patches: one for the wayland.xml
(and wayland.dtd since the fact of the matter is that that file is
still there), and one for scanner.c

See 5dc0112f734d23d65a2bf9a78f11463d0294b6c7 and
b6d5659c650056f66267f3f20fdbaf724138a61b in [0].

Is this a good format for sending patches? Or are actual patch emails preferred?

The scanner.c code checks that the enum attribute of an <arg> is the
name of an <enum> in the same <interface>. In that case, it checks
that the type of the <arg> is an int or a uint, and if the <enum> had
bitfield set to "true", that the type was indeed uint.

If these properties are not satisfied, the scanner dies. Is that what
was expected?

Auke.

[0] https://github.com/tulcod/wayland/tree/enum-attribute


More information about the wayland-devel mailing list