sync: Change value list param of CreateAlarm and ChangeAlarm into switch
[free-sw/xcb/proto] / src / xkb.xml
index 31234e7..0e263c4 100644 (file)
@@ -153,10 +153,6 @@ authorization from the authors.
                <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">
@@ -181,19 +177,16 @@ authorization from the authors.
        <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 +268,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 +311,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 +347,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,39 +370,52 @@ 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">
                <field name="active" type="BOOL" />
+               <!-- Xlib uses a different arrangement of fields
                <field name="mods_mask" type="CARD8" mask="ModMask" />
                <field name="level" type="CARD8" />
+               -->
+               <field name="level" type="CARD8" />
+               <field name="mods_mask" type="CARD8" mask="ModMask" />
                <field name="mods_mods" type="CARD8" mask="ModMask" />
                <field name="mods_vmods" type="CARD16" mask="VMod" />
                <pad bytes="2" />
@@ -750,8 +749,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" />
@@ -1030,6 +1029,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 +1086,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 +1151,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 +1172,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 +1188,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" />
@@ -1220,9 +1237,9 @@ authorization from the authors.
                        <field name="accessXTimeoutOptionsMask" type="AXOption" />
                        <field name="accessXTimeoutOptionsValues" type="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 +1249,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" />
                <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,8 +1273,8 @@ 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="accessXTimeoutMask" type="CARD32" mask="BoolCtrl" />
+               <field name="accessXTimeoutValues" type="CARD32" mask="BoolCtrl" />
                <field name="accessXTimeoutOptionsMask" type="AXOption" />
                <field name="accessXTimeoutOptionsValues" type="AXOption" />
                <list name="perKeyRepeat" type="CARD8">
@@ -1267,8 +1284,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 +1307,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" />
@@ -1346,7 +1363,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>
@@ -1373,7 +1390,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 +1447,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 +1485,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 +1505,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 +1536,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 +1554,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>
@@ -1568,8 +1579,8 @@ authorization from the authors.
 
        <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 +1607,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 +1651,11 @@ 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 name="ktLevelNames" type="ATOM">
                                                <sumof ref="nLevelsPerType" />
@@ -1987,13 +2002,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 +2073,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 +2096,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 +2119,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 +2135,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" />
@@ -2375,110 +2242,14 @@ authorization from the authors.
                                                </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>
-                                               </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>
+                               <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" />
@@ -2518,16 +2289,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 +2308,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 +2330,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 +2363,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 +2378,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 +2404,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 +2429,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 +2445,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 +2455,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 +2465,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 +2486,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 +2497,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 +2512,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 +2527,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,11 +2538,12 @@ 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="reason" type="CARD16" mask="XIFeature" />
+               <field name="ledClass" type="CARD16" enum="LedClassResult" />
                <field name="ledID" type="CARD8" />
                <field name="ledsDefined" type="CARD32" />
                <field name="ledState" type="CARD32" />