[Wayland-bugs] [Bug 82127] New: Add enum attribute to arg element to allow type safe protocol generation for languages that support enum as a type.
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Mon Aug 4 04:52:05 PDT 2014
https://bugs.freedesktop.org/show_bug.cgi?id=82127
Priority: medium
Bug ID: 82127
Assignee: wayland-bugs at lists.freedesktop.org
Summary: Add enum attribute to arg element to allow type safe
protocol generation for languages that support enum as
a type.
Severity: enhancement
Classification: Unclassified
OS: All
Reporter: derijcke.erik at gmail.com
Hardware: Other
Status: NEW
Version: unspecified
Component: wayland
Product: Wayland
Note that this suggestion is not the same as the one proposed in bug 55534.
Currently the protocol defines enums but does not specify any means of
assigning those enums to arguments. The only way to deduce this is to read the
documentation and hope you get it right.
This is ok if you're programming in C.
However a lot of other languages have a separate enum type that allows for type
safe input of arguments that expect it. Unfortunately the wayland protocol xml
does not link arguments that expect an enum value to the respective enum,
making it impossible for these languages to fully facilitate their typesafe
nature.
I propose to add an "enum" attribute to a "arg" elements that expect an enum.
The value of the "enum" attribute will be the "name" value of the required
"enum" element. This way the current C generator will not be impacted while
allowing typesafe languages to use this extra piece of information.
example:
<enum name="error">
...
</enum>
<arg name="code" type="uint" enum="error"/>
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-bugs/attachments/20140804/a4a50459/attachment.html>
More information about the Wayland-bugs
mailing list