48
48
* Types and structures...
51
typedef enum _pwg_output_mode_e /**** PWG output-mode indices ****/
53
_PWG_OUTPUT_MODE_MONOCHROME = 0, /* output-mode=monochrome */
54
_PWG_OUTPUT_MODE_COLOR, /* output-mode=color */
58
typedef enum _pwg_print_quality_e /**** PWG print-quality indices ****/
60
_PWG_PRINT_QUALITY_DRAFT = 0, /* print-quality=3 */
61
_PWG_PRINT_QUALITY_NORMAL, /* print-quality=4 */
62
_PWG_PRINT_QUALITY_HIGH, /* print-quality=5 */
63
_PWG_PRINT_QUALITY_MAX
64
} _pwg_print_quality_t;
51
typedef struct _pwg_map_s /**** Map element - PPD to/from PWG */
53
char *pwg, /* PWG media keyword */
54
*ppd; /* PPD option keyword */
66
57
typedef struct _pwg_media_s /**** Common media size data ****/
89
74
top; /* Top margin in 2540ths */
92
typedef struct _pwg_s /**** PWG-PPD conversion data ****/
94
int num_bins; /* Number of output bins */
95
_pwg_map_t *bins; /* Output bins */
96
int num_sizes; /* Number of media sizes */
97
_pwg_size_t *sizes; /* Media sizes */
98
int custom_max_width, /* Maximum custom width in 2540ths */
99
custom_max_length, /* Maximum custom length in 2540ths */
100
custom_min_width, /* Minimum custom width in 2540ths */
101
custom_min_length; /* Minimum custom length in 2540ths */
102
char *custom_max_keyword, /* Maximum custom size PWG keyword */
103
*custom_min_keyword, /* Minimum custom size PWG keyword */
104
custom_ppd_size[41]; /* Custom PPD size name */
105
_pwg_size_t custom_size; /* Custom size record */
106
char *source_option; /* PPD option for media source */
107
int num_sources; /* Number of media sources */
108
_pwg_map_t *sources; /* Media sources */
109
int num_types; /* Number of media types */
110
_pwg_map_t *types; /* Media types */
111
int num_presets[_PWG_OUTPUT_MODE_MAX][_PWG_PRINT_QUALITY_MAX];
112
/* Number of output-mode/print-quality options */
113
cups_option_t *presets[_PWG_OUTPUT_MODE_MAX][_PWG_PRINT_QUALITY_MAX];
114
/* output-mode/print-quality options */
115
char *sides_option, /* PPD option for sides */
116
*sides_1sided, /* Choice for one-sided */
117
*sides_2sided_long, /* Choice for two-sided-long-edge */
118
*sides_2sided_short; /* Choice for two-sided-short-edge */
126
extern _pwg_t *_pwgCreateWithFile(const char *filename);
127
extern _pwg_t *_pwgCreateWithPPD(ppd_file_t *ppd);
128
extern void _pwgDestroy(_pwg_t *pwg);
129
82
extern void _pwgGenerateSize(char *keyword, size_t keysize,
130
83
const char *prefix,
132
85
int width, int length);
133
extern const char *_pwgGetBin(_pwg_t *pwg, const char *output_bin);
134
extern const char *_pwgGetInputSlot(_pwg_t *pwg, ipp_t *job,
135
const char *keyword);
136
extern const char *_pwgGetMediaType(_pwg_t *pwg, ipp_t *job,
137
const char *keyword);
138
extern const char *_pwgGetOutputBin(_pwg_t *pwg, const char *keyword);
139
extern const char *_pwgGetPageSize(_pwg_t *pwg, ipp_t *job,
140
const char *keyword, int *exact);
141
extern _pwg_size_t *_pwgGetSize(_pwg_t *pwg, const char *page_size);
142
extern const char *_pwgGetSource(_pwg_t *pwg, const char *input_slot);
143
extern const char *_pwgGetType(_pwg_t *pwg, const char *media_type);
144
86
extern int _pwgInitSize(_pwg_size_t *size, ipp_t *job,
145
87
int *margins_set);
146
extern const char *_pwgInputSlotForSource(const char *media_source,
147
char *name, size_t namesize);
148
88
extern _pwg_media_t *_pwgMediaForLegacy(const char *legacy);
149
89
extern _pwg_media_t *_pwgMediaForPPD(const char *ppd);
150
90
extern _pwg_media_t *_pwgMediaForPWG(const char *pwg);
151
91
extern _pwg_media_t *_pwgMediaForSize(int width, int length);
152
extern const char *_pwgMediaTypeForType(const char *media_source,
153
char *name, size_t namesize);
154
extern const char *_pwgPageSizeForMedia(_pwg_media_t *media,
155
char *name, size_t namesize);
156
extern int _pwgWriteFile(_pwg_t *pwg, const char *filename);
159
94
# ifdef __cplusplus