[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:

XI:
* the enum in the specs:
  http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt?id=inputproto-2.3.1#n315
  http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml?id=libXi-1.7.4#n743

* the enum-values in the headers:

  - list of values in comment of field "use" of struct XDeviceInfo:
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XIproto.h?id=inputproto-2.3.1#n243

  - definition of the values:
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI.h?id=inputproto-2.3.1#n189


XI2:
* The enum in the spec:
  http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XI2proto.txt?id=inputproto-2.3.1#n669

* The enum-values in the headers:

  - list of valid values in the comment of field "use" of struct xXIDeviceInfo:
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI2proto.h?id=inputproto-2.3.1#n128

  - definition of the values:
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI2.h?id=inputproto-2.3.1#n132






More information about the Xcb mailing list