[Xcb] [PATCH proto 4/5] xinput: replace initial pad of xinput1.x replies with field

Christian Linhart chris at demorecorder.com
Mon Aug 18 07:41:22 PDT 2014


Replace the initial 1-byte pad of Xinput-1.x replies
with CARD8-field "xi_reply_type", according to XIproto.h.

This may also help to implement assertions
based on the value of that field.

reference:
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XIproto.h#n187
http://cgit.freedesktop.org/xorg/xserver/tree/Xi/getvers.c#n103
---
 src/xinput.xml | 46 +++++++++++++++++++++++-----------------------
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/src/xinput.xml b/src/xinput.xml
index b55ce3a..4ee55f8 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -59,15 +59,15 @@ <struct name="FP3232">
     <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="CARD8"  name="xi_reply_type" />
             <field type="CARD16" name="server_major" />
             <field type="CARD16" name="server_minor" />
             <field type="BOOL"   name="present" />
             <pad bytes="19" />
         </reply>
     </request>
 
@@ -157,15 +157,15 @@ <struct name="DeviceName">
         <list type="char"  name="string">
             <fieldref>len</fieldref>
         </list>
     </struct>
 
     <request name="ListInputDevices" opcode="2">
         <reply>
-            <pad bytes="1" />
+            <field type="CARD8" name="xi_reply_type" />
             <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 -->
@@ -180,15 +180,15 @@ <struct name="InputClassInfo">
         <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="xi_reply_type" />
             <field type="CARD8" name="num_classes" />
             <pad bytes="23" />
             <list type="InputClassInfo" name="class_info">
                 <fieldref>num_classes</fieldref>
             </list>
             <pad align="4" />
         </reply>
@@ -204,15 +204,15 @@ <request name="CloseDevice" opcode="4">
     <!-- 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="xi_reply_type" />
             <!-- values for status: 0: Success, 1: AlreadyGrabbed -->
             <field type="CARD8" name="status" enum="GrabStatus" />
             <pad bytes="23" />
         </reply>
     </request>
 
     <!-- SelectExtensionEvent -->
@@ -227,15 +227,15 @@ <request name="SelectExtensionEvent" opcode="6">
     </request>
 
     <!-- GetSelectedExtensionEvents -->
 
     <request name="GetSelectedExtensionEvents" opcode="7">
         <field type="WINDOW" name="window" />
         <reply>
-            <pad bytes="1" />
+            <field type="CARD8"  name="xi_reply_type" />
             <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">
@@ -262,15 +262,15 @@ <request name="ChangeDeviceDontPropagateList" opcode="8">
     </request>
 
     <!-- GetDeviceDontPropagateList -->
 
     <request name="GetDeviceDontPropagateList" opcode="9">
         <field type="WINDOW" name="window" />
         <reply>
-            <pad bytes="1" />
+            <field type="CARD8"  name="xi_reply_type" />
             <field type="CARD16" name="num_classes" />
             <pad bytes="22" />
             <list type="EventClass" name="classes">
                 <fieldref>num_classes</fieldref>
             </list>
         </reply>
     </request>
@@ -285,30 +285,30 @@ <struct name="DeviceTimeCoord">
 
     <request name="GetDeviceMotionEvents" opcode="10">
         <field type="TIMESTAMP" name="start" />
         <field type="TIMESTAMP" name="stop" altenum="Time" />
         <field type="CARD8"     name="device_id" />
         <pad bytes="3"/>
         <reply>
-            <pad bytes="1" />
+            <field type="CARD8"  name="xi_reply_type" />
             <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="xi_reply_type" />
             <!-- only the following GrabStatus-values are valid here:
                  "Success", "AlreadyGrabbed", and "Frozen" 
             -->
             <field type="CARD8" name="status" enum="GrabStatus" />
             <pad bytes="23" />
         </reply>
     </request>
@@ -317,15 +317,15 @@ <request name="ChangeKeyboardDevice" opcode="11">
 
     <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="xi_reply_type" />
             <!-- only the following GrabStatus-values are valid here:
                  "Success", "AlreadyGrabbed", and "Frozen" 
             -->
             <field type="CARD8" name="status" enum="GrabStatus" />
             <pad bytes="23" />
         </reply>
     </request>
@@ -341,15 +341,15 @@ <request name="GrabDevice" opcode="13">
         <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="xi_reply_type" />
             <field type="CARD8" name="status" enum="GrabStatus" />
             <pad bytes="23" />
         </reply>
     </request>
 
     <!-- UngrabDevice -->
 
@@ -440,15 +440,15 @@ <request name="AllowDeviceEvents" opcode="19">
 
     <!-- GetDeviceFocus -->
 
     <request name="GetDeviceFocus" opcode="20">
         <field type="CARD8" name="device_id" />
         <pad bytes="3" />
         <reply>
-            <pad bytes="1" />
+            <field type="CARD8"     name="xi_reply_type" />
             <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>
 
@@ -550,15 +550,15 @@ <struct name="FeedbackState">
         </list>
     </struct>
 
     <request name="GetFeedbackControl" opcode="22">
         <field type="CARD8" name="device_id" />
         <pad bytes="3" />
         <reply>
-            <pad bytes="1" />
+            <field type="CARD8"  name="xi_reply_type" />
             <field type="CARD16" name="num_feedbacks" />
             <pad bytes="22" />
             <list type="FeedbackState" name="feedbacks">
                 <fieldref>num_feedbacks</fieldref>
             </list>
         </reply>
     </request>
@@ -665,15 +665,15 @@ <request name="ChangeFeedbackControl" opcode="23">
 
     <request name="GetDeviceKeyMapping" opcode="24">
         <field type="CARD8"   name="device_id" />
         <field type="KeyCode" name="first_keycode" />
         <field type="CARD8"   name="count" />
         <pad bytes="1" />
         <reply>
-            <pad bytes="1" />
+            <field type="CARD8" name="xi_reply_type" />
             <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>
@@ -696,15 +696,15 @@ <request name="ChangeDeviceKeyMapping" opcode="25">
 
     <!-- GetDeviceModifierMapping -->
 
     <request name="GetDeviceModifierMapping" opcode="26">
         <field type="CARD8" name="device_id" />
         <pad bytes="3" />
         <reply>
-            <pad bytes="1" />
+            <field type="CARD8" name="xi_reply_type" />
             <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>
@@ -721,27 +721,27 @@ <request name="SetDeviceModifierMapping" opcode="27">
         <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="xi_reply_type" />
             <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="xi_reply_type" />
             <field type="CARD8" name="map_size" />
             <pad bytes="23" />
             <list type="CARD8" name="map">
                 <fieldref>map_size</fieldref>
             </list>
             <pad align="4" />
         </reply>
@@ -753,15 +753,15 @@ <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="xi_reply_type" />
             <field type="CARD8" name="status" enum="MappingStatus" />
             <pad bytes="23" />
         </reply>
     </request>
 
     <!-- QueryDeviceState -->
 
@@ -813,15 +813,15 @@ <struct name="InputState">
         </list>
     </struct>
 
     <request name="QueryDeviceState" opcode="30">
         <field type="CARD8" name="device_id" />
         <pad bytes="3" />
         <reply>
-            <pad bytes="1" />
+            <field type="CARD8" name="xi_reply_type" />
             <field type="CARD8" name="num_classes" />
             <pad bytes="23" />
             <list type="InputState" name="classes">
                 <fieldref>num_classes</fieldref>
             </list>
         </reply>
     </request>
@@ -862,15 +862,15 @@ <request name="SetDeviceValuators" opcode="33">
         <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="xi_reply_type" />
             <field type="CARD8" name="status" enum="GrabStatus" />
             <pad bytes="23" />
         </reply>
     </request>
 
     <!-- GetDeviceControl -->
 
@@ -948,15 +948,15 @@ <struct name="DeviceState">
     </struct>
 
     <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="xi_reply_type" />
             <field type="CARD8" name="status" altenum="GrabStatus" />
             <pad bytes="23" />
             <field type="DeviceState" name="control" />
         </reply>
     </request>
 
     <!-- ChangeDeviceControl -->
@@ -1023,29 +1023,29 @@ <struct name="DeviceCtl">
 
     <request name="ChangeDeviceControl" opcode="35">
         <field type="CARD16" name="control_id" enum="DeviceControl" />
         <field type="CARD8"  name="device_id" />
         <pad bytes="1" />
         <field type="DeviceCtl" name="control" />
         <reply>
-            <pad bytes="1" />
+            <field type="CARD8" name="xi_reply_type" />
             <field type="CARD8" name="status" altenum="GrabStatus" />
             <pad bytes="23" />
         </reply>
     </request>
 
     <!-- ⋅⋅⋅ Requests (v1.5) ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ -->
 
     <!-- ListDeviceProperties -->
 
     <request name="ListDeviceProperties" opcode="36">
         <field type="CARD8"  name="device_id" />
         <pad bytes="3" />
         <reply>
-            <pad bytes="1" />
+            <field type="CARD8"  name="xi_reply_type" />
             <field type="CARD16" name="num_atoms" />
             <pad bytes="22" />
             <list type="ATOM" name="atoms">
                 <fieldref>num_atoms</fieldref>
             </list>
         </reply>
     </request>
@@ -1110,15 +1110,15 @@ <request name="GetDeviceProperty" opcode="39">
         <field type="ATOM"   name="type" />
         <field type="CARD32" name="offset" />
         <field type="CARD32" name="len" />
         <field type="CARD8"  name="device_id" />
         <field type="BOOL"   name="delete" />
         <pad bytes="2" />
         <reply>
-            <pad bytes="1" />
+            <field type="CARD8"  name="xi_reply_type" />
             <field type="ATOM"   name="type" />
             <field type="CARD32" name="bytes_after" />
             <field type="CARD32" name="num_items" />
             <field type="CARD8"  name="format" enum="PropertyFormat" />
             <field type="CARD8"  name="device_id" />
             <pad bytes="10" />
             <switch name="items">
-- 
2.0.1



More information about the Xcb mailing list