[Xcb] [PATCH proto 03/10] xinput: struct DeviceState: full support
Christian Linhart
chris at demorecorder.com
Thu Sep 4 01:53:14 PDT 2014
replace uninterpreted_data by switch-case
this is needed by reply GetDeviceControl.
spec:
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt?id=inputproto-2.3.1#n640
http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml?id=libXi-1.7.4#n1856
Note: Only the DeviceControl of type DeviceResolution is defined in both specs.
( this is struct name="DeviceResolutionState" in the xml. )
The other DeviceControls are not defined in any of the specs.
code:
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI.h?id=inputproto-2.3.1#n170
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XIproto.h?id=inputproto-2.3.1#n1263
---
src/xinput.xml | 54 +++++++++++++++++++++++++++++++++++++++++++++++-------
1 file changed, 47 insertions(+), 7 deletions(-)
diff --git a/src/xinput.xml b/src/xinput.xml
index 8dec32f..5da79b1 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, ... )
-* 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"
*****
@@ -1091,20 +1090,61 @@ <struct name="DeviceEnableState">
<field type="CARD8" name="enable" />
<pad bytes="3" />
</struct>
<struct name="DeviceState">
<field type="CARD16" name="control_id" enum="DeviceControl" />
<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>control_id</fieldref>
+ <case name="resolution">
+ <enumref ref="DeviceControl">resolution</enumref>
+ <field type="CARD32" name="num_valuators" />
+ <list type="CARD32" name="resolution_values">
+ <fieldref>num_valuators</fieldref>
+ </list>
+ <list type="CARD32" name="resolution_min">
+ <fieldref>num_valuators</fieldref>
+ </list>
+ <list type="CARD32" name="resolution_max">
+ <fieldref>num_valuators</fieldref>
+ </list>
+ </case>
+ <case name="abs_calib">
+ <enumref ref="DeviceControl">abs_calib</enumref>
+ <field type="INT32" name="min_x" />
+ <field type="INT32" name="max_x" />
+ <field type="INT32" name="min_y" />
+ <field type="INT32" name="max_y" />
+ <field type="CARD32" name="flip_x" />
+ <field type="CARD32" name="flip_y" />
+ <field type="CARD32" name="rotation" />
+ <field type="CARD32" name="button_threshold" />
+ </case>
+ <case name="core">
+ <enumref ref="DeviceControl">core</enumref>
+ <field type="CARD8" name="status" />
+ <field type="CARD8" name="iscore" />
+ <pad bytes="2" />
+ </case>
+ <case name="enable">
+ <enumref ref="DeviceControl">enable</enumref>
+ <field type="CARD8" name="enable" />
+ <pad bytes="3" />
+ </case>
+ <case name="abs_area">
+ <enumref ref="DeviceControl">abs_area</enumref>
+ <field type="CARD32" name="offset_x" />
+ <field type="CARD32" name="offset_y" />
+ <field type="CARD32" name="width" />
+ <field type="CARD32" name="height" />
+ <field type="CARD32" name="screen" />
+ <field type="CARD32" name="following" />
+ </case>
+ </switch>
</struct>
<request name="GetDeviceControl" opcode="34">
<field type="CARD16" name="control_id" enum="DeviceControl" />
<field type="CARD8" name="device_id" />
<pad bytes="1" />
<reply>
--
2.0.1
More information about the Xcb
mailing list