# -*-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.
# Converter is supposed to take only on argument and returns the
# requested type.

%stringTo = (
	     "Widget","name2Widget",
	     "XmString", "stringToXmString",
	     "XrmQuark", "XrmStringToQuark",
	     "TextSink","name2Sink",
	     "TextSource","name2Source",
	     "XtTranslations","XtParseTranslationTable",
	     "XtAccelerators", "XtParseAcceleratorTable",
	     "XawTextPosition", "%ld",
	     "Dimension", "%hu",
	     "Position", "%hd",
	     "int", "%d",
	     "float", "%f",
	     "double", "%lf",
	     "char *", "%s",
	     "String", "%s",
	     "long", "%ld",
	     "unsigned long", "%lu",
	     );

%toString = (
	     "Widget","XtName",
	     "XawTextPosition", "%ld",
	     "int", "%d",
	     "float", "%f",
	     "Dimension", "%hu",
	     "Position", "%hd",
	     "char *", "%s",
	     "String", "%s",
	     "String *", "Tcl_Merge(returnVar,",
	     "EscapedString", "estrcpy-2",
	     "EscapedXmString", "exmString2String-2",
	     "XmString", "xmString2String-2",
	     "XmStringTable", "xmStringTable2String",
	     "intArray", "intsToTcl",
	     "WidgetList", "widgetListToList",
	     "XrmQuark", "XrmQuarkToString",
	     "Window", "%p",
	     "XmTextPosition", "%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 = (
	 "true",1,
	 "false",0,
	       );

@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,
		  );

@XtCallbackProc = (
	 "exec", "(XtCallbackProc)execCallbackProc",
	 "none", "XtCallbackNone",
	 "exclusive", "XtCallbackExclusive",
	 "nonexclusive", "XtCallbackNonexclusive",
	 "popdown", "XtCallbackPopdown",
	 "position", "(XtCallbackProc)positionCallbackProc",
	 "positionCursor", "(XtCallbackProc)positionCursorCallbackProc",
                );

@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,
		  );

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



%Structure = (
	    "XawTextBlock" , "(int) firstPos, (int) length, (char *) ptr, *(Atom) format",
	    "XawListReturnStruct", "(char *) string, (int) list_index",
	    "XedwListReturnStruct", "(char *) string, (int) xedwList_index",
)


