DEFINITION MODULE tek4010vdu;

(* Author:         Andrew Trevorrow
   Implementation: Modula-2 under VAX/UNIX 4.2 BSD
   Date Started:   June, 1986

   Description:
   This module exports various routines and parameters used in specific VDU
   modules that emulate a Tektronix 4010 terminal (VIS500, VIS550, VT640).
   (DVItoVDU may well be usable on an actual Tek 4010, but I haven't had
   access to such a terminal as yet.  ClearTextLine and ResetVDU are the
   only routines that would need to be implemented.)
*)

EXPORT QUALIFIED
   maxy, lineht, dragdown, havesentxy, SendXY,
   TEK4010StartText, TEK4010MoveToTextLine, TEK4010ClearScreen,
   TEK4010StartGraphics, TEK4010LoadFont, TEK4010ShowChar,
   TEK4010ShowRectangle;

VAR
   maxy       : CARDINAL;    (* TEK4010 vertical coordinates are in 0..maxy;
                                some VDUs may change default value of 779     *)
   lineht     : CARDINAL;    (* height in TEK4010 pixels of a text line;
                                some VDUs may change default value of 26      *)
   dragdown   : CARDINAL;    (* VIS500/550 VDUs can use this value to drag
                                Terse character baseline down to TeX ref pt   *)
   havesentxy : BOOLEAN;     (* don't need to send all 4 bytes of address?    *)

PROCEDURE SendXY (x, y : CARDINAL);
(* Calculate and send up to 4 address bytes for given screen position
   (using TEK4010 coordinate scheme).
   If havesentxy is FALSE then all 4 address bytes must be sent, otherwise
   fewer bytes can be sent.
*)

(* These are the routines described in VDUInterface: *)

PROCEDURE TEK4010StartText;

PROCEDURE TEK4010MoveToTextLine (line : CARDINAL);

PROCEDURE TEK4010ClearScreen;

PROCEDURE TEK4010StartGraphics;

PROCEDURE TEK4010LoadFont (fontname : ARRAY OF CHAR;
                           fontsize : CARDINAL;
                           mag, hscale, vscale : REAL);

PROCEDURE TEK4010ShowChar (screenh, screenv : CARDINAL;
                           ch : CHAR);

PROCEDURE TEK4010ShowRectangle (screenh, screenv, width, height : CARDINAL;
                                ch : CHAR);

END tek4010vdu.
