(*********************************************************************
 *
 *  :Program.    PrinterSupport.def
 *  :Author.     Michael Frieß
 *  :Address.    Kernerstr. 22a
 *  :Address.    7000 Stuttgart 1
 *  :shortcut.   [mif]
 *  :Version.    2.0
 *  :Date.       18.09.88
 *  :Copyright.  PD
 *  :Language.   Modula-II
 *  :Translator. M2Amiga
 *  :Contents.   PROCEDUREs zum Druckerhandling
 *  :UpDate.     Update von V1.0 [fbs]
 *  :Remark.     Diese Version ist die Zusammenführung zweier
 *  :Remark.     getrennt entwickelter Module. Eines von Fridtjof
 *  :Remark.     und eines von mir.
 *
 *********************************************************************)

DEFINITION MODULE PrinterSupport;
(* (C) Copyright 1988 by Michael Frieß and Fridtjof Siebert *)

FROM Exec     IMPORT UByte;
FROM Graphics IMPORT RastPortPtr, ColorMapPtr, ViewModeSet;
FROM Printer  IMPORT Special, SpecialSet;


PROCEDURE OpenPrinter;
  (* :semantic.opens printer for further use. Call this procedure
     :semantic.before working with your printer.
     :note.Current implementation of M2Amiga DOESN´T return whether
     :note.OpenLibrary was successful (TRUE) or not (FALSE).
     :update.Error checking of memory allocation implemented.
     :update.Automatic ClosePrinter when your program is terminated.
  *)


PROCEDURE ClosePrinter;
  (* :semantic.closes printer.
     :update.If you haven´t closed printer until end of your program,
     :update.it will be automatically closed.
  *)


PROCEDURE PrintString (s : ARRAY OF CHAR);
  (* :input.s = string to be printed
     :semantic.prints string s with translation of escape sequences.
     :update.Replaces procedure WritePrinter of V1.0
  *)

PROCEDURE PrintRaw    (s : ARRAY OF CHAR);
  (* :input.s = string to be printed
     :semantic.prints string s without translation, so you can use
     :semantic.printer specific escape sequences not supported by
     :semantic.printer.device
  *)


PROCEDURE PrintChar (c : CHAR);
  (* :input.c = char to be printed
     :semantic.prints char c.
  *)


PROCEDURE PrintCommand (Cmd : CARDINAL; p0, p1, p2, p3 : UByte);
  (* :input.Cmd = Printer Command (see Printer.def)
     :input.p0..p3 = parameters of Cmd. Just set them to zero, if
     :input.         they are unused.
     :semantic.Executes Cmd with given parameters.
  *)

PROCEDURE DumpRPort (rp: RastPortPtr; cm: ColorMapPtr;
                    Modes: ViewModeSet; x,y,w,h: CARDINAL;
                    c,r: LONGINT; s: SpecialSet);
  (* :input.rp = Pointer to RastPort to be printed
     :input.cm = Pointer to ColorMap
     :input.Modes =
     :input.x = x offset into rp
     :input.y = y offset into rp
     :input.w = x size in rp to be printed
     :input.h = y size in rp to be printed
     :input.c = column size of area
     :input.r = row size of area
     :input.s = kind of interpretation of c and r
     :semantic.dumps part of rp (specified by x,y,w and h) with
     :semantic.given parameters on printer. For more details see
     :semantic.appendix B of ROM Kernel Reference Manual (Libraries
     :semantic.and Devices)
     :update.none (still not tested)
  *)

(* I didn't need this yet so it isn't tested. Only for completion.         *)
(* Use Libraries & Devices Manual (if you have) for further information.   *)

END PrinterSupport.
