xinput: struct FeedbackState: full support
[free-sw/xcb/proto] / src / xkb.xml
index 31234e7..ad52ea2 100644 (file)
@@ -130,33 +130,21 @@ authorization from the authors.
                <item name="ControlsEnabled"> <bit>31</bit> </item>
        </enum>
 
-       <enum name="AXFBOpt">
+       <enum name="AXOption">
                <item name="SKPressFB">     <bit>0</bit> </item>
                <item name="SKAcceptFB">    <bit>1</bit> </item>
                <item name="FeatureFB">     <bit>2</bit> </item>
                <item name="SlowWarnFB">    <bit>3</bit> </item>
                <item name="IndicatorFB">   <bit>4</bit> </item>
                <item name="StickyKeysFB">  <bit>5</bit> </item>
-               <item name="SKReleaseFB">   <bit>6</bit> </item>
-               <item name="SKRejectFB">    <bit>7</bit> </item>
-               <item name="BKRejectFB">    <bit>8</bit> </item>
-               <item name="DumbBell">      <bit>9</bit> </item>
+               <item name="TwoKeys">       <bit>6</bit> </item>
+               <item name="LatchToLock">   <bit>7</bit> </item>
+               <item name="SKReleaseFB">   <bit>8</bit> </item>
+               <item name="SKRejectFB">    <bit>9</bit> </item>
+               <item name="BKRejectFB">    <bit>10</bit> </item>
+               <item name="DumbBell">      <bit>11</bit> </item>
        </enum>
 
-       <enum name="AXSKOpt">
-               <item name="TwoKeys">     <bit>6</bit> </item>
-               <item name="LatchToLock"> <bit>7</bit> </item>
-       </enum>
-
-       <union name="AXOption">
-               <field name="fbopt" type="CARD16" enum="AXFBOpt" />
-               <field name="skopt" type="CARD16" enum="AXSKOpt" />
-       </union>
-
-       <enum name="Device">
-               <item name="UseCoreKbd"> <bit>8</bit> </item>
-               <item name="UseCorePtr"> <bit>9</bit> </item>
-       </enum>
        <typedef oldname="CARD16" newname="DeviceSpec" />
 
        <enum name="LedClassResult">
@@ -165,8 +153,10 @@ authorization from the authors.
        </enum>
 
        <enum name="LedClass">
-               <item name="DfltXIClass">  <value>768</value> </item>   <!--0x300-->
-               <item name="AllXIClasses"> <value>1280</value> </item>  <!--0x500-->
+               <item name="KbdFeedbackClass"> <value>0</value> </item>
+               <item name="LedFeedbackClass"> <value>4</value> </item>
+               <item name="DfltXIClass">      <value>768</value> </item>       <!--0x300-->
+               <item name="AllXIClasses">     <value>1280</value> </item>      <!--0x500-->
        </enum>
        <typedef oldname="CARD16" newname="LedClassSpec" />
 
@@ -176,24 +166,23 @@ authorization from the authors.
        </enum>
 
        <enum name="BellClass">
-               <item name="DfltXIClass"> <value>768</value> </item>    <!--0x300-->
+               <item name="KbdFeedbackClass">  <value>0</value> </item>
+               <item name="BellFeedbackClass"> <value>5</value> </item>
+               <item name="DfltXIClass">       <value>768</value> </item>      <!--0x300-->
        </enum>
        <typedef oldname="CARD16" newname="BellClassSpec" />
 
        <enum name="ID">
-               <item name="DfltXIId"> <bit>10</bit> </item>
+               <item name="UseCoreKbd">  <value>256</value> </item>    <!-- 0x100 -->
+               <item name="UseCorePtr">  <value>512</value> </item>    <!-- 0x200 -->
+               <item name="DfltXIClass"> <value>768</value> </item>    <!-- 0x300 -->
+               <item name="DfltXIId">   <value>1024</value> </item>    <!-- 0x400 -->
+               <item name="AllXIClass"> <value>1280</value> </item>    <!-- 0x500 -->
+               <item name="AllXIId">    <value>1536</value> </item>    <!-- 0x600 -->
+               <item name="XINone">     <value>65280</value> </item>   <!--0xff00-->
        </enum>
        <typedef oldname="CARD16" newname="IDSpec" />
 
-       <enum name="IDResult">
-               <item name="XINone"> <value>65280</value> </item>       <!--0xff00-->
-       </enum>
-
-       <enum name="MultiId">
-               <item name="AllXIIds"> <value>1280</value> </item>      <!--0x500-->
-       </enum>
-       <typedef oldname="CARD16" newname="MultiIdSpec" />
-
        <enum name="Group">
                <item name="1"> <value>0</value> </item>
                <item name="2"> <value>1</value> </item>
@@ -275,7 +264,7 @@ authorization from the authors.
                <item name="KeyType1">    <bit>0</bit> </item>
        </enum>
 
-       <enum name="SymInterpret">
+       <enum name="SymInterpretMatch">
                <item name="NoneOf">      <value>0</value> </item>
                <item name="AnyOfOrNone"> <value>1</value> </item>
                <item name="AnyOf">       <value>2</value> </item>
@@ -318,7 +307,7 @@ authorization from the authors.
                <field name="mods" type="CARD8" mask="ModMask" />
                <field name="realMods" type="CARD8" mask="ModMask" />
                <field name="vmods" type="CARD16" mask="VMod" />
-               <field name="ctrls" type="CARD32" enum="BoolCtrl" />
+               <field name="ctrls" type="CARD32" mask="BoolCtrl" />
        </struct>
 
        <enum name="CMDetail">
@@ -354,21 +343,14 @@ authorization from the authors.
                <item name="OtherNames">    <bit>7</bit> </item>
        </enum>
 
-       <enum name="XIExtDevFeature">
+       <enum name="XIFeature">
+               <item name="Keyboards">      <bit>0</bit> </item>
                <item name="ButtonActions">  <bit>1</bit> </item>
                <item name="IndicatorNames"> <bit>2</bit> </item>
                <item name="IndicatorMaps">  <bit>3</bit> </item>
                <item name="IndicatorState"> <bit>4</bit> </item>
        </enum>
 
-       <enum name="XIFeature">
-               <item name="Keyboards"> <value>1</value> </item>
-       </enum>
-
-       <enum name="XIDetail">
-               <item name="UnsupportedFeature"> <bit>15</bit> </item>
-       </enum>
-
        <enum name="PerClientFlag">
                <item name="DetectableAutoRepeat">   <bit>0</bit> </item>
                <item name="GrabsUseXKBState">       <bit>1</bit> </item>
@@ -384,33 +366,42 @@ authorization from the authors.
        </struct>
 
        <struct name="KeyName">
-               <list name="name" type="CARD8">
+               <list name="name" type="char">
                        <value>4</value>
                </list>
        </struct>
 
        <struct name="KeyAlias">
-               <list name="real" type="CARD8">
+               <list name="real" type="char">
                        <value>4</value>
                </list>
-               <list name="alias" type="CARD8">
+               <list name="alias" type="char">
                        <value>4</value>
                </list>
        </struct>
 
-       <struct name="CountedString8">
-               <field name="length" type="CARD8" />
-               <list name="string" type="CARD8">
-                       <fieldref>length</fieldref>
-               </list>
-       </struct>
-
        <struct name="CountedString16">
                <field name="length" type="CARD16" />
-               <list name="string" type="CARD8">
+               <list name="string" type="char">
                        <fieldref>length</fieldref>
                </list>
-               <pad bytes="1" />
+               <list type="void" name="alignment_pad">
+                       <op op="-">
+                               <op op="&amp;">
+                                       <op op="+">
+                                               <fieldref>length</fieldref>
+                                               <value>5</value>
+                                       </op>
+                                       <unop op="~">
+                                               <value>3</value>
+                                       </unop>
+                               </op>
+                               <op op="+">
+                                       <fieldref>length</fieldref>
+                                       <value>2</value>
+                               </op>
+                       </op>
+               </list>
        </struct>
 
        <struct name="KTMapEntry">
@@ -472,32 +463,26 @@ authorization from the authors.
                <field name="group" type="CARD8" />
        </struct>
 
-       <struct name="Overlay1Behavior">
+       <struct name="OverlayBehavior">
                <field name="type" type="CARD8" />
                <field name="key" type="KEYCODE" />
        </struct>
 
-       <struct name="Overlay2Behavior">
-               <field name="type" type="CARD8" />
-               <field name="key" type="CARD8" />
-       </struct>
-
        <typedef oldname="LockBehavior" newname="PermamentLockBehavior" />
        <typedef oldname="RadioGroupBehavior" newname="PermamentRadioGroupBehavior" />
-       <typedef oldname="Overlay1Behavior" newname="PermamentOverlay1Behavior" />
-       <typedef oldname="Overlay2Behavior" newname="PermamentOverlay2Behavior" />
+       <typedef oldname="OverlayBehavior" newname="PermamentOverlayBehavior" />
 
        <union name="Behavior">
                <field name="common" type="CommonBehavior" />
                <field name="default" type="DefaultBehavior" />
                <field name="lock" type="LockBehavior" />
                <field name="radioGroup" type="RadioGroupBehavior" />
-               <field name="overlay1" type="Overlay1Behavior" />
-               <field name="overlay2" type="Overlay2Behavior" />
+               <field name="overlay1" type="OverlayBehavior" />
+               <field name="overlay2" type="OverlayBehavior" />
                <field name="permamentLock" type="PermamentLockBehavior" />
                <field name="permamentRadioGroup" type="PermamentRadioGroupBehavior" />
-               <field name="permamentOverlay1" type="PermamentOverlay1Behavior" />
-               <field name="permamentOverlay2" type="PermamentOverlay2Behavior" />
+               <field name="permamentOverlay1" type="PermamentOverlayBehavior" />
+               <field name="permamentOverlay2" type="PermamentOverlayBehavior" />
                <field name="type" type="CARD8" />
        </union>
 
@@ -562,6 +547,7 @@ authorization from the authors.
 
        <typedef oldname="char" newname="STRING8" />
 
+       <!-- XXX: Property is broken
        <struct name="Property">
                <field name="nameLength" type="CARD16" />
                <list name="name" type="STRING8">
@@ -572,6 +558,15 @@ authorization from the authors.
                        <fieldref>valueLength</fieldref>
                </list>
        </struct>
+       -->
+       <!-- XXX: This would be the correct Property structure as per spec.,
+                 but it's broken atm. too. Add it anyway here, so we don't
+                 loose that information.
+       <struct name="Property">
+               <field name="name" type="CountedString16" />
+               <field name="value" type="CountedString16" />
+       </struct>
+       -->
 
        <struct name="Outline">
                <field name="nPoints" type="CARD8" />
@@ -648,6 +643,7 @@ authorization from the authors.
                <item name="Logo">      <value>5</value> </item>
        </enum>
 
+       <!-- XXX: doodads are broken
        <struct name="CommonDoodad">
                <field name="name" type="ATOM" />
                <field name="type" type="CARD8" enum="DoodadType" />
@@ -655,6 +651,7 @@ authorization from the authors.
                <field name="top" type="INT16" />
                <field name="left" type="INT16" />
                <field name="angle" type="INT16" />
+               <pad bytes="8" />
        </struct>
 
        <struct name="ShapeDoodad">
@@ -740,6 +737,7 @@ authorization from the authors.
                        <fieldref>nOverlays</fieldref>
                </list>
        </struct>
+       -->
 
        <struct name="Listing">
                <field name="flags" type="CARD16" />
@@ -750,8 +748,8 @@ authorization from the authors.
        </struct>
 
        <struct name="DeviceLedInfo">
-               <field name="ledClass" type="LedClassSpec" mask="LedClass" />
-               <field name="ledID" type="IDSpec" mask="ID" />
+               <field name="ledClass" type="LedClassSpec" enum="LedClass" />
+               <field name="ledID" type="IDSpec" altenum="ID" />
                <field name="namesPresent" type="CARD32" />
                <field name="mapsPresent" type="CARD32" />
                <field name="physIndicators" type="CARD32" />
@@ -879,7 +877,8 @@ authorization from the authors.
        </struct>
 
        <enum name="SASetPtrDfltFlag">
-               <item name="DfltBtnAbsolute">  <bit>1</bit> </item>
+               <!-- The spec says 0x02 but Xlib uses 0x04. -->
+               <item name="DfltBtnAbsolute">  <bit>2</bit> </item>
                <item name="AffectDfltButton"> <bit>0</bit> </item>
        </enum>
 
@@ -1008,6 +1007,7 @@ authorization from the authors.
                <pad bytes="1" />
                <field name="button" type="CARD8" />
                <field name="device" type="CARD8" />
+               <pad bytes="3" />
        </struct>
 
        <enum name="SAValWhat">
@@ -1030,6 +1030,23 @@ authorization from the authors.
                <field name="val2value" type="CARD8" />
        </struct>
 
+       <struct name="SIAction">
+               <field name="type" type="CARD8" enum="SAType" />
+               <list name="data" type="CARD8">
+                       <value>7</value>
+               </list>
+       </struct>
+
+       <struct name="SymInterpret">
+               <field name="sym" type="KEYSYM" />
+               <field name="mods" type="CARD8" mask="ModMask" />
+               <!-- "match" may also have XkbSI_LevelOneOnly (0x80) or'd into it -->
+               <field name="match" type="CARD8" altenum="SymInterpretMatch" />
+               <field name="virtualMod" type="CARD8" mask="VModsLow" />
+               <field name="flags" type="CARD8" />
+               <field name="action" type="SIAction" />
+       </struct>
+
        <union name="Action">
                <field name="noaction" type="SANoAction" />
                <field name="setmods" type="SASetMods" />
@@ -1070,11 +1087,11 @@ authorization from the authors.
 
        <request name="SelectEvents" opcode="1">
                <field name="deviceSpec" type="DeviceSpec" />
-               <field name="affectWhich" type="CARD16" enum="EventType" />
-               <field name="clear" type="CARD16" enum="EventType" />
-               <field name="selectAll" type="CARD16" enum="EventType" />
-               <field name="affectMap" type="CARD16" enum="MapPart" />
-               <field name="map" type="CARD16" enum="MapPart" />
+               <field name="affectWhich" type="CARD16" mask="EventType" />
+               <field name="clear" type="CARD16" mask="EventType" />
+               <field name="selectAll" type="CARD16" mask="EventType" />
+               <field name="affectMap" type="CARD16" mask="MapPart" />
+               <field name="map" type="CARD16" mask="MapPart" />
                <switch name="details">
                        <op op="&amp;">
                                <fieldref>affectWhich</fieldref>
@@ -1135,13 +1152,13 @@ authorization from the authors.
                        </bitcase>
                        <bitcase>
                                <enumref ref="EventType">ExtensionDeviceNotify</enumref>
-                               <field name="affectExtDev" type="CARD16" mask="XIDetail" />
-                               <field name="extdevDetails" type="CARD16" mask="XIDetail" />
+                               <field name="affectExtDev" type="CARD16" mask="XIFeature" />
+                               <field name="extdevDetails" type="CARD16" mask="XIFeature" />
                        </bitcase>
                </switch>
        </request>
 
-       <request name="Bell" opcode="2">
+       <request name="Bell" opcode="3">
                <field name="deviceSpec" type="DeviceSpec" />
                <field name="bellClass" type="BellClassSpec" />
                <field name="bellID" type="IDSpec" />
@@ -1156,7 +1173,7 @@ authorization from the authors.
                <field name="window" type="WINDOW" />
        </request>
 
-       <request name="GetState" opcode="3">
+       <request name="GetState" opcode="4">
                <field name="deviceSpec" type="DeviceSpec" />
                <pad bytes="2" />
                <reply>
@@ -1172,6 +1189,7 @@ authorization from the authors.
                        <field name="compatState" type="CARD8" mask="ModMask" />
                        <field name="grabMods" type="CARD8" mask="ModMask" />
                        <field name="compatGrabMods" type="CARD8" mask="ModMask" />
+                        <field name="lookupMods" type="CARD8" mask="ModMask" />
                        <field name="compatLookupMods" type="CARD8" mask="ModMask" />
                        <pad bytes="1" />
                        <field name="ptrBtnState" type="CARD16" mask="KeyButMask" />
@@ -1186,6 +1204,10 @@ authorization from the authors.
                <field name="lockGroup" type="BOOL" />
                <field name="groupLock" type="CARD8" enum="Group" />
                <field name="affectModLatches" type="CARD8" mask="ModMask" />
+               <pad bytes="1" /> <!-- This pad is a workaround to prevent an API break,
+                                      which the following field (correct fix) would cause.
+               <field name="modLatches" type="CARD8" mask="ModMask" />
+               -->
                <pad bytes="1" />
                <field name="latchGroup" type="BOOL" />
                <field name="groupLatch" type="CARD16" />
@@ -1215,14 +1237,14 @@ authorization from the authors.
                        <field name="mouseKeysTimeToMax" type="CARD16" />
                        <field name="mouseKeysMaxSpeed" type="CARD16" />
                        <field name="mouseKeysCurve" type="INT16" />
-                       <field name="accessXOption" type="AXOption" />
+                       <field name="accessXOption" type="CARD16" mask="AXOption" />
                        <field name="accessXTimeout" type="CARD16" />
-                       <field name="accessXTimeoutOptionsMask" type="AXOption" />
-                       <field name="accessXTimeoutOptionsValues" type="AXOption" />
+                       <field name="accessXTimeoutOptionsMask" type="CARD16" mask="AXOption" />
+                       <field name="accessXTimeoutOptionsValues" type="CARD16" mask="AXOption" />
                        <pad bytes="2" />
-                       <field name="accessXTimeoutMask" type="CARD32" enum="BoolCtrl" />
-                       <field name="accessXTimeoutValues" type="CARD32" enum="BoolCtrl" />
-                       <field name="enabledControls" type="CARD32" enum="BoolCtrl" />
+                       <field name="accessXTimeoutMask" type="CARD32" mask="BoolCtrl" />
+                       <field name="accessXTimeoutValues" type="CARD32" mask="BoolCtrl" />
+                       <field name="enabledControls" type="CARD32" mask="BoolCtrl" />
                        <list name="perKeyRepeat" type="CARD8">
                                <value>32</value>
                        </list>
@@ -1232,19 +1254,19 @@ authorization from the authors.
        <request name="SetControls" opcode="7">
                <field name="deviceSpec" type="DeviceSpec" />
                <field name="affectInternalRealMods" type="CARD8" mask="ModMask" />
-               <field name="interanlRealMods" type="CARD8" mask="ModMask" />
+               <field name="internalRealMods" type="CARD8" mask="ModMask" />
                <field name="affectIgnoreLockRealMods" type="CARD8" mask="ModMask" />
                <field name="ignoreLockRealMods" type="CARD8" mask="ModMask" />
                <field name="affectInternalVirtualMods" type="CARD16" mask="VMod" />
                <field name="internalVirtualMods" type="CARD16" mask="VMod" />
-               <field name="affectInternalLockVirtualMods" type="CARD16" mask="VMod" />
-               <field name="internalLockVirtualMods" type="CARD16" mask="VMod" />
+               <field name="affectIgnoreLockVirtualMods" type="CARD16" mask="VMod" />
+               <field name="ignoreLockVirtualMods" type="CARD16" mask="VMod" />
                <field name="mouseKeysDfltBtn" type="CARD8" />
                <field name="groupsWrap" type="CARD8" />
-               <field name="accessXOptions" type="AXOption" />
+               <field name="accessXOptions" type="CARD16" mask="AXOption" />
                <pad bytes="2" />
-               <field name="affectEnabledControls" type="CARD32" enum="BoolCtrl" />
-               <field name="enabledControls" type="CARD32" enum="BoolCtrl" />
+               <field name="affectEnabledControls" type="CARD32" mask="BoolCtrl" />
+               <field name="enabledControls" type="CARD32" mask="BoolCtrl" />
                <field name="changeControls" type="CARD32" mask="Control" />
                <field name="repeatDelay" type="CARD16" />
                <field name="repeatInterval" type="CARD16" />
@@ -1256,10 +1278,10 @@ authorization from the authors.
                <field name="mouseKeysMaxSpeed" type="CARD16" />
                <field name="mouseKeysCurve" type="INT16" />
                <field name="accessXTimeout" type="CARD16" />
-               <field name="accessXTimeoutMask" type="CARD32" enum="BoolCtrl" />
-               <field name="accessXTimeoutValues" type="CARD32" enum="BoolCtrl" />
-               <field name="accessXTimeoutOptionsMask" type="AXOption" />
-               <field name="accessXTimeoutOptionsValues" type="AXOption" />
+               <field name="accessXTimeoutMask" type="CARD32" mask="BoolCtrl" />
+               <field name="accessXTimeoutValues" type="CARD32" mask="BoolCtrl" />
+               <field name="accessXTimeoutOptionsMask" type="CARD16" mask="AXOption" />
+               <field name="accessXTimeoutOptionsValues" type="CARD16" mask="AXOption" />
                <list name="perKeyRepeat" type="CARD8">
                        <value>32</value>
                </list>
@@ -1267,8 +1289,8 @@ authorization from the authors.
 
        <request name="GetMap" opcode="8">
                <field name="deviceSpec" type="DeviceSpec" />
-               <field name="full" type="CARD16" enum="MapPart" />
-               <field name="partial" type="CARD16" enum="MapPart" />
+               <field name="full" type="CARD16" mask="MapPart" />
+               <field name="partial" type="CARD16" mask="MapPart" />
                <field name="firstType" type="CARD8" />
                <field name="nTypes" type="CARD8" />
                <field name="firstKeySym" type="KEYCODE" />
@@ -1290,7 +1312,7 @@ authorization from the authors.
                        <pad bytes="2" />
                        <field name="minKeyCode" type="KEYCODE" />
                        <field name="maxKeyCode" type="KEYCODE" />
-                       <field name="present" type="CARD16" enum="MapPart" />
+                       <field name="present" type="CARD16" mask="MapPart" />
                        <field name="firstType" type="CARD8" />
                        <field name="nTypes" type="CARD8" />
                        <field name="totalTypes" type="CARD8" />
@@ -1333,6 +1355,7 @@ authorization from the authors.
                                        <list name="acts_rtrn_count" type="CARD8">
                                                <fieldref>nKeyActions</fieldref>
                                        </list>
+                                        <pad align="4" />
                                        <list name="acts_rtrn_acts" type="Action">
                                                <fieldref>totalActions</fieldref>
                                        </list>
@@ -1346,20 +1369,23 @@ authorization from the authors.
                                <bitcase>
                                        <enumref ref="MapPart">VirtualMods</enumref>
                                        <list name="vmods_rtrn" type="CARD8" mask="ModMask">
-                                               <fieldref>nVModMapKeys</fieldref>
+                                               <popcount><fieldref>virtualMods</fieldref></popcount>
                                        </list>
+                                        <pad align="4" />
                                </bitcase>
                                <bitcase>
                                        <enumref ref="MapPart">ExplicitComponents</enumref>
                                        <list name="explicit_rtrn" type="SetExplicit">
                                                <fieldref>totalKeyExplicit</fieldref>
                                        </list>
+                                        <pad align="4" />
                                </bitcase>
                                <bitcase>
                                        <enumref ref="MapPart">ModifierMap</enumref>
                                        <list name="modmap_rtrn" type="KeyModMap">
                                                <fieldref>totalModMapKeys</fieldref>
                                        </list>
+                                        <pad align="4" />
                                </bitcase>
                                <bitcase>
                                        <enumref ref="MapPart">VirtualModMap</enumref>
@@ -1373,7 +1399,7 @@ authorization from the authors.
 
        <request name="SetMap" opcode="9">
                <field name="deviceSpec" type="DeviceSpec" />
-               <field name="present" type="CARD16" enum="MapPart" />
+               <field name="present" type="CARD16" mask="MapPart" />
                <field name="flags" type="CARD16" mask="SetMapFlags" />
                <field name="minKeyCode" type="KEYCODE" />
                <field name="maxKeyCode" type="KEYCODE" />
@@ -1430,7 +1456,7 @@ authorization from the authors.
                        <bitcase>
                                <enumref ref="MapPart">VirtualMods</enumref>
                                <list name="vmods" type="CARD8">
-                                       <fieldref>nVModMapKeys</fieldref>
+                                       <popcount><fieldref>virtualMods</fieldref></popcount>
                                </list>
                        </bitcase>
                        <bitcase>
@@ -1468,11 +1494,8 @@ authorization from the authors.
                        <field name="nSIRtrn" type="CARD16" />
                        <field name="nTotalSI" type="CARD16" />
                        <pad bytes="16" />
-                       <list name="si_rtrn" type="CARD8" mask="SymInterpret">
-                               <op op="*">
-                                       <value>16</value>
-                                       <fieldref>nSIRtrn</fieldref>
-                               </op>
+                       <list name="si_rtrn" type="SymInterpret">
+                               <fieldref>nSIRtrn</fieldref>
                        </list>
                        <list name="group_rtrn" type="ModDef">
                                <popcount>
@@ -1491,11 +1514,8 @@ authorization from the authors.
                <field name="firstSI" type="CARD16" />
                <field name="nSI" type="CARD16" />
                <pad bytes="2"/>
-               <list name="si" type="CARD8" mask="SymInterpret">
-                       <op op="*">
-                               <value>16</value>
-                               <fieldref>nSI</fieldref>
-                       </op>
+               <list name="si" type="SymInterpret">
+                       <fieldref>nSI</fieldref>
                </list>
                <list name="groupMaps" type="ModDef">
                        <popcount>
@@ -1525,7 +1545,7 @@ authorization from the authors.
                        <field name="nIndicators" type="CARD8" />
                        <pad bytes="15" />
                        <list name="maps" type="IndicatorMap">
-                               <fieldref>nIndicators</fieldref>
+                               <popcount><fieldref>which</fieldref></popcount>
                        </list>
                </reply>
        </request>
@@ -1543,8 +1563,8 @@ authorization from the authors.
 
        <request name="GetNamedIndicator" opcode="15">
                <field name="deviceSpec" type="DeviceSpec" />
-               <field name="ledClass" type="LedClassSpec" mask="LedClass" />
-               <field name="ledID" type="IDSpec" mask="ID" />
+               <field name="ledClass" type="LedClassSpec" enum="LedClass" />
+               <field name="ledID" type="IDSpec" altenum="ID" />
                <pad bytes="2" />
                <field name="indicator" type="ATOM" />
                <reply>
@@ -1562,14 +1582,15 @@ authorization from the authors.
                        <field name="map_realMods" type="CARD8" mask="ModMask" />
                        <field name="map_vmod" type="CARD16" mask="VMod" />
                        <field name="map_ctrls" type="CARD32" mask="BoolCtrl" />
+                       <field name="supported" type="BOOL" />
                        <pad bytes="3" />
                </reply>
        </request>
 
        <request name="SetNamedIndicator" opcode="16" >
                <field name="deviceSpec" type="DeviceSpec" />
-               <field name="ledClass" type="LedClassSpec" mask="LedClass" />
-               <field name="ledID" type="IDSpec" mask="ID" />
+               <field name="ledClass" type="LedClassSpec" enum="LedClass" />
+               <field name="ledID" type="IDSpec" altenum="ID" />
                <pad bytes="2" />
                <field name="indicator" type="ATOM" />
                <field name="setState" type="BOOL" />
@@ -1596,7 +1617,7 @@ authorization from the authors.
                        <field name="minKeyCode" type="KEYCODE" />
                        <field name="maxKeyCode" type="KEYCODE" />
                        <field name="nTypes" type="CARD8" />
-                       <field name="groupNames" type="CARD8" mask="Group" />
+                       <field name="groupNames" type="CARD8" mask="SetOfGroup" />
                        <field name="virtualMods" type="CARD16" mask="VMod" />
                        <field name="firstKey" type="KEYCODE" />
                        <field name="nKeys" type="CARD8" />
@@ -1640,7 +1661,25 @@ authorization from the authors.
                                <bitcase>
                                        <enumref ref="NameDetail">KTLevelNames</enumref>
                                        <list name="nLevelsPerType" type="CARD8">
-                                               <fieldref>nKTLevels</fieldref>
+                                         <!-- Xlib uses NTypes here - 
+                                              the spec says nKTLevels is correct, but
+                                              it does not work in reality
+                                              <fieldref>nKTLevels</fieldref> -->
+                                               <fieldref>nTypes</fieldref>
+                                       </list>
+                                       <list type="CARD8" name="alignment_pad">
+                                           <op op="-">
+                                               <op op="&amp;">
+                                                   <op op="+">
+                                                       <fieldref>nTypes</fieldref>
+                                                       <value>3</value>
+                                                   </op>
+                                                   <unop op="~">
+                                                       <value>3</value>
+                                                   </unop>
+                                               </op>
+                                               <fieldref>nTypes</fieldref>
+                                           </op>
                                        </list>
                                        <list name="ktLevelNames" type="ATOM">
                                                <sumof ref="nLevelsPerType" />
@@ -1743,7 +1782,7 @@ authorization from the authors.
                        <bitcase>
                                <enumref ref="NameDetail">KTLevelNames</enumref>
                                <list name="nLevelsPerType" type="CARD8">
-                                       <fieldref>nKTLevels</fieldref>
+                                       <fieldref>nTypes</fieldref>
                                </list>
                                <list name="ktLevelNames" type="ATOM">
                                        <sumof ref="nLevelsPerType" />
@@ -1794,6 +1833,7 @@ authorization from the authors.
                </switch>
        </request>
 
+       <!-- XXX: Property and doodads are broken, which renders GetGeometry useless
        <request name="GetGeometry" opcode="19">
                <field name="deviceSpec" type="DeviceSpec" />
                <pad bytes="2" />
@@ -1834,7 +1874,9 @@ authorization from the authors.
                        </list>
                </reply>
        </request>
+       -->
 
+       <!-- XXX: Property and doodads are broken, which renders SetGeometry useless
        <request name="SetGeometry" opcode="20">
                <field name="deviceSpec" type="DeviceSpec" />
                <field name="nShapes" type="CARD8" />
@@ -1869,6 +1911,7 @@ authorization from the authors.
                        <fieldref>nKeyAliases</fieldref>
                </list>
        </request>
+       -->
 
        <request name="PerClientFlags" opcode="21">
                <field name="deviceSpec" type="DeviceSpec" />
@@ -1891,6 +1934,7 @@ authorization from the authors.
        <request name="ListComponents" opcode="22">
                <field name="deviceSpec" type="DeviceSpec" />
                <field name="maxNames" type="CARD16" />
+               <!-- XXX: Intermixed fixed size fields and lists are broken
                <field name="keymapsSpecLen" type="CARD8" />
                <list name="keymapsSpec" type="STRING8">
                        <fieldref>keymapsSpecLen</fieldref>
@@ -1915,6 +1959,7 @@ authorization from the authors.
                <list name="geometrySpec" type="STRING8">
                        <fieldref>geometrySpecLen</fieldref>
                </list>
+               -->
                <reply>
                        <field name="deviceID" type="CARD8" />
                        <field name="nKeymaps" type="CARD16" />
@@ -1952,6 +1997,7 @@ authorization from the authors.
                <field name="want" type="CARD16" mask="GBNDetail" />
                <field name="load" type="BOOL" />
                <pad bytes="1" />
+               <!-- XXX: Intermixed fixed size fields and lists are broken
                <field name="keymapsSpecLen" type="CARD8" />
                <list name="keymapsSpec" type="STRING8">
                        <fieldref>keymapsSpecLen</fieldref>
@@ -1976,6 +2022,7 @@ authorization from the authors.
                <list name="geometrySpec" type="STRING8">
                        <fieldref>geometrySpecLen</fieldref>
                </list>
+               -->
                <reply>
                        <field name="deviceID" type="CARD8" />
                        <field name="minKeyCode" type="KEYCODE" />
@@ -1987,13 +2034,22 @@ authorization from the authors.
                        <pad bytes="16" />
                        <switch name="replies">
                                <fieldref>reported</fieldref>
-                               <bitcase>
+                               <bitcase name="types">
                                        <enumref ref="GBNDetail">Types</enumref>
+                                       <enumref ref="GBNDetail">ClientSymbols</enumref>
+                                       <enumref ref="GBNDetail">ServerSymbols</enumref>
+                                       <!-- from the spec, this has to be a GetMap reply -->
+                                       <field name="getmap_type" type="CARD8" />
+                                       <!-- done 'emulating' GetMap reply header-->
                                        <field name="typeDeviceID" type="CARD8" />
+                                       <!-- from the spec, this has to be a GetMap reply -->
+                                       <field name="getmap_sequence" type="CARD16" />
+                                       <field name="getmap_length" type="CARD32" />
+                                       <!-- done 'emulating' GetMap reply header-->
                                        <pad bytes="2" />
                                        <field name="typeMinKeyCode" type="KEYCODE" />
                                        <field name="typeMaxKeyCode" type="KEYCODE" />
-                                       <field name="present" type="CARD16" enum="MapPart" />
+                                       <field name="present" type="CARD16" mask="MapPart" />
                                        <field name="firstType" type="CARD8" />
                                        <field name="nTypes" type="CARD8" />
                                        <field name="totalTypes" type="CARD8" />
@@ -2049,7 +2105,7 @@ authorization from the authors.
                                                <bitcase>
                                                        <enumref ref="MapPart">VirtualMods</enumref>
                                                        <list name="vmods_rtrn" type="CARD8" mask="ModMask">
-                                                               <fieldref>nVModMapKeys</fieldref>
+                                                               <popcount><fieldref>virtualMods</fieldref></popcount>
                                                        </list>
                                                </bitcase>
                                                <bitcase>
@@ -2072,20 +2128,22 @@ authorization from the authors.
                                                </bitcase>
                                        </switch>
                                </bitcase>
-                               <bitcase>
+                               <bitcase name="compat_map">
                                        <enumref ref="GBNDetail">CompatMap</enumref>
+                                       <!-- from the spec, this has to include a reply header -->
+                                       <field name="compatmap_type" type="CARD8" />
                                        <field name="compatDeviceID" type="CARD8" />
+                                       <field name="compatmap_sequence" type="CARD16" />
+                                       <field name="compatmap_length" type="CARD32" />
+                                       <!-- done 'emulating' reply header -->
                                        <field name="groupsRtrn" type="CARD8" mask="SetOfGroup" />
                                        <pad bytes="1" />
                                        <field name="firstSIRtrn" type="CARD16" />
                                        <field name="nSIRtrn" type="CARD16" />
                                        <field name="nTotalSI" type="CARD16" />
                                        <pad bytes="16" />
-                                       <list name="si_rtrn" type="CARD8" mask="SymInterpret">
-                                               <op op="*">
-                                                       <value>16</value>
-                                                       <fieldref>nSIRtrn</fieldref>
-                                               </op>
+                                       <list name="si_rtrn" type="SymInterpret">
+                                               <fieldref>nSIRtrn</fieldref>
                                        </list>
                                        <list name="group_rtrn" type="ModDef">
                                                <popcount>
@@ -2093,179 +2151,14 @@ authorization from the authors.
                                                </popcount>
                                        </list>
                                </bitcase>
-                               <bitcase>
-                                       <enumref ref="GBNDetail">ClientSymbols</enumref>
-                                       <field name="clientDeviceID" type="CARD8" />
-                                       <pad bytes="2" />
-                                       <field name="clientMinKeyCode" type="KEYCODE" />
-                                       <field name="clientMaxKeyCode" type="KEYCODE" />
-                                       <field name="present" type="CARD16" enum="MapPart" />
-                                       <field name="firstType" type="CARD8" />
-                                       <field name="nTypes" type="CARD8" />
-                                       <field name="totalTypes" type="CARD8" />
-                                       <field name="firstKeySym" type="KEYCODE" />
-                                       <field name="totalSyms" type="CARD16" />
-                                       <field name="nKeySyms" type="CARD8" />
-                                       <field name="firstKeyAction" type="KEYCODE" />
-                                       <field name="totalActions" type="CARD16" />
-                                       <field name="nKeyActions" type="CARD8" />
-                                       <field name="firstKeyBehavior" type="KEYCODE" />
-                                       <field name="nKeyBehaviors" type="CARD8" />
-                                       <field name="totalKeyBehaviors" type="CARD8" />
-                                       <field name="firstKeyExplicit" type="KEYCODE" />
-                                       <field name="nKeyExplicit" type="CARD8" />
-                                       <field name="totalKeyExplicit" type="CARD8" />
-                                       <field name="firstModMapKey" type="KEYCODE" />
-                                       <field name="nModMapKeys" type="CARD8" />
-                                       <field name="totalModMapKeys" type="CARD8" />
-                                       <field name="firstVModMapKey" type="KEYCODE" />
-                                       <field name="nVModMapKeys" type="CARD8" />
-                                       <field name="totalVModMapKeys" type="CARD8" />
-                                       <pad bytes="1" />
-                                       <field name="virtualMods" type="CARD16" mask="VMod" />
-                                       <switch name="map">
-                                               <fieldref>present</fieldref>
-                                               <bitcase>
-                                                       <enumref ref="MapPart">KeyTypes</enumref>
-                                                       <list name="types_rtrn" type="KeyType">
-                                                               <fieldref>nTypes</fieldref>
-                                                       </list>
-                                               </bitcase>
-                                               <bitcase>
-                                                       <enumref ref="MapPart">KeySyms</enumref>
-                                                       <list name="syms_rtrn" type="KeySymMap">
-                                                               <fieldref>nKeySyms</fieldref>
-                                                       </list>
-                                               </bitcase>
-                                               <bitcase>
-                                                       <enumref ref="MapPart">KeyActions</enumref>
-                                                       <list name="acts_rtrn_count" type="CARD8">
-                                                               <fieldref>nKeyActions</fieldref>
-                                                       </list>
-                                                       <list name="acts_rtrn_acts" type="Action">
-                                                               <fieldref>totalActions</fieldref>
-                                                       </list>
-                                               </bitcase>
-                                               <bitcase>
-                                                       <enumref ref="MapPart">KeyBehaviors</enumref>
-                                                       <list name="behaviors_rtrn" type="SetBehavior">
-                                                               <fieldref>totalKeyBehaviors</fieldref>
-                                                       </list>
-                                               </bitcase>
-                                               <bitcase>
-                                                       <enumref ref="MapPart">VirtualMods</enumref>
-                                                       <list name="vmods_rtrn" type="CARD8" mask="ModMask">
-                                                               <fieldref>nVModMapKeys</fieldref>
-                                                       </list>
-                                               </bitcase>
-                                               <bitcase>
-                                                       <enumref ref="MapPart">ExplicitComponents</enumref>
-                                                       <list name="explicit_rtrn" type="SetExplicit">
-                                                               <fieldref>totalKeyExplicit</fieldref>
-                                                       </list>
-                                               </bitcase>
-                                               <bitcase>
-                                                       <enumref ref="MapPart">ModifierMap</enumref>
-                                                       <list name="modmap_rtrn" type="KeyModMap">
-                                                               <fieldref>totalModMapKeys</fieldref>
-                                                       </list>
-                                               </bitcase>
-                                               <bitcase>
-                                                       <enumref ref="MapPart">VirtualModMap</enumref>
-                                                       <list name="vmodmap_rtrn" type="KeyVModMap">
-                                                               <fieldref>totalVModMapKeys</fieldref>
-                                                       </list>
-                                               </bitcase>
-                                       </switch>
-                               </bitcase>
-                               <bitcase>
-                                       <enumref ref="GBNDetail">ServerSymbols</enumref>
-                                       <field name="serverDeviceID" type="CARD8" />
-                                       <pad bytes="2" />
-                                       <field name="serverMinKeyCode" type="KEYCODE" />
-                                       <field name="serverMaxKeyCode" type="KEYCODE" />
-                                       <field name="present" type="CARD16" enum="MapPart" />
-                                       <field name="firstType" type="CARD8" />
-                                       <field name="nTypes" type="CARD8" />
-                                       <field name="totalTypes" type="CARD8" />
-                                       <field name="firstKeySym" type="KEYCODE" />
-                                       <field name="totalSyms" type="CARD16" />
-                                       <field name="nKeySyms" type="CARD8" />
-                                       <field name="firstKeyAction" type="KEYCODE" />
-                                       <field name="totalActions" type="CARD16" />
-                                       <field name="nKeyActions" type="CARD8" />
-                                       <field name="firstKeyBehavior" type="KEYCODE" />
-                                       <field name="nKeyBehaviors" type="CARD8" />
-                                       <field name="totalKeyBehaviors" type="CARD8" />
-                                       <field name="firstKeyExplicit" type="KEYCODE" />
-                                       <field name="nKeyExplicit" type="CARD8" />
-                                       <field name="totalKeyExplicit" type="CARD8" />
-                                       <field name="firstModMapKey" type="KEYCODE" />
-                                       <field name="nModMapKeys" type="CARD8" />
-                                       <field name="totalModMapKeys" type="CARD8" />
-                                       <field name="firstVModMapKey" type="KEYCODE" />
-                                       <field name="nVModMapKeys" type="CARD8" />
-                                       <field name="totalVModMapKeys" type="CARD8" />
-                                       <pad bytes="1" />
-                                       <field name="virtualMods" type="CARD16" mask="VMod" />
-                                       <switch name="map">
-                                               <fieldref>present</fieldref>
-                                               <bitcase>
-                                                       <enumref ref="MapPart">KeyTypes</enumref>
-                                                       <list name="types_rtrn" type="KeyType">
-                                                               <fieldref>nTypes</fieldref>
-                                                       </list>
-                                               </bitcase>
-                                               <bitcase>
-                                                       <enumref ref="MapPart">KeySyms</enumref>
-                                                       <list name="syms_rtrn" type="KeySymMap">
-                                                               <fieldref>nKeySyms</fieldref>
-                                                       </list>
-                                               </bitcase>
-                                               <bitcase>
-                                                       <enumref ref="MapPart">KeyActions</enumref>
-                                                       <list name="acts_rtrn_count" type="CARD8">
-                                                               <fieldref>nKeyActions</fieldref>
-                                                       </list>
-                                                       <list name="acts_rtrn_acts" type="Action">
-                                                               <fieldref>totalActions</fieldref>
-                                                       </list>
-                                               </bitcase>
-                                               <bitcase>
-                                                       <enumref ref="MapPart">KeyBehaviors</enumref>
-                                                       <list name="behaviors_rtrn" type="SetBehavior">
-                                                               <fieldref>totalKeyBehaviors</fieldref>
-                                                       </list>
-                                               </bitcase>
-                                               <bitcase>
-                                                       <enumref ref="MapPart">VirtualMods</enumref>
-                                                       <list name="vmods_rtrn" type="CARD8" mask="ModMask">
-                                                               <fieldref>nVModMapKeys</fieldref>
-                                                       </list>
-                                               </bitcase>
-                                               <bitcase>
-                                                       <enumref ref="MapPart">ExplicitComponents</enumref>
-                                                       <list name="explicit_rtrn" type="SetExplicit">
-                                                               <fieldref>totalKeyExplicit</fieldref>
-                                                       </list>
-                                               </bitcase>
-                                               <bitcase>
-                                                       <enumref ref="MapPart">ModifierMap</enumref>
-                                                       <list name="modmap_rtrn" type="KeyModMap">
-                                                               <fieldref>totalModMapKeys</fieldref>
-                                                       </list>
-                                               </bitcase>
-                                               <bitcase>
-                                                       <enumref ref="MapPart">VirtualModMap</enumref>
-                                                       <list name="vmodmap_rtrn" type="KeyVModMap">
-                                                               <fieldref>totalVModMapKeys</fieldref>
-                                                       </list>
-                                               </bitcase>
-                                       </switch>
-                               </bitcase>
-                               <bitcase>
+                               <bitcase name="indicator_maps">
                                        <enumref ref="GBNDetail">IndicatorMaps</enumref>
+                                       <!-- from the spec, this has to include a reply header -->
+                                       <field name="indicatormap_type" type="CARD8" />
                                        <field name="indicatorDeviceID" type="CARD8" />
+                                       <field name="indicatormap_sequence" type="CARD16" />
+                                       <field name="indicatormap_length" type="CARD32" />
+                                       <!-- done 'emulating' reply header -->
                                        <field name="which" type="CARD32" />
                                        <field name="realIndicators" type="CARD32" />
                                        <field name="nIndicators" type="CARD8" />
@@ -2274,14 +2167,20 @@ authorization from the authors.
                                                <fieldref>nIndicators</fieldref>
                                        </list>
                                </bitcase>
-                               <bitcase>
+                               <bitcase name="key_names">
                                        <enumref ref="GBNDetail">KeyNames</enumref>
+                                       <enumref ref="GBNDetail">OtherNames</enumref>
+                                       <!-- from the spec, this has to include a reply header -->
+                                       <field name="keyname_type" type="CARD8" />
                                        <field name="keyDeviceID" type="CARD8" />
+                                       <field name="keyname_sequence" type="CARD16" />
+                                       <field name="keyname_length" type="CARD32" />
+                                       <!-- done 'emulating' reply header -->
                                        <field name="which" type="CARD32" mask="NameDetail" />
                                        <field name="keyMinKeyCode" type="KEYCODE" />
                                        <field name="keyMaxKeyCode" type="KEYCODE" />
                                        <field name="nTypes" type="CARD8" />
-                                       <field name="groupNames" type="CARD8" mask="Group" />
+                                       <field name="groupNames" type="CARD8" mask="SetOfGroup" />
                                        <field name="virtualMods" type="CARD16" mask="VMod" />
                                        <field name="firstKey" type="KEYCODE" />
                                        <field name="nKeys" type="CARD8" />
@@ -2325,109 +2224,8 @@ authorization from the authors.
                                                <bitcase>
                                                        <enumref ref="NameDetail">KTLevelNames</enumref>
                                                        <list name="nLevelsPerType" type="CARD8">
-                                                               <fieldref>nKTLevels</fieldref>
-                                                       </list>
-                                                       <list name="ktLevelNames" type="ATOM">
-                                                               <sumof ref="nLevelsPerType" />
-                                                       </list>
-                                               </bitcase>
-                                               <bitcase>
-                                                       <enumref ref="NameDetail">IndicatorNames</enumref>
-                                                       <list name="indicatorNames" type="ATOM">
-                                                               <popcount>
-                                                                       <fieldref>indicators</fieldref>
-                                                               </popcount>
-                                                       </list>
-                                               </bitcase>
-                                               <bitcase>
-                                                       <enumref ref="NameDetail">VirtualModNames</enumref>
-                                                       <list name="virtualModNames" type="ATOM">
-                                                               <popcount>
-                                                                       <fieldref>virtualMods</fieldref>
-                                                               </popcount>
-                                                       </list>
-                                               </bitcase>
-                                               <bitcase>
-                                                       <enumref ref="NameDetail">GroupNames</enumref>
-                                                       <list name="groups" type="ATOM">
-                                                               <popcount>
-                                                                       <fieldref>groupNames</fieldref>
-                                                               </popcount>
-                                                       </list>
-                                               </bitcase>
-                                               <bitcase>
-                                                       <enumref ref="NameDetail">KeyNames</enumref>
-                                                       <list name="keyNames" type="KeyName">
-                                                               <fieldref>nKeys</fieldref>
-                                                       </list>
-                                               </bitcase>
-                                               <bitcase>
-                                                       <enumref ref="NameDetail">KeyAliases</enumref>
-                                                       <list name="keyAliases" type="KeyAlias">
-                                                               <fieldref>nKeyAliases</fieldref>
-                                                       </list>
-                                               </bitcase>
-                                               <bitcase>
-                                                       <enumref ref="NameDetail">RGNames</enumref>
-                                                       <list name="radioGroupNames" type="ATOM">
-                                                               <fieldref>nRadioGroups</fieldref>
-                                                       </list>
-                                               </bitcase>
-                                       </switch>
-                               </bitcase>
-                               <bitcase>
-                                       <enumref ref="GBNDetail">OtherNames</enumref>
-                                       <field name="otherDeviceID" type="CARD8" />
-                                       <field name="which" type="CARD32" mask="NameDetail" />
-                                       <field name="otherMinKeyCode" type="KEYCODE" />
-                                       <field name="otherMaxKeyCode" type="KEYCODE" />
-                                       <field name="nTypes" type="CARD8" />
-                                       <field name="groupNames" type="CARD8" mask="Group" />
-                                       <field name="virtualMods" type="CARD16" mask="VMod" />
-                                       <field name="firstKey" type="KEYCODE" />
-                                       <field name="nKeys" type="CARD8" />
-                                       <field name="indicators" type="CARD32" />
-                                       <field name="nRadioGroups" type="CARD8" />
-                                       <field name="nKeyAliases" type="CARD8" />
-                                       <field name="nKTLevels" type="CARD16" />
-                                       <pad bytes="4" />
-                                       <switch name="valueList">
-                                               <fieldref>which</fieldref>
-                                               <bitcase>
-                                                       <enumref ref="NameDetail">Keycodes</enumref>
-                                                       <field name="keycodesName" type="ATOM" />
-                                               </bitcase>
-                                               <bitcase>
-                                                       <enumref ref="NameDetail">Geometry</enumref>
-                                                       <field name="geometryName" type="ATOM" />
-                                               </bitcase>
-                                               <bitcase>
-                                                       <enumref ref="NameDetail">Symbols</enumref>
-                                                       <field name="symbolsName" type="ATOM" />
-                                               </bitcase>
-                                               <bitcase>
-                                                       <enumref ref="NameDetail">PhysSymbols</enumref>
-                                                       <field name="physSymbolsName" type="ATOM" />
-                                               </bitcase>
-                                               <bitcase>
-                                                       <enumref ref="NameDetail">Types</enumref>
-                                                       <field name="typesName" type="ATOM" />
-                                               </bitcase>
-                                               <bitcase>
-                                                       <enumref ref="NameDetail">Compat</enumref>
-                                                       <field name="compatName" type="ATOM" />
-                                               </bitcase>
-                                               <bitcase>
-                                                       <enumref ref="NameDetail">KeyTypeNames</enumref>
-                                                       <list name="typeNames" type="ATOM">
                                                                <fieldref>nTypes</fieldref>
                                                        </list>
-                                               </bitcase>
-                                               <bitcase>
-                                                       <enumref ref="NameDetail">KTLevelNames</enumref>
-                                                       <list name="nLevelsPerType" type="CARD8">
-                                                               <fieldref>nKTLevels</fieldref>
-                                                       </list>
                                                        <list name="ktLevelNames" type="ATOM">
                                                                <sumof ref="nLevelsPerType" />
                                                        </list>
@@ -2476,9 +2274,14 @@ authorization from the authors.
                                                </bitcase>
                                        </switch>
                                </bitcase>
-                               <bitcase>
+                               <bitcase name="geometry">
                                        <enumref ref="GBNDetail">Geometry</enumref>
+                                       <!-- from the spec, this has to include a reply header -->
+                                       <field name="geometry_type" type="CARD8" />
                                        <field name="geometryDeviceID" type="CARD8" />
+                                       <field name="geometry_sequence" type="CARD16" />
+                                       <field name="geometry_length" type="CARD32" />
+                                       <!-- done 'emulating' reply header -->
                                        <field name="name" type="ATOM" />
                                        <field name="geometryFound" type="BOOL" />
                                        <pad bytes="1" />
@@ -2493,6 +2296,7 @@ authorization from the authors.
                                        <field name="baseColorNdx" type="CARD8" />
                                        <field name="labelColorNdx" type="CARD8" />
                                        <field name="labelFont" type="CountedString16" />
+                                       <!-- XXX: Property is broken
                                        <list name="properties" type="Property">
                                                <fieldref>nProperties</fieldref>
                                        </list>
@@ -2502,6 +2306,8 @@ authorization from the authors.
                                        <list name="shapes" type="Shape">
                                                <fieldref>nShapes</fieldref>
                                        </list>
+                                       -->
+                                       <!-- XXX: doodads are broken
                                        <list name="sections" type="Section">
                                                <fieldref>nSections</fieldref>
                                        </list>
@@ -2511,6 +2317,7 @@ authorization from the authors.
                                        <list name="keyAliases" type="KeyAlias">
                                                <fieldref>nKeyAliases</fieldref>
                                        </list>
+                                       -->
                                </bitcase>
                        </switch>
                </reply>
@@ -2518,16 +2325,16 @@ authorization from the authors.
 
        <request name="GetDeviceInfo" opcode="24">
                <field name="deviceSpec" type="DeviceSpec" />
-               <field name="wanted" type="CARD16" mask="XIExtDevFeature" />
+               <field name="wanted" type="CARD16" mask="XIFeature" />
                <field name="allButtons" type="BOOL" />
                <field name="firstButton" type="CARD8" />
                <field name="nButtons" type="CARD8" />
                <pad bytes="1" />
-               <field name="ledClass" type="LedClassSpec" mask="LedClass" />
-               <field name="ledID" type="IDSpec" mask="ID" />
+               <field name="ledClass" type="LedClassSpec" enum="LedClass" />
+               <field name="ledID" type="IDSpec" altenum="ID" />
                <reply>
                        <field name="deviceID" type="CARD8" />
-                       <field name="present" type="CARD16" mask="XIExtDevFeature" />
+                       <field name="present" type="CARD16" mask="XIFeature" />
                        <field name="supported" type="CARD16" mask="XIFeature" />
                        <field name="unsupported" type="CARD16" mask="XIFeature" />
                        <field name="nDeviceLedFBs" type="CARD16" />
@@ -2537,8 +2344,8 @@ authorization from the authors.
                        <field name="nBtnsRtrn" type="CARD8" />
                        <field name="totalBtns" type="CARD8" />
                        <field name="hasOwnState" type="BOOL" />
-                       <field name="dfltKbdFB" type="CARD16" mask="IDResult" />
-                       <field name="dfltLedFB" type="CARD16" mask="IDResult" />
+                       <field name="dfltKbdFB" type="CARD16" altenum="ID" />
+                       <field name="dfltLedFB" type="CARD16" altenum="ID" />
                        <pad bytes="2" />
                        <field name="devType" type="ATOM" />
                        <field name="nameLen" type="CARD16" />
@@ -2559,7 +2366,7 @@ authorization from the authors.
                <field name="deviceSpec" type="DeviceSpec" />
                <field name="firstBtn" type="CARD8" />
                <field name="nBtns" type="CARD8" />
-               <field name="change" type="CARD16" mask="XIExtDevFeature" />
+               <field name="change" type="CARD16" mask="XIFeature" />
                <field name="nDeviceLedFBs" type="CARD16" />
                <list name="btnActions" type="Action">
                        <fieldref>nBtns</fieldref>
@@ -2592,6 +2399,7 @@ authorization from the authors.
        <!-- Events -->
 
        <event name="NewKeyboardNotify" number="0">
+               <field name="xkbType" type="CARD8" />
                <field name="time" type="TIMESTAMP" />
                <field name="deviceID" type="CARD8" />
                <field name="oldDeviceID" type="CARD8" />
@@ -2606,6 +2414,7 @@ authorization from the authors.
        </event>
 
        <event name="MapNotify" number="1">
+               <field name="xkbType" type="CARD8" />
                <field name="time" type="TIMESTAMP" />
                <field name="deviceID" type="CARD8" />
                <field name="ptrBtnActions" type="CARD8" />
@@ -2631,6 +2440,7 @@ authorization from the authors.
        </event>
 
        <event name="StateNotify" number="2">
+               <field name="xkbType" type="CARD8" />
                <field name="time" type="TIMESTAMP" />
                <field name="deviceID" type="CARD8" />
                <field name="mods" type="CARD8" mask="ModMask" />
@@ -2655,6 +2465,7 @@ authorization from the authors.
        </event>
 
        <event name="ControlsNotify" number="3">
+               <field name="xkbType" type="CARD8" />
                <field name="time" type="TIMESTAMP" />
                <field name="deviceID" type="CARD8" />
                <field name="numGroups" type="CARD8" />
@@ -2670,6 +2481,7 @@ authorization from the authors.
        </event>
 
        <event name="IndicatorStateNotify" number="4">
+               <field name="xkbType" type="CARD8" />
                <field name="time" type="TIMESTAMP" />
                <field name="deviceID" type="CARD8" />
                <pad bytes="3" />
@@ -2679,6 +2491,7 @@ authorization from the authors.
        </event>
 
        <event name="IndicatorMapNotify" number="5">
+               <field name="xkbType" type="CARD8" />
                <field name="time" type="TIMESTAMP" />
                <field name="deviceID" type="CARD8" />
                <pad bytes="3" />
@@ -2688,6 +2501,7 @@ authorization from the authors.
        </event>
 
        <event name="NamesNotify" number="6">
+               <field name="xkbType" type="CARD8" />
                <field name="time" type="TIMESTAMP" />
                <field name="deviceID" type="CARD8" />
                <pad bytes="1" />
@@ -2708,6 +2522,7 @@ authorization from the authors.
        </event>
 
        <event name="CompatMapNotify" number="7">
+               <field name="xkbType" type="CARD8" />
                <field name="time" type="TIMESTAMP" />
                <field name="deviceID" type="CARD8" />
                <field name="changedGroups" type="CARD8" mask="SetOfGroup" />
@@ -2718,6 +2533,7 @@ authorization from the authors.
        </event>
 
        <event name="BellNotify" number="8">
+               <field name="xkbType" type="CARD8" />
                <field name="time" type="TIMESTAMP" />
                <field name="deviceID" type="CARD8" />
                <field name="bellClass" type="CARD8" enum="BellClassResult" />
@@ -2732,6 +2548,7 @@ authorization from the authors.
        </event>
 
        <event name="ActionMessage" number="9">
+               <field name="xkbType" type="CARD8" />
                <field name="time" type="TIMESTAMP" />
                <field name="deviceID" type="CARD8" />
                <field name="keycode" type="KEYCODE" />
@@ -2746,6 +2563,7 @@ authorization from the authors.
        </event>
 
        <event name="AccessXNotify" number="10">
+               <field name="xkbType" type="CARD8" />
                <field name="time" type="TIMESTAMP" />
                <field name="deviceID" type="CARD8" />
                <field name="keycode" type="KEYCODE" />
@@ -2756,12 +2574,13 @@ authorization from the authors.
        </event>
 
        <event name="ExtensionDeviceNotify" number="11">
+               <field name="xkbType" type="CARD8" />
                <field name="time" type="TIMESTAMP" />
                <field name="deviceID" type="CARD8" />
                <pad bytes="1" />
-               <field name="reason" type="CARD16" mask="XIDetail" />
-               <field name="ledClass" type="CARD16" mask="LedClassResult" />
-               <field name="ledID" type="CARD8" />
+               <field name="reason" type="CARD16" mask="XIFeature" />
+               <field name="ledClass" type="CARD16" enum="LedClassResult" />
+               <field name="ledID" type="CARD16" />
                <field name="ledsDefined" type="CARD32" />
                <field name="ledState" type="CARD32" />
                <field name="firstButton" type="CARD8" />