diff options
author | Didier Raboud <odyx@debian.org> | 2017-06-19 08:38:07 +0200 |
---|---|---|
committer | Didier Raboud <odyx@debian.org> | 2017-06-19 08:38:07 +0200 |
commit | aedf3e93e811c6c9d504274172861d266e1c5c97 (patch) | |
tree | 95e525108c5b6bd2ea3fa689cf11bfe4a5b982a9 /src | |
parent | 7bd83d89975d166521a0b326b64b4cad80117750 (diff) |
New upstream version 5.2.13~pre1
Diffstat (limited to 'src')
65 files changed, 2862 insertions, 976 deletions
diff --git a/src/Makefile.in b/src/Makefile.in index 19d2f2a..078e2c4 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -197,9 +197,11 @@ BZIP2 = @BZIP2@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +COMPRESS = @COMPRESS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSUF = @CSUF@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LIBS = @CUPS_LIBS@ @@ -258,6 +260,7 @@ GUTENPRINT_MICRO_VERSION = @GUTENPRINT_MICRO_VERSION@ GUTENPRINT_MINOR_VERSION = @GUTENPRINT_MINOR_VERSION@ GUTENPRINT_RELEASE_VERSION = @GUTENPRINT_RELEASE_VERSION@ GUTENPRINT_VERSION = @GUTENPRINT_VERSION@ +GZIP = @GZIP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -283,6 +286,7 @@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ +LRZIP = @LRZIP@ LTALLOCA = @LTALLOCA@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ @@ -310,6 +314,7 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ +PKGROOT = @PKGROOT@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ @@ -318,6 +323,7 @@ POSUB = @POSUB@ RANLIB = @RANLIB@ RELEASE_DATE = @RELEASE_DATE@ RM = @RM@ +RZIP = @RZIP@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ @@ -330,6 +336,7 @@ VERSION = @VERSION@ WHICH_PPDS = @WHICH_PPDS@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ +XZ = @XZ@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ diff --git a/src/cups/Makefile.in b/src/cups/Makefile.in index cf76ab2..27bcc47 100644 --- a/src/cups/Makefile.in +++ b/src/cups/Makefile.in @@ -492,9 +492,11 @@ BZIP2 = @BZIP2@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +COMPRESS = @COMPRESS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSUF = @CSUF@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LIBS = @CUPS_LIBS@ @@ -553,6 +555,7 @@ GUTENPRINT_MICRO_VERSION = @GUTENPRINT_MICRO_VERSION@ GUTENPRINT_MINOR_VERSION = @GUTENPRINT_MINOR_VERSION@ GUTENPRINT_RELEASE_VERSION = @GUTENPRINT_RELEASE_VERSION@ GUTENPRINT_VERSION = @GUTENPRINT_VERSION@ +GZIP = @GZIP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -578,6 +581,7 @@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ +LRZIP = @LRZIP@ LTALLOCA = @LTALLOCA@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ @@ -605,6 +609,7 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ +PKGROOT = @PKGROOT@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ @@ -613,6 +618,7 @@ POSUB = @POSUB@ RANLIB = @RANLIB@ RELEASE_DATE = @RELEASE_DATE@ RM = @RM@ +RZIP = @RZIP@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ @@ -625,6 +631,7 @@ VERSION = @VERSION@ WHICH_PPDS = @WHICH_PPDS@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ +XZ = @XZ@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ diff --git a/src/cups/backend_canonselphy.c b/src/cups/backend_canonselphy.c index 4d7e6d0..501cb0a 100644 --- a/src/cups/backend_canonselphy.c +++ b/src/cups/backend_canonselphy.c @@ -369,11 +369,11 @@ static struct printer_data selphy_printers[] = { .model = "SELPHY CP Series (!CP-10/CP790)", .init_length = 12, .foot_length = 0, /* CP900 has four-byte NULL footer that can be safely ignored */ - .init_readback = { 0x01, 0x00, 0x00, 0x00, -1, 0x00, -1, 0x00, 0x00, 0x00, 0x00, -1 }, - .ready_y_readback = { 0x02, 0x00, 0x00, 0x00, 0x70, 0x00, -1, 0x00, 0x00, 0x00, 0x00, -1 }, - .ready_m_readback = { 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -1, 0x00, 0x00, 0x00, 0x00, -1 }, - .ready_c_readback = { 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, -1, 0x00, 0x00, 0x00, 0x00, -1 }, - .done_c_readback = { 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, -1, 0x00, 0x00, 0x00, 0x00, -1 }, + .init_readback = { 0x01, 0x00, 0x00, 0x00, -1, 0x00, -1, -1, 0x00, 0x00, 0x00, -1 }, + .ready_y_readback = { 0x02, 0x00, 0x00, 0x00, 0x70, 0x00, -1, -1, 0x00, 0x00, 0x00, -1 }, + .ready_m_readback = { 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -1, -1, 0x00, 0x00, 0x00, -1 }, + .ready_c_readback = { 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, -1, -1, 0x00, 0x00, 0x00, -1 }, + .done_c_readback = { 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, -1, -1, 0x00, 0x00, 0x00, -1 }, .clear_error = { 0x40, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, .clear_error_len = 12, .pgcode_offset = 3, @@ -535,7 +535,7 @@ done: return printer_type; } -/* Private data stucture */ +/* Private data structure */ struct canonselphy_ctx { struct libusb_device_handle *dev; uint8_t endp_up; @@ -1051,7 +1051,7 @@ static void canonselphy_cmdline(void) struct dyesub_backend canonselphy_backend = { .name = "Canon SELPHY CP/ES", - .version = "0.92", + .version = "0.93", .uri_prefix = "canonselphy", .cmdline_usage = canonselphy_cmdline, .cmdline_arg = canonselphy_cmdline_arg, @@ -1166,7 +1166,7 @@ struct dyesub_backend canonselphy_backend = { 08 00 03 00 [pg] 00 [pg2] [xx] 00 00 00 00 [? transitions to this] 09 00 07 00 [pg] 00 [pg2] [xx] 00 00 00 00 [ready for C] 09 00 00 00 [pg] 00 [pg2] 00 00 00 00 00 [? transitions to this] - 0b 00 00 00 [pg] 00 [pg2] 00 00 00 00 00 [? transisions to this] + 0b 00 00 00 [pg] 00 [pg2] 00 00 00 00 00 [? transitions to this] 0c 00 00 00 [pg] 00 [pg2] 00 00 00 00 00 [? transitions to this] 0f 00 00 00 [pg] 00 [pg2] 00 00 00 00 00 [? transitions to this] 13 00 00 00 [pg] 00 [pg2] 00 00 00 00 00 [? transitions to this] @@ -1338,7 +1338,7 @@ struct dyesub_backend canonselphy_backend = { 01 00 00 00 00 00 00 00 00 00 00 00 [idle, waiting for init] 02 00 00 00 00 00 00 00 00 00 00 00 [init sent, paper feeding] - 02 00 00 00 00 00 00 00 00 00 00 00 [init sent, paper feeding] + 02 00 00 00 00 00 00 00 00 00 00 00 [init sent, paper feeding] 02 00 00 00 00 00 00 00 00 00 00 00 [waiting for Y data] 04 00 00 00 00 00 00 00 00 00 00 00 [waiting for M data] 08 00 00 00 00 00 00 00 00 00 00 00 [waiting for C data] @@ -1373,14 +1373,14 @@ struct dyesub_backend canonselphy_backend = { Known readback values: - 01 00 00 00 [ss] 00 [pg] 00 00 00 00 [xx] [idle, waiting for init] - 02 00 [rr] 00 00 00 [pg] 00 00 00 00 [xx] [init sent, paper feeding] - 02 00 [rr] 00 10 00 [pg] 00 00 00 00 [xx] [init sent, paper feeding] - 02 00 [rr] 00 70 00 [pg] 00 00 00 00 [xx] [waiting for Y data] - 04 00 00 00 00 00 [pg] 00 00 00 00 [xx] [waiting for M data] - 08 00 00 00 00 00 [pg] 00 00 00 00 [xx] [waiting for C data] - 10 00 00 00 00 00 [pg] 00 00 00 00 [xx] [C done, waiting] - 20 00 00 00 00 00 [pg] 00 00 00 00 [xx] [All done] + 01 00 00 00 [ss] 00 [pg] [zz] 00 00 00 [xx] [idle, waiting for init] + 02 00 [rr] 00 00 00 [pg] [zz] 00 00 00 [xx] [init sent, paper feeding] + 02 00 [rr] 00 10 00 [pg] [zz] 00 00 00 [xx] [init sent, paper feeding] + 02 00 [rr] 00 70 00 [pg] [zz] 00 00 00 [xx] [waiting for Y data] + 04 00 00 00 00 00 [pg] [zz] 00 00 00 [xx] [waiting for M data] + 08 00 00 00 00 00 [pg] [zz] 00 00 00 [xx] [waiting for C data] + 10 00 00 00 00 00 [pg] [zz] 00 00 00 [xx] [C done, waiting] + 20 00 00 00 00 00 [pg] [zz] 00 00 00 [xx] [All done] [xx] is 0x01 on the CP780/CP800/CP900, 0x00 on all others. @@ -1405,51 +1405,6 @@ struct dyesub_backend canonselphy_backend = { 0x41 if the 'Wide' paper tray is loaded with a 'P' ribbon. A '0' is used to signify nothing being loaded. - *************************************************************************** - Selphy CP820/CP910/CP1000/CP1200: - - Radically different spool file format! 300dpi, same print sizes, but also - adding a 50x50mm sticker and 22x17.3mm ministickers, though I think the - driver treats all of those as 'C' sizes for printing purposes. - - Printer does *not* require use of a spooler! Huzzah! - - 32-byte header: - - 0f 00 00 40 00 00 00 00 00 00 00 00 00 00 01 00 - 01 00 ?? 00 00 00 00 00 XX 04 00 00 WW ZZ 00 00 - - ?? == 50 (P) - == 4c (L) - == 43 (C) - - XX == e0 (P) - 80 (L) - 40 (C) - - WW == 50 (P) - c0 (L) - 9c (C) - - ZZ == 07 (P) - 05 (L) - 02 (C) - - P == 7008800 == 2336256 * 3 + 32 (1872*1248) - L == 5087264 == 1695744 * 3 + 32 (1536*1104) - C == 2180384 == 726784 * 3 + 32 (1088*668) - - It is worth mentioning that the image payload is Y'CbCr rather than the - traditional YMC (or even BGR) of other dyseubs. Our best guess is that - we need to use the JPEG coefficients, although we realistically have - no way of confirming this. - - It is hoped that the printers do support YMC data, but as of yet we - have no way of determining if this is possible. - - Also, we have reports of the printer not quite behaving properly - in the face of multiple jobs; it's possible this thing may need a - backend after all, but more sniffs will need to be performed to determine - what the status readbacks (if any) mean. + [zz] is 0x01 when on battery power, 0x00 otherwise. */ diff --git a/src/cups/backend_canonselphyneo.c b/src/cups/backend_canonselphyneo.c index c29cbe6..e72b9db 100644 --- a/src/cups/backend_canonselphyneo.c +++ b/src/cups/backend_canonselphyneo.c @@ -41,7 +41,7 @@ /* Exported */ #define USB_VID_CANON 0x04a9 -#define USB_PID_CANON_CP820 XXX +#define USB_PID_CANON_CP820 0x327b #define USB_PID_CANON_CP910 0x327a #define USB_PID_CANON_CP1000 0x32ae #define USB_PID_CANON_CP1200 0x32b1 @@ -58,7 +58,7 @@ struct selphyneo_readback { uint8_t data[12]; } __attribute((packed)); -/* Private data stucture */ +/* Private data structure */ struct selphyneo_ctx { struct libusb_device_handle *dev; uint8_t endp_up; @@ -97,6 +97,8 @@ static char *selphyneo_errors(uint8_t err) return "Paper Feed"; case 0x03: return "No Paper"; + case 0x06: + return "Ink Cassette Empty"; case 0x07: return "No Ink"; case 0x09: @@ -388,7 +390,7 @@ static void selphyneo_cmdline(void) struct dyesub_backend canonselphyneo_backend = { .name = "Canon SELPHY CPneo", - .version = "0.06", + .version = "0.08", .uri_prefix = "canonselphyneo", .cmdline_usage = selphyneo_cmdline, .cmdline_arg = selphyneo_cmdline_arg, @@ -398,7 +400,7 @@ struct dyesub_backend canonselphyneo_backend = { .read_parse = selphyneo_read_parse, .main_loop = selphyneo_main_loop, .devices = { -// { USB_VID_CANON, USB_PID_CANON_CP820, P_CP910, ""}, + { USB_VID_CANON, USB_PID_CANON_CP820, P_CP910, ""}, { USB_VID_CANON, USB_PID_CANON_CP910, P_CP910, ""}, { USB_VID_CANON, USB_PID_CANON_CP1000, P_CP910, ""}, { USB_VID_CANON, USB_PID_CANON_CP1200, P_CP910, ""}, @@ -421,7 +423,7 @@ struct dyesub_backend canonselphyneo_backend = { 32-byte header: 0f 00 00 40 00 00 00 00 00 00 00 00 00 00 01 00 - 01 00 TT 00 00 00 00 00 XX XX XX XX YY YY YY YY + 01 00 TT 00 00 00 00 ZZ XX XX XX XX YY YY YY YY cols (le32) rows (le32) 50 e0 04 50 07 1248 * 1872 (P) @@ -432,19 +434,17 @@ struct dyesub_backend canonselphyneo_backend = { == 4c (L) == 43 (C) + ZZ == 00 Y'CbCr data follows + == 01 CMY data follows + Followed by three planes of image data. P == 7008800 == 2336256 * 3 + 32 (1872*1248) L == 5087264 == 1695744 * 3 + 32 (1472*1152) C == 2180384 == 726784 * 3 + 32 (1088*668) - It is worth mentioning that the image payload is Y'CbCr rather than the - traditional YMC (or even BGR) of other dyseubs. Our best guess is that - we need to use the JPEG coefficients, although we realistically have - no way of confirming this. - - It is hoped that the printers do support YMC data, but as of yet we - have no way of determining if this is possible. + It is worth mentioning that the Y'CbCr image data is surmised to use the + JPEG coefficients, although we realistically have no way of confirming this. Other questions: @@ -488,4 +488,18 @@ Also, the first time a readback happens after plugging in the printer: 34 44 35 31 01 00 01 00 01 00 45 00 "4D51" ...?? + +** ** ** ** This is what windows sends if you print over the network: + +00 00 00 00 40 00 00 00 02 00 00 00 00 00 04 00 Header [unknown] +00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + +00 00 01 00 HH HH HH HH 02 00 00 00 PP PP PP PP Header2 [unknown] PP == payload len, HH == payload + header2 len [ie + 3 ] +CC CC CC CC RR RR RR RR 00 00 00 00 LL LL LL LL CC == cols, RR == rows, LL == plane len (ie RR * CC) +L2 L2 L2 L2 L2 == LL * 2, apparently. + +[ ..followed by three planes of LL bytes, totalling PP bytes.. ] + */ diff --git a/src/cups/backend_citizencw01.c b/src/cups/backend_citizencw01.c index 618af86..0987916 100644 --- a/src/cups/backend_citizencw01.c +++ b/src/cups/backend_citizencw01.c @@ -43,7 +43,7 @@ #define USB_PID_CITIZEN_CW01 0x0002 // Maybe others? //#define USB_PID_OLMEC_OP900 XXXX -/* Private data stucture */ +/* Private data structure */ struct cw01_spool_hdr { uint8_t type; /* 0x00 -> 0x06 */ uint8_t res; /* vertical resolution; 0x00 == 334dpi, 0x01 == 600dpi */ @@ -183,7 +183,7 @@ static char *cw01_statuses(char *str) break; } - return "Unkown Error"; + return "Unknown Error"; } static int cw01_do_cmd(struct cw01_ctx *ctx, diff --git a/src/cups/backend_common.c b/src/cups/backend_common.c index bc39061..959eee4 100644 --- a/src/cups/backend_common.c +++ b/src/cups/backend_common.c @@ -1,7 +1,7 @@ /* * CUPS Backend common code * - * Copyright (c) 2007-2016 Solomon Peachy <pizza@shaftnet.org> + * Copyright (c) 2007-2017 Solomon Peachy <pizza@shaftnet.org> * * The latest version of this program can be found at: * @@ -27,7 +27,7 @@ #include "backend_common.h" -#define BACKEND_VERSION "0.70G" +#define BACKEND_VERSION "0.71G" #ifndef URI_PREFIX #error "Must Define URI_PREFIX" #endif @@ -168,7 +168,7 @@ static int parse1284_data(const char *device_id, struct deviceid_dict* dict) break; } return num; -}; +} static char *dict_find(const char *key, int dlen, struct deviceid_dict* dict) { @@ -368,7 +368,7 @@ static int print_scan_output(struct libusb_device *device, char *ieee_id = NULL; int i; - uint8_t endp_up = 0, endp_down = 0; + uint8_t endp_up, endp_down; DEBUG("Probing VID: %04X PID: %04x\n", desc->idVendor, desc->idProduct); @@ -392,6 +392,7 @@ static int print_scan_output(struct libusb_device *device, } /* Find the endpoints */ + endp_up = endp_down = 0; for (i = 0 ; i < config->interface[iface].altsetting[altset].bNumEndpoints ; i++) { if ((config->interface[iface].altsetting[altset].endpoint[i].bmAttributes & LIBUSB_TRANSFER_TYPE_MASK) == LIBUSB_TRANSFER_TYPE_BULK) { if (config->interface[iface].altsetting[altset].endpoint[i].bEndpointAddress & LIBUSB_ENDPOINT_IN) @@ -428,7 +429,7 @@ static int print_scan_output(struct libusb_device *device, } if (!manuf || !strlen(manuf)) { /* Last-ditch */ if (manuf) free(manuf); - manuf = url_encode("Unknown"); + manuf = url_encode("Unknown"); // XXX use USB VID? } /* Look up model number */ @@ -445,7 +446,7 @@ static int print_scan_output(struct libusb_device *device, if (!product || !strlen(product)) { /* Last-ditch */ if (!product) free(product); - product = url_encode("Unknown"); + product = url_encode("Unknown"); // XXX Use USB PID? } /* Look up description */ @@ -496,7 +497,7 @@ static int print_scan_output(struct libusb_device *device, if (serial) free(serial); WARNING("**** THIS PRINTER DOES NOT REPORT A SERIAL NUMBER!\n"); WARNING("**** If you intend to use multiple printers of this type, you\n"); - WARNING("**** must only plug one in at a time or unexpected behaivor will occur!\n"); + WARNING("**** must only plug one in at a time or unexpected behavior will occur!\n"); serial = strdup("NONE_UNKNOWN"); } @@ -662,7 +663,7 @@ static struct dyesub_backend *find_backend(char *uri_prefix) void print_license_blurb(void) { const char *license = "\n\ -Copyright 2007-2016 Solomon Peachy <pizza AT shaftnet DOT org>\n\ +Copyright 2007-2017 Solomon Peachy <pizza AT shaftnet DOT org>\n\ \n\ This program is free software; you can redistribute it and/or modify it\n\ under the terms of the GNU General Public License as published by the Free\n\ @@ -750,8 +751,7 @@ int main (int argc, char **argv) struct dyesub_backend *backend = NULL; void * backend_ctx = NULL; - uint8_t endp_up = 0; - uint8_t endp_down = 0; + uint8_t endp_up, endp_down; int iface = 0; // XXX loop through interfaces int altset = 0; // XXX loop through altsetting @@ -933,6 +933,7 @@ int main (int argc, char **argv) goto done_close; } + endp_up = endp_down = 0; for (i = 0 ; i < config->interface[iface].altsetting[altset].bNumEndpoints ; i++) { if ((config->interface[iface].altsetting[altset].endpoint[i].bmAttributes & LIBUSB_TRANSFER_TYPE_MASK) == LIBUSB_TRANSFER_TYPE_BULK) { if (config->interface[iface].altsetting[altset].endpoint[i].bEndpointAddress & LIBUSB_ENDPOINT_IN) @@ -1015,7 +1016,8 @@ newpage: goto done_claimed; /* Log the completed page */ - PAGE("%d %d\n", current_page, copies); + if (!uri) + PAGE("%d %d\n", current_page, copies); /* Since we have no way of telling if there's more data remaining to be read (without actually trying to read it), always assume @@ -1026,7 +1028,8 @@ done_multiple: close(data_fd); /* Done printing, log the total number of pages */ - PAGE("total %d\n", current_page * copies); + if (!uri) + PAGE("total %d\n", current_page * copies); ret = CUPS_BACKEND_OK; done_claimed: diff --git a/src/cups/backend_common.h b/src/cups/backend_common.h index fea04dc..4e489fc 100644 --- a/src/cups/backend_common.h +++ b/src/cups/backend_common.h @@ -1,7 +1,7 @@ /* * CUPS Backend common code * - * (c) 2013-2016 Solomon Peachy <pizza@shaftnet.org> + * (c) 2013-2017 Solomon Peachy <pizza@shaftnet.org> * * The latest version of this program can be found at: * @@ -117,6 +117,7 @@ enum { P_MITSU_9800, P_MITSU_9800S, P_MITSU_9810, + P_MITSU_P93D, P_MITSU_P95D, P_DNP_DS40, P_DNP_DS80, @@ -180,7 +181,7 @@ extern struct dyesub_backend BACKEND; #endif /* CUPS compatibility */ -#define CUPS_BACKEND_OK 0 /* Sucess */ +#define CUPS_BACKEND_OK 0 /* Success */ #define CUPS_BACKEND_FAILED 1 /* Failed to print use CUPS policy */ #define CUPS_BACKEND_AUTH_REQUIRED 2 /* Auth required */ #define CUPS_BACKEND_HOLD 3 /* Hold this job only */ diff --git a/src/cups/backend_dnpds40.c b/src/cups/backend_dnpds40.c index 650c963..68f2293 100644 --- a/src/cups/backend_dnpds40.c +++ b/src/cups/backend_dnpds40.c @@ -64,7 +64,7 @@ #define USB_PID_DNP_DS620 0x8b01 #define USB_PID_DNP_DS820 0x9001 -/* Private data stucture */ +/* Private data structure */ struct dnpds40_ctx { struct libusb_device_handle *dev; uint8_t endp_up; @@ -369,7 +369,7 @@ static char *dnpds80_duplex_statuses(int status) break; } - return "Unkown Duplexer Error"; + return "Unknown Duplexer Error"; } static char *dnpds40_statuses(int status) diff --git a/src/cups/backend_kodak1400.c b/src/cups/backend_kodak1400.c index 3b97e3a..6851385 100644 --- a/src/cups/backend_kodak1400.c +++ b/src/cups/backend_kodak1400.c @@ -74,7 +74,7 @@ struct kodak1400_hdr { } __attribute__((packed)); -/* Private data stucture */ +/* Private data structure */ struct kodak1400_ctx { struct libusb_device_handle *dev; uint8_t endp_up; @@ -643,7 +643,7 @@ struct dyesub_backend kodak1400_backend = { 00 00 00 00 NULL XX 00 Glossy, 01 Matte (Note: Kodak805 only supports Glossy) XX 01 to laminate, 00 to not. - 01 Unkown, always set to 01 + 01 Unknown, always set to 01 XX Lamination Strength: 3c Glossy diff --git a/src/cups/backend_kodak605.c b/src/cups/backend_kodak605.c index 1c0382d..ac4367a 100644 --- a/src/cups/backend_kodak605.c +++ b/src/cups/backend_kodak605.c @@ -91,7 +91,7 @@ struct kodak605_media_list { struct kodak605_status { struct kodak605_sts_hdr hdr; /*@10*/ uint32_t ctr_life; /* Lifetime Prints */ - uint32_t ctr_maint; /* Prints since last maintainence */ + uint32_t ctr_maint; /* Prints since last maintenance */ uint32_t ctr_media; /* Prints on current media */ uint32_t ctr_cut; /* Cutter Actuations */ uint32_t ctr_head; /* Prints on current head */ @@ -164,7 +164,7 @@ static const char *kodak68xx_mediatypes(int type) #define CMDBUF_LEN 4 -/* Private data stucture */ +/* Private data structure */ struct kodak605_ctx { struct libusb_device_handle *dev; uint8_t endp_up; diff --git a/src/cups/backend_kodak6800.c b/src/cups/backend_kodak6800.c index 63a6063..9df4200 100644 --- a/src/cups/backend_kodak6800.c +++ b/src/cups/backend_kodak6800.c @@ -1,7 +1,7 @@ /* * Kodak 6800/6850 Photo Printer CUPS backend -- libusb-1.0 version * - * (c) 2013-2016 Solomon Peachy <pizza@shaftnet.org> + * (c) 2013-2017 Solomon Peachy <pizza@shaftnet.org> * * Development of this backend was sponsored by: * @@ -113,14 +113,14 @@ enum { WAIT_STATUS2_BUSY = 4, }; -#define ERROR_STATUS2_CTRL_CIRCUIT (1<<31) -#define ERROR_STATUS2_MECHANISM_CTRL (1<<30) -#define ERROR_STATUS2_SENSOR (1<<13) -#define ERROR_STATUS2_COVER_OPEN (1<<12) -#define ERROR_STATUS2_TEMP_SENSOR (1<<9) -#define ERROR_STATUS2_PAPER_JAM (1<<8) -#define ERROR_STATUS2_PAPER_EMPTY (1<<6) -#define ERROR_STATUS2_RIBBON_ERR (1<<4) +#define ERROR_STATUS2_CTRL_CIRCUIT (0x80000000) +#define ERROR_STATUS2_MECHANISM_CTRL (0x40000000) +#define ERROR_STATUS2_SENSOR (0x00002000) +#define ERROR_STATUS2_COVER_OPEN (0x00001000) +#define ERROR_STATUS2_TEMP_SENSOR (0x00000200) +#define ERROR_STATUS2_PAPER_JAM (0x00000100) +#define ERROR_STATUS2_PAPER_EMPTY (0x00000040) +#define ERROR_STATUS2_RIBBON_ERR (0x00000010) enum { CTRL_CIR_ERROR_EEPROM1 = 0x01, @@ -221,7 +221,7 @@ struct kodak68x0_media_readback { #define CMDBUF_LEN 17 -/* Private data stucture */ +/* Private data structure */ struct kodak6800_ctx { struct libusb_device_handle *dev; uint8_t endp_up; @@ -1257,7 +1257,7 @@ static int kodak6800_main_loop(void *vctx, int copies) { /* Exported */ struct dyesub_backend kodak6800_backend = { .name = "Kodak 6800/6850", - .version = "0.57", + .version = "0.58", .uri_prefix = "kodak6800", .cmdline_usage = kodak6800_cmdline, .cmdline_arg = kodak6800_cmdline_arg, diff --git a/src/cups/backend_mitsu70x.c b/src/cups/backend_mitsu70x.c index a0ab482..39a94e4 100644 --- a/src/cups/backend_mitsu70x.c +++ b/src/cups/backend_mitsu70x.c @@ -1,7 +1,7 @@ /* * Mitsubishi CP-D70/D707 Photo Printer CUPS backend -- libusb-1.0 version * - * (c) 2013-2016 Solomon Peachy <pizza@shaftnet.org> + * (c) 2013-2017 Solomon Peachy <pizza@shaftnet.org> * * The latest version of this program can be found at: * @@ -84,16 +84,19 @@ struct BandImage { }; #endif +#define REQUIRED_LIB_APIVERSION 4 + /* Image processing library function prototypes */ #define LIB_NAME_RE "libMitsuD70ImageReProcess.so" // Reimplemented library +typedef int (*lib70x_getapiversionFN)(void); typedef int (*Get3DColorTableFN)(uint8_t *buf, const char *filename); typedef struct CColorConv3D *(*Load3DColorTableFN)(const uint8_t *ptr); typedef void (*Destroy3DColorTableFN)(struct CColorConv3D *this); typedef void (*DoColorConvFN)(struct CColorConv3D *this, uint8_t *data, uint16_t cols, uint16_t rows, uint32_t bytes_per_row, int rgb_bgr); typedef struct CPCData *(*get_CPCDataFN)(const char *filename); typedef void (*destroy_CPCDataFN)(struct CPCData *data); -typedef int (*do_image_effectFN)(struct CPCData *cpc, struct BandImage *input, struct BandImage *output, int sharpen, uint8_t rew[2]); +typedef int (*do_image_effectFN)(struct CPCData *cpc, struct CPCData *ecpc, struct BandImage *input, struct BandImage *output, int sharpen, int reverse, uint8_t rew[2]); typedef int (*send_image_dataFN)(struct BandImage *out, void *context, int (*callback_fn)(void *context, void *buffer, uint32_t len)); @@ -109,6 +112,7 @@ typedef int (*send_image_dataFN)(struct BandImage *out, void *context, #define USB_PID_MITSU_D70X 0x3B30 #define USB_PID_MITSU_K60 0x3B31 #define USB_PID_MITSU_D80 0x3B36 +#define USB_PID_MITSU_D90 0x3B60 #define USB_VID_KODAK 0x040a #define USB_PID_KODAK305 0x404f //#define USB_VID_FUJIFILM XXXXXX @@ -117,7 +121,10 @@ typedef int (*send_image_dataFN)(struct BandImage *out, void *context, /* Width of the laminate data file */ #define LAMINATE_STRIDE 1864 -/* Private data stucture */ +/* Max size of data chunk sent over */ +#define CHUNK_LEN (256*1024) + +/* Private data structure */ struct mitsu70x_ctx { struct libusb_device_handle *dev; uint8_t endp_up; @@ -140,23 +147,31 @@ struct mitsu70x_ctx { char *laminatefname; char *lutfname; char *cpcfname; + char *ecpcfname; void *dl_handle; + lib70x_getapiversionFN GetAPIVersion; Get3DColorTableFN Get3DColorTable; Load3DColorTableFN Load3DColorTable; Destroy3DColorTableFN Destroy3DColorTable; DoColorConvFN DoColorConv; get_CPCDataFN GetCPCData; destroy_CPCDataFN DestroyCPCData; + do_image_effectFN DoImageEffect60; + do_image_effectFN DoImageEffect70; + do_image_effectFN DoImageEffect80; do_image_effectFN DoImageEffect; send_image_dataFN SendImageData; struct CColorConv3D *lut; struct CPCData *cpcdata; + struct CPCData *ecpcdata; char *last_cpcfname; + char *last_ecpcfname; int raw_format; + int reverse; int sharpen; /* ie mhdr.sharpen - 1 */ uint8_t rew[2]; /* 1 for rewind ok (default!) */ @@ -197,6 +212,7 @@ struct mitsu70x_jobs { #define MECHA_STATUS_INIT 0x80 #define MECHA_STATUS_FEED 0x50 #define MECHA_STATUS_LOAD 0x40 +#define MECHA_STATUS_LOAD2 0x30 #define MECHA_STATUS_PRINT 0x20 #define MECHA_STATUS_IDLE 0x00 @@ -244,7 +260,7 @@ struct mitsu70x_jobs { #define ERROR_STATUS0_RIBBONEND 0x09 #define ERROR_STATUS0_DOOROPEN_IDLE 0x0A #define ERROR_STATUS0_DOOROPEN_PRNT 0x0B -#define ERROR_STATUS0_POWEROFF 0x0C // nonsense.. heh. +#define ERROR_STATUS0_POWEROFF 0x0C // Powered off during printing..? #define ERROR_STATUS0_NOMCOP 0x0D #define ERROR_STATUS0_RIBBONSKIP1 0x0E #define ERROR_STATUS0_RIBBONSKIP2 0x0F @@ -311,11 +327,15 @@ struct mitsu70x_printerstatus_resp { uint8_t hdr[4]; /* E4 56 32 31 */ uint8_t memory; uint8_t power; - uint8_t unk[34]; + uint8_t unk[20]; + uint8_t sleeptime; /* In minutes, 0-10 */ + uint8_t iserial; /* 0x00 for Enabled, 0x80 for Disabled */ + uint8_t unk_b[12]; int16_t model[6]; /* LE, UTF-16 */ int16_t serno[6]; /* LE, UTF-16 */ struct mitsu70x_status_ver vers[7]; // components are 'MLRTF' - uint8_t null[8]; + uint8_t null[2]; + uint8_t user_serno[6]; /* Supposedly, don't know how to set it */ struct mitsu70x_status_deck lower; struct mitsu70x_status_deck upper; } __attribute__((packed)); @@ -356,8 +376,8 @@ struct mitsu70x_hdr { uint8_t sharpen; /* 0-9. 5 is "normal", 0 is "off" */ uint8_t mode; /* 0 for cooked YMC planar, 1 for packed BGR */ uint8_t use_lut; /* in BGR mode, 0 disables, 1 enables */ - - uint8_t pad[448]; + uint8_t reversed; /* 1 tells the backend the row data is correct */ + uint8_t pad[447]; } __attribute__((packed)); /* Error dumps, etc */ @@ -370,6 +390,7 @@ static char *mitsu70x_mechastatus(uint8_t *sts) case MECHA_STATUS_FEED: return "Paper Feeding/Cutting"; case MECHA_STATUS_LOAD: + case MECHA_STATUS_LOAD2: return "Media Loading"; case MECHA_STATUS_PRINT: return "Printing"; @@ -609,6 +630,13 @@ static const char *mitsu70x_media_types(uint8_t brand, uint8_t type) return "CK-K76R (6x8)"; else return "Unknown"; + +// Also CK-D715, CK-D718, CK-D720, CK-D723 (4x6,5x8,6x8,6x9) for D70-S model +// CK-D746-U for D70-U model +// CK-D820 (6x8) for D80-S model +// CK-D868 (6x8) for D80 (non-S) +// D90 can use _all_ of htese types except for the -U! + } #define CMDBUF_LEN 512 @@ -653,30 +681,60 @@ static void mitsu70x_attach(void *vctx, struct libusb_device_handle *dev, /* Attempt to open the library */ #if defined(WITH_DYNAMIC) - INFO("Attempting to load image processing library\n"); + DEBUG("Attempting to load image processing library\n"); ctx->dl_handle = DL_OPEN(LIB_NAME_RE); if (!ctx->dl_handle) WARNING("Image processing library not found, using internal fallback code\n"); if (ctx->dl_handle) { + ctx->GetAPIVersion = DL_SYM(ctx->dl_handle, "lib70x_getapiversion"); + if (!ctx->GetAPIVersion) { + ERROR("Problem resolving API Version symbol in imaging processing library, too old or not installed?\n"); + DL_CLOSE(ctx->dl_handle); + ctx->dl_handle = NULL; + return; + } + if (ctx->GetAPIVersion() != REQUIRED_LIB_APIVERSION) { + ERROR("Image processing library API version mismatch!\n"); + DL_CLOSE(ctx->dl_handle); + ctx->dl_handle = NULL; + return; + } + ctx->Get3DColorTable = DL_SYM(ctx->dl_handle, "CColorConv3D_Get3DColorTable"); ctx->Load3DColorTable = DL_SYM(ctx->dl_handle, "CColorConv3D_Load3DColorTable"); ctx->Destroy3DColorTable = DL_SYM(ctx->dl_handle, "CColorConv3D_Destroy3DColorTable"); ctx->DoColorConv = DL_SYM(ctx->dl_handle, "CColorConv3D_DoColorConv"); ctx->GetCPCData = DL_SYM(ctx->dl_handle, "get_CPCData"); ctx->DestroyCPCData = DL_SYM(ctx->dl_handle, "destroy_CPCData"); - ctx->DoImageEffect = DL_SYM(ctx->dl_handle, "do_image_effect"); + ctx->DoImageEffect60 = DL_SYM(ctx->dl_handle, "do_image_effect60"); + ctx->DoImageEffect70 = DL_SYM(ctx->dl_handle, "do_image_effect70"); + ctx->DoImageEffect80 = DL_SYM(ctx->dl_handle, "do_image_effect80"); ctx->SendImageData = DL_SYM(ctx->dl_handle, "send_image_data"); if (!ctx->Get3DColorTable || !ctx->Load3DColorTable || !ctx->Destroy3DColorTable || !ctx->DoColorConv || !ctx->GetCPCData || !ctx->DestroyCPCData || - !ctx->DoImageEffect || !ctx->SendImageData) { - WARNING("Problem resolving symbols in imaging processing library\n"); + !ctx->DoImageEffect60 || !ctx->DoImageEffect70 || + !ctx->DoImageEffect80 || !ctx->SendImageData) { + ERROR("Problem resolving symbols in imaging processing library\n"); DL_CLOSE(ctx->dl_handle); ctx->dl_handle = NULL; } else { - INFO("Image processing library successfully loaded\n"); + DEBUG("Image processing library successfully loaded\n"); } } + + switch (ctx->type) { + case P_MITSU_D80: + ctx->DoImageEffect = ctx->DoImageEffect80; + break; + case P_MITSU_K60: + case P_KODAK_305: + ctx->DoImageEffect = ctx->DoImageEffect60; + break; + default: + ctx->DoImageEffect = ctx->DoImageEffect70; + break; + } #else WARNING("Dynamic library support not enabled, using internal fallback code\n"); #endif @@ -694,6 +752,8 @@ static void mitsu70x_teardown(void *vctx) { if (ctx->dl_handle) { if (ctx->cpcdata) ctx->DestroyCPCData(ctx->cpcdata); + if (ctx->ecpcdata) + ctx->DestroyCPCData(ctx->ecpcdata); if (ctx->lut) ctx->Destroy3DColorTable(ctx->lut); DL_CLOSE(ctx->dl_handle); @@ -718,6 +778,7 @@ static int mitsu70x_read_parse(void *vctx, int data_fd) { ctx->databuf = NULL; } + /* Reset some state */ ctx->matte = 0; ctx->rew[0] = 1; ctx->rew[1] = 1; @@ -752,6 +813,21 @@ repeat: ctx->raw_format = !mhdr.mode; + /* Sanity check Matte mode */ + if (!mhdr.laminate && mhdr.laminate_mode) { + if (ctx->type != P_MITSU_D70X) { + if (mhdr.speed != 0x03 && mhdr.speed != 0x04) { + WARNING("Forcing Ultrafine mode for matte printing!\n"); + mhdr.speed = 0x04; /* Force UltraFine */ + } + } else { + if (mhdr.speed != 0x03) { + mhdr.speed = 0x03; /* Force SuperFine */ + WARNING("Forcing SuperFine mode for matte printing!\n"); + } + } + } + /* Figure out the correction data table to use */ if (ctx->type == P_MITSU_D70X) { ctx->laminatefname = CORRTABLE_PATH "/D70MAT01.raw"; @@ -774,12 +850,14 @@ repeat: if (mhdr.speed == 3) { ctx->cpcfname = CORRTABLE_PATH "/CPD80S01.cpc"; + ctx->ecpcfname = CORRTABLE_PATH "/CPD80E01.cpc"; } else if (mhdr.speed == 4) { ctx->cpcfname = CORRTABLE_PATH "/CPD80U01.cpc"; + ctx->ecpcfname = NULL; } else { ctx->cpcfname = CORRTABLE_PATH "/CPD80N01.cpc"; + ctx->ecpcfname = NULL; } - // XXX what about CPD80**E**01? if (mhdr.hdr[3] != 0x01) { WARNING("Print job has wrong submodel specifier (%x)\n", mhdr.hdr[3]); mhdr.hdr[3] = 0x01; @@ -831,11 +909,13 @@ repeat: ctx->lutfname = NULL; ctx->sharpen = mhdr.sharpen - 1; + ctx->reverse = !mhdr.reversed; /* Clean up header back to pristine. */ mhdr.use_lut = 0; mhdr.mode = 0; mhdr.sharpen = 0; + mhdr.reversed = 0; /* Work out total printjob size */ ctx->cols = be16_to_cpu(mhdr.cols); @@ -921,10 +1001,11 @@ repeat: ctx->DoColorConv(ctx->lut, spoolbuf, ctx->cols, ctx->rows, ctx->cols * 3, COLORCONV_BGR); } - /* Load in the CPC file, if needed! */ if (ctx->dl_handle) { struct BandImage input; + + /* Load in the CPC file, if needed */ if (ctx->cpcfname && ctx->cpcfname != ctx->last_cpcfname) { ctx->last_cpcfname = ctx->cpcfname; if (ctx->cpcdata) @@ -936,8 +1017,23 @@ repeat: } } - /* Convert using image processing library */ + /* Load in the secondary CPC, if needed */ + if (ctx->ecpcfname != ctx->last_ecpcfname) { + ctx->last_ecpcfname = ctx->ecpcfname; + if (ctx->ecpcdata) + ctx->DestroyCPCData(ctx->ecpcdata); + if (ctx->ecpcfname) { + ctx->ecpcdata = ctx->GetCPCData(ctx->ecpcfname); + if (!ctx->ecpcdata) { + ERROR("Unable to load CPC file '%s'\n", ctx->cpcfname); + return CUPS_BACKEND_CANCEL; + } + } else { + ctx->ecpcdata = NULL; + } + } + /* Convert using image processing library */ input.origin_rows = input.origin_cols = 0; input.rows = ctx->rows; input.cols = ctx->cols; @@ -950,9 +1046,9 @@ repeat: ctx->output.imgbuf = ctx->databuf + ctx->datalen; ctx->output.bytes_per_row = ctx->cols * 3 * 2; - DEBUG("Running print data through processing library\n"); - if (ctx->DoImageEffect(ctx->cpcdata, &input, &ctx->output, ctx->sharpen, ctx->rew)) { + if (ctx->DoImageEffect(ctx->cpcdata, ctx->ecpcdata, + &input, &ctx->output, ctx->sharpen, ctx->reverse, ctx->rew)) { ERROR("Image Processing failed, aborting!\n"); return CUPS_BACKEND_CANCEL; } @@ -1175,11 +1271,15 @@ static int mitsu70x_set_sleeptime(struct mitsu70x_ctx *ctx, uint8_t time) uint8_t cmdbuf[4]; int ret; - /* Send Job cancel. No response. */ + /* 10 minutes max, according to all docs. */ + if (time > 10) + time = 10; + + /* Send Parameter.. */ memset(cmdbuf, 0, 4); cmdbuf[0] = 0x1b; cmdbuf[1] = 0x53; - cmdbuf[2] = 0x53; // XXX also, 0x4e and 0x50 are other params. + cmdbuf[2] = 0x53; cmdbuf[3] = time; if ((ret = send_data(ctx->dev, ctx->endp_down, @@ -1189,6 +1289,59 @@ static int mitsu70x_set_sleeptime(struct mitsu70x_ctx *ctx, uint8_t time) return 0; } +static int mitsu70x_set_iserial(struct mitsu70x_ctx *ctx, uint8_t enabled) +{ + uint8_t cmdbuf[4]; + int ret; + + if (enabled) + enabled = 0; + else + enabled = 0x80; + + /* Send Parameter.. */ + memset(cmdbuf, 0, 4); + cmdbuf[0] = 0x1b; + cmdbuf[1] = 0x53; + cmdbuf[2] = 0x4e; + cmdbuf[3] = enabled; + + if ((ret = send_data(ctx->dev, ctx->endp_down, + cmdbuf, 4))) + return ret; + + return 0; +} + +#if 0 +/* Switches between "Driver" and "SDK" modes. + Single-endpoint vs Multi-Endpoint, essentially. + Not sure about the polarity. + */ +static int mitsu70x_set_printermode(struct mitsu70x_ctx *ctx, uint8_t enabled) +{ + uint8_t cmdbuf[4]; + int ret; + + if (enabled) + enabled = 0; + else + enabled = 0x80; + + /* Send Parameter.. */ + memset(cmdbuf, 0, 4); + cmdbuf[0] = 0x1b; + cmdbuf[1] = 0x53; + cmdbuf[2] = 0x50; + cmdbuf[3] = enabled; + + if ((ret = send_data(ctx->dev, ctx->endp_down, + cmdbuf, 4))) + return ret; + + return 0; +} +#endif static int mitsu70x_wakeup(struct mitsu70x_ctx *ctx) { int ret; @@ -1210,9 +1363,25 @@ static int mitsu70x_wakeup(struct mitsu70x_ctx *ctx) static int d70_library_callback(void *context, void *buffer, uint32_t len) { + uint32_t chunk = len; + uint32_t offset = 0; + int ret = 0; + struct mitsu70x_ctx *ctx = context; - return send_data(ctx->dev, ctx->endp_down, buffer, len); + while (chunk > 0) { + if (chunk > CHUNK_LEN) + chunk = CHUNK_LEN; + + ret = send_data(ctx->dev, ctx->endp_down, buffer + offset, chunk); + if (ret < 0) + break; + + offset += chunk; + chunk = len - offset; + } + + return ret; } static int mitsu70x_main_loop(void *vctx, int copies) @@ -1221,6 +1390,7 @@ static int mitsu70x_main_loop(void *vctx, int copies) struct mitsu70x_jobstatus jobstatus; struct mitsu70x_printerstatus_resp resp; struct mitsu70x_hdr *hdr; + uint8_t last_status[4] = {0xff, 0xff, 0xff, 0xff}; int ret; @@ -1368,21 +1538,7 @@ skip_status: if (ctx->type != P_MITSU_D70X) { hdr->rewind[0] = !ctx->rew[0]; hdr->rewind[1] = !ctx->rew[1]; - } - - /* Matte operation requires Ultrafine/superfine */ - if (ctx->matte) { - if (ctx->type != P_MITSU_D70X) { - if (hdr->speed != 0x03 && hdr->speed != 0x04) { - WARNING("Forcing Ultrafine mode for matte printing!\n"); - hdr->speed = 0x04; /* Force UltraFine */ - } - } else { - if (hdr->speed != 0x03) { - hdr->speed = 0x03; /* Force SuperFine */ - WARNING("Forcing Ultrafine mode for matte printing!\n"); - } - } + DEBUG("Rewind Inhibit? %02x %02x\n", hdr->rewind[0], hdr->rewind[1]); } /* Any other fixups? */ @@ -1411,7 +1567,7 @@ skip_status: /* K60 and 305 need data sent in 256K chunks, but the first chunk needs to subtract the length of the 512-byte header */ - int chunk = 256*1024 - sizeof(struct mitsu70x_hdr); + int chunk = CHUNK_LEN - sizeof(struct mitsu70x_hdr); int sent = 512; while (chunk > 0) { if ((ret = send_data(ctx->dev, ctx->endp_down, @@ -1419,8 +1575,8 @@ skip_status: return CUPS_BACKEND_FAILED; sent += chunk; chunk = ctx->datalen - sent; - if (chunk > 256*1024) - chunk = 256*1024; + if (chunk > CHUNK_LEN) + chunk = CHUNK_LEN; } } @@ -1471,12 +1627,18 @@ skip_status: return CUPS_BACKEND_STOP; } - INFO("%s: %x/%x/%x/%x\n", - mitsu70x_jobstatuses(jobstatus.job_status), - jobstatus.job_status[0], - jobstatus.job_status[1], - jobstatus.job_status[2], - jobstatus.job_status[3]); + /* Only print if it's changed */ + if (jobstatus.job_status[0] != last_status[0] || + jobstatus.job_status[1] != last_status[1] || + jobstatus.job_status[2] != last_status[2] || + jobstatus.job_status[3] != last_status[3]) + INFO("%s: %02x/%02x/%02x/%02x\n", + mitsu70x_jobstatuses(jobstatus.job_status), + jobstatus.job_status[0], + jobstatus.job_status[1], + jobstatus.job_status[2], + jobstatus.job_status[3]); + if (jobstatus.job_status[0] == JOB_STATUS0_END) { if (jobstatus.job_status[1] || jobstatus.job_status[2] || @@ -1495,6 +1657,9 @@ skip_status: INFO("Fast return mode enabled.\n"); break; } + + /* Update cache for the next round */ + memcpy(last_status, jobstatus.job_status, 4); } while(1); /* Clean up */ @@ -1541,6 +1706,8 @@ static void mitsu70x_dump_printerstatus(struct mitsu70x_printerstatus_resp *resp INFO("FW Component: %c %s (%04x)\n", type, buf, be16_to_cpu(resp->vers[i].checksum)); } + INFO("Standby Timeout: %d minutes\n", resp->sleeptime); + INFO("iSerial Reporting: %s\n", resp->iserial ? "No" : "Yes" ); INFO("Lower Mechanical Status: %s\n", mitsu70x_mechastatus(resp->lower.mecha_status)); @@ -1666,6 +1833,7 @@ static void mitsu70x_cmdline(void) DEBUG("\t\t[ -s ] # Query status\n"); DEBUG("\t\t[ -f ] # Use fast return mode\n"); DEBUG("\t\t[ -k num ] # Set standby time (1-60 minutes, 0 disables)\n"); + DEBUG("\t\t[ -x num ] # Set USB iSerialNumber Reporting (1 on, 0 off)\n"); DEBUG("\t\t[ -X jobid ] # Abort a printjob\n");} static int mitsu70x_cmdline_arg(void *vctx, int argc, char **argv) @@ -1676,7 +1844,7 @@ static int mitsu70x_cmdline_arg(void *vctx, int argc, char **argv) if (!ctx) return -1; - while ((i = getopt(argc, argv, GETOPT_LIST_GLOBAL "sX:k:")) >= 0) { + while ((i = getopt(argc, argv, GETOPT_LIST_GLOBAL "sk:X:x:")) >= 0) { switch(i) { GETOPT_PROCESS_GLOBAL case 'k': @@ -1685,6 +1853,9 @@ static int mitsu70x_cmdline_arg(void *vctx, int argc, char **argv) case 's': j = mitsu70x_query_status(ctx); break; + case 'x': + j = mitsu70x_set_iserial(ctx, atoi(optarg)); + break; case 'X': j = mitsu70x_cancel_job(ctx, atoi(optarg)); break; @@ -1702,7 +1873,7 @@ static int mitsu70x_cmdline_arg(void *vctx, int argc, char **argv) /* Exported */ struct dyesub_backend mitsu70x_backend = { .name = "Mitsubishi CP-D70/D707/K60/D80", - .version = "0.55", + .version = "0.61", .uri_prefix = "mitsu70x", .cmdline_usage = mitsu70x_cmdline, .cmdline_arg = mitsu70x_cmdline_arg, @@ -1716,6 +1887,7 @@ struct dyesub_backend mitsu70x_backend = { { USB_VID_MITSU, USB_PID_MITSU_D70X, P_MITSU_D70X, ""}, { USB_VID_MITSU, USB_PID_MITSU_K60, P_MITSU_K60, ""}, { USB_VID_MITSU, USB_PID_MITSU_D80, P_MITSU_D80, ""}, +// { USB_VID_MITSU, USB_PID_MITSU_D90, P_MITSU_D90, ""}, { USB_VID_KODAK, USB_PID_KODAK305, P_KODAK_305, ""}, // { USB_VID_FUJIFILM, USB_PID_FUJI_ASK300, P_FUJI_ASK300, ""}, { 0, 0, 0, ""} @@ -1751,7 +1923,7 @@ struct dyesub_backend mitsu70x_backend = { YY YY == rows QQ QQ == lamination columns (equal to XX XX) ZZ ZZ == lamination rows (YY YY + 12 on D70x/D80/ASK300, YY YY on others) - RR RR == "rewind inhibit", 01 01 enabled, normally 00 00 + RR RR == "rewind inhibit", 01 01 enabled, normally 00 00 (All but D70x) SS == Print mode: 00 = Fine, 03 = SuperFine (D70x/D80 only), 04 = UltraFine (Matte requires Superfine or Ultrafine) UU == 00 = Auto, 01 = Lower Deck (required for !D70x), 02 = Upper Deck diff --git a/src/cups/backend_mitsu9550.c b/src/cups/backend_mitsu9550.c index 12ff0e8..907c773 100644 --- a/src/cups/backend_mitsu9550.c +++ b/src/cups/backend_mitsu9550.c @@ -104,7 +104,7 @@ struct mitsu9550_cmd { uint8_t cmd[4]; } __attribute__((packed)); -/* Private data stucture */ +/* Private data structure */ struct mitsu9550_ctx { struct libusb_device_handle *dev; uint8_t endp_up; diff --git a/src/cups/backend_mitsup95d.c b/src/cups/backend_mitsup95d.c index 140e918..100462f 100644 --- a/src/cups/backend_mitsup95d.c +++ b/src/cups/backend_mitsup95d.c @@ -1,7 +1,11 @@ /* - * Mitsubishi P95D Monochrome Thermal Photo Printer CUPS backend + * Mitsubishi P93D/P95D Monochrome Thermal Photo Printer CUPS backend * - * (c) 2016 Solomon Peachy <pizza@shaftnet.org> + * (c) 2016-2017 Solomon Peachy <pizza@shaftnet.org> + * + * Development of this backend was sponsored by: + * + * A benefactor who wishes to remain anonymous * * The latest version of this program can be found at: * @@ -40,14 +44,17 @@ #include "backend_common.h" #define USB_VID_MITSU 0x06D3 +#define USB_PID_MITSU_P93D 0x0398 #define USB_PID_MITSU_P95D 0x3b10 -/* Private data stucture */ +/* Private data structure */ struct mitsup95d_ctx { struct libusb_device_handle *dev; uint8_t endp_up; uint8_t endp_down; + int type; + uint8_t mem_clr[4]; // 1b 5a 43 00 int mem_clr_present; @@ -57,7 +64,8 @@ struct mitsup95d_ctx { uint8_t hdr2[50]; // 1b 57 21 2e ... uint8_t hdr3[50]; // 1b 57 22 2e ... - uint8_t hdr4[36]; // 1b 58 ... + uint8_t hdr4[42]; // 1b 58 ... + int hdr4_len; // 36 (P95) or 42 (P93) uint8_t plane[12]; // 1b 5a 74 00 ... uint8_t *databuf; @@ -95,6 +103,8 @@ static void mitsup95d_attach(void *vctx, struct libusb_device_handle *dev, device = libusb_get_device(dev); libusb_get_device_descriptor(device, &desc); + ctx->type = lookup_printer_type(&mitsup95d_backend, + desc.idVendor, desc.idProduct); } static void mitsup95d_teardown(void *vctx) { @@ -116,7 +126,7 @@ static int mitsup95d_read_parse(void *vctx, int data_fd) { int i; int remain; int ptr_offset; - + if (!ctx) return CUPS_BACKEND_FAILED; @@ -125,25 +135,20 @@ static int mitsup95d_read_parse(void *vctx, int data_fd) { ctx->databuf = NULL; } ctx->mem_clr_present = 0; - + top: i = read(data_fd, buf, sizeof(buf)); + if (i == 0) return CUPS_BACKEND_CANCEL; if (i < 0) return CUPS_BACKEND_CANCEL; - if (buf[0] != 0x1b) { ERROR("malformed data stream\n"); return CUPS_BACKEND_CANCEL; } switch (buf[1]) { - case 0x43: /* Memory Clear */ - remain = 4; - ptr = ctx->mem_clr; - ctx->mem_clr_present = 1; - break; case 0x50: /* Footer */ remain = 2; ptr = ctx->ftr; @@ -157,12 +162,19 @@ top: ptr = tmphdr; break; case 0x58: /* User Comment */ - remain = 36; + if (ctx->type == P_MITSU_P93D) + ctx->hdr4_len = 42; + else + ctx->hdr4_len = 36; + remain = ctx->hdr4_len; ptr = ctx->hdr4; break; - case 0x5a: /* Plane header */ - remain = 12; - ptr = ctx->plane; + case 0x5a: /* Plane header OR printer reset */ + // reset memory: 1b 5a 43 ... [len 04] + // plane header: 1b 5a 74 ... [len 12] + // Read in the minimum length, and clean it up later */ + ptr = tmphdr; + remain = 4; break; default: ERROR("Unrecognized command! (%02x %02x)\n", buf[0], buf[1]); @@ -172,7 +184,7 @@ top: memcpy(ptr, buf, sizeof(buf)); remain -= sizeof(buf); ptr_offset = sizeof(buf); - + while (remain) { i = read(data_fd, ptr + ptr_offset, remain); if (i == 0) @@ -181,8 +193,22 @@ top: return CUPS_BACKEND_CANCEL; remain -= i; ptr_offset += i; + + /* Handle the ambiguous 0x5a block */ + if (buf[1] == 0x5a && remain == 0) { + if (tmphdr[2] == 0x74) { /* plane header */ + ptr = ctx->plane; + remain = 12 - ptr_offset; /* Finish reading */ + } else if (tmphdr[2] == 0x43) { /* reset memory */ + ptr = ctx->mem_clr; + ctx->mem_clr_present = 1; + remain = 4 - ptr_offset; + } + memcpy(ptr, tmphdr, ptr_offset); + buf[1] = 0xff; + } } - + if (ptr == tmphdr) { if (tmphdr[3] != 46) { ERROR("Unexpected header chunk: %02x %02x %02x %02x\n", @@ -239,21 +265,29 @@ static int mitsup95d_main_loop(void *vctx, int copies) { struct mitsup95d_ctx *ctx = vctx; uint8_t querycmd[4] = { 0x1b, 0x72, 0x00, 0x00 }; uint8_t queryresp[9]; - + int ret; int num; if (!ctx) return CUPS_BACKEND_FAILED; + /* P93D is ... special. Windows switches to this halfway through + but it seems be okay to use it everywhere */ + if (ctx->type == P_MITSU_P93D) { + querycmd[2] = 0x03; + } + /* Update printjob header to reflect number of requested copies */ if (ctx->hdr2[13] != 0xff) ctx->hdr2[13] = copies; - /* XXX Update unknown header field to match sniffs */ - if (ctx->hdr1[18] == 0x00) - ctx->hdr1[18] = 0x01; - + if (ctx->type == P_MITSU_P95D) { + /* XXX Update unknown header field to match sniffs */ + if (ctx->hdr1[18] == 0x00) + ctx->hdr1[18] = 0x01; + } + INFO("Waiting for printer idle\n"); /* Query Status to make sure printer is idle */ @@ -263,22 +297,35 @@ static int mitsup95d_main_loop(void *vctx, int copies) { return CUPS_BACKEND_FAILED; ret = read_data(ctx->dev, ctx->endp_up, queryresp, sizeof(queryresp), &num); - if (num != sizeof(queryresp) || ret < 0) { + if (ret < 0) + return CUPS_BACKEND_FAILED; + if (ctx->type == P_MITSU_P95D && num != 9) { + return CUPS_BACKEND_FAILED; + } else if (ctx->type == P_MITSU_P93D && num != 8) { return CUPS_BACKEND_FAILED; } - if (queryresp[5] & 0x40) { - ERROR("Printer error %02x\n", queryresp[5]); // XXX decode - return CUPS_BACKEND_STOP; + if (ctx->type == P_MITSU_P95D) { + if (queryresp[5] & 0x40) { + ERROR("Printer error %02x\n", queryresp[5]); // XXX decode + return CUPS_BACKEND_STOP; + } + if (queryresp[5] == 0x00) + break; + } else { + if (queryresp[6] == 0x45) { + ERROR("Printer error %02x\n", queryresp[7]); + return CUPS_BACKEND_STOP; + } + if (queryresp[6] == 0x30) + break; } - if (queryresp[5] == 0x00) - break; - + sleep(1); } while (1); INFO("Sending print job\n"); - + /* Send over Memory Clear, if present */ if (ctx->mem_clr_present) { if ((ret = send_data(ctx->dev, ctx->endp_down, @@ -302,7 +349,7 @@ static int mitsup95d_main_loop(void *vctx, int copies) { ctx->hdr3, sizeof(ctx->hdr3)))) return CUPS_BACKEND_FAILED; if ((ret = send_data(ctx->dev, ctx->endp_down, - ctx->hdr4, sizeof(ctx->hdr4)))) + ctx->hdr4, ctx->hdr4_len))) return CUPS_BACKEND_FAILED; /* Send plane header and image data */ @@ -319,16 +366,38 @@ static int mitsup95d_main_loop(void *vctx, int copies) { return CUPS_BACKEND_FAILED; ret = read_data(ctx->dev, ctx->endp_up, queryresp, sizeof(queryresp), &num); - if (num != sizeof(queryresp) || ret < 0) { + + if (ret < 0) + return CUPS_BACKEND_FAILED; + if (ctx->type == P_MITSU_P95D && num != 9) { + return CUPS_BACKEND_FAILED; + } else if (ctx->type == P_MITSU_P93D && num != 8) { return CUPS_BACKEND_FAILED; } + if (queryresp[5] & 0x40) { ERROR("Printer error %02x\n", queryresp[5]); // XXX decode return CUPS_BACKEND_STOP; } - if (queryresp[5] != 0x00) { - ERROR("Printer not ready (%02x)!\n", queryresp[5]); - return CUPS_BACKEND_CANCEL; + + if (ctx->type == P_MITSU_P95D) { + if (queryresp[5] & 0x40) { + ERROR("Printer error %02x\n", queryresp[5]); // XXX decode + return CUPS_BACKEND_STOP; + } + if (queryresp[5] != 0x00) { + ERROR("Printer not ready (%02x)!\n", queryresp[5]); + return CUPS_BACKEND_CANCEL; + } + } else { + if (queryresp[6] == 0x45) { + ERROR("Printer error %02x\n", queryresp[7]); + return CUPS_BACKEND_STOP; + } + if (queryresp[6] != 0x30) { + ERROR("Printer not ready (%02x)!\n", queryresp[6]); + return CUPS_BACKEND_CANCEL; + } } /* Send over Footer */ @@ -341,33 +410,53 @@ static int mitsup95d_main_loop(void *vctx, int copies) { /* Query status until we're done.. */ do { sleep(1); - + /* Query Status */ if ((ret = send_data(ctx->dev, ctx->endp_down, querycmd, sizeof(querycmd)))) return CUPS_BACKEND_FAILED; ret = read_data(ctx->dev, ctx->endp_up, queryresp, sizeof(queryresp), &num); - if (num != sizeof(queryresp) || ret < 0) { + + if (ret < 0) + return CUPS_BACKEND_FAILED; + if (ctx->type == P_MITSU_P95D && num != 9) { + return CUPS_BACKEND_FAILED; + } else if (ctx->type == P_MITSU_P93D && num != 8) { return CUPS_BACKEND_FAILED; } - if (queryresp[5] & 0x40) { - ERROR("Printer error %02x\n", queryresp[5]); // XXX decode - return CUPS_BACKEND_STOP; - } - if (queryresp[5] == 0 && queryresp[7] == 0) - break; + if (ctx->type == P_MITSU_P95D) { + if (queryresp[5] & 0x40) { + ERROR("Printer error %02x\n", queryresp[5]); // XXX decode + return CUPS_BACKEND_STOP; + } + if (queryresp[5] == 0x00) + break; - if (queryresp[7] > 0) { - if (fast_return) { - INFO("Fast return mode enabled.\n"); + if (queryresp[7] > 0) { + if (fast_return) { + INFO("Fast return mode enabled.\n"); + break; + } + } + } else { + if (queryresp[6] == 0x45) { + ERROR("Printer error %02x\n", queryresp[7]); + return CUPS_BACKEND_STOP; + } + if (queryresp[6] == 0x30) break; + if (queryresp[6] == 0x43 && queryresp[7] > 0) { + if (fast_return) { + INFO("Fast return mode enabled.\n"); + break; + } } } } while(1); - - INFO("Print complete\n"); + + INFO("Print complete\n"); return CUPS_BACKEND_OK; } @@ -392,8 +481,8 @@ static int mitsup95d_cmdline_arg(void *vctx, int argc, char **argv) /* Exported */ struct dyesub_backend mitsup95d_backend = { - .name = "Mitsubishi P95D", - .version = "0.02", + .name = "Mitsubishi P93D/P95D", + .version = "0.05", .uri_prefix = "mitsup95d", .cmdline_arg = mitsup95d_cmdline_arg, .init = mitsup95d_init, @@ -402,6 +491,7 @@ struct dyesub_backend mitsup95d_backend = { .read_parse = mitsup95d_read_parse, .main_loop = mitsup95d_main_loop, .devices = { + { USB_VID_MITSU, USB_PID_MITSU_P93D, P_MITSU_P93D, ""}, { USB_VID_MITSU, USB_PID_MITSU_P95D, P_MITSU_P95D, ""}, { 0, 0, 0, ""} } @@ -409,7 +499,7 @@ struct dyesub_backend mitsup95d_backend = { /***************************************************** - Mitsubishi P95D Spool Format + Mitsubishi P93D/P95D Spool Format ...All fields are BIG ENDIAN. @@ -423,22 +513,31 @@ struct dyesub_backend mitsup95d_backend = { PRINT_SETUP - 1b 57 20 2e 00 0a 00 02 00 00 00 00 00 00 CC CC + 1b 57 20 2e 00 0a 00 ZZ 00 00 00 00 00 00 CC CC RR RR XX 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - XX == 01 seen in sniffs, 00 seen in dumps. Unknown! + XX == 01 seen in sniffs, 00 seen in dumps. Unknown purpose. + ZZ == 00 on P93D, 02 on P95D CC CC = columns, RR RR = rows (print dimensions) PRINT_OPTIONS + P95: 1b 57 21 2e 00 4a aa 00 20 TT 00 00 64 NN 00 MM [[ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ]] 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 XY + + P93: + + 1b 57 21 2e 00 4a aa 00 00 TT 00 00 00 NN 00 MM + [[ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 00 ]] 00 00 00 02 00 00 00 00 00 00 00 00 00 00 + 00 XY NN = copies 1..200 @@ -449,19 +548,29 @@ struct dyesub_backend mitsup95d_backend = { 02 = Date 03 = DateTime [[ .. ]] = actual comment (18 bytes), see below. + TT = media type + + P95D: + 00 = Standard 01 = High Density 02 = High Glossy 03 = High Glossy (K95HG) - X = media cut length + + P93D: + + 00 = High Density + 01 = High Glossy + 02 = Standard + + X = media cut length (P95D ONLY. P93 is 0) 4..8 (mm) Y = flags 0x04 = Paper save 0x03 = Buzzer (3 = high, 2 = low, 0 = off) - - GAMMA ???? + GAMMA (P95) 1b 57 22 2e 00 15 TT 00 00 00 00 00 LL BB CC 00 [[ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -479,7 +588,20 @@ struct dyesub_backend mitsup95d_backend = { 01 = Yes [[ .. ]] = Gamma table, loaded from LUT on disk. (skip first 16 bytes) - USER_COMMENT + GAMMA (P93) + + 1b 57 22 2e 00 d5 00 00 00 00 00 00 SS 00 LL 00 + BB 00 CC 00 00 00 00 00 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 00 00 + + SS = Sharpening (0 = low, 1 = normal, 2 = high) + LL = Gamma table + 00..04 Gamma table 1..5 + BB = Brightness (signed 8-bit) + CC = Contrast (signed 8-bit) + + USER_COMMENT (P95) 1b 58 [[ 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 @@ -488,6 +610,15 @@ struct dyesub_backend mitsup95d_backend = { [[ .. ]] = Actual comment. 34 bytes payload, 0x20 -> 0x7e (Null terminated?) + USER_COMMENT (P93) + + 1b 58 [[ 20 20 20 20 20 20 20 20 20 20 20 20 20 + 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 + 20 20 20 20 20 20 20 20 20 20 ]] + + [[ .. ]] = Actual comment. 40 bytes payload, 0x20 -> 0x7e + (Null terminated?) + IMAGE_DATA 1b 5a 74 00 00 00 YY YY CC CC RR RR @@ -505,7 +636,7 @@ struct dyesub_backend mitsup95d_backend = { ********************************* - Printer Comms: + P95D Printer Comms: STATUS query @@ -524,13 +655,32 @@ struct dyesub_backend mitsup95d_backend = { ^ \--- 0x40 appears to be a flag that indicates error. + P93D Printer Comms: + + STATUS query + + -> 1b 72 0? 00 + <- e4 72 0? 00 03 XX YY ZZ + + ? could be 0x00 or 0x03. Seen both. + +Seen: 30 30 30 + 30 43 01 <- 1 copies remaining + 30 43 00 <- 0 copies remaining + ^^ + \-- 30 == idle, 43 == printing + + 30 45 6f <- door open + 30 45 50 <- no paper + + 45 == error? **************************** UNKNOWNS: * How multiple images are stacked for printing on a single page - (col offset too? write four, then tell PRINT?) Is this the mystery 0x01? - * How to adjust printer sharpness? + (col offset too? write four, then tell PRINT?) + * How to adjust P95D printer sharpness? * Serial number query (iSerial appears bogus) * What "custom gamma" table does to spool file? diff --git a/src/cups/backend_shinkos1245.c b/src/cups/backend_shinkos1245.c index 1b24797..b92b275 100644 --- a/src/cups/backend_shinkos1245.c +++ b/src/cups/backend_shinkos1245.c @@ -1,7 +1,7 @@ /* * Shinko/Sinfonia CHC-S1245 CUPS backend -- libusb-1.0 version * - * (c) 2015-2016 Solomon Peachy <pizza@shaftnet.org> + * (c) 2015-2017 Solomon Peachy <pizza@shaftnet.org> * * Low-level documentation was provided by Sinfonia, Inc. Thank you! * @@ -135,7 +135,7 @@ struct shinkos1245_resp_status { uint8_t status1; uint32_t status2; /* BE */ uint8_t error; - } state; + } __attribute__((packed)) state; struct { uint32_t lifetime; /* BE */ uint32_t maint; /* BE */ @@ -145,13 +145,13 @@ struct shinkos1245_resp_status { uint8_t ver_boot; uint8_t ver_ctrl; uint8_t control_flag; // 0x00 == epson, 0x01 == cypress - } counters; + } __attribute__((packed)) counters; struct { uint16_t main_boot; uint16_t main_control; uint16_t dsp_boot; uint16_t dsp_control; - } versions; + } __attribute__((packed)) versions; struct { uint8_t bank1_id; uint8_t bank2_id; @@ -161,7 +161,7 @@ struct shinkos1245_resp_status { uint16_t bank2_remain; /* BE */ uint16_t bank2_complete; /* BE */ uint16_t bank2_spec; /* BE */ - } counters2; + } __attribute__((packed)) counters2; uint8_t curve_status; } __attribute__((packed)); @@ -191,14 +191,15 @@ enum { WAIT_STATUS2_BUSY = 4, }; -#define ERROR_STATUS2_CTRL_CIRCUIT (1<<31) -#define ERROR_STATUS2_MECHANISM_CTRL (1<<30) -#define ERROR_STATUS2_SENSOR (1<<13) -#define ERROR_STATUS2_COVER_OPEN (1<<12) -#define ERROR_STATUS2_TEMP_SENSOR (1<<9) -#define ERROR_STATUS2_PAPER_JAM (1<<8) -#define ERROR_STATUS2_PAPER_EMPTY (1<<6) -#define ERROR_STATUS2_RIBBON_ERR (1<<4) + +#define ERROR_STATUS2_CTRL_CIRCUIT (0x80000000) +#define ERROR_STATUS2_MECHANISM_CTRL (0x40000000) +#define ERROR_STATUS2_SENSOR (0x00002000) +#define ERROR_STATUS2_COVER_OPEN (0x00001000) +#define ERROR_STATUS2_TEMP_SENSOR (0x00000200) +#define ERROR_STATUS2_PAPER_JAM (0x00000100) +#define ERROR_STATUS2_PAPER_EMPTY (0x00000040) +#define ERROR_STATUS2_RIBBON_ERR (0x00000010) enum { CTRL_CIR_ERROR_EEPROM1 = 0x01, @@ -291,7 +292,7 @@ struct shinkos1245_mediadesc { struct shinkos1245_resp_media { uint8_t code; - uint8_t reserved[5]; + uint8_t reserved[6]; uint8_t count; /* 1-5? */ struct shinkos1245_mediadesc data[NUM_MEDIAS]; } __attribute__((packed)); @@ -399,7 +400,7 @@ struct shinkos1245_resp_matte { #define MATTE_MODE_MATTE 0x00 -/* Private data stucture */ +/* Private data structure */ struct shinkos1245_ctx { struct libusb_device_handle *dev; uint8_t endp_up; @@ -1536,7 +1537,7 @@ top: cmd.mode = (ctx->hdr.mode & 0x3f) || ((ctx->hdr.dust & 0x3) << 6); cmd.combo = ctx->hdr.method; - /* Issue print commmand */ + /* Issue print command */ i = shinkos1245_do_cmd(ctx, &cmd, sizeof(cmd), &status1, sizeof(status1), &num); @@ -1639,7 +1640,7 @@ static int shinkos1245_query_serno(struct libusb_device_handle *dev, uint8_t end struct dyesub_backend shinkos1245_backend = { .name = "Shinko/Sinfonia CHC-S1245", - .version = "0.11WIP", + .version = "0.13WIP", .uri_prefix = "shinkos1245", .cmdline_usage = shinkos1245_cmdline, .cmdline_arg = shinkos1245_cmdline_arg, diff --git a/src/cups/backend_shinkos2145.c b/src/cups/backend_shinkos2145.c index ec7bcd6..d56ca2f 100644 --- a/src/cups/backend_shinkos2145.c +++ b/src/cups/backend_shinkos2145.c @@ -90,7 +90,7 @@ struct s2145_printjob_hdr { uint32_t unk21; } __attribute__((packed)); -/* Private data stucture */ +/* Private data structure */ struct shinkos2145_ctx { struct libusb_device_handle *dev; uint8_t endp_up; @@ -591,7 +591,7 @@ static char *error_str(uint8_t v) { case ERROR_COMMS_TIMEOUT: return "Main Communication Timeout"; case ERROR_MAINT_NEEDED: - return "Maintainence Needed"; + return "Maintenance Needed"; case ERROR_BAD_COMMAND: return "Inappropriate Command"; case ERROR_PRINTER: @@ -878,7 +878,7 @@ static int get_status(struct shinkos2145_ctx *ctx) INFO(" Print Counts:\n"); INFO("\tSince Paper Changed:\t%08u\n", le32_to_cpu(resp->count_paper)); INFO("\tLifetime:\t\t%08u\n", le32_to_cpu(resp->count_lifetime)); - INFO("\tMaintainence:\t\t%08u\n", le32_to_cpu(resp->count_maint)); + INFO("\tMaintenance:\t\t%08u\n", le32_to_cpu(resp->count_maint)); INFO("\tPrint Head:\t\t%08u\n", le32_to_cpu(resp->count_head)); INFO(" Cutter Actuations:\t%08u\n", le32_to_cpu(resp->count_cutter)); INFO(" Ribbon Remaining:\t%08u\n", le32_to_cpu(resp->count_ribbon_left)); diff --git a/src/cups/backend_shinkos6145.c b/src/cups/backend_shinkos6145.c index 692a42c..e8d39b4 100644 --- a/src/cups/backend_shinkos6145.c +++ b/src/cups/backend_shinkos6145.c @@ -130,7 +130,7 @@ struct s6145_printjob_hdr { uint32_t unk19; uint32_t unk20; - uint32_t unk21; + uint32_t ext_flags; /* 0x00 in the official headers. 0x01 to mark inout data as YMC planar */ } __attribute__((packed)); /* "Image Correction Parameter" File */ @@ -259,7 +259,7 @@ struct shinkos6145_correctionparam { uint8_t pad[3948]; // @12436, null. } __attribute__((packed)); /* 16384 bytes */ -/* Private data stucture */ +/* Private data structure */ struct shinkos6145_ctx { struct libusb_device_handle *dev; uint8_t endp_up; @@ -276,7 +276,8 @@ struct shinkos6145_ctx { size_t datalen; uint8_t ribbon_type; - + uint8_t input_ymc; + uint16_t last_donor; uint16_t last_remain; uint16_t last_ribbon; @@ -365,7 +366,7 @@ static char *cmd_names(uint16_t v) { default: return "Unknown Command"; } -}; +} struct s6145_print_cmd { struct s6145_cmd_hdr hdr; @@ -780,7 +781,7 @@ static char *error_str(uint8_t v) { case ERROR_COMMS_TIMEOUT: return "Main Communication Timeout"; case ERROR_MAINT_NEEDED: - return "Maintainence Needed"; + return "Maintenance Needed"; case ERROR_BAD_COMMAND: return "Inappropriate Command"; case ERROR_PRINTER: @@ -1194,7 +1195,7 @@ static int get_status(struct shinkos6145_ctx *ctx) INFO(" Print Counts:\n"); INFO("\tSince Paper Changed:\t%08u\n", le32_to_cpu(resp->count_paper)); INFO("\tLifetime:\t\t%08u\n", le32_to_cpu(resp->count_lifetime)); - INFO("\tMaintainence:\t\t%08u\n", le32_to_cpu(resp->count_maint)); + INFO("\tMaintenance:\t\t%08u\n", le32_to_cpu(resp->count_maint)); INFO("\tPrint Head:\t\t%08u\n", le32_to_cpu(resp->count_head)); INFO(" Cutter Actuations:\t%08u\n", le32_to_cpu(resp->count_cutter)); INFO(" Ribbon Remaining:\t%08u\n", le32_to_cpu(resp->count_ribbon_left)); @@ -1229,7 +1230,7 @@ static int get_status(struct shinkos6145_ctx *ctx) return -1; INFO("Lifetime Distance: %08u inches\n", le32_to_cpu(resp2->lifetime_distance)); - INFO("Maintainence Distance: %08u inches\n", le32_to_cpu(resp2->maint_distance)); + INFO("Maintenance Distance: %08u inches\n", le32_to_cpu(resp2->maint_distance)); INFO("Head Distance: %08u inches\n", le32_to_cpu(resp2->head_distance)); /* Query various params */ @@ -2097,11 +2098,17 @@ static int shinkos6145_read_parse(void *vctx, int data_fd) { return CUPS_BACKEND_CANCEL; } + /* Extended spool format to re-purpose an unused header field. + When bit 0 is set, this tells the backend that the data is + already in planar YMC format (vs packed RGB) so we don't need + to do the conversion ourselves. Saves some processing overhead */ + ctx->input_ymc = le32_to_cpu(ctx->hdr.ext_flags) & 0x01; + if (ctx->databuf) { free(ctx->databuf); ctx->databuf = NULL; } - + ctx->datalen = le32_to_cpu(ctx->hdr.rows) * le32_to_cpu(ctx->hdr.columns) * 3; ctx->databuf = malloc(ctx->datalen); if (!ctx->databuf) { @@ -2320,10 +2327,8 @@ top: ctx->corrdata->width = cpu_to_le16(le32_to_cpu(ctx->hdr.columns)); ctx->corrdata->height = cpu_to_le16(le32_to_cpu(ctx->hdr.rows)); - /* Convert packed RGB to planar YMC */ - // XXX would it make more sense to have Gutenprint generate - // planar YMC data as an extension of the spooler format? - { + /* Convert packed RGB to planar YMC if necessary */ + if (!ctx->input_ymc) { int planelen = le16_to_cpu(ctx->corrdata->width) * le16_to_cpu(ctx->corrdata->height); uint8_t *databuf3 = malloc(ctx->datalen); @@ -2483,7 +2488,7 @@ static int shinkos6145_query_serno(struct libusb_device_handle *dev, uint8_t end struct dyesub_backend shinkos6145_backend = { .name = "Shinko/Sinfonia CHC-S6145", - .version = "0.21", + .version = "0.22", .uri_prefix = "shinkos6145", .cmdline_usage = shinkos6145_cmdline, .cmdline_arg = shinkos6145_cmdline_arg, diff --git a/src/cups/backend_shinkos6245.c b/src/cups/backend_shinkos6245.c index b5b1c2b..414d55a 100644 --- a/src/cups/backend_shinkos6245.c +++ b/src/cups/backend_shinkos6245.c @@ -90,7 +90,7 @@ struct s6245_printjob_hdr { uint32_t unk21; } __attribute__((packed)); -/* Private data stucture */ +/* Private data structure */ struct shinkos6245_ctx { struct libusb_device_handle *dev; uint8_t endp_up; @@ -612,7 +612,7 @@ static char *error_str(uint8_t v) { case ERROR_COMMS_TIMEOUT: return "Main Communication Timeout"; case ERROR_MAINT_NEEDED: - return "Maintainence Needed"; + return "Maintenance Needed"; case ERROR_BAD_COMMAND: return "Inappropriate Command"; case ERROR_PRINTER: @@ -1003,7 +1003,7 @@ static int get_status(struct shinkos6245_ctx *ctx) INFO(" Print Counts:\n"); INFO("\tSince Paper Changed:\t%08u\n", le32_to_cpu(resp->count_paper)); INFO("\tLifetime:\t\t%08u\n", le32_to_cpu(resp->count_lifetime)); - INFO("\tMaintainence:\t\t%08u\n", le32_to_cpu(resp->count_maint)); + INFO("\tMaintenance:\t\t%08u\n", le32_to_cpu(resp->count_maint)); INFO("\tPrint Head:\t\t%08u\n", le32_to_cpu(resp->count_head)); INFO(" Cutter Actuations:\t%08u\n", le32_to_cpu(resp->count_cutter)); INFO(" Ribbon Remaining:\t%08u\n", le32_to_cpu(resp->count_ribbon_left)); @@ -1038,7 +1038,7 @@ static int get_status(struct shinkos6245_ctx *ctx) return 0; INFO("Lifetime Distance: %08u inches\n", le32_to_cpu(resp2->lifetime_distance)); - INFO("Maintainence Distance: %08u inches\n", le32_to_cpu(resp2->maint_distance)); + INFO("Maintenance Distance: %08u inches\n", le32_to_cpu(resp2->maint_distance)); INFO("Head Distance: %08u inches\n", le32_to_cpu(resp2->head_distance)); return 0; diff --git a/src/cups/backend_sonyupdr150.c b/src/cups/backend_sonyupdr150.c index be8423f..a914d3f 100644 --- a/src/cups/backend_sonyupdr150.c +++ b/src/cups/backend_sonyupdr150.c @@ -45,7 +45,7 @@ #define USB_PID_SONY_UPDR200 0x035F #define USB_PID_SONY_UPCR10 0x0226 -/* Private data stucture */ +/* Private data structure */ struct updr150_ctx { struct libusb_device_handle *dev; uint8_t endp_up; diff --git a/src/cups/blacklist b/src/cups/blacklist index b0ddd2d..191e97d 100644 --- a/src/cups/blacklist +++ b/src/cups/blacklist @@ -75,6 +75,9 @@ # Canon SELPHY CP810 0x04a9 0x3256 blacklist +# Canon SELPHY CP820 +0x04a9 0x327b blacklist + # Canon SELPHY CP900 0x04a9 0x3255 blacklist @@ -178,6 +181,9 @@ # Mitsubishi CP-9810D/DW 0x06d3 0x3b21 blacklist +# Mitsubishi P93D +0x06d3 0x0398 blacklist + # Mitsubishi P95D 0x06d3 0x3b10 blacklist diff --git a/src/cups/cups-calibrate.c b/src/cups/cups-calibrate.c index cc1c789..205157b 100644 --- a/src/cups/cups-calibrate.c +++ b/src/cups/cups-calibrate.c @@ -370,7 +370,7 @@ main(int argc, if (system(lpoptionscommand) == 0) puts("Calibration profile successfully saved."); else - puts("An error occured while saving the calibration profile."); + puts("An error occurred while saving the calibration profile."); return (0); } diff --git a/src/cups/genppd.c b/src/cups/genppd.c index 2121f9d..49c13a9 100644 --- a/src/cups/genppd.c +++ b/src/cups/genppd.c @@ -685,6 +685,7 @@ main(int argc, /* I - Number of command-line arguments */ return 1; } } while (pid > 0); + stp_free(subprocesses); } if (parent && !verbose) fprintf(stderr, " done.\n"); diff --git a/src/cups/rastertoprinter.c b/src/cups/rastertoprinter.c index 7cc3501..23faa85 100644 --- a/src/cups/rastertoprinter.c +++ b/src/cups/rastertoprinter.c @@ -636,8 +636,8 @@ purge_excess_data(cups_image_t *cups) char *buffer = stp_malloc(cups->header.cupsBytesPerLine); if (buffer) { - if (! suppress_messages) - fprintf(stderr, "DEBUG: Gutenprint: Purging %d row%s\n", + if (! suppress_messages && ! suppress_verbose_messages ) + fprintf(stderr, "DEBUG2: Gutenprint: Purging %d row%s\n", cups->header.cupsHeight - cups->row, ((cups->header.cupsHeight - cups->row) == 1 ? "" : "s")); while (cups->row < cups->header.cupsHeight) @@ -1298,6 +1298,7 @@ main(int argc, /* I - Number of command-line arguments */ stp_set_float_parameter(default_settings, "AppGamma", 1.0); set_all_options(default_settings, options, num_options, ppd); + cupsFreeOptions(num_options, options); ppdClose(ppd); cups.ras = cupsRasterOpen(fd, CUPS_RASTER_READ); diff --git a/src/cups/test-ppds b/src/cups/test-ppds index 7d8713c..27e5a8d 100755 --- a/src/cups/test-ppds +++ b/src/cups/test-ppds @@ -1,5 +1,23 @@ #!/bin/sh +# Test PPD conformance +# +# Copyright 2006-2017 Robert Krawitz (rlk@alum.mit.edu) +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the Free +# Software Foundation; either version 2 of the License, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + # Keeping this up to date with changing CUPS versions is a real headache make EXTRA_GENPPD_OPTS='-b -Z' ppd-clean ppd-global ppd-nls ppd-nonls diff --git a/src/cups/test-rastertogutenprint.in b/src/cups/test-rastertogutenprint.in index c64a8e4..b6a5b70 100755 --- a/src/cups/test-rastertogutenprint.in +++ b/src/cups/test-rastertogutenprint.in @@ -1,5 +1,23 @@ #!@SHELL@ +# Driver for rastertogutenprint tester. +# +# Copyright 2007-2017 Robert Krawitz (rlk@alum.mit.edu) +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the Free +# Software Foundation; either version 2 of the License, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + retval=0 if [ -z "$srcdir" -o "$srcdir" = "." ] ; then @@ -83,7 +101,7 @@ if [ -n "$md5dir" -a ! -d "$md5dir" ] ; then mkdir -p "$md5dir" fi -version="5.2"; +version="@GUTENPRINT_RELEASE_VERSION@"; cupsdir="/usr/lib/cups/filter" if [ -x "$cupsdir/pstoraster" -o -x "$cupsdir/gstoraster" -o -x "$cupsdir/cgpdftoraster" ] ; then pages="24-`expr 24 + $npages - 1`" diff --git a/src/escputil/Makefile.in b/src/escputil/Makefile.in index 838b6c6..9b450de 100644 --- a/src/escputil/Makefile.in +++ b/src/escputil/Makefile.in @@ -189,9 +189,11 @@ BZIP2 = @BZIP2@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +COMPRESS = @COMPRESS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSUF = @CSUF@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LIBS = @CUPS_LIBS@ @@ -250,6 +252,7 @@ GUTENPRINT_MICRO_VERSION = @GUTENPRINT_MICRO_VERSION@ GUTENPRINT_MINOR_VERSION = @GUTENPRINT_MINOR_VERSION@ GUTENPRINT_RELEASE_VERSION = @GUTENPRINT_RELEASE_VERSION@ GUTENPRINT_VERSION = @GUTENPRINT_VERSION@ +GZIP = @GZIP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -275,6 +278,7 @@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ +LRZIP = @LRZIP@ LTALLOCA = @LTALLOCA@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ @@ -302,6 +306,7 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ +PKGROOT = @PKGROOT@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ @@ -310,6 +315,7 @@ POSUB = @POSUB@ RANLIB = @RANLIB@ RELEASE_DATE = @RELEASE_DATE@ RM = @RM@ +RZIP = @RZIP@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ @@ -322,6 +328,7 @@ VERSION = @VERSION@ WHICH_PPDS = @WHICH_PPDS@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ +XZ = @XZ@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ diff --git a/src/escputil/d4lib.c b/src/escputil/d4lib.c index a8e9ff2..e6cc1aa 100644 --- a/src/escputil/d4lib.c +++ b/src/escputil/d4lib.c @@ -31,7 +31,7 @@ * * The best way to get the Stylus Scanner working is to test * this and also correct my possibly errors. - * Programming knowledge will be helpfull for this. + * Programming knowledge will be helpful for this. * */ @@ -151,14 +151,14 @@ static errorMessage_t errorMessage[] = { 0x03, "Transaction channel can't be closed." ,0 }, { 0x04, "No sufficient resources available now." ,0 }, { 0x05, "Connection denied." ,1 }, - { 0x06, "Channel allready open." ,0 }, + { 0x06, "Channel already open." ,0 }, { 0x07, "Credit overflow, previous credit remain valid." ,0 }, { 0x08, "Channel is not open." ,1 }, { 0x09, "Service not available on specified socket." ,1 }, { 0x0a, "Service name to socket ID failed." ,1 }, { 0x0b, "Init transaction failed." ,1 }, { 0x0c, "Invalid packet size." ,1 }, - { 0x0d, "Requested packed size is 0, no data can be transfered." ,0 }, + { 0x0d, "Requested packed size is 0, no data can be transferred." ,0 }, { 0x80, "Malformed packet, ignored." ,1 }, { 0x81, "No credit for received packet, ignored" ,0 }, { 0x82, "Reply doesn't match with outstanding command, ignored." ,1 }, @@ -377,7 +377,7 @@ static void printCmdType(unsigned char *cmd) /*******************************************************************/ /* Function writeCmd() */ -/* write a commmand */ +/* write a command */ /* Input: int fd file handle */ /* char *cmd the data are to be put here */ /* int len the number of bytes to read */ @@ -533,7 +533,7 @@ int readAnswer(int fd, unsigned char *buf, int len, int allowExtra) { /* the bytes idx 2 and 3 contain the length */ /* in case of errors this may differ from */ - /* the expected lenght. Setting len to this */ + /* the expected length. Setting len to this */ /* value will avoid waiting for timeout */ int newlen = (buf[2] << 8) + buf[3]; if (len > newlen) diff --git a/src/gimp2/Makefile.in b/src/gimp2/Makefile.in index e0bf142..c3a9ff5 100644 --- a/src/gimp2/Makefile.in +++ b/src/gimp2/Makefile.in @@ -194,9 +194,11 @@ BZIP2 = @BZIP2@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +COMPRESS = @COMPRESS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSUF = @CSUF@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LIBS = @CUPS_LIBS@ @@ -255,6 +257,7 @@ GUTENPRINT_MICRO_VERSION = @GUTENPRINT_MICRO_VERSION@ GUTENPRINT_MINOR_VERSION = @GUTENPRINT_MINOR_VERSION@ GUTENPRINT_RELEASE_VERSION = @GUTENPRINT_RELEASE_VERSION@ GUTENPRINT_VERSION = @GUTENPRINT_VERSION@ +GZIP = @GZIP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -280,6 +283,7 @@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ +LRZIP = @LRZIP@ LTALLOCA = @LTALLOCA@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ @@ -307,6 +311,7 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ +PKGROOT = @PKGROOT@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ @@ -315,6 +320,7 @@ POSUB = @POSUB@ RANLIB = @RANLIB@ RELEASE_DATE = @RELEASE_DATE@ RM = @RM@ +RZIP = @RZIP@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ @@ -327,6 +333,7 @@ VERSION = @VERSION@ WHICH_PPDS = @WHICH_PPDS@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ +XZ = @XZ@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ diff --git a/src/gimp2/print.c b/src/gimp2/print.c index afb50cd..756a1d1 100644 --- a/src/gimp2/print.c +++ b/src/gimp2/print.c @@ -35,6 +35,7 @@ #include <unistd.h> #include <stdio.h> #include <string.h> +#include <stdlib.h> #include "print-intl.h" @@ -82,34 +83,15 @@ query (void) { static GimpParamDef args[] = { - { GIMP_PDB_INT32, (BAD_CONST_CHAR) "run_mode", (BAD_CONST_CHAR) "Interactive, non-interactive" }, - { GIMP_PDB_IMAGE, (BAD_CONST_CHAR) "image", (BAD_CONST_CHAR) "Input image" }, - { GIMP_PDB_DRAWABLE, (BAD_CONST_CHAR) "drawable", (BAD_CONST_CHAR) "Input drawable" }, - { GIMP_PDB_STRING, (BAD_CONST_CHAR) "output_to", (BAD_CONST_CHAR) "Print command or filename (| to pipe to command)" }, + { GIMP_PDB_INT32, (BAD_CONST_CHAR) "run_mode",(BAD_CONST_CHAR) "Interactive, non-interactive" }, + { GIMP_PDB_IMAGE, (BAD_CONST_CHAR) "image", (BAD_CONST_CHAR) "Input image" }, + { GIMP_PDB_DRAWABLE,(BAD_CONST_CHAR) "drawable",(BAD_CONST_CHAR) "Input drawable" }, { GIMP_PDB_STRING, (BAD_CONST_CHAR) "driver", (BAD_CONST_CHAR) "Printer driver short name" }, - { GIMP_PDB_STRING, (BAD_CONST_CHAR) "ppd_file", (BAD_CONST_CHAR) "PPD file" }, - { GIMP_PDB_INT32, (BAD_CONST_CHAR) "output_type", (BAD_CONST_CHAR) "Output type (0 = gray, 1 = color)" }, - { GIMP_PDB_STRING, (BAD_CONST_CHAR) "resolution", (BAD_CONST_CHAR) "Resolution (\"300\", \"720\", etc.)" }, - { GIMP_PDB_STRING, (BAD_CONST_CHAR) "media_size", (BAD_CONST_CHAR) "Media size (\"Letter\", \"A4\", etc.)" }, - { GIMP_PDB_STRING, (BAD_CONST_CHAR) "media_type", (BAD_CONST_CHAR) "Media type (\"Plain\", \"Glossy\", etc.)" }, - { GIMP_PDB_STRING, (BAD_CONST_CHAR) "media_source", (BAD_CONST_CHAR) "Media source (\"Tray1\", \"Manual\", etc.)" }, - { GIMP_PDB_FLOAT, (BAD_CONST_CHAR) "brightness", (BAD_CONST_CHAR) "Brightness (0-400%)" }, - { GIMP_PDB_FLOAT, (BAD_CONST_CHAR) "scaling", (BAD_CONST_CHAR) "Output scaling (0-100%, -PPI)" }, - { GIMP_PDB_INT32, (BAD_CONST_CHAR) "orientation", (BAD_CONST_CHAR) "Output orientation (-1 = auto, 0 = portrait, 1 = landscape)" }, - { GIMP_PDB_INT32, (BAD_CONST_CHAR) "left", (BAD_CONST_CHAR) "Left offset (points, -1 = centered)" }, - { GIMP_PDB_INT32, (BAD_CONST_CHAR) "top", (BAD_CONST_CHAR) "Top offset (points, -1 = centered)" }, - { GIMP_PDB_FLOAT, (BAD_CONST_CHAR) "gamma", (BAD_CONST_CHAR) "Output gamma (0.1 - 3.0)" }, - { GIMP_PDB_FLOAT, (BAD_CONST_CHAR) "contrast", (BAD_CONST_CHAR) "Contrast" }, - { GIMP_PDB_FLOAT, (BAD_CONST_CHAR) "cyan", (BAD_CONST_CHAR) "Cyan level" }, - { GIMP_PDB_FLOAT, (BAD_CONST_CHAR) "magenta", (BAD_CONST_CHAR) "Magenta level" }, - { GIMP_PDB_FLOAT, (BAD_CONST_CHAR) "yellow", (BAD_CONST_CHAR) "Yellow level" }, - { GIMP_PDB_INT32, (BAD_CONST_CHAR) "linear", (BAD_CONST_CHAR) "Linear output (0 = normal, 1 = linear)" }, - { GIMP_PDB_INT32, (BAD_CONST_CHAR) "image_type", (BAD_CONST_CHAR) "Image type (0 = line art, 1 = solid tones, 2 = continuous tone, 3 = monochrome)"}, - { GIMP_PDB_FLOAT, (BAD_CONST_CHAR) "saturation", (BAD_CONST_CHAR) "Saturation (0-1000%)" }, - { GIMP_PDB_FLOAT, (BAD_CONST_CHAR) "density", (BAD_CONST_CHAR) "Density (0-200%)" }, - { GIMP_PDB_STRING, (BAD_CONST_CHAR) "ink_type", (BAD_CONST_CHAR) "Type of ink or cartridge" }, - { GIMP_PDB_STRING, (BAD_CONST_CHAR) "dither_algorithm", (BAD_CONST_CHAR) "Dither algorithm" }, - { GIMP_PDB_INT32, (BAD_CONST_CHAR) "unit", (BAD_CONST_CHAR) "Unit 0=Inches 1=Metric" }, + { GIMP_PDB_STRING, (BAD_CONST_CHAR) "printer_queue",(BAD_CONST_CHAR) "CUPS Printer Queue" }, + { GIMP_PDB_INT32, (BAD_CONST_CHAR) "left", (BAD_CONST_CHAR) "Left offset (points, -1 = centered)" }, + { GIMP_PDB_INT32, (BAD_CONST_CHAR) "top", (BAD_CONST_CHAR) "Top offset (points, -1 = centered)" }, + { GIMP_PDB_INT32, (BAD_CONST_CHAR) "length_key_value_array", (BAD_CONST_CHAR) "Length of the key-value array" }, + { GIMP_PDB_STRINGARRAY, (BAD_CONST_CHAR) "keys", (BAD_CONST_CHAR) "Key-value pairs for Gutenprint Settings" }, }; static const gchar *blurb = "This plug-in prints images from The GIMP using Gutenprint directly."; @@ -161,6 +143,7 @@ run (const char *name, /* I - Name of print program. */ stpui_image_t *image; gint32 image_ID; gint32 base_type; + stp_parameter_t desc; if (getenv("STP_DEBUG_STARTUP")) while (SDEBUG) ; @@ -216,25 +199,25 @@ run (const char *name, /* I - Name of print program. */ /* eventually export the image */ switch (run_mode) - { - case GIMP_RUN_INTERACTIVE: + { + case GIMP_RUN_INTERACTIVE: case GIMP_RUN_WITH_LAST_VALS: gimp_ui_init ("print", TRUE); export = gimp_export_image (&image_ID, &drawable_ID, "Print", - (GIMP_EXPORT_CAN_HANDLE_RGB | - GIMP_EXPORT_CAN_HANDLE_GRAY | - GIMP_EXPORT_CAN_HANDLE_INDEXED | - GIMP_EXPORT_CAN_HANDLE_ALPHA)); + (GIMP_EXPORT_CAN_HANDLE_RGB | + GIMP_EXPORT_CAN_HANDLE_GRAY | + GIMP_EXPORT_CAN_HANDLE_INDEXED | + GIMP_EXPORT_CAN_HANDLE_ALPHA)); if (export == GIMP_EXPORT_CANCEL) - { - *nreturn_vals = 1; - values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; - return; - } + { + values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; + fprintf(stderr,"Cannot handle image type\n"); + return; + } break; - default: - break; - } + default: + break; + } /* * Get drawable... @@ -247,17 +230,17 @@ run (const char *name, /* I - Name of print program. */ stpui_set_image_channel_depth(8); base_type = gimp_image_base_type(image_ID); switch (base_type) - { - case GIMP_INDEXED: - case GIMP_RGB: - stpui_set_image_type("RGB"); - break; - case GIMP_GRAY: - stpui_set_image_type("Whitescale"); - break; - default: - break; - } + { + case GIMP_INDEXED: + case GIMP_RGB: + stpui_set_image_type("RGB"); + break; + case GIMP_GRAY: + stpui_set_image_type("Whitescale"); + break; + default: + break; + } image = Image_GimpDrawable_new(drawable, image_ID); stp_set_float_parameter(gimp_vars.v, "AppGamma", gimp_gamma()); @@ -267,105 +250,242 @@ run (const char *name, /* I - Name of print program. */ */ switch (run_mode) - { - case GIMP_RUN_INTERACTIVE: - /* - * Get information from the dialog... - */ + { + case GIMP_RUN_INTERACTIVE: + /* + * Get information from the dialog... + */ - if (!do_print_dialog (name, image_ID)) - goto cleanup; + if (!do_print_dialog (name, image_ID)) + { + values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; + } + else + { stpui_plist_copy(&gimp_vars, stpui_get_current_printer()); - break; - - case GIMP_RUN_NONINTERACTIVE: - /* - * Make sure all the arguments are present... - */ - if (nparams < 11) - values[0].data.d_status = GIMP_PDB_CALLING_ERROR; - else - { -#if 0 - /* What do we do with old output_to? Probably best ignore it. */ - stpui_plist_set_output_to(&gimp_vars, param[3].data.d_string); -#endif - stp_set_driver(gimp_vars.v, param[4].data.d_string); - stp_set_file_parameter(gimp_vars.v, "PPDFile", param[5].data.d_string); - switch (param[6].data.d_int32) - { - case 0: - default: - stp_set_string_parameter(gimp_vars.v, "PrintingMode", "BW"); - break; - case 1: - stp_set_string_parameter(gimp_vars.v, "PrintingMode", "Color"); - } - stp_set_string_parameter(gimp_vars.v, "Resolution", param[7].data.d_string); - stp_set_string_parameter(gimp_vars.v, "PageSize", param[8].data.d_string); - stp_set_string_parameter(gimp_vars.v, "MediaType", param[9].data.d_string); - stp_set_string_parameter(gimp_vars.v, "InputSlot", param[10].data.d_string); - - if (nparams > 11) - stp_set_float_parameter(gimp_vars.v, "Brightness", param[11].data.d_float); - - if (nparams > 12) - gimp_vars.scaling = param[12].data.d_float; - - if (nparams > 13) - gimp_vars.orientation = param[13].data.d_int32; - - if (nparams > 14) - stp_set_left(gimp_vars.v, param[14].data.d_int32); - - if (nparams > 15) - stp_set_top(gimp_vars.v, param[15].data.d_int32); + } + break; - if (nparams > 16) - stp_set_float_parameter(gimp_vars.v, "Gamma", param[16].data.d_float); + case GIMP_RUN_NONINTERACTIVE: + /* + * Make sure all the arguments are present... + */ + if (nparams < 9) + values[0].data.d_status = GIMP_PDB_CALLING_ERROR; + else + { + gimp_image_get_resolution(image_ID, &xres, &yres); + gdouble pixwidth = gimp_drawable_width(drawable_ID); + gdouble pixheight = gimp_drawable_height(drawable_ID); + gdouble pointwidth = gimp_pixels_to_units(pixwidth, GIMP_UNIT_POINT, xres); + gdouble pointheight = gimp_pixels_to_units(pixheight, GIMP_UNIT_POINT, yres); - if (nparams > 17) - stp_set_float_parameter(gimp_vars.v, "Contrast", param[17].data.d_float); + stp_set_height(gimp_vars.v, pointheight); + stp_set_width(gimp_vars.v, pointwidth); - if (nparams > 18) - stp_set_float_parameter(gimp_vars.v, "Cyan", param[18].data.d_float); + /* + * Avoid calling stpui_print with an invalid driver (SEGFAULT) + */ - if (nparams > 19) - stp_set_float_parameter(gimp_vars.v, "Magenta", param[19].data.d_float); + if (! stp_get_printer_by_driver(param[3].data.d_string) ) + { + values[0].data.d_status = GIMP_PDB_CALLING_ERROR; + fprintf(stderr, "Unknown driver %s\n", stp_get_driver(gimp_vars.v)); + break; + } - if (nparams > 20) - stp_set_float_parameter(gimp_vars.v, "Yellow", param[20].data.d_float); + stp_set_driver(gimp_vars.v, param[3].data.d_string); - if (nparams > 21) - stp_set_string_parameter(gimp_vars.v, "ImageOptimization", param[21].data.d_string); + stpui_plist_set_queue_name(&gimp_vars, param[4].data.d_string); - if (nparams > 22) - stp_set_float_parameter(gimp_vars.v, "Saturation", param[23].data.d_float); + /* + * Left offset (points, -1 = centered) + */ - if (nparams > 23) - stp_set_float_parameter(gimp_vars.v, "Density", param[24].data.d_float); + stp_set_left(gimp_vars.v, param[6].data.d_int32); - if (nparams > 24) - stp_set_string_parameter(gimp_vars.v, "InkType", param[25].data.d_string); + /* + * Top offset (points, -1 = centered) + */ - if (nparams > 25) - stp_set_string_parameter(gimp_vars.v, "DitherAlgorithm", - param[26].data.d_string); + stp_set_top(gimp_vars.v, param[5].data.d_int32); - if (nparams > 26) - gimp_vars.unit = param[27].data.d_int32; - } + /* + * Parse remaining parameters from key-value string array + */ - break; + int kv_arr_len = param[7].data.d_int32; + + if (kv_arr_len % 2 != 0) + { + /* + * Key with no Value + */ + + values[0].data.d_status = GIMP_PDB_CALLING_ERROR; + fprintf(stderr,"Key with no value provided\n"); + } else { + + int k = 0; + for( k=0; k<kv_arr_len && values[0].data.d_status == GIMP_PDB_SUCCESS; k+=2 ) + { + char *key = param[8].data.d_stringarray[k]; + char *value = param[8].data.d_stringarray[k + 1]; + char *endptr = NULL; + float float_value = 0; + + stp_describe_parameter(gimp_vars.v, key, &desc); + + switch(desc.p_type) + { + case STP_PARAMETER_TYPE_STRING_LIST: + + /* + * Some useful string stp parameters + * + * "PrintingMode": BW, Color + * "Resolution": "300", "720", etc. + * "PageSize": "Letter", "A4", etc. TODO: Support Custom + * "MediaType": "Plain", "Glossy", etc. + * "InputSlot": "Tray1", "Manual", etc. + * "ColorCorrection": Color Correction model + * "InkType": Type of ink or cartridge + * "InkSet": Set of inks to use + * "DitherAlgorithm": Dither algorithm + * "Weave": Weave method + * "PrintingDirection": "Bidirectional", "Unidirectional" + */ + + stp_set_string_parameter(gimp_vars.v, key, value); + break; + + case STP_PARAMETER_TYPE_INT: + stp_set_int_parameter(gimp_vars.v, key, atoi(value)); + break; + + case STP_PARAMETER_TYPE_BOOLEAN: + stp_set_boolean_parameter(gimp_vars.v, key, atoi(value)); + break; + + case STP_PARAMETER_TYPE_DOUBLE: + + /* + * Some useful floating point stp parameters + * + * "Brightness" 0-400% + * "Gamma" Output gamma 0.1 - 3.0 + * "Contrast" 0.1 - 3.0 + * "Saturation" 0-1000% + * "Density" 0-200% + * "DropSize1" 0.0-1.0 + * "DropSize2" 0.0-1.0 + * "DropSize3" 0.0-1.0 + */ + + float_value = strtof(value, &endptr); + if (float_value == 0 && endptr == value) + { + /* + * No conversion was performed -- invalid floating point number + */ + *nreturn_vals = 1; + values[0].data.d_status = GIMP_PDB_CALLING_ERROR; + fprintf(stderr,"Invalid floating point value provided for key: %s\n", key); + } + else + { + stp_set_float_parameter(gimp_vars.v, key, float_value); + } + break; + + case STP_PARAMETER_TYPE_CURVE: + case STP_PARAMETER_TYPE_FILE: + case STP_PARAMETER_TYPE_RAW: + case STP_PARAMETER_TYPE_ARRAY: + case STP_PARAMETER_TYPE_DIMENSION: + values[0].data.d_status = GIMP_PDB_CALLING_ERROR; + fprintf(stderr,"Parameter type unsupported in gimp2 plugin for parameter %s\n", key); + break; + + case STP_PARAMETER_TYPE_INVALID: + + /* + * Output scaling (0-100%, -PPI) + */ + + if (strncmp("Scaling", key, 7) == 0) + { + float_value = strtof(value, &endptr); + if (float_value == 0 && endptr == value) + { + /* + * No conversion was performed -- invalid floating point number + */ + + values[0].data.d_status = GIMP_PDB_CALLING_ERROR; + fprintf(stderr,"Invalid floating point value provided for key: Scaling\n"); + } + else + { + gimp_vars.scaling = float_value; + + if (gimp_vars.scaling == 0) { + values[0].data.d_status = GIMP_PDB_CALLING_ERROR; + fprintf(stderr,"Scaling cannot be 0\n"); + } + else if (gimp_vars.scaling > 0) + { + /* + * Scaling > 0 in % + */ + + stp_set_width(gimp_vars.v, pointwidth * gimp_vars.scaling / 100.); + stp_set_height(gimp_vars.v, pointheight * gimp_vars.scaling / 100.); + } + else /* gimp_vars < 0 */ + { + /* + * Scaling < 0 in DPI + */ + + pointwidth = gimp_pixels_to_units(pixwidth, GIMP_UNIT_POINT, -gimp_vars.scaling); + pointheight = gimp_pixels_to_units(pixheight, GIMP_UNIT_POINT, -gimp_vars.scaling); + stp_set_width(gimp_vars.v, pointwidth); + stp_set_height(gimp_vars.v, pointheight); + } + } + break; + } + + /* + * Output orientation (-1 = auto, 0 = portrait, 1 = landscape) + */ + + else if (strncmp("Orientation", key, 11) == 0) + { + gimp_vars.orientation = atoi(value); + break; + } + + default: + values[0].data.d_status = GIMP_PDB_CALLING_ERROR; + fprintf(stderr,"Parameter unsupported in gimp2 plugin for parameter %s\n", key); + break; + } + stp_parameter_description_destroy(&desc); + } + } + } + break; - case GIMP_RUN_WITH_LAST_VALS: - values[0].data.d_status = GIMP_PDB_CALLING_ERROR; - break; + case GIMP_RUN_WITH_LAST_VALS: + values[0].data.d_status = GIMP_PDB_CALLING_ERROR; + break; - default: - values[0].data.d_status = GIMP_PDB_CALLING_ERROR; - break; - } + default: + values[0].data.d_status = GIMP_PDB_CALLING_ERROR; + break; + } if (gimp_thumbnail_data) g_free(gimp_thumbnail_data); @@ -374,38 +494,39 @@ run (const char *name, /* I - Name of print program. */ * Print the image... */ if (values[0].data.d_status == GIMP_PDB_SUCCESS) + { + /* + * Set the tile cache size... + */ + + if (drawable->height > drawable->width) + gimp_tile_cache_ntiles ((drawable->height + gimp_tile_width () - 1) / + gimp_tile_width () + 1); + else + gimp_tile_cache_ntiles ((drawable->width + gimp_tile_width () - 1) / + gimp_tile_width () + 1); + + if (! stpui_print(&gimp_vars, image)) { - /* - * Set the tile cache size... - */ - - if (drawable->height > drawable->width) - gimp_tile_cache_ntiles ((drawable->height + gimp_tile_width () - 1) / - gimp_tile_width () + 1); - else - gimp_tile_cache_ntiles ((drawable->width + gimp_tile_width () - 1) / - gimp_tile_width () + 1); + values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; + } - if (! stpui_print(&gimp_vars, image)) - values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; - - /* - * Store data... - * FIXME! This is broken! - */ + /* + * Store data... + * FIXME! This is broken! + */ #if 0 - if (run_mode == GIMP_RUN_INTERACTIVE) - gimp_set_data (PLUG_IN_NAME, vars, sizeof (vars)); + if (run_mode == GIMP_RUN_INTERACTIVE) + gimp_set_data (PLUG_IN_NAME, vars, sizeof (vars)); #endif - } + } /* * Detach from the drawable... */ gimp_drawable_detach (drawable); - cleanup: if (export == GIMP_EXPORT_EXPORT) gimp_image_delete (image_ID); stp_vars_destroy(gimp_vars.v); diff --git a/src/gutenprintui2/Makefile.in b/src/gutenprintui2/Makefile.in index 453273a..f0cf463 100644 --- a/src/gutenprintui2/Makefile.in +++ b/src/gutenprintui2/Makefile.in @@ -250,9 +250,11 @@ BZIP2 = @BZIP2@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +COMPRESS = @COMPRESS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSUF = @CSUF@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LIBS = @CUPS_LIBS@ @@ -311,6 +313,7 @@ GUTENPRINT_MICRO_VERSION = @GUTENPRINT_MICRO_VERSION@ GUTENPRINT_MINOR_VERSION = @GUTENPRINT_MINOR_VERSION@ GUTENPRINT_RELEASE_VERSION = @GUTENPRINT_RELEASE_VERSION@ GUTENPRINT_VERSION = @GUTENPRINT_VERSION@ +GZIP = @GZIP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -336,6 +339,7 @@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ +LRZIP = @LRZIP@ LTALLOCA = @LTALLOCA@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ @@ -363,6 +367,7 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ +PKGROOT = @PKGROOT@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ @@ -371,6 +376,7 @@ POSUB = @POSUB@ RANLIB = @RANLIB@ RELEASE_DATE = @RELEASE_DATE@ RM = @RM@ +RZIP = @RZIP@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ @@ -383,6 +389,7 @@ VERSION = @VERSION@ WHICH_PPDS = @WHICH_PPDS@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ +XZ = @XZ@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ diff --git a/src/gutenprintui2/printrcl.c b/src/gutenprintui2/printrcl.c index 61d3863..4d66c44 100644 --- a/src/gutenprintui2/printrcl.c +++ b/src/gutenprintui2/printrcl.c @@ -196,12 +196,12 @@ struct yy_buffer_state /* Size of input buffer in bytes, not including room for EOB * characters. */ - yy_size_t yy_buf_size; + int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - yy_size_t yy_n_chars; + int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -271,7 +271,7 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; -static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ +static int yy_n_chars; /* number of characters read into yy_ch_buf */ yy_size_t yyleng; /* Points to current character in buffer. */ @@ -356,7 +356,7 @@ static void yy_fatal_error (yyconst char msg[] ); */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ - yyleng = (size_t) (yy_cp - yy_bp); \ + yyleng = (int) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; @@ -893,7 +893,7 @@ static int input (void ); else \ { \ errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ + while ( (result = (int) fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ @@ -1021,7 +1021,7 @@ yy_match: if ( yy_current_state >= 336 ) yy_c = yy_meta[(unsigned int) yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 654 ); @@ -1437,7 +1437,7 @@ static int yy_get_next_buffer (void) else { - yy_size_t num_to_read = + int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) @@ -1472,7 +1472,7 @@ static int yy_get_next_buffer (void) (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + num_to_read = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; } @@ -1506,9 +1506,9 @@ static int yy_get_next_buffer (void) else ret_val = EOB_ACT_CONTINUE_SCAN; - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + if ((int) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); @@ -1546,7 +1546,7 @@ static int yy_get_next_buffer (void) if ( yy_current_state >= 336 ) yy_c = yy_meta[(unsigned int) yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; } return yy_current_state; @@ -1574,7 +1574,7 @@ static int yy_get_next_buffer (void) if ( yy_current_state >= 336 ) yy_c = yy_meta[(unsigned int) yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; yy_is_jam = (yy_current_state == 335); return yy_is_jam ? 0 : yy_current_state; @@ -1592,7 +1592,7 @@ static int yy_get_next_buffer (void) if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register yy_size_t number_to_move = (yy_n_chars) + 2; + register int number_to_move = (yy_n_chars) + 2; register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; register char *source = @@ -1604,7 +1604,7 @@ static int yy_get_next_buffer (void) yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size; if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); @@ -2000,7 +2000,7 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) { - return yy_scan_bytes(yystr,strlen(yystr) ); + return yy_scan_bytes(yystr,(int) strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to yylex() will @@ -2018,7 +2018,7 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len int i; /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; + n = (yy_size_t) _yybytes_len + 2; buf = (char *) yyalloc(n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); diff --git a/src/main/Makefile.in b/src/main/Makefile.in index 1e89eb9..defa705 100644 --- a/src/main/Makefile.in +++ b/src/main/Makefile.in @@ -344,9 +344,11 @@ BZIP2 = @BZIP2@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +COMPRESS = @COMPRESS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSUF = @CSUF@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LIBS = @CUPS_LIBS@ @@ -405,6 +407,7 @@ GUTENPRINT_MICRO_VERSION = @GUTENPRINT_MICRO_VERSION@ GUTENPRINT_MINOR_VERSION = @GUTENPRINT_MINOR_VERSION@ GUTENPRINT_RELEASE_VERSION = @GUTENPRINT_RELEASE_VERSION@ GUTENPRINT_VERSION = @GUTENPRINT_VERSION@ +GZIP = @GZIP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -430,6 +433,7 @@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ +LRZIP = @LRZIP@ LTALLOCA = @LTALLOCA@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ @@ -457,6 +461,7 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ +PKGROOT = @PKGROOT@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ @@ -465,6 +470,7 @@ POSUB = @POSUB@ RANLIB = @RANLIB@ RELEASE_DATE = @RELEASE_DATE@ RM = @RM@ +RZIP = @RZIP@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ @@ -477,6 +483,7 @@ VERSION = @VERSION@ WHICH_PPDS = @WHICH_PPDS@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ +XZ = @XZ@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ diff --git a/src/main/canon-inks.h b/src/main/canon-inks.h index 6d42d3e..e3f3084 100644 --- a/src/main/canon-inks.h +++ b/src/main/canon-inks.h @@ -219,14 +219,14 @@ DECLARE_INK(4,16); DECLARE_INK(8,16); -/* A inkset is a list of inks and their (relative) densities +/* An inkset is a list of inks and their (relative) densities * For printers that use the extended SetImage command t) * the inkset will be used to build the parameter list * therefore invalid inksets will let the printer fallback * to a default mode which will then lead to wrong output * use {0,0.0,NULL} for undefined placeholder inks * set density to 0.0 to disable certain inks - * the paramters will then still occure in the t) command + * the parameters will then still occure in the t) command * * names: * inksets are named canon_X_ where X is the number of possible inks in the set diff --git a/src/main/canon-media-mode.h b/src/main/canon-media-mode.h index b2b088e..54e973e 100644 --- a/src/main/canon-media-mode.h +++ b/src/main/canon-media-mode.h @@ -7808,7 +7808,7 @@ static const char* canon_MULTIPASS_MP630_modeuses_plain[] = { "600x600dpi", "600x600dpi_draft",/*untested*/ "300x300dpi", - "300x300dpi_draft",/*untested*/ + "300x300dpi_draft", NULL }; @@ -7888,9 +7888,7 @@ static const char* canon_MULTIPASS_MP640_modeuses_plain[] = { "600x600dpi_high2", "600x600dpi_high",/* duplex */ "600x600dpi", - "600x600dpi_draft",/*untested*/ "300x300dpi", - "300x300dpi_draft",/*untested*/ NULL }; @@ -7898,21 +7896,18 @@ static const char* canon_MULTIPASS_MP640_modeuses_plain[] = { static const char* canon_MULTIPASS_MP640_modeuses_PPpro[] = { "600x600dpi_photohigh", "600x600dpi_photo", - "600x600dpi_photodraft",/*untested*/ NULL }; static const char* canon_MULTIPASS_MP640_modeuses_PPplusG2[] = { "600x600dpi_photohigh", "600x600dpi_photo", - "600x600dpi_photodraft",/*untested*/ NULL }; static const char* canon_MULTIPASS_MP640_modeuses_PPmatte[] = { "600x600dpi_photohigh", "600x600dpi_photo2", - "600x600dpi_photodraft",/*untested*/ NULL }; @@ -7941,7 +7936,6 @@ static const char* canon_MULTIPASS_MP640_modeuses_TShirt[] = { static const char* canon_MULTIPASS_MP640_modeuses_PPother[] = { "600x600dpi_photo", - "600x600dpi_photodraft",/*untested*/ NULL }; @@ -12827,15 +12821,18 @@ DECLARE_MODEUSES(canon_PIXMA_Pro9000mk2); /* ----------------------------------- Canon Pro9500 ----------------------------------- */ static const char* canon_PIXMA_Pro9500_modeuses_plain[] = { - "600x600dpi_high", - "600x600dpi", - "600x600dpi_draft", + "600x600dpi_high",/* untested */ + "600x600dpi",/* untested */ + "300x600dpi_high", + "300x600dpi", + "75x600dpi", /* Mono */ "600x600dpi_highmono2", - "600x600dpi_highmono", /*untested*/ - "600x600dpi_mono", - "600x600dpi_draftmono", - "600x600dpi_draftmono2",/*untested*/ + "600x600dpi_highmono", + "600x600dpi_mono",/* untested */ + "300x600dpi_mono", + "300x600dpi_draftmono", + "75x600dpi_mono", NULL }; @@ -12885,12 +12882,18 @@ static const char* canon_PIXMA_Pro9500_modeuses_inkjetHagaki[] = { /* modes not yet supported (R,G inks) */ static const char* canon_PIXMA_Pro9500_modeuses_Hagaki[] = { + "600x600dpi_high",/* untested */ + "600x600dpi",/* untested */ + "300x600dpi_high",/* untested */ + "300x600dpi",/* untested */ + "75x600dpi",/* untested */ /* Mono */ "600x600dpi_highmono2", "600x600dpi_highmono", - "600x600dpi_mono", /*untested*/ - "600x600dpi_draftmono",/*untested*/ - "600x600dpi_draftmono2",/*untested*/ + "600x600dpi_mono", + "300x600dpi_mono",/* untested */ + "300x600dpi_draftmono", + "75x600dpi_mono", NULL }; diff --git a/src/main/canon-media.h b/src/main/canon-media.h index 62c641e..b4a0737 100644 --- a/src/main/canon-media.h +++ b/src/main/canon-media.h @@ -62,14 +62,12 @@ static const canon_slot_t canon_default_slots[] = { }; DECLARE_SLOTS(canon_default); -/* Gernot: changes 2010-10-02 */ static const canon_slot_t canon_PIXMA_iP4000_slots[] = { { "SelectKey", N_ ("Selected by Paper Select Key"), 0x3 }, { "Auto", N_ ("Auto Sheet Feeder"), 0x4 }, { "Cassette", N_ ("Cassette"), 0x8 }, { "CD", N_ ("CD tray"), 0xa }, { "AutoSwitch", N_ ("Automatic Paper Source Switching"), 0xf }, - { "AllocPaper", N_ ("PaperAllocation"), 0x15 }, }; DECLARE_SLOTS(canon_PIXMA_iP4000); @@ -78,8 +76,7 @@ static const canon_slot_t canon_PIXMA_iP3100_slots[] = { { "Auto", N_ ("Auto Sheet Feeder"), 0x4 }, { "Cassette", N_ ("Cassette"), 0x8 }, { "CD", N_ ("CD tray"), 0xa }, - { "AutoSwitch", N_ ("Continuous Autofeed"), 0xf }, - { "AllocPaper", N_ ("PaperAllocation"), 0x15 }, + { "AutoSwitch", N_ ("Continuous Autofeed"), 0xf }, /* must check this: must be one or the other */ }; DECLARE_SLOTS(canon_PIXMA_iP3100); @@ -88,7 +85,6 @@ static const canon_slot_t canon_PIXMA_iP2000_slots[] = { { "Auto", N_ ("Auto Sheet Feeder"), 0x4 }, { "Front", N_ ("Front Feeder"), 0x8 }, { "Continuous", N_ ("Continuous Autofeed"), 0xf }, - { "AllocPaper", N_ ("PaperAllocation"), 0x15 }, }; DECLARE_SLOTS(canon_PIXMA_iP2000); @@ -97,8 +93,7 @@ static const canon_slot_t canon_MULTIPASS_MP530_slots[] = { { "Auto", N_ ("Auto Sheet Feeder"), 0x4 }, { "Cassette", N_ ("Cassette"), 0x8 }, { "CD", N_ ("CD tray"), 0xa }, - { "AutoSwitch", N_ ("Continuous Autofeed"), 0xf }, - { "AllocPaper", N_ ("PaperAllocation"), 0x15 }, + { "AutoSwitch", N_ ("Continuous Autofeed"), 0xf }, /* must check this: must be one or the other */ }; DECLARE_SLOTS(canon_MULTIPASS_MP530); @@ -160,9 +155,9 @@ static const canon_slot_t canon_PIXMA_iP4500_slots[] = { { "SelectKey", N_ ("Selected by Paper Select Key"), 0x3 }, { "Rear", N_ ("Rear tray"), 0x4 }, { "Cassette", N_ ("Cassette"), 0x8 }, - { "Continuous", N_ ("Continuous Autofeed"), 0xf }, /* no paper automatic change source*/ + { "Continuous", N_ ("Continuous Autofeed"), 0xf }, { "CD", N_ ("CD tray"), 0xa }, - { "AutoSwitch", N_ ("Automatic Paper Source Switching"), 15 }, + { "AutoSwitch", N_ ("Automatic Paper Source Switching"), 15 }, /* incorrect: need to check */ }; DECLARE_SLOTS(canon_PIXMA_iP4500); @@ -170,7 +165,7 @@ static const canon_slot_t canon_MULTIPASS_MX850_slots[] = { { "SelectKey", N_ ("Selected by Paper Select Key"), 0x3 }, { "Rear", N_ ("Rear tray"), 0x4 }, { "Cassette", N_ ("Cassette"), 0x8 }, - { "Continuous", N_ ("Continuous Autofeed (both)"), 0xf }, /* no paper automatic change source*/ + { "Continuous", N_ ("Continuous Autofeed (both)"), 0xf }, { "CD", N_ ("CD tray"), 0xa }, }; DECLARE_SLOTS(canon_MULTIPASS_MX850); @@ -203,7 +198,6 @@ static const canon_slot_t canon_PIXMA_iP4600_slots[] = { { "Rear", N_ ("Rear tray"), 0x4 }, { "Cassette", N_ ("Cassette"), 0x8 }, { "Continuous", N_ ("Continuous Autofeed"), 0xf }, - { "AllocPaper", N_ ("PaperAllocation"), 0x15 }, { "CD", N_ ("CD tray"), 0xa }, }; DECLARE_SLOTS(canon_PIXMA_iP4600); @@ -216,21 +210,21 @@ static const canon_slot_t canon_PIXMA_Pro9000_slots[] = { }; DECLARE_SLOTS(canon_PIXMA_Pro9000); +/* duplicate of canon_PIXMA_iP3600_slots, delete */ static const canon_slot_t canon_PIXMA_MG5100_slots[] = { { "AutoSwitch", N_ ("Automatic Paper Source Switching"), 0xe }, { "Rear", N_ ("Rear tray"), 0x4 }, { "Cassette", N_ ("Cassette"), 0x8 }, { "Continuous", N_ ("Continuous Autofeed"), 0xf }, - { "AllocPaper", N_ ("PaperAllocation"), 0x15 }, }; DECLARE_SLOTS(canon_PIXMA_MG5100); +/* duplicate of canon_PIXMA_iP4600_slots, delete */ static const canon_slot_t canon_PIXMA_MG5200_slots[] = { { "AutoSwitch", N_ ("Automatic Paper Source Switching"), 0xe }, { "Rear", N_ ("Rear tray"), 0x4 }, { "Cassette", N_ ("Cassette"), 0x8 }, { "Continuous", N_ ("Continuous Autofeed"), 0xf }, - { "AllocPaper", N_ ("PaperAllocation"), 0x15 }, { "CD", N_ ("CD tray"), 0xa }, }; DECLARE_SLOTS(canon_PIXMA_MG5200); diff --git a/src/main/canon-modes.h b/src/main/canon-modes.h index 41bb12e..7f938e7 100644 --- a/src/main/canon-modes.h +++ b/src/main/canon-modes.h @@ -1209,8 +1209,8 @@ static const canon_mode_t canon_PIXMA_iP100_modes[] = { { 600, 600,CANON_INK_CMYK|CANON_INK_K,"600x600dpi_high",N_("600x600 DPI HIGH MONO"),INKSET(11_C3M3Y2K2_c),16,MODE_FLAG_EXTENDED_T|MODE_FLAG_S,NULL,1.0,1.0,NULL,NULL,NULL,4},/* color untested */ { 600, 600,CANON_INK_CMYK|CANON_INK_K,"600x600dpi",N_("600x600 DPI"),INKSET(11_C3M3Y2K2_c),16,MODE_FLAG_EXTENDED_T|MODE_FLAG_S,NULL,1.0,1.0,NULL,NULL,NULL,3},/*|MODE_FLAG_COLOR*/ { 600, 600,CANON_INK_CMYK|CANON_INK_K,"600x600dpi_draft",N_("600x600 DPI DRAFT"),INKSET(11_C3M3Y2K2_c),16,MODE_FLAG_EXTENDED_T|MODE_FLAG_S,NULL,1.0,1.0,NULL,NULL,NULL,2},/*|MODE_FLAG_COLOR*/ - { 300, 300,CANON_INK_CMYK|CANON_INK_K,"300x300dpi",N_("300x300 DPI"),INKSET(11_C2M2Y2K2),8,MODE_FLAG_IP8500|MODE_FLAG_S,NULL,1.0,1.0,NULL,NULL,NULL,1}, - { 300, 300,CANON_INK_CMYK|CANON_INK_K,"300x300dpi_draft",N_("300x300 DPI DRAFT"),INKSET(11_C2M2Y2K2),8,MODE_FLAG_IP8500|MODE_FLAG_S,NULL,1.0,1.0,NULL,NULL,NULL,0}, + { 300, 300,CANON_INK_CMYK|CANON_INK_K,"300x300dpi",N_("300x300 DPI"),INKSET(11_C2M2Y2K2),8,MODE_FLAG_EXTENDED_T|MODE_FLAG_IP8500|MODE_FLAG_S,NULL,1.0,1.0,NULL,NULL,NULL,1}, + { 300, 300,CANON_INK_CMYK|CANON_INK_K,"300x300dpi_draft",N_("300x300 DPI DRAFT"),INKSET(11_C2M2Y2K2),8,MODE_FLAG_EXTENDED_T|MODE_FLAG_IP8500|MODE_FLAG_S,NULL,1.0,1.0,NULL,NULL,NULL,0}, /* photo modes CMYk */ { 600, 600,CANON_INK_CMYK,"600x600dpi_photohigh2",N_("600x600 DPI PHOTO HIGHEST Pro"),INKSET(11_C9M9Y4k6),16,MODE_FLAG_EXTENDED_T|MODE_FLAG_S,NULL,1.0,1.0,NULL,NULL,NULL,4}, { 600, 600,CANON_INK_CMYK,"600x600dpi_photohigh",N_("600x600 DPI PHOTO HIGH"),INKSET(11_C6M6Y4k4),16,MODE_FLAG_EXTENDED_T|MODE_FLAG_S,NULL,1.0,1.0,NULL,NULL,NULL,3}, @@ -1225,7 +1225,7 @@ static const canon_mode_t canon_PIXMA_iP100_modes[] = { }; DECLARE_MODES(canon_PIXMA_iP100,2); -/* simpler compared to iP110, in fact commands in line with other normal-sized PIXMA devices */ +/* simpler compared to iP100, in fact commands in line with other normal-sized PIXMA devices */ /* no Esc (S command */ /* 2 ink carts: (1) CMYk (2) pigment black K */ /* special inksaving options to save ink and/or use only remaining ink: */ @@ -1236,8 +1236,8 @@ static const canon_mode_t canon_PIXMA_iP110_modes[] = { { 600, 600,CANON_INK_K|CANON_INK_CMYK,"600x600dpi_high",N_("600x600 DPI HIGH MONO"),INKSET(11_C3M3Y2K2_c),16,MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL,4},/* color untested */ { 600, 600,CANON_INK_K|CANON_INK_CMY|CANON_INK_CMYK,"600x600dpi",N_("600x600 DPI"),INKSET(11_C3M3Y2K2_c),16,MODE_FLAG_EXTENDED_T|MODE_FLAG_COLOR,NULL,1.0,1.0,NULL,NULL,NULL,3}, { 600, 600,CANON_INK_K|CANON_INK_CMY|CANON_INK_CMYK,"600x600dpi_draft",N_("600x600 DPI DRAFT"),INKSET(11_C3M3Y2K2_c),16,MODE_FLAG_EXTENDED_T|MODE_FLAG_COLOR,NULL,1.0,1.0,NULL,NULL,NULL,2}, - { 300, 300,CANON_INK_K|CANON_INK_CMYK,"300x300dpi",N_("300x300 DPI"),INKSET(11_C2M2Y2K2),8,MODE_FLAG_IP8500,NULL,1.0,1.0,NULL,NULL,NULL,1}, - { 300, 300,CANON_INK_K|CANON_INK_CMYK,"300x300dpi_draft",N_("300x300 DPI DRAFT"),INKSET(11_C2M2Y2K2),8,MODE_FLAG_IP8500,NULL,1.0,1.0,NULL,NULL,NULL,0},/* untested */ + { 300, 300,CANON_INK_K|CANON_INK_CMYK,"300x300dpi",N_("300x300 DPI"),INKSET(11_C2M2Y2K2),8,MODE_FLAG_EXTENDED_T|MODE_FLAG_IP8500,NULL,1.0,1.0,NULL,NULL,NULL,1}, + { 300, 300,CANON_INK_K|CANON_INK_CMYK,"300x300dpi_draft",N_("300x300 DPI DRAFT"),INKSET(11_C2M2Y2K2),8,MODE_FLAG_EXTENDED_T|MODE_FLAG_IP8500,NULL,1.0,1.0,NULL,NULL,NULL,0},/* untested */ /* photo modes CMYk */ { 600, 600,CANON_INK_CMYK,"600x600dpi_photohigh2",N_("600x600 DPI PHOTO HIGHEST (Plus Glossy II)"),INKSET(11_C9M9Y4k6),16,MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL,4}, { 600, 600,CANON_INK_CMYK,"600x600dpi_photohigh",N_("600x600 DPI PHOTO HIGH"),INKSET(11_C6M6Y4k4),16,MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL,3}, @@ -1435,7 +1435,7 @@ DECLARE_MODES(canon_PIXMA_iP3100,1); static const canon_mode_t canon_PIXMA_iP4000_modes[] = { /* plain modes --- same for duplex */ /* NOTE: temporarily allowing plain modes for CD printing */ - /* legacy modes were used before printer capabilites were improved to handle real mode from driver */ + /* legacy modes were used before printer capabilities were improved to handle real mode from driver */ { 600, 600,CANON_INK_CMYK|CANON_INK_K,"600x600dpi_high4",N_("600x600 DPI HIGH (LEGACY)"),INKSET(4_C2M2Y2K2),16,MODE_FLAG_CD,NULL,1.0,1.0,NULL,NULL,NULL,2},/* legacy */ { 600, 600,CANON_INK_CMYK|CANON_INK_K,"600x600dpi_std4",N_("600x600 DPI (LEGACY)"),INKSET(4_C2M2Y2K2),16,MODE_FLAG_CD,NULL,1.0,1.0,NULL,NULL,NULL,1},/* legacy */ { 600, 600,CANON_INK_CMYK|CANON_INK_K,"600x600dpi_draft2",N_("600x600 DPI DRAFT (LEGACY)"),INKSET(4_C2M2Y2K2),16,MODE_FLAG_CD,NULL,1.0,1.0,NULL,NULL,NULL,0},/* legacy */ @@ -2597,6 +2597,30 @@ static const canon_mode_t canon_MULTIPASS_MP600_modes[] = { }; DECLARE_MODES(canon_MULTIPASS_MP600,1); +static const canon_mode_t canon_MULTIPASS_MP630_modes[] = { + /* plain modes */ + { 600, 600,CANON_INK_K|CANON_INK_CMYK,"600x600dpi_high2",N_("600x600 DPI HIGH"),INKSET(13_C6M6Y4K2y4),16,MODE_FLAG_EXTENDED_T|MODE_FLAG_NODUPLEX,NULL,1.0,1.0,NULL,NULL,NULL,3}, + { 600, 600,CANON_INK_K|CANON_INK_CMYK,"600x600dpi_high",N_("600x600 DPI HIGH (duplex)"),INKSET(13_C3M3Y2K2y3_c),16,MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL,3}, + { 600, 600,CANON_INK_K|CANON_INK_CMYK,"600x600dpi",N_("600x600 DPI"),INKSET(13_C3M3Y2K2y3_c),16,MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL,2}, + { 600, 600,CANON_INK_K|CANON_INK_CMYK,"600x600dpi_draft",N_("600x600 DPI DRAFT"),INKSET(13_C3M3Y2K2y3_c),16,MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL,1}, + { 300, 300,CANON_INK_K|CANON_INK_CMYK,"300x300dpi",N_("300x300 DPI"),INKSET(13_C2M2Y2K2),8,MODE_FLAG_EXTENDED_T|MODE_FLAG_IP8500,NULL,1.0,1.0,NULL,NULL,NULL,1}, + { 300, 300,CANON_INK_K|CANON_INK_CMYK,"300x300dpi_draft",N_("300x300 DPI DRAFT"),INKSET(13_C2M2Y2K2),8,MODE_FLAG_EXTENDED_T|MODE_FLAG_IP8500,NULL,1.0,1.0,NULL,NULL,NULL,0}, + /* photo modes */ + { 600, 600,CANON_INK_CMYK,"600x600dpi_photohigh2",N_("600x600 DPI PHOTO HIGH"),INKSET(13_C8M8Y4k4),16,MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL,3}, + { 600, 600,CANON_INK_CMYK,"600x600dpi_photo",N_("600x600 DPI PHOTO"),INKSET(13_C6M6Y4k4),16,MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL,2}, + { 600, 600,CANON_INK_CMYK,"600x600dpi_photo2",N_("600x600 DPI PHOTO matte/HiRes"),INKSET(13_C8M8Y4k4),16,MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL,2}, + { 600, 600,CANON_INK_CMYK,"600x600dpi_photodraft",N_("600x600 DPI PHOTO DRAFT"),INKSET(13_C8M8Y4k4),16,MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL,1},/*untested*/ + /* inkjet Hagaki / CD */ + { 600, 600,CANON_INK_CMYK,"600x600dpi_photohigh3",N_("600x600 DPI HIGH inkjetHagaki/CD"),INKSET(13_C5M5Y4k4),16,MODE_FLAG_EXTENDED_T|MODE_FLAG_CD,NULL,1.0,1.0,NULL,NULL,NULL,3}, + { 600, 600,CANON_INK_CMYK,"600x600dpi_photo3",N_("600x600 DPI inkjetHagaki/CD"),INKSET(13_C5M5Y4k4),16,MODE_FLAG_EXTENDED_T|MODE_FLAG_CD,NULL,1.0,1.0,NULL,NULL,NULL,2}, + /* T-Shirt --- same as photo high */ + { 600, 600,CANON_INK_CMYK,"600x600dpi_tshirt",N_("600x600 DPI T-SHIRT"),INKSET(13_C8M8Y4k4),16,MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL,3}, + /* Env/Hagaki CMYKk */ + { 600, 600,CANON_INK_K|CANON_INK_CMYKk,"600x600dpi_high3",N_("600x600 DPI HIGH Env/Hagaki"),INKSET(13_C3M3Y2K2k3on_c),16,MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL,3}, + { 600, 600,CANON_INK_K|CANON_INK_CMYKk,"600x600dpi_std3",N_("600x600 DPI Env/Hagaki"),INKSET(13_C3M3Y2K2k3on_c),16,MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL,2}, +}; +DECLARE_MODES(canon_MULTIPASS_MP630,2); + static const canon_mode_t canon_MULTIPASS_MP640_modes[] = { /* plain modes */ { 600, 600,CANON_INK_K|CANON_INK_CMYK,"600x600dpi_high2",N_("600x600 DPI HIGH"),INKSET(13_C6M6Y4K2y4),16,MODE_FLAG_EXTENDED_T|MODE_FLAG_NODUPLEX,NULL,1.0,1.0,NULL,NULL,NULL,3}, @@ -2604,12 +2628,10 @@ static const canon_mode_t canon_MULTIPASS_MP640_modes[] = { { 600, 600,CANON_INK_K|CANON_INK_CMYK,"600x600dpi",N_("600x600 DPI"),INKSET(13_C3M3Y2K2y3_c),16,MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL,2}, { 600, 600,CANON_INK_K|CANON_INK_CMYK,"600x600dpi_draft",N_("600x600 DPI DRAFT"),INKSET(13_C3M3Y2K2y3_c),16,MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL,1},/* untested */ { 300, 300,CANON_INK_K|CANON_INK_CMYK,"300x300dpi",N_("300x300 DPI"),INKSET(13_C2M2Y2K2),8,MODE_FLAG_EXTENDED_T|MODE_FLAG_IP8500,NULL,1.0,1.0,NULL,NULL,NULL,1}, - { 300, 300,CANON_INK_K|CANON_INK_CMYK,"300x300dpi_draft",N_("300x300 DPI DRAFT"),INKSET(13_C2M2Y2K2),8,MODE_FLAG_EXTENDED_T|MODE_FLAG_IP8500,NULL,1.0,1.0,NULL,NULL,NULL,0},/* untested */ /* photo modes */ { 600, 600,CANON_INK_CMYK,"600x600dpi_photohigh2",N_("600x600 DPI PHOTO HIGH"),INKSET(13_C8M8Y4k4),16,MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL,3}, { 600, 600,CANON_INK_CMYK,"600x600dpi_photo",N_("600x600 DPI PHOTO"),INKSET(13_C6M6Y4k4),16,MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL,2}, { 600, 600,CANON_INK_CMYK,"600x600dpi_photo2",N_("600x600 DPI PHOTO matte/HiRes"),INKSET(13_C8M8Y4k4),16,MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL,2}, - { 600, 600,CANON_INK_CMYK,"600x600dpi_photodraft2",N_("600x600 DPI PHOTO DRAFT"),INKSET(13_C8M8Y4k4),16,MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL,1},/*untested*/ /* inkjet Hagaki / CD */ { 600, 600,CANON_INK_CMYK,"600x600dpi_photohigh3",N_("600x600 DPI HIGH inkjetHagaki/CD"),INKSET(13_C5M5Y4k4),16,MODE_FLAG_EXTENDED_T|MODE_FLAG_CD,NULL,1.0,1.0,NULL,NULL,NULL,3}, { 600, 600,CANON_INK_CMYK,"600x600dpi_photo3",N_("600x600 DPI inkjetHagaki/CD"),INKSET(13_C5M5Y4k4),16,MODE_FLAG_EXTENDED_T|MODE_FLAG_CD,NULL,1.0,1.0,NULL,NULL,NULL,2}, @@ -3499,17 +3521,20 @@ DECLARE_MODES(canon_PIXMA_Pro9000mk2,1); /* the Pro9500 has fewer quality settings in the driver than the Pro9500 Mk.II but I put the "missing" ones in anyway */ static const canon_mode_t canon_PIXMA_Pro9500_modes[] = { /* plain mode: fast, 1 only but maybe accept 2 and 0 quality settings too */ - { 600, 600,CANON_INK_CMYK,"600x600dpi_high",N_("600x600 DPI HIGH"),INKSET(11_C2M2Y2K2),16,MODE_FLAG_EXTENDED_T|MODE_FLAG_IP8500,NULL,1.0,1.0,NULL,NULL,NULL,2}, - { 600, 600,CANON_INK_CMYK,"600x600dpi",N_("600x600 DPI"),INKSET(11_C2M2Y2K2),16,MODE_FLAG_EXTENDED_T|MODE_FLAG_IP8500,NULL,1.0,1.0,NULL,NULL,NULL,1}, - { 600, 600,CANON_INK_CMYK,"600x600dpi_draft",N_("600x600 DPI DRAFT"),INKSET(11_C2M2Y2K2),16,MODE_FLAG_EXTENDED_T|MODE_FLAG_IP8500,NULL,1.0,1.0,NULL,NULL,NULL,0}, + { 600, 600,CANON_INK_CMYK,"600x600dpi_high",N_("600x600 DPI HIGH"),INKSET(11_C6M6Y6K6_c),16,MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL,3},/* untested */ + { 600, 600,CANON_INK_CMYK,"600x600dpi",N_("600x600 DPI"),INKSET(11_C6M6Y6K6_c),16,MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL,2},/* untested */ + { 600, 600,CANON_INK_CMYK,"300x600dpi_high",N_("300x600 DPI HIGH"),INKSET(11_C2M2Y2K2),16,MODE_FLAG_EXTENDED_T|MODE_FLAG_IP8500,NULL,1.0,1.0,NULL,NULL,NULL,2}, + { 600, 600,CANON_INK_CMYK,"300x600dpi",N_("300x600 DPI"),INKSET(11_C2M2Y2K2),16,MODE_FLAG_EXTENDED_T|MODE_FLAG_IP8500,NULL,1.0,1.0,NULL,NULL,NULL,1}, + { 600, 600,CANON_INK_CMYK,"75x600dpi",N_("75x600 DPI"),INKSET(11_C2M2Y2K2),16,MODE_FLAG_EXTENDED_T|MODE_FLAG_IP8500,NULL,1.0,1.0,NULL,NULL,NULL,0}, /* plain mono: these modes use CMYK inks also */ /* used for plain, hagaki */ /* bw=2 */ { 600, 600,CANON_INK_CMYK,"600x600dpi_highmono2",N_("600x600 DPI MONO PLAIN/Hagaki HIGH"),INKSET(11_C6M6Y6K6_c),16,MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL,4}, - { 600, 600,CANON_INK_CMYK,"600x600dpi_highmono",N_("600x600 DPI MONO Hagaki STD"),INKSET(11_C6M6Y6K6_c),16,MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL,3}, - { 600, 600,CANON_INK_CMYK,"600x600dpi_mono",N_("600x600 DPI MONO PLAIN STD"),INKSET(11_C6M6Y6K6_c),16,MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL,2}, - { 600, 600,CANON_INK_CMYK,"600x600dpi_draftmono",N_("600x600 DPI MONO DRAFT"),INKSET(11_C2M2Y2K2),16,MODE_FLAG_EXTENDED_T|MODE_FLAG_IP8500,NULL,1.0,1.0,NULL,NULL,NULL,1}, - { 600, 600,CANON_INK_CMYK,"600x600dpi_draftmono2",N_("600x600 DPI MONO DRAFT2"),INKSET(11_C2M2Y2K2),16,MODE_FLAG_EXTENDED_T|MODE_FLAG_IP8500,NULL,1.0,1.0,NULL,NULL,NULL,0},/*untested*/ + { 600, 600,CANON_INK_CMYK,"600x600dpi_highmono",N_("600x600 DPI MONO Hagaki"),INKSET(11_C6M6Y6K6_c),16,MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL,3}, + { 600, 600,CANON_INK_CMYK,"600x600dpi_mono",N_("600x600 DPI MONO PLAIN"),INKSET(11_C6M6Y6K6_c),16,MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL,2}, + { 600, 600,CANON_INK_CMYK,"300x600dpi_mono",N_("300x600 DPI MONO"),INKSET(11_C2M2Y2K2),16,MODE_FLAG_EXTENDED_T|MODE_FLAG_IP8500,NULL,1.0,1.0,NULL,NULL,NULL,2},/*untested*/ + { 600, 600,CANON_INK_CMYK,"300x600dpi_draftmono",N_("300x600 DPI MONO DRAFT"),INKSET(11_C2M2Y2K2),16,MODE_FLAG_EXTENDED_T|MODE_FLAG_IP8500,NULL,1.0,1.0,NULL,NULL,NULL,1}, + { 600, 600,CANON_INK_CMYK,"75x600dpi_mono",N_("75x600 DPI MONO"),INKSET(11_C2M2Y2K2),16,MODE_FLAG_EXTENDED_T|MODE_FLAG_IP8500,NULL,1.0,1.0,NULL,NULL,NULL,0}, /* Photo modes: only mono using CMYK-only can be supported currently */ /* this has k instead of K --- also CD */ { 600, 600,CANON_INK_CMYK,"600x600dpi_photomono",N_("600x600 DPI MONO PHOTO / CD"),INKSET(11_C16M16Y16k16),8,MODE_FLAG_EXTENDED_T|MODE_FLAG_CD,NULL,1.0,1.0,NULL,NULL,NULL,4}, @@ -3628,7 +3653,7 @@ static const canon_mode_t canon_PIXMA_iP8100_modes[] = { { 600, 600,CANON_INK_K,"600x600dpi_mono",N_("600x600 DPI MONO"),INKSET(11_K2),16,MODE_FLAG_EXTENDED_T|MODE_FLAG_IP8500,NULL,1.0,1.0,NULL,NULL,NULL,1}, { 600, 600,CANON_INK_K,"600x600dpi_draftmono",N_("600x600 DPI MONO DRAFT"),INKSET(11_K2),16,MODE_FLAG_EXTENDED_T|MODE_FLAG_IP8500,NULL,1.0,1.0,NULL,NULL,NULL,0}, /* photo modes */ - /* one mode for PPpro ud1, hi cannot be supported yet as it uses Red ink (R) in addtion to CMYKcm */ + /* one mode for PPpro ud1, hi cannot be supported yet as it uses Red ink (R) in addition to CMYKcm */ { 600, 600,CANON_INK_CcMmYK,"600x600dpi_photohigh",N_("600x600 DPI PHOTO HIGH"),INKSET(11_C6M6Y6K6c16m16_c),16,MODE_FLAG_EXTENDED_T|MODE_FLAG_PRO,NULL,1.0,1.0,NULL,NULL,NULL,4}, { 600, 600,CANON_INK_CcMmYK,"600x600dpi_photohigh2",N_("600x600 DPI PHOTO HIGH matte/HiRes"),INKSET(11_C6M6Y6K6c6m6_c),16,MODE_FLAG_EXTENDED_T|MODE_FLAG_PRO,NULL,1.0,1.0,NULL,NULL,NULL,4}, { 600, 600,CANON_INK_CcMmYK,"600x600dpi_photo",N_("600x600 DPI PHOTO / CD High"),INKSET(11_C6M6Y6K6c6m6_c),16,MODE_FLAG_EXTENDED_T|MODE_FLAG_PRO|MODE_FLAG_CD,NULL,1.0,1.0,NULL,NULL,NULL,2}, @@ -3752,7 +3777,7 @@ static const canon_mode_t canon_PIXMA_iP9910_modes[] = { { 600, 600,CANON_INK_K,"600x600dpi_mono",N_("600x600 DPI MONO"),INKSET(11_K2),16,MODE_FLAG_EXTENDED_T|MODE_FLAG_IP8500,NULL,1.0,1.0,NULL,NULL,NULL,1}, { 600, 600,CANON_INK_K,"600x600dpi_draftmono",N_("600x600 DPI MONO DRAFT"),INKSET(11_K2),16,MODE_FLAG_EXTENDED_T|MODE_FLAG_IP8500,NULL,1.0,1.0,NULL,NULL,NULL,0}, /* photo modes */ - /* one mode for PPpro hi, and PPplusGlossy hi cannot be supported yet as it uses Red (R) and Green (G) ink in addtion to CMYKcm */ + /* one mode for PPpro hi, and PPplusGlossy hi cannot be supported yet as it uses Red (R) and Green (G) ink in addition to CMYKcm */ { 600, 600,CANON_INK_CcMmYK,"600x600dpi_photohigh",N_("600x600 DPI PHOTO HIGH plusDS/gloss"),INKSET(11_C6M6Y6K6c16m16_c),16,MODE_FLAG_EXTENDED_T|MODE_FLAG_PRO,NULL,1.0,1.0,NULL,NULL,NULL,4}, { 600, 600,CANON_INK_CcMmYK,"600x600dpi_photohigh2",N_("600x600 DPI PHOTO HIGH matte/HiRes"),INKSET(11_C6M6Y6K6c6m6_c),16,MODE_FLAG_EXTENDED_T|MODE_FLAG_PRO,NULL,1.0,1.0,NULL,NULL,NULL,4}, { 600, 600,CANON_INK_CcMmYK,"600x600dpi_photo",N_("600x600 DPI PHOTO pro"),INKSET(11_C6M6Y6K6c16m16_c),16,MODE_FLAG_EXTENDED_T|MODE_FLAG_PRO,NULL,1.0,1.0,NULL,NULL,NULL,3}, diff --git a/src/main/canon-printers.h b/src/main/canon-printers.h index 59c847c..24a9b2d 100644 --- a/src/main/canon-printers.h +++ b/src/main/canon-printers.h @@ -2123,7 +2123,7 @@ static const canon_cap_t canon_model_capabilities[] = INCH(17/2), INCH(23), /* max paper width and height */ /* from MacOSX driver */ 10, 10, 9, 15, /*border_left, border_right, border_top, border_bottom */ &canon_MULTIPASS_MP530_slotlist, - CANON_CAP_STD0|CANON_CAP_px|CANON_CAP_I|CANON_CAP_P|CANON_CAP_r|CANON_CAP_BORDERLESS,0x64, + CANON_CAP_STD0|CANON_CAP_px|CANON_CAP_DUPLEX|CANON_CAP_I|CANON_CAP_P|CANON_CAP_r|CANON_CAP_BORDERLESS,0x64, 3,4, /* ESC (l and (P command lengths */ 0, /* Upper/Lower Cassette option */ control_cmd_PIXMA_iP4200, /*features */ @@ -2246,7 +2246,7 @@ static const canon_cap_t canon_model_capabilities[] = 3,4, /* ESC (l and (P command lengths */ 0, /* Upper/Lower Cassette option */ control_cmd_PIXMA_iP4200, /*features */ - &canon_MULTIPASS_MP640_modelist, + &canon_MULTIPASS_MP630_modelist, &canon_MULTIPASS_MP630_paperlist, &canon_MULTIPASS_MP630_modeuselist, NULL, @@ -2959,12 +2959,11 @@ static const canon_cap_t canon_model_capabilities[] = iP4500_channel_order }, { /* Canon PIXMA MG3600 */ - /* no support for Esc (s and ESC (u commands yet for duplex */ "PIXMA MG3600", 3, /*model, model_id*/ INCH(17/2), 1917, /* max paper width and height */ /* unconfirmed */ 10, 10, 9, 15, /*border_left, border_right, border_top, border_bottom */ &canon_PIXMA_MG2100_slotlist, - CANON_CAP_STD0|CANON_CAP_DUPLEX|CANON_CAP_px|CANON_CAP_I|CANON_CAP_P|CANON_CAP_T|CANON_CAP_v|CANON_CAP_XML|CANON_CAP_BORDERLESS,0, + CANON_CAP_STD0|CANON_CAP_DUPLEX|CANON_CAP_s|CANON_CAP_u|CANON_CAP_px|CANON_CAP_I|CANON_CAP_P|CANON_CAP_T|CANON_CAP_v|CANON_CAP_XML|CANON_CAP_BORDERLESS,0, 3,9, /* ESC (l and (P command lengths */ 0, /* Upper/Lower Cassette option */ control_cmd_PIXMA_MG3500, /* features: also uses CAP_T */ @@ -3062,12 +3061,11 @@ static const canon_cap_t canon_model_capabilities[] = iP4500_channel_order }, { /* Canon PIXMA MG5600 */ - /* no support for Esc (s and ESC (u commands yet for duplex */ "PIXMA MG5600", 3, /*model, model_id*/ INCH(17/2), INCH(14), /* max paper width and height */ /* not confirmed yet */ 10, 10, 9, 15, /*border_left, border_right, border_top, border_bottom */ &canon_MULTIPASS_MX7600_slotlist, - CANON_CAP_STD0|CANON_CAP_DUPLEX|CANON_CAP_px|CANON_CAP_v|CANON_CAP_I|CANON_CAP_P|CANON_CAP_XML|CANON_CAP_BORDERLESS,0, + CANON_CAP_STD0|CANON_CAP_DUPLEX|CANON_CAP_s|CANON_CAP_u|CANON_CAP_px|CANON_CAP_v|CANON_CAP_I|CANON_CAP_P|CANON_CAP_XML|CANON_CAP_BORDERLESS,0, 3,9, /* ESC (l and (P command lengths */ 0, /* Upper/Lower Cassette option */ control_cmd_PIXMA_MG5600, @@ -3080,12 +3078,12 @@ static const canon_cap_t canon_model_capabilities[] = iP4500_channel_order }, { /* Canon PIXMA MG5700 */ - /* no support for Esc (s and ESC (u commands yet for duplex */ + /* TESTING ESC (s */ "PIXMA MG5700", 3, /*model, model_id*/ INCH(17/2), INCH(14), /* max paper width and height */ /* not confirmed yet */ 10, 10, 9, 15, /*border_left, border_right, border_top, border_bottom */ &canon_MULTIPASS_MX7600_slotlist, - CANON_CAP_STD0|CANON_CAP_DUPLEX|CANON_CAP_px|CANON_CAP_v|CANON_CAP_w|CANON_CAP_I|CANON_CAP_P|CANON_CAP_XML|CANON_CAP_BORDERLESS,0, + CANON_CAP_STD0|CANON_CAP_DUPLEX|CANON_CAP_s|CANON_CAP_u|CANON_CAP_px|CANON_CAP_v|CANON_CAP_w|CANON_CAP_I|CANON_CAP_P|CANON_CAP_XML|CANON_CAP_BORDERLESS,0, 3,9, /* ESC (l and (P command lengths */ 0, /* Upper/Lower Cassette option */ control_cmd_PIXMA_MG5600, @@ -3762,12 +3760,11 @@ static const canon_cap_t canon_model_capabilities[] = iP4500_channel_order }, { /* Canon MAXIFY iB4000 --- with XML */ - /* no support for Esc (s and ESC (u commands yet for duplex */ "MAXIFY iB4000", 3, /*model, model_id*/ INCH(17/2), 1917, /* max paper width and height assumed */ 10, 10, 9, 15, /*border_left, border_right, border_top, border_bottom */ &canon_MAXIFY_iB4000_slotlist, - CANON_CAP_STD0|CANON_CAP_px|CANON_CAP_P|CANON_CAP_I|CANON_CAP_v|CANON_CAP_XML|CANON_CAP_DUPLEX,0, + CANON_CAP_STD0|CANON_CAP_px|CANON_CAP_P|CANON_CAP_I|CANON_CAP_v|CANON_CAP_XML|CANON_CAP_DUPLEX|CANON_CAP_s|CANON_CAP_u,0, 3,9, /* ESC (l and (P command lengths */ 0, /* Upper/Lower Cassette option */ control_cmd_PIXMA_MG5300, /*features*/ @@ -3781,12 +3778,11 @@ static const canon_cap_t canon_model_capabilities[] = }, { /* Canon MAXIFY MB2000 --- with XML */ /* Same: MB5000 */ - /* no support for Esc (s and ESC (u commands yet for duplex */ "MAXIFY MB2000", 3, /*model, model_id*/ INCH(17/2), 1917, /* max paper width and height assumed */ 10, 10, 9, 15, /*border_left, border_right, border_top, border_bottom */ &canon_MULTIPASS_MX7600_slotlist, - CANON_CAP_STD0|CANON_CAP_px|CANON_CAP_P|CANON_CAP_I|CANON_CAP_v|CANON_CAP_XML|CANON_CAP_DUPLEX,0, + CANON_CAP_STD0|CANON_CAP_px|CANON_CAP_P|CANON_CAP_I|CANON_CAP_v|CANON_CAP_XML|CANON_CAP_DUPLEX|CANON_CAP_s|CANON_CAP_u,0, 3,9, /* ESC (l and (P command lengths */ 0, /* Upper/Lower Cassette option */ control_cmd_PIXMA_MG5300, /*features*/ @@ -3800,12 +3796,11 @@ static const canon_cap_t canon_model_capabilities[] = }, { /* Canon MAXIFY MB2300 --- with XML */ /* Same: MB5300 */ - /* no support for Esc (s and ESC (u commands yet for duplex */ "MAXIFY MB2300", 3, /*model, model_id*/ INCH(17/2), 1917, /* max paper width and height assumed */ 10, 10, 9, 15, /*border_left, border_right, border_top, border_bottom */ &canon_MAXIFY_iB4000_slotlist, - CANON_CAP_STD0|CANON_CAP_px|CANON_CAP_P|CANON_CAP_I|CANON_CAP_v|CANON_CAP_XML|CANON_CAP_DUPLEX,0, + CANON_CAP_STD0|CANON_CAP_px|CANON_CAP_P|CANON_CAP_I|CANON_CAP_v|CANON_CAP_XML|CANON_CAP_DUPLEX|CANON_CAP_s|CANON_CAP_u,0, 3,9, /* ESC (l and (P command lengths */ 0, /* Upper/Lower Cassette option */ control_cmd_PIXMA_MG5300, /*features*/ diff --git a/src/main/print-canon.c b/src/main/print-canon.c index 89c7fff..f8d4613 100644 --- a/src/main/print-canon.c +++ b/src/main/print-canon.c @@ -190,6 +190,8 @@ pack_pixels3_6(unsigned char* buf,int len) #define CANON_CAP_NOBLACK 0x2000000ul /* no Black cartridge selection */ #define CANON_CAP_v 0x4000000ul /* not sure of this yet */ #define CANON_CAP_w 0x8000000ul /* related to media type selection */ +#define CANON_CAP_s 0x10000000ul /* not sure of this yet: duplex-related? */ +#define CANON_CAP_u 0x20000000ul /* not sure of this yet: duplex-related? */ #define CANON_CAP_STD0 (CANON_CAP_b|CANON_CAP_c|CANON_CAP_d|\ CANON_CAP_l|CANON_CAP_q|CANON_CAP_t) @@ -276,6 +278,8 @@ static void canon_advance_paper(stp_vars_t *, int); static void canon_flush_pass(stp_vars_t *, int, int); static void canon_write_multiraster(stp_vars_t *v,canon_privdata_t* pd,int y); +static void fix_papersize(unsigned char arg_ESCP_1, int *paper_width, int *paper_length); + static const stp_parameter_t the_parameters[] = { { @@ -395,6 +399,12 @@ static const stp_parameter_t the_parameters[] = STP_PARAMETER_TYPE_STRING_LIST, STP_PARAMETER_CLASS_FEATURE, STP_PARAMETER_LEVEL_BASIC, 1, 1, STP_CHANNEL_NONE, 0, 0 }, + { + "Orientation", N_("Orientation"), "Color=No,Category=Basic Printer Setup", + N_("Orientation, Portrait, Landscape, Upside Down, Seascape"), + STP_PARAMETER_TYPE_STRING_LIST, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_BASIC, 1, 1, STP_CHANNEL_NONE, 1, 0, + }, }; static const int the_parameter_count = @@ -486,6 +496,20 @@ static const stp_param_string_t duplex_types[] = }; #define NUM_DUPLEX (sizeof (duplex_types) / sizeof (stp_param_string_t)) +/* + * Orientation support - modes available + * Note that the internal names MUST match those in cups/genppd.c else the + * PPD files will not be generated correctly + */ + +static const stp_param_string_t orientation_types[] = { + {"Portrait", N_("Portrait")}, + {"Landscape", N_("Landscape")}, + {"UpsideDown", N_("Reverse Portrait")}, + {"Seascape", N_("Reverse Landscape")}, +}; +#define NUM_ORIENTATION (sizeof (orientation_types) / sizeof (stp_param_string_t)) + static const canon_paper_t * get_media_type(const canon_cap_t* caps,const char *name) { @@ -1061,7 +1085,7 @@ const canon_mode_t* canon_check_current_mode(stp_vars_t *v){ if (media_type && resolution && mode) { stp_dprintf(STP_DBG_CANON, v,"DEBUG: Gutenprint: check_current_mode --- Resolution, Media, Mode all known \n"); stp_dprintf(STP_DBG_CANON, v,"DEBUG: Gutenprint: media type selected: '%s'\n",media_type->name); - stp_dprintf(STP_DBG_CANON, v,"DEBUG: (Inital) Gutenprint: mode initally active: '%s'\n",mode->name); + stp_dprintf(STP_DBG_CANON, v,"DEBUG: (Initial) Gutenprint: mode initially active: '%s'\n",mode->name); /* scroll through modeuse list to find media */ muse = select_media_modes(v,media_type,mlist); @@ -2447,13 +2471,13 @@ canon_printhead_colors(const stp_vars_t*v) stp_dprintf(STP_DBG_CANON, v,"(canon_printhead_colors[BW]) NOBLACK? %lu\n",(caps->features & CANON_CAP_NOBLACK)); return CANON_INK_K; } - /* alternatively, if the cartridge selection is in force, and black cartride is selected, accept it */ + /* alternatively, if the cartridge selection is in force, and black cartridge is selected, accept it */ if(ink_set && !strcmp(ink_set, "Black")){ stp_dprintf(STP_DBG_CANON, v,"(canon_printhead_colors[BW]) Found InkSet black selection\n"); return CANON_INK_K; } - /* originaly finds selected InkType of form: CANON_INK_<inks> */ + /* originally finds selected InkType of form: CANON_INK_<inks> */ /* but this is incorrect, since it does not check media or mode */ /* change: deal with mode set and mode not set cases */ @@ -2531,9 +2555,13 @@ canon_size_type(const stp_vars_t *v, const canon_cap_t * caps) { const stp_papersize_t *pp = stp_get_papersize_by_size(stp_get_page_height(v), stp_get_page_width(v)); + + stp_deprintf(STP_DBG_CANON,"canon: entered canon_size_type\n"); + if (pp) { const char *name = pp->name; + stp_deprintf(STP_DBG_CANON,"canon: in canon_size_type is pp->name: '%s'\n",name); /* used internally: do not translate */ /* built ins: Japanese driver notation */ if (!strcmp(name,"A5")) return 0x01; @@ -2543,25 +2571,25 @@ canon_size_type(const stp_vars_t *v, const canon_cap_t * caps) if (!strcmp(name,"B4")) return 0x0a; if (!strcmp(name,"Letter")) return 0x0d; if (!strcmp(name,"Legal")) return 0x0f; - if (!strcmp(name,"Tabloid")) return 0x11; /* 11x17 */ + if (!strcmp(name,"Tabloid")) return 0x11; /* 11x17 inch */ if (!strcmp(name,"w283h420")) return 0x14; /* Hagaki */ /* if (!strcmp(name,"COM10")) return 0x16;*/ /* if (!strcmp(name,"DL")) return 0x17;*/ if (!strcmp(name,"LetterExtra")) return 0x2a; /* Letter navi --- Letter+ */ if (!strcmp(name,"A4Extra")) return 0x2b; /* A4navi --- A4+ */ - if (!strcmp(name,"A3plus")) return 0x2c; /* A3navi --- A3+ */ - if (!strcmp(name,"w288h144")) return 0x2d; /* ??? */ + if (!strcmp(name,"A3plus")) return 0x2c; /* A3navi --- A3+ (13x19 inch) */ + if (!strcmp(name,"w288h144")) return 0x2d; /* 4x2 inch labels */ if (!strcmp(name,"COM10")) return 0x2e; /* US Comm #10 Env */ if (!strcmp(name,"DL")) return 0x2f; /* Euro DL Env */ if (!strcmp(name,"w297h666")) return 0x30; /* Western Env #4 (you4) */ if (!strcmp(name,"w277h538")) return 0x31; /* Western Env #6 (you6) */ - if (!strcmp(name,"w252h360J")) return 0x32; /* L --- similar to US 3.5x5 size */ - if (!strcmp(name,"w360h504J")) return 0x33; /* 2L --- similar to US5x7 */ - if (!strcmp(name,"w288h432J")) return 0x34; /* KG --- same size as US 4x6 */ + if (!strcmp(name,"w252h360J")) return 0x32; /* L --- similar to US 3.5x5 inch size */ + if (!strcmp(name,"w360h504J")) return 0x33; /* 2L --- similar to US5x7 inch */ + if (!strcmp(name,"w288h432J")) return 0x34; /* KG --- same size as US 4x6 inch */ /* if (!strcmp(name,"CD5Inch")) return 0x35; */ /* CD Custom Tray */ if (!strcmp(name,"w155h257")) return 0x36; /* Japanese Business Card 55mm x 91mm */ - if (!strcmp(name,"w360h504")) return 0x37; /* US5x7 */ - if (!strcmp(name,"w420h567")) return 0x39; /* Ofuku Hagaki */ + if (!strcmp(name,"w360h504")) return 0x37; /* US5x7 inch */ + if (!strcmp(name,"w420h567")) return 0x39; /* Oufuku Hagaki --- but should be w567h420 */ if (!strcmp(name,"w340h666")) return 0x3a; /* Japanese Long Env #3 (chou3) */ if (!strcmp(name,"w255h581")) return 0x3b; /* Japanese Long Env #4 (chou4) */ /* if (!strcmp(name,"CD5Inch")) return 0x3f; */ /* CD Tray A */ @@ -2580,9 +2608,9 @@ canon_size_type(const stp_vars_t *v, const canon_cap_t * caps) /* if (!strcmp(name,"Letter")) return 0x45; */ /* FineArt Letter 35mm border */ if (!strcmp(name,"w288h576")) return 0x46; /* US4x8 */ - if (!strcmp(name,"w1008h1224J")) return 0x47; /* HanKire --- 14in x 17in */ - if (!strcmp(name,"720h864J")) return 0x48; /* YonKire --- 10in x 12 in*/ - if (!strcmp(name,"c8x10J")) return 0x49; /* RokuKire --- same size as 8x10 */ + if (!strcmp(name,"w1008h1224J")) return 0x47; /* HanKire --- 14in x 17 inch */ + if (!strcmp(name,"720h864J")) return 0x48; /* YonKire --- 10in x 12 inch */ + if (!strcmp(name,"c8x10J")) return 0x49; /* RokuKire --- same size as 8x10 inch */ /* if (!strcmp(name,"CD5Inch")) return 0x4a; */ /* CD Tray C */ /* if (!strcmp(name,"CD5Inch")) return 0x4b; */ /* CD Tray D */ @@ -2596,8 +2624,8 @@ canon_size_type(const stp_vars_t *v, const canon_cap_t * caps) /* if (!strcmp(name,"A3plus")) return 0x50; */ /* FineArt A3plus 35mm border */ /* if (!strcmp(name,"CD5Inch")) return 0x51; */ /* CD Tray F */ - if (!strcmp(name,"w288h512")) return 0x52; /* Wide101.6x180.6 */ - /* w283h566 Wide postcard 148mm x 200mm */ + if (!strcmp(name,"w288h512")) return 0x52; /* Wide 101.6x180.6mm */ + /* w283h566 Wide postcard 100mm x 200mm */ /* media size codes for CD (and other media depending on printer model */ @@ -2626,6 +2654,84 @@ canon_size_type(const stp_vars_t *v, const canon_cap_t * caps) return 0; } +/* fix paper_width and paper_length for known papersizes in ESC (p command */ +static void fix_papersize(unsigned char arg_ESCP_1, int *paper_width, int *paper_length){ + + switch(arg_ESCP_1) + { + case 0x01: *paper_width = 3497; *paper_length = 4961; break;; /* A5 */ + case 0x03: *paper_width = 4961; *paper_length = 7016; break;; /* A4 */ + case 0x05: *paper_width = 7016; *paper_length = 9922; break;; /* A3 */ + case 0x08: *paper_width = 4300; *paper_length = 6071; break;; /* B5 */ + case 0x0a: *paper_width = 6071; *paper_length = 8599; break;; /* B4 */ + case 0x0d: *paper_width = 5100; *paper_length = 6600; break;; /* Letter */ + case 0x0f: *paper_width = 5100; *paper_length = 8400; break;; /* Legal */ + case 0x11: *paper_width = 6600; *paper_length = 10200; break;; /* Tabloid : 11x17" */ + /* Letter+, A4+ only seem to be available in shirink-to-fit */ + /* case 0x2a: paper_width = ( init->page_width + border_left + border_right ) * unit / 72; break;; */ /* LetterExtra : Letter navi, Letter+ */ + /* case 0x2b: paper_width = ( init->page_width + border_left + border_right ) * unit / 72; break;; */ /* A4Extra : A4navi, A4+ */ + case 0x2c: *paper_width = 7772; *paper_length = 11410; break;; /* A3Extra : A3navi, A3+ (13x19") */ + /* case 0x2d: paper_width = ( init->page_width + border_left + border_right ) * unit / 72; break;; */ /* w288h144 : 4x2" labels */ + /* Hagaki media */ + case 0x14: *paper_width = 2363; *paper_length = 3497; break;; /* w283h420 : Hagaki */ + /* Oufuku Hagaki should be swapped: w567h420, same height as Hagaki */ + /* case 0x39: paper_width = 4725; l: 3497 */ + /* w420h567 : Oufuku Hagaki */ + /* case 0x39: paper_width=(init->page_width + border_left + border_right) * unit / 72; break;;*/ /* leave untouched since orientation wrong */ + case 0x52: *paper_width = 2400; *paper_length = 4267; break;; /* w288h512 : Wide101.6x180.6mm */ + /* Envelope media */ + case 0x16: *paper_width = 2475; *paper_length = 5700; break;; /* COM10 : US Commercial #10 */ + case 0x17: *paper_width = 2599; *paper_length = 5197; break;; /* DL : Euro DL */ + case 0x2e: *paper_width = 2475; *paper_length = 5700; break;; /* COM10 : US Commercial #10 */ + case 0x2f: *paper_width = 2599; *paper_length = 5197; break;; /* DL : Euro DL */ + case 0x30: *paper_width = 2481; *paper_length = 5552; break;; /* w297xh666 : Western Env #4 (you4) */ + case 0x31: *paper_width = 2155; *paper_length = 4489; break;; /* w277xh538 : Western Env #6 (you6) */ + case 0x3a: *paper_width = 2835; *paper_length = 5552; break;; /* w340xh666 : Japanese Long Env #3 (chou3) */ + case 0x3b: *paper_width = 2126; *paper_length = 4843; break;; /* w255xh581 : Japanese Long Env #4 (chou4) */ + /* Photo media */ + case 0x32: *paper_width = 2103; *paper_length = 3000; break;; /* w252h360 : L --- similar to US 3.5x5" */ + case 0x33: *paper_width = 3000; *paper_length = 4205; break;; /* w360h504 : 2L --- similar to US 5x7" */ + case 0x37: *paper_width = 3000; *paper_length = 4200; break;; /* w360h504 : US 5x7" */ + case 0x34: *paper_width = 2400; *paper_length = 3600; break;; /* w288h432J : KG --- same as US 4x6" */ + case 0x46: *paper_width = 2400; *paper_length = 4800; break;; /* w288h576 : US 4x8" */ + /* CD media */ + case 0x35: *paper_width = 3207; *paper_length = 6041; break;; /* CD5Inch : CD Custom Tray */ + case 0x3f: *paper_width = 3378; *paper_length = 6206; break;; /* CD5Inch : CD Tray A */ + case 0x40: *paper_width = 3095; *paper_length = 5640; break;; /* CD5Inch : CD Tray B */ + case 0x4a: *paper_width = 3095; *paper_length = 5640; break;; /* CD5Inch : CD Tray C */ + case 0x4b: *paper_width = 3095; *paper_length = 5640; break;; /* CD5Inch : CD Tray D */ + case 0x4c: *paper_width = 4063; *paper_length = 6497; break;; /* CD5Inch : CD Tray E */ + case 0x51: *paper_width = 3095; *paper_length = 5730; break;; /* CD5Inch : CD Tray F */ + case 0x53: *paper_width = 3095; *paper_length = 6008; break;; /* CD5Inch : CD Tray G */ + case 0x56: *paper_width = 3095; *paper_length = 6008; break;; /* CD5Inch : CD Tray G late version */ + case 0x57: *paper_width = 3572; *paper_length = 8953; break;; /* CD5Inch : CD Tray H */ + case 0x5b: *paper_width = 3071; *paper_length = 5311; break;; /* CD5Inch : CD Tray J */ + /* case 0x62: paper_width = ( init->page_width + border_left + border_right ) * unit / 72; break;; */ /* CD5Inch : CD Tray L */ + /* Business/Credit Card media */ + case 0x36: *paper_width = 1300; *paper_length = 2150; break;; /* w155h257 : Japanese Business Card 55x91mm */ + case 0x41: *paper_width = 1276; *paper_length = 2032; break;; /* w155h244 : Business/Credit Card 54x86mm */ + /* Fine Art media */ + case 0x42: *paper_width = 4961; *paper_length = 7016; break;; /* FineArt A4 35mm border */ + case 0x43: *paper_width = 7016; *paper_length = 9922; break;; /* FineArt A3 35mm border */ + case 0x44: *paper_width = 7772; *paper_length = 11410; break;; /* FineArt A3+ 35mm border */ + case 0x45: *paper_width = 5100; *paper_length = 6600; break;; /* FineArt Letter 35mm border */ + case 0x4d: *paper_width = 4961; *paper_length = 7016; break;; /* FineArt A4 35mm border */ + case 0x4e: *paper_width = 7016; *paper_length = 9922; break;; /* FineArt A3 35mm border */ + case 0x4f: *paper_width = 5100; *paper_length = 6600; break;; /* FineArt Letter 35mm border */ + case 0x50: *paper_width = 7772; *paper_length = 11410; break;; /* FineArt A3+ 35mm border */ + case 0x58: *paper_width = 4961; *paper_length = 7016; break;; /* FineArt A4 35mm border */ + case 0x59: *paper_width = 7016; *paper_length = 9922; break;; /* FineArt A3 35mm border */ + case 0x5a: *paper_width = 5100; *paper_length = 6600; break;; /* FineArt Letter 35mm border */ + case 0x5d: *paper_width = 7772; *paper_length = 11410; break;; /* FineArt A3+ 35mm border */ + /* Other media */ + case 0x47: *paper_width = 8400; *paper_length = 10200; break;; /* w1008h1224J : HanKire --- 14x17" */ + case 0x48: *paper_width = 6000; *paper_length = 7200; break;; /* 720h864J : YonKire --- 10x12" */ + case 0x49: *paper_width = 4800; *paper_length = 6000; break;; /* c8x10J : RokuKire --- same as 8x10" */ + /* default */ + /* default: paper_width=(init->page_width + border_left + border_right) * unit / 72; break;; */ /* custom */ + } +} + static void canon_describe_resolution(const stp_vars_t *v, int *x, int *y) { @@ -3097,6 +3203,16 @@ canon_parameters(const stp_vars_t *v, const char *name, else description->is_active = 0; } + else if (strcmp(name, "Orientation") == 0) + { + description->bounds.str = stp_string_list_create(); + description->deflt.str = orientation_types[0].name; + for (i=0; i < NUM_ORIENTATION; i++) + { + stp_string_list_add_string(description->bounds.str, + orientation_types[i].name,gettext(orientation_types[i].text)); + } + } else if (strcmp(name, "Quality") == 0) { #if 0 @@ -3165,11 +3281,12 @@ internal_imageable_area(const stp_vars_t *v, /* I */ if (media_size) pt = stp_get_papersize_by_name(media_size); - + if(input_slot && !strcmp(input_slot,"CD")) cd = 1; stp_default_media_size(v, &width, &length); + if (cd) { /* ignore printer margins for the cd print, margins get adjusted in do_print for now */ if (pt) { @@ -3576,7 +3693,8 @@ canon_init_setPrintMode(const stp_vars_t *v, const canon_privdata_t *init) if (!arg_6d_a) arg_6d_b= 1; - arg_6d_1= 0x04; + arg_6d_1= 0x04; + if ((!strcmp(init->caps->name,"7000")) && (init->used_inks == CANON_INK_K || init->used_inks == CANON_INK_CcMmYK || init->used_inks == CANON_INK_CcMmYyK)) arg_6d_1= 0x03; @@ -3614,7 +3732,7 @@ static void canon_init_setPageMargins2(const stp_vars_t *v, canon_privdata_t *init) { unsigned char arg_70_1,arg_70_2,arg_70_3,arg_70_4; - + int border_left,border_right,border_top,border_bottom; int border_left2,border_top2; int border_right2; @@ -3641,7 +3759,16 @@ canon_init_setPageMargins2(const stp_vars_t *v, canon_privdata_t *init) int adjust_tray_H_left, adjust_tray_H_right, adjust_tray_H_top, adjust_tray_H_bottom; int adjust_tray_J_left, adjust_tray_J_right, adjust_tray_J_top, adjust_tray_J_bottom; int adjust_tray_L_left, adjust_tray_L_right, adjust_tray_L_top, adjust_tray_L_bottom; + int paper_width, paper_length; + /* Canon printer firmware requires paper_width (and paper_length?) + to be exact matches in units of 1/600 inch. + To this end, papersize code is used to find the papersize for the + printjob, and paper_width and paper_length set to exact values, + rather than calculated. + */ + unsigned char arg_ESCP_1 = (init->pt) ? canon_size_type(v,init->caps) : 0x03; /* default size A4 */ + stp_dprintf(STP_DBG_CANON, v,"setPageMargins2: arg_ESCP_1 = '%x'\n",arg_ESCP_1); /* TOFIX: what exactly is to be sent? * Is it the printable length or the bottom border? @@ -3649,12 +3776,12 @@ canon_init_setPageMargins2(const stp_vars_t *v, canon_privdata_t *init) */ int unit = 600; - int printable_width= (init->page_width + 1)*5/6; - int printable_length= (init->page_height + 1)*5/6; + int printable_width = (init->page_width + 1)*5/6; + int printable_length = (init->page_height + 1)*5/6; const char* input_slot = stp_get_string_parameter(v, "InputSlot"); - int print_cd= (input_slot && (!strcmp(input_slot, "CD"))); - + int print_cd = (input_slot && (!strcmp(input_slot, "CD"))); + stp_dprintf(STP_DBG_CANON, v,"setPageMargins2: print_cd = %d\n",print_cd); test_cd = 1; @@ -4175,16 +4302,16 @@ canon_init_setPageMargins2(const stp_vars_t *v, canon_privdata_t *init) /* calculated depending on borderless or not: uses modified borders */ if ( (init->caps->features & CANON_CAP_BORDERLESS) && !(print_cd) && stp_get_boolean_parameter(v, "FullBleed") ) { + /* borderless */ stp_put32_be((init->page_width - border_left2 - border_right2 ) * unit / 72,v); /* area_width */ stp_put32_be((init->page_height - border_top2 - border_bottom2 ) * unit / 72,v); /* area_length */ } else { - /* for CD */ - if ( (print_cd) && (test_cd==1) ) { + if ( (print_cd) && (test_cd==1) ) { /* bordered for CD */ stp_put32_be(init->page_width * unit / 72,v); /* area_width */ stp_put32_be(init->page_height * unit / 72,v); /* area_length */ } - else { /* no CD */ + else { /* bordered non CD media */ stp_put32_be((init->page_width) * unit / 72,v); /* area_width */ stp_put32_be((init->page_height) * unit / 72,v); /* area_length */ } @@ -4194,21 +4321,35 @@ canon_init_setPageMargins2(const stp_vars_t *v, canon_privdata_t *init) stp_put32_be(0,v); /* paper_right : Windows also 0 here for all Trays */ stp_put32_be(0,v); /* paper_top : Windows also 0 here for all Trays */ - /* standard paper sizes, unchanged for borderless so use original borders */ + /* standard paper sizes, unchanged for borderless so use + original borders */ + + /* discovered that paper_width needs to be same as Windows + dimensions for Canon printer firmware to automatically + determine which tray to pull paper from automatically. + */ + if ( (init->caps->features & CANON_CAP_BORDERLESS) && !(print_cd) && stp_get_boolean_parameter(v, "FullBleed") ) { + /* borderless */ stp_put32_be((init->page_width) * unit / 72,v); /* paper_width */ stp_put32_be((init->page_height) * unit / 72,v); /* paper_length */ } else { - /* for CD */ - if ( (print_cd) && (test_cd==1) ) { - stp_put32_be((init->page_width + border_left2 + border_right2) * unit / 72,v); /* paper_width */ - stp_put32_be((init->page_height + border_top2 + border_bottom2) * unit / 72,v); /* paper_length */ + if ( (print_cd) && (test_cd==1) ) { /* bordered for CD */ + paper_width = (init->page_width + border_left2 + border_right2) * unit / 72; /* paper_width */ + paper_length = (init->page_height + border_top2 + border_bottom2) * unit / 72; /* paper_length */ + fix_papersize(arg_ESCP_1, &paper_width, &paper_length); + stp_put32_be(paper_width,v); /* paper_width */ + stp_put32_be(paper_length,v); /* paper_length */ } - else { /* not CD */ - stp_put32_be((init->page_width + border_left + border_right) * unit / 72,v); /* paper_width */ - stp_put32_be((init->page_height + border_top + border_bottom) * unit / 72,v); /* paper_length */ + else { /* bordered non CD media */ + /* set by calculation first, then correct if necessary */ + paper_width = (init->page_width + border_left + border_right) * unit / 72; /* paper_width */ + paper_length = (init->page_height + border_top + border_bottom) * unit / 72; /* paper_length */ + fix_papersize(arg_ESCP_1, &paper_width, &paper_length); + stp_put32_be(paper_width,v); /* paper_width */ + stp_put32_be(paper_length,v); /* paper_length */ } } @@ -4221,16 +4362,24 @@ canon_init_setPageMargins2(const stp_vars_t *v, canon_privdata_t *init) } /* ESC (P -- 0x50 -- unknown -- : - pt = stp_get_papersize_by_name(media_size); - seems to set media and page information. Different byte lengths depending on printer model. */ + Seems to set media and page information. Different byte lengths + depending on printer model. + Page rotation option in driver [ESC (v] influences ESC (P command + parameters 5 and 6: + none: 1 0 + 90 deg: 2 0 + 180 deg: 1 1 + 270 deg: 2 1 +*/ static void canon_init_setESC_P(const stp_vars_t *v, const canon_privdata_t *init) { - unsigned char arg_ESCP_1, arg_ESCP_2, arg_ESCP_9; + unsigned char arg_ESCP_1, arg_ESCP_2, arg_ESCP_5, arg_ESCP_6, arg_ESCP_9; int width, length; /* const char *media_size = stp_get_string_parameter(v, "PageSize"); const stp_papersize_t *pt = NULL; */ + const char* orientation_type = stp_get_string_parameter(v, "Orientation"); const char* input_slot = stp_get_string_parameter(v, "InputSlot"); const char* input_tray = stp_get_string_parameter(v, "CassetteTray"); /* const canon_cap_t * caps= canon_get_model_capabilities(v); */ @@ -4257,9 +4406,30 @@ canon_init_setESC_P(const stp_vars_t *v, const canon_privdata_t *init) else user_ESCP_9=0x00; /* fall-through setting, but this value is not used */ - arg_ESCP_1 = (init->pt) ? canon_size_type(v,init->caps): 0x03; + arg_ESCP_1 = (init->pt) ? canon_size_type(v,init->caps): 0x03; /* set to A4 size as default */ + stp_deprintf(STP_DBG_CANON,"canon: ESCP (P code read paper size, resulting arg_ESCP_1: '%x'\n",arg_ESCP_1); arg_ESCP_2 = (init->pt) ? init->pt->media_code_P: 0x00; + arg_ESCP_5 = 0x01; /* default for portrait orientation */ + arg_ESCP_6 = 0x00; /* default for portrait orientation */ + + if( orientation_type && !strcmp(orientation_type,"Portrait")) { /* none */ + arg_ESCP_5 = 0x01; + arg_ESCP_6 = 0x00; + } + else if( orientation_type && !strcmp(orientation_type,"Landscape")) { /* 90 deg */ + arg_ESCP_5 = 0x02; + arg_ESCP_6 = 0x00; + } + else if( orientation_type && !strcmp(orientation_type,"UpsideDown")) { /* 180 deg */ + arg_ESCP_5 = 0x01; + arg_ESCP_6 = 0x01; + } + else if( orientation_type && !strcmp(orientation_type,"Seascape")) { /* 270 deg */ + arg_ESCP_5 = 0x02; + arg_ESCP_6 = 0x01; + } + /* Code for last argument in 9-byte ESC (P printers with and upper and lower tray included in the cassette input source The intention appears to be to allow printing of photos and non-photo paper without needing to change trays. Note, envelopes are printed from the lower tray. @@ -4611,14 +4781,14 @@ canon_init_setESC_P(const stp_vars_t *v, const canon_privdata_t *init) if ( !(strcmp(init->caps->name,"PIXMA MG7700")) ) { /* output with 3 extra 0s at the end */ - canon_cmd( v,ESC28,0x50,12,0x00,arg_ESCP_1,0x00,arg_ESCP_2,0x01,0x00,0x01,0x00,arg_ESCP_9,0x00,0x00,0x00); + canon_cmd( v,ESC28,0x50,12,0x00,arg_ESCP_1,0x00,arg_ESCP_2,arg_ESCP_5,arg_ESCP_6,0x01,0x00,arg_ESCP_9,0x00,0x00,0x00 ); } else { /* arg_ESCP_1 = 0x03; */ /* A4 size */ /* arg_ESCP_2 = 0x00; */ /* plain media */ - /* size media tray */ - canon_cmd( v,ESC28,0x50,9,0x00,arg_ESCP_1,0x00,arg_ESCP_2,0x01,0x00,0x01,0x00,arg_ESCP_9); + /* size media tray */ + canon_cmd( v,ESC28,0x50,9,0x00,arg_ESCP_1,0x00,arg_ESCP_2,arg_ESCP_5,arg_ESCP_6,0x01,0x00,arg_ESCP_9 ); } } @@ -4628,7 +4798,7 @@ canon_init_setESC_P(const stp_vars_t *v, const canon_privdata_t *init) /* arg_ESCP_1 = 0x03; */ /* A4 size */ /* arg_ESCP_2 = 0x00; */ /* plain media */ /* size media */ - canon_cmd( v,ESC28,0x50,8,0x00,arg_ESCP_1,0x00,arg_ESCP_2,0x01,0x00,0x01,0x00); + canon_cmd( v,ESC28,0x50,8,0x00,arg_ESCP_1,0x00,arg_ESCP_2,arg_ESCP_5,arg_ESCP_6,0x01,0x00 ); } else if ( init->caps->ESC_P_len == 6 ) /* first devices with XML header and ender */ {/* the 4th of the 6 bytes is the media type. 2nd byte is media size. Both read from canon-media array. */ @@ -4636,7 +4806,7 @@ canon_init_setESC_P(const stp_vars_t *v, const canon_privdata_t *init) /* arg_ESCP_1 = 0x03; */ /* A4 size */ /* arg_ESCP_2 = 0x00; */ /* plain media */ /* size media */ - canon_cmd( v,ESC28,0x50,6,0x00,arg_ESCP_1,0x00,arg_ESCP_2,0x01,0x00); + canon_cmd( v,ESC28,0x50,6,0x00,arg_ESCP_1,0x00,arg_ESCP_2,arg_ESCP_5,arg_ESCP_6 ); } else if ( init->caps->ESC_P_len == 4 ) {/* 4 bytes */ /* size media */ @@ -4651,9 +4821,10 @@ canon_init_setESC_P(const stp_vars_t *v, const canon_privdata_t *init) "ESC_P_len=%d!!\n",init->caps->ESC_P_len); } -#if 0 -/* ESC (s -- 0x73 -- used in some newer printers for duplex pages except last one -- */ -/* When capability available, used for non-tumble and tumble (unlike Esc (u which is non-tumble only) */ +/* ESC (s -- 0x73 -- : + used in some newer printers for duplex pages except last one. + When capability available, used for non-tumble and tumble (unlike Esc (u which is non-tumble only) + Limitation: outputs on every page */ static void canon_init_setESC_s(const stp_vars_t *v, const canon_privdata_t *init) { @@ -4664,7 +4835,6 @@ canon_init_setESC_s(const stp_vars_t *v, const canon_privdata_t *init) canon_cmd(v,ESC28,0x73, 1, 0x00); } -#endif /* ESC (S -- 0x53 -- unknown -- : Required by iP90/iP90v and iP100 printers. @@ -5082,32 +5252,54 @@ canon_init_setESC_u(const stp_vars_t *v, const canon_privdata_t *init) if (!(init->caps->features & CANON_CAP_DUPLEX)) return; - canon_cmd(v,ESC28,0x75, 1, 0x01); + canon_cmd( v,ESC28,0x75, 1, 0x01 ); } /* ESC (v -- 0x76 -- */ +/* page rotation in Windows driver settings: */ +/* none: 0x0 */ +/* 90 deg: 0x1 */ +/* 180 deg: 0x2 */ +/* 270 deg: 0x3 */ +/* also influences ESC (P command parameters 5 and 6 */ +/* none: 1 0 */ +/* 90 deg: 2 0 */ +/* 180 deg: 1 1 */ +/* 270 deg: 2 1 */ static void canon_init_setESC_v(const stp_vars_t *v, const canon_privdata_t *init) { + const char *orientation_type =stp_get_string_parameter(v, "Orientation"); + unsigned char arg_ESCv_1 = 0x00; + if (!(init->caps->features & CANON_CAP_v)) return; - - canon_cmd(v,ESC28,0x76, 1, 0x00); + + if( orientation_type && !strcmp(orientation_type,"Portrait")) /* none */ + arg_ESCv_1 = 0x00; + else if( orientation_type && !strcmp(orientation_type,"Landscape")) /* 90 deg */ + arg_ESCv_1 = 0x01; + else if( orientation_type && !strcmp(orientation_type,"UpsideDown")) /* 180 deg */ + arg_ESCv_1 = 0x02; + else if( orientation_type && !strcmp(orientation_type,"Seascape")) /* 270 deg */ + arg_ESCv_1 = 0x03; + + canon_cmd( v,ESC28,0x76, 1, arg_ESCv_1 ); } -/* ESC (w -- 0x77 -- */ +/* ESC (w -- 0x77 -- : + Unknown. + new September 2015, currently only 1 byte. +*/ static void canon_init_setESC_w(const stp_vars_t *v, const canon_privdata_t *init) { unsigned char arg_ESCw_1; - - /* new September 2015, currently only 1 byte */ if (!(init->caps->features & CANON_CAP_w)) return; arg_ESCw_1 = (init->pt) ? init->pt->media_code_w: 0x00; - - canon_cmd(v,ESC28,0x77, 1, arg_ESCw_1); + canon_cmd( v,ESC28,0x77, 1, arg_ESCw_1 ); } static void @@ -5115,12 +5307,12 @@ canon_init_printer(const stp_vars_t *v, canon_privdata_t *init) { unsigned int mytop; int page_number = stp_get_int_parameter(v, "PageNumber"); - const char *duplex_mode =stp_get_string_parameter(v, "Duplex"); + const char *duplex_mode = stp_get_string_parameter(v, "Duplex"); /* init printer */ if (init->is_first_page) { - canon_init_resetPrinter(v,init); /* ESC [K */ - canon_init_setESC_M(v,init); /* ESC (M */ - canon_init_setDuplex(v,init); /* ESC ($ */ + canon_init_resetPrinter(v,init); /* ESC [K */ + canon_init_setESC_M(v,init); /* ESC (M */ + canon_init_setDuplex(v,init); /* ESC ($ */ } canon_init_setPageMode(v,init); /* ESC (a */ canon_init_setDataCompression(v,init); /* ESC (b */ @@ -5137,9 +5329,12 @@ canon_init_printer(const stp_vars_t *v, canon_privdata_t *init) canon_init_setTray(v,init); /* ESC (l */ canon_init_setX72(v,init); /* ESC (r */ canon_init_setESC_v(v,init); /* ESC (v */ - canon_init_setESC_w(v,init); /* ESC (w */ + if (init->is_first_page) + canon_init_setESC_w(v,init); /* ESC (w */ if((page_number & 1) && duplex_mode && !strcmp(duplex_mode,"DuplexNoTumble")) - canon_init_setESC_u(v,init); /* ESC (u 0x1 */ + canon_init_setESC_u(v,init); /* ESC (u 0x1 */ + if(duplex_mode) + canon_init_setESC_s(v,init); /* ESC (s 0x0 */ canon_init_setMultiRaster(v,init); /* ESC (I (J (L */ /* some linefeeds */ @@ -5439,47 +5634,61 @@ static void canon_setup_channels(stp_vars_t *v,canon_privdata_t* privdata){ #define CANON_CD_Y 405 static void setup_page(stp_vars_t* v,canon_privdata_t* privdata){ - const char *media_source = stp_get_string_parameter(v, "InputSlot"); + const char *media_source = stp_get_string_parameter(v, "InputSlot"); const char *cd_type = stp_get_string_parameter(v, "PageSize"); - int print_cd= (media_source && (!strcmp(media_source, "CD"))); - int page_left, - page_top, - page_right, - page_bottom; + int print_cd = (media_source && (!strcmp(media_source, "CD"))); + int page_left, page_top, page_right, page_bottom; int hub_size = 0; - +#if 0 + /* needed in workaround for Oufuku Hagaki */ + const stp_papersize_t *pp = stp_get_papersize_by_size(stp_get_page_height(v), + stp_get_page_width(v)); + + if (pp) + { + const char *name = pp->name; + if (!strcmp(name,"w420h567")) { + /* workaround for Oufuku Hagaki: wrong orientation */ + privdata->page_width = stp_get_width(v); + privdata->page_height = stp_get_height(v); + stp_set_page_width(v, privdata->page_height); + stp_set_page_height(v, privdata->page_width); + } + } +#endif + if (cd_type && (strcmp(cd_type, "CDCustom") == 0 )) - { - int outer_diameter = stp_get_dimension_parameter(v, "CDOuterDiameter"); - stp_set_page_width(v, outer_diameter); - stp_set_page_height(v, outer_diameter); - stp_set_width(v, outer_diameter); - stp_set_height(v, outer_diameter); - hub_size = stp_get_dimension_parameter(v, "CDInnerDiameter"); - } - else { - const char *inner_radius_name = stp_get_string_parameter(v, "CDInnerRadius"); - hub_size = 43 * 10 * 72 / 254; /* 43 mm standard CD hub */ - - if (inner_radius_name && strcmp(inner_radius_name, "Small") == 0) - hub_size = 16 * 10 * 72 / 254; /* 15 mm prints to the hole - play it - safe and print 16 mm */ + int outer_diameter = stp_get_dimension_parameter(v, "CDOuterDiameter"); + stp_set_page_width(v, outer_diameter); + stp_set_page_height(v, outer_diameter); + stp_set_width(v, outer_diameter); + stp_set_height(v, outer_diameter); + hub_size = stp_get_dimension_parameter(v, "CDInnerDiameter"); } - + else + { + const char *inner_radius_name = stp_get_string_parameter(v, "CDInnerRadius"); + hub_size = 43 * 10 * 72 / 254; /* 43 mm standard CD hub */ + + if (inner_radius_name && strcmp(inner_radius_name, "Small") == 0) + hub_size = 16 * 10 * 72 / 254; /* 15 mm prints to the hole - play it + safe and print 16 mm */ + } + privdata->top = stp_get_top(v); privdata->left = stp_get_left(v); privdata->out_width = stp_get_width(v); /* check Epson: page_true_width */ privdata->out_height = stp_get_height(v); /* check Epson: page_true_height */ - + stp_deprintf(STP_DBG_CANON,"stp_get_width: privdata->out_width is %i\n",privdata->out_width); - stp_deprintf(STP_DBG_CANON,"stp_get_height: privdata->out_height is %i\n",privdata->out_height); - + stp_deprintf(STP_DBG_CANON,"stp_get_height: privdata->out_height is %i\n",privdata->out_height); + /* Don't use full bleed mode if the paper itself has a margin */ if (privdata->left > 0 || privdata->top > 0) stp_set_boolean_parameter(v, "FullBleed", 0); - + internal_imageable_area(v, 0, 0, &page_left, &page_right, &page_bottom, &page_top); if (print_cd) { @@ -5574,9 +5783,9 @@ canon_do_print(stp_vars_t *v, stp_image_t *image) int status = 1; const char *media_source = stp_get_string_parameter(v, "InputSlot"); const char *ink_type = stp_get_string_parameter(v, "InkType"); - const char *duplex_mode =stp_get_string_parameter(v, "Duplex"); + const char *duplex_mode = stp_get_string_parameter(v, "Duplex"); int page_number = stp_get_int_parameter(v, "PageNumber"); - const canon_cap_t * caps= canon_get_model_capabilities(v); + const canon_cap_t * caps = canon_get_model_capabilities(v); const canon_modeuselist_t* mlist = caps->modeuselist; #if 0 const canon_modeuse_t* muse; @@ -5594,7 +5803,7 @@ canon_do_print(stp_vars_t *v, stp_image_t *image) out_channels; /* Output bytes per pixel */ #endif unsigned zero_mask; - int print_cd= (media_source && (!strcmp(media_source, "CD"))); + int print_cd = (media_source && (!strcmp(media_source, "CD"))); int image_height; #if 0 int image_width; @@ -5820,11 +6029,11 @@ canon_do_print(stp_vars_t *v, stp_image_t *image) /* Allocate compression buffer */ if(caps->features & CANON_CAP_I) /*privdata.comp_buf = stp_zalloc(privdata.buf_length_max * 2 * caps->raster_lines_per_block * privdata.num_channels); */ - privdata.comp_buf = stp_zalloc(privdata.buf_length_max * 2 * privdata.mode->raster_lines_per_block * privdata.num_channels); /* for multiraster we need to buffer 8 lines for every color */ + privdata.comp_buf = stp_zalloc(stp_compute_tiff_linewidth(v, privdata.buf_length_max * 2 * privdata.mode->raster_lines_per_block * privdata.num_channels)); /* for multiraster we need to buffer 8 lines for every color */ else - privdata.comp_buf = stp_zalloc(privdata.buf_length_max * 2); + privdata.comp_buf = stp_zalloc(stp_compute_tiff_linewidth(v, privdata.buf_length_max * 2)); /* Allocate fold buffer */ - privdata.fold_buf = stp_zalloc(privdata.buf_length_max); + privdata.fold_buf = stp_zalloc(stp_compute_tiff_linewidth(v, privdata.buf_length_max)); @@ -6262,7 +6471,7 @@ canon_write(stp_vars_t *v, /* I - Print file or command */ unsigned char *line, /* I - Output bitmap data */ int length, /* I - Length of bitmap data */ int coloridx, /* I - Which color */ - int *empty, /* IO- Preceeding empty lines */ + int *empty, /* IO- Preceding empty lines */ int width, /* I - Printed width */ int offset, /* I - Offset from left side */ int bits, diff --git a/src/main/print-color.c b/src/main/print-color.c index 6edd61b..dd0b98c 100644 --- a/src/main/print-color.c +++ b/src/main/print-color.c @@ -1693,18 +1693,17 @@ stpi_color_traditional_describe_parameter(const stp_vars_t *v, { stp_parameter_t ink_limit_desc; stp_describe_parameter(v, "InkChannels", &ink_limit_desc); - if (ink_limit_desc.p_type == STP_PARAMETER_TYPE_INT) + if (ink_limit_desc.p_type == STP_PARAMETER_TYPE_INT && + ink_limit_desc.deflt.integer > 1) { - if (ink_limit_desc.deflt.integer > 1) - { - description->bounds.dbl.upper = - ink_limit_desc.deflt.integer; - description->deflt.dbl = - ink_limit_desc.deflt.integer; - } - else - description->is_active = 0; + description->bounds.dbl.upper = + ink_limit_desc.deflt.integer; + description->deflt.dbl = + ink_limit_desc.deflt.integer; } + else + description->is_active = 0; + stp_parameter_description_destroy(&ink_limit_desc); } break; diff --git a/src/main/print-dpl.c b/src/main/print-dpl.c index fde76ea..b3b0cd8 100644 --- a/src/main/print-dpl.c +++ b/src/main/print-dpl.c @@ -6,7 +6,7 @@ * Robert Krawitz (rlk@alum.mit.edu) and * Dave Hill (dave@minnie.demon.co.uk) * - * Copyright 2016 FIXME + * Copyright 2016 Steve Letter (sletter1@yahoo.com) * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -286,6 +286,171 @@ static const dpl_cap_t dpl_model_capabilities[] = { 'A', 'E', }, +/* Datamax-O'Neil Thermal DPL printers */ + {10031, /* H4212 */ + 4 * 72, 99 * 72, /* Max paper size */ + 1, 1, /* Min paper size */ + DPL_RES_203_203, /* Resolutions */ + DPL_RES_203_203, /* Max Resolution */ + DPL_RES_203_203, /* Resolution Adjust */ + 'W', /* Maximum IPS */ + 'C', /* Minimum IPS */ + 'O', /* Default IPS */ + }, +/* Datamax-O'Neil Thermal DPL printers */ + {10032, /* H4212X */ + 4 * 72, 99 * 72, /* Max paper size */ + 1, 1, /* Min paper size */ + DPL_RES_203_203, /* Resolutions */ + DPL_RES_203_203, /* Max Resolution */ + DPL_RES_203_203, /* Resolution Adjust */ + 'W', /* Maximum IPS */ + 'C', /* Minimum IPS */ + 'O', /* Default IPS */ + }, +/* Datamax-O'Neil Thermal DPL printers */ + {10033, /* H4310 */ + 4 * 72, 99 * 72, /* Max paper size */ + 1, 1, /* Min paper size */ + DPL_RES_150_150 | DPL_RES_300_300, /* Resolutions */ + DPL_RES_300_300, /* Max Resolution */ + DPL_RES_203_203, /* Resolution Adjust */ + 'S', /* Maximum IPS */ + 'C', /* Minimum IPS */ + 'O', /* Default IPS */ + }, +/* Datamax-O'Neil Thermal DPL printers */ + {10034, /* H4310X */ + 4 * 72, 99 * 72, /* Max paper size */ + 1, 1, /* Min paper size */ + DPL_RES_150_150 | DPL_RES_300_300, /* Resolutions */ + DPL_RES_300_300, /* Max Resolution */ + DPL_RES_203_203, /* Resolution Adjust */ + 'S', /* Maximum IPS */ + 'C', /* Minimum IPS */ + 'O', /* Default IPS */ + }, +/* Datamax-O'Neil Thermal DPL printers */ + {10035, /* H4408 */ + 4 * 72, 99 * 72, /* Max paper size */ + 1, 1, /* Min paper size */ + DPL_RES_400_400 | DPL_RES_203_203, /* Resolutions */ + DPL_RES_203_203, /* Max Resolution */ + DPL_RES_203_203, /* Resolution Adjust */ + 'O', /* Maximum IPS */ + 'C', /* Minimum IPS */ + 'G', /* Default IPS */ + }, +/* Datamax-O'Neil Thermal DPL printers */ + {10036, /* H4606 */ + 4 * 72, 99 * 72, /* Max paper size */ + 1, 1, /* Min paper size */ + DPL_RES_300_300 | DPL_RES_600_600, /* Resolutions */ + DPL_RES_600_600, /* Max Resolution */ + DPL_RES_300_300, /* Resolution Adjust */ + 'K', /* Maximum IPS */ + 'C', /* Minimum IPS */ + 'G', /* Default IPS */ + }, +/* Datamax-O'Neil Thermal DPL printers */ + {10037, /* H4606X */ + 4 * 72, 99 * 72, /* Max paper size */ + 1, 1, /* Min paper size */ + DPL_RES_300_300 | DPL_RES_600_600, /* Resolutions */ + DPL_RES_600_600, /* Max Resolution */ + DPL_RES_300_300, /* Resolution Adjust */ + 'K', /* Maximum IPS */ + 'C', /* Minimum IPS */ + 'G', /* Default IPS */ + }, +/* Datamax-O'Neil Thermal DPL printers */ + {10038, /* H6210 */ + 6 * 72, 99 * 72, /* Max paper size */ + 1, 1, /* Min paper size */ + DPL_RES_203_203, /* Resolutions */ + DPL_RES_203_203, /* Max Resolution */ + DPL_RES_203_203, /* Resolution Adjust */ + 'S', /* Maximum IPS */ + 'C', /* Minimum IPS */ + 'O', /* Default IPS */ + }, +/* Datamax-O'Neil Thermal DPL printers */ + {10039, /* H6210X */ + 6 * 72, 99 * 72, /* Max paper size */ + 1, 1, /* Min paper size */ + DPL_RES_203_203, /* Resolutions */ + DPL_RES_203_203, /* Max Resolution */ + DPL_RES_203_203, /* Resolution Adjust */ + 'S', /* Maximum IPS */ + 'C', /* Minimum IPS */ + 'O', /* Default IPS */ + }, +/* Datamax-O'Neil Thermal DPL printers */ + {10040, /* H6212 */ + 6 * 72, 99 * 72, /* Max paper size */ + 1, 1, /* Min paper size */ + DPL_RES_203_203, /* Resolutions */ + DPL_RES_203_203, /* Max Resolution */ + DPL_RES_203_203, /* Resolution Adjust */ + 'W', /* Maximum IPS */ + 'C', /* Minimum IPS */ + 'O', /* Default IPS */ + }, +/* Datamax-O'Neil Thermal DPL printers */ + {10041, /* H6212X */ + 6 * 72, 99 * 72, /* Max paper size */ + 1, 1, /* Min paper size */ + DPL_RES_203_203, /* Resolutions */ + DPL_RES_203_203, /* Max Resolution */ + DPL_RES_203_203, /* Resolution Adjust */ + 'W', /* Maximum IPS */ + 'C', /* Minimum IPS */ + 'O', /* Default IPS */ + }, +/* Datamax-O'Neil Thermal DPL printers */ + {10042, /* H6308 */ + 6 * 72, 99 * 72, /* Max paper size */ + 1, 1, /* Min paper size */ + DPL_RES_150_150 | DPL_RES_300_300, /* Resolutions */ + DPL_RES_300_300, /* Max Resolution */ + DPL_RES_203_203, /* Resolution Adjust */ + 'O', /* Maximum IPS */ + 'C', /* Minimum IPS */ + 'G', /* Default IPS */ + }, +/* Datamax-O'Neil Thermal DPL printers */ + {10043, /* H6310X */ + 6 * 72, 99 * 72, /* Max paper size */ + 1, 1, /* Min paper size */ + DPL_RES_150_150 | DPL_RES_300_300, /* Resolutions */ + DPL_RES_300_300, /* Max Resolution */ + DPL_RES_203_203, /* Resolution Adjust */ + 'S', /* Maximum IPS */ + 'C', /* Minimum IPS */ + 'O', /* Default IPS */ + }, +/* Datamax-O'Neil Thermal DPL printers */ + {10044, /* H8308 */ + 8.5 * 72, 99 * 72, /* Max paper size */ + 1, 1, /* Min paper size */ + DPL_RES_150_150 | DPL_RES_300_300, /* Resolutions */ + DPL_RES_300_300, /* Max Resolution */ + DPL_RES_203_203, /* Resolution Adjust */ + 'O', /* Maximum IPS */ + 'C', /* Minimum IPS */ + 'G', /* Default IPS */ + }, +/* Datamax-O'Neil Thermal DPL printers */ + {10045, /* H8308X */ + 8.5 * 72, 99 * 72, /* Max paper size */ + 1, 1, /* Min paper size */ + DPL_RES_150_150 | DPL_RES_300_300, /* Resolutions */ + DPL_RES_300_300, /* Max Resolution */ + DPL_RES_203_203, /* Resolution Adjust */ + 'O', /* Maximum IPS */ + 'C', /* Minimum IPS */ + 'G', /* Default IPS */ + }, }; static const stp_parameter_t the_parameters[] = { @@ -305,12 +470,13 @@ static const stp_parameter_t the_parameters[] = { STP_PARAMETER_TYPE_STRING_LIST, STP_PARAMETER_CLASS_CORE, STP_PARAMETER_LEVEL_BASIC, 1, 1, STP_CHANNEL_NONE, 1, 0 }, -#ifdef FIXME +#ifdef FIXME /* Orientation not available for graphics, need + * rotation routine in this driver */ { "Orientation", N_("Orientation"), "Color=No,Category=Basic Printer Setup", N_("Orientation, Portrait, Landscape, Upside Down, Seascape"), STP_PARAMETER_TYPE_STRING_LIST, STP_PARAMETER_CLASS_FEATURE, - STP_PARAMETER_LEVEL_BASIC, 1, 1, STP_CHANNEL_NONE, 1, 0, + STP_PARAMETER_LEVEL_BASIC, 1, 1, STP_CHANNEL_NONE, 1, 0 }, #endif { @@ -1111,7 +1277,7 @@ dpl_do_print (stp_vars_t * v, stp_image_t * image) } stp_puts ("\r\002L\r", v); /* enter Label Formatting mode */ - multiplier = dpl_get_multiplier (v); /* dot multiplyer */ + multiplier = dpl_get_multiplier (v); /* dot multiplier */ stp_zprintf (v, "D%1i%1i\r", multiplier, multiplier); stp_puts ("R0000\r", v); /* 0 offset, offset handled below */ stp_puts ("A2\r", v); /* transparent mode */ diff --git a/src/main/print-olympus.c b/src/main/print-olympus.c index 59c8d0c..95eb64c 100644 --- a/src/main/print-olympus.c +++ b/src/main/print-olympus.c @@ -1,9 +1,10 @@ /* * - * Print plug-in DyeSub driver (formerly Olympus driver) for the GIMP. + * Print plug-in DyeSub driver (formerly Olympus driver) for Gutenprint * - * Copyright 2003 - 2006 - * Michael Mraka (Michael.Mraka@linux.cz) + * Copyright 2003-2006 Michael Mraka (Michael.Mraka@linux.cz) + * + * Copyright 2007-2017 Solomon Peachy (pizza@shaftnet.org) * * The plug-in is based on the code of the RAW plugin for the GIMP of * Michael Sweet (mike@easysw.com) and Robert Krawitz (rlk@alum.mit.edu) @@ -41,6 +42,10 @@ #define inline __inline__ #endif +#define MITSU70X_8BPP +//#define S6145_YMC +//#define CANONSELPHYNEO_CMY + #define DYESUB_FEATURE_NONE 0x00000000 #define DYESUB_FEATURE_FULL_WIDTH 0x00000001 #define DYESUB_FEATURE_FULL_HEIGHT 0x00000002 @@ -53,15 +58,15 @@ #define DYESUB_FEATURE_12BPP 0x00000100 #define DYESUB_FEATURE_16BPP 0x00000200 #define DYESUB_FEATURE_BIGENDIAN 0x00000400 -#define DYESUB_FEATURE_RGBtoYCBCR 0x00000800 -#define DYESUB_FEATURE_DUPLEX 0x00001000 -#define DYESUB_FEATURE_MONOCHROME 0x00002000 /* Monochrome only..? */ +#define DYESUB_FEATURE_DUPLEX 0x00000800 +#define DYESUB_FEATURE_MONOCHROME 0x00001000 +#ifndef CANONSELPHYNEO_CMY +#define DYESUB_FEATURE_RGBtoYCBCR 0x00002000 +#endif #define DYESUB_PORTRAIT 0 #define DYESUB_LANDSCAPE 1 -#define MITSU70X_8BPP - #ifndef MIN # define MIN(a,b) (((a) < (b)) ? (a) : (b)) #endif /* !MIN */ @@ -221,7 +226,10 @@ typedef struct int gamma; int flags; int comment; - char usercomment[34]; + int contrast; + int sharpen; + int brightness; + char usercomment[40]; char commentbuf[19]; /* With one extra byte for null termination */ } mitsu_p95d_privdata_t; @@ -279,7 +287,7 @@ typedef struct /* printer specific parameters */ const dyesub_resolution_list_t *resolution; const dyesub_pagesize_list_t *pages; const dyesub_printsize_list_t *printsize; - int block_size; + int block_size; /* Really # of rows in a block */ int features; void (*printer_init_func)(stp_vars_t *); void (*printer_end_func)(stp_vars_t *); @@ -1149,7 +1157,7 @@ static const dyesub_pagesize_t cp910_page[] = { { "Postcard", "Postcard 100x148mm", PT(1248,300)+1, PT(1872,300)+1, 13, 13, 16, 19, DYESUB_PORTRAIT}, { "w253h337", "CP_L 89x119mm", PT(1152,300)+1, PT(1472,300)+1, 13, 13, 15, 15, DYESUB_PORTRAIT}, - { "w155h244", "Card 54x86mm", PT(1088,300)+1, PT(668,300)+1, 13, 13, 15, 15, DYESUB_LANDSCAPE}, + { "w155h244", "Card 54x86mm", PT(668,300)+1, PT(1088,300)+1, 13, 13, 15, 15, DYESUB_LANDSCAPE}, }; LIST(dyesub_pagesize_list_t, cp910_page_list, dyesub_pagesize_t, cp910_page); @@ -1180,7 +1188,12 @@ static void cp910_printer_init_func(stp_vars_t *v) 0x50 ))); stp_putc(pg, v); - dyesub_nputc(v, '\0', 5); + dyesub_nputc(v, '\0', 4); +#ifdef CANONSELPHYNEO_CMY + stp_putc(0x01, v); +#else + stp_putc(0x00, v); +#endif stp_put32_le(pd->w_size, v); stp_put32_le(pd->h_size, v); @@ -1981,7 +1994,7 @@ static const dyesub_pagesize_t kodak_1400_page[] = */ { "w612h864", "8.5x12", PT(2560,301)+1, PT(3010,301)+72*2, PT(76,301)+1, PT(76,301), 72, 72, DYESUB_PORTRAIT}, /* 8x12 */ { "Legal", "8.5x14", PT(2560,301)+1, PT(3612,301)+72*2, PT(35,301)+1, PT(35,301)+1, 72, 72, DYESUB_PORTRAIT}, /* 8x14 */ - { "A4", "A4", PT(2560,301)+1, PT(3010,301)+72*2, PT(76,301)+1, PT(76,301), 0, 0, DYESUB_PORTRAIT}, /* A4, indentical to 8x12 */ + { "A4", "A4", PT(2560,301)+1, PT(3010,301)+72*2, PT(76,301)+1, PT(76,301), 0, 0, DYESUB_PORTRAIT}, /* A4, identical to 8x12 */ }; LIST(dyesub_pagesize_list_t, kodak_1400_page_list, dyesub_pagesize_t, kodak_1400_page); @@ -2481,7 +2494,7 @@ static const stp_parameter_t kodak_8500_parameters[] = }, { "MatteIntensity", N_("Matte Intensity"), "Color=No,Category=Advanced Printer Setup", - N_("Strengh of matte lamination pattern (-5 through +5)"), + N_("Strength of matte lamination pattern (-5 through +5)"), STP_PARAMETER_TYPE_INT, STP_PARAMETER_CLASS_FEATURE, STP_PARAMETER_LEVEL_BASIC, 1, 1, STP_CHANNEL_NONE, 1, 0 }, @@ -2893,7 +2906,10 @@ static int mitsu_p95d_parse_parameters(stp_vars_t *v) if (pd->copies > 200) pd->copies = 200; - + + pd->privdata.m95d.brightness = stp_get_int_parameter(v, "P95Brightness"); + pd->privdata.m95d.contrast = stp_get_int_parameter(v, "P95Contrast"); + if (!strcmp(gamma, "Printer")) { pd->privdata.m95d.gamma = 0x00; } else if (!strcmp(gamma, "T1")) { @@ -3051,7 +3067,10 @@ static void mitsu_p95d_printer_init(stp_vars_t *v) stp_putc(0x00, v); dyesub_nputc(v, 0x00, 5); stp_putc(pd->privdata.m95d.gamma, v); - dyesub_nputc(v, 0x00, 3); + stp_putc(pd->privdata.m95d.brightness, v); + stp_putc(pd->privdata.m95d.contrast, v); + stp_putc(0x00, v); + if (pd->privdata.m95d.gamma == 0x10) { stp_zfwrite(p95d_lut, 1, sizeof(p95d_lut), v); /* XXX only for K95HG? */ } else { @@ -3086,6 +3105,363 @@ static void mitsu_p95d_printer_end(stp_vars_t *v) stp_putc(0x50, v); } +/* Mitsubishi P93D/DW */ + +static const dyesub_media_t mitsu_p93d_medias[] = +{ + {"Standard", N_("Standard (KP61B)"), {1, "\x02"}}, + {"HighDensity", N_("High Density (KP65HM)"), {1, "\x00"}}, + {"HighGlossy", N_("High Glossy (KP91HG)"), {1, "\x01"}}, +}; + +LIST(dyesub_media_list_t, mitsu_p93d_media_list, dyesub_media_t, mitsu_p93d_medias); + +static const dyesub_stringitem_t mitsu_p93d_gammas[] = +{ + { "T1", N_ ("Table 1") }, + { "T2", N_ ("Table 2") }, + { "T3", N_ ("Table 3") }, + { "T4", N_ ("Table 4") }, + { "T5", N_ ("Table 5") }, +}; +LIST(dyesub_stringlist_t, mitsu_p93d_gamma_list, dyesub_stringitem_t, mitsu_p93d_gammas); + +static const stp_parameter_t mitsu_p93d_parameters[] = +{ + { + "P93Gamma", N_("Printer Gamma Correction"), "Color=No,Category=Advanced Printer Setup", + N_("Printer Gamma Correction"), + STP_PARAMETER_TYPE_STRING_LIST, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_ADVANCED, 1, 1, STP_CHANNEL_NONE, 1, 0 + }, + { + "Buzzer", N_("Printer Buzzer"), "Color=No,Category=Advanced Printer Setup", + N_("Printer Buzzer"), + STP_PARAMETER_TYPE_STRING_LIST, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_ADVANCED, 1, 1, STP_CHANNEL_NONE, 1, 0 + }, + { + "PaperSaving", N_("Paper Saving Mode"), "Color=Yes,Category=Advanced Printer Setup", + N_("Paper Saving Mode"), + STP_PARAMETER_TYPE_BOOLEAN, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_BASIC, 1, 1, STP_CHANNEL_NONE, 1, 0 + }, + { + "Comment", N_("Generate Comment"), "Color=No,Category=Advanced Printer Setup", + N_("Generate Comment"), + STP_PARAMETER_TYPE_STRING_LIST, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_ADVANCED, 1, 1, STP_CHANNEL_NONE, 1, 0 + }, + { + "ClearMemory", N_("Clear Memory"), "Color=No,Category=Advanced Printer Setup", + N_("Clear Memory"), + STP_PARAMETER_TYPE_BOOLEAN, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_ADVANCED, 1, 1, STP_CHANNEL_NONE, 1, 0 + }, + { + "ContinuousPrint", N_("Continuous Printing"), "Color=No,Category=Advanced Printer Setup", + N_("Continuous Printing"), + STP_PARAMETER_TYPE_BOOLEAN, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_ADVANCED, 1, 1, STP_CHANNEL_NONE, 1, 0 + }, + { + "P93Brightness", N_("Brightness"), "Color=No,Category=Advanced Printer Setup", + N_("Printer Brightness Adjustment"), + STP_PARAMETER_TYPE_INT, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_ADVANCED, 1, 1, STP_CHANNEL_NONE, 1, 0 + }, + { + "P93Contrast", N_("Contrast"), "Color=No,Category=Advanced Printer Setup", + N_("Printer Contrast Adjustment"), + STP_PARAMETER_TYPE_INT, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_ADVANCED, 1, 1, STP_CHANNEL_NONE, 1, 0 + }, + { + "Sharpen", N_("Image Sharpening"), "Color=No,Category=Advanced Printer Setup", + N_("Sharpening to apply to image (1 is soft, 1 is normal, 2 is hard"), + STP_PARAMETER_TYPE_INT, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_BASIC, 1, 1, STP_CHANNEL_NONE, 1, 0 + }, + { + "UserComment", N_("User Comment"), "Color=No,Category=Advanced Printer Setup", + N_("User-specified comment (0-40 characters from 0x20->0x7E), null terminated if under 40 characters long"), + STP_PARAMETER_TYPE_RAW, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_ADVANCED, 0, 1, STP_CHANNEL_NONE, 1, 0 + }, +}; +#define mitsu_p93d_parameter_count (sizeof(mitsu_p93d_parameters) / sizeof(const stp_parameter_t)) + +static int +mitsu_p93d_load_parameters(const stp_vars_t *v, const char *name, + stp_parameter_t *description) +{ + int i; + const dyesub_cap_t *caps = dyesub_get_model_capabilities( + stp_get_model_id(v)); + + if (caps->parameter_count && caps->parameters) + { + for (i = 0; i < caps->parameter_count; i++) + if (strcmp(name, caps->parameters[i].name) == 0) + { + stp_fill_parameter_settings(description, &(caps->parameters[i])); + break; + } + } + + if (strcmp(name, "P93Gamma") == 0) + { + description->bounds.str = stp_string_list_create(); + + const dyesub_stringlist_t *mlist = &mitsu_p93d_gamma_list; + for (i = 0; i < mlist->n_items; i++) + { + const dyesub_stringitem_t *m = &(mlist->item[i]); + stp_string_list_add_string(description->bounds.str, + m->name, m->text); /* Do *not* want this translated, otherwise use gettext(m->text) */ + } + description->deflt.str = stp_string_list_param(description->bounds.str, 0)->name; + description->is_active = 1; + } else if (strcmp(name, "Buzzer") == 0) { + description->bounds.str = stp_string_list_create(); + + const dyesub_stringlist_t *mlist = &mitsu_p95d_buzzer_list; + for (i = 0; i < mlist->n_items; i++) + { + const dyesub_stringitem_t *m = &(mlist->item[i]); + stp_string_list_add_string(description->bounds.str, + m->name, m->text); /* Do *not* want this translated, otherwise use gettext(m->text) */ + } + description->deflt.str = stp_string_list_param(description->bounds.str, 2)->name; + description->is_active = 1; + } else if (strcmp(name, "PaperSaving") == 0) { + description->deflt.boolean = 0; + description->is_active = 1; + } else if (strcmp(name, "Comment") == 0) { + description->bounds.str = stp_string_list_create(); + + const dyesub_stringlist_t *mlist = &mitsu_p95d_comment_list; + for (i = 0; i < mlist->n_items; i++) + { + const dyesub_stringitem_t *m = &(mlist->item[i]); + stp_string_list_add_string(description->bounds.str, + m->name, m->text); /* Do *not* want this translated, otherwise use gettext(m->text) */ + } + description->deflt.str = stp_string_list_param(description->bounds.str, 0)->name; + description->is_active = 1; + } else if (strcmp(name, "ClearMemory") == 0) { + description->is_active = 1; + description->deflt.boolean = 0; + } else if (strcmp(name, "ContinuousPrint") == 0) { + description->is_active = 1; + description->deflt.boolean = 0; + } else if (strcmp(name, "P93Brightness") == 0) { + description->deflt.integer = 0; + description->bounds.integer.lower = -127; + description->bounds.integer.upper = 127; + description->is_active = 1; + } else if (strcmp(name, "P93Contrast") == 0) { + description->deflt.integer = 0; + description->bounds.integer.lower = -127; + description->bounds.integer.upper = 127; + description->is_active = 1; + } else if (strcmp(name, "Sharpen") == 0) { + description->deflt.integer = 1; + description->bounds.integer.lower = 0; + description->bounds.integer.upper = 2; + description->is_active = 1; + } else if (strcmp(name, "UserComment") == 0) { + description->is_active = 1; + } + else + { + return 0; + } + return 1; +} + +static int mitsu_p93d_parse_parameters(stp_vars_t *v) +{ + dyesub_privdata_t *pd = get_privdata(v); + const char *gamma = stp_get_string_parameter(v, "P93Gamma"); + const char *buzzer = stp_get_string_parameter(v, "Buzzer"); + const char *comment = stp_get_string_parameter(v, "Comment"); + const stp_raw_t *usercomment = NULL; + + /* Sanity check */ + if (stp_check_raw_parameter(v, "UserComment", STP_PARAMETER_ACTIVE)) { + usercomment = stp_get_raw_parameter(v, "UserComment"); + if (usercomment->bytes > 40) { + stp_eprintf(v, _("StpUserComment must be between 0 and 40 bytes!\n")); + return 0; + } + } + + /* No need to set global params if there's no privdata yet */ + if (!pd) + return 1; + + /* Parse options */ + pd->privdata.m95d.clear_mem = stp_get_boolean_parameter(v, "ClearMemory"); + pd->privdata.m95d.cont_print = stp_get_boolean_parameter(v, "ContinuousPrint"); + + if (pd->copies > 200) + pd->copies = 200; + + if (!strcmp(gamma, "T1")) { + pd->privdata.m95d.gamma = 0x00; + } else if (!strcmp(gamma, "T2")) { + pd->privdata.m95d.gamma = 0x01; + } else if (!strcmp(gamma, "T3")) { + pd->privdata.m95d.gamma = 0x02; + } else if (!strcmp(gamma, "T4")) { + pd->privdata.m95d.gamma = 0x03; + } else if (!strcmp(gamma, "T5")) { + pd->privdata.m95d.gamma = 0x04; + } + + if (!strcmp(buzzer, "Off")) { + pd->privdata.m95d.flags |= 0x00; + } else if (!strcmp(buzzer, "Low")) { + pd->privdata.m95d.flags |= 0x02; + } else if (!strcmp(buzzer, "High")) { + pd->privdata.m95d.flags |= 0x03; + } + + pd->privdata.m95d.brightness = stp_get_int_parameter(v, "P93Brightness"); + pd->privdata.m95d.contrast = stp_get_int_parameter(v, "P93Contrast"); + pd->privdata.m95d.sharpen = stp_get_int_parameter(v, "Sharpen"); + + if (stp_get_boolean_parameter(v, "PaperSaving")) { + pd->privdata.m95d.flags |= 0x04; + } + + if (!strcmp(comment, "Off")) { + memset(pd->privdata.m95d.commentbuf, 0, sizeof(pd->privdata.m95d.commentbuf)); + pd->privdata.m95d.comment = 0; + } else if (!strcmp(comment, "Settings")) { + memset(pd->privdata.m95d.commentbuf, 0, sizeof(pd->privdata.m95d.commentbuf)); + pd->privdata.m95d.comment = 1; + } else if (!strcmp(comment, "Date")) { + struct tm tmp; + time_t t; + t = time(NULL); + localtime_r(&t, &tmp); + strftime(pd->privdata.m95d.commentbuf, sizeof(pd->privdata.m95d.commentbuf), " %F", &tmp); + pd->privdata.m95d.comment = 2; + } else if (!strcmp(comment, "DateTime")) { + struct tm tmp; + time_t t; + t = time(NULL); + localtime_r(&t, &tmp); + strftime(pd->privdata.m95d.commentbuf, sizeof(pd->privdata.m95d.commentbuf), " %F %R", &tmp); + pd->privdata.m95d.comment = 3; + } + + if (usercomment) { + if (strncmp("None", usercomment->data, usercomment->bytes)) { + int i; + memcpy(pd->privdata.m95d.usercomment, usercomment->data, usercomment->bytes); + if (usercomment->bytes < 40) + pd->privdata.m95d.usercomment[usercomment->bytes] = 0; + for (i = 0 ; i < usercomment->bytes ; i++) { + if (pd->privdata.m95d.usercomment[i] < 0x20 || + pd->privdata.m95d.usercomment[i] > 0x7F) + pd->privdata.m95d.usercomment[i] = 0x20; + } + } + } else { + memset(pd->privdata.m95d.usercomment, 0x20, sizeof(pd->privdata.m95d.usercomment)); + } + + return 1; +} + +static void mitsu_p93d_printer_init(stp_vars_t *v) +{ + dyesub_privdata_t *pd = get_privdata(v); + + /* Header */ + stp_putc(0x1b, v); + stp_putc(0x51, v); + + /* Clear memory */ + if (pd->privdata.m95d.clear_mem) { + stp_putc(0x1b, v); + stp_putc(0x5a, v); + stp_putc(0x43, v); + stp_putc(0x00, v); + } + + /* Page Setup */ + stp_putc(0x1b, v); + stp_putc(0x57, v); + stp_putc(0x20, v); + stp_putc(0x2e, v); + stp_putc(0x00, v); + stp_putc(0x0a, v); + dyesub_nputc(v, 0x00, 8); + stp_put16_be(pd->w_size, v); /* Columns */ + stp_put16_be(pd->h_size, v); /* Rows */ + + /* This is only set under Windows if a "custom" size is selected, + but the USB comms always show it set to 1... */ + if (!strcmp(pd->pagesize,"Custom")) + stp_putc(0x01, v); + else + stp_putc(0x00, v); + dyesub_nputc(v, 0x00, 31); + + /* Print Options */ + stp_putc(0x1b, v); + stp_putc(0x57, v); + stp_putc(0x21, v); + stp_putc(0x2e, v); + stp_putc(0x00, v); + stp_putc(0x4a, v); + stp_putc(0xaa, v); + stp_putc(0x00, v); + stp_putc(0x00, v); + stp_zfwrite((pd->media->seq).data, 1, 1, v); /* Media Type */ + stp_putc(0x00, v); + stp_putc(0x00, v); + stp_putc(0x00, v); + if (pd->privdata.m95d.cont_print) + stp_putc(0xff, v); + else + stp_putc(pd->copies, v); + stp_putc(0x00, v); + stp_putc(pd->privdata.m95d.comment, v); + stp_zfwrite(pd->privdata.m95d.commentbuf, 1, sizeof(pd->privdata.m95d.commentbuf) -1, v); + dyesub_nputc(v, 0x00, 3); + stp_putc(0x02, v); + dyesub_nputc(v, 0x00, 11); + stp_putc(pd->privdata.m95d.flags, v); + + /* Gamma */ + stp_putc(0x1b, v); + stp_putc(0x57, v); + stp_putc(0x22, v); + stp_putc(0x2e, v); + stp_putc(0x00, v); + stp_putc(0xd5, v); + dyesub_nputc(v, 0x00, 6); + + stp_putc(pd->privdata.m95d.sharpen, v); // XXX + stp_putc(0x00, v); + stp_putc(pd->privdata.m95d.gamma, v); + stp_putc(0x00, v); + stp_putc(pd->privdata.m95d.brightness, v); + stp_putc(0x00, v); + stp_putc(pd->privdata.m95d.contrast, v); + dyesub_nputc(v, 0x00, 31); + + /* User Comment */ + stp_putc(0x1b, v); + stp_putc(0x58, v); + stp_zfwrite(pd->privdata.m95d.usercomment, 1, sizeof(pd->privdata.m95d.usercomment), v); +} + /* Mitsubishi CP3020D/DU/DE */ static const dyesub_pagesize_t mitsu_cp3020d_page[] = { @@ -4243,10 +4619,11 @@ static void mitsu_cpd70k60_printer_init(stp_vars_t *v, unsigned char model) stp_putc(pd->privdata.m70x.sharpen, v); stp_putc(0x01, v); /* Mark as 8bpp BGR rather than 16bpp YMC cooked */ stp_putc(pd->privdata.m70x.use_lut, v); /* Use LUT? */ + stp_putc(0x01, v); /* Tell the backend the data's in the proper order */ #else - dyesub_nputc(v, 0x00, 15); + dyesub_nputc(v, 0x00, 16); #endif - dyesub_nputc(v, 0x00, 448); /* Pad to 512-byte block */ + dyesub_nputc(v, 0x00, 447); /* Pad to 512-byte block */ } static void mitsu_cpd70x_printer_init(stp_vars_t *v) @@ -4994,7 +5371,7 @@ static const stp_parameter_t shinko_chcs1245_parameters[] = }, { "MatteIntensity", N_("Matte Intensity"), "Color=No,Category=Advanced Printer Setup", - N_("Strengh of matte lamination pattern (-25 through +25)"), + N_("Strength of matte lamination pattern (-25 through +25)"), STP_PARAMETER_TYPE_INT, STP_PARAMETER_CLASS_FEATURE, STP_PARAMETER_LEVEL_BASIC, 1, 1, STP_CHANNEL_NONE, 1, 0 }, @@ -5381,7 +5758,11 @@ static void shinko_chcs6145_printer_init(stp_vars_t *v) stp_put32_le(0x00, v); stp_put32_le(0x00, v); +#ifdef S6145_YMC + stp_put32_le(0x01, v); +#else stp_put32_le(0x00, v); +#endif } /* Ciaat Brava 21 */ @@ -6691,20 +7072,34 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, NULL, NULL, 0, NULL, NULL, }, - { /* Canon CP820, CP910 */ + { /* Canon CP820, CP910, CP1000, CP1200 */ 1011, +#ifdef CANONSELPHYNEO_CMY + &cmy_ink_list, +#else &rgb_ink_list, +#endif &res_300dpi_list, &cp910_page_list, &cp910_printsize_list, SHRT_MAX, +#ifdef CANONSELPHYNEO_CMY + DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT + | DYESUB_FEATURE_BORDERLESS | DYESUB_FEATURE_WHITE_BORDER + | DYESUB_FEATURE_PLANE_INTERLACE, +#else DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT | DYESUB_FEATURE_BORDERLESS | DYESUB_FEATURE_WHITE_BORDER | DYESUB_FEATURE_PLANE_INTERLACE | DYESUB_FEATURE_RGBtoYCBCR, +#endif &cp910_printer_init_func, NULL, NULL, NULL, NULL, NULL, +#ifdef CANONSELPHYNEO_CMY + cpx00_adjust_curves, +#else NULL, +#endif NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, @@ -7135,7 +7530,7 @@ static const dyesub_cap_t dyesub_model_capabilities[] = &mitsu_cpd70x_printsize_list, SHRT_MAX, #ifdef MITSU70X_8BPP - DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT, + DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT | DYESUB_FEATURE_PLANE_LEFTTORIGHT, &mitsu_cpd70x_printer_init, NULL, #else DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT @@ -7165,7 +7560,7 @@ static const dyesub_cap_t dyesub_model_capabilities[] = &mitsu_cpk60_printsize_list, SHRT_MAX, #ifdef MITSU70X_8BPP - DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT, + DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT | DYESUB_FEATURE_PLANE_LEFTTORIGHT, &mitsu_cpk60_printer_init, NULL, #else DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT @@ -7195,7 +7590,7 @@ static const dyesub_cap_t dyesub_model_capabilities[] = &mitsu_cpd80_printsize_list, SHRT_MAX, #ifdef MITSU70X_8BPP - DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT, + DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT | DYESUB_FEATURE_PLANE_LEFTTORIGHT, &mitsu_cpd70x_printer_init, NULL, #else DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT @@ -7225,7 +7620,7 @@ static const dyesub_cap_t dyesub_model_capabilities[] = &kodak305_printsize_list, SHRT_MAX, #ifdef MITSU70X_8BPP - DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT, + DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT | DYESUB_FEATURE_PLANE_LEFTTORIGHT, &kodak305_printer_init, NULL, #else DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT @@ -7250,7 +7645,7 @@ static const dyesub_cap_t dyesub_model_capabilities[] = &mitsu_cpd90_page_list, &mitsu_cpd90_printsize_list, SHRT_MAX, - DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT, + DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT | DYESUB_FEATURE_PLANE_LEFTTORIGHT, &mitsu_cpd90_printer_init, &mitsu_cpd90_printer_end, NULL, NULL, NULL, NULL, /* No block funcs */ @@ -7311,7 +7706,7 @@ static const dyesub_cap_t dyesub_model_capabilities[] = &fuji_ask300_printsize_list, SHRT_MAX, #ifdef MITSU70X_8BPP - DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT, + DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT | DYESUB_FEATURE_PLANE_LEFTTORIGHT, &mitsu_cpd70x_printer_init, NULL, #else DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT @@ -7390,6 +7785,26 @@ static const dyesub_cap_t dyesub_model_capabilities[] = mitsu9500_load_parameters, mitsu9500_parse_parameters, }, + { /* Mitsubishi P93D/DW */ + 4116, + &w_ink_list, + &res_325dpi_list, + &mitsu_p95d_page_list, + &mitsu_p95d_printsize_list, + SHRT_MAX, + DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT + | DYESUB_FEATURE_MONOCHROME, + &mitsu_p93d_printer_init, &mitsu_p95d_printer_end, + &mitsu_p95d_plane_start, NULL, + NULL, NULL, /* No block funcs */ + NULL, + NULL, &mitsu_p93d_media_list, + NULL, NULL, + mitsu_p93d_parameters, + mitsu_p93d_parameter_count, + mitsu_p93d_load_parameters, + mitsu_p93d_parse_parameters, + }, { /* Shinko CHC-S9045 (experimental) */ 5000, &rgb_ink_list, @@ -7459,11 +7874,18 @@ static const dyesub_cap_t dyesub_model_capabilities[] = }, { /* Shinko/Sinfonia CHC-S6145 */ 5004, +#ifdef S6145_YMC + &ymc_ink_list, +#else &rgb_ink_list, +#endif &res_300dpi_list, &shinko_chcs6145_page_list, &shinko_chcs6145_printsize_list, SHRT_MAX, +#ifdef S6145_YMC + DYESUB_FEATURE_PLANE_INTERLACE | +#endif DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT, &shinko_chcs6145_printer_init, &shinko_chcs2145_printer_end, NULL, NULL, /* No planes */ @@ -7475,11 +7897,18 @@ static const dyesub_cap_t dyesub_model_capabilities[] = }, { /* CIAAT Brava 21 (aka CHC-S6145D) */ 5005, +#ifdef S6145_YMC + &ymc_ink_list, +#else &rgb_ink_list, +#endif &res_300dpi_list, &ciaat_brava21_page_list, &ciaat_brava21_printsize_list, SHRT_MAX, +#ifdef S6145_YMC + DYESUB_FEATURE_PLANE_INTERLACE | +#endif DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT, &shinko_chcs6145_printer_init, &shinko_chcs2145_printer_end, NULL, NULL, /* No planes */ @@ -8232,7 +8661,15 @@ static void dyesub_swap_ints(int *a, int *b) { int t = *a; - *a = *b; + *a = *b; + *b = t; +} + +static void +dyesub_swap_doubles(double *a, double *b) +{ + double t = *a; + *a = *b; *b = t; } @@ -8278,15 +8715,12 @@ dyesub_exec_check(stp_vars_t *v, return 1; } - -static int +/* FIXME: This function is badly named. It actually picks the best single + "point" on the original image to use for the desired output pixel. */ +static double dyesub_interpolate(int oldval, int oldsize, int newsize) { - /* - * This is simple linear interpolation algorithm. - * When imagesize <> printsize I need rescale image somehow... :-/ - */ - return (int)(oldval * newsize / oldsize); + return ((double)oldval * (double)newsize / (double)oldsize); } static void @@ -8345,121 +8779,127 @@ dyesub_read_image(stp_vars_t *v, return image_data; } -static int -dyesub_print_pixel(stp_vars_t *v, - dyesub_print_vars_t *pv, - const dyesub_cap_t *caps, - int row, - int col, - int plane) -{ - unsigned short ink[MAX_INK_CHANNELS], *out; - int i, j, b; - - if (pv->print_mode == DYESUB_LANDSCAPE) - { /* "rotate" image */ - dyesub_swap_ints(&col, &row); - row = (pv->imgw_px - 1) - row; - } +static void +dyesub_render_pixel(unsigned short *src, char *dest, + dyesub_print_vars_t *pv, + const dyesub_cap_t *caps, + int plane) +{ + unsigned short ink[MAX_INK_CHANNELS]; /* What is sent to printer */ - out = &(pv->image_data[row][col * pv->out_channels]); + int i; + int start, end; - for (i = 0; i < pv->ink_channels; i++) + /* Only compute one color at a time */ + if (pv->plane_interlacing || pv->row_interlacing) { - if (pv->out_channels == pv->ink_channels) - { /* copy out_channel (image) to equiv ink_channel (printer) */ - if (dyesub_feature(caps, DYESUB_FEATURE_RGBtoYCBCR)) { - /* Convert RGB -> YCbCr (JPEG YCbCr444 coefficients) */ - double R, G, B; - R = out[0]; - G = out[1]; - B = out[2]; - - if (i == 0) /* Y */ - ink[i] = R * 0.299 + G * 0.587 + B * 0.114; - else if (i == 1) /* Cb */ - ink[i] = R * -0.168736 + G * -0.331264 + B * 0.5 + 32768; - else if (i == 2) /* Cr */ - ink[i] = R * 0.5 + G * -0.418688 + B * -0.081312 + 32768; - - /* FIXME: Natively support YCbCr "inks" in the - Gutenprint core and allow that as an input - into the dyesub driver. */ - } else { - ink[i] = out[i]; - } - } - else if (pv->out_channels < pv->ink_channels) - { /* several ink_channels (printer) "share" same out_channel (image) */ - ink[i] = out[i * pv->out_channels / pv->ink_channels]; - } - else /* (pv->out_channels > pv->ink_channels) */ - { /* merge several out_channels (image) into ink_channel (printer) */ - int avg = 0; - for (j = 0; j < pv->out_channels / pv->ink_channels; j++) - avg += out[j + i * pv->out_channels / pv->ink_channels]; - ink[i] = avg * pv->ink_channels / pv->out_channels; - } + start = plane; + end = plane + 1; + } + else + { + start = 0; + end = pv->ink_channels; } - - /* Downscale 16bpp to output bpp */ - /* FIXME: Do we want to round? */ - if (pv->bytes_per_ink_channel == 1) + + /* copy out_channel (image) to equiv ink_channel (printer) */ + for (i = start; i < end; i++) { - unsigned char *ink_u8 = (unsigned char *) ink; - for (i = 0; i < pv->ink_channels; i++) { +#ifndef CANONSELPHYNEO_CMY + if (dyesub_feature(caps, DYESUB_FEATURE_RGBtoYCBCR)) + { + /* Convert RGB -> YCbCr (JPEG YCbCr444 coefficients) */ + double R, G, B; + R = src[0]; + G = src[1]; + B = src[2]; + + if (i == 0) /* Y */ + ink[i] = R * 0.299 + G * 0.587 + B * 0.114; + else if (i == 1) /* Cb */ + ink[i] = R * -0.168736 + G * -0.331264 + B * 0.5 + (1 << (16 -1)); // Math is 16bpp here. + else if (i == 2) /* Cr */ + ink[i] = R * 0.5 + G * -0.418688 + B * -0.081312 + (1 << (16 -1)); // Math is 16bpp here. + /* FIXME: Natively support YCbCr "inks" in the + Gutenprint core and allow that as an input + into the dyesub driver. */ + } + else +#endif + { + ink[i] = src[i]; + } + + /* Downscale 16bpp to output bpp */ + if (pv->bytes_per_ink_channel == 1) + { + unsigned char *ink_u8 = (unsigned char *) ink; +#ifndef CANONSELPHYNEO_CMY #if 0 - if (dyesub_feature(caps, DYESUB_FEATURE_RGBtoYCBCR)) - ink_u8[i] = ink[i] >> 8; - else + /* FIXME: Do we want to round? */ + if (dyesub_feature(caps, DYESUB_FEATURE_RGBtoYCBCR)) + ink_u8[i] = ink[i] >> 8; + else #endif - ink_u8[i] = ink[i] / 257; - } - } - else if (pv->bits_per_ink_channel != 16) - { - for (i = 0; i < pv->ink_channels; i++) - ink[i] = ink[i] >> (16 - pv->bits_per_ink_channel); - } +#endif + ink_u8[i] = ink[i] / 257; + } + else /* ie 2 bytes per channel */ + { + /* Scale down to output bits */ + if (pv->bits_per_ink_channel != 16) + ink[i] = ink[i] >> (16 - pv->bits_per_ink_channel); - /* Byteswap as needed */ - if (pv->bytes_per_ink_channel == 2 && pv->byteswap) - for (i = 0; i < pv->ink_channels; i++) - ink[i] = ((ink[i] >> 8) & 0xff) | ((ink[i] & 0xff) << 8); + /* Byteswap if needed */ + if (pv->byteswap) + ink[i] = ((ink[i] >> 8) & 0xff) | ((ink[i] & 0xff) << 8); + } + } + /* If we use plane or row interlacing, only write the plane's channel */ if (pv->plane_interlacing || pv->row_interlacing) - stp_zfwrite((char *) ink + (plane * pv->bytes_per_ink_channel), - pv->bytes_per_ink_channel, 1, v); - else - /* print inks in correct order, eg. RGB BGR */ - for (b = 0; b < pv->ink_channels; b++) - stp_zfwrite((char *) ink + (pv->bytes_per_ink_channel * (pv->ink_order[b]-1)), - pv->bytes_per_ink_channel, 1, v); - - return 1; + memcpy(dest, (char *) ink + (plane * pv->bytes_per_ink_channel), + pv->bytes_per_ink_channel); + else /* Otherwise, print the full set of inks, in order (eg RGB or BGR) */ + for (i = 0; i < pv->ink_channels; i++) + memcpy(dest + i*pv->bytes_per_ink_channel, + (char *) ink + (pv->bytes_per_ink_channel * (pv->ink_order[i]-1)), + pv->bytes_per_ink_channel); } -static int -dyesub_print_row(stp_vars_t *v, - dyesub_print_vars_t *pv, - const dyesub_cap_t *caps, - int row, - int plane) -{ - int ret = 0; - int w, col; +static void +dyesub_render_row(stp_vars_t *v, + dyesub_print_vars_t *pv, + const dyesub_cap_t *caps, + double in_row, + char *dest, + int bytes_per_pixel, + int plane) +{ + int w; + unsigned short *src; for (w = 0; w < pv->outw_px; w++) { - col = dyesub_interpolate(w, pv->outw_px, pv->imgw_px); + double row = in_row; + double col = dyesub_interpolate(w, pv->outw_px, pv->imgw_px); if (pv->plane_lefttoright) - ret = dyesub_print_pixel(v, pv, caps, row, pv->imgw_px - col - 1, plane); - else - ret = dyesub_print_pixel(v, pv, caps, row, col, plane); - if (ret > 1) - break; + col = pv->imgw_px - col - 1; + if (pv->print_mode == DYESUB_LANDSCAPE) + { /* "rotate" image */ + dyesub_swap_doubles(&col, &row); + row = (pv->imgw_px - 1) - row; + } + // XXX FIXME: This is "point" interpolation. Be smarter! + // eg: Average (average all pixels that touch this one) + // BiLinear (scale based on linear interpolation) + // BiCubic (scale based on weighted average, based on proximity) + // Lanczos (awesome!! but slow) + src = &(pv->image_data[(int)row][(int)col * pv->out_channels]); + + dyesub_render_pixel(src, dest + w*bytes_per_pixel, + pv, caps, plane); } - return ret; } static int @@ -8469,16 +8909,36 @@ dyesub_print_plane(stp_vars_t *v, const dyesub_cap_t *caps, int plane) { - - - int ret = 0; - int h, row, p; - int out_bytes = ((pv->plane_interlacing || pv->row_interlacing) ? 1 : pv->ink_channels) + int h; + int bpp = ((pv->plane_interlacing || pv->row_interlacing) ? 1 : pv->ink_channels) * pv->bytes_per_ink_channel; + size_t rowlen = pv->prnw_px * bpp; + char *destrow = stp_malloc(rowlen); /* Allocate a buffer for the rendered rows */ + if (!destrow) + return 0; /* ? out of memory ? */ + + /* Pre-Fill in the blank bits of the row. */ + if (dyesub_feature(caps, DYESUB_FEATURE_FULL_WIDTH)) + { + /* FIXME: This is broken for bpp != 1 and packed data -- but no such models exist. */ + /* empty part left of image area */ + if (pv->outl_px > 0) + { + memset(destrow, pv->empty_byte[plane], bpp * pv->outl_px); + } + /* empty part right of image area */ + if (pv->outr_px < pv->prnw_px) + { + memset(destrow + rowlen - bpp * (pv->prnw_px - pv->outr_px), + pv->empty_byte[plane], + bpp * (pv->prnw_px - pv->outr_px)); + } + } for (h = 0; h <= pv->prnb_px - pv->prnt_px; h++) { - p = pv->row_interlacing ? 0 : plane; + int p = pv->row_interlacing ? 0 : plane; + double row; do { @@ -8493,31 +8953,25 @@ dyesub_print_plane(stp_vars_t *v, dyesub_exec(v, caps->block_init_func, "caps->block_init"); } + /* Generate a single row */ if (h + pv->prnt_px < pv->outt_px || h + pv->prnt_px >= pv->outb_px) { /* empty part above or below image area */ - dyesub_nputc(v, pv->empty_byte[plane], out_bytes * pv->prnw_px); + memset(destrow, pv->empty_byte[plane], rowlen); + /* FIXME: This is also broken for bpp != 1 and packed data */ + /* FIXME: Also this is inefficient; it won't change once generated.. */ } else { - if (dyesub_feature(caps, DYESUB_FEATURE_FULL_WIDTH) - && pv->outl_px > 0) - { /* empty part left of image area */ - dyesub_nputc(v, pv->empty_byte[plane], out_bytes * pv->outl_px); - } - row = dyesub_interpolate(h + pv->prnt_px - pv->outt_px, - pv->outh_px, pv->imgh_px); + pv->outh_px, pv->imgh_px); + stp_deprintf(STP_DBG_DYESUB, - "dyesub_print_plane: h = %d, row = %d\n", h, row); - ret = dyesub_print_row(v, pv, caps, row, p); - - if (dyesub_feature(caps, DYESUB_FEATURE_FULL_WIDTH) - && pv->outr_px < pv->prnw_px) - { /* empty part right of image area */ - dyesub_nputc(v, pv->empty_byte[plane], out_bytes - * (pv->prnw_px - pv->outr_px)); - } + "dyesub_print_plane: h = %d, row = %f\n", h, row); + + dyesub_render_row(v, pv, caps, row, destrow + bpp * pv->outl_px, bpp, p); } + /* And send it out */ + stp_zfwrite(destrow, rowlen, 1, v); if (h + pv->prnt_px == pd->block_max_h) { /* block end */ @@ -8526,7 +8980,9 @@ dyesub_print_plane(stp_vars_t *v, } while (pv->row_interlacing && ++p < pv->ink_channels); } - return ret; + + stp_free(destrow); + return 1; } /* @@ -8676,6 +9132,16 @@ dyesub_do_print(stp_vars_t *v, stp_image_t *image) stp_channel_add(v, i, 0, 1.0); pv.out_channels = stp_color_init(v, image, 65536); + /* If there's a mismatch in channels, that is ALWAYS a problem */ + if (pv.out_channels != pv.ink_channels) + { + stp_deprintf(STP_DBG_DYESUB, + "Input and output channel count mismatch! (%d vs %d)\n", pv.out_channels, pv.ink_channels); + stp_image_conclude(image); + stp_free(pd); + return 2; + } + if (dyesub_feature(caps, DYESUB_FEATURE_12BPP)) { pv.bytes_per_ink_channel = 2; pv.bits_per_ink_channel = 12; @@ -8699,11 +9165,16 @@ dyesub_do_print(stp_vars_t *v, stp_image_t *image) pv.image_data = dyesub_read_image(v, &pv, image); if (ink_type) { +#ifndef CANONSELPHYNEO_CMY if (dyesub_feature(caps, DYESUB_FEATURE_RGBtoYCBCR)) { pv.empty_byte[0] = 0xff; /* Y */ pv.empty_byte[1] = 0x80; /* Cb */ pv.empty_byte[2] = 0x80; /* Cr */ - } else if (strcmp(ink_type, "RGB") == 0 || strcmp(ink_type, "BGR") == 0 || strcmp(ink_type, "Whitescale") == 0) { + } else +#endif + if (strcmp(ink_type, "RGB") == 0 || + strcmp(ink_type, "BGR") == 0 || + strcmp(ink_type, "Whitescale") == 0) { pv.empty_byte[0] = 0xff; pv.empty_byte[1] = 0xff; pv.empty_byte[2] = 0xff; @@ -8725,6 +9196,7 @@ dyesub_do_print(stp_vars_t *v, stp_image_t *image) if (!pv.image_data) { stp_image_conclude(image); + stp_free(pd); return 2; } /* /FIXME */ diff --git a/src/testpattern/Makefile.am b/src/testpattern/Makefile.am index 0482a05..245b884 100644 --- a/src/testpattern/Makefile.am +++ b/src/testpattern/Makefile.am @@ -33,7 +33,7 @@ TESTS = run-testpattern-1 run-testpattern-2 bin_PROGRAMS = testpattern noinst_PROGRAMS = printers printer_options -noinst_SCRIPTS = run-testpattern-2 compare-checksums compress-checksums uncompress-checksums +noinst_SCRIPTS = run-testpattern-2 compare-checksums compress-checksums endif AM_LFLAGS = -i @@ -59,11 +59,15 @@ endif if BUILD_TESTPATTERN -checksums: testpattern run-testpattern-2 ./compress-checksums +# This suffix is *not* static during development! +CSUM_SUFFIX=`@PKGROOT@/scripts/gversion` +CSUM_FILE=Checksums/sums.$(SPREFIX)$(CSUM_SUFFIX) + +Checksums: $(MKDIR_P) Checksums - ./run-testpattern-2 -q -M Checksums/sums.$(SPREFIX)@GUTENPRINT_VERSION@.in - ./compress-checksums < Checksums/sums.@GUTENPRINT_VERSION@.in |$(BZIP2) -c > Checksums/sums.@GUTENPRINT_VERSION@.bz2 - rm -f Checksums/sums.@GUTENPRINT_VERSION@.in + +checksums: testpattern run-testpattern-2 ./compress-checksums Checksums + ./run-testpattern-2 -q -M - | ./compress-checksums | $(COMPRESS) > "$(CSUM_FILE)$(CSUF)" endif ## Clean @@ -76,5 +80,4 @@ EXTRA_DIST = \ run-testpattern \ run-testpattern-1 \ compare-checksums.in \ - compress-checksums.in \ - uncompress-checksums.in + compress-checksums.in diff --git a/src/testpattern/Makefile.in b/src/testpattern/Makefile.in index feec3ce..5731867 100644 --- a/src/testpattern/Makefile.in +++ b/src/testpattern/Makefile.in @@ -87,9 +87,9 @@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/scripts/global.mk $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(srcdir)/run-testpattern-2.in \ $(srcdir)/compare-checksums.in $(srcdir)/compress-checksums.in \ - $(srcdir)/uncompress-checksums.in testpatterny.h \ - testpatterny.c testpatternl.c $(top_srcdir)/scripts/depcomp \ - $(top_srcdir)/scripts/ylwrap $(top_srcdir)/scripts/test-driver + testpatterny.h testpatterny.c testpatternl.c \ + $(top_srcdir)/scripts/depcomp $(top_srcdir)/scripts/ylwrap \ + $(top_srcdir)/scripts/test-driver @BUILD_TESTPATTERN_TRUE@bin_PROGRAMS = testpattern$(EXEEXT) @BUILD_TESTPATTERN_TRUE@noinst_PROGRAMS = printers$(EXEEXT) \ @BUILD_TESTPATTERN_TRUE@ printer_options$(EXEEXT) @@ -110,7 +110,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = run-testpattern-2 compare-checksums \ - compress-checksums uncompress-checksums + compress-checksums CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgdatadir)" PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) @@ -430,9 +430,11 @@ BZIP2 = @BZIP2@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +COMPRESS = @COMPRESS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSUF = @CSUF@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LIBS = @CUPS_LIBS@ @@ -491,6 +493,7 @@ GUTENPRINT_MICRO_VERSION = @GUTENPRINT_MICRO_VERSION@ GUTENPRINT_MINOR_VERSION = @GUTENPRINT_MINOR_VERSION@ GUTENPRINT_RELEASE_VERSION = @GUTENPRINT_RELEASE_VERSION@ GUTENPRINT_VERSION = @GUTENPRINT_VERSION@ +GZIP = @GZIP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -516,6 +519,7 @@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ +LRZIP = @LRZIP@ LTALLOCA = @LTALLOCA@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ @@ -543,6 +547,7 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ +PKGROOT = @PKGROOT@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ @@ -551,6 +556,7 @@ POSUB = @POSUB@ RANLIB = @RANLIB@ RELEASE_DATE = @RELEASE_DATE@ RM = @RM@ +RZIP = @RZIP@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ @@ -563,6 +569,7 @@ VERSION = @VERSION@ WHICH_PPDS = @WHICH_PPDS@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ +XZ = @XZ@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ @@ -634,7 +641,7 @@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(LOCAL_CPPFLAGS) $(GNUCFLAGS) GUTENPRINTUI_LIBS = $(top_builddir)/src/gutenprintui/libgutenprintui.la @BUILD_TESTPATTERN_TRUE@TESTS = run-testpattern-1 run-testpattern-2 -@BUILD_TESTPATTERN_TRUE@noinst_SCRIPTS = run-testpattern-2 compare-checksums compress-checksums uncompress-checksums +@BUILD_TESTPATTERN_TRUE@noinst_SCRIPTS = run-testpattern-2 compare-checksums compress-checksums AM_LFLAGS = -i AM_YFLAGS = -d testpattern_SOURCES = testpattern.c testpatterny.y testpatternl.l testpattern.h @@ -642,6 +649,10 @@ testpattern_LDADD = $(GUTENPRINT_LIBS) $(LIBM) printers_LDADD = $(GUTENPRINT_LIBS) printer_options_LDADD = $(GUTENPRINT_LIBS) @INSTALL_SAMPLES_TRUE@pkgdata_DATA = testpattern.sample extended.sample + +# This suffix is *not* static during development! +@BUILD_TESTPATTERN_TRUE@CSUM_SUFFIX = `@PKGROOT@/scripts/gversion` +@BUILD_TESTPATTERN_TRUE@CSUM_FILE = Checksums/sums.$(SPREFIX)$(CSUM_SUFFIX) MAINTAINERCLEANFILES = Makefile.in testpatternl.c testpatterny.c testpatterny.h EXTRA_DIST = \ testpatterny.h \ @@ -649,8 +660,7 @@ EXTRA_DIST = \ run-testpattern \ run-testpattern-1 \ compare-checksums.in \ - compress-checksums.in \ - uncompress-checksums.in + compress-checksums.in all: all-am @@ -693,8 +703,6 @@ compare-checksums: $(top_builddir)/config.status $(srcdir)/compare-checksums.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ compress-checksums: $(top_builddir)/config.status $(srcdir)/compress-checksums.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -uncompress-checksums: $(top_builddir)/config.status $(srcdir)/uncompress-checksums.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ @@ -1241,11 +1249,11 @@ $(top_builddir)/src/gutenprintui2/libgutenprintui2.la: testpatternl.o: testpatterny.o testpattern.o: testpatterny.o -@BUILD_TESTPATTERN_TRUE@checksums: testpattern run-testpattern-2 ./compress-checksums +@BUILD_TESTPATTERN_TRUE@Checksums: @BUILD_TESTPATTERN_TRUE@ $(MKDIR_P) Checksums -@BUILD_TESTPATTERN_TRUE@ ./run-testpattern-2 -q -M Checksums/sums.$(SPREFIX)@GUTENPRINT_VERSION@.in -@BUILD_TESTPATTERN_TRUE@ ./compress-checksums < Checksums/sums.@GUTENPRINT_VERSION@.in |$(BZIP2) -c > Checksums/sums.@GUTENPRINT_VERSION@.bz2 -@BUILD_TESTPATTERN_TRUE@ rm -f Checksums/sums.@GUTENPRINT_VERSION@.in + +@BUILD_TESTPATTERN_TRUE@checksums: testpattern run-testpattern-2 ./compress-checksums Checksums +@BUILD_TESTPATTERN_TRUE@ ./run-testpattern-2 -q -M - | ./compress-checksums | $(COMPRESS) > "$(CSUM_FILE)$(CSUF)" # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/src/testpattern/compare-checksums.in b/src/testpattern/compare-checksums.in index 07d7c43..4174796 100755 --- a/src/testpattern/compare-checksums.in +++ b/src/testpattern/compare-checksums.in @@ -1,5 +1,5 @@ #!@PERL@ -## Copyright (C) 2016 Robert Krawitz +## Copyright (C) 2016-2017 Robert Krawitz ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -25,8 +25,12 @@ while ($#ARGV >= 0 && $ARGV[0] eq '-d') { shift @ARGV; } -if ($#ARGV != 1) { - die "Usage: $0 old_checksum_file new_checksum_file\n"; +if ($#ARGV <= 0) { + print_file($ARGV[0]); +} elsif ($#ARGV == 1) { + compare_files($ARGV[0], $ARGV[1]); +} else { + die "Usage: $0 [old_checksum_file] [new_checksum_file]\n"; } sub get_printer($) { @@ -41,107 +45,150 @@ sub get_mode($) { return $mode; } -sub load_file($\%\%) { - my ($file, $modes, $printers) = @_; - if ($file =~ /\.bz2$/) { - open(IN, "bunzip2 -c $file|") or die("Can't open checksum file $file: $!\n"); - } elsif ($file =~ /.gz$/) { - open(IN, "gunzip -c $file|") or die("Can't open checksum file $file: $!\n"); +sub uncompress_chunk($$) { + my ($chunk, $sub_table) = @_; + if (defined $$sub_table{$chunk}) { + return $$sub_table{$chunk}; } else { - open(IN, "$file") or die("Can't open checksum file $file: $!\n"); - } - my ($inline); - my ($last_sum) = ""; - while ($inline = <IN>) { - chomp $inline; - my ($sum, @okeys) = split(/ /, $inline); - if ($last_sum ne "" && ((length $sum) < (length $last_sum))) { - $sum = substr($last_sum, 0, ((length $last_sum) - (length $sum))) . $sum; - } - $last_sum = $sum; - my @keys = map { - s/\.prn$//; - s/^\*//; - $_; - } @okeys; - my (@pchunks) = (); - foreach my $k (@keys) { - $k =~ s/=/________/g; - $k =~ s/!/_______/g; - $k =~ s/"/______/g; - $k =~ s/,/_____/g; - $k =~ s/'/____/g; - $k =~ s/%/___/g; - $k =~ s/>/__/g; - my (@chunks) = split(/_/, $k, -1); - foreach my $i (0..$#chunks) { - if ($chunks[$i] eq '') { - $chunks[$i] = $pchunks[$i]; - } elsif ($chunks[$i] =~ /^([0-9]+)\+(.*)/) { - $chunks[$i] = substr($pchunks[$i], 0, $1) . $2; - } - } - my ($val) = join('_', @chunks); - $val =~ s/(^[^:]*)_:(.*)/$2_$1/; - $$modes{$val} = $sum; - $$printers{get_printer($val)} = 1; - @pchunks = @chunks; - } + return $chunk; } - close IN; } -load_file($ARGV[0], %old_modes, %old_printers); -load_file($ARGV[1], %new_modes, %new_printers); - -my (%only_old_printers, %only_new_printers); - -foreach my $new_printer (keys %new_printers) { - if (! defined $old_printers{$new_printer}) { - $only_new_printers{$new_printer} = 1; +sub open_file($) { + my ($file) = @_; + my $in; + if ($file =~ /\.bz2$/) { + open($in, '-|', "@BZIP2@ -d -c $file") || die("Can't open checksum file $file: $!\n"); + } elsif ($file =~ /.gz$/) { + open($in, '-|', "@GZIP@ -d -c $file") || die("Can't open checksum file $file: $!\n"); + } elsif ($file =~ /.xz$/) { + open($in, '-|', "@XZ@ -d -c $file") || die("Can't open checksum file $file: $!\n"); + } elsif ($file =~ /.lrz$/) { + open($in, '-|', "cat $file | @LRZIP@ -d -q") || die("Can't open checksum file $file: $!\n"); + } elsif ($file =~ /.rz$/) { + open($in, '-|', "@RZIP@ -d -c $file") || die("Can't open checksum file $file: $!\n"); + } else { + open($in, '<', "$file") || die("Can't open checksum file $file: $!\n"); } + return $in; } -foreach my $old_printer (keys %old_printers) { - if (! defined $new_printers{$old_printer}) { - $only_old_printers{$old_printer} = 1; - } +sub create_substitution_table() { + my (%sub_table); + $sub_table{"PrintingMode"} = "P;"; + $sub_table{"PageSize"} = "S;"; + $sub_table{"DitherAlgorithm"} = "D;"; + $sub_table{"Resolution"} = "R;"; + $sub_table{"ColorCorrection"} = "C;"; + $sub_table{"Color"} = "c;"; + $sub_table{"MediaType"} = "M;"; + $sub_table{"InputSlot"} = "I;"; + %sub_table = reverse %sub_table; + return \%sub_table; } -my (@only_old_modes, @only_new_modes, @changed_modes); - -sub mode_ne($$) { - my ($new, $old) = @_; - if (length $new == length $old) { - return ($new ne $old); - } elsif (length $new < length $old) { - return ($new ne substr($old, 0, length $new)); +sub initialize_file($) { + my ($file) = @_; + my (%ctx); + if ($file eq '' || $file eq '-' || ! defined $file) { + $ctx{"fh"} = \*STDIN; + $ctx{"close_fh"} = 0; } else { - return ($old ne substr($new, 0, length $old)); + $ctx{"fh"} = open_file($file); + $ctx{"close_fh"} = 1; } + $ctx{"sum"} = ""; + $ctx{"last_sum"} = ""; + $ctx{"kvals"} = []; + $ctx{"sub_table"} = create_substitution_table(); + $ctx{"pchunks"} = []; + $ctx{"active"} = 1; + return \%ctx; } -foreach my $old_mode (sort keys %old_modes) { - next if defined $only_old_printers{get_printer($old_mode)}; - if (defined $new_modes{$old_mode}) { - if (mode_ne($new_modes{$old_mode}, $old_modes{$old_mode})) { - push @changed_modes, $old_mode; +sub get_next_datum($) { + my ($ctx) = @_; + if (! $$ctx{"active"}) { + return undef; + } + if ((scalar @{$$ctx{"kvals"}}) == 0) { + my ($fh) = $$ctx{"fh"}; + my ($inline); + my ($read) = 0; + while ($inline = <$fh>) { + $read = 1; + last; } - } else { - push @only_old_modes, $old_mode; + if (! $read) { + if ($$ctx{"close_fh"}) { + close($fh); + } + $$ctx{"active"} = 0; + return undef; + } + chomp $inline; + my ($sum, @okeys) = split(/ /, $inline); + if ($$ctx{"last_sum"} ne "" && + ((length $sum) < (length $$ctx{"last_sum"}))) { + $sum = + substr($$ctx{"last_sum"}, 0, + ((length $$ctx{"last_sum"}) - (length $sum))) . + $sum; + } + $$ctx{"sum"} = $sum; + $$ctx{"last_sum"} = $sum; + my @keys = map { + s/\.prn$//; + s/^\*//; + $_; + } @okeys; + $$ctx{"kvals"} = \@keys; + $$ctx{"pchunks"} = []; } + my @pchunks = @{$$ctx{"pchunks"}}; + my $k = shift(@{$$ctx{"kvals"}}); + $k =~ s/=/________/g; + $k =~ s/!/_______/g; + $k =~ s/"/______/g; + $k =~ s/,/_____/g; + $k =~ s/'/____/g; + $k =~ s/%/___/g; + $k =~ s/>/__/g; + my (@chunks) = split(/_/, $k, -1); + foreach my $i (0..$#chunks) { + if ($chunks[$i] eq '') { + $chunks[$i] = ${$$ctx{"pchunks"}}[$i]; + } else { + if ($chunks[$i] =~ /^([0-9]+)\+(.*)/) { + $chunks[$i] = substr(${$$ctx{"pchunks"}}[$i], 0, $1) . $2; + } elsif ($chunks[$i] =~ /^\*(.*)/) { + $chunks[$i] = substr(${$$ctx{"pchunks"}}[$i], 0, 2) . $1; + } + if ($chunks[$i] =~ m,(.*)/([0-9]+)$,) { + $chunks[$i] = $1 . substr(${$$ctx{"pchunks"}}[$i], -$2); + } elsif ($chunks[$i] =~ /([^\\]*)\\$/) { + $chunks[$i] = $1 . substr(${$$ctx{"pchunks"}}[$i], -2); + } + } + } + my ($val) = join('_', map { uncompress_chunk($_, $$ctx{"sub_table"}) } @chunks); + $val =~ s/(^[^:]*)_:(.*)/$2_$1/; + $$ctx{"pchunks"} = \@chunks; + return [$$ctx{"sum"}, $val]; } -foreach my $new_mode (sort keys %new_modes) { - next if defined $only_new_printers{get_printer($new_mode)}; - if (!defined $old_modes{$new_mode}) { - push @only_new_modes, $new_mode; +sub load_file($\%\%) { + my ($file, $modes, $printers) = @_; + my ($ctx) = initialize_file($file); + my ($answer); + while ($answer = get_next_datum($ctx)) { + my ($sum) = $$answer[0]; + my ($val) = $$answer[1]; + $$modes{$val} = $sum; + $$printers{get_printer($val)} = 1; } } -my (@only_old_printers) = sort keys %only_old_printers; -my (@only_new_printers) = sort keys %only_new_printers; - sub print_changes($$@) { my ($tag, $detail, @changes) = @_; my ($prev_printer); @@ -167,11 +214,76 @@ sub print_changes($$@) { print "\n"; } -if (! $detail1) { - print "*** Changes from $ARGV[0] to $ARGV[1] ***\n\n"; - print_changes("Printers removed from $ARGV[1]", 0, @only_old_printers); - print_changes("Printers added to $ARGV[1]", 0, @only_new_printers); - print_changes("Modes removed from $ARGV[1]", 1, @only_old_modes); - print_changes("Modes added to $ARGV[1]", 1, @only_new_modes); +sub compare_files($$) { + my ($file1, $file2) = @_; + load_file($file1, %old_modes, %old_printers); + load_file($file2, %new_modes, %new_printers); + + my (%only_old_printers, %only_new_printers); + + foreach my $new_printer (keys %new_printers) { + if (! defined $old_printers{$new_printer}) { + $only_new_printers{$new_printer} = 1; + } + } + + foreach my $old_printer (keys %old_printers) { + if (! defined $new_printers{$old_printer}) { + $only_old_printers{$old_printer} = 1; + } + } + + my (@only_old_modes, @only_new_modes, @changed_modes); + + sub mode_ne($$) { + my ($new, $old) = @_; + if (length $new == length $old) { + return ($new ne $old); + } elsif (length $new < length $old) { + return ($new ne substr($old, 0, length $new)); + } else { + return ($old ne substr($new, 0, length $old)); + } + } + + foreach my $old_mode (sort keys %old_modes) { + next if defined $only_old_printers{get_printer($old_mode)}; + if (defined $new_modes{$old_mode}) { + if (mode_ne($new_modes{$old_mode}, $old_modes{$old_mode})) { + push @changed_modes, $old_mode; + } + } else { + push @only_old_modes, $old_mode; + } + } + + foreach my $new_mode (sort keys %new_modes) { + next if defined $only_new_printers{get_printer($new_mode)}; + if (!defined $old_modes{$new_mode}) { + push @only_new_modes, $new_mode; + } + } + + my (@only_old_printers) = sort keys %only_old_printers; + my (@only_new_printers) = sort keys %only_new_printers; + + if (! $detail1) { + print "*** Changes from $ARGV[0] to $ARGV[1] ***\n\n"; + print_changes("Printers removed from $ARGV[1]", 0, @only_old_printers); + print_changes("Printers added to $ARGV[1]", 0, @only_new_printers); + print_changes("Modes removed from $ARGV[1]", 1, @only_old_modes); + print_changes("Modes added to $ARGV[1]", 1, @only_new_modes); + } + print_changes("Changed printing modes", 1 + $detail1, @changed_modes); +} + +sub print_file($) { + my ($file) = @_; + my ($ctx) = initialize_file($file); + my ($answer); + while ($answer = get_next_datum($ctx)) { + my ($sum) = $$answer[0]; + my ($val) = $$answer[1]; + print "$sum *$val.prn\n"; + } } -print_changes("Changed printing modes", 1 + $detail1, @changed_modes); diff --git a/src/testpattern/compress-checksums.in b/src/testpattern/compress-checksums.in index b4b0330..19af2f1 100644 --- a/src/testpattern/compress-checksums.in +++ b/src/testpattern/compress-checksums.in @@ -89,6 +89,25 @@ my $min_prefix = find_min_nonunique_prefix(keys %checksums); my ($last_sum) = ""; +my (%sub_table); +$sub_table{"PrintingMode"} = "P;"; +$sub_table{"PageSize"} = "S;"; +$sub_table{"DitherAlgorithm"} = "D;"; +$sub_table{"Resolution"} = "R;"; +$sub_table{"ColorCorrection"} = "C;"; +$sub_table{"Color"} = "c;"; +$sub_table{"MediaType"} = "M;"; +$sub_table{"InputSlot"} = "I;"; + +sub compress_chunk($) { + my ($chunk) = @_; + if (defined $sub_table{$chunk}) { + return $sub_table{$chunk}; + } else { + return $chunk; + } +} + foreach my $sum (sort keys %checksums) { my ($out) = substr($sum, 0, $min_prefix); if ($last_sum ne "") { @@ -106,7 +125,8 @@ foreach my $sum (sort keys %checksums) { "${mode}_:$printer" } @{$checksums{$sum}}; foreach my $run (@runs) { - my (@chunks) = split(/_/, $run); + my (@chunks) = split(/[_]/, $run); + @chunks = map { compress_chunk($_) } @chunks; my ($mchunks) = min(scalar @pchunks, scalar @chunks); my ($i) = 0; $out .= " "; @@ -119,15 +139,29 @@ foreach my $sum (sort keys %checksums) { my ($len) = length $chunks[$i]; my ($maxc) = min($len, $plen); my ($dup) = 0; + my ($tail) = 0; while ($dup < $maxc) { last if (substr($pchunks[$i], $dup, 1) ne substr($chunks[$i], $dup, 1)); $dup++; } - if ($dup > 2) { - $out .= "$dup+" . substr($chunks[$i], $dup); + while ($tail < $maxc - $dup) { + last if (substr($pchunks[$i], -1 - $tail, 1) ne + substr($chunks[$i], -1 - $tail, 1)); + $tail++; + } + my ($chunk) = $chunks[$i]; + if ($tail == 2) { + $chunk = substr($chunk, 0, -$tail) . '\\'; + } elsif ($tail > 2) { + $chunk = substr($chunk, 0, -$tail) . "/$tail"; + } + if ($dup == 2) { + $out .= '*' . substr($chunk, $dup); + } elsif ($dup > 2) { + $out .= "$dup+" . substr($chunk, $dup); } else { - $out .= "$chunks[$i]"; + $out .= "$chunk"; } } else { $out .= ""; diff --git a/src/testpattern/extended.sample b/src/testpattern/extended.sample index 53ec901..db6fbd2 100644 --- a/src/testpattern/extended.sample +++ b/src/testpattern/extended.sample @@ -1,5 +1,23 @@ # Sample test pattern file, for use with Gimp-Print test pattern generator +# Example pattern for test pattern generator +# +# Copyright 2002-2016 Robert Krawitz (rlk@alum.mit.edu) +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the Free +# Software Foundation; either version 2 of the License, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + # Printer/driver settings. # Printer model printer escp2-2200; diff --git a/src/testpattern/run-testpattern b/src/testpattern/run-testpattern index 09dd5e7..098f773 100755 --- a/src/testpattern/run-testpattern +++ b/src/testpattern/run-testpattern @@ -1,5 +1,23 @@ #!/bin/sh +# Driver for test pattern generator +# +# Copyright 2003-2008 Robert Krawitz (rlk@alum.mit.edu) +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the Free +# Software Foundation; either version 2 of the License, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + retval=0; if [ -z "$srcdir" -o "$srcdir" = "." ] ; then diff --git a/src/testpattern/run-testpattern-1 b/src/testpattern/run-testpattern-1 index e27e448..a248e22 100755 --- a/src/testpattern/run-testpattern-1 +++ b/src/testpattern/run-testpattern-1 @@ -1,5 +1,24 @@ #!/bin/sh +# Driver for test pattern generator +# +# Copyright 2004-2008 Robert Krawitz (rlk@alum.mit.edu) and other +# members of the Gutenprint project. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the Free +# Software Foundation; either version 2 of the License, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + retval=0 if [ -z "$srcdir" -o "$srcdir" = "." ] ; then diff --git a/src/testpattern/run-testpattern-2.in b/src/testpattern/run-testpattern-2.in index 00608ff..17555a4 100644 --- a/src/testpattern/run-testpattern-2.in +++ b/src/testpattern/run-testpattern-2.in @@ -1,5 +1,24 @@ #!@PERL@ +# Featureful driver for test pattern generator +# +# Copyright 2006-2017 Robert Krawitz (rlk@alum.mit.edu) and other +# members of the Gutenprint project. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the Free +# Software Foundation; either version 2 of the License, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + use Getopt::Long; Getopt::Long::Configure("bundling", "no_ignore_case", "pass_through"); @@ -25,7 +44,23 @@ my @special_options = (); my $include_pattern = ''; my $exclude_pattern = ''; my %exclude_list = (); -my @standard_options = qw(InkType InkSet,RawChannels DitherAlgorithm Duplex MediaType InputSlot ColorCorrection ImageType FullBleed Quality UseGloss Weave PrintingDirection Density CyanDensity Orientation LabelSeparator); +my @standard_options = ("InkType", + "InkSet,RawChannels", + "DitherAlgorithm", + "Duplex", + "MediaType", + "InputSlot", + "ColorCorrection", + "ImageType", + "FullBleed", + "Quality", + "UseGloss", + "Weave", + "PrintingDirection", + "Density", + "CyanDensity", + "Orientation", + "LabelSeparator"); my $global_status = 1; my $run_installed = 0; my $use_min_res = 0; @@ -500,7 +535,10 @@ sub do_output($) { my $outbase = "${outkey}.prn"; my $outfile = "$output/$outbase"; if (defined $csum_file) { - $checksum_cmd = "${csum_type}sum -b | sed 's/-/$outbase/' >> '$csum_file'"; + $checksum_cmd = "${csum_type}sum -b | sed 's/-/$outbase/'"; + if ($csum_file ne '' && $csum_file ne '-') { + $checksum_cmd .= " >> '$csum_file'"; + } } elsif (defined $csum_dir) { my $checksum_dir = $csum_dir; if (defined $csum_dir && $csum_dir eq "") { @@ -522,18 +560,34 @@ sub do_output($) { } } -sub build_list($$) { - my ($keys, $printer) = @_; +sub build_list($$$$) { + my ($keys, $printer, $min_res, $max_res) = @_; my (@keys) = split (/,/, $keys); my ($key) = $keys[0]; my ($rest); my (@stuff); if ($#keys > 0) { $rest = join ",", @keys[1..$#keys]; - @stuff = build_list($rest, $printer); + @stuff = build_list($rest, $printer, $min_res, $max_res); } my (@tmp); - if ($param_types{$printer}{$key} == 3) { + if ($key =~ /=/) { + my (@values); + my ($vlist); + ($key, $vlist) = split(/=/, $key); + @tmp = split(/;/, $vlist); + if ($key eq 'Resolution') { + @tmp = map { + if ($_ eq 'MIN') { + $min_res; + } elsif ($_ eq 'MAX') { + $max_res; + } else { + $_ + } + } @tmp; + } + } elsif ($param_types{$printer}{$key} == 3) { my ($minv) = $stp_float_values{$printer}{'MINVAL'}{$key}; my ($defv) = $stp_float_values{$printer}{'DEFVAL'}{$key}; my ($maxv) = $stp_float_values{$printer}{'MAXVAL'}{$key}; @@ -571,7 +625,7 @@ sub build_list($$) { sub build_key($$) { my ($keys, $printer) = @_; my (@keys) = split (/,/, $keys); - my (@answer) = grep { defined $param_types{$printer}{$_} } @keys; + my (@answer) = grep { defined $param_types{$printer}{$_} || /=/ } @keys; return join ",", @answer; } @@ -580,6 +634,8 @@ sub do_printer($$) { my $tmp; my $min_res_name; my $min_res_value = 0; + my $max_res_name; + my $max_res_value = 0; my $first_time = 1; my $key; my $skip_resolutions_local = $skip_resolutions; @@ -600,25 +656,30 @@ sub do_printer($$) { } } + foreach $tmp (sort @resolutions) { + my $res_value = ($stpdata{$printer}{'x_resolution'}{$tmp} * + $stpdata{$printer}{'y_resolution'}{$tmp}); + if ($min_res_value == 0 || $res_value < $min_res_value) { + $min_res_value = $res_value; + $min_res_name = $tmp; + } + if ($res_value > $min_res_value) { + $max_res_value = $res_value; + $max_res_name = $tmp; + } + } foreach $key (@special_options) { - my (@subkeys) = split(/,/, $key); + my (@subkeys) = (split(/,/, $key)); if (grep { /^Resolution$/ } @subkeys) { $skip_resolutions_local = 1; } my $nkey = build_key($key, $printer); if ($nkey ne "") { - my (@vals) = build_list($nkey, $printer); + my (@vals) = build_list($nkey, $printer, $min_res_name, $max_res_name); + $nkey =~ s/=[^,]*//g; $opt_vals{$nkey} = \@vals; } } - foreach $tmp (sort @resolutions) { - my $res_value = ($stpdata{$printer}{'x_resolution'}{$tmp} * - $stpdata{$printer}{'y_resolution'}{$tmp}); - if ($min_res_value == 0 || $res_value < $min_res_value) { - $min_res_value = $res_value; - $min_res_name = $tmp; - } - } if ($use_min_res > 1) { @resolutions = ($min_res_name); } @@ -799,7 +860,7 @@ sub stopit { } } -if ($list_options) { +sub list_options() { if ($#printer_list > 0) { die "-L must be used with one printer\n"; } @@ -835,15 +896,16 @@ if ($list_options) { } } } -} elsif ($dontrun) { - map { do_printer($_, \*STDOUT) } @printer_list; - exit 0; -} else { +} + +sub runit() { my $valgrind_command; my $valopts; if ($gdb_attach) { $proc_count = 1; } + + # V A L G R I N D # if ($callgrind) { $valopts = '--tool=callgrind --dump-instr=yes --trace-jump=yes'; $valgrind = 4; @@ -863,6 +925,7 @@ if ($list_options) { $valgrind_command = "valgrind $valopts"; } + # O U T P U T # if (defined $output && $output ne "" && ! -d $output) { mkdir $output || die "Can't create directory $output: $!\n"; } @@ -876,14 +939,12 @@ if ($list_options) { system "touch $csum_file"; } - my $status = 1; + # # # # # # # # my ($suppress); if (! defined $output && ! defined $csum_dir && ! defined $csum_file) { $suppress = '-n'; } - my ($qopt) = $quiet ? "-q" : ""; - my ($Hopt) = $halt_on_error ? "-H" : ""; my (@children); my ($child_no); my ($kid); @@ -896,6 +957,8 @@ if ($list_options) { push @children, $kid; } } + + # Child: select the printers to print, round-robin. if ($kid == 0) { my (@xprinter_list); foreach my $i (0..$#printer_list) { @@ -906,7 +969,10 @@ if ($list_options) { @printer_list = @xprinter_list; } } + + my $status = 1; if ($proc_count > 1 && $kid > 0) { + # Parent in parallel case while ($proc_count > 0 && $kid > 0) { $kid = waitpid(-1, 0); if ($kid > 0 && $? > 0) { @@ -914,6 +980,8 @@ if ($list_options) { } } } else { + my ($qopt) = $quiet ? "-q" : ""; + my ($Hopt) = $halt_on_error ? "-H" : ""; $testpattern_command = "$valgrind_command ./testpattern -y $suppress $qopt $Hopt"; if ($single > 1) { $SIG{TERM} = sub() { stopit() }; @@ -941,7 +1009,7 @@ if ($list_options) { print STDERR "\n"; } if ($status && ! $error) { - exit 0; + return 0; } else { if ($error) { if ($single > 1) { @@ -951,6 +1019,15 @@ if ($list_options) { print STDERR "*** $error CRASH${plural} NOTED***\n"; } } - exit 1; + return 1; } } + + +if ($list_options) { + list_options(); +} elsif ($dontrun) { + map { do_printer($_, \*STDOUT) } @printer_list; +} else { + exit(runit()); +} diff --git a/src/testpattern/testpattern.sample b/src/testpattern/testpattern.sample index 5359c4b..4385cc0 100644 --- a/src/testpattern/testpattern.sample +++ b/src/testpattern/testpattern.sample @@ -1,4 +1,20 @@ -# Sample test pattern file, for use with Gimp-Print test pattern generator +# Sample test pattern file, for use with Gutenprint test pattern generator +# +# Copyright 2001-2016 Robert Krawitz (rlk@alum.mit.edu) +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the Free +# Software Foundation; either version 2 of the License, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Printer/driver settings. # Printer model diff --git a/src/testpattern/uncompress-checksums.in b/src/testpattern/uncompress-checksums.in deleted file mode 100644 index cb3f5cf..0000000 --- a/src/testpattern/uncompress-checksums.in +++ /dev/null @@ -1,53 +0,0 @@ -#!@PERL@ -## Copyright (C) 2016 Robert Krawitz -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2, or (at your option) -## any later version. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -use strict; - -my (%checksums); - -my ($last_sum) = ""; - -while (<>) { - chomp; - my ($sum, @keys) = split; - if ($last_sum ne "" && ((length $sum) < (length $last_sum))) { - $sum = substr($last_sum, 0, ((length $last_sum) - (length $sum))) . $sum; - } - $last_sum = $sum; - my (@pchunks) = (); - foreach my $k (@keys) { - $k =~ s/=/________/g; - $k =~ s/!/_______/g; - $k =~ s/"/______/g; - $k =~ s/,/_____/g; - $k =~ s/'/____/g; - $k =~ s/%/___/g; - $k =~ s/>/__/g; - my (@chunks) = split(/_/, $k, -1); - foreach my $i (0..$#chunks) { - if ($chunks[$i] eq '') { - $chunks[$i] = $pchunks[$i]; - } elsif ($chunks[$i] =~ /^([0-9]+)\+(.*)/) { - $chunks[$i] = substr($pchunks[$i], 0, $1) . $2; - } - } - my ($answer) = join('_', @chunks); - $answer =~ s/(^[^:]*)_:(.*)/$2_$1/; - print "$sum *$answer.prn\n"; - @pchunks = @chunks; - } -} diff --git a/src/xml/Makefile.in b/src/xml/Makefile.in index 1816f06..6d5bc71 100644 --- a/src/xml/Makefile.in +++ b/src/xml/Makefile.in @@ -259,9 +259,11 @@ BZIP2 = @BZIP2@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +COMPRESS = @COMPRESS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSUF = @CSUF@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LIBS = @CUPS_LIBS@ @@ -320,6 +322,7 @@ GUTENPRINT_MICRO_VERSION = @GUTENPRINT_MICRO_VERSION@ GUTENPRINT_MINOR_VERSION = @GUTENPRINT_MINOR_VERSION@ GUTENPRINT_RELEASE_VERSION = @GUTENPRINT_RELEASE_VERSION@ GUTENPRINT_VERSION = @GUTENPRINT_VERSION@ +GZIP = @GZIP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -345,6 +348,7 @@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ +LRZIP = @LRZIP@ LTALLOCA = @LTALLOCA@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ @@ -372,6 +376,7 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ +PKGROOT = @PKGROOT@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ @@ -380,6 +385,7 @@ POSUB = @POSUB@ RANLIB = @RANLIB@ RELEASE_DATE = @RELEASE_DATE@ RM = @RM@ +RZIP = @RZIP@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ @@ -392,6 +398,7 @@ VERSION = @VERSION@ WHICH_PPDS = @WHICH_PPDS@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ +XZ = @XZ@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ diff --git a/src/xml/escp2/Makefile.in b/src/xml/escp2/Makefile.in index e6075d0..ad6278c 100644 --- a/src/xml/escp2/Makefile.in +++ b/src/xml/escp2/Makefile.in @@ -197,9 +197,11 @@ BZIP2 = @BZIP2@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +COMPRESS = @COMPRESS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSUF = @CSUF@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LIBS = @CUPS_LIBS@ @@ -258,6 +260,7 @@ GUTENPRINT_MICRO_VERSION = @GUTENPRINT_MICRO_VERSION@ GUTENPRINT_MINOR_VERSION = @GUTENPRINT_MINOR_VERSION@ GUTENPRINT_RELEASE_VERSION = @GUTENPRINT_RELEASE_VERSION@ GUTENPRINT_VERSION = @GUTENPRINT_VERSION@ +GZIP = @GZIP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -283,6 +286,7 @@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ +LRZIP = @LRZIP@ LTALLOCA = @LTALLOCA@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ @@ -310,6 +314,7 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ +PKGROOT = @PKGROOT@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ @@ -318,6 +323,7 @@ POSUB = @POSUB@ RANLIB = @RANLIB@ RELEASE_DATE = @RELEASE_DATE@ RM = @RM@ +RZIP = @RZIP@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ @@ -330,6 +336,7 @@ VERSION = @VERSION@ WHICH_PPDS = @WHICH_PPDS@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ +XZ = @XZ@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ diff --git a/src/xml/escp2/inks/Makefile.in b/src/xml/escp2/inks/Makefile.in index 0999d8c..3db12cb 100644 --- a/src/xml/escp2/inks/Makefile.in +++ b/src/xml/escp2/inks/Makefile.in @@ -167,9 +167,11 @@ BZIP2 = @BZIP2@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +COMPRESS = @COMPRESS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSUF = @CSUF@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LIBS = @CUPS_LIBS@ @@ -228,6 +230,7 @@ GUTENPRINT_MICRO_VERSION = @GUTENPRINT_MICRO_VERSION@ GUTENPRINT_MINOR_VERSION = @GUTENPRINT_MINOR_VERSION@ GUTENPRINT_RELEASE_VERSION = @GUTENPRINT_RELEASE_VERSION@ GUTENPRINT_VERSION = @GUTENPRINT_VERSION@ +GZIP = @GZIP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -253,6 +256,7 @@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ +LRZIP = @LRZIP@ LTALLOCA = @LTALLOCA@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ @@ -280,6 +284,7 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ +PKGROOT = @PKGROOT@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ @@ -288,6 +293,7 @@ POSUB = @POSUB@ RANLIB = @RANLIB@ RELEASE_DATE = @RELEASE_DATE@ RM = @RM@ +RZIP = @RZIP@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ @@ -300,6 +306,7 @@ VERSION = @VERSION@ WHICH_PPDS = @WHICH_PPDS@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ +XZ = @XZ@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ diff --git a/src/xml/escp2/inputslots/Makefile.in b/src/xml/escp2/inputslots/Makefile.in index 9d96498..e4db367 100644 --- a/src/xml/escp2/inputslots/Makefile.in +++ b/src/xml/escp2/inputslots/Makefile.in @@ -167,9 +167,11 @@ BZIP2 = @BZIP2@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +COMPRESS = @COMPRESS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSUF = @CSUF@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LIBS = @CUPS_LIBS@ @@ -228,6 +230,7 @@ GUTENPRINT_MICRO_VERSION = @GUTENPRINT_MICRO_VERSION@ GUTENPRINT_MINOR_VERSION = @GUTENPRINT_MINOR_VERSION@ GUTENPRINT_RELEASE_VERSION = @GUTENPRINT_RELEASE_VERSION@ GUTENPRINT_VERSION = @GUTENPRINT_VERSION@ +GZIP = @GZIP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -253,6 +256,7 @@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ +LRZIP = @LRZIP@ LTALLOCA = @LTALLOCA@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ @@ -280,6 +284,7 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ +PKGROOT = @PKGROOT@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ @@ -288,6 +293,7 @@ POSUB = @POSUB@ RANLIB = @RANLIB@ RELEASE_DATE = @RELEASE_DATE@ RM = @RM@ +RZIP = @RZIP@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ @@ -300,6 +306,7 @@ VERSION = @VERSION@ WHICH_PPDS = @WHICH_PPDS@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ +XZ = @XZ@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ diff --git a/src/xml/escp2/media/Makefile.in b/src/xml/escp2/media/Makefile.in index f4fb48d..fbb0324 100644 --- a/src/xml/escp2/media/Makefile.in +++ b/src/xml/escp2/media/Makefile.in @@ -167,9 +167,11 @@ BZIP2 = @BZIP2@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +COMPRESS = @COMPRESS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSUF = @CSUF@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LIBS = @CUPS_LIBS@ @@ -228,6 +230,7 @@ GUTENPRINT_MICRO_VERSION = @GUTENPRINT_MICRO_VERSION@ GUTENPRINT_MINOR_VERSION = @GUTENPRINT_MINOR_VERSION@ GUTENPRINT_RELEASE_VERSION = @GUTENPRINT_RELEASE_VERSION@ GUTENPRINT_VERSION = @GUTENPRINT_VERSION@ +GZIP = @GZIP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -253,6 +256,7 @@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ +LRZIP = @LRZIP@ LTALLOCA = @LTALLOCA@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ @@ -280,6 +284,7 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ +PKGROOT = @PKGROOT@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ @@ -288,6 +293,7 @@ POSUB = @POSUB@ RANLIB = @RANLIB@ RELEASE_DATE = @RELEASE_DATE@ RM = @RM@ +RZIP = @RZIP@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ @@ -300,6 +306,7 @@ VERSION = @VERSION@ WHICH_PPDS = @WHICH_PPDS@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ +XZ = @XZ@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ diff --git a/src/xml/escp2/mediasizes/Makefile.in b/src/xml/escp2/mediasizes/Makefile.in index f8d0142..2818b4b 100644 --- a/src/xml/escp2/mediasizes/Makefile.in +++ b/src/xml/escp2/mediasizes/Makefile.in @@ -167,9 +167,11 @@ BZIP2 = @BZIP2@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +COMPRESS = @COMPRESS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSUF = @CSUF@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LIBS = @CUPS_LIBS@ @@ -228,6 +230,7 @@ GUTENPRINT_MICRO_VERSION = @GUTENPRINT_MICRO_VERSION@ GUTENPRINT_MINOR_VERSION = @GUTENPRINT_MINOR_VERSION@ GUTENPRINT_RELEASE_VERSION = @GUTENPRINT_RELEASE_VERSION@ GUTENPRINT_VERSION = @GUTENPRINT_VERSION@ +GZIP = @GZIP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -253,6 +256,7 @@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ +LRZIP = @LRZIP@ LTALLOCA = @LTALLOCA@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ @@ -280,6 +284,7 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ +PKGROOT = @PKGROOT@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ @@ -288,6 +293,7 @@ POSUB = @POSUB@ RANLIB = @RANLIB@ RELEASE_DATE = @RELEASE_DATE@ RM = @RM@ +RZIP = @RZIP@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ @@ -300,6 +306,7 @@ VERSION = @VERSION@ WHICH_PPDS = @WHICH_PPDS@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ +XZ = @XZ@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ diff --git a/src/xml/escp2/model/Makefile.am b/src/xml/escp2/model/Makefile.am index 204a00a..f971699 100644 --- a/src/xml/escp2/model/Makefile.am +++ b/src/xml/escp2/model/Makefile.am @@ -153,7 +153,8 @@ pkgxmldata_DATA = \ model_125.xml \ model_126.xml \ model_127.xml \ - model_128.xml + model_128.xml \ + model_129.xml xml-stamp: $(pkgxmldata_DATA) Makefile.am -rm -f $@ $@.tmp diff --git a/src/xml/escp2/model/Makefile.in b/src/xml/escp2/model/Makefile.in index 6a575ae..a5aa582 100644 --- a/src/xml/escp2/model/Makefile.in +++ b/src/xml/escp2/model/Makefile.in @@ -167,9 +167,11 @@ BZIP2 = @BZIP2@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +COMPRESS = @COMPRESS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSUF = @CSUF@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LIBS = @CUPS_LIBS@ @@ -228,6 +230,7 @@ GUTENPRINT_MICRO_VERSION = @GUTENPRINT_MICRO_VERSION@ GUTENPRINT_MINOR_VERSION = @GUTENPRINT_MINOR_VERSION@ GUTENPRINT_RELEASE_VERSION = @GUTENPRINT_RELEASE_VERSION@ GUTENPRINT_VERSION = @GUTENPRINT_VERSION@ +GZIP = @GZIP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -253,6 +256,7 @@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ +LRZIP = @LRZIP@ LTALLOCA = @LTALLOCA@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ @@ -280,6 +284,7 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ +PKGROOT = @PKGROOT@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ @@ -288,6 +293,7 @@ POSUB = @POSUB@ RANLIB = @RANLIB@ RELEASE_DATE = @RELEASE_DATE@ RM = @RM@ +RZIP = @RZIP@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ @@ -300,6 +306,7 @@ VERSION = @VERSION@ WHICH_PPDS = @WHICH_PPDS@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ +XZ = @XZ@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ @@ -500,7 +507,8 @@ pkgxmldata_DATA = \ model_125.xml \ model_126.xml \ model_127.xml \ - model_128.xml + model_128.xml \ + model_129.xml CLEANFILES = xmli18n-tmp.h xml-stamp xml-stamp.tmp EXTRA_DIST = $(pkgxmldata_DATA) diff --git a/src/xml/escp2/model/model_129.xml b/src/xml/escp2/model/model_129.xml new file mode 100644 index 0000000..aaa16b1 --- /dev/null +++ b/src/xml/escp2/model/model_129.xml @@ -0,0 +1,175 @@ +<?xml version="1.0"?> + +<gutenprint xmlns="http://gimp-print.sourceforge.net/xsd/gp.xsd-1.0" +xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +xsi:schemaLocation="http://gimp-print.sourceforge.net/xsd/gp.xsd-1.0 gutenprint.xsd"> +<copyright> + * Copyright 2008 Robert Krawitz (rlk@alum.mit.edu) + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +</copyright> +<escp2Model id="129"> + <media src="escp2/media/c82.xml"/> + <inputSlots src="escp2/inputslots/default.xml"/> + <qualityPresets src="escp2/qualitypresets/standard.xml"/> + <inkGroup src="escp2/inks/c82.xml"/> + <verticalBorderlessSequence>SN2\000\000\006\026\000\000\000\000\000\000\001\000\000\027\003\276\000?\007\000\000\334\005\366\011\366\011\226\000\000\000\226\000?\007\031\030\031\031\004\031\004\031\031\031\004\004\000\000]\006</verticalBorderlessSequence> + <preinitSequence>\000\000\000\033\001@EJL\0401284.4\012@EJL\040\040\040\040\040\012\033@</preinitSequence> + <preinitRemoteSequence>PM\002\000\000\000</preinitRemoteSequence> + <postinitRemoteSequence>JE\001\000\000</postinitRemoteSequence> + <commandSet>2000</commandSet> + <borderless>Yes</borderless> + <supportsVariableDropsizes/> + <hasFastGraymode/> + <sendZeroAdvance/> + <supportsD4Mode/> + <preferredEnvelopeOrientation>Portrait</preferredEnvelopeOrientation> + <headConfiguration type="default"> + <Nozzles>59</Nozzles> + <MinNozzles>60</MinNozzles> + <FirstNozzle>1</FirstNozzle> + <NozzleSeparation>2</NozzleSeparation> + </headConfiguration> + <headConfiguration type="black"> + <Nozzles>180</Nozzles> + <MinNozzles>180</MinNozzles> + <FirstNozzle>0</FirstNozzle> + <NozzleSeparation>2</NozzleSeparation> + </headConfiguration> + <headConfiguration type="fast"> + <Nozzles>180</Nozzles> + <MinNozzles>180</MinNozzles> + <FirstNozzle>0</FirstNozzle> + <NozzleSeparation>2</NozzleSeparation> + </headConfiguration> + <physicalChannels>4</physicalChannels> + <baseSeparation>360</baseSeparation> + <resolutionScale>14400</resolutionScale> + <minimumResolution>360 180</minimumResolution> + <maximumResolution>2880 2880</maximumResolution> + <separationRows>1</separationRows> + <zeroMarginOffset>80</zeroMarginOffset> + <microLeftMargin>42</microLeftMargin> + <initialVerticalOffset>-240</initialVerticalOffset> + <minHorizontalAlignment>1</minHorizontalAlignment> + <baseHorizontalAlignment>28800</baseHorizontalAlignment> + <bidirectionalAutoUpperLimit>1036800</bidirectionalAutoUpperLimit> + <minimumMediaSize>144 144</minimumMediaSize> + <maximumMediaSize>612 86400</maximumMediaSize> + <maximumImageableArea>612 86400</maximumImageableArea> + <margins interleave="soft" media="sheet">9 9 0 9</margins> + <margins interleave="printer" media="sheet">9 9 0 9</margins> + <margins interleave="soft" media="roll">9 9 0 0</margins> + <margins interleave="printer" media="roll">9 9 0 0</margins> + <extraBottom>24</extraBottom> + <AlignmentChoices>4 15 0 0</AlignmentChoices> + <ChannelNames> + <ChannelName translate="text" name="Black" text="Black"/> + <ChannelName translate="text" name="Cyan" text="Cyan"/> + <ChannelName translate="text" name="Magenta" text="Magenta"/> + <ChannelName translate="text" name="Yellow" text="Yellow"/> + </ChannelNames> + <resolutions> + <resolution translate="text" name="360x180sw" text="360 x 180 DPI Draft"> + <physicalResolution>360 180</physicalResolution> + <parameter type="float" name="escp2_density">2.400000</parameter> + <parameter type="integer" name="escp2_ink_type">16</parameter> + <parameter type="integer" name="escp2_base_res">360</parameter> + <parameter type="integer" name="escp2_bits">2</parameter> + <parameter type="float" name="DropSize1">0.000000</parameter> + <parameter type="float" name="DropSize2">0.000000</parameter> + <parameter type="float" name="DropSize3">1.000000</parameter> + </resolution> + <resolution translate="text" name="360sw" text="360 DPI"> + <physicalResolution>360 360</physicalResolution> + <parameter type="float" name="escp2_density">1.200000</parameter> + <parameter type="integer" name="escp2_ink_type">16</parameter> + <parameter type="integer" name="escp2_base_res">360</parameter> + <parameter type="integer" name="escp2_bits">2</parameter> + <parameter type="float" name="DropSize1">0.280000</parameter> + <parameter type="float" name="DropSize2">0.000000</parameter> + <parameter type="float" name="DropSize3">1.000000</parameter> + </resolution> + <resolution translate="text" name="720x360sw" text="720 x 360 DPI"> + <physicalResolution>720 360</physicalResolution> + <parameter type="float" name="escp2_density">0.600000</parameter> + <parameter type="integer" name="escp2_ink_type">16</parameter> + <parameter type="integer" name="escp2_base_res">360</parameter> + <parameter type="integer" name="escp2_bits">2</parameter> + <parameter type="float" name="DropSize1">0.280000</parameter> + <parameter type="float" name="DropSize2">0.000000</parameter> + <parameter type="float" name="DropSize3">1.000000</parameter> + </resolution> + <resolution translate="text" name="720sw" text="720 DPI"> + <physicalResolution>720 720</physicalResolution> + <parameter type="float" name="escp2_density">0.600000</parameter> + <parameter type="integer" name="escp2_ink_type">17</parameter> + <parameter type="integer" name="escp2_base_res">360</parameter> + <parameter type="integer" name="escp2_bits">2</parameter> + <parameter type="float" name="DropSize1">0.280000</parameter> + <parameter type="float" name="DropSize2">0.000000</parameter> + <parameter type="float" name="DropSize3">1.000000</parameter> + </resolution> + <resolution translate="text" name="1440x720sw" text="1440 x 720 DPI"> + <physicalResolution>1440 720</physicalResolution> + <parameter type="float" name="escp2_density">0.512000</parameter> + <parameter type="integer" name="escp2_ink_type">18</parameter> + <parameter type="integer" name="escp2_base_res">360</parameter> + <parameter type="integer" name="escp2_bits">2</parameter> + <parameter type="float" name="DropSize1">0.250000</parameter> + <parameter type="float" name="DropSize2">0.500000</parameter> + <parameter type="float" name="DropSize3">1.000000</parameter> + </resolution> + <resolution translate="text" name="2880x720sw" text="2880 x 720 DPI"> + <physicalResolution>2880 720</physicalResolution> + <parameter type="float" name="escp2_density">0.256000</parameter> + <parameter type="integer" name="escp2_ink_type">18</parameter> + <parameter type="integer" name="escp2_base_res">360</parameter> + <parameter type="integer" name="escp2_bits">2</parameter> + <parameter type="float" name="DropSize1">0.250000</parameter> + <parameter type="float" name="DropSize2">0.500000</parameter> + <parameter type="float" name="DropSize3">1.000000</parameter> + </resolution> + <resolution translate="text" name="1440x1440sw" text="1440 x 1440 DPI"> + <physicalResolution>1440 1440</physicalResolution> + <parameter type="float" name="escp2_density">0.256000</parameter> + <parameter type="integer" name="escp2_ink_type">18</parameter> + <parameter type="integer" name="escp2_base_res">360</parameter> + <parameter type="integer" name="escp2_bits">2</parameter> + <parameter type="float" name="DropSize1">0.250000</parameter> + <parameter type="float" name="DropSize2">0.500000</parameter> + <parameter type="float" name="DropSize3">1.000000</parameter> + </resolution> + <resolution translate="text" name="2880x1440sw" text="2880 x 1440 DPI"> + <physicalResolution>2880 1440</physicalResolution> + <parameter type="float" name="escp2_density">0.128000</parameter> + <parameter type="integer" name="escp2_ink_type">18</parameter> + <parameter type="integer" name="escp2_base_res">360</parameter> + <parameter type="integer" name="escp2_bits">2</parameter> + <parameter type="float" name="DropSize1">0.250000</parameter> + <parameter type="float" name="DropSize2">0.500000</parameter> + <parameter type="float" name="DropSize3">1.000000</parameter> + </resolution> + <resolution translate="text" name="2880x2880sw" text="2880 x 2880 DPI"> + <physicalResolution>2880 2880</physicalResolution> + <parameter type="float" name="escp2_density">0.000000</parameter> + <parameter type="integer" name="escp2_ink_type">18</parameter> + <parameter type="integer" name="escp2_base_res">360</parameter> + <parameter type="integer" name="escp2_bits">2</parameter> + <parameter type="float" name="DropSize1">1.000000</parameter> + </resolution> + </resolutions> +</escp2Model> +</gutenprint> diff --git a/src/xml/escp2/qualitypresets/Makefile.in b/src/xml/escp2/qualitypresets/Makefile.in index c1e6569..0a1e94b 100644 --- a/src/xml/escp2/qualitypresets/Makefile.in +++ b/src/xml/escp2/qualitypresets/Makefile.in @@ -167,9 +167,11 @@ BZIP2 = @BZIP2@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +COMPRESS = @COMPRESS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSUF = @CSUF@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LIBS = @CUPS_LIBS@ @@ -228,6 +230,7 @@ GUTENPRINT_MICRO_VERSION = @GUTENPRINT_MICRO_VERSION@ GUTENPRINT_MINOR_VERSION = @GUTENPRINT_MINOR_VERSION@ GUTENPRINT_RELEASE_VERSION = @GUTENPRINT_RELEASE_VERSION@ GUTENPRINT_VERSION = @GUTENPRINT_VERSION@ +GZIP = @GZIP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -253,6 +256,7 @@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ +LRZIP = @LRZIP@ LTALLOCA = @LTALLOCA@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ @@ -280,6 +284,7 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ +PKGROOT = @PKGROOT@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ @@ -288,6 +293,7 @@ POSUB = @POSUB@ RANLIB = @RANLIB@ RELEASE_DATE = @RELEASE_DATE@ RM = @RM@ +RZIP = @RZIP@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ @@ -300,6 +306,7 @@ VERSION = @VERSION@ WHICH_PPDS = @WHICH_PPDS@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ +XZ = @XZ@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ diff --git a/src/xml/escp2/weaves/Makefile.in b/src/xml/escp2/weaves/Makefile.in index 9975a0a..85b3b97 100644 --- a/src/xml/escp2/weaves/Makefile.in +++ b/src/xml/escp2/weaves/Makefile.in @@ -167,9 +167,11 @@ BZIP2 = @BZIP2@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +COMPRESS = @COMPRESS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSUF = @CSUF@ CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_CONFIG = @CUPS_CONFIG@ CUPS_LIBS = @CUPS_LIBS@ @@ -228,6 +230,7 @@ GUTENPRINT_MICRO_VERSION = @GUTENPRINT_MICRO_VERSION@ GUTENPRINT_MINOR_VERSION = @GUTENPRINT_MINOR_VERSION@ GUTENPRINT_RELEASE_VERSION = @GUTENPRINT_RELEASE_VERSION@ GUTENPRINT_VERSION = @GUTENPRINT_VERSION@ +GZIP = @GZIP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -253,6 +256,7 @@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ +LRZIP = @LRZIP@ LTALLOCA = @LTALLOCA@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ @@ -280,6 +284,7 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ +PKGROOT = @PKGROOT@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ @@ -288,6 +293,7 @@ POSUB = @POSUB@ RANLIB = @RANLIB@ RELEASE_DATE = @RELEASE_DATE@ RM = @RM@ +RZIP = @RZIP@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ @@ -300,6 +306,7 @@ VERSION = @VERSION@ WHICH_PPDS = @WHICH_PPDS@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ +XZ = @XZ@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ diff --git a/src/xml/extract-strings.c b/src/xml/extract-strings.c index f2b0860..0c3d56b 100644 --- a/src/xml/extract-strings.c +++ b/src/xml/extract-strings.c @@ -1,18 +1,21 @@ /* - * * Extract translation strings * * Copyright 2008 by Robert Krawitz. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2, or (at your option) any later version. + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* diff --git a/src/xml/papers.xml b/src/xml/papers.xml index a097fcf..d4ce3ce 100644 --- a/src/xml/papers.xml +++ b/src/xml/papers.xml @@ -358,7 +358,7 @@ <paper name="w576h842"> <description translate="value" value="8x11.7"/> <comment value="Only used by DS80, DS80DX, DS820 dyesub printers"/> - <width value="595"/> + <width value="576"/> <height value="842"/> <unit value="english-extended"/> </paper> diff --git a/src/xml/printers.xml b/src/xml/printers.xml index 117fd58..9b7a59c 100644 --- a/src/xml/printers.xml +++ b/src/xml/printers.xml @@ -153,9 +153,11 @@ <printer translate="name" name="Canon PIXMA iP90v" driver="bjc-PIXMA-iP90v" manufacturer="Canon" model="3000090" parameters="PIXMA_iP4000_params" /> <printer translate="name" name="Canon PIXUS iP90v" driver="bjc-PIXUS-iP90v" manufacturer="Canon" model="3000090" parameters="PIXMA_iP4000_params" /> <!-- Canon iP100 family --> +<!-- <printer translate="name" name="Canon iP100 series" driver="bjc-iP100-series" manufacturer="Canon" model="3000100" parameters="PIXMA_iP4000_params"/> <printer translate="name" name="Canon PIXMA iP100" driver="bjc-PIXMA-iP100" manufacturer="Canon" model="3000100" parameters="PIXMA_iP4000_params" /> <printer translate="name" name="Canon PIXUS iP100" driver="bjc-PIXUS-iP100" manufacturer="Canon" model="3000100" parameters="PIXMA_iP4000_params" /> +--> <!-- Canon iP110 family --> <printer translate="name" name="Canon iP110 series" driver="bjc-iP110-series" manufacturer="Canon" model="3000110" parameters="PIXMA_iP4000_params">EXPERIMENTAL</printer> <printer translate="name" name="Canon PIXMA iP110" driver="bjc-PIXMA-iP110" manufacturer="Canon" model="3000110" parameters="PIXMA_iP4000_params">EXPERIMENTAL</printer> @@ -1298,6 +1300,21 @@ <printer translate="name" name="Datamax-ONeil E4305L Mark III" deviceid="MFG:Datamax-O'Neil;CMD:DPL;MDL:E4305L Mark III;" color="false" driver="datamax_oneil_E4305L" manufacturer="DatamaxONeil" model="10028" parameters="dpl_params" /> <printer translate="name" name="Datamax-ONeil RL3e" deviceid="MFG:Datamax-O'Neil;CMD:DPL;MDL:RL3e;" color="false" driver="datamax_oneil_RL3e" manufacturer="DatamaxONeil" model="10029" parameters="dpl_params" /> <printer translate="name" name="Datamax-ONeil RL4e" deviceid="MFG:Datamax-O'Neil;CMD:DPL;MDL:RL4e;" color="false" driver="datamax_oneil_RL4e" manufacturer="DatamaxONeil" model="10030" parameters="dpl_params" /> + <printer translate="name" name="Datamax-ONeil H4212" deviceid="MFG:Datamax;CMD:DPL;MDL:H4212;" color="false" driver="datamax_oneil_H4212" manufacturer="DatamaxONeil" model="10031" parameters="dpl_params" /> + <printer translate="name" name="Datamax-ONeil H4212X" deviceid="MFG:Datamax;CMD:DPL;MDL:H4212X;" color="false" driver="datamax_oneil_H4212X" manufacturer="DatamaxONeil" model="10032" parameters="dpl_params" /> + <printer translate="name" name="Datamax-ONeil H4310" deviceid="MFG:Datamax;CMD:DPL;MDL:H4310;" color="false" driver="datamax_oneil_H4310" manufacturer="DatamaxONeil" model="10033" parameters="dpl_params" /> + <printer translate="name" name="Datamax-ONeil H4310X" deviceid="MFG:Datamax;CMD:DPL;MDL:H4310X;" color="false" driver="datamax_oneil_H4310X" manufacturer="DatamaxONeil" model="10034" parameters="dpl_params" /> + <printer translate="name" name="Datamax-ONeil H4408" deviceid="MFG:Datamax;CMD:DPL;MDL:H4408;" color="false" driver="datamax_oneil_H4408" manufacturer="DatamaxONeil" model="10035" parameters="dpl_params" /> + <printer translate="name" name="Datamax-ONeil H4606" deviceid="MFG:Datamax;CMD:DPL;MDL:H4606;" color="false" driver="datamax_oneil_H4606" manufacturer="DatamaxONeil" model="10036" parameters="dpl_params" /> + <printer translate="name" name="Datamax-ONeil H4606X" deviceid="MFG:Datamax;CMD:DPL;MDL:H4606X;" color="false" driver="datamax_oneil_H4606X" manufacturer="DatamaxONeil" model="10037" parameters="dpl_params" /> + <printer translate="name" name="Datamax-ONeil H6210" deviceid="MFG:Datamax;CMD:DPL;MDL:H6210;" color="false" driver="datamax_oneil_H6210" manufacturer="DatamaxONeil" model="10038" parameters="dpl_params" /> + <printer translate="name" name="Datamax-ONeil H6210X" deviceid="MFG:Datamax;CMD:DPL;MDL:H6210X;" color="false" driver="datamax_oneil_H6210X" manufacturer="DatamaxONeil" model="10039" parameters="dpl_params" /> + <printer translate="name" name="Datamax-ONeil H6212" deviceid="MFG:Datamax;CMD:DPL;MDL:H6212;" color="false" driver="datamax_oneil_H6212" manufacturer="DatamaxONeil" model="10040" parameters="dpl_params" /> + <printer translate="name" name="Datamax-ONeil H6212X" deviceid="MFG:Datamax;CMD:DPL;MDL:H6212X;" color="false" driver="datamax_oneil_H6212X" manufacturer="DatamaxONeil" model="10041" parameters="dpl_params" /> + <printer translate="name" name="Datamax-ONeil H6308" deviceid="MFG:Datamax;CMD:DPL;MDL:H6308;" color="false" driver="datamax_oneil_H6308" manufacturer="DatamaxONeil" model="10042" parameters="dpl_params" /> + <printer translate="name" name="Datamax-ONeil H6310X" deviceid="MFG:Datamax;CMD:DPL;MDL:H6310X;" color="false" driver="datamax_oneil_H6310X" manufacturer="DatamaxONeil" model="10043" parameters="dpl_params" /> + <printer translate="name" name="Datamax-ONeil H8308" deviceid="MFG:Datamax;CMD:DPL;MDL:H8308;" color="false" driver="datamax_oneil_H8308" manufacturer="DatamaxONeil" model="10044" parameters="dpl_params" /> + <printer translate="name" name="Datamax-ONeil H8308X" deviceid="MFG:Datamax;CMD:DPL;MDL:H8308X;" color="false" driver="datamax_oneil_H8308X" manufacturer="DatamaxONeil" model="10045" parameters="dpl_params" /> </family> <family name="escp2"> <parameters name="standard_params"> @@ -1328,6 +1345,7 @@ <printer translate="name" name="Epson Artisan 800" driver="escp2-artisan800" manufacturer="Epson" model="96" parameters="claria_params" /> <printer translate="name" name="Epson Artisan 810" driver="escp2-artisan810" manufacturer="Epson" model="96" parameters="claria_params" /> <printer translate="name" name="Epson Artisan 835" driver="escp2-artisan835" manufacturer="Epson" model="96" parameters="claria_params" /> + <printer translate="name" name="Epson Artisan 1430" driver="escp2-artisan1430" manufacturer="Epson" model="82" parameters="claria_params" /> <printer translate="name" name="Epson B-300" driver="escp2-b300" manufacturer="Epson" model="87" parameters="standard_params" /> <printer translate="name" name="Epson B-308" driver="escp2-b308" manufacturer="Epson" model="87" parameters="standard_params" /> <printer translate="name" name="Epson B-310" driver="escp2-b310" manufacturer="Epson" model="87" parameters="standard_params" /> @@ -1337,6 +1355,7 @@ <printer translate="name" name="Epson B-510DN" driver="escp2-b510dn" manufacturer="Epson" model="87" parameters="standard_params" /> <printer translate="name" name="Epson L120" driver="escp2-l120" manufacturer="Epson" model="80" parameters="cx3500_params" /> <printer translate="name" name="Epson L210" driver="escp2-l210" manufacturer="Epson" model="80" parameters="cx3500_params" /> + <printer translate="name" name="Epson L310" driver="escp2-l310" manufacturer="Epson" model="129" parameters="cx3500_params" /> <printer translate="name" name="Epson L1300" driver="escp2-l1300" manufacturer="Epson" model="99" parameters="standard_params" /> <printer translate="name" name="Epson L1800" driver="escp2-l1800" manufacturer="Epson" model="122" parameters="cx3500_params" /> <printer translate="name" name="Epson Stylus C20" deviceid="MFG:EPSON;MDL:Stylus C20;DES:EPSON Stylus C20;CMD:ESCPL2,BDC,D4;" driver="escp2-c20" manufacturer="Epson" model="42" parameters="480_params" /> @@ -2917,7 +2936,7 @@ <printer translate="name" name="Canon SELPHY CP790" deviceid="MFG:Canon;CMD:Raster3;MDL:CP790;CLS:PRINTER;DES:Canon CP790;VER:1.00;" driver="canon-cp790" manufacturer="Canon" model="1008" parameters="nativecopies" /> <printer translate="name" name="Canon SELPHY CP800" deviceid="MFG:Canon;CMD:Raster3;MDL:CP800;CLS:PRINTER;DES:Canon CP800;VER:1.00;" driver="canon-cp800" manufacturer="Canon" model="1009" parameters="nativecopies" /> <printer translate="name" name="Canon SELPHY CP810" deviceid="MFG:Canon;CMD:Raster3;MDL:CP810;CLS:PRINTER;DES:Canon CP810;VER:3.05;" driver="canon-cp810" manufacturer="Canon" model="1009" parameters="nativecopies" /> - <printer translate="name" name="Canon SELPHY CP820" driver="canon-cp820" manufacturer="Canon" model="1011" parameters="nativecopies"/> + <printer translate="name" name="Canon SELPHY CP820" deviceid="MFG:Canon;CMD:Raster3;MDL:CP820;CLS:PRINTER;DES:Canon CP820;VER:1.00;CID:1284_CID_CA_YCC_ICP;" driver="canon-cp820" manufacturer="Canon" model="1011" parameters="nativecopies"/> <printer translate="name" name="Canon SELPHY CP900" deviceid="MFG:Canon;CMD:Raster3;MDL:CP900;CLS:PRINTER;DES:Canon CP900;VER:5.77;" driver="canon-cp900" manufacturer="Canon" model="1010" parameters="nativecopies" /> <printer translate="name" name="Canon SELPHY CP910" deviceid="MFG:Canon;CMD:Raster3;MDL:CP910;CLS:PRINTER;DES:Canon CP910;VER:1.00;CID:CA_YCC_ICP;" driver="canon-cp910" manufacturer="Canon" model="1011" parameters="nativecopies" /> <printer translate="name" name="Canon SELPHY CP1000" deviceid="MFG:Canon;CMD:Raster3;MDL:CP1000;CLS:PRINTER;DES:Canon CP1000;VER:1.00;CID:CA_YCC_ICP;" driver="canon-cp1000" manufacturer="Canon" model="1011" parameters="nativecopies" /> @@ -2983,8 +3002,9 @@ <printer translate="name" name="Mitsubishi CP-9800DZ" deviceid="MFG:MITSUBISHI;CMD:MEL;MDL:CP9800DZ;CLS:PRINTER;DES:MITSUBISHI CP9800DZ;" driver="mitsubishi-9800dz" manufacturer="Mitsubishi" model="4113" parameters="nativecopies" /> <printer translate="name" name="Mitsubishi CP-9800DW-S" driver="mitsubishi-9800dw-s" manufacturer="Mitsubishi" model="4113" parameters="nativecopies" /> <printer translate="name" name="Mitsubishi P95D" driverid="MFG:MITSUBISHI;CMD:MEL;MDL:P95D ;CLS:PRINTER;DES:MITSUBISHI P95D ;" driver="mitsubishi-p95d" manufacturer="Mitsubishi" model="4114" parameters="nativecopies" /> - <printer translate="name" name="Shinko CHC-S9045" driver="shinko-chcs9045" manufacturer="Shinko" model="5000" /> <printer translate="name" name="Mitsubishi CP-9500DW" driver="mitsubishi-9500dw" manufacturer="Mitsubishi" model="4115" parameters="nativecopies" /> + <printer translate="name" name="Mitsubishi P93D" driverid="MFG:MITSUBISHI;CMD:MEL;MDL:P93D;CLS:PRINTER;DES:MITSUBISHI P93D;" driver="mitsubishi-p93d" manufacturer="Mitsubishi" model="4116" parameters="nativecopies" /> + <printer translate="name" name="Shinko CHC-S9045" driver="shinko-chcs9045" manufacturer="Shinko" model="5000" /> <printer translate="name" name="Shinko CHC-S2145" deviceid="MFG:SHINKO;CMD:SUPCC;MDL:CHC-S2145;CLS:PRINTER;DES:SHINKO CHC-S2145;" driver="shinko-chcs2145" manufacturer="Shinko" model="5001" parameters="nativecopies" /> <printer translate="name" name="Sinfonia S2145/S2" driver="sinfonia-chcs2145" manufacturer="Sinfonia" model="5001" parameters="nativecopies" /> <printer translate="name" name="Shinko CHC-S1245" driver="shinko-chcs1245" manufacturer="Shinko" model="5002" parameters="nativecopies">EXPERIMENTAL</printer> |