(FILECREATED "10-Jun-85 16:42:15" {ERIS}<LISPCORE>LIBRARY>TEK4010CHAT.;4 21584  

      changes to:  (FNS TEK4010CHAT.INIT)

      previous date: "24-May-85 15:38:44" {DSK}<LISPFILES>TEK4010CHAT.;7)


(* Copyright (c) 1985 by Xerox Corporation. All rights reserved.)

(PRETTYCOMPRINT TEK4010CHATCOMS)

(RPAQQ TEK4010CHATCOMS [(RECORDS TEK4010.STATE)
	(FNS TEK4010.ALPHASTATE TEK4010.CLEAR TEK4010.CLOSEFN TEK4010.CROSSHAIR TEK4010CHAT.INIT 
	     TEK4010.NEXTSTATE TEK4010.RELMOVETO TEK4010.SENDCOORD TEK4010CHAT.BUTTONFN 
	     TEK4010CHAT.HANDLECHAR TEK4010CHAT.MENUFN TEK4010.GRAPHICSSTATE TEK4010.CTRLCHAR 
	     TEK4010.ESCAPECHAR TEK4010.GLOMHI&LO TEK4010.MOVETO TEK4010.DRAWTO)
	(INITVARS (TEK4010CHAT.MENU NIL))
	(VARS TEK4010CHAT.MENUITEMS)
	(ADDVARS (CHAT.DRIVERTYPES (TEK4010 TEK4010CHAT.HANDLECHAR TEK4010CHAT.INIT])
[DECLARE: EVAL@COMPILE 

(DATATYPE TEK4010.STATE (CURRENTSTATE PREVSTATE (HIX INTEGER)
				      (LOX INTEGER)
				      (HIY INTEGER)
				      (LOY INTEGER)
				      (INBYTE BITS 8)
				      (HI2BITS BITS 2)
				      (LO5BITS BITS 5)
				      BYTESTATE
				      (DRAWP FLAG)
				      (ROW INTEGER)
				      (MARGIN INTEGER))
			CURRENTSTATE ←(QUOTE TEK4010.ALPHASTATE)
			HIX ← 0 LOX ← 0 HIY ← 0 LOY ← 0 INBYTE ← 0 HI2BITS ← 0 LO5BITS ← 0 ROW ← 1 
			MARGIN ← 0)
]
(/DECLAREDATATYPE (QUOTE TEK4010.STATE)
		  (QUOTE (POINTER POINTER FIXP FIXP FIXP FIXP (BITS 8)
				  (BITS 2)
				  (BITS 5)
				  POINTER FLAG FIXP FIXP))
		  (QUOTE ((TEK4010.STATE 0 POINTER)
			  (TEK4010.STATE 2 POINTER)
			  (TEK4010.STATE 4 FIXP)
			  (TEK4010.STATE 6 FIXP)
			  (TEK4010.STATE 8 FIXP)
			  (TEK4010.STATE 10 FIXP)
			  (TEK4010.STATE 2 (BITS . 7))
			  (TEK4010.STATE 0 (BITS . 1))
			  (TEK4010.STATE 0 (BITS . 36))
			  (TEK4010.STATE 12 POINTER)
			  (TEK4010.STATE 12 (FLAGBITS . 0))
			  (TEK4010.STATE 14 FIXP)
			  (TEK4010.STATE 16 FIXP)))
		  (QUOTE 18))
(DEFINEQ

(TEK4010.ALPHASTATE
  [LAMBDA (CHAT.STATE STATE)                                 (* AJB "15-May-85 17:14")

          (* This function resets the DRAWP and BYTESTATE fields to NIL such that the next time GRAPHICSSTATE is entered, it 
	  will be clean, and then either outputs the alpha character or calls the control char routine if the high 2 bits are 
	  zero.)


    (replace DRAWP of STATE with NIL)
    (replace BYTESTATE of STATE with NIL)
    (COND
      ((ZEROP (fetch HI2BITS of STATE))
	(TEK4010.CTRLCHAR CHAT.STATE STATE))
      (T (BOUT (FETCH (CHAT.STATE DSP) OF CHAT.STATE)
	       (fetch INBYTE of STATE])

(TEK4010.CLEAR
  [LAMBDA (CHAT.STATE WINDOW)                                (* AJB "15-May-85 18:46")
                                                             (* This functions clears the screen and resets the 
							     cursor to the top left corner)
    (LET ((OUTSTREAM (fetch (CHAT.STATE DSP) of CHAT.STATE))
       (STATE (fetch (CHAT.STATE TERM.STATE) of CHAT.STATE)))
      (CARET (QUOTE OFF))
      (DSPRESET OUTSTREAM)
      (CARET T)
      (replace ROW of STATE with 1)
      (replace MARGIN of STATE with 0)
      (TEK4010.NEXTSTATE STATE (QUOTE TEK4010.ALPHASTATE))
      (replace BYTESTATE of STATE with NIL)
      (replace DRAWP of STATE with NIL)
      (DSPLEFTMARGIN 0 OUTSTREAM)
      (DSPRIGHTMARGIN 1024 OUTSTREAM])

(TEK4010.CLOSEFN
  [LAMBDA (WINDOW)                                           (* AJB "30-Apr-85 12:00")
                                                             (* This function resets the window back to a default 
							     state)
    (WINDOWDELPROP WINDOW (QUOTE CLOSEFN)
		   (FUNCTION TEK4010.CLOSEFN))               (* Remove this close function so it doesn't get called 
							     again)
    (DSPOPERATION (QUOTE REPLACE)
		  WINDOW)                                    (* Restore REPLACE mode for BITBLT)
                                                             (* Turn scrolling back on)
    (DSPSCROLL (QUOTE ON)
	       WINDOW])

(TEK4010.CROSSHAIR
  [LAMBDA (WINDOW)                                           (* edited: "26-Apr-85 16:14")
                                                             (* Moves crosshair around screen until anykey is struct
							     and then returns X Y location)
    (PROG [(WIDTH (WINDOWPROP WINDOW (QUOTE WIDTH)))
	   (HEIGHT (WINDOWPROP WINDOW (QUOTE HEIGHT)))
	   (REGION (WINDOWPROP WINDOW (QUOTE REGION)))
	   (OUTSTREAM (WINDOWPROP WINDOW (QUOTE DSP]
          (LET* [(LEFT 0)
	     (RIGHT (PLUS LEFT WIDTH))
	     (BOTTOM 0)
	     (TOP (PLUS BOTTOM HEIGHT))
	     (LASTY (LASTMOUSEY WINDOW))
	     (LASTX (LASTMOUSEX WINDOW))
	     (CROSSHAIRX (WINDOWPROP WINDOW (QUOTE CROSSHAIRX)))
	     (CROSSHAIRY (WINDOWPROP WINDOW (QUOTE CROSSHAIRY]
	    (COND
	      [CROSSHAIRX (COND
			    ((NEQ CROSSHAIRX LASTX)
			      (BLTVLINE CROSSHAIRX 0 HEIGHT WINDOW GRAYSHADE)
			      (BLTVLINE LASTX 0 HEIGHT WINDOW GRAYSHADE]
	      (T (SETQ LASTX (COND
		     ((LESSP LASTX LEFT)
		       LEFT)
		     ((GREATERP LASTX RIGHT)
		       (DIFFERENCE RIGHT 2))
		     (T LASTX)))
		 (BLTVLINE LASTX 0 HEIGHT WINDOW GRAYSHADE)))
	    (WINDOWPROP WINDOW (QUOTE CROSSHAIRX)
			LASTX)
	    (COND
	      [CROSSHAIRY (COND
			    ((NEQ CROSSHAIRY LASTY)
			      (BLTHLINE CROSSHAIRY 0 WIDTH WINDOW GRAYSHADE)
			      (BLTHLINE LASTY 0 WIDTH WINDOW GRAYSHADE]
	      (T (SETQ LASTY (COND
		     ((LESSP LASTY BOTTOM)
		       BOTTOM)
		     ((GREATERP LASTY TOP)
		       (DIFFERENCE TOP 2))
		     (T LASTY)))
		 (BLTHLINE LASTY 0 WIDTH WINDOW GRAYSHADE)))
	    (WINDOWPROP WINDOW (QUOTE CROSSHAIRY)
			LASTY])

(TEK4010CHAT.INIT
  [LAMBDA (CHAT.STATE)                                       (* AJB "10-Jun-85 16:41")
    (PROG* ((OUTSTREAM (fetch (CHAT.STATE DSP) OF CHAT.STATE))
	    (WINDOW (WFROMDS OUTSTREAM)))
           (DSPFONT (QUOTE (GACHA 12 MRR))
		    OUTSTREAM)
           (WINDOWADDPROP WINDOW (QUOTE CLOSEFN)
			  (FUNCTION TEK4010.CLOSEFN)
			  T)                                 (* Add close function to restore state back)
                                                             (* NOTE: CLOSE function must be put at beginning of 
							     property list for CLOSEFN WINDOWPROP)
           (WINDOWPROP WINDOW (QUOTE CURSORMOVEDFN)
		       NIL)                                  (* Make sure crosshair function is disabled)
           (WINDOWPROP WINDOW (QUOTE CROSSHAIRX)
		       NIL)
           (WINDOWPROP WINDOW (QUOTE CROSSHAIRY)
		       NIL)
           (DSPLEFTMARGIN 0 OUTSTREAM)
           (DSPRIGHTMARGIN 1024 OUTSTREAM)                   (* Wrap only at 1024)
           (DSPOPERATION (QUOTE PAINT)
			 OUTSTREAM)                          (* Set BITBLT to OR bits since this is emulating a 
							     storage tube device)
           (SETQ CHAT.EMULATORTYPE (QUOTE TEK4010))
           (WINDOWPROP WINDOW (QUOTE BUTTONEVENTFN)
		       (FUNCTION TEK4010CHAT.BUTTONFN))
           (RETURN (CREATE TEK4010.STATE])

(TEK4010.NEXTSTATE
  [LAMBDA (STATE NEXTSTATE)                                  (* AJB "15-May-85 16:47")
                                                             (* This function replaces the state of the emulator 
							     which is either ALPHASTATE or GRAPHICSSTATE in the 
							     STATE instance of the TEK4010.STATE datatype)
    (replace PREVSTATE of STATE with (fetch CURRENTSTATE of STATE))
    (replace CURRENTSTATE of STATE with NEXTSTATE])

(TEK4010.RELMOVETO
  [LAMBDA (RELX RELY STREAM)                                 (* edited: "29-Apr-85 15:36")
    (RELMOVETO RELX RELY STREAM])

(TEK4010.SENDCOORD
  [LAMBDA (STREAM COORD)                                     (* AJB "30-Apr-85 12:13")
                                                             (* Send X or Y crosshair coordinate back to computer)
    (BOUT STREAM (IPLUS (LRSH (OR (NUMBERP COORD)
				  0)
			      5)
			32))
    (BOUT STREAM (IPLUS (LOGAND (OR (NUMBERP COORD)
				    0)
				31)
			64])

(TEK4010CHAT.BUTTONFN
  [LAMBDA (WINDOW)                                           (* AJB "24-May-85 15:27")
    (COND
      ((LASTMOUSESTATE LEFT)
	(CHAT.HOLD WINDOW))
      ((LASTMOUSESTATE MIDDLE)
	(TEK4010CHAT.MENUFN WINDOW])

(TEK4010CHAT.HANDLECHAR
  [LAMBDA (CH CHAT.STATE STATE)                              (* AJB "15-May-85 16:28")

          (* This function is called by CHAT to handle a single char from the input stream ; stores the char in INBYTE, the 
	  high 2 bits in HI2BITS, and the lower 5 bits in LO5BITS in the instance of the TEK4010.STATE DATATYPE parameter 
	  called STATE It then fetches the current state of the emulator (GRAPHICSSTATE or ALPHASTATE) and executes the 
	  corresponding named function. Currently the initialization is triggered from here, since CHAT has no initialize hook
	  for other emulators.)


    (replace INBYTE of STATE with CH)
    (replace HI2BITS of STATE with (LRSH (fetch INBYTE of STATE)
					 5))
    (replace LO5BITS of STATE with (LOGAND (fetch INBYTE of STATE)
					   31))
    (APPLY* (fetch CURRENTSTATE of STATE)
	    CHAT.STATE STATE])

(TEK4010CHAT.MENUFN
  [LAMBDA (WINDOW)                                           (* AJB "24-May-85 15:33")
    (DECLARE (GLOBALVARS TEK4010CHAT.MENU)
	     (SPECVARS WINDOW STATE))                        (* Called by YELLOW)
    (PROG ((STATE (WINDOWPROP WINDOW (QUOTE CHATSTATE)))
	   COMMAND)
          [COND
	    ((NOT STATE)                                     (* No Connection here; try to reestablish)
	      (RETURN (COND
			((LASTMOUSESTATE MIDDLE)
			  (CHAT.RECONNECT WINDOW))
			(T (TOTOPW WINDOW]
          (replace (CHAT.STATE HELD) of STATE with T)
          (\CHECKCARET WINDOW)
          (SELECTQ [SETQ COMMAND (MENU (OR TEK4010CHAT.MENU (SETQ TEK4010CHAT.MENU
					     (create MENU
						     ITEMS ← TEK4010CHAT.MENUITEMS]
		   (Close (replace (CHAT.STATE RUNNING?) of STATE with (QUOTE CLOSE))
                                                             (* Ask CHAT.TYPEIN to shut things down.)
			  )
		   (New (replace (CHAT.STATE RUNNING?) of STATE with (QUOTE CLOSE))
			(WINDOWPROP WINDOW (QUOTE KEEPCHAT)
				    (QUOTE NEW)))
		   (Suspend (replace (CHAT.STATE RUNNING?) of STATE with (QUOTE CLOSE))
			    (WINDOWPROP WINDOW (QUOTE KEEPCHAT)
					T))
		   (Freeze                                   (* Leave in HELD state)
			   (RETURN))
		   (NIL)
		   (APPLY* COMMAND STATE WINDOW))
          (replace (CHAT.STATE HELD) of STATE with NIL])

(TEK4010.GRAPHICSSTATE
  [LAMBDA (CHAT.STATE STATE)                                 (* AJB "15-May-85 17:17")

          (* This function collects up to 4 bytes of XY position, ie, HIX, HIY, LOY, LOX and does a MOVETO or DRAWTO when the 
	  last byte is received which is always LOX. The previous values of HIX, HIY, & LOY may be used to move or draw, Only 
	  a new LOX is required to evoke the operation.)



          (* The high 2 bits of the byte are used to indicate which byte is being received, however if it is zero, then it is 
	  a control char and handled by the CTRLCHAR routine. The other bytes are determined as follows: 1 => HIY or HIX;
	  2 => LOX; 3 => LOY Notice there are 2 possibilities for the high 2 bits=1. The proper byte is determined by which 
	  byte was collected the last time. So to keep track of this a field called BYTESTATE is maintained in the STATE 
	  record to remember the previous byte)



          (* When the state goes from ALPHAMODE to GRAPHICSMODE, the first set of bytes are used to do a MOVETO, and 
	  subsequent sets of bytes are used to do DRAWTOs. The only way to do a subsequent MOVETO is reenter GRAPHICSMODE 
	  using a control character such as 29 which enters GRAPHICSMODE. This is the way that positioning text must be done)


    (LET ((HI2BITS (fetch HI2BITS of STATE))
       (LO5BITS (fetch LO5BITS of STATE))
       (BYTESTATE (fetch BYTESTATE of STATE))
       (INSTREAM (FETCH (CHAT.STATE INSTREAM) OF CHAT.STATE))
       (OUTSTREAM (FETCH (CHAT.STATE DSP) OF CHAT.STATE)))
      (SELECTQ HI2BITS
	       (0 (TEK4010.CTRLCHAR CHAT.STATE STATE))
	       [1 (COND
		    ((EQUAL BYTESTATE (QUOTE LOY))
		      (replace HIX of STATE with LO5BITS)
		      (replace BYTESTATE of STATE with (QUOTE HIX)))
		    (T (replace HIY of STATE with LO5BITS)
		       (replace BYTESTATE of STATE with (QUOTE HIY]
	       [2 (replace LOX of STATE with LO5BITS)
		  (replace BYTESTATE of STATE with (QUOTE LOX))
		  (COND
		    ((fetch DRAWP of STATE)
		      (TEK4010.DRAWTO (TEK4010.GLOMHI&LO (fetch HIX of STATE)
							 (fetch LOX of STATE))
				      (TEK4010.GLOMHI&LO (fetch HIY of STATE)
							 (fetch LOY of STATE))
				      1 NIL OUTSTREAM))
		    (T (TEK4010.MOVETO (TEK4010.GLOMHI&LO (fetch HIX of STATE)
							  (fetch LOX of STATE))
				       (TEK4010.GLOMHI&LO (fetch HIY of STATE)
							  (fetch LOY of STATE))
				       OUTSTREAM)
		       (replace DRAWP of STATE with T]
	       (3 (replace LOY of STATE with LO5BITS)
		  (replace BYTESTATE of STATE with (QUOTE LOY)))
	       (SHOULDNT])

(TEK4010.CTRLCHAR
  [LAMBDA (CHAT.STATE STATE)                                 (* AJB "15-May-85 17:17")
                                                             (* This function performs various control char 
							     functions such as CR, LF, enter GRAPHICSSTATE or 
							     ALPHASTATE, ring the bell, clear the screen, etc.)
    (LET* ((INSTREAM (FETCH (CHAT.STATE INSTREAM) OF CHAT.STATE))
       (OUTSTREAM (FETCH (CHAT.STATE DSP) OF CHAT.STATE))
       (LO5BITS (fetch LO5BITS of STATE))
       (HI2BITS (fetch HI2BITS of STATE))
       (SPACEWIDTH (CHARWIDTH (CHARCODE SPACE)
			      OUTSTREAM))
       (SPACEHEIGHT 22))
      (SELCHARQ LO5BITS
		(↑D (TEK4010.NEXTSTATE STATE (FUNCTION TEK4010.ALPHASTATE)))
		(↑G (replace DRAWP of STATE with NIL)
		    (replace BYTESTATE of STATE with NIL)
		    (RINGBELLS 1))
		(BS (TEK4010.RELMOVETO (IMINUS SPACEWIDTH)
				       0 OUTSTREAM)
		    (replace DRAWP of STATE with NIL)
		    (replace BYTESTATE of STATE with NIL))
		(TAB (TEK4010.RELMOVETO SPACEWIDTH 0 OUTSTREAM)
		     (replace DRAWP of STATE with NIL)
		     (replace BYTESTATE of STATE with NIL))
		[LF (TEK4010.RELMOVETO 0 (IMINUS SPACEHEIGHT)
				       OUTSTREAM)
		    (replace DRAWP of STATE with NIL)
		    (replace BYTESTATE of STATE with NIL)
		    (add (fetch ROW of STATE)
			 1)
		    (COND
		      ((GREATERP (fetch ROW of STATE)
				 35)
			(replace ROW of STATE with 1)        (* at bottom of screen, clear screen and pos to top -
							     no scrolling)
                                                             (* Determine whether to goto margin 1 
							     (top/middle of screen) or margin 0 
							     (top/left) of screen)
			(COND
			  ((NEQ (fetch MARGIN of STATE)
				0)
			    (replace MARGIN of STATE with 0)
			    (DSPLEFTMARGIN 0 OUTSTREAM)
			    (MOVETO 0 (IDIFFERENCE (WINDOWPROP (WFROMDS OUTSTREAM)
							       (QUOTE HEIGHT))
						   (FONTPROP OUTSTREAM (QUOTE HEIGHT)))
				    OUTSTREAM))
			  (T (replace MARGIN of STATE with 512)
			     (DSPXPOSITION 512 OUTSTREAM)
			     (DSPLEFTMARGIN 512 OUTSTREAM)
			     (DSPYPOSITION (WINDOWPROP (WFROMDS OUTSTREAM)
						       (QUOTE HEIGHT))
					   OUTSTREAM]
		(↑K (TEK4010.RELMOVETO 0 SPACEHEIGHT OUTSTREAM)
		    (replace DRAWP of STATE with NIL)
		    (replace BYTESTATE of STATE with NIL))
		(ESC (TEK4010.ESCAPECHAR CHAT.STATE STATE))
		(↑                                          (* 29)
		    (replace DRAWP of STATE with NIL)
		    (replace BYTESTATE of STATE with NIL)
		    (TEK4010.NEXTSTATE STATE (FUNCTION TEK4010.GRAPHICSSTATE)))
		(CR (MOVETO (fetch MARGIN of STATE)
			    (DSPYPOSITION NIL OUTSTREAM)
			    OUTSTREAM)
		    (TEK4010.NEXTSTATE STATE (FUNCTION TEK4010.ALPHASTATE)))
		(↑←                                          (* 31)
		    (TEK4010.NEXTSTATE STATE (FUNCTION TEK4010.ALPHASTATE)))
		NIL])

(TEK4010.ESCAPECHAR
  [LAMBDA (CHAT.STATE STATE)                                 (* AJB "15-May-85 18:15")
                                                             (* Handles ESCAPE sequences.)
    (LET* ((INSTREAM (fetch (CHAT.STATE INSTREAM) of CHAT.STATE))
       (OUTSTREAM (fetch (CHAT.STATE DSP) of CHAT.STATE))
       (CHAR (LOGAND (BIN INSTREAM)
		     127))
       (WINDOW (WFROMDS OUTSTREAM))
       (SSTREAM (fetch (CHAT.STATE OUTSTREAM) of CHAT.STATE))
       (WIDTH (WINDOWPROP WINDOW (QUOTE WIDTH)))
       (HEIGHT (WINDOWPROP WINDOW (QUOTE HEIGHT)))
       PREVPROC PREVDS CROSSHAIRX CROSSHAIRY)
      (COND
	((EQ CHAR (CHARCODE FF))                             (* ESC FF clears screen and resets cursor to top, and 
							     switches to (if not already in) alphamode)
	  (DSPRESET OUTSTREAM)
	  (TEK4010.NEXTSTATE STATE (FUNCTION TEK4010.ALPHASTATE)))
	((EQ CHAR (CHARCODE ↑Z))

          (* Go into Graphic Input Mode. Display crosshairs while tracking mouse, until 1st keyboard character is entered.
	  Then send character plus location of crosshair back to computer)


	  (TEK4010.CROSSHAIR WINDOW)                         (* DISPLAY CROSSHAIR)
	  (RESETLST (RESETSAVE (WINDOWPROP WINDOW (QUOTE CURSORMOVEDFN)
					   (FUNCTION TEK4010.CROSSHAIR))
			       (LIST (FUNCTION WINDOWPROP)
				     WINDOW
				     (QUOTE CURSORMOVEDFN)
				     NIL))

          (* Setup TEK4010.CROSSHAIR routine to track mouse, and setup TTYPROCESS to come to this process instead of the 
	  chat.input process. RESETRESTORE will put everything back when character is struck from keyboard)


		    (SETQ PREVPROC (WINDOWPROP WINDOW (QUOTE PROCESS)))
		    (RESETSAVE (WINDOWPROP WINDOW (QUOTE PROCESS)
					   (THIS.PROCESS))
			       (LIST (FUNCTION WINDOWPROP)
				     WINDOW
				     (QUOTE PROCESS)
				     PREVPROC))
		    (RESETSAVE [COND
				 ((TTY.PROCESSP PREVPROC)
				   (TTY.PROCESS (THIS.PROCESS]
			       (LIST (FUNCTION TTY.PROCESS)
				     PREVPROC))
		    (SETQ PREVDS (TTYDISPLAYSTREAM))
		    (RESETSAVE (TTYDISPLAYSTREAM OUTSTREAM)
			       (LIST (FUNCTION TTYDISPLAYSTREAM)
				     PREVDS))
		    (PAGEHEIGHT 0)                           (* Prevent full page prompt hold up)
		    (DSPSCROLL (QUOTE OFF)
			       OUTSTREAM)                    (* Turn off scrolling which TTYDISPLAYSTREAM fn turns 
							     on)
		    (SETQ CHAR (\GETKEY)))                   (* Wait for keyboard input)
	  (SETQ CROSSHAIRX (WINDOWPROP WINDOW (QUOTE CROSSHAIRX)))
	  (SETQ CROSSHAIRY (WINDOWPROP WINDOW (QUOTE CROSSHAIRY)))
	  (BLTHLINE CROSSHAIRY 0 WIDTH WINDOW GRAYSHADE)     (* Erase Crosshair)
	  (BLTVLINE CROSSHAIRX 0 HEIGHT WINDOW GRAYSHADE)
	  (BOUT SSTREAM CHAR)                                (* Send keyboard char first)
	  (TEK4010.SENDCOORD SSTREAM CROSSHAIRX)             (* send X coord)
	  (TEK4010.SENDCOORD SSTREAM CROSSHAIRY)             (* Send Y coord)
	  (WINDOWPROP WINDOW (QUOTE CROSSHAIRX)
		      NIL)
	  (WINDOWPROP WINDOW (QUOTE CROSSHAIRY)
		      NIL])

(TEK4010.GLOMHI&LO
  [LAMBDA (HIBYTE LOBYTE)                                    (* hdj "10-Sep-84 14:32")
    (IPLUS LOBYTE (LLSH HIBYTE 5])

(TEK4010.MOVETO
  [LAMBDA (X Y STREAM)                                       (* AJB "30-Apr-85 12:14")
    (MOVETO X Y STREAM])

(TEK4010.DRAWTO
  [LAMBDA (X Y WIDTH OPERATION STREAM)                       (* AJB "30-Apr-85 12:15")
    (DRAWTO X Y WIDTH OPERATION STREAM])
)

(RPAQ? TEK4010CHAT.MENU NIL)

(RPAQQ TEK4010CHAT.MENUITEMS ((Close (QUOTE Close)
				     "Closes the connection and returns")
			      (Suspend (QUOTE Suspend)
				       "Closes the connection but leaves window up")
			      (New (QUOTE New)
				   "Closes this connection and prompts for a new host")
			      (Freeze (QUOTE Freeze)
				      "Holds typeout in this window until you bug it again")
			      ("Input" (FUNCTION CHAT.TAKE.INPUT)
				       "Allows input from a file")
			      ("Dribble" (FUNCTION CHAT.TYPESCRIPT)
					 "Starts a typescript of window typeout")
			      (Clear (FUNCTION TEK4010.CLEAR)
				     "Clears window and resets to ALPHAMODE column 1, row 1")))

(ADDTOVAR CHAT.DRIVERTYPES (TEK4010 TEK4010CHAT.HANDLECHAR TEK4010CHAT.INIT))
(PUTPROPS TEK4010CHAT COPYRIGHT ("Xerox Corporation" 1985))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (1907 20722 (TEK4010.ALPHASTATE 1917 . 2609) (TEK4010.CLEAR 2611 . 3435) (
TEK4010.CLOSEFN 3437 . 4146) (TEK4010.CROSSHAIR 4148 . 5944) (TEK4010CHAT.INIT 5946 . 7331) (
TEK4010.NEXTSTATE 7333 . 7846) (TEK4010.RELMOVETO 7848 . 8003) (TEK4010.SENDCOORD 8005 . 8435) (
TEK4010CHAT.BUTTONFN 8437 . 8678) (TEK4010CHAT.HANDLECHAR 8680 . 9640) (TEK4010CHAT.MENUFN 9642 . 
11104) (TEK4010.GRAPHICSSTATE 11106 . 13965) (TEK4010.CTRLCHAR 13967 . 17146) (TEK4010.ESCAPECHAR 
17148 . 20264) (TEK4010.GLOMHI&LO 20266 . 20422) (TEK4010.MOVETO 20424 . 20563) (TEK4010.DRAWTO 20565
 . 20720)))))
STOP