[Xcb] [PATCH proto 02/10] xinput: struct FeedbackCtl: full support

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


replace uninterpreted_data by switch-case

this is needed by request ChangeFeedbackControl.

spec:
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt?id=inputproto-2.3.1#n1719
http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml?id=libXi-1.7.4#n1445

code:
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI.h?id=inputproto-2.3.1#n244
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XIproto.h?id=inputproto-2.3.1#n862
---
 src/xinput.xml | 52 +++++++++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 45 insertions(+), 7 deletions(-)

diff --git a/src/xinput.xml b/src/xinput.xml
index c7e57a5..8dec32f 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -42,15 +42,14 @@
 with a semantic that shows how to interpret this data.
 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:
-* ChangeFeedbackControl request field "feedback" ( structs FeedbackCtl, ... )
 * QueryDeviceState reply field "classes" ( structs InputState, ... )
 * GetDeviceControl reply field "control"  ( structs DeviceState, ... )
 * ChangeDeviceControl request field "control" ( structs ChangeDeviceControl, ... )
 * XIChangeHierarchy request field "changes" ( structs  HierarchyChange, ... )
 * struct XIDeviceInfo field "classes" ( structs DeviceClass, ... )
 * SendExtensionEvent member "events"
 
@@ -724,20 +723,59 @@ <struct name="LedFeedbackCtl">
         <field type="CARD32" name="led_values" />
     </struct>
 
     <struct name="FeedbackCtl">
         <field type="CARD8"  name="class_id" enum="FeedbackClass" />
         <field type="CARD8"  name="feedback_id" />
         <field type="CARD16" name="len" />
-        <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="keyboard">
+                <enumref ref="FeedbackClass">Keyboard</enumref>
+		<field type="KeyCode" name="key" />
+		<field type="CARD8"   name="auto_repeat_mode" />
+		<field type="INT8"    name="key_click_percent" />
+		<field type="INT8"    name="bell_percent" />
+		<field type="INT16"   name="bell_pitch" />
+		<field type="INT16"   name="bell_duration" />
+		<field type="CARD32"  name="led_mask" />
+		<field type="CARD32"  name="led_values" />
+            </case>
+            <case name="pointer">
+                <enumref ref="FeedbackClass">Pointer</enumref>
+		<pad bytes="2" />
+		<field type="INT16"  name="num" />
+		<field type="INT16"  name="denom" />
+		<field type="INT16"  name="threshold" />
+            </case>
+            <case name="string">
+                <enumref ref="FeedbackClass">String</enumref>
+		<pad bytes="2" />
+		<field type="CARD16" name="num_keysyms" />
+		<list type="KEYSYM"  name="keysyms">
+		    <fieldref>num_keysyms</fieldref>
+		</list>
+            </case>
+            <case name="integer">
+                <enumref ref="FeedbackClass">Integer</enumref>
+	        <field type="INT32"  name="int_to_display" />
+            </case>
+            <case name="led">
+                <enumref ref="FeedbackClass">Led</enumref>
+		<field type="CARD32" name="led_mask" />
+		<field type="CARD32" name="led_values" />
+            </case>
+            <case name="bell">
+                <enumref ref="FeedbackClass">Bell</enumref>
+		<field type="INT8"   name="percent" />
+		<pad bytes="3" />
+		<field type="INT16"  name="pitch" />
+		<field type="INT16"  name="duration" />
+            </case>
+	</switch>
     </struct>
 
     <enum name="ChangeFeedbackControlMask">
         <item name="KeyClickPercent">  <bit>0</bit> </item> <!-- 0x01 -->
         <item name="Percent">          <bit>1</bit> </item> <!-- 0x02 -->
         <item name="Pitch">            <bit>2</bit> </item> <!-- 0x04 -->
         <item name="Duration">         <bit>3</bit> </item> <!-- 0x08 -->
-- 
2.0.1



More information about the Xcb mailing list