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

Bryce Harrington bryce at osg.samsung.com
Mon May 18 19:23:20 PDT 2015


On Sat, May 02, 2015 at 11:52:22PM +0200, Auke Booij wrote:
> 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?

Actual patch emails are preferred, since our tooling (patchwork and
phabricator) only know to identify patches here on the list.
 
> 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?

Thanks for following up.

I went through the earlier discussion, and my take is that there were
some strong opinions but it sounds like it resulted in a consensus.  It
looks to me like your patch implements this consensus, but to be 100%
certain it would be good to see thumbs-up by pekka, jeroen, and others
that participated in that thread.

It also needs to be documented, at least in
wayland/doc/publican/sources/Protocol.xml, and possibly other places
where types are discussed.

Since we're only a couple weeks out from a release, and since this
obviously is a non-trivial change to the API, I'd be most comfortable if
we held this until 1.9 opens, and land it then; that would give us
maximum time to test this.

(Speaking of testing, it would be Really Nice to have a test for the
scanner.)

Bryce


More information about the wayland-devel mailing list