]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Add output-bin support for IPP Everywhere printers (Issue #4938)
authorMichael R Sweet <michaelrsweet@gmail.com>
Tue, 3 Jan 2017 21:42:46 +0000 (16:42 -0500)
committerMichael R Sweet <michaelrsweet@gmail.com>
Tue, 3 Jan 2017 21:42:46 +0000 (16:42 -0500)
CHANGES.txt
cups/ppd-cache.c

index fee98d58cefb55f0979a98d63b440cb03dd04c0f..9c535bf4b6f13426feb5358adbc48c62c4b4d4e5 100644 (file)
@@ -6,7 +6,7 @@ CHANGES IN CUPS V2.2.2
        - Fixed some issues with the Zebra ZPL printer driver (Issue #4898)
        - Fixed some issues with IPP Everywhere printer support (Issue #4893,
          Issue #4909, Issue #4916, Issue #4921, Issue #4923, Issue #4932,
-         Issue #4933)
+         Issue #4933, Issue #4938)
        - The cups-lpd program did not catch all legacy usage of ISO-8859-1
           (Issue #4899)
         - Fixed builds on systems without a working poll() implementation
index 003180633575f5195106965ae9da1a61321b90de..a919d21e8a9292c5c1daa4dbe8a4e93e91687b8f 100644 (file)
@@ -3672,6 +3672,79 @@ _ppdCreateFromIPP(char   *buffer,        /* I - Filename buffer */
     }
   }
 
+ /*
+  * Output bin...
+  */
+
+  if ((attr = ippFindAttribute(response, "output-bin-default", IPP_TAG_ZERO)) != NULL)
+    pwg_ppdize_name(ippGetString(attr, 0, NULL), ppdname, sizeof(ppdname));
+  else
+    strlcpy(ppdname, "Unknown", sizeof(ppdname));
+
+  if ((attr = ippFindAttribute(response, "outout-bin-supported", IPP_TAG_ZERO)) != NULL && (count = ippGetCount(attr)) > 1)
+  {
+    static const char * const output_bins[][2] =
+    {                                  /* "output-bin" strings */
+      { "auto", _("Automatic") },
+      { "bottom", _("Bottom Tray") },
+      { "center", _("Center Tray") },
+      { "face-down", _("Face Down") },
+      { "face-up", _("Face Up") },
+      { "large-capacity", _("Large Capacity Tray") },
+      { "left", _("Left Tray") },
+      { "mailbox-1", _("Mailbox 1") },
+      { "mailbox-2", _("Mailbox 2") },
+      { "mailbox-3", _("Mailbox 3") },
+      { "mailbox-4", _("Mailbox 4") },
+      { "mailbox-5", _("Mailbox 5") },
+      { "mailbox-6", _("Mailbox 6") },
+      { "mailbox-7", _("Mailbox 7") },
+      { "mailbox-8", _("Mailbox 8") },
+      { "mailbox-9", _("Mailbox 9") },
+      { "mailbox-10", _("Mailbox 10") },
+      { "middle", _("Middle") },
+      { "my-mailbox", _("My Mailbox") },
+      { "rear", _("Rear Tray") },
+      { "right", _("Right Tray") },
+      { "side", _("Side Tray") },
+      { "stacker-1", _("Stacker 1") },
+      { "stacker-2", _("Stacker 2") },
+      { "stacker-3", _("Stacker 3") },
+      { "stacker-4", _("Stacker 4") },
+      { "stacker-5", _("Stacker 5") },
+      { "stacker-6", _("Stacker 6") },
+      { "stacker-7", _("Stacker 7") },
+      { "stacker-8", _("Stacker 8") },
+      { "stacker-9", _("Stacker 9") },
+      { "stacker-10", _("Stacker 10") },
+      { "top", _("Top Tray") },
+      { "tray-1", _("Tray 1") },
+      { "tray-2", _("Tray 2") },
+      { "tray-3", _("Tray 3") },
+      { "tray-4", _("Tray 4") },
+      { "tray-5", _("Tray 5") },
+      { "tray-6", _("Tray 6") },
+      { "tray-7", _("Tray 7") },
+      { "tray-8", _("Tray 8") },
+      { "tray-9", _("Tray 9") },
+      { "tray-10", _("Tray 10") }
+    };
+
+    cupsFilePrintf(fp, "*OpenUI *OutputBin: PickOne\n"
+                       "*OrderDependency: 10 AnySetup *OutputBin\n"
+                       "*DefaultOutputBin: %s\n", ppdname);
+    for (i = 0; i < (int)(sizeof(output_bins) / sizeof(output_bins[0])); i ++)
+    {
+      if (!ippContainsString(attr, output_bins[i][0]))
+        continue;
+
+      pwg_ppdize_name(output_bins[i][0], ppdname, sizeof(ppdname));
+
+      cupsFilePrintf(fp, "*OutputBin %s/%s: \"\"\n", ppdname, _cupsLangString(lang, output_bins[i][1]));
+    }
+    cupsFilePuts(fp, "*CloseUI: *OutputBin\n");
+  }
+
  /*
   * Finishing options...
   */