home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Pascal / HISOFTPASCAL2,0-3.DMS / in.adf / Units / AmigaPrinter.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1992-05-20  |  5.8 KB  |  323 lines

  1. unit AmigaPrinter;
  2.  
  3. INTERFACE
  4. uses Exec, AmigaDOS, Graphics, Input, Intuition, Parallel, Serial, Timer;
  5.  
  6.  
  7. type
  8.     pDeviceData = ^tDeviceData;
  9.     tDeviceData = record
  10.         dd_Device: tLibrary;
  11.         dd_Segment: pointer;
  12.         dd_ExecBase: pointer;
  13.         dd_CmdVectors: pointer;
  14.         dd_CmdBytes: pointer;
  15.         dd_NumCommands: word;
  16.         end;
  17.  
  18.     pPrinterSegment = ^tPrinterSegment;
  19.     pPrinterData = ^tPrinterData;
  20.     tPrinterData = record
  21.         pd_Device: tDeviceData;
  22.         pd_Unit: tMsgPort;
  23.         pd_PrinterSegment: BPTR;
  24.         pd_PrinterType: word;
  25.         pd_SegmentData: pPrinterSegment;
  26.         pd_PrintBuf: pbyte;
  27.         pd_PWrite: pointer;
  28.         pd_PBothReady: pointer;
  29.         case integer of
  30.         0: (
  31.         pd_PIOR0: tIOExtPar;
  32.         pd_PIOR1: tIOExtPar;
  33.         );
  34.         1: (
  35.         pd_SIOR0: tIOExtSer;
  36.         pd_SIOR1: tIOExtSer;
  37.         pd_TIOR: ttimerequest;
  38.         pd_IORPort: tMsgPort;
  39.         pd_TC: tTask;
  40.         pd_OldStk: array [0..2047] of byte;
  41.         pd_Flags: byte;
  42.         pd_pad: byte;
  43.         pd_Preferences: tPreferences;
  44.         pd_PWaitEnabled: byte;
  45.         pd_Flags1: byte;
  46.         pd_Stk: array [0..4095] of byte;
  47.         );
  48.         end;
  49.  
  50.     pPrinterExtendedData = ^tPrinterExtendedData;
  51.     tPrinterExtendedData = record
  52.         ped_PrinterName: pbyte;
  53.         ped_Init: pointer;
  54.         ped_Expunge: pointer;
  55.         ped_Open: pointer;
  56.         ped_Close: pointer;
  57.         ped_PrinterClass: byte;
  58.         ped_ColorClass: byte;
  59.         ped_MaxColumns: byte;
  60.         ped_NumCharSets: byte;
  61.         ped_NumRows: word;
  62.         ped_MaxXDots: long;
  63.         ped_MaxYDots: long;
  64.         ped_XDotsInch: word;
  65.         ped_YDotsInch: word;
  66.         ped_Commands: pppbyte;
  67.         ped_DoSpecial: pointer;
  68.         ped_Render: pointer;
  69.         ped_TimeoutSecs: longint;
  70.         ped_8BitChars: ppbyte;
  71.         ped_PrintMode: longint;
  72.         ped_ConvFunc: pointer;
  73.         end;
  74.  
  75.     pIOPrtCmdReq = ^tIOPrtCmdReq;
  76.     tIOPrtCmdReq = record
  77.         io_Message: tMessage;
  78.         io_Device: pDevice;
  79.         io_Unit: pUnit;
  80.         io_Command: word;
  81.         io_Flags: byte;
  82.         io_Error: shortint;
  83.         io_PrtCommand: word;
  84.         io_Parm0: byte;
  85.         io_Parm1: byte;
  86.         io_Parm2: byte;
  87.         io_Parm3: byte;
  88.         end;
  89.  
  90.     tPrinterSegment = record
  91.         ps_NextSegment: long;
  92.         ps_runAlert: long;
  93.         ps_Version: word;
  94.         ps_Revision: word;
  95.         ps_PED: tPrinterExtendedData;
  96.         end;
  97.  
  98.     pcolorEntry = ^tcolorEntry;
  99.     tcolorEntry = record
  100. case integer of
  101.         0: (
  102.         colorLong: long;
  103.         );
  104.         1: (
  105.         colorByte: array [0..3] of byte;
  106.         );
  107.         2: (
  108.         colorSByte: array [0..3] of shortint;
  109.         );
  110.         end;
  111.  
  112.     pIODRPReq = ^tIODRPReq;
  113.     tIODRPReq = record
  114.         io_Message: tMessage;
  115.         io_Device: pDevice;
  116.         io_Unit: pUnit;
  117.         io_Command: word;
  118.         io_Flags: byte;
  119.         io_Error: shortint;
  120.         io_RastPort: pRastPort;
  121.         io_ColorMap: pColorMap;
  122.         io_Modes: long;
  123.         io_SrcX: word;
  124.         io_SrcY: word;
  125.         io_SrcWidth: word;
  126.         io_SrcHeight: word;
  127.         io_DestCols: longint;
  128.         io_DestRows: longint;
  129.         io_Special: word;
  130.         end;
  131.  
  132.     pPrtInfo = ^tPrtInfo;
  133.     tPrtInfo = record
  134.         pi_render: pointer;
  135.         pi_rp: pRastPort;
  136.         pi_temprp: pRastPort;
  137.         pi_RowBuf: pword;
  138.         pi_HamBuf: pword;
  139.         pi_ColorMap: pcolorEntry;
  140.         pi_ColorInt: pcolorEntry;
  141.         pi_HamInt: pcolorEntry;
  142.         pi_Dest1Int: pcolorEntry;
  143.         pi_Dest2Int: pcolorEntry;
  144.         pi_ScaleX: pword;
  145.         pi_ScaleXAlt: pword;
  146.         pi_dmatrix: pbyte;
  147.         pi_TopBuf: pword;
  148.         pi_BotBuf: pword;
  149.         pi_RowBufSize: word;
  150.         pi_HamBufSize: word;
  151.         pi_ColorMapSize: word;
  152.         pi_ColorIntSize: word;
  153.         pi_HamIntSize: word;
  154.         pi_Dest1IntSize: word;
  155.         pi_Dest2IntSize: word;
  156.         pi_ScaleXSize: word;
  157.         pi_ScaleXAltSize: word;
  158.         pi_PrefsFlags: word;
  159.         pi_special: long;
  160.         pi_xstart: word;
  161.         pi_ystart: word;
  162.         pi_width: word;
  163.         pi_height: word;
  164.         pi_pc: long;
  165.         pi_pr: long;
  166.         pi_ymult: word;
  167.         pi_ymod: word;
  168.         pi_ety: integer;
  169.         pi_xpos: word;
  170.         pi_threshold: word;
  171.         pi_tempwidth: word;
  172.         pi_flags: word;
  173.         end;
  174.  
  175.  
  176.  
  177. const
  178.     PCC_YMCB = 4;
  179.     aSTBM = $40;
  180.     aCAM = $42;
  181.     PCMWHITE = 3;
  182.     P_BUFSIZE = $100;
  183.     SPECIAL_FULLCOLS = 4;
  184.     PCC_BGRW = $C;
  185.     aSBC = $D;
  186.     aSLRM = $41;
  187.     SPECIAL_FRACROWS = $20;
  188.     PPCB_GFX = 0;
  189.     aSLPP = $39;
  190.     aIND = 2;
  191.     aSFC = $C;
  192.     PDERR_DIMENSIONOVFLOW = 5;
  193.     PPCF_GFX = 1;
  194.     PCMBLUE = 0;
  195.     aNEL = 3;
  196.     aPLD = $21;
  197.     PCMCYAN = 2;
  198.     aBMS = $3F;
  199.     aFNT10 = $2C;
  200.     PCC_BGR = $A;
  201.     PRD_QUERY = $C;
  202.     PDERR_TOOKCONTROL = 8;
  203.     P_STKSIZE = $1000;
  204.     PPC_BWALPHA = 0;
  205.     PPC_COLORGFX = 3;
  206.     aTBCALL = $49;
  207.     PCMMAGENTA = 1;
  208.     aRIN = 1;
  209.     aRAW = $4C;
  210.     SPECIAL_MILCOLS = 1;
  211.     aSGR22 = $B;
  212.     aSGR23 = 7;
  213.     aLMS = $3C;
  214.     aSGR24 = 9;
  215.     PRD_DUMPRPORT = $B;
  216.     aRIS = 0;
  217.     aHTS = $43;
  218.     SPECIAL_FULLROWS = 8;
  219.     aPLU = $20;
  220.     aSHORP0 = $E;
  221.     aRMS = $3D;
  222.     SPECIAL_NOFORMFEED = $800;
  223.     aSHORP1 = $10;
  224.     PCC_YMC = 2;
  225.     PCC_4COLOR = 4;
  226.     aSHORP2 = $F;
  227.     aTMS = $3E;
  228.     SPECIAL_DENSITYMASK = $700;
  229.     aSHORP3 = $12;
  230.     PDERR_INTERNALMEMORY = 6;
  231.     PCMRED = 2;
  232.     aSHORP4 = $11;
  233.     PDERR_BADDIMENSION = 4;
  234.     aSHORP5 = $14;
  235.     aSHORP6 = $13;
  236.     aPERF0 = $3B;
  237.     aTBSALL = $4A;
  238.     aTSS = $30;
  239.     PRD_RAWWRITE = 9;
  240.     SPECIAL_ASPECT = $80;
  241.     P_OLDSTKSIZE = $800;
  242.     aVTS = $44;
  243.     SPECIAL_CENTER = $40;
  244.     aEXTEND = $4B;
  245.     aRI = 4;
  246.     SPECIAL_NOPRINT = $2000;
  247.     PDERR_INVERTHAM = 3;
  248.     SPECIAL_DIMENSIONSMASK = $BF;
  249.     PPC_COLORALPHA = 2;
  250.     SPECIAL_MILROWS = 2;
  251.     aDEN1 = $1A;
  252.     aVERP0 = $37;
  253.     PDERR_NOERR = 0;
  254.     PCC_BW = 1;
  255.     PCC_WB = 9;
  256.     aDEN2 = $19;
  257.     aVERP1 = $38;
  258.     aTBC0 = $45;
  259.     aDEN3 = $18;
  260.     aTBC1 = $47;
  261.     aDEN4 = $17;
  262.     SPECIAL_TRUSTME = $1000;
  263.     aDEN5 = $16;
  264.     aPROP0 = $2F;
  265.     aTBC3 = $46;
  266.     aDEN6 = $15;
  267.     aPROP1 = $2E;
  268.     aTBC4 = $48;
  269.     aPROP2 = $2D;
  270.     PPCB_COLOR = 1;
  271.     PPCF_COLOR = 2;
  272.     PCMBLACK = 3;
  273.     PCC_BGR_WB = $B;
  274.     P_SAFESIZE = $80;
  275.     PRD_PRTCOMMAND = $A;
  276.     aFNT0 = $22;
  277.     aFNT1 = $23;
  278.     aJFY0 = $34;
  279.     aFNT2 = $24;
  280.     aJFY1 = $36;
  281.     aFNT3 = $25;
  282.     aSGR0 = 5;
  283.     aFNT4 = $26;
  284.     aJFY3 = $35;
  285.     PDERR_BUFFERMEMORY = 7;
  286.     aSGR1 = $A;
  287.     aFNT5 = $27;
  288.     aFNT6 = $28;
  289.     aJFY5 = $31;
  290.     aSGR3 = 6;
  291.     aFNT7 = $29;
  292.     aJFY6 = $33;
  293.     aSGR4 = 8;
  294.     aFNT8 = $2A;
  295.     aJFY7 = $32;
  296.     aFNT9 = $2B;
  297.     PCC_YMC_BW = 3;
  298.     SPECIAL_FRACCOLS = $10;
  299.     PCC_ADDITIVE = 8;
  300.     PCMGREEN = 1;
  301.     SPECIAL_DENSITY1 = $100;
  302.     PDERR_CANCEL = 1;
  303.     SPECIAL_DENSITY2 = $200;
  304.     SPECIAL_DENSITY3 = $300;
  305.     aSUS0 = $1F;
  306.     SPECIAL_DENSITY4 = $400;
  307.     aSUS1 = $1C;
  308.     SPECIAL_DENSITY5 = $500;
  309.     PCMYELLOW = 0;
  310.     aSUS2 = $1B;
  311.     aPERF = $3A;
  312.     SPECIAL_DENSITY6 = $600;
  313.     aSUS3 = $1E;
  314.     SPECIAL_DENSITY7 = $700;
  315.     aSUS4 = $1D;
  316.     PDERR_NOTGRAPHICS = 2;
  317.     PPC_BWGFX = 1;
  318.     PCC_MULTI_PASS = $10;
  319.  
  320.  
  321. IMPLEMENTATION
  322. end.
  323.