DEFINITION MODULE Printer; (*$ Implementation:=FALSE *)
(* 29-May-1993/bp *)

FROM ExecD IMPORT
 nonstd,DevicePtr,IOFlagSet,Message,UnitPtr,IOStdReq;

FROM GraphicsD IMPORT
 ColorMapPtr,RastPortPtr,ViewModeSet;

CONST
 printerName="printer.device";

 rawWrite=nonstd+0;
 prtCommand=nonstd+1;
 dumpRPort=nonstd+2;
 query=nonstd+3;

 ris=0;
 rin=1;
 ind=2;
 nel=3;
 ri=4;
 sgr0=5;
 sgr3=6;
 sgr23=7;
 sgr4=8;
 sgr24=9;
 sgr1=10;
 sgr22=11;
 sfc=12;
 sbc=13;
 shorp0=14;
 shorp2=15;
 shorp1=16;
 shorp4=17;
 shorp3=18;
 shorp6=19;
 shorp5=20;
 den6=21;
 den5=22;
 den4=23;
 den3=24;
 den2=25;
 den1=26;
 sus2=27;
 sus1=28;
 sus4=29;
 sus3=30;
 sus0=31;
 plu=32;
 pld=33;
 fnt0=34;
 fnt1=35;
 fnt2=36;
 fnt3=37;
 fnt4=38;
 fnt5=39;
 fnt6=40;
 fnt7=41;
 fnt8=42;
 fnt9=43;
 fnt10=44;
 prop2=45;
 prop1=46;
 prop0=47;
 tss=48;
 jfy5=49;
 jfy7=50;
 jfy6=51;
 jfy0=52;
 jfy3=53;
 jfy1=54;
 verp0=55;
 verp1=56;
 slpp=57;
 perf=58;
 perf0=59;
 lms=60;
 rms=61;
 tms=62;
 bms=63;
 stbm=64;
 slrm=65;
 cam=66;
 hts=67;
 vts=68;
 tbc0=69;
 tbc3=70;
 tbc1=71;
 tbc4=72;
 tbcall=73;
 tbsall=74;
 extend=75;
 raw=76;

TYPE
 Error=(
  noErr,cancel,notGraphics,invertHam,badDimension,
  dimensionOvflow,internalMemory,bufferMemory,tookControl
 );
 IOPrtCmdReq=RECORD
  message:Message;
  device:DevicePtr;
  unit:UnitPtr;
  command:CARDINAL;
  flags:IOFlagSet;
  error:Error;
  prtCommand:CARDINAL;
  parm0:SHORTCARD;
  parm1:SHORTCARD;
  parm2:SHORTCARD;
  parm3:SHORTCARD;
 END;
 IOPrtCmdReqPtr=POINTER TO IOPrtCmdReq;

 Special=(
  milCols,milRows,fullCols,fullRows,fracCols,fracRows,center,aspect,
  density1,density2,density4,noFormFeed,trustMe,noPrint,s14,s15
 );
 SpecialSet=SET OF Special;

CONST
 density3=SpecialSet{density1,density2};
 density5=SpecialSet{density1,density4};
 density6=SpecialSet{density2,density4};
 density7=SpecialSet{density1..density4};

 densityMask=SpecialSet{density1..density4};

 dimensionMask=SpecialSet{milCols..fracRows,aspect};

TYPE
 IODRPReq=RECORD
  message:Message;
  device:DevicePtr;
  unit:UnitPtr;
  command:CARDINAL;
  flags:IOFlagSet;
  error:Error;
  rastPort:RastPortPtr;
  colorMap:ColorMapPtr;
  modesHi:CARDINAL;     (* muss auf 0 gesetzt werden! *)
  modes:ViewModeSet;
  srcX:CARDINAL;
  srcY:CARDINAL;
  srcWidth:CARDINAL;
  srcHeight:CARDINAL;
  destCols:LONGINT;
  destRows:LONGINT;
  special:SpecialSet;
 END;
 IODRPReqPtr=POINTER TO IODRPReq;

 PrinterIO = RECORD
   CASE :INTEGER OF
   | 0: ios:   IOStdReq;
   | 1: iodrp: IODRPReq;
   | 2: iopc:  IOPrtCmdReq;
   END;
 END;
 PrinterIOPtr = POINTER TO PrinterIO;
 
(*
 Synonyme mit einheitlicher Namensgebung
*)
 IOPrinter=IOPrtCmdReq;
 IOPrinterPtr=IOPrtCmdReqPtr;

END Printer.noimp
