xref: /plan9/sys/src/cmd/gs/src/gdevdljm.h (revision 593dc095aefb2a85c828727bbfa9da139a49bdf4)
1 /* Copyright (C) 2000 Aladdin Enterprises.  All rights reserved.
2 
3   This software is provided AS-IS with no warranty, either express or
4   implied.
5 
6   This software is distributed under license and may not be copied,
7   modified or distributed except as expressly authorized under the terms
8   of the license contained in the file LICENSE in this distribution.
9 
10   For more information about licensing, please refer to
11   http://www.ghostscript.com/licensing/. For information on
12   commercial licensing, go to http://www.artifex.com/licensing/ or
13   contact Artifex Software, Inc., 101 Lucas Valley Road #110,
14   San Rafael, CA  94903, U.S.A., +1(415)492-9861.
15  */
16 
17 /* $Id: gdevdljm.h,v 1.8 2004/01/29 18:40:23 ray Exp $ */
18 /* Interface to generic monochrome H-P DeskJet/LaserJet driver */
19 
20 #ifndef gdevdljm_INCLUDED
21 #  define gdevdljm_INCLUDED
22 
23 #include "gdevpcl.h"
24 
25 /*
26  * The notion that there is such a thing as a "PCL printer" is a fiction: no
27  * two "PCL" printers, even at the same PCL level, have identical command
28  * sets.  (The H-P documentation isn't fully accurate either; for example,
29  * it doesn't reveal that the DeskJet printers implement anything beyond PCL
30  * 3.)
31  *
32  * This file contains feature definitions for a generic monochrome PCL
33  * driver (gdevdljm.c), and the specific feature values for all such
34  * printers that Ghostscript currently supports.
35  */
36 
37 /* Printer spacing capabilities.  Include at most one of these. */
38 #define PCL_NO_SPACING   0	/* no vertical spacing capability, must be 0 */
39 #define PCL3_SPACING     1	/* <ESC>*p+<n>Y (PCL 3) */
40 #define PCL4_SPACING     2	/* <ESC>*b<n>Y (PCL 4) */
41 #define PCL5_SPACING     4	/* <ESC>*b<n>Y and clear seed row (PCL 5) */
42 /* The following is only used internally. */
43 #define PCL_ANY_SPACING\
44   (PCL3_SPACING | PCL4_SPACING | PCL5_SPACING)
45 
46 /* Individual printer properties.  Any subset of these may be included. */
47 #define PCL_MODE_2_COMPRESSION       8	/* compression mode 2 supported */
48 					/* (PCL 4) */
49 #define PCL_MODE_3_COMPRESSION      16	/* compression modes 2 & 3 supported */
50 					/* (PCL 5) */
51 #define PCL_END_GRAPHICS_DOES_RESET 32	/* <esc>*rB resets all parameters */
52 #define PCL_HAS_DUPLEX              64	/* <esc>&l<duplex>S supported */
53 #define PCL_CAN_SET_PAPER_SIZE     128	/* <esc>&l<sizecode>A supported */
54 #define PCL_CAN_PRINT_COPIES       256  /* <esc>&l<copies>X supported */
55 
56 /* Shorthands for the most common spacing/compression combinations. */
57 #define PCL_MODE0 PCL3_SPACING
58 #define PCL_MODE0NS PCL_NO_SPACING
59 #define PCL_MODE2 (PCL4_SPACING | PCL_MODE_2_COMPRESSION)
60 #define PCL_MODE2P (PCL_NO_SPACING | PCL_MODE_2_COMPRESSION)
61 #define PCL_MODE3 (PCL5_SPACING | PCL_MODE_3_COMPRESSION)
62 #define PCL_MODE3NS (PCL_NO_SPACING | PCL_MODE_3_COMPRESSION)
63 
64 /* Parameters for the printers we know about. */
65 
66      /* H-P DeskJet */
67 #define PCL_DJ_FEATURES\
68   (PCL_MODE2 |\
69    PCL_END_GRAPHICS_DOES_RESET | PCL_CAN_SET_PAPER_SIZE)
70 
71      /* H-P DeskJet 500 */
72 #define PCL_DJ500_FEATURES\
73   (PCL_MODE3 |\
74    PCL_END_GRAPHICS_DOES_RESET | PCL_CAN_SET_PAPER_SIZE)
75 
76      /* Kyocera FS-600 */
77 #define PCL_FS600_FEATURES\
78   (PCL_MODE3 |\
79    PCL_CAN_SET_PAPER_SIZE | PCL_CAN_PRINT_COPIES)
80 
81      /* H-P original LaserJet */
82 #define PCL_LJ_FEATURES\
83   (PCL_MODE0)
84 
85      /* H-P LaserJet Plus */
86 #define PCL_LJplus_FEATURES\
87   (PCL_MODE0)
88 
89      /* H-P LaserJet IIp, IId */
90 #define PCL_LJ2p_FEATURES\
91   (PCL_MODE2P |\
92    PCL_CAN_SET_PAPER_SIZE)
93 
94      /* H-P LaserJet III* */
95 #define PCL_LJ3_FEATURES\
96   (PCL_MODE3 |\
97    PCL_CAN_SET_PAPER_SIZE | PCL_CAN_PRINT_COPIES)
98 
99      /* H-P LaserJet IIId */
100 #define PCL_LJ3D_FEATURES\
101   (PCL_MODE3 |\
102    PCL_HAS_DUPLEX | PCL_CAN_SET_PAPER_SIZE | PCL_CAN_PRINT_COPIES)
103 
104      /* H-P LaserJet 4 */
105 #define PCL_LJ4_FEATURES\
106   (PCL_MODE3 |\
107    PCL_CAN_SET_PAPER_SIZE | PCL_CAN_PRINT_COPIES)
108 
109      /* H-P LaserJet 4d */
110 #define PCL_LJ4D_FEATURES\
111   (PCL_MODE3 |\
112    PCL_HAS_DUPLEX | PCL_CAN_SET_PAPER_SIZE | PCL_CAN_PRINT_COPIES)
113 
114      /* H-P 2563B line printer */
115 #define PCL_LP2563B_FEATURES\
116   (PCL_MODE0NS |\
117    PCL_CAN_SET_PAPER_SIZE)
118 
119      /* OCE 9050 line printer */
120 #define	PCL_OCE9050_FEATURES\
121   (PCL_MODE3NS |\
122    PCL_CAN_SET_PAPER_SIZE)
123 
124 /* ---------------- Procedures ---------------- */
125 
126 /* Send a page to the printer. */
127 int dljet_mono_print_page(
128 	gx_device_printer * pdev,	/* from device-specific _print_page */
129 	FILE * prn_stream,		/* ibid. */
130 	int dots_per_inch,		/* may be a multiple of y resolution */
131 	int features,			/* as defined above */
132 	const char *page_init		/* page initialization string */
133 			     );
134 int dljet_mono_print_page_copies(
135 	gx_device_printer * pdev,
136 	FILE * prn_stream,
137 	int num_copies,
138 	int dots_per_inch,
139 	int features,
140 	const char *page_init
141 			     );
142 
143 #endif /* gdevdljm_INCLUDED */
144