2 * "$Id: pwg-private.h 10245 2012-02-11 02:24:44Z mike $"
4 * Private PWG media API definitions for CUPS.
6 * Copyright 2009-2010 by Apple Inc.
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/".
14 * This file is subject to the Apple OS-Developed Software exception.
17 #ifndef _CUPS_PWG_PRIVATE_H_
18 # define _CUPS_PWG_PRIVATE_H_
22 * Include necessary headers...
25 # include <cups/cups.h>
34 # endif /* __cplusplus */
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)
48 * Types and structures...
51 typedef struct _pwg_map_s /**** Map element - PPD to/from PWG */
53 char *pwg, /* PWG media keyword */
54 *ppd; /* PPD option keyword */
57 typedef struct _pwg_media_s /**** Common media size data ****/
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 */
66 typedef struct _pwg_size_s /**** Size element - PPD to/from PWG */
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 */
82 extern void _pwgGenerateSize(char *keyword, size_t keysize,
85 int width, int length);
86 extern int _pwgInitSize(_pwg_size_t *size, ipp_t *job,
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);
96 # endif /* __cplusplus */
98 #endif /* !_CUPS_PWG_PRIVATE_H_ */
101 * End of "$Id: pwg-private.h 10245 2012-02-11 02:24:44Z mike $".