]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
The scheduler now advertises PWG Raster attributes for IPP Everywhere clients
authorMichael Sweet <michael.r.sweet@gmail.com>
Mon, 16 May 2016 23:54:35 +0000 (19:54 -0400)
committerMichael Sweet <michael.r.sweet@gmail.com>
Mon, 16 May 2016 23:54:35 +0000 (19:54 -0400)
(Issue #4428)

CHANGES.txt
scheduler/printers.c

index b9e5717186d505d633dfa5f259f55cba9df187b6..3e97472f5aeb58901c289d92ef15bc0a9219a4df 100644 (file)
@@ -3,6 +3,8 @@ CHANGES.txt - 2.2b1 - 2016-05-16
 
 CHANGES IN CUPS V2.2b1
 
+       - The scheduler now advertises PWG Raster attributes for IPP Everywhere
+         clients (Issue #4428)
        - The scheduler now logs informational messages for jobs at LogLevel
          "info" (Issue #4815)
        - The scheduler now uses the getgrouplist function when available
index 62f846c5293e87f9cf0d972c0200295ed7babdd1..7aa7bd8f24cfc35c7096bcff3da742fc4ef54f77 100644 (file)
@@ -3809,6 +3809,12 @@ load_ppd(cupsd_printer_t *p)             /* I - Printer */
                margins[16];            /* media-*-margin-supported values */
   const char   *filter,                /* Current filter */
                *mandatory;             /* Current mandatory attribute */
+  static const char * const pwg_raster_document_types[] =
+               {
+                 "black_1",
+                 "sgray_8",
+                 "srgb_8"
+               };
   static const char * const sides[3] = /* sides-supported values */
                {
                  "one-sided",
@@ -4413,6 +4419,7 @@ load_ppd(cupsd_printer_t *p)              /* I - Printer */
                     "print-color-mode-supported", 2, NULL, color_modes);
       ippAddString(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
                    "print-color-mode-default", NULL, "color");
+      ippAddStrings(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "pwg-raster-document-type-supported", 3, NULL, pwg_raster_document_types);
     }
     else
     {
@@ -4420,6 +4427,7 @@ load_ppd(cupsd_printer_t *p)              /* I - Printer */
                    "print-color-mode-supported", NULL, "monochrome");
       ippAddString(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
                    "print-color-mode-default", NULL, "monochrome");
+      ippAddStrings(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "pwg-raster-document-type-supported", 2, NULL, pwg_raster_document_types);
     }
 
    /*
@@ -4457,10 +4465,7 @@ load_ppd(cupsd_printer_t *p)             /* I - Printer */
       * Report all supported resolutions...
       */
 
-      attr = ippAddResolutions(p->ppd_attrs, IPP_TAG_PRINTER,
-                               "printer-resolution-supported",
-                               resolution->num_choices, IPP_RES_PER_INCH,
-                              NULL, NULL);
+      attr = ippAddResolutions(p->ppd_attrs, IPP_TAG_PRINTER, "printer-resolution-supported", resolution->num_choices, IPP_RES_PER_INCH, NULL, NULL);
 
       for (i = 0, choice = resolution->choices;
            i < resolution->num_choices;
@@ -4483,9 +4488,10 @@ load_ppd(cupsd_printer_t *p)             /* I - Printer */
         attr->values[i].resolution.units = IPP_RES_PER_INCH;
 
         if (choice->marked)
-         ippAddResolution(p->ppd_attrs, IPP_TAG_PRINTER,
-                          "printer-resolution-default", IPP_RES_PER_INCH,
-                          xdpi, ydpi);
+         ippAddResolution(p->ppd_attrs, IPP_TAG_PRINTER, "printer-resolution-default", IPP_RES_PER_INCH, xdpi, ydpi);
+
+        if (i == 0)
+         ippAddResolution(p->ppd_attrs, IPP_TAG_PRINTER, "pwg-raster-document-resolution-supported", IPP_RES_PER_INCH, xdpi, ydpi);
       }
     }
     else if ((ppd_attr = ppdFindAttr(ppd, "DefaultResolution", NULL)) != NULL &&
@@ -4518,6 +4524,7 @@ load_ppd(cupsd_printer_t *p)              /* I - Printer */
       ippAddResolution(p->ppd_attrs, IPP_TAG_PRINTER,
                       "printer-resolution-supported", IPP_RES_PER_INCH,
                       xdpi, ydpi);
+      ippAddResolution(p->ppd_attrs, IPP_TAG_PRINTER, "pwg-raster-document-resolution-supported", IPP_RES_PER_INCH, xdpi, ydpi);
     }
     else
     {
@@ -4531,6 +4538,7 @@ load_ppd(cupsd_printer_t *p)              /* I - Printer */
       ippAddResolution(p->ppd_attrs, IPP_TAG_PRINTER,
                       "printer-resolution-supported", IPP_RES_PER_INCH,
                       300, 300);
+      ippAddResolution(p->ppd_attrs, IPP_TAG_PRINTER, "pwg-raster-document-resolution-supported", IPP_RES_PER_INCH, 300, 300);
     }
 
    /*
@@ -4550,6 +4558,8 @@ load_ppd(cupsd_printer_t *p)              /* I - Printer */
     {
       p->type |= CUPS_PRINTER_DUPLEX;
 
+      ippAddString(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "pwg-raster-document-sheet-back", NULL, "normal");
+
       ippAddStrings(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
                    "sides-supported", 3, NULL, sides);