# -*-Perl-*-
# generic converters with associative lookup
# each converter is defined by the pair <Type, Converter>
# if Converter starts with "%" either fprintf or sscanf is used.
# Converters are supposed to take only one argument and return the
# requested type.

%stringTo = (
	     "Widget","name2Widget",
	     "XmString", "wafeCvtStringToXmString",
	     "XmStringTable", "wafeCvtStringToXmStringTable",
	     "XrmQuark", "XrmStringToQuark",
	     "TextSink","name2Sink",
	     "TextSource","name2Source",
	     "XtTranslations","XtParseTranslationTable",
	     "XtAccelerators", "XtParseAcceleratorTable",
	     "XmDropTransferEntryRec*", "string2transferEntryRec(XXX,XtDisplay(localVar1))",
	     "XtInputId", "%lu",
	     "XtIntervalId", "%lu",
	     "XtWorkProcId", "%lu",
	     "XawTextPosition", "%ld",
	     "XmTextPosition", "%ld",
	     "Dimension", "%hu",
	     "Position", "%hd",
	     "int", "%d",
	     "float", "%f",
	     "double", "%lf",
	     "char *", "%s",
	     "String", "%s",
	     "long", "%ld",
	     "time_t", "%ld",
	     "unsigned long", "%lu",
	     );

%stringToGarbage = (
		    "XmString", "XmStringFree",
		    "XmStringTable", "wafeFreeStringTable",
		    );


%toString = (
	     "Widget","widget2Name",
	     "XawTextPosition", "%ld",
	     "XmTextPosition", "%ld",
	     "int", "%d",
	     "long", "%ld",
	     "XtIntervalId", "%lu",
	     "XtWorkProcId", "%lu",
	     "float", "%f",
	     "double", "%f",
	     "Dimension", "%hu",
	     "Position", "%hd",
	     "XtInputId", "%lu",
	     "char *", "%s",
	     "String", "%s",
	     "String *", "Tcl_Merge(returnVar,",
	     "EscapedString", "wafeEscapedStrcpy-2",
	     "EscapedXmString", "wafeEscapedXmString2String-2",
	     "XmString", "wafeCvtXmString2String-2",
	     "XmStringTable", "wafeCvtXmStringTable2String",
	     "intArray", "wafeCvtIntsToTcl-2",
	     "int*,int", "wafeCvtIntsToTcl(NULL,XXXcount,XXXlist)",
	     "stringTable", "Tcl_Merge",
	     "WidgetList", "wafeCvtWidgetListToList-2",
	     "XrmQuark", "XrmQuarkToString",
	     "Window", "%p",
	     "WidgetID", "%ld",
	     );

#
# if-then-else cascaded converters; 
# each conversion definiton of a type consists of a pair <string, TookitType>
# order in the array determines the ordering of the cascade
#
@XtGrabKind = (
	       "none", "XtGrabNone",
	       "nonexclusive","XtGrabNonexclusive",
	       "exclusive","XtGrabExclusive",
	       );    

@GrabReturns = (
		"success", "GrabSuccess",
		"alreadyGrabbed","AlreadyGrabbed",
		"notViewable","GrabNotViewable", 
		"frozen","GrabFrozen",
		);

@SyncAsync = (
              "sync", "GrabModeSync",
	      "async", "GrabModeAsync",
	      );

@Boolean = (
	 "false",0,
	 "true",1,
	    );

@MapState = (
	 "IsUnmapped",0,
	 "IsUnviewable",1,
	 "IsViewable",2,
	    );

@SourceInputMask = (
	'read',   '(XtPointer)XtInputReadMask',
	'write',  '(XtPointer)XtInputWriteMask',
	'except', '(XtPointer)XtInputExceptMask',
	'none',   '(XtPointer)XtInputNoneMask',
		    );

@FileNoReadWrite = (
	'read', 0,
	'write', 1,
	'r', 0,
	'w', 1,
		   );

@NULL = (
	 "NULL",'NULL',
	 );
@None = (
	 "None",'None',
	 );


@TranslationModifier = (       
	 "override", 1,
	 "augment", 2,
         "replace", 3,
		);

@XawTextScanDirection = (
	"left", XawsdLeft,
	"right", XawsdRight,
	"Left", XawsdLeft,
	"Right", XawsdRight,
		);

@XawTextScanType = (
	 "position", XawstPositions,
	 "whiteSpace", XawstWhiteSpace,
	 "EOL", XawstEOL,
	 "paragraph", XawstParagraph,
	 "all", XawstAll
		  );
@XmChild = (
	 "DIALOG_CANCEL_BUTTON", XmDIALOG_CANCEL_BUTTON,
	 "DIALOG_DEFAULT_BUTTON", XmDIALOG_DEFAULT_BUTTON,
	 "DIALOG_HELP_BUTTON", XmDIALOG_HELP_BUTTON,
	 "DIALOG_OK_BUTTON", XmDIALOG_OK_BUTTON,
	 "DIALOG_SEPARATOR", XmDIALOG_SEPARATOR,
	 "DIALOG_SYMBOL_LABEL", XmDIALOG_SYMBOL_LABEL,
	 "DIALOG_MESSAGE_LABEL", XmDIALOG_MESSAGE_LABEL,

	 "DIALOG_APPLY_BUTTON", XmDIALOG_APPLY_BUTTON,
	 "DIALOG_DIR_LIST", XmDIALOG_DIR_LIST,
	 "DIALOG_DIR_LIST_LABEL", XmDIALOG_DIR_LIST_LABEL,
	 "DIALOG_FILTER_LABEL", XmDIALOG_FILTER_LABEL,
	 "DIALOG_FILTER_TEXT", XmDIALOG_FILTER_TEXT,
	 "DIALOG_LIST", XmDIALOG_LIST,
	 "DIALOG_LIST_LABEL", XmDIALOG_LIST_LABEL,
	 "DIALOG_SELECTION_LABEL", XmDIALOG_SELECTION_LABEL,
	 "DIALOG_TEXT", XmDIALOG_TEXT,
	 "DIALOG_WORK_AREA", XmDIALOG_WORK_AREA,

	 "DIALOG_COMMAND_TEXT", XmDIALOG_COMMAND_TEXT,
	 "DIALOG_PROMPT_LABEL", XmDIALOG_PROMPT_LABEL,
	 "DIALOG_HISTORY_LIST", XmDIALOG_HISTORY_LIST,
		  );

@XmHighlightMode = (
	 "NORMAL", 	        "XmHIGHLIGHT_NORMAL",
         "SELECTED",            "XmHIGHLIGHT_SELECTED",
         "SECONDARY_SELECTED",  "XmHIGHLIGHT_SECONDARY_SELECTED",
		     );

@XtCallbackProc = (
	 "exec", "(XtCallbackProc)wafeExecCallbackProc",
	 "none", "XtCallbackNone",
	 "exclusive", "XtCallbackExclusive",
	 "nonexclusive", "XtCallbackNonexclusive",
	 "popdown", "XtCallbackPopdown",
	 "position", "(XtCallbackProc)wafePositionCallbackProc",
	 "positionCursor", "(XtCallbackProc)wafePositionCursorCallbackProc",
                );

@XawTextSelectType = (
	    "selectAll", XawselectAll,
	    "selectChar", XawselectChar,
	    "selectLine", XawselectLine,
	    "selectNull", XawselectNull,
	    "selectParagraph", XawselectParagraph,
	    "selectPosition", XawselectPosition,
	    "selectWord",XawselectWord,
               );

@Atom = (
	 "0", XA_CUT_BUFFER0,
	 "1", XA_CUT_BUFFER1,
	 "2", XA_CUT_BUFFER2,
	 "3", XA_CUT_BUFFER3,
	 "4", XA_CUT_BUFFER4,
	 "5", XA_CUT_BUFFER5,
	 "6", XA_CUT_BUFFER6,
	 );

@WM_PROTOCOLS = (  # references localvar1 !
	 "WM_TAKE_FOCUS",  
		 'XInternAtom(XtDisplay(localVar1),"WM_TAKE_FOCUS",False)',
	 "WM_SAVE_YOURSELF", 
		 'XInternAtom(XtDisplay(localVar1),"WM_SAVE_YOURSELF",False)',
	 "WM_DELETE_WINDOW", 
		 'XInternAtom(XtDisplay(localVar1),"WM_DELETE_WINDOW",False)',
	 );

@ReplaceVal = (
	    "editDone", XawEditDone,
	    "positionError", XawPositionError,
	    "editError", XawEditError,
	       );

@XcToggleState = (
	    "on", XcOn,
	    "off", XcOff,
		  );

@signalType = (
            "term", "HANDLERMAX+SIGTERM",
            "quit", "HANDLERMAX+SIGQUIT",
            "int",  "HANDLERMAX+SIGINT",
            "hup",  "HANDLERMAX+SIGHUP",
            "pipe", "HANDLERMAX+SIGPIPE",
#            "cld",  "HANDLERMAX+SIGCLD",
            "usr1", "HANDLERMAX+SIGUSR1",
            "usr2", "HANDLERMAX+SIGUSR2",
	       );

@handlerType = (
	    "stdin", STDIN,
	    "stdout", STDOUT,
	    "stderr", STDERR,
	    "xioerr", XIOERR,
	    "htmlVisited", HTMLVISITED,
	    @signalType
		  );

@XmTravDir = (
	      "TRAVERSE_CURRENT",         XmTRAVERSE_CURRENT,
	      "TRAVERSE_NEXT",            XmTRAVERSE_NEXT,
	      "TRAVERSE_PREV",            XmTRAVERSE_PREV,
	      "TRAVERSE_HOME",            XmTRAVERSE_HOME,
	      "TRAVERSE_NEXT_TAB_GROUP",  XmTRAVERSE_NEXT_TAB_GROUP,
	      "TRAVERSE_PREV_TAB_GROUP",  XmTRAVERSE_PREV_TAB_GROUP,
	      "TRAVERSE_UP",              XmTRAVERSE_UP,
	      "TRAVERSE_DOWN",            XmTRAVERSE_DOWN,
	      "TRAVERSE_LEFT",            XmTRAVERSE_LEFT,
	      "TRAVERSE_RIGHT",           XmTRAVERSE_RIGHT,
	      );

%Structure = (
	    "XawTextBlock" , "(int) firstPos, (int) length, (char *) ptr, *(Atom) format",
	    "XawListReturnStruct", "(char *) string, (int) list_index",
	    "XedwListReturnStruct", "(char *) string, (int) xedwList_index",
	    "ElementRef", "(int) id, (int) pos",
	    "HTMLElementRecord", "(char *) anchorName, (char *) anchorHRef, (char *) edata",
	      );
 

%reasonCode = (
	       "cancelCallback", "XmCR_CANCEL",
	       "motionVerifyCallback", "XmCR_MOVING_INSERT_CURSOR",
	       "valueChangedCallback", "XmCR_VALUE_CHANGED",
	       "pageIncrementCallback", "XmCR_PAGE_INCREMENT",
	       "browseSelectionCallback", "XmCR_BROWSE_SELECT",
	       "inputCallback", "XmCR_INPUT",
	       "activateCallback", "XmCR_ACTIVATE",
	       "okCallback", "XmCR_OK",
	       "noMatchCallback", "XmCR_NO_MATCH",
	       "toBottomCallback", "XmCR_TO_BOTTOM",
	       "decrementCallback", "XmCR_DECREMENT",
	       "dragCallback", "XmCR_DRAG",
	       "exposeCallback", "XmCR_EXPOSE",
	       "defaultActionCallback", "XmCR_DEFAULT_ACTION",
	       "incrementCallback", "XmCR_INCREMENT",
	       "commandChangedCallback", "XmCR_COMMAND_CHANGED",
	       "losingFocusCallback", "XmCR_LOSING_FOCUS",
	       "modifyVerifyCallback", "XmCR_MODIFYING_TEXT_VALUE",
	       "applyCallback", "XmCR_APPLY",
	       "multipleSelectionCallback", "XmCR_MULTIPLE_SELECT",
	       "extendedSelectionCallback", "XmCR_EXTENDED_SELECT",
	       "toTopCallback", "XmCR_TO_TOP",
	       "commandEnteredCallback", "XmCR_COMMAND_ENTERED",
	       "resizeCallback", "XmCR_RESIZE",
	       "pageDecrementCallback", "XmCR_PAGE_DECREMENT",
	       "singleSelectionCallback", "XmCR_SINGLE_SELECT",
#
# XmGraph Widget's callbacks:
#	       
	       "arcEditedCallback", "XmCR_ARC_EDITED",
	       "newArcCallback", "XmCR_NEW_ARC",
	       "newNodeCallback", "XmCR_NEW_NODE",
               "arcMovedCallback", "XmCR_ARC_MOVED",
               "nodeMovedCallback", "XmCR_NODE_MOVED XmCR_NODES_MOVED",
	       "selectNodeCallback", "XmCR_SELECT_NODE XmCR_SELECT_NODES XmCR_SELECT_ARCS_AND_NODES XmCR_SELECT_ARC",
	       "selectArcCallback", "XmCR_SELECT_ARC XmCR_SELECT_ARCS XmCR_SELECT_ARCS_AND_NODES",
	       "deselectCallback", "XmCR_DESELECT",
	       "selectSubgraphCallback", "XmCR_SELECT_SUBGRAPH",
	       "defaultActionCallback", "XmCR_NODE_DOUBLE_CLICK XmCR_ARC_DOUBLE_CLICK XmCR_DOUBLE_CLICK",
               );












