From: Michael R Sweet Date: Thu, 11 Mar 2021 16:31:03 +0000 (-0500) Subject: Address review by Till Kamppeter: X-Git-Tag: v2.4b1~188^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=954d47c7b68e034b7c6fffea9ffd15784fc03dfe;p=thirdparty%2Fcups.git Address review by Till Kamppeter: - 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. --- diff --git a/cups/ipp-support.c b/cups/ipp-support.c index d9e900649a..0dc427ee07 100644 --- a/cups/ipp-support.c +++ b/cups/ipp-support.c @@ -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", diff --git a/cups/ppd-cache.c b/cups/ppd-cache.c index 1032b13fc2..be924ba0b4 100644 --- a/cups/ppd-cache.c +++ b/cups/ppd-cache.c @@ -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 diff --git a/cups/ppd-private.h b/cups/ppd-private.h index 7b406c971b..b2fa23a147 100644 --- a/cups/ppd-private.h +++ b/cups/ppd-private.h @@ -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 9 /* Version number in cache file */ +# define _PPD_CACHE_VERSION 10 /* Version number in cache file */ /* diff --git a/doc/help/man-cupsd.conf.html b/doc/help/man-cupsd.conf.html index d66f67e55b..bbdb13e9ab 100644 --- a/doc/help/man-cupsd.conf.html +++ b/doc/help/man-cupsd.conf.html @@ -75,6 +75,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 policy-name
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". +
ReadyPaperSizes sizename[,...] +
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 seconds
Specifies the amount of time to wait for job completion before restarting the scheduler. The default is "30". diff --git a/man/cupsd.conf.5 b/man/cupsd.conf.5 index f32f748591..a4843da602 100644 --- a/man/cupsd.conf.5 +++ b/man/cupsd.conf.5 @@ -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 diff --git a/scheduler/printers.c b/scheduler/printers.c index 90b4f31c51..32faac37b9 100644 --- a/scheduler/printers.c +++ b/scheduler/printers.c @@ -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);