#define CACHE_TRANSLATIONS
#define TM_NO_MATCH (-2)
#define _XtRStateTablePair "_XtStateTablePair"
typedef unsigned char TMByteCard;
typedef unsigned short TMShortCard;
typedef unsigned long TMLongCard;
typedef short TMShortInt;
typedef struct _TMTypeMatchRec *TMTypeMatch;
typedef struct _TMModifierMatchRec *TMModifierMatch;
typedef struct _TMEventRec *TMEventPtr;
typedef Boolean (*MatchProc)(TMTypeMatch typeMatch,
TMModifierMatch modMatch,
TMEventPtr eventSeq);
typedef struct _ModToKeysymTable {
Modifiers mask;
int count;
int idx;
} ModToKeysymTable;
typedef struct _LateBindings {
unsigned int knot:1;
unsigned int pair:1;
unsigned short ref_count;
KeySym keysym;
} LateBindings, *LateBindingsPtr;
typedef short ModifierMask;
typedef struct _ActionsRec *ActionPtr;
typedef struct _ActionsRec {
int idx;
String *params;
Cardinal num_params;
ActionPtr next;
} ActionRec;
typedef struct _XtStateRec *StatePtr;
typedef struct _XtStateRec {
unsigned int isCycleStart:1;
unsigned int isCycleEnd:1;
TMShortCard typeIndex;
TMShortCard modIndex;
ActionPtr actions;
StatePtr nextLevel;
}StateRec;
#define XtTableReplace 0
#define XtTableAugment 1
#define XtTableOverride 2
#define XtTableUnmerge 3
typedef unsigned int _XtTranslateOp;
typedef struct _TMModifierMatchRec{
TMLongCard modifiers;
TMLongCard modifierMask;
LateBindingsPtr lateModifiers;
Boolean standard;
}TMModifierMatchRec;
typedef struct _TMTypeMatchRec{
TMLongCard eventType;
TMLongCard eventCode;
TMLongCard eventCodeMask;
MatchProc matchEvent;
}TMTypeMatchRec;
typedef struct _TMBranchHeadRec {
unsigned int isSimple:1;
unsigned int hasActions:1;
unsigned int hasCycles:1;
unsigned int more:13;
TMShortCard typeIndex;
TMShortCard modIndex;
}TMBranchHeadRec, *TMBranchHead;
typedef struct _TMSimpleStateTreeRec{
unsigned int isSimple:1;
unsigned int isAccelerator:1;
unsigned int mappingNotifyInterest:1;
unsigned int refCount:13;
TMShortCard numBranchHeads;
TMShortCard numQuarks;
TMShortCard unused;
TMBranchHeadRec *branchHeadTbl;
XrmQuark *quarkTbl;
}TMSimpleStateTreeRec, *TMSimpleStateTree;
typedef struct _TMComplexStateTreeRec{
unsigned int isSimple:1;
unsigned int isAccelerator:1;
unsigned int mappingNotifyInterest:1;
unsigned int refCount:13;
TMShortCard numBranchHeads;
TMShortCard numQuarks;
TMShortCard numComplexBranchHeads;
TMBranchHeadRec *branchHeadTbl;
XrmQuark *quarkTbl;
StatePtr *complexBranchHeadTbl;
}TMComplexStateTreeRec, *TMComplexStateTree;
typedef struct _TMParseStateTreeRec{
unsigned int isSimple:1;
unsigned int isAccelerator:1;
unsigned int mappingNotifyInterest:1;
unsigned int isStackQuarks:1;
unsigned int isStackBranchHeads:1;
unsigned int isStackComplexBranchHeads:1;
unsigned int unused:10;
TMShortCard numBranchHeads;
TMShortCard numQuarks;
TMShortCard numComplexBranchHeads;
TMBranchHeadRec *branchHeadTbl;
XrmQuark *quarkTbl;
StatePtr *complexBranchHeadTbl;
TMShortCard branchHeadTblSize;
TMShortCard quarkTblSize;
TMShortCard complexBranchHeadTblSize;
StatePtr head;
}TMParseStateTreeRec, *TMParseStateTree;
typedef union _TMStateTreeRec{
TMSimpleStateTreeRec simple;
TMParseStateTreeRec parse;
TMComplexStateTreeRec complex;
}*TMStateTree, **TMStateTreePtr, **TMStateTreeList;
typedef struct _TMSimpleBindProcsRec {
XtActionProc *procs;
}TMSimpleBindProcsRec, *TMSimpleBindProcs;
typedef struct _TMComplexBindProcsRec {
Widget widget;
XtTranslations aXlations;
XtActionProc *procs;
}TMComplexBindProcsRec, *TMComplexBindProcs;
typedef struct _TMSimpleBindDataRec {
unsigned int isComplex:1;
TMSimpleBindProcsRec bindTbl[1];
}TMSimpleBindDataRec, *TMSimpleBindData;
typedef struct _TMComplexBindDataRec {
unsigned int isComplex:1;
struct _ATranslationData *accel_context;
TMComplexBindProcsRec bindTbl[1];
}TMComplexBindDataRec, *TMComplexBindData;
typedef union _TMBindDataRec{
TMSimpleBindDataRec simple;
TMComplexBindDataRec complex;
}*TMBindData;
typedef struct _TranslationData{
unsigned char hasBindings;
unsigned char operation;
TMShortCard numStateTrees;
struct _TranslationData *composers[2];
EventMask eventMask;
TMStateTree stateTreeTbl[1];
}TranslationData;
typedef struct _ATranslationData{
unsigned char hasBindings;
unsigned char operation;
struct _TranslationData *xlations;
struct _ATranslationData *next;
TMComplexBindProcsRec bindTbl[1];
}ATranslationData, *ATranslations;
typedef struct _TMConvertRec {
XtTranslations old;
XtTranslations new;
} TMConvertRec;
#define _XtEventTimerEventType ((TMLongCard)~0L)
#define KeysymModMask (1L<<27)
#define AnyButtonMask (1L<<28)
typedef struct _EventRec {
TMLongCard modifiers;
TMLongCard modifierMask;
LateBindingsPtr lateModifiers;
TMLongCard eventType;
TMLongCard eventCode;
TMLongCard eventCodeMask;
MatchProc matchEvent;
Boolean standard;
} Event;
typedef struct _EventSeqRec *EventSeqPtr;
typedef struct _EventSeqRec {
Event event;
StatePtr state;
EventSeqPtr next;
ActionPtr actions;
} EventSeqRec;
typedef EventSeqRec EventRec;
typedef EventSeqPtr EventPtr;
typedef struct _TMEventRec {
XEvent *xev;
Event event;
}TMEventRec;
typedef struct _ActionHookRec {
struct _ActionHookRec* next;
XtAppContext app;
XtActionHookProc proc;
XtPointer closure;
} ActionHookRec, *ActionHook;
#define TMKEYCACHELOG2 6
#define TMKEYCACHESIZE (1<<TMKEYCACHELOG2)
typedef struct _KeyCacheRec {
unsigned char modifiers_return[256];
KeyCode keycode[TMKEYCACHESIZE];
unsigned char modifiers[TMKEYCACHESIZE];
KeySym keysym[TMKEYCACHESIZE];
} TMKeyCache;
typedef struct _TMKeyContextRec {
XEvent *event;
unsigned long serial;
KeySym keysym;
Modifiers modifiers;
TMKeyCache keycache;
} TMKeyContextRec, *TMKeyContext;
typedef struct _TMGlobalRec{
TMTypeMatchRec **typeMatchSegmentTbl;
TMShortCard numTypeMatches;
TMShortCard numTypeMatchSegments;
TMShortCard typeMatchSegmentTblSize;
TMModifierMatchRec **modMatchSegmentTbl;
TMShortCard numModMatches;
TMShortCard numModMatchSegments;
TMShortCard modMatchSegmentTblSize;
Boolean newMatchSemantics;
#ifdef TRACE_TM
XtTranslations *tmTbl;
TMShortCard numTms;
TMShortCard tmTblSize;
struct _TMBindCacheRec **bindCacheTbl;
TMShortCard numBindCache;
TMShortCard bindCacheTblSize;
TMShortCard numLateBindings;
TMShortCard numBranchHeads;
TMShortCard numComplexStates;
TMShortCard numComplexActions;
#endif
}TMGlobalRec;
extern TMGlobalRec _XtGlobalTM;
#define TM_MOD_SEGMENT_SIZE 16
#define TM_TYPE_SEGMENT_SIZE 16
#define TMGetTypeMatch(idx) \
((TMTypeMatch) \
&((_XtGlobalTM.typeMatchSegmentTbl[((idx) >> 4)])[(idx) & 15]))
#define TMGetModifierMatch(idx) \
((TMModifierMatch) \
&((_XtGlobalTM.modMatchSegmentTbl[(idx) >> 4])[(idx) & 15]))
#define TMNewMatchSemantics() (_XtGlobalTM.newMatchSemantics)
#define TMBranchMore(branch) (branch->more)
#define TMComplexBranchHead(tree, br) \
(((TMComplexStateTree)tree)->complexBranchHeadTbl[TMBranchMore(br)])
#define TMGetComplexBindEntry(bindData, idx) \
((TMComplexBindProcs)&(((TMComplexBindData)bindData)->bindTbl[idx]))
#define TMGetSimpleBindEntry(bindData, idx) \
((TMSimpleBindProcs)&(((TMSimpleBindData)bindData)->bindTbl[idx]))
#define _InitializeKeysymTables(dpy, pd) \
if (pd->keysyms == NULL) \
_XtBuildKeysymTables(dpy, pd)
extern void _XtPopup(
Widget ,
XtGrabKind ,
_XtBoolean
);
extern String _XtPrintXlations(
Widget ,
XtTranslations ,
Widget ,
_XtBoolean
);
extern void _XtRegisterGrabs(
Widget
);
extern XtPointer _XtInitializeActionData(
struct _XtActionsRec * ,
Cardinal ,
_XtBoolean
);
extern void _XtAddEventSeqToStateTree(
EventSeqPtr ,
TMParseStateTree
);
extern Boolean _XtMatchUsingStandardMods(
TMTypeMatch ,
TMModifierMatch ,
TMEventPtr
);
extern Boolean _XtMatchUsingDontCareMods(
TMTypeMatch ,
TMModifierMatch ,
TMEventPtr
);
extern Boolean _XtRegularMatch(
TMTypeMatch ,
TMModifierMatch ,
TMEventPtr
);
extern Boolean _XtMatchAtom(
TMTypeMatch ,
TMModifierMatch ,
TMEventPtr
);
extern void _XtTranslateEvent(
Widget ,
XEvent*
);
#include "CallbackI.h"
#include "EventI.h"
#include "HookObjI.h"
#include "PassivGraI.h"
#include "ThreadsI.h"
#include "InitialI.h"
#include "ResourceI.h"
#include "StringDefs.h"
extern void _XtBuildKeysymTables(Display *dpy, XtPerDisplay pd);
#ifndef NO_MIT_HACKS
extern void _XtDisplayTranslations(
Widget ,
XEvent* ,
String* ,
Cardinal*
);
extern void _XtDisplayAccelerators(
Widget ,
XEvent* ,
String* ,
Cardinal*
);
extern void _XtDisplayInstalledAccelerators(
Widget ,
XEvent* ,
String* ,
Cardinal*
);
#endif
extern void _XtPopupInitialize(
XtAppContext
);
extern void _XtBindActions(
Widget ,
XtTM
);
extern Boolean _XtComputeLateBindings(
Display* ,
LateBindingsPtr ,
Modifiers* ,
Modifiers*
);
extern XtTranslations _XtCreateXlations(
TMStateTree * ,
TMShortCard ,
XtTranslations ,
XtTranslations
);
extern Boolean _XtCvtMergeTranslations(
Display* ,
XrmValuePtr ,
Cardinal* ,
XrmValuePtr ,
XrmValuePtr ,
XtPointer*
);
void _XtFreeTranslations(
XtAppContext ,
XrmValuePtr ,
XtPointer ,
XrmValuePtr ,
Cardinal*
);
extern TMShortCard _XtGetModifierIndex(
Event*
);
extern TMShortCard _XtGetQuarkIndex(
TMParseStateTree ,
XrmQuark
);
extern XtTranslations _XtGetTranslationValue(
Widget
);
extern TMShortCard _XtGetTypeIndex(
Event*
);
extern void _XtGrabInitialize(
XtAppContext
);
extern void _XtInstallTranslations(
Widget
);
extern void _XtRemoveTranslations(
Widget
);
extern void _XtDestroyTMData(
Widget
);
extern void _XtMergeTranslations(
Widget ,
XtTranslations ,
_XtTranslateOp
);
extern void _XtActionInitialize(
XtAppContext
);
extern TMStateTree _XtParseTreeToStateTree(
TMParseStateTree
);
extern String _XtPrintActions(
ActionRec* ,
XrmQuark*
);
extern String _XtPrintEventSeq(
EventSeqPtr ,
Display*
);
typedef Boolean (*_XtTraversalProc)(
StatePtr ,
XtPointer
);
extern void _XtTraverseStateTree(
TMStateTree ,
_XtTraversalProc ,
XtPointer
);
extern void _XtTranslateInitialize(
void
);
extern void _XtAddTMConverters(
ConverterTable
);
extern void _XtUnbindActions(
Widget ,
XtTranslations ,
TMBindData
);
extern void _XtUnmergeTranslations(
Widget ,
XtTranslations
);
extern void _XtAllocTMContext(XtPerDisplay pd);