[Xcb] [PATCH proto 12/22] xinput: struct XIDeviceInfo.type: altenum to enum

Christian Linhart chris at DemoRecorder.com
Thu Aug 21 14:27:10 PDT 2014

On 08/21/14 13:34, Ran Benita wrote:
> On Mon, Aug 18, 2014 at 02:59:52PM +0200, Christian Linhart wrote:
>> field "type": replace altenum by enum because
>> only the values of DeviceType are permitted
>> spec:
>> http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XI2proto.txt#n669
>> http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XI2proto.txt#n763
>> notes to the spec:
>> * the field is called "use" in the spec, instead of "type"
>> * the enum is called "DEVICEUSE" in the spec, instead of "DeviceType"
> There is also a DeviceUse enum defined, which is used in some places,
> and has different values (offset of 1) from DeviceType. I think there
> might be some pre-existing confusion here. Are both enums needed? If so,
> are they used correctly?

I have looked at the specs and headerfiles and found out the following:
Both XI and XI2 have different enums for the same purpose in their spec, 
and these enums have different values.

Here is the relation between xcb-xinput and XI/XI2:
* xcb-enum "DeviceUse" is for the values the field "use" of DEVICEINFO of XI
* xcb-enum "DeviceType" is DEVICEUSE of XI2

On closer inspection, the xml looks semantically OK to me.
( but the naming is somehow confusing. )

Here are the references to the spec and the code:

* the enum in the specs:

* the enum-values in the headers:

  - list of values in comment of field "use" of struct XDeviceInfo:

  - definition of the values:

* The enum in the spec:

* The enum-values in the headers:

  - list of valid values in the comment of field "use" of struct xXIDeviceInfo:

  - definition of the values:

More information about the Xcb mailing list