1 /************************************************************
2 Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
3 
4 Permission to use, copy, modify, and distribute this
5 software and its documentation for any purpose and without
6 fee is hereby granted, provided that the above copyright
7 notice appear in all copies and that both that copyright
8 notice and this permission notice appear in supporting
9 documentation, and that the name of Silicon Graphics not be
10 used in advertising or publicity pertaining to distribution
11 of the software without specific prior written permission.
12 Silicon Graphics makes no representation about the suitability
13 of this software for any purpose. It is provided "as is"
14 without any express or implied warranty.
15 
16 SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
17 SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
18 AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
19 GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
20 DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
21 DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
22 OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION  WITH
23 THE USE OR PERFORMANCE OF THIS SOFTWARE.
24 
25 ********************************************************/
26 
27 #ifndef _XKBPROTO_H_
28 #define	_XKBPROTO_H_
29 
30 #include <X11/Xmd.h>
31 #include <X11/extensions/XKB.h>
32 
33 #define Window CARD32
34 #define Atom CARD32
35 #define Time CARD32
36 #define KeyCode CARD8
37 #define KeySym CARD32
38 
39 #define	XkbPaddedSize(n)	((((unsigned int)(n)+3) >> 2) << 2)
40 
41 typedef struct _xkbUseExtension {
42     CARD8	reqType;
43     CARD8	xkbReqType;	/* always X_KBUseExtension */
44     CARD16	length B16;
45     CARD16	wantedMajor B16;
46     CARD16	wantedMinor B16;
47 } xkbUseExtensionReq;
48 #define	sz_xkbUseExtensionReq	8
49 
50 typedef struct _xkbUseExtensionReply {
51     BYTE	type;		/* X_Reply */
52     BOOL	supported;
53     CARD16	sequenceNumber B16;
54     CARD32	length B32;
55     CARD16	serverMajor B16;
56     CARD16	serverMinor B16;
57     CARD32	pad1 B32;
58     CARD32	pad2 B32;
59     CARD32	pad3 B32;
60     CARD32	pad4 B32;
61     CARD32	pad5 B32;
62 } xkbUseExtensionReply;
63 #define	sz_xkbUseExtensionReply	32
64 
65 typedef	struct _xkbSelectEvents {
66     CARD8	reqType;
67     CARD8	xkbReqType;	/* X_KBSelectEvents */
68     CARD16	length B16;
69     CARD16	deviceSpec B16;
70     CARD16	affectWhich B16;
71     CARD16	clear B16;
72     CARD16	selectAll B16;
73     CARD16	affectMap B16;
74     CARD16	map B16;
75 } xkbSelectEventsReq;
76 #define	sz_xkbSelectEventsReq	16
77 
78 typedef struct _xkbBell {
79     CARD8	reqType;
80     CARD8	xkbReqType;	/* X_KBBell */
81     CARD16	length B16;
82     CARD16	deviceSpec B16;
83     CARD16	bellClass B16;
84     CARD16	bellID B16;
85     INT8	percent;
86     BOOL	forceSound;
87     BOOL	eventOnly;
88     CARD8	pad1;
89     INT16	pitch B16;
90     INT16	duration B16;
91     CARD16	pad2 B16;
92     Atom	name B32;
93     Window	window B32;
94 } xkbBellReq;
95 #define	sz_xkbBellReq		28
96 
97 typedef struct _xkbGetState {
98 	CARD8		reqType;
99 	CARD8		xkbReqType;	/* always X_KBGetState */
100 	CARD16		length B16;
101 	CARD16		deviceSpec B16;
102 	CARD16		pad B16;
103 } xkbGetStateReq;
104 #define	sz_xkbGetStateReq	8
105 
106 typedef	struct _xkbGetStateReply {
107     BYTE	type;
108     BYTE	deviceID;
109     CARD16	sequenceNumber B16;
110     CARD32	length B32;
111     CARD8	mods;
112     CARD8	baseMods;
113     CARD8	latchedMods;
114     CARD8	lockedMods;
115     CARD8	group;
116     CARD8	lockedGroup;
117     INT16	baseGroup B16;
118     INT16	latchedGroup B16;
119     CARD8	compatState;
120     CARD8	grabMods;
121     CARD8	compatGrabMods;
122     CARD8	lookupMods;
123     CARD8	compatLookupMods;
124     CARD8	pad1;
125     CARD16	ptrBtnState B16;
126     CARD16	pad2 B16;
127     CARD32	pad3 B32;
128 } xkbGetStateReply;
129 #define	sz_xkbGetStateReply	32
130 
131 typedef struct _xkbLatchLockState {
132     CARD8	reqType;
133     CARD8	xkbReqType;	/* always X_KBLatchLockState */
134     CARD16	length B16;
135     CARD16	deviceSpec B16;
136     CARD8	affectModLocks;
137     CARD8	modLocks;
138     BOOL	lockGroup;
139     CARD8	groupLock;
140     CARD8	affectModLatches;
141     CARD8	modLatches;
142     CARD8	pad;
143     BOOL	latchGroup;
144     INT16	groupLatch B16;
145 } xkbLatchLockStateReq;
146 #define	sz_xkbLatchLockStateReq		16
147 
148 typedef struct _xkbGetControls {
149     CARD8	reqType;
150     CARD8	xkbReqType;	/* always X_KBGetControls */
151     CARD16	length B16;
152     CARD16	deviceSpec B16;
153     CARD16	pad B16;
154 } xkbGetControlsReq;
155 #define	sz_xkbGetControlsReq	8
156 
157 typedef struct _xkbGetControlsReply {
158     BYTE	type;		/* X_Reply */
159     CARD8	deviceID;
160     CARD16	sequenceNumber B16;
161     CARD32	length B32;
162     CARD8	mkDfltBtn;
163     CARD8	numGroups;
164     CARD8	groupsWrap;
165     CARD8	internalMods;
166     CARD8	ignoreLockMods;
167     CARD8	internalRealMods;
168     CARD8	ignoreLockRealMods;
169     CARD8	pad1;
170     CARD16	internalVMods B16;
171     CARD16	ignoreLockVMods B16;
172     CARD16	repeatDelay B16;
173     CARD16	repeatInterval B16;
174     CARD16	slowKeysDelay B16;
175     CARD16	debounceDelay B16;
176     CARD16	mkDelay B16;
177     CARD16	mkInterval B16;
178     CARD16	mkTimeToMax B16;
179     CARD16	mkMaxSpeed B16;
180     INT16	mkCurve B16;
181     CARD16	axOptions B16;
182     CARD16	axTimeout B16;
183     CARD16	axtOptsMask B16;
184     CARD16	axtOptsValues B16;
185     CARD16	pad2 B16;
186     CARD32	axtCtrlsMask B32;
187     CARD32	axtCtrlsValues B32;
188     CARD32	enabledCtrls B32;
189     BYTE	perKeyRepeat[XkbPerKeyBitArraySize];
190 } xkbGetControlsReply;
191 #define	sz_xkbGetControlsReply	92
192 
193 typedef struct _xkbSetControls {
194     CARD8	reqType;
195     CARD8	xkbReqType;	/* always X_KBSetControls */
196     CARD16	length B16;
197     CARD16	deviceSpec B16;
198     CARD8	affectInternalMods;
199     CARD8	internalMods;
200     CARD8	affectIgnoreLockMods;
201     CARD8	ignoreLockMods;
202     CARD16	affectInternalVMods B16;
203     CARD16	internalVMods B16;
204     CARD16	affectIgnoreLockVMods B16;
205     CARD16	ignoreLockVMods B16;
206     CARD8	mkDfltBtn;
207     CARD8	groupsWrap;
208     CARD16	axOptions B16;
209     CARD16	pad1 B16;
210     CARD32	affectEnabledCtrls B32;
211     CARD32	enabledCtrls B32;
212     CARD32	changeCtrls B32;
213     CARD16	repeatDelay B16;
214     CARD16	repeatInterval B16;
215     CARD16	slowKeysDelay B16;
216     CARD16	debounceDelay B16;
217     CARD16	mkDelay B16;
218     CARD16	mkInterval B16;
219     CARD16	mkTimeToMax B16;
220     CARD16	mkMaxSpeed B16;
221     INT16	mkCurve B16;
222     CARD16	axTimeout B16;
223     CARD32	axtCtrlsMask B32;
224     CARD32	axtCtrlsValues B32;
225     CARD16	axtOptsMask B16;
226     CARD16	axtOptsValues B16;
227     BYTE	perKeyRepeat[XkbPerKeyBitArraySize];
228 } xkbSetControlsReq;
229 #define	sz_xkbSetControlsReq	100
230 
231 typedef	struct _xkbKTMapEntryWireDesc {
232     BOOL	active;
233     CARD8	mask;
234     CARD8	level;
235     CARD8	realMods;
236     CARD16	virtualMods B16;
237     CARD16	pad B16;
238 } xkbKTMapEntryWireDesc;
239 #define sz_xkbKTMapEntryWireDesc	8
240 
241 typedef struct _xkbKTSetMapEntryWireDesc {
242     CARD8	level;
243     CARD8	realMods;
244     CARD16	virtualMods B16;
245 } xkbKTSetMapEntryWireDesc;
246 #define	sz_xkbKTSetMapEntryWireDesc	4
247 
248 typedef struct _xkbModsWireDesc {
249     CARD8	mask;		/* GetMap only */
250     CARD8	realMods;
251     CARD16	virtualMods B16;
252 } xkbModsWireDesc;
253 #define	sz_xkbModsWireDesc	4
254 
255 typedef struct _xkbKeyTypeWireDesc {
256     CARD8	mask;
257     CARD8	realMods;
258     CARD16	virtualMods B16;
259     CARD8	numLevels;
260     CARD8	nMapEntries;
261     BOOL	preserve;
262     CARD8	pad;
263 } xkbKeyTypeWireDesc;
264 #define	sz_xkbKeyTypeWireDesc	8
265 
266 typedef struct _xkbSymMapWireDesc {
267     CARD8	ktIndex[XkbNumKbdGroups];
268     CARD8	groupInfo;
269     CARD8	width;
270     CARD16	nSyms B16;
271 } xkbSymMapWireDesc;
272 #define	sz_xkbSymMapWireDesc	8
273 
274 typedef struct _xkbVModMapWireDesc {
275     KeyCode	key;
276     CARD8	pad;
277     CARD16	vmods B16;
278 } xkbVModMapWireDesc;
279 #define	sz_xkbVModMapWireDesc	4
280 
281 typedef struct _xkbBehaviorWireDesc {
282 	CARD8	key;
283 	CARD8	type;
284 	CARD8	data;
285 	CARD8	pad;
286 } xkbBehaviorWireDesc;
287 #define	sz_xkbBehaviorWireDesc	4
288 
289 typedef	struct _xkbActionWireDesc {
290     CARD8	type;
291     CARD8	data[7];
292 } xkbActionWireDesc;
293 #define	sz_xkbActionWireDesc	8
294 
295 typedef struct _xkbGetMap {
296     CARD8	reqType;
297     CARD8	xkbReqType;	/* always X_KBGetMap */
298     CARD16	length B16;
299     CARD16	deviceSpec B16;
300     CARD16	full B16;
301     CARD16	partial B16;
302     CARD8	firstType;
303     CARD8	nTypes;
304     KeyCode	firstKeySym;
305     CARD8	nKeySyms;
306     KeyCode	firstKeyAct;
307     CARD8	nKeyActs;
308     KeyCode	firstKeyBehavior;
309     CARD8	nKeyBehaviors;
310     CARD16	virtualMods B16;
311     KeyCode	firstKeyExplicit;
312     CARD8	nKeyExplicit;
313     KeyCode	firstModMapKey;
314     CARD8	nModMapKeys;
315     KeyCode	firstVModMapKey;
316     CARD8	nVModMapKeys;
317     CARD16	pad1 B16;
318 } xkbGetMapReq;
319 #define	sz_xkbGetMapReq	28
320 
321 typedef struct _xkbGetMapReply {
322     CARD8	type;		/* always X_Reply */
323     CARD8	deviceID;
324     CARD16	sequenceNumber B16;
325     CARD32	length B32;
326     CARD16	pad1 B16;
327     KeyCode	minKeyCode;
328     KeyCode	maxKeyCode;
329     CARD16	present B16;
330     CARD8	firstType;
331     CARD8	nTypes;
332     CARD8	totalTypes;
333     KeyCode	firstKeySym;
334     CARD16	totalSyms B16;
335     CARD8	nKeySyms;
336     KeyCode	firstKeyAct;
337     CARD16	totalActs B16;
338     CARD8	nKeyActs;
339     KeyCode	firstKeyBehavior;
340     CARD8	nKeyBehaviors;
341     CARD8	totalKeyBehaviors;
342     KeyCode	firstKeyExplicit;
343     CARD8	nKeyExplicit;
344     CARD8	totalKeyExplicit;
345     KeyCode	firstModMapKey;
346     CARD8	nModMapKeys;
347     CARD8	totalModMapKeys;
348     KeyCode	firstVModMapKey;
349     CARD8	nVModMapKeys;
350     CARD8	totalVModMapKeys;
351     CARD8	pad2;
352     CARD16	virtualMods B16;
353 } xkbGetMapReply;
354 #define	sz_xkbGetMapReply		40
355 
356 #define	XkbSetMapResizeTypes		(1L<<0)
357 #define	XkbSetMapRecomputeActions	(1L<<1)
358 #define	XkbSetMapAllFlags		(0x3)
359 
360 typedef struct _xkbSetMap {
361     CARD8	reqType;
362     CARD8	xkbReqType;	/* always X_KBSetMap */
363     CARD16	length B16;
364     CARD16	deviceSpec B16;
365     CARD16	present B16;
366     CARD16	flags B16;
367     KeyCode	minKeyCode;
368     KeyCode	maxKeyCode;
369     CARD8	firstType;
370     CARD8	nTypes;
371     KeyCode	firstKeySym;
372     CARD8	nKeySyms;
373     CARD16	totalSyms B16;
374     KeyCode	firstKeyAct;
375     CARD8	nKeyActs;
376     CARD16	totalActs B16;
377     KeyCode	firstKeyBehavior;
378     CARD8	nKeyBehaviors;
379     CARD8	totalKeyBehaviors;
380     KeyCode	firstKeyExplicit;
381     CARD8	nKeyExplicit;
382     CARD8	totalKeyExplicit;
383     KeyCode	firstModMapKey;
384     CARD8	nModMapKeys;
385     CARD8	totalModMapKeys;
386     KeyCode	firstVModMapKey;
387     CARD8	nVModMapKeys;
388     CARD8	totalVModMapKeys;
389     CARD16	virtualMods B16;
390 } xkbSetMapReq;
391 #define	sz_xkbSetMapReq	36
392 
393 typedef struct _xkbSymInterpretWireDesc {
394     CARD32		sym B32;
395     CARD8		mods;
396     CARD8		match;
397     CARD8		virtualMod;
398     CARD8		flags;
399     xkbActionWireDesc	act;
400 } xkbSymInterpretWireDesc;
401 #define	sz_xkbSymInterpretWireDesc	16
402 
403 typedef struct _xkbGetCompatMap {
404     CARD8	reqType;
405     CARD8	xkbReqType;	/* always X_KBGetCompatMap */
406     CARD16	length B16;
407     CARD16	deviceSpec B16;
408     CARD8	groups;
409     BOOL	getAllSI;
410     CARD16	firstSI B16;
411     CARD16	nSI B16;
412 } xkbGetCompatMapReq;
413 #define	sz_xkbGetCompatMapReq	12
414 
415 typedef struct _xkbGetCompatMapReply {
416     CARD8	type;		/* always X_Reply */
417     CARD8	deviceID;
418     CARD16	sequenceNumber B16;
419     CARD32	length B32;
420     CARD8	groups;
421     CARD8	pad1;
422     CARD16	firstSI B16;
423     CARD16	nSI B16;
424     CARD16	nTotalSI B16;
425     CARD32	pad2 B32;
426     CARD32	pad3 B32;
427     CARD32	pad4 B32;
428     CARD32	pad5 B32;
429 } xkbGetCompatMapReply;
430 #define	sz_xkbGetCompatMapReply		32
431 
432 typedef struct _xkbSetCompatMap {
433     CARD8	reqType;
434     CARD8	xkbReqType;	/* always X_KBSetCompatMap */
435     CARD16	length B16;
436     CARD16	deviceSpec B16;
437     CARD8	pad1;
438     BOOL	recomputeActions;
439     BOOL	truncateSI;
440     CARD8	groups;
441     CARD16	firstSI B16;
442     CARD16	nSI B16;
443     CARD16	pad2 B16;
444 } xkbSetCompatMapReq;
445 #define	sz_xkbSetCompatMapReq	16
446 
447 typedef struct _xkbGetIndicatorState {
448     CARD8	reqType;
449     CARD8	xkbReqType;	/* always X_KBGetIndicatorState */
450     CARD16	length B16;
451     CARD16	deviceSpec B16;
452     CARD16	pad1 B16;
453 } xkbGetIndicatorStateReq;
454 #define	sz_xkbGetIndicatorStateReq	8
455 
456 typedef struct _xkbGetIndicatorStateReply {
457     CARD8	type;		/* always X_Reply */
458     CARD8	deviceID;
459     CARD16	sequenceNumber B16;
460     CARD32	length B32;
461     CARD32	state B32;
462     CARD32	pad1 B32;
463     CARD32	pad2 B32;
464     CARD32	pad3 B32;
465     CARD32	pad4 B32;
466     CARD32	pad5 B32;
467 } xkbGetIndicatorStateReply;
468 #define	sz_xkbGetIndicatorStateReply	32
469 
470 typedef struct _xkbGetIndicatorMap {
471     CARD8	reqType;
472     CARD8	xkbReqType;	/* always X_KBGetIndicatorMap */
473     CARD16	length B16;
474     CARD16	deviceSpec B16;
475     CARD16	pad B16;
476     CARD32	which B32;
477 } xkbGetIndicatorMapReq;
478 #define	sz_xkbGetIndicatorMapReq	12
479 
480 typedef struct _xkbGetIndicatorMapReply {
481     CARD8	type;		/* always X_Reply */
482     CARD8	deviceID;
483     CARD16	sequenceNumber B16;
484     CARD32	length B32;
485     CARD32	which B32;
486     CARD32	realIndicators B32;
487     CARD8	nIndicators;
488     CARD8	pad1;
489     CARD16	pad2 B16;
490     CARD32	pad3 B32;
491     CARD32	pad4 B32;
492     CARD32	pad5 B32;
493 } xkbGetIndicatorMapReply;
494 #define	sz_xkbGetIndicatorMapReply	32
495 
496 typedef struct _xkbIndicatorMapWireDesc {
497     CARD8	flags;
498     CARD8	whichGroups;
499     CARD8	groups;
500     CARD8	whichMods;
501     CARD8	mods;
502     CARD8	realMods;
503     CARD16	virtualMods B16;
504     CARD32	ctrls B32;
505 } xkbIndicatorMapWireDesc;
506 #define	sz_xkbIndicatorMapWireDesc	12
507 
508 typedef struct _xkbSetIndicatorMap {
509     CARD8	reqType;
510     CARD8	xkbReqType;	/* always X_KBSetIndicatorMap */
511     CARD16	length B16;
512     CARD16	deviceSpec B16;
513     CARD16	pad1 B16;
514     CARD32	which B32;
515 } xkbSetIndicatorMapReq;
516 #define	sz_xkbSetIndicatorMapReq	12
517 
518 typedef struct _xkbGetNamedIndicator {
519     CARD8	reqType;
520     CARD8	xkbReqType;	/* X_KBGetNamedIndicator */
521     CARD16	length B16;
522     CARD16	deviceSpec B16;
523     CARD16	ledClass B16;
524     CARD16	ledID B16;
525     CARD16	pad1 B16;
526     Atom	indicator B32;
527 } xkbGetNamedIndicatorReq;
528 #define	sz_xkbGetNamedIndicatorReq		16
529 
530 typedef	struct _xkbGetNamedIndicatorReply {
531     BYTE	type;
532     BYTE	deviceID;
533     CARD16	sequenceNumber B16;
534     CARD32	length B32;
535     Atom	indicator B32;
536     BOOL	found;
537     BOOL	on;
538     BOOL	realIndicator;
539     CARD8	ndx;
540     CARD8	flags;
541     CARD8	whichGroups;
542     CARD8	groups;
543     CARD8	whichMods;
544     CARD8	mods;
545     CARD8	realMods;
546     CARD16	virtualMods B16;
547     CARD32	ctrls B32;
548     BOOL	supported;
549     CARD8	pad1;
550     CARD16	pad2 B16;
551 } xkbGetNamedIndicatorReply;
552 #define	sz_xkbGetNamedIndicatorReply	32
553 
554 typedef struct _xkbSetNamedIndicator {
555     CARD8	reqType;
556     CARD8	xkbReqType;	/* X_KBSetNamedIndicator */
557     CARD16	length B16;
558     CARD16	deviceSpec B16;
559     CARD16	ledClass B16;
560     CARD16	ledID B16;
561     CARD16	pad1 B16;
562     Atom	indicator B32;
563     BOOL	setState;
564     BOOL	on;
565     BOOL	setMap;
566     BOOL	createMap;
567     CARD8	pad2;
568     CARD8	flags;
569     CARD8	whichGroups;
570     CARD8	groups;
571     CARD8	whichMods;
572     CARD8	realMods;
573     CARD16	virtualMods B16;
574     CARD32	ctrls B32;
575 } xkbSetNamedIndicatorReq;
576 #define	sz_xkbSetNamedIndicatorReq	32
577 
578 typedef struct _xkbGetNames {
579     CARD8	reqType;
580     CARD8	xkbReqType;	/* always X_KBGetNames */
581     CARD16	length B16;
582     CARD16	deviceSpec B16;
583     CARD16	pad B16;
584     CARD32	which B32;
585 } xkbGetNamesReq;
586 #define	sz_xkbGetNamesReq		12
587 
588 typedef	struct _xkbGetNamesReply {
589     BYTE	type;
590     BYTE	deviceID;
591     CARD16	sequenceNumber B16;
592     CARD32	length B32;
593     CARD32	which B32;
594     KeyCode	minKeyCode;
595     KeyCode	maxKeyCode;
596     CARD8	nTypes;
597     CARD8	groupNames;
598     CARD16	virtualMods B16;
599     KeyCode	firstKey;
600     CARD8	nKeys;
601     CARD32	indicators B32;
602     CARD8	nRadioGroups;
603     CARD8	nKeyAliases;
604     CARD16	nKTLevels B16;
605     CARD32	pad3 B32;
606 } xkbGetNamesReply;
607 #define	sz_xkbGetNamesReply	32
608 
609 typedef struct _xkbSetNames {
610     CARD8	reqType;
611     CARD8	xkbReqType;	/* always X_KBSetNames */
612     CARD16	length B16;
613     CARD16	deviceSpec B16;
614     CARD16	virtualMods B16;
615     CARD32	which B32;
616     CARD8	firstType;
617     CARD8	nTypes;
618     CARD8	firstKTLevel;
619     CARD8	nKTLevels;
620     CARD32	indicators B32;
621     CARD8	groupNames;
622     CARD8	nRadioGroups;
623     KeyCode	firstKey;
624     CARD8	nKeys;
625     CARD8	nKeyAliases;
626     CARD8	pad1;
627     CARD16	totalKTLevelNames B16;
628 } xkbSetNamesReq;
629 #define	sz_xkbSetNamesReq	28
630 
631 typedef struct _xkbPointWireDesc {
632     INT16	x B16;
633     INT16	y B16;
634 } xkbPointWireDesc;
635 #define	sz_xkbPointWireDesc	4
636 
637 typedef struct _xkbOutlineWireDesc {
638     CARD8	nPoints;
639     CARD8	cornerRadius;
640     CARD16	pad B16;
641 } xkbOutlineWireDesc;
642 #define	sz_xkbOutlineWireDesc	4
643 
644 typedef struct _xkbShapeWireDesc {
645     Atom	name B32;
646     CARD8	nOutlines;
647     CARD8	primaryNdx;
648     CARD8	approxNdx;
649     CARD8	pad;
650 } xkbShapeWireDesc;
651 #define	sz_xkbShapeWireDesc	8
652 
653 typedef struct _xkbSectionWireDesc {
654     Atom	name B32;
655     INT16	top B16;
656     INT16	left B16;
657     CARD16	width B16;
658     CARD16	height B16;
659     INT16	angle B16;
660     CARD8	priority;
661     CARD8	nRows;
662     CARD8	nDoodads;
663     CARD8	nOverlays;
664     CARD16	pad B16;
665 } xkbSectionWireDesc;
666 #define	sz_xkbSectionWireDesc	20
667 
668 typedef struct _xkbRowWireDesc {
669     INT16	top B16;
670     INT16	left B16;
671     CARD8	nKeys;
672     BOOL	vertical;
673     CARD16	pad B16;
674 } xkbRowWireDesc;
675 #define	sz_xkbRowWireDesc	8
676 
677 typedef struct _xkbKeyWireDesc {
678     CARD8	name[XkbKeyNameLength];
679     INT16	gap B16;
680     CARD8	shapeNdx;
681     CARD8	colorNdx;
682 } xkbKeyWireDesc;
683 #define	sz_xkbKeyWireDesc	8
684 
685 typedef struct _xkbOverlayWireDesc {
686     Atom	name B32;
687     CARD8	nRows;
688     CARD8	pad1;
689     CARD16	pad2 B16;
690 } xkbOverlayWireDesc;
691 #define	sz_xkbOverlayWireDesc	8
692 
693 typedef struct _xkbOverlayRowWireDesc {
694    CARD8	rowUnder;
695    CARD8	nKeys;
696    CARD16	pad1 B16;
697 } xkbOverlayRowWireDesc;
698 #define	sz_xkbOverlayRowWireDesc	4
699 
700 typedef struct _xkbOverlayKeyWireDesc {
701    CARD8	over[XkbKeyNameLength];
702    CARD8	under[XkbKeyNameLength];
703 } xkbOverlayKeyWireDesc;
704 #define	sz_xkbOverlayKeyWireDesc	8
705 
706 typedef struct _xkbShapeDoodadWireDesc {
707     Atom	name B32;
708     CARD8	type;
709     CARD8	priority;
710     INT16	top B16;
711     INT16	left B16;
712     INT16	angle B16;
713     CARD8	colorNdx;
714     CARD8	shapeNdx;
715     CARD16	pad1 B16;
716     CARD32	pad2 B32;
717 } xkbShapeDoodadWireDesc;
718 #define	sz_xkbShapeDoodadWireDesc	20
719 
720 typedef struct _xkbTextDoodadWireDesc {
721     Atom	name B32;
722     CARD8	type;
723     CARD8	priority;
724     INT16	top B16;
725     INT16	left B16;
726     INT16	angle B16;
727     CARD16	width B16;
728     CARD16	height B16;
729     CARD8	colorNdx;
730     CARD8	pad1;
731     CARD16	pad2 B16;
732 } xkbTextDoodadWireDesc;
733 #define	sz_xkbTextDoodadWireDesc	20
734 
735 typedef struct _xkbIndicatorDoodadWireDesc {
736     Atom	name B32;
737     CARD8	type;
738     CARD8	priority;
739     INT16	top B16;
740     INT16	left B16;
741     INT16	angle B16;
742     CARD8	shapeNdx;
743     CARD8	onColorNdx;
744     CARD8	offColorNdx;
745     CARD8	pad1;
746     CARD32	pad2 B32;
747 } xkbIndicatorDoodadWireDesc;
748 #define	sz_xkbIndicatorDoodadWireDesc	20
749 
750 typedef struct _xkbLogoDoodadWireDesc {
751     Atom	name B32;
752     CARD8	type;
753     CARD8	priority;
754     INT16	top B16;
755     INT16	left B16;
756     INT16	angle B16;
757     CARD8	colorNdx;
758     CARD8	shapeNdx;
759     CARD16	pad1 B16;
760     CARD32	pad2 B32;
761 } xkbLogoDoodadWireDesc;
762 #define	sz_xkbLogoDoodadWireDesc	20
763 
764 typedef struct _xkbAnyDoodadWireDesc {
765     Atom	name B32;
766     CARD8	type;
767     CARD8	priority;
768     INT16	top B16;
769     INT16	left B16;
770     INT16	angle B16;
771     CARD32	pad2 B32;
772     CARD32	pad3 B32;
773 } xkbAnyDoodadWireDesc;
774 #define	sz_xkbAnyDoodadWireDesc	20
775 
776 typedef union _xkbDoodadWireDesc {
777     xkbAnyDoodadWireDesc	any;
778     xkbShapeDoodadWireDesc	shape;
779     xkbTextDoodadWireDesc	text;
780     xkbIndicatorDoodadWireDesc	indicator;
781     xkbLogoDoodadWireDesc	logo;
782 } xkbDoodadWireDesc;
783 #define	sz_xkbDoodadWireDesc	20
784 
785 typedef struct _xkbGetGeometry {
786     CARD8	reqType;
787     CARD8	xkbReqType;	/* always X_KBGetGeometry */
788     CARD16	length B16;
789     CARD16	deviceSpec B16;
790     CARD16	pad B16;
791     Atom	name B32;
792 } xkbGetGeometryReq;
793 #define	sz_xkbGetGeometryReq	12
794 
795 typedef struct _xkbGetGeometryReply {
796     CARD8	type;		/* always X_Reply */
797     CARD8	deviceID;
798     CARD16	sequenceNumber B16;
799     CARD32	length B32;
800     Atom	name B32;
801     BOOL	found;
802     CARD8	pad;
803     CARD16	widthMM B16;
804     CARD16	heightMM B16;
805     CARD16	nProperties B16;
806     CARD16	nColors B16;
807     CARD16	nShapes B16;
808     CARD16	nSections B16;
809     CARD16	nDoodads B16;
810     CARD16	nKeyAliases B16;
811     CARD8	baseColorNdx;
812     CARD8	labelColorNdx;
813 } xkbGetGeometryReply;
814 #define	sz_xkbGetGeometryReply	32
815 
816 typedef struct _xkbSetGeometry {
817     CARD8	reqType;
818     CARD8	xkbReqType;	/* always X_KBSetGeometry */
819     CARD16	length B16;
820     CARD16	deviceSpec B16;
821     CARD8	nShapes;
822     CARD8	nSections;
823     Atom	name B32;
824     CARD16	widthMM B16;
825     CARD16	heightMM B16;
826     CARD16	nProperties B16;
827     CARD16	nColors B16;
828     CARD16	nDoodads B16;
829     CARD16	nKeyAliases B16;
830     CARD8	baseColorNdx;
831     CARD8	labelColorNdx;
832     CARD16	pad B16;
833 } xkbSetGeometryReq;
834 #define	sz_xkbSetGeometryReq	28
835 
836 typedef struct _xkbPerClientFlags {
837     CARD8	reqType;
838     CARD8	xkbReqType;/* always X_KBPerClientFlags */
839     CARD16	length B16;
840     CARD16	deviceSpec B16;
841     CARD16	pad1 B16;
842     CARD32	change B32;
843     CARD32	value B32;
844     CARD32	ctrlsToChange B32;
845     CARD32	autoCtrls B32;
846     CARD32	autoCtrlValues B32;
847 } xkbPerClientFlagsReq;
848 #define	sz_xkbPerClientFlagsReq	28
849 
850 typedef struct _xkbPerClientFlagsReply {
851     CARD8	type;		/* always X_Reply */
852     CARD8	deviceID;
853     CARD16	sequenceNumber B16;
854     CARD32	length B32;
855     CARD32	supported B32;
856     CARD32	value B32;
857     CARD32	autoCtrls B32;
858     CARD32	autoCtrlValues B32;
859     CARD32	pad1 B32;
860     CARD32	pad2 B32;
861 } xkbPerClientFlagsReply;
862 #define	sz_xkbPerClientFlagsReply	32
863 
864 typedef struct _xkbListComponents {
865     CARD8	reqType;
866     CARD8	xkbReqType;	/* always X_KBListComponents */
867     CARD16	length B16;
868     CARD16	deviceSpec B16;
869     CARD16	maxNames B16;
870 } xkbListComponentsReq;
871 #define	sz_xkbListComponentsReq	8
872 
873 typedef struct _xkbListComponentsReply {
874     CARD8	type;		/* always X_Reply */
875     CARD8	deviceID;
876     CARD16	sequenceNumber B16;
877     CARD32	length B32;
878     CARD16	nKeymaps B16;
879     CARD16	nKeycodes B16;
880     CARD16	nTypes B16;
881     CARD16	nCompatMaps B16;
882     CARD16	nSymbols B16;
883     CARD16	nGeometries B16;
884     CARD16	extra B16;
885     CARD16	pad1 B16;
886     CARD32	pad2 B32;
887     CARD32	pad3 B32;
888 } xkbListComponentsReply;
889 #define	sz_xkbListComponentsReply	32
890 
891 typedef struct _xkbGetKbdByName {
892     CARD8	reqType;
893     CARD8	xkbReqType;	/* always X_KBGetKbdByName */
894     CARD16	length B16;
895     CARD16	deviceSpec B16;
896     CARD16	need B16;	/* combination of XkbGBN_* */
897     CARD16	want B16;	/* combination of XkbGBN_* */
898     BOOL	load;
899     CARD8	pad;
900 } xkbGetKbdByNameReq;
901 #define	sz_xkbGetKbdByNameReq	12
902 
903 typedef struct _xkbGetKbdByNameReply {
904     CARD8	type;		/* always X_Reply */
905     CARD8	deviceID;
906     CARD16	sequenceNumber B16;
907     CARD32	length B32;
908     KeyCode	minKeyCode;
909     KeyCode	maxKeyCode;
910     BOOL	loaded;
911     BOOL	newKeyboard;
912     CARD16	found B16;	/* combination of XkbGBN_* */
913     CARD16	reported B16;	/* combination of XkbAllComponents */
914     CARD32	pad1 B32;
915     CARD32	pad2 B32;
916     CARD32	pad3 B32;
917     CARD32	pad4 B32;
918 } xkbGetKbdByNameReply;
919 #define	sz_xkbGetKbdByNameReply	32
920 
921 typedef	struct _xkbDeviceLedsWireDesc {
922     CARD16	ledClass B16;
923     CARD16	ledID B16;
924     CARD32	namesPresent B32;
925     CARD32	mapsPresent B32;
926     CARD32	physIndicators B32;
927     CARD32	state B32;
928 } xkbDeviceLedsWireDesc;
929 #define sz_xkbDeviceLedsWireDesc	20
930 
931 typedef struct _xkbGetDeviceInfo {
932     CARD8	reqType;
933     CARD8	xkbReqType;	/* always X_KBGetDeviceInfo */
934     CARD16	length B16;
935     CARD16	deviceSpec B16;
936     CARD16	wanted B16;
937     BOOL	allBtns;
938     CARD8	firstBtn;
939     CARD8	nBtns;
940     CARD8	pad;
941     CARD16	ledClass B16;
942     CARD16	ledID B16;
943 } xkbGetDeviceInfoReq;
944 #define	sz_xkbGetDeviceInfoReq	16
945 
946 typedef struct _xkbGetDeviceInfoReply {
947     CARD8	type;		/* always X_Reply */
948     CARD8	deviceID;
949     CARD16	sequenceNumber B16;
950     CARD32	length B32;
951     CARD16	present B16;
952     CARD16	supported B16;
953     CARD16	unsupported B16;
954     CARD16	nDeviceLedFBs B16;
955     CARD8	firstBtnWanted;
956     CARD8	nBtnsWanted;
957     CARD8	firstBtnRtrn;
958     CARD8	nBtnsRtrn;
959     CARD8	totalBtns;
960     BOOL	hasOwnState;
961     CARD16	dfltKbdFB B16;
962     CARD16	dfltLedFB B16;
963     CARD16	pad B16;
964     Atom	devType B32;
965 } xkbGetDeviceInfoReply;
966 #define	sz_xkbGetDeviceInfoReply	32
967 
968 typedef struct _xkbSetDeviceInfo {
969     CARD8	reqType;
970     CARD8	xkbReqType;	/* always X_KBSetDeviceInfo */
971     CARD16	length B16;
972     CARD16	deviceSpec B16;
973     CARD8	firstBtn;
974     CARD8	nBtns;
975     CARD16	change B16;
976     CARD16	nDeviceLedFBs B16;
977 } xkbSetDeviceInfoReq;
978 #define	sz_xkbSetDeviceInfoReq	12
979 
980 typedef struct _xkbSetDebuggingFlags {
981     CARD8	reqType;
982     CARD8	xkbReqType;	/* always X_KBSetDebuggingFlags */
983     CARD16	length B16;
984     CARD16	msgLength B16;
985     CARD16	pad B16;
986     CARD32	affectFlags B32;
987     CARD32	flags B32;
988     CARD32	affectCtrls B32;
989     CARD32	ctrls B32;
990 } xkbSetDebuggingFlagsReq;
991 #define	sz_xkbSetDebuggingFlagsReq	24
992 
993 typedef struct _xkbSetDebuggingFlagsReply {
994     BYTE	type;		/* X_Reply */
995     CARD8	pad0;
996     CARD16	sequenceNumber B16;
997     CARD32	length B32;
998     CARD32	currentFlags B32;
999     CARD32	currentCtrls B32;
1000     CARD32	supportedFlags B32;
1001     CARD32	supportedCtrls B32;
1002     CARD32	pad1 B32;
1003     CARD32	pad2 B32;
1004 } xkbSetDebuggingFlagsReply;
1005 #define	sz_xkbSetDebuggingFlagsReply	32
1006 
1007 	/*
1008 	 * X KEYBOARD EXTENSION EVENT STRUCTURES
1009 	 */
1010 
1011 typedef struct _xkbAnyEvent {
1012     BYTE	type;
1013     BYTE	xkbType;
1014     CARD16	sequenceNumber B16;
1015     Time	time B32;
1016     CARD8	deviceID;
1017     CARD8	pad1;
1018     CARD16	pad2 B16;
1019     CARD32	pad3 B32;
1020     CARD32	pad4 B32;
1021     CARD32	pad5 B32;
1022     CARD32	pad6 B32;
1023     CARD32	pad7 B32;
1024 } xkbAnyEvent;
1025 #define	sz_xkbAnyEvent 32
1026 
1027 typedef	struct _xkbNewKeyboardNotify {
1028     BYTE	type;
1029     BYTE	xkbType;
1030     CARD16	sequenceNumber B16;
1031     Time	time B32;
1032     CARD8	deviceID;
1033     CARD8	oldDeviceID;
1034     KeyCode	minKeyCode;
1035     KeyCode	maxKeyCode;
1036     KeyCode	oldMinKeyCode;
1037     KeyCode	oldMaxKeyCode;
1038     CARD8	requestMajor;
1039     CARD8	requestMinor;
1040     CARD16	changed B16;
1041     CARD8	detail;
1042     CARD8	pad1;
1043     CARD32	pad2 B32;
1044     CARD32	pad3 B32;
1045     CARD32	pad4 B32;
1046 } xkbNewKeyboardNotify;
1047 #define	sz_xkbNewKeyboardNotify	32
1048 
1049 typedef	struct _xkbMapNotify {
1050     BYTE	type;
1051     BYTE	xkbType;
1052     CARD16	sequenceNumber B16;
1053     Time	time B32;
1054     CARD8	deviceID;
1055     CARD8	ptrBtnActions;
1056     CARD16	changed B16;
1057     KeyCode	minKeyCode;
1058     KeyCode	maxKeyCode;
1059     CARD8	firstType;
1060     CARD8	nTypes;
1061     KeyCode	firstKeySym;
1062     CARD8	nKeySyms;
1063     KeyCode	firstKeyAct;
1064     CARD8	nKeyActs;
1065     KeyCode	firstKeyBehavior;
1066     CARD8	nKeyBehaviors;
1067     KeyCode	firstKeyExplicit;
1068     CARD8	nKeyExplicit;
1069     KeyCode	firstModMapKey;
1070     CARD8	nModMapKeys;
1071     KeyCode	firstVModMapKey;
1072     CARD8	nVModMapKeys;
1073     CARD16	virtualMods B16;
1074     CARD16	pad1 B16;
1075 } xkbMapNotify;
1076 #define	sz_xkbMapNotify	32
1077 
1078 typedef	struct _xkbStateNotify {
1079     BYTE	type;
1080     BYTE	xkbType;
1081     CARD16	sequenceNumber B16;
1082     Time	time B32;
1083     CARD8	deviceID;
1084     CARD8	mods;
1085     CARD8	baseMods;
1086     CARD8	latchedMods;
1087     CARD8	lockedMods;
1088     CARD8	group;
1089     INT16	baseGroup B16;
1090     INT16	latchedGroup B16;
1091     CARD8	lockedGroup;
1092     CARD8	compatState;
1093     CARD8	grabMods;
1094     CARD8	compatGrabMods;
1095     CARD8	lookupMods;
1096     CARD8	compatLookupMods;
1097     CARD16	ptrBtnState B16;
1098     CARD16	changed B16;
1099     KeyCode	keycode;
1100     CARD8	eventType;
1101     CARD8	requestMajor;
1102     CARD8	requestMinor;
1103 } xkbStateNotify;
1104 #define	sz_xkbStateNotify	32
1105 
1106 typedef struct _xkbControlsNotify {
1107     BYTE	type;
1108     BYTE	xkbType;
1109     CARD16	sequenceNumber B16;
1110     Time	time B32;
1111     CARD8	deviceID;
1112     CARD8	numGroups;
1113     CARD16	pad1 B16;
1114     CARD32	changedControls B32;
1115     CARD32	enabledControls B32;
1116     CARD32	enabledControlChanges B32;
1117     KeyCode	keycode;
1118     CARD8	eventType;
1119     CARD8	requestMajor;
1120     CARD8	requestMinor;
1121     CARD32	pad2 B32;
1122 } xkbControlsNotify;
1123 #define	sz_xkbControlsNotify	32
1124 
1125 typedef struct _xkbIndicatorNotify {
1126     BYTE	type;
1127     BYTE	xkbType;
1128     CARD16	sequenceNumber B16;
1129     Time	time B32;
1130     CARD8	deviceID;
1131     CARD8	pad1;
1132     CARD16	pad2 B16;
1133     CARD32	state B32;
1134     CARD32	changed B32;
1135     CARD32	pad3 B32;
1136     CARD32	pad4 B32;
1137     CARD32	pad5 B32;
1138 } xkbIndicatorNotify;
1139 #define	sz_xkbIndicatorNotify	32
1140 
1141 typedef struct _xkbNamesNotify {
1142     BYTE	type;
1143     BYTE	xkbType;
1144     CARD16	sequenceNumber B16;
1145     Time	time B32;
1146     CARD8	deviceID;
1147     CARD8	pad1;
1148     CARD16	changed B16;
1149     CARD8	firstType;
1150     CARD8	nTypes;
1151     CARD8	firstLevelName;
1152     CARD8	nLevelNames;
1153     CARD8	pad2;
1154     CARD8	nRadioGroups;
1155     CARD8	nAliases;
1156     CARD8	changedGroupNames;
1157     CARD16	changedVirtualMods B16;
1158     CARD8	firstKey;
1159     CARD8	nKeys;
1160     CARD32	changedIndicators B32;
1161     CARD32	pad3 B32;
1162 } xkbNamesNotify;
1163 #define	sz_xkbNamesNotify	32
1164 
1165 typedef struct _xkbCompatMapNotify {
1166     BYTE	type;
1167     BYTE	xkbType;
1168     CARD16	sequenceNumber B16;
1169     Time	time B32;
1170     CARD8	deviceID;
1171     CARD8	changedGroups;
1172     CARD16	firstSI B16;
1173     CARD16	nSI B16;
1174     CARD16	nTotalSI B16;
1175     CARD32	pad1 B32;
1176     CARD32	pad2 B32;
1177     CARD32	pad3 B32;
1178     CARD32	pad4 B32;
1179 } xkbCompatMapNotify;
1180 #define sz_xkbCompatMapNotify	32
1181 
1182 typedef struct _xkbBellNotify {
1183     BYTE	type;
1184     BYTE	xkbType;
1185     CARD16	sequenceNumber B16;
1186     Time	time B32;
1187     CARD8	deviceID;
1188     CARD8	bellClass;
1189     CARD8	bellID;
1190     CARD8	percent;
1191     CARD16	pitch B16;
1192     CARD16	duration B16;
1193     Atom	name B32;
1194     Window	window B32;
1195     BOOL	eventOnly;
1196     CARD8	pad1;
1197     CARD16	pad2 B16;
1198     CARD32	pad3 B32;
1199 } xkbBellNotify;
1200 #define	sz_xkbBellNotify	32
1201 
1202 typedef struct _xkbActionMessage {
1203     BYTE	type;
1204     BYTE	xkbType;
1205     CARD16	sequenceNumber B16;
1206     Time	time B32;
1207     CARD8	deviceID;
1208     KeyCode	keycode;
1209     BOOL	press;
1210     BOOL	keyEventFollows;
1211     CARD8	mods;
1212     CARD8	group;
1213     CARD8	message[8];
1214     CARD16	pad1 B16;
1215     CARD32	pad2 B32;
1216     CARD32	pad3 B32;
1217 } xkbActionMessage;
1218 #define	sz_xkbActionMessage		32
1219 
1220 typedef struct _xkbAccessXNotify {
1221     BYTE	type;
1222     BYTE	xkbType;
1223     CARD16	sequenceNumber B16;
1224     Time	time B32;
1225     CARD8	deviceID;
1226     KeyCode	keycode;
1227     CARD16	detail B16;
1228     CARD16	slowKeysDelay B16;
1229     CARD16	debounceDelay B16;
1230     CARD32	pad1 B32;
1231     CARD32	pad2 B32;
1232     CARD32	pad3 B32;
1233     CARD32	pad4 B32;
1234 } xkbAccessXNotify;
1235 #define	sz_xkbAccessXNotify	32
1236 
1237 typedef struct _xkbExtensionDeviceNotify {
1238     BYTE	type;
1239     BYTE	xkbType;
1240     CARD16	sequenceNumber B16;
1241     Time	time B32;
1242     CARD8	deviceID;
1243     CARD8	pad1;
1244     CARD16	reason B16;
1245     CARD16	ledClass B16;
1246     CARD16	ledID B16;
1247     CARD32	ledsDefined B32;
1248     CARD32	ledState B32;
1249     CARD8	firstBtn;
1250     CARD8	nBtns;
1251     CARD16	supported B16;
1252     CARD16	unsupported B16;
1253     CARD16	pad3 B16;
1254 } xkbExtensionDeviceNotify;
1255 #define	sz_xkbExtensionDeviceNotify		32
1256 
1257 typedef struct _xkbEvent {
1258     union {
1259 	xkbAnyEvent		any;
1260 	xkbNewKeyboardNotify	new_kbd;
1261 	xkbMapNotify		map;
1262 	xkbStateNotify		state;
1263 	xkbControlsNotify	ctrls;
1264 	xkbIndicatorNotify	indicators;
1265 	xkbNamesNotify		names;
1266 	xkbCompatMapNotify	compat;
1267 	xkbBellNotify		bell;
1268 	xkbActionMessage	message;
1269 	xkbAccessXNotify	accessx;
1270 	xkbExtensionDeviceNotify device;
1271     } u;
1272 } xkbEvent;
1273 #define sz_xkbEvent	32
1274 
1275 #undef Window
1276 #undef Atom
1277 #undef Time
1278 #undef KeyCode
1279 #undef KeySym
1280 
1281 #endif /* _XKBPROTO_H_ */
1282