[Xcb] xinput:QueryDeviceState: full-support: generator and xml-changes

Christian Linhart chris at DemoRecorder.com
Thu Aug 21 13:25:18 PDT 2014


Hi all,

I have succeeded in getting the QueryDeviceState-reply of Xinput 
to work with full support, i.e. replacing the "uninterpreted_data"
with full interpretation of all data.

This has required some further changes in the Parser and Generator
which are as follows:

* support fixed size lists in var-sized structs
	Here, "var-sized struct" also includes switch-cases.

* support lists of structs which contain a switch
	( this fixes also a problem in the generator when
	a fixed-size list is the last field of a case or bitcase.)

* support for optionally switching off implicit-padding
	This is not strictly needed for this particular example
	but I have implemented it anyways before I have fixed an align
	problem with switch. That fix is contained in the previous patch.

	In any case my intuition tells me that switching
	off implicit padding is a good idea for examples like this
	because the switch starts at an address which is not 4-byte aligned,
	but one case contains 4-byte elements.

	Therefore I have switched off implicit-padding for
	the struct InputState which is used in the 
	QueryDeviceState-reply.

	We'll probably need the disabling of implicit-padding in 
	other places in the XInput or XKB extension.


I have tested this with a test program which is attached to this email.
Before compiling and starting the test program you probably need to edit
the following things:
* The list of XInput device-ids in lines 23-30 of xinput-test.c

* The variable TESTINSTALLROOT in the Makefile which points to
  the root-dir of your xcb test installation.


I will post the patches as replies to this email.

Chris
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Makefile
URL: <http://lists.freedesktop.org/archives/xcb/attachments/20140821/32385402/attachment.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xinput-test.c
Type: text/x-csrc
Size: 6588 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/xcb/attachments/20140821/32385402/attachment.c>


More information about the Xcb mailing list