
DEFINITION MODULE TEK4010VDU;

(* Author:         Andrew Trevorrow
   Implementation: University of Hamburg Modula-2 under VAX/VMS version 4
   Date Started:   October, 1984

   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.)

   Revised:
   June, 1985
 - Coordinate pairs now shown as (h,v) instead of (v,h) to
   be closer to (x,y) Cartesian coordinates.  Parameter order
   in some routines has changed to reflect this.
*)

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

  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 (fontspec : ARRAY OF CHAR;
                             fontsize : CARDINAL;
                             mag, hscale, vscale : REAL);

  PROCEDURE TEK4010ShowChar (h, v : CARDINAL;
                             ch : CHAR);

  PROCEDURE TEK4010ShowRectangle (h, v, wd, ht : CARDINAL;
                                  ch : CHAR);

END TEK4010VDU.
