[Xcb] [PATCH proto 1/7] xinput: Cleanup implementation of XI up to v1.4

Daniel Martin consume.noise at gmail.com
Tue Jan 15 23:33:44 PST 2013


- Structural changes:
  * indent with spaces only (replaced tabs)
  * indent attributes
  * move structures in front of the first request using it
    (Otherwise c_client.py would generate uncompileable code if we fix
     the uninterpreted lists.)
  * add version-controlled section comments (types, requests, events,
    errors) and move structures into their corresponding section
  * sort events and eventcopys by number

- Additions:
  * add various missing enums and structs (i.e. DeviceChange,
    DeviceControl, DeviceName, ...)
  * uncomment commented out requests
  * linked in various enums into fields (via enum or altenum)

- Other changes:
  * link to the txt specification in the git repo
  * fixed comments for "uninterpreted lists"

- API CHANGES:
  * Request: GetDeviceMotionEvents
    The reply contains a list of events (of coordinates). So, we rename
    num_coords to num_events. The field is called nevents_return in the
    specification. The list was commented out anyways, so the rename
    shouldn't affect that much.
  * Request: SendExtensionEvent
    The list 'events' is a mask, make it a CARD8 like every other mask.
  * Events: FocusIn/Out
    Those ones haven't been named properly. They are called
    DeviceFocusIn/Out in the specification. In XI2 the names FocusIn/Out
    are used to introduce new events and cause name clashes. So, we have
    to rename the existing FocusIn/Out and give them their proper names.
  * Structures: *Feedback{Ctl,State}
    Rename the field id to feedback_id, as it's called in the spec. The
    only lists using those structs are commented out yet. So, this might
    not be called an api break.

Signed-off-by: Daniel Martin <consume.noise at gmail.com>
---
 src/xinput.xml | 1398 +++++++++++++++++++++++++++++---------------------------
 1 file changed, 719 insertions(+), 679 deletions(-)

diff --git a/src/xinput.xml b/src/xinput.xml
index 80416fe..81fe85a 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -26,995 +26,1035 @@
 authorization from the authors.
 -->
 
-<!-- Spec: http://refspecs.freestandards.org/X11/Xinput.pdf -->
+<!-- Specifications:
+     http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt
+-->
 
 <xcb header="xinput" extension-xname="XInputExtension" extension-name="Input"
      major-version="1" minor-version="4">
     <import>xproto</import>
 
-    <typedef oldname="CARD8" newname="KeyCode" />
+    <!-- ⋅⋅⋅ Types (v1.0) ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ -->
+
     <typedef oldname="CARD32" newname="EventClass" />
+    <typedef oldname="CARD8"  newname="KeyCode" />
 
-    <enum name="ValuatorMode">
-	<item name="Relative"> <value>0</value></item>
-	<item name="Absolute"> <value>1</value></item>
-    </enum>
-
-    <enum name="PropagateMode">
-	<item name="AddToList"> <value>0</value></item>
-	<item name="DeleteFromList"> <value>1</value></item>
-    </enum>
+    <!-- ⋅⋅⋅ Requests (v1.0) ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ -->
 
     <!-- GetExtensionVersion -->
 
     <request name="GetExtensionVersion" opcode="1">
-	<field type="CARD16" name="name_len" />
-	<pad bytes="2" />
-	<list type="char" name="name">
-	    <fieldref>name_len</fieldref>
-	</list>
-	<reply>
-	    <pad bytes="1" />
-	    <field type="CARD16" name="server_major" />
-	    <field type="CARD16" name="server_minor" />
-	    <field type="BOOL" name="present" />
-	    <pad bytes="19" />
-	</reply>
+        <field type="CARD16" name="name_len" />
+        <pad bytes="2" />
+        <list type="char" name="name">
+            <fieldref>name_len</fieldref>
+        </list>
+        <reply>
+            <pad bytes="1" />
+            <field type="CARD16" name="server_major" />
+            <field type="CARD16" name="server_minor" />
+            <field type="BOOL"   name="present" />
+            <pad bytes="19" />
+        </reply>
     </request>
 
     <!-- ListInputDevices -->
 
     <enum name="DeviceUse">
-	<item name="IsXPointer"><value>0</value></item>
-	<item name="IsXKeyboard"><value>1</value></item>
-	<item name="IsXExtensionDevice"><value>2</value></item>
-	<item name="IsXExtensionKeyboard"><value>3</value></item>
-	<item name="IsXExtensionPointer"><value>4</value></item>
+        <item name="IsXPointer">           <value>0</value> </item>
+        <item name="IsXKeyboard">          <value>1</value> </item>
+        <item name="IsXExtensionDevice">   <value>2</value> </item>
+        <item name="IsXExtensionKeyboard"> <value>3</value> </item>
+        <item name="IsXExtensionPointer">  <value>4</value> </item>
     </enum>
 
-    <struct name="DeviceInfo">
-	<field type="ATOM" name="device_type" />
-	<field type="CARD8" name="device_id" />
-	<field type="CARD8" name="num_class_info" />
-	<field type="CARD8" name="device_use" enum="DeviceUse" />
-	<pad bytes="1" />
-    </struct>
-
-    <request name="ListInputDevices" opcode="2">
-	<reply>
-	    <pad bytes="1" />
-	    <field type="CARD8" name="devices_len" />
-	    <pad bytes="23" />
-	    <list type="DeviceInfo" name="devices">
-		<fieldref>devices_len</fieldref>
-	    </list>
-	    <!-- Uninterpreted: list of deviceinfo structs of 3 the subtypes -->
-	    <!-- Uninterpreted: list of null-terminated strings -->
-	</reply>
-    </request>
-
     <enum name="InputClass">
-	<item name="Key"><value>0</value></item>
-	<item name="Button"><value>1</value></item>
-	<item name="Valuator"><value>2</value></item>
-	<item name="Feedback"><value>3</value></item>
-	<item name="Proximity"><value>4</value></item>
-	<item name="Focus"><value>5</value></item>
-	<item name="Other"><value>6</value></item>
+        <item name="Key">       <value>0</value> </item>
+        <item name="Button">    <value>1</value> </item>
+        <item name="Valuator">  <value>2</value> </item>
+        <item name="Feedback">  <value>3</value> </item>
+        <item name="Proximity"> <value>4</value> </item>
+        <item name="Focus">     <value>5</value> </item>
+        <item name="Other">     <value>6</value> </item>
     </enum>
 
-    <struct name="InputInfo">
-	<field type="CARD8" name="class_id" enum="InputClass" />
-	<field type="CARD8" name="len" />
+    <enum name="ValuatorMode">
+        <item name="Relative"> <value>0</value> </item>
+        <item name="Absolute"> <value>1</value> </item>
+    </enum>
+
+    <struct name="DeviceInfo">
+        <field type="ATOM"  name="device_type" />
+        <field type="CARD8" name="device_id" />
+        <field type="CARD8" name="num_class_info" />
+        <field type="CARD8" name="device_use" enum="DeviceUse" />
+        <pad bytes="1" />
     </struct>
 
     <struct name="KeyInfo">
-	<field type="CARD8" name="class_id" enum="InputClass" />
-	<field type="CARD8" name="len" />
-	<field type="KeyCode" name="min_keycode" />
-	<field type="KeyCode" name="max_keycode" />
-	<field type="CARD16" name="num_keys" />
-	<pad bytes="2" />
+        <field type="CARD8"   name="class_id" enum="InputClass" />
+        <field type="CARD8"   name="len" />
+        <field type="KeyCode" name="min_keycode" />
+        <field type="KeyCode" name="max_keycode" />
+        <field type="CARD16"  name="num_keys" />
+        <pad bytes="2" />
     </struct>
 
     <struct name="ButtonInfo">
-	<field type="CARD8" name="class_id" enum="InputClass" />
-	<field type="CARD8" name="len" />
-	<field type="CARD16" name="num_buttons" />
+        <field type="CARD8"  name="class_id" enum="InputClass" />
+        <field type="CARD8"  name="len" />
+        <field type="CARD16" name="num_buttons" />
     </struct>
 
     <struct name="AxisInfo">
-	<field type="CARD32" name="resolution" />
-	<field type="INT32" name="minimum" />
-	<field type="INT32" name="maximum" />
+        <field type="CARD32" name="resolution" />
+        <field type="INT32"  name="minimum" />
+        <field type="INT32"  name="maximum" />
     </struct>
 
     <struct name="ValuatorInfo">
-	<field type="CARD8" name="class_id" enum="InputClass" />
-	<field type="CARD8" name="len" />
-	<field type="CARD8" name="axes_len" />
-	<field type="CARD8" name="mode" enum="ValuatorMode" />
-	<field type="CARD32" name="motion_size" />
-	<list type="AxisInfo" name="axes">
-	    <fieldref>axes_len</fieldref>
-	</list>
+        <field type="CARD8"   name="class_id" enum="InputClass" />
+        <field type="CARD8"   name="len" />
+        <field type="CARD8"   name="axes_len" />
+        <field type="CARD8"   name="mode" enum="ValuatorMode" />
+        <field type="CARD32"  name="motion_size" />
+        <list type="AxisInfo" name="axes">
+            <fieldref>axes_len</fieldref>
+        </list>
+    </struct>
+
+    <struct name="InputInfo">
+        <field type="CARD8" name="class_id" enum="InputClass" />
+        <field type="CARD8" name="len" />
+    </struct>
+
+    <struct name="DeviceName">
+        <field type="CARD8" name="len" />
+        <list type="char"  name="string">
+            <fieldref>len</fieldref>
+        </list>
     </struct>
 
+    <request name="ListInputDevices" opcode="2">
+        <reply>
+            <pad bytes="1" />
+            <field type="CARD8" name="devices_len" />
+            <pad bytes="23" />
+            <list type="DeviceInfo" name="devices">
+                <fieldref>devices_len</fieldref>
+            </list>
+            <!-- Uninterpreted: list (infos) of InputInfo structures,
+                                length is <sumof> all devices.num_class_info -->
+            <!-- Uninterpreted: list (name) of DeviceName structures -->
+        </reply>
+    </request>
+
     <!-- OpenDevice -->
 
     <struct name="InputClassInfo">
-	<field type="CARD8" name="class_id" enum="InputClass" />
-	<field type="CARD8" name="event_type_base" />
+        <field type="CARD8" name="class_id" enum="InputClass" />
+        <field type="CARD8" name="event_type_base" />
     </struct>
 
     <request name="OpenDevice" opcode="3">
-	<field type="CARD8" name="device_id" />
-	<pad bytes="3" />
-	<reply>
-	    <pad bytes="1" />
-	    <field type="CARD8" name="num_classes" />
-	    <pad bytes="23" />
-	    <list type="InputClassInfo" name="class_info">
-		<fieldref>num_classes</fieldref>
-	    </list>
-	</reply>
+        <field type="CARD8" name="device_id" />
+        <pad bytes="3" />
+        <reply>
+            <pad bytes="1" />
+            <field type="CARD8" name="num_classes" />
+            <pad bytes="23" />
+            <list type="InputClassInfo" name="class_info">
+                <fieldref>num_classes</fieldref>
+            </list>
+        </reply>
     </request>
 
     <!-- CloseDevice -->
 
     <request name="CloseDevice" opcode="4">
-	<field type="CARD8" name="device_id" />
-	<pad bytes="3" />
+        <field type="CARD8" name="device_id" />
+        <pad bytes="3" />
     </request>
 
     <!-- SetDeviceMode -->
 
     <request name="SetDeviceMode" opcode="5">
-	<field type="CARD8" name="device_id" />
-	<field type="CARD8" name="mode" enum="ValuatorMode" />
-	<pad bytes="2" />
-	<reply>
-	    <pad bytes="1" />
-	    <field type="CARD8" name="status" altenum="GrabStatus" />
-	    <pad bytes="23" />
-	</reply>
+        <field type="CARD8" name="device_id" />
+        <field type="CARD8" name="mode" enum="ValuatorMode" />
+        <pad bytes="2" />
+        <reply>
+            <pad bytes="1" />
+            <field type="CARD8" name="status" altenum="GrabStatus" />
+            <pad bytes="23" />
+        </reply>
     </request>
 
     <!-- SelectExtensionEvent -->
 
     <request name="SelectExtensionEvent" opcode="6">
-	<field type="WINDOW" name="window" />
-	<field type="CARD16" name="num_classes" />
-	<pad bytes="2" />
-	<list type="EventClass" name="classes">
-	    <fieldref>num_classes</fieldref>
-	</list>
+        <field type="WINDOW" name="window" />
+        <field type="CARD16" name="num_classes" />
+        <pad bytes="2" />
+        <list type="EventClass" name="classes">
+            <fieldref>num_classes</fieldref>
+        </list>
     </request>
 
     <!-- GetSelectedExtensionEvents -->
 
     <request name="GetSelectedExtensionEvents" opcode="7">
-	<field type="WINDOW" name="window" />
-	<reply>
-	    <pad bytes="1" />
-	    <field type="CARD16" name="num_this_classes" />
-	    <field type="CARD16" name="num_all_classes" />
-	    <pad bytes="20" />
-	    <list type="EventClass" name="this_classes">
-		<fieldref>num_this_classes</fieldref>
-	    </list>
-	    <list type="EventClass" name="all_classes">
-		<fieldref>num_all_classes</fieldref>
-	    </list>
-	</reply>
+        <field type="WINDOW" name="window" />
+        <reply>
+            <pad bytes="1" />
+            <field type="CARD16" name="num_this_classes" />
+            <field type="CARD16" name="num_all_classes" />
+            <pad bytes="20" />
+            <list type="EventClass" name="this_classes">
+                <fieldref>num_this_classes</fieldref>
+            </list>
+            <list type="EventClass" name="all_classes">
+                <fieldref>num_all_classes</fieldref>
+            </list>
+        </reply>
     </request>
 
     <!-- ChangeDeviceDontPropagateList -->
 
+    <enum name="PropagateMode">
+        <item name="AddToList">      <value>0</value> </item>
+        <item name="DeleteFromList"> <value>1</value> </item>
+    </enum>
+
     <request name="ChangeDeviceDontPropagateList" opcode="8">
-	<field type="WINDOW" name="window" />
-	<field type="CARD16" name="num_classes" />
-	<field type="CARD8" name="mode" enum="PropagateMode" />
-	<pad bytes="1" />
-	<list type="EventClass" name="classes">
-	    <fieldref>num_classes</fieldref>
-	</list>
+        <field type="WINDOW" name="window" />
+        <field type="CARD16" name="num_classes" />
+        <field type="CARD8"  name="mode" enum="PropagateMode" />
+        <pad bytes="1" />
+        <list type="EventClass" name="classes">
+            <fieldref>num_classes</fieldref>
+        </list>
     </request>
 
     <!-- GetDeviceDontPropagateList -->
 
     <request name="GetDeviceDontPropagateList" opcode="9">
-	<field type="WINDOW" name="window" />
-	<reply>
-	    <pad bytes="1" />
-	    <field type="CARD16" name="num_classes" />
-	    <pad bytes="22" />
-	    <list type="EventClass" name="classes">
-		<fieldref>num_classes</fieldref>
-	    </list>
-	</reply>
+        <field type="WINDOW" name="window" />
+        <reply>
+            <pad bytes="1" />
+            <field type="CARD16" name="num_classes" />
+            <pad bytes="22" />
+            <list type="EventClass" name="classes">
+                <fieldref>num_classes</fieldref>
+            </list>
+        </reply>
     </request>
 
     <!-- GetDeviceMotionEvents -->
 
-    <request name="GetDeviceMotionEvents" opcode="10">
-	<field type="TIMESTAMP" name="start" />
-	<field type="TIMESTAMP" name="stop" altenum="Time" />
-	<field type="CARD8" name="device_id" />
-	<reply>
-	    <pad bytes="1" />
-	    <field type="CARD32" name="num_coords" />
-	    <field type="CARD8" name="num_axes" />
-	    <field type="CARD8" name="device_mode" enum="ValuatorMode" />
-	    <pad bytes="18" />
-	    <!-- Uninterpreted: list of DeviceTimeCoord structures -->
-	</reply>
-    </request>
-
     <struct name="DeviceTimeCoord">
-	<field type="TIMESTAMP" name="time" />
-	<!-- Uninterpreted: list of CARD16 -->
+        <field type="TIMESTAMP" name="time" />
+        <!-- Uninterpreted: list (data) of CARD32,
+                            length is num_axes from GetDeviceMotionEvents -->
     </struct>
 
+    <request name="GetDeviceMotionEvents" opcode="10">
+        <field type="TIMESTAMP" name="start" />
+        <field type="TIMESTAMP" name="stop" altenum="Time" />
+        <field type="CARD8"     name="device_id" />
+        <reply>
+            <pad bytes="1" />
+            <field type="CARD32" name="num_events" />
+            <field type="CARD8"  name="num_axes" />
+            <field type="CARD8"  name="device_mode" enum="ValuatorMode" />
+            <pad bytes="18" />
+            <!-- Uninterpreted: list (events) of DeviceTimeCoord structures -->
+        </reply>
+    </request>
+
     <!-- ChangeKeyboardDevice -->
+
     <request name="ChangeKeyboardDevice" opcode="11">
-	<field type="CARD8" name="device_id" />
-	<pad bytes="3" />
-	<reply>
-	    <pad bytes="1" />
-	    <field type="CARD8" name="status" altenum="GrabStatus" />
-	    <pad bytes="23" />
-	</reply>
+        <field type="CARD8" name="device_id" />
+        <pad bytes="3" />
+        <reply>
+            <pad bytes="1" />
+            <field type="CARD8" name="status" altenum="GrabStatus" />
+            <pad bytes="23" />
+        </reply>
     </request>
 
     <!-- ChangePointerDevice -->
 
     <request name="ChangePointerDevice" opcode="12">
-	<field type="CARD8" name="x_axis" />
-	<field type="CARD8" name="y_axis" />
-	<field type="CARD8" name="device_id" />
-	<pad bytes="1" />
-	<reply>
-	    <pad bytes="1" />
-	    <field type="CARD8" name="status" altenum="GrabStatus" />
-	    <pad bytes="23" />
-	</reply>
+        <field type="CARD8" name="x_axis" />
+        <field type="CARD8" name="y_axis" />
+        <field type="CARD8" name="device_id" />
+        <pad bytes="1" />
+        <reply>
+            <pad bytes="1" />
+            <field type="CARD8" name="status" altenum="GrabStatus" />
+            <pad bytes="23" />
+        </reply>
     </request>
 
     <!-- GrabDevice -->
 
     <request name="GrabDevice" opcode="13">
-	<field type="WINDOW" name="grab_window" />
-	<field type="TIMESTAMP" name="time" altenum="Time" />
-	<field type="CARD16" name="num_classes" />
-	<field type="CARD8" name="this_device_mode" enum="GrabMode" />
-	<field type="CARD8" name="other_device_mode" enum="GrabMode" />
-	<field type="BOOL" name="owner_events" />
-	<field type="CARD8" name="device_id" />
-	<pad bytes="2" />
-	<list type="EventClass" name="classes">
-	    <fieldref>num_classes</fieldref>
-	</list>
-	<reply>
-	    <pad bytes="1" />
-	    <field type="CARD8" name="status" enum="GrabStatus" />
-	    <pad bytes="23" />
-	</reply>
+        <field type="WINDOW"    name="grab_window" />
+        <field type="TIMESTAMP" name="time" altenum="Time" />
+        <field type="CARD16"    name="num_classes" />
+        <field type="CARD8"     name="this_device_mode" enum="GrabMode" />
+        <field type="CARD8"     name="other_device_mode" enum="GrabMode" />
+        <field type="BOOL"      name="owner_events" />
+        <field type="CARD8"     name="device_id" />
+        <pad bytes="2" />
+        <list type="EventClass" name="classes">
+            <fieldref>num_classes</fieldref>
+        </list>
+        <reply>
+            <pad bytes="1" />
+            <field type="CARD8" name="status" enum="GrabStatus" />
+            <pad bytes="23" />
+        </reply>
     </request>
 
     <!-- UngrabDevice -->
 
     <request name="UngrabDevice" opcode="14">
-	<field type="TIMESTAMP" name="time" altenum="Time" />
-	<field type="CARD8" name="device_id" />
+        <field type="TIMESTAMP" name="time" altenum="Time" />
+        <field type="CARD8"     name="device_id" />
     </request>
 
     <!-- GrabDeviceKey -->
 
     <request name="GrabDeviceKey" opcode="15">
-	<field type="WINDOW" name="grab_window" />
-	<field type="CARD16" name="num_classes" />
-	<field type="CARD16" name="modifiers" mask="ModMask" />
-	<field type="CARD8" name="modifier_device" />
-	<field type="CARD8" name="grabbed_device" />
-	<field type="CARD8" name="key" altenum="Grab" />
-	<field type="CARD8" name="this_device_mode" enum="GrabMode" />
-	<field type="CARD8" name="other_device_mode" enum="GrabMode" />
-	<field type="BOOL" name="owner_events" />
-	<pad bytes="2" />
-	<list type="EventClass" name="classes">
-	    <fieldref>num_classes</fieldref>
-	</list>
+        <field type="WINDOW" name="grab_window" />
+        <field type="CARD16" name="num_classes" />
+        <field type="CARD16" name="modifiers" mask="ModMask" />
+        <field type="CARD8"  name="modifier_device" />
+        <field type="CARD8"  name="grabbed_device" />
+        <field type="CARD8"  name="key" altenum="Grab" />
+        <field type="CARD8"  name="this_device_mode" enum="GrabMode" />
+        <field type="CARD8"  name="other_device_mode" enum="GrabMode" />
+        <field type="BOOL"   name="owner_events" />
+        <pad bytes="2" />
+        <list type="EventClass" name="classes">
+            <fieldref>num_classes</fieldref>
+        </list>
     </request>
 
     <!-- UngrabDeviceKey -->
 
     <request name="UngrabDeviceKey" opcode="16">
-	<field type="WINDOW" name="grabWindow" />
-	<field type="CARD16" name="modifiers" mask="ModMask" />
-	<field type="CARD8" name="modifier_device" />
-	<field type="CARD8" name="key" altenum="Grab" />
-	<field type="CARD8" name="grabbed_device" />
+        <field type="WINDOW" name="grabWindow" />
+        <field type="CARD16" name="modifiers" mask="ModMask" />
+        <field type="CARD8"  name="modifier_device" />
+        <field type="CARD8"  name="key" altenum="Grab" />
+        <field type="CARD8"  name="grabbed_device" />
     </request>
 
     <!-- GrabDeviceButton -->
 
     <request name="GrabDeviceButton" opcode="17">
-	<field type="WINDOW" name="grab_window" />
-	<field type="CARD8" name="grabbed_device" />
-	<field type="CARD8" name="modifier_device" />
-	<field type="CARD16" name="num_classes" />
-	<field type="CARD16" name="modifiers" mask="ModMask" />
-	<field type="CARD8" name="this_device_mode" enum="GrabMode" />
-	<field type="CARD8" name="other_device_mode" enum="GrabMode" />
-	<field type="CARD8" name="button" altenum="Grab" />
-	<field type="CARD8" name="owner_events" />
-	<pad bytes="2" />
-	<list type="EventClass" name="classes">
-	    <fieldref>num_classes</fieldref>
-	</list>
+        <field type="WINDOW" name="grab_window" />
+        <field type="CARD8"  name="grabbed_device" />
+        <field type="CARD8"  name="modifier_device" />
+        <field type="CARD16" name="num_classes" />
+        <field type="CARD16" name="modifiers" mask="ModMask" />
+        <field type="CARD8"  name="this_device_mode" enum="GrabMode" />
+        <field type="CARD8"  name="other_device_mode" enum="GrabMode" />
+        <field type="CARD8"  name="button" altenum="Grab" />
+        <field type="CARD8"  name="owner_events" />
+        <pad bytes="2" />
+        <list type="EventClass" name="classes">
+            <fieldref>num_classes</fieldref>
+        </list>
     </request>
 
     <!-- UngrabDeviceButton -->
 
     <request name="UngrabDeviceButton" opcode="18">
-	<field type="WINDOW" name="grab_window" />
-	<field type="CARD16" name="modifiers" mask="ModMask" />
-	<field type="CARD8" name="modifier_device" />
-	<field type="CARD8" name="button" altenum="Grab" />
-	<field type="CARD8" name="grabbed_device" />
+        <field type="WINDOW" name="grab_window" />
+        <field type="CARD16" name="modifiers" mask="ModMask" />
+        <field type="CARD8"  name="modifier_device" />
+        <field type="CARD8"  name="button" altenum="Grab" />
+        <field type="CARD8"  name="grabbed_device" />
     </request>
 
     <!-- AllowDeviceEvents -->
 
     <enum name="DeviceInputMode">
-	<item name="AsyncThisDevice" />
-	<item name="SyncThisDevice" />
-	<item name="ReplayThisDevice" />
-	<item name="AsyncOtherDevices" />
-	<item name="AsyncAll" />
-	<item name="SyncAll" />
+        <item name="AsyncThisDevice" />
+        <item name="SyncThisDevice" />
+        <item name="ReplayThisDevice" />
+        <item name="AsyncOtherDevices" />
+        <item name="AsyncAll" />
+        <item name="SyncAll" />
     </enum>
 
     <request name="AllowDeviceEvents" opcode="19">
-	<field type="TIMESTAMP" name="time" altenum="Time" />
-	<field type="CARD8" name="mode" enum="DeviceInputMode" />
-	<field type="CARD8" name="device_id" />
+        <field type="TIMESTAMP" name="time" altenum="Time" />
+        <field type="CARD8"     name="mode" enum="DeviceInputMode" />
+        <field type="CARD8"     name="device_id" />
     </request>
 
     <!-- GetDeviceFocus -->
 
     <request name="GetDeviceFocus" opcode="20">
-	<field type="CARD8" name="device_id" />
-	<pad bytes="3" />
-	<reply>
-	    <pad bytes="1" />
-	    <field type="WINDOW" name="focus" altenum="InputFocus" />
-	    <field type="TIMESTAMP" name="time" />
-	    <field type="CARD8" name="revert_to" enum="InputFocus" />
-	    <pad bytes="15" />
-	</reply>
+        <field type="CARD8" name="device_id" />
+        <pad bytes="3" />
+        <reply>
+            <pad bytes="1" />
+            <field type="WINDOW"    name="focus" altenum="InputFocus" />
+            <field type="TIMESTAMP" name="time" />
+            <field type="CARD8"     name="revert_to" enum="InputFocus" />
+            <pad bytes="15" />
+        </reply>
     </request>
 
     <!-- SetDeviceFocus -->
 
     <request name="SetDeviceFocus" opcode="21">
-	<field type="WINDOW" name="focus" altenum="InputFocus" />
-	<field type="TIMESTAMP" name="time" altenum="Time" />
-	<field type="CARD8" name="revert_to" enum="InputFocus" />
-	<field type="CARD8" name="device_id" />
+        <field type="WINDOW"    name="focus" altenum="InputFocus" />
+        <field type="TIMESTAMP" name="time" altenum="Time" />
+        <field type="CARD8"     name="revert_to" enum="InputFocus" />
+        <field type="CARD8"     name="device_id" />
     </request>
 
     <!-- GetFeedbackControl -->
 
-    <request name="GetFeedbackControl" opcode="22">
-	<field type="CARD8" name="device_id" />
-	<pad bytes="3" />
-	<reply>
-	    <pad bytes="1" />
-	    <field type="CARD16" name="num_feedback" />
-	    <pad bytes="22" />
-	    <!-- Uninterpreted: list of FeedbackState structures -->
-	</reply>
-    </request>
-
     <enum name="FeedbackClass">
-	<item name="Keyboard" />
-	<item name="Pointer" />
-	<item name="String" />
-	<item name="Integer" />
-	<item name="Led" />
-	<item name="Bell" />
+        <item name="Keyboard" />
+        <item name="Pointer" />
+        <item name="String" />
+        <item name="Integer" />
+        <item name="Led" />
+        <item name="Bell" />
     </enum>
 
-    <struct name="FeedbackState">
-	<field type="CARD8" name="class_id" enum="FeedbackClass" />
-	<field type="CARD8" name="id" />
-	<field type="CARD16" name="len" />
-    </struct>
-    
     <struct name="KbdFeedbackState">
-	<field type="CARD8" name="class_id" enum="FeedbackClass" />
-	<field type="CARD8" name="id" />
-	<field type="CARD16" name="len" />
-	<field type="CARD16" name="pitch" />
-	<field type="CARD16" name="duration" />
-	<field type="CARD32" name="led_mask" />
-	<field type="CARD32" name="led_values" />
-	<field type="BOOL" name="global_auto_repeat" />
-	<field type="CARD8" name="click" />
-	<field type="CARD8" name="percent" />
-	<pad bytes="1" />
-	<list type="CARD8" name="auto_repeats"><value>32</value></list>
+        <field type="CARD8"  name="class_id" enum="FeedbackClass" />
+        <field type="CARD8"  name="feedback_id" />
+        <field type="CARD16" name="len" />
+        <field type="CARD16" name="pitch" />
+        <field type="CARD16" name="duration" />
+        <field type="CARD32" name="led_mask" />
+        <field type="CARD32" name="led_values" />
+        <field type="BOOL"   name="global_auto_repeat" />
+        <field type="CARD8"  name="click" />
+        <field type="CARD8"  name="percent" />
+        <pad bytes="1" />
+        <list type="CARD8" name="auto_repeats">
+            <value>32</value>
+        </list>
     </struct>
 
     <struct name="PtrFeedbackState">
-	<field type="CARD8" name="class_id" enum="FeedbackClass" />
-	<field type="CARD8" name="id" />
-	<field type="CARD16" name="len" />
-	<pad bytes="2" />
-	<field type="CARD16" name="accel_num" />
-	<field type="CARD16" name="accel_denom" />
-	<field type="CARD16" name="threshold" />
+        <field type="CARD8"  name="class_id" enum="FeedbackClass" />
+        <field type="CARD8"  name="feedback_id" />
+        <field type="CARD16" name="len" />
+        <pad bytes="2" />
+        <field type="CARD16" name="accel_num" />
+        <field type="CARD16" name="accel_denom" />
+        <field type="CARD16" name="threshold" />
     </struct>
 
     <struct name="IntegerFeedbackState">
-	<field type="CARD8" name="class_id" enum="FeedbackClass" />
-	<field type="CARD8" name="id" />
-	<field type="CARD16" name="len" />
-	<field type="CARD32" name="resolution" />
-	<field type="INT32" name="min_value" />
-	<field type="INT32" name="max_value" />
+        <field type="CARD8"  name="class_id" enum="FeedbackClass" />
+        <field type="CARD8"  name="feedback_id" />
+        <field type="CARD16" name="len" />
+        <field type="CARD32" name="resolution" />
+        <field type="INT32"  name="min_value" />
+        <field type="INT32"  name="max_value" />
     </struct>
 
     <struct name="StringFeedbackState">
-	<field type="CARD8" name="class_id" enum="FeedbackClass" />
-	<field type="CARD8" name="id" />
-	<field type="CARD16" name="len" />
-	<field type="CARD16" name="max_symbols" />
-	<field type="CARD16" name="num_keysyms" />
-	<list type="KEYSYM" name="keysyms">
-	    <fieldref>num_keysyms</fieldref>
-	</list>
+        <field type="CARD8"  name="class_id" enum="FeedbackClass" />
+        <field type="CARD8"  name="feedback_id" />
+        <field type="CARD16" name="len" />
+        <field type="CARD16" name="max_symbols" />
+        <field type="CARD16" name="num_keysyms" />
+        <list type="KEYSYM"  name="keysyms">
+            <fieldref>num_keysyms</fieldref>
+        </list>
     </struct>
 
     <struct name="BellFeedbackState">
-	<field type="CARD8" name="class_id" enum="FeedbackClass" />
-	<field type="CARD8" name="id" />
-	<field type="CARD16" name="len" />
-	<field type="CARD8" name="percent" />
-	<pad bytes="3" />
-	<field type="CARD16" name="pitch" />
-	<field type="CARD16" name="duration" />
+        <field type="CARD8"  name="class_id" enum="FeedbackClass" />
+        <field type="CARD8"  name="feedback_id" />
+        <field type="CARD16" name="len" />
+        <field type="CARD8"  name="percent" />
+        <pad bytes="3" />
+        <field type="CARD16" name="pitch" />
+        <field type="CARD16" name="duration" />
     </struct>
 
     <struct name="LedFeedbackState">
-	<field type="CARD8" name="class_id" enum="FeedbackClass" />
-	<field type="CARD8" name="id" />
-	<field type="CARD16" name="len" />
-	<field type="CARD32" name="led_mask" />
-	<field type="CARD32" name="led_values" />
+        <field type="CARD8"  name="class_id" enum="FeedbackClass" />
+        <field type="CARD8"  name="feedback_id" />
+        <field type="CARD16" name="len" />
+        <field type="CARD32" name="led_mask" />
+        <field type="CARD32" name="led_values" />
     </struct>
 
-    <!-- ChangeFeedbackControl
+    <struct name="FeedbackState">
+        <field type="CARD8"  name="class_id" enum="FeedbackClass" />
+        <field type="CARD8"  name="feedback_id" />
+        <field type="CARD16" name="len" />
+    </struct>
 
-    <request name="ChangeFeedbackControl" opcode="23">
-	<field type="CARD32" name="mask" />
-	<field type="CARD8" name="device_id" />
-	<field type="CARD8" name="feedback_id" />
-	Uninterpreted: list of FeedbackCtl structures
+    <request name="GetFeedbackControl" opcode="22">
+        <field type="CARD8" name="device_id" />
+        <pad bytes="3" />
+        <reply>
+            <pad bytes="1" />
+            <field type="CARD16" name="num_feedbacks" />
+            <pad bytes="22" />
+            <!-- Uninterpreted: list (feedbacks) of FeedbackState structures -->
+        </reply>
     </request>
 
-    -->
-
-    <struct name="FeedbackCtl">
-	<field type="CARD8" name="class_id" enum="FeedbackClass" />
-	<field type="CARD8" name="id" />
-	<field type="CARD16" name="len" />
-    </struct>
+    <!-- ChangeFeedbackControl -->
 
     <struct name="KbdFeedbackCtl">
-	<field type="CARD8" name="class_id" enum="FeedbackClass" />
-	<field type="CARD8" name="id" />
-	<field type="CARD16" name="len" />
-	<field type="KeyCode" name="key" />
-	<field type="CARD8" name="auto_repeat_mode" />
-	<field type="INT8" name="key_click_percent" />
-	<field type="INT8" name="bell_percent" />
-	<field type="INT16" name="bell_pitch" />
-	<field type="INT16" name="bell_duration" />
-	<field type="CARD32" name="led_mask" />
-	<field type="CARD32" name="led_values" />
+        <field type="CARD8"   name="class_id" enum="FeedbackClass" />
+        <field type="CARD8"   name="feedback_id" />
+        <field type="CARD16"  name="len" />
+        <field type="KeyCode" name="key" />
+        <field type="CARD8"   name="auto_repeat_mode" />
+        <field type="INT8"    name="key_click_percent" />
+        <field type="INT8"    name="bell_percent" />
+        <field type="INT16"   name="bell_pitch" />
+        <field type="INT16"   name="bell_duration" />
+        <field type="CARD32"  name="led_mask" />
+        <field type="CARD32"  name="led_values" />
     </struct>
 
     <struct name="PtrFeedbackCtl">
-	<field type="CARD8" name="class_id" enum="FeedbackClass" />
-	<field type="CARD8" name="id" />
-	<field type="CARD16" name="len" />
-	<pad bytes="2" />
-	<field type="INT16" name="num" />
-	<field type="INT16" name="denom" />
-	<field type="INT16" name="threshold" />
+        <field type="CARD8"  name="class_id" enum="FeedbackClass" />
+        <field type="CARD8"  name="feedback_id" />
+        <field type="CARD16" name="len" />
+        <pad bytes="2" />
+        <field type="INT16"  name="num" />
+        <field type="INT16"  name="denom" />
+        <field type="INT16"  name="threshold" />
     </struct>
 
     <struct name="IntegerFeedbackCtl">
-	<field type="CARD8" name="class_id" enum="FeedbackClass" />
-	<field type="CARD8" name="id" />
-	<field type="CARD16" name="len" />
-	<field type="INT32" name="int_to_display" />
+        <field type="CARD8"  name="class_id" enum="FeedbackClass" />
+        <field type="CARD8"  name="feedback_id" />
+        <field type="CARD16" name="len" />
+        <field type="INT32"  name="int_to_display" />
     </struct>
 
     <struct name="StringFeedbackCtl">
-	<field type="CARD8" name="class_id" enum="FeedbackClass" />
-	<field type="CARD8" name="id" />
-	<field type="CARD16" name="len" />
-	<pad bytes="2" />
-	<field type="CARD16" name="num_keysyms" />
-	<list type="KEYSYM" name="keysyms">
-	    <fieldref>num_keysyms</fieldref>
-	</list>
+        <field type="CARD8"  name="class_id" enum="FeedbackClass" />
+        <field type="CARD8"  name="feedback_id" />
+        <field type="CARD16" name="len" />
+        <pad bytes="2" />
+        <field type="CARD16" name="num_keysyms" />
+        <list type="KEYSYM"  name="keysyms">
+            <fieldref>num_keysyms</fieldref>
+        </list>
     </struct>
 
     <struct name="BellFeedbackCtl">
-	<field type="CARD8" name="class_id" enum="FeedbackClass" />
-	<field type="CARD8" name="id" />
-	<field type="CARD16" name="len" />
-	<field type="INT8" name="percent" />
-	<pad bytes="3" />
-	<field type="INT16" name="pitch" />
-	<field type="INT16" name="duration" />
+        <field type="CARD8"  name="class_id" enum="FeedbackClass" />
+        <field type="CARD8"  name="feedback_id" />
+        <field type="CARD16" name="len" />
+        <field type="INT8"   name="percent" />
+        <pad bytes="3" />
+        <field type="INT16"  name="pitch" />
+        <field type="INT16"  name="duration" />
     </struct>
 
     <struct name="LedFeedbackCtl">
-	<field type="CARD8" name="class_id" enum="FeedbackClass" />
-	<field type="CARD8" name="id" />
-	<field type="CARD16" name="len" />
-	<field type="CARD32" name="led_mask" />
-	<field type="CARD32" name="led_values" />
+        <field type="CARD8"  name="class_id" enum="FeedbackClass" />
+        <field type="CARD8"  name="feedback_id" />
+        <field type="CARD16" name="len" />
+        <field type="CARD32" name="led_mask" />
+        <field type="CARD32" name="led_values" />
+    </struct>
+
+    <struct name="FeedbackCtl">
+        <field type="CARD8"  name="class_id" enum="FeedbackClass" />
+        <field type="CARD8"  name="feedback_id" />
+        <field type="CARD16" name="len" />
     </struct>
 
+    <request name="ChangeFeedbackControl" opcode="23">
+        <field type="CARD32"      name="mask" />
+        <field type="CARD8"       name="device_id" />
+        <field type="CARD8"       name="feedback_id" />
+        <!-- Uninterpreted: field (feedback) of FeedbackCtl structure -->
+    </request>
+
     <!-- GetDeviceKeyMapping -->
 
     <request name="GetDeviceKeyMapping" opcode="24">
-	<field type="CARD8" name="device_id" />
-	<field type="KeyCode" name="first_keycode" />
-	<field type="CARD8" name="count" />
-	<reply>
-	    <pad bytes="1" />
-	    <field type="CARD8" name="keysyms_per_keycode" />
-	    <pad bytes="23" />
-	    <list type="KEYSYM" name="keysyms">
-		<fieldref>length</fieldref>
-	    </list>
-	</reply>
+        <field type="CARD8"   name="device_id" />
+        <field type="KeyCode" name="first_keycode" />
+        <field type="CARD8"   name="count" />
+        <reply>
+            <pad bytes="1" />
+            <field type="CARD8" name="keysyms_per_keycode" />
+            <pad bytes="23" />
+            <list type="KEYSYM" name="keysyms">
+                <!-- 'length' is a field in the header -->
+                <fieldref>length</fieldref>
+            </list>
+        </reply>
     </request>
 
     <!-- ChangeDeviceKeyMapping -->
 
     <request name="ChangeDeviceKeyMapping" opcode="25">
-	<field type="CARD8" name="device_id" />
-	<field type="KeyCode" name="first_keycode" />
-	<field type="CARD8" name="keysyms_per_keycode" />
-	<field type="CARD8" name="keycode_count" />
-	<list type="KEYSYM" name="keysyms">
-	    <op op="*">
-		<fieldref>keycode_count</fieldref>
-		<fieldref>keysyms_per_keycode</fieldref>
-	    </op>
-	</list>
+        <field type="CARD8"   name="device_id" />
+        <field type="KeyCode" name="first_keycode" />
+        <field type="CARD8"   name="keysyms_per_keycode" />
+        <field type="CARD8"   name="keycode_count" />
+        <list type="KEYSYM"   name="keysyms">
+            <op op="*">
+                <fieldref>keycode_count</fieldref>
+                <fieldref>keysyms_per_keycode</fieldref>
+            </op>
+        </list>
     </request>
 
     <!-- GetDeviceModifierMapping -->
 
     <request name="GetDeviceModifierMapping" opcode="26">
-	<field type="CARD8" name="device_id" />
-	<pad bytes="3" />
-	<reply>
-	    <pad bytes="1" />
-	    <field type="CARD8" name="keycodes_per_modifier" />
-	    <pad bytes="23" />
-	    <list type="CARD8" name="keymaps">
-		<op op="*">
-		    <fieldref>keycodes_per_modifier</fieldref>
-		    <value>8</value>
-		</op>
-	    </list>
-	</reply>
+        <field type="CARD8" name="device_id" />
+        <pad bytes="3" />
+        <reply>
+            <pad bytes="1" />
+            <field type="CARD8" name="keycodes_per_modifier" />
+            <pad bytes="23" />
+            <list type="CARD8"  name="keymaps">
+                <op op="*">
+                    <fieldref>keycodes_per_modifier</fieldref>
+                    <value>8</value>
+                </op>
+            </list>
+        </reply>
     </request>
 
     <!-- SetDeviceModifierMapping -->
 
     <request name="SetDeviceModifierMapping" opcode="27">
-	<field type="CARD8" name="device_id" />
-	<field type="CARD8" name="keycodes_per_modifier" />
-	<pad bytes="1" />
-	<list type="CARD8" name="keymaps">
-	    <op op="*">
-		<fieldref>keycodes_per_modifier</fieldref>
-		<value>8</value>
-	    </op>
-	</list>
-	<reply>
-	    <pad bytes="1" />
-	    <field type="CARD8" name="status" enum="MappingStatus" />
-	    <pad bytes="23" />
-	</reply>
+        <field type="CARD8" name="device_id" />
+        <field type="CARD8" name="keycodes_per_modifier" />
+        <pad bytes="1" />
+        <list type="CARD8" name="keymaps">
+            <op op="*">
+                <fieldref>keycodes_per_modifier</fieldref>
+                <value>8</value>
+            </op>
+        </list>
+        <reply>
+            <pad bytes="1" />
+            <field type="CARD8" name="status" enum="MappingStatus" />
+            <pad bytes="23" />
+        </reply>
     </request>
 
     <!-- GetDeviceButtonMapping -->
 
     <request name="GetDeviceButtonMapping" opcode="28">
-	<field type="CARD8" name="device_id" />
-	<pad bytes="3" />
-	<reply>
-	    <pad bytes="1" />
-	    <field type="CARD8" name="map_size" />
-	    <pad bytes="23" />
-	    <list type="CARD8" name="map">
-		<fieldref>map_size</fieldref>
-	    </list>
-	</reply>
+        <field type="CARD8" name="device_id" />
+        <pad bytes="3" />
+        <reply>
+            <pad bytes="1" />
+            <field type="CARD8" name="map_size" />
+            <pad bytes="23" />
+            <list type="CARD8" name="map">
+                <fieldref>map_size</fieldref>
+            </list>
+        </reply>
     </request>
 
     <!-- SetDeviceButtonMapping -->
 
     <request name="SetDeviceButtonMapping" opcode="29">
-	<field type="CARD8" name="device_id" />
-	<field type="CARD8" name="map_size" />
-	<pad bytes="2" />
-	<list type="CARD8" name="map">
-	    <fieldref>map_size</fieldref>
-	</list>
-	<reply>
-	    <pad bytes="1" />
-	    <field type="CARD8" name="status" enum="MappingStatus" />
-	    <pad bytes="23" />
-	</reply>
+        <field type="CARD8" name="device_id" />
+        <field type="CARD8" name="map_size" />
+        <pad bytes="2" />
+        <list type="CARD8" name="map">
+            <fieldref>map_size</fieldref>
+        </list>
+        <reply>
+            <pad bytes="1" />
+            <field type="CARD8" name="status" enum="MappingStatus" />
+            <pad bytes="23" />
+        </reply>
     </request>
 
     <!-- QueryDeviceState -->
 
-    <request name="QueryDeviceState" opcode="30">
-	<field type="CARD8" name="device_id" />
-	<pad bytes="3" />
-	<reply>
-	    <pad bytes="1" />
-	    <field type="CARD8" name="num_classes" />
-	    <pad bytes="23" />
-	    <!-- Uninterpreted: list of InputState structures -->
-	</reply>
-    </request>
-
-    <struct name="InputState">
-	<field type="CARD8" name="class_id" enum="InputClass" />
-	<field type="CARD8" name="len" />
-	<field type="CARD8" name="num_items" />
-    </struct>
-
     <struct name="KeyState">
-	<field type="CARD8" name="class_id" enum="InputClass" />
-	<field type="CARD8" name="len" />
-	<field type="CARD8" name="num_keys" />
-	<pad bytes="1" />
-	<list type="CARD8" name="keys">
-	    <value>32</value>
-	</list>
+        <field type="CARD8" name="class_id" enum="InputClass" />
+        <field type="CARD8" name="len" />
+        <field type="CARD8" name="num_keys" />
+        <pad bytes="1" />
+        <list type="CARD8" name="keys">
+            <value>32</value>
+        </list>
     </struct>
 
     <struct name="ButtonState">
-	<field type="CARD8" name="class_id" enum="InputClass" />
-	<field type="CARD8" name="len" />
-	<field type="CARD8" name="num_buttons" />
-	<pad bytes="1" />
-	<list type="CARD8" name="buttons">
-	    <value>32</value>
-	</list>
+        <field type="CARD8" name="class_id" enum="InputClass" />
+        <field type="CARD8" name="len" />
+        <field type="CARD8" name="num_buttons" />
+        <pad bytes="1" />
+        <list type="CARD8" name="buttons">
+            <value>32</value>
+        </list>
     </struct>
 
     <struct name="ValuatorState">
-	<field type="CARD8" name="class_id" enum="InputClass" />
-	<field type="CARD8" name="len" />
-	<field type="CARD8" name="num_valuators" />
-	<field type="CARD8" name="mode" />
-	<list type="CARD32" name="valuators">
-	    <fieldref>num_valuators</fieldref>
-	</list>
+        <field type="CARD8" name="class_id" enum="InputClass" />
+        <field type="CARD8" name="len" />
+        <field type="CARD8" name="num_valuators" />
+        <field type="CARD8" name="mode" />
+        <list type="CARD32" name="valuators">
+            <fieldref>num_valuators</fieldref>
+        </list>
     </struct>
 
+    <struct name="InputState">
+        <field type="CARD8" name="class_id" enum="InputClass" />
+        <field type="CARD8" name="len" />
+        <field type="CARD8" name="num_items" />
+    </struct>
+
+    <request name="QueryDeviceState" opcode="30">
+        <field type="CARD8" name="device_id" />
+        <pad bytes="3" />
+        <reply>
+            <pad bytes="1" />
+            <field type="CARD8" name="num_classes" />
+            <pad bytes="23" />
+            <!-- Uninterpreted: list (classes) of InputState structures -->
+        </reply>
+    </request>
+
     <!-- SendExtensionEvent -->
 
     <request name="SendExtensionEvent" opcode="31">
-	<field type="WINDOW" name="destination" />
-	<field type="CARD8" name="device_id" />
-	<field type="BOOL" name="propagate" />
-	<field type="CARD16" name="num_classes" />
-	<field type="CARD8" name="num_events" />
-	<pad bytes="3" />
-	<list type="char" name="events">
-	    <op op="*">
-		<fieldref>num_events</fieldref>
-		<value>32</value>
-	    </op>
-	</list>
-	<list type="EventClass" name="classes">
-	    <fieldref>num_classes</fieldref>
-	</list>
+        <field type="WINDOW" name="destination" />
+        <field type="CARD8"  name="device_id" />
+        <field type="BOOL"   name="propagate" />
+        <field type="CARD16" name="num_classes" />
+        <field type="CARD8"  name="num_events" />
+        <pad bytes="3" />
+        <list type="CARD8" name="events">
+            <op op="*">
+                <fieldref>num_events</fieldref>
+                <value>32</value>
+            </op>
+        </list>
+        <list type="EventClass" name="classes">
+            <fieldref>num_classes</fieldref>
+        </list>
     </request>
 
     <!-- DeviceBell -->
 
     <request name="DeviceBell" opcode="32">
-	<field type="CARD8" name="device_id" />
-	<field type="CARD8" name="feedback_id" />
-	<field type="CARD8" name="feedback_class" />
-	<field type="INT8" name="percent" />
+        <field type="CARD8" name="device_id" />
+        <field type="CARD8" name="feedback_id" />
+        <field type="CARD8" name="feedback_class" />
+        <field type="INT8"  name="percent" />
     </request>
 
     <!-- SetDeviceValuators -->
 
     <request name="SetDeviceValuators" opcode="33">
-	<field type="CARD8" name="device_id" />
-	<field type="CARD8" name="first_valuator" />
-	<field type="CARD8" name="num_valuators" />
-	<pad bytes="1" />
-	<list type="INT32" name="valuators">
-	    <fieldref>num_valuators</fieldref>
-	</list>
-	<reply>
-	    <pad bytes="1" />
-	    <field type="CARD8" name="status" enum="GrabStatus" />
-	    <pad bytes="23" />
-	</reply>
+        <field type="CARD8" name="device_id" />
+        <field type="CARD8" name="first_valuator" />
+        <field type="CARD8" name="num_valuators" />
+        <pad bytes="1" />
+        <list type="INT32" name="valuators">
+            <fieldref>num_valuators</fieldref>
+        </list>
+        <reply>
+            <pad bytes="1" />
+            <field type="CARD8" name="status" enum="GrabStatus" />
+            <pad bytes="23" />
+        </reply>
     </request>
 
     <!-- GetDeviceControl -->
 
-    <request name="GetDeviceControl" opcode="34">
-	<field type="CARD16" name="control_id" />
-	<field type="CARD8" name="device_id" />
-	<pad bytes="1" />
-	<reply>
-	    <pad bytes="1" />
-	    <field type="CARD8" name="status" altenum="GrabStatus" />
-	    <pad bytes="23" />
-	    <!-- Uninterpreted: list of DeviceState structures -->
-	</reply>
-    </request>
-
-    <struct name="DeviceState">
-	<field type="CARD16" name="control_id" />
-	<field type="CARD16" name="len" />
-    </struct>
+    <enum name="DeviceControl">
+        <item name="resolution"> <value>1</value> </item>
+        <item name="abs_calib">  <value>2</value> </item>
+        <item name="core">       <value>3</value> </item>
+        <item name="enable">     <value>4</value> </item>
+        <item name="abs_area">   <value>5</value> </item>
+    </enum>
 
     <struct name="DeviceResolutionState">
-	<field type="CARD16" name="control_id" />
-	<field type="CARD16" name="len" />
-	<field type="CARD32" name="num_valuators" />
-	<list type="CARD32" name="resolution_values">
-	    <fieldref>num_valuators</fieldref>
-	</list>
-	<list type="CARD32" name="resolution_min">
-	    <fieldref>num_valuators</fieldref>
-	</list>
-	<list type="CARD32" name="resolution_max">
-	    <fieldref>num_valuators</fieldref>
-	</list>
+        <field type="CARD16" name="control_id" enum="DeviceControl" />
+        <field type="CARD16" name="len" />
+        <field type="CARD32" name="num_valuators" />
+        <list type="CARD32"  name="resolution_values">
+            <fieldref>num_valuators</fieldref>
+        </list>
+        <list type="CARD32" name="resolution_min">
+            <fieldref>num_valuators</fieldref>
+        </list>
+        <list type="CARD32" name="resolution_max">
+            <fieldref>num_valuators</fieldref>
+        </list>
     </struct>
 
     <struct name="DeviceAbsCalibState">
-	<field type="CARD16" name="control_id" />
-	<field type="CARD16" name="len" />
-	<field type="INT32" name="min_x" />
-	<field type="INT32" name="max_x" />
-	<field type="INT32" name="min_y" />
-	<field type="INT32" name="max_y" />
-	<field type="CARD32" name="flip_x" />
-	<field type="CARD32" name="flip_y" />
-	<field type="CARD32" name="rotation" />
-	<field type="CARD32" name="button_threshold" />
+        <field type="CARD16" name="control_id" enum="DeviceControl" />
+        <field type="CARD16" name="len" />
+        <field type="INT32"  name="min_x" />
+        <field type="INT32"  name="max_x" />
+        <field type="INT32"  name="min_y" />
+        <field type="INT32"  name="max_y" />
+        <field type="CARD32" name="flip_x" />
+        <field type="CARD32" name="flip_y" />
+        <field type="CARD32" name="rotation" />
+        <field type="CARD32" name="button_threshold" />
     </struct>
 
     <struct name="DeviceAbsAreaState">
-	<field type="CARD16" name="control_id" />
-	<field type="CARD16" name="len" />
-	<field type="CARD32" name="offset_x" />
-	<field type="CARD32" name="offset_y" />
-	<field type="CARD32" name="width" />
-	<field type="CARD32" name="height" />
-	<field type="CARD32" name="screen" />
-	<field type="CARD32" name="following" />
+        <field type="CARD16" name="control_id" enum="DeviceControl" />
+        <field type="CARD16" name="len" />
+        <field type="CARD32" name="offset_x" />
+        <field type="CARD32" name="offset_y" />
+        <field type="CARD32" name="width" />
+        <field type="CARD32" name="height" />
+        <field type="CARD32" name="screen" />
+        <field type="CARD32" name="following" />
     </struct>
 
     <struct name="DeviceCoreState">
-	<field type="CARD16" name="control_id" />
-	<field type="CARD16" name="len" />
-	<field type="CARD8" name="status" />
-	<field type="CARD8" name="iscore" />
-	<pad bytes="2" />
+        <field type="CARD16" name="control_id" enum="DeviceControl" />
+        <field type="CARD16" name="len" />
+        <field type="CARD8"  name="status" />
+        <field type="CARD8"  name="iscore" />
+        <pad bytes="2" />
     </struct>
 
     <struct name="DeviceEnableState">
-	<field type="CARD16" name="control_id" />
-	<field type="CARD16" name="len" />
-	<field type="CARD8" name="enable" />
-	<pad bytes="3" />
+        <field type="CARD16" name="control_id" enum="DeviceControl" />
+        <field type="CARD16" name="len" />
+        <field type="CARD8"  name="enable" />
+        <pad bytes="3" />
     </struct>
 
-    <!-- ChangeDeviceControl
+    <struct name="DeviceState">
+        <field type="CARD16" name="control_id" enum="DeviceControl" />
+        <field type="CARD16" name="len" />
+    </struct>
 
-    <request name="ChangeDeviceControl" opcode="35">
-	<field type="CARD16" name="control_id" />
-	<field type="CARD8" name="device_id" />
-	<pad bytes="1" />
-	Uninterpreted: list of DeviceCtl structures
-	<reply>
-            <pad byte="1" />
+    <request name="GetDeviceControl" opcode="34">
+        <field type="CARD16" name="control_id" enum="DeviceControl" />
+        <field type="CARD8"  name="device_id" />
+        <pad bytes="1" />
+        <reply>
+            <pad bytes="1" />
             <field type="CARD8" name="status" altenum="GrabStatus" />
             <pad bytes="23" />
-	</reply>
+            <!-- Uninterpreted: field (control) of DeviceState structure -->
+        </reply>
     </request>
 
-    -->
-
-    <struct name="DeviceCtl">
-	<field type="CARD16" name="control_id" />
-	<field type="CARD16" name="len" />
-    </struct>
+    <!-- ChangeDeviceControl -->
 
     <struct name="DeviceResolutionCtl">
-	<field type="CARD16" name="control_id" />
-	<field type="CARD16" name="len" />
-	<field type="CARD8" name="first_valuator" />
-	<field type="CARD8" name="num_valuators" />
-	<list type="CARD32" name="resolution_values">
-	    <fieldref>num_valuators</fieldref>
-	</list>
+        <field type="CARD16" name="control_id" enum="DeviceControl" />
+        <field type="CARD16" name="len" />
+        <field type="CARD8"  name="first_valuator" />
+        <field type="CARD8"  name="num_valuators" />
+        <list type="CARD32"  name="resolution_values">
+            <fieldref>num_valuators</fieldref>
+        </list>
     </struct>
 
     <struct name="DeviceAbsCalibCtl">
-	<field type="CARD16" name="control_id" />
-	<field type="CARD16" name="len" />
-	<field type="INT32" name="min_x" />
-	<field type="INT32" name="max_x" />
-	<field type="INT32" name="min_y" />
-	<field type="INT32" name="max_y" />
-	<field type="CARD32" name="flip_x" />
-	<field type="CARD32" name="flip_y" />
-	<field type="CARD32" name="rotation" />
-	<field type="CARD32" name="button_threshold" />
+        <field type="CARD16" name="control_id" enum="DeviceControl" />
+        <field type="CARD16" name="len" />
+        <field type="INT32"  name="min_x" />
+        <field type="INT32"  name="max_x" />
+        <field type="INT32"  name="min_y" />
+        <field type="INT32"  name="max_y" />
+        <field type="CARD32" name="flip_x" />
+        <field type="CARD32" name="flip_y" />
+        <field type="CARD32" name="rotation" />
+        <field type="CARD32" name="button_threshold" />
     </struct>
 
     <struct name="DeviceAbsAreaCtrl">
-	<field type="CARD16" name="control_id" />
-	<field type="CARD16" name="len" />
-	<field type="CARD32" name="offset_x" />
-	<field type="CARD32" name="offset_y" />
-	<field type="INT32" name="width" />
-	<field type="INT32" name="height" />
-	<field type="INT32" name="screen" />
-	<field type="CARD32" name="following" />
+        <field type="CARD16" name="control_id" enum="DeviceControl" />
+        <field type="CARD16" name="len" />
+        <field type="CARD32" name="offset_x" />
+        <field type="CARD32" name="offset_y" />
+        <field type="INT32"  name="width" />
+        <field type="INT32"  name="height" />
+        <field type="INT32"  name="screen" />
+        <field type="CARD32" name="following" />
     </struct>
 
     <struct name="DeviceCoreCtrl">
-	<field type="CARD16" name="control_id" />
-	<field type="CARD16" name="len" />
-	<field type="CARD8" name="status" />
-	<pad bytes="3" />
+        <field type="CARD16" name="control_id" enum="DeviceControl" />
+        <field type="CARD16" name="len" />
+        <field type="CARD8"  name="status" />
+        <pad bytes="3" />
     </struct>
 
     <struct name="DeviceEnableCtrl">
-	<field type="CARD16" name="control_id" />
-	<field type="CARD16" name="len" />
-	<field type="CARD8" name="enable" />
-	<pad bytes="3" />
+        <field type="CARD16" name="control_id" enum="DeviceControl" />
+        <field type="CARD16" name="len" />
+        <field type="CARD8"  name="enable" />
+        <pad bytes="3" />
     </struct>
 
-    <!-- EVENTS --> 
+    <struct name="DeviceCtl">
+        <field type="CARD16" name="control_id" enum="DeviceControl" />
+        <field type="CARD16" name="len" />
+    </struct>
+
+    <request name="ChangeDeviceControl" opcode="35">
+        <field type="CARD16" name="control_id" enum="DeviceControl" />
+        <field type="CARD8"  name="device_id" />
+        <pad bytes="1" />
+        <!-- Uninterpreted: field (control) of DeviceCtl structure -->
+        <reply>
+            <pad bytes="1" />
+            <field type="CARD8" name="status" altenum="GrabStatus" />
+            <pad bytes="23" />
+        </reply>
+    </request>
+
+    <!-- ⋅⋅⋅ Events (v1.0) ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ -->
+    <!-- Notes:
+         - A 'len' field in a v1++ structure is in bytes.
+    -->
 
     <event name="DeviceValuator" number="0">
-	<field type="CARD8" name="device_id" />
-	<field type="CARD16" name="device_state" />
-	<field type="CARD8" name="num_valuators" />
-	<field type="CARD8" name="first_valuator" />
-	<list type="INT32" name="valuators"><value>6</value></list>
+        <field type="CARD8"  name="device_id" />
+        <field type="CARD16" name="device_state" />
+        <field type="CARD8"  name="num_valuators" />
+        <field type="CARD8"  name="first_valuator" />
+        <list type="INT32"   name="valuators">
+            <value>6</value>
+        </list>
     </event>
 
     <event name="DeviceKeyPress" number="1">
-	<field type="BYTE" name="detail" />
-	<field type="TIMESTAMP" name="time" />
-	<field type="WINDOW" name="root" />
-	<field type="WINDOW" name="event" />
-	<field type="WINDOW" name="child" altenum="Window" />
-	<field type="INT16" name="root_x" />
-	<field type="INT16" name="root_y" />
-	<field type="INT16" name="event_x" />
-	<field type="INT16" name="event_y" />
-	<field type="CARD16" name="state" />
-	<field type="BOOL" name="same_screen" />
-	<field type="CARD8" name="device_id" />
+        <field type="BYTE"      name="detail" />
+        <field type="TIMESTAMP" name="time" />
+        <field type="WINDOW"    name="root" />
+        <field type="WINDOW"    name="event" />
+        <field type="WINDOW"    name="child" altenum="Window" />
+        <field type="INT16"     name="root_x" />
+        <field type="INT16"     name="root_y" />
+        <field type="INT16"     name="event_x" />
+        <field type="INT16"     name="event_y" />
+        <field type="CARD16"    name="state" />
+        <field type="BOOL"      name="same_screen" />
+        <field type="CARD8"     name="device_id" />
     </event>
 
-    <eventcopy name="DeviceKeyRelease" number="2" ref="DeviceKeyPress" />
-    <eventcopy name="DeviceButtonPress" number="3" ref="DeviceKeyPress" />
+    <eventcopy name="DeviceKeyRelease"    number="2" ref="DeviceKeyPress" />
+    <eventcopy name="DeviceButtonPress"   number="3" ref="DeviceKeyPress" />
     <eventcopy name="DeviceButtonRelease" number="4" ref="DeviceKeyPress" />
-    <eventcopy name="DeviceMotionNotify" number="5" ref="DeviceKeyPress" />
-    <eventcopy name="ProximityIn" number="8" ref="DeviceKeyPress" />
-    <eventcopy name="ProximityOut" number="9" ref="DeviceKeyPress" />
-
-    <event name="FocusIn" number="6">
-	<field type="BYTE" name="detail" enum="NotifyDetail" />
-	<field type="TIMESTAMP" name="time" />
-	<field type="WINDOW" name="window" />
-	<field type="BYTE" name="mode" enum="NotifyMode" />
-	<field type="CARD8" name="device_id" />
-	<pad bytes="18" />
+    <eventcopy name="DeviceMotionNotify"  number="5" ref="DeviceKeyPress" />
+
+    <event name="DeviceFocusIn" number="6">
+        <field type="BYTE"      name="detail" enum="NotifyDetail" />
+        <field type="TIMESTAMP" name="time" />
+        <field type="WINDOW"    name="window" />
+        <field type="BYTE"      name="mode" enum="NotifyMode" />
+        <field type="CARD8"     name="device_id" />
+        <pad bytes="18" />
     </event>
 
-    <eventcopy name="FocusOut" number="7" ref="FocusIn" />
+    <eventcopy name="DeviceFocusOut" number="7" ref="DeviceFocusIn" />
+    <eventcopy name="ProximityIn"    number="8" ref="DeviceKeyPress" />
+    <eventcopy name="ProximityOut"   number="9" ref="DeviceKeyPress" />
 
     <event name="DeviceStateNotify" number="10">
-	<field type="BYTE" name="device_id" />
-	<field type="TIMESTAMP" name="time" />
-	<field type="CARD8" name="num_keys" />
-	<field type="CARD8" name="num_buttons" />
-	<field type="CARD8" name="num_valuators" />
-	<field type="CARD8" name="classes_reported" />
-	<list type="CARD8" name="buttons">
+        <field type="BYTE"      name="device_id" />
+        <field type="TIMESTAMP" name="time" />
+        <field type="CARD8"     name="num_keys" />
+        <field type="CARD8"     name="num_buttons" />
+        <field type="CARD8"     name="num_valuators" />
+        <field type="CARD8"     name="classes_reported" />
+        <list type="CARD8"      name="buttons">
             <value>4</value>
-	</list>
-	<list type="CARD8" name="keys">
+        </list>
+        <list type="CARD8" name="keys">
             <value>4</value>
-	</list>
-	<list type="CARD32" name="valuators">
-	    <value>3</value>
-	</list>
+        </list>
+        <list type="CARD32" name="valuators">
+            <value>3</value>
+        </list>
     </event>
 
     <event name="DeviceMappingNotify" number="11">
-	<field type="BYTE" name="device_id" />
-	<field type="CARD8" name="request" />
-	<field type="KeyCode" name="first_keycode" />
-	<field type="CARD8" name="count" />
-	<pad bytes="1" />
-	<field type="TIMESTAMP" name="time" />
-	<pad bytes="20" />
+        <field type="BYTE"    name="device_id" />
+        <field type="CARD8"   name="request" />
+        <field type="KeyCode" name="first_keycode" />
+        <field type="CARD8"   name="count" />
+        <pad bytes="1" />
+        <field type="TIMESTAMP" name="time" />
+        <pad bytes="20" />
     </event>
 
     <event name="ChangeDeviceNotify" number="12">
-	<field type="BYTE" name="device_id" />
-	<field type="TIMESTAMP" name="time" />
-	<field type="CARD8" name="request" />
-	<pad bytes="23" />
+        <field type="BYTE"      name="device_id" />
+        <field type="TIMESTAMP" name="time" />
+        <field type="CARD8"     name="request" />
+        <pad bytes="23" />
     </event>
 
     <event name="DeviceKeyStateNotify" number="13">
-	<field type="BYTE" name="device_id" />
-	<list type="CARD8" name="keys">
+        <field type="BYTE" name="device_id" />
+        <list type="CARD8" name="keys">
             <value>28</value>
-	</list>
+        </list>
     </event>
 
     <event name="DeviceButtonStateNotify" number="14">
-	<field type="BYTE" name="device_id" />
-	<list type="CARD8" name="buttons">
+        <field type="BYTE" name="device_id" />
+        <list type="CARD8" name="buttons">
             <value>28</value>
-	</list>
+        </list>
     </event>
 
+    <!-- ⋅⋅⋅ Events (v1.4) ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ -->
+
+    <enum name="DeviceChange">
+        <item name="Added" />
+        <item name="Removed" />
+        <item name="Enabled" />
+        <item name="Disabled" />
+        <item name="Unrecoverable" />
+        <item name="ControlChanged" />
+    </enum>
+
     <event name="DevicePresenceNotify" number="15">
         <pad bytes="1" />
         <field type="TIMESTAMP" name="time" />
-        <field type="BYTE" name="devchange" />
-        <field type="BYTE" name="device_id" />
-        <field type="CARD16" name="control" />
-	<pad bytes="20" />
+        <field type="BYTE"      name="devchange" enum="DeviceChange" />
+        <field type="BYTE"      name="device_id" />
+        <field type="CARD16"    name="control" />
+        <pad bytes="20" />
     </event>
 
-    <!-- ERRORS -->
-    <error name="Device" number="0" />
-    <error name="Event" number="1" />
-    <error name="Mode" number="2" />
+    <!-- ⋅⋅⋅ Errors (v1.0) ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ -->
+
+    <error name="Device"     number="0" />
+    <error name="Event"      number="1" />
+    <error name="Mode"       number="2" />
     <error name="DeviceBusy" number="3" />
-    <error name="Class" number="4" />
+    <error name="Class"      number="4" />
 
 </xcb>
-- 
1.8.0.3



More information about the Xcb mailing list