pappl icon indicating copy to clipboard operation
pappl copied to clipboard

Scanning: Scanner object, driver Interface, etc.

Open michaelrsweet opened this issue 3 years ago • 3 comments

In order to support multi-function devices and standalone scanners, PAPPL should provide APIs, interfaces, and objects for scanning, with the goal of providing IPP Scan and/or eSCL protocol endpoints (eSCL is used for AirPrint and Mopria, IPP Scan is a published but otherwise unused standard that has the needed semantics/data elements) that can be linked to a printer object and/or used separately.

Specific sub-tasks:

  • [ ] Implement pappl_scanner_t object based on pappl_printer_t (adapted to the needs of scanning - 90% duplication here)
  • [ ] Update pappl_job_t object to support print or scan jobs (add a pointer to pappl_scanner_t)
  • [ ] Implement pappl_sc_driver_data_t structure based on pappl_pr_driver_data_t, with corresponding callback functions using the pappl_sc_ prefix. For the purposes of PAPPL scanning, do not support vendor options.
  • [ ] Implement pappl_sc_options_t structure based on pappl_pr_options_t. For the purposes of PAPPL scanning, do not support vendor options.
  • [ ] Add scanner.h header with public API and scanner-private.h header with private API using appropriately-named header guard macros. These can be patterned after the corresponding printer headers.
  • [ ] Add scanner.c file that provides the scanner object constructor and destructor.
  • [ ] Add scanner-accessors.c file that provides the scanner object accessor (get/set) functions, patterned on printer-accessors.c
  • [ ] Add scanner-driver.c file that provides the scan driver interfaces and attributes, patterned on printer-driver.c.
  • [ ] Add scanner-webif.c file that provides scan-specific web pages.
  • [ ] Add job-scan.c file that provides scan job processing functions.
  • [ ] Add papplPrinterSetScanner API to set the scanner associated with a printer
  • [ ] Add papplSystemSetScannerDrivers API to set the list of scanner drivers, callback, etc.
  • [ ] Add pappl_sc_autoadd_cb_t, pappl_sc_create_cb_t, pappl_sc_driver_cb_t, and pappl_scanner_cb_t callbacks to system.h.

Need to think about how to auto-associate scanners in printers.

michaelrsweet avatar Jan 18 '21 16:01 michaelrsweet

@michaelrsweet @tillkamppeter new PR opened : #349

Commit 7190a0bc2ba9e9bd771dba9499a78a6845aae17e solves:

  • [x] Implement pappl_scanner_t object based on pappl_printer_t (adapted to the needs of scanning - 90% duplication here)
  • [x] Implement pappl_sc_driver_data_t structure based on pappl_pr_driver_data_t, with corresponding callback functions using the pappl_sc_ prefix. For the purposes of PAPPL scanning, do not support vendor options.
  • [x] Implement pappl_sc_options_t structure based on pappl_pr_options_t. For the purposes of PAPPL scanning, do not support vendor options.
  • [x] Add scanner.h header with public API and scanner-private.h header with private API using appropriately-named header guard macros. These can be patterned after the corresponding printer headers.

Please review the above in detail.

Kappuccino111 avatar Mar 09 '24 21:03 Kappuccino111

Commit e24d9e3357f470f0cc5f6242b4d90057bbbdf3bf marks this as done

  • [x] Update pappl_job_t object to support print or scan jobs (add a pointer to pappl_scanner_t)

Kappuccino111 avatar Mar 22 '24 18:03 Kappuccino111

Commit 317300f166f8fe61105cb94619dc649bb415e59f marks this as done

  • [x] Add scanner-accessors.c file that provides the scanner object accessor (get/set) functions, patterned on printer-accessors.c

Kappuccino111 avatar Mar 22 '24 18:03 Kappuccino111