xinput: ListInputDevices: full support
authorChristian Linhart <chris@DemoRecorder.com>
Sun, 2 Nov 2014 12:47:38 +0000 (13:47 +0100)
committerChristian Linhart <chris@demorecorder.com>
Mon, 3 Nov 2014 10:23:22 +0000 (11:23 +0100)
commit0d5a061ef288bab9c75a9aa434d63527174e29a9
treef468fd4962a2220d2ed7ebdf7e62f5668c7c0e33
parent8c5c89f9f6c8e2b7334bdf19d47209e1ade4ef7c
xinput: ListInputDevices: full support

* define struct InputInfo with switch-case
* define the lists "infos" and "names"
* the list "infos" requires a new xml-construct:
  <sumof> with a nested expression, to access fields
  of the list which is iterated by sumof.

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

code:
http://cgit.freedesktop.org/xorg/lib/libXi/tree/src/XListDev.c?id=libXi-1.7.4

Both specs are misleading ( or buggy ) in the following aspect:

In both specs, struct Deviceinfo is defined to contain a list
of InputInfo and a list of STR.

But, by analyzing the code in libXi, it was clear that
* InputInfo is contained in an extra toplevel list
  in the reply ListInputDevices
* the strings ( struct xproto:STR ) are also contained in a toplevel list
  in the reply

Signed-off-by: Christian Linhart <chris@demorecorder.com>
Reviewed-by: Ran Benita <ran234@gmail.com>
Message-ID: <545627EA.8010408@DemoRecorder.com>
Patch-Thread-Subject: [Xcb] [PATCHSET] ListInputDevices revision 2
Patch-Set: ListInputDevices
Patch-Number: proto 5/8
Patch-Version: V1
src/xinput.xml