<div dir="ltr"><div><div><div><div>Hi,<br><br>I would recommend to also include the name of the interface, where the enum is defined, in the enum attribute, e.g:<br>      <<span>arg</span> <span>name</span>=<span><span>"</span>format<span>"</span></span> <span>type</span>=<span><span>"</span>uint<span>"</span></span> <span>enum</span>=<span><span>"</span>wl_shm.format<span>"</span></span>/><br><br></div>Also, I think you forgot some enum attributes, e.g. <span>wl_shm_pool::</span><span><span></span>create_buffer<span>::</span></span><span><span></span>format<span> is the </span></span><span>wl_shm::format enum, but I can't find it in your patch (I can't seem to find the e-mail with your second patch, though).<br></span></div><div><span>You might want to compare with my XML file:<br><a href="https://github.com/NilsBrause/waylandpp/blob/master/scanner/wayland.xml" target="_blank">https://github.com/NilsBrause/waylandpp/blob/master/scanner/wayland.xml</a><br></span></div><div><span><br></span></div><span>Apart from that, I like it for obvious reasons. :)<br><br></span></div><span>Cheers,<br></span></div><span>Nils<br></span><div><div><div><div><br><br>On 23 Apr 2015 04:41, "Bill Spitzak" <<a href="mailto:spitzak@gmail.com" target="_blank">spitzak@gmail.com</a>> wrote:<br>><br>> This improvement to the protocol allows you to refer to the kind of enum you are expecting.<br>> It also introduces a distinction between enums that are bitfields, ie<br>> that can be OR'ed together.<br>> ---<br>>  protocol/wayland.dtd |    2 ++<br>>  protocol/wayland.xml |   32 ++++++++++++++++----------------<br>>  2 files changed, 18 insertions(+), 16 deletions(-)<br>><br>> diff --git a/protocol/wayland.dtd b/protocol/wayland.dtd<br>> index b8b1573..3b67ca8 100644<br>> --- a/protocol/wayland.dtd<br>> +++ b/protocol/wayland.dtd<br>> @@ -14,6 +14,7 @@<br>>  <!ELEMENT enum (description?,entry*)><br>>    <!ATTLIST enum name CDATA #REQUIRED><br>>    <!ATTLIST enum since CDATA #IMPLIED><br>> +  <!ATTLIST enum bitfield CDATA #IMPLIED><br>>  <!ELEMENT entry (description?)><br>>    <!ATTLIST entry name CDATA #REQUIRED><br>>    <!ATTLIST entry value CDATA #REQUIRED><br>> @@ -25,5 +26,6 @@<br>>    <!ATTLIST arg summary CDATA #IMPLIED><br>>    <!ATTLIST arg interface CDATA #IMPLIED><br>>    <!ATTLIST arg allow-null CDATA #IMPLIED><br>> +  <!ATTLIST arg enum CDATA #IMPLIED><br>>  <!ELEMENT description (#PCDATA)><br>>    <!ATTLIST description summary CDATA #REQUIRED><br>> diff --git a/protocol/wayland.xml b/protocol/wayland.xml<br>> index f52677f..2b9efa1 100644<br>> --- a/protocol/wayland.xml<br>> +++ b/protocol/wayland.xml<br>> @@ -367,7 +367,7 @@<br>>         can be used for buffers. Known formats include<br>>         argb8888 and xrgb8888.<br>>        </description><br>> -      <arg name="format" type="uint"/><br>> +      <arg name="format" type="uint" enum="format"/><br>>      </event><br>>    </interface><br>><br>> @@ -774,7 +774,7 @@<br>>        </description><br>>        <arg name="seat" type="object" interface="wl_seat" summary="the wl_seat whose pointer is used"/><br>>        <arg name="serial" type="uint" summary="serial of the implicit grab on the pointer"/><br>> -      <arg name="edges" type="uint" summary="which edge or corner is being dragged"/><br>> +      <arg name="edges" type="uint" summary="which edge or corner is being dragged" enum="resize"/><br>>      </request><br>><br>>      <request name="set_toplevel"><br>> @@ -785,7 +785,7 @@<br>>        </description><br>>      </request><br>><br>> -    <enum name="transient"><br>> +    <enum name="transient" bitfield="true"><br>>        <description summary="details of transient behaviour"><br>>         These flags specify details of the expected behaviour<br>>         of transient surfaces. Used in the set_transient request.<br>> @@ -807,7 +807,7 @@<br>>        <arg name="parent" type="object" interface="wl_surface"/><br>>        <arg name="x" type="int"/><br>>        <arg name="y" type="int"/><br>> -      <arg name="flags" type="uint"/><br>> +      <arg name="flags" type="uint" enum="transient"/><br>>      </request><br>><br>>      <enum name="fullscreen_method"><br>> @@ -891,7 +891,7 @@<br>>        <arg name="parent" type="object" interface="wl_surface"/><br>>        <arg name="x" type="int"/><br>>        <arg name="y" type="int"/><br>> -      <arg name="flags" type="uint"/><br>> +      <arg name="flags" type="uint" enum="transient"/><br>>      </request><br>><br>>      <request name="set_maximized"><br>> @@ -972,7 +972,7 @@<br>>         in surface local coordinates.<br>>        </description><br>><br>> -      <arg name="edges" type="uint"/><br>> +      <arg name="edges" type="uint" enum="resize"/><br>>        <arg name="width" type="int"/><br>>        <arg name="height" type="int"/><br>>      </event><br>> @@ -1337,7 +1337,7 @@<br>>        maintains a keyboard focus and a pointer focus.<br>>      </description><br>><br>> -    <enum name="capability"><br>> +    <enum name="capability" bitfield="true"><br>>        <description summary="seat capability bitmask"><br>>          This is a bitmask of capabilities this seat has; if a member is<br>>          set, then it is present on the seat.<br>> @@ -1353,7 +1353,7 @@<br>>         keyboard or touch capabilities.  The argument is a capability<br>>         enum containing the complete set of capabilities this seat has.<br>>        </description><br>> -      <arg name="capabilities" type="uint"/><br>> +      <arg name="capabilities" type="uint" enum="capability"/><br>>      </event><br>><br>>      <request name="get_pointer"><br>> @@ -1521,7 +1521,7 @@<br>>        <arg name="serial" type="uint"/><br>>        <arg name="time" type="uint" summary="timestamp with millisecond granularity"/><br>>        <arg name="button" type="uint"/><br>> -      <arg name="state" type="uint"/><br>> +      <arg name="state" type="uint" enum="button_state"/><br>>      </event><br>><br>>      <enum name="axis"><br>> @@ -1553,7 +1553,7 @@<br>>        </description><br>><br>>        <arg name="time" type="uint" summary="timestamp with millisecond granularity"/><br>> -      <arg name="axis" type="uint"/><br>> +      <arg name="axis" type="uint" enum="axis"/><br>>        <arg name="value" type="fixed"/><br>>      </event><br>><br>> @@ -1593,7 +1593,7 @@<br>>         This event provides a file descriptor to the client which can be<br>>         memory-mapped to provide a keyboard mapping description.<br>>        </description><br>> -      <arg name="format" type="uint"/><br>> +      <arg name="format" type="uint" enum="keymap_format"/><br>>        <arg name="fd" type="fd"/><br>>        <arg name="size" type="uint"/><br>>      </event><br>> @@ -1638,7 +1638,7 @@<br>>        <arg name="serial" type="uint"/><br>>        <arg name="time" type="uint" summary="timestamp with millisecond granularity"/><br>>        <arg name="key" type="uint"/><br>> -      <arg name="state" type="uint"/><br>> +      <arg name="state" type="uint" enum="key_state"/><br>>      </event><br>><br>>      <event name="modifiers"><br>> @@ -1819,17 +1819,17 @@<br>>            summary="width in millimeters of the output"/><br>>        <arg name="physical_height" type="int"<br>>            summary="height in millimeters of the output"/><br>> -      <arg name="subpixel" type="int"<br>> +      <arg name="subpixel" type="int" enum="subpixel"<br>>            summary="subpixel orientation of the output"/><br>>        <arg name="make" type="string"<br>>            summary="textual description of the manufacturer"/><br>>        <arg name="model" type="string"<br>>            summary="textual description of the model"/><br>> -      <arg name="transform" type="int"<br>> +      <arg name="transform" type="int" enum="transform"<br>>            summary="transform that maps framebuffer to output"/><br>>      </event><br>><br>> -    <enum name="mode"><br>> +    <enum name="mode" bitfield="true"><br>>        <description summary="mode information"><br>>         These flags describe properties of an output mode.<br>>         They are used in the flags bitfield of the mode event.<br>> @@ -1856,7 +1856,7 @@<br>>          the output may be scaled, as described in wl_output.scale,<br>>          or transformed , as described in wl_output.transform.<br>>        </description><br>> -      <arg name="flags" type="uint" summary="bitfield of mode flags"/><br>> +      <arg name="flags" type="uint" summary="bitfield of mode flags" enum="mode"/><br>>        <arg name="width" type="int" summary="width of the mode in hardware units"/><br>>        <arg name="height" type="int" summary="height of the mode in hardware units"/><br>>        <arg name="refresh" type="int" summary="vertical refresh rate in mHz"/><br>> --<br>> 1.7.9.5<br>><br>> _______________________________________________<br>> wayland-devel mailing list<br>> <a href="mailto:wayland-devel@lists.freedesktop.org" target="_blank">wayland-devel@lists.freedesktop.org</a><br>> <a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a></div></div></div></div></div>