From: msweet Date: Mon, 7 Mar 2016 20:02:13 +0000 (+0000) Subject: Added support for disc media sizes () X-Git-Tag: v2.2b1~100 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d71488ecddea08aafd8cb9fc31e0dbb305a37a84;p=thirdparty%2Fcups.git Added support for disc media sizes () 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 --- diff --git a/CHANGES.txt b/CHANGES.txt index 983c389ddb..df0d6a5668 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,8 +1,9 @@ -CHANGES.txt - 2.2b1 - 2015-12-11 +CHANGES.txt - 2.2b1 - 2016-03-07 -------------------------------- CHANGES IN CUPS V2.2b1 + - Added support for disc media sizes () - The httpAddrConnect and httpConnect* APIs now try connecting to multiple addresses in parallel () - The cupsd domain socket is no longer world-accessible on OS X diff --git a/cups/pwg-media.c b/cups/pwg-media.c index 0c5396b085..09c8c2538d 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$". - */ diff --git a/cups/pwg-private.h b/cups/pwg-private.h index 274397fb3f..26269254f5 100644 --- a/cups/pwg-private.h +++ b/cups/pwg-private.h @@ -57,14 +57,6 @@ extern void _pwgGenerateSize(char *keyword, size_t keysize, extern int _pwgInitSize(pwg_size_t *size, ipp_t *job, int *margins_set) _CUPS_INTERNAL_MSG("Use pwgInitSize instead."); -extern pwg_media_t *_pwgMediaForLegacy(const char *legacy) - _CUPS_INTERNAL_MSG("Use pwgMediaForLegacy instead."); -extern pwg_media_t *_pwgMediaForPPD(const char *ppd) - _CUPS_INTERNAL_MSG("Use pwgMediaForPPD instead."); -extern pwg_media_t *_pwgMediaForPWG(const char *pwg) - _CUPS_INTERNAL_MSG("Use pwgMediaForPWG instead."); -extern pwg_media_t *_pwgMediaForSize(int width, int length) - _CUPS_INTERNAL_MSG("Use pwgMediaForSize instead."); extern const pwg_media_t *_pwgMediaTable(size_t *num_media); extern pwg_media_t *_pwgMediaNearSize(int width, int length, int epsilon); diff --git a/cups/testpwg.c b/cups/testpwg.c index dfa9f402ac..582c8deb13 100644 --- a/cups/testpwg.c +++ b/cups/testpwg.c @@ -1,23 +1,15 @@ /* - * "$Id$" + * PWG unit test program for CUPS. * - * PWG test program for CUPS. + * Copyright 2009-2016 by Apple Inc. * - * Copyright 2009-2013 by Apple Inc. + * These coded instructions, statements, and computer programs are the + * property of Apple Inc. and are protected by Federal copyright + * law. Distribution and use rights are outlined in the file "LICENSE.txt" + * which should have been included with this file. If this file is + * file is missing or damaged, see the license at "http://www.cups.org/". * - * These coded instructions, statements, and computer programs are the - * property of Apple Inc. and are protected by Federal copyright - * law. Distribution and use rights are outlined in the file "LICENSE.txt" - * which should have been included with this file. If this file is - * file is missing or damaged, see the license at "http://www.cups.org/". - * - * This file is subject to the Apple OS-Developed Software exception. - * - * Contents: - * - * main() - Main entry. - * test_pagesize() - Test the PWG mapping functions. - * test_ppd_cache() - Test the PPD cache functions. + * This file is subject to the Apple OS-Developed Software exception. */ /* @@ -188,6 +180,20 @@ main(int argc, /* I - Number of command-line args */ else printf("PASS (%dx%d)\n", pwgmedia->width, pwgmedia->length); + fputs("pwgMediaForPWG(\"disc_test_10x100mm\"): ", stdout); + if ((pwgmedia = pwgMediaForPWG("disc_test_10x100mm")) == NULL) + { + puts("FAIL (not found)"); + status ++; + } + else if (pwgmedia->width != 10000 || pwgmedia->length != 10000) + { + printf("FAIL (%dx%d)\n", pwgmedia->width, pwgmedia->length); + status ++; + } + else + printf("PASS (%dx%d)\n", pwgmedia->width, pwgmedia->length); + fputs("pwgMediaForLegacy(\"na-letter\"): ", stdout); if ((pwgmedia = pwgMediaForLegacy("na-letter")) == NULL) { diff --git a/doc/help/man-cupsd.html b/doc/help/man-cupsd.html index 0094851287..de12942170 100644 --- a/doc/help/man-cupsd.html +++ b/doc/help/man-cupsd.html @@ -13,7 +13,7 @@ cupsd - cups scheduler cupsd [ -c -cupsd.conf +config-file ] [ -f ] [ @@ -23,20 +23,17 @@ cupsd - cups scheduler ] [ -l ] [ --s -cups-files.conf -] [ -t ]

Description

cupsd -is the scheduler for CUPS. It implements a printing system based upon the Internet Printing Protocol, version 2.1, and supports most of the requirements for IPP Everywhere. If no options are specified on the command-line then the default configuration file +is the scheduler for CUPS. It implements a printing system based upon the Internet Printing Protocol, version 2.1. If no options are specified on the command-line then the default configuration file /etc/cups/cupsd.conf will be used.

Options

-
-c cupsd.conf -
Uses the named cupsd.conf configuration file. +
-c config-file +
Uses the named configuration file.
-f
Run cupsd @@ -57,8 +54,6 @@ when it is run from launchd(8) or systemd(8). -
-s cups-files.conf -
Uses the named cups-files.conf configuration file.
-t
Test the configuration file for syntax errors.
@@ -104,7 +99,6 @@ in the foreground with a test configuration file called backend(7), classes.conf(5), cups(1), -cups-files.conf(5), cups-lpd(8), cupsd.conf(5), cupsd-helper(8), @@ -117,7 +111,7 @@ in the foreground with a test configuration file called systemd(8), CUPS Online Help (http://localhost:631/help)

Copyright

-Copyright © 2007-2016 by Apple Inc. +Copyright © 2007-2015 by Apple Inc. diff --git a/doc/help/man-ppdcfile.html b/doc/help/man-ppdcfile.html index 4e4279722f..aa1d6bf6b5 100644 --- a/doc/help/man-ppdcfile.html +++ b/doc/help/man-ppdcfile.html @@ -45,7 +45,7 @@ This man page provides a quick reference to the supported keywords and should be
Darkness temperature "name/text"
DriverType type
Duplex type -
Filter Imime-type cost program +
Filter mime-type cost program
Finishing name
Finishing "name/text"
Font * diff --git a/filter/rastertopwg.c b/filter/rastertopwg.c index 7e17f53310..b47ef2967a 100644 --- a/filter/rastertopwg.c +++ b/filter/rastertopwg.c @@ -1,9 +1,7 @@ /* - * "$Id$" - * * CUPS raster to PWG raster format filter for CUPS. * - * Copyright 2011, 2014-2015 Apple Inc. + * Copyright 2011, 2014-2016 Apple Inc. * * These coded instructions, statements, and computer programs are the * property of Apple Inc. and are protected by Federal copyright law. @@ -269,10 +267,8 @@ main(int argc, /* I - Number of command-line args */ } else { - pwg_media = _pwgMediaForSize((int)(2540.0 * inheader.cupsPageSize[0] / - 72.0), - (int)(2540.0 * inheader.cupsPageSize[1] / - 72.0)); + pwg_media = pwgMediaForSize((int)(2540.0 * inheader.cupsPageSize[0] / 72.0), + (int)(2540.0 * inheader.cupsPageSize[1] / 72.0)); if (pwg_media) strlcpy(outheader.cupsPageSizeName, pwg_media->pwg, @@ -486,8 +482,3 @@ main(int argc, /* I - Number of command-line args */ return (0); } - - -/* - * End of "$Id$". - */