]>
git.ipfire.org Git - thirdparty/cups.git/blob - cups/pwg.h
4 * PWG media API definitions for CUPS.
6 * Copyright 2009-2013 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.
27 # endif /* __cplusplus */
34 /* Convert from points to hundredths of millimeters */
35 # define PWG_FROM_POINTS(n) (int)(((n) * 2540 + 36) / 72)
36 /* Convert from hundredths of millimeters to points */
37 # define PWG_TO_POINTS(n) ((n) * 72.0 / 2540.0)
41 * Types and structures...
44 typedef struct pwg_map_s
/**** Map element - PPD to/from PWG */
46 char *pwg
, /* PWG media keyword */
47 *ppd
; /* PPD option keyword */
50 typedef struct pwg_media_s
/**** Common media size data ****/
52 const char *pwg
, /* PWG 5101.1 "self describing" name */
53 *legacy
, /* IPP/ISO legacy name */
54 *ppd
; /* Standard Adobe PPD name */
55 int width
, /* Width in 2540ths */
56 length
; /* Length in 2540ths */
59 typedef struct pwg_size_s
/**** Size element - PPD to/from PWG */
61 pwg_map_t map
; /* Map element */
62 int width
, /* Width in 2540ths */
63 length
, /* Length in 2540ths */
64 left
, /* Left margin in 2540ths */
65 bottom
, /* Bottom margin in 2540ths */
66 right
, /* Right margin in 2540ths */
67 top
; /* Top margin in 2540ths */
75 extern int pwgFormatSizeName(char *keyword
, size_t keysize
,
76 const char *prefix
, const char *name
,
77 int width
, int length
,
78 const char *units
) _CUPS_API_1_7
;
79 extern int pwgInitSize(pwg_size_t
*size
, ipp_t
*job
,
80 int *margins_set
) _CUPS_API_1_7
;
81 extern pwg_media_t
*pwgMediaForLegacy(const char *legacy
) _CUPS_API_1_7
;
82 extern pwg_media_t
*pwgMediaForPPD(const char *ppd
) _CUPS_API_1_7
;
83 extern pwg_media_t
*pwgMediaForPWG(const char *pwg
) _CUPS_API_1_7
;
84 extern pwg_media_t
*pwgMediaForSize(int width
, int length
) _CUPS_API_1_7
;
88 # endif /* __cplusplus */
90 #endif /* !_CUPS_PWG_H_ */