Debian Codegraph @

contrib/eplaser/gdevescv.h

raw
1 /* Copyright (C) EPSON SOFTWARE DEVELOPMENT LABORATORY, INC. 1999,2000.
2 Copyright (C) SEIKO EPSON CORPORATION 2000-2006,2009.
3
4 Ghostscript printer driver for EPSON ESC/Page and ESC/Page-Color.
5
6 This software is distributed in the hope that it will be useful, but
7 WITHOUT ANY WARRANTY. No author or distributor accepts responsibility
8 to anyone for the consequences of using it or for whether it serves any
9 particular purpose or works at all, unless he says so in writing. Refer
10 to the GNU General Public License for full details.
11
12 Everyone is granted permission to copy, modify and redistribute
13 this software, but only under the conditions described in the GNU
14 General Public License. A copy of this license is supposed to have been
15 given to you along with this software so you can know your rights and
16 responsibilities. It should be in a file named COPYING. Among other
17 things, the copyright notice and this notice must be preserved on all
18 copies.
19 */
20
21 #ifndef gdevescv_INCLUDED
22 #define gdevescv_INCLUDED
23
24 #ifndef TRUE
25 # define TRUE 1
26 #endif
27
28 #ifndef FALSE
29 # define FALSE 0
30 #endif
31
32 #define GS (0x1d)
33 #define ESC_GS "\035"
34 #define ESC_FF "\014"
35 #define ESC_CR "\015"
36 #define ESC_LF "\012"
37 #define ESC_BS "\010"
38
39 #define POINT 72
40 #define MMETER_PER_INCH 25.4
41
42 #define ESCPAGE_DEFAULT_WIDTH (4840)
43 #define ESCPAGE_DEFAULT_HEIGHT (6896)
44
45 #define ESCPAGE_LEFT_MARGIN_DEFAULT 5. / (MMETER_PER_INCH / POINT)
46 #define ESCPAGE_BOTTOM_MARGIN_DEFAULT 5. / (MMETER_PER_INCH / POINT)
47 #define ESCPAGE_RIGHT_MARGIN_DEFAULT 5. / (MMETER_PER_INCH / POINT)
48 #define ESCPAGE_TOP_MARGIN_DEFAULT 5. / (MMETER_PER_INCH / POINT)
49
50 #define NUM_OF_PAPER_TABLES 23
51 #define MAX_PAPER_SIZE_DELTA 5
52
53 #define ESCPAGE_OPTION_MANUALFEED "ManualFeed"
54 #define ESCPAGE_OPTION_CASSETFEED "Casset"
55 #define ESCPAGE_OPTION_FACEUP "FaceUp"
56 #define ESCPAGE_OPTION_DUPLEX "Duplex"
57 #define ESCPAGE_OPTION_DUPLEX_TUMBLE "Tumble"
58 #define ESCPAGE_OPTION_MEDIATYPE "MediaType"
59 #define ESCPAGE_OPTION_RIT "RITOff"
60 #define ESCPAGE_OPTION_LANDSCAPE "Landscape"
61 #define ESCPAGE_OPTION_TONERDENSITY "TonerDensity"
62 #define ESCPAGE_OPTION_TONERSAVING "TonerSaving"
63 #define ESCPAGE_OPTION_COLLATE "Collate"
64 #define ESCPAGE_OPTION_JOBID "JobID"
65 #define ESCPAGE_OPTION_USERNAME "UserName"
66 #define ESCPAGE_OPTION_DOCUMENT "Document"
67 #define ESCPAGE_OPTION_HOSTNAME "HostName"
68 #define ESCPAGE_OPTION_COMMENT "eplComment"
69 #define ESCPAGE_OPTION_EPLModelJP "EPLModelJP"
70 #define ESCPAGE_OPTION_EPLCapFaceUp "EPLCapFaceUp"
71 #define ESCPAGE_OPTION_EPLCapDuplexUnit "EPLCapDuplexUnit"
72 #define ESCPAGE_OPTION_EPLCapMaxResolution "EPLCapMaxResolution"
73
74 #define ESCPAGE_JOBID_MAX 255
75 #define ESCPAGE_USERNAME_MAX 255
76 #define ESCPAGE_HOSTNAME_MAX 255
77 #define ESCPAGE_DOCUMENT_MAX 255
78 #define ESCPAGE_MODELNAME_MAX 255
79 #define ESCPAGE_COMMENT_MAX 255
80
81 #define ESCPAGE_TUMBLE_DEFAULT FALSE /* Long age */
82 #define ESCPAGE_RIT_DEFAULT FALSE
83 #define ESCPAGE_FACEUP_DEFAULT FALSE
84 #define ESCPAGE_FACEUP_DEFAULT FALSE
85
86 #define ESCPAGE_MEDIATYPE_DEFAULT 0 /* NORMAL */
87 #define ESCPAGE_MEDIACHAR_MAX 32
88
89 #define ESCPAGE_MANUALFEED_DEFAULT FALSE
90 #define ESCPAGE_CASSETFEED_DEFAULT 0
91
92 #define ESCPAGE_DPI_MIN 60
93 #define ESCPAGE_DPI_MAX 1200
94
95 #define ESCPAGE_HEIGHT_MAX ( 1369 + MAX_PAPER_SIZE_DELTA ) /* A3PLUS */
96 #define ESCPAGE_WIDTH_MAX ( 933 + MAX_PAPER_SIZE_DELTA ) /* A3PLUS */
97 #define ESCPAGE_HEIGHT_MIN ( 420 - MAX_PAPER_SIZE_DELTA ) /* POSTCARD */
98 #define ESCPAGE_WIDTH_MIN ( 279 - MAX_PAPER_SIZE_DELTA ) /* MON */
99
100 #define RES1200 1200
101 #define RES600 600
102 #define JPN TRUE
103 #define ENG FALSE
104
105 #define X_DPI 600
106 #define Y_DPI 600
107 #define VCACHE 0x3FF
108
109 #define ESCPAGE_DEVICENAME_COLOR "eplcolor"
110 #define ESCPAGE_DEVICENAME_MONO "eplmono"
111
112 /* ---------------- Device definition ---------------- */
113
114 typedef struct gx_device_escv_s {
115 gx_device_vector_common;
116
117 int colormode; /* 0=ESC/Page(Monochrome), 1=ESC/Page-Color */
118 bool manualFeed; /* Use manual feed */
119 int cassetFeed; /* Input Casset */
120 bool RITOff; /* RIT Control */
121 bool Collate;
122 int toner_density;
123 bool toner_saving;
124 int prev_paper_size;
125 int prev_paper_width;
126 int prev_paper_height;
127 int prev_num_copies;
128 int prev_feed_mode;
129 bool orientation;
130 bool faceup;
131 int MediaType;
132 bool first_page;
133 bool Duplex;
134 bool Tumble;
135 int ncomp;
136 int MaskReverse;
137 int MaskState;
138 bool c4map; /* 4bit ColorMap */
139 bool c8map; /* 8bit ColorMap */
140 int prev_x;
141 int prev_y;
142 gx_color_index prev_color;
143 gx_color_index current_color;
144 double lwidth;
145 long cap;
146 long join;
147 long reverse_x;
148 long reverse_y;
149 gs_matrix xmat; /* matrix */
150 int bx;
151 int by;
152 int w; /* width */
153 int h; /* height */
154 int roll;
155 float sx; /* scale x */
156 float sy; /* scale y */
157 long dd;
158 int ispath;
159 gx_bitmap_id id_cache[VCACHE + 1]; /* for Font Downloading */
160 char JobID[ESCPAGE_JOBID_MAX + 1];
161 char UserName[ESCPAGE_USERNAME_MAX + 1];
162 char HostName[ESCPAGE_HOSTNAME_MAX + 1];
163 char Document[ESCPAGE_DOCUMENT_MAX + 1];
164 char Comment[ESCPAGE_COMMENT_MAX + 1];
165 gs_param_string gpsJobID;
166 gs_param_string gpsUserName;
167 gs_param_string gpsHostName;
168 gs_param_string gpsDocument;
169 gs_param_string gpsComment;
170 bool modelJP;
171 bool capFaceUp;
172 bool capDuplexUnit;
173 int capMaxResolution;
174 } gx_device_escv;
175
176 typedef struct EPaperTable_s{
177 int width; /* paper width (unit: point) */
178 int height; /* paper height (unit: point) */
179 int escpage; /* number of papersize in ESC/PAGE */
180 const char *name; /* Paper Name */
181 } EPaperTable;
182
183 typedef struct paper_candidate_s {
184 const EPaperTable *paper;
185 int absw; /* absolute delta width */
186 int absh; /* absolute delta height */
187 int score; /* select priority score */
188 bool isfillw; /* inside printable area width? */
189 bool isfillh; /* inside printable area height? */
190 bool isminw; /* best fit width? */
191 bool isminh; /* best fit height? */
192 } paper_candidate;
193
194 #endif /* gdevescv_INCLUDED */
195
196 /* end of file */