]>
Commit | Line | Data |
---|---|---|
1 | // | |
2 | // "$Id$" | |
3 | // | |
4 | // PPD file compiler test data file for the Common UNIX Printing | |
5 | // System (CUPS). | |
6 | // | |
7 | // Copyright 2007 by Apple Inc. | |
8 | // Copyright 1997-2003 by Easy Software Products. | |
9 | // | |
10 | // These coded instructions, statements, and computer programs are the | |
11 | // property of Apple Inc. and are protected by Federal copyright | |
12 | // law. Distribution and use rights are outlined in the file "LICENSE.txt" | |
13 | // which should have been included with this file. If this file is | |
14 | // file is missing or damaged, see the license at "http://www.cups.org/". | |
15 | // | |
16 | ||
17 | /* | |
18 | * C-style comments are supported. | |
19 | */ | |
20 | ||
21 | // | |
22 | // C++-style comments are supported. | |
23 | // | |
24 | ||
25 | // | |
26 | // Include the common media size definitions... | |
27 | // | |
28 | // #include directives support both <name> to include a standard file | |
29 | // and "name" or just name without the quotes for a local file. Local | |
30 | // files resolve relative to the current file's path. Unlike C/C++, | |
31 | // #include <name> does not look in multiple directories, and | |
32 | // #include "name" does not look in the standard directory. | |
33 | // | |
34 | ||
35 | #include <media.defs> | |
36 | ||
37 | ||
38 | // | |
39 | // Include the CUPS raster definitions... | |
40 | // | |
41 | ||
42 | #include <raster.defs> | |
43 | ||
44 | ||
45 | // | |
46 | // Include the standard CUPS fonts... | |
47 | // | |
48 | ||
49 | #include <font.defs> | |
50 | ||
51 | ||
52 | // | |
53 | // Define variables using the #define directive. In this case we | |
54 | // are defining constants for the model number, which is used by | |
55 | // our imaginary rastertofoo filter to determine which model-specific | |
56 | // features to use/support. | |
57 | // | |
58 | ||
59 | #define MODEL_BW 0 | |
60 | #define MODEL_COLOR 1 | |
61 | ||
62 | #define MODEL_LASER 0 | |
63 | #define MODEL_PHOTO 2 | |
64 | ||
65 | ||
66 | // | |
67 | // Media sizes are defined using the #media directive. The order of | |
68 | // values is: size name/text, width, length. | |
69 | // | |
70 | // "Size name" is an alphanumeric string of up to 40 characters as | |
71 | // defined by the Adobe PPD specification. | |
72 | // | |
73 | // "Size text" is a text string of up to 80 characters as defined by | |
74 | // the Adobe PPD specification. | |
75 | // | |
76 | // "Width" and "length" are the width and length of the media size. | |
77 | // Numbers by themselves represent points (72 points = 1 inch). The | |
78 | // suffixes "cm", "ft", "in", "m", "mm", and "pt" are recognized to | |
79 | // specify centimeters, feet, inches, meters, millimeters, and points, | |
80 | // respectively. | |
81 | // | |
82 | ||
83 | #media "FooLetter/Foo Letter" 8in 10in | |
84 | #media "FooPhoto/Foo Photo" 200mm 300mm | |
85 | ||
86 | ||
87 | // | |
88 | // Message catalogs can be included using #po... | |
89 | // | |
90 | ||
91 | #po fr foo-fr.po | |
92 | ||
93 | ||
94 | // | |
95 | // Specify that the drivers use all of the standard base fonts... | |
96 | // | |
97 | ||
98 | Font * | |
99 | ||
100 | ||
101 | // | |
102 | // All copyright lines are put at the top of the PPD file in order | |
103 | // of their appearance. Copyright text can span multiple lines and | |
104 | // will be properly included in the PPD file with comment prefixes | |
105 | // on each line. | |
106 | // | |
107 | // First an MIT-style copyright/license notice... | |
108 | // | |
109 | ||
110 | Copyright "Copyright 2007 by Foo Industries." | |
111 | Copyright " | |
112 | Permission is granted for redistribution of this file as long as | |
113 | this copyright notice is intact and the contents of the file are | |
114 | not altered in any way from their original form. | |
115 | ||
116 | Permission is hereby granted, free of charge, to any person | |
117 | obtaining a copy of this software and associated documentation | |
118 | files (the \"Software\"), to deal in the Software without | |
119 | restriction, including without limitation the rights to use, | |
120 | copy, modify, merge, publish, distribute, sublicense, and/or | |
121 | sell copies of the Software, and to permit persons to whom the | |
122 | Software is furnished to do so, subject to the following | |
123 | conditions: | |
124 | ||
125 | The above copyright notice and this permission notice shall be | |
126 | included in all copies or substantial portions of the Software. | |
127 | ||
128 | THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, | |
129 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | |
130 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | |
131 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | |
132 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | |
133 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
134 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |
135 | OTHER DEALINGS IN THE SOFTWARE. | |
136 | " | |
137 | ||
138 | // | |
139 | // Then a GPL notice... | |
140 | // | |
141 | ||
142 | Copyright "Copyright 2007 by Foo Industries." | |
143 | Copyright " | |
144 | This software is free software; you can redistribute it and/or | |
145 | modify it under the terms of the GNU General Public License as | |
146 | published by the Free Software Foundation; either version 2 of | |
147 | the License, or (at your option) any later version. | |
148 | ||
149 | This software is distributed in the hope that it will be useful, | |
150 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
151 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
152 | GNU General Public License for more details. | |
153 | ||
154 | You should have received a copy of the GNU General Public | |
155 | License along with this software; if not, write to the Free | |
156 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, | |
157 | MA 02111 USA | |
158 | " | |
159 | ||
160 | ||
161 | // | |
162 | // All printer drivers must define the manufacturer, model, PC | |
163 | // filename, and version strings; since this test file contains | |
164 | // drivers for an imaginary manufacturer "Foo", all of the drivers | |
165 | // listed in this file share common manufacturer and version | |
166 | // strings. | |
167 | // | |
168 | ||
169 | Manufacturer "Foo" | |
170 | Version 1.0 | |
171 | ||
172 | ||
173 | // | |
174 | // Printer drivers can access driver-specific attributes in a PPD | |
175 | // file; these attributes are specified using lines of the form: | |
176 | // | |
177 | // Attribute name selector value | |
178 | // | |
179 | // "Name" is the name of the attribute and should start with either | |
180 | // the "cups" prefix or the name of the vendor, e.g. "hpFoo", | |
181 | // "epsonBar", etc. The name can be any alphanumeric character (a-z, | |
182 | // A-Z, and 0-9) and cannot be a common prefix of another attribute, | |
183 | // e.g. "fooLines" and "fooLinesPerInch" cannot be in the same file. | |
184 | // | |
185 | // "Selector" is a selector string containing any characters except | |
186 | // colon (:). Typically this will be one or more keywords separated | |
187 | // by the forward slash (/), however the empty string ("") can be used | |
188 | // to omit the selector. | |
189 | // | |
190 | // "Value" is a quoted value string that can contain any printable | |
191 | // characters except the double quote ("). Hexadecimal numbers | |
192 | // inside angle brackets (<xx>) can be used to substitute escape | |
193 | // codes and other special characters. | |
194 | // | |
195 | ||
196 | Attribute fooOutputFormat "" "PCL" | |
197 | Attribute fooPJL Begin "<1B>%-12345X@PJL<0D0A>" | |
198 | Attribute fooPJL Enter/PCL "@PJL ENTER LANGUAGE=PCL<0D0A>" | |
199 | Attribute fooPJL End "<1B>%-12345X@PJL END JOB<0D0A>" | |
200 | ||
201 | // | |
202 | // Most printer drivers use filters; exceptions include PostScript | |
203 | // printers and PPD files for software RIPs. | |
204 | // | |
205 | // The format is: | |
206 | // | |
207 | // Filter mime-type cost program | |
208 | // | |
209 | // The "mime-type" field defines the MIME type that the filter program | |
210 | // accepts; for CUPS raster printer drivers, this will be | |
211 | // "application/vnd.cups-raster". | |
212 | // | |
213 | // The "cost" field defines the relative cost of the filter in terms of | |
214 | // both CPU and memory usage, and is used to limit the number of | |
215 | // simultaneous jobs in some configurations. Most raster filters should | |
216 | // have a cost of 100, unless the filter does no dithering - then a cost | |
217 | // of 33 is more appropriate. | |
218 | // | |
219 | // The "program" field defined the filter program to run; use the null | |
220 | // filter "-" to define a MIME type that the printer accepts directly. | |
221 | // If no path information is provided, then the program will be run | |
222 | // from the standard CUPS filter directory, usually | |
223 | // /usr/lib/cups/filter. | |
224 | // | |
225 | // When compiling PPD files for PostScript capable devices that use | |
226 | // additional filters, add a null filter for the MIME type | |
227 | // "application/vnd.cups-postscript" so that printer commands, user | |
228 | // job filters, and page markings can be added to the PostScript | |
229 | // output that is sent to the printer. | |
230 | // | |
231 | ||
232 | Filter application/vnd.cups-raster 100 rastertofoo | |
233 | ||
234 | ||
235 | // | |
236 | // Attributes are included thusly... | |
237 | // | |
238 | ||
239 | Attribute cupsIPPReason "com.foo-serious-error/A Serious Error" "http://foo.com/serious.html" | |
240 | ||
241 | ||
242 | // | |
243 | // Curley braces are used for grouping common data and for isolating | |
244 | // individual printer models. All data values are inherited *except* | |
245 | // for the PCFilename and ModelName strings. | |
246 | // | |
247 | ||
248 | { | |
249 | // | |
250 | // Define two printer drivers that support only the FooLetter and | |
251 | // FooPhoto media size. One is color, the other is black-and-white. | |
252 | // | |
253 | // Both printers share two MediaSize definitions; the name listed | |
254 | // after the MediaSize keyword must be one of the Adobe standard | |
255 | // names listed in the PPD specification or any named size defined | |
256 | // using the #media directive. | |
257 | // | |
258 | // Default options are indicated by placing an asterisk (*) before | |
259 | // the keyword. | |
260 | // | |
261 | // For custom size and margin specification, see the next group of | |
262 | // printer drivers. | |
263 | // | |
264 | ||
265 | MediaSize FooLetter | |
266 | *MediaSize FooPhoto | |
267 | ||
268 | ||
269 | // | |
270 | // These imaginary printers support printing at 300, 600x300, | |
271 | // and 600 DPI. We'll use the old-style Resolution convenience | |
272 | // keyword which accepts the following parameters: colorspace/ | |
273 | // order, bits-per-color, row count, row feed, row step, and | |
274 | // name/text. | |
275 | // | |
276 | // The name must be of the form NNNsuffix or NNNxMMMsuffix, | |
277 | // where NNN and MMM represent the X and Y resolution in dots | |
278 | // per inch. | |
279 | // | |
280 | ||
281 | Resolution - 8 0 0 0 "300dpi/300 DPI" | |
282 | Resolution - 8 0 0 0 "600x300dpi/600 x 300 DPI" | |
283 | *Resolution - 8 0 0 0 "600dpi/600 DPI" | |
284 | ||
285 | ||
286 | // | |
287 | // One printer is grayscale only, and the other does grayscale | |
288 | // and color. Define the grayscale color model for both printers | |
289 | // using the old-style ColorModel convenience keyword which | |
290 | // accepts the name/text, colorspace, color order, and compression | |
291 | // parameters. | |
292 | // | |
293 | ||
294 | ColorModel Gray/Grayscale w chunked 0 | |
295 | ||
296 | ||
297 | { | |
298 | // | |
299 | // The first sub-group contains the grayscale printer, which | |
300 | // only needs the model name, PC filename, and model number | |
301 | // values set... | |
302 | // | |
303 | // The ModelName keyword defines the string that is shown to | |
304 | // the user. | |
305 | // | |
306 | ||
307 | ModelName "Mono Photo Printer" | |
308 | ||
309 | ||
310 | // | |
311 | // The ModelNumber keyword defines the cupsModelNumber | |
312 | // attribute value. We use the "(name name)" notation | |
313 | // to perform a bitwise OR of the #define'd constants. | |
314 | // | |
315 | ||
316 | ModelNumber ($MODEL_BW $MODEL_PHOTO) | |
317 | ||
318 | ||
319 | // | |
320 | // The PCFileName keyword defines the filename of the PPD | |
321 | // file and should be 8 characters or less + the .ppd | |
322 | // extension. | |
323 | // | |
324 | ||
325 | PCFileName "foogphot.ppd" | |
326 | } | |
327 | ||
328 | ||
329 | { | |
330 | // | |
331 | // The second sub-group contains the color printer, which | |
332 | // needs another ColorModel definition along with the model | |
333 | // name, PC filename, and model number values. For fun, we'll | |
334 | // add some input slots (paper trays) as well. | |
335 | // | |
336 | // The ModelName keyword defines the string that is shown to | |
337 | // the user. | |
338 | // | |
339 | ||
340 | ModelName "Color Photo Printer" | |
341 | ||
342 | ||
343 | // | |
344 | // The ModelNumber keyword defines the cupsModelNumber | |
345 | // attribute value. We use the "(name name)" notation | |
346 | // to perform a bitwise OR of the #define'd constants. | |
347 | // | |
348 | ||
349 | ModelNumber ($MODEL_COLOR $MODEL_PHOTO) | |
350 | ||
351 | ||
352 | // | |
353 | // The PCFileName keyword defines the filename of the PPD | |
354 | // file and should be 8 characters or less + the .ppd | |
355 | // extension. | |
356 | // | |
357 | ||
358 | PCFileName "foocphot.ppd" | |
359 | ||
360 | ||
361 | // | |
362 | // This printer does color printing, too, so add it and make | |
363 | // RGB the default... | |
364 | // | |
365 | ||
366 | ColorDevice Yes | |
367 | ||
368 | *ColorModel RGB/Color rgb chunked 0 | |
369 | ||
370 | ||
371 | // | |
372 | // The old-style InputSlot keyword accepts tray definitions | |
373 | // of the form: | |
374 | // | |
375 | // InputSlot position name/text | |
376 | // | |
377 | ||
378 | InputSlot 0 "Upper/Main Paper Tray" | |
379 | InputSlot 1 "LargeCapacity/Large Paper Tray" | |
380 | } | |
381 | } | |
382 | ||
383 | ||
384 | { | |
385 | // | |
386 | // Define two printer drivers that support two typical laser | |
387 | // printers with custom page sizes. One is color, the other is | |
388 | // black-and-white. | |
389 | // | |
390 | // Both printers share several MediaSize definitions and support | |
391 | // custom page sizes from 3x5 to 13x19 inches. | |
392 | // | |
393 | // All US media sizes use hardware margins of 0.25 inches on the sides | |
394 | // and 12 points (1/6th inch) at the top and bottom. European sizes | |
395 | // and custom sizes use margins of 12 points all around. | |
396 | // | |
397 | // The order of the HWMargins numbers are left, bottom, right, and top. | |
398 | // The current HWMargins values are used when defining each media size. | |
399 | // The last HWMargins values are used for custom page size margins. | |
400 | // | |
401 | ||
402 | HWMargins 0.25in 12pt 0.25in 12pt | |
403 | ||
404 | *MediaSize Letter | |
405 | MediaSize Legal | |
406 | MediaSize Tabloid | |
407 | MediaSize TabloidExtra | |
408 | ||
409 | HWMargins 12pt 12pt 12pt 12pt | |
410 | MediaSize A4 | |
411 | MediaSize A3 | |
412 | ||
413 | // | |
414 | // Specify that custom/variable paper sizes are supported, and the | |
415 | // range of sizes that are supported... | |
416 | // | |
417 | ||
418 | VariablePaperSize Yes | |
419 | MinSize 3in 5in | |
420 | MaxSize 13in 19in | |
421 | ||
422 | ||
423 | // | |
424 | // These imaginary printers support printing at 600 and 1200 DPI. | |
425 | // We'll use the new Option and Choice keywords to define the | |
426 | // Resolution options... | |
427 | // | |
428 | // Option option-name option-text option-type | |
429 | // Choice choice-name choice-text code | |
430 | // | |
431 | // "Option-type" is the type of option: boolean, pickone, or pickmany. | |
432 | // | |
433 | ||
434 | Option Resolution PickOne AnySetup 10 | |
435 | Choice "600dpi/600 DPI" "<</HWResolution[600 600]/cupsBitsPerColor 8>>setpagedevice" | |
436 | Choice "1200dpi/1200 DPI" "<</HWResolution[1200 1200]/cupsBitsPerColor 8>>setpagedevice" | |
437 | ||
438 | ||
439 | // | |
440 | // One printer is grayscale only, and the other does grayscale | |
441 | // and color. Define the grayscale color model for both printers | |
442 | // using the new Option and Choice keywords. | |
443 | // | |
444 | ||
445 | Option "ColorModel/Color Mode" PickOne AnySetup 10 | |
446 | Choice Gray/Grayscale "<</cupsColorSpace $CUPS_CSPACE_W>>setpagedevice" | |
447 | ||
448 | ||
449 | // | |
450 | // Both printers provide two paper trays, which we'll define using | |
451 | // the new Option and Choice keywords... | |
452 | // | |
453 | ||
454 | Option "InputSlot/Input Slot" PickOne AnySetup 10 | |
455 | Choice "Upper/Main Paper Tray" "<</MediaPosition 0>>setpagedevice" | |
456 | Choice "LargeCapacity/Large Paper Tray" "<</MediaPosition 1>>setpagedevice" | |
457 | ||
458 | ||
459 | // | |
460 | // Both printers support duplexing... | |
461 | // | |
462 | // The Duplex keyword accepts values of "none" (no duplexing capability), | |
463 | // "normal" (standard duplexing capability), and "flip" (auto-duplex that | |
464 | // requires the back side to be flipped by the RIP...) | |
465 | // | |
466 | ||
467 | Duplex normal | |
468 | ||
469 | ||
470 | { | |
471 | // | |
472 | // The first sub-group contains the grayscale printer, which | |
473 | // only needs the model name, PC filename, and model number | |
474 | // values set... | |
475 | // | |
476 | // The ModelName keyword defines the string that is shown to | |
477 | // the user. | |
478 | // | |
479 | ||
480 | ModelName "Mono Laser Printer" | |
481 | ||
482 | ||
483 | // | |
484 | // The ModelNumber keyword defines the cupsModelNumber | |
485 | // attribute value. We use the "(name name)" notation | |
486 | // to perform a bitwise OR of the #define'd constants. | |
487 | // | |
488 | ||
489 | ModelNumber ($MODEL_BW $MODEL_LASER) | |
490 | ||
491 | ||
492 | // | |
493 | // The PCFileName keyword defines the filename of the PPD | |
494 | // file and should be 8 characters or less + the .ppd | |
495 | // extension. | |
496 | // | |
497 | ||
498 | PCFileName "fooglasr.ppd" | |
499 | } | |
500 | ||
501 | ||
502 | { | |
503 | // | |
504 | // The second sub-group contains the color printer, which | |
505 | // needs another ColorModel definition along with the model | |
506 | // name, PC filename, and model number values. | |
507 | // | |
508 | // The ModelName keyword defines the string that is shown to | |
509 | // the user. | |
510 | // | |
511 | ||
512 | ModelName "Color Laser Printer" | |
513 | ||
514 | ||
515 | // | |
516 | // The ModelNumber keyword defines the cupsModelNumber | |
517 | // attribute value. We use the "(name name)" notation | |
518 | // to perform a bitwise OR of the #define'd constants. | |
519 | // | |
520 | ||
521 | ModelNumber ($MODEL_COLOR $MODEL_LASER) | |
522 | ||
523 | ||
524 | // | |
525 | // The PCFileName keyword defines the filename of the PPD | |
526 | // file and should be 8 characters or less + the .ppd | |
527 | // extension. | |
528 | // | |
529 | ||
530 | PCFileName "fooclasr.ppd" | |
531 | ||
532 | ||
533 | // | |
534 | // This printer does color printing, too, so add it and make | |
535 | // RGB the default... | |
536 | // | |
537 | ||
538 | ColorDevice Yes | |
539 | ||
540 | Option "ColorModel/Color Mode" PickOne AnySetup 10 | |
541 | *Choice RGB/Color "<</cupsColorSpace $CUPS_CSPACE_RGB>>setpagedevice" | |
542 | } | |
543 | } | |
544 | ||
545 | ||
546 | // | |
547 | // End of "$Id$". | |
548 | // |