Initial import of the CDE 2.1.30 sources from the Open Group.
This commit is contained in:
64
cde/lib/DtTerm/Term/Imakefile
Normal file
64
cde/lib/DtTerm/Term/Imakefile
Normal file
@@ -0,0 +1,64 @@
|
||||
XCOMM $XConsortium: Imakefile /main/1 1996/04/21 19:15:07 drk $
|
||||
#define DoNormalLib NormalLibDtTerm
|
||||
#define DoSharedLib SharedLibDtTerm
|
||||
#define DoDebugLib DebugLibDtTerm
|
||||
#define DoProfileLib ProfileLibDtTerm
|
||||
#define LibName DtTerm
|
||||
#define SoRev SODTTERMREV
|
||||
#define IncSubdir Dt
|
||||
#define LibCreate NO
|
||||
|
||||
#include <Threads.tmpl>
|
||||
|
||||
DEFINES =
|
||||
INCLUDES = -I. -I../TermPrim
|
||||
|
||||
LINTLIBS = $(LINTXLIB) $(LINTXTOOL) $(LINTXM)
|
||||
|
||||
UTILDIR = ../util
|
||||
|
||||
TermLineData.c: TermLineData.data $(UTILDIR)/lineToData.c
|
||||
RemoveFiles($@ lineToData)
|
||||
LinkRule(lineToData,$(CFLAGS),$(UTILDIR)/lineToData.c,$(LDLIBS))
|
||||
./lineToData -p _DtTerm -f TermLineData.data > $@
|
||||
RemoveFile(./lineToData)
|
||||
|
||||
includes:: TermLineData.c
|
||||
|
||||
clean::
|
||||
RemoveFile(TermLineData.c)
|
||||
|
||||
|
||||
HEADERS = Term.h TermP.h
|
||||
|
||||
SRCS = \
|
||||
Term.c \
|
||||
TermAction.c \
|
||||
TermBuffer.c \
|
||||
TermColor.c \
|
||||
TermEnhance.c \
|
||||
TermFunction.c \
|
||||
TermFunctionKey.c \
|
||||
TermLineData.c \
|
||||
TermParse.c \
|
||||
TermParseTable.c \
|
||||
TermVersion.c
|
||||
|
||||
OBJS = \
|
||||
Term.o \
|
||||
TermAction.o \
|
||||
TermBuffer.o \
|
||||
TermColor.o \
|
||||
TermEnhance.o \
|
||||
TermFunction.o \
|
||||
TermFunctionKey.o \
|
||||
TermLineData.o \
|
||||
TermParse.o \
|
||||
TermParseTable.o \
|
||||
TermVersion.o
|
||||
|
||||
#include <Library.tmpl>
|
||||
|
||||
SubdirLibraryRule($(OBJS))
|
||||
|
||||
DependTarget()
|
||||
1038
cde/lib/DtTerm/Term/Term.c
Normal file
1038
cde/lib/DtTerm/Term/Term.c
Normal file
File diff suppressed because it is too large
Load Diff
623
cde/lib/DtTerm/Term/Term.h
Normal file
623
cde/lib/DtTerm/Term/Term.h
Normal file
@@ -0,0 +1,623 @@
|
||||
/* $XConsortium: Term.h /main/1 1996/04/21 19:15:14 drk $ */
|
||||
/*
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1993, 1994 Novell, Inc.
|
||||
*/
|
||||
|
||||
#ifndef _Dt_TermPrim_h
|
||||
#define _Dt_TermPrim_h
|
||||
|
||||
#include <sys/wait.h>
|
||||
#include <Xm/Xm.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
|
||||
/* Resources */
|
||||
|
||||
#ifndef DtNbackgroundIsSelect
|
||||
#define DtNbackgroundIsSelect "backgroundIsSelect"
|
||||
#endif
|
||||
#ifndef DtNblinkRate
|
||||
#define DtNblinkRate "blinkRate"
|
||||
#endif
|
||||
#ifndef DtNcharCursorStyle
|
||||
#define DtNcharCursorStyle "charCursorStyle"
|
||||
#endif
|
||||
#ifndef DtNconsoleMode
|
||||
#define DtNconsoleMode "consoleMode"
|
||||
#endif
|
||||
#ifndef DtNcsWidth
|
||||
#define DtNcsWidth "csWidth"
|
||||
#endif
|
||||
#ifndef DtNemulationId
|
||||
#define DtNemulationId "emulationId"
|
||||
#endif
|
||||
#ifndef DtNinputVerifyCallback
|
||||
#define DtNinputVerifyCallback "inputVerifyCallback"
|
||||
#endif
|
||||
#ifndef DtNjumpScroll
|
||||
#define DtNjumpScroll "jumpScroll"
|
||||
#endif
|
||||
#ifndef DtNkshMode
|
||||
#define DtNkshMode "kshMode"
|
||||
#endif
|
||||
#ifndef DtNlogFile
|
||||
#define DtNlogFile "logFile"
|
||||
#endif
|
||||
#ifndef DtNlogInhibit
|
||||
#define DtNlogInhibit "logInhibit"
|
||||
#endif
|
||||
#ifndef DtNlogging
|
||||
#define DtNlogging "logging"
|
||||
#endif
|
||||
#ifndef DtNloginShell
|
||||
#define DtNloginShell "loginShell"
|
||||
#endif
|
||||
#ifndef DtNmapOnOutput
|
||||
#define DtNmapOnOutput "mapOnOutput"
|
||||
#endif
|
||||
#ifndef DtNmapOnOutputDelay
|
||||
#define DtNmapOnOutputDelay "mapOnOutputDelay"
|
||||
#endif
|
||||
#ifndef DtNmarginBell
|
||||
#define DtNmarginBell "marginBell"
|
||||
#endif
|
||||
#ifndef DtNnMarginBell
|
||||
#define DtNnMarginBell "nMarginBell"
|
||||
#endif
|
||||
#ifndef DtNoutputLogCallback
|
||||
#define DtNoutputLogCallback "outputLogCallback"
|
||||
#endif
|
||||
#ifndef DtNpointerBlank
|
||||
#define DtNpointerBlank "pointerBlank"
|
||||
#endif
|
||||
#ifndef DtNpointerBlankDelay
|
||||
#define DtNpointerBlankDelay "pointerBlankDelay"
|
||||
#endif
|
||||
#ifndef DtNpointerColor
|
||||
#define DtNpointerColor "pointerColor"
|
||||
#endif
|
||||
#ifndef DtNpointerColorBackground
|
||||
#define DtNpointerColorBackground "pointerColorBackground"
|
||||
#endif
|
||||
#ifndef DtNpointerShape
|
||||
#define DtNpointerShape "pointerShape"
|
||||
#endif
|
||||
#ifndef DtNreverseVideo
|
||||
#define DtNreverseVideo "reverseVideo"
|
||||
#endif
|
||||
#ifndef DtNsaveLines
|
||||
#define DtNsaveLines "saveLines"
|
||||
#endif
|
||||
#ifndef DtNsizeList
|
||||
#define DtNsizeList "sizeList"
|
||||
#endif
|
||||
#ifndef DtNstatusChangeCallback
|
||||
#define DtNstatusChangeCallback "statusChangeCallback"
|
||||
#endif
|
||||
#ifndef DtNstickyNextCursor
|
||||
#define DtNstickyNextCursor "stickyNextCursor"
|
||||
#endif
|
||||
#ifndef DtNstickyPrevCursor
|
||||
#define DtNstickyPrevCursor "stickyPrevCursor"
|
||||
#endif
|
||||
#ifndef DtNsubprocessLoginShell
|
||||
#define DtNsubprocessLoginShell "subprocessLoginShell"
|
||||
#endif
|
||||
#ifndef DtNsubprocessPid
|
||||
#define DtNsubprocessPid "subprocessPid"
|
||||
#endif
|
||||
#ifndef DtNsubprocessExec
|
||||
#define DtNsubprocessExec "subprocessExec"
|
||||
#endif
|
||||
#ifndef DtNsubprocessTerminationCatch
|
||||
#define DtNsubprocessTerminationCatch "subprocessTerminationCatch"
|
||||
#endif
|
||||
#ifndef DtNsubprocessCmd
|
||||
#define DtNsubprocessCmd "subprocessCmd"
|
||||
#endif
|
||||
#ifndef DtNsubprocessArgv
|
||||
#define DtNsubprocessArgv "subprocessArgv"
|
||||
#endif
|
||||
#ifndef DtNsubprocessTerminationCallback
|
||||
#define DtNsubprocessTerminationCallback "subprocessTerminationCallback"
|
||||
#endif
|
||||
#ifndef DtNtermEmulationMode
|
||||
#define DtNtermEmulationMode "termEmulationMode"
|
||||
#endif
|
||||
#ifndef DtNtermDevice
|
||||
#define DtNtermDevice "termDevice"
|
||||
#endif
|
||||
#ifndef DtNtermDeviceAllocate
|
||||
#define DtNtermDeviceAllocate "termDeviceAllocate"
|
||||
#endif
|
||||
#ifndef DtNtermId
|
||||
#define DtNtermId "termId"
|
||||
#endif
|
||||
#ifndef DtNtermName
|
||||
#define DtNtermName "termName"
|
||||
#endif
|
||||
#ifndef DtNtermSlaveName
|
||||
#define DtNtermSlaveName "termSlaveName"
|
||||
#endif
|
||||
#ifndef DtNttyModes
|
||||
#define DtNttyModes "ttyModes"
|
||||
#endif
|
||||
#ifndef DtNuseFontSets
|
||||
#define DtNuseFontSets "useFontSets"
|
||||
#endif
|
||||
#ifndef DtNuseLineDraw
|
||||
#define DtNuseLineDraw "useLineDraw"
|
||||
#endif
|
||||
#ifndef DtNuserFont
|
||||
#define DtNuserFont "userFont"
|
||||
#endif
|
||||
#ifndef DtNuserBoldFont
|
||||
#define DtNuserBoldFont "userBoldFont"
|
||||
#endif
|
||||
#ifndef DtNvisualBell
|
||||
#define DtNvisualBell "visualBell"
|
||||
#endif
|
||||
#ifndef DtNallowSendEvents
|
||||
#define DtNallowSendEvents "allowSendEvents"
|
||||
#endif
|
||||
#ifndef DtNbaseHeight
|
||||
#define DtNbaseHeight XmNbaseHeight
|
||||
#endif
|
||||
#ifndef DtNbaseWidth
|
||||
#define DtNbaseWidth XmNbaseWidth
|
||||
#endif
|
||||
#ifndef DtNcolumns
|
||||
#define DtNcolumns XmNcolumns
|
||||
#endif
|
||||
#ifndef DtNheightInc
|
||||
#define DtNheightInc XmNheightInc
|
||||
#endif
|
||||
#ifndef DtNmarginHeight
|
||||
#define DtNmarginHeight XmNmarginHeight
|
||||
#endif
|
||||
#ifndef DtNmarginWidth
|
||||
#define DtNmarginWidth XmNmarginWidth
|
||||
#endif
|
||||
#ifndef DtNrows
|
||||
#define DtNrows XmNrows
|
||||
#endif
|
||||
#ifndef DtNshadowType
|
||||
#define DtNshadowType XmNshadowType
|
||||
#endif
|
||||
#ifndef DtNverticalScrollBar
|
||||
#define DtNverticalScrollBar XmNverticalScrollBar
|
||||
#endif
|
||||
#ifndef DtNwidthInc
|
||||
#define DtNwidthInc XmNwidthInc
|
||||
#endif
|
||||
|
||||
#ifndef DtCBackground
|
||||
#define DtCBackground XmCBackground
|
||||
#endif
|
||||
#ifndef DtCBackgroundIsSelect
|
||||
#define DtCBackgroundIsSelect "BackgroundIsSelect"
|
||||
#endif
|
||||
#ifndef DtCBlinkRate
|
||||
#define DtCBlinkRate "BlinkRate"
|
||||
#endif
|
||||
#ifndef DtCCallback
|
||||
#define DtCCallback XmCCallback
|
||||
#endif
|
||||
#ifndef DtCCursor
|
||||
#define DtCCursor XmCCursor
|
||||
#endif
|
||||
#ifndef DtCConsoleMode
|
||||
#define DtCConsoleMode "ConsoleMode"
|
||||
#endif
|
||||
#ifndef DtCCsWidth
|
||||
#define DtCCsWidth "CsWidth"
|
||||
#endif
|
||||
#ifndef DtCCharCursorStyle
|
||||
#define DtCCharCursorStyle "CharCursorStyle"
|
||||
#endif
|
||||
#ifndef DtCEmulationId
|
||||
#define DtCEmulationId "EmulationId"
|
||||
#endif
|
||||
#ifndef DtCForeground
|
||||
#define DtCForeground XmCForeground
|
||||
#endif
|
||||
#ifndef DtCJumpScroll
|
||||
#define DtCJumpScroll "JumpScroll"
|
||||
#endif
|
||||
#ifndef DtCKshMode
|
||||
#define DtCKshMode "KshMode"
|
||||
#endif
|
||||
#ifndef DtCLogFile
|
||||
#define DtCLogFile "LogFile"
|
||||
#endif
|
||||
#ifndef DtCLogInhibit
|
||||
#define DtCLogInhibit "LogInhibit"
|
||||
#endif
|
||||
#ifndef DtCLogging
|
||||
#define DtCLogging "Logging"
|
||||
#endif
|
||||
#ifndef DtCLoginShell
|
||||
#define DtCLoginShell "LoginShell"
|
||||
#endif
|
||||
#ifndef DtCMapOnOutput
|
||||
#define DtCMapOnOutput "MapOnOutput"
|
||||
#endif
|
||||
#ifndef DtCMapOnOutputDelay
|
||||
#define DtCMapOnOutputDelay "MapOnOutputDelay"
|
||||
#endif
|
||||
#ifndef DtCMarginBell
|
||||
#define DtCMarginBell "MarginBell"
|
||||
#endif
|
||||
#ifndef DtCNMarginBell
|
||||
#define DtCNMarginBell "NMarginBell"
|
||||
#endif
|
||||
#ifndef DtCPointerBlank
|
||||
#define DtCPointerBlank "PointerBlank"
|
||||
#endif
|
||||
#ifndef DtCPointerBlankDelay
|
||||
#define DtCPointerBlankDelay "PointerBlankDelay"
|
||||
#endif
|
||||
#ifndef DtCPointerColor
|
||||
#define DtCPointerColor "PointerColor"
|
||||
#endif
|
||||
#ifndef DtCPointerColorBackground
|
||||
#define DtCPointerColorBackground "PointerColorBackground"
|
||||
#endif
|
||||
#ifndef DtCPointerShape
|
||||
#define DtCPointerShape "PointerShape"
|
||||
#endif
|
||||
#ifndef DtCReverseVideo
|
||||
#define DtCReverseVideo "ReverseVideo"
|
||||
#endif
|
||||
#ifndef DtCSaveLines
|
||||
#define DtCSaveLines "SaveLines"
|
||||
#endif
|
||||
#ifndef DtCSizeList
|
||||
#define DtCSizeList "SizeList"
|
||||
#endif
|
||||
#ifndef DtCStickyCursor
|
||||
#define DtCStickyCursor "StickyCursor"
|
||||
#endif
|
||||
#ifndef DtCSubprocessLoginShell
|
||||
#define DtCSubprocessLoginShell "SubprocessLoginShell"
|
||||
#endif
|
||||
#ifndef DtCSubprocessPid
|
||||
#define DtCSubprocessPid "SubprocessPid"
|
||||
#endif
|
||||
#ifndef DtCSubprocessExec
|
||||
#define DtCSubprocessExec "SubprocessExec"
|
||||
#endif
|
||||
#ifndef DtCSubprocessTerminationCatch
|
||||
#define DtCSubprocessTerminationCatch "SubprocessTerminationCatch"
|
||||
#endif
|
||||
#ifndef DtCSubprocessCmd
|
||||
#define DtCSubprocessCmd "SubprocessCmd"
|
||||
#endif
|
||||
#ifndef DtCSubprocessArgv
|
||||
#define DtCSubprocessArgv "SubprocessArgv"
|
||||
#endif
|
||||
#ifndef DtCTermEmulationMode
|
||||
#define DtCTermEmulationMode "TermEmulationMode"
|
||||
#endif
|
||||
#ifndef DtCTermDevice
|
||||
#define DtCTermDevice "TermDevice"
|
||||
#endif
|
||||
#ifndef DtCTermDeviceAllocate
|
||||
#define DtCTermDeviceAllocate "TermDeviceAllocate"
|
||||
#endif
|
||||
#ifndef DtCTermId
|
||||
#define DtCTermId "TermId"
|
||||
#endif
|
||||
#ifndef DtCTermName
|
||||
#define DtCTermName "TermName"
|
||||
#endif
|
||||
#ifndef DtCTermSlaveName
|
||||
#define DtCTermSlaveName "TermSlaveName"
|
||||
#endif
|
||||
#ifndef DtCTtyModes
|
||||
#define DtCTtyModes "TtyModes"
|
||||
#endif
|
||||
#ifndef DtCUseFontSets
|
||||
#define DtCUseFontSets "UseFontSets"
|
||||
#endif
|
||||
#ifndef DtCUseLineDraw
|
||||
#define DtCUseLineDraw "UseLineDraw"
|
||||
#endif
|
||||
#ifndef DtCUserFont
|
||||
#define DtCUserFont "UserFont"
|
||||
#endif
|
||||
#ifndef DtCUserBoldFont
|
||||
#define DtCUserBoldFont "UserBoldFont"
|
||||
#endif
|
||||
#ifndef DtCVisualBell
|
||||
#define DtCVisualBell "VisualBell"
|
||||
#endif
|
||||
#ifndef DtCAllowSendEvents
|
||||
#define DtCAllowSendEvents "AllowSendEvents"
|
||||
#endif
|
||||
#ifndef DtCBaseHeight
|
||||
#define DtCBaseHeight XmCBaseHeight
|
||||
#endif
|
||||
#ifndef DtCBaseWidth
|
||||
#define DtCBaseWidth XmCBaseWidth
|
||||
#endif
|
||||
#ifndef DtCColumns
|
||||
#define DtCColumns XmCColumns
|
||||
#endif
|
||||
#ifndef DtCHeightInc
|
||||
#define DtCHeightInc XmCHeightInc
|
||||
#endif
|
||||
#ifndef DtCMarginHeight
|
||||
#define DtCMarginHeight XmCMarginHeight
|
||||
#endif
|
||||
#ifndef DtCMarginWidth
|
||||
#define DtCMarginWidth XmCMarginWidth
|
||||
#endif
|
||||
#ifndef DtCRows
|
||||
#define DtCRows XmCRows
|
||||
#endif
|
||||
#ifndef DtCShadowType
|
||||
#define DtCShadowType XmCShadowType
|
||||
#endif
|
||||
#ifndef DtCVerticalScrollBar
|
||||
#define DtCVerticalScrollBar XmCVerticalScrollBar
|
||||
#endif
|
||||
#ifndef DtCWidthInc
|
||||
#define DtCWidthInc XmCWidthInc
|
||||
#endif
|
||||
|
||||
/* Representation types */
|
||||
|
||||
#define DtRDtTermCharCursorStyle "DtTermCharCursorStyle"
|
||||
#define DtRDtTermEmulationMode "DtTermEmulationMode"
|
||||
#define DtRDtTermTerminalSize "DtTermTerminalSize"
|
||||
#define DtRDtTermTerminalSizeList "DtTermTerminalSizeList"
|
||||
|
||||
/* DtNshadowType values */
|
||||
|
||||
#ifndef DtSHADOW_IN
|
||||
#define DtSHADOW_IN XmSHADOW_IN
|
||||
#endif
|
||||
#ifndef DtSHADOW_OUT
|
||||
#define DtSHADOW_OUT XmSHADOW_OUT
|
||||
#endif
|
||||
#ifndef DtSHADOW_ETCHED_IN
|
||||
#define DtSHADOW_ETCHED_IN XmSHADOW_ETCHED_IN
|
||||
#endif
|
||||
#ifndef DtSHADOW_ETCHED_OUT
|
||||
#define DtSHADOW_ETCHED_OUT XmSHADOW_ETCHED_OUT
|
||||
#endif
|
||||
|
||||
#define DtTERM_CHAR_CURSOR_BOX 0
|
||||
#define DtTERM_CHAR_CURSOR_BAR 1
|
||||
#define DtTERM_CHAR_CURSOR_INVISIBLE 2
|
||||
|
||||
#define DtTermEMULATIONHP 0
|
||||
#define DtTermEMULATIONANSI 1
|
||||
|
||||
/* Callback reasons */
|
||||
|
||||
#define DtCR_TERM_SUBPROCESS_TERMINATION 1
|
||||
#define DtCR_TERM_STATUS_CHANGE 2
|
||||
#define DtCR_TERM_INPUT_VERIFY 7
|
||||
#define DtCR_TERM_OUTPUT_LOG 8
|
||||
|
||||
|
||||
/*
|
||||
* Types
|
||||
*/
|
||||
|
||||
/* insert char mode */
|
||||
|
||||
typedef enum {
|
||||
DtTERM_INSERT_CHAR_OFF = 0,
|
||||
DtTERM_INSERT_CHAR_ON,
|
||||
DtTERM_INSERT_CHAR_ON_WRAP
|
||||
} DtTermInsertCharMode;
|
||||
|
||||
typedef struct {
|
||||
int reason;
|
||||
XEvent *event;
|
||||
int cursorX;
|
||||
int cursorY;
|
||||
Boolean capsLock;
|
||||
Boolean stop;
|
||||
DtTermInsertCharMode insertCharMode;
|
||||
Boolean locked;
|
||||
} DtTermStatusChangeCallbackStruct;
|
||||
|
||||
typedef struct {
|
||||
int reason;
|
||||
XEvent *event;
|
||||
pid_t pid;
|
||||
int status;
|
||||
} DtTermSubprocessTerminationCallbackStruct;
|
||||
|
||||
typedef struct {
|
||||
int reason;
|
||||
XEvent *event;
|
||||
Boolean doit;
|
||||
unsigned char *text;
|
||||
int length;
|
||||
} DtTermInputVerifyCallbackStruct;
|
||||
|
||||
typedef struct {
|
||||
int reason;
|
||||
XEvent *event;
|
||||
unsigned char *text;
|
||||
int length;
|
||||
} DtTermOutputLogCallbackStruct;
|
||||
|
||||
typedef struct _DtTermTerminalSize {
|
||||
short rows;
|
||||
short columns;
|
||||
} DtTermTerminalSize;
|
||||
|
||||
typedef struct _DtTermTerminalSizeList {
|
||||
int numSizes;
|
||||
DtTermTerminalSize *sizes;
|
||||
} DtTermTerminalSizeList;
|
||||
|
||||
/* Widget class and instance */
|
||||
|
||||
typedef struct _DtTermPrimitiveClassRec *DtTermPrimitiveWidgetClass;
|
||||
typedef struct _DtTermPrimitiveRec *DtTermPrimitiveWidget;
|
||||
|
||||
|
||||
/*
|
||||
* Data
|
||||
*/
|
||||
|
||||
/* Widget class record */
|
||||
|
||||
externalref WidgetClass dtTermPrimitiveWidgetClass;
|
||||
|
||||
|
||||
/*
|
||||
* Functions
|
||||
*/
|
||||
|
||||
extern Widget DtCreateTermPrimitive(
|
||||
Widget parent,
|
||||
char *name,
|
||||
ArgList arglist,
|
||||
Cardinal argcount);
|
||||
|
||||
extern void DtTermInitialize(void);
|
||||
|
||||
extern void DtTermDisplaySend(
|
||||
Widget widget,
|
||||
unsigned char *buffer,
|
||||
int length);
|
||||
|
||||
extern void DtTermSubprocSend(
|
||||
Widget widget,
|
||||
unsigned char *buffer,
|
||||
int length);
|
||||
|
||||
extern void DtTermSubprocReap(
|
||||
pid_t pid,
|
||||
int *stat_loc);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _Dt_TermPrim_h */
|
||||
|
||||
|
||||
|
||||
#ifndef _Dt_Term_h
|
||||
#define _Dt_Term_h
|
||||
|
||||
#include <Dt/TermPrim.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
|
||||
/* Resources */
|
||||
|
||||
#ifndef DtNfunctionKeyExecuteProc
|
||||
#define DtNfunctionKeyExecuteProc "functionKeyExecuteProc"
|
||||
#endif
|
||||
#ifndef DtNfunctionKeyUpdateProc
|
||||
#define DtNfunctionKeyUpdateProc "functionKeyUpdateProc"
|
||||
#endif
|
||||
#ifndef DtNautoWrap
|
||||
#define DtNautoWrap "autoWrap"
|
||||
#endif
|
||||
#ifndef DtNreverseWrap
|
||||
#define DtNreverseWrap "reverseWrap"
|
||||
#endif
|
||||
#ifndef DtNsunFunctionKeys
|
||||
#define DtNsunFunctionKeys "sunFunctionKeys"
|
||||
#endif
|
||||
#ifndef DtNc132
|
||||
#define DtNc132 "c132"
|
||||
#endif
|
||||
#ifndef DtNappCursorDefault
|
||||
#define DtNappCursorDefault "appCursorDefault"
|
||||
#endif
|
||||
#ifndef DtNappKeypadDefault
|
||||
#define DtNappKeypadDefault "appKeypadDefault"
|
||||
#endif
|
||||
|
||||
#ifndef DtCFunctionKeyExecuteProc
|
||||
#define DtCFunctionKeyExecuteProc "FunctionKeyExecuteProc"
|
||||
#endif
|
||||
#ifndef DtCFunctionKeyUpdateProc
|
||||
#define DtCFunctionKeyUpdateProc "FunctionKeyUpdateProc"
|
||||
#endif
|
||||
#ifndef DtCFunctionKeyLast
|
||||
#define DtCFunctionKeyLast "FunctionKeyLast"
|
||||
#endif
|
||||
#ifndef DtCAutoWrap
|
||||
#define DtCAutoWrap "AutoWrap"
|
||||
#endif
|
||||
#ifndef DtCReverseWrap
|
||||
#define DtCReverseWrap "ReverseWrap"
|
||||
#endif
|
||||
#ifndef DtCSunFunctionKeys
|
||||
#define DtCSunFunctionKeys "SunFunctionKeys"
|
||||
#endif
|
||||
#ifndef DtCC132
|
||||
#define DtCC132 "C132"
|
||||
#endif
|
||||
#ifndef DtCAppCursorDefault
|
||||
#define DtCAppCursorDefault "AppCursorDefault"
|
||||
#endif
|
||||
#ifndef DtCAppKeypadDefault
|
||||
#define DtCAppKeypadDefault "AppKeypadDefault"
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Types
|
||||
*/
|
||||
|
||||
/* Widget class and instance */
|
||||
|
||||
typedef struct _DtTermClassRec *DtTermWidgetClass;
|
||||
typedef struct _DtTermRec *DtTermWidget;
|
||||
|
||||
|
||||
/*
|
||||
* Data
|
||||
*/
|
||||
|
||||
/* Widget class record */
|
||||
|
||||
externalref WidgetClass dtTermWidgetClass;
|
||||
|
||||
|
||||
/*
|
||||
* Functions
|
||||
*/
|
||||
|
||||
extern Widget DtCreateTerm(
|
||||
Widget parent,
|
||||
char *name,
|
||||
ArgList arglist,
|
||||
Cardinal argcount);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _Dt_Term_h */
|
||||
648
cde/lib/DtTerm/Term/TermAction.c
Normal file
648
cde/lib/DtTerm/Term/TermAction.c
Normal file
@@ -0,0 +1,648 @@
|
||||
#ifndef lint
|
||||
#ifdef VERBOSE_REV_INFO
|
||||
static char rcs_id[] = "$XConsortium: TermAction.c /main/1 1996/04/21 19:15:17 drk $";
|
||||
#endif /* VERBOSE_REV_INFO */
|
||||
#endif /* lint */
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994, 1996 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994, 1996 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994, 1996 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994, 1996 Novell, Inc. *
|
||||
* (c) Copyright 1996 Digital Equipment Corporation. *
|
||||
* (c) Copyright 1996 FUJITSU LIMITED. *
|
||||
* (c) Copyright 1996 Hitachi. *
|
||||
*/
|
||||
|
||||
#include "TermHeader.h"
|
||||
#include "TermPrimDebug.h"
|
||||
#include "TermPrimI.h"
|
||||
#include "TermP.h"
|
||||
#include "TermPrimData.h"
|
||||
/* #include "TermData.h" */
|
||||
#include "TermPrimAction.h"
|
||||
#include "TermAction.h"
|
||||
#include "TermFunction.h"
|
||||
#include "TermPrimSetPty.h"
|
||||
#include "TermSendEsc.h"
|
||||
#ifdef _AIX
|
||||
#include <X11/keysym.h>
|
||||
#endif /* _AIX */
|
||||
|
||||
static char *KeypadKey[] = { DT_KP_Space, DT_KP_Tab, DT_KP_Enter, DT_KP_F1,
|
||||
DT_KP_F2, DT_KP_F3, DT_KP_F4, DT_KP_Equal,
|
||||
DT_KP_Multiply, DT_KP_Add, DT_KP_Separator,
|
||||
DT_KP_Subtract, DT_KP_Decimal, DT_KP_Divide,
|
||||
DT_KP_0, DT_KP_1, DT_KP_2, DT_KP_3, DT_KP_4,
|
||||
DT_KP_5, DT_KP_6, DT_KP_7, DT_KP_8, DT_KP_9};
|
||||
static char *AppKeypadKey[] ={KP_APP_Space, KP_APP_Tab, KP_APP_Enter,KP_APP_F1,
|
||||
KP_APP_F2, KP_APP_F3, KP_APP_F4, KP_APP_Equal,
|
||||
KP_APP_Multiply, KP_APP_Add, KP_APP_Separator,
|
||||
KP_APP_Subtract, KP_APP_Decimal, KP_APP_Divide,
|
||||
KP_APP_0, KP_APP_1, KP_APP_2, KP_APP_3, KP_APP_4,
|
||||
KP_APP_5, KP_APP_6, KP_APP_7, KP_APP_8, KP_APP_9};
|
||||
#ifdef OBSOLETE
|
||||
static char *EditKey[] = {ESC_FIND, ESC_INSERT_HERE, ESC_DELETE,
|
||||
ESC_SELECT, ESC_PREV_SCREEN, ESC_NEXT_SCREEN};
|
||||
static char *SunEditKey[] = {ESC_FIND_SUN, ESC_INSERT_HERE_SUN,
|
||||
ESC_DELETE_SUN, ESC_SELECT_SUN, ESC_PREV_SCREEN_SUN,
|
||||
ESC_NEXT_SCREEN_SUN};
|
||||
#endif /* OBSOLETE */
|
||||
void
|
||||
_DtTermWriteEscSeq(Widget w, char *transmitString)
|
||||
{
|
||||
DtTermWidget tw = (DtTermWidget)w;
|
||||
DtTermData td = tw->vt.td;
|
||||
|
||||
if (KEYBOARD_LOCKED(td->tpd->keyboardLocked)) {
|
||||
/* keyboard locked -- ring the bell...
|
||||
*/
|
||||
(void) _DtTermPrimBell(w);
|
||||
} else
|
||||
if ( td->S8C1TMode ) {
|
||||
char *cbuf =malloc(strlen(transmitString)+1);
|
||||
strcpy(cbuf,transmitString) ;
|
||||
cbuf[1] = 0x9B ;
|
||||
(void) _DtTermPrimSendInput(w, (unsigned char *) (cbuf+1),
|
||||
strlen(cbuf+1));
|
||||
free(cbuf) ;
|
||||
}
|
||||
else {
|
||||
(void) _DtTermPrimSendInput(w, (unsigned char *) transmitString,
|
||||
strlen(transmitString));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
const char *string;
|
||||
char value;
|
||||
} EnumType;
|
||||
|
||||
static int
|
||||
stringToEnum(char *c, EnumType *enumTypes, int numEnumTypes)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < numEnumTypes; i++) {
|
||||
if (!strcmp(enumTypes[i].string, c))
|
||||
return(i);
|
||||
}
|
||||
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
/*** BREAK ********************************************************************
|
||||
*
|
||||
* ##### ##### ###### ## # #
|
||||
* # # # # # # # # #
|
||||
* ##### # # ##### # # ####
|
||||
* # # ##### # ###### # #
|
||||
* # # # # # # # # #
|
||||
* ##### # # ###### # # # #
|
||||
*/
|
||||
|
||||
void
|
||||
_DtTermActionBreak(Widget w, XEvent *event, String *params, Cardinal *num_params)
|
||||
{
|
||||
DtTermPrimitiveWidget tw = (DtTermPrimitiveWidget) w;
|
||||
struct termData *tpd = tw->term.tpd;
|
||||
int msec = 0;
|
||||
|
||||
/* check for keyboardLock... */
|
||||
if (KEYBOARD_LOCKED(tpd->keyboardLocked)) {
|
||||
(void) _DtTermPrimBell(w);
|
||||
return;
|
||||
}
|
||||
|
||||
/* tcsendbreak() , which eventually gets called, has the msec
|
||||
parameter but it never actually gets used, so for now, its a dont care
|
||||
*/
|
||||
|
||||
if (tw->term.pty >= 0)
|
||||
(void) _DtTermPrimPtySendBreak(tw->term.pty, msec);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*** SCROLL *******************************************************************
|
||||
*
|
||||
* #### #### ##### #### # #
|
||||
* # # # # # # # # #
|
||||
* #### # # # # # # #
|
||||
* # # ##### # # # #
|
||||
* # # # # # # # # # #
|
||||
* #### #### # # #### ###### ######
|
||||
*/
|
||||
|
||||
|
||||
typedef enum {
|
||||
scrollPage,
|
||||
scrollHalfPage,
|
||||
scrollLine,
|
||||
scrollPixel
|
||||
} ScrollAmount;
|
||||
|
||||
static EnumType scrollUnits[] = {
|
||||
"page", (char) scrollPage,
|
||||
"halfpage", (char) scrollHalfPage,
|
||||
"line", (char) scrollLine
|
||||
};
|
||||
|
||||
void
|
||||
_DtTermActionScroll(Widget w, XEvent *event,
|
||||
String *params, Cardinal *num_params)
|
||||
{
|
||||
DtTermPrimitiveWidget tw = (DtTermPrimitiveWidget) w;
|
||||
struct termData *tpd = tw->term.tpd;
|
||||
int unitsIndex;
|
||||
ScrollAmount units;
|
||||
int count = 1;
|
||||
|
||||
if (*num_params >= 1) {
|
||||
count = strtol(params[0], (char **) 0, 0);
|
||||
}
|
||||
|
||||
if (*num_params >= 2) {
|
||||
unitsIndex = stringToEnum(params[1], scrollUnits,
|
||||
XtNumber(scrollUnits));
|
||||
if (unitsIndex < 0) {
|
||||
/* no match... */
|
||||
return;
|
||||
}
|
||||
units = (ScrollAmount) scrollUnits[unitsIndex].value;
|
||||
} else {
|
||||
units = scrollLine;
|
||||
}
|
||||
|
||||
/* perform the cursor motion...
|
||||
*/
|
||||
switch(units) {
|
||||
case scrollPage:
|
||||
_DtTermFuncScroll(w, count*(tw->term.rows-1), fromAction);
|
||||
break;
|
||||
|
||||
case scrollHalfPage:
|
||||
if (count > 0) {
|
||||
_DtTermFuncScroll(w, count *
|
||||
(tw->term.rows - tpd->memoryLockRow) / 2, fromAction);
|
||||
} else {
|
||||
_DtTermFuncScroll(w,
|
||||
count * (tw->term.rows - tpd->memoryLockRow) / 2,
|
||||
fromAction);
|
||||
}
|
||||
break;
|
||||
|
||||
case scrollLine:
|
||||
_DtTermFuncScroll(w, count, fromAction);
|
||||
break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
_DtTermActionBeginningOfBuffer(Widget w, XEvent *event,
|
||||
String *params, Cardinal *num_params)
|
||||
{
|
||||
_DtTermFuncBeginningOfBuffer(w,NULL,1) ;
|
||||
(void) _DtTermPrimCursorOn(w);
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
_DtTermActionEndOfBuffer(Widget w, XEvent *event,
|
||||
String *params, Cardinal *num_params)
|
||||
{
|
||||
_DtTermFuncEndOfBuffer(w,NULL,1) ;
|
||||
(void) _DtTermPrimCursorOn(w);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** HARD/SOFT RESET ***********************************************************
|
||||
* #
|
||||
* # # ## ##### ##### # #### #### ###### #####
|
||||
* # # # # # # # # # # # # # #
|
||||
* ###### # # # # # # # #### # # ##### #
|
||||
* # # ###### ##### # # # # # # # #
|
||||
* # # # # # # # # # # # # # # #
|
||||
* # # # # # # ##### # #### #### # #
|
||||
*
|
||||
*
|
||||
* ##### ###### #### ###### #####
|
||||
* # # # # # #
|
||||
* # # ##### #### ##### #
|
||||
* ##### # # # #
|
||||
* # # # # # # #
|
||||
* # # ###### #### ###### #
|
||||
*/
|
||||
void
|
||||
_DtTermActionHardReset(Widget w, XEvent *event,
|
||||
String *params, Cardinal *num_params)
|
||||
{
|
||||
(void) _DtTermFuncHardReset(w, 0, fromAction);
|
||||
}
|
||||
|
||||
void
|
||||
_DtTermActionSoftReset(Widget w, XEvent *event,
|
||||
String *params, Cardinal *num_params)
|
||||
{
|
||||
(void) _DtTermFuncSoftReset(w, 0, fromAction);
|
||||
}
|
||||
|
||||
|
||||
/*** INSERT CHAR/LINE *********************************************************
|
||||
*
|
||||
* # # # #### ###### ##### #####
|
||||
* # ## # # # # # #
|
||||
* # # # # #### ##### # # #
|
||||
* # # # # # # ##### #
|
||||
* # # ## # # # # # #
|
||||
* # # # #### ###### # # #
|
||||
*
|
||||
* #
|
||||
* #### # # ## ##### # # # # # ######
|
||||
* # # # # # # # # # # # ## # #
|
||||
* # ###### # # # # # # # # # # #####
|
||||
* # # # ###### ##### # # # # # # #
|
||||
* # # # # # # # # # # # # ## #
|
||||
* #### # # # # # # # ###### # # # ######
|
||||
*/
|
||||
|
||||
|
||||
void
|
||||
_DtTermActionInsertLine(Widget w, XEvent *event,
|
||||
String *params, Cardinal *num_params)
|
||||
{
|
||||
_DtTermFuncInsertLine(w,1,1) ;
|
||||
(void) _DtTermPrimCursorOn(w);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*** CURSOR MOTION ************************************************************
|
||||
*
|
||||
* #### # # ##### #### #### #####
|
||||
* # # # # # # # # # # #
|
||||
* # # # # # #### # # # #
|
||||
* # # # ##### # # # #####
|
||||
* # # # # # # # # # # # #
|
||||
* #### #### # # #### #### # #
|
||||
*
|
||||
*
|
||||
* # # #### ##### # #### # #
|
||||
* ## ## # # # # # # ## #
|
||||
* # ## # # # # # # # # # #
|
||||
* # # # # # # # # # # #
|
||||
* # # # # # # # # # ##
|
||||
* # # #### # # #### # #
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
cursorForward,
|
||||
cursorBackward,
|
||||
cursorUp,
|
||||
cursorDown
|
||||
} CursorDirection;
|
||||
|
||||
static EnumType cursorDirections[] = {
|
||||
"forward", (char) cursorForward,
|
||||
"backward", (char) cursorBackward,
|
||||
"up", (char) cursorUp,
|
||||
"down", (char) cursorDown
|
||||
};
|
||||
|
||||
void
|
||||
_DtTermActionMoveCursor(Widget w, XEvent *event,
|
||||
String *params, Cardinal *num_params)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (*num_params < 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* figure out the direction... */
|
||||
i = stringToEnum(params[0], cursorDirections, XtNumber(cursorDirections));
|
||||
if (i < 0) {
|
||||
/* no match... */
|
||||
return;
|
||||
}
|
||||
|
||||
switch((CursorDirection) cursorDirections[i].value) {
|
||||
case cursorUp:
|
||||
if (((DtTermWidget)w)->vt.td->applicationMode)
|
||||
(void) _DtTermWriteEscSeq(w, ESC_CURSOR_UP_APP);
|
||||
else
|
||||
(void) _DtTermWriteEscSeq(w, ESC_CURSOR_UP);
|
||||
break;
|
||||
|
||||
case cursorDown:
|
||||
if (((DtTermWidget)w)->vt.td->applicationMode)
|
||||
(void) _DtTermWriteEscSeq(w, ESC_CURSOR_DOWN_APP);
|
||||
else
|
||||
(void) _DtTermWriteEscSeq(w, ESC_CURSOR_DOWN);
|
||||
break;
|
||||
|
||||
case cursorForward:
|
||||
if (((DtTermWidget)w)->vt.td->applicationMode)
|
||||
(void) _DtTermWriteEscSeq(w, ESC_CURSOR_RIGHT_APP);
|
||||
else
|
||||
(void) _DtTermWriteEscSeq(w, ESC_CURSOR_RIGHT);
|
||||
break;
|
||||
|
||||
case cursorBackward:
|
||||
if (((DtTermWidget)w)->vt.td->applicationMode)
|
||||
(void) _DtTermWriteEscSeq(w, ESC_CURSOR_LEFT_APP);
|
||||
else
|
||||
(void) _DtTermWriteEscSeq(w, ESC_CURSOR_LEFT);
|
||||
break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_DtTermActionTab(Widget w, XEvent *event,
|
||||
String *params, Cardinal *num_params)
|
||||
{
|
||||
(void) _DtTermPrimSendInput(w, (unsigned char *) "\t", 1);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*** FUNCTION KEYS ************************************************************
|
||||
*
|
||||
* ###### # # # # #### ##### # #### # #
|
||||
* # # # ## # # # # # # # ## #
|
||||
* ##### # # # # # # # # # # # # #
|
||||
* # # # # # # # # # # # # # #
|
||||
* # # # # ## # # # # # # # ##
|
||||
* # #### # # #### # # #### # #
|
||||
*
|
||||
*
|
||||
* # # ###### # # ####
|
||||
* # # # # # #
|
||||
* #### ##### # ####
|
||||
* # # # # #
|
||||
* # # # # # #
|
||||
* # # ###### # ####
|
||||
*/
|
||||
void
|
||||
_DtTermActionFunctionKeyExecute(Widget w, XEvent *event, String *params,
|
||||
Cardinal *num_params)
|
||||
{
|
||||
Boolean shift = False;
|
||||
long keyNumber;
|
||||
char *ret;
|
||||
int i;
|
||||
|
||||
/* must have a key number, may have a shift/unshift as well... */
|
||||
if (*num_params < 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* get a key number... */
|
||||
keyNumber = strtol(params[0], &ret, 0);
|
||||
|
||||
|
||||
/* if we had anything left in the string, the number is bogus... */
|
||||
if (*ret) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (*num_params >= 2) {
|
||||
if (!strcmp(params[1], "UDK")) {
|
||||
shift = True;
|
||||
} else if (!strcmp(params[1], "function")) {
|
||||
shift = False;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* execute the key... */
|
||||
(void) _DtTermFunctionKeyExecute(w, (short) keyNumber, shift);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* KEYPAD
|
||||
*
|
||||
*/
|
||||
|
||||
static char *kpTypes[] = { "space", "tab", "enter", "f1", "f2", "f3", "f4",
|
||||
"equal", "multiply", "add", "separator", "subtract", "decimal", "divide",
|
||||
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"
|
||||
};
|
||||
static int no_kptypes=sizeof(kpTypes)/sizeof(char *) ;
|
||||
|
||||
void
|
||||
_DtTermActionKeypadKeyExecute(Widget w, XEvent *event, String *params,
|
||||
Cardinal *num_params)
|
||||
{
|
||||
DtTermWidget tw = (DtTermWidget)w;
|
||||
Boolean shift = False;
|
||||
long keyNumber;
|
||||
char *ret;
|
||||
int type;
|
||||
DtTermData td = tw->vt.td;
|
||||
|
||||
if (KEYBOARD_LOCKED(td->tpd->keyboardLocked)) {
|
||||
/* keyboard locked -- ring the bell...
|
||||
*/
|
||||
(void) _DtTermPrimBell(w);
|
||||
return ;
|
||||
}
|
||||
/* must have an edit key type... */
|
||||
if (*num_params < 1) {
|
||||
return;
|
||||
}
|
||||
#ifdef _AIX
|
||||
/*
|
||||
* IBM JP kbd specific code. IBM JP kbd requires IM functionality
|
||||
* to recoginze NumLock state + (*,/) key
|
||||
*
|
||||
* The following code is derived from TermPrim/TermPrim.c's
|
||||
* _DtTermPrimActionKeyInput()
|
||||
*
|
||||
*/
|
||||
{
|
||||
XKeyEvent *keyEvent = (XKeyEvent *)event;
|
||||
KeySym keysym;
|
||||
Status status;
|
||||
unsigned char string[BUFSIZ];
|
||||
int nbytes;
|
||||
|
||||
nbytes = XmImMbLookupString(w, keyEvent, (char *) string,
|
||||
sizeof(string), &keysym, &status);
|
||||
|
||||
/*
|
||||
* Usually we have to take care of the status. Yet, this function is
|
||||
* called only when KP_XX is pressed. So in this case, ignore any
|
||||
* error case..... Please keep your fingers crossed !
|
||||
*/
|
||||
|
||||
/*
|
||||
* Hack code........
|
||||
*/
|
||||
if ( ( keysym == XK_KP_Add ) || ( keysym == XK_KP_Multiply ) ) {
|
||||
if ( string[0] == '*' )
|
||||
params[0] = "multiply";
|
||||
else if ( string[0] == '+' )
|
||||
params[0] = "add";
|
||||
}
|
||||
}
|
||||
#endif /* _AIX */
|
||||
|
||||
type=0;
|
||||
while( strcmp(params[0],kpTypes[type]) && type<= no_kptypes ) type++;
|
||||
|
||||
if (type > no_kptypes) return ;
|
||||
|
||||
if ( tw->vt.td->applicationKPMode ) {
|
||||
_DtTermWriteEscSeq(w,AppKeypadKey[type]);
|
||||
}
|
||||
else {
|
||||
_DtTermPrimSendInput(w,(unsigned char *)KeypadKey[type],
|
||||
strlen(KeypadKey[type]));
|
||||
if ( type == 2 && tw->term.tpd->autoLineFeed )
|
||||
_DtTermPrimSendInput(w,(unsigned char *)"\012",1);/* newline */
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Edit Keys (Find, Insert Here, Remove, Select, Prev Screen, Next Screen)
|
||||
*
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
findType,
|
||||
insertType,
|
||||
selectType,
|
||||
priorType,
|
||||
nextType,
|
||||
deleteType,
|
||||
removeType,
|
||||
helpType,
|
||||
menuType,
|
||||
doType
|
||||
} EditType;
|
||||
|
||||
static EnumType editTypes[] = {
|
||||
"find", (char) findType,
|
||||
"insert", (char) insertType,
|
||||
"select", (char) selectType,
|
||||
"next", (char) nextType,
|
||||
"prior", (char) priorType,
|
||||
"delete", (char) deleteType,
|
||||
"remove", (char) removeType,
|
||||
"help", (char) helpType,
|
||||
"menu", (char) menuType,
|
||||
"do", (char) doType
|
||||
};
|
||||
|
||||
void
|
||||
_DtTermActionEditKeyExecute(Widget w, XEvent *event, String *params,
|
||||
Cardinal *num_params)
|
||||
{
|
||||
DtTermWidget tw = (DtTermWidget)w;
|
||||
Boolean shift = False;
|
||||
long keyNumber;
|
||||
char *ret;
|
||||
int i;
|
||||
DtTermData td = tw->vt.td;
|
||||
|
||||
if (*num_params < 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* figure out the direction... */
|
||||
i = stringToEnum(params[0], editTypes, XtNumber(editTypes));
|
||||
if (i < 0) {
|
||||
/* no match... */
|
||||
return;
|
||||
}
|
||||
|
||||
switch( editTypes[i].value) {
|
||||
case findType:
|
||||
if ( tw->vt.sunFunctionKeys == False) {
|
||||
(void) _DtTermWriteEscSeq(w, ESC_FIND) ;
|
||||
}
|
||||
else {
|
||||
(void) _DtTermWriteEscSeq(w,ESC_FIND_SUN);
|
||||
}
|
||||
break;
|
||||
case insertType:
|
||||
if ( tw->vt.sunFunctionKeys == False) {
|
||||
(void) _DtTermWriteEscSeq(w, ESC_INSERT_HERE) ;
|
||||
}
|
||||
else {
|
||||
(void) _DtTermWriteEscSeq(w,ESC_INSERT_HERE_SUN);
|
||||
}
|
||||
break;
|
||||
case selectType:
|
||||
if ( tw->vt.sunFunctionKeys == False) {
|
||||
(void) _DtTermWriteEscSeq(w, ESC_SELECT) ;
|
||||
}
|
||||
else {
|
||||
(void) _DtTermWriteEscSeq(w,ESC_SELECT_SUN);
|
||||
}
|
||||
break;
|
||||
case priorType:
|
||||
if ( tw->vt.sunFunctionKeys == False) {
|
||||
(void) _DtTermWriteEscSeq(w, ESC_PREV_SCREEN) ;
|
||||
}
|
||||
else {
|
||||
(void) _DtTermWriteEscSeq(w,ESC_PREV_SCREEN_SUN);
|
||||
}
|
||||
break;
|
||||
case nextType:
|
||||
if ( tw->vt.sunFunctionKeys == False) {
|
||||
(void) _DtTermWriteEscSeq(w, ESC_NEXT_SCREEN) ;
|
||||
}
|
||||
else {
|
||||
(void) _DtTermWriteEscSeq(w,ESC_NEXT_SCREEN_SUN);
|
||||
}
|
||||
break;
|
||||
case deleteType:
|
||||
case removeType:
|
||||
if ( tw->vt.sunFunctionKeys == False) {
|
||||
(void) _DtTermWriteEscSeq(w, ESC_DELETE) ;
|
||||
}
|
||||
else {
|
||||
(void) _DtTermWriteEscSeq(w,ESC_DELETE_SUN);
|
||||
}
|
||||
break;
|
||||
|
||||
case helpType:
|
||||
if (tw->vt.sunFunctionKeys == False) {
|
||||
(void) _DtTermWriteEscSeq(w, ESC_HELP);
|
||||
} else {
|
||||
(void) _DtTermWriteEscSeq(w, ESC_HELP_SUN);
|
||||
}
|
||||
break;
|
||||
|
||||
case menuType:
|
||||
if (tw->vt.sunFunctionKeys == False) {
|
||||
(void) _DtTermWriteEscSeq(w, ESC_MENU);
|
||||
} else {
|
||||
(void) _DtTermWriteEscSeq(w, ESC_MENU_SUN);
|
||||
}
|
||||
break;
|
||||
|
||||
case doType:
|
||||
if (tw->vt.sunFunctionKeys == False) {
|
||||
(void) _DtTermWriteEscSeq(w, ESC_DO);
|
||||
} else {
|
||||
(void) _DtTermWriteEscSeq(w, ESC_DO_SUN);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
43
cde/lib/DtTerm/Term/TermAction.h
Normal file
43
cde/lib/DtTerm/Term/TermAction.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* $XConsortium: TermAction.h /main/1 1996/04/21 19:15:20 drk $";
|
||||
*/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _Dt_TermAction_h
|
||||
#define _Dt_TermAction_h
|
||||
|
||||
extern void _DtTermActionBeginningOfBuffer(Widget w, XEvent *event,
|
||||
String *params, Cardinal *num_params);
|
||||
extern void _DtTermActionBreak(Widget w, XEvent *event,
|
||||
String *params, Cardinal *num_params);
|
||||
extern void _DtTermActionEndOfBuffer(Widget w, XEvent *event,
|
||||
String *params, Cardinal *num_params);
|
||||
extern void _DtTermActionFunctionKeyExecute(Widget w, XEvent *event,
|
||||
String *params, Cardinal *num_params);
|
||||
extern void _DtTermActionHardReset(Widget w, XEvent *event,
|
||||
String *params, Cardinal *num_params);
|
||||
extern void _DtTermActionInsertLine(Widget w, XEvent *event,
|
||||
String *params, Cardinal *num_params);
|
||||
extern void _DtTermActionMoveCursor(Widget w, XEvent *event,
|
||||
String *params, Cardinal *num_params);
|
||||
extern void _DtTermActionScroll(Widget w, XEvent *event,
|
||||
String *params, Cardinal *num_params);
|
||||
extern void _DtTermActionSoftReset(Widget w, XEvent *event,
|
||||
String *params, Cardinal *num_params);
|
||||
extern void _DtTermActionTab(Widget w, XEvent *event,
|
||||
String *params, Cardinal *num_params);
|
||||
extern void _DtTermActionKeypadKeyExecute(Widget w, XEvent *event,
|
||||
String *params, Cardinal *num_params);
|
||||
extern void _DtTermActionEditKeyExecute(Widget w, XEvent *event,
|
||||
String *params, Cardinal *num_params);
|
||||
extern void _DtTermActionKeypadKeyExecute(Widget w, XEvent *event,
|
||||
String *params, Cardinal *num_params);
|
||||
|
||||
#endif /* _Dt_TermAction_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif... */
|
||||
1323
cde/lib/DtTerm/Term/TermBuffer.c
Normal file
1323
cde/lib/DtTerm/Term/TermBuffer.c
Normal file
File diff suppressed because it is too large
Load Diff
142
cde/lib/DtTerm/Term/TermBuffer.h
Normal file
142
cde/lib/DtTerm/Term/TermBuffer.h
Normal file
@@ -0,0 +1,142 @@
|
||||
/*
|
||||
** $XConsortium: TermBuffer.h /main/1 1996/04/21 19:15:26 drk $
|
||||
*/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _Dt_TermBuffer_h
|
||||
#define _Dt_TermBuffer_h
|
||||
#include <TermPrimBuffer.h>
|
||||
|
||||
/*
|
||||
** Defines for video enhancements
|
||||
*/
|
||||
#define BOLD (1 << 5)
|
||||
#define SECURE (1 << 4)
|
||||
#define HALF_BRIGHT (1 << 3)
|
||||
#define UNDERLINE (1 << 2)
|
||||
#define INVERSE (1 << 1)
|
||||
#define BLINK (1 << 0)
|
||||
#define VIDEO_MASK (BOLD | SECURE | HALF_BRIGHT | UNDERLINE | INVERSE | BLINK)
|
||||
|
||||
#define IS_BOLD(flags) ((flags) & BOLD)
|
||||
#define IS_SECURE(flags) ((flags) & SECURE)
|
||||
#define IS_HALF_BRIGHT(flags) ((flags) & HALF_BRIGHT)
|
||||
#define IS_UNDERLINE(flags) ((flags) & UNDERLINE)
|
||||
#define IS_INVERSE(flags) ((flags) & INVERSE)
|
||||
#define IS_BLINK(flags) ((flags) & BLINK)
|
||||
|
||||
/*
|
||||
** Defines for field types
|
||||
*/
|
||||
#define FIELD_UNPROTECT 0
|
||||
#define FIELD_PROTECT 1
|
||||
#define FIELD_TRANSMIT 2
|
||||
#define FIELD_END 3
|
||||
#define FIELD_MASK 3
|
||||
|
||||
#define COLOR_MASK 0x0F
|
||||
|
||||
/*
|
||||
** Defines for font ID
|
||||
*/
|
||||
#define FONT_NORMAL 0
|
||||
#define FONT_LINEDRAW 1
|
||||
#define FONT_MASK 1
|
||||
|
||||
typedef enum _dtEnhID
|
||||
{
|
||||
enhVideo = 0, enhField = 1, enhFont = 3, enhFgColor = 4, enhBgColor = 5
|
||||
} dtEnhID;
|
||||
#define NUM_ENHANCEMENT_FIELDS 6
|
||||
|
||||
/*
|
||||
** enumerate the different erase modes...
|
||||
*/
|
||||
typedef enum _DtEraseMode
|
||||
{
|
||||
eraseFromCol0, /* from col 0 to cursor */
|
||||
eraseCharCount, /* "count" characters from cursor */
|
||||
eraseLineCount, /* "count" lines from cursor */
|
||||
eraseToEOL, /* from cursor to end-of-line */
|
||||
eraseLine, /* the entire line the cursor is on */
|
||||
eraseBuffer, /* the entire buffer */
|
||||
eraseFromRow0Col0, /* from row 0, col 0 to the cursor */
|
||||
eraseToEOB /* from the cursor to the end of the buffer */
|
||||
} DtEraseMode;
|
||||
|
||||
|
||||
/*
|
||||
** This may be useful for debugging purposes.
|
||||
*/
|
||||
#if (defined(DEBUG) | defined(__CODECENTER__))
|
||||
typedef enum _videoFlags
|
||||
{
|
||||
b_i_h_u_s = 0x00, b_i_h_u_S = 0x01, b_i_h_U_s = 0x02, b_i_h_U_S = 0x03,
|
||||
b_i_H_u_s = 0x04, b_i_H_u_S = 0x05, b_i_H_U_s = 0x06, b_i_H_U_S = 0x07,
|
||||
b_I_h_u_s = 0x08, b_I_h_u_S = 0x09, b_I_h_U_s = 0x0A, b_I_h_U_S = 0x0B,
|
||||
b_I_H_u_s = 0x0C, b_I_H_u_S = 0x0D, b_I_H_U_s = 0x0E, b_I_H_U_S = 0x0F,
|
||||
B_i_h_u_s = 0x10, B_i_h_u_S = 0x11, B_i_h_U_s = 0x12, B_i_h_U_S = 0x13,
|
||||
B_i_H_u_s = 0x14, B_i_H_u_S = 0x15, B_i_H_U_s = 0x16, B_i_H_U_S = 0x17,
|
||||
B_I_h_u_s = 0x18, B_I_h_u_S = 0x19, B_I_h_U_s = 0x1A, B_I_h_U_S = 0x1B,
|
||||
B_I_H_u_s = 0x1C, B_I_H_u_S = 0x1D, B_I_H_U_s = 0x1E, B_I_H_U_S = 0x1F,
|
||||
} videoFlags;
|
||||
#endif /* (defined(DEBUG) | defined(__CODECENTER__)) */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
extern TermBuffer
|
||||
_DtTermBufferCreateBuffer
|
||||
(
|
||||
const Widget w,
|
||||
const short rows,
|
||||
const short cols,
|
||||
const short sizeOfBuffer,
|
||||
const short sizeOfLine,
|
||||
const short sizeOfEnh
|
||||
);
|
||||
|
||||
extern void
|
||||
_DtTermBufferFreeBuffer
|
||||
(
|
||||
const TermBuffer tb
|
||||
);
|
||||
|
||||
/*
|
||||
** Delete enough characters from the specified line such that the
|
||||
** width of the characters deleted equal or exceeds the desired
|
||||
** width. The actual width deleted is returned in "width".
|
||||
*/
|
||||
void
|
||||
_DtTermBufferDelete
|
||||
(
|
||||
TermBuffer tb,
|
||||
short *row,
|
||||
short *col,
|
||||
short *width
|
||||
);
|
||||
|
||||
extern void
|
||||
_DtTermBufferErase
|
||||
(
|
||||
TermBuffer tb,
|
||||
short row,
|
||||
short col,
|
||||
short count,
|
||||
DtEraseMode eraseSwitch
|
||||
);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* close scope of 'extern "C"'... */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* _Dt_TermBuffer_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif... */
|
||||
93
cde/lib/DtTerm/Term/TermBufferP.h
Normal file
93
cde/lib/DtTerm/Term/TermBufferP.h
Normal file
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
** $XConsortium: TermBufferP.h /main/1 1996/04/21 19:15:29 drk $
|
||||
*/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _Dt_TermBufferP_h
|
||||
#define _Dt_TermBufferP_h
|
||||
#include "TermBuffer.h"
|
||||
#include "TermPrimBufferP.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*
|
||||
** This is the enhancement structure, one per character.
|
||||
*/
|
||||
typedef struct _DtEnh
|
||||
{
|
||||
/* ANSI C requires bit fields to be int, signed int or unsigned int type */
|
||||
|
||||
/*
|
||||
** The video enhancements.
|
||||
*/
|
||||
unsigned int video :6;
|
||||
|
||||
/*
|
||||
** FIELD_UNPROTECT 0
|
||||
** FIELD_PROTECT 1
|
||||
** FIELD_TRANSMIT 2
|
||||
** FIELD_END 3
|
||||
*/
|
||||
unsigned int field :2;
|
||||
|
||||
/*
|
||||
** index into color[0..15], on for foreground, on for background
|
||||
*/
|
||||
unsigned int fgColor :4;
|
||||
unsigned int bgColor :4;
|
||||
|
||||
/*
|
||||
** FONT_NORMAL 0
|
||||
** FONT_LINEDRAW 1
|
||||
*/
|
||||
unsigned int font :1;
|
||||
} DtTermEnhPart, *DtEnh;
|
||||
|
||||
/*
|
||||
** This a line, the character buffer, and the enhancements.
|
||||
*/
|
||||
typedef struct _DtLinePart
|
||||
{
|
||||
DtEnh enh;
|
||||
} DtLinePart;
|
||||
|
||||
typedef struct _DtTermLineRec
|
||||
{
|
||||
TermLinePart term_line;
|
||||
DtLinePart dt_line;
|
||||
} DtTermLineRec, *DtLine;
|
||||
|
||||
typedef struct _DtTermBufferPart
|
||||
{
|
||||
DtTermEnhPart enhState;
|
||||
Boolean enhDirty; /* true if the enhState is non default */
|
||||
} DtTermBufferPart;
|
||||
|
||||
typedef struct _DtTermBufferRec
|
||||
{
|
||||
TermBufferPart term_buffer;
|
||||
DtTermBufferPart dt_buffer;
|
||||
} DtTermBufferRec, *DtTermBuffer;
|
||||
|
||||
/*
|
||||
** Define some useful DT counter parts for the TermPrimBufferP.h macros
|
||||
*/
|
||||
#define DT_LINE_OF_TBUF(tb, row) ((DtLine)(LINE_OF_TBUF(tb, row)))
|
||||
#define DT_LINES(tb) ((DtLine*)(LINES(tb)))
|
||||
#define DT_ENH_STATE(tb) (((DtTermBuffer)(tb))->dt_buffer.enhState)
|
||||
#define DT_ENH_DIRTY(tb) (((DtTermBuffer)(tb))->dt_buffer.enhDirty)
|
||||
#define DT_ENH(line) ((line)->dt_line.enh)
|
||||
#ifdef __cplusplus
|
||||
} /* close scope of 'extern "C"'... */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* _Dt_TermBufferP_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif... */
|
||||
254
cde/lib/DtTerm/Term/TermColor.c
Normal file
254
cde/lib/DtTerm/Term/TermColor.c
Normal file
@@ -0,0 +1,254 @@
|
||||
#ifndef lint
|
||||
#ifdef VERBOSE_REV_INFO
|
||||
static char rcs_id[] = "$XConsortium: TermColor.c /main/2 1996/05/08 13:31:00 ageorge $";
|
||||
#endif /* VERBOSE_REV_INFO */
|
||||
#endif /* lint */
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994, 1996 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994, 1996 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994, 1996 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994, 1996 Novell, Inc. *
|
||||
* (c) Copyright 1996 Digital Equipment Corporation. *
|
||||
* (c) Copyright 1996 FUJITSU LIMITED. *
|
||||
* (c) Copyright 1996 Hitachi. *
|
||||
*/
|
||||
|
||||
#include "TermHeader.h"
|
||||
#include <X11/X.h>
|
||||
#include "TermP.h"
|
||||
#include "TermColor.h"
|
||||
#include "TermPrimDebug.h"
|
||||
|
||||
#ifndef BBA
|
||||
#define InitColor(p, r, g, b) (p)->red = r ? 0xffff : 0; \
|
||||
(p)->green = g ? 0xffff : 0; \
|
||||
(p)->blue = b ? 0xffff : 0
|
||||
#else /* BBA */
|
||||
static void
|
||||
InitColor
|
||||
(
|
||||
XColor *p,
|
||||
int r,
|
||||
int g,
|
||||
int b
|
||||
)
|
||||
{
|
||||
p->red = r ? 0xffff : 0;
|
||||
p->green = g ? 0xffff : 0;
|
||||
p->blue = b ? 0xffff : 0;
|
||||
}
|
||||
|
||||
#endif /* BBA */
|
||||
|
||||
static Boolean debugColors = False;
|
||||
static int debugColorsAvailable = 0;
|
||||
|
||||
#define DebugIsColorAvailable() (!debugColors || (debugColors && (debugColorsAvailable > 0)))
|
||||
|
||||
void
|
||||
_DtTermColorInit(Widget w)
|
||||
{
|
||||
DtTermWidget tw = (DtTermWidget) w;
|
||||
DtTermData td = tw->vt.td;
|
||||
int i;
|
||||
|
||||
if (isDebugFSet('C', 0)) {
|
||||
#ifdef BBA
|
||||
#pragma BBA_IGNORE
|
||||
#endif /*BBA*/
|
||||
_DtTermProcessLock();
|
||||
debugColors = True;
|
||||
if (isDebugFSet('C', 1)) {
|
||||
debugColorsAvailable = 5;
|
||||
} else if (isDebugFSet('C', 2)) {
|
||||
debugColorsAvailable = 6;
|
||||
} else if (isDebugFSet('C', 3)) {
|
||||
debugColorsAvailable = 7;
|
||||
} else if (isDebugFSet('C', 4)) {
|
||||
debugColorsAvailable = 8;
|
||||
}
|
||||
_DtTermProcessUnlock();
|
||||
}
|
||||
|
||||
/* set up color pairs... */
|
||||
td->colorPairs[0].fg.pixel = tw->primitive.foreground;
|
||||
td->colorPairs[0].bg.pixel = tw->core.background_pixel;
|
||||
|
||||
/* Assume that we can't free the foreground and background colors.
|
||||
* this will keep us from messing up any hidden widget stuff that
|
||||
* either depends on them (since the toolkit allocated them for us
|
||||
* to begin with), or mucks with and/or owns them (like the VUE
|
||||
* color object)...
|
||||
*/
|
||||
td->colorPairs[0].fgCommon = True;
|
||||
td->colorPairs[0].bgCommon = True;
|
||||
/* initialize the color... */
|
||||
(void) _DtTermColorInitializeColorPair(w, &td->colorPairs[0]);
|
||||
|
||||
/* set the default colors for colorpairs 1-7...
|
||||
*/
|
||||
InitColor(&td->colorPairs[1].fg, 0, 0, 0); /* 1: fg=black*/
|
||||
InitColor(&td->colorPairs[2].fg, 1, 0, 0); /* 2: fg=red */
|
||||
InitColor(&td->colorPairs[3].fg, 0, 1, 0); /* 2: fg=green */
|
||||
InitColor(&td->colorPairs[4].fg, 1, 1, 0); /* 3: fg=yellow */
|
||||
InitColor(&td->colorPairs[5].fg, 0, 0, 1); /* 4: fg=blue */
|
||||
InitColor(&td->colorPairs[6].fg, 1, 0, 1); /* 5: fg=magenta */
|
||||
InitColor(&td->colorPairs[7].fg, 0, 1, 1); /* 6: fg=cyan */
|
||||
InitColor(&td->colorPairs[8].fg, 1, 1, 1); /* 7: fg=white */
|
||||
InitColor(&td->colorPairs[1].bg, 0, 0, 0); /* 1: bg=black */
|
||||
InitColor(&td->colorPairs[2].bg, 1, 0, 0); /* 2: bg=red */
|
||||
InitColor(&td->colorPairs[3].bg, 0, 1, 0); /* 3: bg=green */
|
||||
InitColor(&td->colorPairs[4].bg, 1, 1, 0); /* 4: bg=yellow */
|
||||
InitColor(&td->colorPairs[5].bg, 0, 0, 1); /* 5: bg=blue */
|
||||
InitColor(&td->colorPairs[6].bg, 1, 0, 1); /* 6: bg=magenta */
|
||||
InitColor(&td->colorPairs[7].bg, 0, 1, 1); /* 7: bg=cyan */
|
||||
InitColor(&td->colorPairs[8].bg, 1, 1, 1); /* 8: bg=white */
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
_DtTermColorDestroy(Widget w)
|
||||
{
|
||||
DtTermWidget tw = (DtTermWidget) w;
|
||||
DtTermData td = tw->vt.td;
|
||||
int i;
|
||||
int j;
|
||||
Pixel pixels[3];
|
||||
|
||||
/* run through the color pairs and free up all the pixels that
|
||||
* we allocated. This function will mark things as invalid/
|
||||
* uninitialized so that it will not kill things if it is
|
||||
* called more than once on destroy...
|
||||
*/
|
||||
for (i = 0; i < 8; i++) {
|
||||
if (td->colorPairs[i].initialized) {
|
||||
j = 0;
|
||||
if (!td->colorPairs[i].fgCommon) {
|
||||
pixels[j++] = td->colorPairs[i].fg.pixel;
|
||||
}
|
||||
if (!td->colorPairs[i].bgCommon) {
|
||||
pixels[j++] = td->colorPairs[i].bg.pixel;
|
||||
}
|
||||
if (td->colorPairs[i].hbValid) {
|
||||
pixels[j++] = td->colorPairs[i].hb.pixel;
|
||||
td->colorPairs[i].hbValid = False;
|
||||
}
|
||||
if (j > 0) {
|
||||
(void) XFreeColors(XtDisplay(w), w->core.colormap, pixels, j,
|
||||
0);
|
||||
_DtTermProcessLock();
|
||||
debugColorsAvailable += j;
|
||||
_DtTermProcessUnlock();
|
||||
}
|
||||
td->colorPairs[i].initialized = False;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
_DtTermColorInitializeColorPair(Widget w, VtColorPair colorPair)
|
||||
{
|
||||
DtTermWidget tw = (DtTermWidget) w;
|
||||
DtTermData td = tw->vt.td;
|
||||
Boolean fgValid = colorPair->fgCommon;
|
||||
Boolean bgValid = colorPair->bgCommon;
|
||||
Pixel pixels[2];
|
||||
int i;
|
||||
|
||||
if (colorPair->initialized) {
|
||||
/* already initialized... */
|
||||
return;
|
||||
}
|
||||
|
||||
_DtTermProcessLock();
|
||||
/* initialize foreground... */
|
||||
if (!colorPair->fgCommon) {
|
||||
if (DebugIsColorAvailable() &&
|
||||
XAllocColor(XtDisplay(w), w->core.colormap, &colorPair->fg)) {
|
||||
fgValid = True;
|
||||
(void) debugColorsAvailable--;
|
||||
}
|
||||
}
|
||||
/* initialize background... */
|
||||
if (!colorPair->bgCommon) {
|
||||
if (DebugIsColorAvailable() &&
|
||||
XAllocColor(XtDisplay(w), w->core.colormap, &colorPair->bg)) {
|
||||
bgValid = True;
|
||||
(void) debugColorsAvailable--;
|
||||
}
|
||||
}
|
||||
|
||||
/* did we have a failure?... */
|
||||
if (!fgValid || !bgValid) {
|
||||
/* we were unable to allocate a foreground/background pair. Let's
|
||||
* use the base colorpair pair[0]...
|
||||
*/
|
||||
i = 0;
|
||||
|
||||
/* free up any allocated color cells... */
|
||||
if (fgValid && !colorPair->fgCommon) {
|
||||
pixels[i++] = colorPair->fg.pixel;
|
||||
}
|
||||
if (bgValid && !colorPair->bgCommon) {
|
||||
pixels[i++] = colorPair->bg.pixel;
|
||||
}
|
||||
if (i > 0) {
|
||||
(void) XFreeColors(XtDisplay(w), w->core.colormap, pixels, i, 0);
|
||||
debugColorsAvailable += i;
|
||||
}
|
||||
|
||||
/* use the base color (colorPair 0)... */
|
||||
(void) memcpy(&colorPair->fg, &td->colorPairs[0].fg,
|
||||
sizeof(td->colorPairs[0].fg));
|
||||
colorPair->fgCommon = td->colorPairs[0].fgCommon;
|
||||
|
||||
(void) memcpy(&colorPair->bg, &td->colorPairs[0].bg,
|
||||
sizeof(td->colorPairs[0].bg));
|
||||
colorPair->bgCommon = td->colorPairs[0].bgCommon;
|
||||
|
||||
/* since this is the base pair which is always common (since it is
|
||||
* owned either by Motif or CDE), we don't need to re-alloc the pixels
|
||||
* to maintain the correct usage count...
|
||||
*/
|
||||
}
|
||||
|
||||
/* for common colors, query the server to get the current values before
|
||||
* we generate the half bright...
|
||||
*/
|
||||
if (colorPair->fgCommon) {
|
||||
(void) XQueryColor(XtDisplay(w), w->core.colormap, &colorPair->fg);
|
||||
}
|
||||
if (colorPair->bgCommon) {
|
||||
(void) XQueryColor(XtDisplay(w), w->core.colormap, &colorPair->bg);
|
||||
}
|
||||
/* make the "half bright" 3/4 the intensity of the foreground color... */
|
||||
colorPair->hb.red = ((int) colorPair->fg.red) * 3 / 4;
|
||||
colorPair->hb.green = ((int) colorPair->fg.green) * 3 / 4;
|
||||
colorPair->hb.blue = ((int) colorPair->fg.blue) * 3 / 4;
|
||||
|
||||
/* special case out black -- make it 1/4 brighter...
|
||||
*/
|
||||
if ((0 == colorPair->hb.red) &&
|
||||
(0 == colorPair->hb.green) &&
|
||||
(0 == colorPair->hb.blue)) {
|
||||
colorPair->hb.red = 0xffff / 4;
|
||||
colorPair->hb.green = 0xffff / 4;
|
||||
colorPair->hb.blue = 0xffff / 4;
|
||||
}
|
||||
colorPair->hb.flags = colorPair->fg.flags;
|
||||
|
||||
/* allocate the halfbright color... */
|
||||
if (DebugIsColorAvailable() &&
|
||||
XAllocColor(XtDisplay(w), w->core.colormap, &colorPair->hb)) {
|
||||
/* success... */
|
||||
colorPair->hbValid = True;
|
||||
(void) debugColorsAvailable--;
|
||||
} else {
|
||||
colorPair->hbValid = False;
|
||||
}
|
||||
_DtTermProcessUnlock();
|
||||
|
||||
colorPair->initialized = True;
|
||||
}
|
||||
20
cde/lib/DtTerm/Term/TermColor.h
Normal file
20
cde/lib/DtTerm/Term/TermColor.h
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* $XConsortium: TermColor.h /main/1 1996/04/21 19:15:35 drk $";
|
||||
*/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _Dt_TermColor_h
|
||||
#define _Dt_TermColor_h
|
||||
|
||||
void _DtTermColorInit(Widget w);
|
||||
void _DtTermColorDestroy(Widget w);
|
||||
void _DtTermColorInitializeColorPair(Widget w, VtColorPair colorPair);
|
||||
|
||||
#endif /* _Dt_TermColor_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif... */
|
||||
136
cde/lib/DtTerm/Term/TermData.h
Normal file
136
cde/lib/DtTerm/Term/TermData.h
Normal file
@@ -0,0 +1,136 @@
|
||||
/*
|
||||
* $XConsortium: TermData.h /main/1 1996/04/21 19:15:38 drk $";
|
||||
*/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _Dt_TermData_h
|
||||
#define _Dt_TermData_h
|
||||
|
||||
#include "TermPrimData.h"
|
||||
#include "TermPrimRender.h"
|
||||
#include "TermFunctionKey.h"
|
||||
|
||||
#define NUM_RENDER_FONTS 3
|
||||
#define RENDER_FONT_NORMAL 0
|
||||
#define RENDER_FONT_LINEDRAW 1
|
||||
#define RENDER_FONT_BOLD 2
|
||||
|
||||
#define NO_USER_KEY_STRINGS 15
|
||||
typedef struct _VtFontInfoRec {
|
||||
TermFont termFont;
|
||||
short id;
|
||||
} VtFontRec, *VtFont;
|
||||
|
||||
typedef struct _VtColorPairRec {
|
||||
XColor fg;
|
||||
XColor bg;
|
||||
XColor hb;
|
||||
Boolean fgCommon;
|
||||
Boolean hbValid;
|
||||
Boolean bgCommon;
|
||||
Boolean initialized;
|
||||
} VtColorPairRec, *VtColorPair;
|
||||
|
||||
typedef struct _VtsaveCursor {
|
||||
/* The following "save" symbols are for "Save cursor state" (ESC7 & ESC8) */
|
||||
short cursorRow; /* to save current row */
|
||||
short cursorColumn; /* to save current column */
|
||||
char enhFieldState; /* to save current Char Erase state */
|
||||
char enhVideoState; /* to save current video enhancements */
|
||||
char enhFgColorState; /* index into color pair for fg text color*/
|
||||
char enhBgColorState; /* index into color pair for bg text color */
|
||||
Boolean originMode; /* to save current origin mode */
|
||||
Boolean wrapMode; /* to save current Wrap mode */
|
||||
int *GL; /* left graphics character set */
|
||||
int *GR; /* right graphics character set */
|
||||
int G0; /* graphics 0 character set */
|
||||
int G1; /* graphics 1 character set */
|
||||
int G2; /* graphics 2 character set */
|
||||
int G3; /* graphics 3 character set */
|
||||
int singleShiftFont; /* single shift character set */
|
||||
Boolean singleShiftPending; /* single shift ready to go */
|
||||
/* short charSets; don't need these yet */
|
||||
/* short charShift; ** to save char shift states for G0, etc */
|
||||
} VtSaveCursorRec, *VtSaveCursor ;
|
||||
|
||||
typedef struct _VtSaveDECMode {
|
||||
Boolean allow80_132ColMode; /* true if we allow changing (xterm spec)*/
|
||||
Boolean col132Mode ; /* True if 132 column mode */
|
||||
Boolean applicationMode; /* true if app mode, false if normal mode */
|
||||
Boolean applicationKPMode; /* true if app keypad mode */
|
||||
Boolean originMode; /* true when origin mode is active */
|
||||
Boolean wrapMode; /* true when wrapRightMode is true */
|
||||
Boolean jumpScrollMode;
|
||||
Boolean inverseVideoMode;
|
||||
Boolean fixCursesMode;
|
||||
Boolean reverseWrapMode;
|
||||
Boolean marginBellMode;
|
||||
Boolean cursorVisible;
|
||||
Boolean logging;
|
||||
} VtSaveDECModeRec, *VtSaveDECMode ;
|
||||
|
||||
typedef struct _DtTermDataRec {
|
||||
/*********************************************************************
|
||||
* Provide the term data structure so we can use a single pointer
|
||||
*/
|
||||
DtTermPrimData tpd;
|
||||
|
||||
/*********************************************************************
|
||||
* Font
|
||||
*/
|
||||
VtFontRec renderFonts[NUM_RENDER_FONTS];
|
||||
/* fonts to use for the terinal */
|
||||
int G0; /* Graphics sets 0-4 */
|
||||
int G1;
|
||||
int G2;
|
||||
int G3;
|
||||
int *GL; /* Graphics Left and Right */
|
||||
int *GR;
|
||||
int singleShiftFont; /* single shift character set */
|
||||
Boolean singleShiftPending; /* single shift ready to go */
|
||||
unsigned char baseFontIndex; /* number of base font */
|
||||
unsigned char altFontIndex; /* number of alternate font */
|
||||
|
||||
/*********************************************************************
|
||||
* Colors
|
||||
*/
|
||||
VtColorPairRec colorPairs[9]; /* color pair pixels */
|
||||
|
||||
/*********************************************************************
|
||||
* User (and other) Function keys
|
||||
*/
|
||||
unsigned char *userKeyString[NO_USER_KEY_STRINGS+1] ;
|
||||
|
||||
Boolean applicationMode; /* true if app mode, false if normal mode */
|
||||
Boolean applicationKPMode; /* true if app keypad mode */
|
||||
Boolean originMode; /* true when origin mode is active */
|
||||
Boolean S8C1TMode; /* true when xmitting 8 bit c1 codes */
|
||||
Boolean col132Mode ; /* True if 132 column mode */
|
||||
Boolean reverseWrapMode; /* true if we're doing Reverse auto wrap*/
|
||||
Boolean fixCursesMode; /* true if we're handling the tab problem */
|
||||
Boolean userKeysLocked; /* true if user defined keys are locked */
|
||||
Boolean needToLockUserKeys; /* true if need to lock keys (this is a parser
|
||||
state and will mostly be false) */
|
||||
|
||||
int compatLevel; /* 1=vt100, 2=vt200 */
|
||||
int terminalId; /* 220, 100, 101, 102 */
|
||||
char enhVideoState; /* current video enhancement state */
|
||||
char enhFieldState; /* current field enhancement state */
|
||||
char enhFgColorState; /* current fg color enhancement state */
|
||||
char enhBgColorState; /* current bg color enhancement state */
|
||||
char enhFontState; /* current font enhancement state */
|
||||
|
||||
VtSaveCursorRec saveCursor ;
|
||||
|
||||
VtSaveDECModeRec saveDECMode ;
|
||||
|
||||
} DtTermDataRec, *DtTermData;
|
||||
|
||||
|
||||
#endif /* _Dt_TermData_h */
|
||||
93
cde/lib/DtTerm/Term/TermEnhance.c
Normal file
93
cde/lib/DtTerm/Term/TermEnhance.c
Normal file
@@ -0,0 +1,93 @@
|
||||
#ifndef lint
|
||||
#ifdef VERBOSE_REV_INFO
|
||||
static char rcs_id[] = "$XConsortium: TermEnhance.c /main/1 1996/04/21 19:15:41 drk $";
|
||||
#endif /* VERBOSE_REV_INFO */
|
||||
#endif /* lint */
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#include "TermHeader.h"
|
||||
#include <X11/X.h>
|
||||
#include "TermP.h"
|
||||
#include "TermColor.h"
|
||||
#include "TermBuffer.h"
|
||||
|
||||
#define ourColorPair (values[(int) enhFgColor])
|
||||
#define ourBgColor (values[(int) enhBgColor])
|
||||
#define ourFont (values[(int) enhFont])
|
||||
#define ourVideo (values[(int) enhVideo])
|
||||
|
||||
void
|
||||
_DtTermEnhProc(Widget w, enhValues values, TermEnhInfo info)
|
||||
{
|
||||
|
||||
DtTermWidget tw = (DtTermWidget) w;
|
||||
DtTermData td = tw->vt.td;
|
||||
|
||||
/* initialize the color pair if we need to... */
|
||||
if (!td->colorPairs[ourColorPair].initialized) {
|
||||
(void) _DtTermColorInitializeColorPair(w,
|
||||
&td->colorPairs[ourColorPair]);
|
||||
}
|
||||
if (!td->colorPairs[ourBgColor].initialized) {
|
||||
(void) _DtTermColorInitializeColorPair(w,
|
||||
&td->colorPairs[ourBgColor]);
|
||||
}
|
||||
|
||||
/* take care of video enhancements...
|
||||
*/
|
||||
/* half bright (picks fg color) ... */
|
||||
if (IS_HALF_BRIGHT(ourVideo) && td->colorPairs[ourColorPair].hbValid) {
|
||||
info->fg = td->colorPairs[ourColorPair].hb.pixel;
|
||||
} else {
|
||||
info->fg = td->colorPairs[ourColorPair].fg.pixel;
|
||||
}
|
||||
|
||||
/* background is always background... */
|
||||
info->bg = td->colorPairs[ourBgColor].bg.pixel;
|
||||
|
||||
/* if inverse video, swap fg and bg... */
|
||||
if (IS_INVERSE(ourVideo)) {
|
||||
Pixel tmp;
|
||||
|
||||
tmp = info->fg;
|
||||
info->fg = info->bg;
|
||||
info->bg = tmp;
|
||||
}
|
||||
|
||||
info->flags = (unsigned long) 0;
|
||||
if (IS_SECURE(ourVideo)) {
|
||||
info->flags |= TermENH_SECURE;
|
||||
}
|
||||
if (IS_UNDERLINE(ourVideo)) {
|
||||
info->flags |= TermENH_UNDERLINE;
|
||||
}
|
||||
|
||||
info->font = td->renderFonts[RENDER_FONT_NORMAL].termFont;
|
||||
if (IS_BOLD(ourVideo)) {
|
||||
if (ourFont == FONT_NORMAL) {
|
||||
if (td->renderFonts[RENDER_FONT_BOLD].termFont) {
|
||||
/* valid bold font -- use it... */
|
||||
info->font = td->renderFonts[RENDER_FONT_BOLD].termFont;
|
||||
} else {
|
||||
/* embolden via overstrike... */
|
||||
info->flags |= TermENH_OVERSTRIKE;
|
||||
}
|
||||
} else {
|
||||
/* DKS: can't do bold with the linedraw font... */
|
||||
info->font = td->renderFonts[RENDER_FONT_LINEDRAW].termFont;
|
||||
}
|
||||
} else {
|
||||
/* not bold -- default is FONT_NORMAL... */
|
||||
if (ourFont == FONT_LINEDRAW) {
|
||||
info->font = td->renderFonts[RENDER_FONT_LINEDRAW].termFont;
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
19
cde/lib/DtTerm/Term/TermEnhance.h
Normal file
19
cde/lib/DtTerm/Term/TermEnhance.h
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* $XConsortium: TermEnhance.h /main/1 1996/04/21 19:15:44 drk $";
|
||||
*/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _Dt_TermEnhance_h
|
||||
#define _Dt_TermEnhance_h
|
||||
|
||||
#include "TermPrimBuffer.h"
|
||||
extern void _DtTermEnhProc(Widget w, enhValues values, TermEnhInfo info);
|
||||
|
||||
#endif /* _Dt_TermEnhance_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif... */
|
||||
1143
cde/lib/DtTerm/Term/TermFunction.c
Normal file
1143
cde/lib/DtTerm/Term/TermFunction.c
Normal file
File diff suppressed because it is too large
Load Diff
72
cde/lib/DtTerm/Term/TermFunction.h
Normal file
72
cde/lib/DtTerm/Term/TermFunction.h
Normal file
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* $XConsortium: TermFunction.h /main/1 1996/04/21 19:15:50 drk $";
|
||||
*/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _Dt_TermFunction_h
|
||||
#define _Dt_TermFunction_h
|
||||
|
||||
#include "TermPrimFunction.h"
|
||||
|
||||
extern void _DtTermFuncScroll(Widget w, int count,
|
||||
FunctionSource functionSource);
|
||||
extern void _DtTermFuncBeginningOfBuffer(Widget w, int count,
|
||||
FunctionSource functionSource);
|
||||
extern void _DtTermFuncEndOfBuffer(Widget w, int count,
|
||||
FunctionSource functionSource);
|
||||
|
||||
extern void _DtTermFuncEraseInLine(Widget w, int count,
|
||||
FunctionSource functionSource);
|
||||
extern void _DtTermFuncEraseInDisplay(Widget w, int count,
|
||||
FunctionSource functionSource);
|
||||
extern void _DtTermFuncEraseCharacter(Widget w, int count,
|
||||
FunctionSource functionSource);
|
||||
|
||||
extern void _DtTermFuncClearToEndOfBuffer(Widget w, int count,
|
||||
FunctionSource functionSource);
|
||||
extern void _DtTermFuncClearBuffer(Widget w, int count,
|
||||
FunctionSource functionSource);
|
||||
extern void _DtTermFuncClearLine(Widget w, int count,
|
||||
FunctionSource functionSource);
|
||||
extern void _DtTermFuncClearToEndOfLine(Widget w, int count,
|
||||
FunctionSource functionSource);
|
||||
|
||||
extern void _DtTermFuncHardReset(Widget w, int count,
|
||||
FunctionSource functionSource);
|
||||
extern void _DtTermFuncSoftReset(Widget w, int count,
|
||||
FunctionSource functionSource);
|
||||
|
||||
extern void _DtTermFuncDeleteChar(Widget w, int count,
|
||||
FunctionSource functionSource);
|
||||
extern void _DtTermFuncDeleteCharWrap(Widget w, int count,
|
||||
FunctionSource functionSource);
|
||||
|
||||
extern void _DtTermFuncInsertLine(Widget w, int count,
|
||||
FunctionSource functionSource);
|
||||
|
||||
extern void _DtTermFuncDeleteLine(Widget w, int count,
|
||||
FunctionSource functionSource);
|
||||
|
||||
extern void _DtTermFuncTab(Widget w, int count,
|
||||
FunctionSource functionSource);
|
||||
|
||||
extern void _DtTermVideoEnhancement(Widget w,int value);
|
||||
|
||||
extern void _DtTermFontEnhancement(Widget w,int value);
|
||||
|
||||
extern void _DtTermSetUserKeyLock(Widget w,Boolean lock_state);
|
||||
extern Boolean _DtTermGetUserKeyLock(Widget w);
|
||||
extern void _DtTermSetAutoLineFeed(Widget w,Boolean alf_state);
|
||||
extern Boolean _DtTermGetAutoLineFeed(Widget w);
|
||||
extern void _DtTermSetCurrentWorkingDirectory(Widget w, char *cwd);
|
||||
extern char *_DtTermGetCurrentWorkingDirectory(Widget w);
|
||||
|
||||
#endif /* _Dt_TermFunction_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif... */
|
||||
|
||||
139
cde/lib/DtTerm/Term/TermFunctionKey.c
Normal file
139
cde/lib/DtTerm/Term/TermFunctionKey.c
Normal file
@@ -0,0 +1,139 @@
|
||||
#ifndef lint
|
||||
#ifdef VERBOSE_REV_INFO
|
||||
static char rcs_id[] = "$XConsortium: TermFunctionKey.c /main/1 1996/04/21 19:15:53 drk $";
|
||||
#endif /* VERBOSE_REV_INFO */
|
||||
#endif /* lint */
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#include "TermHeader.h"
|
||||
#include <Xm/Xm.h>
|
||||
#include "TermPrimI.h"
|
||||
#include "TermP.h"
|
||||
/* #include "TermFunctionKeyP.h" */
|
||||
/* #include "TermPrimFunction.h" */
|
||||
#include "TermSendEsc.h"
|
||||
|
||||
#define NO_SUN_FUNC_KEYS 35
|
||||
#define NO_VT_FUNC_KEYS 20
|
||||
|
||||
static char *functionKey[] = { F1_VT,F2_VT,F3_VT,F4_VT,F5_VT,F6_VT,F7_VT,F8_VT,F9_VT,F10_VT,F11_VT,F12_VT,F13_VT,F14_VT,F15_VT,F16_VT,F17_VT,F18_VT,F19_VT,F20_VT};
|
||||
static char *sunFunctionKey[] = { F1_VT_SUN,F2_VT_SUN,F3_VT_SUN,F4_VT_SUN,F5_VT_SUN,F6_VT_SUN,F7_VT_SUN,F8_VT_SUN,F9_VT_SUN,F10_VT_SUN,F11_VT_SUN,F12_VT_SUN,F13_VT_SUN,F14_VT_SUN,F15_VT_SUN,F16_VT_SUN,F17_VT_SUN,F18_VT_SUN,F19_VT_SUN,F20_VT_SUN,F21_VT_SUN,F22_VT_SUN,F23_VT_SUN,F24_VT_SUN,F25_VT_SUN,F26_VT_SUN,F27_VT_SUN,F28_VT_SUN,F29_VT_SUN,F30_VT_SUN,F31_VT_SUN,F32_VT_SUN,F33_VT_SUN,F34_VT_SUN,F35_VT_SUN};
|
||||
|
||||
|
||||
/* NOTE: the following function assumes that the keys start at 0
|
||||
* (i.e., F1 == 0, F2 == 1, etc)...
|
||||
*/
|
||||
void
|
||||
_DtTermFunctionKeyExecute(
|
||||
Widget w,
|
||||
short keyNumber,
|
||||
Boolean shift
|
||||
)
|
||||
{
|
||||
DtTermWidget tw = (DtTermWidget) w;
|
||||
DtTermData td = tw->vt.td;
|
||||
|
||||
if (!shift || tw->vt.sunFunctionKeys == True ) {
|
||||
if ( tw->vt.sunFunctionKeys == True ) {
|
||||
if ( --keyNumber < NO_SUN_FUNC_KEYS )
|
||||
(void) _DtTermWriteEscSeq(w, sunFunctionKey[keyNumber]);
|
||||
}
|
||||
else {
|
||||
if ( --keyNumber < NO_VT_FUNC_KEYS )
|
||||
(void) _DtTermWriteEscSeq(w, functionKey[keyNumber]);
|
||||
}
|
||||
} else {
|
||||
(void) _DtTermFunctionKeyUserKeyExecute(w, keyNumber, shift);
|
||||
}
|
||||
}
|
||||
|
||||
/* NOTE: the following function assumes that the keys start at 0
|
||||
* (i.e., F1 == 0, F2 == 1, etc)...
|
||||
*/
|
||||
void
|
||||
_DtTermFunctionKeyUserKeyExecute(
|
||||
Widget w,
|
||||
short keyno,
|
||||
Boolean shift
|
||||
)
|
||||
{
|
||||
DtTermWidget tw = (DtTermWidget) w;
|
||||
DtTermData td = tw->vt.td;
|
||||
|
||||
keyno -= 6 ; /* valid keys are F6-F20 */
|
||||
if ( keyno >= 0 && keyno <= NO_USER_KEY_STRINGS
|
||||
&& td->userKeyString[keyno] )
|
||||
_DtTermPrimSendInput(w,td->userKeyString[keyno],
|
||||
strlen((char *)td->userKeyString[keyno])) ;
|
||||
}
|
||||
|
||||
void
|
||||
_DtTermFunctionKeyStringStore( /* store the label for the given key number */
|
||||
Widget w,
|
||||
int keyno,
|
||||
char *string
|
||||
)
|
||||
{
|
||||
DtTermWidget tw = (DtTermWidget) w;
|
||||
DtTermData td = tw->vt.td;
|
||||
int ukey = 0 ;
|
||||
|
||||
switch ( keyno ) {
|
||||
case 17: ukey = 0 ; break;
|
||||
case 18: ukey = 1 ; break;
|
||||
case 19: ukey = 2 ; break;
|
||||
case 20: ukey = 3 ; break;
|
||||
case 21: ukey = 4 ; break;
|
||||
case 23: ukey = 5 ; break;
|
||||
case 24: ukey = 6 ; break;
|
||||
case 25: ukey = 7 ; break;
|
||||
case 26: ukey = 8 ; break;
|
||||
case 28: ukey = 9; break;
|
||||
case 29: ukey = 10 ; break;
|
||||
case 31: ukey = 11 ; break;
|
||||
case 32: ukey = 12 ; break;
|
||||
case 33: ukey = 13 ; break;
|
||||
case 34: ukey = 14 ; break;
|
||||
default: ukey = -1 ; break;
|
||||
}
|
||||
if (ukey == -1) return ;
|
||||
if (td->userKeyString[ukey]) free(td->userKeyString[ukey]) ;
|
||||
td->userKeyString[ukey] = malloc(strlen(string)+1) ;
|
||||
strcpy((char *)td->userKeyString[ukey],string) ;
|
||||
}
|
||||
|
||||
void
|
||||
_DtTermFunctionKeyClear(
|
||||
Widget w
|
||||
)
|
||||
{
|
||||
DtTermWidget tw = (DtTermWidget) w;
|
||||
DtTermData td = tw->vt.td;
|
||||
int i ;
|
||||
|
||||
for (i=0; i<=NO_USER_KEY_STRINGS ; i++) {
|
||||
if (td->userKeyString[i]) {
|
||||
free(td->userKeyString[i]) ;
|
||||
td->userKeyString[i] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_DtTermFunctionKeyInit(
|
||||
Widget w
|
||||
)
|
||||
{
|
||||
DtTermWidget tw = (DtTermWidget) w;
|
||||
DtTermData td = tw->vt.td;
|
||||
int i ;
|
||||
|
||||
for (i=0; i<=NO_USER_KEY_STRINGS ; i++) {
|
||||
td->userKeyString[i] = 0;
|
||||
}
|
||||
}
|
||||
60
cde/lib/DtTerm/Term/TermFunctionKey.h
Normal file
60
cde/lib/DtTerm/Term/TermFunctionKey.h
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* $XConsortium: TermFunctionKey.h /main/1 1996/04/21 19:15:56 drk $
|
||||
*/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _Dt_TermFunctionKey_h
|
||||
#define _Dt_TermFunctionKey_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
/* _DtTermFunctionKeyExecute(): This action is invoked via an action when
|
||||
* a function key F1..F32 is depressed...
|
||||
*/
|
||||
extern void _DtTermFunctionKeyExecute(
|
||||
Widget w,
|
||||
short keyNumber,
|
||||
Boolean shift
|
||||
);
|
||||
|
||||
extern void
|
||||
_DtTermFunctionKeyUserKeyExecute(
|
||||
Widget w,
|
||||
short keyno,
|
||||
Boolean shift
|
||||
);
|
||||
|
||||
extern void
|
||||
_DtTermFunctionKeyStringStore( /* store the label for the given key number
|
||||
*/
|
||||
Widget w,
|
||||
int keyno,
|
||||
char *string
|
||||
);
|
||||
|
||||
|
||||
extern void
|
||||
_DtTermFunctionKeyClear(
|
||||
Widget w
|
||||
);
|
||||
|
||||
|
||||
extern _DtTermFunctionKeyInit(
|
||||
Widget w
|
||||
);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* close scope of 'extern "C"'.... */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* DONT'T ADD ANYTHING AFTER THIS #endif... */
|
||||
#endif /* _Dt_TermFunctionKey_h */
|
||||
48
cde/lib/DtTerm/Term/TermFunctionKeyP.h
Normal file
48
cde/lib/DtTerm/Term/TermFunctionKeyP.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* $XConsortium: TermFunctionKeyP.h /main/1 1996/04/21 19:15:58 drk $
|
||||
*/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _Dt_TermFunctionKeyP_h
|
||||
#define _Dt_TermFunctionKeyP_h
|
||||
|
||||
#include "TermFunctionKey.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
typedef struct _PerUserKeyInfoRec {
|
||||
UserKeyAttribute attribute;
|
||||
unsigned char *label;
|
||||
short labelLength;
|
||||
unsigned char *sendString;
|
||||
short sendStringLength;
|
||||
Boolean enabled;
|
||||
} PerUserKeyInfoRec, *PerUserKeyInfo;
|
||||
|
||||
typedef struct _UserKeyInfoRec {
|
||||
int numKeys;
|
||||
int keyToXmit;
|
||||
PerUserKeyInfoRec *keys;
|
||||
int workingKeyNumber;
|
||||
unsigned char *workingLabel;
|
||||
int workingLabelLength;
|
||||
int workingLabelTotalLength;
|
||||
unsigned char *workingString;
|
||||
int workingStringLength;
|
||||
int workingStringTotalLength;
|
||||
} UserKeyInfoRec;
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* close scope of 'extern "C"'.... */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* DONT'T ADD ANYTHING AFTER THIS #endif... */
|
||||
#endif /* _Dt_TermFunctionKeyP_h */
|
||||
83
cde/lib/DtTerm/Term/TermLineData.data
Normal file
83
cde/lib/DtTerm/Term/TermLineData.data
Normal file
@@ -0,0 +1,83 @@
|
||||
# @(#)$XConsortium: TermLineData.data /main/1 1996/04/21 19:16:01 drk $
|
||||
#
|
||||
# the following stuff will be inserted directly into the output file.
|
||||
# *** it does not apply directly to this file!!!! ***
|
||||
#
|
||||
!/* This file was machine generated. It should not be placed under
|
||||
! * revision control or edited directly.
|
||||
! */
|
||||
!
|
||||
!#include "TermPrimLineFontP.h"
|
||||
!
|
||||
|
||||
char '_'
|
||||
# blank space
|
||||
|
||||
char 'j'
|
||||
# lower right corner
|
||||
line 50 0 50 50 1
|
||||
line 50 50 0 50 1
|
||||
|
||||
char 'k'
|
||||
# upper right corner
|
||||
line 0 50 50 50 1
|
||||
line 50 50 50 100 1
|
||||
|
||||
char 'l'
|
||||
# upper left corner
|
||||
line 50 50 100 50 1
|
||||
line 50 50 50 100 1
|
||||
|
||||
char 'm'
|
||||
# lower left corner
|
||||
line 50 0 50 50 1
|
||||
line 50 50 100 50 1
|
||||
|
||||
char 'n'
|
||||
# cross
|
||||
line 50 0 50 100 1
|
||||
line 0 50 100 50 1
|
||||
|
||||
char 'o'
|
||||
# scan 1 (of 9)
|
||||
line 0 0 100 0 1
|
||||
|
||||
char 'p'
|
||||
# scan 3 (of 9)
|
||||
line 0 25 100 25 1
|
||||
|
||||
char 'q'
|
||||
# scan 5 (of 9)
|
||||
line 0 50 100 50 1
|
||||
|
||||
char 'r'
|
||||
# scan 7 (of 9)
|
||||
line 0 75 100 75 1
|
||||
|
||||
char 's'
|
||||
# scan 9 (of 9)
|
||||
line 0 100 100 100 1
|
||||
|
||||
char 't'
|
||||
# left T
|
||||
line 50 0 50 100 1
|
||||
line 50 50 100 50 1
|
||||
|
||||
char 'u'
|
||||
# right T
|
||||
line 50 0 50 100 1
|
||||
line 50 50 0 50 1
|
||||
|
||||
char 'v'
|
||||
# lower T
|
||||
line 50 0 50 50 1
|
||||
line 0 50 100 50 1
|
||||
|
||||
char 'w'
|
||||
# upper T
|
||||
line 0 50 100 50 1
|
||||
line 50 50 50 100 1
|
||||
|
||||
char 'x'
|
||||
# vertical bar
|
||||
line 50 0 50 100 1
|
||||
20
cde/lib/DtTerm/Term/TermLineData.h
Normal file
20
cde/lib/DtTerm/Term/TermLineData.h
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* $XConsortium: TermLineData.h /main/1 1996/04/21 19:16:04 drk $";
|
||||
*/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _Dt_TermLineData_h
|
||||
#define _Dt_TermLineData_h
|
||||
|
||||
#include "TermPrimLineFont.h"
|
||||
|
||||
extern int _DtTermNumGlyphs;
|
||||
extern GlyphInfoRec _DtTermGlyphs[];
|
||||
|
||||
#endif /* _Dt_TermLineData_h */
|
||||
70
cde/lib/DtTerm/Term/TermP.h
Normal file
70
cde/lib/DtTerm/Term/TermP.h
Normal file
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* $XConsortium: TermP.h /main/1 1996/04/21 19:16:07 drk $";
|
||||
*/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _Dt_TermP_h
|
||||
#define _Dt_TermP_h
|
||||
|
||||
#include "TermPrimP.h"
|
||||
#include "Term.h"
|
||||
#include "TermData.h"
|
||||
#include "TermFunctionKey.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* Vt class structure... */
|
||||
|
||||
typedef struct _DtTermClassPart
|
||||
{
|
||||
int foo;
|
||||
} DtTermClassPart;
|
||||
|
||||
/* full clas record declaration for Vt class... */
|
||||
typedef struct _DtTermClassRec {
|
||||
CoreClassPart core_class;
|
||||
XmPrimitiveClassPart primitive_class;
|
||||
DtTermPrimitiveClassPart term_primitive_class;
|
||||
DtTermClassPart term_class;
|
||||
} DtTermClassRec;
|
||||
|
||||
externalref DtTermClassRec dtTermClassRec;
|
||||
|
||||
/* vt instance record... */
|
||||
typedef struct _DtTermPart
|
||||
{
|
||||
DtTermData td; /* non-widget terminal data */
|
||||
Boolean autoWrap;
|
||||
Boolean reverseWrap;
|
||||
Boolean sunFunctionKeys;
|
||||
Boolean c132;
|
||||
Boolean appKeypadMode;
|
||||
Boolean appCursorMode;
|
||||
} DtTermPart;
|
||||
|
||||
/* full instance record declaration... */
|
||||
|
||||
typedef struct _DtTermRec {
|
||||
CorePart core;
|
||||
XmPrimitivePart primitive;
|
||||
DtTermPrimitivePart term;
|
||||
DtTermPart vt;
|
||||
} DtTermRec;
|
||||
|
||||
/* private function declarations... */
|
||||
/* end private function declarations... */
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* close scope of 'extern "C"'... */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* _Dt_TermP_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif... */
|
||||
2232
cde/lib/DtTerm/Term/TermParse.c
Normal file
2232
cde/lib/DtTerm/Term/TermParse.c
Normal file
File diff suppressed because it is too large
Load Diff
552
cde/lib/DtTerm/Term/TermParseTable.c
Normal file
552
cde/lib/DtTerm/Term/TermParseTable.c
Normal file
@@ -0,0 +1,552 @@
|
||||
/*
|
||||
** $XConsortium: TermParseTable.c /main/3 1996/10/11 17:45:10 rswiston $
|
||||
*/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994, 1996 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994, 1996 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994, 1996 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994, 1996 Novell, Inc. *
|
||||
* (c) Copyright 1996 Digital Equipment Corporation. *
|
||||
* (c) Copyright 1996 FUJITSU LIMITED. *
|
||||
* (c) Copyright 1996 Hitachi. *
|
||||
*/
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#ifndef TEST
|
||||
#include "TermHeader.h"
|
||||
#endif /* TEST */
|
||||
#include "TermPrimParserP.h"
|
||||
#include "TermPrimParseTable.h" /* DKS: the things we care about should be moved to TermParseTable.h */
|
||||
#include "TermParseTableP.h"
|
||||
|
||||
static StateTableRec stateStart;
|
||||
|
||||
/* This is our basic pre-parse table
|
||||
*/
|
||||
static StateEntryRec
|
||||
pre_parse_table[] =
|
||||
{
|
||||
0x00, 0x00, NULL, NULL, /* null chars -- ignore */
|
||||
#ifdef NOTDEF
|
||||
0x05, 0x05, NULL, enquire, /* send answer back */
|
||||
#endif /* NOTDEF */
|
||||
0x07, 0x07, NULL, _DtTermPrimParseBell, /* ring the bell */
|
||||
0x08, 0x08, NULL, _DtTermParseBackspace, /* backspace */
|
||||
0x09, 0x09, NULL, _DtTermParseTab, /* horizontal tab */
|
||||
0x0A, 0x0A, NULL, _DtTermParseLF, /* newline */
|
||||
0x0B, 0x0B, NULL, _DtTermParseLF, /* Vertical Tab (Ctrl-k) */
|
||||
0x0C, 0x0C, NULL, _DtTermParseLF, /* Form Feed or New Page */
|
||||
0x0D, 0x0D, NULL, _DtTermPrimParseCR, /* carriage return */
|
||||
0x0E, 0x0F, NULL, _DtTermParseFontShift, /* font shift in/out */
|
||||
0x1B, 0x1B, &_DtTermStateEscape, _DtTermClearParam, /* Esc */
|
||||
0x84, 0x84, &stateStart,_DtTermIndex, /* Index */
|
||||
0x85, 0x85, &stateStart,_DtTermNextLine, /* Next Line */
|
||||
0x88, 0x88, &stateStart,_DtTermTabSet, /* Horizontal Tab Set */
|
||||
0x8D, 0x8D, &stateStart,_DtTermReverseIndex, /* Reverse Index */
|
||||
0x8E, 0x8E, &stateStart,_DtTermSingleShiftG2,/* Single Shift G2 */
|
||||
0x8F, 0x8F, &stateStart,_DtTermSingleShiftG3, /* Single Shift G3 */
|
||||
0x90, 0x90, &_DtTermStateP, _DtTermPrimParserNextState, /* DCS */
|
||||
0x9B, 0x9B, &_DtTermStateLeftBracket, _DtTermClearParam,/*CSI*/
|
||||
0x00, 0xFF, NULL, NULL, /* end of table */
|
||||
};
|
||||
|
||||
/*
|
||||
** Since the preparse was added this state only serves to indicate
|
||||
** the end of parsing (originally it was the start state)
|
||||
*/
|
||||
static StateEntryRec
|
||||
start_table[] =
|
||||
{
|
||||
0x00, 0xFF, &stateStart, _DtTermPrimParserNextState /* end of table */
|
||||
};
|
||||
|
||||
static StateTableRec stateStart = {True, start_table, pre_parse_table};
|
||||
StateTable _DtTermStateStart = &stateStart;
|
||||
|
||||
/*
|
||||
** this is the table used when an escape has been seen
|
||||
*/
|
||||
static StateEntryRec
|
||||
escape_table[] =
|
||||
{
|
||||
'[', '[', &_DtTermStateLeftBracket, _DtTermPrimParserNextState,
|
||||
'#', '#', &_DtTermStatePound, _DtTermPrimParserNextState,
|
||||
'(', '(', &_DtTermStateLeftParen, _DtTermPrimParserNextState,
|
||||
')', ')', &_DtTermStateRightParen, _DtTermPrimParserNextState,
|
||||
'*', '*', &_DtTermStateAsterisk, _DtTermPrimParserNextState,
|
||||
'+', '+', &_DtTermStatePlus, _DtTermPrimParserNextState,
|
||||
'7', '7', &stateStart, _DtTermSaveCursor, /* Save Cursor (DECSC) */
|
||||
'8', '8', &stateStart,_DtTermRestoreCursor, /* Restore Cursor (DECRC)*/
|
||||
'=', '=', &stateStart, _DtTermAppKeypad , /* App keypad */
|
||||
'>', '>', &stateStart, _DtTermNormalKeypad, /* Normal keypad */
|
||||
'D', 'D', &stateStart, _DtTermIndex, /* cursor down IND */
|
||||
'E', 'E', &stateStart, _DtTermNextLine, /* next line (NEL) */
|
||||
'H', 'H', &stateStart, _DtTermTabSet, /* Tab Set (HTS) */
|
||||
'M', 'M', &stateStart, _DtTermReverseIndex, /* RI */
|
||||
'N', 'N', &stateStart, _DtTermSingleShiftG2, /* SS2 */
|
||||
'O', 'O', &stateStart, _DtTermSingleShiftG3, /* SS3 */
|
||||
'P', 'P', &_DtTermStateP, _DtTermPrimParserNextState, /* DCS */
|
||||
'Z', 'Z', &stateStart, _DtTermParseStatus, /* Same as DA */
|
||||
']', ']', &_DtTermStateRightBracket, _DtTermPrimParserNextState,
|
||||
'^', '^', &_DtTermStateUpArrow, _DtTermPrimParserNextState, /* PM */
|
||||
'_', '_', &_DtTermStateUnderscore, _DtTermPrimParserNextState, /*ACP*/
|
||||
'c', 'c', &stateStart, _DtTermReset, /* Full Reset (RIS) */
|
||||
'n', 'n', &stateStart, _DtTermSelectG2, /* Select G2 character set */
|
||||
'o', 'o', &stateStart, _DtTermSelectG3, /* Select G3 character set */
|
||||
'|', '|', &stateStart, _DtTermInvokeG3, /* Invoke G3 character set */
|
||||
'}', '}', &stateStart, _DtTermInvokeG2, /* Select G2 character set */
|
||||
'~', '~', &_DtTermStateTilda, _DtTermPrimParserNextState, /* Invoke G1*/
|
||||
' ', ' ', &_DtTermStateC1, _DtTermPrimParserNextState,/* set C1 control*/
|
||||
0x00, 0xFF, &stateStart, _DtTermPrimParserNextState /* end of table */
|
||||
};
|
||||
StateTableRec _DtTermStateEscape = {False, escape_table, pre_parse_table};
|
||||
|
||||
|
||||
/*
|
||||
** this is the table used when an escape sp has been seen
|
||||
*/
|
||||
static StateEntryRec
|
||||
set_c1_table[] =
|
||||
{
|
||||
'F', 'F', &stateStart, _DtTermS7C1T, /* Select 7-bit C1 Control */
|
||||
'G', 'G', &stateStart, _DtTermS8C1T, /* Select 8-bit C1 Control */
|
||||
0x00, 0xFF, &stateStart, _DtTermPrintState , /* end of table */
|
||||
};
|
||||
StateTableRec _DtTermStateC1 = {False, set_c1_table, pre_parse_table};
|
||||
|
||||
/*
|
||||
** this is the table used when an escape # been seen
|
||||
*/
|
||||
static StateEntryRec
|
||||
pound_table[] =
|
||||
{
|
||||
'3', '3', &stateStart, _DtTermDoubleHigh,
|
||||
'5', '5', &stateStart, _DtTermSingleWide,
|
||||
'6', '6', &stateStart, _DtTermDoubleWide,
|
||||
'8', '8', &stateStart, _DtTermAlignTest,
|
||||
0x00, 0xFF, &stateStart, _DtTermPrintState , /* end of table */
|
||||
};
|
||||
StateTableRec _DtTermStatePound = {False, pound_table, pre_parse_table};
|
||||
|
||||
|
||||
/*
|
||||
** this is the table used when an escape ( has been seen
|
||||
*/
|
||||
static StateEntryRec
|
||||
left_paren_table[] =
|
||||
{
|
||||
0x00, 0xFF, &stateStart, _DtTermParseFontG0 /* end of table */
|
||||
};
|
||||
StateTableRec _DtTermStateLeftParen = {False, left_paren_table, pre_parse_table};
|
||||
|
||||
/*
|
||||
** this is the table used when an escape ) a has been seen
|
||||
*/
|
||||
static StateEntryRec
|
||||
right_paren_table[] =
|
||||
{
|
||||
0x00, 0xFF, &stateStart, _DtTermParseFontG1 /* end of table */
|
||||
};
|
||||
StateTableRec _DtTermStateRightParen = {False, right_paren_table, pre_parse_table};
|
||||
|
||||
/*
|
||||
** this is table used when ESC * has been seen
|
||||
*/
|
||||
static StateEntryRec
|
||||
esc_asterisk_table[] =
|
||||
{
|
||||
0x00, 0xFF, &stateStart, _DtTermParseFontG2 /* end of table */
|
||||
};
|
||||
StateTableRec _DtTermStateAsterisk = {False, esc_asterisk_table, pre_parse_table};
|
||||
|
||||
/*
|
||||
** this is table used when Esc + has been seen
|
||||
*/
|
||||
static StateEntryRec
|
||||
plus_table[] =
|
||||
{
|
||||
0x00, 0xFF, &stateStart, _DtTermParseFontG3 /* end of table */
|
||||
};
|
||||
StateTableRec _DtTermStatePlus = {False, plus_table, pre_parse_table};
|
||||
|
||||
/*
|
||||
** this is table used when "Esc ] l<string>Esc" has been seen
|
||||
*/
|
||||
static StateEntryRec
|
||||
get_titleBS_table[] =
|
||||
{
|
||||
'\\', '\\', &stateStart, _DtTermParserSunWindowTitle,
|
||||
0x00,0xFF, &_DtTermStateGetTitle, _DtTermSaveChar,
|
||||
};
|
||||
StateTableRec _DtTermStateGetTitleBS = {False, get_titleBS_table};
|
||||
|
||||
/*
|
||||
** this is table used when "Esc ] l" has been seen
|
||||
*/
|
||||
static StateEntryRec
|
||||
get_title_table[] =
|
||||
{
|
||||
0x1B, 0x1B,&_DtTermStateGetTitleBS,_DtTermPrimParserNextState,
|
||||
0x00,0xFF, &_DtTermStateGetTitle, _DtTermSaveChar,
|
||||
};
|
||||
StateTableRec _DtTermStateGetTitle = {False, get_title_table};
|
||||
|
||||
/*
|
||||
** this is table used when "Esc ] L<string>Esc" has been seen
|
||||
*/
|
||||
static StateEntryRec
|
||||
get_iconBS_table[] =
|
||||
{
|
||||
'\\', '\\', &stateStart, _DtTermParserSunWindowIcon,
|
||||
0x00,0xFF, &_DtTermStateGetIcon, _DtTermSaveChar,
|
||||
};
|
||||
StateTableRec _DtTermStateGetIconBS = {False, get_iconBS_table};
|
||||
|
||||
/*
|
||||
** this is table used when "Esc ] L" has been seen
|
||||
*/
|
||||
static StateEntryRec
|
||||
get_icon_table[] =
|
||||
{
|
||||
0x1B, 0x1B,&_DtTermStateGetIconBS , _DtTermPrimParserNextState,
|
||||
0x00,0xFF, &_DtTermStateGetIcon, _DtTermSaveChar,
|
||||
};
|
||||
StateTableRec _DtTermStateGetIcon = {False, get_icon_table};
|
||||
|
||||
/*
|
||||
** this is table used when "Esc ] I<file>Esc" has been seen
|
||||
*/
|
||||
static StateEntryRec
|
||||
get_fileBS_table[] =
|
||||
{
|
||||
'\\', '\\', &stateStart, _DtTermParserSunIconFile,
|
||||
0x00,0xFF, &_DtTermStateGetIconFile, _DtTermSaveChar,
|
||||
};
|
||||
StateTableRec _DtTermStateGetIconFileBS = {False, get_fileBS_table};
|
||||
|
||||
/*
|
||||
** this is table used when "Esc ] I" has been seen
|
||||
*/
|
||||
static StateEntryRec
|
||||
get_file_table[] =
|
||||
{
|
||||
0x1B, 0x1B,&_DtTermStateGetIconFileBS , _DtTermPrimParserNextState,
|
||||
0x00,0xFF, &_DtTermStateGetIconFile, _DtTermSaveChar,
|
||||
};
|
||||
StateTableRec _DtTermStateGetIconFile = {False, get_file_table};
|
||||
|
||||
/*
|
||||
** CDExc21154:
|
||||
** this is table used when "Esc ] number ;<string>Esc" has been seen
|
||||
*/
|
||||
static StateEntryRec
|
||||
get_stringBS_table[] =
|
||||
{
|
||||
'\\', '\\', &stateStart, _DtTermPrimParserNextState,/*valid terminator*/
|
||||
0x07, 0x07, &stateStart, _DtTermChangeTextParam,/*new Icon,Title,etc*/
|
||||
0x00, 0xFF, &_DtTermStateGetString, _DtTermSaveChar, /* text*/
|
||||
};
|
||||
StateTableRec _DtTermStateGetStringBS = {False, get_stringBS_table};
|
||||
|
||||
/*
|
||||
** this is table used when "Esc ] number ;" has been seen
|
||||
*/
|
||||
static StateEntryRec
|
||||
get_string_table[] =
|
||||
{
|
||||
0x07, 0x07, &stateStart, _DtTermChangeTextParam,/*new Icon,Title,etc*/
|
||||
0x1B, 0x1B, &_DtTermStateGetStringBS , _DtTermPrimParserNextState,
|
||||
0x00,0xFF, &_DtTermStateGetString, _DtTermSaveChar, /* text*/
|
||||
};
|
||||
StateTableRec _DtTermStateGetString = {False, get_string_table};
|
||||
|
||||
/*
|
||||
** this is table used when esc ] has been seen
|
||||
*/
|
||||
static StateEntryRec
|
||||
right_bracket_table[] =
|
||||
{
|
||||
';', ';', &_DtTermStateGetString, _DtTermParsePushNum,/* increment count */
|
||||
'0', '9', &_DtTermStateRightBracket, _DtTermEnterNum, /* enter number */
|
||||
'l', 'l', &_DtTermStateGetTitle, _DtTermPrimParserNextState,
|
||||
'L', 'L', &_DtTermStateGetIcon, _DtTermPrimParserNextState,
|
||||
'I', 'I', &_DtTermStateGetIconFile, _DtTermPrimParserNextState,
|
||||
0x00, 0xFF, &stateStart, _DtTermPrintState /* end of table */
|
||||
};
|
||||
StateTableRec _DtTermStateRightBracket = {False, right_bracket_table};
|
||||
|
||||
/*
|
||||
** this is table used when esc [ has been seen and '?' is not in the follow
|
||||
*/
|
||||
static StateEntryRec
|
||||
left_bracket_table_no_Q[] =
|
||||
{
|
||||
';', ';', &_DtTermStateLeftBracketNotQ,_DtTermParsePushNum,
|
||||
'0', '9', &_DtTermStateLeftBracketNotQ, _DtTermEnterNum,
|
||||
'@', '@', &stateStart, _DtTermInsertChars, /* IL Insert Blank char*/
|
||||
'A', 'A', &stateStart, _DtTermCursorUp, /* CUU Cursor up n */
|
||||
'B', 'B', &stateStart, _DtTermCursorDown, /* CUD Cursor down n*/
|
||||
'C', 'C', &stateStart, _DtTermCursorForward,/* CUF Cursor forward n*/
|
||||
'D', 'D', &stateStart, _DtTermCursorBack, /* CUB Cursor back n*/
|
||||
'F', 'F', &stateStart, _DtTermCursorToLineUp,/* CPL Curs to Line up*/
|
||||
'G', 'G', &stateStart, _DtTermCursorToCol, /* CHA Curs to Col */
|
||||
'H', 'H', &stateStart, _DtTermCursorPos , /* Cursor Position */
|
||||
'J', 'J', &stateStart, _DtTermEraseDisplay, /* Erase in Display */
|
||||
'K', 'K', &stateStart, _DtTermEraseInLine, /* EL Erase in Line */
|
||||
'L', 'L', &stateStart, _DtTermInsertLines, /* IL Insert Lines */
|
||||
'M', 'M', &stateStart, _DtTermDeleteLines, /* DL Delete Lines */
|
||||
'S', 'S', &stateStart, _DtTermScrollUp , /* SU Scroll Up p lines*/
|
||||
'T', 'T', &stateStart, _DtTermScrollDown ,/*SD Scroll DOwn p lines*/
|
||||
'X', 'X', &stateStart, _DtTermEraseChars , /* ECH Erase chars */
|
||||
'c', 'c', &stateStart, _DtTermDeviceAttributes, /* DA */
|
||||
'P', 'P', &stateStart, _DtTermDeleteChars, /* DCH Delete Chars */
|
||||
'f', 'f', &stateStart, _DtTermCursorPos, /* Cursor Position */
|
||||
'g', 'g', &stateStart, _DtTermTabClear, /* TBC */
|
||||
'h', 'h', &stateStart, _DtTermSetMode, /* SM */
|
||||
'l', 'l', &stateStart, _DtTermResetMode, /* RM */
|
||||
'm', 'm', &stateStart, _DtTermCharAttributes, /* SGR */
|
||||
'n', 'n', &stateStart, _DtTermDeviceStatusAnsi, /* DSR */
|
||||
'r', 'r', &stateStart, _DtTermScrollingRegion, /* DECSTBM */
|
||||
't', 't', &stateStart, _DtTermParseSunMisc, /* misc sun esc seq */
|
||||
'x', 'x', &stateStart, _DtTermRequestParam, /* DECREQTPARM */
|
||||
'"', '"', &_DtTermStateDECSCA, _DtTermPrimParserNextState,/* sel erase */
|
||||
'!', '!', &_DtTermStateSoftReset, _DtTermPrimParserNextState , /* set erase attr */
|
||||
0x00, 0xFF, &stateStart, _DtTermPrintState /* end of table */
|
||||
};
|
||||
StateTableRec _DtTermStateLeftBracketNotQ = {False, left_bracket_table_no_Q, pre_parse_table};
|
||||
|
||||
/*
|
||||
** this is table used when esc [ has been seen
|
||||
*/
|
||||
static StateEntryRec
|
||||
left_bracket_table[] =
|
||||
{
|
||||
'?', '?', &_DtTermStateEscQuestion, _DtTermPrimParserNextState,/*DECSET*/
|
||||
';', ';', &_DtTermStateLeftBracketNotQ ,_DtTermParsePushNum,
|
||||
'0', '9', &_DtTermStateLeftBracketNotQ , _DtTermEnterNum,
|
||||
'@', '@', &stateStart, _DtTermInsertChars, /* IL Insert Blank char*/
|
||||
'A', 'A', &stateStart, _DtTermCursorUp, /* CUU Cursor up n */
|
||||
'B', 'B', &stateStart, _DtTermCursorDown, /* CUD Cursor down n*/
|
||||
'C', 'C', &stateStart, _DtTermCursorForward,/* CUF Cursor forward n*/
|
||||
'D', 'D', &stateStart, _DtTermCursorBack, /* CUB Cursor back n*/
|
||||
'F', 'F', &stateStart, _DtTermCursorToLineUp,/* CPL Curs to Line up*/
|
||||
'G', 'G', &stateStart, _DtTermCursorToCol, /* CHA Curs to Col */
|
||||
'H', 'H', &stateStart, _DtTermCursorPos , /* Cursor Position */
|
||||
'J', 'J', &stateStart, _DtTermEraseDisplay, /* Erase in Display */
|
||||
'K', 'K', &stateStart, _DtTermEraseInLine, /* EL Erase in Line */
|
||||
'L', 'L', &stateStart, _DtTermInsertLines, /* IL Insert Lines */
|
||||
'M', 'M', &stateStart, _DtTermDeleteLines, /* DL Delete Lines */
|
||||
'S', 'S', &stateStart, _DtTermScrollUp , /* SU Scroll Up p lines*/
|
||||
'T', 'T', &stateStart, _DtTermScrollDown ,/*SD Scroll DOwn p lines*/
|
||||
'X', 'X', &stateStart, _DtTermEraseChars , /* ECH Erase chars */
|
||||
'c', 'c', &stateStart, _DtTermDeviceAttributes, /* DA */
|
||||
'P', 'P', &stateStart, _DtTermDeleteChars, /* DCH Delete Chars */
|
||||
'f', 'f', &stateStart, _DtTermCursorPos, /* Cursor Position */
|
||||
'g', 'g', &stateStart, _DtTermTabClear, /* TBC */
|
||||
'h', 'h', &stateStart, _DtTermSetMode, /* SM */
|
||||
'l', 'l', &stateStart, _DtTermResetMode, /* RM */
|
||||
'm', 'm', &stateStart, _DtTermCharAttributes, /* SGR */
|
||||
'n', 'n', &stateStart, _DtTermDeviceStatusAnsi, /* DSR */
|
||||
'r', 'r', &stateStart, _DtTermScrollingRegion, /* DECSTBM */
|
||||
't', 't', &stateStart, _DtTermParseSunMisc, /* misc sun esc seq */
|
||||
'x', 'x', &stateStart, _DtTermRequestParam, /* DECREQTPARM */
|
||||
'"', '"', &_DtTermStateDECSCA, _DtTermPrimParserNextState,/* sel erase */
|
||||
'!', '!', &_DtTermStateSoftReset, _DtTermPrimParserNextState , /* set erase attr */
|
||||
0x00, 0xFF, &stateStart, _DtTermPrintState /* end of table */
|
||||
};
|
||||
StateTableRec _DtTermStateLeftBracket = {False, left_bracket_table, pre_parse_table};
|
||||
|
||||
/*
|
||||
** this is table used when esc [ ! has been seen
|
||||
*/
|
||||
static StateEntryRec
|
||||
soft_reset_table[] =
|
||||
{
|
||||
'p', 'p', &stateStart , _DtTermSoftReset, /* End of text */
|
||||
0x00, 0xFF, &stateStart , _DtTermPrintState /* end of table*/
|
||||
};
|
||||
StateTableRec _DtTermStateSoftReset = {False, soft_reset_table, pre_parse_table};
|
||||
|
||||
/*
|
||||
** this is table used when CSI " has been seen
|
||||
*/
|
||||
static StateEntryRec
|
||||
set_erase_table[] =
|
||||
{
|
||||
'p', 'p', &stateStart , _DtTermSetCompatLevel, /* DECSCL */
|
||||
'q', 'q', &stateStart , _DtTermSetCharEraseMode, /* set sel erase */
|
||||
0x00, 0xFF, &stateStart , _DtTermPrintState /* end of table*/
|
||||
};
|
||||
StateTableRec _DtTermStateDECSCA = {False, set_erase_table, pre_parse_table};
|
||||
|
||||
/*
|
||||
** this is table used when esc ^ ... esc has been seen
|
||||
*/
|
||||
static StateEntryRec
|
||||
up_backslash_table[] =
|
||||
{
|
||||
'\\', '\\',&stateStart , _DtTermPrimParserNextState, /* End of text */
|
||||
0x00, 0xFF, &_DtTermStateUpArrow, _DtTermPrimParserNextState
|
||||
};
|
||||
StateTableRec _DtTermStateUA_BS = {False, up_backslash_table};
|
||||
|
||||
/*
|
||||
** this is table used when esc ^ has been seen
|
||||
*/
|
||||
static StateEntryRec
|
||||
uparrow_table[] =
|
||||
{
|
||||
0x1B, 0x1B,&_DtTermStateUA_BS , _DtTermPrimParserNextState, /* Esc */
|
||||
0x9C, 0x9C, &stateStart, _DtTermPrimParserNextState, /* ST */
|
||||
0x00, 0xFF, &_DtTermStateUpArrow, _DtTermPrimParserNextState
|
||||
};
|
||||
StateTableRec _DtTermStateUpArrow = {False, uparrow_table};
|
||||
|
||||
/*
|
||||
** this is table used when esc _ ... esc has been seen
|
||||
*/
|
||||
static StateEntryRec
|
||||
under_backslash_table[] =
|
||||
{
|
||||
'\\', '\\',&stateStart , _DtTermPrimParserNextState, /* End of text */
|
||||
0x00, 0xFF, &_DtTermStateUnderscore, _DtTermPrimParserNextState /* Go back to Underscore*/
|
||||
};
|
||||
StateTableRec _DtTermStateUS_BS = {False, under_backslash_table};
|
||||
|
||||
/*
|
||||
** this is table used when esc _ has been seen
|
||||
*/
|
||||
static StateEntryRec
|
||||
underscore_table[] =
|
||||
{
|
||||
0x1B, 0x1B,&_DtTermStateUS_BS , _DtTermPrimParserNextState, /* Esc */
|
||||
0x9C, 0x9C, &stateStart, _DtTermPrimParserNextState, /* ST */
|
||||
0x00, 0xFF, &_DtTermStateUnderscore, _DtTermPrimParserNextState
|
||||
};
|
||||
StateTableRec _DtTermStateUnderscore = {False, underscore_table};
|
||||
|
||||
/*
|
||||
** this is the table used when an CSI ? has been seen
|
||||
*/
|
||||
static StateEntryRec
|
||||
esc_question_table[] =
|
||||
{
|
||||
'0', '9', &_DtTermStateEscQuestion , _DtTermEnterNum,
|
||||
'h', 'h', &stateStart , _DtTermPModeSet, /* DECSET private mode*/
|
||||
'l', 'l', &stateStart , _DtTermPModeReset, /*DECSET private mode*/
|
||||
'n', 'n', &stateStart , _DtTermDeviceStatus, /*DECSET private mode*/
|
||||
'r', 'r', &stateStart , _DtTermRestoreModeValues, /*restore Mode values*/
|
||||
's', 's', &stateStart , _DtTermSaveModeValues, /*save Mode values*/
|
||||
'K', 'K', &stateStart , _DtTermSelEraseInLine, /* DECSEL */
|
||||
'J', 'J', &stateStart , _DtTermSelEraseInDisplay,/* DECSEL */
|
||||
0x00, 0xFF, &stateStart , _DtTermPrintState /* end of table*/
|
||||
};
|
||||
StateTableRec _DtTermStateEscQuestion = {False, esc_question_table, pre_parse_table};
|
||||
|
||||
/*
|
||||
** this is the table used when an Esc ~ has been seen
|
||||
*/
|
||||
static StateEntryRec
|
||||
tilda_table[] =
|
||||
{
|
||||
0x1B, 0x1B,&stateStart,_DtTermInvokeG1, /* LS1R Invoke G1 Char set */
|
||||
0x00, 0xFF, &stateStart , _DtTermPrintState /* end of table */
|
||||
};
|
||||
StateTableRec _DtTermStateTilda = {False, tilda_table, pre_parse_table};
|
||||
|
||||
/*
|
||||
* this is the table used when an DCS p1;p2 | p3/ string Esc has been seen
|
||||
*/
|
||||
static StateEntryRec
|
||||
sk_backslash_table[] =
|
||||
{
|
||||
'\\', '\\',&stateStart, _DtTermParseUserKeyLoadLast, /* ST */
|
||||
0x00, 0xFF, &_DtTermStateIsNextBS_SK, _DtTermPrimParserNextState/*toss*/
|
||||
};
|
||||
StateTableRec _DtTermStateIsNextBS_SK = {False, sk_backslash_table};
|
||||
|
||||
/*
|
||||
** this is the table used when an DCS p1;p2 | p3/ has been seen
|
||||
*/
|
||||
static StateEntryRec
|
||||
user_key_string_table[] =
|
||||
{
|
||||
'0','9', &_DtTermStateUserKeyString, _DtTermParseHexDigit, /*hex digit*/
|
||||
'a','f', &_DtTermStateUserKeyString, _DtTermParseHexDigit, /*hex digit*/
|
||||
'A','F', &_DtTermStateUserKeyString, _DtTermParseHexDigit, /*hex digit*/
|
||||
';', ';', &_DtTermStateUserKey, _DtTermParseUserKeyLoad,/*load string*/
|
||||
0x1B, 0x1B, &_DtTermStateIsNextBS_SK, _DtTermPrimParserNextState,/*Esc*/
|
||||
0x9C, 0x9C, &stateStart, _DtTermParseUserKeyLoadLast, /* ST */
|
||||
0x00, 0xFF, &stateStart , _DtTermPrintState /* end of table */
|
||||
};
|
||||
StateTableRec _DtTermStateUserKeyString = {False, user_key_string_table};
|
||||
|
||||
/*
|
||||
** this is the table used when an DCS p1;p2 | has been seen
|
||||
*/
|
||||
static StateEntryRec
|
||||
softkey_table[] =
|
||||
{
|
||||
'0', '9', &_DtTermStateUserKey, _DtTermEnterNum, /* enter number */
|
||||
'/', '/',&_DtTermStateUserKeyString,_DtTermPrimParserNextState,/*store key*/
|
||||
0x1B, 0x1B, &_DtTermStateIsNextBS_SK, _DtTermPrimParserNextState,/*Esc*/
|
||||
0x9C, 0x9C, &stateStart, _DtTermParseUserKeyLoadLast, /* ST */
|
||||
0x00, 0xFF, &stateStart , _DtTermPrintState /* end of table */
|
||||
};
|
||||
StateTableRec _DtTermStateUserKey = {False, softkey_table};
|
||||
|
||||
/*
|
||||
* this is the table used when an DCS p1;p2 { ..... Esc has been seen
|
||||
*/
|
||||
static StateEntryRec
|
||||
dl_backslash_table[] =
|
||||
{
|
||||
'\\', '\\',&stateStart, _DtTermLoadCharSet, /* ST */
|
||||
0x20,0x7E, &_DtTermStateP, _DtTermPrimParserNextState, /* all text */
|
||||
0x00, 0xFF, &stateStart , _DtTermPrintState /* end of table */
|
||||
};
|
||||
StateTableRec _DtTermStateIsNextBS_DL = {False, dl_backslash_table};
|
||||
|
||||
/*
|
||||
** this is the table used when an DCS (ESC P) p1;p2... { has been seen
|
||||
*/
|
||||
static StateEntryRec
|
||||
dl_char_table[] =
|
||||
{
|
||||
'\\', '\\',&stateStart, _DtTermLoadCharSet , /* ST */
|
||||
0x20,0x7E, &_DtTermStateDLCharSet, _DtTermPrimParserNextState,/* text */
|
||||
0x1B, 0x1B,&_DtTermStateIsNextBS_DL,_DtTermPrimParserNextState,/*end?*/
|
||||
0x9C, 0x9C, &stateStart, _DtTermLoadCharSet, /* C1 string terminator*/
|
||||
0x00, 0xFF, &stateStart , _DtTermPrintState /* end of table */
|
||||
};
|
||||
StateTableRec _DtTermStateDLCharSet = {False, dl_char_table};
|
||||
|
||||
/*
|
||||
** this is the table used when an Esc P (DCS) has been seen
|
||||
*/
|
||||
static StateEntryRec
|
||||
esc_P_table[] =
|
||||
{
|
||||
';', ';', &_DtTermStateP, _DtTermParsePushNum, /*increment count*/
|
||||
'0', '9', &_DtTermStateP, _DtTermEnterNum, /* enter number */
|
||||
'|', '|', &_DtTermStateUserKey, _DtTermParseUserKeyClear, /* DECUDK */
|
||||
'{', '{', &_DtTermStateDLCharSet, _DtTermPrimParserNextState,
|
||||
/* down-line-load char set */
|
||||
0x00, 0xFF, &stateStart , _DtTermPrintState /* end of table */
|
||||
};
|
||||
StateTableRec _DtTermStateP = {False, esc_P_table, pre_parse_table};
|
||||
|
||||
|
||||
/*
|
||||
** this is the table used when an error occurred in an escape sequence
|
||||
*/
|
||||
static StateEntryRec
|
||||
error_table[] =
|
||||
{
|
||||
'A', 'Z', &stateStart, _DtTermPrimParserNextState, /* legal char */
|
||||
0x00, 0xFF, &_DtTermStateError, _DtTermPrimParserNextState /* end */
|
||||
};
|
||||
|
||||
StateTableRec _DtTermStateError = {False, error_table};
|
||||
|
||||
101
cde/lib/DtTerm/Term/TermParseTable.h
Normal file
101
cde/lib/DtTerm/Term/TermParseTable.h
Normal file
@@ -0,0 +1,101 @@
|
||||
/*
|
||||
** $XConsortium: TermParseTable.h /main/1 1996/04/21 19:16:17 drk $
|
||||
*/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _Dt_TermParseTable_h
|
||||
#define _Dt_TermParseTable_h
|
||||
|
||||
extern StateTable _DtTermStateStart;
|
||||
|
||||
extern void _DtTermDeviceStatus(Widget w);
|
||||
extern void _DtTermPrimParserEnterNumAndPush(Widget w) ;
|
||||
extern void _DtTermPrintState(Widget w) ;
|
||||
extern void _DtTermCursorPos(Widget w) ;
|
||||
extern void _DtTermEraseDisplay(Widget w) ;
|
||||
extern void _DtTermInsertChars(Widget w) ;
|
||||
extern void _DtTermCursorUp(Widget w) ;
|
||||
extern void _DtTermCursorDown(Widget w) ;
|
||||
extern void _DtTermCursorForward(Widget w) ;
|
||||
extern void _DtTermCursorBack(Widget w) ;
|
||||
extern void _DtTermCursorToLineUp(Widget w) ;
|
||||
extern void _DtTermCursorToCol(Widget w) ;
|
||||
extern void _DtTermEraseInLine(Widget w) ;
|
||||
extern void _DtTermInsertLines(Widget w) ;
|
||||
extern void _DtTermDeleteLines(Widget w) ;
|
||||
extern void _DtTermDeleteChars(Widget w) ;
|
||||
extern void _DtTermEnterNum(Widget w) ;
|
||||
extern void _DtTermParsePushNum(Widget w) ;
|
||||
extern void _DtTermInvokeG3(Widget w) ;
|
||||
extern void _DtTermInvokeG2(Widget w) ;
|
||||
extern void _DtTermScrollUp(Widget w) ;
|
||||
extern void _DtTermScrollDown(Widget w) ;
|
||||
extern void _DtTermEraseChars(Widget w) ;
|
||||
extern void _DtTermSoftReset(Widget w) ;
|
||||
extern void _DtTermClearParam(Widget w) ;
|
||||
extern void _DtTermDeviceAttributes(Widget w) ;
|
||||
extern void _DtTermTabClear(Widget w) ;
|
||||
extern void _DtTermSetMode(Widget w) ;
|
||||
extern void _DtTermResetMode(Widget w) ;
|
||||
extern void _DtTermCharAttributes(Widget w) ;
|
||||
extern void _DtTermScrollingRegion(Widget w) ;
|
||||
extern void _DtTermRequestParam(Widget w) ;
|
||||
extern void _DtTermPModeSet(Widget w) ;
|
||||
extern void _DtTermPModeReset(Widget w) ;
|
||||
extern void _DtTermRestoreModeValues(Widget w) ;
|
||||
extern void _DtTermSaveModeValues(Widget w) ;
|
||||
extern void _DtTermAlignTest(Widget w);
|
||||
extern void _DtTermInvokeG1(Widget w);
|
||||
extern void _DtTermSelEraseInLine(Widget w); /* vt220 */
|
||||
extern void _DtTermSelEraseInDisplay(Widget w); /* vt220 */
|
||||
extern void _DtTermSaveCursor(Widget w);
|
||||
extern void _DtTermRestoreCursor(Widget w);
|
||||
extern void _DtTermAppKeypad(Widget w);
|
||||
extern void _DtTermNormalKeypad(Widget w);
|
||||
extern void _DtTermIndex(Widget w);
|
||||
extern void _DtTermNextLine(Widget w);
|
||||
extern void _DtTermTabSet(Widget w);
|
||||
extern void _DtTermReverseIndex(Widget w);
|
||||
extern void _DtTermSingleShiftG2(Widget w);
|
||||
extern void _DtTermSingleShiftG3(Widget w);
|
||||
extern void _DtTermDeviceControl(Widget w);
|
||||
extern void _DtTermReset(Widget w);
|
||||
extern void _DtTermSelectG2(Widget w);
|
||||
extern void _DtTermSelectG3(Widget w);
|
||||
extern void _DtTermParseTab(Widget w);
|
||||
extern void _DtTermParseFontShift(Widget w);
|
||||
extern void _DtTermParseFontG0(Widget w);
|
||||
extern void _DtTermParseFontG1(Widget w);
|
||||
extern void _DtTermParseFontG2(Widget w);
|
||||
extern void _DtTermParseFontG3(Widget w);
|
||||
extern void _DtTermParseStatus(Widget w);
|
||||
extern void _DtTermChangeTextParam(Widget w);
|
||||
extern void _DtTermSaveChar(Widget w);
|
||||
extern void _DtTermS7C1T(Widget w);
|
||||
extern void _DtTermS8C1T(Widget w) ;
|
||||
extern void _DtTermSetCharEraseMode(Widget w);
|
||||
extern void _DtTermSingleWide(Widget w);
|
||||
extern void _DtTermDoubleHigh(Widget w);
|
||||
extern void _DtTermDoubleWide(Widget w);
|
||||
extern void _DtTermParseLF(Widget w);
|
||||
extern void _DtTermLoadCharSet(Widget w);
|
||||
extern void _DtTermParseBackspace(Widget w);
|
||||
extern void _DtTermParseUserKeyLoad(Widget w);
|
||||
extern void _DtTermParseUserKeyClear(Widget w);
|
||||
extern void _DtTermParseHexDigit(Widget w);
|
||||
extern void _DtTermSetCompatLevel(Widget w);
|
||||
extern void _DtTermParseUserKeyLoadLast(Widget w);
|
||||
extern void _DtTermParseSunMisc(Widget w);
|
||||
extern void _DtTermParserSunWindowIcon(Widget w);
|
||||
extern void _DtTermParserSunWindowTitle(Widget w);
|
||||
extern void _DtTermParserSunIconFile(Widget w);
|
||||
extern void _DtTermDeviceStatusAnsi(Widget w);
|
||||
|
||||
#endif /* _Dt_TermParseTable_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif... */
|
||||
54
cde/lib/DtTerm/Term/TermParseTableP.h
Normal file
54
cde/lib/DtTerm/Term/TermParseTableP.h
Normal file
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
** $XConsortium: TermParseTableP.h /main/1 1996/04/21 19:16:20 drk $
|
||||
*/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _Dt_TermParseTableP_h
|
||||
#define _Dt_TermParseTableP_h
|
||||
|
||||
#include "TermParseTable.h"
|
||||
|
||||
extern StateTable _DtTermStateStart;
|
||||
extern StateTableRec _vtStateLParen;
|
||||
extern StateTableRec _vtStateRParen;
|
||||
extern StateTableRec _vtStateRParenNum;
|
||||
extern StateTableRec _DtTermStateError;
|
||||
extern StateTableRec _DtTermStatePound;
|
||||
extern StateTableRec _DtTermStateLeftParen;
|
||||
extern StateTableRec _DtTermStateRightParen;
|
||||
extern StateTableRec _DtTermStatePlus;
|
||||
extern StateTableRec _vtStateAsterick;
|
||||
extern StateTableRec _DtTermStateLeftBracket;
|
||||
extern StateTableRec _DtTermStateRightBracket;
|
||||
extern StateTableRec _DtTermStateUpArrow;
|
||||
extern StateTableRec _DtTermStateUnderscore;
|
||||
extern StateTableRec _DtTermStateError;
|
||||
extern StateTableRec _DtTermStateAsterisk;
|
||||
extern StateTableRec _DtTermStateTilda;
|
||||
extern StateTableRec _DtTermStateQuestion;
|
||||
extern StateTableRec _DtTermStateEscape;
|
||||
extern StateTableRec _DtTermStateEscQuestion;
|
||||
extern StateTableRec _DtTermStateP;
|
||||
extern StateTableRec _DtTermStateGetString;
|
||||
extern StateTableRec _DtTermStateC1;
|
||||
extern StateTableRec _DtTermStateDECSCA;
|
||||
extern StateTableRec _DtTermStateSoftReset;
|
||||
extern StateTableRec _DtTermStateSoftKey;
|
||||
extern StateTableRec _DtTermStateDLCharSet;
|
||||
extern StateTableRec _DtTermStateIsNextBS_SK;
|
||||
extern StateTableRec _DtTermStateIsNextBS_DL;
|
||||
extern StateTableRec _DtTermStateUserKeyString;
|
||||
extern StateTableRec _DtTermStateUserKey;
|
||||
extern StateTableRec _DtTermStateGetTitle;
|
||||
extern StateTableRec _DtTermStateGetIcon;
|
||||
extern StateTableRec _DtTermStateGetIconFile;
|
||||
extern StateTableRec _DtTermStateLeftBracketNotQ;
|
||||
|
||||
#endif /* _Dt_TermParseTableP_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif... */
|
||||
165
cde/lib/DtTerm/Term/TermSendEsc.h
Normal file
165
cde/lib/DtTerm/Term/TermSendEsc.h
Normal file
@@ -0,0 +1,165 @@
|
||||
/*
|
||||
* $XConsortium: TermSendEsc.h /main/1 1996/04/21 19:16:23 drk $";
|
||||
*/
|
||||
|
||||
/* *
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp. *
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
|
||||
#ifndef _Dt_TermSendEsc_h
|
||||
#define _Dt_TermSendEsc_h
|
||||
|
||||
/* These are the escape sequences that get sent from dtterm. Some are
|
||||
xterm, some vt220 and some are sun.
|
||||
*/
|
||||
|
||||
/* vt220 cursor movement - normal mode */
|
||||
#define ESC_CURSOR_UP "\033[A"
|
||||
#define ESC_CURSOR_DOWN "\033[B"
|
||||
#define ESC_CURSOR_RIGHT "\033[C"
|
||||
#define ESC_CURSOR_LEFT "\033[D"
|
||||
/* vt220 cursor movement - application mode */
|
||||
#define ESC_CURSOR_UP_APP "\033OA"
|
||||
#define ESC_CURSOR_DOWN_APP "\033OB"
|
||||
#define ESC_CURSOR_RIGHT_APP "\033OC"
|
||||
#define ESC_CURSOR_LEFT_APP "\033OD"
|
||||
/* vt/xterm edit keys */
|
||||
#define ESC_FIND "\033[1~"
|
||||
#define ESC_INSERT_HERE "\033[2~"
|
||||
#define ESC_REMOVE "\033[3~"
|
||||
#define ESC_DELETE "\033[3~"
|
||||
#define ESC_SELECT "\033[4~"
|
||||
#define ESC_PREV_SCREEN "\033[5~"
|
||||
#define ESC_NEXT_SCREEN "\033[6~"
|
||||
#define ESC_HELP "\033[28~"
|
||||
#define ESC_MENU "\033[29~"
|
||||
#define ESC_DO "\033[29~"
|
||||
/* vt function keys */
|
||||
#define F1_VT "\033[11~"
|
||||
#define F2_VT "\033[12~"
|
||||
#define F3_VT "\033[13~"
|
||||
#define F4_VT "\033[14~"
|
||||
#define F5_VT "\033[15~"
|
||||
#define F6_VT "\033[17~"
|
||||
#define F7_VT "\033[18~"
|
||||
#define F8_VT "\033[19~"
|
||||
#define F9_VT "\033[20~"
|
||||
#define F10_VT "\033[21~"
|
||||
#ifdef __osf__
|
||||
/* Temporary work around */
|
||||
#define F11_VT "\033"
|
||||
#else
|
||||
#define F11_VT "\033[23~"
|
||||
#endif /* __osf__ */
|
||||
#define F12_VT "\033[24~"
|
||||
#define F13_VT "\033[25~"
|
||||
#define F14_VT "\033[26~"
|
||||
#define F15_VT "\033[28~"
|
||||
#define F16_VT "\033[29~"
|
||||
#define F17_VT "\033[31~"
|
||||
#define F18_VT "\033[32~"
|
||||
#define F19_VT "\033[33~"
|
||||
#define F20_VT "\033[34~"
|
||||
|
||||
/* SUN edit keys */
|
||||
#define ESC_FIND_SUN "\033[1z"
|
||||
#define ESC_INSERT_HERE_SUN "\033[2z"
|
||||
#define ESC_REMOVE_SUN "\033[3z"
|
||||
#define ESC_DELETE_SUN "\033[3z"
|
||||
#define ESC_SELECT_SUN "\033[4z"
|
||||
#define ESC_PREV_SCREEN_SUN "\033[5z"
|
||||
#define ESC_NEXT_SCREEN_SUN "\033[6z"
|
||||
#define ESC_HELP_SUN "\033[196z"
|
||||
#define ESC_MENU_SUN "\033[197z"
|
||||
#define ESC_DO_SUN "\033[197z"
|
||||
/* SUN function keys */
|
||||
#define F1_VT_SUN "\033[224z"
|
||||
#define F2_VT_SUN "\033[225z"
|
||||
#define F3_VT_SUN "\033[226z"
|
||||
#define F4_VT_SUN "\033[227z"
|
||||
#define F5_VT_SUN "\033[228z"
|
||||
#define F6_VT_SUN "\033[229z"
|
||||
#define F7_VT_SUN "\033[230z"
|
||||
#define F8_VT_SUN "\033[231z"
|
||||
#define F9_VT_SUN "\033[232z"
|
||||
#define F10_VT_SUN "\033[233z"
|
||||
#define F11_VT_SUN "\033[192z"
|
||||
#define F12_VT_SUN "\033[193z"
|
||||
#define F13_VT_SUN "\033[194z"
|
||||
#define F14_VT_SUN "\033[195z"
|
||||
#define F15_VT_SUN "\033[196z"
|
||||
#define F16_VT_SUN "\033[197z"
|
||||
#define F17_VT_SUN "\033[198z"
|
||||
#define F18_VT_SUN "\033[199z"
|
||||
#define F19_VT_SUN "\033[200z"
|
||||
#define F20_VT_SUN "\033[201z"
|
||||
#define F21_VT_SUN "\033[208z"
|
||||
#define F22_VT_SUN "\033[209z"
|
||||
#define F23_VT_SUN "\033[210z"
|
||||
#define F24_VT_SUN "\033[211z"
|
||||
#define F25_VT_SUN "\033[212z"
|
||||
#define F26_VT_SUN "\033[213z"
|
||||
#define F27_VT_SUN "\033[214z"
|
||||
#define F28_VT_SUN "\033[215z"
|
||||
#define F29_VT_SUN "\033[216z"
|
||||
#define F30_VT_SUN "\033[217z"
|
||||
#define F31_VT_SUN "\033[218z"
|
||||
#define F32_VT_SUN "\033[219z"
|
||||
#define F33_VT_SUN "\033[220z"
|
||||
#define F34_VT_SUN "\033[221z"
|
||||
#define F35_VT_SUN "\033[222z"
|
||||
|
||||
#define DT_KP_Space " "
|
||||
#define DT_KP_Tab "\t"
|
||||
#define DT_KP_Enter "\015" /* carriage return */
|
||||
#define DT_KP_F1 "\033OP"
|
||||
#define DT_KP_F2 "\033OQ"
|
||||
#define DT_KP_F3 "\033OR"
|
||||
#define DT_KP_F4 "\033OS"
|
||||
#define DT_KP_Equal "="
|
||||
#define DT_KP_Multiply "*"
|
||||
#define DT_KP_Add "+"
|
||||
#define DT_KP_Separator ","
|
||||
#define DT_KP_Subtract "-"
|
||||
#define DT_KP_Decimal "."
|
||||
#define DT_KP_Divide "/"
|
||||
#define DT_KP_0 "0"
|
||||
#define DT_KP_1 "1"
|
||||
#define DT_KP_2 "2"
|
||||
#define DT_KP_3 "3"
|
||||
#define DT_KP_4 "4"
|
||||
#define DT_KP_5 "5"
|
||||
#define DT_KP_6 "6"
|
||||
#define DT_KP_7 "7"
|
||||
#define DT_KP_8 "8"
|
||||
#define DT_KP_9 "9"
|
||||
|
||||
#define KP_APP_Space "\033OA"
|
||||
#define KP_APP_Tab "\033OI"
|
||||
#define KP_APP_Enter "\033OM"
|
||||
#define KP_APP_F1 "\033OP"
|
||||
#define KP_APP_F2 "\033OQ"
|
||||
#define KP_APP_F3 "\033OR"
|
||||
#define KP_APP_F4 "\033OS"
|
||||
#define KP_APP_Equal "\033OX"
|
||||
#define KP_APP_Multiply "\033Oj"
|
||||
#define KP_APP_Add "\033Ok"
|
||||
#define KP_APP_Separator "\033Ol"
|
||||
#define KP_APP_Subtract "\033Om"
|
||||
#define KP_APP_Decimal "\033On"
|
||||
#define KP_APP_Divide "\033Oo"
|
||||
#define KP_APP_0 "\033Op"
|
||||
#define KP_APP_1 "\033Oq"
|
||||
#define KP_APP_2 "\033Or"
|
||||
#define KP_APP_3 "\033Os"
|
||||
#define KP_APP_4 "\033Ot"
|
||||
#define KP_APP_5 "\033Ou"
|
||||
#define KP_APP_6 "\033Ov"
|
||||
#define KP_APP_7 "\033Ow"
|
||||
#define KP_APP_8 "\033Ox"
|
||||
#define KP_APP_9 "\033Oy"
|
||||
|
||||
#endif /* _Dt_TermSendEsc_h */
|
||||
18
cde/lib/DtTerm/Term/TermVersion.c
Normal file
18
cde/lib/DtTerm/Term/TermVersion.c
Normal file
@@ -0,0 +1,18 @@
|
||||
/* $XConsortium: TermVersion.c /main/2 1996/08/30 15:24:52 drk $
|
||||
*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1993,1994,1996 Hewlett-Packard Company.
|
||||
* (c) Copyright 1993,1994,1996 International Business Machines Corp.
|
||||
* (c) Copyright 1993,1994,1996 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1993,1994,1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
|
||||
#include <include/hpversion.h>
|
||||
|
||||
#ifndef lint
|
||||
version_tag("dtterm1.0: $XConsortium: TermVersion.c /main/2 1996/08/30 15:24:52 drk $")
|
||||
#endif /* lint */
|
||||
|
||||
char _DtTermPullInTermWhatString[] = "";
|
||||
Reference in New Issue
Block a user