libkcups: Add new functions using modern CUPS api
Here we are adopting all new apis and getting rid of all the old deprecated apis. Also, looking at a new method for device notification for libkcups clients.
- Use cupsEnumDests to get printers. This is the recommended api for moving away from the deprecated CUPS apis that will be removed in CUPS 3.x.
- Use cupsCopyDestInfo to get PPD files. This is the recommended api for CUPS 3.x for moving from deprecated CUPS api getPPD2.
- Add an method to get printer attributes via a signal instead of loading a list. This can then be used by models to add or update model items.
Pattern change
Will the older apis, the request creates printer objects and populates a local printer list. The request then notifies the client that the list is there. Then, the client copies that list from the request, and finally deletes the request.
The new apis (KCupsRequest::getDestination/::getPrinterAttributesNotify) use the new CUPS apis above to get available printer devices and device attributes. In addtion, instead of populating/updating an internal list and notifying, the new callback notifies the request client for each device. The client can then directly handle each device (models, lists) and on finish, delete request.
Part of: #17
This is to support the MR !211.
Co-authored-by: Mike Noe <noeerover@gmail.com>