michaelrsweet / pappl

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

IPP INFRA/SYSTEM Server Support #47

Open michaelrsweet opened 4 years ago

michaelrsweet commented 4 years ago

Add support for IPP INFRA (PWG 5100.18) and SYSTEM (PWG 5100.22) to function as an infrastructure printer. Tasks:

michaelrsweet commented 10 months ago

Tracking development on the infra branch...

michaelrsweet commented 10 months ago

Proposed API:

enum pappl_soptions_e           // System option bits
{
  ...
  PAPPL_SOPTIONS_INFRA_PROXY = 0x2000,      // Enable shared infrastructure proxy features
  PAPPL_SOPTIONS_INFRA_SERVER = 0x4000      // Enable shared infrastructure printer/system features
};

typedef pappl_printer_t *(*pappl_pr_register_cb_t)(pappl_client_t *client, const char *device_uuid, void *data);
                    // Infrastructure printer registration callback function

extern void     papplPrinterAddInfraDevice(pappl_printer_t *printer, const char *device_uuid) _PAPPL_PUBLIC;
extern bool     papplPrinterAddInfraProxy(pappl_printer_t *printer, const char *uri) _PAPPL_PUBLIC;
extern pappl_printer_t  *papplPrinterCreateInfra(pappl_system_t *system, int printer_id, const char *printer_name, size_t num_device_uuids, const char * const *device_uuids) _PAPPL_PUBLIC;
extern char     **papplPrinterGetInfraDevices(pappl_printer_t *printer, size_t *num_devices) _PAPPL_PUBLIC;
extern char     **papplPrinterGetInfraProxies(pappl_printer_t *printer, size_t *num_proxies) _PAPPL_PUBLIC;
extern void     papplPrinterRemoveInfraDevice(pappl_printer_t *printer, const char *device_uuid) _PAPPL_PUBLIC;
extern void     papplPrinterRemoveInfraProxy(pappl_printer_t *printer, const char *printer_uri) _PAPPL_PUBLIC;

extern pappl_printer_t  *papplSystemFindInfraPrinter(pappl_system_t *system, const char *device_uuid) _PAPPL_PUBLIC;
extern void     papplSystemSetRegisterCallback(pappl_system_t *system, pappl_pr_register_cb_t cb, void *data) _PAPPL_PUBLIC;
michaelrsweet commented 9 months ago

OK, so some of the INFRA implementation has to deal with how to combine the capabilities of multiple output devices for a single INFRA printer. Typically this falls into the category of a union or intersection of capabilities, with potentially some additional filtering, i.e., a site might want to limit the kinds of media that are supported.