diff -up gutenprint-5.2.4/include/gutenprint/printers.h.deviceid gutenprint-5.2.4/include/gutenprint/printers.h --- gutenprint-5.2.4/include/gutenprint/printers.h.deviceid 2008-06-03 12:40:39.000000000 +0100 +++ gutenprint-5.2.4/include/gutenprint/printers.h 2009-09-01 09:11:54.774964164 +0100 @@ -83,6 +83,14 @@ extern const stp_printer_t *stp_get_prin extern const stp_printer_t *stp_get_printer_by_driver(const char *driver); /** + * Get a printer model by its IEEE 1284 device ID. + * @param device_id the printer model's device ID. + * @returns a pointer to the printer model, or NULL on failure. The + * pointer should not be freed. + */ +extern const stp_printer_t *stp_get_printer_by_device_id(const char *device_id); + +/** * Get the printer model from a vars object. * @param v the vars to use. * @returns a pointer to the printer model, or NULL on failure. The @@ -113,6 +121,13 @@ extern const char *stp_printer_get_long_ extern const char *stp_printer_get_driver(const stp_printer_t *p); /** + * Get a printer model's IEEE 1284 device ID, if known. + * @param p the printer model to use. + * @returns the IEEE 1284 device ID, or NULL if not known. + */ +extern const char *stp_printer_get_device_id(const stp_printer_t *p); + +/** * Get a printer model's family name. * The family name is the name of the modular "family" driver this * model uses. diff -up gutenprint-5.2.4/src/cups/genppd.c.deviceid gutenprint-5.2.4/src/cups/genppd.c --- gutenprint-5.2.4/src/cups/genppd.c.deviceid 2009-07-18 01:55:45.000000000 +0100 +++ gutenprint-5.2.4/src/cups/genppd.c 2009-09-01 09:11:54.778963376 +0100 @@ -358,30 +358,34 @@ list_ppds(const char *argv0) /* I - Nam for (i = 0; i < stp_printer_model_count(); i++) if ((printer = stp_get_printer_by_index(i)) != NULL) { + const char *device_id; if (!strcmp(stp_printer_get_family(printer), "ps") || !strcmp(stp_printer_get_family(printer), "raw")) continue; + device_id = stp_printer_get_device_id(printer); printf("\"%s://%s/expert\" " "%s " "\"%s\" " "\"%s" CUPS_PPD_NICKNAME_STRING VERSION "\" " - "\"\"\n", /* No IEEE-1284 Device ID yet */ + "\"%s\"\n", scheme, stp_printer_get_driver(printer), "en", stp_printer_get_manufacturer(printer), - stp_printer_get_long_name(printer)); + stp_printer_get_long_name(printer), + device_id ? device_id : ""); #ifdef GENERATE_SIMPLIFIED_PPDS printf("\"%s://%s/simple\" " "%s " "\"%s\" " "\"%s" CUPS_PPD_NICKNAME_STRING VERSION " Simplified\" " - "\"\"\n", /* No IEEE-1284 Device ID yet */ + "\"%s\"\n", scheme, stp_printer_get_driver(printer), "en", stp_printer_get_manufacturer(printer), - stp_printer_get_long_name(printer)); + stp_printer_get_long_name(printer), + device_id ? device_id : ""); #endif } @@ -925,6 +929,7 @@ write_ppd( int model; /* Internal model ID */ const char *long_name; /* Driver long name */ const char *manufacturer; /* Manufacturer of printer */ + const char *device_id; /* IEEE1284 device ID */ const stp_vars_t *printvars; /* Printer option names */ paper_t *the_papers; /* Media sizes */ int cur_opt; /* Current option */ @@ -957,6 +962,7 @@ write_ppd( model = stp_printer_get_model(p); long_name = stp_printer_get_long_name(p); manufacturer = stp_printer_get_manufacturer(p); + device_id = stp_printer_get_device_id(p); printvars = stp_printer_get_defaults(p); the_papers = NULL; cur_opt = 0; @@ -1079,6 +1085,8 @@ write_ppd( gzprintf(fp, "*cupsFilter: \"application/vnd.cups-raster 100 rastertogutenprint.%s\"\n", GUTENPRINT_RELEASE_VERSION); if (strcasecmp(manufacturer, "EPSON") == 0) gzputs(fp, "*cupsFilter: \"application/vnd.cups-command 33 commandtoepson\"\n"); + if (device_id) + gzprintf(fp, "*1284DeviceID: \"%s\"\n", device_id); if (!language) { /* diff -up gutenprint-5.2.4/src/main/printers.c.deviceid gutenprint-5.2.4/src/main/printers.c --- gutenprint-5.2.4/src/main/printers.c.deviceid 2009-06-08 02:27:38.000000000 +0100 +++ gutenprint-5.2.4/src/main/printers.c 2009-09-01 09:11:54.790088434 +0100 @@ -65,6 +65,7 @@ struct stp_printer char *long_name; /* Long name for UI */ char *family; /* Printer family */ char *manufacturer; /* Printer manufacturer */ + char *device_id; /* IEEE 1284 device ID */ int model; /* Model number */ int vars_initialized; const stp_printfuncs_t *printfuncs; @@ -187,6 +188,12 @@ stpi_printer_long_namefunc(const void *i } const char * +stp_printer_get_device_id(const stp_printer_t *printer) +{ + return printer->device_id; +} + +const char * stp_printer_get_family(const stp_printer_t *printer) { return printer->family; @@ -243,6 +250,30 @@ stp_get_printer_by_driver(const char *dr return (const stp_printer_t *) stp_list_item_get_data(printer_item); } +const stp_printer_t * +stp_get_printer_by_device_id(const char *device_id) +{ + stp_list_item_t *printer_item; + if (printer_list == NULL) + { + stp_erprintf("No printer drivers found: " + "are STP_DATA_PATH and STP_MODULE_PATH correct?\n"); + stpi_init_printer_list(); + } + if (! device_id || strcmp(device_id, "") == 0) + return NULL; + + printer_item = stp_list_get_start(printer_list); + while (printer_item) + { + if (strcmp(((const stp_printer_t *) stp_list_item_get_data(printer_item)), + device_id) == 0) + return ((const stp_printer_t *) stp_list_item_get_data(printer_item)); + printer_item = stp_list_item_next(printer_item); + } + return NULL; +} + int stp_get_printer_index_by_driver(const char *driver) { @@ -1054,6 +1085,9 @@ stp_printer_create_from_xmltree(stp_mxml outprinter->manufacturer = stp_strdup(stp_mxmlElementGetAttr(printer, "manufacturer")); outprinter->model = stp_xmlstrtol(stp_mxmlElementGetAttr(printer, "model")); outprinter->family = stp_strdup((const char *) family); + stmp = stp_mxmlElementGetAttr(printer, "deviceid"); + if (stmp) + outprinter->device_id = stp_strdup(stmp); if (stp_get_driver(outprinter->printvars)) driver = 1; diff -up gutenprint-5.2.4/src/main/print-escp2.c.deviceid gutenprint-5.2.4/src/main/print-escp2.c --- gutenprint-5.2.4/src/main/print-escp2.c.deviceid 2009-07-21 12:07:06.000000000 +0100 +++ gutenprint-5.2.4/src/main/print-escp2.c 2009-09-01 09:11:54.786088370 +0100 @@ -922,7 +922,7 @@ static const int_param_t int_parameters[ { { { - "QualityEnhancement", N_("Quality Enhancement"), N_("Advanced Printer Functionality"), + "BandEnhancement", N_("Quality Enhancement"), N_("Advanced Printer Functionality"), N_("Enhance print quality by additional passes"), STP_PARAMETER_TYPE_INT, STP_PARAMETER_CLASS_FEATURE, STP_PARAMETER_LEVEL_ADVANCED2, 0, 1, STP_CHANNEL_NONE, 1, 0 diff -up gutenprint-5.2.4/src/xml/printers.xml.deviceid gutenprint-5.2.4/src/xml/printers.xml --- gutenprint-5.2.4/src/xml/printers.xml.deviceid 2009-06-24 02:19:54.000000000 +0100 +++ gutenprint-5.2.4/src/xml/printers.xml 2009-09-01 09:11:39.044962200 +0100 @@ -90,39 +90,39 @@ 1.3 - - - - - + + + + + - - + + - + - + - - + + - + - + - + - + - + @@ -199,46 +199,46 @@ - + - - + + - + - - - - - - - - - - + + + + + + + + + + - + - + - - - + + + - - + + - - - + + + - + @@ -248,29 +248,29 @@ - - - + + + - + - + - - - - + + + + - + - - + + - + @@ -284,31 +284,31 @@ - - + + - + - - + + - - - + + + - + - - - - + + + + - + @@ -320,9 +320,9 @@ - - - + + + @@ -332,10 +332,10 @@ - - - - + + + + @@ -345,12 +345,12 @@ - - - - - - + + + + + + @@ -358,13 +358,13 @@ - - + + - + @@ -383,62 +383,62 @@ - - - - - - - - - - - - + + + + + + + + + + + + - - - - + + + + - + - - + + - - + + - + - - + + - - - - + + + + - - + + - - + + - - + + - + @@ -604,7 +604,7 @@ - + @@ -617,38 +617,38 @@ - + - + - - - + + + - - - - + + + + - - + + - - - - - - + + + + + + - + @@ -659,7 +659,7 @@ - + @@ -669,21 +669,21 @@ - + - + - + - + - + @@ -759,17 +759,17 @@ - - - - - + + + + + - + - - - + + + @@ -786,9 +786,9 @@ - + - + @@ -796,84 +796,84 @@ - + - + - - - + + + - - + + - - + + - + - + - + - - - - + + + + - - - - - - - - - + + + + + + + + + - - + + - + - + - + - + - - + + - - + + - + - + - + - + @@ -883,173 +883,173 @@ - + - + - + - - - + + + - - - - - - + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - + + - - + + - + - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - + + + - - - + + + - - + + - - + + - + @@ -1100,52 +1100,52 @@ - + - - - - + + + + - - - - + + + + - + - - + + - - - + + + - + - - - - - + + + + + - - + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + @@ -1202,21 +1202,21 @@ - + - + - - - - + + + + - + - + @@ -1277,20 +1277,20 @@ - - - - - - - + + + + + + + - + @@ -1351,7 +1351,7 @@ - + @@ -1375,7 +1375,7 @@ - + @@ -1428,9 +1428,9 @@ - + - + @@ -1439,11 +1439,11 @@ - - - + + + - + @@ -1452,10 +1452,10 @@ 2.0 - - + + - +