-- PrintOps.mesa,  Edit: Johnsson 16-Apr-81  8:13:05
-- Edit: Paul Rovner 6-Jan-82 19:07:07
-- Edit: Warren Teitelman  June 18, 1982 12:04 pm

DIRECTORY
  Press USING [FontIndex, FontSlope, FontWeight, Mica, micasPerInch, Mode],
  IO USING[STREAM];

PrintOps: DEFINITIONS =
  BEGIN
  
  DataEnd: SIGNAL;
  
  Direction: TYPE = {left, right, top, bottom};
  
  Margins: TYPE = ARRAY Direction OF Press.Mica;
  
  Parameters: TYPE = RECORD [
    copies, tab: CARDINAL,
    margins: ARRAY Direction OF Press.Mica,
    betweenColumns: Press.Mica ← Press.micasPerInch/2,
    columns: CARDINAL,
    mail: BOOLEAN ← FALSE,
    wrap: BOOLEAN ← TRUE,
    nonprog: BOOLEAN ← FALSE,
    headers: BOOLEAN ← TRUE,
    trailers: BOOLEAN ← TRUE,
    weight: Press.FontWeight,
    slope: Press.FontSlope,
    mode: Press.Mode];
  
  ParametersHandle: TYPE = POINTER TO Parameters;
  
  PressProcsObject: TYPE = RECORD [
    Character: PROCEDURE [CHARACTER],
    GetWidthOfCharacter: PROCEDURE [CHARACTER] RETURNS [Press.Mica],
    PieceOfLine: PROCEDURE [s: LONG STRING, width: Press.Mica],
    SetCurrentFont: PROCEDURE [Press.FontIndex, Press.FontWeight, Press.FontSlope],
    SkipSomeSpace: PROCEDURE [Press.Mica], -- for indenting
    SetCurrentPosition: PROCEDURE [x, y: Press.Mica],
    GetCurrentPosition: PROCEDURE RETURNS [x, y: Press.Mica],
    GetCurrentPageNumber: PROCEDURE RETURNS [CARDINAL],
    SetCurrentPageNumber: PROCEDURE [CARDINAL],
    GetHeightOfFont: PROCEDURE [Press.FontIndex] RETURNS [Press.Mica]
    ];
  
  PressProcsHandle: TYPE = POINTER TO PressProcsObject;  
  
  printerName: LONG STRING;

  out: IO.STREAM;
  
  Format: PROCEDURE [
    getChar: PROCEDURE RETURNS [CHARACTER],
    procs: PressProcsHandle,
    p: ParametersHandle] RETURNS [lastPage: CARDINAL];

  GetStatus: PROCEDURE RETURNS [BOOLEAN];

  END.

June 18, 1982 12:04 pm converted to 3.2. IOStream -> IO.