home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / TRSICAT.LZX / CATS_CD2_TRSI / Inc&AD1.3 / Includes / devices / printer.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-09-12  |  9.2 KB  |  221 lines

  1. #ifndef DEVICES_PRINTER_H
  2. #define DEVICES_PRINTER_H
  3. /*
  4. **    $Filename: devices/printer.h $
  5. **    $Release: 1.3 $
  6. **
  7. **    
  8. **
  9. **    (C) Copyright 1985,1986,1987,1988 Commodore-Amiga, Inc.
  10. **        All Rights Reserved
  11. */
  12.  
  13. #ifndef     EXEC_NODES_H
  14. #include "exec/nodes.h"
  15. #endif
  16.  
  17. #ifndef     EXEC_LISTS_H
  18. #include "exec/lists.h"
  19. #endif
  20.  
  21. #ifndef     EXEC_PORTS_H
  22. #include "exec/ports.h"
  23. #endif
  24.  
  25. #define     PRD_RAWWRITE       (CMD_NONSTD+0)
  26. #define     PRD_PRTCOMMAND       (CMD_NONSTD+1)
  27. #define     PRD_DUMPRPORT       (CMD_NONSTD+2)
  28. #define     PRD_QUERY       (CMD_NONSTD+3)
  29.  
  30. /* printer command definitions */
  31.  
  32. #define aRIS     0  /* ESCc  reset              ISO */
  33. #define aRIN     1  /* ESC#1 initialize              +++ */
  34. #define aIND     2  /* ESCD  lf                  ISO */           
  35. #define aNEL     3  /* ESCE  return,lf              ISO */         
  36. #define aRI     4  /* ESCM  reverse lf              ISO */      
  37.  
  38. #define aSGR0     5  /* ESC[0m normal char set          ISO */    
  39. #define aSGR3     6  /* ESC[3m italics on          ISO */        
  40. #define aSGR23     7  /* ESC[23m italics off          ISO */
  41. #define aSGR4     8  /* ESC[4m underline on          ISO */
  42. #define aSGR24     9  /* ESC[24m underline off          ISO */
  43. #define aSGR1    10  /* ESC[1m boldface on          ISO */
  44. #define aSGR22    11  /* ESC[22m boldface off          ISO */
  45. #define aSFC    12  /* SGR30-39     set foreground color ISO */
  46. #define aSBC    13  /* SGR40-49     set background color ISO */
  47.  
  48. #define aSHORP0 14  /* ESC[0w normal pitch          DEC */
  49. #define aSHORP2 15  /* ESC[2w elite on              DEC */
  50. #define aSHORP1 16  /* ESC[1w elite off              DEC */
  51. #define aSHORP4 17  /* ESC[4w condensed fine on          DEC */
  52. #define aSHORP3 18  /* ESC[3w condensed off          DEC */
  53. #define aSHORP6 19  /* ESC[6w enlarged on          DEC */
  54. #define aSHORP5 20  /* ESC[5w enlarged off          DEC */
  55.  
  56. #define aDEN6    21  /* ESC[6"z shadow print on          DEC (sort of) */
  57. #define aDEN5    22  /* ESC[5"z shadow print off          DEC */
  58. #define aDEN4    23  /* ESC[4"z doublestrike on          DEC */
  59. #define aDEN3    24  /* ESC[3"z doublestrike off          DEC */
  60. #define aDEN2    25  /* ESC[2"z    NLQ on              DEC */
  61. #define aDEN1    26  /* ESC[1"z    NLQ off              DEC */
  62.  
  63. #define aSUS2    27  /* ESC[2v superscript on          +++ */
  64. #define aSUS1    28  /* ESC[1v superscript off          +++ */
  65. #define aSUS4    29  /* ESC[4v subscript on          +++ */
  66. #define aSUS3    30  /* ESC[3v subscript off          +++ */
  67. #define aSUS0    31  /* ESC[0v normalize the line      +++ */
  68. #define aPLU    32  /* ESCL  partial line up          ISO */
  69. #define aPLD    33  /* ESCK  partial line down          ISO */
  70.  
  71. #define aFNT0    34  /* ESC(B US char set    or Typeface  0 (default) */
  72. #define aFNT1    35  /* ESC(R French char set    or Typeface  1 */
  73. #define aFNT2    36  /* ESC(K German char set    or Typeface  2 */
  74. #define aFNT3    37  /* ESC(A UK char set    or Typeface  3 */
  75. #define aFNT4    38  /* ESC(E Danish I char set    or Typeface  4 */
  76. #define aFNT5    39  /* ESC(H Sweden char set    or Typeface  5 */
  77. #define aFNT6    40  /* ESC(Y Italian char set    or Typeface  6 */
  78. #define aFNT7    41  /* ESC(Z Spanish char set    or Typeface  7 */
  79. #define aFNT8    42  /* ESC(J Japanese char set    or Typeface  8 */
  80. #define aFNT9    43  /* ESC(6 Norweign char set    or Typeface  9 */
  81. #define aFNT10    44  /* ESC(C Danish II char set or Typeface 10 */
  82.                   
  83. /*
  84.     Suggested typefaces are:
  85.  
  86.      0 - default typeface.
  87.      1 - Line Printer or equiv.
  88.      2 - Pica or equiv.
  89.      3 - Elite or equiv.
  90.      4 - Helvetica or equiv.
  91.      5 - Times Roman or equiv.
  92.      6 - Gothic or equiv.
  93.      7 - Script or equiv.
  94.      8 - Prestige or equiv.
  95.      9 - Caslon or equiv.
  96.     10 - Orator or equiv.
  97. */
  98.  
  99. #define aPROP2    45  /* ESC[2p  proportional on          +++ */
  100. #define aPROP1    46  /* ESC[1p  proportional off          +++ */
  101. #define aPROP0    47  /* ESC[0p  proportional clear     +++ */
  102. #define aTSS    48  /* ESC[n E set proportional offset ISO */
  103. #define aJFY5    49  /* ESC[5 F auto left justify      ISO */
  104. #define aJFY7    50  /* ESC[7 F auto right justify     ISO */
  105. #define aJFY6    51  /* ESC[6 F auto full justify      ISO */
  106. #define aJFY0    52  /* ESC[0 F auto justify off          ISO */
  107. #define aJFY3    53  /* ESC[3 F letter space (justify) ISO (special) */
  108. #define aJFY1    54  /* ESC[1 F word fill(auto center) ISO (special) */
  109.  
  110. #define aVERP0    55  /* ESC[0z  1/8" line spacing      +++ */
  111. #define aVERP1    56  /* ESC[1z  1/6" line spacing      +++ */
  112. #define aSLPP    57  /* ESC[nt  set form length n      DEC */
  113. #define aPERF    58  /* ESC[nq  perf skip n (n>0)      +++ */
  114. #define aPERF0    59  /* ESC[0q  perf skip off          +++ */
  115.             
  116. #define aLMS    60  /* ESC#9   Left margin set          +++ */
  117. #define aRMS    61  /* ESC#0   Right margin set          +++ */
  118. #define aTMS    62  /* ESC#8   Top margin set          +++ */
  119. #define aBMS    63  /* ESC#2   Bottom marg set          +++ */
  120. #define aSTBM    64  /* ESC[Pn1;Pn2r  T&B margins      DEC */
  121. #define aSLRM    65  /* ESC[Pn1;Pn2s  L&R margin          DEC */
  122. #define aCAM    66  /* ESC#3   Clear margins          +++ */
  123.  
  124. #define aHTS    67  /* ESCH    Set horiz tab          ISO */
  125. #define aVTS    68  /* ESCJ    Set vertical tabs      ISO */
  126. #define aTBC0    69  /* ESC[0g  Clr horiz tab          ISO */
  127. #define aTBC3    70  /* ESC[3g  Clear all h tab          ISO */
  128. #define aTBC1    71  /* ESC[1g  Clr vertical tabs      ISO */
  129. #define aTBC4    72  /* ESC[4g  Clr all v tabs          ISO */
  130. #define aTBCALL 73  /* ESC#4   Clr all h & v tabs     +++ */
  131. #define aTBSALL 74  /* ESC#5   Set default tabs          +++ */
  132. #define aEXTEND 75  /* ESC[Pn"x extended commands     +++ */
  133.  
  134. #define aRAW    76    /* ESC[Pn"r    Next 'Pn' chars are raw +++ */
  135.  
  136. struct IOPrtCmdReq {
  137.     struct  Message io_Message;
  138.     struct  Device  *io_Device;        /* device node pointer  */
  139.     struct  Unit    *io_Unit;        /* unit (driver private)*/
  140.     UWORD   io_Command;            /* device command */
  141.     UBYTE   io_Flags;
  142.     BYTE    io_Error;            /* error or warning num */
  143.     UWORD   io_PrtCommand;        /* printer command */
  144.     UBYTE   io_Parm0;            /* first command parameter */
  145.     UBYTE   io_Parm1;            /* second command parameter */
  146.     UBYTE   io_Parm2;            /* third command parameter */
  147.     UBYTE   io_Parm3;            /* fourth command parameter */
  148. };
  149.  
  150. struct IODRPReq {
  151.     struct  Message io_Message;
  152.     struct  Device  *io_Device;        /* device node pointer  */
  153.     struct  Unit    *io_Unit;        /* unit (driver private)*/
  154.     UWORD   io_Command;            /* device command */
  155.     UBYTE   io_Flags;
  156.     BYTE    io_Error;            /* error or warning num */
  157.     struct  RastPort *io_RastPort;  /* raster port */
  158.     struct  ColorMap *io_ColorMap;  /* color map */
  159.     ULONG   io_Modes;            /* graphics viewport modes */
  160.     UWORD   io_SrcX;            /* source x origin */
  161.     UWORD   io_SrcY;            /* source y origin */
  162.     UWORD   io_SrcWidth;        /* source x width */
  163.     UWORD   io_SrcHeight;        /* source x height */
  164.     LONG    io_DestCols;        /* destination x width */
  165.     LONG    io_DestRows;        /* destination y height */
  166.     UWORD   io_Special;            /* option flags */
  167. };
  168.  
  169. #define SPECIAL_MILCOLS        0x0001    /* DestCols specified in 1/1000" */
  170. #define SPECIAL_MILROWS        0x0002    /* DestRows specified in 1/1000" */
  171. #define SPECIAL_FULLCOLS    0x0004    /* make DestCols maximum possible */
  172. #define SPECIAL_FULLROWS    0x0008    /* make DestRows maximum possible */
  173. #define SPECIAL_FRACCOLS    0x0010    /* DestCols is fraction of FULLCOLS */
  174. #define SPECIAL_FRACROWS    0x0020    /* DestRows is fraction of FULLROWS */
  175. #define SPECIAL_CENTER        0x0040    /* center image on paper */
  176. #define SPECIAL_ASPECT        0x0080    /* ensure correct aspect ratio */
  177. #define SPECIAL_DENSITY1    0x0100    /* lowest resolution (dpi) */
  178. #define SPECIAL_DENSITY2    0x0200    /* next res */
  179. #define SPECIAL_DENSITY3    0x0300    /* next res */
  180. #define SPECIAL_DENSITY4    0x0400    /* next res */
  181. #define SPECIAL_DENSITY5    0x0500    /* next res */
  182. #define SPECIAL_DENSITY6    0x0600    /* next res */
  183. #define SPECIAL_DENSITY7    0x0700    /* highest res */
  184. #define SPECIAL_NOFORMFEED    0x0800    /* don't eject paper on gfx prints */
  185. #define SPECIAL_TRUSTME        0x1000    /* don't reset on gfx prints */
  186. /*
  187.     Compute print size, set 'io_DestCols' and 'io_DestRows' in the calling
  188.     program's 'IODRPReq' structure and exit, DON'T PRINT.  This allows the
  189.     calling program to see what the final print size would be in printer
  190.     pixels.     Note that it modifies the 'io_DestCols' and 'io_DestRows'
  191.     fields of your 'IODRPReq' structure.  Also, set the print density and
  192.     update the 'MaxXDots', 'MaxYDots', 'XDotsInch', and 'YDotsInch' fields
  193.     of the 'PrinterExtendedData' structure.
  194. */
  195. #define SPECIAL_NOPRINT        0x2000    /* see above */
  196.  
  197. #define PDERR_NOERR        0    /* clean exit, no errors */
  198. #define PDERR_CANCEL        1    /* user cancelled print */
  199. #define PDERR_NOTGRAPHICS    2    /* printer cannot output graphics */
  200. #define PDERR_INVERTHAM        3    /* OBSOLETE */
  201. #define PDERR_BADDIMENSION    4    /* print dimensions illegal */
  202. #define PDERR_DIMENSIONOVFLOW    5    /* OBSOLETE */
  203. #define PDERR_INTERNALMEMORY    6    /* no memory for internal variables */
  204. #define PDERR_BUFFERMEMORY    7    /* no memory for print buffer */
  205. /*
  206.     Note : this is an internal error that can be returned from the render
  207.     function to the printer device.     It is NEVER returned to the user.
  208.     If the printer device sees this error it converts it 'PDERR_NOERR'
  209.     and exits gracefully.  Refer to the document on
  210.     'How to Write a Graphics Printer Driver' for more info.
  211. */
  212. #define PDERR_TOOKCONTROL    8    /* Took control in case 0 of render */
  213.  
  214. /* internal use */
  215. #define SPECIAL_DENSITYMASK    0x0700    /* masks out density values */
  216. #define SPECIAL_DIMENSIONSMASK \
  217.     (SPECIAL_MILCOLS|SPECIAL_MILROWS|SPECIAL_FULLCOLS|SPECIAL_FULLROWS\
  218.     |SPECIAL_FRACCOLS|SPECIAL_FRACROWS|SPECIAL_ASPECT)
  219.  
  220. #endif    /* DEVICES_PRINTER_H */
  221.