(*---------------------------------------------------------------------------
    :Program.    PrinterSupport.def
    :Author.     Fridtjof Siebert
    :Address.    Nobileweg 67, D-7-Stgt-40
    :Phone.      0711/822509
    :Shortcut.   [fbs]
    :Version.    1.0
    :Date.       31-Jul-88
    :Copyright.  PD
    :Language.   Modula-II
    :Translator. M2Amiga
    :Imports.    none.
    :UpDate.     none.
    :Contents.   PROCEDUREs für Druckerhandling (Open, Write, Close etc.)
    :Remark.     Ähnlich wie die Prozeduren des Libraries&Devices Manual.
---------------------------------------------------------------------------*)

DEFINITION MODULE PrinterSupport;

(*------  IMPORTList:  ------*)

FROM SYSTEM      IMPORT ADDRESS;

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

(*-------------------------------------------------------------------------*)
(*                                                                         *)
(*                            Open Printer:                                *)
(*                                                                         *)
(*-------------------------------------------------------------------------*)

PROCEDURE OpenPrinter();
(* This has to be called before playing with your Printer.                 *)
(* Be careful: Error-Checking is impossible because M2Amigas-Implementation*)
(* of OpenLibrary DOESN'T return TRUE or FALSE wether it was succesful or  *)
(* not. I myself was too lazy to check out of Memory after CreatePort()    *)
(* CreateExtIO(). So don't call this if the largest chunk of Memory is less*)
(* the 200 Bytes !!!                                                       *)


(*-------------------------------------------------------------------------*)
(*                                                                         *)
(*                          WritePrinter:                                  *)
(*                                                                         *)
(*-------------------------------------------------------------------------*)

PROCEDURE WritePrinter(Buffer: ADDRESS; Length: LONGINT);
(* This is similar to Dos.Write. Length Bytes are written to Printer.      *)
(* Buffer needn't be a CHIP-Mem Address (I think so).                      *)


(*-------------------------------------------------------------------------*)
(*                                                                         *)
(*                            PrintCommand:                                *)
(*                                                                         *)
(*-------------------------------------------------------------------------*)

PROCEDURE PrintCommand(Command: CARDINAL; p0,p1,p2,p3: UByte);
(* This Sends a Printercommand. See Printer.def for more information about *)
(* the Commands. p0..p1 contain it's parameters. Just set them to zero if  *)
(* they are unused (normally they are).                                    *)


(*-------------------------------------------------------------------------*)
(*                                                                         *)
(*                       Dump A RastPort (print Graphics):                 *)
(*                                                                         *)
(*-------------------------------------------------------------------------*)

PROCEDURE DumpRPort(RP: RastPortPtr; ColorMap: ColorMapPtr;
                    Modes: ViewModeSet; sx,sy,sw,sh: CARDINAL;
                    dc,dr: LONGINT; s: SpecialSet);
(* I didn't need this yet so it isn't tested. Only for completion.         *)
(* Use Libraries & Devices Manual (if you have) for further information.   *)


(*-------------------------------------------------------------------------*)
(*                                                                         *)
(*                           Close Printer:                                *)
(*                                                                         *)
(*-------------------------------------------------------------------------*)

PROCEDURE ClosePrinter();
(* Don't forget to call this at the end of your Programm.                  *)


END PrinterSupport.
