]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Added support for disc media sizes (<rdar://problem/20219536>)
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Mon, 7 Mar 2016 20:02:13 +0000 (20:02 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Mon, 7 Mar 2016 20:02:13 +0000 (20:02 +0000)
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

CHANGES.txt
cups/pwg-media.c
cups/pwg-private.h
cups/testpwg.c
doc/help/man-cupsd.html
doc/help/man-ppdcfile.html
filter/rastertopwg.c

index 983c389ddb678c885185ca3920866b69868adcd4..df0d6a566863e73538df4845f8ac119d6789e5ee 100644 (file)
@@ -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 (<rdar://problem/20219536>)
        - The httpAddrConnect and httpConnect* APIs now try connecting to
          multiple addresses in parallel (<rdar://problem/20643153>)
        - The cupsd domain socket is no longer world-accessible on OS X
index 0c5396b08509cdc4f0b8216302b4eb948897ff38..09c8c2538d59403d88a2b2d9b7b951713e503b9e 100644 (file)
@@ -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$".
- */
index 274397fb3f18e8abce84f209d6dcdcfe5f5751a7..26269254f50e03617314f339a91f158ff35d6110 100644 (file)
@@ -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);
 
index dfa9f402acd677e6298d599ed79d073d9a6a35c0..582c8deb134f715b343e73e04a65f925ee93ef18 100644 (file)
@@ -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)
   {
index 0094851287896289032557fcfc7279d2cc4ecf8a..de1294217030b249649f0f7d628fd855be815ebd 100644 (file)
@@ -13,7 +13,7 @@ cupsd - cups scheduler
 <b>cupsd</b>
 [
 <b>-c</b>
-<i>cupsd.conf</i>
+<i>config-file</i>
 ] [
 <b>-f</b>
 ] [
@@ -23,20 +23,17 @@ cupsd - cups scheduler
 ] [
 <b>-l</b>
 ] [
-<b>-s</b>
-<i>cups-files.conf</i>
-] [
 <b>-t</b>
 ]
 <h2 class="title"><a name="DESCRIPTION">Description</a></h2>
 <b>cupsd</b>
-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
 <i>/etc/cups/cupsd.conf</i>
 will be used.
 <h2 class="title"><a name="OPTIONS">Options</a></h2>
 <dl class="man">
-<dt><b>-c</b><i> cupsd.conf</i>
-<dd style="margin-left: 5.0em">Uses the named cupsd.conf configuration file.
+<dt><b>-c</b><i> config-file</i>
+<dd style="margin-left: 5.0em">Uses the named configuration file.
 <dt><b>-f</b>
 <dd style="margin-left: 5.0em">Run
 <b>cupsd</b>
@@ -57,8 +54,6 @@ when it is run from
 <b>launchd</b>(8)
 or
 <b>systemd</b>(8).
-<dt><b>-s</b><i> cups-files.conf</i>
-<dd style="margin-left: 5.0em">Uses the named cups-files.conf configuration file.
 <dt><b>-t</b>
 <dd style="margin-left: 5.0em">Test the configuration file for syntax errors.
 </dl>
@@ -104,7 +99,6 @@ in the foreground with a test configuration file called
 <a href="man-backend.html?TOPIC=Man+Pages"><b>backend</b>(7),</a>
 <a href="man-classes.conf.html?TOPIC=Man+Pages"><b>classes.conf</b>(5),</a>
 <a href="man-cups.html?TOPIC=Man+Pages"><b>cups</b>(1),</a>
-<a href="man-cups-files.conf.html?TOPIC=Man+Pages"><b>cups-files.conf</b>(5),</a>
 <a href="man-cups-lpd.html?TOPIC=Man+Pages"><b>cups-lpd</b>(8),</a>
 <a href="man-cupsd.conf.html?TOPIC=Man+Pages"><b>cupsd.conf</b>(5),</a>
 <a href="man-cupsd-helper.html?TOPIC=Man+Pages"><b>cupsd-helper</b>(8),</a>
@@ -117,7 +111,7 @@ in the foreground with a test configuration file called
 <b>systemd</b>(8),
 CUPS Online Help (<a href="http://localhost:631/help">http://localhost:631/help</a>)
 <h2 class="title"><a name="COPYRIGHT">Copyright</a></h2>
-Copyright &copy; 2007-2016 by Apple Inc.
+Copyright &copy; 2007-2015 by Apple Inc.
 
 </body>
 </html>
index 4e4279722f6b1b5677ef53efac7cf05b8878eec6..aa1d6bf6b5c86d8cc4501b12acce09f4b3773c42 100644 (file)
@@ -45,7 +45,7 @@ This man page provides a quick reference to the supported keywords and should be
 <dd style="margin-left: 5.0em"><dt><b>Darkness </b><i>temperature </i><b>"</b><i>name</i><b>/</b><i>text</i><b>"</b>
 <dd style="margin-left: 5.0em"><dt><b>DriverType </b><i>type</i>
 <dd style="margin-left: 5.0em"><dt><b>Duplex </b><i>type</i>
-<dd style="margin-left: 5.0em"><dt><b>Filter Imime-type cost program</b>
+<dd style="margin-left: 5.0em"><dt><b>Filter </b><i>mime-type cost program</i>
 <dd style="margin-left: 5.0em"><dt><b>Finishing </b><i>name</i>
 <dd style="margin-left: 5.0em"><dt><b>Finishing "</b><i>name</i><b>/</b><i>text</i><b>"</b>
 <dd style="margin-left: 5.0em"><dt><b>Font *</b>
index 7e17f533108b6ab228885b7d6c6a56c745f9701a..b47ef2967a977927cfa56e6a8f6a8a26aab4a077 100644 (file)
@@ -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$".
- */