apple / cups

Apple CUPS Sources
https://www.cups.org
Apache License 2.0
1.95k stars 464 forks source link

Add IPP Everywhere PPD generator #4258

Closed michaelrsweet closed 9 years ago

michaelrsweet commented 11 years ago

Version: 2.1-feature CUPS.org User: mike

To fully support IPP Everywhere printers today, we need a PPD generator that will drive a traditional CUPS print queue. The PPD generator should query the IPP Everywhere printer, creating the necessary PPD options and values needed to support native PWG Raster, JPEG, and PDF printing.

michaelrsweet commented 11 years ago

CUPS.org User: mike

Note that this bug may end up closed depending on when we actually implement IPP Everywhere printing support since PPDs are a legacy implementation detail of the CUPS printing infrastructure - if we end up with a native set of IPP Everywhere-based filters then this PPD generator will be unnecessary...

michaelrsweet commented 10 years ago

CUPS.org User: till.kamppeter

The filter set for PPD-less printing on IPP Everywhere printers (PWG Raster, PDF, PostScript) is already in place in cups-filters 1.0.43 and cups-browsed is already capable of auto-creating appropriate queues. A client (print dialog) can ask the printer for available options and capabilities now and send PDF jobs with appropriate IPP attributes to these queues.

michaelrsweet commented 9 years ago

CUPS.org User: mike

First part of the equation: a private API for generating a PPD from the response of a Get-Printer-Attributes request.

Next up will be lpadmin and web interface support.

michaelrsweet commented 9 years ago

CUPS.org User: mike

Fixed in Subversion repository.

Second part.

michaelrsweet commented 9 years ago

"str4258p1.patch":

Index: cups/ppd-cache.c

--- cups/ppd-cache.c (revision 12508) +++ cups/ppd-cache.c (working copy) @@ -37,6 +37,7 @@ _pwg_finishings_t b); static void pwg_free_finishings(_pwg_finishings_t f); static void pwg_ppdize_name(const char ipp, char name, size_t namesize); +static void pwg_ppdize_resolution(ipp_attribute_t attr, int element, int xres, int yres, char name, size_t namesize); static void pwg_unppdize_name(const char ppd, char name, size_t namesize, const char *dashchars);

@@ -2782,6 +2783,479 @@

/*

Index: cups/ppd-private.h

--- cups/ppd-private.h (revision 12508) +++ cups/ppd-private.h (working copy) @@ -188,6 +188,7 @@ const char media_type); extern int _ppdCacheWriteFile(_ppd_cache_t pc, const char filename, ipp_t attrs); +extern char _ppdCreateFromIPP(char buffer, size_t bufsize, ipp_t response); extern void _ppdFreeLanguages(cups_array_t languages); extern cups_encoding_t _ppdGetEncoding(const char name); extern cups_array_t _ppdGetLanguages(ppd_file_t *ppd);

Index: cups/testppd.c

--- cups/testppd.c (revision 12508) +++ cups/testppd.c (working copy) @@ -3,7 +3,7 @@ *

michaelrsweet commented 9 years ago

"str4258p2.patch":

Index: cups/ppd-cache.c

--- cups/ppd-cache.c (revision 12510) +++ cups/ppd-cache.c (working copy) @@ -2815,6 +2815,9 @@

Index: cups/testppd.c

--- cups/testppd.c (revision 12510) +++ cups/testppd.c (working copy) @@ -901,6 +901,7 @@ puts("Unable to create PPD.");

 ippDelete(response);

+#define _CUPS_NO_DEPRECATED +#define _PPD_DEPRECATED

include <cups/cups-private.h>

@@ -32,6 +34,7 @@ static int delete_printer_option(http_t _http, char printer, char option); static int enable_printer(http_t http, char printer); +static char get_printer_ppd(const char uri, char buffer, size_t bufsize); static cups_ptype_t get_printer_type(http_t http, char printer, char uri, size_t urisize); static int set_printer_options(httpt http, char printer, @@ -55,7 +58,11 @@ *val; / Pointer to allow/deny value _/ int numoptions; / Number of options _/ cups_optiont *options; / Options */

@@ -812,7 +824,7 @@ DEBUG_printf(("default_printer(%p, \"%s\")\n", http, printer));

/*

@@ -863,7 +875,7 @@ DEBUG_printf(("delete_printer(%p, \"%s\")\n", http, printer));

/*

@@ -920,7 +932,7 @@ printer, pclass));

/*

@@ -983,7 +995,7 @@ if (members->num_values == 1) { /*

@@ -1066,7 +1078,7 @@

/*

@@ -1119,7 +1131,7 @@ DEBUG_printf(("enable_printer(%p, \"%s\")\n", http, printer));

/*

@@ -1161,6 +1173,63 @@

/*

@@ -1189,7 +1258,7 @@

httpAssembleURIf(HTTP_URI_CODING_ALL, uri, (int)urisize, "ipp", NULL, "localhost", ippPort(), "/printers/%s", printer);

@@ -1292,14 +1366,7 @@ NULL, "tbcp"); }

- ppdfile = NULL;

Index: xcode/CUPS.xcodeproj/project.pbxproj

--- xcode/CUPS.xcodeproj/project.pbxproj (revision 12508) +++ xcode/CUPS.xcodeproj/project.pbxproj (working copy) @@ -31,6 +31,7 @@ buildPhases = ( ); dependencies = (

michaelrsweet commented 9 years ago

"str4258p3.patch":

Index: cgi-bin/admin.c

--- cgi-bin/admin.c (revision 12514) +++ cgi-bin/admin.c (working copy) @@ -3,7 +3,7 @@ *

-static void choose_device_cb(const char *device_class,

@@ -4198,5 +4204,78 @@

/*

@@ -3209,6 +3216,35 @@ else cupsFilePuts(fp, "*cupsBackSide: Rotated\n"); }