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