diff options
author | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2016-03-07 20:02:13 +0000 |
---|---|---|
committer | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2016-03-07 20:02:13 +0000 |
commit | d71488ecddea08aafd8cb9fc31e0dbb305a37a84 (patch) | |
tree | 8896c547cc5050dc055aefad9b43ae39290a173e /cups/pwg-media.c | |
parent | 8be431f216479a7f9d396b082941fa33fa71f813 (diff) | |
download | cups-d71488ecddea08aafd8cb9fc31e0dbb305a37a84.tar.gz |
Added support for disc media sizes (<rdar://problem/20219536>)
Also remove old 10.8 private APIs that are no longer needed.
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@13118 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'cups/pwg-media.c')
-rw-r--r-- | cups/pwg-media.c | 35 |
1 files changed, 10 insertions, 25 deletions
diff --git a/cups/pwg-media.c b/cups/pwg-media.c index 0c5396b08..09c8c2538 100644 --- a/cups/pwg-media.c +++ b/cups/pwg-media.c @@ -1,9 +1,7 @@ /* - * "$Id$" - * * PWG media name API implementation for CUPS. * - * Copyright 2009-2014 by Apple Inc. + * Copyright 2009-2016 by Apple Inc. * * These coded instructions, statements, and computer programs are the * property of Apple Inc. and are protected by Federal copyright @@ -235,7 +233,10 @@ static pwg_media_t const cups_pwg_media[] = _PWG_MEDIA_MM("om_folio_210x330mm", "folio", "Folio", 210, 330), _PWG_MEDIA_MM("om_folio-sp_215x315mm", NULL, "FolioSP", 215, 315), _PWG_MEDIA_MM("om_invite_220x220mm", NULL, "EnvInvite", 220, 220), - _PWG_MEDIA_MM("om_small-photo_100x200mm", NULL, "om_wide-photo", 100, 200) + _PWG_MEDIA_MM("om_small-photo_100x200mm", NULL, "om_wide-photo", 100, 200), + + /* Disc Sizes */ + _PWG_MEDIA_MM("disc_standard_40x118mm", NULL, NULL, 118, 118) }; @@ -316,6 +317,8 @@ pwgFormatSizeName(char *keyword, /* I - Keyword buffer */ else name = usize; + if (prefix && !strcmp(prefix, "disc")) + width = 4000; /* Disc sizes use hardcoded 40mm inner diameter */ if (!units) { @@ -616,10 +619,6 @@ pwgMediaForLegacy(const char *legacy) /* I - Legacy size name */ return ((pwg_media_t *)cupsArrayFind(cg->leg_size_lut, &key)); } -/* For OS X 10.8 and earlier */ -pwg_media_t *_pwgMediaForLegacy(const char *legacy) -{ return (pwgMediaForLegacy(legacy)); } - /* * 'pwgMediaForPPD()' - Find a PWG media size by Adobe PPD name. @@ -790,10 +789,6 @@ pwgMediaForPPD(const char *ppd) /* I - PPD size name */ return (size); } -/* For OS X 10.8 and earlier */ -pwg_media_t *_pwgMediaForPPD(const char *ppd) -{ return (pwgMediaForPPD(ppd)); } - /* * 'pwgMediaForPWG()' - Find a PWG media size by 5101.1 self-describing name. @@ -877,6 +872,9 @@ pwgMediaForPWG(const char *pwg) /* I - PWG size name */ if (ptr) { + if (!strncmp(pwg, "disc_", 5)) + w = l; /* Make the media size OUTERxOUTER */ + size = &(cg->pwg_media); size->width = w; size->length = l; @@ -890,10 +888,6 @@ pwgMediaForPWG(const char *pwg) /* I - PWG size name */ return (size); } -/* For OS X 10.8 and earlier */ -pwg_media_t *_pwgMediaForPWG(const char *pwg) -{ return (pwgMediaForPWG(pwg)); } - /* * 'pwgMediaForSize()' - Get the PWG media size for the given dimensions. @@ -991,10 +985,6 @@ _pwgMediaNearSize(int width, /* I - Width in hundredths of millimeters * return (&(cg->pwg_media)); } -/* For OS X 10.8 and earlier */ -pwg_media_t *_pwgMediaForSize(int width, int length) -{ return (pwgMediaForSize(width, length)); } - /* * '_pwgMediaTable()' - Return the internal media size table. @@ -1177,8 +1167,3 @@ pwg_scan_measurement( return (value * numer / denom + fractional * numer / denom / divisor); } - - -/* - * End of "$Id$". - */ |