[Xcb] [PATCH proto 2/2] xinput: Add XI version 1.5
Peter Hutterer
peter.hutterer at who-t.net
Thu Jan 3 22:03:10 PST 2013
On Thu, Jan 03, 2013 at 08:49:29PM +0100, Daniel Martin wrote:
> Added requests:
> - ListDeviceProperties
> - ChangeDeviceProperty
> - DeleteDeviceProperty
> - GetDeviceProperty
>
> Added event:
> - DevicePropertyNotify
>
> Added enums:
> - PropertyFormat
> - PropertyMode
> ---
> src/xinput.xml | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 97 insertions(+), 1 deletion(-)
>
> diff --git a/src/xinput.xml b/src/xinput.xml
> index e9cc9e5..0cbe77a 100644
> --- a/src/xinput.xml
> +++ b/src/xinput.xml
> @@ -29,7 +29,7 @@ authorization from the authors.
> <!-- Spec: http://refspecs.freestandards.org/X11/Xinput.pdf -->
>
> <xcb header="xinput" extension-xname="XInputExtension" extension-name="Input"
> - major-version="1" minor-version="4">
> + major-version="1" minor-version="5">
> <import>xproto</import>
>
> <typedef oldname="CARD8" newname="KeyCode" />
> @@ -1014,6 +1014,92 @@ authorization from the authors.
> <field type="CARD16" name="control_id" enum="DeviceControl" />
> </union>
>
> + <!-- ListDeviceProperties -->
> +
> + <request name="ListDeviceProperties" opcode="36">
> + <field type="CARD8" name="device_id" />
> + <pad bytes="3" />
> + <reply>
> + <pad bytes="1" />
> + <field type="CARD16" name="num_properties" />
this doesn't seem right, it would misalign the num_properties field. looking
at the struct there is no pad before nAtoms.
plus, the spec and the C headers use nAtoms and Atoms, maybe use the same
naming scheme here.
> + <pad bytes="22" />
> + <list type="ATOM" name="properties">
> + <fieldref>num_properties</fieldref>
> + </list>
> + </reply>
> + </request>
> +
> + <!-- ChangeDeviceProperty -->
> +
> + <enum name="PropertyFormat">
> + <item name="data8"> <value>8</value> </item>
> + <item name="data16"> <value>16</value> </item>
> + <item name="data32"> <value>32</value> </item>
> + </enum>
> +
> + <enum name="PropertyMode">
> + <item name="Replace" />
> + <item name="Prepand" />
typo: prepend
> + <item name="Append" />
> + </enum>
> +
> + <request name="ChangeDeviceProperty" opcode="37">
> + <field type="ATOM" name="property" />
> + <field type="ATOM" name="type" />
> + <field type="CARD8" name="device_id" />
> + <field type="CARD8" name="format" enum="PropertyFormat" />
> + <field type="CARD8" name="mode" enum="PropertyMode" />
> + <pad bytes="1" />
> + <field type="CARD32" name="num_items" />
> + <list type="CARD8" name="data">
> + <op op="*">
> + <op op="/">
> + <fieldref>format</fieldref>
> + <value>8</value>
> + </op>
> + <fieldref>num_items</fieldref>
> + </op>
> + </list>
> + </request>
> +
> + <!-- DeleteDeviceProperty -->
> +
> + <request name="DeleteDeviceProperty" opcode="38">
> + <field type="ATOM" name="property" />
> + <field type="CARD8" name="device_id" />
> + <pad bytes="3" />
> + </request>
> +
> + <!-- GetDeviceProperty -->
> +
> + <request name="GetDeviceProperty" opcode="39">
> + <field type="ATOM" name="property" />
> + <field type="ATOM" name="type" />
> + <field type="CARD32" name="offset" />
> + <field type="CARD32" name="len" />
> + <field type="CARD8" name="device_id" />
> + <field type="BOOL" name="delete" />
> + <pad bytes="2" />
> + <reply>
> + <pad bytes="1" />
> + <field type="ATOM" name="type" />
> + <field type="CARD32" name="bytes_after" />
> + <field type="CARD32" name="num_items" />
> + <field type="CARD8" name="format" enum="PropertyFormat" />
> + <field type="CARD8" name="device_id" />
> + <pad bytes="10" />
> + <list type="CARD8" name="data">
> + <op op="*">
> + <op op="/">
> + <fieldref>format</fieldref>
> + <value>8</value>
> + </op>
> + <fieldref>num_items</fieldref>
> + </op>
> + </list>
> + </reply>
> + </request>
> +
> <!-- EVENTS -->
>
> <event name="DeviceValuator" number="0">
> @@ -1126,6 +1212,16 @@ authorization from the authors.
> <pad bytes="20" />
> </event>
>
> + <event name="DevicePropertyNotify" number="16">
> + <!-- XXX: pad0 (byte between response_type and sequence)
> + is used for the state (NewValue or Delete) -->
> + <pad bytes="1" />
this is odd, can't you access this byte? DeviceMappingNotify and
ChangeDeviceNotify have the deviceid here and their xml seems
to access it?
either way, with the changes Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
Cheers,
Peter
> + <field type="TIMESTAMP" name="time" />
> + <field type="ATOM" name="property" />
> + <pad bytes="19" />
> + <field type="BYTE" name="device_id" />
> + </event>
> +
> <!-- ERRORS -->
> <error name="Device" number="0" />
> <error name="Event" number="1" />
> --
> 1.8.0.3
>
More information about the Xcb
mailing list