]>
git.ipfire.org Git - thirdparty/cups.git/blob - cups/pwg.h
f663246cad5320926ebf01ecdb604093010464c0
2 * PWG media API definitions for CUPS.
4 * Copyright 2009-2013 by Apple Inc.
6 * These coded instructions, statements, and computer programs are the
7 * property of Apple Inc. and are protected by Federal copyright
8 * law. Distribution and use rights are outlined in the file "LICENSE.txt"
9 * which should have been included with this file. If this file is
10 * file is missing or damaged, see the license at "http://www.cups.org/".
12 * This file is subject to the Apple OS-Developed Software exception.
25 # endif /* __cplusplus */
32 /* Convert from points to hundredths of millimeters */
33 # define PWG_FROM_POINTS(n) (int)(((n) * 2540 + 36) / 72)
34 /* Convert from hundredths of millimeters to points */
35 # define PWG_TO_POINTS(n) ((n) * 72.0 / 2540.0)
39 * Types and structures...
42 typedef struct pwg_map_s
/**** Map element - PPD to/from PWG */
44 char *pwg
, /* PWG media keyword */
45 *ppd
; /* PPD option keyword */
48 typedef struct pwg_media_s
/**** Common media size data ****/
50 const char *pwg
, /* PWG 5101.1 "self describing" name */
51 *legacy
, /* IPP/ISO legacy name */
52 *ppd
; /* Standard Adobe PPD name */
53 int width
, /* Width in 2540ths */
54 length
; /* Length in 2540ths */
57 typedef struct pwg_size_s
/**** Size element - PPD to/from PWG */
59 pwg_map_t map
; /* Map element */
60 int width
, /* Width in 2540ths */
61 length
, /* Length in 2540ths */
62 left
, /* Left margin in 2540ths */
63 bottom
, /* Bottom margin in 2540ths */
64 right
, /* Right margin in 2540ths */
65 top
; /* Top margin in 2540ths */
73 extern int pwgFormatSizeName(char *keyword
, size_t keysize
,
74 const char *prefix
, const char *name
,
75 int width
, int length
,
76 const char *units
) _CUPS_API_1_7
;
77 extern int pwgInitSize(pwg_size_t
*size
, ipp_t
*job
,
78 int *margins_set
) _CUPS_API_1_7
;
79 extern pwg_media_t
*pwgMediaForLegacy(const char *legacy
) _CUPS_API_1_7
;
80 extern pwg_media_t
*pwgMediaForPPD(const char *ppd
) _CUPS_API_1_7
;
81 extern pwg_media_t
*pwgMediaForPWG(const char *pwg
) _CUPS_API_1_7
;
82 extern pwg_media_t
*pwgMediaForSize(int width
, int length
) _CUPS_API_1_7
;
86 # endif /* __cplusplus */
88 #endif /* !_CUPS_PWG_H_ */