DEFINITION MODULE PrtBase; (*$Implementation:=FALSE*)
(* 16-May-1992/cn *)

FROM SYSTEM IMPORT ADDRESS,BPTR,BYTE;

FROM ExecD IMPORT
 Device,ExecBasePtr,Library,MsgPort,Task;

FROM IntuitionD IMPORT
 Preferences;

FROM Parallel IMPORT
 IOParallel;

FROM Serial IMPORT
 IOSerial;

FROM Timer IMPORT
 IOTimer;

TYPE
 StrPtr=ADDRESS;

 DeviceData=RECORD
  device:Device;
  segment:BPTR;
  execBase:ExecBasePtr;
  cmdVectors:ADDRESS;
  cmdBytes:ADDRESS;
  numCommands:CARDINAL;
 END;
 DeviceDataPtr=POINTER TO DeviceData;

TYPE
 PrinterClass=(gfx,color);
 PrinterClassSet=SET OF PrinterClass;

CONST
 bwAlpha=PrinterClassSet{};
 bwGfx=PrinterClassSet{gfx};
 colorAlpha=PrinterClassSet{color};
 colorGfx=PrinterClassSet{gfx,color};

TYPE
 ColorClass=(blackAndWhite,colors,fourColor,additive,multipass);
 ColorClassSet=SET OF ColorClass;

CONST
 bw=ColorClassSet{blackAndWhite};
 ymc=ColorClassSet{colors};
 ymcBw=ColorClassSet{blackAndWhite,colors};
 ymcb=ColorClassSet{fourColor};
 wb=ColorClassSet{blackAndWhite,additive};
 bgr=ColorClassSet{colors,additive};
 bgrWb=ColorClassSet{blackAndWhite,colors,additive};
 bgrw=ColorClassSet{fourColor,additive};

 oldStkSize=0800H;
 (*36*)stkSize=1000H;
 bufSize=256;
 safeSize=128;

TYPE
 PrinterExtendedData=RECORD
  printerName:StrPtr;
  init:PROC;
  expunge:PROC;
  open:PROCEDURE():INTEGER;
  close:PROC;
  printerClass:PrinterClassSet;
  colorClass:ColorClassSet;
  maxColumns:SHORTCARD;
  numCharSets:SHORTCARD;
  numRows:CARDINAL;
  maxXDots:LONGCARD;
  maxYDots:LONGCARD;
  xDotsInch:CARDINAL;
  yDotsInch:CARDINAL;
  commands:ADDRESS;
  doSpecial:PROCEDURE():LONGINT;
  render:PROCEDURE():LONGINT;
  timeoutSecs:LONGINT;
  eightBitChars:ADDRESS;
  printMode:LONGINT;
  (*34*)convFunc:PROCEDURE():LONGINT;
 END;
 PrinterExtendedDataPtr=POINTER TO PrinterExtendedData;

 PrinterSegment=RECORD
  nextSegment:BPTR;
  runAlert:LONGCARD;
  version:CARDINAL;
  revision:CARDINAL;
  ped:PrinterExtendedData;
 END;
 PrinterSegmentPtr=POINTER TO PrinterSegment;

 PrinterData=RECORD
  device:DeviceData;
  unit:MsgPort;
  printerSegment:BPTR;
  printerType:CARDINAL;
  segmentData:PrinterSegmentPtr;
  printBuf:ADDRESS;
  pWrite:PROCEDURE():INTEGER;
  pBothReady:PROCEDURE():INTEGER;
  CASE :INTEGER OF
  |1: p0:IOParallel;
      p1:IOParallel;
  |2: s0:IOSerial;
      s1:IOSerial;
  END;
  tior:IOTimer;
  iorPort:MsgPort;
  tc:Task;
  oldStk:ARRAY [0..oldStkSize-1] OF BYTE;
  flags:SHORTCARD;
  pad:BYTE;
  preferences:Preferences;
  pWaitEnabled:SHORTCARD;
  (*36*)flags1:SHORTCARD;
  (*36*)stk:ARRAY[0..stkSize-1] OF BYTE;
 END;
 PrinterDataPtr=POINTER TO PrinterData;

END PrtBase.noimp
