[Xcb-commit] xcb/proto: src

Peter Harris peterh at kemper.freedesktop.org
Thu Oct 30 08:59:49 PDT 2014


 src/xinput.xml |   37 ++++++++++++++++++++++++++++---------
 1 file changed, 28 insertions(+), 9 deletions(-)

New commits:
commit 691d2b97e5989d6d7006304d81bd8fa128477ca1
Author: Christian Linhart <chris at DemoRecorder.com>
Date:   Fri Aug 29 19:35:50 2014 +0200

    xinput: rep QueryDeviceState struct InputState: full support
    
    Full support for the QueryDeviceState reply.
    This has been done by changing the struct InputState
    with using switch-case and implicit-padding="false".
    
    Also fixed the type of field valuators of struct ValuatorState
    from CARD32 to INT32.
    
    V2: patch revised:
    * removed the implicit-padding="false" attribute, according
      to the discussion in this thread.
    * give names to the cases, which generates more beautiful code.
    
    spec:
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt?id=inputproto-2.3.1#n2082
    http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml?id=libXi-1.7.4#n1728
    
    Message-ID: <5400B9F6.5000208 at DemoRecorder.com>
    Patch-Thread-Subject: [Xcb] xinput:QueryDeviceState: full-support: generator and xml-changes
    Patch-Set: QueryDeviceState
    Patch-Number: proto 2/2
    Patch-Version: V2
    Signed-off-by: Christian Linhart <chris at DemoRecorder.com>
    Reviewed-By: Ran Benita <ran234 at gmail.com>

diff --git a/src/xinput.xml b/src/xinput.xml
index dc87e78..7f7b0a6 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -862,7 +862,7 @@ in struct DeviceTimeCoord.
         <field type="CARD8" name="len" />
         <field type="CARD8" name="num_valuators" />
         <field type="CARD8" name="mode" mask="ValuatorStateModeMask" />
-        <list type="CARD32" name="valuators">
+        <list type="INT32" name="valuators">
             <fieldref>num_valuators</fieldref>
         </list>
     </struct>
@@ -870,14 +870,33 @@ in struct DeviceTimeCoord.
     <struct name="InputState">
         <field type="CARD8" name="class_id" enum="InputClass" />
         <field type="CARD8" name="len" />
-        <field type="CARD8" name="num_items" />
-        <pad bytes="1" />
-        <list type="CARD8" name="uninterpreted_data">
-            <op op="-">
-                <fieldref>len</fieldref>
-                <value>4</value>
-            </op>
-        </list>
+        <switch name="data">
+            <fieldref>class_id</fieldref>
+            <case name="key">
+                <enumref ref="InputClass">Key</enumref>
+                <field type="CARD8" name="num_keys" />
+                <pad bytes="1" />
+                <list type="CARD8" name="keys">
+                    <value>32</value>
+                </list>
+            </case>
+            <case name="button">
+                <enumref ref="InputClass">Button</enumref>
+                <field type="CARD8" name="num_buttons" />
+                <pad bytes="1" />
+                <list type="CARD8" name="buttons">
+                    <value>32</value>
+                </list>
+            </case>
+            <case name="valuator">
+                <enumref ref="InputClass">Valuator</enumref>
+                <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>
     </struct>
 
     <request name="QueryDeviceState" opcode="30">


More information about the xcb-commit mailing list