]> git.ipfire.org Git - thirdparty/cups.git/blame - cups/ppd-private.h
Bring back PWG white paper support for 3D print queues (just tagging of queues and...
[thirdparty/cups.git] / cups / ppd-private.h
CommitLineData
a603edef
MS
1/*
2 * "$Id$"
3 *
7e86f2f6 4 * Private PPD definitions for CUPS.
a603edef 5 *
f099325e 6 * Copyright 2007-2015 by Apple Inc.
7e86f2f6 7 * Copyright 1997-2007 by Easy Software Products, all rights reserved.
a603edef 8 *
7e86f2f6
MS
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/".
a603edef 14 *
7e86f2f6 15 * PostScript is a trademark of Adobe Systems, Inc.
a603edef 16 *
7e86f2f6
MS
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.
a603edef 23 *
7e86f2f6 24 * This file is subject to the Apple OS-Developed Software exception.
a603edef
MS
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
44extern "C" {
45# endif /* __cplusplus */
46
47
f14324a7
MS
48/*
49 * Constants...
50 */
51
9b4bd602 52# define _PPD_CACHE_VERSION 7 /* Version number in cache file */
f14324a7
MS
53
54
66ab9486 55/*
c7017ecc 56 * Types and structures...
66ab9486
MS
57 */
58
9c80ffa2
MS
59typedef enum _ppd_localization_e /**** Selector for _ppdOpen ****/
60{
61 _PPD_LOCALIZATION_DEFAULT, /* Load only the default localization */
62 _PPD_LOCALIZATION_ICC_PROFILES, /* Load only the color profile localization */
63 _PPD_LOCALIZATION_NONE, /* Load no localizations */
64 _PPD_LOCALIZATION_ALL /* Load all localizations */
65} _ppd_localization_t;
66
c7017ecc
MS
67typedef enum _ppd_parse_e /**** Selector for _ppdParseOptions ****/
68{
69 _PPD_PARSE_OPTIONS, /* Parse only the options */
70 _PPD_PARSE_PROPERTIES, /* Parse only the properties */
71 _PPD_PARSE_ALL /* Parse everything */
72} _ppd_parse_t;
73
66ab9486
MS
74typedef struct _ppd_cups_uiconst_s /**** Constraint from cupsUIConstraints ****/
75{
76 ppd_option_t *option; /* Constrained option */
77 ppd_choice_t *choice; /* Constrained choice or @code NULL@ */
78 int installable; /* Installable option? */
79} _ppd_cups_uiconst_t;
80
81typedef struct _ppd_cups_uiconsts_s /**** cupsUIConstraints ****/
82{
83 char resolver[PPD_MAX_NAME]; /* Resolver name */
84 int installable, /* Constrained against any installable options? */
85 num_constraints; /* Number of constraints */
86 _ppd_cups_uiconst_t *constraints; /* Constraints */
87} _ppd_cups_uiconsts_t;
88
f14324a7 89typedef enum _pwg_print_color_mode_e /**** PWG print-color-mode indices ****/
c7017ecc 90{
f14324a7
MS
91 _PWG_PRINT_COLOR_MODE_MONOCHROME = 0, /* print-color-mode=monochrome */
92 _PWG_PRINT_COLOR_MODE_COLOR, /* print-color-mode=color */
93 /* Other proposed values are not supported by CUPS yet. */
94 _PWG_PRINT_COLOR_MODE_MAX
95} _pwg_print_color_mode_t;
c7017ecc 96
dcb445bc 97typedef enum _pwg_print_quality_e /**** PWG print-quality values ****/
c7017ecc
MS
98{
99 _PWG_PRINT_QUALITY_DRAFT = 0, /* print-quality=3 */
100 _PWG_PRINT_QUALITY_NORMAL, /* print-quality=4 */
101 _PWG_PRINT_QUALITY_HIGH, /* print-quality=5 */
102 _PWG_PRINT_QUALITY_MAX
103} _pwg_print_quality_t;
104
dcb445bc
MS
105typedef struct _pwg_finishings_s /**** PWG finishings mapping data ****/
106{
cb7f98ee
MS
107 ipp_finishings_t value; /* finishings value */
108 int num_options; /* Number of options to apply */
109 cups_option_t *options; /* Options to apply */
dcb445bc
MS
110} _pwg_finishings_t;
111
5a08320a
MS
112typedef struct _pwg_material_s /**** PWG material mapping data ****/
113{
114 char *key, /* material-key value */
115 *name; /* material-name value */
116 int num_props; /* Number of properties */
117 cups_option_t *props; /* Material properties */
118} _pwg_material_t;
119
f14324a7 120struct _ppd_cache_s /**** PPD cache and PWG conversion data ****/
c7017ecc
MS
121{
122 int num_bins; /* Number of output bins */
6961465f 123 pwg_map_t *bins; /* Output bins */
c7017ecc 124 int num_sizes; /* Number of media sizes */
6961465f 125 pwg_size_t *sizes; /* Media sizes */
c7017ecc
MS
126 int custom_max_width, /* Maximum custom width in 2540ths */
127 custom_max_length, /* Maximum custom length in 2540ths */
128 custom_min_width, /* Minimum custom width in 2540ths */
129 custom_min_length; /* Minimum custom length in 2540ths */
130 char *custom_max_keyword, /* Maximum custom size PWG keyword */
131 *custom_min_keyword, /* Minimum custom size PWG keyword */
132 custom_ppd_size[41]; /* Custom PPD size name */
6961465f 133 pwg_size_t custom_size; /* Custom size record */
4220952d 134 char *source_option; /* PPD option for media source */
c7017ecc 135 int num_sources; /* Number of media sources */
6961465f 136 pwg_map_t *sources; /* Media sources */
c7017ecc 137 int num_types; /* Number of media types */
6961465f 138 pwg_map_t *types; /* Media types */
f14324a7
MS
139 int num_presets[_PWG_PRINT_COLOR_MODE_MAX][_PWG_PRINT_QUALITY_MAX];
140 /* Number of print-color-mode/print-quality options */
141 cups_option_t *presets[_PWG_PRINT_COLOR_MODE_MAX][_PWG_PRINT_QUALITY_MAX];
142 /* print-color-mode/print-quality options */
c7017ecc
MS
143 char *sides_option, /* PPD option for sides */
144 *sides_1sided, /* Choice for one-sided */
145 *sides_2sided_long, /* Choice for two-sided-long-edge */
146 *sides_2sided_short; /* Choice for two-sided-short-edge */
f14324a7
MS
147 char *product; /* Product value */
148 cups_array_t *filters, /* cupsFilter/cupsFilter2 values */
149 *prefilters; /* cupsPreFilter values */
82f97232 150 int single_file; /* cupsSingleFile value */
dcb445bc 151 cups_array_t *finishings; /* cupsIPPFinishings values */
5a9febac
MS
152 int max_copies, /* cupsMaxCopies value */
153 account_id, /* cupsJobAccountId value */
154 accounting_user_id; /* cupsJobAccountingUserId value */
155 char *password; /* cupsJobPassword value */
156 cups_array_t *mandatory; /* cupsMandatory value */
a469f8a5 157 char *charge_info_uri; /* cupsChargeInfoURI value */
c1420c87 158 cups_array_t *support_files; /* Support files - ICC profiles, etc. */
5a08320a
MS
159 char *cups_3d, /* cups3D value */
160 *cups_layer_order; /* cupsLayerOrder value */
161 int cups_accuracy[3]; /* cupsAccuracy value - x, y, and z in nanometers */
162 int cups_volume[3]; /* cupsVolume value - x, y, and z in millimeters */
163 cups_array_t *materials; /* cupsMaterial values */
f14324a7 164};
c7017ecc 165
66ab9486
MS
166
167/*
168 * Prototypes...
169 */
170
f099325e 171extern int _cupsConvertOptions(ipp_t *request, ppd_file_t *ppd, _ppd_cache_t *pc, ipp_attribute_t *media_col_sup, ipp_attribute_t *doc_handling_sup, ipp_attribute_t *print_color_mode_sup, const char *user, const char *format, int copies, int num_options, cups_option_t *options);
f14324a7
MS
172extern _ppd_cache_t *_ppdCacheCreateWithFile(const char *filename,
173 ipp_t **attrs);
174extern _ppd_cache_t *_ppdCacheCreateWithPPD(ppd_file_t *ppd);
175extern void _ppdCacheDestroy(_ppd_cache_t *pc);
176extern const char *_ppdCacheGetBin(_ppd_cache_t *pc,
177 const char *output_bin);
cb7f98ee
MS
178extern int _ppdCacheGetFinishingOptions(_ppd_cache_t *pc,
179 ipp_t *job,
180 ipp_finishings_t value,
181 int num_options,
dcb445bc 182 cups_option_t **options);
cb7f98ee
MS
183extern int _ppdCacheGetFinishingValues(_ppd_cache_t *pc,
184 int num_options,
dcb445bc 185 cups_option_t *options,
cb7f98ee
MS
186 int max_values,
187 int *values);
f14324a7
MS
188extern const char *_ppdCacheGetInputSlot(_ppd_cache_t *pc, ipp_t *job,
189 const char *keyword);
190extern const char *_ppdCacheGetMediaType(_ppd_cache_t *pc, ipp_t *job,
191 const char *keyword);
192extern const char *_ppdCacheGetOutputBin(_ppd_cache_t *pc,
193 const char *keyword);
194extern const char *_ppdCacheGetPageSize(_ppd_cache_t *pc, ipp_t *job,
195 const char *keyword, int *exact);
6961465f 196extern pwg_size_t *_ppdCacheGetSize(_ppd_cache_t *pc,
f14324a7
MS
197 const char *page_size);
198extern const char *_ppdCacheGetSource(_ppd_cache_t *pc,
199 const char *input_slot);
200extern const char *_ppdCacheGetType(_ppd_cache_t *pc,
201 const char *media_type);
202extern int _ppdCacheWriteFile(_ppd_cache_t *pc,
203 const char *filename, ipp_t *attrs);
d9fc71e4 204extern char *_ppdCreateFromIPP(char *buffer, size_t bufsize, ipp_t *response);
a603edef 205extern void _ppdFreeLanguages(cups_array_t *languages);
5eb9da71 206extern cups_encoding_t _ppdGetEncoding(const char *name);
a603edef
MS
207extern cups_array_t *_ppdGetLanguages(ppd_file_t *ppd);
208extern unsigned _ppdHashName(const char *name);
209extern ppd_attr_t *_ppdLocalizedAttr(ppd_file_t *ppd, const char *keyword,
210 const char *spec, const char *ll_CC);
5eb9da71
MS
211extern char *_ppdNormalizeMakeAndModel(const char *make_and_model,
212 char *buffer,
213 size_t bufsize);
9c80ffa2
MS
214extern ppd_file_t *_ppdOpen(cups_file_t *fp,
215 _ppd_localization_t localization);
216extern ppd_file_t *_ppdOpenFile(const char *filename,
217 _ppd_localization_t localization);
66ab9486 218extern int _ppdParseOptions(const char *s, int num_options,
c7017ecc
MS
219 cups_option_t **options,
220 _ppd_parse_t which);
aaf19ab0
MS
221extern const char *_pwgInputSlotForSource(const char *media_source,
222 char *name, size_t namesize);
cc754834 223extern const char *_pwgMediaTypeForType(const char *media_type,
f14324a7 224 char *name, size_t namesize);
6961465f 225extern const char *_pwgPageSizeForMedia(pwg_media_t *media,
aaf19ab0 226 char *name, size_t namesize);
a603edef
MS
227
228
229/*
230 * C++ magic...
231 */
232
233# ifdef __cplusplus
234}
235# endif /* __cplusplus */
236#endif /* !_CUPS_PPD_PRIVATE_H_ */
237
238/*
239 * End of "$Id$".
240 */