[Xcb] [PATCH proto 01/10] xinput: struct FeedbackState: full support
Christian Linhart
chris at demorecorder.com
Thu Sep 4 01:53:12 PDT 2014
replace uninterpreted_data by switch-case
this is needed by reply GetFeedbackControl.
spec:
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt?id=inputproto-2.3.1#n1613
http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml?id=libXi-1.7.4#n1341
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#n754
---
src/xinput.xml | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++-------
1 file changed, 50 insertions(+), 7 deletions(-)
diff --git a/src/xinput.xml b/src/xinput.xml
index 59694dd..c7e57a5 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:
-* GetFeedbackControl reply field "feedbacks" ( structs FeedbackState, ... )
* 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"
@@ -594,20 +593,64 @@ <struct name="LedFeedbackState">
<field type="CARD32" name="led_values" />
</struct>
<struct name="FeedbackState">
<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="CARD16" name="pitch" />
+ <field type="CARD16" name="duration" />
+ <field type="CARD32" name="led_mask" />
+ <field type="CARD32" name="led_values" />
+ <field type="BOOL" name="global_auto_repeat" />
+ <field type="CARD8" name="click" />
+ <field type="CARD8" name="percent" />
+ <pad bytes="1" />
+ <list type="CARD8" name="auto_repeats">
+ <value>32</value>
+ </list>
+ </case>
+ <case name="pointer">
+ <enumref ref="FeedbackClass">Pointer</enumref>
+ <pad bytes="2" />
+ <field type="CARD16" name="accel_num" />
+ <field type="CARD16" name="accel_denom" />
+ <field type="CARD16" name="threshold" />
+ </case>
+ <case name="string">
+ <enumref ref="FeedbackClass">String</enumref>
+ <field type="CARD16" name="max_symbols" />
+ <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="CARD32" name="resolution" />
+ <field type="INT32" name="min_value" />
+ <field type="INT32" name="max_value" />
+ </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="CARD8" name="percent" />
+ <pad bytes="3" />
+ <field type="CARD16" name="pitch" />
+ <field type="CARD16" name="duration" />
+ </case>
+ </switch>
</struct>
<request name="GetFeedbackControl" opcode="22">
<field type="CARD8" name="device_id" />
<pad bytes="3" />
<reply>
<field type="CARD8" name="xi_reply_type" />
--
2.0.1
More information about the Xcb
mailing list