Revert manifest to default one
[external/cups.git] / cups / pwg-private.h
1 /*
2  * "$Id: pwg-private.h 10245 2012-02-11 02:24:44Z mike $"
3  *
4  *   Private PWG media API definitions for CUPS.
5  *
6  *   Copyright 2009-2010 by Apple Inc.
7  *
8  *   These coded instructions, statements, and computer programs are the
9  *   property of Apple Inc. and are protected by Federal copyright
10  *   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
11  *   which should have been included with this file.  If this file is
12  *   file is missing or damaged, see the license at "http://www.cups.org/".
13  *
14  *   This file is subject to the Apple OS-Developed Software exception.
15  */
16
17 #ifndef _CUPS_PWG_PRIVATE_H_
18 #  define _CUPS_PWG_PRIVATE_H_
19
20
21 /*
22  * Include necessary headers...
23  */
24
25 #  include <cups/cups.h>
26
27
28 /*
29  * C++ magic...
30  */
31
32 #  ifdef __cplusplus
33 extern "C" {
34 #  endif /* __cplusplus */
35
36
37 /*
38  * Macros...
39  */
40
41 /* Convert from points to 2540ths */
42 #  define _PWG_FROMPTS(n)       (int)(((n) * 2540 + 36) / 72)
43 /* Convert from 2540ths to points */
44 #  define _PWG_TOPTS(n)         ((n) * 72.0 / 2540.0)
45
46
47 /*
48  * Types and structures...
49  */
50
51 typedef struct _pwg_map_s               /**** Map element - PPD to/from PWG */
52 {
53   char          *pwg,                   /* PWG media keyword */
54                 *ppd;                   /* PPD option keyword */
55 } _pwg_map_t;
56
57 typedef struct _pwg_media_s             /**** Common media size data ****/
58 {
59   const char    *pwg,                   /* PWG 5101.1 "self describing" name */
60                 *legacy,                /* IPP/ISO legacy name */
61                 *ppd;                   /* Standard Adobe PPD name */
62   int           width,                  /* Width in 2540ths */
63                 length;                 /* Length in 2540ths */
64 } _pwg_media_t;
65
66 typedef struct _pwg_size_s              /**** Size element - PPD to/from PWG */
67 {
68   _pwg_map_t    map;                    /* Map element */
69   int           width,                  /* Width in 2540ths */
70                 length,                 /* Length in 2540ths */
71                 left,                   /* Left margin in 2540ths */
72                 bottom,                 /* Bottom margin in 2540ths */
73                 right,                  /* Right margin in 2540ths */
74                 top;                    /* Top margin in 2540ths */
75 } _pwg_size_t;
76
77
78 /*
79  * Functions...
80  */
81
82 extern void             _pwgGenerateSize(char *keyword, size_t keysize,
83                                          const char *prefix,
84                                          const char *name,
85                                          int width, int length);
86 extern int              _pwgInitSize(_pwg_size_t *size, ipp_t *job,
87                                      int *margins_set);
88 extern _pwg_media_t     *_pwgMediaForLegacy(const char *legacy);
89 extern _pwg_media_t     *_pwgMediaForPPD(const char *ppd);
90 extern _pwg_media_t     *_pwgMediaForPWG(const char *pwg);
91 extern _pwg_media_t     *_pwgMediaForSize(int width, int length);
92
93
94 #  ifdef __cplusplus
95 }
96 #  endif /* __cplusplus */
97
98 #endif /* !_CUPS_PWG_PRIVATE_H_ */
99
100 /*
101  * End of "$Id: pwg-private.h 10245 2012-02-11 02:24:44Z mike $".
102  */