%N ttdriv %F $MIR/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_science_miriad/miriad/work/miriad-4.3.8/borrow/pgplot/drivers/ttdriv.f
%D PGPLOT Tektronix terminal drivers
%B
      SUBROUTINE TTDRIV (IFUNC, RBUF, NBUF, CHR, LCHR, MODE)
      INTEGER IFUNC, NBUF, LCHR, MODE
      REAL    RBUF(*)
      CHARACTER*(*) CHR

 PGPLOT driver for Tektronix terminals and emulators.

 1993 Jan 18 - T. J. Pearson.
 1993 Jun 24 - L. Staveley-Smith, minor alteration of 
               flush-buffer for better /tek
               compatibility. Also added MODE 7 for
               Visual 603's and MODE 8 for IBM-PCs 
               running as remote terminals using
               Kermit version 3 (for DOS).
 1994 Dec 19 - TJP: better XTERM support.
 1994 Dec 29 - TJP: and Tek4100 support (MODE 9).
 1996 Apr 18 - TJP: prevent concurrent access.
 1998 Mar 09 - M. Zolliker: new MODE 10 for VersaTerm-PRO for Macintosh

 Supported device:
 1. Tektronix 4006/4010 storage-tube terminal; can be used with
   emulators, but the options below take advantage of features not
   present in the basic Tektronix terminal.
 2. GraphOn Corporation 200-series terminals. These emulate a
   Tektronix-4010 with enhancements (selective erase, rectangle fill,
   switch between Tek and VT100 modes).
 3. Digital Engineering, Inc., Retrographics modified VT100
   terminal (VT640). 
 4. IRAF GTERM Tektronix terminal emulator, with color extensions.
 5. Xterm window on an X-window server. Emulates a Tektronix-4014,
   with extensions (switch between Tek and VT100 windows).
 6. ZSTEM 240 and ZSTEM 4014 terminal emulators for the IBM PC and
   clones. ZSTEM supports Tektronix 4014 emulation and the 4105 color
   escape sequences. ZSTEM can be obtained from: KEA Systems Ltd.,
   2150 West Broadway, Suite 412, Vancouver, British Columbia, Canada,
   V6K 4L9.
 7.Visual-603 and 630 terminals. These are VT100/220 compatible
   terminals with Tektronix 4010/4014 emulation (Visual Technology
   Incorporated, 1703 Middlesex Street, Lowell, Mass 01851). The 
   Visual 630 has the capability of displaying dual text and graphics.
   This feature is not used in this driver. Graphics mode is entered 
   automatically when the graph is drawn but only exited when PGPAGE 
   or PGEND is called. Therefore, for multiple plots interspersed
   with text I/O, use PGPAGE at the end of each plot. This will prompt
   for a carriage return before switching. If this is not done,
   intervening text will appear on the graphics screen. Graphics mode
   can be entered and exited from the setup menu, or by SHIFT-PF1.
   Graphics extensions include rectangle fill, selective erase and 
   switch between Tek and VT100 modes.
 8.IBM PC's and compatibles running MS-Kermit 3 as a terminal emulator.
   The video board is assumed to have sufficient memory to retain the 
   graphics image in memory when switched to text. This will be true 
   for VGA and EGA, but some early PCs might not be able to do this. 
   If Kermit is using full VGA resolution (ie SET TERMINAL GRAPHICS 
   VGA), there is not usually enough memory to store the full 480 
   vertical lines, so the bottom few lines may disappear. Tektronix 
   enhancements include selective erase, colours, rectangle fill, and
   switching between text and graphics mode. The cursor may be
   operated with the mouse. Tested with Kermit version 3.1.
 9.Tektronix 4100 series color terminals (and emulators)
 10.Versaterm-PRO for Macintosh (Tek 4105 emulation).

 Device type codes:
 1.  /TEK4010 Tektronix-4010 terminal
 2.  /GF      GraphOn terminal
 3.  /RETRO   Retrographics VT640 terminal
 4.  /GTERM   GTERM terminal emulator
 5.  /XTERM   XTERM terminal emulator
 6.  /ZSTEM   ZSTEM terminal emulator
 7.  /V603    Visual V603 terminal
 8.  /KRM3    Kermit 3 on IBM-PC
 9.  /TK4100  Tektronix 4100 series terminals
 10. /VMAC    VersaTerm-PRO for Macintosh

 Default device name: the logged-in terminal
   /dev/tty (UNIX)
   TT: (VMS)

 Default view surface dimensions:
   Depends on monitor; nominally 8in (horizontal) by 6in (vertical).

 Resolution:
   A standard Tektronix terminal displays a screen of 1024 pixels
   (horizontal) by 780 pixels (vertical), with a nominal resolution
   of 130 pixels per inch. The actual resolution may be less.

 Color capability:
   /TEK4010, /XTERM: none; only color index 1 is available; selective
       erase is not possible. Requests to draw in color index 0 are
       ignored.
   /GF, /RETRO, /V603: color indices 0 (erase, black) and 1 (bright:
       usually white, green or amber) are supported. It is not 
       possible to change color representation.
   /GTERM:  color indices 0 to 15 are available and default to the
       standard PGPLOT colors. The color representation can be changed.
   /ZSTEM: color indices 0 to 7 are available and default to the
       indicated in the ZSTEM setup menu (which default to the standard
       PGPLOT colors).  The color representation cannot be changed.
   /KRM3: color indices 0 to 7 are the standard PGPLOT colors. Indices
       8 to 14 are also available, but are BRIGHT versions of 1 to 7,
       and thus non-standard. Color representation can't be changed.
   /TK4100: color indices 0-15.
   /VMAC: color indices 0 to 15 are available and default to the
       standard PGPLOT colors. The color representation can be changed.
       Caution: this does not work reliably, owing to bugs (?) in
       Versaterm.

 Input capability:
   Depending on the emulation, the graphics cursor may be a pointer,
   a small cross, or a crosshair across the entire screen. The user
   positions the cursor using thumbwheels, mouse, trackball, or the
   arrow keys on the keyboard. The user indicates that the cursor has
   been positioned by typing any printable ASCII character on the 
   keyboard. Most control characters (eg, ^C) are intercepted by the
   operating system and cannot be used. 

 File format: 
   Binary byte stream. Under Unix, the output may be directed to
   a file; under VMS, this is not possible: the output device must
   be a terminal.

 Obtaining hardcopy:

 Environment variables:
   None.
