#ifndef _CUPS_PPD_PRIVATE_H_
# define _CUPS_PPD_PRIVATE_H_
# include <cups/cups.h>
# include <cups/ppd.h>
# include "pwg-private.h"
# ifdef __cplusplus
extern "C" {
# endif
# define _PPD_CACHE_VERSION 6
typedef enum _ppd_localization_e
{
_PPD_LOCALIZATION_DEFAULT,
_PPD_LOCALIZATION_ICC_PROFILES,
_PPD_LOCALIZATION_NONE,
_PPD_LOCALIZATION_ALL
} _ppd_localization_t;
typedef enum _ppd_parse_e
{
_PPD_PARSE_OPTIONS,
_PPD_PARSE_PROPERTIES,
_PPD_PARSE_ALL
} _ppd_parse_t;
typedef struct _ppd_cups_uiconst_s
{
ppd_option_t *option;
ppd_choice_t *choice;
int installable;
} _ppd_cups_uiconst_t;
typedef struct _ppd_cups_uiconsts_s
{
char resolver[PPD_MAX_NAME];
int installable,
num_constraints;
_ppd_cups_uiconst_t *constraints;
} _ppd_cups_uiconsts_t;
typedef enum _pwg_print_color_mode_e
{
_PWG_PRINT_COLOR_MODE_MONOCHROME = 0,
_PWG_PRINT_COLOR_MODE_COLOR,
_PWG_PRINT_COLOR_MODE_MAX
} _pwg_print_color_mode_t;
typedef enum _pwg_print_quality_e
{
_PWG_PRINT_QUALITY_DRAFT = 0,
_PWG_PRINT_QUALITY_NORMAL,
_PWG_PRINT_QUALITY_HIGH,
_PWG_PRINT_QUALITY_MAX
} _pwg_print_quality_t;
typedef struct _pwg_finishings_s
{
ipp_finishings_t value;
int num_options;
cups_option_t *options;
} _pwg_finishings_t;
struct _ppd_cache_s
{
int num_bins;
pwg_map_t *bins;
int num_sizes;
pwg_size_t *sizes;
int custom_max_width,
custom_max_length,
custom_min_width,
custom_min_length;
char *custom_max_keyword,
*custom_min_keyword,
custom_ppd_size[41];
pwg_size_t custom_size;
char *source_option;
int num_sources;
pwg_map_t *sources;
int num_types;
pwg_map_t *types;
int num_presets[_PWG_PRINT_COLOR_MODE_MAX][_PWG_PRINT_QUALITY_MAX];
cups_option_t *presets[_PWG_PRINT_COLOR_MODE_MAX][_PWG_PRINT_QUALITY_MAX];
char *sides_option,
*sides_1sided,
*sides_2sided_long,
*sides_2sided_short;
char *product;
cups_array_t *filters,
*prefilters;
int single_file;
cups_array_t *finishings;
int max_copies,
account_id,
accounting_user_id;
char *password;
cups_array_t *mandatory;
char *charge_info_uri;
cups_array_t *support_files;
};
extern _ppd_cache_t *_ppdCacheCreateWithFile(const char *filename,
ipp_t **attrs);
extern _ppd_cache_t *_ppdCacheCreateWithPPD(ppd_file_t *ppd);
extern void _ppdCacheDestroy(_ppd_cache_t *pc);
extern const char *_ppdCacheGetBin(_ppd_cache_t *pc,
const char *output_bin);
extern int _ppdCacheGetFinishingOptions(_ppd_cache_t *pc,
ipp_t *job,
ipp_finishings_t value,
int num_options,
cups_option_t **options);
extern int _ppdCacheGetFinishingValues(_ppd_cache_t *pc,
int num_options,
cups_option_t *options,
int max_values,
int *values);
extern const char *_ppdCacheGetInputSlot(_ppd_cache_t *pc, ipp_t *job,
const char *keyword);
extern const char *_ppdCacheGetMediaType(_ppd_cache_t *pc, ipp_t *job,
const char *keyword);
extern const char *_ppdCacheGetOutputBin(_ppd_cache_t *pc,
const char *keyword);
extern const char *_ppdCacheGetPageSize(_ppd_cache_t *pc, ipp_t *job,
const char *keyword, int *exact);
extern pwg_size_t *_ppdCacheGetSize(_ppd_cache_t *pc,
const char *page_size);
extern const char *_ppdCacheGetSource(_ppd_cache_t *pc,
const char *input_slot);
extern const char *_ppdCacheGetType(_ppd_cache_t *pc,
const char *media_type);
extern int _ppdCacheWriteFile(_ppd_cache_t *pc,
const char *filename, ipp_t *attrs);
extern void _ppdFreeLanguages(cups_array_t *languages);
extern cups_encoding_t _ppdGetEncoding(const char *name);
extern cups_array_t *_ppdGetLanguages(ppd_file_t *ppd);
extern unsigned _ppdHashName(const char *name);
extern ppd_attr_t *_ppdLocalizedAttr(ppd_file_t *ppd, const char *keyword,
const char *spec, const char *ll_CC);
extern char *_ppdNormalizeMakeAndModel(const char *make_and_model,
char *buffer,
size_t bufsize);
extern ppd_file_t *_ppdOpen(cups_file_t *fp,
_ppd_localization_t localization);
extern ppd_file_t *_ppdOpenFile(const char *filename,
_ppd_localization_t localization);
extern int _ppdParseOptions(const char *s, int num_options,
cups_option_t **options,
_ppd_parse_t which);
extern const char *_pwgInputSlotForSource(const char *media_source,
char *name, size_t namesize);
extern const char *_pwgMediaTypeForType(const char *media_type,
char *name, size_t namesize);
extern const char *_pwgPageSizeForMedia(pwg_media_t *media,
char *name, size_t namesize);
# ifdef __cplusplus
}
# endif
#endif