Summer Coding 2010 ideas - Unified ink level reporting

More information
The main page for Summer Coding 2010 ideas is Category:Summer Coding 2010 ideas.

Unified ink level reporting
There is already a single user interface in which CUPS "commands" can be sent to drivers and their output shown, and this is system-config-printer. While it could do with a little improvement, the main work will be in two of the larger printer drivers available as free software for Linux.

CUPS provides two mechanisms for reporting ink levels: course-grained, in which ink can be reported as "low" or "empty"; and fine-grained, in which the percentage of capacity for each marker is reported.

The way it works is that drivers either detect ink levels as part of their normal operation, or else are told to query the printer for ink levels using a special "CUPS command" print job. Once the ink levels are known, the drivers report them back to CUPS by writing specially-formatted text lines to their "standard error" file descriptor.

The main tasks in this idea are:


 * Adjust the existing escputil command from gutenprint so that it can use separate file descriptors for reading from and writing to the device
 * Convert escputil into a library so that the gutenprint raster driver can use it
 * Adjust the gutenprint raster driver to use it by changing the gutenprint CUPS command filters
 * Understand the various ways HP printers communicate their marker levels using IEEE 1284 Device ID fields (base/status.py)
 * Add low/empty marker detection to the hpcups driver that is part of the HPLIP project
 * Add fine-grained marker level detection to the hpcups driver