[Xcb-commit] xcb/proto: 45 commits - src

Peter Harris peterh at kemper.freedesktop.org
Mon Aug 25 16:36:00 PDT 2014


 src/xinput.xml |  268 +++++++++++++++++++++++++++++++++++++++++++--------------
 1 file changed, 206 insertions(+), 62 deletions(-)

New commits:
commit 80a79d466d1b3cb7c81c30f54035862b2d0f5f6f
Merge: 88415e6 7d8c990
Author: Peter Harris <pharris at opentext.com>
Date:   Mon Aug 25 19:31:36 2014 -0400

    Merge http://infra-srv1.demorecorder.com/git/free-sw/xcb/proto
    
    See the mailing list for Reviewed-bys.
    
    Thread root is
    http://lists.freedesktop.org/archives/xcb/2014-August/009632.html

commit 7d8c990d6a6f6ef49793eaef46ae38eb2ebb6f39
Author: Christian Linhart <chris at DemoRecorder.com>
Date:   Fri Aug 22 12:11:50 2014 +0200

    xinput: add TODO list
    
    Add TODO list of things which cannot be done yet
    with the current feature-set of xml and the generator.
    
    V2: Fix reference in the parametrized struct-paragraph:
    to correctly refer to the GetDeviceMotionEvents-reply
    (instead of the ChangeKeyboardDevice-request which
    does not need parametrized structs.)

diff --git a/src/xinput.xml b/src/xinput.xml
index 39b26e9..976855a 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -32,6 +32,73 @@ authorization from the authors.
      http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XI2proto.txt
 -->
 
+<!-- TODO: Things which need to be done for full XInput support
+	but cannot be done now ( August 18, 2014 ) with the current feature-set
+	of the xml and the generator:
+
+*****
+
+replace "uninterpreted_data" or similar constructs
+with a semantic that shows how to interpret this data.
+This requires enhancements to the xml-schema and generator such as union with selector.
+
+This will, e.g., be necessary for automatically generated byte-order conversion code,
+which will, e.g., be necessary for server-side xcb.
+
+This affects the following:
+* GetFeedbackControl reply field "feedbacks" ( structs FeedbackState, ... )
+* ChangeFeedbackControl request field "feedback" ( structs FeedbackCtl, ... )
+* QueryDeviceState reply field "classes" ( structs InputState, ... )
+* GetDeviceControl reply field "control"  ( structs DeviceState, ... )
+* ChangeDeviceControl request field "control" ( structs ChangeDeviceControl, ... )
+* XIChangeHierarchy request field "changes" ( structs  HierarchyChange, ... )
+* struct XIDeviceInfo field "classes" ( structs DeviceClass, ... )
+* SendExtensionEvent member "events"
+
+*****
+
+xml and generator have to support <popcount> of all members of a list
+
+This is needed for the following XI2-events ( and eventcopies thereof )
+	KeyPress
+	ButtonPress
+	RawKeyPress
+	RawKeyPress
+	RawButtonPress
+	TouchBegin
+	RawTouchBegin
+
+
+*****
+
+<sumof> should support fields of listmembers.
+
+This is needed for request "ListInputDevices"
+
+*****
+
+xml and generator should support
+switch-case similar to switch-bitcase.
+
+(and maybe: variable sized unions with a mechanism to define
+which union-field is selected.)
+
+One of these features is needed for the InputInfo type
+which is used by request "ListInputDevices" for the list "input_infos".
+
+*****
+
+Parametrized structs
+
+This is needed for being able to use the value of the field
+"num_axes" of the GetDeviceMotionEvents-reply
+in struct DeviceTimeCoord.
+
+*****
+
+-->
+
+
 <xcb header="xinput" extension-xname="XInputExtension" extension-name="Input"
      major-version="2" minor-version="3">
     <import>xfixes</import>
commit e238b3487ed80501ff928429dabe4aa1d54d28fc
Author: Christian Linhart <chris at demorecorder.com>
Date:   Mon Aug 18 16:41:22 2014 +0200

    xinput: replace initial pad of xinput1.x replies with field
    
    Replace the initial 1-byte pad of Xinput-1.x replies
    with CARD8-field "xi_reply_type", according to XIproto.h.
    
    This may also help to implement assertions
    based on the value of that field.
    
    reference:
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XIproto.h#n187
    http://cgit.freedesktop.org/xorg/xserver/tree/Xi/getvers.c#n103

diff --git a/src/xinput.xml b/src/xinput.xml
index 5b0070d..39b26e9 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -63,7 +63,7 @@ authorization from the authors.
             <fieldref>name_len</fieldref>
         </list>
         <reply>
-            <pad bytes="1" />
+            <field type="CARD8"  name="xi_reply_type" />
             <field type="CARD16" name="server_major" />
             <field type="CARD16" name="server_minor" />
             <field type="BOOL"   name="present" />
@@ -161,7 +161,7 @@ authorization from the authors.
 
     <request name="ListInputDevices" opcode="2">
         <reply>
-            <pad bytes="1" />
+            <field type="CARD8" name="xi_reply_type" />
             <field type="CARD8" name="devices_len" />
             <pad bytes="23" />
             <list type="DeviceInfo" name="devices">
@@ -184,7 +184,7 @@ authorization from the authors.
         <field type="CARD8" name="device_id" />
         <pad bytes="3" />
         <reply>
-            <pad bytes="1" />
+            <field type="CARD8" name="xi_reply_type" />
             <field type="CARD8" name="num_classes" />
             <pad bytes="23" />
             <list type="InputClassInfo" name="class_info">
@@ -208,7 +208,7 @@ authorization from the authors.
         <field type="CARD8" name="mode" enum="ValuatorMode" />
         <pad bytes="2" />
         <reply>
-            <pad bytes="1" />
+            <field type="CARD8" name="xi_reply_type" />
             <!-- values for status: 0: Success, 1: AlreadyGrabbed -->
             <field type="CARD8" name="status" enum="GrabStatus" />
             <pad bytes="23" />
@@ -231,7 +231,7 @@ authorization from the authors.
     <request name="GetSelectedExtensionEvents" opcode="7">
         <field type="WINDOW" name="window" />
         <reply>
-            <pad bytes="1" />
+            <field type="CARD8"  name="xi_reply_type" />
             <field type="CARD16" name="num_this_classes" />
             <field type="CARD16" name="num_all_classes" />
             <pad bytes="20" />
@@ -266,7 +266,7 @@ authorization from the authors.
     <request name="GetDeviceDontPropagateList" opcode="9">
         <field type="WINDOW" name="window" />
         <reply>
-            <pad bytes="1" />
+            <field type="CARD8"  name="xi_reply_type" />
             <field type="CARD16" name="num_classes" />
             <pad bytes="22" />
             <list type="EventClass" name="classes">
@@ -289,7 +289,7 @@ authorization from the authors.
         <field type="CARD8"     name="device_id" />
         <pad bytes="3"/>
         <reply>
-            <pad bytes="1" />
+            <field type="CARD8"  name="xi_reply_type" />
             <field type="CARD32" name="num_events" />
             <field type="CARD8"  name="num_axes" />
             <field type="CARD8"  name="device_mode" enum="ValuatorMode" />
@@ -304,7 +304,7 @@ authorization from the authors.
         <field type="CARD8" name="device_id" />
         <pad bytes="3" />
         <reply>
-            <pad bytes="1" />
+            <field type="CARD8" name="xi_reply_type" />
             <!-- only the following GrabStatus-values are valid here:
                  "Success", "AlreadyGrabbed", and "Frozen"
             -->
@@ -321,7 +321,7 @@ authorization from the authors.
         <field type="CARD8" name="device_id" />
         <pad bytes="1" />
         <reply>
-            <pad bytes="1" />
+            <field type="CARD8" name="xi_reply_type" />
             <!-- only the following GrabStatus-values are valid here:
                  "Success", "AlreadyGrabbed", and "Frozen"
             -->
@@ -345,7 +345,7 @@ authorization from the authors.
             <fieldref>num_classes</fieldref>
         </list>
         <reply>
-            <pad bytes="1" />
+            <field type="CARD8" name="xi_reply_type" />
             <field type="CARD8" name="status" enum="GrabStatus" />
             <pad bytes="23" />
         </reply>
@@ -444,7 +444,7 @@ authorization from the authors.
         <field type="CARD8" name="device_id" />
         <pad bytes="3" />
         <reply>
-            <pad bytes="1" />
+            <field type="CARD8"     name="xi_reply_type" />
             <field type="WINDOW"    name="focus" altenum="InputFocus" />
             <field type="TIMESTAMP" name="time" />
             <field type="CARD8"     name="revert_to" enum="InputFocus" />
@@ -554,7 +554,7 @@ authorization from the authors.
         <field type="CARD8" name="device_id" />
         <pad bytes="3" />
         <reply>
-            <pad bytes="1" />
+            <field type="CARD8"  name="xi_reply_type" />
             <field type="CARD16" name="num_feedbacks" />
             <pad bytes="22" />
             <list type="FeedbackState" name="feedbacks">
@@ -669,7 +669,7 @@ authorization from the authors.
         <field type="CARD8"   name="count" />
         <pad bytes="1" />
         <reply>
-            <pad bytes="1" />
+            <field type="CARD8" name="xi_reply_type" />
             <field type="CARD8" name="keysyms_per_keycode" />
             <pad bytes="23" />
             <list type="KEYSYM" name="keysyms">
@@ -700,7 +700,7 @@ authorization from the authors.
         <field type="CARD8" name="device_id" />
         <pad bytes="3" />
         <reply>
-            <pad bytes="1" />
+            <field type="CARD8" name="xi_reply_type" />
             <field type="CARD8" name="keycodes_per_modifier" />
             <pad bytes="23" />
             <list type="CARD8"  name="keymaps">
@@ -725,7 +725,7 @@ authorization from the authors.
             </op>
         </list>
         <reply>
-            <pad bytes="1" />
+            <field type="CARD8" name="xi_reply_type" />
             <field type="CARD8" name="status" enum="MappingStatus" />
             <pad bytes="23" />
         </reply>
@@ -737,7 +737,7 @@ authorization from the authors.
         <field type="CARD8" name="device_id" />
         <pad bytes="3" />
         <reply>
-            <pad bytes="1" />
+            <field type="CARD8" name="xi_reply_type" />
             <field type="CARD8" name="map_size" />
             <pad bytes="23" />
             <list type="CARD8" name="map">
@@ -757,7 +757,7 @@ authorization from the authors.
             <fieldref>map_size</fieldref>
         </list>
         <reply>
-            <pad bytes="1" />
+            <field type="CARD8" name="xi_reply_type" />
             <field type="CARD8" name="status" enum="MappingStatus" />
             <pad bytes="23" />
         </reply>
@@ -817,7 +817,7 @@ authorization from the authors.
         <field type="CARD8" name="device_id" />
         <pad bytes="3" />
         <reply>
-            <pad bytes="1" />
+            <field type="CARD8" name="xi_reply_type" />
             <field type="CARD8" name="num_classes" />
             <pad bytes="23" />
             <list type="InputState" name="classes">
@@ -866,7 +866,7 @@ authorization from the authors.
             <fieldref>num_valuators</fieldref>
         </list>
         <reply>
-            <pad bytes="1" />
+            <field type="CARD8" name="xi_reply_type" />
             <field type="CARD8" name="status" enum="GrabStatus" />
             <pad bytes="23" />
         </reply>
@@ -952,7 +952,7 @@ authorization from the authors.
         <field type="CARD8"  name="device_id" />
         <pad bytes="1" />
         <reply>
-            <pad bytes="1" />
+            <field type="CARD8" name="xi_reply_type" />
             <field type="CARD8" name="status" altenum="GrabStatus" />
             <pad bytes="23" />
             <field type="DeviceState" name="control" />
@@ -1027,7 +1027,7 @@ authorization from the authors.
         <pad bytes="1" />
         <field type="DeviceCtl" name="control" />
         <reply>
-            <pad bytes="1" />
+            <field type="CARD8" name="xi_reply_type" />
             <field type="CARD8" name="status" altenum="GrabStatus" />
             <pad bytes="23" />
         </reply>
@@ -1041,7 +1041,7 @@ authorization from the authors.
         <field type="CARD8"  name="device_id" />
         <pad bytes="3" />
         <reply>
-            <pad bytes="1" />
+            <field type="CARD8"  name="xi_reply_type" />
             <field type="CARD16" name="num_atoms" />
             <pad bytes="22" />
             <list type="ATOM" name="atoms">
@@ -1114,7 +1114,7 @@ authorization from the authors.
         <field type="BOOL"   name="delete" />
         <pad bytes="2" />
         <reply>
-            <pad bytes="1" />
+            <field type="CARD8"  name="xi_reply_type" />
             <field type="ATOM"   name="type" />
             <field type="CARD32" name="bytes_after" />
             <field type="CARD32" name="num_items" />
commit 3e6ddac96fb562c8675343d32fb25a2f6e3de17d
Author: Christian Linhart <chris at demorecorder.com>
Date:   Mon Aug 18 16:41:21 2014 +0200

    xinput: rep SetDeviceMode.status: altenum to enum
    
    Field "status" of the SetDeviceMode-reply
    only allows values from enum GrabStatus.
    
    Therefore it has an "enum" and not an "altenum".
    
    Also: Add comment about valid values of field "status".
    
    spec:
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt#n601
    
    note:
    The following spec also mentions value "3 + first_error":
    http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml#n891
    
    This is probably an error in this old spec because:
    * the X-Server code does not generate that value.
      In case of error-codes, it does the following:
      instead of sending the reply it returns
      rep.status containing the error-code as returnvalue
      of the function ProcXSetDeviceMode.
      This will probably cause the sending of an XError.
      code:
        http://cgit.freedesktop.org/xorg/xserver/tree/Xi/setmode.c#n86
    
    * the new spec does not mention that value:
      http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt#n601

diff --git a/src/xinput.xml b/src/xinput.xml
index 0c036bd..5b0070d 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -209,7 +209,8 @@ authorization from the authors.
         <pad bytes="2" />
         <reply>
             <pad bytes="1" />
-            <field type="CARD8" name="status" altenum="GrabStatus" />
+            <!-- values for status: 0: Success, 1: AlreadyGrabbed -->
+            <field type="CARD8" name="status" enum="GrabStatus" />
             <pad bytes="23" />
         </reply>
     </request>
commit 36484e600c803b214a12f60c94fe81e4dc78980f
Author: Christian Linhart <chris at demorecorder.com>
Date:   Mon Aug 18 16:41:20 2014 +0200

    xinput: struct XIDeviceInfo.name: cleanup of padding
    
    Previuosly, the padding of list "name"
    has been done by faking another list-length.
    
    Correct this by using the real list-length,
    and by adding a 4-byte align-pad after the list.
    
    This yields the same total length of the struct,
    and uses the correct length of the list "name".
    
    spec:
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XI2proto.txt#n768
    
    code:
    http://cgit.freedesktop.org/xorg/lib/libXi/tree/src/XIQueryDevice.c#n92
    http://cgit.freedesktop.org/xorg/xserver/tree/Xi/xiquerydevice.c#n477

diff --git a/src/xinput.xml b/src/xinput.xml
index 3cceee5..0c036bd 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -1498,19 +1498,9 @@ authorization from the authors.
         <field type="BOOL"     name="enabled" />
         <pad bytes="1" />
         <list type="char" name="name">
-            <!-- name_len is without padding, so we've to pad on our own,
-                 auto align pad after the list would be helpfull -->
-            <op op="*">
-                <op op="/">
-                    <op op="+">
-                        <fieldref>name_len</fieldref>
-                        <value>3</value>
-                    </op>
-                    <value>4</value>
-                </op>
-                <value>4</value>
-            </op>
+            <fieldref>name_len</fieldref>
         </list>
+        <pad align="4" />
         <list type="DeviceClass" name="classes">
             <fieldref>num_classes</fieldref>
         </list>
commit a2374e10396cab18bd5ccf9b4cc0ee27f87a0c00
Author: Christian Linhart <chris at DemoRecorder.com>
Date:   Mon Aug 25 12:08:57 2014 +0200

    xinput: req XIPassiveGrabDevice.time: field is unused
    
    The request-field "time" is unused.
    Add a comment about this.
    
    V2: patch revised according to the following fix in the spec:
    http://cgit.freedesktop.org/xorg/proto/inputproto/commit/?id=81378a1e7139af9d476d90df8737c0c1a58670f3
    
    spec:
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XI2proto.txt?id=81378a1e7139af9d476d90df8737c0c1a58670f3#n1699
    
    code:
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI2proto.h?id=inputproto-2.3.1#n680

diff --git a/src/xinput.xml b/src/xinput.xml
index d941937..3cceee5 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -1634,6 +1634,7 @@ authorization from the authors.
     </struct>
 
     <request name="XIPassiveGrabDevice" opcode="54">
+        <!-- field "time" is unused and its value is undefined -->
         <field type="TIMESTAMP" name="time" altenum="Time" />
         <field type="WINDOW"    name="grab_window" />
         <field type="CURSOR"    name="cursor" />
commit 41f364a809868b4bfaf80cfe7a956e74a009987c
Author: Christian Linhart <chris at demorecorder.com>
Date:   Mon Aug 18 15:00:02 2014 +0200

    xinput: ev BarrierHit.flags: add new mask
    
    add new enum "BarrierFlags" as mask to field "flags"
    
    spec:
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XI2proto.txt#n2575
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI2.h#n164

diff --git a/src/xinput.xml b/src/xinput.xml
index 3d71da7..d941937 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -2288,6 +2288,11 @@ authorization from the authors.
 
     <!-- â‹…â‹…â‹… Events (v2.3) â‹…â‹…â‹…â‹…â‹…â‹…â‹…â‹…â‹…â‹…â‹…â‹…â‹…â‹…â‹…â‹…â‹…â‹…â‹…â‹…â‹…â‹…â‹…â‹…â‹…â‹…â‹…â‹…â‹…â‹…â‹…â‹…â‹…â‹…â‹…â‹…â‹…â‹…â‹…â‹…â‹… -->
 
+    <enum name="BarrierFlags">
+	<item name="PointerReleased"> <bit>0</bit> </item>
+	<item name="DeviceIsGrabbed"> <bit>1</bit> </item>
+    </enum>
+
     <event name="BarrierHit" number="25" xge="true">
         <field type="DeviceId"  name="deviceid" altenum="Device" />
         <field type="TIMESTAMP" name="time" altenum="Time" />
@@ -2298,7 +2303,7 @@ authorization from the authors.
         <field type="BARRIER"   name="barrier" />
         <!-- 32 byte boundary -->
         <field type="CARD32"    name="dtime" />
-        <field type="CARD32"    name="flags" />
+        <field type="CARD32"    name="flags" mask="BarrierFlags" />
         <field type="DeviceId"  name="sourceid" altenum="Device" />
         <pad bytes="2" />
         <field type="FP1616"    name="root_x" />
commit 70b975cfd62b16fc04f051f10e81adcd8abaf6c1
Author: Christian Linhart <chris at DemoRecorder.com>
Date:   Sat Aug 23 13:05:43 2014 +0200

    xinput: ev DeviceStateNotify.classes_reported: mask
    
    add new enum "ClassesReportedMask" as mask to field "classes_reported"
    
    V2: patch revised according to suggestion from Peter Harris:
    * use names which indicate the way the bits should be flipped
    
    V3: revised the diff-context according to the modification of patch 18/22 V2
    
    spec:
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt#n2401
    http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml#n2220

diff --git a/src/xinput.xml b/src/xinput.xml
index e81ec57..3d71da7 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -1868,13 +1868,25 @@ authorization from the authors.
     <eventcopy name="ProximityIn"    number="8" ref="DeviceKeyPress" />
     <eventcopy name="ProximityOut"   number="9" ref="DeviceKeyPress" />
 
+    <enum name="ClassesReportedMask">
+        <item name="OutOfProximity">     <bit>7</bit> </item> <!-- 0x80 -->
+            <!-- 0 = InProxmity, 1 = OutOfProximity -->
+
+        <item name="DeviceModeAbsolute"> <bit>6</bit> </item> <!-- 0x40 -->
+            <!-- 0 = Relative, 1 = Absolute -->
+
+        <item name="ReportingValuators"> <bit>2</bit> </item> <!-- 0x04 -->
+        <item name="ReportingButtons">   <bit>1</bit> </item> <!-- 0x02 -->
+        <item name="ReportingKeys">      <bit>0</bit> </item> <!-- 0x01 -->
+    </enum>
+
     <event name="DeviceStateNotify" number="10">
         <field type="BYTE"      name="device_id" altmask="MoreEventsMask" />
         <field type="TIMESTAMP" name="time" />
         <field type="CARD8"     name="num_keys" />
         <field type="CARD8"     name="num_buttons" />
         <field type="CARD8"     name="num_valuators" />
-        <field type="CARD8"     name="classes_reported" />
+        <field type="CARD8"     name="classes_reported" mask="ClassesReportedMask" />
         <list type="CARD8"      name="buttons">
             <value>4</value>
         </list>
commit df64e417b8e8490970bbf85e138609de729f93eb
Author: Christian Linhart <chris at DemoRecorder.com>
Date:   Fri Aug 22 17:26:10 2014 +0200

    xinput: ev DeviceButtonStateNotify.device_id: mask
    
    add mask "MoreEventsMask" to field "device_id"
    
    V2: patch revised according to suggestion from Peter Harris:
    * use "altmask" instead of "mask"
      because all the legal values of device_id are not described
      by the <bit> elements of MoreEventsMask.
    
    V3: revised the diff-context according to the modification of patch 19/22 V2.
    
    spec:
    http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml#n2252
    http://cgit.freedesktop.org/xorg/xserver/tree/dix/enterleave.c#n725
    
    note:
    this mask is missing in the following spec:
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt#n2431

diff --git a/src/xinput.xml b/src/xinput.xml
index 8d6d954..e81ec57 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -1916,7 +1916,7 @@ authorization from the authors.
     </event>
 
     <event name="DeviceButtonStateNotify" number="14">
-        <field type="BYTE" name="device_id" />
+        <field type="BYTE" name="device_id" altmask="MoreEventsMask" />
         <list type="CARD8" name="buttons">
             <value>28</value>
         </list>
commit fe95c9448b220b058f7e33e54f8dea5824fb7ac6
Author: Christian Linhart <chris at DemoRecorder.com>
Date:   Tue Aug 19 13:13:54 2014 +0200

    xinput: ev DeviceKeyStateNotify.device_id: mask
    
    add mask "MoreEventsMask" to field "device_id"
    
    V2: patch revised according to suggestion from Peter Harris:
    * use "altmask" instead of "mask"
      because all the legal values of device_id are not described
      by the <bit> elements of MoreEventsMask.
    
    spec:
    http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml#n2239
    http://cgit.freedesktop.org/xorg/xserver/tree/dix/enterleave.c#n745
    
    note:
    this mask is missing in the following spec:
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt#n2428

diff --git a/src/xinput.xml b/src/xinput.xml
index cd0a111..8d6d954 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -1909,7 +1909,7 @@ authorization from the authors.
     </event>
 
     <event name="DeviceKeyStateNotify" number="13">
-        <field type="BYTE" name="device_id" />
+        <field type="BYTE" name="device_id" altmask="MoreEventsMask" />
         <list type="CARD8" name="keys">
             <value>28</value>
         </list>
commit 01d0228f9bfc354d3832b6a68355769a7ad38ea3
Author: Christian Linhart <chris at DemoRecorder.com>
Date:   Tue Aug 19 13:13:43 2014 +0200

    xinput: ev DeviceStateNotify.device_id: mask
    
    add mask "MoreEventsMask" to field "device_id"
    
    V2: patch revised according to suggestion from Peter Harris:
    * use "altmask" instead of "mask"
      because all the legal values of device_id are not described
      by the <bit> elements of MoreEventsMask.
    
    spec and code:
    http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml#n2214
    http://cgit.freedesktop.org/xorg/xserver/tree/dix/enterleave.c#n725
    
    note:
    this mask is missing in the following spec:
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt#n2395

diff --git a/src/xinput.xml b/src/xinput.xml
index 7b7b948..cd0a111 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -1869,7 +1869,7 @@ authorization from the authors.
     <eventcopy name="ProximityOut"   number="9" ref="DeviceKeyPress" />
 
     <event name="DeviceStateNotify" number="10">
-        <field type="BYTE"      name="device_id" />
+        <field type="BYTE"      name="device_id" altmask="MoreEventsMask" />
         <field type="TIMESTAMP" name="time" />
         <field type="CARD8"     name="num_keys" />
         <field type="CARD8"     name="num_buttons" />
commit 07e5a4a2f09a538567ee3ea8ca7444d432e6ac14
Author: Christian Linhart <chris at DemoRecorder.com>
Date:   Tue Aug 19 13:13:24 2014 +0200

    xinput: ev DeviceKeyPress.device_id: add mask
    
    for event DeviceKeyPress and derived ones:
    add new mask "MoreEventsMask" to field "device_id"
    
    V2: patch revised according to suggestion from Peter Harris:
    * use "altmask" instead of "mask"
      because all the legal values of device_id are not described
      by the <bit> elements of MoreEventsMask.
    
    spec and code:
    http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml#n1999
    http://cgit.freedesktop.org/xorg/lib/libXi/tree/src/XExtInt.c#n534
    http://cgit.freedesktop.org/xorg/xserver/tree/dix/eventconvert.c#n348
    http://cgit.freedesktop.org/xorg/xserver/tree/Xi/exevents.c#n188
    
    note:
    this mask is missing in the following spec:
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt#n2257

diff --git a/src/xinput.xml b/src/xinput.xml
index 179735f..7b7b948 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -1847,7 +1847,7 @@ authorization from the authors.
         <field type="INT16"     name="event_y" />
         <field type="CARD16"    name="state" mask="KeyButMask" />
         <field type="BOOL"      name="same_screen" />
-        <field type="CARD8"     name="device_id" />
+        <field type="CARD8"     name="device_id" altmask="MoreEventsMask" />
     </event>
 
     <eventcopy name="DeviceKeyRelease"    number="2" ref="DeviceKeyPress" />
commit f515871258226739fb4d36750a5c003e532ccd13
Author: Christian Linhart <chris at DemoRecorder.com>
Date:   Tue Aug 19 13:13:06 2014 +0200

    xinput: new enum for device_id in some events
    
    add new enum "MoreEventsMask" to be used
    by event DeviceKeyPress and derived ones
    for field "device_id".
    
    V2: patch revised according to suggestion from Peter Harris:
    * remove DeviceBits = 0x7f from the enum in order to avoid
      mixing bit and value in the same enum.
      ( We'd need a way to specify a range of bits for that ... )
    
    spec and code:
    http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml#n1999
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XIproto.h#n67
    http://cgit.freedesktop.org/xorg/lib/libXi/tree/src/XExtInt.c#n534
    http://cgit.freedesktop.org/xorg/xserver/tree/dix/eventconvert.c#n348
    http://cgit.freedesktop.org/xorg/xserver/tree/Xi/exevents.c#n188
    
    note:
    this mask is missing in the following spec:
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt#n2257

diff --git a/src/xinput.xml b/src/xinput.xml
index 53eaf6a..179735f 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -1829,6 +1829,12 @@ authorization from the authors.
         </list>
     </event>
 
+    <!-- the highest bit in a CARD8 device_id-field indicates that more
+	events will follow -->
+    <enum name="MoreEventsMask">
+	<item name="MoreEvents"> <bit>7</bit> </item> <!-- 0x80 -->
+    </enum>
+
     <event name="DeviceKeyPress" number="1">
         <field type="BYTE"      name="detail" />
         <field type="TIMESTAMP" name="time" />
commit b37ab52f961c7c28b556072663acaafa2e320837
Author: Christian Linhart <chris at demorecorder.com>
Date:   Mon Aug 18 14:59:55 2014 +0200

    xinput: ev ChangeDeviceNotify.request: add enum
    
    add new enum "ChangeDevice" for field "request"
    
    spec:
    http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml#n2301
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt#n2459

diff --git a/src/xinput.xml b/src/xinput.xml
index 3e882fd..53eaf6a 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -1890,10 +1890,15 @@ authorization from the authors.
         <pad bytes="20" />
     </event>
 
+    <enum name="ChangeDevice">
+	<item name="NewPointer">  <value>0</value> </item>
+	<item name="NewKeyboard"> <value>1</value> </item>
+    </enum>
+
     <event name="ChangeDeviceNotify" number="12">
         <field type="BYTE"      name="device_id" />
         <field type="TIMESTAMP" name="time" />
-        <field type="CARD8"     name="request" />
+        <field type="CARD8"     name="request" enum="ChangeDevice" />
         <pad bytes="23" />
     </event>
 
commit cea46882b8ab5c16b91a30d3a7b7d6fbe7e2fa2d
Author: Christian Linhart <chris at demorecorder.com>
Date:   Mon Aug 18 14:59:54 2014 +0200

    xinput: ev DeviceMappingNotify.request: add enum
    
    add enum "Mapping" for field "request"
    
    spec:
    http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml#n2281
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt#n2443
    
    def of enum "Mapping":
    http://cgit.freedesktop.org/xcb/proto/tree/src/xproto.xml#n1058

diff --git a/src/xinput.xml b/src/xinput.xml
index 4c0c3a7..3e882fd 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -1882,7 +1882,7 @@ authorization from the authors.
 
     <event name="DeviceMappingNotify" number="11">
         <field type="BYTE"    name="device_id" />
-        <field type="CARD8"   name="request" />
+        <field type="CARD8"   name="request" enum="Mapping" />
         <field type="KeyCode" name="first_keycode" />
         <field type="CARD8"   name="count" />
         <pad bytes="1" />
commit 24cd3000e7f381cf16ec3ef27697e21ba769fec8
Author: Christian Linhart <chris at demorecorder.com>
Date:   Mon Aug 18 14:59:53 2014 +0200

    xinput: ev DeviceKeyPress.state: add mask
    
    add mask KeyButMask to field "state"
    
    spec:
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt#n2271

diff --git a/src/xinput.xml b/src/xinput.xml
index d53b777..4c0c3a7 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -1839,7 +1839,7 @@ authorization from the authors.
         <field type="INT16"     name="root_y" />
         <field type="INT16"     name="event_x" />
         <field type="INT16"     name="event_y" />
-        <field type="CARD16"    name="state" />
+        <field type="CARD16"    name="state" mask="KeyButMask" />
         <field type="BOOL"      name="same_screen" />
         <field type="CARD8"     name="device_id" />
     </event>
commit 319220781c4744fc8b70b1e2414eefdc1999c453
Author: Christian Linhart <chris at demorecorder.com>
Date:   Mon Aug 18 14:59:52 2014 +0200

    xinput: struct XIDeviceInfo.type: altenum to enum
    
    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"

diff --git a/src/xinput.xml b/src/xinput.xml
index 5cfa9f9..d53b777 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -1491,7 +1491,7 @@ authorization from the authors.
 
     <struct name="XIDeviceInfo">
         <field type="DeviceId" name="deviceid" altenum="Device" />
-        <field type="CARD16"   name="type" altenum="DeviceType" />
+        <field type="CARD16"   name="type" enum="DeviceType" />
         <field type="DeviceId" name="attachment" altenum="Device" />
         <field type="CARD16"   name="num_classes" />
         <field type="CARD16"   name="name_len" />
commit 7675fbdf29ff0050321c3cb2e88f442f9f7496d1
Author: Christian Linhart <chris at demorecorder.com>
Date:   Mon Aug 18 14:59:51 2014 +0200

    xinput: struct ScrollClass.flags: has a mask
    
    the field "flags" of struct ScrollClass uses ScrollFlags as a mask
    
    spec:
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XI2proto.txt#n802
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI2.h#n151

diff --git a/src/xinput.xml b/src/xinput.xml
index 94bdd59..5cfa9f9 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -1447,7 +1447,7 @@ authorization from the authors.
         <field type="CARD16"   name="number" />
         <field type="CARD16"   name="scroll_type" enum="ScrollType" />
         <pad bytes="2" />
-        <field type="CARD32"   name="flags" enum="ScrollFlags" />
+        <field type="CARD32"   name="flags" mask="ScrollFlags" />
         <field type="FP3232"   name="increment" />
     </struct>
 
commit 27b22875e62eda71e8c1a81643c4bcf2199cf79c
Author: Christian Linhart <chris at DemoRecorder.com>
Date:   Thu Aug 21 22:50:52 2014 +0200

    xinput: req ChangeFeedbackControl.mask: add mask
    
    add new enum ChangeFeedbackControlMask to field "mask" as mask
    
    V2: patch revised according to suggestion from Ran Benita:
    * changed item name from "ledMode" to "LedMode" ( initial character uppercase )
      to be consistent with the initial uppercase letter of the other items.
    
    V2: added a note to the commit-message
        about multiple items with the same value.
    
    Note:
    This enum contains multiple items with the same value.
    This is defined that way in the spec.
    The reason is probably as follows:
    The semantic of those values probably depends on the
    the value of field "class_id" of struct "FeedbackCtrl".
    
    spec and code:
    http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml#n1450
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI.h#n207
    http://cgit.freedesktop.org/xorg/xserver/tree/Xi/chgfctl.c
    
    the following spec just mentions that the field "mask" is a BITMASK,
    but does not list its values:
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt#n1725

diff --git a/src/xinput.xml b/src/xinput.xml
index e318339..94bdd59 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -636,8 +636,24 @@ authorization from the authors.
         </list>
     </struct>
 
+    <enum name="ChangeFeedbackControlMask">
+        <item name="KeyClickPercent">  <bit>0</bit> </item> <!-- 0x01 -->
+        <item name="Percent">          <bit>1</bit> </item> <!-- 0x02 -->
+        <item name="Pitch">            <bit>2</bit> </item> <!-- 0x04 -->
+        <item name="Duration">         <bit>3</bit> </item> <!-- 0x08 -->
+        <item name="Led">              <bit>4</bit> </item> <!-- 0x10 -->
+        <item name="LedMode">          <bit>5</bit> </item> <!-- 0x20 -->
+        <item name="Key">              <bit>6</bit> </item> <!-- 0x40 -->
+        <item name="AutoRepeatMode">   <bit>7</bit> </item> <!-- 0x80 -->
+        <item name="String">           <bit>0</bit> </item> <!-- 0x01 -->
+        <item name="Integer">          <bit>0</bit> </item> <!-- 0x01 -->
+        <item name="AccelNum">         <bit>0</bit> </item> <!-- 0x01 -->
+        <item name="AccelDenom">       <bit>1</bit> </item> <!-- 0x02 -->
+        <item name="Threshold">        <bit>2</bit> </item> <!-- 0x04 -->
+    </enum>
+
     <request name="ChangeFeedbackControl" opcode="23">
-        <field type="CARD32"      name="mask" />
+        <field type="CARD32"      name="mask" mask="ChangeFeedbackControlMask" />
         <field type="CARD8"       name="device_id" />
         <field type="CARD8"       name="feedback_id" />
         <pad bytes="2" />
commit dcd78ec38917e6c2fda97b80f912a2822c2d5c01
Author: Christian Linhart <chris at DemoRecorder.com>
Date:   Tue Aug 19 13:12:32 2014 +0200

    xinput: struct ValuatorState.mode: add mask
    
    add new enum ValuatorStateModeMask as mask to field "mode"
    
    V2: patch revised according to suggestions from Peter Harris:
    * use bit instead of value
    * use names which indicate the way the bits should be flipped
    
    spec:
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt#n2095
    http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml#n1783

diff --git a/src/xinput.xml b/src/xinput.xml
index 29758a2..e318339 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -768,11 +768,16 @@ authorization from the authors.
         </list>
     </struct>
 
+    <enum name="ValuatorStateModeMask">
+        <item name="DeviceModeAbsolute"> <bit>0</bit> </item>
+        <item name="OutOfProximity">     <bit>1</bit> </item>
+    </enum>
+
     <struct name="ValuatorState">
         <field type="CARD8" name="class_id" enum="InputClass" />
         <field type="CARD8" name="len" />
         <field type="CARD8" name="num_valuators" />
-        <field type="CARD8" name="mode" />
+        <field type="CARD8" name="mode" mask="ValuatorStateModeMask" />
         <list type="CARD32" name="valuators">
             <fieldref>num_valuators</fieldref>
         </list>
commit c272fb7b262c90f7566cc9823ce776dbec53fb39
Author: Christian Linhart <chris at demorecorder.com>
Date:   Mon Aug 18 14:59:48 2014 +0200

    xinput: req UngrabDeviceButton.modifier_device: altenum
    
    add altenum ModifierDevice to field modifier_device for value UseXKeyboard
    
    spec and code:
    http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml#n1225
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI.h#n187
    http://cgit.freedesktop.org/xorg/xserver/tree/Xi/ungrdevb.c#n111
    
    the following spec uses "NULL" instead of "UseXKeyboard":
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt#n1386
    Questions:
    * is this spec wrong?
    * or does "NULL" have the unusual value of 0xff in this context?

diff --git a/src/xinput.xml b/src/xinput.xml
index 6538726..29758a2 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -413,7 +413,7 @@ authorization from the authors.
     <request name="UngrabDeviceButton" opcode="18">
         <field type="WINDOW" name="grab_window" />
         <field type="CARD16" name="modifiers" mask="ModMask" />
-        <field type="CARD8"  name="modifier_device" />
+        <field type="CARD8"  name="modifier_device" altenum="ModifierDevice" />
         <field type="CARD8"  name="button" altenum="Grab" />
         <field type="CARD8"  name="grabbed_device" />
         <pad bytes="3" />
commit 280fff745810f5214f394bd0c3e8d238d623e648
Author: Christian Linhart <chris at demorecorder.com>
Date:   Mon Aug 18 14:59:47 2014 +0200

    xinput: req GrabDeviceButton.modifier_device: altenum
    
    add altenum ModifierDevice to field modifier_device for value UseXKeyboard
    
    spec and code:
    http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml#n1195
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI.h#n187
    http://cgit.freedesktop.org/xorg/xserver/tree/Xi/grabdevb.c#n118
    
    the following spec uses "NULL" instead of "UseXKeyboard":
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt#n1309
    Questions:
    * is this spec wrong?
    * or does "NULL" have the unusual value of 0xff in this context?

diff --git a/src/xinput.xml b/src/xinput.xml
index e3e71cb..6538726 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -395,7 +395,7 @@ authorization from the authors.
     <request name="GrabDeviceButton" opcode="17">
         <field type="WINDOW" name="grab_window" />
         <field type="CARD8"  name="grabbed_device" />
-        <field type="CARD8"  name="modifier_device" />
+        <field type="CARD8"  name="modifier_device" altenum="ModifierDevice" />
         <field type="CARD16" name="num_classes" />
         <field type="CARD16" name="modifiers" mask="ModMask" />
         <field type="CARD8"  name="this_device_mode" enum="GrabMode" />
commit 7b62d2b8f748b231f2a68a10bd7c5f2ede3743db
Author: Christian Linhart <chris at demorecorder.com>
Date:   Mon Aug 18 14:59:46 2014 +0200

    xinput: req UngrabDeviceKey.modifier_device: altenum
    
    add altenum ModifierDevice to field modifier_device for value UseXKeyboard
    
    spec and code:
    http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml#n1175
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI.h#n187
    http://cgit.freedesktop.org/xorg/xserver/tree/Xi/ungrdevk.c#n113
    
    the following spec uses "NULL" instead of "UseXKeyboard":
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt#n1295
    Questions:
    * is this spec wrong?
    * or does "NULL" have the unusual value of 0xff in this context?

diff --git a/src/xinput.xml b/src/xinput.xml
index faa67ac..e3e71cb 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -385,7 +385,7 @@ authorization from the authors.
     <request name="UngrabDeviceKey" opcode="16">
         <field type="WINDOW" name="grabWindow" />
         <field type="CARD16" name="modifiers" mask="ModMask" />
-        <field type="CARD8"  name="modifier_device" />
+        <field type="CARD8"  name="modifier_device" altenum="ModifierDevice" />
         <field type="CARD8"  name="key" altenum="Grab" />
         <field type="CARD8"  name="grabbed_device" />
     </request>
commit 20d642e7d1e594558b17722f3477d967ad66a2db
Author: Christian Linhart <chris at DemoRecorder.com>
Date:   Fri Aug 22 17:15:24 2014 +0200

    xinput: req GrabDeviceKey.modifier_device: altenum
    
    add altenum ModifierDevice to field modifier_device for value UseXKeyboard
    
    V2: patch revised according to info from Ran Benita about NULL and UseXKeyboard
    
    spec and code:
    http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml#n1147
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI.h#n187
    http://cgit.freedesktop.org/xorg/xserver/tree/Xi/grabdevk.c#n116
    
    the following spec uses "NULL" instead of "UseXKeyboard":
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt#n1213
    
    The reason for NULL vs UseXKeyboard is: in the libXi function XUngrabDeviceKey,
    the modifier_device arg is an XDevice pointer, and NULL means to use the
    core X keyboard. But on the wire it is an integer, with 255 as a special
    value.

diff --git a/src/xinput.xml b/src/xinput.xml
index 088984c..faa67ac 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -368,7 +368,7 @@ authorization from the authors.
         <field type="WINDOW" name="grab_window" />
         <field type="CARD16" name="num_classes" />
         <field type="CARD16" name="modifiers" mask="ModMask" />
-        <field type="CARD8"  name="modifier_device" />
+        <field type="CARD8"  name="modifier_device" altenum="ModifierDevice" />
         <field type="CARD8"  name="grabbed_device" />
         <field type="CARD8"  name="key" altenum="Grab" />
         <field type="CARD8"  name="this_device_mode" enum="GrabMode" />
commit 566ceb96d0e8c42befa236655973ca575fe47724
Author: Christian Linhart <chris at demorecorder.com>
Date:   Mon Aug 18 14:59:44 2014 +0200

    xinput: add new enum ModifierDevice
    
    needed for field "modifier_device" in the following requests:
    * GrabDeviceKey
    * UngrabDeviceKey
    * GrabDeviceButton
    * UngrabDeviceButton
    
    spec:
    http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml#n1147
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI.h#n187

diff --git a/src/xinput.xml b/src/xinput.xml
index b30cf19..088984c 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -360,6 +360,10 @@ authorization from the authors.
 
     <!-- GrabDeviceKey -->
 
+    <enum name="ModifierDevice">
+	<item name="UseXKeyboard"><value>255</value></item> <!-- 0xff -->
+    </enum>
+
     <request name="GrabDeviceKey" opcode="15">
         <field type="WINDOW" name="grab_window" />
         <field type="CARD16" name="num_classes" />
commit 8f5ae916166bd867eee327c65af61d754a56062f
Author: Christian Linhart <chris at demorecorder.com>
Date:   Mon Aug 18 14:59:43 2014 +0200

    xinput: rep ChangePointerDevice.status: altenum to enum
    
    Field "status" can only get values from enum GrabStatus.
    Therefore make it an enum instead of altenum.
    
    spec:
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt#n1055
    
    Add comments:
    Add comment about valid values for field "status".
    
    Note:
    An old spec lists value 2 for enum value "Frozen"
    while enum GrabStatus has value 4 for Frozen.
    The old spec is probably wrong.
    Here is the URL of the old spec:
    http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml#n1073

diff --git a/src/xinput.xml b/src/xinput.xml
index 51a5a5d..b30cf19 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -321,7 +321,10 @@ authorization from the authors.
         <pad bytes="1" />
         <reply>
             <pad bytes="1" />
-            <field type="CARD8" name="status" altenum="GrabStatus" />
+            <!-- only the following GrabStatus-values are valid here:
+                 "Success", "AlreadyGrabbed", and "Frozen"
+            -->
+            <field type="CARD8" name="status" enum="GrabStatus" />
             <pad bytes="23" />
         </reply>
     </request>
commit aa8b37167cffd211b2ab635d2521d5b6d9d3cc47
Author: Christian Linhart <chris at demorecorder.com>
Date:   Mon Aug 18 14:59:42 2014 +0200

    xinput: rep ChangeKeyboardDevice.status: altenum to enum
    
    Field "status" can only get values from enum GrabStatus
    therefore make it an enum instead of altenum.
    
    spec:
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt#n1016
    
    Add comment about valid values for field status.
    
    Note:
    An old spec lists value 2 for enum value "Frozen"
    while enum GrabStatus has value 4 for Frozen.
    The old spec is probably wrong.
    Here is the URL of the old spec:
    http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml#n1044

diff --git a/src/xinput.xml b/src/xinput.xml
index 58551ea..51a5a5d 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -304,7 +304,10 @@ authorization from the authors.
         <pad bytes="3" />
         <reply>
             <pad bytes="1" />
-            <field type="CARD8" name="status" altenum="GrabStatus" />
+            <!-- only the following GrabStatus-values are valid here:
+                 "Success", "AlreadyGrabbed", and "Frozen"
+            -->
+            <field type="CARD8" name="status" enum="GrabStatus" />
             <pad bytes="23" />
         </reply>
     </request>
commit 63b08d46f699b8a548cf2b9f500da26b11428ebf
Author: Christian Linhart <chris at demorecorder.com>
Date:   Mon Aug 18 14:59:41 2014 +0200

    xinput: enum InputClass: comment value Attach 7
    
    The value Attach=7 is defined in XI.h but not supported anymore by libXi.
    And it never was transmitted over the protocol.
    (It was used to tag a fake class created by libXi)
    
    Add this comment so that future reviews will not accidentally add this value.
    
    spec:
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI.h#n242
    
    drop of support in libXi:
    http://cgit.freedesktop.org/xorg/lib/libXi/commit/?id=62858c426e6de1b99df660251737233afd335302

diff --git a/src/xinput.xml b/src/xinput.xml
index 459b388..58551ea 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -89,6 +89,17 @@ authorization from the authors.
         <item name="Proximity"> <value>4</value> </item>
         <item name="Focus">     <value>5</value> </item>
         <item name="Other">     <value>6</value> </item>
+        <!--
+               value Attach=7 is still contained in XI.h as "#define AttachClass"
+               but it was never transmitted over the protocol.
+               (It was used to tag a fake class created by libXi).
+
+               Even the creation of that fake class has been dropped
+               from libXi in 2009 by the following change:
+               http://cgit.freedesktop.org/xorg/lib/libXi/commit/?id=62858c426e6de1b99df660251737233afd335302
+
+               <item name="Attach">    <value>7</value> </item>
+        -->
     </enum>
 
     <enum name="ValuatorMode">
commit 70d59f56b1d356521b3ecc1d16cd3390d94fdac2
Author: Christian Linhart <chris at demorecorder.com>
Date:   Sat Aug 16 12:08:28 2014 +0200

    xinput: event Enter: fix type of fields same_screen and focus
    
    fix type of fields "same_screen" and  "focus" from CARD8 to BOOL
    
    spec:
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XI2proto.txt#n2432
    (file-position in the above URL may become wrong if the spec changes)

diff --git a/src/xinput.xml b/src/xinput.xml
index 6f5aeaa..459b388 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -2031,8 +2031,8 @@ authorization from the authors.
         <field type="FP1616"       name="root_y" />
         <field type="FP1616"       name="event_x" />
         <field type="FP1616"       name="event_y" />
-        <field type="CARD8"        name="same_screen" />
-        <field type="CARD8"        name="focus" />
+        <field type="BOOL"         name="same_screen" />
+        <field type="BOOL"         name="focus" />
         <field type="CARD16"       name="buttons_len" />
         <field type="ModifierInfo" name="mods" />
         <field type="GroupInfo"    name="group" />
commit e224ebbe20f93b16534fde589c7c832d39da98f0
Author: Christian Linhart <chris at demorecorder.com>
Date:   Sat Aug 16 12:08:27 2014 +0200

    xinput: request GrabDeviceButton: fix type of field owner_events
    
    change type of field "owner_events" from CARD8 to BOOL
    
    spec:
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt#n1311
    (file-position in the above URL may become wrong if the spec changes)

diff --git a/src/xinput.xml b/src/xinput.xml
index 7a36692..6f5aeaa 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -380,7 +380,7 @@ authorization from the authors.
         <field type="CARD8"  name="this_device_mode" enum="GrabMode" />
         <field type="CARD8"  name="other_device_mode" enum="GrabMode" />
         <field type="CARD8"  name="button" altenum="Grab" />
-        <field type="CARD8"  name="owner_events" />
+        <field type="BOOL"   name="owner_events" />
         <pad bytes="2" />
         <list type="EventClass" name="classes">
             <fieldref>num_classes</fieldref>
commit d15b0f611305248dce00ed5a5292315f8aaa29f1
Author: Christian Linhart <chris at demorecorder.com>
Date:   Sat Aug 16 12:08:26 2014 +0200

    xinput: struct AddMaster: fix type of fields
    
    fix type of fields "send_core" and "enable" to BOOL
    
    spec:
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XI2proto.txt#n1187
    
    note:
    the type of these fields should also be fixed in XI2proto.h:
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI2proto.h#n460
    
    (file-positions in the above URLs may become wrong if the spec changes)

diff --git a/src/xinput.xml b/src/xinput.xml
index c03b93c..7a36692 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -1196,8 +1196,8 @@ authorization from the authors.
         <field type="CARD16" name="type" enum="HierarchyChangeType" />
         <field type="CARD16" name="len" />
         <field type="CARD16" name="name_len" />
-        <field type="CARD8"  name="send_core" />
-        <field type="CARD8"  name="enable" />
+        <field type="BOOL"   name="send_core" />
+        <field type="BOOL"   name="enable" />
         <list type="char" name="name">
             <fieldref>name_len</fieldref>
         </list>
commit 506759adfd391a95ac913c0633b0452b884ad053
Author: Christian Linhart <chris at demorecorder.com>
Date:   Sat Aug 16 12:08:25 2014 +0200

    xinput: reply XIQueryPointer: fix type of field same_screen
    
    fix type of field "same_screen" from CARD8 to BOOL
    
    spec:
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XI2proto.txt#n1054
    
    note:
    the type of this field should also be fixed in XI2proto.h:
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI2proto.h#n386
    
    (file-positions in the above URLs may become wrong if the spec or header changes)

diff --git a/src/xinput.xml b/src/xinput.xml
index bf4efe9..c03b93c 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -1143,7 +1143,7 @@ authorization from the authors.
             <field type="FP1616"       name="root_y" />
             <field type="FP1616"       name="win_x" />
             <field type="FP1616"       name="win_y" />
-            <field type="CARD8"        name="same_screen" />
+            <field type="BOOL"         name="same_screen" />
             <pad bytes="1" />
             <field type="CARD16"       name="buttons_len" />
             <field type="ModifierInfo" name="mods" />
commit 9981b4e23460a55e5d43331a2ff58a9d8b49dcb6
Author: Christian Linhart <chris at demorecorder.com>
Date:   Sat Aug 16 12:08:24 2014 +0200

    xinput: struct DeviceTimeCoord: replace CARD32 by INT32
    
    replace CARD32 by INT32 in commented-out list "axisvalues"
    
    spec:
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt#n927
    	in this spec, the list is called "data" instead of "axisvalues"
    
    http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml#n1018
    	in this spec, the list is called "valuators" instead of "axisvalues"
    
    (file-positions in the above URLs may become wrong if the spec changes)

diff --git a/src/xinput.xml b/src/xinput.xml
index a0f42b3..bf4efe9 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -267,7 +267,7 @@ authorization from the authors.
 
     <struct name="DeviceTimeCoord">
         <field type="TIMESTAMP" name="time" />
-        <!-- Uninterpreted: list (axisvalues) of CARD32,
+        <!-- Uninterpreted: list (axisvalues) of INT32,
                             length is num_axes from GetDeviceMotionEvents -->
     </struct>
 
commit fcbd6d3e89ec1a8aed00e654d46bc89d512aad5b
Author: Christian Linhart <chris at demorecorder.com>
Date:   Fri Aug 15 20:36:20 2014 +0200

    xinput: GetDeviceMotionEvents-request: add pad at end
    
    see:
    http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml#n992
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XIproto.h#n474
    (file-positions may become wrong if the spec or header change)

diff --git a/src/xinput.xml b/src/xinput.xml
index 8e09d7d..a0f42b3 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -275,6 +275,7 @@ authorization from the authors.
         <field type="TIMESTAMP" name="start" />
         <field type="TIMESTAMP" name="stop" altenum="Time" />
         <field type="CARD8"     name="device_id" />
+        <pad bytes="3"/>
         <reply>
             <pad bytes="1" />
             <field type="CARD32" name="num_events" />
commit 5a24dadd9d4e4062dfd72acd1554fc5f9e23869c
Author: Christian Linhart <chris at demorecorder.com>
Date:   Fri Aug 15 20:36:19 2014 +0200

    xinput: XIGetProperty-reply: add align-pad at end
    
    reasons:
    * all X11-replies must have a length which is a multiple of 4 bytes
    * bitcases "8Bits" and "16bits" may have a length
      which is not a multiple of 4 bytes
      but they start on a 4-byte aligned position.
      Therefore the unpadded end of the request may not be 4-byte aligned
    * Therefore this requires a 4-byte align-pad.
    
    notes:
    * The align pad had to be added in each relevant bitcase
      because adding it after the switch would cause the generator
      to abort. (which is OK because a <switch> has to be the last item
      of a struct, request or reply, according to the xcb-xml-spec)

diff --git a/src/xinput.xml b/src/xinput.xml
index 7547f02..8e09d7d 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -1720,12 +1720,14 @@ authorization from the authors.
                     <list type="CARD8" name="data8">
                         <fieldref>num_items</fieldref>
                     </list>
+                    <pad align="4" />
                 </bitcase>
                 <bitcase>
                     <enumref ref="PropertyFormat">16Bits</enumref>
                     <list type="CARD16" name="data16">
                         <fieldref>num_items</fieldref>
                     </list>
+                    <pad align="4" />
                 </bitcase>
                 <bitcase>
                     <enumref ref="PropertyFormat">32Bits</enumref>
commit d65d8836a079a536ade19eb852103e131a912cb1
Author: Christian Linhart <chris at demorecorder.com>
Date:   Fri Aug 15 20:36:18 2014 +0200

    xinput: struct AddMaster: add align-pad at end
    
    reasons:
    * length of the struct is a multiple of 4 according to spec.
    * list of char may not end at a 4-byte aligned position.
    
    see:
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XI2proto.txt#n1224
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI2proto.h#n454
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI2proto.h#n458
    (file-positions may become wrong if the spec or header change)

diff --git a/src/xinput.xml b/src/xinput.xml
index 1103a86..7547f02 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -1200,6 +1200,7 @@ authorization from the authors.
         <list type="char" name="name">
             <fieldref>name_len</fieldref>
         </list>
+        <pad align="4" />
     </struct>
 
     <struct name="RemoveMaster">
commit 055c13096d94953de9ca62017f917572bd0e3f56
Author: Christian Linhart <chris at demorecorder.com>
Date:   Fri Aug 15 20:36:17 2014 +0200

    xinput: ChangeDeviceProperty-request: add align-pad at end
    
    reasons:
    * all X11-requests must have a length which is a multiple of 4 bytes
    * bitcases "8Bits" and "16bits" may have a length
      which is not a multiple of 4-bytes
      but they start on a 4-byte aligned position.
      Therefore the unpadded end of the request may not be 4-byte aligned
    * Therefore this requires a 4-byte align-pad.
    
    notes:
    * The align pad had to be added in each relevant bitcase
      because adding it after the switch would cause the generator
      to abort. (which is OK because a <switch> has to be the last item
      of a struct, request or reply, according to the xcb-xml-spec)

diff --git a/src/xinput.xml b/src/xinput.xml
index d6932ba..1103a86 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -1033,12 +1033,14 @@ authorization from the authors.
                 <list type="CARD8" name="data8">
                     <fieldref>num_items</fieldref>
                 </list>
+                <pad align="4" />
             </bitcase>
             <bitcase>
                 <enumref ref="PropertyFormat">16Bits</enumref>
                 <list type="CARD16" name="data16">
                     <fieldref>num_items</fieldref>
                 </list>
+                <pad align="4" />
             </bitcase>
             <bitcase>
                 <enumref ref="PropertyFormat">32Bits</enumref>
commit 4f7ededf36b8c6bebb369e141bf21a0a6e237cd3
Author: Christian Linhart <chris at demorecorder.com>
Date:   Fri Aug 15 20:36:16 2014 +0200

    xinput: GetDeviceProperty-reply: add align-pad at end
    
    reasons:
    * all X11-replies must have a length which is a multiple of 4 bytes
    * bitcases "8Bits" and "16bits" may have a length
      which is not a multiple of 4-bytes
      but they start on a 4-byte aligned position.
      Therefore the unpadded end of the request may not be 4-byte aligned
    * Therefore this requires a 4-byte align-pad.
    
    notes:
    * The align pad had to be added in each relevant bitcase
      because adding it after the switch would cause the generator
      to abort. (which is OK because a <switch> has to be the last item
      of a struct, request or reply, according to the xcb-xml-spec)

diff --git a/src/xinput.xml b/src/xinput.xml
index e0d887a..d6932ba 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -1086,12 +1086,14 @@ authorization from the authors.
                     <list type="CARD8" name="data8">
                         <fieldref>num_items</fieldref>
                     </list>
+                    <pad align="4" />
                 </bitcase>
                 <bitcase>
                     <enumref ref="PropertyFormat">16Bits</enumref>
                     <list type="CARD16" name="data16">
                         <fieldref>num_items</fieldref>
                     </list>
+                    <pad align="4" />
                 </bitcase>
                 <bitcase>
                     <enumref ref="PropertyFormat">32Bits</enumref>
commit 13f14416734df4a2c3415f22dac13d877d42b471
Author: Christian Linhart <chris at demorecorder.com>
Date:   Fri Aug 15 20:36:15 2014 +0200

    xinput: GetDeviceButtonMapping-reply: add align-pad at end
    
    see:
    http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml#n1691
    (file-position may become wrong if the spec changes)

diff --git a/src/xinput.xml b/src/xinput.xml
index cb24de3..e0d887a 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -704,6 +704,7 @@ authorization from the authors.
             <list type="CARD8" name="map">
                 <fieldref>map_size</fieldref>
             </list>
+            <pad align="4" />
         </reply>
     </request>
 
commit 30b0406b1de1e30cf6b32a3c7fb6a6203cccb100
Author: Christian Linhart <chris at demorecorder.com>
Date:   Fri Aug 15 20:36:14 2014 +0200

    xinput: GetDeviceKeyMapping-request: add pad at end
    
    see:
    http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml#n1583
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XIproto.h#n982
    (file-positions may become wrong if the spec or header change)

diff --git a/src/xinput.xml b/src/xinput.xml
index bfd02bb..cb24de3 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -628,6 +628,7 @@ authorization from the authors.
         <field type="CARD8"   name="device_id" />
         <field type="KeyCode" name="first_keycode" />
         <field type="CARD8"   name="count" />
+        <pad bytes="1" />
         <reply>
             <pad bytes="1" />
             <field type="CARD8" name="keysyms_per_keycode" />
commit aa18c4250a815520a4a8545ae256559470cb4148
Author: Christian Linhart <chris at demorecorder.com>
Date:   Fri Aug 15 20:36:13 2014 +0200

    xinput: SetDeviceFocus-request: add pad at end
    
    see:
    http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml#n1308
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XIproto.h#n737
    (file-positions may become wrong if the spec or header change)

diff --git a/src/xinput.xml b/src/xinput.xml
index 218c119..bfd02bb 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -436,6 +436,7 @@ authorization from the authors.
         <field type="TIMESTAMP" name="time" altenum="Time" />
         <field type="CARD8"     name="revert_to" enum="InputFocus" />
         <field type="CARD8"     name="device_id" />
+        <pad bytes="2" />
     </request>
 
     <!-- GetFeedbackControl -->
commit c57d5cf58b249c549074e0a0098fee3fb9ecaf87
Author: Christian Linhart <chris at demorecorder.com>
Date:   Fri Aug 15 20:36:12 2014 +0200

    xinput: AllowDeviceEvents-request: add pad at end
    
    see:
    http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml#n1251
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XIproto.h#n692
    (file-positions may become wrong if the spec or header change)

diff --git a/src/xinput.xml b/src/xinput.xml
index 519cd1b..218c119 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -412,6 +412,7 @@ authorization from the authors.
         <field type="TIMESTAMP" name="time" altenum="Time" />
         <field type="CARD8"     name="mode" enum="DeviceInputMode" />
         <field type="CARD8"     name="device_id" />
+        <pad bytes="2" />
     </request>
 
     <!-- GetDeviceFocus -->
commit a5c21eb0e5d9a9cf8a033a9225d9a4a02cbc151a
Author: Christian Linhart <chris at demorecorder.com>
Date:   Fri Aug 15 20:36:11 2014 +0200

    xinput: UngrabDeviceButton-request: add pad at end
    
    see:
    http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml#n1229
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XIproto.h#n676
    (file-positions may become wrong if the spec or header change)

diff --git a/src/xinput.xml b/src/xinput.xml
index 861a9ca..519cd1b 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -394,6 +394,7 @@ authorization from the authors.
         <field type="CARD8"  name="modifier_device" />
         <field type="CARD8"  name="button" altenum="Grab" />
         <field type="CARD8"  name="grabbed_device" />
+        <pad bytes="3" />
     </request>
 
     <!-- AllowDeviceEvents -->
commit 8da2ea01f3629ab2ee74501341c84247e7316ec8
Author: Christian Linhart <chris at demorecorder.com>
Date:   Fri Aug 15 20:36:10 2014 +0200

    xinput: UngrabDevice-request: add pad at end
    
    see:
    http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml#n1130
    http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XIproto.h#n596
    (file-positions may become wrong if the spec or header change)

diff --git a/src/xinput.xml b/src/xinput.xml
index 87db67c..861a9ca 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -337,6 +337,7 @@ authorization from the authors.
     <request name="UngrabDevice" opcode="14">
         <field type="TIMESTAMP" name="time" altenum="Time" />
         <field type="CARD8"     name="device_id" />
+        <pad bytes="3" />
     </request>
 
     <!-- GrabDeviceKey -->
commit d9a3d5b1ab5044f0931282c25a4bc1d36f12849c
Author: Christian Linhart <chris at demorecorder.com>
Date:   Fri Aug 15 20:36:09 2014 +0200

    xinput: OpenDevice-reply: add align-pad at end
    
    see:
    http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml#n834
    (file-position may become wrong if the spec changes)

diff --git a/src/xinput.xml b/src/xinput.xml
index cdb414d..87db67c 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -179,6 +179,7 @@ authorization from the authors.
             <list type="InputClassInfo" name="class_info">
                 <fieldref>num_classes</fieldref>
             </list>
+            <pad align="4" />
         </reply>
     </request>
 


More information about the xcb-commit mailing list