From: Michael R Sweet Date: Mon, 18 Jun 2018 16:44:49 +0000 (-0400) Subject: Report all supported Job Creation attributes and their values (Issue #5340) X-Git-Tag: v2.3b6~143 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91505c0a326ec53ef6d2b82c9efd8029fac7ae01;p=thirdparty%2Fcups.git Report all supported Job Creation attributes and their values (Issue #5340) --- diff --git a/CHANGES.md b/CHANGES.md index a178a309da..c7438f9b72 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,4 @@ -CHANGES - 2.3b6 - 2018-06-12 +CHANGES - 2.3b6 - 2018-06-18 ============================ Changes in CUPS v2.3b6 @@ -7,6 +7,8 @@ Changes in CUPS v2.3b6 - Localization update (Issue #5339) - Fixed a regression in the changes to ippValidateAttribute (Issue #5322, Issue #5330) +- The scheduler did not report all of the supported job options and values + (Issue #5340) - Fixed a memory leak for some IPP (extension) syntaxes. diff --git a/cups/encode.c b/cups/encode.c index e08bc9a644..04058b565a 100644 --- a/cups/encode.c +++ b/cups/encode.c @@ -129,6 +129,9 @@ static const _ipp_option_t ipp_options[] = cups_schemes }, { 1, "finishings", IPP_TAG_ENUM, IPP_TAG_JOB, IPP_TAG_DOCUMENT }, + { 1, "finishings-col", IPP_TAG_BEGIN_COLLECTION, IPP_TAG_JOB, + IPP_TAG_DOCUMENT }, + { 1, "finishings-col-default", IPP_TAG_BEGIN_COLLECTION, IPP_TAG_PRINTER }, { 1, "finishings-default", IPP_TAG_ENUM, IPP_TAG_PRINTER }, { 0, "fit-to-page", IPP_TAG_BOOLEAN, IPP_TAG_JOB, IPP_TAG_DOCUMENT }, @@ -142,6 +145,7 @@ static const _ipp_option_t ipp_options[] = { 1, "include-schemes", IPP_TAG_NAME, IPP_TAG_OPERATION, IPP_TAG_ZERO, cups_schemes }, + { 0, "ipp-attribute-fidelity", IPP_TAG_BOOLEAN, IPP_TAG_OPERATION }, { 0, "job-account-id", IPP_TAG_NAME, IPP_TAG_JOB }, { 0, "job-account-id-default",IPP_TAG_NAME, IPP_TAG_PRINTER }, { 0, "job-accounting-user-id", IPP_TAG_NAME, IPP_TAG_JOB }, @@ -150,6 +154,7 @@ static const _ipp_option_t ipp_options[] = { 0, "job-cancel-after", IPP_TAG_INTEGER, IPP_TAG_JOB }, { 0, "job-cancel-after-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER }, { 0, "job-hold-until", IPP_TAG_KEYWORD, IPP_TAG_JOB }, + { 0, "job-hold-until-default", IPP_TAG_KEYWORD, IPP_TAG_PRINTER }, { 0, "job-id", IPP_TAG_INTEGER, IPP_TAG_ZERO }, /* never send as option */ { 0, "job-impressions", IPP_TAG_INTEGER, IPP_TAG_OPERATION }, { 0, "job-impressions-completed", IPP_TAG_INTEGER, IPP_TAG_ZERO }, /* never send as option */ @@ -158,6 +163,8 @@ static const _ipp_option_t ipp_options[] = { 0, "job-k-octets-completed",IPP_TAG_INTEGER, IPP_TAG_ZERO }, /* never send as option */ { 0, "job-media-sheets", IPP_TAG_INTEGER, IPP_TAG_OPERATION }, { 0, "job-media-sheets-completed", IPP_TAG_INTEGER, IPP_TAG_ZERO }, /* never send as option */ + { 0, "job-name", IPP_TAG_NAME, IPP_TAG_OPERATION, + IPP_TAG_JOB }, { 0, "job-page-limit", IPP_TAG_INTEGER, IPP_TAG_PRINTER }, { 0, "job-pages", IPP_TAG_INTEGER, IPP_TAG_OPERATION }, { 0, "job-pages-completed", IPP_TAG_INTEGER, IPP_TAG_ZERO }, /* never send as option */ @@ -168,6 +175,7 @@ static const _ipp_option_t ipp_options[] = IPP_TAG_ZERO, ipp_job_creation }, { 0, "job-priority", IPP_TAG_INTEGER, IPP_TAG_JOB }, + { 0, "job-priority-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER }, { 0, "job-quota-period", IPP_TAG_INTEGER, IPP_TAG_PRINTER }, { 1, "job-sheets", IPP_TAG_NAME, IPP_TAG_JOB }, { 1, "job-sheets-default", IPP_TAG_NAME, IPP_TAG_PRINTER }, @@ -212,6 +220,9 @@ static const _ipp_option_t ipp_options[] = IPP_TAG_DOCUMENT }, { 0, "mirror", IPP_TAG_BOOLEAN, IPP_TAG_JOB }, { 0, "mirror-default", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER }, + { 0, "multiple-document-handling", IPP_TAG_KEYWORD, IPP_TAG_JOB, + IPP_TAG_DOCUMENT }, + { 0, "multiple-document-handling-default", IPP_TAG_KEYWORD, IPP_TAG_PRINTER }, { 0, "natural-scaling", IPP_TAG_INTEGER, IPP_TAG_JOB }, { 0, "natural-scaling-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER }, { 0, "notify-charset", IPP_TAG_CHARSET, IPP_TAG_SUBSCRIPTION }, @@ -227,18 +238,26 @@ static const _ipp_option_t ipp_options[] = { 0, "number-up", IPP_TAG_INTEGER, IPP_TAG_JOB, IPP_TAG_DOCUMENT }, { 0, "number-up-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER }, + { 0, "number-up-layout", IPP_TAG_KEYWORD, IPP_TAG_JOB, + IPP_TAG_DOCUMENT }, + { 0, "number-up-layout-default", IPP_TAG_KEYWORD, IPP_TAG_PRINTER }, { 0, "orientation-requested", IPP_TAG_ENUM, IPP_TAG_JOB, IPP_TAG_DOCUMENT }, { 0, "orientation-requested-default", IPP_TAG_ENUM, IPP_TAG_PRINTER }, + { 0, "output-bin", IPP_TAG_KEYWORD, IPP_TAG_JOB, + IPP_TAG_DOCUMENT }, + { 0, "output-bin-default", IPP_TAG_KEYWORD, IPP_TAG_PRINTER }, { 1, "overrides", IPP_TAG_BEGIN_COLLECTION, IPP_TAG_JOB, IPP_TAG_DOCUMENT }, { 0, "page-bottom", IPP_TAG_INTEGER, IPP_TAG_JOB }, { 0, "page-bottom-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER }, + { 0, "page-delivery", IPP_TAG_KEYWORD, IPP_TAG_JOB, + IPP_TAG_DOCUMENT }, + { 0, "page-delivery-default", IPP_TAG_KEYWORD, IPP_TAG_PRINTER }, { 0, "page-left", IPP_TAG_INTEGER, IPP_TAG_JOB }, { 0, "page-left-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER }, { 1, "page-ranges", IPP_TAG_RANGE, IPP_TAG_JOB, IPP_TAG_DOCUMENT }, - { 1, "page-ranges-default", IPP_TAG_RANGE, IPP_TAG_PRINTER }, { 0, "page-right", IPP_TAG_INTEGER, IPP_TAG_JOB }, { 0, "page-right-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER }, { 0, "page-top", IPP_TAG_INTEGER, IPP_TAG_JOB }, @@ -279,9 +298,21 @@ static const _ipp_option_t ipp_options[] = { 0, "ppi-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER }, { 0, "prettyprint", IPP_TAG_BOOLEAN, IPP_TAG_JOB }, { 0, "prettyprint-default", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER }, + { 0, "print-color-mode", IPP_TAG_KEYWORD, IPP_TAG_JOB, + IPP_TAG_DOCUMENT }, + { 0, "print-color-mode-default", IPP_TAG_KEYWORD, IPP_TAG_PRINTER }, + { 0, "print-content-optimize", IPP_TAG_KEYWORD, IPP_TAG_JOB, + IPP_TAG_DOCUMENT }, + { 0, "print-content-optimize-default", IPP_TAG_KEYWORD, IPP_TAG_PRINTER }, { 0, "print-quality", IPP_TAG_ENUM, IPP_TAG_JOB, IPP_TAG_DOCUMENT }, { 0, "print-quality-default", IPP_TAG_ENUM, IPP_TAG_PRINTER }, + { 0, "print-rendering-intent", IPP_TAG_KEYWORD, IPP_TAG_JOB, + IPP_TAG_DOCUMENT }, + { 0, "print-rendering-intent-default", IPP_TAG_KEYWORD, IPP_TAG_PRINTER }, + { 0, "print-scaling", IPP_TAG_KEYWORD, IPP_TAG_JOB, + IPP_TAG_DOCUMENT }, + { 0, "print-scaling-default", IPP_TAG_KEYWORD, IPP_TAG_PRINTER }, { 1, "printer-alert", IPP_TAG_STRING, IPP_TAG_PRINTER }, { 1, "printer-alert-description", IPP_TAG_TEXT, IPP_TAG_PRINTER }, { 1, "printer-commands", IPP_TAG_KEYWORD, IPP_TAG_PRINTER }, @@ -303,6 +334,7 @@ static const _ipp_option_t ipp_options[] = { 1, "printer-output-tray", IPP_TAG_STRING, IPP_TAG_PRINTER }, { 0, "printer-resolution", IPP_TAG_RESOLUTION, IPP_TAG_JOB, IPP_TAG_DOCUMENT }, + { 0, "printer-resolution-default", IPP_TAG_RESOLUTION, IPP_TAG_PRINTER }, { 0, "printer-state", IPP_TAG_ENUM, IPP_TAG_PRINTER }, { 0, "printer-state-change-time", IPP_TAG_INTEGER, IPP_TAG_PRINTER }, { 1, "printer-state-reasons", IPP_TAG_KEYWORD, IPP_TAG_PRINTER }, diff --git a/scheduler/job.c b/scheduler/job.c index 5ced0b9d1f..90aaccbf85 100644 --- a/scheduler/job.c +++ b/scheduler/job.c @@ -1,10 +1,11 @@ /* * Job management routines for the CUPS scheduler. * - * Copyright 2007-2017 by Apple Inc. - * Copyright 1997-2007 by Easy Software Products, all rights reserved. + * Copyright © 2007-2018 by Apple Inc. + * Copyright © 1997-2007 by Easy Software Products, all rights reserved. * - * Licensed under Apache License v2.0. See the file "LICENSE" for more information. + * Licensed under Apache License v2.0. See the file "LICENSE" for more + * information. */ /* @@ -3815,6 +3816,20 @@ get_options(cupsd_job_t *job, /* I - Job */ cupsdLogJob(job, CUPSD_LOG_DEBUG2, "After mapping finishings %s=%s", pwgppd->name, pwgppd->value); } + /* + * Map page-delivery values... + */ + + if ((attr = ippFindAttribute(job->attrs, "page-delivery", IPP_TAG_KEYWORD)) != NULL && !ippFindAttribute(job->attrs, "outputorder", IPP_TAG_ZERO)) + { + const char *page_delivery = ippGetString(attr, 0, NULL); + + if (!strncmp(page_delivery, "same-order", 10)) + num_pwgppds = cupsAddOption("OutputOrder", "Normal", num_pwgppds, &pwgppds); + else if (!strncmp(page_delivery, "reverse-order", 13)) + num_pwgppds = cupsAddOption("OutputOrder", "Reverse", num_pwgppds, &pwgppds); + } + /* * Figure out how much room we need... */ diff --git a/scheduler/printers.c b/scheduler/printers.c index c4a009d3dd..1520201031 100644 --- a/scheduler/printers.c +++ b/scheduler/printers.c @@ -1,10 +1,11 @@ /* * Printer routines for the CUPS scheduler. * - * Copyright 2007-2017 by Apple Inc. - * Copyright 1997-2007 by Easy Software Products, all rights reserved. + * Copyright © 2007-2018 by Apple Inc. + * Copyright © 1997-2007 by Easy Software Products, all rights reserved. * - * Licensed under Apache License v2.0. See the file "LICENSE" for more information. + * Licensed under Apache License v2.0. See the file "LICENSE" for more + * information. */ /* @@ -148,8 +149,32 @@ cupsdCreateCommonData(void) struct statfs spoolinfo; /* FS info for spool directory */ double spoolsize; /* FS size */ #endif /* HAVE_STATVFS */ - static const int nups[] = /* number-up-supported values */ + static const char * const page_delivery[] = + { /* page-delivery-supported values */ + "reverse-order", + "same-order" + }; + static const char * const print_scaling[] = + { /* print-scaling-supported values */ + "auto", + "auto-fit", + "fill", + "fit", + "none" + }; + static const int number_up[] = /* number-up-supported values */ { 1, 2, 4, 6, 9, 16 }; + static const char * const number_up_layout[] = + { /* number-up-layout-supported values */ + "btlr", + "btrl", + "lrbt", + "lrtb", + "rlbt", + "rltb", + "tblr", + "tbrl" + }; static const int orients[4] =/* orientation-requested-supported values */ { IPP_PORTRAIT, @@ -290,6 +315,7 @@ cupsdCreateCommonData(void) { /* job-creation-attributes-supported */ "copies", "finishings", + "finishings-col", "ipp-attribute-fidelity", "job-hold-until", "job-name", @@ -299,11 +325,14 @@ cupsdCreateCommonData(void) "media-col", "multiple-document-handling", "number-up", - "output-bin", + "number-up-layout", "orientation-requested", + "output-bin", + "page-delivery", "page-ranges", "print-color-mode", "print-quality", + "print-scaling", "printer-resolution", "sides" }; @@ -601,7 +630,10 @@ cupsdCreateCommonData(void) /* number-up-supported */ ippAddIntegers(CommonData, IPP_TAG_PRINTER, IPP_TAG_INTEGER, - "number-up-supported", sizeof(nups) / sizeof(nups[0]), nups); + "number-up-supported", sizeof(number_up) / sizeof(number_up[0]), number_up); + + /* number-up-layout-supported */ + ippAddStrings(CommonData, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD), "number-up-layout-supported", sizeof(number_up_layout) / sizeof(number_up_layout[0]), NULL, number_up_layout); /* operations-supported */ ippAddIntegers(CommonData, IPP_TAG_PRINTER, IPP_TAG_ENUM, @@ -611,6 +643,9 @@ cupsdCreateCommonData(void) ippAddIntegers(CommonData, IPP_TAG_PRINTER, IPP_TAG_ENUM, "orientation-requested-supported", 4, orients); + /* page-delivery-supported */ + ippAddStrings(CommonData, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD), "page-delivery-supported", sizeof(page_delivery) / sizeof(page_delivery[0]), NULL, page_delivery); + /* page-ranges-supported */ ippAddBoolean(CommonData, IPP_TAG_PRINTER, "page-ranges-supported", 1); @@ -628,6 +663,9 @@ cupsdCreateCommonData(void) ippAddString(CommonData, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | IPP_TAG_COPY, "pdl-override-supported", NULL, "attempted"); + /* print-scaling-supported */ + ippAddStrings(CommonData, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD), "print-scaling-supported", sizeof(print_scaling) / sizeof(print_scaling[0]), NULL, print_scaling); + /* printer-get-attributes-supported */ ippAddString(CommonData, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD), "printer-get-attributes-supported", NULL, "document-format");