1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
|
/*
* IPP Everywhere/Apple Raster/IPP legacy PPD generator header file
*
* Copyright 2016 by Till Kamppeter.
*
* The PPD generator is based on the PPD generator for the CUPS
* "lpadmin -m everywhere" functionality in the cups/ppd-cache.c
* file. The copyright of this file is:
*
* Copyright 2010-2016 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "COPYING"
* which should have been included with this file.
*/
#ifndef _CUPS_FILTERS_PPDGENERATOR_H_
# define _CUPS_FILTERS_PPDGENERATOR_H_
# ifdef __cplusplus
extern "C" {
# endif /* __cplusplus */
/*
* Include necessary headers...
*/
# include <stdio.h>
# include <stdlib.h>
# include <time.h>
# include <math.h>
# if defined(WIN32) || defined(__EMX__)
# include <io.h>
# else
# include <unistd.h>
# include <fcntl.h>
# endif /* WIN32 || __EMX__ */
# include <cups/cups.h>
# include <cups/raster.h>
#include <config.h>
#include <cups/cups.h>
#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5)
#define HAVE_CUPS_1_6 1
#endif
/*
* Prototypes...
*/
#ifdef HAVE_CUPS_1_6
extern char ppdgenerator_msg[1024];
/* Data structure for resolution (X x Y dpi) */
typedef struct res_s {
int x, y;
} res_t;
char *ppdCreateFromIPP(char *buffer, size_t bufsize,
ipp_t *response, const char *make_model,
const char *pdl, int color, int duplex);
char *ppdCreateFromIPP2(char *buffer, size_t bufsize,
ipp_t *response, const char *make_model,
const char *pdl, int color, int duplex,
cups_array_t* conflicts,
cups_array_t *sizes,char* default_pagesize,
const char *default_cluster_color);
int compare_resolutions(void *resolution_a, void *resolution_b,
void *user_data);
void free_resolution(void *resolution, void *user_data);
res_t * ippResolutionToRes(ipp_attribute_t *attr, int index);
res_t * resolutionNew(int x, int y);
cups_array_t * resolutionArrayNew();
cups_array_t* generate_sizes(ipp_t *response,
ipp_attribute_t **defattr,
int *min_length,
int* min_width,
int* max_length,
int* max_width,
int* bottom,
int* left,
int* right,
int* top,
char* ppdname);
#endif /* HAVE_CUPS_1_6 */
# ifdef __cplusplus
}
# endif /* __cplusplus */
#endif /* !_CUPS_FILTERS_PPDGENERATOR_H_ */
|