summaryrefslogtreecommitdiff
path: root/scheduler
diff options
context:
space:
mode:
authorMichael Sweet <michael.r.sweet@gmail.com>2017-11-28 12:59:45 -0500
committerMichael Sweet <michael.r.sweet@gmail.com>2017-11-28 12:59:45 -0500
commit4f63d6cdafa4052f52fa15e8fc97650c558d45b4 (patch)
tree15c75a74a4f770d695dbb20098d36c6933f21f1d /scheduler
parent27ee2c4dd70f4fc47d075b31ce37d1b1cacaa40e (diff)
Add support for finishings-col (Issue #5180)
- cups/ppd-cache.c: Look for cupsFinishingTemplate option, finishings-col-database attribute. Add finishings-col with finishing-template. - cups/ppd-private.h: Add array of finishing-template names. - scheduler/printers.c: Add finishings-col-database.
Diffstat (limited to 'scheduler')
-rw-r--r--scheduler/printers.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/scheduler/printers.c b/scheduler/printers.c
index 662c58c98..557d7514f 100644
--- a/scheduler/printers.c
+++ b/scheduler/printers.c
@@ -4098,17 +4098,10 @@ load_ppd(cupsd_printer_t *p) /* I - Printer */
input_slot = ppdFindMarkedChoice(ppd, "InputSlot");
media_type = ppdFindMarkedChoice(ppd, "MediaType");
col = new_media_col(pwgsize,
- input_slot ?
- _ppdCacheGetSource(p->pc,
- input_slot->choice) :
- NULL,
- media_type ?
- _ppdCacheGetType(p->pc,
- media_type->choice) :
- NULL);
-
- ippAddCollection(p->ppd_attrs, IPP_TAG_PRINTER, "media-col-default",
- col);
+ input_slot ? _ppdCacheGetSource(p->pc, input_slot->choice) : NULL,
+ media_type ? _ppdCacheGetType(p->pc, media_type->choice) : NULL);
+
+ ippAddCollection(p->ppd_attrs, IPP_TAG_PRINTER, "media-col-default", col);
ippDelete(col);
}
@@ -4698,6 +4691,22 @@ load_ppd(cupsd_printer_t *p) /* I - Printer */
}
}
+ if (p->pc && p->pc->templates)
+ {
+ const char *template; /* Finishing template */
+ ipp_attribute_t *fin_col_db; /* finishings-col-database attribute */
+ ipp_t *fin_col; /* finishings-col value */
+
+ fin_col_db = ippAddCollections(p->ppd_attrs, IPP_TAG_PRINTER, "finishings-col-database", cupsArrayCount(p->pc->templates), NULL);
+ for (i = 0, template = (const char *)cupsArrayFirst(p->pc->templates); template; i ++, template = (const char *)cupsArrayNext(p->pc->templates))
+ {
+ fin_col = ippNew();
+ ippAddString(fin_col, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "finishing-template", NULL, template);
+ ippSetCollection(p->ppd_attrs, &fin_col_db, i, fin_col);
+ ippDelete(fin_col);
+ }
+ }
+
for (i = 0; i < ppd->num_sizes; i ++)
if (ppd->sizes[i].length > 1728)
p->type |= CUPS_PRINTER_LARGE;