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

Bill Spitzak spitzak at gmail.com
Thu Apr 23 11:58:37 PDT 2015



On 04/23/2015 11:28 AM, Jeroen Bollen wrote:
>  > Using enum="interfacename.enumname" would probably work. The
>  > "interfacename." is optional if you are describing a method on the same
>  > interface. Another possibility is to just add interface="interfacename"
>  > to the argument along with enum="enumname".
>
> The second possibility wouldn't work for bitfields that take enums from
> different interfaces.

I didn't think that would be allowed. The bitmap arg can only or 
together a set of values from a single enumeration.

>  > An even more drastic approach would be to put all the values in the same
>  > namespace as interfaces, again renaming (or perhaps changing the values)
>  > as necessary. This would allow the programmer to write
>  > Widget.setAlignment(Left). It would also match how enums in C work.
>
> Putting enums next to interfaces, instead of inside of them, to me, also
> seems like the best option. I don't think it'll get any support however,
> as it isn't backwards compatible.

Maybe it could be added, ie you can make global enumerations as well as 
local enumerations. Local ones are still useful for the error values. 
Some sort of aliasing could be used to migrate other local enumerations 
to global without breaking any existing code.


More information about the wayland-devel mailing list