[Xcb] [PATCH proto 2/2] xinput: Example for sizeof in struct on InputState

Daniel Martin consume.noise at gmail.com
Sun Dec 23 06:29:25 PST 2012


DO NOT COMMIT.

This is an example how the sizeof tag in a struct can be used.

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

diff --git a/src/xinput.xml b/src/xinput.xml
index 80416fe..29860c7 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -681,7 +681,9 @@ authorization from the authors.
 	    <pad bytes="1" />
 	    <field type="CARD8" name="num_classes" />
 	    <pad bytes="23" />
-	    <!-- Uninterpreted: list of InputState structures -->
+            <list type="InputState" name="classes">
+                <fieldref>num_classes</fieldref>
+            </list>
 	</reply>
     </request>
 
@@ -689,6 +691,10 @@ authorization from the authors.
 	<field type="CARD8" name="class_id" enum="InputClass" />
 	<field type="CARD8" name="len" />
 	<field type="CARD8" name="num_items" />
+
+        <sizeof>
+            <fieldref>len</fieldref>
+        </sizeof>
     </struct>
 
     <struct name="KeyState">
-- 
1.8.0.2



More information about the Xcb mailing list