[Xcb] [PATCH proto 05/10] xinput: struct HierarchyChange: full support

Christian Linhart chris at demorecorder.com
Thu Sep 4 01:53:16 PDT 2014


replace uninterpreted_data by switch-case

this is needed by request XIChangeHierarchy.

spec:
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XI2proto.txt?id=inputproto-2.3.1#n1170

code:
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI2.h?id=inputproto-2.3.1#n118
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI2proto.h?id=inputproto-2.3.1#n444
---
 src/xinput.xml | 41 +++++++++++++++++++++++++++++++----------
 1 file changed, 31 insertions(+), 10 deletions(-)

diff --git a/src/xinput.xml b/src/xinput.xml
index a0839af..e5d0d39 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -43,15 +43,14 @@
 This requires enhancements to the xml-schema and generator such as union with selector.
 
 This will, e.g., be necessary for automatically generated byte-order conversion code,
 which will, e.g., be necessary for server-side xcb.
 
 This affects the following:
 * QueryDeviceState reply field "classes" ( structs InputState, ... )
-* XIChangeHierarchy request field "changes" ( structs  HierarchyChange, ... )
 * struct XIDeviceInfo field "classes" ( structs DeviceClass, ... )
 * SendExtensionEvent member "events"
 
 *****
 
 xml and generator have to support <popcount> of all members of a list
 
@@ -1497,23 +1496,45 @@ <struct name="DetachSlave">
         <field type="DeviceId" name="deviceid" altenum="Device" />
         <pad bytes="2" />
     </struct>
 
     <struct name="HierarchyChange">
         <field type="CARD16" name="type" enum="HierarchyChangeType" />
         <field type="CARD16" name="len" />
-        <list type="CARD8" name="uninterpreted_data">
-            <op op="-">
-                <op op="*">
-                    <fieldref>len</fieldref>
-                    <value>4</value>
-                </op>
-                <value>4</value>
-            </op>
-        </list>
+        <switch name="data">
+            <fieldref>type</fieldref>
+            <case name="add_master">
+                <enumref ref="HierarchyChangeType">AddMaster</enumref>
+                <field type="CARD16" name="name_len" />
+                <field type="BOOL"   name="send_core" />
+                <field type="BOOL"   name="enable" />
+                <list type="char" name="name">
+                    <fieldref>name_len</fieldref>
+                </list>
+                <pad align="4" />
+            </case>
+            <case name="remove_master">
+                <enumref ref="HierarchyChangeType">RemoveMaster</enumref>
+                <field type="DeviceId" name="deviceid" altenum="Device" />
+                <field type="CARD8"    name="return_mode" enum="ChangeMode" />
+                <pad bytes="1" />
+                <field type="DeviceId" name="return_pointer" altenum="Device" />
+                <field type="DeviceId" name="return_keyboard" altenum="Device" />
+            </case>
+            <case name="attach_slave">
+                <enumref ref="HierarchyChangeType">AttachSlave</enumref>
+                <field type="DeviceId" name="deviceid" altenum="Device" />
+                <field type="DeviceId" name="master" altenum="Device" />
+            </case>
+            <case name="detach_slave">
+                <enumref ref="HierarchyChangeType">DetachSlave</enumref>
+                <field type="DeviceId" name="deviceid" altenum="Device" />
+                <pad bytes="2" />
+            </case>
+        </switch>
     </struct>
 
     <request name="XIChangeHierarchy" opcode="43">
         <field type="CARD8" name="num_changes" />
         <pad bytes="3" />
         <list type="HierarchyChange" name="changes">
             <fieldref>num_changes</fieldref>
-- 
2.0.1



More information about the Xcb mailing list