04ab4297ad59a9065dabf44f0960b75dffa3d063
[free-sw/xcb/proto] / src / xkb.xml
1 <?xml version="1.0" encoding="utf-8" ?>
2 <!--
3 Copyright (C) 2009 Open Text Corporation.  All Rights Reserved.
4
5 Permission is hereby granted, free of charge, to any person obtaining a copy
6 of this software and associated documentation files (the "Software"), to deal
7 in the Software without restriction, including without limitation the rights
8 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 copies of the Software, and to permit persons to whom the Software is
10 furnished to do so, subject to the following conditions:
11
12 The above copyright notice and this permission notice shall be included in all
13 copies or substantial portions of the Software.
14
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
19 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
22 Except as contained in this notice, the names of the authors or their
23 institutions shall not be used in advertising or otherwise to promote the
24 sale, use or other dealings in this Software without prior written
25 authorization from the authors.
26 -->
27 <xcb header="xkb" extension-xname="XKEYBOARD" extension-name="xkb"
28         major-version="1" minor-version="0">
29
30         <import>xproto</import>
31
32         <!-- Common Types -->
33         <enum name="Const">
34                 <item name="MaxLegalKeyCode"> <value>255</value> </item>
35                 <item name="PerKeyBitArraySize">
36                         <value>32</value>
37                 </item>
38                 <item name="KeyNameLength">
39                         <value>4</value>
40                 </item>
41         </enum>
42
43         <enum name="EventType">
44                 <item name="NewKeyboardNotify">      <bit>0</bit> </item>
45                 <item name="MapNotify">              <bit>1</bit> </item>
46                 <item name="StateNotify">            <bit>2</bit> </item>
47                 <item name="ControlsNotify">         <bit>3</bit> </item>
48                 <item name="IndicatorStateNotify">   <bit>4</bit> </item>
49                 <item name="IndicatorMapNotify">     <bit>5</bit> </item>
50                 <item name="NamesNotify">            <bit>6</bit> </item>
51                 <item name="CompatMapNotify">        <bit>7</bit> </item>
52                 <item name="BellNotify">             <bit>8</bit> </item>
53                 <item name="ActionMessage">          <bit>9</bit> </item>
54                 <item name="AccessXNotify">          <bit>10</bit> </item>
55                 <item name="ExtensionDeviceNotify">  <bit>11</bit> </item>
56         </enum>
57
58         <enum name="NKNDetail">
59                 <item name="Keycodes"> <bit>0</bit> </item>
60                 <item name="Geometry"> <bit>1</bit> </item>
61                 <item name="DeviceID"> <bit>2</bit> </item>
62         </enum>
63
64         <enum name="AXNDetail">
65                 <item name="SKPress">      <bit>0</bit> </item>
66                 <item name="SKAccept">     <bit>1</bit> </item>
67                 <item name="SKReject">     <bit>2</bit> </item>
68                 <item name="SKRelease">    <bit>3</bit> </item>
69                 <item name="BKAccept">     <bit>4</bit> </item>
70                 <item name="BKReject">     <bit>5</bit> </item>
71                 <item name="AXKWarning">   <bit>6</bit> </item>
72         </enum>
73
74         <enum name="MapPart">
75                 <item name="KeyTypes">            <bit>0</bit> </item>
76                 <item name="KeySyms">             <bit>1</bit> </item>
77                 <item name="ModifierMap">         <bit>2</bit> </item>
78                 <item name="ExplicitComponents">  <bit>3</bit> </item>
79                 <item name="KeyActions">          <bit>4</bit> </item>
80                 <item name="KeyBehaviors">        <bit>5</bit> </item>
81                 <item name="VirtualMods">         <bit>6</bit> </item>
82                 <item name="VirtualModMap">       <bit>7</bit> </item>
83         </enum>
84
85         <enum name="SetMapFlags">
86                 <item name="ResizeTypes">       <bit>0</bit> </item>
87                 <item name="RecomputeActions">  <bit>1</bit> </item>
88         </enum>
89
90         <enum name="StatePart">
91                 <item name="ModifierState">     <bit>0</bit> </item>
92                 <item name="ModifierBase">      <bit>1</bit> </item>
93                 <item name="ModifierLatch">     <bit>2</bit> </item>
94                 <item name="ModifierLock">      <bit>3</bit> </item>
95                 <item name="GroupState">        <bit>4</bit> </item>
96                 <item name="GroupBase">         <bit>5</bit> </item>
97                 <item name="GroupLatch">        <bit>6</bit> </item>
98                 <item name="GroupLock">         <bit>7</bit> </item>
99                 <item name="CompatState">       <bit>8</bit> </item>
100                 <item name="GrabMods">          <bit>9</bit> </item>
101                 <item name="CompatGrabMods">    <bit>10</bit> </item>
102                 <item name="LookupMods">        <bit>11</bit> </item>
103                 <item name="CompatLookupMods">  <bit>12</bit> </item>
104                 <item name="PointerButtons">    <bit>13</bit> </item>
105         </enum>
106
107         <enum name="BoolCtrl">
108                 <item name="RepeatKeys">           <bit>0</bit> </item>
109                 <item name="SlowKeys">             <bit>1</bit> </item>
110                 <item name="BounceKeys">           <bit>2</bit> </item>
111                 <item name="StickyKeys">           <bit>3</bit> </item>
112                 <item name="MouseKeys">            <bit>4</bit> </item>
113                 <item name="MouseKeysAccel">       <bit>5</bit> </item>
114                 <item name="AccessXKeys">          <bit>6</bit> </item>
115                 <item name="AccessXTimeoutMask">   <bit>7</bit> </item>
116                 <item name="AccessXFeedbackMask">  <bit>8</bit> </item>
117                 <item name="AudibleBellMask">      <bit>9</bit> </item>
118                 <item name="Overlay1Mask">         <bit>10</bit> </item>
119                 <item name="Overlay2Mask">         <bit>11</bit> </item>
120                 <item name="IgnoreGroupLockMask">  <bit>12</bit> </item>
121         </enum>
122
123         <!-- XXX: one zero less than XKB specification says,
124                   uses the same values as libX11 -->
125         <enum name="Control" >
126                 <item name="GroupsWrap">      <bit>27</bit> </item>
127                 <item name="InternalMods">    <bit>28</bit> </item>
128                 <item name="IgnoreLockMods">  <bit>29</bit> </item>
129                 <item name="PerKeyRepeat">    <bit>30</bit> </item>
130                 <item name="ControlsEnabled"> <bit>31</bit> </item>
131         </enum>
132
133         <enum name="AXOption">
134                 <item name="SKPressFB">     <bit>0</bit> </item>
135                 <item name="SKAcceptFB">    <bit>1</bit> </item>
136                 <item name="FeatureFB">     <bit>2</bit> </item>
137                 <item name="SlowWarnFB">    <bit>3</bit> </item>
138                 <item name="IndicatorFB">   <bit>4</bit> </item>
139                 <item name="StickyKeysFB">  <bit>5</bit> </item>
140                 <item name="TwoKeys">       <bit>6</bit> </item>
141                 <item name="LatchToLock">   <bit>7</bit> </item>
142                 <item name="SKReleaseFB">   <bit>8</bit> </item>
143                 <item name="SKRejectFB">    <bit>9</bit> </item>
144                 <item name="BKRejectFB">    <bit>10</bit> </item>
145                 <item name="DumbBell">      <bit>11</bit> </item>
146         </enum>
147
148         <typedef oldname="CARD16" newname="DeviceSpec" />
149
150         <enum name="LedClassResult">
151                 <item name="KbdFeedbackClass"> <value>0</value> </item>
152                 <item name="LedFeedbackClass"> <value>4</value> </item>
153         </enum>
154
155         <enum name="LedClass">
156                 <item name="KbdFeedbackClass"> <value>0</value> </item>
157                 <item name="LedFeedbackClass"> <value>4</value> </item>
158                 <item name="DfltXIClass">      <value>768</value> </item>       <!--0x300-->
159                 <item name="AllXIClasses">     <value>1280</value> </item>      <!--0x500-->
160         </enum>
161         <typedef oldname="CARD16" newname="LedClassSpec" />
162
163         <enum name="BellClassResult">
164                 <item name="KbdFeedbackClass">  <value>0</value> </item>
165                 <item name="BellFeedbackClass"> <value>5</value> </item>
166         </enum>
167
168         <enum name="BellClass">
169                 <item name="KbdFeedbackClass">  <value>0</value> </item>
170                 <item name="BellFeedbackClass"> <value>5</value> </item>
171                 <item name="DfltXIClass">       <value>768</value> </item>      <!--0x300-->
172         </enum>
173         <typedef oldname="CARD16" newname="BellClassSpec" />
174
175         <enum name="ID">
176                 <item name="UseCoreKbd">  <value>256</value> </item>    <!-- 0x100 -->
177                 <item name="UseCorePtr">  <value>512</value> </item>    <!-- 0x200 -->
178                 <item name="DfltXIClass"> <value>768</value> </item>    <!-- 0x300 -->
179                 <item name="DfltXIId">   <value>1024</value> </item>    <!-- 0x400 -->
180                 <item name="AllXIClass"> <value>1280</value> </item>    <!-- 0x500 -->
181                 <item name="AllXIId">    <value>1536</value> </item>    <!-- 0x600 -->
182                 <item name="XINone">     <value>65280</value> </item>   <!--0xff00-->
183         </enum>
184         <typedef oldname="CARD16" newname="IDSpec" />
185
186         <enum name="Group">
187                 <item name="1"> <value>0</value> </item>
188                 <item name="2"> <value>1</value> </item>
189                 <item name="3"> <value>2</value> </item>
190                 <item name="4"> <value>3</value> </item>
191         </enum>
192
193         <enum name="Groups">
194                 <item name="Any"> <value>254</value> </item>
195                 <item name="All"> <value>255</value> </item>
196         </enum>
197
198         <enum name="SetOfGroup">
199                 <item name="Group1"> <bit>0</bit> </item>
200                 <item name="Group2"> <bit>1</bit> </item>
201                 <item name="Group3"> <bit>2</bit> </item>
202                 <item name="Group4"> <bit>3</bit> </item>
203         </enum>
204
205         <enum name="SetOfGroups">
206                 <item name="Any"> <bit>7</bit> </item>
207         </enum>
208
209         <enum name="GroupsWrap">
210                 <item name="WrapIntoRange">     <value>0</value> </item>
211                 <item name="ClampIntoRange">    <bit>6</bit> </item>
212                 <item name="RedirectIntoRange"> <bit>7</bit> </item>
213         </enum>
214
215         <enum name="VModsHigh">
216                 <item name="15"> <bit>7</bit> </item>
217                 <item name="14"> <bit>6</bit> </item>
218                 <item name="13"> <bit>5</bit> </item>
219                 <item name="12"> <bit>4</bit> </item>
220                 <item name="11"> <bit>3</bit> </item>
221                 <item name="10"> <bit>2</bit> </item>
222                 <item name="9">  <bit>1</bit> </item>
223                 <item name="8">  <bit>0</bit> </item>
224         </enum>
225
226         <enum name="VModsLow">
227                 <item name="7"> <bit>7</bit> </item>
228                 <item name="6"> <bit>6</bit> </item>
229                 <item name="5"> <bit>5</bit> </item>
230                 <item name="4"> <bit>4</bit> </item>
231                 <item name="3"> <bit>3</bit> </item>
232                 <item name="2"> <bit>2</bit> </item>
233                 <item name="1"> <bit>1</bit> </item>
234                 <item name="0"> <bit>0</bit> </item>
235         </enum>
236
237         <enum name="VMod">
238                 <item name="15"> <bit>15</bit> </item>
239                 <item name="14"> <bit>14</bit> </item>
240                 <item name="13"> <bit>13</bit> </item>
241                 <item name="12"> <bit>12</bit> </item>
242                 <item name="11"> <bit>11</bit> </item>
243                 <item name="10"> <bit>10</bit> </item>
244                 <item name="9">  <bit>9</bit> </item>
245                 <item name="8">  <bit>8</bit> </item>
246                 <item name="7">  <bit>7</bit> </item>
247                 <item name="6">  <bit>6</bit> </item>
248                 <item name="5">  <bit>5</bit> </item>
249                 <item name="4">  <bit>4</bit> </item>
250                 <item name="3">  <bit>3</bit> </item>
251                 <item name="2">  <bit>2</bit> </item>
252                 <item name="1">  <bit>1</bit> </item>
253                 <item name="0">  <bit>0</bit> </item>
254         </enum>
255
256         <enum name="Explicit">
257                 <item name="VModMap">     <bit>7</bit> </item>
258                 <item name="Behavior">    <bit>6</bit> </item>
259                 <item name="AutoRepeat">  <bit>5</bit> </item>
260                 <item name="Interpret">   <bit>4</bit> </item>
261                 <item name="KeyType4">    <bit>3</bit> </item>
262                 <item name="KeyType3">    <bit>2</bit> </item>
263                 <item name="KeyType2">    <bit>1</bit> </item>
264                 <item name="KeyType1">    <bit>0</bit> </item>
265         </enum>
266
267         <enum name="SymInterpretMatch">
268                 <item name="NoneOf">      <value>0</value> </item>
269                 <item name="AnyOfOrNone"> <value>1</value> </item>
270                 <item name="AnyOf">       <value>2</value> </item>
271                 <item name="AllOf">       <value>3</value> </item>
272                 <item name="Exactly">     <value>4</value> </item>
273         </enum>
274
275         <enum name="SymInterpMatch">
276                 <item name="LevelOneOnly"> <bit>7</bit> </item>
277                 <item name="OpMask">       <value>127</value> </item>   <!--0x7f-->
278         </enum>
279
280         <enum name="IMFlag">
281                 <item name="NoExplicit">  <bit>7</bit> </item>
282                 <item name="NoAutomatic"> <bit>6</bit> </item>
283                 <item name="LEDDrivesKB"> <bit>5</bit> </item>
284         </enum>
285
286         <enum name="IMModsWhich">
287                 <item name="UseCompat">    <bit>4</bit> </item>
288                 <item name="UseEffective"> <bit>3</bit> </item>
289                 <item name="UseLocked">    <bit>2</bit> </item>
290                 <item name="UseLatched">   <bit>1</bit> </item>
291                 <item name="UseBase">      <bit>0</bit> </item>
292         </enum>
293
294         <enum name="IMGroupsWhich">
295                 <item name="UseCompat">    <bit>4</bit> </item>
296                 <item name="UseEffective"> <bit>3</bit> </item>
297                 <item name="UseLocked">    <bit>2</bit> </item>
298                 <item name="UseLatched">   <bit>1</bit> </item>
299                 <item name="UseBase">      <bit>0</bit> </item>
300         </enum>
301
302         <struct name="IndicatorMap">
303                 <field name="flags" type="CARD8" enum="IMFlag" />
304                 <field name="whichGroups" type="CARD8" enum="IMGroupsWhich" />
305                 <field name="groups" type="CARD8" enum="SetOfGroup" />
306                 <field name="whichMods" type="CARD8" enum="IMModsWhich" />
307                 <field name="mods" type="CARD8" mask="ModMask" />
308                 <field name="realMods" type="CARD8" mask="ModMask" />
309                 <field name="vmods" type="CARD16" mask="VMod" />
310                 <field name="ctrls" type="CARD32" mask="BoolCtrl" />
311         </struct>
312
313         <enum name="CMDetail">
314                 <item name="SymInterp">   <bit>0</bit> </item>
315                 <item name="GroupCompat"> <bit>1</bit> </item>
316         </enum>
317
318         <enum name="NameDetail">
319                 <item name="Keycodes">        <bit>0</bit> </item>
320                 <item name="Geometry">        <bit>1</bit> </item>
321                 <item name="Symbols">         <bit>2</bit> </item>
322                 <item name="PhysSymbols">     <bit>3</bit> </item>
323                 <item name="Types">           <bit>4</bit> </item>
324                 <item name="Compat">          <bit>5</bit> </item>
325                 <item name="KeyTypeNames">    <bit>6</bit> </item>
326                 <item name="KTLevelNames">    <bit>7</bit> </item>
327                 <item name="IndicatorNames">  <bit>8</bit> </item>
328                 <item name="KeyNames">        <bit>9</bit> </item>
329                 <item name="KeyAliases">      <bit>10</bit> </item>
330                 <item name="VirtualModNames"> <bit>11</bit> </item>
331                 <item name="GroupNames">      <bit>12</bit> </item>
332                 <item name="RGNames">         <bit>13</bit> </item>
333         </enum>
334
335         <enum name="GBNDetail">
336                 <item name="Types">         <bit>0</bit> </item>
337                 <item name="CompatMap">     <bit>1</bit> </item>
338                 <item name="ClientSymbols"> <bit>2</bit> </item>
339                 <item name="ServerSymbols"> <bit>3</bit> </item>
340                 <item name="IndicatorMaps"> <bit>4</bit> </item>
341                 <item name="KeyNames">      <bit>5</bit> </item>
342                 <item name="Geometry">      <bit>6</bit> </item>
343                 <item name="OtherNames">    <bit>7</bit> </item>
344         </enum>
345
346         <enum name="XIFeature">
347                 <item name="Keyboards">      <bit>0</bit> </item>
348                 <item name="ButtonActions">  <bit>1</bit> </item>
349                 <item name="IndicatorNames"> <bit>2</bit> </item>
350                 <item name="IndicatorMaps">  <bit>3</bit> </item>
351                 <item name="IndicatorState"> <bit>4</bit> </item>
352         </enum>
353
354         <enum name="PerClientFlag">
355                 <item name="DetectableAutoRepeat">   <bit>0</bit> </item>
356                 <item name="GrabsUseXKBState">       <bit>1</bit> </item>
357                 <item name="AutoResetControls">      <bit>2</bit> </item>
358                 <item name="LookupStateWhenGrabbed"> <bit>3</bit> </item>
359                 <item name="SendEventUsesXKBState">  <bit>4</bit> </item>
360         </enum>
361
362         <struct name="ModDef">
363                 <field name="mask" type="CARD8" mask="ModMask" />
364                 <field name="realMods" type="CARD8" mask="ModMask" />
365                 <field name="vmods" type="CARD16" mask="VMod" />
366         </struct>
367
368         <struct name="KeyName">
369                 <list name="name" type="char">
370                         <value>4</value>
371                 </list>
372         </struct>
373
374         <struct name="KeyAlias">
375                 <list name="real" type="char">
376                         <value>4</value>
377                 </list>
378                 <list name="alias" type="char">
379                         <value>4</value>
380                 </list>
381         </struct>
382
383         <struct name="CountedString16">
384                 <field name="length" type="CARD16" />
385                 <list name="string" type="char">
386                         <fieldref>length</fieldref>
387                 </list>
388                 <list type="void" name="alignment_pad">
389                         <op op="-">
390                                 <op op="&amp;">
391                                         <op op="+">
392                                                 <fieldref>length</fieldref>
393                                                 <value>5</value>
394                                         </op>
395                                         <unop op="~">
396                                                 <value>3</value>
397                                         </unop>
398                                 </op>
399                                 <op op="+">
400                                         <fieldref>length</fieldref>
401                                         <value>2</value>
402                                 </op>
403                         </op>
404                 </list>
405         </struct>
406
407         <struct name="KTMapEntry">
408                 <field name="active" type="BOOL" />
409                 <field name="mods_mask" type="CARD8" mask="ModMask" />
410                 <field name="level" type="CARD8" />
411                 <field name="mods_mods" type="CARD8" mask="ModMask" />
412                 <field name="mods_vmods" type="CARD16" mask="VMod" />
413                 <pad bytes="2" />
414         </struct>
415
416         <struct name="KeyType">
417                 <field name="mods_mask" type="CARD8" mask="ModMask" />
418                 <field name="mods_mods" type="CARD8" mask="ModMask" />
419                 <field name="mods_vmods" type="CARD16" mask="VMod" />
420                 <field name="numLevels" type="CARD8" />
421                 <field name="nMapEntries" type="CARD8" />
422                 <field name="hasPreserve" type="BOOL" />
423                 <pad bytes="1" />
424                 <list name="map" type="KTMapEntry">
425                         <fieldref>nMapEntries</fieldref>
426                 </list>
427                 <list name="preserve" type="ModDef">
428                     <op op="*">
429                         <fieldref>hasPreserve</fieldref>
430                         <fieldref>nMapEntries</fieldref>
431                     </op>
432                 </list>
433         </struct>
434
435         <struct name="KeySymMap">
436                 <list name="kt_index" type="CARD8">
437                         <value>4</value>
438                 </list>
439                 <field name="groupInfo" type="CARD8" />
440                 <field name="width" type="CARD8" />
441                 <field name="nSyms" type="CARD16" />
442                 <list name="syms" type="KEYSYM">
443                         <fieldref>nSyms</fieldref>
444                 </list>
445         </struct>
446
447         <!-- Key Behaviors -->
448
449         <struct name="CommonBehavior">
450                 <field name="type" type="CARD8" />
451                 <field name="data" type="CARD8" />
452         </struct>
453
454         <struct name="DefaultBehavior">
455                 <field name="type" type="CARD8" />
456                 <pad bytes="1" />
457         </struct>
458
459         <typedef oldname="DefaultBehavior" newname="LockBehavior" />
460
461         <struct name="RadioGroupBehavior">
462                 <field name="type" type="CARD8" />
463                 <field name="group" type="CARD8" />
464         </struct>
465
466         <struct name="OverlayBehavior">
467                 <field name="type" type="CARD8" />
468                 <field name="key" type="KEYCODE" />
469         </struct>
470
471         <typedef oldname="LockBehavior" newname="PermamentLockBehavior" />
472         <typedef oldname="RadioGroupBehavior" newname="PermamentRadioGroupBehavior" />
473         <typedef oldname="OverlayBehavior" newname="PermamentOverlayBehavior" />
474
475         <union name="Behavior">
476                 <field name="common" type="CommonBehavior" />
477                 <field name="default" type="DefaultBehavior" />
478                 <field name="lock" type="LockBehavior" />
479                 <field name="radioGroup" type="RadioGroupBehavior" />
480                 <field name="overlay1" type="OverlayBehavior" />
481                 <field name="overlay2" type="OverlayBehavior" />
482                 <field name="permamentLock" type="PermamentLockBehavior" />
483                 <field name="permamentRadioGroup" type="PermamentRadioGroupBehavior" />
484                 <field name="permamentOverlay1" type="PermamentOverlayBehavior" />
485                 <field name="permamentOverlay2" type="PermamentOverlayBehavior" />
486                 <field name="type" type="CARD8" />
487         </union>
488
489         <enum name="BehaviorType">
490                 <item name="Default">             <value>0</value> </item>      <!--0x00-->
491                 <item name="Lock">                <value>1</value> </item>      <!--0x01-->
492                 <item name="RadioGroup">          <value>2</value> </item>      <!--0x02-->
493                 <item name="Overlay1">            <value>3</value> </item>      <!--0x03-->
494                 <item name="Overlay2">            <value>4</value> </item>      <!--0x04-->
495                 <item name="PermamentLock">       <value>129</value> </item>    <!--0x81-->
496                 <item name="PermamentRadioGroup"> <value>130</value> </item>    <!--0x82-->
497                 <item name="PermamentOverlay1">   <value>131</value> </item>    <!--0x83-->
498                 <item name="PermamentOverlay2">   <value>132</value> </item>    <!--0x84-->
499         </enum>
500
501         <struct name="SetBehavior">
502                 <field name="keycode" type="KEYCODE" />
503                 <field name="behavior" type="Behavior" />
504                 <pad bytes="1" />
505         </struct>
506
507         <struct name="SetExplicit">
508                 <field name="keycode" type="KEYCODE" />
509                 <field name="explicit" type="CARD8" mask="Explicit" />
510         </struct>
511
512         <struct name="KeyModMap">
513                 <field name="keycode" type="KEYCODE" />
514                 <field name="mods" type="CARD8" mask="ModMask" />
515         </struct>
516
517         <struct name="KeyVModMap">
518                 <field name="keycode" type="KEYCODE" />
519                 <pad bytes="1" />
520                 <field name="vmods" type="CARD16" mask="VMod" />
521         </struct>
522
523         <struct name="KTSetMapEntry">
524                 <field name="level" type="CARD8" />
525                 <field name="realMods" type="CARD8" mask="ModMask" />
526                 <field name="virtualMods" type="CARD16" mask="VMod" />
527         </struct>
528
529         <struct name="SetKeyType">
530                 <field name="mask" type="CARD8" mask="ModMask" />
531                 <field name="realMods" type="CARD8" mask="ModMask" />
532                 <field name="virtualMods" type="CARD16" mask="VMod" />
533                 <field name="numLevels" type="CARD8" />
534                 <field name="nMapEntries" type="CARD8" />
535                 <field name="preserve" type="BOOL" />
536                 <pad bytes="1" />
537                 <list name="entries" type="KTSetMapEntry">
538                         <fieldref>nMapEntries</fieldref>
539                 </list>
540                 <list name="preserve_entries" type="KTSetMapEntry">
541                     <op op = "*">
542                         <fieldref>preserve</fieldref>
543                         <fieldref>nMapEntries</fieldref>
544                     </op>
545                 </list>
546         </struct>
547
548         <typedef oldname="char" newname="STRING8" />
549
550         <!-- XXX: Property is broken
551         <struct name="Property">
552                 <field name="nameLength" type="CARD16" />
553                 <list name="name" type="STRING8">
554                         <fieldref>nameLength</fieldref>
555                 </list>
556                 <field name="valueLength" type="CARD16" />
557                 <list name="value" type="STRING8">
558                         <fieldref>valueLength</fieldref>
559                 </list>
560         </struct>
561         -->
562         <!-- XXX: This would be the correct Property structure as per spec.,
563                   but it's broken atm. too. Add it anyway here, so we don't
564                   loose that information.
565         <struct name="Property">
566                 <field name="name" type="CountedString16" />
567                 <field name="value" type="CountedString16" />
568         </struct>
569         -->
570
571         <struct name="Outline">
572                 <field name="nPoints" type="CARD8" />
573                 <field name="cornerRadius" type="CARD8" />
574                 <pad bytes="2" />
575                 <list name="points" type="POINT">
576                         <fieldref>nPoints</fieldref>
577                 </list>
578         </struct>
579
580         <struct name="Shape">
581                 <field name="name" type="ATOM" />
582                 <field name="nOutlines" type="CARD8" />
583                 <field name="primaryNdx" type="CARD8" />
584                 <field name="approxNdx" type="CARD8" />
585                 <pad bytes="1" />
586                 <list name="outlines" type="Outline">
587                         <fieldref>nOutlines</fieldref>
588                 </list>
589         </struct>
590
591         <struct name="Key">
592                 <list name="name" type="STRING8">
593                         <value>4</value>
594                 </list>
595                 <field name="gap" type="INT16" />
596                 <field name="shapeNdx" type="CARD8" />
597                 <field name="colorNdx" type="CARD8" />
598         </struct>
599
600         <struct name="OverlayKey">
601                 <list name="over" type="STRING8">
602                         <value>4</value>
603                 </list>
604                 <list name="under" type="STRING8">
605                         <value>4</value>
606                 </list>
607         </struct>
608
609         <struct name="OverlayRow">
610                 <field name="rowUnder" type="CARD8" />
611                 <field name="nKeys" type="CARD8" />
612                 <pad bytes="2" />
613                 <list name="keys" type="OverlayKey">
614                         <fieldref>nKeys</fieldref>
615                 </list>
616         </struct>
617
618         <struct name="Overlay">
619                 <field name="name" type="ATOM" />
620                 <field name="nRows" type="CARD8" />
621                 <pad bytes="3" />
622                 <list name="rows" type="OverlayRow">
623                         <fieldref>nRows</fieldref>
624                 </list>
625         </struct>
626
627         <struct name="Row">
628                 <field name="top" type="INT16" />
629                 <field name="left" type="INT16" />
630                 <field name="nKeys" type="CARD8" />
631                 <field name="vertical" type="BOOL" />
632                 <pad bytes="2" />
633                 <list name="keys" type="Key">
634                         <fieldref>nKeys</fieldref>
635                 </list>
636         </struct>
637
638         <enum name="DoodadType">
639                 <item name="Outline">   <value>1</value> </item>
640                 <item name="Solid">     <value>2</value> </item>
641                 <item name="Text">      <value>3</value> </item>
642                 <item name="Indicator"> <value>4</value> </item>
643                 <item name="Logo">      <value>5</value> </item>
644         </enum>
645
646         <!-- XXX: doodads are broken
647         <struct name="CommonDoodad">
648                 <field name="name" type="ATOM" />
649                 <field name="type" type="CARD8" enum="DoodadType" />
650                 <field name="priority" type="CARD8" />
651                 <field name="top" type="INT16" />
652                 <field name="left" type="INT16" />
653                 <field name="angle" type="INT16" />
654                 <pad bytes="8" />
655         </struct>
656
657         <struct name="ShapeDoodad">
658                 <field name="name" type="ATOM" />
659                 <field name="type" type="CARD8" enum="DoodadType" />
660                 <field name="priority" type="CARD8" />
661                 <field name="top" type="INT16" />
662                 <field name="left" type="INT16" />
663                 <field name="angle" type="INT16" />
664                 <field name="colorNdx" type="CARD8" />
665                 <field name="shapeNdx" type="CARD8" />
666                 <pad bytes="6" />
667         </struct>
668
669         <struct name="TextDoodad">
670                 <field name="name" type="ATOM" />
671                 <field name="type" type="CARD8" enum="DoodadType" />
672                 <field name="priority" type="CARD8" />
673                 <field name="top" type="INT16" />
674                 <field name="left" type="INT16" />
675                 <field name="angle" type="INT16" />
676                 <field name="width" type="CARD16" />
677                 <field name="height" type="CARD16" />
678                 <field name="colorNdx" type="CARD8" />
679                 <pad bytes="3" />
680                 <field name="text" type="CountedString16" />
681                 <field name="font" type="CountedString16" />
682         </struct>
683
684         <struct name="IndicatorDoodad">
685                 <field name="name" type="ATOM" />
686                 <field name="type" type="CARD8" enum="DoodadType" />
687                 <field name="priority" type="CARD8" />
688                 <field name="top" type="INT16" />
689                 <field name="left" type="INT16" />
690                 <field name="angle" type="INT16" />
691                 <field name="shapeNdx" type="CARD8" />
692                 <field name="onColorNdx" type="CARD8" />
693                 <field name="offColorNdx" type="CARD8" />
694                 <pad bytes="5" />
695         </struct>
696
697         <struct name="LogoDoodad">
698                 <field name="name" type="ATOM" />
699                 <field name="type" type="CARD8" enum="DoodadType" />
700                 <field name="priority" type="CARD8" />
701                 <field name="top" type="INT16" />
702                 <field name="left" type="INT16" />
703                 <field name="angle" type="INT16" />
704                 <field name="colorNdx" type="CARD8" />
705                 <field name="shapeNdx" type="CARD8" />
706                 <pad bytes="6" />
707                 <field name="logoName" type="CountedString16" />
708         </struct>
709
710         <union name="Doodad">
711                 <field name="common" type="CommonDoodad" />
712                 <field name="shape" type="ShapeDoodad" />
713                 <field name="text" type="TextDoodad" />
714                 <field name="indicator" type="IndicatorDoodad" />
715                 <field name="logo" type="LogoDoodad" />
716         </union>
717
718         <struct name="Section">
719                 <field name="name" type="ATOM" />
720                 <field name="top" type="INT16" />
721                 <field name="left" type="INT16" />
722                 <field name="width" type="CARD16" />
723                 <field name="height" type="CARD16" />
724                 <field name="angle" type="INT16" />
725                 <field name="priority" type="CARD8" />
726                 <field name="nRows" type="CARD8" />
727                 <field name="nDoodads" type="CARD8" />
728                 <field name="nOverlays" type="CARD8" />
729                 <pad bytes="2" />
730                 <list name="rows" type="Row">
731                         <fieldref>nRows</fieldref>
732                 </list>
733                 <list name="doodads" type="Doodad">
734                         <fieldref>nDoodads</fieldref>
735                 </list>
736                 <list name="overlays" type="Overlay">
737                         <fieldref>nOverlays</fieldref>
738                 </list>
739         </struct>
740         -->
741
742         <struct name="Listing">
743                 <field name="flags" type="CARD16" />
744                 <field name="length" type="CARD16" />
745                 <list name="string" type="STRING8">
746                         <fieldref>length</fieldref>
747                 </list>
748         </struct>
749
750         <struct name="DeviceLedInfo">
751                 <field name="ledClass" type="LedClassSpec" enum="LedClass" />
752                 <field name="ledID" type="IDSpec" altenum="ID" />
753                 <field name="namesPresent" type="CARD32" />
754                 <field name="mapsPresent" type="CARD32" />
755                 <field name="physIndicators" type="CARD32" />
756                 <field name="state" type="CARD32" />
757                 <list name="names" type="ATOM">
758                         <popcount>
759                                 <fieldref>namesPresent</fieldref>
760                         </popcount>
761                 </list>
762                 <list name="maps" type="IndicatorMap">
763                         <popcount>
764                                 <fieldref>mapsPresent</fieldref>
765                         </popcount>
766                 </list>
767         </struct>
768
769         <!-- Errors -->
770
771         <enum name="Error">
772                 <item name="BadDevice"> <value>255</value> </item>      <!--0xff-->
773                 <item name="BadClass">  <value>254</value> </item>      <!--0xfe-->
774                 <item name="BadId">     <value>253</value> </item>      <!--0xfd-->
775         </enum>
776
777         <error name="Keyboard" number="0">
778                 <field name="value" type="CARD32" />
779                 <field name="minorOpcode" type="CARD16" />
780                 <field name="majorOpcode" type="CARD8" />
781                 <pad bytes="21" />
782         </error>
783
784         <!-- Key Actions -->
785
786         <enum name="SA">
787                 <item name="ClearLocks">    <bit>0</bit> </item>
788                 <item name="LatchToLock">   <bit>1</bit> </item>
789                 <item name="UseModMapMods"> <bit>2</bit> </item>
790                 <item name="GroupAbsolute"> <bit>2</bit> </item>
791         </enum>
792
793         <enum name="SAType">
794                 <item name="NoAction">       <value>0</value> </item>
795                 <item name="SetMods">        <value>1</value> </item>
796                 <item name="LatchMods">      <value>2</value> </item>
797                 <item name="LockMods">       <value>3</value> </item>
798                 <item name="SetGroup">       <value>4</value> </item>
799                 <item name="LatchGroup">     <value>5</value> </item>
800                 <item name="LockGroup">      <value>6</value> </item>
801                 <item name="MovePtr">        <value>7</value> </item>
802                 <item name="PtrBtn">         <value>8</value> </item>
803                 <item name="LockPtrBtn">     <value>9</value> </item>
804                 <item name="SetPtrDflt">     <value>10</value> </item>
805                 <item name="ISOLock">        <value>11</value> </item>
806                 <item name="Terminate">      <value>12</value> </item>
807                 <item name="SwitchScreen">   <value>13</value> </item>
808                 <item name="SetControls">    <value>14</value> </item>
809                 <item name="LockControls">   <value>15</value> </item>
810                 <item name="ActionMessage">  <value>16</value> </item>
811                 <item name="RedirectKey">    <value>17</value> </item>
812                 <item name="DeviceBtn">      <value>18</value> </item>
813                 <item name="LockDeviceBtn">  <value>19</value> </item>
814                 <item name="DeviceValuator"> <value>20</value> </item>
815         </enum>
816
817         <struct name="SANoAction">
818                 <field name="type" type="CARD8" enum="SAType" />
819                 <pad bytes="7" />
820         </struct>
821
822         <struct name="SASetMods">
823                 <field name="type" type="CARD8" enum="SAType" />
824                 <field name="flags" type="CARD8" mask="SA" />
825                 <field name="mask" type="CARD8" mask="ModMask" />
826                 <field name="realMods" type="CARD8" mask="ModMask" />
827                 <field name="vmodsHigh" type="CARD8" mask="VModsHigh" />
828                 <field name="vmodsLow" type="CARD8" mask="VModsLow" />
829                 <pad bytes="2" />
830         </struct>
831
832         <typedef oldname="SASetMods" newname="SALatchMods" />
833
834         <typedef oldname="SASetMods" newname="SALockMods" />
835
836         <struct name="SASetGroup">
837                 <field name="type" type="CARD8" enum="SAType" />
838                 <field name="flags" type="CARD8" mask="SA" />
839                 <field name="group" type="INT8" />
840                 <pad bytes="5" />
841         </struct>
842
843         <typedef oldname="SASetGroup" newname="SALatchGroup" />
844
845         <typedef oldname="SASetGroup" newname="SALockGroup" />
846
847         <enum name="SAMovePtrFlag">
848                 <item name="NoAcceleration"> <bit>0</bit> </item>
849                 <item name="MoveAbsoluteX">  <bit>1</bit> </item>
850                 <item name="MoveAbsoluteY">  <bit>2</bit> </item>
851         </enum>
852
853         <struct name="SAMovePtr">
854                 <field name="type" type="CARD8" enum="SAType" />
855                 <field name="flags" type="CARD8" mask="SAMovePtrFlag" />
856                 <field name="xHigh" type="INT8" />
857                 <field name="xLow" type="CARD8" />
858                 <field name="yHigh" type="INT8" />
859                 <field name="yLow" type="CARD8" />
860                 <pad bytes="2" />
861         </struct>
862
863         <struct name="SAPtrBtn">
864                 <field name="type" type="CARD8" enum="SAType" />
865                 <field name="flags" type="CARD8" />
866                 <field name="count" type="CARD8" />
867                 <field name="button" type="CARD8" />
868                 <pad bytes="4" />
869         </struct>
870
871         <struct name="SALockPtrBtn">
872                 <field name="type" type="CARD8" enum="SAType" />
873                 <field name="flags" type="CARD8" />
874                 <pad bytes="1" />
875                 <field name="button" type="CARD8" />
876                 <pad bytes="4" />
877         </struct>
878
879         <enum name="SASetPtrDfltFlag">
880                 <!-- The spec says 0x02 but Xlib uses 0x04. -->
881                 <item name="DfltBtnAbsolute">  <bit>2</bit> </item>
882                 <item name="AffectDfltButton"> <bit>0</bit> </item>
883         </enum>
884
885         <struct name="SASetPtrDflt">
886                 <field name="type" type="CARD8" enum="SAType" />
887                 <field name="flags" type="CARD8" mask="SASetPtrDfltFlag" />
888                 <field name="affect" type="CARD8" mask="SASetPtrDfltFlag" />
889                 <field name="value" type="INT8" />
890                 <pad bytes="4" />
891         </struct>
892
893         <enum name="SAIsoLockFlag">
894                 <item name="NoLock">         <bit>0</bit> </item>
895                 <item name="NoUnlock">       <bit>1</bit> </item>
896                 <item name="UseModMapMods">  <bit>2</bit> </item>
897                 <item name="GroupAbsolute">  <bit>2</bit> </item>
898                 <item name="ISODfltIsGroup"> <bit>3</bit> </item>
899         </enum>
900
901         <enum name="SAIsoLockNoAffect">
902                 <item name="Ctrls"> <bit>3</bit> </item>
903                 <item name="Ptr">   <bit>4</bit> </item>
904                 <item name="Group"> <bit>5</bit> </item>
905                 <item name="Mods">  <bit>6</bit> </item>
906         </enum>
907
908         <struct name="SAIsoLock">
909                 <field name="type" type="CARD8" enum="SAType" />
910                 <field name="flags" type="CARD8" mask="SAIsoLockFlag" />
911                 <field name="mask" type="CARD8" mask="ModMask" />
912                 <field name="realMods" type="CARD8" mask="ModMask" />
913                 <field name="group" type="INT8" />
914                 <field name="affect" type="CARD8" mask="SAIsoLockNoAffect" />
915                 <field name="vmodsHigh" type="CARD8" mask="VModsHigh" />
916                 <field name="vmodsLow" type="CARD8" mask="VModsLow" />
917         </struct>
918
919         <struct name="SATerminate">
920                 <field name="type" type="CARD8" enum="SAType" />
921                 <pad bytes="7" />
922         </struct>
923
924         <enum name="SwitchScreenFlag">
925                 <item name="Application"> <bit>0</bit> </item>
926                 <item name="Absolute" >   <bit>2</bit> </item>
927         </enum>
928
929         <struct name="SASwitchScreen">
930                 <field name="type" type="CARD8" enum="SAType" />
931                 <field name="flags" type="CARD8" />
932                 <field name="newScreen" type="INT8" />
933                 <pad bytes="5" />
934         </struct>
935
936         <enum name="BoolCtrlsHigh">
937                 <item name="AccessXFeedback"> <bit>0</bit> </item>
938                 <item name="AudibleBell">     <bit>1</bit> </item>
939                 <item name="Overlay1">        <bit>2</bit> </item>
940                 <item name="Overlay2">        <bit>3</bit> </item>
941                 <item name="IgnoreGroupLock"> <bit>4</bit> </item>
942         </enum>
943
944         <enum name="BoolCtrlsLow">
945                 <item name="RepeatKeys">     <bit>0</bit> </item>
946                 <item name="SlowKeys">       <bit>1</bit> </item>
947                 <item name="BounceKeys">     <bit>2</bit> </item>
948                 <item name="StickyKeys">     <bit>3</bit> </item>
949                 <item name="MouseKeys">      <bit>4</bit> </item>
950                 <item name="MouseKeysAccel"> <bit>5</bit> </item>
951                 <item name="AccessXKeys">    <bit>6</bit> </item>
952                 <item name="AccessXTimeout"> <bit>7</bit> </item>
953         </enum>
954
955         <struct name="SASetControls">
956                 <field name="type" type="CARD8" enum="SAType" />
957                 <pad bytes="3" />
958                 <field name="boolCtrlsHigh" type="CARD8" mask="BoolCtrlsHigh" />
959                 <field name="boolCtrlsLow"  type="CARD8" mask="BoolCtrlsLow" />
960                 <pad bytes="2" />
961         </struct>
962
963         <typedef oldname="SASetControls" newname="SALockControls" />
964
965         <enum name="ActionMessageFlag">
966                 <item name="OnPress">     <bit>0</bit> </item>
967                 <item name="OnRelease">   <bit>1</bit> </item>
968                 <item name="GenKeyEvent"> <bit>2</bit> </item>
969         </enum>
970
971         <struct name="SAActionMessage">
972                 <field name="type" type="CARD8" enum="SAType" />
973                 <field name="flags" type="CARD8" mask="ActionMessageFlag" />
974                 <list name="message" type="CARD8">
975                         <value>6</value>
976                 </list>
977         </struct>
978
979         <struct name="SARedirectKey">
980                 <field name="type" type="CARD8" enum="SAType" />
981                 <field name="newkey" type="KEYCODE" />
982                 <field name="mask" type="CARD8" mask="ModMask" />
983                 <field name="realModifiers" type="CARD8" mask="ModMask" />
984                 <field name="vmodsMaskHigh" type="CARD8" mask="VModsHigh"/>
985                 <field name="vmodsMaskLow" type="CARD8" mask="VModsLow"/>
986                 <field name="vmodsHigh" type="CARD8" mask="VModsHigh"/>
987                 <field name="vmodsLow" type="CARD8" mask="VModsLow"/>
988         </struct>
989
990         <struct name="SADeviceBtn">
991                 <field name="type" type="CARD8" enum="SAType" />
992                 <field name="flags" type="CARD8" />
993                 <field name="count" type="CARD8" />
994                 <field name="button" type="CARD8" />
995                 <field name="device" type="CARD8" />
996                 <pad bytes="3" />
997         </struct>
998
999         <enum name="LockDeviceFlags">
1000                 <item name="NoLock">   <bit>0</bit> </item>
1001                 <item name="NoUnlock"> <bit>1</bit> </item>
1002         </enum>
1003
1004         <struct name="SALockDeviceBtn">
1005                 <field name="type" type="CARD8" enum="SAType" />
1006                 <field name="flags" type="CARD8" mask="LockDeviceFlags" />
1007                 <pad bytes="1" />
1008                 <field name="button" type="CARD8" />
1009                 <field name="device" type="CARD8" />
1010                 <pad bytes="3" />
1011         </struct>
1012
1013         <enum name="SAValWhat">
1014                 <item name="IgnoreVal">      <value>0</value> </item>
1015                 <item name="SetValMin">      <value>1</value> </item>
1016                 <item name="SetValCenter">   <value>2</value> </item>
1017                 <item name="SetValMax">      <value>3</value> </item>
1018                 <item name="SetValRelative"> <value>4</value> </item>
1019                 <item name="SetValAbsolute"> <value>5</value> </item>
1020         </enum>
1021
1022         <struct name="SADeviceValuator">
1023                 <field name="type" type="CARD8" enum="SAType" />
1024                 <field name="device" type="CARD8" />
1025                 <field name="val1what" type="CARD8" enum="SAValWhat" />
1026                 <field name="val1index" type="CARD8" />
1027                 <field name="val1value" type="CARD8" />
1028                 <field name="val2what" type="CARD8" enum="SAValWhat" />
1029                 <field name="val2index" type="CARD8" />
1030                 <field name="val2value" type="CARD8" />
1031         </struct>
1032
1033         <struct name="SIAction">
1034                 <field name="type" type="CARD8" enum="SAType" />
1035                 <list name="data" type="CARD8">
1036                         <value>7</value>
1037                 </list>
1038         </struct>
1039
1040         <struct name="SymInterpret">
1041                 <field name="sym" type="KEYSYM" />
1042                 <field name="mods" type="CARD8" mask="ModMask" />
1043                 <!-- "match" may also have XkbSI_LevelOneOnly (0x80) or'd into it -->
1044                 <field name="match" type="CARD8" altenum="SymInterpretMatch" />
1045                 <field name="virtualMod" type="CARD8" mask="VModsLow" />
1046                 <field name="flags" type="CARD8" />
1047                 <field name="action" type="SIAction" />
1048         </struct>
1049
1050         <union name="Action">
1051                 <field name="noaction" type="SANoAction" />
1052                 <field name="setmods" type="SASetMods" />
1053                 <field name="latchmods" type="SALatchMods" />
1054                 <field name="lockmods" type="SALockMods" />
1055                 <field name="setgroup" type="SASetGroup" />
1056                 <field name="latchgroup" type="SALatchGroup" />
1057                 <field name="lockgroup" type="SALockGroup" />
1058                 <field name="moveptr" type="SAMovePtr" />
1059                 <field name="ptrbtn" type="SAPtrBtn" />
1060                 <field name="lockptrbtn" type="SALockPtrBtn" />
1061                 <field name="setptrdflt" type="SASetPtrDflt" />
1062                 <field name="isolock" type="SAIsoLock" />
1063                 <field name="terminate" type="SATerminate" />
1064                 <field name="switchscreen" type="SASwitchScreen" />
1065                 <field name="setcontrols" type="SASetControls" />
1066                 <field name="lockcontrols" type="SALockControls" />
1067                 <field name="message" type="SAActionMessage" />
1068                 <field name="redirect" type="SARedirectKey" />
1069                 <field name="devbtn" type="SADeviceBtn" />
1070                 <field name="lockdevbtn" type="SALockDeviceBtn" />
1071                 <field name="devval" type="SADeviceValuator" />
1072                 <field name="type" type="CARD8" enum="SAType" />
1073         </union>
1074
1075         <!-- Requests -->
1076
1077         <request name="UseExtension" opcode="0">
1078                 <field name="wantedMajor" type="CARD16" />
1079                 <field name="wantedMinor" type="CARD16" />
1080                 <reply>
1081                         <field name="supported" type="BOOL" />
1082                         <field name="serverMajor" type="CARD16" />
1083                         <field name="serverMinor" type="CARD16" />
1084                         <pad bytes="20" />
1085                 </reply>
1086         </request>
1087
1088         <request name="SelectEvents" opcode="1">
1089                 <field name="deviceSpec" type="DeviceSpec" />
1090                 <field name="affectWhich" type="CARD16" mask="EventType" />
1091                 <field name="clear" type="CARD16" mask="EventType" />
1092                 <field name="selectAll" type="CARD16" mask="EventType" />
1093                 <field name="affectMap" type="CARD16" mask="MapPart" />
1094                 <field name="map" type="CARD16" mask="MapPart" />
1095                 <switch name="details">
1096                         <op op="&amp;">
1097                                 <fieldref>affectWhich</fieldref>
1098                                 <op op="&amp;">
1099                                         <unop op="~"><fieldref>clear</fieldref></unop>
1100                                         <unop op="~"><fieldref>selectAll</fieldref></unop>
1101                                 </op>
1102                         </op>
1103                         <bitcase>
1104                                 <enumref ref="EventType">NewKeyboardNotify</enumref>
1105                                 <field name="affectNewKeyboard" type="CARD16" mask="NKNDetail" />
1106                                 <field name="newKeyboardDetails" type="CARD16" mask="NKNDetail" />
1107                         </bitcase>
1108                         <bitcase>
1109                                 <enumref ref="EventType">StateNotify</enumref>
1110                                 <field name="affectState" type="CARD16" mask="StatePart" />
1111                                 <field name="stateDetails" type="CARD16" mask="StatePart" />
1112                         </bitcase>
1113                         <bitcase>
1114                                 <enumref ref="EventType">ControlsNotify</enumref>
1115                                 <field name="affectCtrls" type="CARD32" mask="Control" />
1116                                 <field name="ctrlDetails" type="CARD32" mask="Control" />
1117                         </bitcase>
1118                         <bitcase>
1119                                 <enumref ref="EventType">IndicatorStateNotify</enumref>
1120                                 <field name="affectIndicatorState" type="CARD32" />
1121                                 <field name="indicatorStateDetails" type="CARD32" />
1122                         </bitcase>
1123                         <bitcase>
1124                                 <enumref ref="EventType">IndicatorMapNotify</enumref>
1125                                 <field name="affectIndicatorMap" type="CARD32" />
1126                                 <field name="indicatorMapDetails" type="CARD32" />
1127                         </bitcase>
1128                         <bitcase>
1129                                 <enumref ref="EventType">NamesNotify</enumref>
1130                                 <field name="affectNames" type="CARD16" mask="NameDetail" />
1131                                 <field name="namesDetails" type="CARD16" mask="NameDetail" />
1132                         </bitcase>
1133                         <bitcase>
1134                                 <enumref ref="EventType">CompatMapNotify</enumref>
1135                                 <field name="affectCompat" type="CARD8" mask="CMDetail" />
1136                                 <field name="compatDetails" type="CARD8" mask="CMDetail" />
1137                         </bitcase>
1138                         <bitcase>
1139                                 <enumref ref="EventType">BellNotify</enumref>
1140                                 <field name="affectBell" type="CARD8" />
1141                                 <field name="bellDetails" type="CARD8" />
1142                         </bitcase>
1143                         <bitcase>
1144                                 <enumref ref="EventType">ActionMessage</enumref>
1145                                 <field name="affectMsgDetails" type="CARD8" />
1146                                 <field name="msgDetails" type="CARD8" />
1147                         </bitcase>
1148                         <bitcase>
1149                                 <enumref ref="EventType">AccessXNotify</enumref>
1150                                 <field name="affectAccessX" type="CARD16" mask="AXNDetail" />
1151                                 <field name="accessXDetails" type="CARD16" mask="AXNDetail" />
1152                         </bitcase>
1153                         <bitcase>
1154                                 <enumref ref="EventType">ExtensionDeviceNotify</enumref>
1155                                 <field name="affectExtDev" type="CARD16" mask="XIFeature" />
1156                                 <field name="extdevDetails" type="CARD16" mask="XIFeature" />
1157                         </bitcase>
1158                 </switch>
1159         </request>
1160
1161         <request name="Bell" opcode="3">
1162                 <field name="deviceSpec" type="DeviceSpec" />
1163                 <field name="bellClass" type="BellClassSpec" />
1164                 <field name="bellID" type="IDSpec" />
1165                 <field name="percent" type="INT8" />
1166                 <field name="forceSound" type="BOOL" />
1167                 <field name="eventOnly" type="BOOL" />
1168                 <pad bytes="1" />
1169                 <field name="pitch" type="INT16" />
1170                 <field name="duration" type="INT16" />
1171                 <pad bytes="2" />
1172                 <field name="name" type="ATOM" />
1173                 <field name="window" type="WINDOW" />
1174         </request>
1175
1176         <request name="GetState" opcode="4">
1177                 <field name="deviceSpec" type="DeviceSpec" />
1178                 <pad bytes="2" />
1179                 <reply>
1180                         <field name="deviceID" type="CARD8" />
1181                         <field name="mods" type="CARD8" mask="ModMask" />
1182                         <field name="baseMods" type="CARD8" mask="ModMask" />
1183                         <field name="latchedMods" type="CARD8" mask="ModMask" />
1184                         <field name="lockedMods" type="CARD8" mask="ModMask" />
1185                         <field name="group" type="CARD8" enum="Group" />
1186                         <field name="lockedGroup" type="CARD8" enum="Group" />
1187                         <field name="baseGroup" type="INT16" />
1188                         <field name="latchedGroup" type="INT16" />
1189                         <field name="compatState" type="CARD8" mask="ModMask" />
1190                         <field name="grabMods" type="CARD8" mask="ModMask" />
1191                         <field name="compatGrabMods" type="CARD8" mask="ModMask" />
1192                         <field name="lookupMods" type="CARD8" mask="ModMask" />
1193                         <field name="compatLookupMods" type="CARD8" mask="ModMask" />
1194                         <pad bytes="1" />
1195                         <field name="ptrBtnState" type="CARD16" mask="KeyButMask" />
1196                         <pad bytes="6" />
1197                 </reply>
1198         </request>
1199
1200         <request name="LatchLockState" opcode="5">
1201                 <field name="deviceSpec" type="DeviceSpec" />
1202                 <field name="affectModLocks" type="CARD8" mask="ModMask" />
1203                 <field name="modLocks" type="CARD8" mask="ModMask" />
1204                 <field name="lockGroup" type="BOOL" />
1205                 <field name="groupLock" type="CARD8" enum="Group" />
1206                 <field name="affectModLatches" type="CARD8" mask="ModMask" />
1207                 <pad bytes="1" />
1208                 <field name="latchGroup" type="BOOL" />
1209                 <field name="groupLatch" type="CARD16" />
1210         </request>
1211
1212         <request name="GetControls" opcode="6">
1213                 <field name="deviceSpec" type="DeviceSpec" />
1214                 <pad bytes="2" />
1215                 <reply>
1216                         <field name="deviceID" type="CARD8" />
1217                         <field name="mouseKeysDfltBtn" type="CARD8" />
1218                         <field name="numGroups" type="CARD8" />
1219                         <field name="groupsWrap" type="CARD8" />
1220                         <field name="internalModsMask" type="CARD8" mask="ModMask" />
1221                         <field name="ignoreLockModsMask" type="CARD8" mask="ModMask" />
1222                         <field name="internalModsRealMods" type="CARD8" mask="ModMask" />
1223                         <field name="ignoreLockModsRealMods" type="CARD8" mask="ModMask" />
1224                         <pad bytes="1" />
1225                         <field name="internalModsVmods" type="CARD16" mask="VMod" />
1226                         <field name="ignoreLockModsVmods" type="CARD16" mask="VMod" />
1227                         <field name="repeatDelay" type="CARD16" />
1228                         <field name="repeatInterval" type="CARD16" />
1229                         <field name="slowKeysDelay" type="CARD16" />
1230                         <field name="debounceDelay" type="CARD16" />
1231                         <field name="mouseKeysDelay" type="CARD16" />
1232                         <field name="mouseKeysInterval" type="CARD16" />
1233                         <field name="mouseKeysTimeToMax" type="CARD16" />
1234                         <field name="mouseKeysMaxSpeed" type="CARD16" />
1235                         <field name="mouseKeysCurve" type="INT16" />
1236                         <field name="accessXOption" type="CARD16" mask="AXOption" />
1237                         <field name="accessXTimeout" type="CARD16" />
1238                         <field name="accessXTimeoutOptionsMask" type="CARD16" mask="AXOption" />
1239                         <field name="accessXTimeoutOptionsValues" type="CARD16" mask="AXOption" />
1240                         <pad bytes="2" />
1241                         <field name="accessXTimeoutMask" type="CARD32" mask="BoolCtrl" />
1242                         <field name="accessXTimeoutValues" type="CARD32" mask="BoolCtrl" />
1243                         <field name="enabledControls" type="CARD32" mask="BoolCtrl" />
1244                         <list name="perKeyRepeat" type="CARD8">
1245                                 <value>32</value>
1246                         </list>
1247                 </reply>
1248         </request>
1249
1250         <request name="SetControls" opcode="7">
1251                 <field name="deviceSpec" type="DeviceSpec" />
1252                 <field name="affectInternalRealMods" type="CARD8" mask="ModMask" />
1253                 <field name="internalRealMods" type="CARD8" mask="ModMask" />
1254                 <field name="affectIgnoreLockRealMods" type="CARD8" mask="ModMask" />
1255                 <field name="ignoreLockRealMods" type="CARD8" mask="ModMask" />
1256                 <field name="affectInternalVirtualMods" type="CARD16" mask="VMod" />
1257                 <field name="internalVirtualMods" type="CARD16" mask="VMod" />
1258                 <field name="affectIgnoreLockVirtualMods" type="CARD16" mask="VMod" />
1259                 <field name="ignoreLockVirtualMods" type="CARD16" mask="VMod" />
1260                 <field name="mouseKeysDfltBtn" type="CARD8" />
1261                 <field name="groupsWrap" type="CARD8" />
1262                 <field name="accessXOptions" type="CARD16" mask="AXOption" />
1263                 <pad bytes="2" />
1264                 <field name="affectEnabledControls" type="CARD32" mask="BoolCtrl" />
1265                 <field name="enabledControls" type="CARD32" mask="BoolCtrl" />
1266                 <field name="changeControls" type="CARD32" mask="Control" />
1267                 <field name="repeatDelay" type="CARD16" />
1268                 <field name="repeatInterval" type="CARD16" />
1269                 <field name="slowKeysDelay" type="CARD16" />
1270                 <field name="debounceDelay" type="CARD16" />
1271                 <field name="mouseKeysDelay" type="CARD16" />
1272                 <field name="mouseKeysInterval" type="CARD16" />
1273                 <field name="mouseKeysTimeToMax" type="CARD16" />
1274                 <field name="mouseKeysMaxSpeed" type="CARD16" />
1275                 <field name="mouseKeysCurve" type="INT16" />
1276                 <field name="accessXTimeout" type="CARD16" />
1277                 <field name="accessXTimeoutMask" type="CARD32" mask="BoolCtrl" />
1278                 <field name="accessXTimeoutValues" type="CARD32" mask="BoolCtrl" />
1279                 <field name="accessXTimeoutOptionsMask" type="CARD16" mask="AXOption" />
1280                 <field name="accessXTimeoutOptionsValues" type="CARD16" mask="AXOption" />
1281                 <list name="perKeyRepeat" type="CARD8">
1282                         <value>32</value>
1283                 </list>
1284         </request>
1285
1286         <request name="GetMap" opcode="8">
1287                 <field name="deviceSpec" type="DeviceSpec" />
1288                 <field name="full" type="CARD16" mask="MapPart" />
1289                 <field name="partial" type="CARD16" mask="MapPart" />
1290                 <field name="firstType" type="CARD8" />
1291                 <field name="nTypes" type="CARD8" />
1292                 <field name="firstKeySym" type="KEYCODE" />
1293                 <field name="nKeySyms" type="CARD8" />
1294                 <field name="firstKeyAction" type="KEYCODE" />
1295                 <field name="nKeyActions" type="CARD8" />
1296                 <field name="firstKeyBehavior" type="KEYCODE" />
1297                 <field name="nKeyBehaviors" type="CARD8" />
1298                 <field name="virtualMods" type="CARD16" mask="VMod" />
1299                 <field name="firstKeyExplicit" type="KEYCODE" />
1300                 <field name="nKeyExplicit" type="CARD8" />
1301                 <field name="firstModMapKey" type="KEYCODE" />
1302                 <field name="nModMapKeys" type="CARD8" />
1303                 <field name="firstVModMapKey" type="KEYCODE" />
1304                 <field name="nVModMapKeys" type="CARD8" />
1305                 <pad bytes="2" />
1306                 <reply>
1307                         <field name="deviceID" type="CARD8" />
1308                         <pad bytes="2" />
1309                         <field name="minKeyCode" type="KEYCODE" />
1310                         <field name="maxKeyCode" type="KEYCODE" />
1311                         <field name="present" type="CARD16" mask="MapPart" />
1312                         <field name="firstType" type="CARD8" />
1313                         <field name="nTypes" type="CARD8" />
1314                         <field name="totalTypes" type="CARD8" />
1315                         <field name="firstKeySym" type="KEYCODE" />
1316                         <field name="totalSyms" type="CARD16" />
1317                         <field name="nKeySyms" type="CARD8" />
1318                         <field name="firstKeyAction" type="KEYCODE" />
1319                         <field name="totalActions" type="CARD16" />
1320                         <field name="nKeyActions" type="CARD8" />
1321                         <field name="firstKeyBehavior" type="KEYCODE" />
1322                         <field name="nKeyBehaviors" type="CARD8" />
1323                         <field name="totalKeyBehaviors" type="CARD8" />
1324                         <field name="firstKeyExplicit" type="KEYCODE" />
1325                         <field name="nKeyExplicit" type="CARD8" />
1326                         <field name="totalKeyExplicit" type="CARD8" />
1327                         <field name="firstModMapKey" type="KEYCODE" />
1328                         <field name="nModMapKeys" type="CARD8" />
1329                         <field name="totalModMapKeys" type="CARD8" />
1330                         <field name="firstVModMapKey" type="KEYCODE" />
1331                         <field name="nVModMapKeys" type="CARD8" />
1332                         <field name="totalVModMapKeys" type="CARD8" />
1333                         <pad bytes="1" />
1334                         <field name="virtualMods" type="CARD16" mask="VMod" />
1335                         <switch name="map">
1336                                 <fieldref>present</fieldref>
1337                                 <bitcase>
1338                                         <enumref ref="MapPart">KeyTypes</enumref>
1339                                         <list name="types_rtrn" type="KeyType">
1340                                                 <fieldref>nTypes</fieldref>
1341                                         </list>
1342                                 </bitcase>
1343                                 <bitcase>
1344                                         <enumref ref="MapPart">KeySyms</enumref>
1345                                         <list name="syms_rtrn" type="KeySymMap">
1346                                                 <fieldref>nKeySyms</fieldref>
1347                                         </list>
1348                                 </bitcase>
1349                                 <bitcase>
1350                                         <enumref ref="MapPart">KeyActions</enumref>
1351                                         <list name="acts_rtrn_count" type="CARD8">
1352                                                 <fieldref>nKeyActions</fieldref>
1353                                         </list>
1354                                         <pad align="4" />
1355                                         <list name="acts_rtrn_acts" type="Action">
1356                                                 <fieldref>totalActions</fieldref>
1357                                         </list>
1358                                 </bitcase>
1359                                 <bitcase>
1360                                         <enumref ref="MapPart">KeyBehaviors</enumref>
1361                                         <list name="behaviors_rtrn" type="SetBehavior">
1362                                                 <fieldref>totalKeyBehaviors</fieldref>
1363                                         </list>
1364                                 </bitcase>
1365                                 <bitcase>
1366                                         <enumref ref="MapPart">VirtualMods</enumref>
1367                                         <list name="vmods_rtrn" type="CARD8" mask="ModMask">
1368                                                 <popcount><fieldref>virtualMods</fieldref></popcount>
1369                                         </list>
1370                                         <pad align="4" />
1371                                 </bitcase>
1372                                 <bitcase>
1373                                         <enumref ref="MapPart">ExplicitComponents</enumref>
1374                                         <list name="explicit_rtrn" type="SetExplicit">
1375                                                 <fieldref>totalKeyExplicit</fieldref>
1376                                         </list>
1377                                         <pad align="4" />
1378                                 </bitcase>
1379                                 <bitcase>
1380                                         <enumref ref="MapPart">ModifierMap</enumref>
1381                                         <list name="modmap_rtrn" type="KeyModMap">
1382                                                 <fieldref>totalModMapKeys</fieldref>
1383                                         </list>
1384                                         <pad align="4" />
1385                                 </bitcase>
1386                                 <bitcase>
1387                                         <enumref ref="MapPart">VirtualModMap</enumref>
1388                                         <list name="vmodmap_rtrn" type="KeyVModMap">
1389                                                 <fieldref>totalVModMapKeys</fieldref>
1390                                         </list>
1391                                 </bitcase>
1392                         </switch>
1393                 </reply>
1394         </request>
1395
1396         <request name="SetMap" opcode="9">
1397                 <field name="deviceSpec" type="DeviceSpec" />
1398                 <field name="present" type="CARD16" mask="MapPart" />
1399                 <field name="flags" type="CARD16" mask="SetMapFlags" />
1400                 <field name="minKeyCode" type="KEYCODE" />
1401                 <field name="maxKeyCode" type="KEYCODE" />
1402                 <field name="firstType" type="CARD8" />
1403                 <field name="nTypes" type="CARD8" />
1404                 <field name="firstKeySym" type="KEYCODE" />
1405                 <field name="nKeySyms" type="CARD8" />
1406                 <field name="totalSyms" type="CARD16" />
1407                 <field name="firstKeyAction" type="KEYCODE" />
1408                 <field name="nKeyActions" type="CARD8" />
1409                 <field name="totalActions" type="CARD16" />
1410                 <field name="firstKeyBehavior" type="KEYCODE" />
1411                 <field name="nKeyBehaviors" type="CARD8" />
1412                 <field name="totalKeyBehaviors" type="CARD8" />
1413                 <field name="firstKeyExplicit" type="KEYCODE" />
1414                 <field name="nKeyExplicit" type="CARD8" />
1415                 <field name="totalKeyExplicit" type="CARD8" />
1416                 <field name="firstModMapKey" type="KEYCODE" />
1417                 <field name="nModMapKeys" type="CARD8" />
1418                 <field name="totalModMapKeys" type="CARD8" />
1419                 <field name="firstVModMapKey" type="KEYCODE" />
1420                 <field name="nVModMapKeys" type="CARD8" />
1421                 <field name="totalVModMapKeys" type="CARD8" />
1422                 <field name="virtualMods" type="CARD16" mask="VMod" />
1423                 <switch name="values">
1424                         <fieldref>present</fieldref>
1425                         <bitcase>
1426                                 <enumref ref="MapPart">KeyTypes</enumref>
1427                                 <list name="types" type="SetKeyType">
1428                                         <fieldref>nTypes</fieldref>
1429                                 </list>
1430                         </bitcase>
1431                         <bitcase>
1432                                 <enumref ref="MapPart">KeySyms</enumref>
1433                                 <list name="syms" type="KeySymMap">
1434                                         <fieldref>nKeySyms</fieldref>
1435                                 </list>
1436                         </bitcase>
1437                         <bitcase>
1438                                 <enumref ref="MapPart">KeyActions</enumref>
1439                                 <list name="actionsCount" type="CARD8">
1440                                         <fieldref>nKeyActions</fieldref>
1441                                 </list>
1442                                 <list name="actions" type="Action">
1443                                         <fieldref>totalActions</fieldref>
1444                                 </list>
1445                         </bitcase>
1446                         <bitcase>
1447                                 <enumref ref="MapPart">KeyBehaviors</enumref>
1448                                 <list name="behaviors" type="SetBehavior">
1449                                         <fieldref>totalKeyBehaviors</fieldref>
1450                                 </list>
1451                         </bitcase>
1452                         <bitcase>
1453                                 <enumref ref="MapPart">VirtualMods</enumref>
1454                                 <list name="vmods" type="CARD8">
1455                                         <popcount><fieldref>virtualMods</fieldref></popcount>
1456                                 </list>
1457                         </bitcase>
1458                         <bitcase>
1459                                 <enumref ref="MapPart">ExplicitComponents</enumref>
1460                                 <list name="explicit" type="SetExplicit">
1461                                         <fieldref>totalKeyExplicit</fieldref>
1462                                 </list>
1463                         </bitcase>
1464                         <bitcase>
1465                                 <enumref ref="MapPart">ModifierMap</enumref>
1466                                 <list name="modmap" type="KeyModMap">
1467                                         <fieldref>totalModMapKeys</fieldref>
1468                                 </list>
1469                         </bitcase>
1470                         <bitcase>
1471                                 <enumref ref="MapPart">VirtualModMap</enumref>
1472                                 <list name="vmodmap" type="KeyVModMap">
1473                                         <fieldref>totalVModMapKeys</fieldref>
1474                                 </list>
1475                         </bitcase>
1476                 </switch>
1477         </request>
1478
1479         <request name="GetCompatMap" opcode="10">
1480                 <field name="deviceSpec" type="DeviceSpec" />
1481                 <field name="groups" type="CARD8" mask="SetOfGroup" />
1482                 <field name="getAllSI" type="BOOL" />
1483                 <field name="firstSI" type="CARD16" />
1484                 <field name="nSI" type="CARD16" />
1485                 <reply>
1486                         <field name="deviceID" type="CARD8" />
1487                         <field name="groupsRtrn" type="CARD8" mask="SetOfGroup" />
1488                         <pad bytes="1" />
1489                         <field name="firstSIRtrn" type="CARD16" />
1490                         <field name="nSIRtrn" type="CARD16" />
1491                         <field name="nTotalSI" type="CARD16" />
1492                         <pad bytes="16" />
1493                         <list name="si_rtrn" type="SymInterpret">
1494                                 <fieldref>nSIRtrn</fieldref>
1495                         </list>
1496                         <list name="group_rtrn" type="ModDef">
1497                                 <popcount>
1498                                         <fieldref>groupsRtrn</fieldref>
1499                                 </popcount>
1500                         </list>
1501                 </reply>
1502         </request>
1503
1504         <request name="SetCompatMap" opcode="11">
1505                 <field name="deviceSpec" type="DeviceSpec" />
1506                 <pad bytes="1" />
1507                 <field name="recomputeActions" type="BOOL" />
1508                 <field name="truncateSI" type="BOOL" />
1509                 <field name="groups" type="CARD8" mask="SetOfGroup" />
1510                 <field name="firstSI" type="CARD16" />
1511                 <field name="nSI" type="CARD16" />
1512                 <pad bytes="2"/>
1513                 <list name="si" type="SymInterpret">
1514                         <fieldref>nSI</fieldref>
1515                 </list>
1516                 <list name="groupMaps" type="ModDef">
1517                         <popcount>
1518                                 <fieldref>groups</fieldref>
1519                         </popcount>
1520                 </list>
1521         </request>
1522
1523         <request name="GetIndicatorState" opcode="12">
1524                 <field name="deviceSpec" type="DeviceSpec" />
1525                 <pad bytes="2" />
1526                 <reply>
1527                         <field name="deviceID" type="CARD8" />
1528                         <field name="state" type="CARD32" />
1529                         <pad bytes="20" />
1530                 </reply>
1531         </request>
1532
1533         <request name="GetIndicatorMap" opcode="13">
1534                 <field name="deviceSpec" type="DeviceSpec" />
1535                 <pad bytes="2" />
1536                 <field name="which" type="CARD32" />
1537                 <reply>
1538                         <field name="deviceID" type="CARD8" />
1539                         <field name="which" type="CARD32" />
1540                         <field name="realIndicators" type="CARD32" />
1541                         <field name="nIndicators" type="CARD8" />
1542                         <pad bytes="15" />
1543                         <list name="maps" type="IndicatorMap">
1544                                 <popcount><fieldref>which</fieldref></popcount>
1545                         </list>
1546                 </reply>
1547         </request>
1548
1549         <request name="SetIndicatorMap" opcode="14">
1550                 <field name="deviceSpec" type="DeviceSpec" />
1551                 <pad bytes="2" />
1552                 <field name="which" type="CARD32" />
1553                 <list name="maps" type="IndicatorMap">
1554                         <popcount>
1555                                 <fieldref>which</fieldref>
1556                         </popcount>
1557                 </list>
1558         </request>
1559
1560         <request name="GetNamedIndicator" opcode="15">
1561                 <field name="deviceSpec" type="DeviceSpec" />
1562                 <field name="ledClass" type="LedClassSpec" enum="LedClass" />
1563                 <field name="ledID" type="IDSpec" altenum="ID" />
1564                 <pad bytes="2" />
1565                 <field name="indicator" type="ATOM" />
1566                 <reply>
1567                         <field name="deviceID" type="CARD8" />
1568                         <field name="indicator" type="ATOM" />
1569                         <field name="found" type="BOOL" />
1570                         <field name="on" type="BOOL" />
1571                         <field name="realIndicator" type="BOOL" />
1572                         <field name="ndx" type="CARD8" />
1573                         <field name="map_flags" type="CARD8" mask="IMFlag" />
1574                         <field name="map_whichGroups" type="CARD8" mask="IMGroupsWhich" />
1575                         <field name="map_groups" type="CARD8" mask="SetOfGroups" />
1576                         <field name="map_whichMods" type="CARD8" mask="IMModsWhich" />
1577                         <field name="map_mods" type="CARD8" mask="ModMask" />
1578                         <field name="map_realMods" type="CARD8" mask="ModMask" />
1579                         <field name="map_vmod" type="CARD16" mask="VMod" />
1580                         <field name="map_ctrls" type="CARD32" mask="BoolCtrl" />
1581                         <field name="supported" type="BOOL" />
1582                         <pad bytes="3" />
1583                 </reply>
1584         </request>
1585
1586         <request name="SetNamedIndicator" opcode="16" >
1587                 <field name="deviceSpec" type="DeviceSpec" />
1588                 <field name="ledClass" type="LedClassSpec" enum="LedClass" />
1589                 <field name="ledID" type="IDSpec" altenum="ID" />
1590                 <pad bytes="2" />
1591                 <field name="indicator" type="ATOM" />
1592                 <field name="setState" type="BOOL" />
1593                 <field name="on" type="BOOL" />
1594                 <field name="setMap" type="BOOL" />
1595                 <field name="createMap" type="BOOL" />
1596                 <pad bytes="1" />
1597                 <field name="map_flags" type="CARD8" mask="IMFlag" />
1598                 <field name="map_whichGroups" type="CARD8" mask="IMGroupsWhich" />
1599                 <field name="map_groups" type="CARD8" mask="SetOfGroups" />
1600                 <field name="map_whichMods" type="CARD8" mask="IMModsWhich" />
1601                 <field name="map_realMods" type="CARD8" mask="ModMask" />
1602                 <field name="map_vmods" type="CARD16" mask="VMod" />
1603                 <field name="map_ctrls" type="CARD32" mask="BoolCtrl" />
1604         </request>
1605
1606         <request name="GetNames" opcode="17">
1607                 <field name="deviceSpec" type="DeviceSpec" />
1608                 <pad bytes="2" />
1609                 <field name="which" type="CARD32" mask="NameDetail" />
1610                 <reply>
1611                         <field name="deviceID" type="CARD8" />
1612                         <field name="which" type="CARD32" mask="NameDetail" />
1613                         <field name="minKeyCode" type="KEYCODE" />
1614                         <field name="maxKeyCode" type="KEYCODE" />
1615                         <field name="nTypes" type="CARD8" />
1616                         <field name="groupNames" type="CARD8" mask="SetOfGroup" />
1617                         <field name="virtualMods" type="CARD16" mask="VMod" />
1618                         <field name="firstKey" type="KEYCODE" />
1619                         <field name="nKeys" type="CARD8" />
1620                         <field name="indicators" type="CARD32" />
1621                         <field name="nRadioGroups" type="CARD8" />
1622                         <field name="nKeyAliases" type="CARD8" />
1623                         <field name="nKTLevels" type="CARD16" />
1624                         <pad bytes="4" />
1625                         <switch name="valueList">
1626                                 <fieldref>which</fieldref>
1627                                 <bitcase>
1628                                         <enumref ref="NameDetail">Keycodes</enumref>
1629                                         <field name="keycodesName" type="ATOM" />
1630                                 </bitcase>
1631                                 <bitcase>
1632                                         <enumref ref="NameDetail">Geometry</enumref>
1633                                         <field name="geometryName" type="ATOM" />
1634                                 </bitcase>
1635                                 <bitcase>
1636                                         <enumref ref="NameDetail">Symbols</enumref>
1637                                         <field name="symbolsName" type="ATOM" />
1638                                 </bitcase>
1639                                 <bitcase>
1640                                         <enumref ref="NameDetail">PhysSymbols</enumref>
1641                                         <field name="physSymbolsName" type="ATOM" />
1642                                 </bitcase>
1643                                 <bitcase>
1644                                         <enumref ref="NameDetail">Types</enumref>
1645                                         <field name="typesName" type="ATOM" />
1646                                 </bitcase>
1647                                 <bitcase>
1648                                         <enumref ref="NameDetail">Compat</enumref>
1649                                         <field name="compatName" type="ATOM" />
1650                                 </bitcase>
1651                                 <bitcase>
1652                                         <enumref ref="NameDetail">KeyTypeNames</enumref>
1653                                         <list name="typeNames" type="ATOM">
1654                                                 <fieldref>nTypes</fieldref>
1655                                         </list>
1656                                 </bitcase>
1657                                 <bitcase>
1658                                         <enumref ref="NameDetail">KTLevelNames</enumref>
1659                                         <list name="nLevelsPerType" type="CARD8">
1660                                           <!-- Xlib uses NTypes here - 
1661                                                the spec says nKTLevels is correct, but
1662                                                it does not work in reality
1663                                                <fieldref>nKTLevels</fieldref> -->
1664                                                 <fieldref>nTypes</fieldref>
1665                                         </list>
1666                                         <list type="CARD8" name="alignment_pad">
1667                                             <op op="-">
1668                                                 <op op="&amp;">
1669                                                     <op op="+">
1670                                                         <fieldref>nTypes</fieldref>
1671                                                         <value>3</value>
1672                                                     </op>
1673                                                     <unop op="~">
1674                                                         <value>3</value>
1675                                                     </unop>
1676                                                 </op>
1677                                                 <fieldref>nTypes</fieldref>
1678                                             </op>
1679                                         </list>
1680                                         <list name="ktLevelNames" type="ATOM">
1681                                                 <sumof ref="nLevelsPerType" />
1682                                         </list>
1683                                 </bitcase>
1684                                 <bitcase>
1685                                         <enumref ref="NameDetail">IndicatorNames</enumref>
1686                                         <list name="indicatorNames" type="ATOM">
1687                                                 <popcount>
1688                                                         <fieldref>indicators</fieldref>
1689                                                 </popcount>
1690                                         </list>
1691                                 </bitcase>
1692                                 <bitcase>
1693                                         <enumref ref="NameDetail">VirtualModNames</enumref>
1694                                         <list name="virtualModNames" type="ATOM">
1695                                                 <popcount>
1696                                                         <fieldref>virtualMods</fieldref>
1697                                                 </popcount>
1698                                         </list>
1699                                 </bitcase>
1700                                 <bitcase>
1701                                         <enumref ref="NameDetail">GroupNames</enumref>
1702                                         <list name="groups" type="ATOM">
1703                                                 <popcount>
1704                                                         <fieldref>groupNames</fieldref>
1705                                                 </popcount>
1706                                         </list>
1707                                 </bitcase>
1708                                 <bitcase>
1709                                         <enumref ref="NameDetail">KeyNames</enumref>
1710                                         <list name="keyNames" type="KeyName">
1711                                                 <fieldref>nKeys</fieldref>
1712                                         </list>
1713                                 </bitcase>
1714                                 <bitcase>
1715                                         <enumref ref="NameDetail">KeyAliases</enumref>
1716                                         <list name="keyAliases" type="KeyAlias">
1717                                                 <fieldref>nKeyAliases</fieldref>
1718                                         </list>
1719                                 </bitcase>
1720                                 <bitcase>
1721                                         <enumref ref="NameDetail">RGNames</enumref>
1722                                         <list name="radioGroupNames" type="ATOM">
1723                                                 <fieldref>nRadioGroups</fieldref>
1724                                         </list>
1725                                 </bitcase>
1726                         </switch>
1727                 </reply>
1728         </request>
1729
1730         <request name="SetNames" opcode="18">
1731                 <field name="deviceSpec" type="DeviceSpec" />
1732                 <field name="virtualMods" type="CARD16" mask="VMod" />
1733                 <field name="which" type="CARD32" mask="NameDetail" />
1734                 <field name="firstType" type="CARD8" />
1735                 <field name="nTypes" type="CARD8" />
1736                 <field name="firstKTLevelt" type="CARD8" />
1737                 <field name="nKTLevels" type="CARD8" />
1738                 <field name="indicators" type="CARD32" />
1739                 <field name="groupNames" type="CARD8" mask="SetOfGroup" />
1740                 <field name="nRadioGroups" type="CARD8" />
1741                 <field name="firstKey" type="KEYCODE" />
1742                 <field name="nKeys" type="CARD8" />
1743                 <field name="nKeyAliases" type="CARD8"/>
1744                 <pad bytes="1" />
1745                 <field name="totalKTLevelNames" type="CARD16" />
1746                 <switch name="values">
1747                         <fieldref>which</fieldref>
1748                         <bitcase>
1749                                 <enumref ref="NameDetail">Keycodes</enumref>
1750                                 <field name="keycodesName" type="ATOM" />
1751                         </bitcase>
1752                         <bitcase>
1753                                 <enumref ref="NameDetail">Geometry</enumref>
1754                                 <field name="geometryName" type="ATOM" />
1755                         </bitcase>
1756                         <bitcase>
1757                                 <enumref ref="NameDetail">Symbols</enumref>
1758                                 <field name="symbolsName" type="ATOM" />
1759                         </bitcase>
1760                         <bitcase>
1761                                 <enumref ref="NameDetail">PhysSymbols</enumref>
1762                                 <field name="physSymbolsName" type="ATOM" />
1763                         </bitcase>
1764                         <bitcase>
1765                                 <enumref ref="NameDetail">Types</enumref>
1766                                 <field name="typesName" type="ATOM" />
1767                         </bitcase>
1768                         <bitcase>
1769                                 <enumref ref="NameDetail">Compat</enumref>
1770                                 <field name="compatName" type="ATOM" />
1771                         </bitcase>
1772                         <bitcase>
1773                                 <enumref ref="NameDetail">KeyTypeNames</enumref>
1774                                 <list name="typeNames" type="ATOM">
1775                                         <fieldref>nTypes</fieldref>
1776                                 </list>
1777                         </bitcase>
1778                         <bitcase>
1779                                 <enumref ref="NameDetail">KTLevelNames</enumref>
1780                                 <list name="nLevelsPerType" type="CARD8">
1781                                         <fieldref>nTypes</fieldref>
1782                                 </list>
1783                                 <list name="ktLevelNames" type="ATOM">
1784                                         <sumof ref="nLevelsPerType" />
1785                                 </list>
1786                         </bitcase>
1787                         <bitcase>
1788                                 <enumref ref="NameDetail">IndicatorNames</enumref>
1789                                 <list name="indicatorNames" type="ATOM">
1790                                         <popcount>
1791                                                 <fieldref>indicators</fieldref>
1792                                         </popcount>
1793                                 </list>
1794                         </bitcase>
1795                         <bitcase>
1796                                 <enumref ref="NameDetail">VirtualModNames</enumref>
1797                                 <list name="virtualModNames" type="ATOM">
1798                                         <popcount>
1799                                                 <fieldref>virtualMods</fieldref>
1800                                         </popcount>
1801                                 </list>
1802                         </bitcase>
1803                         <bitcase>
1804                                 <enumref ref="NameDetail">GroupNames</enumref>
1805                                 <list name="groups" type="ATOM">
1806                                         <popcount>
1807                                                 <fieldref>groupNames</fieldref>
1808                                         </popcount>
1809                                 </list>
1810                         </bitcase>
1811                         <bitcase>
1812                                 <enumref ref="NameDetail">KeyNames</enumref>
1813                                 <list name="keyNames" type="KeyName">
1814                                         <fieldref>nKeys</fieldref>
1815                                 </list>
1816                         </bitcase>
1817                         <bitcase>
1818                                 <enumref ref="NameDetail">KeyAliases</enumref>
1819                                 <list name="keyAliases" type="KeyAlias">
1820                                         <fieldref>nKeyAliases</fieldref>
1821                                 </list>
1822                         </bitcase>
1823                         <bitcase>
1824                                 <enumref ref="NameDetail">RGNames</enumref>
1825                                 <list name="radioGroupNames" type="ATOM">
1826                                         <fieldref>nRadioGroups</fieldref>
1827                                 </list>
1828                         </bitcase>
1829                 </switch>
1830         </request>
1831
1832         <!-- XXX: Property and doodads are broken, which renders GetGeometry useless
1833         <request name="GetGeometry" opcode="19">
1834                 <field name="deviceSpec" type="DeviceSpec" />
1835                 <pad bytes="2" />
1836                 <field name="name" type="ATOM" />
1837                 <reply>
1838                         <field name="deviceID" type="CARD8" />
1839                         <field name="name" type="ATOM" />
1840                         <field name="found" type="BOOL" />
1841                         <pad bytes="1" />
1842                         <field name="widthMM" type="CARD16" />
1843                         <field name="heightMM" type="CARD16" />
1844                         <field name="nProperties" type="CARD16" />
1845                         <field name="nColors" type="CARD16" />
1846                         <field name="nShapes" type="CARD16" />
1847                         <field name="nSections" type="CARD16" />
1848                         <field name="nDoodads" type="CARD16" />
1849                         <field name="nKeyAliases" type="CARD16" />
1850                         <field name="baseColorNdx" type="CARD8" />
1851                         <field name="labelColorNdx" type="CARD8" />
1852                         <field name="labelFont" type="CountedString16" />
1853                         <list name="properties" type="Property">
1854                                 <fieldref>nProperties</fieldref>
1855                         </list>
1856                         <list name="colors" type="CountedString16">
1857                                 <fieldref>nColors</fieldref>
1858                         </list>
1859                         <list name="shapes" type="Shape">
1860                                 <fieldref>nShapes</fieldref>
1861                         </list>
1862                         <list name="sections" type="Section">
1863                                 <fieldref>nSections</fieldref>
1864                         </list>
1865                         <list name="doodads" type="Doodad">
1866                                 <fieldref>nDoodads</fieldref>
1867                         </list>
1868                         <list name="keyAliases" type="KeyAlias">
1869                                 <fieldref>nKeyAliases</fieldref>
1870                         </list>
1871                 </reply>
1872         </request>
1873         -->
1874
1875         <!-- XXX: Property and doodads are broken, which renders SetGeometry useless
1876         <request name="SetGeometry" opcode="20">
1877                 <field name="deviceSpec" type="DeviceSpec" />
1878                 <field name="nShapes" type="CARD8" />
1879                 <field name="nSections" type="CARD8" />
1880                 <field name="name" type="ATOM" />
1881                 <field name="widthMM" type="CARD16" />
1882                 <field name="heightMM" type="CARD16" />
1883                 <field name="nProperties" type="CARD16" />
1884                 <field name="nColors" type="CARD16" />
1885                 <field name="nDoodads" type="CARD16" />
1886                 <field name="nKeyAliases" type="CARD16" />
1887                 <field name="baseColorNdx" type="CARD8" />
1888                 <field name="labelColorNdx" type="CARD8" />
1889                 <pad bytes="2" />
1890                 <field name="labelFont" type="CountedString16" />
1891                 <list name="properties" type="Property">
1892                         <fieldref>nProperties</fieldref>
1893                 </list>
1894                 <list name="colors" type="CountedString16">
1895                         <fieldref>nColors</fieldref>
1896                 </list>
1897                 <list name="shapes" type="Shape">
1898                         <fieldref>nShapes</fieldref>
1899                 </list>
1900                 <list name="sections" type="Section">
1901                         <fieldref>nSections</fieldref>
1902                 </list>
1903                 <list name="doodads" type="Doodad">
1904                         <fieldref>nDoodads</fieldref>
1905                 </list>
1906                 <list name="keyAliases" type="KeyAlias">
1907                         <fieldref>nKeyAliases</fieldref>
1908                 </list>
1909         </request>
1910         -->
1911
1912         <request name="PerClientFlags" opcode="21">
1913                 <field name="deviceSpec" type="DeviceSpec" />
1914                 <pad bytes="2" />
1915                 <field name="change" type="CARD32" mask="PerClientFlag" />
1916                 <field name="value" type="CARD32" mask="PerClientFlag" />
1917                 <field name="ctrlsToChange" type="CARD32" mask="BoolCtrl" />
1918                 <field name="autoCtrls" type="CARD32" mask="BoolCtrl" />
1919                 <field name="autoCtrlsValues" type="CARD32" mask="BoolCtrl" />
1920                 <reply>
1921                         <field name="deviceID" type="CARD8"/>
1922                         <field name="supported" type="CARD32" mask="PerClientFlag" />
1923                         <field name="value" type="CARD32" mask="PerClientFlag" />
1924                         <field name="autoCtrls" type="CARD32" mask="BoolCtrl" />
1925                         <field name="autoCtrlsValues" type="CARD32" mask="BoolCtrl" />
1926                         <pad bytes="8" />
1927                 </reply>
1928         </request>
1929
1930         <request name="ListComponents" opcode="22">
1931                 <field name="deviceSpec" type="DeviceSpec" />
1932                 <field name="maxNames" type="CARD16" />
1933                 <!-- XXX: Intermixed fixed size fields and lists are broken
1934                 <field name="keymapsSpecLen" type="CARD8" />
1935                 <list name="keymapsSpec" type="STRING8">
1936                         <fieldref>keymapsSpecLen</fieldref>
1937                 </list>
1938                 <field name="keycodesSpecLen" type="CARD8" />
1939                 <list name="keycodesSpec" type="STRING8">
1940                         <fieldref>keycodesSpecLen</fieldref>
1941                 </list>
1942                 <field name="typesSpecLen" type="CARD8" />
1943                 <list name="typesSpec" type="STRING8">
1944                         <fieldref>typesSpecLen</fieldref>
1945                 </list>
1946                 <field name="compatMapSpecLen" type="CARD8" />
1947                 <list name="compatMapSpec" type="STRING8">
1948                         <fieldref>compatMapSpecLen</fieldref>
1949                 </list>
1950                 <field name="symbolsSpecLen" type="CARD8" />
1951                 <list name="symbolsSpec" type="STRING8">
1952                         <fieldref>symbolsSpecLen</fieldref>
1953                 </list>
1954                 <field name="geometrySpecLen" type="CARD8" />
1955                 <list name="geometrySpec" type="STRING8">
1956                         <fieldref>geometrySpecLen</fieldref>
1957                 </list>
1958                 -->
1959                 <reply>
1960                         <field name="deviceID" type="CARD8" />
1961                         <field name="nKeymaps" type="CARD16" />
1962                         <field name="nKeycodes" type="CARD16" />
1963                         <field name="nTypes" type="CARD16" />
1964                         <field name="nCompatMaps" type="CARD16" />
1965                         <field name="nSymbols" type="CARD16" />
1966                         <field name="nGeometries" type="CARD16" />
1967                         <field name="extra" type="CARD16" />
1968                         <pad bytes="10" />
1969                         <list name="keymaps" type="Listing">
1970                                 <fieldref>nKeymaps</fieldref>
1971                         </list>
1972                         <list name="keycodes" type="Listing">
1973                                 <fieldref>nKeycodes</fieldref>
1974                         </list>
1975                         <list name="types" type="Listing">
1976                                 <fieldref>nTypes</fieldref>
1977                         </list>
1978                         <list name="compatMaps" type="Listing">
1979                                 <fieldref>nCompatMaps</fieldref>
1980                         </list>
1981                         <list name="symbols" type="Listing">
1982                                 <fieldref>nSymbols</fieldref>
1983                         </list>
1984                         <list name="geometries" type="Listing">
1985                                 <fieldref>nGeometries</fieldref>
1986                         </list>
1987                 </reply>
1988         </request>
1989
1990         <request name="GetKbdByName" opcode="23">
1991                 <field name="deviceSpec" type="DeviceSpec" />
1992                 <field name="need" type="CARD16" mask="GBNDetail" />
1993                 <field name="want" type="CARD16" mask="GBNDetail" />
1994                 <field name="load" type="BOOL" />
1995                 <pad bytes="1" />
1996                 <!-- XXX: Intermixed fixed size fields and lists are broken
1997                 <field name="keymapsSpecLen" type="CARD8" />
1998                 <list name="keymapsSpec" type="STRING8">
1999                         <fieldref>keymapsSpecLen</fieldref>
2000                 </list>
2001                 <field name="keycodesSpecLen" type="CARD8" />
2002                 <list name="keycodesSpec" type="STRING8">
2003                         <fieldref>keycodesSpecLen</fieldref>
2004                 </list>
2005                 <field name="typesSpecLen" type="CARD8" />
2006                 <list name="typesSpec" type="STRING8">
2007                         <fieldref>typesSpecLen</fieldref>
2008                 </list>
2009                 <field name="compatMapSpecLen" type="CARD8" />
2010                 <list name="compatMapSpec" type="STRING8">
2011                         <fieldref>compatMapSpecLen</fieldref>
2012                 </list>
2013                 <field name="symbolsSpecLen" type="CARD8" />
2014                 <list name="symbolsSpec" type="STRING8">
2015                         <fieldref>symbolsSpecLen</fieldref>
2016                 </list>
2017                 <field name="geometrySpecLen" type="CARD8" />
2018                 <list name="geometrySpec" type="STRING8">
2019                         <fieldref>geometrySpecLen</fieldref>
2020                 </list>
2021                 -->
2022                 <reply>
2023                         <field name="deviceID" type="CARD8" />
2024                         <field name="minKeyCode" type="KEYCODE" />
2025                         <field name="maxKeyCode" type="KEYCODE" />
2026                         <field name="loaded" type="BOOL" />
2027                         <field name="newKeyboard" type="BOOL" />
2028                         <field name="found" type="CARD16" mask="GBNDetail" />
2029                         <field name="reported" type="CARD16" mask="GBNDetail" />
2030                         <pad bytes="16" />
2031                         <switch name="replies">
2032                                 <fieldref>reported</fieldref>
2033                                 <bitcase name="types">
2034                                         <enumref ref="GBNDetail">Types</enumref>
2035                                         <enumref ref="GBNDetail">ClientSymbols</enumref>
2036                                         <enumref ref="GBNDetail">ServerSymbols</enumref>
2037                                         <!-- from the spec, this has to be a GetMap reply -->
2038                                         <field name="getmap_type" type="CARD8" />
2039                                         <!-- done 'emulating' GetMap reply header-->
2040                                         <field name="typeDeviceID" type="CARD8" />
2041                                         <!-- from the spec, this has to be a GetMap reply -->
2042                                         <field name="getmap_sequence" type="CARD16" />
2043                                         <field name="getmap_length" type="CARD32" />
2044                                         <!-- done 'emulating' GetMap reply header-->
2045                                         <pad bytes="2" />
2046                                         <field name="typeMinKeyCode" type="KEYCODE" />
2047                                         <field name="typeMaxKeyCode" type="KEYCODE" />
2048                                         <field name="present" type="CARD16" mask="MapPart" />
2049                                         <field name="firstType" type="CARD8" />
2050                                         <field name="nTypes" type="CARD8" />
2051                                         <field name="totalTypes" type="CARD8" />
2052                                         <field name="firstKeySym" type="KEYCODE" />
2053                                         <field name="totalSyms" type="CARD16" />
2054                                         <field name="nKeySyms" type="CARD8" />
2055                                         <field name="firstKeyAction" type="KEYCODE" />
2056                                         <field name="totalActions" type="CARD16" />
2057                                         <field name="nKeyActions" type="CARD8" />
2058                                         <field name="firstKeyBehavior" type="KEYCODE" />
2059                                         <field name="nKeyBehaviors" type="CARD8" />
2060                                         <field name="totalKeyBehaviors" type="CARD8" />
2061                                         <field name="firstKeyExplicit" type="KEYCODE" />
2062                                         <field name="nKeyExplicit" type="CARD8" />
2063                                         <field name="totalKeyExplicit" type="CARD8" />
2064                                         <field name="firstModMapKey" type="KEYCODE" />
2065                                         <field name="nModMapKeys" type="CARD8" />
2066                                         <field name="totalModMapKeys" type="CARD8" />
2067                                         <field name="firstVModMapKey" type="KEYCODE" />
2068                                         <field name="nVModMapKeys" type="CARD8" />
2069                                         <field name="totalVModMapKeys" type="CARD8" />
2070                                         <pad bytes="1" />
2071                                         <field name="virtualMods" type="CARD16" mask="VMod" />
2072                                         <switch name="map">
2073                                                 <fieldref>present</fieldref>
2074                                                 <bitcase>
2075                                                         <enumref ref="MapPart">KeyTypes</enumref>
2076                                                         <list name="types_rtrn" type="KeyType">
2077                                                                 <fieldref>nTypes</fieldref>
2078                                                         </list>
2079                                                 </bitcase>
2080                                                 <bitcase>
2081                                                         <enumref ref="MapPart">KeySyms</enumref>
2082                                                         <list name="syms_rtrn" type="KeySymMap">
2083                                                                 <fieldref>nKeySyms</fieldref>
2084                                                         </list>
2085                                                 </bitcase>
2086                                                 <bitcase>
2087                                                         <enumref ref="MapPart">KeyActions</enumref>
2088                                                         <list name="acts_rtrn_count" type="CARD8">
2089                                                                 <fieldref>nKeyActions</fieldref>
2090                                                         </list>
2091                                                         <list name="acts_rtrn_acts" type="Action">
2092                                                                 <fieldref>totalActions</fieldref>
2093                                                         </list>
2094                                                 </bitcase>
2095                                                 <bitcase>
2096                                                         <enumref ref="MapPart">KeyBehaviors</enumref>
2097                                                         <list name="behaviors_rtrn" type="SetBehavior">
2098                                                                 <fieldref>totalKeyBehaviors</fieldref>
2099                                                         </list>
2100                                                 </bitcase>
2101                                                 <bitcase>
2102                                                         <enumref ref="MapPart">VirtualMods</enumref>
2103                                                         <list name="vmods_rtrn" type="CARD8" mask="ModMask">
2104                                                                 <popcount><fieldref>virtualMods</fieldref></popcount>
2105                                                         </list>
2106                                                 </bitcase>
2107                                                 <bitcase>
2108                                                         <enumref ref="MapPart">ExplicitComponents</enumref>
2109                                                         <list name="explicit_rtrn" type="SetExplicit">
2110                                                                 <fieldref>totalKeyExplicit</fieldref>
2111                                                         </list>
2112                                                 </bitcase>
2113                                                 <bitcase>
2114                                                         <enumref ref="MapPart">ModifierMap</enumref>
2115                                                         <list name="modmap_rtrn" type="KeyModMap">
2116                                                                 <fieldref>totalModMapKeys</fieldref>
2117                                                         </list>
2118                                                 </bitcase>
2119                                                 <bitcase>
2120                                                         <enumref ref="MapPart">VirtualModMap</enumref>
2121                                                         <list name="vmodmap_rtrn" type="KeyVModMap">
2122                                                                 <fieldref>totalVModMapKeys</fieldref>
2123                                                         </list>
2124                                                 </bitcase>
2125                                         </switch>
2126                                 </bitcase>
2127                                 <bitcase name="compat_map">
2128                                         <enumref ref="GBNDetail">CompatMap</enumref>
2129                                         <!-- from the spec, this has to include a reply header -->
2130                                         <field name="compatmap_type" type="CARD8" />
2131                                         <field name="compatDeviceID" type="CARD8" />
2132                                         <field name="compatmap_sequence" type="CARD16" />
2133                                         <field name="compatmap_length" type="CARD32" />
2134                                         <!-- done 'emulating' reply header -->
2135                                         <field name="groupsRtrn" type="CARD8" mask="SetOfGroup" />
2136                                         <pad bytes="1" />
2137                                         <field name="firstSIRtrn" type="CARD16" />
2138                                         <field name="nSIRtrn" type="CARD16" />
2139                                         <field name="nTotalSI" type="CARD16" />
2140                                         <pad bytes="16" />
2141                                         <list name="si_rtrn" type="SymInterpret">
2142                                                 <fieldref>nSIRtrn</fieldref>
2143                                         </list>
2144                                         <list name="group_rtrn" type="ModDef">
2145                                                 <popcount>
2146                                                         <fieldref>groupsRtrn</fieldref>
2147                                                 </popcount>
2148                                         </list>
2149                                 </bitcase>
2150                                 <bitcase name="indicator_maps">
2151                                         <enumref ref="GBNDetail">IndicatorMaps</enumref>
2152                                         <!-- from the spec, this has to include a reply header -->
2153                                         <field name="indicatormap_type" type="CARD8" />
2154                                         <field name="indicatorDeviceID" type="CARD8" />
2155                                         <field name="indicatormap_sequence" type="CARD16" />
2156                                         <field name="indicatormap_length" type="CARD32" />
2157                                         <!-- done 'emulating' reply header -->
2158                                         <field name="which" type="CARD32" />
2159                                         <field name="realIndicators" type="CARD32" />
2160                                         <field name="nIndicators" type="CARD8" />
2161                                         <pad bytes="15" />
2162                                         <list name="maps" type="IndicatorMap">
2163                                                 <fieldref>nIndicators</fieldref>
2164                                         </list>
2165                                 </bitcase>
2166                                 <bitcase name="key_names">
2167                                         <enumref ref="GBNDetail">KeyNames</enumref>
2168                                         <enumref ref="GBNDetail">OtherNames</enumref>
2169                                         <!-- from the spec, this has to include a reply header -->
2170                                         <field name="keyname_type" type="CARD8" />
2171                                         <field name="keyDeviceID" type="CARD8" />
2172                                         <field name="keyname_sequence" type="CARD16" />
2173                                         <field name="keyname_length" type="CARD32" />
2174                                         <!-- done 'emulating' reply header -->
2175                                         <field name="which" type="CARD32" mask="NameDetail" />
2176                                         <field name="keyMinKeyCode" type="KEYCODE" />
2177                                         <field name="keyMaxKeyCode" type="KEYCODE" />
2178                                         <field name="nTypes" type="CARD8" />
2179                                         <field name="groupNames" type="CARD8" mask="SetOfGroup" />
2180                                         <field name="virtualMods" type="CARD16" mask="VMod" />
2181                                         <field name="firstKey" type="KEYCODE" />
2182                                         <field name="nKeys" type="CARD8" />
2183                                         <field name="indicators" type="CARD32" />
2184                                         <field name="nRadioGroups" type="CARD8" />
2185                                         <field name="nKeyAliases" type="CARD8" />
2186                                         <field name="nKTLevels" type="CARD16" />
2187                                         <pad bytes="4" />
2188                                         <switch name="valueList">
2189                                                 <fieldref>which</fieldref>
2190                                                 <bitcase>
2191                                                         <enumref ref="NameDetail">Keycodes</enumref>
2192                                                         <field name="keycodesName" type="ATOM" />
2193                                                 </bitcase>
2194                                                 <bitcase>
2195                                                         <enumref ref="NameDetail">Geometry</enumref>
2196                                                         <field name="geometryName" type="ATOM" />
2197                                                 </bitcase>
2198                                                 <bitcase>
2199                                                         <enumref ref="NameDetail">Symbols</enumref>
2200                                                         <field name="symbolsName" type="ATOM" />
2201                                                 </bitcase>
2202                                                 <bitcase>
2203                                                         <enumref ref="NameDetail">PhysSymbols</enumref>
2204                                                         <field name="physSymbolsName" type="ATOM" />
2205                                                 </bitcase>
2206                                                 <bitcase>
2207                                                         <enumref ref="NameDetail">Types</enumref>
2208                                                         <field name="typesName" type="ATOM" />
2209                                                 </bitcase>
2210                                                 <bitcase>
2211                                                         <enumref ref="NameDetail">Compat</enumref>
2212                                                         <field name="compatName" type="ATOM" />
2213                                                 </bitcase>
2214                                                 <bitcase>
2215                                                         <enumref ref="NameDetail">KeyTypeNames</enumref>
2216                                                         <list name="typeNames" type="ATOM">
2217                                                                 <fieldref>nTypes</fieldref>
2218                                                         </list>
2219                                                 </bitcase>
2220                                                 <bitcase>
2221                                                         <enumref ref="NameDetail">KTLevelNames</enumref>
2222                                                         <list name="nLevelsPerType" type="CARD8">
2223                                                                 <fieldref>nTypes</fieldref>
2224                                                         </list>
2225                                                         <list name="ktLevelNames" type="ATOM">
2226                                                                 <sumof ref="nLevelsPerType" />
2227                                                         </list>
2228                                                 </bitcase>
2229                                                 <bitcase>
2230                                                         <enumref ref="NameDetail">IndicatorNames</enumref>
2231                                                         <list name="indicatorNames" type="ATOM">
2232                                                                 <popcount>
2233                                                                         <fieldref>indicators</fieldref>
2234                                                                 </popcount>
2235                                                         </list>
2236                                                 </bitcase>
2237                                                 <bitcase>
2238                                                         <enumref ref="NameDetail">VirtualModNames</enumref>
2239                                                         <list name="virtualModNames" type="ATOM">
2240                                                                 <popcount>
2241                                                                         <fieldref>virtualMods</fieldref>
2242                                                                 </popcount>
2243                                                         </list>
2244                                                 </bitcase>
2245                                                 <bitcase>
2246                                                         <enumref ref="NameDetail">GroupNames</enumref>
2247                                                         <list name="groups" type="ATOM">
2248                                                                 <popcount>
2249                                                                         <fieldref>groupNames</fieldref>
2250                                                                 </popcount>
2251                                                         </list>
2252                                                 </bitcase>
2253                                                 <bitcase>
2254                                                         <enumref ref="NameDetail">KeyNames</enumref>
2255                                                         <list name="keyNames" type="KeyName">
2256                                                                 <fieldref>nKeys</fieldref>
2257                                                         </list>
2258                                                 </bitcase>
2259                                                 <bitcase>
2260                                                         <enumref ref="NameDetail">KeyAliases</enumref>
2261                                                         <list name="keyAliases" type="KeyAlias">
2262                                                                 <fieldref>nKeyAliases</fieldref>
2263                                                         </list>
2264                                                 </bitcase>
2265                                                 <bitcase>
2266                                                         <enumref ref="NameDetail">RGNames</enumref>
2267                                                         <list name="radioGroupNames" type="ATOM">
2268                                                                 <fieldref>nRadioGroups</fieldref>
2269                                                         </list>
2270                                                 </bitcase>
2271                                         </switch>
2272                                 </bitcase>
2273                                 <bitcase name="geometry">
2274                                         <enumref ref="GBNDetail">Geometry</enumref>
2275                                         <!-- from the spec, this has to include a reply header -->
2276                                         <field name="geometry_type" type="CARD8" />
2277                                         <field name="geometryDeviceID" type="CARD8" />
2278                                         <field name="geometry_sequence" type="CARD16" />
2279                                         <field name="geometry_length" type="CARD32" />
2280                                         <!-- done 'emulating' reply header -->
2281                                         <field name="name" type="ATOM" />
2282                                         <field name="geometryFound" type="BOOL" />
2283                                         <pad bytes="1" />
2284                                         <field name="widthMM" type="CARD16" />
2285                                         <field name="heightMM" type="CARD16" />
2286                                         <field name="nProperties" type="CARD16" />
2287                                         <field name="nColors" type="CARD16" />
2288                                         <field name="nShapes" type="CARD16" />
2289                                         <field name="nSections" type="CARD16" />
2290                                         <field name="nDoodads" type="CARD16" />
2291                                         <field name="nKeyAliases" type="CARD16" />
2292                                         <field name="baseColorNdx" type="CARD8" />
2293                                         <field name="labelColorNdx" type="CARD8" />
2294                                         <field name="labelFont" type="CountedString16" />
2295                                         <!-- XXX: Property is broken
2296                                         <list name="properties" type="Property">
2297                                                 <fieldref>nProperties</fieldref>
2298                                         </list>
2299                                         <list name="colors" type="CountedString16">
2300                                                 <fieldref>nColors</fieldref>
2301                                         </list>
2302                                         <list name="shapes" type="Shape">
2303                                                 <fieldref>nShapes</fieldref>
2304                                         </list>
2305                                         -->
2306                                         <!-- XXX: doodads are broken
2307                                         <list name="sections" type="Section">
2308                                                 <fieldref>nSections</fieldref>
2309                                         </list>
2310                                         <list name="doodads" type="Doodad">
2311                                                 <fieldref>nDoodads</fieldref>
2312                                         </list>
2313                                         <list name="keyAliases" type="KeyAlias">
2314                                                 <fieldref>nKeyAliases</fieldref>
2315                                         </list>
2316                                         -->
2317                                 </bitcase>
2318                         </switch>
2319                 </reply>
2320         </request>
2321
2322         <request name="GetDeviceInfo" opcode="24">
2323                 <field name="deviceSpec" type="DeviceSpec" />
2324                 <field name="wanted" type="CARD16" mask="XIFeature" />
2325                 <field name="allButtons" type="BOOL" />
2326                 <field name="firstButton" type="CARD8" />
2327                 <field name="nButtons" type="CARD8" />
2328                 <pad bytes="1" />
2329                 <field name="ledClass" type="LedClassSpec" enum="LedClass" />
2330                 <field name="ledID" type="IDSpec" altenum="ID" />
2331                 <reply>
2332                         <field name="deviceID" type="CARD8" />
2333                         <field name="present" type="CARD16" mask="XIFeature" />
2334                         <field name="supported" type="CARD16" mask="XIFeature" />
2335                         <field name="unsupported" type="CARD16" mask="XIFeature" />
2336                         <field name="nDeviceLedFBs" type="CARD16" />
2337                         <field name="firstBtnWanted" type="CARD8" />
2338                         <field name="nBtnsWanted" type="CARD8" />
2339                         <field name="firstBtnRtrn" type="CARD8" />
2340                         <field name="nBtnsRtrn" type="CARD8" />
2341                         <field name="totalBtns" type="CARD8" />
2342                         <field name="hasOwnState" type="BOOL" />
2343                         <field name="dfltKbdFB" type="CARD16" altenum="ID" />
2344                         <field name="dfltLedFB" type="CARD16" altenum="ID" />
2345                         <pad bytes="2" />
2346                         <field name="devType" type="ATOM" />
2347                         <field name="nameLen" type="CARD16" />
2348                         <list name="name" type="STRING8">
2349                                 <fieldref>nameLen</fieldref>
2350                         </list>
2351                         <list name="btnActions" type="Action">
2352                                 <fieldref>nBtnsRtrn</fieldref>
2353                         </list>
2354                         <list name="leds" type="DeviceLedInfo">
2355                                 <fieldref>nDeviceLedFBs</fieldref>
2356                         </list>
2357                 </reply>
2358         </request>
2359
2360
2361         <request name="SetDeviceInfo" opcode="25">
2362                 <field name="deviceSpec" type="DeviceSpec" />
2363                 <field name="firstBtn" type="CARD8" />
2364                 <field name="nBtns" type="CARD8" />
2365                 <field name="change" type="CARD16" mask="XIFeature" />
2366                 <field name="nDeviceLedFBs" type="CARD16" />
2367                 <list name="btnActions" type="Action">
2368                         <fieldref>nBtns</fieldref>
2369                 </list>
2370                 <list name="leds" type="DeviceLedInfo">
2371                         <fieldref>nDeviceLedFBs</fieldref>
2372                 </list>
2373         </request>
2374
2375         <request name="SetDebuggingFlags" opcode="101">
2376                 <field name="msgLength" type="CARD16" />
2377                 <pad bytes="2" />
2378                 <field name="affectFlags" type="CARD32" />
2379                 <field name="flags" type="CARD32" />
2380                 <field name="affectCtrls" type="CARD32" />
2381                 <field name="ctrls" type="CARD32" />
2382                 <list name="message" type="STRING8">
2383                         <fieldref>msgLength</fieldref>
2384                 </list>
2385                 <reply>
2386                         <pad bytes="1" />
2387                         <field name="currentFlags" type="CARD32" />
2388                         <field name="currentCtrls" type="CARD32" />
2389                         <field name="supportedFlags" type="CARD32" />
2390                         <field name="supportedCtrls" type="CARD32" />
2391                         <pad bytes="8" />
2392                 </reply>
2393         </request>
2394
2395         <!-- Events -->
2396
2397         <event name="NewKeyboardNotify" number="0">
2398                 <field name="xkbType" type="CARD8" />
2399                 <field name="time" type="TIMESTAMP" />
2400                 <field name="deviceID" type="CARD8" />
2401                 <field name="oldDeviceID" type="CARD8" />
2402                 <field name="minKeyCode" type="KEYCODE" />
2403                 <field name="maxKeyCode" type="KEYCODE" />
2404                 <field name="oldMinKeyCode" type="KEYCODE" />
2405                 <field name="oldMaxKeyCode" type="KEYCODE" />
2406                 <field name="requestMajor" type="CARD8" />
2407                 <field name="requestMinor" type="CARD8" />
2408                 <field name="changed" type="CARD16" mask="NKNDetail" />
2409                 <pad bytes="14" />
2410         </event>
2411
2412         <event name="MapNotify" number="1">
2413                 <field name="xkbType" type="CARD8" />
2414                 <field name="time" type="TIMESTAMP" />
2415                 <field name="deviceID" type="CARD8" />
2416                 <field name="ptrBtnActions" type="CARD8" />
2417                 <field name="changed" type="CARD16" mask="MapPart" />
2418                 <field name="minKeyCode" type="KEYCODE" />
2419                 <field name="maxKeyCode" type="KEYCODE" />
2420                 <field name="firstType" type="CARD8" />
2421                 <field name="nTypes" type="CARD8" />
2422                 <field name="firstKeySym" type="KEYCODE" />
2423                 <field name="nKeySyms" type="CARD8" />
2424                 <field name="firstKeyAct" type="KEYCODE" />
2425                 <field name="nKeyActs" type="CARD8" />
2426                 <field name="firstKeyBehavior" type="KEYCODE" />
2427                 <field name="nKeyBehavior" type="CARD8" />
2428                 <field name="firstKeyExplicit" type="KEYCODE" />
2429                 <field name="nKeyExplicit" type="CARD8" />
2430                 <field name="firstModMapKey" type="KEYCODE" />
2431                 <field name="nModMapKeys" type="CARD8" />
2432                 <field name="firstVModMapKey" type="KEYCODE" />
2433                 <field name="nVModMapKeys" type="CARD8" />
2434                 <field name="virtualMods" type="CARD16" mask="VMod" />
2435                 <pad bytes="2" />
2436         </event>
2437
2438         <event name="StateNotify" number="2">
2439                 <field name="xkbType" type="CARD8" />
2440                 <field name="time" type="TIMESTAMP" />
2441                 <field name="deviceID" type="CARD8" />
2442                 <field name="mods" type="CARD8" mask="ModMask" />
2443                 <field name="baseMods" type="CARD8" mask="ModMask" />
2444                 <field name="latchedMods" type="CARD8" mask="ModMask" />
2445                 <field name="lockedMods" type="CARD8" mask="ModMask" />
2446                 <field name="group" type="CARD8" enum="Group" />
2447                 <field name="baseGroup" type="INT16" />
2448                 <field name="latchedGroup" type="INT16" />
2449                 <field name="lockedGroup" type="CARD8" enum="Group" />
2450                 <field name="compatState" type="CARD8" mask="ModMask" />
2451                 <field name="grabMods" type="CARD8" mask="ModMask" />
2452                 <field name="compatGrabMods" type="CARD8" mask="ModMask" />
2453                 <field name="lookupMods" type="CARD8" mask="ModMask" />
2454                 <field name="compatLoockupMods" type="CARD8" mask="ModMask" />
2455                 <field name="ptrBtnState" type="CARD16" mask="KeyButMask" />
2456                 <field name="changed" type="CARD16" mask="StatePart" />
2457                 <field name="keycode" type="KEYCODE" />
2458                 <field name="eventType" type="CARD8" />
2459                 <field name="requestMajor" type="CARD8" />
2460                 <field name="requestMinor" type="CARD8" />
2461         </event>
2462
2463         <event name="ControlsNotify" number="3">
2464                 <field name="xkbType" type="CARD8" />
2465                 <field name="time" type="TIMESTAMP" />
2466                 <field name="deviceID" type="CARD8" />
2467                 <field name="numGroups" type="CARD8" />
2468                 <pad bytes="2" />
2469                 <field name="changedControls" type="CARD32" mask="Control" />
2470                 <field name="enabledControls" type="CARD32" mask="BoolCtrl" />
2471                 <field name="enabledControlChanges" type="CARD32" mask="BoolCtrl" />
2472                 <field name="keycode" type="KEYCODE" />
2473                 <field name="eventType" type="CARD8" />
2474                 <field name="requestMajor" type="CARD8" />
2475                 <field name="requestMinor" type="CARD8" />
2476                 <pad bytes="4" />
2477         </event>
2478
2479         <event name="IndicatorStateNotify" number="4">
2480                 <field name="xkbType" type="CARD8" />
2481                 <field name="time" type="TIMESTAMP" />
2482                 <field name="deviceID" type="CARD8" />
2483                 <pad bytes="3" />
2484                 <field name="state" type="CARD32" />
2485                 <field name="stateChanged" type="CARD32" />
2486                 <pad bytes="12" />
2487         </event>
2488
2489         <event name="IndicatorMapNotify" number="5">
2490                 <field name="xkbType" type="CARD8" />
2491                 <field name="time" type="TIMESTAMP" />
2492                 <field name="deviceID" type="CARD8" />
2493                 <pad bytes="3" />
2494                 <field name="state" type="CARD32" />
2495                 <field name="mapChanged" type="CARD32" />
2496                 <pad bytes="12" />
2497         </event>
2498
2499         <event name="NamesNotify" number="6">
2500                 <field name="xkbType" type="CARD8" />
2501                 <field name="time" type="TIMESTAMP" />
2502                 <field name="deviceID" type="CARD8" />
2503                 <pad bytes="1" />
2504                 <field name="changed" type="CARD16" mask="NameDetail" />
2505                 <field name="firstType" type="CARD8" />
2506                 <field name="nTypes" type="CARD8" />
2507                 <field name="firstLevelName" type="CARD8" />
2508                 <field name="nLevelNames" type="CARD8" />
2509                 <pad bytes="1" />
2510                 <field name="nRadioGroups" type="CARD8" />
2511                 <field name="nKeyAliases" type="CARD8" />
2512                 <field name="changedGroupNames" type="CARD8" mask="SetOfGroup" />
2513                 <field name="changedVirtualMods" type="CARD16" mask="VMod" />
2514                 <field name="firstKey" type="KEYCODE" />
2515                 <field name="nKeys" type="CARD8" />
2516                 <field name="changedIndicators" type="CARD32" />
2517                 <pad bytes="4" />
2518         </event>
2519
2520         <event name="CompatMapNotify" number="7">
2521                 <field name="xkbType" type="CARD8" />
2522                 <field name="time" type="TIMESTAMP" />
2523                 <field name="deviceID" type="CARD8" />
2524                 <field name="changedGroups" type="CARD8" mask="SetOfGroup" />
2525                 <field name="firstSI" type="CARD16" />
2526                 <field name="nSI" type="CARD16" />
2527                 <field name="nTotalSI" type="CARD16" />
2528                 <pad bytes="16" />
2529         </event>
2530
2531         <event name="BellNotify" number="8">
2532                 <field name="xkbType" type="CARD8" />
2533                 <field name="time" type="TIMESTAMP" />
2534                 <field name="deviceID" type="CARD8" />
2535                 <field name="bellClass" type="CARD8" enum="BellClassResult" />
2536                 <field name="bellID" type="CARD8" />
2537                 <field name="percent" type="CARD8" />
2538                 <field name="pitch" type="CARD16" />
2539                 <field name="duration" type="CARD16" />
2540                 <field name="name" type="ATOM" />
2541                 <field name="window" type="WINDOW" />
2542                 <field name="eventOnly" type="BOOL" />
2543                 <pad bytes="7" />
2544         </event>
2545
2546         <event name="ActionMessage" number="9">
2547                 <field name="xkbType" type="CARD8" />
2548                 <field name="time" type="TIMESTAMP" />
2549                 <field name="deviceID" type="CARD8" />
2550                 <field name="keycode" type="KEYCODE" />
2551                 <field name="press" type="BOOL" />
2552                 <field name="keyEventFollows" type="BOOL" />
2553                 <field name="mods" type="CARD8" mask="ModMask" />
2554                 <field name="group" type="CARD8" enum="Group" />
2555                 <list name="message" type="STRING8">
2556                         <value>8</value>
2557                 </list>
2558                 <pad bytes="10" />
2559         </event>
2560
2561         <event name="AccessXNotify" number="10">
2562                 <field name="xkbType" type="CARD8" />
2563                 <field name="time" type="TIMESTAMP" />
2564                 <field name="deviceID" type="CARD8" />
2565                 <field name="keycode" type="KEYCODE" />
2566                 <field name="detailt" type="CARD16" mask="AXNDetail" />
2567                 <field name="slowKeysDelay" type="CARD16" />
2568                 <field name="debounceDelay" type="CARD16" />
2569                 <pad bytes="16" />
2570         </event>
2571
2572         <event name="ExtensionDeviceNotify" number="11">
2573                 <field name="xkbType" type="CARD8" />
2574                 <field name="time" type="TIMESTAMP" />
2575                 <field name="deviceID" type="CARD8" />
2576                 <pad bytes="1" />
2577                 <field name="reason" type="CARD16" mask="XIFeature" />
2578                 <field name="ledClass" type="CARD16" enum="LedClassResult" />
2579                 <field name="ledID" type="CARD16" />
2580                 <field name="ledsDefined" type="CARD32" />
2581                 <field name="ledState" type="CARD32" />
2582                 <field name="firstButton" type="CARD8" />
2583                 <field name="nButtons" type="CARD8" />
2584                 <field name="supported" type="CARD16" mask="XIFeature" />
2585                 <field name="unsupported" type="CARD16" mask="XIFeature" />
2586                 <pad bytes="2" />
2587         </event>
2588 </xcb>