-
-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non-Static Drivers - Printers with Installable Accessories #107
Comments
@tillkamppeter Do this initialization the first time your status callback is called - you are allowed to call the papplPrinterSetDriverData function to update the printer attributes, as needed. |
I have now done a quick test when the status callback gets called. Unfortunately it gets only called if there is an IPP request from a client. I have stopped |
@tillkamppeter I think calling the status callback from |
I got the "Installable Options" support for the PostScript Printer Application completely working now. With the call of the status callback after loading a printer's entry it works perfectly. Thank you very much. |
When a printer is set up, it gets assigned a named driver. Usually, there is one driver for each printer model or a class of drivers for each printer model.
For this driver the Printer Application fills in a driver data structure of type
pappl_pr_driver_data_t
with information about available resolutions, trays, paper sizes, ... when creating the printer and on every start of the Printer Application. For most, especially low-end printers this works, but for high-end printers we run into a problem: These printers often support optional accessories, like extra trays, duplexer, finishers, ... The combination of accessories actually installed would lead to different driver data on the same printer model and one cannot create a "model" for each combination of accessories, as 7 accessories would lead to 2^7 = 128 "models" for one actual printer model.High-end printers are either PostScript printers or IPP printers:
The PostScript Printer Application is supposed to emulate an IPP printer behaving as in (1) as good as possible, having a PostScript printer and PPD file as of (2). Automatic setup or manual setup of the printer via "Add printer" only finds the make and model of the printer and assigns a PPD file to it. The driver setup
ps_setup_driver()
then parses the PPD file and fills in the driver data structure, including vendor-specific options. All this depends only on the static PPD file, not on the individual default setting configuration of the state file, so also not taking into account the accessory configuration when it is saved in one or more (invisible) vendor options as proposed in issue #91 and for creating the driver data correctly, the accessory configuration needs to be known. The driver data needs to reflect the exact configuration of the printer to produce a correct answer to a get-printer-attributes IPP request from a client.This is because
papplSystemLoadState()
loads the state file line by line and when a printer header comes, it callspapplPrinterCreate()
and only after that it loads the following lines with the default settings. What would be needed here is that when the end of the printer entry in the state file is reached a callback would be called. This could update the driver data depending on the default settings, for example removing trays which are no actually installed, from the media sources, removing the double-sided duplex settings if there is no duplexer, ... The callback could load the driver data withpapplPrinterGetDriverData()
andpapplPrinterGetDriverAttributes()
update it and write it back withpapplPrinterSetDriverData()
.So my feature request here is to have an appropriate callback function call added to the end of
papplSystemLoadState()
.For reference, the commit in the PostScript Printer Application with the "Installable Options" work done is here.
The text was updated successfully, but these errors were encountered: