sync code with last improvements from OpenBSD

This commit is contained in:
purplerain 2023-08-28 05:57:34 +00:00
commit 88965415ff
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
26235 changed files with 29195616 additions and 0 deletions

View file

@ -0,0 +1,141 @@
#ifndef _XKBBELLS_H_
#define _XKBBELLS_H_ 1
/************************************************************
Copyright (c) 1995 by Silicon Graphics Computer Systems, Inc.
Permission to use, copy, modify, and distribute this
software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
documentation, and that the name of Silicon Graphics not be
used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#define XkbBN_Info "Info"
#define XkbBN_Warning "Warning"
#define XkbBN_MinorError "MinorError"
#define XkbBN_MajorError "MajorError"
#define XkbBN_BadValue "BadValue"
#define XkbBN_InvalidLocation "InvalidLocation"
#define XkbBN_Question "Question"
#define XkbBN_Start "Start"
#define XkbBN_End "End"
#define XkbBN_Success "Success"
#define XkbBN_Failure "Failure"
#define XkbBN_Wait "Wait"
#define XkbBN_Proceed "Proceed"
#define XkbBN_Ignore "Ignore"
#define XkbBN_Iconify "Iconify"
#define XkbBN_Deiconify "Deconify"
#define XkbBN_Open "Open"
#define XkbBN_Close "Close"
#define XkbBN_TerminalBell "TerminalBell"
#define XkbBN_MarginBell "MarginBell"
#define XkbBN_CursorStuck "CursorStuck"
#define XkbBN_NewMail "NewMail"
#define XkbBN_LaunchApp "LaunchApp"
#define XkbBN_AppDeath "AppDeath"
#define XkbBN_ImAlive "ImAlive"
#define XkbBN_ClockChimeHour "ClockChimeHour"
#define XkbBN_ClockChimeHalf "ClockChimeHalf"
#define XkbBN_ClockChimeQuarter "ClockChimeQuarter"
#define XkbBN_RepeatingLastBell "RepeatingLastBell"
#define XkbBN_ComposeFail "ComposeFail"
#define XkbBN_AX_FeatureOn "AX_FeatureOn"
#define XkbBN_AX_FeatureOff "AX_FeatureOff"
#define XkbBN_AX_FeatureChange "AX_FeatureChange"
#define XkbBN_AX_IndicatorOn "AX_IndicatorOn"
#define XkbBN_AX_IndicatorOff "AX_IndicatorOff"
#define XkbBN_AX_IndicatorChange "AX_IndicatorChange"
#define XkbBN_AX_SlowKeysWarning "AX_SlowKeysWarning"
#define XkbBN_AX_SlowKeyPress "AX_SlowKeyPress"
#define XkbBN_AX_SlowKeyAccept "AX_SlowKeyAccept"
#define XkbBN_AX_SlowKeyReject "AX_SlowKeyReject"
#define XkbBN_AX_SlowKeyRelease "AX_SlowKeyRelease"
#define XkbBN_AX_BounceKeyReject "AX_BounceKeyReject"
#define XkbBN_AX_StickyLatch "AX_StickyLatch"
#define XkbBN_AX_StickyLock "AX_StickyLock"
#define XkbBN_AX_StickyUnlock "AX_StickyUnlock"
#define XkbBI_Info 0
#define XkbBI_Warning 1
#define XkbBI_MinorError 2
#define XkbBI_MajorError 3
#define XkbBI_BadValue 4
#define XkbBI_InvalidLocation 5
#define XkbBI_Question 6
#define XkbBI_Start 7
#define XkbBI_End 8
#define XkbBI_Success 9
#define XkbBI_Failure 10
#define XkbBI_Wait 11
#define XkbBI_Proceed 12
#define XkbBI_Ignore 13
#define XkbBI_Iconify 14
#define XkbBI_Deiconify 15
#define XkbBI_Open 16
#define XkbBI_Close 17
#define XkbBI_TerminalBell 18
#define XkbBI_MarginBell 19
#define XkbBI_CursorStuck 20
#define XkbBI_NewMail 21
#define XkbBI_LaunchApp 22
#define XkbBI_AppDeath 23
#define XkbBI_ImAlive 24
#define XkbBI_ClockChimeHour 25
#define XkbBI_ClockChimeHalf 26
#define XkbBI_ClockChimeQuarter 27
#define XkbBI_RepeatingLastBell 28
#define XkbBI_ComposeFail 29
#define XkbBI_AX_FeatureOn 30
#define XkbBI_AX_FeatureOff 31
#define XkbBI_AX_FeatureChange 32
#define XkbBI_AX_IndicatorOn 33
#define XkbBI_AX_IndicatorOff 34
#define XkbBI_AX_IndicatorChange 35
#define XkbBI_AX_SlowKeysWarning 36
#define XkbBI_AX_SlowKeyPress 37
#define XkbBI_AX_SlowKeyAccept 38
#define XkbBI_AX_SlowKeyReject 39
#define XkbBI_AX_SlowKeyRelease 40
#define XkbBI_AX_BounceKeyReject 41
#define XkbBI_AX_StickyLatch 42
#define XkbBI_AX_StickyLock 43
#define XkbBI_AX_StickyUnlock 44
#define XkbBI_NumBells 45
_XFUNCPROTOBEGIN
extern Bool XkbStdBell(
Display * /* dpy */,
Window /* win */,
int /* percent */,
int /* bellDef */
);
extern Bool XkbStdBellEvent(
Display * /* dpy */,
Window /* win */,
int /* percent */,
int /* bellDef */
);
_XFUNCPROTOEND
#endif /* _XKBBELLS_H_ */

View file

@ -0,0 +1,278 @@
#ifndef _XKBCONFIG_H_
#define _XKBCONFIG_H_ 1
/************************************************************
Copyright (c) 1995 by Silicon Graphics Computer Systems, Inc.
Permission to use, copy, modify, and distribute this
software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
documentation, and that the name of Silicon Graphics not be
used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
typedef struct _XkbConfigRtrn *XkbConfigRtrnPtr;
typedef struct _XkbConfigField *XkbConfigFieldPtr;
typedef struct _XkbConfigFields *XkbConfigFieldsPtr;
typedef Bool (*XkbConfigParseFunc)(
FILE * /* file */,
XkbConfigFieldsPtr /* fields */,
XkbConfigFieldPtr /* field */,
XkbDescPtr /* xkb */,
XkbConfigRtrnPtr /* rtrn */
);
#define XkbCF_Check 0
#define XkbCF_Apply 1
#define XkbCF_CleanUp 2
#define XkbCF_Destroy 3
typedef Bool (*XkbConfigFinishFunc)(
XkbConfigFieldsPtr /* fields */,
XkbDescPtr /* xkb */,
XkbConfigRtrnPtr /* rtrn */,
int /* what */
);
typedef struct _XkbConfigRtrnPriv {
int cfg_id;
XPointer priv;
struct _XkbConfigRtrnPriv * next;
} XkbConfigRtrnPrivRec,*XkbConfigRtrnPrivPtr;
typedef struct _XkbConfigModInfo {
Bool replace;
unsigned char mods;
unsigned char mods_clear;
unsigned short vmods;
unsigned short vmods_clear;
} XkbConfigModInfoRec,*XkbConfigModInfoPtr;
typedef struct _XkbConfigUnboundMod {
unsigned char what;
unsigned char mods;
unsigned short vmods;
short merge;
char * name;
} XkbConfigUnboundModRec,*XkbConfigUnboundModPtr;
#define XkbCF_MergeSet 0
#define XkbCF_MergeAdd 1
#define XkbCF_MergeRemove 2
#define XkbCF_InitialMods (1L<<0)
#define XkbCF_InternalMods (1L<<1)
#define XkbCF_IgnoreLockMods (1L<<2)
#define XkbCF_InitialCtrls (1L<<3)
#define XkbCF_AccessXTimeout (1L<<4)
#define XkbCF_AccessXTimeoutCtrlsOn (1L<<5)
#define XkbCF_AccessXTimeoutCtrlsOff (1L<<6)
#define XkbCF_AccessXTimeoutOptsOn (1L<<7)
#define XkbCF_AccessXTimeoutOptsOff (1L<<8)
#define XkbCF_GroupsWrap (1L<<9)
#define XkbCF_InitialOpts (1L<<10)
typedef struct _XkbConfigRtrn {
unsigned defined;
int error;
int line;
int click_volume;
int bell_volume;
int bell_pitch;
int bell_duration;
int repeat_delay;
int repeat_interval;
char * rules_file;
char * model;
char * layout;
char * variant;
char * options;
char * keymap;
char * keycodes;
char * geometry;
char * phys_symbols;
char * symbols;
char * types;
char * compat;
Bool replace_initial_ctrls;
unsigned long initial_ctrls;
unsigned long initial_ctrls_clear;
Bool replace_initial_opts;
unsigned short initial_opts;
unsigned short initial_opts_clear;
XkbConfigModInfoRec initial_mods;
XkbConfigModInfoRec internal_mods;
XkbConfigModInfoRec ignore_lock_mods;
short num_unbound_mods;
short sz_unbound_mods;
XkbConfigUnboundModPtr unbound_mods;
int groups_wrap;
int slow_keys_delay;
int debounce_delay;
int mk_delay;
int mk_interval;
int mk_time_to_max;
int mk_max_speed;
int mk_curve;
int ax_timeout;
Bool replace_axt_ctrls_on;
Bool replace_axt_ctrls_off;
unsigned long axt_ctrls_on;
unsigned long axt_ctrls_off;
unsigned long axt_ctrls_ignore;
Bool replace_axt_opts_off;
Bool replace_axt_opts_on;
unsigned short axt_opts_off;
unsigned short axt_opts_on;
unsigned short axt_opts_ignore;
XkbConfigRtrnPrivPtr priv;
} XkbConfigRtrnRec;
typedef struct _XkbConfigField {
char * field;
unsigned char field_id;
} XkbConfigFieldRec;
typedef struct _XkbConfigFields {
unsigned short cfg_id;
unsigned short num_fields;
XkbConfigFieldPtr fields;
XkbConfigParseFunc parser;
XkbConfigFinishFunc finish;
XPointer priv;
struct _XkbConfigFields *next;
} XkbConfigFieldsRec;
#define XkbCF_EOF -1
#define XkbCF_Unknown 0
#define XkbCF_EOL 1
#define XkbCF_Semi 2
#define XkbCF_Equals 3
#define XkbCF_PlusEquals 4
#define XkbCF_MinusEquals 5
#define XkbCF_Plus 6
#define XkbCF_Minus 7
#define XkbCF_String 10
#define XkbCF_Ident 11
#define XkbCF_Integer 12
#define XkbCF_UnterminatedString 100
#define XkbCF_BadAlloc 101
#define XkbCF_MissingIdent 102
#define XkbCF_MissingEquals 103
#define XkbCF_ExpectedEOS 104
#define XkbCF_ExpectedBoolean 105
#define XkbCF_ExpectedInteger 106
#define XkbCF_ExpectedString 107
#define XkbCF_ExpectedModifier 108
#define XkbCF_ExpectedControl 109
#define XkbCF_ExpectedAXOption 110
#define XkbCF_ExpectedOperator 111
#define XkbCF_ExpectedOORGroupBehavior 112
typedef union {
int ival;
char * str;
} XkbCFScanResultRec,*XkbCFScanResultPtr;
extern XkbConfigFieldsPtr XkbCFDflts;
_XFUNCPROTOBEGIN
extern int XkbCFScan(
FILE * /* file */,
XkbCFScanResultPtr /* val_rtrn */,
XkbConfigRtrnPtr /* rtrn */
);
extern XkbConfigFieldsPtr XkbCFDup(
XkbConfigFieldsPtr /* fields */
);
extern XkbConfigFieldsPtr XkbCFFree(
XkbConfigFieldsPtr /* fields */,
Bool /* all */
);
extern XkbConfigUnboundModPtr XkbCFAddModByName(
XkbConfigRtrnPtr /* rtrn */,
int /* what */,
char * /* name */,
Bool /* merge */,
XkbConfigUnboundModPtr /* last */
);
extern Bool XkbCFBindMods(
XkbConfigRtrnPtr /* rtrn */,
XkbDescPtr /* xkb */
);
extern Bool XkbCFApplyMods(
XkbConfigRtrnPtr /* rtrn */,
int /* what */,
XkbConfigModInfoPtr /* info */
);
extern Bool XkbCFApplyRtrnValues(
XkbConfigRtrnPtr /* rtrn */,
XkbConfigFieldsPtr /* fields */,
XkbDescPtr /* xkb */
);
extern XkbConfigRtrnPrivPtr XkbCFAddPrivate(
XkbConfigRtrnPtr /* rtrn */,
XkbConfigFieldsPtr /* fields */,
XPointer /* ptr */
);
extern void XkbCFFreeRtrn(
XkbConfigRtrnPtr /* rtrn */,
XkbConfigFieldsPtr /* fields */,
XkbDescPtr /* xkb */
);
extern Bool XkbCFParse(
FILE * /* file */,
XkbConfigFieldsPtr /* fields */,
XkbDescPtr /* xkb */,
XkbConfigRtrnPtr /* rtrn */
);
extern void XkbCFReportError(
FILE * /* file */,
char * /* name */,
int /* error */,
int /* line */
);
_XFUNCPROTOEND
#endif /* _XKBCONFIG_H_ */

View file

@ -0,0 +1,490 @@
#ifndef _XKBFILE_H_
#define _XKBFILE_H_ 1
/************************************************************
Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc.
Permission to use, copy, modify, and distribute this
software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
documentation, and that the name of Silicon Graphics not be
used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
/***====================================================================***/
#define XkbXKMFile 0
#define XkbCFile 1
#define XkbXKBFile 2
#define XkbMessage 3
#define XkbMapDefined (1<<0)
#define XkbStateDefined (1<<1)
typedef struct _XkbFileInfo {
unsigned type;
unsigned defined;
XkbDescPtr xkb;
} XkbFileInfo,*XkbFileInfoPtr;
typedef void (*XkbFileAddOnFunc)(
FILE * /* file */,
XkbFileInfo * /* result */,
Bool /* topLevel */,
Bool /* showImplicit */,
int /* fileSection */,
void * /* priv */
);
/***====================================================================***/
#define _XkbSuccess 0
#define _XkbErrMissingNames 1
#define _XkbErrMissingTypes 2
#define _XkbErrMissingReqTypes 3
#define _XkbErrMissingSymbols 4
#define _XkbErrMissingVMods 5
#define _XkbErrMissingIndicators 6
#define _XkbErrMissingCompatMap 7
#define _XkbErrMissingSymInterps 8
#define _XkbErrMissingGeometry 9
#define _XkbErrIllegalDoodad 10
#define _XkbErrIllegalTOCType 11
#define _XkbErrIllegalContents 12
#define _XkbErrEmptyFile 13
#define _XkbErrFileNotFound 14
#define _XkbErrFileCannotOpen 15
#define _XkbErrBadValue 16
#define _XkbErrBadMatch 17
#define _XkbErrBadTypeName 18
#define _XkbErrBadTypeWidth 19
#define _XkbErrBadFileType 20
#define _XkbErrBadFileVersion 21
#define _XkbErrBadFileFormat 22
#define _XkbErrBadAlloc 23
#define _XkbErrBadLength 24
#define _XkbErrXReqFailure 25
#define _XkbErrBadImplementation 26
extern const char * _XkbErrMessages[];
extern unsigned _XkbErrCode;
extern const char * _XkbErrLocation;
extern unsigned _XkbErrData;
/***====================================================================***/
_XFUNCPROTOBEGIN
extern char * XkbIndentText(
unsigned /* size */
);
extern char * XkbAtomText(
Display * /* dpy */,
Atom /* atm */,
unsigned /* format */
);
extern char * XkbKeysymText(
KeySym /* sym */,
unsigned /* format */
);
extern char * XkbStringText(
char * /* str */,
unsigned /* format */
);
extern char * XkbKeyNameText(
char * /* name */,
unsigned /* format */
);
extern char *
XkbModIndexText(
unsigned /* ndx */,
unsigned /* format */
);
extern char *
XkbModMaskText(
unsigned /* mask */,
unsigned /* format */
);
extern char * XkbVModIndexText(
Display * /* dpy */,
XkbDescPtr /* xkb */,
unsigned /* ndx */,
unsigned /* format */
);
extern char * XkbVModMaskText(
Display * /* dpy */,
XkbDescPtr /* xkb */,
unsigned /* modMask */,
unsigned /* mask */,
unsigned /* format */
);
extern char * XkbConfigText(
unsigned /* config */,
unsigned /* format */
);
extern char * XkbSIMatchText(
unsigned /* type */,
unsigned /* format */
);
extern char * XkbIMWhichStateMaskText(
unsigned /* use_which */,
unsigned /* format */
);
extern char * XkbAccessXDetailText(
unsigned /* state */,
unsigned /* format */
);
extern char * XkbNKNDetailMaskText(
unsigned /* detail */,
unsigned /* format */
);
extern char * XkbControlsMaskText(
unsigned /* ctrls */,
unsigned /* format */
);
extern char * XkbGeomFPText(
int /* val */,
unsigned /* format */
);
extern char * XkbDoodadTypeText(
unsigned /* type */,
unsigned /* format */
);
extern char * XkbActionTypeText(
unsigned /* type */,
unsigned /* format */
);
extern char * XkbActionText(
Display * /* dpy */,
XkbDescPtr /* xkb */,
XkbAction * /* action */,
unsigned /* format */
);
extern char * XkbBehaviorText(
XkbDescPtr /* xkb */,
XkbBehavior * /* behavior */,
unsigned /* format */
);
/***====================================================================***/
#define _XkbKSLower (1<<0)
#define _XkbKSUpper (1<<1)
#define XkbKSIsLower(k) (_XkbKSCheckCase(k)&_XkbKSLower)
#define XkbKSIsUpper(k) (_XkbKSCheckCase(k)&_XkbKSUpper)
#define XkbKSIsKeypad(k) (((k)>=XK_KP_Space)&&((k)<=XK_KP_Equal))
#define XkbKSIsDeadKey(k) \
(((k)>=XK_dead_grave)&&((k)<=XK_dead_semivoiced_sound))
extern unsigned _XkbKSCheckCase(
KeySym /* sym */
);
extern int XkbFindKeycodeByName(
XkbDescPtr /* xkb */,
char * /* name */,
Bool /* use_aliases */
);
extern Bool XkbLookupGroupAndLevel(
XkbDescPtr /* xkb */,
int /* key */,
int * /* mods_inout */,
int * /* grp_inout */,
int * /* lvl_rtrn */
);
/***====================================================================***/
extern Bool XkbLookupCanonicalRGBColor(
char * /* def */,
XColor * /* color */
);
/***====================================================================***/
extern char * XkbAtomGetString(
Display * /* dpy */,
Atom /* atm */
);
extern Atom XkbInternAtom(
Display * /* dpy */,
const char */* name */,
Bool /* onlyIfExists */
);
extern Status XkbChangeKbdDisplay(
Display * /* newDpy */,
XkbFileInfo * /* result */
);
extern Atom XkbChangeAtomDisplay(
Display * /* oldDpy */,
Display * /* newDpy */,
Atom /* atm */
);
extern void XkbInitAtoms(
Display * /* dpy */
);
/***====================================================================***/
#ifdef _XKBGEOM_H_
#define XkbDW_Unknown 0
#define XkbDW_Doodad 1
#define XkbDW_Section 2
typedef struct _XkbDrawable {
int type;
int priority;
union {
XkbDoodadPtr doodad;
XkbSectionPtr section;
} u;
struct _XkbDrawable * next;
} XkbDrawableRec,*XkbDrawablePtr;
extern XkbDrawablePtr
XkbGetOrderedDrawables(
XkbGeometryPtr /* geom */,
XkbSectionPtr /* section */
);
extern void
XkbFreeOrderedDrawables(
XkbDrawablePtr /* draw */
);
#endif
/***====================================================================***/
extern unsigned XkbConvertGetByNameComponents(
Bool /* toXkm */,
unsigned /* orig */
);
extern unsigned XkbConvertXkbComponents(
Bool /* toXkm */,
unsigned /* orig */
);
extern Bool XkbDetermineFileType(
XkbFileInfo * /* xkb */,
int /* format */,
int * /* opts_missing */
);
extern Bool XkbNameMatchesPattern(
char * /* name */,
char * /* pattern */
);
/***====================================================================***/
extern Bool XkbWriteXKBKeycodes(
FILE * /* file */,
XkbFileInfo * /* result */,
Bool /* topLevel */,
Bool /* showImplicit */,
XkbFileAddOnFunc /* addOn */,
void * /* priv */
);
extern Bool XkbWriteXKBKeyTypes(
FILE * /* file */,
XkbFileInfo * /* result */,
Bool /* topLevel */,
Bool /* showImplicit */,
XkbFileAddOnFunc /* addOn */,
void * /* priv */
);
extern Bool XkbWriteXKBCompatMap(
FILE * /* file */,
XkbFileInfo * /* result */,
Bool /* topLevel */,
Bool /* showImplicit */,
XkbFileAddOnFunc /* addOn */,
void * /* priv */
);
extern Bool XkbWriteXKBSymbols(
FILE * /* file */,
XkbFileInfo * /* result */,
Bool /* topLevel */,
Bool /* showImplicit */,
XkbFileAddOnFunc /* addOn */,
void * /* priv */
);
extern Bool XkbWriteXKBGeometry(
FILE * /* file */,
XkbFileInfo * /* result */,
Bool /* topLevel */,
Bool /* showImplicit */,
XkbFileAddOnFunc /* addOn */,
void * /* priv */
);
extern Bool XkbWriteXKBSemantics(
FILE * /* file */,
XkbFileInfo * /* result */,
Bool /* topLevel */,
Bool /* showImplicit */,
XkbFileAddOnFunc /* addOn */,
void * /* priv */
);
extern Bool XkbWriteXKBLayout(
FILE * /* file */,
XkbFileInfo * /* result */,
Bool /* topLevel */,
Bool /* showImplicit */,
XkbFileAddOnFunc /* addOn */,
void * /* priv */
);
extern Bool XkbWriteXKBKeymap(
FILE * /* file */,
XkbFileInfo * /* result */,
Bool /* topLevel */,
Bool /* showImplicit */,
XkbFileAddOnFunc /* addOn */,
void * /* priv */
);
extern Bool XkbWriteXKBFile(
FILE * /* file */,
XkbFileInfo * /* result */,
Bool /* showImplicit */,
XkbFileAddOnFunc /* addOn */,
void * /* priv */
);
extern Bool XkbWriteCFile(
FILE * /* file */,
char * /* name */,
XkbFileInfo * /* info */
);
extern Bool XkbWriteXKMFile(
FILE * /* file */,
XkbFileInfo * /* result */
);
extern Bool XkbWriteToServer(
XkbFileInfo * /* result */
);
extern void XkbEnsureSafeMapName(
char * /* name */
);
extern Bool XkbWriteXKBKeymapForNames(
FILE * /* file */,
XkbComponentNamesPtr /* names */,
Display * /* dpy */,
XkbDescPtr /* xkb */,
unsigned /* want */,
unsigned /* need */
);
extern Status XkbMergeFile(
XkbDescPtr /* xkb */,
XkbFileInfo /* finfo */
);
/***====================================================================***/
extern Bool XkmProbe(
FILE * /* file */
);
extern unsigned XkbReadFromServer(
Display * /* dpy */,
unsigned /* need */,
unsigned /* want */,
XkbFileInfo * /* result */
);
extern unsigned XkmReadFile(
FILE * /* file */,
unsigned /* need */,
unsigned /* want */,
XkbFileInfo * /* result */
);
#ifdef _XKMFORMAT_H_
extern Bool XkmReadTOC(
FILE * /* file */,
xkmFileInfo * /* file_info */,
int /* max_toc */,
xkmSectionInfo * /* toc */
);
extern xkmSectionInfo *XkmFindTOCEntry(
xkmFileInfo * /* finfo */,
xkmSectionInfo * /* toc */,
unsigned /* type */
);
extern Bool XkmReadFileSection(
FILE * /* file */,
xkmSectionInfo * /* toc */,
XkbFileInfo * /* result */,
unsigned * /* loaded_rtrn */
);
extern char * XkmReadFileSectionName(
FILE * /* file */,
xkmSectionInfo * /* toc */
);
#endif /* _XKMFORMAT_H */
_XFUNCPROTOEND
#endif /* _XKBFILE_H_ */

View file

@ -0,0 +1,197 @@
#ifndef _XKBRULES_H_
#define _XKBRULES_H_ 1
/************************************************************
Copyright (c) 1996 by Silicon Graphics Computer Systems, Inc.
Permission to use, copy, modify, and distribute this
software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
documentation, and that the name of Silicon Graphics not be
used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
/***====================================================================***/
typedef struct _XkbRF_VarDefs {
char * model;
char * layout;
char * variant;
char * options;
unsigned short sz_extra;
unsigned short num_extra;
char * extra_names;
char ** extra_values;
} XkbRF_VarDefsRec,*XkbRF_VarDefsPtr;
typedef struct _XkbRF_VarDesc {
char * name;
char * desc;
} XkbRF_VarDescRec, *XkbRF_VarDescPtr;
typedef struct _XkbRF_DescribeVars {
int sz_desc;
int num_desc;
XkbRF_VarDescPtr desc;
} XkbRF_DescribeVarsRec,*XkbRF_DescribeVarsPtr;
typedef struct _XkbRF_Rule {
int number;
int layout_num;
int variant_num;
char * model;
char * layout;
char * variant;
char * option;
/* yields */
char * keycodes;
char * symbols;
char * types;
char * compat;
char * geometry;
char * keymap;
unsigned flags;
} XkbRF_RuleRec,*XkbRF_RulePtr;
typedef struct _XkbRF_Group {
int number;
char * name;
char * words;
} XkbRF_GroupRec, *XkbRF_GroupPtr;
#define XkbRF_PendingMatch (1L<<1)
#define XkbRF_Option (1L<<2)
#define XkbRF_Append (1L<<3)
#define XkbRF_Normal (1L<<4)
#define XkbRF_Invalid (1L<<5)
typedef struct _XkbRF_Rules {
XkbRF_DescribeVarsRec models;
XkbRF_DescribeVarsRec layouts;
XkbRF_DescribeVarsRec variants;
XkbRF_DescribeVarsRec options;
unsigned short sz_extra;
unsigned short num_extra;
char ** extra_names;
XkbRF_DescribeVarsPtr extra;
unsigned short sz_rules;
unsigned short num_rules;
XkbRF_RulePtr rules;
unsigned short sz_groups;
unsigned short num_groups;
XkbRF_GroupPtr groups;
} XkbRF_RulesRec, *XkbRF_RulesPtr;
/***====================================================================***/
_XFUNCPROTOBEGIN
extern Bool XkbRF_GetComponents(
XkbRF_RulesPtr /* rules */,
XkbRF_VarDefsPtr /* var_defs */,
XkbComponentNamesPtr /* names */
);
extern XkbRF_RulePtr XkbRF_AddRule(
XkbRF_RulesPtr /* rules */
);
extern XkbRF_GroupPtr XkbRF_AddGroup(XkbRF_RulesPtr rules);
extern Bool XkbRF_LoadRules(
FILE * /* file */,
XkbRF_RulesPtr /* rules */
);
extern Bool XkbRF_LoadRulesByName(
char * /* base */,
char * /* locale */,
XkbRF_RulesPtr /* rules */
);
/***====================================================================***/
extern XkbRF_VarDescPtr XkbRF_AddVarDesc(
XkbRF_DescribeVarsPtr /* vars */
);
extern XkbRF_VarDescPtr XkbRF_AddVarDescCopy(
XkbRF_DescribeVarsPtr /* vars */,
XkbRF_VarDescPtr /* copy_from */
);
extern XkbRF_DescribeVarsPtr XkbRF_AddVarToDescribe(
XkbRF_RulesPtr /* rules */,
char * /* name */
);
extern Bool XkbRF_LoadDescriptions(
FILE * /* file */,
XkbRF_RulesPtr /* rules */
);
extern Bool XkbRF_LoadDescriptionsByName(
char * /* base */,
char * /* locale */,
XkbRF_RulesPtr /* rules */
);
extern XkbRF_RulesPtr XkbRF_Load(
char * /* base */,
char * /* locale */,
Bool /* wantDesc */,
Bool /* wantRules */
);
extern XkbRF_RulesPtr XkbRF_Create(
int /* sz_rules */,
int /* sz_extra */
);
/***====================================================================***/
extern void XkbRF_Free(
XkbRF_RulesPtr /* rules */,
Bool /* freeRules */
);
/***====================================================================***/
#define _XKB_RF_NAMES_PROP_ATOM "_XKB_RULES_NAMES"
#define _XKB_RF_NAMES_PROP_MAXLEN 1024
extern Bool XkbRF_GetNamesProp(
Display * /* dpy */,
char ** /* rules_file_rtrn */,
XkbRF_VarDefsPtr /* var_defs_rtrn */
);
extern Bool XkbRF_SetNamesProp(
Display * /* dpy */,
char * /* rules_file */,
XkbRF_VarDefsPtr /* var_defs */
);
_XFUNCPROTOEND
#endif /* _XKBRULES_H_ */

View file

@ -0,0 +1,69 @@
/************************************************************
Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc.
Permission to use, copy, modify, and distribute this
software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
documentation, and that the name of Silicon Graphics not be
used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifndef XKM_H
#define XKM_H 1
#define XkmFileVersion 15
#define XkmIllegalFile -1
#define XkmSemanticsFile 20
#define XkmLayoutFile 21
#define XkmKeymapFile 22
#define XkmGeometryFile 23
#define XkmTypesIndex 0
#define XkmCompatMapIndex 1
#define XkmSymbolsIndex 2
#define XkmIndicatorsIndex 3
#define XkmKeyNamesIndex 4
#define XkmGeometryIndex 5
#define XkmVirtualModsIndex 6
#define XkmLastIndex XkmVirtualModsIndex
#define XkmTypesMask (1<<0)
#define XkmCompatMapMask (1<<1)
#define XkmSymbolsMask (1<<2)
#define XkmIndicatorsMask (1<<3)
#define XkmKeyNamesMask (1<<4)
#define XkmGeometryMask (1<<5)
#define XkmVirtualModsMask (1<<6)
#define XkmLegalIndexMask (0x7f)
#define XkmAllIndicesMask (0x7f)
#define XkmSemanticsRequired (XkmCompatMapMask)
#define XkmSemanticsOptional (XkmTypesMask|XkmVirtualModsMask|XkmIndicatorsMask)
#define XkmSemanticsLegal (XkmSemanticsRequired|XkmSemanticsOptional)
#define XkmLayoutRequired (XkmKeyNamesMask|XkmSymbolsMask|XkmTypesMask)
#define XkmLayoutOptional (XkmVirtualModsMask|XkmGeometryMask)
#define XkmLayoutLegal (XkmLayoutRequired|XkmLayoutOptional)
#define XkmKeymapRequired (XkmSemanticsRequired|XkmLayoutRequired)
#define XkmKeymapOptional ((XkmSemanticsOptional|XkmLayoutOptional)&(~XkmKeymapRequired))
#define XkmKeymapLegal (XkmKeymapRequired|XkmKeymapOptional)
#define XkmLegalSection(m) (((m)&(~XkmKeymapLegal))==0)
#define XkmSingleSection(m) (XkmLegalSection(m)&&(((m)&(~(m)+1))==(m)))
#endif /* XKM_H */

View file

@ -0,0 +1,299 @@
/************************************************************
Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc.
Permission to use, copy, modify, and distribute this
software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
documentation, and that the name of Silicon Graphics not be
used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifndef _XKMFORMAT_H_
#define _XKMFORMAT_H_ 1
#include <X11/extensions/XKB.h>
#include <X11/extensions/XKBproto.h>
#include <X11/extensions/XKM.h>
typedef struct _xkmFileInfo {
CARD8 type;
CARD8 min_kc;
CARD8 max_kc;
CARD8 num_toc;
CARD16 present;
CARD16 pad;
} xkmFileInfo;
#define sz_xkmFileInfo 8
typedef struct _xkmSectionInfo {
CARD16 type;
CARD16 format;
CARD16 size;
CARD16 offset;
} xkmSectionInfo;
#define sz_xkmSectionInfo 8
typedef struct _xkmKeyTypeDesc {
CARD8 realMods;
CARD8 numLevels;
CARD16 virtualMods;
CARD8 nMapEntries;
CARD8 nLevelNames;
CARD8 preserve;
CARD8 pad;
} xkmKeyTypeDesc;
#define sz_xkmKeyTypeDesc 8
typedef struct _xkmKTMapEntryDesc {
CARD8 level;
CARD8 realMods;
CARD16 virtualMods;
} xkmKTMapEntryDesc;
#define sz_xkmKTMapEntryDesc 4
typedef struct _xkmModsDesc {
CARD8 realMods;
CARD8 pad;
CARD16 virtualMods;
} xkmModsDesc;
#define sz_xkmModsDesc 4
typedef struct _xkmVModMapDesc {
CARD8 key;
CARD8 pad;
CARD16 vmods;
} xkmVModMapDesc;
#define sz_xkmVModMapDesc 4
typedef struct _xkmSymInterpretDesc {
CARD32 sym;
CARD8 mods;
CARD8 match;
CARD8 virtualMod;
CARD8 flags;
CARD8 actionType;
CARD8 actionData[7];
} xkmSymInterpretDesc;
#define sz_xkmSymInterpretDesc 16
typedef struct _xkmBehaviorDesc {
CARD8 type;
CARD8 data;
CARD16 pad;
} xkmBehaviorDesc;
#define sz_xkmBehaviorDesc 4
typedef struct _xkmActionDesc {
CARD8 type;
CARD8 data[7];
} xkmActionDesc;
#define sz_xkmActionDesc 8
#define XkmKeyHasTypes (0x0f)
#define XkmKeyHasGroup1Type (1<<0)
#define XkmKeyHasGroup2Type (1<<1)
#define XkmKeyHasGroup3Type (1<<2)
#define XkmKeyHasGroup4Type (1<<3)
#define XkmKeyHasActions (1<<4)
#define XkmKeyHasBehavior (1<<5)
#define XkmRepeatingKey (1<<6)
#define XkmNonRepeatingKey (1<<7)
typedef struct _xkmKeySymMapDesc {
CARD8 width;
CARD8 num_groups;
CARD8 modifier_map;
CARD8 flags;
} xkmKeySymMapDesc;
#define sz_xkmKeySymMapDesc 4
typedef struct _xkmIndicatorMapDesc {
CARD8 indicator;
CARD8 flags;
CARD8 which_mods;
CARD8 real_mods;
CARD16 vmods;
CARD8 which_groups;
CARD8 groups;
CARD32 ctrls;
} xkmIndicatorMapDesc;
#define sz_xkmIndicatorMapDesc 12
typedef struct _xkmGeometryDesc {
CARD16 width_mm;
CARD16 height_mm;
CARD8 base_color_ndx;
CARD8 label_color_ndx;
CARD16 num_properties;
CARD16 num_colors;
CARD16 num_shapes;
CARD16 num_sections;
CARD16 num_doodads;
CARD16 num_key_aliases;
CARD16 pad1;
} xkmGeometryDesc;
#define sz_xkmGeometryDesc 20
typedef struct _xkmPointDesc {
INT16 x;
INT16 y;
} xkmPointDesc;
#define sz_xkmPointDesc 4
typedef struct _xkmOutlineDesc {
CARD8 num_points;
CARD8 corner_radius;
CARD16 pad;
} xkmOutlineDesc;
#define sz_xkmOutlineDesc 4
typedef struct _xkmShapeDesc {
CARD8 num_outlines;
CARD8 primary_ndx;
CARD8 approx_ndx;
CARD8 pad;
} xkmShapeDesc;
#define sz_xkmShapeDesc 4
typedef struct _xkmSectionDesc {
INT16 top;
INT16 left;
CARD16 width;
CARD16 height;
INT16 angle;
CARD8 priority;
CARD8 num_rows;
CARD8 num_doodads;
CARD8 num_overlays;
CARD16 pad2;
} xkmSectionDesc;
#define sz_xkmSectionDesc 16
typedef struct _xkmRowDesc {
INT16 top;
INT16 left;
CARD8 num_keys;
BOOL vertical;
CARD16 pad;
} xkmRowDesc;
#define sz_xkmRowDesc 8
typedef struct _xkmKeyDesc {
CARD8 name[XkbKeyNameLength];
INT16 gap;
CARD8 shape_ndx;
CARD8 color_ndx;
} xkmKeyDesc;
#define sz_xkmKeyDesc 8
typedef struct _xkmOverlayDesc {
CARD8 num_rows;
CARD8 pad1;
CARD16 pad2;
} xkmOverlayDesc;
#define sz_xkmOverlayDesc 4
typedef struct _xkmOverlayRowDesc {
CARD8 row_under;
CARD8 num_keys;
CARD16 pad;
} xkmOverlayRowDesc;
#define sz_xkmOverlayRowDesc 4
typedef struct _xkmOverlayKeyDesc {
char over[XkbKeyNameLength];
char under[XkbKeyNameLength];
} xkmOverlayKeyDesc;
#define sz_xkmOverlayKeyDesc 8
typedef struct _xkmShapeDoodadDesc {
CARD8 type;
CARD8 priority;
INT16 top;
INT16 left;
INT16 angle;
CARD8 color_ndx;
CARD8 shape_ndx;
CARD16 pad;
CARD32 pad1;
} xkmShapeDoodadDesc;
#define sz_xkmShapeDoodadDesc 16
typedef struct _xkmTextDoodadDesc {
CARD8 type;
CARD8 priority;
INT16 top;
INT16 left;
INT16 angle;
CARD16 width;
CARD16 height;
CARD8 color_ndx;
CARD8 pad1;
CARD16 pad2;
} xkmTextDoodadDesc;
#define sz_xkmTextDoodadDesc 16
typedef struct _xkmIndicatorDoodadDesc {
CARD8 type;
CARD8 priority;
INT16 top;
INT16 left;
CARD8 shape_ndx;
CARD8 on_color_ndx;
CARD8 off_color_ndx;
CARD8 pad1;
CARD16 pad2;
CARD32 pad3;
} xkmIndicatorDoodadDesc;
#define sz_xkmIndicatorDoodadDesc 16
typedef struct _xkmLogoDoodadDesc {
CARD8 type;
CARD8 priority;
INT16 top;
INT16 left;
INT16 angle;
CARD8 color_ndx;
CARD8 shape_ndx;
CARD16 pad;
CARD32 pad1;
} xkmLogoDoodadDesc;
#define sz_xkmLogoDoodadDesc 16
typedef struct _xkmAnyDoodadDesc {
CARD8 type;
CARD8 priority;
INT16 top;
INT16 left;
CARD16 pad1;
CARD32 pad2;
CARD32 pad3;
} xkmAnyDoodadDesc;
#define sz_xkmAnyDoodadDesc 16
typedef union _xkmDoodadDesc {
xkmAnyDoodadDesc any;
xkmShapeDoodadDesc shape;
xkmTextDoodadDesc text;
xkmIndicatorDoodadDesc indicator;
xkmLogoDoodadDesc logo;
} xkmDoodadDesc;
#define sz_xkmDoodadDesc 16
#endif /* _XKMFORMAT_H_ */