2
$Xorg: XKB.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $
3
************************************************************
4
$Xorg: XKBstr.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $
5
************************************************************
6
$Xorg: XKBgeom.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $
7
************************************************************
9
Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
11
Permission to use, copy, modify, and distribute this
12
software and its documentation for any purpose and without
13
fee is hereby granted, provided that the above copyright
14
notice appear in all copies and that both that copyright
15
notice and this permission notice appear in supporting
16
documentation, and that the name of Silicon Graphics not be
17
used in advertising or publicity pertaining to distribution
18
of the software without specific prior written permission.
19
Silicon Graphics makes no representation about the suitability
20
of this software for any purpose. It is provided "as is"
21
without any express or implied warranty.
23
SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
24
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
25
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
26
GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
27
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
28
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
29
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
30
THE USE OR PERFORMANCE OF THIS SOFTWARE.
32
********************************************************
33
$XFree86: xc/include/extensions/XKB.h,v 1.5 2002/11/20 04:49:01 dawes Exp $
34
$XFree86: xc/include/extensions/XKBgeom.h,v 3.9 2002/09/18 17:11:40 tsi Exp $
36
Pascal Convertion was made by Ido Kannner - kanerido@actcom.net.il
39
I want to thanks to oliebol for putting up with all of the problems that was found
40
while translating this code. ;)
42
I want to thanks #fpc channel in freenode irc, for helping me, and to put up with my
45
Thanks for mmc in #xlib on freenode irc And so for the channel itself for the helping me to
46
understanding some of the problems I had converting this headers and pointing me to resources
47
that helped translating this headers.
52
2004/10/15 - Fixed a bug of accessing second based records by removing "paced record" and
53
chnaged it to "reocrd" only.
54
2004/10/04 - 06 - Convertion from the c header of XKBgeom.h.
55
2004/10/03 - Removed the XKBstr_UNIT compiler decleration. Afther the joined files,
56
There is no need for it anymore.
57
- There is a need to define (for now) XKBgeom (compiler define) in order
58
to use the code of it. At this moment, I did not yet converted it to Pascal.
60
2004/09/17 - 10/04 - Convertion from the c header of XKBstr.
62
2004/10/03 - Joined xkbstr.pas into xkb.pas because of the circular calls problems.
63
- Added the history of xkbstr.pas above this addition.
65
2004/09/17 - Fixed a wrong convertion number of XkbPerKeyBitArraySize, insted
66
of float, it's now converted into integer (as it should have been).
68
2004/09/15 - 16 - Convertion from the c header of XKB.h.
71
{$MODE OBJFPC} {$MACRO ON} {$DEFINE MACRO}
77
function XkbCharToInt (v : Byte) : SmallInt;
78
procedure XkbIntTo2Chars (i : Word; var h, l : byte);
80
function Xkb2CharsToInt (h, l : Byte) : SmallInt;
83
Common data structures and access macros
86
PXkbStatePtr = ^TXkbStateRec;
98
compat_grab_mods : Byte;
100
compat_lookup_mods : Byte;
104
function XkbModLocks (s : PXkbStatePtr) : Byte;
105
function XkbStateMods (s : PXkbStatePtr) : Word;
106
function XkbGroupLock (s : PXkbStatePtr) : Byte;
107
function XkbStateGroup (s : PXkbStatePtr) : Word;
108
function XkbStateFieldFromRec (s : PXkbStatePtr) : Cardinal;
109
function XkbGrabStateFromRec (s : PXkbStatePtr) : Cardinal;
112
PXkbModsPtr = ^TXkbModsRec;
114
mask : Byte; // effective mods
120
PXkbKTMapEntryPtr = ^TXkbKTMapEntryRec;
121
TXkbKTMapEntryRec = record
128
PXkbKeyTypePtr = ^TXkbKeyTypeRec;
129
TXkbKeyTypeRec = record
133
map : PXkbKTMapEntryPtr;
134
preserve : PXkbModsPtr;
139
function XkbNumGroups (g : Word) : Word;
140
function XkbOutOfRangeGroupInfo (g : Word) : Word;
141
function XkbOutOfRangeGroupAction (g : Word) : Word;
142
function XkbOutOfRangeGroupNumber (g : Word) : Word;
143
function XkbSetGroupInfo (g, w, n : Word) : Word;
144
function XkbSetNumGroups (g, n : Word) : Word;
147
Structures and access macros used primarily by the server
151
PXkbBehavior = ^TXkbBehavior;
152
TXkbBehavior = record
159
PXkbModAction = ^TXkbModAction;
160
TXkbModAction = record
169
function XkbModActionVMods (a : PXkbModAction) : SmallInt;
170
procedure XkbSetModActionVMods (a : PXkbModAction; v : Byte);
173
PXkbGroupAction = ^TXkbGroupAction;
174
TXkbGroupAction = record
177
group_XXX : ShortInt;
180
function XkbSAGroup (a : PXkbGroupAction) : ShortInt;
181
procedure XkbSASetGroup (a : PXkbGroupAction; g : ShortInt);
184
PXkbISOAction = ^TXkbISOAction;
185
TXkbISOAction = record
190
group_XXX : ShortInt;
197
PXkbPtrAction = ^TXkbPtrAction;
198
TXkbPtrAction = record
207
function XkbPtrActionX (a : PXkbPtrAction) : Word;
208
function XkbPtrActionY (a : PXkbPtrAction) : Word;
209
procedure XkbSetPtrActionX (a : PXkbPtrAction; x : Byte);
210
procedure XkbSetPtrActionY (a : PXkbPtrAction; y : Byte);
213
PXkbPtrBtnAction = ^TXkbPtrBtnAction;
214
TXkbPtrBtnAction = record
222
PXkbPtrDfltAction = ^TXkbPtrDfltAction;
223
TXkbPtrDfltAction = record
230
function XkbSAPtrDfltValue (a : PXkbPtrDfltAction) : ShortInt;
231
procedure XkbSASetPtrDfltValue (a : PXkbPtrDfltAction; const c);
234
PXkbSwitchScreenAction = ^TXkbSwitchScreenAction;
235
TXkbSwitchScreenAction = record
238
screenXXX : ShortInt;
241
function XkbSAScreen (a : PXkbSwitchScreenAction) : ShortInt;
242
procedure XkbSASetScreen (a : PXkbSwitchScreenAction; const s);
245
PXkbCtrlsAction = ^TXkbCtrlsAction;
246
TXkbCtrlsAction = record
255
procedure XkbActionSetCtrls (a : PXkbCtrlsAction; c : Byte);
256
function XkbActionCtrls (a : PXkbCtrlsAction) : Word;
259
PXkbMessageAction = ^TXkbMessageAction;
260
TXkbMessageAction = record
263
message : array [0..5] of char;
267
PXkbRedirectKeyAction = ^TXkbRedirectKeyAction;
268
TXkbRedirectKeyAction = record
279
function XkbSARedirectVMods (a : PXkbRedirectKeyAction) : Word;
280
procedure XkbSARedirectSetVMods (a : PXkbRedirectKeyAction; m : Byte);
281
function XkbSARedirectVModsMask (a : PXkbRedirectKeyAction) : Word;
282
procedure XkbSARedirectSetVModsMask (a : PXkbRedirectKeyAction; m : Byte);
285
PXkbDeviceBtnAction = ^TXkbDeviceBtnAction;
286
TXkbDeviceBtnAction = record
295
PXkbDeviceValuatorAction = ^TXkbDeviceValuatorAction;
296
TXkbDeviceValuatorAction = record
308
Macros to classify key actions
311
XkbAnyActionDataSize = 7;
314
PXkbAnyAction = ^TXkbAnyAction;
315
TXkbAnyAction = record
317
data : array [0..XkbAnyActionDataSize-1] of byte;
320
function XkbIsModAction (a : PXkbAnyAction) : LongBool;
321
function XkbIsGroupAction (a : PXkbAnyAction) : LongBool;
322
function XkbIsPtrAction (a : PXkbAnyAction) : LongBool;
325
PXkbAction = ^TXkbAction;
328
mods : TXkbModAction;
329
group : TXkbGroupAction;
332
btn : TXkbPtrBtnAction;
333
dflt : TXkbPtrDfltAction;
334
screen : TXkbSwitchScreenAction;
335
ctrls : TXkbCtrlsAction;
336
msg : TXkbMessageAction;
337
redirect : TXkbRedirectKeyAction;
338
devbtn : TXkbDeviceBtnAction;
339
devval : TXkbDeviceValuatorAction;
344
XKB request codes, used in:
345
- xkbReqType field of all requests
346
- requestMinor field of some events
349
X_kbUseExtension = 0;
350
X_kbSelectEvents = 1;
353
X_kbLatchLockState = 5;
358
X_kbGetCompatMap = 10;
359
X_kbSetCompatMap = 11;
360
X_kbGetIndicatorState = 12;
361
X_kbGetIndicatorMap = 13;
362
X_kbSetIndicatorMap = 14;
363
X_kbGetNamedIndicator = 15;
364
X_kbSetNamedIndicator = 16;
367
X_kbGetGeometry = 19;
368
X_kbSetGeometry = 20;
369
X_kbPerClientFlags = 21;
370
X_kbListComponents = 22;
371
X_kbGetKbdByName = 23;
372
X_kbGetDeviceInfo = 24;
373
X_kbSetDeviceInfo = 25;
374
X_kbSetDebuggingFlags = 101;
377
In the X sense, XKB reports only one event.
378
The type field of all XKB events is XkbEventCode
382
XkbNumberEvents = XkbEventCode +1;
385
XKB has a minor event code so it can use one X event code for
387
- reported in the xkbType field of all XKB events.
388
- XkbSelectEventDetails: Indicates the event for which event details
392
XkbNewKeyboardNotify = 0;
395
XkbControlsNotify = 3;
396
XkbIndicatorStateNotify = 4;
397
XkbIndicatorMapNotify = 5;
399
XkbCompatMapNotify = 7;
401
XkbActionMessage = 9;
402
XkbAccessXNotify = 10;
403
XkbExtensionDeviceNotify = 11;
407
- XkbSelectEvents: Specifies event interest.
410
XkbNewKeyboardNotifyMask = Cardinal(1) shl 0;
411
XkbMapNotifyMask = Cardinal(1) shl 1;
412
XkbStateNotifyMask = Cardinal(1) shl 2;
413
XkbControlsNotifyMask = Cardinal(1) shl 3;
414
XkbIndicatorStateNotifyMask = Cardinal(1) shl 4;
415
XkbIndicatorMapNotifyMask = Cardinal(1) shl 5;
416
XkbNamesNotifyMask = Cardinal(1) shl 6;
417
XkbCompatMapNotifyMask = Cardinal(1) shl 7;
418
XkbBellNotifyMask = Cardinal(1) shl 8;
419
XkbActionMessageMask = Cardinal(1) shl 9;
420
XkbAccessXNotifyMask = Cardinal(1) shl 10;
421
XkbExtensionDeviceNotifyMask = Cardinal(1) shl 11;
422
XkbAllEventsMask = $FFF;
425
NewKeyboardNotify event details:
428
XkbNKN_KeycodesMask = Cardinal(1) shl 0;
429
XkbNKN_GeometryMask = Cardinal(1) shl 1;
430
XkbNKN_DeviceIDMask = Cardinal(1) shl 2;
431
XkbAllNewKeyboardEventsMask = $7;
434
AccessXNotify event types:
435
- The 'what' field of AccessXNotify events reports the
436
reason that the event was generated.
442
XkbAXN_SKRelease = 3;
445
XkbAXN_AXKWarning = 6;
448
AccessXNotify details:
449
- Used as an event detail mask to limit the conditions under which
450
AccessXNotify events are reported
453
XkbAXN_SKPressMask = Cardinal(1) shl 0;
454
XkbAXN_SKAcceptMask = Cardinal(1) shl 1;
455
XkbAXN_SKRejectMask = Cardinal(1) shl 2;
456
XkbAXN_SKReleaseMask = Cardinal(1) shl 3;
457
XkbAXN_BKAcceptMask = Cardinal(1) shl 4;
458
XkbAXN_BKRejectMask = Cardinal(1) shl 5;
459
XkbAXN_AXKWarningMask = Cardinal(1) shl 6;
460
XkbAllAccessXEventsMask = $f;
463
- The 'changed' field of StateNotify events reports which of
464
the keyboard state components have changed.
465
- Used as an event detail mask to limit the conditions under
466
which StateNotify events are reported.
469
XkbModifierStateMask = Cardinal(1) shl 0;
470
XkbModifierBaseMask = Cardinal(1) shl 1;
471
XkbModifierLatchMask = Cardinal(1) shl 2;
472
XkbModifierLockMask = Cardinal(1) shl 3;
473
XkbGroupStateMask = Cardinal(1) shl 4;
474
XkbGroupBaseMask = Cardinal(1) shl 5;
475
XkbGroupLatchMask = Cardinal(1) shl 6;
476
XkbGroupLockMask = Cardinal(1) shl 7;
477
XkbCompatStateMask = Cardinal(1) shl 8;
478
XkbGrabModsMask = Cardinal(1) shl 9;
479
XkbCompatGrabModsMask = Cardinal(1) shl 10;
480
XkbLookupModsMask = Cardinal(1) shl 11;
481
XkbCompatLookupModsMask = Cardinal(1) shl 12;
482
XkbPointerButtonMask = Cardinal(1) shl 13;
483
XkbAllStateComponentsMask = $3fff;
486
Controls detail masks:
487
The controls specified in XkbAllControlsMask:
488
- The 'changed' field of ControlsNotify events reports which of
489
the keyboard controls have changed.
490
- The 'changeControls' field of the SetControls request specifies
491
the controls for which values are to be changed.
492
- Used as an event detail mask to limit the conditions under
493
which ControlsNotify events are reported.
495
The controls specified in the XkbAllBooleanCtrlsMask:
496
- The 'enabledControls' field of ControlsNotify events reports the
497
current status of the boolean controls.
498
- The 'enabledControlsChanges' field of ControlsNotify events reports
499
any boolean controls that have been turned on or off.
500
- The 'affectEnabledControls' and 'enabledControls' fields of the
501
kbSetControls request change the set of enabled controls.
502
- The 'accessXTimeoutMask' and 'accessXTimeoutValues' fields of
503
an XkbControlsRec specify the controls to be changed if the keyboard
504
times out and the values to which they should be changed.
505
- The 'autoCtrls' and 'autoCtrlsValues' fields of the PerClientFlags
506
request specifies the specify the controls to be reset when the
507
client exits and the values to which they should be reset.
508
- The 'ctrls' field of an indicator map specifies the controls
509
that drive the indicator.
510
- Specifies the boolean controls affected by the SetControls and
511
LockControls key actions.
514
XkbRepeatKeysMask = Cardinal(1) shl 0;
515
XkbSlowKeysMask = Cardinal(1) shl 1;
516
XkbBounceKeysMask = Cardinal(1) shl 2;
517
XkbStickyKeysMask = Cardinal(1) shl 3;
518
XkbMouseKeysMask = Cardinal(1) shl 4;
519
XkbMouseKeysAccelMask = Cardinal(1) shl 5;
520
XkbAccessXKeysMask = Cardinal(1) shl 6;
521
XkbAccessXTimeoutMask = Cardinal(1) shl 7;
522
XkbAccessXFeedbackMask = Cardinal(1) shl 8;
523
XkbAudibleBellMask = Cardinal(1) shl 9;
524
XkbOverlay1Mask = Cardinal(1) shl 10;
525
XkbOverlay2Mask = Cardinal(1) shl 11;
526
XkbIgnoreGroupLockMask = Cardinal(1) shl 12;
527
XkbGroupsWrapMask = Cardinal(1) shl 27;
528
XkbInternalModsMask = Cardinal(1) shl 28;
529
XkbIgnoreLockModsMask = Cardinal(1) shl 29;
530
XkbPerKeyRepeatMask = Cardinal(1) shl 30;
531
XkbControlsEnabledMask = Cardinal(1) shl 31;
533
XkbAccessXOptionsMask = XkbStickyKeysMask or XkbAccessXFeedbackMask;
535
XkbAllBooleanCtrlsMask = $00001FFF;
536
XkbAllControlsMask = $F8001FFF;
539
Compatibility Map Compontents:
540
- Specifies the components to be allocated in XkbAllocCompatMap.
543
XkbSymInterpMask = 1 shl 0;
544
XkbGroupCompatMask = 1 shl 1;
545
XkbAllCompatMask = $3;
548
Assorted constants and limits.
551
XkbAllIndicatorsMask = $ffffffff;
554
Map components masks:
555
Those in AllMapComponentsMask:
556
- Specifies the individual fields to be loaded or changed for the
557
GetMap and SetMap requests.
558
Those in ClientInfoMask:
559
- Specifies the components to be allocated by XkbAllocClientMap.
560
Those in ServerInfoMask:
561
- Specifies the components to be allocated by XkbAllocServerMap.
564
XkbKeyTypesMask = 1 shl 0;
565
XkbKeySymsMask = 1 shl 1;
566
XkbModifierMapMask = 1 shl 2;
567
XkbExplicitComponentsMask = 1 shl 3;
568
XkbKeyActionsMask = 1 shl 4;
569
XkbKeyBehaviorsMask = 1 shl 5;
570
XkbVirtualModsMask = 1 shl 6;
571
XkbVirtualModMapMask = 1 shl 7;
573
XkbAllClientInfoMask = XkbKeyTypesMask or XkbKeySymsMask or XkbModifierMapMask;
574
XkbAllServerInfoMask = XkbExplicitComponentsMask or XkbKeyActionsMask or XkbKeyBehaviorsMask or
575
XkbVirtualModsMask or XkbVirtualModMapMask;
576
XkbAllMapComponentsMask = XkbAllClientInfoMask or XkbAllServerInfoMask;
579
Names component mask:
580
- Specifies the names to be loaded or changed for the GetNames and
582
- Specifies the names that have changed in a NamesNotify event.
583
- Specifies the names components to be allocated by XkbAllocNames.
586
XkbKeycodesNameMask = 1 shl 0;
587
XkbGeometryNameMask = 1 shl 1;
588
XkbSymbolsNameMask = 1 shl 2;
589
XkbPhysSymbolsNameMask = 1 shl 3;
590
XkbTypesNameMask = 1 shl 4;
591
XkbCompatNameMask = 1 shl 5;
592
XkbKeyTypeNamesMask = 1 shl 6;
593
XkbKTLevelNamesMask = 1 shl 7;
594
XkbIndicatorNamesMask = 1 shl 8;
595
XkbKeyNamesMask = 1 shl 9;
596
XkbKeyAliasesMask = 1 shl 10;
597
XkbVirtualModNamesMask = 1 shl 11;
598
XkbGroupNamesMask = 1 shl 12;
599
XkbRGNamesMask = 1 shl 13;
600
XkbComponentNamesMask = $3f;
601
XkbAllNamesMask = $3fff;
604
Miscellaneous event details:
605
- event detail masks for assorted events that don't reall
609
XkbAllStateEventsMask = XkbAllStateComponentsMask;
610
XkbAllMapEventsMask = XkbAllMapComponentsMask;
611
XkbAllControlEventsMask = XkbAllControlsMask;
612
XkbAllIndicatorEventsMask = XkbAllIndicatorsMask;
613
XkbAllNameEventsMask = XkbAllNamesMask;
614
XkbAllCompatMapEventsMask = XkbAllCompatMask;
615
XkbAllBellEventsMask = Cardinal(1) shl 0;
616
XkbAllActionMessagesMask = Cardinal(1) shl 0;
619
XKB reports one error: BadKeyboard
620
A further reason for the error is encoded into to most significant
621
byte of the resourceID for the error:
622
XkbErr_BadDevice - the device in question was not found
623
XkbErr_BadClass - the device was found but it doesn't belong to
624
the appropriate class.
625
XkbErr_BadId - the device was found and belongs to the right
626
class, but not feedback with a matching id was
628
The low byte of the resourceID for this error contains the device
629
id, class specifier or feedback id that failed.
634
XkbErr_BadDevice = $ff;
635
XkbErr_BadClass = $fe;
639
Keyboard Components Mask:
640
- Specifies the components that follow a GetKeyboardByNameReply
643
XkbClientMapMask = Cardinal(1) shl 0;
644
XkbServerMapMask = Cardinal(1) shl 1;
645
XkbCompatMapMask = Cardinal(1) shl 2;
646
XkbIndicatorMapMask = Cardinal(1) shl 3;
647
XkbNamesMask = Cardinal(1) shl 4;
648
XkbGeometryMask = Cardinal(1) shl 5;
649
XkbControlsMask = Cardinal(1) shl 6;
650
XkbAllComponentsMask = $7f;
655
- The 'accessXOptions' field of an XkbControlsRec specifies the
656
AccessX options that are currently in effect.
657
- The 'accessXTimeoutOptionsMask' and 'accessXTimeoutOptionsValues'
658
fields of an XkbControlsRec specify the Access X options to be
659
changed if the keyboard times out and the values to which they
663
XkbAX_SKPressFBMask = Cardinal(1) shl 0;
664
XkbAX_SKAcceptFBMask = Cardinal(1) shl 1;
665
XkbAX_FeatureFBMask = Cardinal(1) shl 2;
666
XkbAX_SlowWarnFBMask = Cardinal(1) shl 3;
667
XkbAX_IndicatorFBMask = Cardinal(1) shl 4;
668
XkbAX_StickyKeysFBMask = Cardinal(1) shl 5;
669
XkbAX_TwoKeysMask = Cardinal(1) shl 6;
670
XkbAX_LatchToLockMask = Cardinal(1) shl 7;
671
XkbAX_SKReleaseFBMask = Cardinal(1) shl 8;
672
XkbAX_SKRejectFBMask = Cardinal(1) shl 9;
673
XkbAX_BKRejectFBMask = Cardinal(1) shl 10;
674
XkbAX_DumbBellFBMask = Cardinal(1) shl 11;
675
XkbAX_FBOptionsMask = $F3F;
676
XkbAX_SKOptionsMask = $0C0;
677
XkbAX_AllOptionsMask = $FFF;
680
XkbUseCoreKbd is used to specify the core keyboard without having
681
to look up its X input extension identifier.
682
XkbUseCorePtr is used to specify the core pointer without having
683
to look up its X input extension identifier.
684
XkbDfltXIClass is used to specify "don't care" any place that the
685
XKB protocol is looking for an X Input Extension
687
XkbDfltXIId is used to specify "don't care" any place that the
688
XKB protocol is looking for an X Input Extension
690
XkbAllXIClasses is used to get information about all device indicators,
691
whether they're part of the indicator feedback class
692
or the keyboard feedback class.
693
XkbAllXIIds is used to get information about all device indicator
694
feedbacks without having to list them.
695
XkbXINone is used to indicate that no class or id has been specified.
696
XkbLegalXILedClass(c) True if 'c' specifies a legal class with LEDs
697
XkbLegalXIBellClass(c) True if 'c' specifies a legal class with bells
698
XkbExplicitXIDevice(d) True if 'd' explicitly specifies a device
699
XkbExplicitXIClass(c) True if 'c' explicitly specifies a device class
700
XkbExplicitXIId(c) True if 'i' explicitly specifies a device id
701
XkbSingleXIClass(c) True if 'c' specifies exactly one device class,
702
including the default.
703
XkbSingleXIId(i) True if 'i' specifies exactly one device
704
identifier, including the default.
707
XkbUseCoreKbd = $0100;
708
XkbUseCorePtr = $0200;
709
XkbDfltXIClass = $0300;
711
XkbAllXIClasses = $0500;
715
function XkbLegalXILedClass (c : Cardinal) : LongBool;
716
function XkbLegalXIBellClass (c : Cardinal) : LongBool;
717
function XkbExplicitXIDevice (c : Cardinal) : LongBool;
718
function XkbExplicitXIClass (c : Cardinal) : LongBool;
719
function XkbExplicitXIId (c : Cardinal) : LongBool;
720
function XkbSingleXIClass (c : Cardinal) : LongBool;
721
function XkbSingleXIId (c : Cardinal) : LongBool;
725
XkbNoShiftLevel = $ff;
727
XkbNoIndicator = $ff;
729
XkbNoModifierMask = 0;
730
XkbAllModifiersMask = $ff;
731
XkbAllVirtualModsMask = $ffff;
734
XkbMaxKbdGroup = XkbNumKbdGroups-1;
736
XkbMaxMouseKeysBtn = 4;
739
Group Index and Mask:
740
- Indices into the kt_index array of a key type.
741
- Mask specifies types to be changed for XkbChangeTypesOfKey
751
XkbGroup1Mask = 1 shl 0;
752
XkbGroup2Mask = 1 shl 1;
753
XkbGroup3Mask = 1 shl 2;
754
XkbGroup4Mask = 1 shl 3;
755
XkbAnyGroupMask = 1 shl 7;
756
XkbAllGroupsMask = $f;
759
BuildCoreState: Given a keyboard group and a modifier state,
760
construct the value to be reported an event.
761
GroupForCoreState: Given the state reported in an event,
762
determine the keyboard group.
763
IsLegalGroup: Returns TRUE if 'g' is a valid group index.
765
function XkbBuildCoreState (m, g : Cardinal) : Cardinal;
766
function XkbGroupForCoreState (s : Cardinal) : Cardinal;
767
function XkbIsLegalGroup (g : Cardinal) : LongBool;
771
- The 'groupsWrap' field of an XkbControlsRec specifies the
772
treatment of out of range groups.
773
- Bits 6 and 7 of the group info field of a key symbol map
774
specify the interpretation of out of range groups for the
778
XkbWrapIntoRange = $00;
779
XkbClampIntoRange = $40;
780
XkbRedirectIntoRange = $80;
783
Action flags: Reported in the 'flags' field of most key actions.
784
Interpretation depends on the type of the action; not all actions
787
Option Used for Actions
788
------ ----------------
789
ClearLocks SetMods, LatchMods, SetGroup, LatchGroup
790
LatchToLock SetMods, LatchMods, SetGroup, LatchGroup
791
LockNoLock LockMods, ISOLock, LockPtrBtn, LockDeviceBtn
792
LockNoUnlock LockMods, ISOLock, LockPtrBtn, LockDeviceBtn
793
UseModMapMods SetMods, LatchMods, LockMods, ISOLock
794
GroupAbsolute SetGroup, LatchGroup, LockGroup, ISOLock
795
UseDfltButton PtrBtn, LockPtrBtn
796
NoAcceleration MovePtr
797
MoveAbsoluteX MovePtr
798
MoveAbsoluteY MovePtr
799
ISODfltIsGroup ISOLock
800
ISONoAffectMods ISOLock
801
ISONoAffectGroup ISOLock
802
ISONoAffectPtr ISOLock
803
ISONoAffectCtrls ISOLock
804
MessageOnPress ActionMessage
805
MessageOnRelease ActionMessage
806
MessageGenKeyEvent ActionMessage
807
AffectDfltBtn SetPtrDflt
808
DfltBtnAbsolute SetPtrDflt
809
SwitchApplication SwitchScreen
810
SwitchAbsolute SwitchScreen
813
XkbSA_ClearLocks = Cardinal(1) shl 0;
814
XkbSA_LatchToLock = Cardinal(1) shl 1;
816
XkbSA_LockNoLock = Cardinal(1) shl 0;
817
XkbSA_LockNoUnlock = Cardinal(1) shl 1;
819
XkbSA_UseModMapMods = Cardinal(1) shl 2;
821
XkbSA_GroupAbsolute = Cardinal(1) shl 2;
822
XkbSA_UseDfltButton = 0;
824
XkbSA_NoAcceleration = Cardinal(1) shl 0;
825
XkbSA_MoveAbsoluteX = Cardinal(1) shl 1;
826
XkbSA_MoveAbsoluteY = Cardinal(1) shl 2;
828
XkbSA_ISODfltIsGroup = Cardinal(1) shl 7;
829
XkbSA_ISONoAffectMods = Cardinal(1) shl 6;
830
XkbSA_ISONoAffectGroup = Cardinal(1) shl 5;
831
XkbSA_ISONoAffectPtr = Cardinal(1) shl 4;
832
XkbSA_ISONoAffectCtrls = Cardinal(1) shl 3;
833
XkbSA_ISOAffectMask = $78;
835
XkbSA_MessageOnPress = Cardinal(1) shl 0;
836
XkbSA_MessageOnRelease = Cardinal(1) shl 1;
837
XkbSA_MessageGenKeyEvent = Cardinal(1) shl 2;
839
XkbSA_AffectDfltBtn = 1;
840
XkbSA_DfltBtnAbsolute = Cardinal(1) shl 2;
842
XkbSA_SwitchApplication = Cardinal(1) shl 0;
843
XkbSA_SwitchAbsolute = Cardinal(1) shl 2;
846
The following values apply to the SA_DeviceValuator
847
action only. Valuator operations specify the action
848
to be taken. Values specified in the action are
849
multiplied by 2^scale before they are applied.
852
XkbSA_IgnoreVal = $00;
853
XkbSA_SetValMin = $10;
854
XkbSA_SetValCenter = $20;
855
XkbSA_SetValMax = $30;
856
XkbSA_SetValRelative = $40;
857
XkbSA_SetValAbsolute = $50;
858
XkbSA_ValOpMask = $70;
859
XkbSA_ValScaleMask = $07;
861
function XkbSA_ValOp (a : Cardinal) : Cardinal;
862
function XkbSA_ValScale (a : Cardinal) : Cardinal;
865
Action types: specifies the type of a key action. Reported in the
866
type field of all key actions.
869
XkbSA_NoAction = $00;
871
XkbSA_LatchMods = $02;
872
XkbSA_LockMods = $03;
873
XkbSA_SetGroup = $04;
874
XkbSA_LatchGroup = $05;
875
XkbSA_LockGroup = $06;
878
XkbSA_LockPtrBtn = $09;
879
XkbSA_SetPtrDflt = $0a;
881
XkbSA_Terminate = $0c;
882
XkbSA_SwitchScreen = $0d;
883
XkbSA_SetControls = $0e;
884
XkbSA_LockControls = $0f;
885
XkbSA_ActionMessage = $10;
886
XkbSA_RedirectKey = $11;
887
XkbSA_DeviceBtn = $12;
888
XkbSA_LockDeviceBtn = $13;
889
XkbSA_DeviceValuator = $14;
890
XkbSA_LastAction = XkbSA_DeviceValuator;
891
XkbSA_NumActions = XkbSA_LastAction +1;
893
{$ifDef XF86DDXACTIONS}
896
{$IFDEF XFree86Server}
902
XkbSA_XFree86Private = $86;
906
Specifies the key actions that clear latched groups or modifiers.
909
{#define XkbSA_BreakLatch \
910
((1<<XkbSA_NoAction)|(1<<XkbSA_PtrBtn)|(1<<XkbSA_LockPtrBtn)|\
911
(1<<XkbSA_Terminate)|(1<<XkbSA_SwitchScreen)|(1<<XkbSA_SetControls)|\
912
(1<<XkbSA_LockControls)|(1<<XkbSA_ActionMessage)|\
913
(1<<XkbSA_RedirectKey)|(1<<XkbSA_DeviceBtn)|(1<<XkbSA_LockDeviceBtn))
915
XkbSA_BreakLatch = (1 shl XkbSA_PtrBtn) or (1 shl XkbSA_LockPtrBtn) or (1 shl XkbSA_Terminate)
917
(1 shl XkbSA_SwitchScreen) or (1 shl XkbSA_SetControls) or (1 shl XkbSA_LockControls)
919
(1 shl XkbSA_ActionMessage) or (1 shl XkbSA_RedirectKey) or (1 shl XkbSA_DeviceBtn)
921
(1 shl XkbSA_LockDeviceBtn);
924
Key Behavior Qualifier:
925
KB_Permanent indicates that the behavior describes an unalterable
926
characteristic of the keyboard, not an XKB software-simulation of
929
Specifies the behavior of the underlying key.
932
XkbKB_Permanent = $80;
937
XkbKB_RadioGroup = $02;
938
XkbKB_Overlay1 = $03;
939
XkbKB_Overlay2 = $04;
941
XkbKB_RGAllowNone = $80;
944
Various macros which describe the range of legal keycodes.
947
XkbMinLegalKeyCode = 8;
948
XkbMaxLegalKeyCode = 255;
949
XkbMaxKeyCount = XkbMaxLegalKeyCode - XkbMinLegalKeyCode +1;
950
XkbPerKeyBitArraySize = (XkbMaxLegalKeyCode + 1) div 8;
952
function XkbIsLegalKeycode (const k : Cardinal) : LongBool;
955
PXkbControlsPtr = ^TXkbControlsRec;
956
TXkbControlsRec = record
960
internal : TXkbModsRec;
961
ignore_lock : TXkbModsRec;
962
enabled_ctrls : Word;
964
repeat_interval : Word;
965
slow_keys_delay : Word;
966
debounce_delay : Word;
969
mk_time_to_max : Word;
974
axt_opts_mask : Word;
975
axt_opts_values : Word;
976
axt_ctrls_mask : Word;
977
axt_ctrls_values : Word;
978
per_key_repeat : array [0..XkbPerKeyBitArraySize -1] of Byte;
981
function XkbAX_AnyFeedback (c : PXkbControlsPtr) : Word;
982
function XkbAX_NeedOption (c : PXkbControlsPtr; w : Word) : Word;
983
function XkbAX_NeedFeedback (c : PXkbControlsPtr; w : Word) : Boolean;
986
Assorted constants and limits.
990
XkbNumVirtualMods = 16;
991
XkbNumIndicators = 32;
993
XkbMaxRadioGroups = 32;
994
XkbAllRadioGroupsMask = $ffffffff;
995
XkbMaxShiftLevel = 63;
996
XkbMaxSymsPerKey = XkbMaxShiftLevel * XkbNumKbdGroups;
997
XkbRGMaxMembers = 12;
998
XkbActionMessageLength = 6;
999
XkbKeyNameLength = 4;
1000
XkbMaxRedirectCount = 8;
1002
XkbGeomPtsPerMM = 10;
1003
XkbGeomMaxColors = 32;
1004
XkbGeomMaxLabelColors = 3;
1005
XkbGeomMaxPriority = 255;
1008
PXkbServerMapPtr = ^TXkbServerMapRec;
1009
TXkbServerMapRec = record
1013
behaviors : PXkbBehavior;
1015
{$IF defined (__cplusplus) or defined (c_plusplus)}
1016
//explicit is a C++ reserved word
1021
vmods : array [0..XkbNumVirtualMods -1] of Byte;
1025
function XkbSMKeyActionsPtr (m : PXkbServerMapPtr; k : Word) : PXkbAction;
1028
Structures and access macros used primarily by clients
1032
PXkbSymMapPtr = ^TXkbSymMapRec;
1033
TXkbSymMapRec = record
1034
kt_index : array [0..XkbNumKbdGroups -1] of Byte;
1041
PXkbClientMapPtr = ^TXkbClientMapRec;
1042
TXkbClientMapRec = record
1045
types : PXkbKeyTypePtr;
1050
key_sym_map : PXkbSymMapPtr;
1055
function XkbCMKeyGroupInfo (m : PXkbClientMapPtr; k : Word) : Byte;
1056
function XkbCMKeyNumGroups (m : PXkbClientMapPtr; k : Word) : Byte;
1057
function XkbCMKeyGroupWidth (m : PXkbClientMapPtr; k : Word; g : Byte) : Byte;
1058
function XkbCMKeyGroupsWidth (m : PXkbClientMapPtr; k : Word) : Byte;
1059
function XkbCMKeyTypeIndex (m : PXkbClientMapPtr; k : Word; g : Byte) : Byte;
1060
function XkbCMKeyType (m : PXkbClientMapPtr; k : Word; g : Byte) : PXkbKeyTypePtr;
1061
function XkbCMKeyNumSyms (m : PXkbClientMapPtr; k : Word) : Word;
1062
function XkbCMKeySymsOffset (m : PXkbClientMapPtr; k : Word) : Byte;
1063
function XkbCMKeySymsPtr (m : PXkbClientMapPtr; k : Word) : PKeySym;
1066
Compatibility structures and access macros
1069
PXkbSymInterpretPtr = ^TXkbSymInterpretRec;
1070
TXkbSymInterpretRec = record
1076
act : TXkbAnyAction;
1080
PXkbCompatMapPtr = ^TXkbCompatMapRec;
1081
TXkbCompatMapRec = record
1082
sym_interpret : PXkbSymInterpretPtr;
1083
groups : array [0..XkbNumKbdGroups -1] of TXkbModsRec;
1089
PXkbIndicatorMapPtr = ^TXkbIndicatorMapRec;
1090
TXkbIndicatorMapRec = record
1092
which_groups : Byte;
1099
function XkbIM_IsAuto (i : PXkbIndicatorMapPtr) : Boolean;
1100
function XkbIM_InUse (i : PXkbIndicatorMapPtr) : Boolean;
1103
PXkbIndicatorPtr = ^TXkbIndicatorRec;
1104
TXkbIndicatorRec = record
1105
phys_indicators : LongWord;
1106
maps : array [0..XkbNumIndicators -1] of TXkbIndicatorMapRec;
1110
PXkbKeyNamePtr = ^TXkbKeyNameRec;
1111
TXkbKeyNameRec = record
1112
name : array [0..XkbKeyNameLength -1] of Char;
1116
PXkbKeyAliasPtr = ^TXkbKeyAliasRec;
1117
TXkbKeyAliasRec = record
1118
real : array [0..XkbKeyNameLength -1] of Char;
1119
alias : array [0..XkbKeyNameLength -1] of Char;
1123
Names for everything
1126
PXkbNamesPtr = ^TXkbNamesRec;
1127
TXkbNamesRec = record
1133
vmods : Array [0..XkbNumVirtualMods -1] of TAtom;
1134
indicators : array [0..XkbNumIndicators -1] of TAtom;
1135
groups : array [0..XkbNumKbdGroups -1] of TAtom;
1136
keys : PXkbKeyNamePtr;
1137
key_aliases : PXkbKeyAliasPtr;
1138
radio_groups : PAtom;
1139
phys_symbols : TAtom;
1141
num_key_aliases : Byte;
1146
Key Type index and mask for the four standard key types.
1149
XkbOneLevelIndex = 0;
1150
XkbTwoLevelIndex = 1;
1151
XkbAlphabeticIndex = 2;
1153
XkbLastRequiredType = XkbKeypadIndex;
1154
XkbNumRequiredTypes = XkbLastRequiredType + 1;
1155
XkbMaxKeyTypes = 255;
1157
XkbOneLevelMask = 1 shl 0;
1158
XkbTwoLevelMask = 1 shl 1;
1159
XkbAlphabeticMask = 1 shl 2;
1160
XkbKeypadMask = 1 shl 3;
1161
XkbAllRequiredTypes = $f;
1163
function XkbShiftLevel (n : Byte) : Byte;
1164
function XkbShiftLevelMask (n : Byte) : Byte;
1167
Extension name and version information
1170
{$DEFINE XkbName := 'XKEYBOARD'}
1171
{$DEFINE XkbMajorVersion := 1}
1172
{$DEFINE XkbMinorVersion := 0}
1175
XkbName = 'XKEYBOARD';
1176
XkbMajorVersion = 1;
1177
XkbMinorVersion = 0;
1181
Explicit map components:
1182
- Used in the 'explicit' field of an XkbServerMap. Specifies
1183
the keyboard components that should _not_ be updated automatically
1184
in response to core protocol keyboard mapping requests.
1187
XkbExplicitKeyTypesMask = $0f;
1188
XkbExplicitKeyType1Mask = 1 shl 0;
1189
XkbExplicitKeyType2Mask = 1 shl 1;
1190
XkbExplicitKeyType3Mask = 1 shl 2;
1191
XkbExplicitKeyType4Mask = 1 shl 3;
1192
XkbExplicitInterpretMask = 1 shl 4;
1193
XkbExplicitAutoRepeatMask = 1 shl 5;
1194
XkbExplicitBehaviorMask = 1 shl 6;
1195
XkbExplicitVModMapMask = 1 shl 7;
1196
XkbAllExplicitMask = $ff;
1199
Symbol interpretations flags:
1200
- Used in the flags field of a symbol interpretation
1203
XkbSI_AutoRepeat = 1 shl 0;
1204
XkbSI_LockingKey = 1 shl 1;
1207
Symbol interpretations match specification:
1208
- Used in the match field of a symbol interpretation to specify
1209
the conditions under which an interpretation is used.
1212
XkbSI_LevelOneOnly = $80;
1215
XkbSI_AnyOfOrNone = 1;
1221
Indicator map flags:
1222
- Used in the flags field of an indicator map to indicate the
1223
conditions under which and indicator can be changed and the
1224
effects of changing the indicator.
1227
XkbIM_NoExplicit = Cardinal(1) shl 7;
1228
XkbIM_NoAutomatic = Cardinal(1) shl 6;
1229
XkbIM_LEDDrivesKB = Cardinal(1) shl 5;
1232
Indicator map component specifications:
1233
- Used by the 'which_groups' and 'which_mods' fields of an indicator
1234
map to specify which keyboard components should be used to drive
1238
XkbIM_UseBase = Cardinal(1) shl 0;
1239
XkbIM_UseLatched = Cardinal(1) shl 1;
1240
XkbIM_UseLocked = Cardinal(1) shl 2;
1241
XkbIM_UseEffective = Cardinal(1) shl 3;
1242
XkbIM_UseCompat = Cardinal(1) shl 4;
1245
XkbIM_UseAnyGroup = XkbIM_UseBase or XkbIM_UseLatched or XkbIM_UseLocked or XkbIM_UseEffective;
1246
XkbIM_UseAnyMods = XkbIM_UseAnyGroup or XkbIM_UseCompat;
1249
GetByName components:
1250
- Specifies desired or necessary components to GetKbdByName request.
1251
- Reports the components that were found in a GetKbdByNameReply
1254
XkbGBN_TypesMask = Cardinal(1) shl 0;
1255
XkbGBN_CompatMapMask = Cardinal(1) shl 1;
1256
XkbGBN_ClientSymbolsMask = Cardinal(1) shl 2;
1257
XkbGBN_ServerSymbolsMask = Cardinal(1) shl 3;
1258
XkbGBN_SymbolsMask = XkbGBN_ClientSymbolsMask or XkbGBN_ServerSymbolsMask;
1259
XkbGBN_IndicatorMapMask = Cardinal(1) shl 4;
1260
XkbGBN_KeyNamesMask = Cardinal(1) shl 5;
1261
XkbGBN_GeometryMask = Cardinal(1) shl 6;
1262
XkbGBN_OtherNamesMask = Cardinal(1) shl 7;
1263
XkbGBN_AllComponentsMask = $ff;
1266
ListComponents flags
1269
XkbLC_Hidden = Cardinal(1) shl 0;
1270
XkbLC_Default = Cardinal(1) shl 1;
1271
XkbLC_Partial = Cardinal(1) shl 2;
1273
XkbLC_AlphanumericKeys = Cardinal(1) shl 8;
1274
XkbLC_ModifierKeys = Cardinal(1) shl 9;
1275
XkbLC_KeypadKeys = Cardinal(1) shl 10;
1276
XkbLC_FunctionKeys = Cardinal(1) shl 11;
1277
XkbLC_AlternateGroup = Cardinal(1) shl 12;
1280
X Input Extension Interactions
1281
- Specifies the possible interactions between XKB and the X input
1283
- Used to request (XkbGetDeviceInfo) or change (XKbSetDeviceInfo)
1284
XKB information about an extension device.
1285
- Reports the list of supported optional features in the reply to
1286
XkbGetDeviceInfo or in an XkbExtensionDeviceNotify event.
1287
XkbXI_UnsupportedFeature is reported in XkbExtensionDeviceNotify
1288
events to indicate an attempt to use an unsupported feature.
1291
XkbXI_KeyboardsMask = Cardinal(1) shl 0;
1292
XkbXI_ButtonActionsMask = Cardinal(1) shl 1;
1293
XkbXI_IndicatorNamesMask = Cardinal(1) shl 2;
1294
XkbXI_IndicatorMapsMask = Cardinal(1) shl 3;
1295
XkbXI_IndicatorStateMask = Cardinal(1) shl 4;
1296
XkbXI_UnsupportedFeatureMask = Cardinal(1) shl 15;
1297
XkbXI_AllFeaturesMask = $001f;
1298
XkbXI_AllDeviceFeaturesMask = $001e;
1300
XkbXI_IndicatorsMask = $001c;
1301
XkbAllExtensionDeviceEventsMask = $801f;
1305
- Specifies flags to be changed by the PerClientFlags request.
1308
XkbPCF_DetectableAutoRepeatMask = Cardinal(1) shl 0;
1309
XkbPCF_GrabsUseXKBStateMask = Cardinal(1) shl 1;
1310
XkbPCF_AutoResetControlsMask = Cardinal(1) shl 2;
1311
XkbPCF_LookupStateWhenGrabbed = Cardinal(1) shl 3;
1312
XkbPCF_SendEventUsesXKBState = Cardinal(1) shl 4;
1313
XkbPCF_AllFlagsMask = $1F;
1316
Debugging flags and controls
1319
XkbDF_DisableLocks = 1 shl 0;
1322
PXkbPropertyPtr = ^TXkbPropertyRec;
1323
TXkbPropertyRec = record
1329
PXkbColorPtr = ^TXkbColorRec;
1330
TXkbColorRec = record
1336
PXkbPointPtr = ^TXkbPointRec;
1337
TXkbPointRec = record
1343
PXkbBoundsPtr = ^TXkbBoundsRec;
1344
TXkbBoundsRec = record
1351
function XkbBoundsWidth (b : PXkbBoundsPtr) : SmallInt;
1352
function XkbBoundsHeight (b : PXkbBoundsPtr) : SmallInt;
1355
PXkbOutlinePtr = ^TXkbOutlineRec;
1356
TXkbOutlineRec = record
1359
corner_radius : Word;
1360
points : PXkbPointPtr;
1364
PXkbShapePtr = ^TXkbShapeRec;
1365
TXkbShapeRec = record
1367
num_outlines : Word;
1369
outlines : PXkbOutlinePtr;
1370
approx : PXkbOutlinePtr;
1371
primary : PXkbOutlinePtr;
1372
bounds : TXkbBoundsRec;
1375
function XkbOutlineIndex (s : PXkbShapePtr; o : PXkbOutlinePtr) : longint;
1378
PXkbShapeDoodadPtr = ^TXkbShapeDoodadRec;
1379
TXkbShapeDoodadRec = record
1391
PXkbTextDoodadPtr = ^TXkbTextDoodadRec;
1392
TXkbTextDoodadRec = record
1407
PXkbIndicatorDoodadPtr = ^TXkbIndicatorDoodadRec;
1408
TXkbIndicatorDoodadRec = record
1416
on_color_ndx : Word;
1417
off_color_ndx : Word;
1421
PXkbLogoDoodadPtr = ^TXkbLogoDoodadRec;
1422
TXkbLogoDoodadRec = record
1435
PXkbAnyDoodadPtr = ^TXkbAnyDoodadRec;
1436
TXkbAnyDoodadRec = record
1446
PXkbDoodadPtr = ^TXkbDoodadRec;
1447
TXkbDoodadRec = record
1448
any : TXkbAnyDoodadRec;
1449
shape : TXkbShapeDoodadRec;
1450
text : TXkbTextDoodadRec;
1451
indicator : TXkbIndicatorDoodadRec;
1452
logo : TXkbLogoDoodadRec;
1456
XkbUnknownDoodad = 0;
1457
XkbOutlineDoodad = 1;
1460
XkbIndicatorDoodad = 4;
1464
PXkbKeyPtr = ^TXkbKeyRec;
1466
name : TXkbKeyNameRec;
1473
PXkbRowPtr = ^TXkbRowRec;
1479
vertical : SmallInt;
1481
bounds : TXkbBoundsRec;
1485
PXkbOverlayPtr = ^TXkbOverlayRec; //forward for TXkbSectionRec use.
1487
//Do not add more "type"
1488
PXkbSectionPtr = ^TXkbSectionRec;
1489
TXkbSectionRec = record
1499
num_overlays : Word;
1501
doodads : PXkbDoodadPtr;
1502
bounds : TXkbBoundsRec;
1503
overlays : PXkbOverlayPtr;
1506
//Do not add more "type"
1507
PXkbOverlayKeyPtr = ^TXkbOverlayKeyRec;
1508
TXkbOverlayKeyRec = record
1509
over : TXkbKeyNameRec;
1510
under : TXkbKeyNameRec;
1513
//Do not add more "type"
1514
PXkbOverlayRowPtr = ^TXkbOverlayRowRec;
1515
TXkbOverlayRowRec = record
1516
row_under : SmallInt;
1517
num_keys : SmallInt;
1519
keys : PXkbOverlayKeyPtr;
1522
//Do not add more "type"
1523
TXkbOverlayRec = record
1525
section_under : PXkbSectionPtr;
1528
rows : PXkbOverlayRowPtr;
1529
bounds : PXkbBoundsPtr;
1533
PXkbGeometryRec = ^TXkbGeometryRec;
1534
PXkbGeometryPtr = PXkbGeometryRec;
1535
TXkbGeometryRec = record
1540
label_color : PXkbColorPtr;
1541
base_color : PXkbColorPtr;
1542
sz_properties : Word;
1547
sz_key_aliases : Word;
1548
num_properties : Word;
1551
num_sections : Word;
1553
num_key_aliases : Word;
1554
properties : PXkbPropertyPtr;
1555
colors : PXkbColorPtr;
1556
shapes : PXkbShapePtr;
1557
sections : PXkbSectionPtr;
1558
key_aliases : PXkbKeyAliasPtr;
1562
XkbGeomPropertiesMask = 1 shl 0;
1563
XkbGeomColorsMask = 1 shl 1;
1564
XkbGeomShapesMask = 1 shl 2;
1565
XkbGeomSectionsMask = 1 shl 3;
1566
XkbGeomDoodadsMask = 1 shl 4;
1567
XkbGeomKeyAliasesMask = 1 shl 5;
1568
XkbGeomAllMask = $3f;
1571
PXkbGeometrySizesPtr = ^TXkbGeometrySizesRec;
1572
TXkbGeometrySizesRec = record
1574
num_properties : Word;
1577
num_sections : Word;
1579
num_key_aliases : Word;
1583
Tie it all together into one big keyboard description
1586
PXkbDescPtr = ^TXkbDescRec;
1587
TXkbDescRec = record
1591
min_key_code : TKeyCode;
1592
max_key_code : TKeyCode;
1593
ctrls : PXkbControlsPtr;
1594
server : PXkbServerMapPtr;
1595
map : PXkbClientMapPtr;
1596
indicators : PXkbIndicatorPtr;
1597
names : PXkbNamesPtr;
1598
compat : PXkbCompatMapPtr;
1599
geom : PXkbGeometryPtr;
1602
function XkbKeyKeyTypeIndex (d : PXkbDescPtr; k : Word; g : Byte) : Byte;
1603
function XkbKeyKeyType (d : PXkbDescPtr; k : Word; g : Byte) : PXkbKeyTypePtr;
1604
function XkbKeyGroupWidth (d : PXkbDescPtr; k : Word; g : Byte) : Byte;
1605
function XkbKeyGroupsWidth (d : PXkbDescPtr; k : Word) : Byte;
1606
function XkbKeyGroupInfo (d : PXkbDescPtr; k : Word) : Byte;
1607
function XkbKeyNumGroups (d : PXkbDescPtr; k : Word) : Byte;
1608
function XkbKeyNumSyms (d : PXkbDescPtr; k : Word) : Word;
1609
function XkbKeySymsPtr (d : PXkbDescPtr; k : Word) : PKeySym;
1610
function XkbKeySym (d : PXkbDescPtr; k : Word; n : Word) : TKeySym;
1611
function XkbKeySymEntry (d : PXkbDescPtr; k : Word; sl : Word; g : Byte) : TKeySym;
1612
function XkbKeyAction (d : PXkbDescPtr; k : Word; n : Word) : PXkbAction;
1613
function XkbKeyActionEntry (d : PXkbDescPtr; k : Word; sl : Word; g : Byte) : Byte;
1614
function XkbKeyHasActions (d : PXkbDescPtr; k : Word) : Boolean;
1615
function XkbKeyNumActions (d : PXkbDescPtr; k : Word) : Word;
1616
function XkbKeyActionsPtr (d : PXkbDescPtr; k : Word) : PXkbAction;
1617
function XkbKeycodeInRange (d : PXkbDescPtr; k : Word) : Boolean;
1618
function XkbNumKeys (d : PXkbDescPtr) : Byte;
1621
The following structures can be used to track changes
1622
to a keyboard device
1625
PXkbMapChangesPtr = ^TXkbMapChangesRec;
1626
TXkbMapChangesRec = record
1628
min_key_code : TKeyCode;
1629
max_key_code : TKeyCode;
1632
first_key_sym : TKeyCode;
1633
num_key_syms : Byte;
1634
first_key_act : TKeyCode;
1635
num_key_acts : Byte;
1636
first_key_behavior : TKeyCode;
1637
num_key_behaviors : Byte;
1638
first_key_explicit : TKeyCode;
1639
num_key_explicit : Byte;
1640
first_modmap_key : TKeyCode;
1641
num_modmap_keys : Byte;
1642
first_vmodmap_key : TKeyCode;
1643
num_vmodmap_keys : Byte;
1649
PXkbControlsChangesPtr = ^TXkbControlsChangesRec;
1650
TXkbControlsChangesRec = record
1651
changed_ctrls : Word;
1652
enabled_ctrls_changes : Word;
1653
num_groups_changed : Boolean;
1657
PXkbIndicatorChangesPtr = ^TXkbIndicatorChangesRec;
1658
TXkbIndicatorChangesRec = record
1659
state_changes : Word;
1664
PXkbNameChangesPtr = ^TXkbNameChangesRec;
1665
TXkbNameChangesRec = record
1675
changed_vmods : Word;
1676
changed_indicators : LongWord;
1677
changed_groups : Byte;
1681
PXkbCompatChangesPtr = ^TXkbCompatChangesRec;
1682
TXkbCompatChangesRec = record
1683
changed_groups : Byte;
1689
PXkbChangesPtr = ^TXkbChangesRec;
1690
TXkbChangesRec = record
1692
state_changes : Word;
1693
map : TXkbMapChangesRec;
1694
ctrls : TXkbControlsChangesRec;
1695
indicators : TXkbIndicatorChangesRec;
1696
names : TXkbNameChangesRec;
1697
compat : TXkbCompatChangesRec;
1701
These data structures are used to construct a keymap from
1702
a set of components or to list components in the server
1706
PXkbComponentNamesPtr = ^TXkbComponentNamesRec;
1707
TXkbComponentNamesRec = record
1709
keycodes : PShortInt;
1712
symbols : PShortInt;
1713
geometry : PShortInt;
1717
PXkbComponentNamePtr = ^TXkbComponentNameRec;
1718
TXkbComponentNameRec = record
1724
PXkbComponentListPtr = ^TXkbComponentListRec;
1725
TXkbComponentListRec = record
1726
num_keymaps : SmallInt;
1727
num_keycodes : SmallInt;
1728
num_types : SmallInt;
1729
num_compat : SmallInt;
1730
num_symbols : SmallInt;
1731
num_geometry : SmallInt;
1732
keymaps : PXkbComponentNamePtr;
1733
keycodes : PXkbComponentNamePtr;
1734
types : PXkbComponentNamePtr;
1735
compat : PXkbComponentNamePtr;
1736
symbols : PXkbComponentNamePtr;
1737
geometry : PXkbComponentNamePtr;
1741
The following data structures describe and track changes to a
1742
non-keyboard extension device
1745
PXkbDeviceLedInfoPtr = ^TXkbDeviceLedInfoRec;
1746
TXkbDeviceLedInfoRec = record
1749
phys_indicators : Word;
1750
maps_present : Word;
1751
names_present : Word;
1753
names : array [0..XkbNumIndicators -1] of TAtom;
1754
maps : array [0..XkbNumIndicators -1] of TXkbIndicatorMapRec;
1758
PXkbDeviceInfoPtr = ^TXkbDeviceInfoRec;
1759
TXkbDeviceInfoRec = record
1763
has_own_state : Boolean;
1767
btn_acts : PXkbAction;
1772
leds : PXkbDeviceLedInfoPtr;
1775
function XkbXI_DevHasBtnActs (d : PXkbDeviceInfoPtr) : Boolean;
1776
function XkbXI_LegalDevBtn (d : PXkbDeviceInfoPtr; b : Word) : Boolean;
1777
function XkbXI_DevHasLeds (d : PXkbDeviceInfoPtr) : Boolean;
1780
PXkbDeviceLedChangesPtr = ^TXkbDeviceLedChangesRec;
1781
TXkbDeviceLedChangesRec = record
1784
defined : Word; //names or maps changed
1785
next : PXkbDeviceLedChangesPtr;
1789
PXkbDeviceChangesPtr = ^TXkbDeviceChangesRec;
1790
TXkbDeviceChangesRec = record
1794
leds : TXkbDeviceLedChangesRec;
1797
function XkbShapeDoodadColor (g : PXkbGeometryPtr; d : PXkbShapeDoodadPtr) : PXkbColorPtr;
1798
function XkbShapeDoodadShape (g : PXkbGeometryPtr; d : PXkbShapeDoodadPtr) : PXkbShapePtr;
1799
procedure XkbSetShapeDoodadColor (g : PXkbGeometryPtr; d : PXkbShapeDoodadPtr; c : PXkbColorPtr);
1800
procedure XkbSetShapeDoodadShape (g : PXkbGeometryPtr; d : PXkbShapeDoodadPtr; s : PXkbShapePtr);
1802
function XkbTextDoodadColor (g : PXkbGeometryPtr; d : PXkbTextDoodadPtr) : PXkbColorPtr;
1803
procedure XkbSetTextDoodadColor (g : PXkbGeometryPtr; d : PXkbTextDoodadPtr; c : PXkbColorPtr);
1805
function XkbIndicatorDoodadShape (g : PXkbGeometryPtr; d : PXkbIndicatorDoodadPtr)
1806
: PXkbShapeDoodadPtr;
1807
function XkbIndicatorDoodadOnColor (g : PXkbGeometryPtr; d : PXkbIndicatorDoodadPtr) : PXkbColorPtr;
1808
function XkbIndicatorDoodadOffColor (g : PXkbGeometryPtr; d : PXkbIndicatorDoodadPtr) : PXkbColorPtr;
1809
procedure XkbSetIndicatorDoodadOnColor (g : PXkbGeometryPtr; d : PXkbIndicatorDoodadPtr;
1811
procedure XkbSetIndicatorDoodadOffColor (g : PXkbGeometryPtr; d : PXkbIndicatorDoodadPtr;
1813
procedure XkbSetIndicatorDoodadShape (g : PXkbGeometryPtr; d : PXkbIndicatorDoodadPtr;
1814
s : PXkbShapeDoodadPtr);
1816
function XkbLogoDoodadColor (g : PXkbGeometryPtr; d : PXkbLogoDoodadPtr) : PXkbColorPtr;
1817
function XkbLogoDoodadShape (g : PXkbGeometryPtr; d : PXkbLogoDoodadPtr) : PXkbShapeDoodadPtr;
1818
procedure XkbSetLogoDoodadColor (g : PXkbGeometryPtr; d : PXkbLogoDoodadPtr; c : PXkbColorPtr);
1819
procedure XkbSetLogoDoodadShape (g : PXkbGeometryPtr; d : PXkbLogoDoodadPtr; s : PXkbShapeDoodadPtr);
1821
function XkbKeyShape (g : PXkbGeometryPtr; k : PXkbKeyPtr) : PXkbShapeDoodadPtr;
1822
function XkbKeyColor (g : PXkbGeometryPtr; k : PXkbKeyPtr) : PXkbColorPtr;
1823
procedure XkbSetKeyShape (g : PXkbGeometryPtr; k : PXkbKeyPtr; s : PXkbShapeDoodadPtr);
1824
procedure XkbSetKeyColor (g : PXkbGeometryPtr; k : PXkbKeyPtr; c : PXkbColorPtr);
1826
function XkbGeomColorIndex (g : PXkbGeometryPtr; c : PXkbColorPtr) : longint;
1828
function XkbAddGeomProperty (geom : PXkbGeometryPtr; name : PChar; value : PChar) : PXkbPropertyPtr;
1829
cdecl; external libX11 name 'XkbAddGeomProperty';
1831
function XkbAddGeomKeyAlias (geom : PXkbGeometryPtr; alias : PChar; real : PChar) : PXkbKeyAliasPtr;
1832
cdecl; external libX11 name 'XkbAddGeomKeyAlias';
1834
function XkbAddGeomColor (geom : PXkbGeometryPtr; spec : PChar; pixel : Word) : PXkbColorPtr;
1835
cdecl; external libX11 name 'XkbAddGeomColor';
1837
function XkbAddGeomOutline (shape : PXkbShapePtr; sz_points : SmallInt) : PXkbOutlinePtr;
1838
cdecl; external libX11 name 'XkbAddGeomOutline';
1840
function XkbAddGeomShape (geom : PXkbGeometryPtr; name : TAtom; sz_outlines : SmallInt) : PXkbShapePtr;
1841
cdecl; external libX11 name 'XkbAddGeomShape';
1843
function XkbAddGeomKey (row : PXkbRowPtr) : PXkbKeyPtr;
1844
cdecl; external libX11 name 'XkbAddGeomKey';
1846
function XkbAddGeomRow (section : PXkbSectionPtr; sz_keys : SmallInt) : PXkbRowPtr;
1847
cdecl; external libX11 name 'XkbAddGeomRow';
1849
function XkbAddGeomSection (geom : PXkbGeometryPtr; name : TAtom;
1850
sz_rows : SmallInt; sz_doodads : SmallInt;
1851
sz_overlays : SmallInt) : PXkbSectionPtr;
1852
cdecl; external libX11 name 'XkbAddGeomSection';
1854
function XkbAddGeomOverlay (section : PXkbSectionPtr; name : TAtom; sz_rows : SmallInt) : PXkbOverlayPtr;
1855
cdecl; external libX11 name 'XkbAddGeomOverlay';
1857
function XkbAddGeomOverlayRow (overlay : PXkbOverlayPtr; row_under : SmallInt;
1858
sz_keys : SmallInt) : PXkbOverlayRowPtr;
1859
cdecl; external libX11 name 'XkbAddGeomOverlayRow';
1861
function XkbAddGeomOverlayKey (overlay : PXkbOverlayPtr; row : PXkbOverlayRowPtr;
1862
over : PChar; under : PChar) : PXkbOverlayKeyPtr;
1863
cdecl; external libX11 name 'XkbAddGeomOverlayKey';
1865
function XkbAddGeomDoodad (geom : PXkbGeometryPtr; section : PXkbSectionPtr; name : TAtom) : PXkbDoodadPtr;
1866
cdecl; external libX11 name 'XkbAddGeomDoodad';
1868
procedure XkbFreeGeomKeyAliases (geom : PXkbGeometryPtr; first : SmallInt;
1869
count : SmallInt; freeAll : Boolean);
1870
cdecl; external libX11 name 'XkbFreeGeomKeyAliases';
1872
procedure XkbFreeGeomColors (geom : PXkbGeometryPtr; first : SmallInt; count : SmallInt; freeAll : Boolean);
1873
cdecl; external libX11 name 'XkbFreeGeomColors';
1875
procedure XkbFreeGeomDoodads (doodads : PXkbDoodadPtr; nDoodads : SmallInt; freeAll : Boolean);
1876
cdecl; external libX11 name 'XkbFreeGeomDoodads';
1878
procedure XkbFreeGeomProperties (geom : PXkbGeometryPtr; first : SmallInt;
1879
count : SmallInt; freeAll : Boolean);
1880
cdecl; external libX11 name 'XkbFreeGeomProperties';
1882
procedure XkbFreeGeomOverlayKeys (row : PXkbOverlayRowPtr; first : SmallInt;
1883
count : SmallInt; freeAll : Boolean);
1884
cdecl; external libX11 name 'XkbFreeGeomOverlayKeys';
1886
procedure XkbFreeGeomOverlayRows (overlay : PXkbOverlayPtr; first : SmallInt;
1887
count : SmallInt; freeAll : Boolean);
1888
cdecl; external libX11 name 'XkbFreeGeomOverlayRows';
1890
procedure XkbFreeGeomOverlays (section : PXkbSectionPtr; first : SmallInt;
1891
count : SmallInt; freeAll : Boolean);
1892
cdecl; external libX11 name 'XkbFreeGeomOverlays';
1894
procedure XkbFreeGeomKeys (row : PXkbRowPtr; first : SmallInt; count : SmallInt; freeAll : Boolean);
1895
cdecl; external libX11 name 'XkbFreeGeomKeys';
1897
procedure XkbFreeGeomRows (section : PXkbSectionPtr; first : SmallInt;
1898
count : SmallInt; freeAll : Boolean);
1899
cdecl; external libX11 name 'XkbFreeGeomRows';
1901
procedure XkbFreeGeomSections (geom : PXkbGeometryPtr; first : SmallInt;
1902
count : SmallInt; freeAll : Boolean);
1903
cdecl; external libX11 name 'XkbFreeGeomSections';
1905
procedure XkbFreeGeomPoints (outline : PXkbOutlinePtr; first : SmallInt;
1906
count : SmallInt; freeAll : Boolean);
1907
cdecl; external libX11 name 'XkbFreeGeomPoints';
1909
procedure XkbFreeGeomOutlines (shape : PXkbShapePtr; first : SmallInt;
1910
count : SmallInt; freeAll : Boolean);
1911
cdecl; external libX11 name 'XkbFreeGeomOutlines';
1913
procedure XkbFreeGeomShapes (geom : PXkbGeometryPtr; first : SmallInt;
1914
count : SmallInt; freeAll : Boolean);
1915
cdecl; external libX11 name 'XkbFreeGeomShapes';
1917
procedure XkbFreeGeometry (geom : PXkbGeometryPtr; which : Word; freeMap : Boolean);
1918
cdecl; external libX11 name 'XkbFreeGeometry';
1920
function XkbAllocGeomProps (geom : PXkbGeometryPtr; nProps : SmallInt) : TStatus;
1921
cdecl; external libX11 name 'XkbAllocGeomProps';
1923
function XkbAllocGeomKeyAliases (geom : PXkbGeometryPtr; nAliases : SmallInt) : TStatus;
1924
cdecl; external libX11 name 'XkbAllocGeomKeyAliases';
1926
function XkbAllocGeomColors (geom : PXkbGeometryPtr; nColors : SmallInt) : TStatus;
1927
cdecl; external libX11 name 'XkbAllocGeomColors';
1929
function XkbAllocGeomShapes (geom : PXkbGeometryPtr; nShapes : SmallInt) : TStatus;
1930
cdecl; external libX11 name 'XkbAllocGeomShapes';
1932
function XkbAllocGeomSections (geom : PXkbGeometryPtr; nSections : SmallInt) : TStatus;
1933
cdecl; external libX11 name 'XkbAllocGeomSections';
1935
function XkbAllocGeomOverlays (section : PXkbSectionPtr; num_needed : SmallInt) : TStatus;
1936
cdecl; external libX11 name 'XkbAllocGeomOverlays';
1938
function XkbAllocGeomOverlayRows (overlay : PXkbOverlayPtr; num_needed : SmallInt) : TStatus;
1939
cdecl; external libX11 name 'XkbAllocGeomOverlayRows';
1941
function XkbAllocGeomOverlayKeys (row : PXkbOverlayRowPtr; num_needed : SmallInt) : TStatus;
1942
cdecl; external libX11 name 'XkbAllocGeomOverlayKeys';
1944
function XkbAllocGeomDoodads (geom : PXkbGeometryPtr; nDoodads : SmallInt) : TStatus;
1945
cdecl; external libX11 name 'XkbAllocGeomDoodads';
1947
function XkbAllocGeomSectionDoodads (section : PXkbSectionPtr; nDoodads : SmallInt) : TStatus;
1948
cdecl; external libX11 name 'XkbAllocGeomSectionDoodads';
1950
function XkbAllocGeomOutlines (shape : PXkbShapePtr; nOL : SmallInt) : TStatus;
1951
cdecl; external libX11 name 'XkbAllocGeomOutlines';
1953
function XkbAllocGeomRows (section : PXkbSectionPtr; nRows : SmallInt) : TStatus;
1954
cdecl; external libX11 name 'XkbAllocGeomRows';
1956
function XkbAllocGeomPoints (ol : PXkbOutlinePtr; nPts : SmallInt) : TStatus;
1957
cdecl; external libX11 name 'XkbAllocGeomPoints';
1959
function XkbAllocGeomKeys (row : PXkbRowPtr; nKeys : SmallInt) : TStatus;
1960
cdecl; external libX11 name 'XkbAllocGeomKeys';
1962
function XkbAllocGeometry (xkb : PXkbDescPtr; sizes : PXkbGeometrySizesPtr) : TStatus;
1963
cdecl; external libX11 name 'XkbAllocGeometry';
1965
function XkbSetGeometry (dpy : PDisplay; deviceSpec : Word; geom : PXkbGeometryPtr) : TStatus;
1966
cdecl; external libX11 name 'XkbSetGeometry';
1968
function XkbComputeShapeTop (shape : PXkbShapePtr; bounds : PXkbBoundsPtr) : Boolean;
1969
cdecl; external libX11 name 'XkbComputeShapeTop';
1971
function XkbComputeShapeBounds (shape : PXkbShapePtr) : Boolean;
1972
cdecl; external libX11 name 'XkbComputeShapeBounds';
1974
function XkbComputeRowBounds (geom : PXkbGeometryPtr; section : PXkbSectionPtr; row : PXkbRowPtr) : Boolean;
1975
cdecl; external libX11 name 'XkbComputeRowBounds';
1977
function XkbComputeSectionBounds (geom : PXkbGeometryPtr; section : PXkbSectionPtr) : Boolean;
1978
cdecl; external libX11 name 'XkbComputeSectionBounds';
1980
function XkbFindOverlayForKey (geom : PXkbGeometryPtr; wanted : PXkbSectionPtr; under : PChar) : PChar;
1981
cdecl; external libX11 name 'XkbFindOverlayForKey';
1983
function XkbGetGeometry (dpy : PDisplay; xkb : PXkbDescPtr) : TStatus;
1984
cdecl; external libX11 name 'XkbGetGeometry';
1986
function XkbGetNamedGeometry (dpy : PDisplay; xkb : PXkbDescPtr; name : TAtom) : TStatus;
1987
cdecl; external libX11 name 'XkbGetNamedGeometry';
1990
{$ifdef XKB_IN_SERVER}
1991
function SrvXkbAddGeomKeyAlias (geom : PXkbGeometryPtr; alias : PChar; real : PChar) : PXkbKeyAliasPtr;
1992
cdecl; external libX11 name 'XkbAddGeomKeyAlias';
1994
function SrvXkbAddGeomColor (geom : PXkbGeometryPtr; spec : PChar; pixel : Word) : PXkbColorPtr;
1995
cdecl; external libX11 name 'XkbAddGeomColor';
1997
function SrvXkbAddGeomDoodad (geom : PXkbGeometryPtr; section : PXkbSectionPtr;
1998
name : TAtom) : PXkbDoodadPtr;
1999
cdecl; external libX11 name 'XkbAddGeomDoodad';
2001
function SrvXkbAddGeomKey (geom : PXkbGeometryPtr; alias : PChar; real : PChar) : PXkbKeyAliasPtr;
2002
cdecl; external libX11 name 'XkbAddGeomKeyAlias';
2004
function SrvXkbAddGeomOutline (shape : PXkbShapePtr; sz_points : SmallInt) : PXkbOutlinePtr;
2005
cdecl; external libX11 name 'XkbAddGeomOutline';
2007
function SrvXkbAddGeomOverlay (overlay : PXkbOverlayPtr; row : PXkbOverlayRowPtr;
2008
over : PChar; under : PChar) : PXkbOverlayKeyPtr;
2009
cdecl; external libX11 name 'XkbAddGeomOverlayKey';
2011
function SrvXkbAddGeomOverlayRow (overlay : PXkbOverlayPtr; row_under : SmallInt;
2012
sz_keys : SmallInt) : PXkbOverlayRowPtr
2013
cdecl; external libX11 name 'XkbAddGeomOverlayRow';
2015
function SrvXkbAddGeomOverlayKey (overlay : PXkbOverlayPtr; row : PXkbOverlayRowPtr;
2016
over : PChar; under : PChar) : PXkbOverlayKeyPtr;
2017
cdecl; external libX11 name 'XkbAddGeomOverlayKey';
2019
function SrvXkbAddGeomProperty (geom : PXkbGeometryPtr; name : PChar; value : PChar) : PXkbPropertyPtr;
2020
cdecl; external libX11 name 'XkbAddGeomProperty';
2022
function SrvXkbAddGeomRow (section : PXkbSectionPtr; sz_keys : SmallInt) : PXkbRowPtr;
2023
cdecl; external libX11 name 'XkbAddGeomRow';
2025
function SrvXkbAddGeomSection (geom : PXkbGeometryPtr; name : TAtom;
2026
sz_rows : SmallInt; sz_doodads : SmallInt;
2027
sz_overlays : SmallInt) : PXkbSectionPtr;
2028
cdecl; external libX11 name 'XkbAddGeomSection';
2030
function SrvXkbAddGeomShape (geom : PXkbGeometryPtr; name : TAtom; sz_outlines : SmallInt) : PXkbShapePtr;
2031
cdecl; external libX11 name 'XkbAddGeomShape';
2033
function SrvXkbAllocGeomKeyAliases (geom : PXkbGeometryPtr; nAliases : SmallInt) : TStatus;
2034
cdecl; external libX11 name 'XkbAllocGeomKeyAliases';
2036
function SrvXkbAllocGeomColors (geom : PXkbGeometryPtr; nColors : SmallInt) : TStatus;
2037
cdecl; external libX11 name 'XkbAllocGeomColors';
2039
function SrvXkbAllocGeomDoodads (geom : PXkbGeometryPtr; nDoodads : SmallInt) : TStatus;
2040
cdecl; external libX11 name 'XkbAllocGeomDoodads';
2042
function SrvXkbAllocGeomKeys (row : PXkbRowPtr; nKeys : SmallInt) : TStatus;
2043
cdecl; external libX11 name 'XkbAllocGeomKeys';
2045
function SrvXkbAllocGeomOutlines (shape : PXkbShapePtr; nOL : SmallInt) : TStatus;
2046
cdecl; external libX11 name 'XkbAllocGeomOutlines';
2048
function SrvXkbAllocGeomPoints (ol : PXkbOutlinePtr; nPts : SmallInt) : TStatus;
2049
cdecl; external libX11 name 'XkbAllocGeomPoints';
2051
function SrvXkbAllocGeomProps (geom : PXkbGeometryPtr; nProps : SmallInt) : TStatus;
2052
cdecl; external libX11 name 'XkbAllocGeomProps';
2054
function SrvXkbAllocGeomRows (section : PXkbSectionPtr; nRows : SmallInt) : TStatus;
2055
cdecl; external libX11 name 'XkbAllocGeomRows';
2057
function SrvXkbAllocGeomSectionDoodads (section : PXkbSectionPtr; nDoodads : SmallInt) : TStatus;
2058
cdecl; external libX11 name 'XkbAllocGeomSectionDoodads';
2060
function SrvXkbAllocGeomSections (geom : PXkbGeometryPtr; nSections : SmallInt) : TStatus;
2061
cdecl; external libX11 name 'XkbAllocGeomSections';
2063
function SrvXkbAllocGeomOverlays (section : PXkbSectionPtr; num_needed : SmallInt) : TStatus;
2064
cdecl; external libX11 name 'XkbAllocGeomOverlays';
2066
function SrvXkbAllocGeomOverlayRows (overlay : PXkbOverlayPtr; num_needed : SmallInt) : TStatus;
2067
cdecl; external libX11 name 'XkbAllocGeomOverlayRows';
2069
function SrvXkbAllocGeomOverlayKeys (row : PXkbOverlayRowPtr; num_needed : SmallInt) : TStatus;
2070
cdecl; external libX11 name 'XkbAllocGeomOverlayKeys';
2072
function SrvXkbAllocGeomShapes (geom : PXkbGeometryPtr; nShapes : SmallInt) : TStatus;
2073
cdecl; external libX11 name 'XkbAllocGeomShapes';
2075
function SrvXkbAllocGeometry (xkb : PXkbDescPtr; sizes : PXkbGeometrySizesPtr) : TStatus;
2076
cdecl; external libX11 name 'XkbAllocGeometry';
2078
procedure SrvXkbFreeGeomKeyAliases (geom : PXkbGeometryPtr; first : SmallInt;
2079
count : SmallInt; freeAll : Boolean);
2080
cdecl; external libX11 name 'XkbFreeGeomKeyAliases';
2082
procedure SrvXkbFreeGeomColors (geom : PXkbGeometryPtr; first : SmallInt;
2083
count : SmallInt; freeAll : Boolean);
2084
cdecl; external libX11 name 'XkbFreeGeomColors';
2086
procedure SrvXkbFreeGeomDoodads (doodads : PXkbDoodadPtr; nDoodads : SmallInt; freeAll : Boolean);
2087
cdecl; external libX11 name 'XkbFreeGeomDoodads';
2089
procedure SrvXkbFreeGeomProperties (geom : PXkbGeometryPtr; first : SmallInt;
2090
count : SmallInt; freeAll : Boolean);
2091
cdecl; external libX11 name 'XkbFreeGeomProperties';
2093
procedure SrvXkbFreeGeomOverlayKeys (row : PXkbOverlayRowPtr; first : SmallInt;
2094
count : SmallInt; freeAll : Boolean);
2095
cdecl; external libX11 name 'XkbFreeGeomOverlayKeys';
2097
procedure SrvXkbFreeGeomOverlayRows (overlay : PXkbOverlayPtr; first : SmallInt;
2098
count : SmallInt; freeAll : Boolean);
2099
cdecl; external libX11 name 'XkbFreeGeomOverlayRows';
2101
procedure SrvXkbFreeGeomOverlays (section : PXkbSectionPtr; first : SmallInt;
2102
count : SmallInt; freeAll : Boolean);
2103
cdecl; external libX11 name 'XkbFreeGeomOverlays';
2105
procedure SrvXkbFreeGeomKeys (row : PXkbRowPtr; first : SmallInt; count : SmallInt; freeAll : Boolean);
2106
cdecl; external libX11 name 'XkbFreeGeomKeys';
2108
procedure SrvXkbFreeGeomRows (section : PXkbSectionPtr; first : SmallInt;
2109
count : SmallInt; freeAll : Boolean);
2110
cdecl; external libX11 name 'XkbFreeGeomRows';
2112
procedure SrvXkbFreeGeomSections (geom : PXkbGeometryPtr; first : SmallInt;
2113
count : SmallInt; freeAll : Boolean);
2114
cdecl; external libX11 name 'XkbFreeGeomSections';
2116
procedure SrvXkbFreeGeomPoints (outline : PXkbOutlinePtr; first : SmallInt;
2117
count : SmallInt; freeAll : Boolean);
2118
cdecl; external libX11 name 'XkbFreeGeomPoints';
2120
procedure SrvXkbFreeGeomOutlines (shape : PXkbShapePtr; first : SmallInt;
2121
count : SmallInt; freeAll : Boolean);
2122
cdecl; external libX11 name 'XkbFreeGeomOutlines';
2124
procedure SrvXkbFreeGeomShapes (geom : PXkbGeometryPtr; first : SmallInt;
2125
count : SmallInt; freeAll : Boolean);
2126
cdecl; external libX11 name 'XkbFreeGeomShapes';
2128
procedure SrvXkbFreeGeometry (geom : PXkbGeometryPtr; which : Word; freeMap : Boolean);
2129
cdecl; external libX11 name 'XkbFreeGeometry';
2135
(************************************* xkb *************************************)
2136
function XkbLegalXILedClass (c : Cardinal) : LongBool;
2138
{#define XkbLegalXILedClass(c) (((c)==KbdFeedbackClass)||((c)==LedFeedbackClass)||
2139
((c)==XkbDfltXIClass)||((c)==XkbAllXIClasses))}
2140
Result := (c = KbdFeedbackClass) or (c = LedFeedbackClass) or
2141
(c = XkbDfltXIClass) or (c = XkbAllXIClasses);
2144
function XkbLegalXIBellClass (c : Cardinal) : LongBool;
2146
{#define XkbLegalXIBellClass(c) (((c)==KbdFeedbackClass)||((c)==BellFeedbackClass)||
2147
((c)==XkbDfltXIClass)||((c)==XkbAllXIClasses))}
2148
Result := (c = KbdFeedbackClass) or (c = BellFeedbackClass) or
2149
(c = XkbDfltXIClass) or (c = XkbAllXIClasses);
2152
function XkbExplicitXIDevice (c : Cardinal) : LongBool;
2154
{#define XkbExplicitXIDevice(c) (((c)&(~0xff))==0)}
2155
Result := (c and (not $ff)) = 0;
2158
function XkbExplicitXIClass (c : Cardinal) : LongBool;
2160
{#define XkbExplicitXIClass(c) (((c)&(~0xff))==0)}
2161
Result := (c and (not $ff)) = 0;
2164
function XkbExplicitXIId (c : Cardinal) : LongBool;
2166
{#define XkbExplicitXIId(c) (((c)&(~0xff))==0)}
2167
Result := (c and (not $ff)) = 0;
2170
function XkbSingleXIClass (c : Cardinal) : LongBool;
2172
{#define XkbSingleXIClass(c) ((((c)&(~0xff))==0)||((c)==XkbDfltXIClass))}
2173
Result := ((c and (not $ff)) = 0) or (c = XkbDfltXIClass);
2176
function XkbSingleXIId (c : Cardinal) : LongBool;
2178
{#define XkbSingleXIId(c) ((((c)&(~0xff))==0)||((c)==XkbDfltXIId))}
2179
Result := ((c and (not $ff)) = 0) or (c = XkbDfltXIId);
2182
function XkbBuildCoreState (m, g : Cardinal) : Cardinal;
2184
{#define XkbBuildCoreState(m,g) ((((g)&0x3)<<13)|((m)&0xff))}
2185
Result := ((g and $3) shl 13) or (m and $ff);
2188
function XkbGroupForCoreState (s : Cardinal) : Cardinal;
2190
{#define XkbGroupForCoreState(s) (((s)>>13)&0x3)}
2191
Result := (s shr 13) and $3;
2194
function XkbIsLegalGroup (g : Cardinal) : LongBool;
2196
{#define XkbIsLegalGroup(g) (((g)>=0)&&((g)<XkbNumKbdGroups))}
2197
Result := (g >= 0) and (g < XkbNumKbdGroups);
2200
function XkbSA_ValOp (a : Cardinal) : Cardinal;
2202
{#define XkbSA_ValOp(a) ((a)&XkbSA_ValOpMask)}
2203
Result := a and XkbSA_ValOpMask;
2206
function XkbSA_ValScale (a : Cardinal) : Cardinal;
2208
{#define XkbSA_ValScale(a) ((a)&XkbSA_ValScaleMask)}
2209
Result := a and XkbSA_ValScaleMask;
2212
function XkbIsModAction (a : PXkbAnyAction) : LongBool;
2214
{#define XkbIsModAction(a) (((a)->type>=Xkb_SASetMods)&&((a)->type<=XkbSA_LockMods))}
2215
Result := (a^._type >= XkbSA_SetMods) and (a^._type <= XkbSA_LockMods);
2218
function XkbIsGroupAction (a : PXkbAnyAction) : LongBool;
2220
{#define XkbIsGroupAction(a) (((a)->type>=XkbSA_SetGroup)&&((a)->type<=XkbSA_LockGroup))}
2221
Result := (a^._type >= XkbSA_SetGroup) or (a^._type <= XkbSA_LockGroup);
2224
function XkbIsPtrAction (a : PXkbAnyAction) : LongBool;
2226
{#define XkbIsPtrAction(a) (((a)->type>=XkbSA_MovePtr)&&((a)->type<=XkbSA_SetPtrDflt))}
2227
Result := (a^._type >= XkbSA_MovePtr) and (a^._type <= XkbSA_SetPtrDflt);
2230
function XkbIsLegalKeycode (const k : Cardinal) : LongBool;
2232
{#define XkbIsLegalKeycode(k) (((k)>=XkbMinLegalKeyCode)&&((k)<=XkbMaxLegalKeyCode))}
2233
Result := (k >= XkbMinLegalKeyCode) and (k <= XkbMaxLegalKeyCode);
2236
function XkbShiftLevel (n : Byte) : Byte;
2238
{#define XkbShiftLevel(n) ((n)-1)}
2242
function XkbShiftLevelMask (n : Byte) : Byte;
2244
{#define XkbShiftLevelMask(n) (1<<((n)-1))}
2245
Result := 1 shl (n - 1);
2248
(********************************** End of xkb **********************************)
2250
(************************************ xkbstr ************************************)
2251
function XkbCharToInt (v : Byte) : SmallInt;
2253
{#define XkbCharToInt(v) ((v)&0x80?(int)((v)|(~0xff)):(int)((v)&0x7f))}
2254
if ((v and $80)<>0) then
2255
Result := v or (not $ff)
2257
Result := longint (v) and $7f;
2260
procedure XkbIntTo2Chars (i : word; var h, l : byte);
2262
{#define XkbIntTo2Chars(i,h,l) (((h)=((i>>8)&0xff)),((l)=((i)&0xff)))}
2263
h := (i shr 8) and $ff;
2267
function Xkb2CharsToInt (h, l : Byte) : SmallInt;
2270
{$IFDEF UNSIGNEDBITFIELDS}
2276
{#define Xkb2CharsToInt(h,l) ((h)&0x80?(int)(((h)<<8)|(l)|(~0xffff)): (int)(((h)<<8)|(l)&0x7fff))}
2277
if ((h = $80) <> 0) then
2278
Result := ((LongInt (h) shl 8) or l or (not $ffff))
2280
Result := ((LongInt (h) shl 8) or l and $7fff));
2282
{#define Xkb2CharsToInt(h,l) ((short)(((h)<<8)|(l)))}
2283
Result := (integer (h) shl 8) or l;
2287
function XkbModLocks (s : PXkbStatePtr) : Byte;
2289
{#define XkbModLocks(s) ((s)->locked_mods)}
2290
Result := s^.locked_mods;
2293
function XkbStateMods (s : PXkbStatePtr) : Word;
2295
{#define XkbStateMods(s) ((s)->base_mods|(s)->latched_mods|XkbModLocks(s))}
2296
Result := s^.base_mods or s^.latched_mods or XkbModLocks (s);
2299
function XkbGroupLock (s : PXkbStatePtr) : Byte;
2301
{#define XkbGroupLock(s) ((s)->locked_group)}
2302
Result := s^.locked_group;
2305
function XkbStateGroup (s : PXkbStatePtr) : Word;
2307
{#define XkbStateGroup(s) ((s)->base_group+(s)->latched_group+XkbGroupLock(s))}
2308
Result := S^.base_group + s^.latched_group + XkbGroupLock (s);
2311
function XkbStateFieldFromRec (s : PXkbStatePtr) : Cardinal;
2313
{#define XkbStateFieldFromRec(s) XkbBuildCoreState((s)->lookup_mods,(s)->group)}
2314
Result := XkbBuildCoreState (s^.lookup_mods, s^.group);
2317
function XkbGrabStateFromRec (s : PXkbStatePtr) : Cardinal;
2319
{#define XkbGrabStateFromRec(s) XkbBuildCoreState((s)->grab_mods,(s)->group)}
2320
Result := XkbBuildCoreState (s^.grab_mods, s^.group);
2323
function XkbNumGroups (g : Word) : Word;
2325
{#define XkbNumGroups(g) ((g)&0x0f)}
2326
Result := g and $0f;
2329
function XkbOutOfRangeGroupInfo (g : Word) : Word;
2331
{#define XkbOutOfRangeGroupInfo(g) ((g)&0xf0)}
2332
Result := g and $f0;
2335
function XkbOutOfRangeGroupAction (g : Word) : Word;
2337
{#define XkbOutOfRangeGroupAction(g) ((g)&0xc0)}
2338
Result := g and $c0;
2341
function XkbOutOfRangeGroupNumber (g : Word) : Word;
2343
{#define XkbOutOfRangeGroupNumber(g) (((g)&0x30)>>4)}
2344
Result := (g and $30) shr 4;
2347
function XkbSetGroupInfo (g, w, n : Word) : Word;
2349
{#define XkbSetGroupInfo(g,w,n) (((w)&0xc0)|(((n)&3)<<4)|((g)&0x0f))}
2350
Result := (w and $c0) or ((n and 3) shl 4) or (g and $0f);
2353
function XkbSetNumGroups (g, n : Word) : Word;
2355
{#define XkbSetNumGroups(g,n) (((g)&0xf0)|((n)&0x0f))}
2356
Result := (g and $f0) or (n and $0f);
2359
function XkbModActionVMods (a : PXkbModAction) : SmallInt;
2361
{#define XkbModActionVMods(a) ((short)(((a)->vmods1<<8)|((a)->vmods2)))}
2362
Result := (integer (a^.vmods1) shl 8) or a^.vmods2;
2365
procedure XkbSetModActionVMods (a : PXkbModAction; v : Byte);
2367
{#define XkbSetModActionVMods(a,v) (((a)->vmods1=(((v)>>8)&0xff)),(a)->vmods2=((v)&0xff))}
2368
a^.vmods1 := (v shr 8) and $ff;
2369
a^.vmods2 := v and $ff;
2372
function XkbSAGroup (a : PXkbGroupAction) : ShortInt;
2374
{#define XkbSAGroup(a) (XkbCharToInt((a)->group_XXX))}
2375
Result := ShortInt(XkbCharToInt(a^.group_XXX));
2378
procedure XkbSASetGroup (a : PXkbGroupAction; g : ShortInt);
2380
{#define XkbSASetGroup(a,g) ((a)->group_XXX=(g))}
2384
function XkbPtrActionX (a : PXkbPtrAction) : Word;
2386
{#define XkbPtrActionX(a) (Xkb2CharsToInt((a)->high_XXX,(a)->low_XXX))}
2387
Result := Word(Xkb2CharsToInt(a^.high_XXX,a^.low_XXX));
2390
function XkbPtrActionY (a : PXkbPtrAction) : Word;
2392
{#define XkbPtrActionY(a) (Xkb2CharsToInt((a)->high_YYY,(a)->low_YYY))}
2393
Result := Word(Xkb2CharsToInt(a^.high_YYY,a^.low_YYY));
2396
procedure XkbSetPtrActionX (a : PXkbPtrAction; x : Byte);
2398
{#define XkbSetPtrActionX(a,x) (XkbIntTo2Chars(x,(a)->high_XXX,(a)->low_XXX))}
2399
XkbIntTo2Chars(x, a^.high_XXX, a^.low_XXX);
2402
procedure XkbSetPtrActionY (a : PXkbPtrAction; y : Byte);
2404
{#define XkbSetPtrActionY(a,y) (XkbIntTo2Chars(y,(a)->high_YYY,(a)->low_YYY))}
2405
XkbIntTo2Chars (y, a^.high_YYY, a^.low_YYY);
2408
function XkbSAPtrDfltValue (a : PXkbPtrDfltAction) : ShortInt;
2410
{#define XkbSAPtrDfltValue(a) (XkbCharToInt((a)->valueXXX))}
2411
Result := ShortInt (XkbCharToInt(a^.valueXXX));
2414
procedure XkbSASetPtrDfltValue (a : PXkbPtrDfltAction; const c);
2416
{#define XkbSASetPtrDfltValue(a,c) ((a)->valueXXX= ((c)&0xff))}
2417
a^.valueXXX := ShortInt (c) and $ff;
2420
function XkbSAScreen (a : PXkbSwitchScreenAction) : ShortInt;
2422
{#define XkbSAScreen(a) (XkbCharToInt((a)->screenXXX))}
2423
Result := ShortInt (XkbCharToInt(a^.screenXXX));
2426
procedure XkbSASetScreen (a : PXkbSwitchScreenAction; const s);
2428
{#define XkbSASetScreen(a,s) ((a)->screenXXX= ((s)&0xff))}
2429
a^.screenXXX := ShortInt (s) and $ff;
2432
procedure XkbActionSetCtrls (a : PXkbCtrlsAction; c : Byte);
2434
{#define XkbActionSetCtrls(a,c) (((a)->ctrls3=(((c)>>24)&0xff)),((a)->ctrls2=(((c)>>16)&0xff)),
2435
((a)->ctrls1=(((c)>>8)&0xff)),((a)->ctrls0=((c)&0xff))) }
2436
a^.ctrls3 := ((c shr 24) and $ff);
2437
a^.ctrls2 := ((c shr 16) and $ff);
2438
a^.ctrls1 := ((c shr 8) and $ff);
2439
a^.ctrls0 := (c and $ff);
2442
function XkbActionCtrls (a : PXkbCtrlsAction) : Word;
2444
{#define XkbActionCtrls(a) ((((unsigned int)(a)->ctrls3)<<24)|(((unsigned int)(a)->ctrls2)<<16)|
2445
(((unsigned int)(a)->ctrls1)<<8)|((unsigned int)((a)->ctrls0))) }
2446
Result := (a^.ctrls3 shl 24) or
2447
(a^.ctrls2 shl 16) or
2448
(a^.ctrls1 shl 8) or
2452
function XkbSARedirectVMods (a : PXkbRedirectKeyAction) : Word;
2454
{#define XkbSARedirectVMods(a) ((((unsigned int)(a)->vmods1)<<8)|((unsigned int)(a)->vmods0))}
2455
Result := (a^.vmods1 shl 8) or
2459
procedure XkbSARedirectSetVMods (a : PXkbRedirectKeyAction; m : Byte);
2461
{#define XkbSARedirectSetVMods(a,m) (((a)->vmods_mask1=(((m)>>8)&0xff)),((a)->vmods_mask0=((m)&0xff)))}
2462
a^.vmods_mask1 := (m shr 8) and $ff;
2463
a^.vmods_mask0 := m or $ff;
2466
function XkbSARedirectVModsMask (a : PXkbRedirectKeyAction) : Word;
2468
{#define XkbSARedirectVModsMask(a) ((((unsigned int)(a)->vmods_mask1)<<8)|
2469
((unsigned int)(a)->vmods_mask0))}
2470
Result := (a^.vmods_mask1 shl 8) or
2474
procedure XkbSARedirectSetVModsMask (a : PXkbRedirectKeyAction; m : Byte);
2476
{#define XkbSARedirectSetVModsMask(a,m) (((a)->vmods_mask1=(((m)>>8)&0xff)),((a)->vmods_mask0=((m)&0xff)))}
2477
a^.vmods_mask1 := (m shr 8) and $ff;
2478
a^.vmods_mask0 := (m and $ff);
2481
function XkbAX_AnyFeedback (c : PXkbControlsPtr) : Word;
2483
{#define XkbAX_AnyFeedback(c) ((c)->enabled_ctrls&XkbAccessXFeedbackMask)}
2484
Result := c^.enabled_ctrls and XkbAccessXFeedbackMask;
2487
function XkbAX_NeedOption (c : PXkbControlsPtr; w : Word) : Word;
2489
{#define XkbAX_NeedOption(c,w) ((c)->ax_options&(w))}
2490
Result := c^.ax_options and w;
2493
function XkbAX_NeedFeedback (c : PXkbControlsPtr; w : Word) : Boolean;
2495
{#define XkbAX_NeedFeedback(c,w) (XkbAX_AnyFeedback(c)&&XkbAX_NeedOption(c,w))}
2496
Result := (XkbAX_AnyFeedback (c) > 0) and (XkbAX_NeedOption (c, w) > 0);
2499
function XkbSMKeyActionsPtr (m : PXkbServerMapPtr; k : Word) : PXkbAction;
2501
{#define XkbSMKeyActionsPtr(m,k) (&(m)->acts[(m)->key_acts[k]])}
2502
Result := @m^.acts [m^.key_acts [k]];
2505
function XkbCMKeyGroupInfo (m : PXkbClientMapPtr; k : Word) : Byte;
2507
{#define XkbCMKeyGroupInfo(m,k) ((m)->key_sym_map[k].group_info)}
2508
Result := m^.key_sym_map [k].group_info;
2511
function XkbCMKeyNumGroups (m : PXkbClientMapPtr; k : Word) : Byte;
2513
{#define XkbCMKeyNumGroups(m,k) (XkbNumGroups((m)->key_sym_map[k].group_info))}
2514
Result := XkbNumGroups (m^.key_sym_map [k].group_info);
2517
function XkbCMKeyGroupWidth (m : PXkbClientMapPtr; k : Word; g : Byte) : Byte;
2519
{#define XkbCMKeyGroupWidth(m,k,g) (XkbCMKeyType(m,k,g)->num_levels)}
2520
Result := XkbCMKeyType(m,k,g)^.num_levels;
2523
function XkbCMKeyGroupsWidth (m : PXkbClientMapPtr; K : Word) : Byte;
2525
{#define XkbCMKeyGroupsWidth(m,k) ((m)->key_sym_map[k].width)}
2526
Result := m^.key_sym_map [k].width;
2529
function XkbCMKeyTypeIndex (m : PXkbClientMapPtr; k : Word; g : Byte) : Byte;
2531
{#define XkbCMKeyTypeIndex(m,k,g) ((m)->key_sym_map[k].kt_index[g&0x3])}
2532
Result := m^.key_sym_map [k].kt_index [g and $3];
2535
function XkbCMKeyType (m : PXkbClientMapPtr; k : Word; g : Byte) : PXkbKeyTypePtr;
2537
{#define XkbCMKeyType(m,k,g) (&(m)->types[XkbCMKeyTypeIndex(m,k,g)])}
2538
Result := @m^.types [XkbCMKeyTypeIndex(m,k,g)];
2541
function XkbCMKeyNumSyms (m : PXkbClientMapPtr; k : Word) : Word;
2543
{#define XkbCMKeyNumSyms(m,k) (XkbCMKeyGroupsWidth(m,k)*XkbCMKeyNumGroups(m,k))}
2544
Result := XkbCMKeyGroupsWidth (m,k) or XkbCMKeyNumGroups(m,k);
2547
function XkbCMKeySymsOffset (m : PXkbClientMapPtr; k : Word) : Byte;
2549
{#define XkbCMKeySymsOffset(m,k) ((m)->key_sym_map[k].offset)}
2550
Result := m^.key_sym_map [k].offset;
2553
function XkbCMKeySymsPtr (m : PXkbClientMapPtr; k : Word) : PKeySym;
2555
{#define XkbCMKeySymsPtr(m,k) (&(m)->syms[XkbCMKeySymsOffset(m,k)])}
2556
Result := @m^.syms [XkbCMKeySymsOffset(m,k)];
2559
function XkbIM_IsAuto (i : PXkbIndicatorMapPtr) : Boolean;
2561
{#define XkbIM_IsAuto(i) ((((i)->flags&XkbIM_NoAutomatic)==0)&&(((i)->which_groups&&(i)->groups)||
2562
((i)->which_mods&&(i)->mods.mask)|| ((i)->ctrls)))}
2563
Result := ((i^.flags and XkbIM_NoAutomatic) = 0) and
2564
(((i^.which_groups > 0) and (i^.groups > 0)) or
2565
((i^.which_mods > 0) and (i^.mods.mask > 0)) or
2569
function XkbIM_InUse (i : PXkbIndicatorMapPtr) : Boolean;
2571
{#define XkbIM_InUse(i) (((i)->flags)||((i)->which_groups)||((i)->which_mods)||((i)->ctrls)) }
2572
Result := (i^.flags > 0) or (i^.which_groups > 0) or (i^.which_mods > 0) or (i^.ctrls > 0);
2575
function XkbKeyKeyTypeIndex (d : PXkbDescPtr; k : Word; g : Byte) : Byte;
2577
{#define XkbKeyKeyTypeIndex(d,k,g) (XkbCMKeyTypeIndex((d)->map,k,g))}
2578
Result := XkbCMKeyTypeIndex(d^.map, k, g);
2581
function XkbKeyKeyType (d : PXkbDescPtr; k : Word; g : Byte) : PXkbKeyTypePtr;
2583
{#define XkbKeyKeyType(d,k,g) (XkbCMKeyType((d)->map,k,g))}
2584
Result := XkbCMKeyType(d^.map, k, g);
2587
function XkbKeyGroupWidth (d : PXkbDescPtr; k : Word; g : Byte) : Byte;
2589
{#define XkbKeyGroupWidth(d,k,g) (XkbCMKeyGroupWidth((d)->map,k,g))}
2590
Result := XkbCMKeyGroupWidth(d^.map, k, g);
2593
function XkbKeyGroupsWidth (d : PXkbDescPtr; k : Word) : Byte;
2595
{#define XkbKeyGroupsWidth(d,k) (XkbCMKeyGroupsWidth((d)->map,k))}
2596
Result := XkbCMKeyGroupsWidth (d^.map, k);
2599
function XkbKeyGroupInfo (d : PXkbDescPtr; k : Word) : Byte;
2601
{#define XkbKeyGroupInfo(d,k) (XkbCMKeyGroupInfo((d)->map,(k)))}
2602
Result := XkbCMKeyGroupInfo (d^.map, k);
2605
function XkbKeyNumGroups (d : PXkbDescPtr; k : Word) : Byte;
2607
{#define XkbKeyNumGroups(d,k) (XkbCMKeyNumGroups((d)->map,(k)))}
2608
Result := XkbCMKeyNumGroups(d^.map, k);
2611
function XkbKeyNumSyms (d : PXkbDescPtr; k : Word) : Word;
2613
{#define XkbKeyNumSyms(d,k) (XkbCMKeyNumSyms((d)->map,(k)))}
2614
Result := XkbCMKeyNumSyms (d^.map, k);
2617
function XkbKeySymsPtr (d : PXkbDescPtr; k : Word) : PKeySym;
2619
{#define XkbKeySymsPtr(d,k) (XkbCMKeySymsPtr((d)->map,(k)))}
2620
Result := XkbCMKeySymsPtr (d^.map, k);
2623
function XkbKeySym (d : PXkbDescPtr; k : Word; n : Word) : TKeySym;
2625
{#define XkbKeySym(d,k,n) (XkbKeySymsPtr(d,k)[n])}
2626
Result := XkbKeySymsPtr(d, k) [n];
2629
function XkbKeySymEntry (d : PXkbDescPtr; k : Word; sl : Word; g : Byte) : TKeySym;
2631
{#define XkbKeySymEntry(d,k,sl,g) (XkbKeySym(d,k,((XkbKeyGroupsWidth(d,k)*(g))+(sl))))}
2632
Result := XkbKeySym (d, k, (XkbKeyGroupsWidth(d, k) * g) + sl);
2635
function XkbKeyAction (d : PXkbDescPtr; k : Word; n : Word) : PXkbAction;
2637
{#define XkbKeyAction(d,k,n) (XkbKeyHasActions(d,k)?&XkbKeyActionsPtr(d,k)[n]:NULL)}
2638
if (XkbKeyHasActions(d,k)) then
2639
Result := @TXkbAction(XkbKeyActionsPtr(d,k)[n]) //Buggy !!!
2641
FillChar (Result, sizeof (TXkbAction), #0);
2644
function XkbKeyActionEntry (d : PXkbDescPtr; k : Word; sl : Word; g : Byte) : Byte;
2646
{#define XkbKeyActionEntry(d,k,sl,g) (XkbKeyHasActions(d,k) ?
2647
XkbKeyAction(d, k, ((XkbKeyGroupsWidth(d, k) * (g))+(sl))):NULL)}
2648
if (XkbKeyHasActions(d, k)) then
2649
Result := (XkbKeyGroupsWidth(d, k) * g) + sl
2654
function XkbKeyHasActions (d : PXkbDescPtr; k : Word) : Boolean;
2656
{#define XkbKeyHasActions(d,k) ((d)->server->key_acts[k]!=0)}
2657
Result := (not (d^.server^.key_acts [k] = 0));
2660
function XkbKeyNumActions (d : PXkbDescPtr; k : Word) : Word;
2662
{#define XkbKeyNumActions(d,k) (XkbKeyHasActions(d,k)?XkbKeyNumSyms(d,k):1)}
2663
if (XkbKeyHasActions(d,k)) then
2664
Result := XkbKeyNumSyms(d,k)
2669
function XkbKeyActionsPtr (d : PXkbDescPtr; k : Word) : PXkbAction;
2671
{#define XkbKeyActionsPtr(d,k) (XkbSMKeyActionsPtr((d)->server,k))}
2672
Result := XkbSMKeyActionsPtr(d^.server, k);
2675
function XkbKeycodeInRange (d : PXkbDescPtr; k : Word) : Boolean;
2677
{#define XkbKeycodeInRange(d,k) (((k)>=(d)->min_key_code)&& ((k)<=(d)->max_key_code))}
2678
Result := (k >= d^.min_key_code) and (k <= d^.max_key_code);
2681
function XkbNumKeys (d : PXkbDescPtr) : Byte;
2683
{#define XkbNumKeys(d) ((d)->max_key_code-(d)->min_key_code+1)}
2684
Result := d^.max_key_code - d^.min_key_code + 1;
2687
function XkbXI_DevHasBtnActs (d : PXkbDeviceInfoPtr) : Boolean;
2689
{#define XkbXI_DevHasBtnActs(d) (((d)->num_btns>0)&&((d)->btn_acts!=NULL))}
2690
Result := (d^.num_btns > 0) and (not (d^.btn_acts = nil));
2693
function XkbXI_LegalDevBtn (d : PXkbDeviceInfoPtr; b : Word) : Boolean;
2695
{#define XkbXI_LegalDevBtn(d,b) (XkbXI_DevHasBtnActs(d)&&((b)<(d)->num_btns))}
2696
Result := XkbXI_DevHasBtnActs(d) and (b < d^.num_btns);
2699
function XkbXI_DevHasLeds (d : PXkbDeviceInfoPtr) : Boolean;
2701
{#define XkbXI_DevHasLeds(d) (((d)->num_leds>0)&&((d)->leds!=NULL))}
2702
Result := (d^.num_leds > 0) and (not (d^.leds = nil));
2704
(******************************** end of xkbstr ********************************)
2705
(*********************************** xkbgeom ***********************************)
2707
function XkbBoundsWidth (b : PXkbBoundsPtr) : SmallInt;
2709
{#define XkbBoundsWidth(b) (((b)->x2)-((b)->x1))}
2710
Result := b^.x2 - b^.x1;
2713
function XkbBoundsHeight (b : PXkbBoundsPtr) : SmallInt;
2715
{#define XkbBoundsHeight(b) (((b)->y2)-((b)->y1))}
2716
Result := b^.y2 - b^.y1;
2719
function XkbOutlineIndex (s : PXkbShapePtr; o : PXkbOutlinePtr) : longint;
2721
{#define XkbOutlineIndex(s,o) ((int)((o)-&(s)->outlines[0]))}
2722
Result := longint(o - @s^.outlines [0]);
2725
function XkbShapeDoodadColor (g : PXkbGeometryPtr; d : PXkbShapeDoodadPtr) : PXkbColorPtr;
2727
{#define XkbShapeDoodadColor(g,d) (&(g)->colors[(d)->color_ndx])}
2728
Result := @(g^.colors [d^.color_ndx]);
2731
function XkbShapeDoodadShape (g : PXkbGeometryPtr; d : PXkbShapeDoodadPtr) : PXkbShapePtr;
2733
{#define XkbShapeDoodadShape(g,d) (&(g)->shapes[(d)->shape_ndx])}
2734
Result := @g^.shapes [d^.shape_ndx];
2737
procedure XkbSetShapeDoodadColor (g : PXkbGeometryPtr; d : PXkbShapeDoodadPtr; c : PXkbColorPtr);
2739
{#define XkbSetShapeDoodadColor(g,d,c) ((d)->color_ndx= (c)-&(g)->colors[0])}
2740
d^.color_ndx := c - @g^.colors [0];
2743
procedure XkbSetShapeDoodadShape (g : PXkbGeometryPtr; d : PXkbShapeDoodadPtr; s : PXkbShapePtr);
2745
{#define XkbSetShapeDoodadShape(g,d,s) ((d)->shape_ndx= (s)-&(g)->shapes[0])}
2746
d^.shape_ndx := PXkbShapePtr(s) - @g^.shapes [0];
2749
function XkbTextDoodadColor (g : PXkbGeometryPtr; d : PXkbTextDoodadPtr) : PXkbColorPtr;
2751
{#define XkbTextDoodadColor(g,d) (&(g)->colors[(d)->color_ndx])}
2752
Result := @g^.colors [d^.color_ndx];
2755
procedure XkbSetTextDoodadColor (g : PXkbGeometryPtr; d : PXkbTextDoodadPtr; c : PXkbColorPtr);
2757
{#define XkbSetTextDoodadColor(g,d,c) ((d)->color_ndx= (c)-&(g)->colors[0])}
2758
d^.color_ndx := c - @g^.colors [0];
2761
function XkbIndicatorDoodadShape (g : PXkbGeometryPtr; d : PXkbIndicatorDoodadPtr) : PXkbShapeDoodadPtr;
2763
{#define XkbIndicatorDoodadShape(g,d) (&(g)->shapes[(d)->shape_ndx])}
2764
Result := PXkbShapeDoodadPtr(@g^.shapes [d^.shape_ndx]);
2767
function XkbIndicatorDoodadOnColor (g : PXkbGeometryPtr; d : PXkbIndicatorDoodadPtr) : PXkbColorPtr;
2769
{#define XkbIndicatorDoodadOnColor(g,d) (&(g)->colors[(d)->on_color_ndx])}
2770
Result := @g^.colors [d^.on_color_ndx];
2773
function XkbIndicatorDoodadOffColor (g : PXkbGeometryPtr; d : PXkbIndicatorDoodadPtr) : PXkbColorPtr;
2775
{#define XkbIndicatorDoodadOffColor(g,d) (&(g)->colors[(d)->off_color_ndx])}
2776
Result := @g^.colors [d^.off_color_ndx];
2779
procedure XkbSetIndicatorDoodadOnColor (g : PXkbGeometryPtr; d : PXkbIndicatorDoodadPtr;
2782
{#define XkbSetIndicatorDoodadOnColor(g,d,c) ((d)->on_color_ndx= (c)-&(g)->colors[0])}
2783
d^.on_color_ndx := c - @g^.colors [0];
2786
procedure XkbSetIndicatorDoodadOffColor (g : PXkbGeometryPtr; d : PXkbIndicatorDoodadPtr;
2789
{#define XkbSetIndicatorDoodadOffColor(g,d,c) ((d)->off_color_ndx= (c)-&(g)->colors[0])}
2790
d^.off_color_ndx := c - @g^.colors [0];
2793
procedure XkbSetIndicatorDoodadShape (g : PXkbGeometryPtr; d : PXkbIndicatorDoodadPtr;
2794
s : PXkbShapeDoodadPtr);
2796
{#define XkbSetIndicatorDoodadShape(g,d,s) ((d)->shape_ndx= (s)-&(g)->shapes[0])}
2797
d^.shape_ndx := PXkbShapePtr(s) - @g^.shapes [0];
2800
function XkbLogoDoodadColor (g : PXkbGeometryPtr; d : PXkbLogoDoodadPtr) : PXkbColorPtr;
2802
{#define XkbLogoDoodadColor(g,d) (&(g)->colors[(d)->color_ndx])}
2803
Result := @g^.colors [d^.color_ndx];
2806
function XkbLogoDoodadShape (g : PXkbGeometryPtr; d : PXkbLogoDoodadPtr) : PXkbShapeDoodadPtr;
2808
{#define XkbLogoDoodadShape(g,d) (&(g)->shapes[(d)->shape_ndx])}
2809
Result := PXkbShapeDoodadPtr(@g^.shapes [d^.shape_ndx]);
2812
procedure XkbSetLogoDoodadColor (g : PXkbGeometryPtr; d : PXkbLogoDoodadPtr; c : PXkbColorPtr);
2814
{#define XkbSetLogoDoodadColor(g,d,c) ((d)->color_ndx= (c)-&(g)->colors[0])}
2815
d^.color_ndx := c - @g^.colors [0];
2818
procedure XkbSetLogoDoodadShape (g : PXkbGeometryPtr; d : PXkbLogoDoodadPtr; s : PXkbShapeDoodadPtr);
2820
{#define XkbSetLogoDoodadShape(g,d,s) ((d)->shape_ndx= (s)-&(g)->shapes[0])}
2821
d^.shape_ndx := PXkbShapePtr(s) - @g^.shapes [0];
2824
function XkbKeyShape (g : PXkbGeometryPtr; k : PXkbKeyPtr) : PXkbShapeDoodadPtr;
2826
{#define XkbKeyShape(g,k) (&(g)->shapes[(k)->shape_ndx])}
2827
Result := PXkbShapeDoodadPtr(@g^.shapes [k^.shape_ndx]);
2830
function XkbKeyColor (g : PXkbGeometryPtr; k : PXkbKeyPtr) : PXkbColorPtr;
2832
{#define XkbKeyColor(g,k) (&(g)->colors[(k)->color_ndx])}
2833
Result := @g^.colors [k^.color_ndx];
2836
procedure XkbSetKeyShape (g : PXkbGeometryPtr; k : PXkbKeyPtr; s : PXkbShapeDoodadPtr);
2838
{#define XkbSetKeyShape(g,k,s) ((k)->shape_ndx= (s)-&(g)->shapes[0])}
2839
k^.shape_ndx := PXkbShapePtr(s) - @g^.shapes [0];
2842
procedure XkbSetKeyColor (g : PXkbGeometryPtr; k : PXkbKeyPtr; c : PXkbColorPtr);
2844
{#define XkbSetKeyColor(g,k,c) ((k)->color_ndx= (c)-&(g)->colors[0])}
2845
k^.color_ndx := c - @g^.colors [0];
2848
function XkbGeomColorIndex (g : PXkbGeometryPtr; c : PXkbColorPtr) : longint;
2850
{#define XkbGeomColorIndex(g,c) ((int)((c)-&(g)->colors[0]))}
2851
Result := longint (c - @g^.colors [0]);
2853
(******************************** end of xkbgeom *******************************)