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