|##########|
|#MAGIC   #|CLABLLHL
|#PROJECT #|"IMPORTALL"
|#PATHS   #|"StdProject"
|#FLAGS   #|xx-x-x--x---x-x-----------------
|#USERSW  #|--------------------------------
|#USERMASK#|--------------------------------
|#SWITCHES#|xx---xxxxx------
|##########|
DEFINITION MODULE Printer;
(* $A- *)

|
| WB  4 Jun 1992 IOCommand
|

FROM T_Exec    IMPORT IOCommand, nonstdVAL, DevicePtr, IOFlagSet, Message,
                      UnitPtr, IORequest;
FROM Graphics  IMPORT ColorMapPtr,RastPortPtr,ViewModeSet;
FROM Resources IMPORT ContextPtr;

CONST
  rawWrite        = IOCommand( nonstdVAL + 0 );
  prtCommand      = IOCommand( nonstdVAL + 1 );
  dumpRPort       = IOCommand( nonstdVAL + 2 );
  query           = IOCommand( nonstdVAL + 3 );

TYPE
  PrtCommands = (ris,rin,ind,nel,ri,
                 sgr0,sgr3,sgr23,sgr4,sgr24,sgr1,sgr22,sfc,sbc,
                 shorp0,shorp2,shorp1,shorp4,shorp3,shorp6,shorp5,
                 den6,den5,den4,den3,den2,den1,
                 sus2,sus1,sus4,sus3,sus0,plu,pld,
                 fnt0,fnt1,fnt2,fnt3,fnt4,fnt5,fnt6,fnt7,fnt8,fnt9,fnt10,
                 prop2,prop1,prop0,tss,jfy5,jfy7,jfy6,jfy0,jfy3,jfy1,
                 verp0,verp1,slpp,perf,perf0,
                 lms,rms,tms,bms,stbm,slrm,cam,
                 hts,vts,tbc0,tbc3,tbc1,tbc4,tbcall,tbsall,extend,raw,
                 makeMeWord = $1000);

TYPE
  Error          = (nonErr,cancel,notGraphics,invertHam,badDimension,
                    dimensionOvflow,internalMemory,buffMemory,tookControl);

  Special        = (milCols,milRows,fullCols,fullRows,fracCols,fracRows,
                    center,aspect,densBit0,densBit1,densBit2,noFormFeeds,
                    trustMe,noPrint);

  SpecialSet     = SET OF Special;


CONST
  density1  = SpecialSet:{densBit0};
  density2  = SpecialSet:{densBit1};
  density3  = SpecialSet:{densBit0,densBit1};
  density4  = SpecialSet:{densBit2};
  density5  = SpecialSet:{densBit0,densBit2};
  density6  = SpecialSet:{densBit1,densBit2};
  density7  = SpecialSet:{densBit0,densBit1,densBit2};

TYPE
  IOPrinter    = RECORD OF IORequest
                   IF KEY : INTEGER
                     OF 0 THEN
                       actual,
                       length  : LONGINT;
                       data    : ANYPTR;
                       offset  : LONGINT;
                     OF 1 THEN
                       prtCommands : PrtCommands;
                       parm0       : SHORTCARD;
                       parm1       : SHORTCARD;
                       parm2       : SHORTCARD;
                       parm3       : SHORTCARD;
                     OF 2 THEN
                       rastPort   : RastPortPtr;
                       colorMap   : ColorMapPtr;
                       modesHi    : CARDINAL;
                       modes      : ViewModeSet;
                       srcX       : CARDINAL;
                       srcY       : CARDINAL;
                       srcWidth   : CARDINAL;
                       srcHeight  : CARDINAL;
                       destCols   : LONGINT;
                       destRows   : LONGINT;
                       special    : SpecialSet
                   END
                 END;
  IOPrinterPtr = POINTER TO IOPrinter


PROCEDURE OpenPrinter(context : ContextPtr:=NIL):IOPrinterPtr;

PROCEDURE ClosePrinter(VAR request : IOPrinterPtr)


GROUP
  All  = rawWrite,query,prtCommand,dumpRPort,PrtCommands,Error,Special,
         SpecialSet,density1,density2,density3,density4,density5,
         density6,density7,IOPrinter,IOPrinterPtr,OpenPrinter,ClosePrinter,
         T_Exec.ExecIOGrp;

END Printer.
