]>
Commit | Line | Data |
---|---|---|
a603edef MS |
1 | /* |
2 | * "$Id$" | |
3 | * | |
f8b3a85b | 4 | * Private PPD definitions for CUPS. |
a603edef | 5 | * |
f8b3a85b | 6 | * Copyright 2007-2010 by Apple Inc. |
a603edef MS |
7 | * Copyright 1997-2007 by Easy Software Products, all rights reserved. |
8 | * | |
9 | * These coded instructions, statements, and computer programs are the | |
10 | * property of Apple Inc. and are protected by Federal copyright | |
11 | * law. Distribution and use rights are outlined in the file "LICENSE.txt" | |
12 | * which should have been included with this file. If this file is | |
13 | * file is missing or damaged, see the license at "http://www.cups.org/". | |
14 | * | |
15 | * PostScript is a trademark of Adobe Systems, Inc. | |
16 | * | |
17 | * This code and any derivative of it may be used and distributed | |
18 | * freely under the terms of the GNU General Public License when | |
19 | * used with GNU Ghostscript or its derivatives. Use of the code | |
20 | * (or any derivative of it) with software other than GNU | |
21 | * GhostScript (or its derivatives) is governed by the CUPS license | |
22 | * agreement. | |
23 | * | |
24 | * This file is subject to the Apple OS-Developed Software exception. | |
25 | */ | |
26 | ||
27 | #ifndef _CUPS_PPD_PRIVATE_H_ | |
28 | # define _CUPS_PPD_PRIVATE_H_ | |
29 | ||
30 | /* | |
31 | * Include necessary headers... | |
32 | */ | |
33 | ||
c7017ecc | 34 | # include <cups/cups.h> |
aaf19ab0 MS |
35 | # include <cups/ppd.h> |
36 | # include "pwg-private.h" | |
a603edef MS |
37 | |
38 | ||
39 | /* | |
40 | * C++ magic... | |
41 | */ | |
42 | ||
43 | # ifdef __cplusplus | |
44 | extern "C" { | |
45 | # endif /* __cplusplus */ | |
46 | ||
47 | ||
66ab9486 | 48 | /* |
c7017ecc | 49 | * Types and structures... |
66ab9486 MS |
50 | */ |
51 | ||
c7017ecc MS |
52 | typedef enum _ppd_parse_e /**** Selector for _ppdParseOptions ****/ |
53 | { | |
54 | _PPD_PARSE_OPTIONS, /* Parse only the options */ | |
55 | _PPD_PARSE_PROPERTIES, /* Parse only the properties */ | |
56 | _PPD_PARSE_ALL /* Parse everything */ | |
57 | } _ppd_parse_t; | |
58 | ||
66ab9486 MS |
59 | typedef struct _ppd_cups_uiconst_s /**** Constraint from cupsUIConstraints ****/ |
60 | { | |
61 | ppd_option_t *option; /* Constrained option */ | |
62 | ppd_choice_t *choice; /* Constrained choice or @code NULL@ */ | |
63 | int installable; /* Installable option? */ | |
64 | } _ppd_cups_uiconst_t; | |
65 | ||
66 | typedef struct _ppd_cups_uiconsts_s /**** cupsUIConstraints ****/ | |
67 | { | |
68 | char resolver[PPD_MAX_NAME]; /* Resolver name */ | |
69 | int installable, /* Constrained against any installable options? */ | |
70 | num_constraints; /* Number of constraints */ | |
71 | _ppd_cups_uiconst_t *constraints; /* Constraints */ | |
72 | } _ppd_cups_uiconsts_t; | |
73 | ||
c7017ecc MS |
74 | typedef enum _pwg_output_mode_e /**** PWG output-mode indices ****/ |
75 | { | |
76 | _PWG_OUTPUT_MODE_MONOCHROME = 0, /* output-mode=monochrome */ | |
77 | _PWG_OUTPUT_MODE_COLOR, /* output-mode=color */ | |
78 | _PWG_OUTPUT_MODE_MAX | |
79 | } _pwg_output_mode_t; | |
80 | ||
81 | typedef enum _pwg_print_quality_e /**** PWG print-quality indices ****/ | |
82 | { | |
83 | _PWG_PRINT_QUALITY_DRAFT = 0, /* print-quality=3 */ | |
84 | _PWG_PRINT_QUALITY_NORMAL, /* print-quality=4 */ | |
85 | _PWG_PRINT_QUALITY_HIGH, /* print-quality=5 */ | |
86 | _PWG_PRINT_QUALITY_MAX | |
87 | } _pwg_print_quality_t; | |
88 | ||
89 | typedef struct _pwg_s /**** PWG-PPD conversion data ****/ | |
90 | { | |
91 | int num_bins; /* Number of output bins */ | |
92 | _pwg_map_t *bins; /* Output bins */ | |
93 | int num_sizes; /* Number of media sizes */ | |
94 | _pwg_size_t *sizes; /* Media sizes */ | |
95 | int custom_max_width, /* Maximum custom width in 2540ths */ | |
96 | custom_max_length, /* Maximum custom length in 2540ths */ | |
97 | custom_min_width, /* Minimum custom width in 2540ths */ | |
98 | custom_min_length; /* Minimum custom length in 2540ths */ | |
99 | char *custom_max_keyword, /* Maximum custom size PWG keyword */ | |
100 | *custom_min_keyword, /* Minimum custom size PWG keyword */ | |
101 | custom_ppd_size[41]; /* Custom PPD size name */ | |
102 | _pwg_size_t custom_size; /* Custom size record */ | |
4220952d | 103 | char *source_option; /* PPD option for media source */ |
c7017ecc MS |
104 | int num_sources; /* Number of media sources */ |
105 | _pwg_map_t *sources; /* Media sources */ | |
106 | int num_types; /* Number of media types */ | |
107 | _pwg_map_t *types; /* Media types */ | |
108 | int num_presets[_PWG_OUTPUT_MODE_MAX][_PWG_PRINT_QUALITY_MAX]; | |
109 | /* Number of output-mode/print-quality options */ | |
110 | cups_option_t *presets[_PWG_OUTPUT_MODE_MAX][_PWG_PRINT_QUALITY_MAX]; | |
111 | /* output-mode/print-quality options */ | |
112 | char *sides_option, /* PPD option for sides */ | |
113 | *sides_1sided, /* Choice for one-sided */ | |
114 | *sides_2sided_long, /* Choice for two-sided-long-edge */ | |
115 | *sides_2sided_short; /* Choice for two-sided-short-edge */ | |
116 | } _pwg_t; | |
117 | ||
66ab9486 MS |
118 | |
119 | /* | |
120 | * Prototypes... | |
121 | */ | |
122 | ||
a603edef | 123 | extern void _ppdFreeLanguages(cups_array_t *languages); |
5eb9da71 | 124 | extern cups_encoding_t _ppdGetEncoding(const char *name); |
a603edef MS |
125 | extern cups_array_t *_ppdGetLanguages(ppd_file_t *ppd); |
126 | extern unsigned _ppdHashName(const char *name); | |
127 | extern ppd_attr_t *_ppdLocalizedAttr(ppd_file_t *ppd, const char *keyword, | |
128 | const char *spec, const char *ll_CC); | |
5eb9da71 MS |
129 | extern char *_ppdNormalizeMakeAndModel(const char *make_and_model, |
130 | char *buffer, | |
131 | size_t bufsize); | |
66ab9486 | 132 | extern int _ppdParseOptions(const char *s, int num_options, |
c7017ecc MS |
133 | cups_option_t **options, |
134 | _ppd_parse_t which); | |
135 | extern _pwg_t *_pwgCreateWithFile(const char *filename); | |
aaf19ab0 | 136 | extern _pwg_t *_pwgCreateWithPPD(ppd_file_t *ppd); |
c7017ecc | 137 | extern void _pwgDestroy(_pwg_t *pwg); |
cc754834 | 138 | extern const char *_pwgGetBin(_pwg_t *pwg, const char *output_bin); |
aaf19ab0 MS |
139 | extern const char *_pwgGetInputSlot(_pwg_t *pwg, ipp_t *job, |
140 | const char *keyword); | |
141 | extern const char *_pwgGetMediaType(_pwg_t *pwg, ipp_t *job, | |
142 | const char *keyword); | |
cc754834 | 143 | extern const char *_pwgGetOutputBin(_pwg_t *pwg, const char *keyword); |
aaf19ab0 MS |
144 | extern const char *_pwgGetPageSize(_pwg_t *pwg, ipp_t *job, |
145 | const char *keyword, int *exact); | |
146 | extern _pwg_size_t *_pwgGetSize(_pwg_t *pwg, const char *page_size); | |
147 | extern const char *_pwgGetSource(_pwg_t *pwg, const char *input_slot); | |
148 | extern const char *_pwgGetType(_pwg_t *pwg, const char *media_type); | |
149 | extern const char *_pwgInputSlotForSource(const char *media_source, | |
150 | char *name, size_t namesize); | |
cc754834 | 151 | extern const char *_pwgMediaTypeForType(const char *media_type, |
aaf19ab0 MS |
152 | char *name, size_t namesize); |
153 | extern const char *_pwgPageSizeForMedia(_pwg_media_t *media, | |
154 | char *name, size_t namesize); | |
c7017ecc | 155 | extern int _pwgWriteFile(_pwg_t *pwg, const char *filename); |
a603edef MS |
156 | |
157 | ||
158 | /* | |
159 | * C++ magic... | |
160 | */ | |
161 | ||
162 | # ifdef __cplusplus | |
163 | } | |
164 | # endif /* __cplusplus */ | |
165 | #endif /* !_CUPS_PPD_PRIVATE_H_ */ | |
166 | ||
167 | /* | |
168 | * End of "$Id$". | |
169 | */ |