[Xcb] [PATCH proto 3/5] xinput: add non-default start-aligns for switches and cases

Christian Linhart chris at demorecorder.com
Sun Nov 1 09:26:32 PST 2015


Especially, these start-aligns have non-zero offsets.

Signed-off-by: Christian Linhart <chris at demorecorder.com>
---
 src/xinput.xml | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/xinput.xml b/src/xinput.xml
index 6564f4c..94855ba 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -169,27 +169,29 @@ <struct name="ValuatorInfo">
     </struct>
 
     <struct name="InputInfo">
         <field type="CARD8" name="class_id" enum="InputClass" />
         <field type="CARD8" name="len" />
         <switch name="info">
             <fieldref>class_id</fieldref>
+            <required_start_align align="4" offset="2" />
             <case name="key">
                 <enumref ref="InputClass">Key</enumref>
                 <field type="KeyCode" name="min_keycode" />
                 <field type="KeyCode" name="max_keycode" />
                 <field type="CARD16"  name="num_keys" />
                 <pad bytes="2" />
             </case>
             <case name="button">
                 <enumref ref="InputClass">Button</enumref>
                 <field type="CARD16"    name="num_buttons" />
             </case>
             <case name="valuator">
                 <enumref ref="InputClass">Valuator</enumref>
+                <required_start_align align="4" offset="2" />
                 <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>
             </case>
@@ -937,16 +939,18 @@ <struct name="ValuatorState">
     </struct>
 
     <struct name="InputState">
         <field type="CARD8" name="class_id" enum="InputClass" />
         <field type="CARD8" name="len" />
         <switch name="data">
             <fieldref>class_id</fieldref>
+            <required_start_align align="4" offset="2" />
             <case name="key">
                 <enumref ref="InputClass">Key</enumref>
+                <required_start_align align="4" offset="2" />
                 <field type="CARD8" name="num_keys" />
                 <pad bytes="1" />
                 <list type="CARD8" name="keys">
                     <value>32</value>
                 </list>
             </case>
             <case name="button">
@@ -955,14 +959,15 @@ <struct name="InputState">
                 <pad bytes="1" />
                 <list type="CARD8" name="buttons">
                     <value>32</value>
                 </list>
             </case>
             <case name="valuator">
                 <enumref ref="InputClass">Valuator</enumref>
+                <required_start_align align="4" offset="2" />
                 <field type="CARD8" name="num_valuators" />
                 <field type="CARD8" name="mode" mask="ValuatorStateModeMask" />
                 <list type="INT32" name="valuators">
                     <fieldref>num_valuators</fieldref>
                 </list>
             </case>
         </switch>
@@ -1722,23 +1727,26 @@ <struct name="ValuatorClass">
 
     <struct name="DeviceClass">
         <field type="CARD16"   name="type" enum="DeviceClassType" />
         <field type="CARD16"   name="len" />
         <field type="DeviceId" name="sourceid" />
 	<switch name="data">
 	    <fieldref>type</fieldref>
+	    <required_start_align align="4" offset="2" />
 	    <case name="key">
 		<enumref ref="DeviceClassType">Key</enumref>
+		<required_start_align align="4" offset="2" />
 		<field type="CARD16"   name="num_keys" />
 		<list type="CARD32" name="keys">
 		    <fieldref>num_keys</fieldref>
 		</list>
 	    </case>
 	    <case name="button">
 		<enumref ref="DeviceClassType">Button</enumref>
+		<required_start_align align="4" offset="2" />
 		<field type="CARD16"   name="num_buttons" />
 		<list type="CARD32"    name="state">
 		    <op op="/">
 		        <op op="+">
 		            <fieldref>num_buttons</fieldref>
 		            <value>31</value>
 		        </op>
@@ -1747,25 +1755,27 @@ <struct name="DeviceClass">
 		</list>
 		<list type="ATOM" name="labels">
 		    <fieldref>num_buttons</fieldref>
 		</list>
 	    </case>
 	    <case name="valuator">
 		<enumref ref="DeviceClassType">Valuator</enumref>
+		<required_start_align align="4" offset="2" />
 		<field type="CARD16"   name="number" />
 		<field type="ATOM"     name="label" />
 		<field type="FP3232"   name="min" />
 		<field type="FP3232"   name="max" />
 		<field type="FP3232"   name="value" />
 		<field type="CARD32"   name="resolution" />
 		<field type="CARD8"    name="mode" enum="ValuatorMode" />
 		<pad bytes="3" />
 	    </case>
 	    <case name="scroll">
 		<enumref ref="DeviceClassType">Scroll</enumref>
+                <required_start_align align="4" offset="2" />
 		<field type="CARD16"   name="number" />
 		<field type="CARD16"   name="scroll_type" enum="ScrollType" />
 		<pad bytes="2" />
 		<field type="CARD32"   name="flags" mask="ScrollFlags" />
 		<field type="FP3232"   name="increment" />
 	    </case>
 	    <case name="touch">
-- 
2.1.4



More information about the Xcb mailing list