1 /***********************************************************
2 Copyright (c) 1993, Oracle and/or its affiliates. All rights reserved.
4 Permission is hereby granted, free of charge, to any person obtaining a
5 copy of this software and associated documentation files (the "Software"),
6 to deal in the Software without restriction, including without limitation
7 the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 and/or sell copies of the Software, and to permit persons to whom the
9 Software is furnished to do so, subject to the following conditions:
11 The above copyright notice and this permission notice (including the next
12 paragraph) shall be included in all copies or substantial portions of the
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 DEALINGS IN THE SOFTWARE.
23 Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
27 Permission to use, copy, modify, and distribute this software and its
28 documentation for any purpose and without fee is hereby granted,
29 provided that the above copyright notice appear in all copies and that
30 both that copyright notice and this permission notice appear in
31 supporting documentation, and that the name of Digital not be
32 used in advertising or publicity pertaining to distribution of the
33 software without specific, written prior permission.
35 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
36 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
37 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
38 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
39 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
40 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
43 ******************************************************************/
47 Copyright 1987, 1988, 1998 The Open Group
49 Permission to use, copy, modify, distribute, and sell this software and its
50 documentation for any purpose is hereby granted without fee, provided that
51 the above copyright notice appear in all copies and that both that
52 copyright notice and this permission notice appear in supporting
55 The above copyright notice and this permission notice shall be included in
56 all copies or substantial portions of the Software.
58 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
59 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
60 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
61 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
62 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
63 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
65 Except as contained in this notice, the name of The Open Group shall not be
66 used in advertising or otherwise to promote the sale, use or other dealings
67 in this Software without prior written authorization from The Open Group.
75 #include "IntrinsicI.h"
78 typedef struct _TMStringBufRec{
82 }TMStringBufRec, *TMStringBuf;
85 #define STR_THRESHOLD 25
86 #define STR_INCAMOUNT 100
87 #define CHECK_STR_OVERFLOW(sb) \
88 if (sb->current - sb->start > (int)sb->max - STR_THRESHOLD) \
89 { String old = sb->start; \
90 sb->start = XtRealloc(old, (Cardinal)(sb->max += STR_INCAMOUNT)); \
91 sb->current = sb->current - old + sb->start; \
94 #define ExpandForChars(sb, nchars ) \
95 if ((unsigned)(sb->current - sb->start) > sb->max - STR_THRESHOLD - nchars) { \
96 String old = sb->start; \
97 sb->start = XtRealloc(old, \
98 (Cardinal)(sb->max += STR_INCAMOUNT + nchars)); \
99 sb->current = sb->current - old + sb->start; \
102 #define ExpandToFit(sb, more) \
104 size_t l = strlen(more); \
105 ExpandForChars(sb, l); \
108 static void PrintModifiers(
110 unsigned long mask, unsigned long mod)
112 Boolean notfirst = False;
113 CHECK_STR_OVERFLOW(sb);
115 if (mask == ~0UL && mod == 0) {
116 *sb->current++ = '!';
121 #define PRINTMOD(modmask,modstring) \
122 if (mask & modmask) { \
123 if (! (mod & modmask)) { \
124 *sb->current++ = '~'; \
128 *sb->current++ = ' '; \
129 else notfirst = True; \
130 strcpy(sb->current, modstring); \
131 sb->current += strlen(sb->current); \
134 PRINTMOD(ShiftMask, "Shift");
135 PRINTMOD(ControlMask, "Ctrl"); /* name is not CtrlMask... */
136 PRINTMOD(LockMask, "Lock");
137 PRINTMOD(Mod1Mask, "Mod1");
138 CHECK_STR_OVERFLOW(sb);
139 PRINTMOD(Mod2Mask, "Mod2");
140 PRINTMOD(Mod3Mask, "Mod3");
141 PRINTMOD(Mod4Mask, "Mod4");
142 PRINTMOD(Mod5Mask, "Mod5");
143 CHECK_STR_OVERFLOW(sb);
144 PRINTMOD(Button1Mask, "Button1");
145 PRINTMOD(Button2Mask, "Button2");
146 PRINTMOD(Button3Mask, "Button3");
147 CHECK_STR_OVERFLOW(sb);
148 PRINTMOD(Button4Mask, "Button4");
149 PRINTMOD(Button5Mask, "Button5");
154 static void PrintEventType(
158 CHECK_STR_OVERFLOW(sb);
160 #define PRINTEVENT(event, name) case event: (void) strcpy(sb->current, name); break;
161 PRINTEVENT(KeyPress, "<KeyPress>")
162 PRINTEVENT(KeyRelease, "<KeyRelease>")
163 PRINTEVENT(ButtonPress, "<ButtonPress>")
164 PRINTEVENT(ButtonRelease, "<ButtonRelease>")
165 PRINTEVENT(MotionNotify, "<MotionNotify>")
166 PRINTEVENT(EnterNotify, "<EnterNotify>")
167 PRINTEVENT(LeaveNotify, "<LeaveNotify>")
168 PRINTEVENT(FocusIn, "<FocusIn>")
169 PRINTEVENT(FocusOut, "<FocusOut>")
170 PRINTEVENT(KeymapNotify, "<KeymapNotify>")
171 PRINTEVENT(Expose, "<Expose>")
172 PRINTEVENT(GraphicsExpose, "<GraphicsExpose>")
173 PRINTEVENT(NoExpose, "<NoExpose>")
174 PRINTEVENT(VisibilityNotify, "<VisibilityNotify>")
175 PRINTEVENT(CreateNotify, "<CreateNotify>")
176 PRINTEVENT(DestroyNotify, "<DestroyNotify>")
177 PRINTEVENT(UnmapNotify, "<UnmapNotify>")
178 PRINTEVENT(MapNotify, "<MapNotify>")
179 PRINTEVENT(MapRequest, "<MapRequest>")
180 PRINTEVENT(ReparentNotify, "<ReparentNotify>")
181 PRINTEVENT(ConfigureNotify, "<ConfigureNotify>")
182 PRINTEVENT(ConfigureRequest, "<ConfigureRequest>")
183 PRINTEVENT(GravityNotify, "<GravityNotify>")
184 PRINTEVENT(ResizeRequest, "<ResizeRequest>")
185 PRINTEVENT(CirculateNotify, "<CirculateNotify>")
186 PRINTEVENT(CirculateRequest, "<CirculateRequest>")
187 PRINTEVENT(PropertyNotify, "<PropertyNotify>")
188 PRINTEVENT(SelectionClear, "<SelectionClear>")
189 PRINTEVENT(SelectionRequest, "<SelectionRequest>")
190 PRINTEVENT(SelectionNotify, "<SelectionNotify>")
191 PRINTEVENT(ColormapNotify, "<ColormapNotify>")
192 PRINTEVENT(ClientMessage, "<ClientMessage>")
193 case _XtEventTimerEventType:
194 (void) strcpy(sb->current,"<EventTimer>");
197 (void) sprintf(sb->current, "<0x%x>", (int) event);
200 sb->current += strlen(sb->current);
203 static void PrintCode(
205 unsigned long mask, unsigned long code)
207 CHECK_STR_OVERFLOW(sb);
210 (void) sprintf(sb->current, "0x%lx:0x%lx", mask, code);
211 else (void) sprintf(sb->current, /*"0x%lx"*/ "%d", (unsigned)code);
212 sb->current += strlen(sb->current);
216 static void PrintKeysym(
222 if (keysym == 0) return;
224 CHECK_STR_OVERFLOW(sb);
225 keysymName = XKeysymToString(keysym);
226 if (keysymName == NULL)
227 PrintCode(sb,~0UL,(unsigned long)keysym);
229 ExpandToFit(sb, keysymName);
230 strcpy(sb->current, keysymName);
231 sb->current += strlen(sb->current);
235 static void PrintAtom(
242 if (atom == 0) return;
244 atomName = (dpy ? XGetAtomName(dpy, atom) : NULL);
247 PrintCode(sb,~0UL,(unsigned long)atom);
249 ExpandToFit( sb, atomName );
250 strcpy(sb->current, atomName);
251 sb->current += strlen(sb->current);
256 static void PrintLateModifiers(
258 LateBindingsPtr lateModifiers)
260 for (; lateModifiers->keysym; lateModifiers++) {
261 CHECK_STR_OVERFLOW(sb);
262 if (lateModifiers->knot) {
263 *sb->current++ = '~';
265 *sb->current++ = ' ';
267 strcpy(sb->current, XKeysymToString(lateModifiers->keysym));
268 sb->current += strlen(sb->current);
269 if (lateModifiers->pair) {
270 *(sb->current -= 2) = '\0'; /* strip "_L" */
271 lateModifiers++; /* skip _R keysym */
276 static void PrintEvent(
278 register TMTypeMatch typeMatch,
279 register TMModifierMatch modMatch,
282 if (modMatch->standard) *sb->current++ = ':';
284 PrintModifiers(sb, modMatch->modifierMask, modMatch->modifiers);
285 if (modMatch->lateModifiers != NULL)
286 PrintLateModifiers(sb, modMatch->lateModifiers);
287 PrintEventType(sb, typeMatch->eventType);
288 switch (typeMatch->eventType) {
291 PrintKeysym(sb, (KeySym)typeMatch->eventCode);
296 case SelectionRequest:
297 case SelectionNotify:
299 PrintAtom(sb, dpy, (Atom)typeMatch->eventCode);
303 PrintCode(sb, typeMatch->eventCodeMask, typeMatch->eventCode);
307 static void PrintParams(
313 for (i = 0; i<num_params; i++) {
314 ExpandToFit( sb, params[i] );
316 *sb->current++ = ',';
317 *sb->current++ = ' ';
319 *sb->current++ = '"';
320 strcpy(sb->current, params[i]);
321 sb->current += strlen(sb->current);
322 *sb->current++ = '"';
327 static void PrintActions(
329 register ActionPtr actions,
333 while (actions != NULL) {
336 *sb->current++ = ' ';
340 String name = XtName(accelWidget);
341 int nameLen = strlen(name);
342 ExpandForChars(sb, nameLen );
343 XtMemmove(sb->current, name, nameLen );
344 sb->current += nameLen;
345 *sb->current++ = '`';
347 proc = XrmQuarkToString(quarkTbl[actions->idx]);
348 ExpandToFit( sb, proc );
349 strcpy(sb->current, proc);
350 sb->current += strlen(proc);
351 *sb->current++ = '(';
352 PrintParams(sb, actions->params, actions->num_params);
353 *sb->current++ = ')';
354 actions = actions->next;
359 static Boolean LookAheadForCycleOrMulticlick(
360 register StatePtr state,
361 StatePtr *state_return, /* state to print, usually startState */
363 StatePtr *nextLevelP)
366 StatePtr startState = state;
367 Boolean isCycle = startState->isCycleEnd;
368 TMTypeMatch sTypeMatch;
369 TMModifierMatch sModMatch;
372 sTypeMatch = TMGetTypeMatch(startState->typeIndex);
373 sModMatch = TMGetModifierMatch(startState->modIndex);
375 *state_return = startState;
377 for (state = state->nextLevel; state != NULL; state = state->nextLevel) {
378 TMTypeMatch typeMatch = TMGetTypeMatch(state->typeIndex);
379 TMModifierMatch modMatch = TMGetModifierMatch(state->modIndex);
381 /* try to pick up the correct state with actions, to be printed */
382 /* This is to accommodate <ButtonUp>(2+), for example */
383 if (state->isCycleStart)
384 *state_return = state;
386 if (state->isCycleEnd) {
387 *countP = repeatCount;
391 if ((startState->typeIndex == state->typeIndex) &&
392 (startState->modIndex == state->modIndex)) {
396 else if (typeMatch->eventType == _XtEventTimerEventType)
398 else /* not same event as starting event and not timer */ {
399 unsigned int type = sTypeMatch->eventType;
400 unsigned int t = typeMatch->eventType;
401 if ( (type == ButtonPress && t != ButtonRelease)
402 || (type == ButtonRelease && t != ButtonPress)
403 || (type == KeyPress && t != KeyRelease)
404 || (type == KeyRelease && t != KeyPress)
405 || typeMatch->eventCode != sTypeMatch->eventCode
406 || modMatch->modifiers != sModMatch->modifiers
407 || modMatch->modifierMask != sModMatch->modifierMask
408 || modMatch->lateModifiers != sModMatch->lateModifiers
409 || typeMatch->eventCodeMask != sTypeMatch->eventCodeMask
410 || typeMatch->matchEvent != sTypeMatch->matchEvent
411 || modMatch->standard != sModMatch->standard)
412 /* not inverse of starting event, either */
416 *countP = repeatCount;
421 static void PrintComplexState(
425 TMStateTree stateTree,
431 StatePtr nextLevel = NULL;
432 StatePtr triggerState = NULL;
434 /* print the current state */
437 cycle = LookAheadForCycleOrMulticlick(state, &triggerState, &clickCount,
440 PrintEvent(sb, TMGetTypeMatch(triggerState->typeIndex),
441 TMGetModifierMatch(triggerState->modIndex), dpy);
443 if (cycle || clickCount) {
445 sprintf(sb->current, "(%d%s)", clickCount+1, cycle ? "+" : "");
447 (void) strncpy(sb->current, "(+)", 4);
448 sb->current += strlen(sb->current);
449 if (! state->actions && nextLevel)
451 while (! state->actions && ! state->isCycleEnd)
452 state = state->nextLevel; /* should be trigger state */
455 if (state->actions) {
457 CHECK_STR_OVERFLOW(sb);
458 *sb->current++ = ':';
461 ((TMSimpleStateTree)stateTree)->quarkTbl,
463 *sb->current++ = '\n';
467 if (state->nextLevel && !cycle && !clickCount)
468 *sb->current++ = ',';
470 /* no actions are attached to this production */
471 *sb->current++ = ':';
472 *sb->current++ = '\n';
477 /* print succeeding states */
478 if (state->nextLevel && !cycle && !clickCount)
479 PrintComplexState(sb, includeRHS, state->nextLevel,
480 stateTree, accelWidget, dpy);
489 static int FindNextMatch(
491 TMShortCard numPrints,
492 XtTranslations xlations,
493 TMBranchHead branchHead,
495 TMShortCard startIndex)
498 TMComplexStateTree stateTree;
499 StatePtr currState, candState;
500 Boolean noMatch = True;
501 TMBranchHead prBranchHead;
503 for (i = startIndex; noMatch && i < numPrints; i++) {
504 stateTree = (TMComplexStateTree)
505 xlations->stateTreeTbl[printData[i].tIndex];
507 &(stateTree->branchHeadTbl[printData[i].bIndex]);
509 if ((prBranchHead->typeIndex == branchHead->typeIndex) &&
510 (prBranchHead->modIndex == branchHead->modIndex)) {
511 if (prBranchHead->isSimple) {
516 currState = TMComplexBranchHead(stateTree, prBranchHead);
517 currState = currState->nextLevel;
518 candState = nextLevel;
520 ((currState && !currState->isCycleEnd) &&
521 (candState && !candState->isCycleEnd));
522 currState = currState->nextLevel,
523 candState = candState->nextLevel) {
524 if ((currState->typeIndex != candState->typeIndex) ||
525 (currState->modIndex != candState->modIndex))
528 if (candState == currState) {
537 static void ProcessLaterMatches(
539 XtTranslations xlations,
542 TMShortCard *numPrintsRtn)
544 TMComplexStateTree stateTree;
546 TMBranchHead branchHead, matchBranch = NULL;
548 for (i = tIndex; i < (int)xlations->numStateTrees; i++) {
549 stateTree = (TMComplexStateTree)xlations->stateTreeTbl[i];
551 matchBranch = &stateTree->branchHeadTbl[bIndex];
555 for (branchHead = &stateTree->branchHeadTbl[j];
556 j < (int)stateTree->numBranchHeads;
558 if ((branchHead->typeIndex == matchBranch->typeIndex) &&
559 (branchHead->modIndex == matchBranch->modIndex)) {
561 if (!branchHead->isSimple)
562 state = TMComplexBranchHead(stateTree, branchHead);
565 if ((!branchHead->isSimple || branchHead->hasActions) &&
566 (FindNextMatch(printData,
570 (state ? state->nextLevel : NULL),
571 0) == TM_NO_MATCH)) {
572 printData[*numPrintsRtn].tIndex = i;
573 printData[*numPrintsRtn].bIndex = j;
581 static void ProcessStateTree(
583 XtTranslations xlations,
585 TMShortCard *numPrintsRtn)
587 TMComplexStateTree stateTree;
589 TMBranchHead branchHead;
591 stateTree = (TMComplexStateTree)xlations->stateTreeTbl[tIndex];
593 for (i = 0, branchHead = stateTree->branchHeadTbl;
594 i < (int)stateTree->numBranchHeads;
597 if (!branchHead->isSimple)
598 state = TMComplexBranchHead(stateTree, branchHead);
601 if (FindNextMatch(printData, *numPrintsRtn, xlations, branchHead,
602 (state ? state->nextLevel : NULL), 0)
604 if (!branchHead->isSimple || branchHead->hasActions) {
605 printData[*numPrintsRtn].tIndex = tIndex;
606 printData[*numPrintsRtn].bIndex = i;
610 if (_XtGlobalTM.newMatchSemantics == False)
611 ProcessLaterMatches(printData,
621 static void PrintState(
624 TMBranchHead branchHead,
629 TMComplexStateTree stateTree = (TMComplexStateTree)tree;
631 if (branchHead->isSimple) {
633 TMGetTypeMatch(branchHead->typeIndex),
634 TMGetModifierMatch(branchHead->modIndex),
639 CHECK_STR_OVERFLOW(sb);
640 *sb->current++ = ':';
641 actRec.idx = TMBranchMore(branchHead);
642 actRec.num_params = 0;
643 actRec.params = NULL;
649 *sb->current++ = '\n';
652 *sb->current++ = ',';
654 if (!branchHead->hasActions)
655 printf(" !! no actions !! ");
658 else { /* it's a complex branchHead */
659 StatePtr state = TMComplexBranchHead(stateTree, branchHead);
660 PrintComplexState(sb,
671 String _XtPrintXlations(
673 XtTranslations xlations,
675 _XtBoolean includeRHS)
678 #define STACKPRINTSIZE 250
679 PrintRec stackPrints[STACKPRINTSIZE];
681 TMStringBufRec sbRec, *sb = &sbRec;
682 TMShortCard numPrints, maxPrints;
684 TMBindData bindData = (TMBindData)w->core.tm.proc_table;
685 Boolean hasAccel = (accelWidget ? True : False);
686 #endif /* TRACE_TM */
687 if (xlations == NULL) return NULL;
689 sb->current = sb->start = __XtMalloc((Cardinal)1000);
692 for (i = 0; i < xlations->numStateTrees; i++)
694 ((TMSimpleStateTree)(xlations->stateTreeTbl[i]))->numBranchHeads;
695 prints = (PrintRec *)
696 XtStackAlloc(maxPrints * sizeof(PrintRec), stackPrints);
699 for (i = 0; i < xlations->numStateTrees; i++)
700 ProcessStateTree(prints, xlations, i, &numPrints);
702 for (i = 0; i < numPrints; i++) {
703 TMSimpleStateTree stateTree = (TMSimpleStateTree)
704 xlations->stateTreeTbl[prints[i].tIndex];
705 TMBranchHead branchHead =
706 &stateTree->branchHeadTbl[prints[i].bIndex];
708 TMComplexBindProcs complexBindProcs;
710 if (hasAccel == False) {
712 if (bindData->simple.isComplex) {
713 complexBindProcs = TMGetComplexBindEntry(bindData, 0);
714 accelWidget = complexBindProcs[prints[i].tIndex].widget;
717 #endif /* TRACE_TM */
718 PrintState(sb, (TMStateTree)stateTree, branchHead,
719 includeRHS, accelWidget, XtDisplay(w));
721 XtStackFree((XtPointer)prints, (XtPointer)stackPrints);
728 void _XtDisplayTranslations(
732 Cardinal *num_params)
736 xString = _XtPrintXlations(widget,
737 widget->core.tm.translations,
741 printf("%s\n",xString);
747 void _XtDisplayAccelerators(
751 Cardinal *num_params)
756 xString = _XtPrintXlations(widget,
757 widget->core.accelerators,
761 printf("%s\n",xString);
767 void _XtDisplayInstalledAccelerators(
771 Cardinal *num_params)
774 = XtWindowToWidget(event->xany.display, event->xany.window);
776 TMStringBufRec sbRec, *sb = &sbRec;
777 XtTranslations xlations;
778 #define STACKPRINTSIZE 250
779 PrintRec stackPrints[STACKPRINTSIZE];
781 TMShortCard numPrints, maxPrints;
782 TMBindData bindData ;
783 TMComplexBindProcs complexBindProcs;
785 if ((eventWidget == NULL) ||
786 (eventWidget->core.tm.translations == NULL) )
789 xlations = eventWidget->core.tm.translations;
790 bindData = (TMBindData) eventWidget->core.tm.proc_table;
791 if (bindData->simple.isComplex == False)
794 sb->current = sb->start = __XtMalloc((Cardinal)1000);
798 for (i = 0; i < xlations->numStateTrees; i++)
800 ((TMSimpleStateTree)xlations->stateTreeTbl[i])->numBranchHeads;
801 prints = (PrintRec *)
802 XtStackAlloc(maxPrints * sizeof(PrintRec), stackPrints);
806 complexBindProcs = TMGetComplexBindEntry(bindData, 0);
808 i < xlations->numStateTrees;
809 i++, complexBindProcs++) {
810 if (complexBindProcs->widget)
812 ProcessStateTree(prints, xlations, i, &numPrints);
815 for (i = 0; i < numPrints; i++) {
816 TMSimpleStateTree stateTree = (TMSimpleStateTree)
817 xlations->stateTreeTbl[prints[i].tIndex];
818 TMBranchHead branchHead =
819 &stateTree->branchHeadTbl[prints[i].bIndex];
821 complexBindProcs = TMGetComplexBindEntry(bindData, 0);
823 PrintState(sb, (TMStateTree)stateTree, branchHead, True,
824 complexBindProcs[prints[i].tIndex].widget,
827 XtStackFree((XtPointer)prints, (XtPointer)stackPrints);
828 printf("%s\n", sb->start);
831 #endif /*NO_MIT_HACKS*/
833 String _XtPrintActions(
834 register ActionRec *actions,
837 TMStringBufRec sbRec, *sb = &sbRec;
840 sb->current = sb->start = __XtMalloc((Cardinal)1000);
848 String _XtPrintState(
849 TMStateTree stateTree,
850 TMBranchHead branchHead)
852 TMStringBufRec sbRec, *sb = &sbRec;
854 sb->current = sb->start = __XtMalloc((Cardinal)1000);
856 PrintState(sb, stateTree, branchHead,
857 True, (Widget)NULL, (Display *)NULL);
862 String _XtPrintEventSeq(
863 register EventSeqPtr eventSeq,
866 TMStringBufRec sbRec, *sb = &sbRec;
867 TMTypeMatch typeMatch;
868 TMModifierMatch modMatch;
870 EventSeqPtr eventSeqs[MAXSEQS];
872 Boolean cycle = False;
874 sb->current = sb->start = __XtMalloc((Cardinal)1000);
877 i < MAXSEQS && eventSeq != NULL && !cycle;
878 eventSeq = eventSeq->next, i++)
880 eventSeqs[i] = eventSeq;
881 for (j = 0; j < i && !cycle; j++)
882 if (eventSeqs[j] == eventSeq)
886 for (j = 0; j < i; j++) {
888 TMGetTypeMatch(_XtGetTypeIndex(&eventSeqs[j]->event));
890 TMGetModifierMatch(_XtGetModifierIndex(&eventSeqs[j]->event));
891 PrintEvent(sb, typeMatch, modMatch, dpy);
893 *sb->current++ = ',';