michaelrsweet / pappl

PAPPL - Printer Application Framework
https://www.msweet.org/pappl
Apache License 2.0
309 stars 49 forks source link

API: papplSystemCreatePrinters, PAPPL-Create-Printers IPP operation #245

Closed michaelrsweet closed 1 year ago

michaelrsweet commented 1 year ago

Experience has shown that existing printer applications all have some variation of the "autoadd" sub-command built into them. Proposed API:

extern bool papplSystemCreatePrinters(pappl_system_t *system, pappl_devtype_t types, pappl_pr_create_cb_t cb, void *cb_data);

This function lists devices of the specified types and attempts to add any new devices using the current printer drivers. If not NULL, the specified callback function is called for each printer that is created.

A corresponding IPP vendor operation ("PAPPL-Create-Printers") can also be registered with the PWG to allow the "autoadd" sub-command to request the server to create printers via the proposed API. Request attributes:

Group 1: Operation attributes:
  "attributes-charset (charset)"
  "attributes-natural-language (naturalLanguage)"
  "system-uri (uri)"
  "smi55357-device-type (1setOf keyword)"

Response attributes:

Group 1: Operation attributes:
  "attributes-charset (charset)"
  "attributes-natural-language (naturalLanguage)"

Groups 2-N: Printer attributes (one per printer created):
  "printer-name (name(127))"
  "printer-state (type1 enum)"
  "printer-state-reasons (1setOf type2 keyword)"
  "printer-xri-supported (1setOf collection)"
michaelrsweet commented 1 year ago

[master 8e0f4c1] Register and document PAPPL-Create-Printers operation (Issue #245)

michaelrsweet commented 1 year ago

[master 5b1b3e5] Implement PAPPL-Create-Printers operation (Issue #245)

michaelrsweet commented 1 year ago

[master baa108b] Refactor Create-Printers/Find-Devices code (Issue #245)

michaelrsweet commented 1 year ago

[master cae49bf] Implement papplSystemCreatePrinters API (Issue #245)

michaelrsweet commented 1 year ago

[master 3d6d9f4] Finish up implementation of new API and use it for autoadd command (Issue #245)

[master fcd0b94] Auto-add local printers the first time a printer application is run.