[comp.sources.x] v09i031: colxterm -- Color xterm, Part01/14

tomw@orac.esd.sgi.com (Tom Weinstein) (09/14/90)

Submitted-by: Tom Weinstein <tomw@orac.esd.sgi.com>
Posting-number: Volume 9, Issue 31
Archive-name: colxterm/part01

[ This is the color xterm stuff Tom Mentioned on comp.windows.x.
  Problems or questions about this posting should be directed
  to comp.windows.x or comp.sources.bugs --dan
]

Author:
Tom Weinstein
Silicon Graphics, Inc., Entry Systems Division, Window Systems
tomw@orac.esd.sgi.com


   File Name		Archive #	Description
----------------------------------------------------------
 xterm                      1	
 xterm/CHANGES             14	
 xterm/Imakefile           13	
 xterm/Makefile             9	
 xterm/README              11	
 xterm/README.new          13	
 xterm/TekPrsTbl.c.aa      10	
 xterm/TekPrsTbl.c.ab      11	
 xterm/TekPrsTbl.c.ac       2	
 xterm/Tekparse.def        14	
 xterm/Tekparse.h          10	
 xterm/Tekproc.c            1	
 xterm/VTPrsTbl.c.aa       10	
 xterm/VTPrsTbl.c.ab        5	
 xterm/VTPrsTbl.c.ac        4	
 xterm/VTparse.def          2	
 xterm/VTparse.h           13	
 xterm/XTerm.ad            12	
 xterm/button.c             2	
 xterm/charproc.c.aa        5	
 xterm/charproc.c.ab        6	
 xterm/charproc.c.ac        7	
 xterm/charproc.c.ad       13	
 xterm/ctlseq2.txt          1	
 xterm/ctlseqs.ms          12	
 xterm/cursor.c            13	
 xterm/data.c              13	
 xterm/data.h              14	
 xterm/error.h             13	
 xterm/input.c             13	
 xterm/main.c.aa            6	
 xterm/main.c.ab            9	
 xterm/main.c.ac            3	
 xterm/main.h               1	
 xterm/menu.c               8	
 xterm/menu.h              10	
 xterm/misc.c               8	
 xterm/ptyx.h              12	
 xterm/resize.c            11	
 xterm/resize.man          14	
 xterm/screen.c            11	
 xterm/scrollbar.c         12	
 xterm/tabs.c              13	
 xterm/tektests             1	
 xterm/termcap              6	
 xterm/termcap.bold         8	
 xterm/termcap.vi           9	
 xterm/terminfo            14	
 xterm/util.c               4	
 xterm/x10ctlseq.ms        13	
 xterm/xterm.man.aa         3	
 xterm/xterm.man.ab         7	
#! /bin/sh
# This is a shell archive.  Remove anything before this line, then feed it
# into a shell via "sh file" or similar.  To overwrite existing files,
# type "sh file -c".
# The tool that generated this appeared in the comp.sources.unix newsgroup;
# send mail to comp-sources-unix@uunet.uu.net if you want that tool.
# If this archive is complete, you will see the following message at the end:
#		"End of archive 1 (of 14)."
# Contents:  xterm xterm/Tekproc.c xterm/ctlseq2.txt xterm/main.h
#   xterm/tektests
# Wrapped by argv@turnpike on Thu Sep 13 20:42:15 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test ! -d 'xterm' ; then
    echo shar: Creating directory \"'xterm'\"
    mkdir 'xterm'
fi
if test -f 'xterm/Tekproc.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xterm/Tekproc.c'\"
else
echo shar: Extracting \"'xterm/Tekproc.c'\" \(41529 characters\)
sed "s/^X//" >'xterm/Tekproc.c' <<'END_OF_FILE'
X/*
X * $XConsortium: Tekproc.c,v 1.81 90/06/08 13:58:07 jim Exp $
X *
X * Warning, there be crufty dragons here.
X */
X
X
X#include <X11/copyright.h>
X
X/*
X * Copyright 1988 Massachusetts Institute of Technology
X * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
X *
X *                         All Rights Reserved
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted,
X * provided that the above copyright notice appear in all copies and that
X * both that copyright notice and this permission notice appear in
X * supporting documentation, and that the name of Digital Equipment
X * Corporation not be used in advertising or publicity pertaining to
X * distribution of the software without specific, written prior permission.
X *
X *
X * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
X * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
X * SOFTWARE.
X */
X
X/* Tekproc.c */
X
X#include <X11/Xos.h>
X#include "ptyx.h"
X#include <X11/Xatom.h>
X#include <X11/Xutil.h>
X#include <X11/cursorfont.h>
X#include <X11/StringDefs.h>
X#include <X11/Shell.h>
X#include <X11/Xmu/CharSet.h>
X#include "Tekparse.h"
X#include <stdio.h>
X#ifdef umips
X# ifndef SYSTYPE_SYSV
X# include <sgtty.h>
X# endif /* not SYSTYPE_SYSV */
X#else
X# ifndef CRAY
X#  include <sgtty.h>
X# endif
X#endif /* umips */
X#include <ctype.h>
X#include <errno.h>
X#include <setjmp.h>
X#include <pwd.h>
X#include "data.h"
X#include "error.h"
X#include "menu.h"
X
X#if !defined(EWOULDBLOCK) && defined(EAGAIN)
X#define EWOULDBLOCK EAGAIN
X#endif
X
Xextern void exit();
Xextern long time();
X
X#define TekColormap DefaultColormap( screen->display, \
X				    DefaultScreen(screen->display) )
X#define DefaultGCID DefaultGC(screen->display, DefaultScreen(screen->display))->gid
X
X/* Tek defines */
X
X#define	BEL		07
X#define	CANCEL		030
X#define	DOTDASHEDLINE	2
X#define	DOTTEDLINE	1
X#define	EAST		01
X#define	ETX		03
X#define	LINEMASK	07
X#define	LONGDASHEDLINE	4
X#define	MARGIN1		0
X#define	MARGIN2		1
X#define MAX_PTS		150
X#define MAX_VTX		300
X#define	NAK		025
X#define	NORTH		04
X#define	PENDOWN		1
X#define	PENUP		0
X#define	SHORTDASHEDLINE	3
X#define	SOLIDLINE	0
X#define	SOUTH		010
X#define	TEKBOTTOMPAD	23
X#define	TEKDEFHEIGHT	565
X#define	TEKDEFWIDTH	750
X#define	TEKHEIGHT	3072
X#define	TEKHOME		((TekChar[screen->page.fontsize].nlines - 1)\
X			 * TekChar[screen->page.fontsize].vsize)
X#define	TEKMINHEIGHT	452
X#define	TEKMINWIDTH	600
X#define	TEKTOPPAD	34
X#define	TEKWIDTH	4096
X#define	TEXT_BUF_SIZE	256
X#define	WEST		02
X
X#define	TekMove(x,y)	screen->cur_X = x; screen->cur_Y = y
X#define	input()		Tinput()
X#define	unput(c)	*Tpushback++ = c
X
X#ifndef lint
Xstatic char rcs_id[] = "$XConsortium: Tekproc.c,v 1.81 90/06/08 13:58:07 jim Exp $";
X#endif	/* lint */
X
Xextern Widget toplevel;
X
Xstatic XPoint *T_box[TEKNUMFONTS] = {
X	T_boxlarge,
X	T_box2,
X	T_box3,
X	T_boxsmall,
X};
Xstatic struct Tek_Char {
X	int hsize;	/* in Tek units */
X	int vsize;	/* in Tek units */
X	int charsperline;
X	int nlines;
X} TekChar[TEKNUMFONTS] = {
X	{56, 88, 74, 35},	/* large */
X	{51, 82, 81, 38},	/* #2 */
X	{34, 53, 121, 58},	/* #3 */
X	{31, 48, 133, 64},	/* small */
X};
X
Xstatic Cursor GINcursor;
Xstatic XSegment *line_pt;
Xstatic int nplot;
Xstatic TekLink Tek0;
Xstatic jmp_buf Tekjump;
Xstatic TekLink *TekRecord;
Xstatic XSegment *Tline;
X
Xextern int Talptable[];
Xextern int Tbestable[];
Xextern int Tbyptable[];
Xextern int Tesctable[];
Xextern int Tipltable[];
Xextern int Tplttable[];
Xextern int Tpttable[];
Xextern int Tspttable[];
X
Xstatic int *curstate = Talptable;
Xstatic int *Tparsestate = Talptable;
X
X/* event handlers */
Xextern void HandleKeyPressed(), HandleEightBitKeyPressed();
Xextern void HandleStringEvent();
Xextern void HandleEnterWindow();
Xextern void HandleLeaveWindow();
Xextern void HandleFocusChange();
Xextern void HandleSecure();
Xextern void HandleGINInput();
Xextern void HandleCreateMenu(), HandlePopupMenu();
X
Xstatic char defaultTranslations[] = "\
X       ~Meta<KeyPress>: 	insert-seven-bit()	\n\
X        Meta<KeyPress>: 	insert-eight-bit()\n\
X Ctrl ~Meta<Btn1Down>:          popup-menu(mainMenu) \n\
X Ctrl ~Meta <Btn2Down>:         popup-menu(tekMenu) \n\
X Shift ~Meta<Btn1Down>:         gin-press(L) \n\
X       ~Meta<Btn1Down>:         gin-press(l) \n\
X Shift ~Meta<Btn2Down>:         gin-press(M) \n\
X       ~Meta<Btn2Down>:         gin-press(m) \n\
X Shift ~Meta<Btn3Down>:         gin-press(R) \n\
X       ~Meta<Btn3Down>:         gin-press(r)";
X
X
Xstatic XtActionsRec actionsList[] = { 
X    { "string",	HandleStringEvent },
X    { "insert",	HandleKeyPressed },	/* alias for insert-seven-bit */
X    { "insert-seven-bit",	HandleKeyPressed },
X    { "insert-eight-bit",	HandleEightBitKeyPressed },
X    { "gin-press",		HandleGINInput },
X    { "secure", 		HandleSecure },
X    { "create-menu",		HandleCreateMenu },
X    { "popup-menu",		HandlePopupMenu },
X    /* menu actions */
X    { "allow-send-events",	HandleAllowSends },
X    { "set-visual-bell",	HandleVisualBell },
X    { "set-logging",		HandleLogging },
X    { "redraw",			HandleRedraw },
X    { "send-signal",		HandleSendSignal },
X    { "quit",			HandleQuit },
X    { "set-scrollbar",		HandleScrollbar },
X    { "set-jumpscroll",		HandleJumpscroll },
X    { "set-reverse-video",	HandleReverseVideo },
X    { "set-autowrap",		HandleAutoWrap },
X    { "set-reversewrap",	HandleReverseWrap },
X    { "set-autolinefeed",	HandleAutoLineFeed },
X    { "set-appcursor",		HandleAppCursor },
X    { "set-appkeypad",		HandleAppKeypad },
X    { "set-scroll-on-key",	HandleScrollKey },
X    { "set-scroll-on-tty-output",	HandleScrollTtyOutput },
X    { "set-allow132",		HandleAllow132 },
X    { "set-cursesemul",		HandleCursesEmul },
X    { "set-marginbell",		HandleMarginBell },
X    { "set-altscreen",		HandleAltScreen },
X    { "soft-reset",		HandleSoftReset },
X    { "hard-reset",		HandleHardReset },
X    { "set-terminal-type",	HandleSetTerminalType },
X    { "set-visibility",		HandleVisibility },
X    { "set-tek-text",		HandleSetTekText },
X    { "tek-page",		HandleTekPage },
X    { "tek-reset",		HandleTekReset },
X    { "tek-copy",		HandleTekCopy },
X};
X
Xstatic Dimension defOne = 1;
X
Xstatic XtResource resources[] = {
X    {XtNwidth, XtCWidth, XtRDimension, sizeof(Dimension),
X	 XtOffset(Widget, core.width), XtRDimension, (caddr_t)&defOne},
X    {XtNheight, XtCHeight, XtRDimension, sizeof(Dimension),
X	 XtOffset(Widget, core.height), XtRDimension, (caddr_t)&defOne},
X    {"fontLarge", XtCFont, XtRFontStruct, sizeof(XFontStruct *),
X       XtOffset(TekWidget, tek.Tfont[TEK_FONT_LARGE]),
X       XtRString, "9x15"},
X    {"font2", XtCFont, XtRFontStruct, sizeof(XFontStruct *),
X       XtOffset(TekWidget, tek.Tfont[TEK_FONT_2]),
X       XtRString, "6x13"},
X    {"font3", XtCFont, XtRFontStruct, sizeof(XFontStruct *),
X       XtOffset(TekWidget, tek.Tfont[TEK_FONT_3]),
X       XtRString, "8x13"},
X    {"fontSmall", XtCFont, XtRFontStruct, sizeof(XFontStruct *),
X       XtOffset(TekWidget, tek.Tfont[TEK_FONT_SMALL]),
X       XtRString, "6x10"},
X    {"initialFont", "InitialFont", XtRString, sizeof(char *),
X       XtOffset(TekWidget, tek.initial_font),
X       XtRString, "large"},
X};
X
Xstatic void TekInitialize(), TekRealize(), TekConfigure();
Xvoid TekExpose();
X
XWidgetClassRec tekClassRec = {
X  {
X/* core_class fields */	
X    /* superclass	  */	(WidgetClass) &widgetClassRec,
X    /* class_name	  */	"Tek4014",
X    /* widget_size	  */	sizeof(TekWidgetRec),
X    /* class_initialize   */    NULL,
X    /* class_part_initialize */ NULL,
X    /* class_inited       */	FALSE,
X    /* initialize	  */	TekInitialize,
X    /* initialize_hook    */    NULL,				
X    /* realize		  */	TekRealize,
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  */	TRUE,
X    /* compress_enterleave */   TRUE,
X    /* visible_interest	  */	FALSE,
X    /* destroy		  */	NULL,
X    /* resize		  */	TekConfigure,
X    /* expose		  */	TekExpose,
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};
X#define tekWidgetClass ((WidgetClass)&tekClassRec)
X
Xstatic Boolean Tfailed = FALSE;
X
XTekWidget CreateTekWidget ()
X{
X    Widget tekshellwidget;
X    extern Arg ourTopLevelShellArgs[];
X    extern int number_ourTopLevelShellArgs;
X
X    /* this causes the Initialize method to be called */
X    tekshellwidget = XtCreatePopupShell ("tektronix", topLevelShellWidgetClass,
X					 toplevel, ourTopLevelShellArgs, 
X					 number_ourTopLevelShellArgs);
X
X    /* this causes the Realize method to be called */
X    tekWidget = (TekWidget) XtCreateManagedWidget ("tek4014", tekWidgetClass,
X						   tekshellwidget, NULL, 0);
X    return (tekWidget);
X}
X
X
Xint TekInit ()
X{
X    if (Tfailed) return (0);
X    if (tekWidget) return (1);
X    if (CreateTekWidget()) {
X	return (1);
X    }
X    return (0);
X}
X
XTekparse()
X{
X	register TScreen *screen = &term->screen;
X	register int c, x, y;
X	char ch;
X	int Tinput();
X
X	for( ; ; )
X		switch(Tparsestate[c = input()]) {
X		 case CASE_REPORT:
X			/* report address */
X			if(screen->TekGIN) {
X				TekGINoff();
X				TekEnqMouse(0);
X			} else {
X				c = 064;	/* has hard copy unit */
X				if(screen->margin == MARGIN2)
X					c |= 02;
X				TekEnq(c, screen->cur_X, screen->cur_Y);
X			}
X			TekRecord->ptr[-1] = NAK; /* remove from recording */
X			Tparsestate = curstate;
X			break;
X
X		 case CASE_VT_MODE:
X			/* special return to vt102 mode */
X			Tparsestate = curstate;
X			TekRecord->ptr[-1] = NAK; /* remove from recording */
X			if(screen->logging) {
X				FlushLog(screen);
X				screen->logstart = buffer;
X			}
X			return;
X
X		 case CASE_SPT_STATE:
X			/* Enter Special Point Plot mode */
X			if(screen->TekGIN)
X				TekGINoff();
X			Tparsestate = curstate = Tspttable;
X			break;
X
X		 case CASE_GIN:
X			/* Do Tek GIN mode */
X			screen->TekGIN = &TekRecord->ptr[-1];
X				/* Set cross-hair cursor raster array */
X			if (GINcursor = 
X			    make_colored_cursor (XC_tcross, screen->mousecolor,
X						 screen->mousecolorback))
X				XDefineCursor (screen->display, TShellWindow,
X					       GINcursor);
X			Tparsestate = Tbyptable;	/* Bypass mode */
X			break;
X
X		 case CASE_BEL:
X			/* BEL */
X			if(screen->TekGIN)
X				TekGINoff();
X			if(!TekRefresh)
X				Bell();
X			Tparsestate = curstate;	/* clear bypass condition */
X			break;
X
X		 case CASE_BS:
X			/* BS */
X			if(screen->TekGIN)
X				TekGINoff();
X			Tparsestate = curstate;	/* clear bypass condition */
X			TCursorBack();
X			break;
X
X		 case CASE_PT_STATE:
X			/* Enter Tek Point Plot mode */
X			if(screen->TekGIN)
X				TekGINoff();
X			Tparsestate = curstate = Tpttable;
X			break;
X
X		 case CASE_PLT_STATE:
X			/* Enter Tek Plot mode */
X			if(screen->TekGIN)
X				TekGINoff();
X			Tparsestate = curstate = Tplttable;
X			if((c = input()) == BEL)
X				screen->pen = PENDOWN;
X			else {
X				unput(c);
X				screen->pen = PENUP;
X			}
X			break;
X
X		 case CASE_TAB:
X			/* HT */
X			if(screen->TekGIN)
X				TekGINoff();
X			Tparsestate = curstate;	/* clear bypass condition */
X			TCursorForward();
X			break;
X
X		 case CASE_IPL_STATE:
X			/* Enter Tek Incremental Plot mode */
X			if(screen->TekGIN)
X				TekGINoff();
X			Tparsestate = curstate = Tipltable;
X			break;
X
X		 case CASE_ALP_STATE:
X			/* Enter Tek Alpha mode from any other mode */
X			if(screen->TekGIN)
X				TekGINoff();
X			/* if in one of graphics states, move alpha cursor */
X			if(nplot > 0)	/* flush line Tbuffer */
X				TekFlush();
X			Tparsestate = curstate = Talptable;
X			break;
X
X		 case CASE_UP:
X			/* cursor up */
X			if(screen->TekGIN)
X				TekGINoff();
X			Tparsestate = curstate;	/* clear bypass condition */
X			TCursorUp();
X			break;
X
X		 case CASE_COPY:
X			/* make copy */
X			if(screen->TekGIN)
X				TekGINoff();
X			TekCopy();
X			TekRecord->ptr[-1] = NAK; /* remove from recording */
X			Tparsestate = curstate;	/* clear bypass condition */
X			break;
X
X		 case CASE_PAGE:
X			/* Page Function */
X			if(screen->TekGIN)
X				TekGINoff();
X			TekPage();	/* clear bypass condition */
X			break;
X
X		 case CASE_BES_STATE:
X			/* Byp: an escape char */
X			Tparsestate = Tbestable;
X			break;
X
X		 case CASE_BYP_STATE:
X			/* set bypass condition */
X			Tparsestate = Tbyptable;
X			break;
X
X		 case CASE_IGNORE:
X			/* Esc: totally ignore CR, ESC, LF, ~ */
X			break;
X
X		 case CASE_ASCII:
X			/* Select ASCII char set */
X			/* ignore for now */
X			Tparsestate = curstate;
X			break;
X
X		 case CASE_APL:
X			/* Select APL char set */
X			/* ignore for now */
X			Tparsestate = curstate;
X			break;
X
X		 case CASE_CHAR_SIZE: 
X			/* character size selector */
X		        TekSetGCFont (screen->cur.fontsize = (c & 03));
X			Tparsestate = curstate;
X			break;
X
X		 case CASE_BEAM_VEC:
X			/* beam and vector selector */
X			/* only line types */
X			if((c &= LINEMASK) != screen->cur.linetype) {
X				if(nplot > 0)
X					TekFlush();
X			if(c<5)
X				screen->cur.linetype = c;
X			}
X			Tparsestate = curstate;
X			break;
X
X		 case CASE_CURSTATE:
X			Tparsestate = curstate;
X			break;
X
X		 case CASE_PENUP:
X			/* Ipl: penup */
X			screen->pen = PENUP;
X			break;
X
X		 case CASE_PENDOWN:
X			/* Ipl: pendown */
X			screen->pen = PENDOWN;
X			break;
X
X		 case CASE_IPL_POINT:
X			/* Ipl: point */
X			x = screen->cur_X;
X			y = screen->cur_Y;
X			if(c & NORTH)
X				y++;
X			else if(c & SOUTH)
X				y--;
X			if(c & EAST)
X				x++;
X			else if(c & WEST)
X				x--;
X			if(screen->pen == PENDOWN)
X				TekDraw(x, y);
X			else
X				TekMove(x, y);
X			break;
X
X		 case CASE_PLT_VEC:
X			/* Plt: vector */
X			unput(c);
X			if(getpoint()) {
X				if(screen->pen == PENDOWN)
X					TekDraw(screen->cur.x, screen->cur.y);
X				else
X					TekMove(screen->cur.x, screen->cur.y);
X				screen->pen = PENDOWN;
X			}
X			break;
X
X		 case CASE_PT_POINT:
X			/* Pt: point */
X			unput(c);
X			if(getpoint()) {
X				TekMove(screen->cur.x, screen->cur.y);
X				TekDraw(screen->cur.x, screen->cur.y);
X			}
X			break;
X
X		 case CASE_SPT_POINT:
X			/* Spt: point */
X			/* ignore intensity character in c */
X			if(getpoint()) {
X				TekMove(screen->cur.x, screen->cur.y);
X				TekDraw(screen->cur.x, screen->cur.y);
X			}
X			break;
X
X		 case CASE_CR:
X			/* CR */
X			if(screen->TekGIN)
X				TekGINoff();
X			if(nplot > 0)	/* flush line Tbuffer */
X				TekFlush();
X			screen->cur_X = screen->margin == MARGIN1 ? 0 :
X			 TEKWIDTH / 2;
X			Tparsestate = curstate = Talptable;
X			break;
X
X		 case CASE_ESC_STATE:
X			/* ESC */
X			Tparsestate = Tesctable;
X			break;
X
X		 case CASE_LF:
X			/* LF */
X			if(screen->TekGIN)
X				TekGINoff();
X			TCursorDown();
X			if (!TekRefresh && (screen->display->qlen > 0 ||
X					    GetBytesAvailable (screen->display->fd) > 0))
X			  xevents();
X			break;
X
X		 case CASE_SP:
X			/* SP */
X			TCursorForward();
X			break;
X
X		 case CASE_PRINT:
X			/* printable character */
X			ch = c;
X			c = screen->cur.fontsize;
X
X			XDrawString(
X			    screen->display,
X			    TWindow(screen), 
X			    screen->TnormalGC,
X			    (int)(screen->cur_X * TekScale(screen)) + screen->border,
X			    (int)((TEKHEIGHT + TEKTOPPAD - screen->cur_Y) * TekScale(screen)) + screen->border,
X			    &ch,
X			    1);
X			TCursorForward();
X			break;
X		 case CASE_OSC:
X			/* do osc escape */
X			do_osc(Tinput);
X			Tparsestate = curstate;
X			break;
X		}
X}			
X
XTekSetGCFont (size)
X    int size;  /* TEK_FONT_{LARGE,2,3,SMALL} */
X    {
X    register TScreen *screen = &term->screen;
X    Font fid = tekWidget->tek.Tfont[size]->fid;
X    if (fid == DefaultGCID) 
X       /* we didn't succeed in opening a real font
X	  for this size.  Instead, use server default. */
X       XCopyGC (screen->display,
X	  DefaultGC(screen->display, DefaultScreen(screen->display)),
X	  GCFont, screen->TnormalGC);
X   else
X       XSetFont (screen->display, screen->TnormalGC, fid);
X    }
X
Xstatic int rcnt;
Xstatic char *rptr;
Xstatic int Tselect_mask;
X
XTinput()
X{
X	register TScreen *screen = &term->screen;
X	register int i;
X	register TekLink *tek;
X	extern char *malloc();
X
X	if(Tpushback > Tpushb)
X		return(*--Tpushback);
X	if(TekRefresh) {
X		if(rcnt-- > 0)
X			return(*rptr++);
X		if(tek = TekRefresh->next) {
X			TekRefresh = tek;
X			rcnt = tek->count - 1;
X			rptr = tek->data;
X			return(*rptr++);
X		}
X		TekRefresh = (TekLink *)0;
X		longjmp(Tekjump, 1);
X	}
Xagain:
X	if(Tbcnt-- <= 0) {
X		if(nplot > 0)	/* flush line Tbuffer */
X			TekFlush();
X		Tselect_mask = pty_mask;	/* force a read */
X		for( ; ; ) {
X#ifdef CRAY
X			struct timeval crocktimeout;
X			crocktimeout.tv_sec = 0;
X			crocktimeout.tv_usec = 0;
X			(void) select (max_plus1, &Tselect_mask, (int *) NULL,
X				       (int *) NULL, &crocktimeout);
X#endif
X			if(Tselect_mask & pty_mask) {
X				if(screen->logging)
X					FlushLog(screen);
X				if((Tbcnt = read(screen->respond,
X				 Tbptr = Tbuffer, BUF_SIZE)) < 0) {
X					if(errno == EIO)
X						Cleanup (0);
X					else if(errno != EWOULDBLOCK)
X						Panic(
X				 "Tinput:read returned unexpected error (%d)\n",
X						 errno);
X				} else if(Tbcnt == 0)
X					Panic("input: read returned zero\n", 0);
X				else {
X				    if (!screen->output_eight_bits) {
X					register int bc = Tbcnt;
X					register Char *b = Tbptr;
X
X					for (; bc > 0; bc--, b++) {
X					    *b &= (Char) 0x7f;
X					}
X				    }
X					break;
X				}
X			}
X			if (Ttoggled && curstate == Talptable) {
X				TCursorToggle(TOGGLE);
X				Ttoggled = FALSE;
X			}
X			if(QLength(screen->display))
X				Tselect_mask = X_mask;
X			else {
X				XFlush(screen->display);
X				Tselect_mask = Select_mask;
X				if((i = select(max_plus1, &Tselect_mask,
X					(int *)NULL, (int *)NULL,
X					(struct timeval *)NULL)) < 0){
X					if (errno != EINTR)
X						SysError(ERROR_TSELECT);
X					continue;
X				}
X			}
X			if(Tselect_mask & X_mask) {
X				xevents();
X				if(Tbcnt > 0)
X					goto again;
X			}
X		}
X		Tbcnt--;
X		if (!Ttoggled && curstate == Talptable) {
X			TCursorToggle(TOGGLE);
X			Ttoggled = TRUE;
X		}
X	}
X	if((tek = TekRecord)->count >= TEK_LINK_BLOCK_SIZE) {
X		if((TekRecord = tek->next = (TekLink *)malloc(sizeof(TekLink)))
X		 == (TekLink *)0)
X			Panic("Tinput: malloc error (%d)\n", errno);
X		tek = tek->next;
X		tek->next = (TekLink *)0;
X		tek->count = 0;
X		tek->ptr = tek->data;
X	}
X	tek->count++;
X	return(*tek->ptr++ = *Tbptr++);
X}
X
X/* this should become the Tek Widget's Resize proc */
Xstatic void TekConfigure(w)
X    Widget w;
X{
X    register TScreen *screen = &term->screen;
X    register int border = 2 * screen->border;
X    register double d;
X
X    if (TWindow(screen)) XClearWindow(screen->display, TWindow(screen));
X    TWidth(screen) = w->core.width - border;
X    THeight(screen) = w->core.height - border;
X    TekScale(screen) = (double)TWidth(screen) / TEKWIDTH;
X    if((d = (double)THeight(screen) / (TEKHEIGHT + TEKTOPPAD + TEKBOTTOMPAD))
X       < TekScale(screen))
X      TekScale(screen) = d;
X    TFullWidth(screen) = w->core.width;
X    TFullHeight(screen) = w->core.height;
X}
X
X/* this should become the Tek Widget's Expose proc */
X/* need to use compress_events = TRUE so you don't need to 
X   look at the "count" in the exposure event ! */
X/*ARGSUSED*/
Xvoid TekExpose(w, event, region)
XWidget w;
XXExposeEvent *event;
XRegion region;
X{
X	register TScreen *screen = &term->screen;
X
X#ifdef lint
X	region = region;
X#endif
X	if(!Ttoggled)
X	    TCursorToggle(CLEAR);
X	Ttoggled = TRUE;
X	Tpushback = Tpushb;
X	screen->cur_X = 0;
X	screen->cur_Y = TEKHOME;
X	screen->cur = screen->page;
X        TekSetGCFont (screen->cur.fontsize);
X	screen->margin = MARGIN1;
X	if(screen->TekGIN) {
X		screen->TekGIN = NULL;
X		TekGINoff();
X	}
X	TekRefresh = &Tek0;
X	rptr = TekRefresh->data;
X	rcnt = TekRefresh->count;
X	Tparsestate = curstate = Talptable;
X	if(!screen->waitrefresh)
X		dorefresh();
X}
X
Xdorefresh()
X{
X	register TScreen *screen = &term->screen;
X	static Cursor wait_cursor = None;
X
X	if (wait_cursor == None)
X            wait_cursor = make_colored_cursor (XC_watch, screen->mousecolor,
X					       screen->mousecolorback);
X        XDefineCursor(screen->display, TShellWindow, wait_cursor);
X	XFlush(screen->display);
X	if(!setjmp(Tekjump))
X		Tekparse();
X	XDefineCursor(screen->display, TShellWindow,
X	 (screen->TekGIN && GINcursor) ? GINcursor : screen->arrow);
X}
X
XTekPage()
X{
X	register TScreen *screen = &term->screen;
X	register TekLink *tek, *tek2;
X
X	XClearWindow(screen->display, TWindow(screen));
X	screen->cur_X = 0;
X	screen->cur_Y = TEKHOME;
X	screen->margin = MARGIN1;
X	screen->page = screen->cur;
X	if(screen->TekGIN)
X		TekGINoff();
X	tek = TekRecord = &Tek0;
X	tek->count = 0;
X	tek->ptr = tek->data;
X	if(tek = tek->next)
X		do {
X			tek2 = tek->next;
X			free((char *)tek);
X		} while(tek = tek2);
X	TekRecord->next = (TekLink *)0;
X	TekRefresh = (TekLink *)0;
X	Ttoggled = TRUE;
X	Tparsestate = curstate = Talptable;	/* Tek Alpha mode */
X}
X
X#define	EXTRABITS	017
X#define	FIVEBITS	037
X#define	HIBITS		(FIVEBITS << SHIFTHI)
X#define	LOBITS		(FIVEBITS << SHIFTLO)
X#define	SHIFTHI		7
X#define	SHIFTLO		2
X#define	TWOBITS		03
X
Xgetpoint()
X{
X	register int c, x, y, e, lo_y = 0;
X	register TScreen *screen = &term->screen;
X
X	x = screen->cur.x;
X	y = screen->cur.y;
X	for( ; ; ) {
X		if((c = input()) < ' ') {	/* control character */
X			unput(c);
X			return(0);
X		}
X		if(c < '@') {	/* Hi X or Hi Y */
X			if(lo_y) {	/* seen a Lo Y, so this must be Hi X */
X				x &= ~HIBITS;
X				x |= (c & FIVEBITS) << SHIFTHI;
X				continue;
X			}
X			/* else Hi Y */
X			y &= ~HIBITS;
X			y |= (c & FIVEBITS) << SHIFTHI;
X			continue;
X		}
X		if(c < '`') {	/* Lo X */
X			x &= ~LOBITS;
X			x |= (c & FIVEBITS) << SHIFTLO;
X			screen->cur.x = x;
X			screen->cur.y = y;
X			return(1);	/* OK */
X		}
X		/* else Lo Y */
X		if(lo_y) {	/* seen a Lo Y, so other must be extra bits */
X			e = (y >> SHIFTLO) & EXTRABITS;
X			x &= ~TWOBITS;
X			x |= e & TWOBITS;
X			y &= ~TWOBITS;
X			y |= (e >> SHIFTLO) & TWOBITS;
X		}
X		y &= ~LOBITS;
X		y |= (c & FIVEBITS) << SHIFTLO;
X		lo_y++;
X	}
X}
X
XTCursorBack()
X{
X	register TScreen *screen = &term->screen;
X	register struct Tek_Char *t;
X	register int x, l;
X
X	x = ( screen->cur_X -=
X		(t = &TekChar[screen->cur.fontsize])->hsize
X	    );
X
X	if(screen->margin == MARGIN1 && x < 0 || screen->margin == MARGIN2
X	 && x < TEKWIDTH / 2) {
X		if((l = (screen->cur_Y + (t->vsize - 1)) / t->vsize + 1) >=
X		 t->nlines) {
X			screen->margin = !screen->margin;
X			l = 0;
X		}
X		screen->cur_Y = l * t->vsize;
X		screen->cur_X = (t->charsperline - 1) * t->hsize;
X	}
X}
X
XTCursorForward()
X{
X	register TScreen *screen = &term->screen;
X	register struct Tek_Char *t;
X	register int l;
X
X	if( ( screen->cur_X +=
X		( t = &TekChar[screen->cur.fontsize])->hsize
X	    ) > TEKWIDTH
X	  ) {
X		if((l = screen->cur_Y / t->vsize - 1) < 0) {
X			screen->margin = !screen->margin;
X			l = t->nlines - 1;
X		}
X		screen->cur_Y = l * t->vsize;
X		screen->cur_X = screen->margin == MARGIN1 ? 0 : TEKWIDTH / 2;
X	}
X}
X
XTCursorUp()
X{
X	register TScreen *screen = &term->screen;
X	register struct Tek_Char *t;
X	register int l;
X
X	t = &TekChar[screen->cur.fontsize];
X
X	if((l = (screen->cur_Y + (t->vsize - 1)) / t->vsize + 1) >= t->nlines) {
X		l = 0;
X		if((screen->margin = !screen->margin) != MARGIN1) {
X			if(screen->cur_X < TEKWIDTH / 2)
X				screen->cur_X += TEKWIDTH / 2;
X		} else if(screen->cur_X >= TEKWIDTH / 2)
X			screen->cur_X -= TEKWIDTH / 2;
X	}
X	screen->cur_Y = l * t->vsize;
X}
X
XTCursorDown()
X{
X	register TScreen *screen = &term->screen;
X	register struct Tek_Char *t;
X	register int l;
X
X	t = &TekChar[screen->cur.fontsize];
X
X	if((l = screen->cur_Y / t->vsize - 1) < 0) {
X		l = t->nlines - 1;
X		if((screen->margin = !screen->margin) != MARGIN1) {
X			if(screen->cur_X < TEKWIDTH / 2)
X				screen->cur_X += TEKWIDTH / 2;
X		} else if(screen->cur_X >= TEKWIDTH / 2)
X			screen->cur_X -= TEKWIDTH / 2;
X	}
X	screen->cur_Y = l * t->vsize;
X}
X
XTekDraw (x, y)
Xint x, y;
X{
X	register TScreen *screen = &term->screen;
X
X	if(nplot == 0 || T_lastx != screen->cur_X || T_lasty != screen->cur_Y) {
X		/*
X		 * We flush on each unconnected line segment if the line
X		 * type is not solid.  This solves a bug in X when drawing
X		 * points while the line type is not solid.
X		 */
X		if(nplot > 0 && screen->cur.linetype != SOLIDLINE)
X			TekFlush();
X	}
X	AddToDraw(screen->cur_X, screen->cur_Y, x, y);
X	T_lastx = screen->cur_X = x;
X	T_lasty = screen->cur_Y = y;
X}
X
XAddToDraw(x1, y1, x2, y2)
Xint x1, y1, x2, y2;
X{
X	register TScreen *screen = &term->screen;
X	register XSegment *lp;
X
X	if(nplot >= MAX_PTS) {
X		TekFlush();
X	}
X	lp = line_pt++;
X	lp->x1 = x1 = x1 * TekScale(screen) + screen->border;
X	lp->y1 = y1 = (TEKHEIGHT + TEKTOPPAD - y1) * TekScale(screen) +
X	 screen->border;
X	lp->x2 = x2 = x2 * TekScale(screen) + screen->border;
X	lp->y2 = y2 = (TEKHEIGHT + TEKTOPPAD - y2) * TekScale(screen) +
X	 screen->border;
X	nplot++;
X}
X
XTekFlush ()
X{
X	register TScreen *screen = &term->screen;
X
X	XDrawSegments(screen->display, TWindow(screen), 
X		((screen->cur.linetype == SOLIDLINE)?  screen->TnormalGC :
X		 screen->linepat[screen->cur.linetype - 1]),
X		 Tline, nplot);
X	nplot = 0;
X	line_pt = Tline;
X}
X
XTekGINoff()
X{
X	register TScreen *screen = &term->screen;
X	
X	XDefineCursor(screen->display, TShellWindow, screen->arrow);
X	if(GINcursor)
X		XFreeCursor(screen->display, GINcursor);
X	if(screen->TekGIN) {
X		*screen->TekGIN = CANCEL;	/* modify recording */
X		screen->TekGIN = NULL;
X	}
X}
X
XTekEnqMouse(c)
Xint c;
X{
X	register TScreen *screen = &term->screen;
X	int mousex, mousey, rootx, rooty;
X	unsigned int mask; /* XQueryPointer */
X	Window root, subw;
X
X	XQueryPointer(
X	    screen->display, TWindow(screen), 
X	    &root, &subw,
X	    &rootx, &rooty,
X	    &mousex, &mousey,
X	    &mask);
X	if((mousex = (mousex - screen->border) / TekScale(screen)) < 0)
X		mousex = 0;
X	else if(mousex >= TEKWIDTH)
X		mousex = TEKWIDTH - 1;
X	if((mousey = TEKHEIGHT + TEKTOPPAD - (mousey - screen->border) /
X	     TekScale(screen)) < 0)
X		mousey = 0;
X	else if(mousey >= TEKHEIGHT)
X		mousey = TEKHEIGHT - 1;
X	TekEnq(c, mousex, mousey);
X}
X
XTekEnq (status, x, y)
Xint status;
Xregister int x, y;
X{
X	register TScreen *screen = &term->screen;
X	int pty = screen->respond;
X	char cplot [5];
X
X	/* Translate x and y to Tektronix code */
X	cplot[1] = 040 | ((x >> SHIFTHI) & FIVEBITS);
X	cplot[2] = 040 | ((x >> SHIFTLO) & FIVEBITS);
X	cplot[3] = 040 | ((y >> SHIFTHI) & FIVEBITS);
X	cplot[4] = 040 | ((y >> SHIFTLO) & FIVEBITS);
X	if(cplot[0] = status)
X		write (pty, cplot, 5);
X	else
X		write (pty, &cplot[1], 4);
X}
X
XTekRun()
X{
X	register TScreen *screen = &term->screen;
X	register int i;
X	
X	if(!TWindow(screen) && !TekInit()) {
X		if(VWindow(screen)) {
X			screen->TekEmu = FALSE;
X			return;
X		}
X		Exit(ERROR_TINIT);
X	}
X	if(!screen->Tshow) {
X	    XtRealizeWidget (tekWidget->core.parent);
X	    set_tek_visibility (TRUE);
X	} 
X	update_vttekmode();
X	update_vtshow();
X	update_tekshow();
X	set_tekhide_sensitivity();
X
X	Tpushback = Tpushb;
X	Tbptr = Tbuffer;
X	for(i = Tbcnt = bcnt ; i > 0 ; i--)
X		*Tbptr++ = *bptr++;
X	Tbptr = Tbuffer;
X	Ttoggled = TRUE;
X	if(!setjmp(Tekend))
X		Tekparse();
X	if(!Ttoggled) {
X		TCursorToggle(TOGGLE);
X		Ttoggled = TRUE;
X	}
X	screen->TekEmu = FALSE;
X}
X
X#define DOTTED_LENGTH 2
X#define DOT_DASHED_LENGTH 4
X#define SHORT_DASHED_LENGTH 2
X#define LONG_DASHED_LENGTH 2
X
Xstatic int dash_length[TEKNUMLINES] = {
X	DOTTED_LENGTH,
X	DOT_DASHED_LENGTH,
X	SHORT_DASHED_LENGTH,
X	LONG_DASHED_LENGTH,
X};
X
Xstatic unsigned char dotted[DOTTED_LENGTH] = {3, 1};
Xstatic unsigned char dot_dashed[DOT_DASHED_LENGTH] = {3, 4, 3, 1};
Xstatic unsigned char short_dashed[SHORT_DASHED_LENGTH] = {4, 4};
Xstatic unsigned char long_dashed[LONG_DASHED_LENGTH] = {4, 7};
X
Xstatic unsigned char *dashes[TEKNUMLINES] = {
X	dotted,
X	dot_dashed,
X	short_dashed,
X	long_dashed,
X};
X
X
X
X/*
X * The following is called the create the tekWidget
X */
X
Xstatic void TekInitialize(request, new)
X    Widget request, new;
X{
X   /* look for focus related events on the shell, because we need
X    * to care about the shell's border being part of our focus.
X    */
X    XtAddEventHandler(XtParent(new), EnterWindowMask, FALSE,
X		      HandleEnterWindow, (caddr_t)NULL);
X    XtAddEventHandler(XtParent(new), LeaveWindowMask, FALSE,
X		      HandleLeaveWindow, (caddr_t)NULL);
X    XtAddEventHandler(XtParent(new), FocusChangeMask, FALSE,
X		      HandleFocusChange, (caddr_t)NULL);
X}
X
X
Xstatic void TekRealize (gw, valuemaskp, values)
X    Widget gw;
X    XtValueMask *valuemaskp;
X    XSetWindowAttributes *values;
X{
X    TekWidget tw = (TekWidget) gw;
X    register TScreen *screen = &term->screen;
X    register int i;
X    register TekLink *tek;
X    register double d;
X    register int border = 2 * screen->border;
X    int pr;
X    XGCValues gcv;
X    int winX, winY, width, height;
X    XSizeHints sizehints;
X    char Tdefault[32];
X    extern char *malloc();
X
X    tw->core.border_pixel = term->core.border_pixel;
X
X    for (i = 0; i < TEKNUMFONTS; i++) {
X	if (!tw->tek.Tfont[i]) 
X	  tw->tek.Tfont[i] = XQueryFont (screen->display, DefaultGCID);
X	tw->tek.tobaseline[i] = tw->tek.Tfont[i]->ascent;
X    }
X
X    if((Tbuffer = (Char *)malloc(BUF_SIZE)) == NULL ||
X       (Tpushb = (Char *)malloc(10)) == NULL ||
X       (Tline = (XSegment *)malloc(MAX_VTX * sizeof(XSegment))) == NULL) {
X	fprintf (stderr, "%s: Not enough core for Tek mode\n", xterm_name);
X	goto mallocfailed;
X    }
X
X    screen->xorplane = 1;
X
X    screen->Tbackground = term->core.background_pixel;
X    screen->Tforeground = screen->foreground;
X    screen->Tcursorcolor = screen->foreground;
X
X    if (term->misc.T_geometry == NULL) {
X	int defwidth, defheight;
X
X	if (term->misc.tekSmall) {
X	    defwidth = TEKMINWIDTH;
X	    defheight = TEKMINHEIGHT;
X	} else {
X	    defwidth = TEKDEFWIDTH;
X	    defheight = TEKDEFHEIGHT;
X	}
X	sprintf (Tdefault, "=%dx%d", defwidth + border, defheight + border);
X	term->misc.T_geometry = Tdefault;
X    }
X
X    winX = 1;
X    winY = 1;
X    width = TEKDEFWIDTH + border;
X    height = TEKDEFHEIGHT + border;
X
X    pr = XParseGeometry(term->misc.T_geometry, &winX, &winY, (unsigned int *)&width, (unsigned int *)&height);
X    if ((pr & XValue) && (pr & XNegative))
X      winX += DisplayWidth(screen->display, DefaultScreen(screen->display))
X                        - width - (term->core.parent->core.border_width * 2);
X    if ((pr & YValue) && (pr & YNegative))
X      winY += DisplayHeight(screen->display, DefaultScreen(screen->display))
X	- height - (term->core.parent->core.border_width * 2);
X  
X    /* set up size hints */
X    sizehints.min_width = TEKMINWIDTH + border;
X    sizehints.min_height = TEKMINHEIGHT + border;
X    sizehints.width_inc = 1;
X    sizehints.height_inc = 1;
X    sizehints.flags = PMinSize|PResizeInc;
X    sizehints.x = winX;
X    sizehints.y = winY;
X    if ((XValue&pr) || (YValue&pr)) {
X	sizehints.flags |= USSize|USPosition;
X	sizehints.flags |= PWinGravity;
X	switch (pr & (XNegative | YNegative)) {
X	  case 0:
X	    sizehints.win_gravity = NorthWestGravity;
X	    break;
X	  case XNegative:
X	    sizehints.win_gravity = NorthEastGravity;
X	    break;
X	  case YNegative:
X	    sizehints.win_gravity = SouthWestGravity;
X	    break;
X	  default:
X	    sizehints.win_gravity = SouthEastGravity;
X	    break;
X	}
X    } else {
X	sizehints.flags |= PSize;
X    }
X    sizehints.width = width;
X    sizehints.height = height;
X    if ((WidthValue&pr) || (HeightValue&pr))
X      sizehints.flags |= USSize;
X    else sizehints.flags |= PSize;
X
X    (void) XtMakeResizeRequest ((Widget) tw, width, height,
X				&tw->core.width, &tw->core.height);
X
X    /* XXX This is bogus.  We are parsing geometries too late.  This
X     * is information that the shell widget ought to have before we get
X     * realized, so that it can do the right thing.
X     */
X    if (sizehints.flags & USPosition)
X      XMoveWindow (XtDisplay(tw), tw->core.parent->core.window,
X		   sizehints.x, sizehints.y);
X
X    XSetWMNormalHints (XtDisplay(tw), tw->core.parent->core.window,
X		       &sizehints);
X    XFlush (XtDisplay(tw));	/* get it out to window manager */
X
X    values->win_gravity = NorthWestGravity;
X    values->background_pixel = screen->Tbackground;
X
X    if((tw->core.window = TWindow(screen) = 
X	XCreateWindow (screen->display,
X		       tw->core.parent->core.window,
X		       tw->core.x, tw->core.y,
X		       tw->core.width, tw->core.height, tw->core.border_width,
X		       (int) tw->core.depth,
X		       InputOutput, CopyFromParent,
X		       ((*valuemaskp)|CWBackPixel|CWWinGravity),
X		       values)) == NULL) {
X	fprintf(stderr, "%s: Can't create Tek window\n", xterm_name);
X	free((char *)Tline);
X      mallocfailed:
X	if(Tpushb) free((char *)Tpushb);
X	if(Tbuffer) free((char *)Tbuffer);
X	Tfailed = TRUE;
X	return;
X    }
X
X    screen->Tbox = T_box;
X
X    TFullWidth(screen) = width;
X    TFullHeight(screen) = height;
X    TWidth(screen) = width - border;
X    THeight(screen) = height - border;
X    TekScale(screen) = (double)TWidth(screen) / TEKWIDTH;
X    if((d = (double)THeight(screen) / (TEKHEIGHT + TEKTOPPAD +
X				       TEKBOTTOMPAD)) < TekScale(screen))
X      TekScale(screen) = d;
X    
X
X    screen->cur.fontsize = TEK_FONT_LARGE;
X    if (tw->tek.initial_font) {
X	char *s = tw->tek.initial_font;
X
X	if (XmuCompareISOLatin1 (s, "large") == 0)
X	  screen->cur.fontsize = TEK_FONT_LARGE;
X	else if (XmuCompareISOLatin1 (s, "2") == 0 || 
X		 XmuCompareISOLatin1 (s, "two") == 0)
X	  screen->cur.fontsize = TEK_FONT_2;
X	else if (XmuCompareISOLatin1 (s, "3") == 0 || 
X		 XmuCompareISOLatin1 (s, "three") == 0)
X	  screen->cur.fontsize = TEK_FONT_3;
X	else if (XmuCompareISOLatin1 (s, "small") == 0)
X	  screen->cur.fontsize = TEK_FONT_SMALL;
X    }
X
X    gcv.graphics_exposures = TRUE;	/* default */
X    gcv.font = tw->tek.Tfont[screen->cur.fontsize]->fid;
X    gcv.foreground = screen->Tforeground;
X    gcv.background = screen->Tbackground;
X    
X    /* if font wasn't successfully opened, then gcv.font will contain
X       the Default GC's ID, meaning that we must use the server default font. 
X     */
X    TEKgcFontMask = (gcv.font == DefaultGCID) ? 0 : GCFont;
X    screen->TnormalGC = XCreateGC (screen->display, TWindow(screen), 
X				   (TEKgcFontMask|GCGraphicsExposures|
X				    GCForeground|GCBackground), &gcv);
X
X    gcv.function = GXinvert;
X    gcv.plane_mask = screen->xorplane = (screen->Tbackground ^
X					 screen->Tcursorcolor);
X    screen->TcursorGC = XCreateGC (screen->display, TWindow(screen), 
X				   (GCFunction|GCPlaneMask), &gcv);
X
X    gcv.foreground = screen->Tforeground;
X    gcv.line_style = LineOnOffDash;
X    for(i = 0 ; i < TEKNUMLINES ; i++) {
X	screen->linepat[i] = XCreateGC (screen->display, TWindow(screen),
X					(GCForeground|GCLineStyle), &gcv); 
X	XSetDashes (screen->display, screen->linepat[i], 0,
X		    (char *) dashes[i], dash_length[i]);
X    }
X
X    TekBackground(screen);
X
X    screen->margin = MARGIN1;		/* Margin 1		*/
X    screen->TekGIN = FALSE;			/* GIN off		*/
X
X
X    XDefineCursor(screen->display, TShellWindow, screen->pointer_cursor);
X
X    {	/* there's gotta be a better way... */
X	static Arg args[] = {
X	    {XtNtitle, NULL},
X	    {XtNiconName, NULL},
X	};
X	char *icon_name, *title, *tek_icon_name, *tek_title;
X
X	args[0].value = (XtArgVal)&icon_name;
X	args[1].value = (XtArgVal)&title;
X	XtGetValues (tw->core.parent, args, 2);
X	tek_icon_name = XtMalloc(strlen(icon_name)+7);
X	strcpy(tek_icon_name, icon_name);
X	strcat(tek_icon_name, "(Tek)");
X	tek_title = XtMalloc(strlen(title)+7);
X	strcpy(tek_title, title);
X	strcat(tek_title, "(Tek)");
X	args[0].value = (XtArgVal)tek_icon_name;
X	args[1].value = (XtArgVal)tek_title;
X	XtSetValues (tw->core.parent, args, 2);
X	XtFree( tek_icon_name );
X	XtFree( tek_title );
X    }
X
X    tek = TekRecord = &Tek0;
X    tek->next = (TekLink *)0;
X    tek->count = 0;
X    tek->ptr = tek->data;
X    Tpushback = Tpushb;
X    Tbptr = Tbuffer;
X    screen->cur_X = 0;
X    screen->cur_Y = TEKHOME;
X    line_pt = Tline;
X    Ttoggled = TRUE;
X    screen->page = screen->cur;
X    return;
X}
X
Xvoid TekSetFontSize (gw, newitem)
X    Widget gw;
X    int newitem;
X{
X    register TScreen *screen = &term->screen;
X    int oldsize = screen->cur.fontsize;
X    int newsize = MI2FS(newitem);
X    
X    if (oldsize == newsize) return;
X    if (!Ttoggled) TCursorToggle(TOGGLE);
X    set_tekfont_menu_item (oldsize, FALSE);
X    TekSetGCFont (newsize);
X    screen->cur.fontsize = newsize;
X    set_tekfont_menu_item (newsize, TRUE);
X    if (!Ttoggled) TCursorToggle(TOGGLE);
X}
X
Xvoid
XChangeTekColors(screen,pNew)
Xregister TScreen *screen;
XScrnColors *pNew;
X{
X	register int i;
X	XGCValues gcv;
X	 
X
X	if (COLOR_DEFINED(pNew,TEK_FG)) {
X	    screen->Tforeground=	COLOR_VALUE(pNew,TEK_FG);
X	    XSetForeground(screen->display,screen->TnormalGC,
X					   screen->Tforeground);
X	}
X	if (COLOR_DEFINED(pNew,TEK_BG)) {
X	    screen->Tbackground=	COLOR_VALUE(pNew,TEK_BG);
X	    XSetBackground(screen->display,screen->TnormalGC,
X					   screen->Tbackground);
X	}
X
X
X	if (tekWidget) {
X	    if (tekWidget->core.border_pixel == screen->Tbackground) {
X		tekWidget->core.border_pixel = screen->Tforeground;
X		tekWidget->core.parent->core.border_pixel =
X		  screen->Tforeground;
X		if (tekWidget->core.parent->core.window)
X		  XSetWindowBorder (screen->display,
X				    tekWidget->core.parent->core.window,
X				    tekWidget->core.border_pixel);
X	    }
X	}
X
X	for(i = 0 ; i < TEKNUMLINES ; i++) {
X		XSetForeground(screen->display, screen->linepat[i], 
X		 screen->Tforeground);
X	}
X
X	screen->Tcursorcolor = screen->Tforeground;
X
X	gcv.plane_mask = screen->xorplane = (screen->Tbackground ^
X					     screen->Tcursorcolor);
X	XChangeGC (screen->display, screen->TcursorGC, GCPlaneMask, &gcv);
X	TekBackground(screen);
X	return;
X}
X
XTekReverseVideo(screen)
Xregister TScreen *screen;
X{
X	register int i;
X	XGCValues gcv;
X	 
X
X	i = screen->Tbackground;
X	screen->Tbackground = screen->Tforeground;
X	screen->Tforeground = i;
X	
X	XSetForeground(screen->display, screen->TnormalGC, 
X	 screen->Tforeground);
X	XSetBackground(screen->display, screen->TnormalGC, 
X	 screen->Tbackground);
X
X	if (tekWidget) {
X	    if (tekWidget->core.border_pixel == screen->Tbackground) {
X		tekWidget->core.border_pixel = screen->Tforeground;
X		tekWidget->core.parent->core.border_pixel =
X		  screen->Tforeground;
X		if (tekWidget->core.parent->core.window)
X		  XSetWindowBorder (screen->display,
X				    tekWidget->core.parent->core.window,
X				    tekWidget->core.border_pixel);
X	    }
X	}
X
X	for(i = 0 ; i < TEKNUMLINES ; i++) {
X		XSetForeground(screen->display, screen->linepat[i], 
X		 screen->Tforeground);
X	}
X
X	screen->Tcursorcolor = screen->Tforeground;
X
X	gcv.plane_mask = screen->xorplane = (screen->Tbackground ^
X					     screen->Tcursorcolor);
X	XChangeGC (screen->display, screen->TcursorGC, GCPlaneMask, &gcv);
X	TekBackground(screen);
X}
X
XTekBackground(screen)
Xregister TScreen *screen;
X{
X	if(TWindow(screen))
X		XSetWindowBackground(screen->display, TWindow(screen), 
X		 screen->Tbackground);
X}
X
X/*
X * Toggles cursor on or off at cursor position in screen.
X */
XTCursorToggle(toggle)
Xint toggle;
X{
X	register TScreen *screen = &term->screen;
X	register int c, x, y;
X	unsigned int cellwidth, cellheight;
X
X	if (!screen->Tshow) return;
X
X	c = screen->cur.fontsize;
X	cellwidth = (unsigned) tekWidget->tek.Tfont[c]->max_bounds.width;
X	cellheight = (unsigned) (tekWidget->tek.Tfont[c]->ascent + 
X				 tekWidget->tek.Tfont[c]->descent);
X
X	x = (screen->cur_X * TekScale(screen)) + screen->border;
X	y = ((TEKHEIGHT + TEKTOPPAD - screen->cur_Y) * TekScale(screen)) +
X	 screen->border - tekWidget->tek.tobaseline[c];
X	if (toggle) {
X	   if (screen->select || screen->always_highlight) 
X		XFillRectangle(
X		    screen->display, TWindow(screen), screen->TcursorGC,
X		    x, y, cellwidth, cellheight);
X	  else { /* fix to use different GC! */
X		  screen->Tbox[c]->x = x;
X		  screen->Tbox[c]->y = y ;
X		  XDrawLines(screen->display, TWindow(screen), 
X		    screen->TcursorGC,
X		    screen->Tbox[c], NBOX, CoordModePrevious);
X	   }
X	} else {
X	   if (screen->select || screen->always_highlight) 
X		XClearArea(screen->display, TWindow(screen), x, y,
X			   cellwidth, cellheight, FALSE);
X	   else { 
X		  screen->Tbox[c]->x = x;
X		  screen->Tbox[c]->y = y ;
X		  XDrawLines(screen->display, TWindow(screen), 
X		    screen->TcursorGC,
X		    screen->Tbox[c], NBOX, CoordModePrevious);
X	   }
X	}
X}
X
Xvoid TekSimulatePageButton (reset)
X    Bool reset;
X{
X    register TScreen *screen = &term->screen;
X
X    if (reset) {
X/*      bzero ((char *)&curmodes, sizeof(Tmodes));             */
X	bzero ((char *) &screen->cur, sizeof screen->cur);
X    }
X    TekRefresh = (TekLink *)0;
X/*    screen->cur = curmodes; */
X    TekPage ();
X    screen->cur_X = 0;
X    screen->cur_Y = TEKHOME;
X}
X
X
XTekCopy()
X{
X	register TekLink *Tp;
X	register int fd;
X	register TScreen *screen = &term->screen;
X	register struct tm *tp;
X	long l;
X	char buf[32];
X
X	time(&l);
X	tp = localtime(&l);
X	sprintf(buf, "COPY%02d-%02d-%02d.%02d:%02d:%02d", tp->tm_year,
X	 tp->tm_mon + 1, tp->tm_mday, tp->tm_hour, tp->tm_min, tp->tm_sec);
X	if(access(buf, F_OK) >= 0) {	/* file exists */
X		if(access(buf, W_OK) < 0) {
X			Bell();
X			return;
X		}
X	} else if(access(".", W_OK) < 0) {	/* can't write in directory */
X		Bell();
X		return;
X	}
X	if((fd = open(buf, O_WRONLY | O_CREAT | O_TRUNC, 0644)) < 0) {
X		Bell();
X		return;
X	}
X	chown(buf, screen->uid, screen->gid);
X	sprintf(buf, "\033%c\033%c", screen->page.fontsize + '8',
X	 screen->page.linetype + '`');
X	write(fd, buf, 4);
X	Tp = &Tek0; 
X	do
X		write(fd, (char *)Tp->data, Tp->count);
X	while(Tp = Tp->next);
X	close(fd);
X}
X
X
X
END_OF_FILE
if test 41529 -ne `wc -c <'xterm/Tekproc.c'`; then
    echo shar: \"'xterm/Tekproc.c'\" unpacked with wrong size!
fi
# end of 'xterm/Tekproc.c'
fi
if test -f 'xterm/ctlseq2.txt' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xterm/ctlseq2.txt'\"
else
echo shar: Extracting \"'xterm/ctlseq2.txt'\" \(8473 characters\)
sed "s/^X//" >'xterm/ctlseq2.txt' <<'END_OF_FILE'
XDate: 12 Sep 89 17:44:43 GMT
XFrom: crdgw1!montnaro@uunet.uu.net  (Skip Montanaro)
XOrganization: GE Corporate Research & Development, Schenectady, NY
XSubject: XTerm Escape Sequences (X11 Version)
XTo: xpert@expo.lcs.mit.edu
X
XI rummaged around through the xterm code and came up with the following
Xstuff. No guarantees. I'm headed out of town for a couple days and thought
Xit better to get it out than let it get stale. Comments, bugs, and other
Xnotes are welcome. Somebody else can convert it to troff. I prefer LaTeX.
X:-) I will try and get to the Tek mode stuff when I return, although I doubt
Xit's changed much from X10 XTerm.
X
XI gleaned the basic stuff out of the charproc.c code, by hacking VTparse()
Xso it spit out leaves of the parse tree. I was mildly surprised to see
Xthings like "ESC # BEL" turn up.
X
XFor most folks, the most interesting stuff will probably be "ESC ] Ps ND
Xstring NP" down near the bottom. That's what you use to change the icon and
Xwindow labels, and the log file name. Most other things appear the same as
Xthe X10 documentation, although a few DEC-ish mode parameters (42, 43, 48, &
X49) seem to have disappeared.
X
X------------------------------------------------------------------------------
XBEL		Bell (Ctrl-G)
XBS		Backspace (Ctrl-H)
XHT		Horizontal Tab (Ctrl-I)
XNL		Line Feed or New Line (Ctrl-J)
XVT		Vertical Tab (Ctrl-K)
XNP		Form Feed or New Page (Ctrl-L)
XCR		Carriage Return (Ctrl-M)
XSO		Shift Out (Ctrl-N) -> Switch to Alternate Character Set
XSI		Shift In (Ctrl-O) -> Switch to Standard Character Set
XESC BEL		(Same as non-escaped BEL)
XESC BS		(Same as non-escaped BS)
XESC HT		(Same as non-escaped HT)
XESC NL		(Same as non-escaped NL)
XESC VT		(Same as non-escaped VT)
XESC NP		(Same as non-escaped NP)
XESC CR		(Same as non-escaped CR)
XESC SO		(Same as non-escaped SO)
XESC SI		(Same as non-escaped SI)
XESC # BEL	(Same as non-escaped BEL)
XESC # BS	(Same as non-escaped BS)
XESC # HT	(Same as non-escaped HT)
XESC # NL	(Same as non-escaped NL)
XESC # VT	(Same as non-escaped VT)
XESC # NP	(Same as non-escaped NP)
XESC # CR	(Same as non-escaped CR)
XESC # SO	(Same as non-escaped SO)
XESC # SI	(Same as non-escaped SI)
XESC # 8		DEC Screen Alignment Test (DECALN)
XESC ( BEL	(Same as non-escaped BEL)
XESC ( BS	(Same as non-escaped BS)
XESC ( HT	(Same as non-escaped HT)
XESC ( NL	(Same as non-escaped NL)
XESC ( VT	(Same as non-escaped VT)
XESC ( NP	(Same as non-escaped NP)
XESC ( CR	(Same as non-escaped CR)
XESC ( SO	(Same as non-escaped SO)
XESC ( SI	(Same as non-escaped SI)
XESC ( C		Select G0 Character Set (SCS)
X		C = 0 -> Special Character and Line Drawing Set
X		C = 1 -> Alternate Character ROM Standard Set
X		C = 2 -> Alternate Character ROM Special Set
X		C = A -> United Kingdom (UK)
X		C = B -> United States (USASCII)
XESC ) C		Select G1 Character Set (SCS)
X		C takes same values as above
XESC * C		Select G2 Character Set (SCS)
X		C takes same values as above
XESC + C		Select G3 Character Set (SCS)
X		C takes same values as above
XESC 7		Save Cursor (DECSC)
XESC 8		Restore Cursor (DECRC)
XESC =		Application Keypad (DECPAM)
XESC >		Normal Keypad (DECNM)
XESC D		Index (IND)
XESC E		Next Line (NEL)
XESC H		Tab Set (HTS)
XESC M		Reverse Index (RI)
XESC N		Single Shift Select of G2 Character Set (SS2)
XESC O		Single Shift Select of G3 Character Set (SS3)
XESC [ BEL	(Same as non-escaped BEL)
XESC [ BS	(Same as non-escaped BS)
XESC [ HT	(Same as non-escaped HT)
XESC [ NL	(Same as non-escaped NL)
XESC [ VT	(Same as non-escaped VT)
XESC [ NP	(Same as non-escaped NP)
XESC [ CR	(Same as non-escaped CR)
XESC [ SO	(Same as non-escaped SO)
XESC [ SI	(Same as non-escaped SI)
XESC [ ? BEL	(Same as non-escaped BEL)
XESC [ ? BS	(Same as non-escaped BS)
XESC [ ? HT	(Same as non-escaped HT)
XESC [ ? NL	(Same as non-escaped NL)
XESC [ ? VT	(Same as non-escaped VT)
XESC [ ? NP	(Same as non-escaped NP)
XESC [ ? CR	(Same as non-escaped CR)
XESC [ ? SO	(Same as non-escaped SO)
XESC [ ? SI	(Same as non-escaped SI)
XESC [ ? Ps h	DEC Private Mode Set (DECSET)
X		Ps = 1 -> Application Cursor Keys (DECCKM)
X		Ps = 2 -> Set VT52 Mode
X		Ps = 3 -> 132 Column Mode (DECCOLM)
X		Ps = 4 -> Smooth (Slow) Scroll (DECSCLM)
X		Ps = 5 -> Reverse Video (DECSCNM)
X		Ps = 6 -> Origin Mode (DECOM)
X		Ps = 7 -> Wraparound Mode (DECAWM)
X		Ps = 8 -> Auto-Repeat Keys (DECARM)
X		Ps = 9 -> Send MIT Mouse Row & Column on Button
X			  Press
X		Ps = 38 -> Enter Tektronix Mode (DECTEK)
X		Ps = 40 -> Allow 80 <-> 132 Mode
X		Ps = 41 -> curses(5) fix
X		Ps = 44 -> Turn on Margin Bell
X		Ps = 45 -> Reverse-wraparound Mode
X		Ps = 46 -> Start Logging
X		Ps = 47 -> Use Alternate Screen Buffer
X		Ps = 1000 -> xtem bogus sequence (???)
X		Ps = 1001 -> xtem sequence w/hilite tracking (???)
XESC [ ? Ps l	DEC Private Mode Reset (DECRST)
X		Ps = 1 -> Normal Cursor Keys (DECCKM)
X		Ps = 3 -> 80 Column Mode (DECCOLM)
X		Ps = 4 -> Jump (Fast) Scroll (DECSCLM)
X		Ps = 5 -> Normal Video (DECSCNM)
X		Ps = 6 -> Normal Cursor Mode (DECOM)
X		Ps = 7 -> No Wraparound Mode (DECAWM)
X		Ps = 8 -> No Auto-Repeat Keys (DECARM)
X		Ps = 9 -> Don't Send MIT Mouse Row & Column on
X			  Button Press
X		Ps = 40 -> Don't Allow 80 <-> 132 Mode
X		Ps = 41 -> No curses(5) fix
X		Ps = 44 -> Turn Off Margin Bell
X		Ps = 45 -> No Reverse-wraparound Mode
X		Ps = 46 -> Stop Logging
X		Ps = 47 -> Use Normal Screen Buffer
X		Ps = 1000 -> xtem bogus sequence (???)
X		Ps = 1001 -> xtem sequence w/hilite tracking (???)
XESC [ ? Ps r	Restore DEC Private Mode
X		Ps = 1 -> Normal/Application Cursor Keys (DECCKM)
X		Ps = 3 -> 80/132 Column Mode (DECCOLM)
X		Ps = 4 -> Jump (Fast)/Smooth (Slow) Scroll (DECSCLM)
X		Ps = 5 -> Normal/Reverse Video (DECSCNM)
X		Ps = 6 -> Normal/Origin  Cursor Mode (DECOM)
X		Ps = 7 -> No Wraparound/Wraparound Mode (DECAWM)
X		Ps = 8 -> Auto-repeat/No Auto-repeat Keys (DECARM)
X		Ps = 9 -> Don't Send/Send MIT Mouse Row & Column on
X			  Button Press
X		Ps = 40 -> Disallow/Allow 80 <-> 132 Mode
X		Ps = 41 -> Off/On curses(5) fix
X		Ps = 44 -> Turn Off/On Margin Bell
X		Ps = 45 -> No Reverse-wraparound/Reverse-wraparound
X			   Mode 
X		Ps = 46 -> Stop/Start Logging
X		Ps = 47 -> Use Normal/Alternate Screen Buffer
X		Ps = 1000 -> mouse bogus sequence (???)
X		Ps = 1001 -> mouse bogus sequence (???)
XESC [ ? Ps s	Save DEC Private Mode
X			Same P's as Restore DEC Private Mode
XESC [ Ps @	Insert Ps (Blank) Character(s) (default = 1) (ICH)
XESC [ Ps A	Cursor Up Ps Times (default = 1) (CUU)
XESC [ Ps B	Cursor Down Ps Times (default = 1) (CUD)
XESC [ Ps C	Cursor Forward Ps Times (default = 1) (CUF)
XESC [ Ps D	Cursor Backward Ps Times (default = 1) (CUB)
XESC [ Ps ; Ps H	Cursor Position [row;column] (default = [1,1]) (CUP)
XESC [ Ps J	Erase in Display
X		Ps = 0 -> Clear Below (default)
X		Ps = 1 -> Clear Above
X		Ps = 2 -> Clear All
XESC [ Ps K	Erase in Line
X		Ps = 0 -> Clear to Right (default)
X		Ps = 1 -> Clear to Left
X		Ps = 2 -> Clear All
XESC [ Ps L	Insert Ps lines (default = 1) (IL)
XESC [ Ps M	Delete Ps lines (default = 1) (DL)
XESC [ Ps P	Delete Ps Characters (default = 1) (DCH)
XESC [ T		Track Mouse (???)
XESC [ Ps c	Device Attributes (DA1)
XESC [ Ps ; Ps f	Cursor Position [row;column] (default = [1,1]) (HVP)
XESC [ Ps g	Tab Clear
X		Ps = 0 -> Clear Current Column (default)
X		Ps = 3 -> Clear All
XESC [ Ps h	Mode Set (SET)
X		Ps = 4 -> Insert Mode (IRM)
X		Ps = 20 -> Automatic Linefeed (LNM)
XESC [ Ps l	Mode Reset (RST)
X		Ps = 4 -> Insert Mode (IRM)
X		Ps = 20 -> Automatic Linefeed (LNM)
XESC [ Pm m	Character Attributes (SGR)
X		Ps = 0 -> Normal (default)
X		Ps = 1 -> Blink (appears as Bold)
X		Ps = 4 -> Underscore
X		Ps = 5 -> Bold
X		Ps = 7 -> Inverse
XESC [ Ps n	Device Status Report (DSR)
X		Ps = 5 -> Status Report ESC [ 0 n -> OK
X		Ps = 6 -> Report Cursor Position (CPR) [row;column]
X			  as ESC [ r ; c R
XESC [ Ps ; Ps r	Set Scrolling Region [top;bottom] (default = full size
X		of window) (DECSTBM)
XESC [ Ps x	Request Terminal Parameters (DECREQTPARM)
XESC ] Ps ND string NP		OSC Mode
X		ND can be any non-digit Character (it's discarded)
X		NP can be any non-printing Character (it's discarded)
X		string can be any ASCII printable string
X			(max 511 characters)
X		Ps = 0 -> use string as a new icon name and title
X		Ps = 1 -> use string is a new icon name only
X		Ps = 2 -> use string is a new title only
X		Ps = 46 -> use string as a new log file name
X		
XESC c		Full Reset
XESC n		Switch to Alternate Character Set LS2
XESC o		Switch to Alternate Character Set LS3
XESC |		Switch to Alternate Graphics(?) Set LS3R
XESC }		Switch to Alternate Graphics(?) Set LS2R
XESC ~		Switch to Alternate Graphics(?) Set LS1R
X--
XSkip Montanaro (montanaro@crdgw1.ge.com)
END_OF_FILE
if test 8473 -ne `wc -c <'xterm/ctlseq2.txt'`; then
    echo shar: \"'xterm/ctlseq2.txt'\" unpacked with wrong size!
fi
# end of 'xterm/ctlseq2.txt'
fi
if test -f 'xterm/main.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xterm/main.h'\"
else
echo shar: Extracting \"'xterm/main.h'\" \(1328 characters\)
sed "s/^X//" >'xterm/main.h' <<'END_OF_FILE'
X/*
X *	$XConsortium: main.h,v 1.3 88/09/06 17:08:12 jim Exp $
X */
X
X
X#include <X11/copyright.h>
X
X/*
X * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
X *
X *                         All Rights Reserved
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted,
X * provided that the above copyright notice appear in all copies and that
X * both that copyright notice and this permission notice appear in
X * supporting documentation, and that the name of Digital Equipment
X * Corporation not be used in advertising or publicity pertaining to
X * distribution of the software without specific, written prior permission.
X *
X *
X * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
X * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
X * SOFTWARE.
X */
X
X/* @(#)main.h\tX10/6.6\t11/10/86 */
X
X#define	DEFBOLDFONT		"fixed"
X#define	DEFBORDER		2
X#define	DEFBORDERWIDTH		2
X#define	DEFFONT			"fixed"
END_OF_FILE
if test 1328 -ne `wc -c <'xterm/main.h'`; then
    echo shar: \"'xterm/main.h'\" unpacked with wrong size!
fi
# end of 'xterm/main.h'
fi
if test ! -d 'xterm/tektests' ; then
    echo shar: Creating directory \"'xterm/tektests'\"
    mkdir 'xterm/tektests'
fi
echo shar: End of archive 1 \(of 14\).
cp /dev/null ark1isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 14 archives.
    rm -f ark[1-9]isdone ark[1-9][0-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0
dan
----------------------------------------------------
O'Reilly && Associates   argv@sun.com / argv@ora.com
Opinions expressed reflect those of the author only.