]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Address review by Till Kamppeter:
authorMichael R Sweet <michael.r.sweet@gmail.com>
Thu, 11 Mar 2021 16:31:03 +0000 (11:31 -0500)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Thu, 11 Mar 2021 16:31:03 +0000 (11:31 -0500)
- Add mopria-certified and printer-wifi-xxx to list of Printer Description
  attributes.
- Bump the PPD cache version to reflect the additional attributes we are adding.
- Update the documentation to note that DefaultPaperSize and ReadyPaperSizes
  contain a list of PPD size names.
- Update urf-supported/URF values to include copies (CP), finishings (FN), and
  print-quality (PQ) values.

cups/ipp-support.c
cups/ppd-cache.c
cups/ppd-private.h
doc/help/man-cupsd.conf.html
man/cupsd.conf.5
scheduler/printers.c

index d9e900649aa86ea2dfb05e16924c3422a938d868..0dc427ee07b793f03a77ea27663105d35f9a9959 100644 (file)
@@ -1640,6 +1640,7 @@ ippCreateRequestedArray(ipp_t *request)   /* I - IPP request */
     "document-format-default",
     "document-format-details-default",
     "document-format-details-supported",
+    "document-format-preferred",       /* AirPrint extension */
     "document-format-supported",
     "document-format-varying-attributes",
     "document-format-version-default",
@@ -1692,6 +1693,7 @@ ippCreateRequestedArray(ipp_t *request)   /* I - IPP request */
     "marker-types",                    /* CUPS extension */
     "member-names",                    /* CUPS extension */
     "member-uris",                     /* CUPS extension */
+    "mopria-certified",                        /* Mopria extension */
     "multiple-destination-uris-supported",/* IPP FaxOut */
     "multiple-document-jobs-supported",
     "multiple-operation-time-out",
@@ -1769,6 +1771,8 @@ ippCreateRequestedArray(ipp_t *request)   /* I - IPP request */
     "printer-up-time",
     "printer-uri-supported",
     "printer-uuid",
+    "printer-wifi-ssid",               /* AirPrint extension */
+    "printer-wifi-state",              /* AirPrint extension */
     "printer-xri-supported",
     "pwg-raster-document-resolution-supported",
     "pwg-raster-document-sheet-back",
index 1032b13fc2d3a61f19869c1fdd40a8b3de9be8e7..be924ba0b43bac82eeb19aa332d2ab49678698eb 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * PPD cache implementation for CUPS.
  *
+ * Copyright © 2021 by OpenPrinting.
  * Copyright © 2010-2019 by Apple Inc.
  *
  * Licensed under Apache License v2.0.  See the file "LICENSE" for more
index 7b406c971bdd6e37edc9bc4dd6e4151e942ee12d..b2fa23a14735f11b6c67ca368ebf715d1adc5406 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * Private PPD definitions for CUPS.
  *
+ * Copyright © 2021 by OpenPrinting.
  * Copyright © 2007-2019 by Apple Inc.
  * Copyright © 1997-2007 by Easy Software Products, all rights reserved.
  *
@@ -35,7 +36,7 @@ extern "C" {
  * Constants...
  */
 
-#  define _PPD_CACHE_VERSION         /* Version number in cache file */
+#  define _PPD_CACHE_VERSION   10      /* Version number in cache file */
 
 
 /*
index d66f67e55b7dceaad6aefd0d62b47ee5d1eda2e7..bbdb13e9ab717ea59b61575c5a95baba2fcdcf6f 100644 (file)
@@ -75,6 +75,7 @@ The default is "en".
 <dd style="margin-left: 5.0em">Specifies the default paper size for new print queues. "Auto" uses a locale-specific default, while "None" specifies there is no default paper size.
 Specific size names are typically "Letter" or "A4".
 The default is "Auto".
+Note: The default paper size must use a size name from the PPD file and not a PWG self-describing media size name.
 <dt><a name="DefaultPolicy"></a><b>DefaultPolicy </b><i>policy-name</i>
 <dd style="margin-left: 5.0em">Specifies the default access policy to use.
 The default access policy is "default".
@@ -238,6 +239,11 @@ The default is "86400" (preserve 1 day).
 If a numeric value is specified, the job history is preserved for the indicated number of seconds after printing.
 If "Yes", the job history is preserved until the MaxJobs limit is reached.
 The default is "Yes".
+<dt><a name="ReadyPaperSizes"></a><b>ReadyPaperSizes </b><i>sizename[,...]</i>
+<dd style="margin-left: 5.0em">Specifies a list of potential paper sizes that are reported as "ready" (loaded).
+The actual list will only contain sizes that each printer supports.
+The default is "Letter,Legal,Tabloid,4x6,Env10" for North America and "A3,A4,A5,A6,EnvDL" elsewhere.
+Note: Paper sizes must use the size names from the PPD file and not PWG self-describing media size names.
 <dt><a name="ReloadTimeout"></a><b>ReloadTimeout </b><i>seconds</i>
 <dd style="margin-left: 5.0em">Specifies the amount of time to wait for job completion before restarting the scheduler.
 The default is "30".
index f32f7485912b9826f7e75a9e1c6c73b484297831..a4843da602b4b222148f38e35650add26a1b85b5 100644 (file)
@@ -8,7 +8,7 @@
 .\" Licensed under Apache License v2.0.  See the file "LICENSE" for more
 .\" information.
 .\"
-.TH cupsd.conf 5 "CUPS" "2021-03-07" "OpenPrinting"
+.TH cupsd.conf 5 "CUPS" "2021-03-11" "OpenPrinting"
 .SH NAME
 cupsd.conf \- server configuration file for cups
 .SH DESCRIPTION
@@ -107,6 +107,7 @@ The default is "en".
 Specifies the default paper size for new print queues. "Auto" uses a locale-specific default, while "None" specifies there is no default paper size.
 Specific size names are typically "Letter" or "A4".
 The default is "Auto".
+Note: The default paper size must use a size name from the PPD file and not a PWG self-describing media size name.
 .\"#DefaultPolicy
 .TP 5
 \fBDefaultPolicy \fIpolicy-name\fR
@@ -376,6 +377,7 @@ The default is "Yes".
 Specifies a list of potential paper sizes that are reported as "ready" (loaded).
 The actual list will only contain sizes that each printer supports.
 The default is "Letter,Legal,Tabloid,4x6,Env10" for North America and "A3,A4,A5,A6,EnvDL" elsewhere.
+Note: Paper sizes must use the size names from the PPD file and not PWG self-describing media size names.
 .\"#ReloadTimeout
 .TP 5
 \fBReloadTimeout \fIseconds\fR
index 90b4f31c5168b16dd8126669f3d8ad84b0c8a202..32faac37b9f41ce575ebaffab856379f5f65c1d1 100644 (file)
@@ -3884,8 +3884,12 @@ load_ppd(cupsd_printer_t *p)             /* I - Printer */
   ipp_attribute_t *media_col_ready,    /* media-col-ready attribute */
                *media_ready;           /* media-ready attribute */
   int          num_urf;                /* Number of urf-supported values */
-  const char   *urf[16];               /* urf-supported values */
-  char         urf_rs[32];             /* RS (resolution) value */
+  const char   *urf[16],               /* urf-supported values */
+               *urf_prefix;            /* Prefix string for value */
+  char         *urf_ptr,               /* Pointer into value */
+               urf_fn[64],             /* FN (finishings) value */
+               urf_pq[32],             /* PQ (print-quality) value */
+               urf_rs[32];             /* RS (resolution) value */
   static const char * const pwg_raster_document_types[] =
                {
                  "black_1",
@@ -4102,9 +4106,17 @@ load_ppd(cupsd_printer_t *p)             /* I - Printer */
 
     num_urf         = 0;
     urf[num_urf ++] = "V1.4";
-    urf[num_urf ++] = "PQ3-4-5";
+    urf[num_urf ++] = "CP1";
     urf[num_urf ++] = "W8";
 
+    for (i = 0, urf_ptr = urf_pq, urf_prefix = "PQ"; i < num_qualities; i ++)
+    {
+      snprintf(urf_ptr, sizeof(urf_pq) - (size_t)(urf_ptr - urf_pq), "%s%d", prefix, qualities[i]);
+      urf_prefix = "-";
+      urf_ptr    += strlen(urf_ptr);
+    }
+    urf[num_urf ++] = urf_pq;
+
    /*
     * Add media options from the PPD file...
     */
@@ -4645,11 +4657,15 @@ load_ppd(cupsd_printer_t *p)            /* I - Printer */
     {
       _pwg_finishings_t        *fin;           /* Current finishing value */
 
-      for (fin = (_pwg_finishings_t *)cupsArrayFirst(p->pc->finishings); fin; fin = (_pwg_finishings_t *)cupsArrayNext(p->pc->finishings))
+      for (fin = (_pwg_finishings_t *)cupsArrayFirst(p->pc->finishings), urf_ptr = urf_fn, urf_prefix = "FN"; fin; fin = (_pwg_finishings_t *)cupsArrayNext(p->pc->finishings))
       {
         if (num_finishings < (int)(sizeof(finishings) / sizeof(finishings[0])))
           finishings[num_finishings++] = (int)fin->value;
 
+        snprintf(urf_ptr, sizeof(urf_fn) - (size_t)(urf_ptr - urf_fn), "%s%d", urf_prefix, fin->value);
+        urf_prefix = "-";
+        urf_ptr    += strlen(urf_ptr);
+
         switch (fin->value)
         {
           case IPP_FINISHINGS_BIND :
@@ -4709,7 +4725,12 @@ load_ppd(cupsd_printer_t *p)             /* I - Printer */
               break;
         }
       }
+
+      if (urf_ptr > urf_fn)
+        urf[num_urf ++] = urf_fn;
     }
+    else
+      urf[num_urf ++] = "FN3";
 
     /* urf-supported */
     ippAddStrings(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "urf-supported", num_urf, NULL, urf);