home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
x
/
volume12
/
kterm
/
part07
< prev
next >
Wrap
Internet Message Format
|
1991-05-08
|
52KB
Path: uunet!wuarchive!cs.utexas.edu!convex!central!newstop!male!jethro!exodus!NMSU.Edu!mleisher
From: mleisher@NMSU.Edu
Newsgroups: comp.sources.x
Subject: v12i088: kterm - kanji xterm, Part07/18
Message-ID: <12972@exodus.Eng.Sun.COM>
Date: 8 May 91 02:39:29 GMT
References: <csx-12i082:kterm@uunet.UU.NET>
Sender: news@exodus.Eng.Sun.COM
Lines: 1808
Approved: argv@sun.com
Submitted-by: mleisher@NMSU.Edu
Posting-number: Volume 12, Issue 88
Archive-name: kterm/part07
#!/bin/sh
# this is kt412.07 (part 7 of kterm-4.1.2)
# do not concatenate these parts, unpack them in order with /bin/sh
# file kterm-4.1.2/charproc.c continued
#
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck
if test "$Scheck" != 7; then
echo Please unpack part "$Scheck" next!
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping kterm-4.1.2/charproc.c'
else
echo 'x - continuing file kterm-4.1.2/charproc.c'
sed 's/^X//' << 'SHAR_EOF' >> 'kterm-4.1.2/charproc.c' &&
X XtOffset(XtermWidget, misc.hg_m), XtRString,
X (caddr_t) NULL},
{XtNhangulNtoKSTable, XtCHangulNtoKSTable, XtRString, sizeof(char *),
X XtOffset(XtermWidget, misc.hg_n2ks_tbl), XtRString,
X (caddr_t) NULL},
# endif /* KTERM_HANGUL */
{XtNlineSpace, XtCLineSpace, XtRInt, sizeof(int),
X XtOffset(XtermWidget, screen.linespace),
X XtRInt, (caddr_t) &defaultLineSpace},
#else /* !KTERM */
{XtNfont, XtCFont, XtRString, sizeof(char *),
X XtOffset(XtermWidget, misc.f_n), XtRString,
X DEFFONT},
{XtNboldFont, XtCFont, XtRString, sizeof(char *),
X XtOffset(XtermWidget, misc.f_b), XtRString,
X DEFBOLDFONT},
#endif /* !KTERM */
{XtNc132, XtCC132, XtRBoolean, sizeof(Boolean),
X XtOffset(XtermWidget, screen.c132),
X XtRBoolean, (caddr_t) &defaultFALSE},
{XtNcharClass, XtCCharClass, XtRString, sizeof(char *),
X XtOffset(XtermWidget, screen.charClass),
X XtRString, (caddr_t) NULL},
{XtNcurses, XtCCurses, XtRBoolean, sizeof(Boolean),
X XtOffset(XtermWidget, screen.curses),
X XtRBoolean, (caddr_t) &defaultFALSE},
{XtNcutNewline, XtCCutNewline, XtRBoolean, sizeof(Boolean),
X XtOffset(XtermWidget, screen.cutNewline),
X XtRBoolean, (caddr_t) &defaultTRUE},
{XtNcutToBeginningOfLine, XtCCutToBeginningOfLine, XtRBoolean, sizeof(Boolean),
X XtOffset(XtermWidget, screen.cutToBeginningOfLine),
X XtRBoolean, (caddr_t) &defaultTRUE},
{XtNbackground, XtCBackground, XtRPixel, sizeof(Pixel),
X XtOffset(XtermWidget, core.background_pixel),
X XtRString, "XtDefaultBackground"},
{XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),
X XtOffset(XtermWidget, screen.foreground),
X XtRString, "XtDefaultForeground"},
{XtNcursorColor, XtCForeground, XtRPixel, sizeof(Pixel),
X XtOffset(XtermWidget, screen.cursorcolor),
X XtRString, "XtDefaultForeground"},
#ifdef COLOR_TEXT /* mukawa */
{XtNcolor0, XtCForeground, XtRPixel, sizeof(Pixel),
X XtOffset(XtermWidget, screen.textcolor[0]),
X XtRString, "XtDefaultForeground"},
{XtNcolor1, XtCForeground, XtRPixel, sizeof(Pixel),
X XtOffset(XtermWidget, screen.textcolor[1]),
X XtRString, "XtDefaultForeground"},
{XtNcolor2, XtCForeground, XtRPixel, sizeof(Pixel),
X XtOffset(XtermWidget, screen.textcolor[2]),
X XtRString, "XtDefaultForeground"},
{XtNcolor3, XtCForeground, XtRPixel, sizeof(Pixel),
X XtOffset(XtermWidget, screen.textcolor[3]),
X XtRString, "XtDefaultForeground"},
{XtNcolor4, XtCForeground, XtRPixel, sizeof(Pixel),
X XtOffset(XtermWidget, screen.textcolor[4]),
X XtRString, "XtDefaultForeground"},
{XtNcolor5, XtCForeground, XtRPixel, sizeof(Pixel),
X XtOffset(XtermWidget, screen.textcolor[5]),
X XtRString, "XtDefaultForeground"},
{XtNcolor6, XtCForeground, XtRPixel, sizeof(Pixel),
X XtOffset(XtermWidget, screen.textcolor[6]),
X XtRString, "XtDefaultForeground"},
{XtNcolor7, XtCForeground, XtRPixel, sizeof(Pixel),
X XtOffset(XtermWidget, screen.textcolor[7]),
X XtRString, "XtDefaultForeground"},
#endif /* COLOR_TEXT */
{XtNeightBitInput, XtCEightBitInput, XtRBoolean, sizeof(Boolean),
X XtOffset(XtermWidget, screen.eight_bits),
X XtRBoolean, (caddr_t) &defaultTRUE},
{XtNgeometry,XtCGeometry, XtRString, sizeof(char *),
X XtOffset(XtermWidget, misc.geo_metry),
X XtRString, (caddr_t) NULL},
{XtNalwaysHighlight,XtCAlwaysHighlight,XtRBoolean,
X sizeof(Boolean),XtOffset(XtermWidget, screen.always_highlight),
X XtRBoolean, (caddr_t) &defaultFALSE},
{XtNtekGeometry,XtCGeometry, XtRString, sizeof(char *),
X XtOffset(XtermWidget, misc.T_geometry),
X XtRString, (caddr_t) NULL},
{XtNinternalBorder,XtCBorderWidth,XtRInt, sizeof(int),
X XtOffset(XtermWidget, screen.border),
X XtRInt, (caddr_t) &defaultIntBorder},
{XtNjumpScroll, XtCJumpScroll, XtRBoolean, sizeof(Boolean),
X XtOffset(XtermWidget, screen.jumpscroll),
X XtRBoolean, (caddr_t) &defaultTRUE},
{XtNlogFile, XtCLogfile, XtRString, sizeof(char *),
X XtOffset(XtermWidget, screen.logfile),
X XtRString, (caddr_t) NULL},
{XtNlogging, XtCLogging, XtRBoolean, sizeof(Boolean),
X XtOffset(XtermWidget, misc.log_on),
X XtRBoolean, (caddr_t) &defaultFALSE},
{XtNlogInhibit, XtCLogInhibit, XtRBoolean, sizeof(Boolean),
X XtOffset(XtermWidget, misc.logInhibit),
X XtRBoolean, (caddr_t) &defaultFALSE},
{XtNloginShell, XtCLoginShell, XtRBoolean, sizeof(Boolean),
X XtOffset(XtermWidget, misc.login_shell),
X XtRBoolean, (caddr_t) &defaultFALSE},
{XtNmarginBell, XtCMarginBell, XtRBoolean, sizeof(Boolean),
X XtOffset(XtermWidget, screen.marginbell),
X XtRBoolean, (caddr_t) &defaultFALSE},
{XtNpointerColor, XtCForeground, XtRPixel, sizeof(Pixel),
X XtOffset(XtermWidget, screen.mousecolor),
X XtRString, "XtDefaultForeground"},
{XtNpointerColorBackground, XtCBackground, XtRPixel, sizeof(Pixel),
X XtOffset(XtermWidget, screen.mousecolorback),
X XtRString, "XtDefaultBackground"},
{XtNpointerShape,XtCCursor, XtRCursor, sizeof(Cursor),
X XtOffset(XtermWidget, screen.pointer_cursor),
X XtRString, (caddr_t) "xterm"},
{XtNmultiClickTime,XtCMultiClickTime, XtRInt, sizeof(int),
X XtOffset(XtermWidget, screen.multiClickTime),
X XtRInt, (caddr_t) &defaultMultiClickTime},
{XtNmultiScroll,XtCMultiScroll, XtRBoolean, sizeof(Boolean),
X XtOffset(XtermWidget, screen.multiscroll),
X XtRBoolean, (caddr_t) &defaultFALSE},
{XtNnMarginBell,XtCColumn, XtRInt, sizeof(int),
X XtOffset(XtermWidget, screen.nmarginbell),
X XtRInt, (caddr_t) &defaultNMarginBell},
{XtNreverseVideo,XtCReverseVideo,XtRBoolean, sizeof(Boolean),
X XtOffset(XtermWidget, misc.re_verse),
X XtRBoolean, (caddr_t) &defaultFALSE},
{XtNreverseWrap,XtCReverseWrap, XtRBoolean, sizeof(Boolean),
X XtOffset(XtermWidget, misc.reverseWrap),
X XtRBoolean, (caddr_t) &defaultFALSE},
{XtNsaveLines, XtCSaveLines, XtRInt, sizeof(int),
X XtOffset(XtermWidget, screen.savelines),
X XtRInt, (caddr_t) &defaultSaveLines},
{XtNscrollBar, XtCScrollBar, XtRBoolean, sizeof(Boolean),
X XtOffset(XtermWidget, misc.scrollbar),
X XtRBoolean, (caddr_t) &defaultFALSE},
{XtNscrollTtyOutput,XtCScrollCond, XtRBoolean, sizeof(Boolean),
X XtOffset(XtermWidget, screen.scrollttyoutput),
X XtRBoolean, (caddr_t) &defaultTRUE},
{XtNscrollKey, XtCScrollCond, XtRBoolean, sizeof(Boolean),
X XtOffset(XtermWidget, screen.scrollkey),
X XtRBoolean, (caddr_t) &defaultFALSE},
{XtNscrollLines, XtCScrollLines, XtRInt, sizeof(int),
X XtOffset(XtermWidget, screen.scrolllines),
X XtRInt, (caddr_t) &defaultScrollLines},
{XtNsignalInhibit,XtCSignalInhibit,XtRBoolean, sizeof(Boolean),
X XtOffset(XtermWidget, misc.signalInhibit),
X XtRBoolean, (caddr_t) &defaultFALSE},
#ifdef STATUSLINE
{XtNstatusLine, XtCStatusLine, XtRBoolean, sizeof(Boolean),
X XtOffset(XtermWidget, screen.statusline),
X XtRBoolean, (caddr_t) &defaultFALSE},
{XtNstatusNormal, XtCStatusNormal, XtRBoolean, sizeof(Boolean),
X XtOffset(XtermWidget, misc.statusnormal),
X XtRBoolean, (caddr_t) &defaultFALSE},
#endif /* STATUSLINE */
{XtNtekInhibit, XtCTekInhibit, XtRBoolean, sizeof(Boolean),
X XtOffset(XtermWidget, misc.tekInhibit),
X XtRBoolean, (caddr_t) &defaultFALSE},
{XtNtekSmall, XtCTekSmall, XtRBoolean, sizeof(Boolean),
X XtOffset(XtermWidget, misc.tekSmall),
X XtRBoolean, (caddr_t) &defaultFALSE},
{XtNtekStartup, XtCTekStartup, XtRBoolean, sizeof(Boolean),
X XtOffset(XtermWidget, screen.TekEmu),
X XtRBoolean, (caddr_t) &defaultFALSE},
{XtNtiteInhibit, XtCTiteInhibit, XtRBoolean, sizeof(Boolean),
X XtOffset(XtermWidget, misc.titeInhibit),
X XtRBoolean, (caddr_t) &defaultFALSE},
{XtNvisualBell, XtCVisualBell, XtRBoolean, sizeof(Boolean),
X XtOffset(XtermWidget, screen.visualbell),
X XtRBoolean, (caddr_t) &defaultFALSE},
{XtNallowSendEvents, XtCAllowSendEvents, XtRBoolean, sizeof(Boolean),
X XtOffset(XtermWidget, screen.allowSendEvents),
X XtRBoolean, (caddr_t) &defaultFALSE},
#ifdef KTERM
{"fontList1", "FontList1", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen.menu_font_list[fontMenu_font1]),
X XtRString, (caddr_t) NULL},
{"fontList2", "FontList2", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen.menu_font_list[fontMenu_font2]),
X XtRString, (caddr_t) NULL},
{"fontList3", "FontList3", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen.menu_font_list[fontMenu_font3]),
X XtRString, (caddr_t) NULL},
{"fontList4", "FontList4", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen.menu_font_list[fontMenu_font4]),
X XtRString, (caddr_t) NULL},
{"boldFontList1", "FontList1", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen.menu_bfont_list[fontMenu_font1]),
X XtRString, (caddr_t) NULL},
{"boldFontList2", "FontList2", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen.menu_bfont_list[fontMenu_font2]),
X XtRString, (caddr_t) NULL},
{"boldFontList3", "FontList3", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen.menu_bfont_list[fontMenu_font3]),
X XtRString, (caddr_t) NULL},
{"boldFontList4", "FontList4", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen.menu_bfont_list[fontMenu_font4]),
X XtRString, (caddr_t) NULL},
{"font1", "Font1", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_font_names[F_ISO8859_1][fontMenu_font1]),
X XtRString, (caddr_t) NULL},
{"font2", "Font2", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_font_names[F_ISO8859_1][fontMenu_font2]),
X XtRString, (caddr_t) NULL},
{"font3", "Font3", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_font_names[F_ISO8859_1][fontMenu_font3]),
X XtRString, (caddr_t) NULL},
{"font4", "Font4", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_font_names[F_ISO8859_1][fontMenu_font4]),
X XtRString, (caddr_t) NULL},
{"boldFont1", "Font1", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_bfont_names[F_ISO8859_1][fontMenu_font1]),
X XtRString, (caddr_t) NULL},
{"boldFont2", "Font2", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_bfont_names[F_ISO8859_1][fontMenu_font2]),
X XtRString, (caddr_t) NULL},
{"boldFont3", "Font3", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_bfont_names[F_ISO8859_1][fontMenu_font3]),
X XtRString, (caddr_t) NULL},
{"boldFont4", "Font4", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_bfont_names[F_ISO8859_1][fontMenu_font4]),
X XtRString, (caddr_t) NULL},
{"romanKanaFont1", "RomanKanaFont1", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_font_names[F_JISX0201_0][fontMenu_font1]),
X XtRString, (caddr_t) NULL},
{"romanKanaFont2", "RomanKanaFont2", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_font_names[F_JISX0201_0][fontMenu_font2]),
X XtRString, (caddr_t) NULL},
{"romanKanaFont3", "RomanKanaFont3", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_font_names[F_JISX0201_0][fontMenu_font3]),
X XtRString, (caddr_t) NULL},
{"romanKanaFont4", "RomanKanaFont4", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_font_names[F_JISX0201_0][fontMenu_font4]),
X XtRString, (caddr_t) NULL},
{"romanKanaBoldFont1", "RomanKanaFont1", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_bfont_names[F_JISX0201_0][fontMenu_font1]),
X XtRString, (caddr_t) NULL},
{"romanKanaBoldFont2", "RomanKanaFont2", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_bfont_names[F_JISX0201_0][fontMenu_font2]),
X XtRString, (caddr_t) NULL},
{"romanKanaBoldFont3", "RomanKanaFont3", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_bfont_names[F_JISX0201_0][fontMenu_font3]),
X XtRString, (caddr_t) NULL},
{"romanKanaBoldFont4", "RomanKanaFont4", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_bfont_names[F_JISX0201_0][fontMenu_font4]),
X XtRString, (caddr_t) NULL},
# ifdef KTERM_KANJI
{"kanjiFont1", "KanjiFont1", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_font_names[F_JISX0208_0][fontMenu_font1]),
X XtRString, (caddr_t) NULL},
{"kanjiFont2", "KanjiFont2", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_font_names[F_JISX0208_0][fontMenu_font2]),
X XtRString, (caddr_t) NULL},
{"kanjiFont3", "KanjiFont3", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_font_names[F_JISX0208_0][fontMenu_font3]),
X XtRString, (caddr_t) NULL},
{"kanjiFont4", "KanjiFont4", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_font_names[F_JISX0208_0][fontMenu_font4]),
X XtRString, (caddr_t) NULL},
{"kanjiBoldFont1", "KanjiFont1", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_bfont_names[F_JISX0208_0][fontMenu_font1]),
X XtRString, (caddr_t) NULL},
{"kanjiBoldFont2", "KanjiFont2", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_bfont_names[F_JISX0208_0][fontMenu_font2]),
X XtRString, (caddr_t) NULL},
{"kanjiBoldFont3", "KanjiFont3", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_bfont_names[F_JISX0208_0][fontMenu_font3]),
X XtRString, (caddr_t) NULL},
{"kanjiBoldFont4", "KanjiFont4", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_bfont_names[F_JISX0208_0][fontMenu_font4]),
X XtRString, (caddr_t) NULL},
# endif /* KTERM_KANJI */
# ifdef KTERM_HANZI
{"hanziFont1", "HanziFont1", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_font_names[F_GB2312_0][fontMenu_font1]),
X XtRString, (caddr_t) NULL},
{"hanziFont2", "HanziFont2", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_font_names[F_GB2312_0][fontMenu_font2]),
X XtRString, (caddr_t) NULL},
{"hanziFont3", "HanziFont3", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_font_names[F_GB2312_0][fontMenu_font3]),
X XtRString, (caddr_t) NULL},
{"hanziFont4", "HanziFont4", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_font_names[F_GB2312_0][fontMenu_font4]),
X XtRString, (caddr_t) NULL},
{"hanziBoldFont1", "HanziFont1", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_bfont_names[F_GB2312_0][fontMenu_font1]),
X XtRString, (caddr_t) NULL},
{"hanziBoldFont2", "HanziFont2", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_bfont_names[F_GB2312_0][fontMenu_font2]),
X XtRString, (caddr_t) NULL},
{"hanziBoldFont3", "HanziFont3", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_bfont_names[F_GB2312_0][fontMenu_font3]),
X XtRString, (caddr_t) NULL},
{"hanziBoldFont4", "HanziFont4", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_bfont_names[F_GB2312_0][fontMenu_font4]),
X XtRString, (caddr_t) NULL},
# endif /* KTERM_HANZI */
# ifdef KTERM_HANGUL
{"hangulFont1", "HangulFont1", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_font_names[F_KSC5601_0][fontMenu_font1]),
X XtRString, (caddr_t) NULL},
{"hangulFont2", "HangulFont2", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_font_names[F_KSC5601_0][fontMenu_font2]),
X XtRString, (caddr_t) NULL},
{"hangulFont3", "HangulFont3", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_font_names[F_KSC5601_0][fontMenu_font3]),
X XtRString, (caddr_t) NULL},
{"hangulFont4", "HangulFont4", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_font_names[F_KSC5601_0][fontMenu_font4]),
X XtRString, (caddr_t) NULL},
{"hangulBoldFont1", "HangulFont1", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_bfont_names[F_KSC5601_0][fontMenu_font1]),
X XtRString, (caddr_t) NULL},
{"hangulBoldFont2", "HangulFont2", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_bfont_names[F_KSC5601_0][fontMenu_font2]),
X XtRString, (caddr_t) NULL},
{"hangulBoldFont3", "HangulFont3", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_bfont_names[F_KSC5601_0][fontMenu_font3]),
X XtRString, (caddr_t) NULL},
{"hangulBoldFont4", "HangulFont4", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen._menu_bfont_names[F_KSC5601_0][fontMenu_font4]),
X XtRString, (caddr_t) NULL},
# endif /* KTERM_HANGUL */
#else /* !KTERM */
{"font1", "Font1", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen.menu_font_names[fontMenu_font1]),
X XtRString, (caddr_t) NULL},
{"font2", "Font2", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen.menu_font_names[fontMenu_font2]),
X XtRString, (caddr_t) NULL},
{"font3", "Font3", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen.menu_font_names[fontMenu_font3]),
X XtRString, (caddr_t) NULL},
{"font4", "Font4", XtRString, sizeof(String),
X XtOffset(XtermWidget, screen.menu_font_names[fontMenu_font4]),
X XtRString, (caddr_t) NULL},
#endif /* !KTERM */
};
X
X
static void VTInitialize(), VTRealize(), VTExpose(), VTResize();
static void VTDestroy();
X
WidgetClassRec xtermClassRec = {
X {
/* core_class fields */
X /* superclass */ (WidgetClass) &widgetClassRec,
X /* class_name */ "VT100",
X /* widget_size */ sizeof(XtermWidgetRec),
X /* class_initialize */ NULL,
X /* class_part_initialize */ NULL,
X /* class_inited */ FALSE,
X /* initialize */ VTInitialize,
X /* initialize_hook */ NULL,
X /* realize */ VTRealize,
X /* actions */ actionsList,
X /* num_actions */ XtNumber(actionsList),
X /* resources */ resources,
X /* num_resources */ XtNumber(resources),
X /* xrm_class */ NULLQUARK,
X /* compress_motion */ TRUE,
X /* compress_exposure */ FALSE,
X /* compress_enterleave */ TRUE,
X /* visible_interest */ FALSE,
X /* destroy */ VTDestroy,
X /* resize */ VTResize,
X /* expose */ VTExpose,
X /* set_values */ NULL,
X /* set_values_hook */ NULL,
X /* set_values_almost */ NULL,
X /* get_values_hook */ NULL,
X /* accept_focus */ NULL,
X /* version */ XtVersion,
X /* callback_offsets */ NULL,
X /* tm_table */ defaultTranslations,
X /* query_geometry */ XtInheritQueryGeometry,
X /* display_accelerator*/ XtInheritDisplayAccelerator,
X /* extension */ NULL
X }
};
X
WidgetClass xtermWidgetClass = (WidgetClass)&xtermClassRec;
X
#ifdef KTERM
X
/*
X * Added as replacement for FNUM(gs) define in ptyx.h.
X * M. Leisher
X */
int fontno(gs)
int gs;
{
X switch(gs) {
#ifdef KTERM_KANJI
X case GSET_KANJI:
X case GSET_OLDKANJI:
X return(F_JISX0208_0);
X break;
#endif /* KTERM_KANJI */
X case GSET_JISROMAN:
X case GSET_KANA:
X return(F_JISX0201_0);
X break;
#ifdef KTERM_HANZI
X case GSET_HANZI:
X return(F_GB2312_0);
X break;
#endif /* KTERM_HANZI */
#ifdef KTERM_HANGUL
X case GSET_HANGUL:
X return(F_KSC5601_0);
X break;
#endif /* KTERM_HANGUL */
X }
X return(F_ISO8859_1);
}
X
/*
X * screen - screen
X * fnum - font number
X * type - BOLD or 0
X */
int
FontType(screen, fnum, bold)
TScreen *screen;
int fnum, bold;
{
X XFontStruct *ft;
X
X if (bold)
X ft = screen->_fnt_bold[fnum];
X else
X ft = screen->_fnt_norm[fnum];
X
X if (!ft)
X return(NONE);
X if (!ft->min_byte1 && !ft->max_byte1)
X return(NONE);
X if (ft->min_byte1 < 0x80 && ft->min_char_or_byte2 < 0x80)
X return(LOW);
X if (ft->min_byte1 > 0x80 && ft->min_char_or_byte2 > 0x80)
X return(HIGH);
X if (ft->min_byte1 > 0x80 && ft->min_char_or_byte2 < 0x80)
X return(MIXED);
}
X
doSS(gset)
short gset;
{
X Char dotextbuf[2];
X register Char c, min, max;
X register Char *cp = bptr;
X register Char *dcp = dotextbuf;
X
X if (gset & CS96) {
X min = 0x20; max = 0x7f;
X } else {
X min = 0x21; max = 0x7e;
X }
X if (*cp & 0x80) {
X min |= 0x80; max |= 0x80;
X }
# ifdef KTERM_KANJI
X if (gset & MBCS) {
X if (bcnt == 1) {
X c = *cp;
X if (min <= c && c <= max) {
X pending_byte = c;
X bcnt = 0;
X return;
X }
X } else {
X /* first byte */
X c = *cp++;
X if (c < min || max < c) {
X cp--;
X goto end;
X }
X *dcp++ = c;
X /* second byte */
X c = *cp++;
X if (c < min || max < c) {
X /*
X * Incomplete multi-byte character.
X * Skip its first byte.
X */
X dcp--;
X cp--;
X goto end;
X }
X *dcp++ = c;
X dotext(&term->screen, term->flags, gset, dotextbuf, dcp);
X }
X } else
# endif /* KTERM_KANJI */
X {
X min &= 0xa0;
X c = *cp++;
X if (c < min || max < c) {
X cp--;
X goto end;
X }
X *dcp++ = c;
X dotext(&term->screen, term->flags, gset, dotextbuf, dcp);
X }
X end:
X /*
X * process SPACE or DEL characters in 94chars gset string.
X */
X if (c < min || max < c) {
X if ((c & ~0x80) == 0x20) {
X dcp = dotextbuf;
X cp++;
X *dcp++ = c;
X dotext(&term->screen, term->flags, gset, dotextbuf, dcp);
X } else if ((c & ~0x80) == 0x7f) {
X cp++;
X }
X }
X bcnt -= cp - bptr;
X bptr = cp;
}
X
# if defined(KTERM_HANZI) || defined(KTERM_HANGUL)
X
doLS(gset)
short gset;
{
X Char dotextbuf[TEXT_BUF_SIZE];
X register int top;
X register Char c, c1, min, max, min2, max1;
X register Char *cp = bptr;
X register Char *dcp = dotextbuf;
X Char oc, oc1;
X char lang = term->misc.lang[0];
X int hzftype = FontType(&term->screen, F_GB2312_0, 0);
X int ftype = FontType(&term->screen, FNUM(gset), 0);
X
X switch(lang) {
#ifdef KTERM_HANZI
X case 'c': case 'C':
X if ((gset & MBCS) && (gset != GSET_HANZI))
X gset &= ~MBCS;
X break;
#endif /* KTERM_HANZI */
#ifdef KTERM_HANGUL
X case 'k': case 'K':
X if ((gset & MBCS) && (gset != GSET_HANGUL))
X gset &= ~MBCS;
X break;
#endif /* KTERM_HANGUL */
X default:
X if ((gset & MBCS) && (gset != GSET_KANJI && gset != GSET_OLDKANJI))
X gset &= ~MBCS;
X break;
X }
X
X if (gset & CS96) {
X min = 0x20; max = 0x7f;
X } else {
X min = 0x21; max = 0x7e;
X }
X if (*cp & 0x80) {
X min |= 0x80; max |= 0x80;
X }
X
X min2 = min;
X max1 = max;
X if ((term->flags & BIG5_HANZI) || hzftype == MIXED) {
X max1 = 0xf9; /* Max byte1 for BIG5 */
X min2 = 0x40; /* Min byte2 for BIG5 */
X }
X
X if (gset & MBCS) {
X if (bcnt == 1) {
X c = *cp;
X if (min <= c && c <= max) {
X pending_byte = c;
X bcnt = 0;
X return;
X }
X } else {
X top = (bcnt >TEXT_BUF_SIZE ? TEXT_BUF_SIZE : bcnt) / 2;
X while (top > 0) {
X /* first byte */
X c = *cp++;
X
X /*
X * Handle BIG5 special case by allowing out of range
X * first bytes through so it gets converted to box
X * char in converter() stage
X */
X if (c < min || max1 < c && !(term->flags & BIG5_HANZI)) {
X cp--;
X break;
X }
X /* second byte */
X c1 = *cp++;
X if (c1 < min2 || max < c1) {
X /*
X * Incomplete multi-byte character.
X * Skip its first byte.
X */
X *dcp = c;
X cp--;
X break;
X }
X
X /*
X * Catch 7-bit stuff using an 8-bit font.
X * Example:
X * 7-bit GuoBiao text
X * JIS Kanji with EUC encoded font.
X */
X if (ftype == HIGH) {
X c |= 0x80;
X c1 |= 0x80;
X }
X
X oc = c; oc1 = c1;
X if (hzftype == MIXED && !(term->flags & BIG5_HANZI))
X
X hzconvert(GBtoBIG,c,c1,&oc,&oc1);
X
X else if (hzftype != MIXED && (term->flags & BIG5_HANZI))
X
X /* We know we have a GB font and
X BIG5 format chars */
X hzconvert(BIGtoGB,c,c1,&oc,&oc1);
X
X *dcp++ = oc;
X *dcp++ = oc1;
X top--;
X }
X dotext(&term->screen, term->flags, gset, dotextbuf, dcp);
X }
X } else {
X min &= 0xa0;
X top = bcnt > TEXT_BUF_SIZE ? TEXT_BUF_SIZE : bcnt;
X while (top > 0) {
X c = *cp++;
X if (c < min || max < c) {
X cp--;
X break;
X }
X *dcp++ = c;
X top--;
X }
X dotext(&term->screen, term->flags, gset, dotextbuf, dcp);
X }
X /*
X * process SPACE or DEL characters in 94chars gset string.
X */
X if (c < min || max < c) {
X if ((c & ~0x80) == 0x20) {
X dcp = dotextbuf;
X top = bcnt > TEXT_BUF_SIZE ? TEXT_BUF_SIZE : bcnt;
X while (top > 0 && *cp == c) {
X *dcp++ = c;
X cp++; top--;
X }
X dotext(&term->screen, term->flags, GSET_ASCII, dotextbuf, dcp);
X } else if ((c & ~0x80) == 0x7f) {
X top = bcnt > TEXT_BUF_SIZE ? TEXT_BUF_SIZE : bcnt;
X while (top > 0 && *cp == c) {
X cp++; top--;
X }
X }
X }
X bcnt -= cp - bptr;
X bptr = cp;
}
X
#ifdef KTERM_HANGUL
doKSH()
{
X Char dotextbuf[TEXT_BUF_SIZE];
X register int top;
X register Char HI, LO;
X register Char *cp = bptr;
X register Char *dcp = dotextbuf;
X unsigned char c1, c2, oc1, oc2;
X
# define KSH1(c) ((c == 0xA4 || (0xB0 <= c && c <= 0xC8)))
# define KSH2(c) (0xA1 <= c && c <= 0xFE)
X if (bcnt == 1) {
X pending_byte = *cp;
X bcnt = 0;
X return;
X }
X top = (bcnt > TEXT_BUF_SIZE ? TEXT_BUF_SIZE : bcnt) / 2;
X while (top > 0) {
X HI = *cp++;
X if (!KSH1(HI)) {
X cp--;
X break;
X }
X LO = *cp++;
X if (!KSH2(LO)) {
X /*
X * Incomplete shift-gb character.
X * Skip its first byte.
X */
X cp--;
X break;
X }
X *dcp++ = HI;
X *dcp++ = LO;
X top--;
X }
X dotext(&term->screen, term->flags, GSET_HANGUL, dotextbuf, dcp);
X bcnt -= cp - bptr;
X bptr = cp;
}
X
doNBH()
{
X Char dotextbuf[TEXT_BUF_SIZE];
X register int top, kslen;
X register Char *cp = bptr;
X unsigned char *dcp = dotextbuf;
X int nblen;
X
X if (bcnt == 1) {
X pending_byte = *cp;
X bcnt = 0;
X return;
X }
X top = (bcnt > TEXT_BUF_SIZE ? TEXT_BUF_SIZE : bcnt);
X kslen = hgconvert(cp, &dcp, &nblen);
X dcp += kslen;
X cp += nblen;
X dotext(&term->screen, term->flags, GSET_HANGUL, dotextbuf, dcp);
X bcnt -= cp - bptr;
X bptr = cp;
}
#endif /* KTERM_HANGUL */
X
doSGB()
{
X Char dotextbuf[TEXT_BUF_SIZE];
X register int top;
X register Char HI, LO;
X register Char *cp = bptr;
X register Char *dcp = dotextbuf;
X unsigned char c1, c2, oc1, oc2;
X
# define SGB1(c) ((0x81 <= c && c <= 0xAF))
# define SGB2(c) (0x40 <= c && c <= 0xFC && c != 0x7F)
X if (bcnt == 1) {
X pending_byte = *cp;
X bcnt = 0;
X return;
X }
X top = (bcnt > TEXT_BUF_SIZE ? TEXT_BUF_SIZE : bcnt) / 2;
X while (top > 0) {
X HI = *cp++;
X if (!SGB1(HI)) {
X cp--;
X break;
X }
X LO = *cp++;
X if (!SGB2(LO)) {
X /*
X * Incomplete shift-gb character.
X * Skip its first byte.
X */
X cp--;
X break;
X }
X c1 = HI;
X c2 = LO;
X if (FontType(&term->screen, F_GB2312_0, 0) == MIXED)
X hzconvert(SGBtoBIG,c1,c2,&oc1,&oc2);
X else
X hzconvert(SGBtoGB,c1,c2,&oc1,&oc2);
X *dcp++ = oc1;
X *dcp++ = oc2;
X top--;
X }
X dotext(&term->screen, term->flags, GSET_HANZI, dotextbuf, dcp);
X bcnt -= cp - bptr;
X bptr = cp;
}
# else /* !KTERM_HANZI && !KTERM_HANGUL */
X
doLS(gset)
short gset;
{
X Char dotextbuf[TEXT_BUF_SIZE];
X register int top;
X register Char c, min, max;
X register Char *cp = bptr;
X register Char *dcp = dotextbuf;
X
X if (gset & CS96) {
X min = 0x20; max = 0x7f;
X } else {
X min = 0x21; max = 0x7e;
X }
X if (*cp & 0x80) {
X min |= 0x80; max |= 0x80;
X }
# ifdef KTERM_KANJI
X if (gset & MBCS) {
X if (bcnt == 1) {
X c = *cp;
X if (min <= c && c <= max) {
X pending_byte = c;
X bcnt = 0;
X return;
X }
X } else {
X top = (bcnt >TEXT_BUF_SIZE ? TEXT_BUF_SIZE : bcnt) / 2;
X while (top > 0) {
X /* first byte */
X c = *cp++;
X if (c < min || max < c) {
X cp--;
X break;
X }
X *dcp++ = c;
X /* second byte */
X c = *cp++;
X if (c < min || max < c) {
X /*
X * Incomplete multi-byte character.
X * Skip its first byte.
X */
X dcp--;
X cp--;
X break;
X }
X *dcp++ = c;
X top--;
X }
X dotext(&term->screen, term->flags, gset, dotextbuf, dcp);
X }
X } else
# endif /* KTERM_KANJI */
X {
X min &= 0xa0;
X top = bcnt > TEXT_BUF_SIZE ? TEXT_BUF_SIZE : bcnt;
X while (top > 0) {
X c = *cp++;
X if (c < min || max < c) {
X cp--;
X break;
X }
X *dcp++ = c;
X top--;
X }
X dotext(&term->screen, term->flags, gset, dotextbuf, dcp);
X }
X /*
X * process SPACE or DEL characters in 94chars gset string.
X */
X if (c < min || max < c) {
X if ((c & ~0x80) == 0x20) {
X dcp = dotextbuf;
X top = bcnt > TEXT_BUF_SIZE ? TEXT_BUF_SIZE : bcnt;
X while (top > 0 && *cp == c) {
X *dcp++ = c;
X cp++; top--;
X }
X dotext(&term->screen, term->flags, GSET_ASCII, dotextbuf, dcp);
X } else if ((c & ~0x80) == 0x7f) {
X top = bcnt > TEXT_BUF_SIZE ? TEXT_BUF_SIZE : bcnt;
X while (top > 0 && *cp == c) {
X cp++; top--;
X }
X }
X }
X bcnt -= cp - bptr;
X bptr = cp;
}
# endif /* !KTERM_HANZI && !KTERM_HANGUL */
X
# ifdef KTERM_KANJI
doSJIS()
{
X Char dotextbuf[TEXT_BUF_SIZE];
X register int top;
X register Char HI, LO;
X register Char *cp = bptr;
X register Char *dcp = dotextbuf;
X
# define SJIS1(c) ((0x81 <= c && c <= 0x9F) || (0xE0 <= c && c <= 0xEF))
# define SJIS2(c) (0x40 <= c && c <= 0xFC && c != 0x7F)
X if (bcnt == 1) {
X pending_byte = *cp;
X bcnt = 0;
X return;
X }
X top = (bcnt > TEXT_BUF_SIZE ? TEXT_BUF_SIZE : bcnt) / 2;
X while (top > 0) {
X HI = *cp++;
X if (!SJIS1(HI)) {
X cp--;
X break;
X }
X LO = *cp++;
X if (!SJIS2(LO)) {
X /*
X * Incomplete shift-jis character.
X * Skip its first byte.
X */
X cp--;
X break;
X }
X /*
X * SJIS to JIS code conversion:
X */
X if (HI <= 0x9f) HI = (HI-0x81)*2 + 0x21;
X else HI = (HI-0xc1)*2 + 0x21;
X if (LO <= 0x7e) LO -= 0x1f;
X else if (LO <= 0x9e) LO -= 0x20;
X else LO -= 0x7e, HI += 1;
X *dcp++ = HI;
X *dcp++ = LO;
X top--;
X }
X dotext(&term->screen, term->flags, GSET_KANJI, dotextbuf, dcp);
X bcnt -= cp - bptr;
X bptr = cp;
}
# endif /* KTERM_KANJI */
#endif /* KTERM */
X
X
VTparse()
{
X register TScreen *screen = &term->screen;
X register int *parsestate = groundtable;
X register unsigned int c;
X register unsigned char *cp;
X register int row, col, top, bot, scstype;
#ifdef KTERM
X register Bchr *xp;
X int cs96 = 0;
#endif /* KTERM */
#ifdef KTERM_KANJI
X int mbcs = 0;
X register int ps;
#endif /* KTERM_KANJI */
X extern int bitset(), bitclr(), finput(), TrackMouse();
X
X if(setjmp(vtjmpbuf))
X parsestate = groundtable;
#ifdef KTERM_KANJI
X pending_byte = 0;
#endif /* KTERM_KANJI */
X for( ; ; ) {
#ifdef KTERM_KANJI
X ps = parsestate[c = doinput()];
X if (term->flags & SJIS_KANJI && SJIS1(c)) {
X bcnt++;
X *--bptr = c;
X doSJIS();
X screen->curss = 0;
X continue;
X }
#ifdef KTERM_HANZI
X if (term->flags & SGB_HANZI && SGB1(c)) {
X bcnt++;
X *--bptr = c;
X doSGB();
X screen->curss = 0;
X continue;
X }
#endif /* KTERM_HANZI */
#ifdef KTERM_HANGUL
X if (term->flags & KS_HANGUL && KSH1(c)) {
X bcnt++;
X *--bptr = c;
X doKSH();
X screen->curss = 0;
X continue;
X }
X if (term->flags & NBYTE_HANGUL && screen->curgl) {
X bcnt++;
X *--bptr = c;
X doNBH();
X screen->curss = screen->curgl = 0;
X continue;
X }
#endif /* KTERM_HANGUL */
X
X switch (ps) {
#else /* !KTERM_KANJI */
X switch (parsestate[c = doinput()]) {
#endif /* !KTERM_KANJI */
X case CASE_PRINT:
X /* printable characters */
#ifdef KTERM
X bcnt++;
X *--bptr = c;
X if(screen->curss) {
X doSS(screen->gsets[screen->curss]);
# ifdef KTERM_KANJI
X if (pending_byte == 0)
# endif /* KTERM_KANJI */
X screen->curss = 0;
X continue;
X }
X doLS(screen->gsets[c & 0x80 ? screen->curgr
X : screen->curgl]);
#else /* KTERM */
X top = bcnt > TEXT_BUF_SIZE ? TEXT_BUF_SIZE : bcnt;
X cp = bptr;
X *--bptr = c;
X while(top > 0 && isprint(*cp & 0x7f)) {
X top--;
X bcnt--;
X cp++;
X }
X if(screen->curss) {
X dotext(screen, term->flags,
X screen->gsets[screen->curss], bptr, bptr + 1);
X screen->curss = 0;
X bptr++;
X }
X if(bptr < cp)
X dotext(screen, term->flags,
X screen->gsets[screen->curgl], bptr, cp);
X bptr = cp;
#endif /* !KTERM */
X break;
X
X case CASE_GROUND_STATE:
X /* exit ignore mode */
X parsestate = groundtable;
X break;
X
X case CASE_IGNORE_STATE:
X /* Ies: ignore anything else */
X parsestate = igntable;
X break;
X
X case CASE_IGNORE_ESC:
X /* Ign: escape */
X parsestate = iestable;
X break;
X
X case CASE_IGNORE:
X /* Ignore character */
X break;
X
X case CASE_BELL:
X /* bell */
X Bell();
X break;
X
X case CASE_BS:
X /* backspace */
X CursorBack(screen, 1);
X break;
X
X case CASE_CR:
X /* carriage return */
X /*
X * Tag only real new lines for selections.
X */
X screen->buf[screen->cur_row][screen->cur_col].attr |=
X NL_TAG;
X CarriageReturn(screen);
X break;
X
X case CASE_ESC:
X /* escape */
X parsestate = esctable;
X break;
X
X case CASE_VMOT:
X /*
X * form feed, line feed, vertical tab
X */
#ifdef STATUSLINE
X if (!screen->instatus)
#endif /* STATUSLINE */
X Index(screen, 1);
X if (term->flags & LINEFEED) {
X /*
X * Tag only real new lines for selections.
X */
X screen->buf[screen->cur_row][screen->cur_col].attr
X |= NL_TAG;
X CarriageReturn(screen);
X }
X if (screen->display->qlen > 0 ||
X GetBytesAvailable (screen->display->fd) > 0)
X xevents();
X break;
X
X case CASE_TAB:
X /* tab */
X /*
X * Tag tabs for preservation in selections.
X */
X screen->buf[screen->cur_row][screen->cur_col].attr |=
X TAB_TAG;
X screen->cur_col = TabNext(term->tabs, screen->cur_col);
X if (screen->cur_col > screen->max_col)
X screen->cur_col = screen->max_col;
X break;
X
X case CASE_SI:
X screen->curgl = 0;
X break;
X
X case CASE_SO:
X screen->curgl = 1;
X break;
X
X case CASE_SCR_STATE:
X /* enter scr state */
X parsestate = scrtable;
X break;
X
X case CASE_SCS0_STATE:
X /* enter scs state 0 */
#ifdef KTERM_CTEXT
X /*
X * For X11 Compound Text encoding, a multi-byte
X * character set is introduced in this way:
X * ESC-$-(-{A,B,C} G0/GL designation
X * ESC-$-)-{A,B,C} G1/GR designation
X *
X * G0/GL triggers an MBCS state in the SCS0 state and
X * G1/GR triggers an MBCS state in the SCS1 state.
X *
X * The {A,B,C} are currently the only X11 Consortium
X * registered multi-byte character set compound text
X * sequences. These character sets are currently
X * defined in GL only.
X * 'A' indicates Chinese GB2312-1980 encoding
X * 'B' indicates Japanese JISX0208-1983 encoding
X * 'C' indicates Korean KSC5601-1987 encoding
X */
X
X if (parsestate == mbcstable && c == '(') mbcs = 1;
#endif /* KTERM_CTEXT */
X
X scstype = 0;
X parsestate = scstable;
X break;
X
X case CASE_SCS1_STATE:
X /* enter scs state 1 */
#ifdef KTERM
X if (c == '-') cs96 = 1;
#endif /* KTERM */
X scstype = 1;
X parsestate = scstable;
X break;
X
X case CASE_SCS2_STATE:
X /* enter scs state 2 */
#ifdef KTERM
X if (c == '.') cs96 = 1;
#endif /* KTERM */
X scstype = 2;
X parsestate = scstable;
X break;
X
X case CASE_SCS3_STATE:
X /* enter scs state 3 */
#ifdef KTERM
X if (c == '/') cs96 = 1;
#endif /* KTERM */
X scstype = 3;
X parsestate = scstable;
X break;
X
#ifdef KTERM_KANJI
X case CASE_MBCS:
X /* enter mbcs state */
X mbcs = 1;
X scstype = 0;
X parsestate = mbcstable;
X break;
#endif /* KTERM_KANJI */
X
X case CASE_ESC_IGNORE:
X /* unknown escape sequence */
X parsestate = eigtable;
X break;
X
X case CASE_ESC_DIGIT:
X /* digit in csi or dec mode */
X if((row = param[nparam - 1]) == DEFAULT)
X row = 0;
X param[nparam - 1] = 10 * row + (c - '0');
X break;
X
X case CASE_ESC_SEMI:
X /* semicolon in csi or dec mode */
X param[nparam++] = DEFAULT;
X break;
X
X case CASE_DEC_STATE:
X /* enter dec mode */
X parsestate = dectable;
X break;
X
X case CASE_ICH:
X /* ICH */
X if((row = param[0]) < 1)
X row = 1;
X InsertChar(screen, row);
X parsestate = groundtable;
X break;
X
X case CASE_CUU:
X /* CUU */
X if((row = param[0]) < 1)
X row = 1;
#ifdef STATUSLINE
X if (!screen->instatus)
#endif /* STATUSLINE */
X CursorUp(screen, row);
X parsestate = groundtable;
X break;
X
X case CASE_CUD:
X /* CUD */
X if((row = param[0]) < 1)
X row = 1;
#ifdef STATUSLINE
X if (!screen->instatus)
#endif /* STATUSLINE */
X CursorDown(screen, row);
X parsestate = groundtable;
X break;
X
X case CASE_CUF:
X /* CUF */
X if((row = param[0]) < 1)
X row = 1;
X CursorForward(screen, row);
X parsestate = groundtable;
X break;
X
X case CASE_CUB:
X /* CUB */
X if((row = param[0]) < 1)
X row = 1;
X CursorBack(screen, row);
X parsestate = groundtable;
X break;
X
X case CASE_CUP:
X /* CUP | HVP */
X if((row = param[0]) < 1)
X row = 1;
X if(nparam < 2 || (col = param[1]) < 1)
X col = 1;
#ifdef STATUSLINE
X if (!screen->instatus)
#endif /* STATUSLINE */
X CursorSet(screen, row-1, col-1, term->flags);
X parsestate = groundtable;
X break;
X
X case CASE_ED:
X /* ED */
X switch (param[0]) {
X case DEFAULT:
X case 0:
#ifdef STATUSLINE
X if (screen->instatus)
X ClearRight(screen);
X else
#endif /* STATUSLINE */
X ClearBelow(screen);
X break;
X
X case 1:
#ifdef STATUSLINE
X if (screen->instatus)
X ClearLeft(screen);
X else
#endif /* STATUSLINE */
X ClearAbove(screen);
X break;
X
X case 2:
#ifdef STATUSLINE
X if (screen->instatus)
X ClearLine(screen);
X else
#endif /* STATUSLINE */
X ClearScreen(screen);
X break;
X }
X parsestate = groundtable;
X break;
X
X case CASE_EL:
X /* EL */
X switch (param[0]) {
X case DEFAULT:
X case 0:
X ClearRight(screen);
X break;
X case 1:
X ClearLeft(screen);
X break;
X case 2:
X ClearLine(screen);
X break;
X }
X parsestate = groundtable;
X break;
X
X case CASE_IL:
X /* IL */
X if((row = param[0]) < 1)
X row = 1;
#ifdef STATUSLINE
X if (!screen->instatus)
#endif /* STATUSLINE */
X InsertLine(screen, row);
X parsestate = groundtable;
X break;
X
X case CASE_DL:
X /* DL */
X if((row = param[0]) < 1)
X row = 1;
#ifdef STATUSLINE
X if (!screen->instatus)
#endif /* STATUSLINE */
X DeleteLine(screen, row);
X parsestate = groundtable;
X break;
X
X case CASE_DCH:
X /* DCH */
X if((row = param[0]) < 1)
X row = 1;
X DeleteChar(screen, row);
X parsestate = groundtable;
X break;
X
X case CASE_TRACK_MOUSE:
X /* Track mouse as long as in window and between
X specified rows */
X TrackMouse(param[0], param[2]-1, param[1]-1,
X param[3]-1, param[4]-2);
X break;
X
X case CASE_DECID:
X param[0] = -1; /* Default ID parameter */
X /* Fall through into ... */
X case CASE_DA1:
X /* DA1 */
X if (param[0] <= 0) { /* less than means DEFAULT */
X reply.a_type = CSI;
X reply.a_pintro = '?';
X reply.a_nparam = 2;
X reply.a_param[0] = 1; /* VT102 */
X reply.a_param[1] = 2; /* VT102 */
X reply.a_inters = 0;
X reply.a_final = 'c';
X unparseseq(&reply, screen->respond);
X }
X parsestate = groundtable;
X break;
X
X case CASE_TBC:
X /* TBC */
X if ((row = param[0]) <= 0) /* less than means default */
X TabClear(term->tabs, screen->cur_col);
X else if (row == 3)
X TabZonk(term->tabs);
X parsestate = groundtable;
X break;
X
X case CASE_SET:
X /* SET */
X modes(term, bitset);
X parsestate = groundtable;
X break;
X
X case CASE_RST:
X /* RST */
X modes(term, bitclr);
X parsestate = groundtable;
X break;
X
X case CASE_SGR:
X /* SGR */
X for (row=0; row<nparam; ++row) {
X switch (param[row]) {
X case DEFAULT:
X case 0:
X term->flags &= ~(INVERSE|BOLD|UNDERLINE
#ifdef COLOR_TEXT /* mukawa */
X |COLOR_TEXT0|COLOR_TEXT1
X |COLOR_TEXT2|COLOR_TEXT3
X |COLOR_TEXT4|COLOR_TEXT5
X |COLOR_TEXT6|COLOR_TEXT7
#endif /* COLOR_TEXT */
X );
X break;
X case 1:
X case 5: /* Blink, really. */
X term->flags |= BOLD;
X break;
X case 4: /* Underscore */
X term->flags |= UNDERLINE;
X break;
X case 7:
X term->flags |= INVERSE;
X break;
#ifdef COLOR_TEXT /* mukawa */
X case 30:
X term->flags &= ~(COLOR_TEXT_MASK|INVERSE);
X term->flags |= COLOR_TEXT0;
X break;
X case 31:
X term->flags &= ~(COLOR_TEXT_MASK|INVERSE);
X term->flags |= COLOR_TEXT1;
X break;
X case 32:
X term->flags &= ~(COLOR_TEXT_MASK|INVERSE);
X term->flags |= COLOR_TEXT2;
X break;
X case 33:
X term->flags &= ~(COLOR_TEXT_MASK|INVERSE);
X term->flags |= COLOR_TEXT3;
X break;
X case 34:
X term->flags &= ~(COLOR_TEXT_MASK|INVERSE);
X term->flags |= COLOR_TEXT4;
X break;
X case 35:
X term->flags &= ~(COLOR_TEXT_MASK|INVERSE);
X term->flags |= COLOR_TEXT5;
X break;
X case 36:
X term->flags &= ~(COLOR_TEXT_MASK|INVERSE);
X term->flags |= COLOR_TEXT6;
X break;
X case 37:
X term->flags &= ~(COLOR_TEXT_MASK|INVERSE);
X term->flags |= COLOR_TEXT7;
X break;
X case 40:
X term->flags &= ~COLOR_TEXT_MASK;
X term->flags |= (COLOR_TEXT0|INVERSE);
X break;
X case 41:
X term->flags &= ~COLOR_TEXT_MASK;
X term->flags |= (COLOR_TEXT1|INVERSE);
X break;
X case 42:
X term->flags &= ~COLOR_TEXT_MASK;
X term->flags |= (COLOR_TEXT2|INVERSE);
X break;
X case 43:
X term->flags &= ~COLOR_TEXT_MASK;
X term->flags |= (COLOR_TEXT3|INVERSE);
X break;
X case 44:
X term->flags &= ~COLOR_TEXT_MASK;
X term->flags |= (COLOR_TEXT4|INVERSE);
X break;
X case 45:
X term->flags &= ~COLOR_TEXT_MASK;
X term->flags |= (COLOR_TEXT5|INVERSE);
X break;
X case 46:
X term->flags &= ~COLOR_TEXT_MASK;
X term->flags |= (COLOR_TEXT6|INVERSE);
X break;
X case 47:
X term->flags &= ~COLOR_TEXT_MASK;
X term->flags |= (COLOR_TEXT7|INVERSE);
X break;
#endif /* COLOR_TEXT */
X }
X }
X parsestate = groundtable;
X break;
X
X case CASE_CPR:
X /* CPR */
X if ((row = param[0]) == 5) {
X reply.a_type = CSI;
X reply.a_pintro = 0;
X reply.a_nparam = 1;
X reply.a_param[0] = 0;
X reply.a_inters = 0;
X reply.a_final = 'n';
X unparseseq(&reply, screen->respond);
X } else if (row == 6) {
X reply.a_type = CSI;
X reply.a_pintro = 0;
X reply.a_nparam = 2;
X reply.a_param[0] = screen->cur_row+1;
X reply.a_param[1] = screen->cur_col+1;
X reply.a_inters = 0;
X reply.a_final = 'R';
X unparseseq(&reply, screen->respond);
X }
X parsestate = groundtable;
X break;
X
X case CASE_DECSTBM:
X /* DECSTBM */
X if((top = param[0]) < 1)
X top = 1;
X if(nparam < 2 || (bot = param[1]) == DEFAULT
X || bot > screen->max_row + 1
X || bot == 0)
X bot = screen->max_row+1;
#ifdef STATUSLINE
X if (!screen->instatus)
#endif /* STATUSLINE */
X if (bot > top) {
X if(screen->scroll_amt)
X FlushScroll(screen);
X screen->top_marg = top-1;
X screen->bot_marg = bot-1;
X CursorSet(screen, 0, 0, term->flags);
X }
X parsestate = groundtable;
X break;
X
X case CASE_DECREQTPARM:
X /* DECREQTPARM */
X if ((row = param[0]) == DEFAULT)
X row = 0;
X if (row == 0 || row == 1) {
X reply.a_type = CSI;
X reply.a_pintro = 0;
X reply.a_nparam = 7;
X reply.a_param[0] = row + 2;
X reply.a_param[1] = 1; /* no parity */
X reply.a_param[2] = 1; /* eight bits */
X reply.a_param[3] = 112; /* transmit 9600 baud */
X reply.a_param[4] = 112; /* receive 9600 baud */
X reply.a_param[5] = 1; /* clock multiplier ? */
X reply.a_param[6] = 0; /* STP flags ? */
X reply.a_inters = 0;
X reply.a_final = 'x';
X unparseseq(&reply, screen->respond);
X }
X parsestate = groundtable;
X break;
X
X case CASE_DECSET:
X /* DECSET */
X dpmodes(term, bitset);
X parsestate = groundtable;
X if(screen->TekEmu)
X return;
X break;
X
X case CASE_DECRST:
X /* DECRST */
X dpmodes(term, bitclr);
X parsestate = groundtable;
X break;
X
X case CASE_DECALN:
X /* DECALN */
X if(screen->cursor_state)
X HideCursor();
X for(row = screen->max_row ; row >= 0 ; row--) {
#ifdef KTERM
X for(xp = screen->buf[row] ; col > 0 ; col--) {
X xp++->code = (unsigned char) 'E';
X xp++->gset = GSET_ASCII;
X xp++->attr = 0;
X }
#else /* !KTERM */
X bzero(screen->buf[2 * row + 1],
X col = screen->max_col + 1);
X for(cp = (unsigned char *)screen->buf[2 * row] ; col > 0 ; col--)
X *cp++ = (unsigned char) 'E';
#endif /* !KTERM */
X }
X ScrnRefresh(screen, 0, 0, screen->max_row + 1,
X screen->max_col + 1, False);
X parsestate = groundtable;
X break;
X
X case CASE_GSETS:
#ifdef KTERM
X c = GSET(c);
X if (cs96) {
X c |= CS96;
X cs96 = 0;
X }
# ifdef KTERM_KANJI
X if (mbcs) {
X c |= MBCS;
X mbcs = 0;
X }
# endif /* KTERM_KANJI */
#endif /* KTERM */
X screen->gsets[scstype] = c;
X parsestate = groundtable;
X break;
X
X case CASE_DECSC:
X /* DECSC */
X CursorSave(term, &screen->sc);
X parsestate = groundtable;
X break;
X
X case CASE_DECRC:
X /* DECRC */
X CursorRestore(term, &screen->sc);
X parsestate = groundtable;
X break;
X
X case CASE_DECKPAM:
X /* DECKPAM */
X term->keyboard.flags |= KYPD_APL;
X update_appkeypad();
X parsestate = groundtable;
X break;
X
X case CASE_DECKPNM:
X /* DECKPNM */
X term->keyboard.flags &= ~KYPD_APL;
X update_appkeypad();
X parsestate = groundtable;
X break;
X
X case CASE_IND:
X /* IND */
#ifdef STATUSLINE
X if (!screen->instatus)
#endif /* STATUSLINE */
X Index(screen, 1);
X if (screen->display->qlen > 0 ||
X GetBytesAvailable (screen->display->fd) > 0)
X xevents();
X parsestate = groundtable;
X break;
X
X case CASE_NEL:
X /* NEL */
#ifdef STATUSLINE
X if (!screen->instatus)
#endif /* STATUSLINE */
X Index(screen, 1);
X /*
X * Tag only real new lines for selections.
X */
X screen->buf[screen->cur_row][screen->cur_col].attr |=
X NL_TAG;
X CarriageReturn(screen);
X
X if (screen->display->qlen > 0 ||
X GetBytesAvailable (screen->display->fd) > 0)
X xevents();
X parsestate = groundtable;
X break;
X
X case CASE_HTS:
X /* HTS */
X TabSet(term->tabs, screen->cur_col);
X parsestate = groundtable;
X break;
X
X case CASE_RI:
X /* RI */
#ifdef STATUSLINE
X if (!screen->instatus)
#endif /* STATUSLINE */
X RevIndex(screen, 1);
X parsestate = groundtable;
X break;
X
X case CASE_SS2:
X /* SS2 */
X screen->curss = 2;
X /*
X dosingleshift();
X screen->curss = 0;
X */
X parsestate = groundtable;
X break;
X
X case CASE_SS3:
X /* SS3 */
X screen->curss = 3;
X /*
X dosingleshift();
X screen->curss = 0;
X */
X parsestate = groundtable;
X break;
X
X case CASE_CSI_STATE:
X /* enter csi state */
X nparam = 1;
X param[0] = DEFAULT;
X parsestate = csitable;
X break;
X
X case CASE_OSC:
X /* do osc escapes */
X do_osc(finput);
X parsestate = groundtable;
X break;
X
X case CASE_RIS:
X /* RIS */
X VTReset(TRUE);
X parsestate = groundtable;
X break;
X
X case CASE_LS2:
X /* LS2 */
X screen->curgl = 2;
X parsestate = groundtable;
X break;
X
X case CASE_LS3:
X /* LS3 */
X screen->curgl = 3;
X parsestate = groundtable;
X break;
X
X case CASE_LS3R:
X /* LS3R */
X screen->curgr = 3;
X parsestate = groundtable;
X break;
X
X case CASE_LS2R:
X /* LS2R */
X screen->curgr = 2;
X parsestate = groundtable;
X break;
X
X case CASE_LS1R:
X /* LS1R */
X screen->curgr = 1;
X parsestate = groundtable;
X break;
X
#ifdef STATUSLINE
X case CASE_TO_STATUS:
X if ((c = param[0]) < 1)
X c = 1;
X ToStatus(c - 1);
X parsestate = groundtable;
X break;
X
X case CASE_FROM_STATUS:
X FromStatus();
X parsestate = groundtable;
X break;
X
X case CASE_SHOW_STATUS:
X ShowStatus();
X parsestate = groundtable;
SHAR_EOF
true || echo 'restore of kterm-4.1.2/charproc.c failed'
fi
echo 'End of kterm-4.1.2 part 7'
echo 'File kterm-4.1.2/charproc.c is continued in part 8'
echo 8 > _shar_seq_.tmp
exit 0
-----------------------------------------------------------------------------
mleisher@nmsu.edu "I laughed.
Mark Leisher I cried.
Computing Research Lab I fell down.
New Mexico State University It changed my life."
Las Cruces, NM - Rich [Cowboy Feng's Space Bar and Grille]
--
Dan Heller
O'Reilly && Associates Z-Code Software Comp-sources-x:
Senior Writer President comp-sources.x@uunet.uu.net
argv@ora.com argv@zipcode.com