]>
git.ipfire.org Git - thirdparty/cups.git/blob - cups/pwg.h
2 * PWG media API definitions for CUPS.
4 * Copyright 2009-2017 by Apple Inc.
6 * Licensed under Apache License v2.0. See the file "LICENSE" for more information.
19 # endif /* __cplusplus */
26 /* Convert from points to hundredths of millimeters */
27 # define PWG_FROM_POINTS(n) (int)(((n) * 2540 + 36) / 72)
28 /* Convert from hundredths of millimeters to points */
29 # define PWG_TO_POINTS(n) ((n) * 72.0 / 2540.0)
33 * Types and structures...
36 typedef struct pwg_map_s
/**** Map element - PPD to/from PWG @exclude all@ */
38 char *pwg
, /* PWG media keyword */
39 *ppd
; /* PPD option keyword */
42 typedef struct pwg_media_s
/**** Common media size data ****/
44 const char *pwg
, /* PWG 5101.1 "self describing" name */
45 *legacy
, /* IPP/ISO legacy name */
46 *ppd
; /* Standard Adobe PPD name */
47 int width
, /* Width in 2540ths */
48 length
; /* Length in 2540ths */
51 typedef struct pwg_size_s
/**** Size element - PPD to/from PWG @exclude all@ */
53 pwg_map_t map
; /* Map element */
54 int width
, /* Width in 2540ths */
55 length
, /* Length in 2540ths */
56 left
, /* Left margin in 2540ths */
57 bottom
, /* Bottom margin in 2540ths */
58 right
, /* Right margin in 2540ths */
59 top
; /* Top margin in 2540ths */
67 extern int pwgFormatSizeName(char *keyword
, size_t keysize
,
68 const char *prefix
, const char *name
,
69 int width
, int length
,
70 const char *units
) _CUPS_API_1_7
;
71 extern int pwgInitSize(pwg_size_t
*size
, ipp_t
*job
,
72 int *margins_set
) _CUPS_API_1_7
;
73 extern pwg_media_t
*pwgMediaForLegacy(const char *legacy
) _CUPS_API_1_7
;
74 extern pwg_media_t
*pwgMediaForPPD(const char *ppd
) _CUPS_API_1_7
;
75 extern pwg_media_t
*pwgMediaForPWG(const char *pwg
) _CUPS_API_1_7
;
76 extern pwg_media_t
*pwgMediaForSize(int width
, int length
) _CUPS_API_1_7
;
80 # endif /* __cplusplus */
82 #endif /* !_CUPS_PWG_H_ */