diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/Makefile.in | 1 | ||||
-rw-r--r-- | src/main/canon-media-mode.h | 53 | ||||
-rw-r--r-- | src/main/canon-media.h | 17 | ||||
-rw-r--r-- | src/main/canon-modes.h | 23 | ||||
-rw-r--r-- | src/main/canon-printers.h | 27 | ||||
-rw-r--r-- | src/main/curve.c | 1 | ||||
-rw-r--r-- | src/main/escp2-papers.c | 1 | ||||
-rw-r--r-- | src/main/print-canon.c | 11 | ||||
-rw-r--r-- | src/main/print-olympus.c | 622 | ||||
-rw-r--r-- | src/main/print-ps.c | 1 | ||||
-rw-r--r-- | src/main/xmlppd.c | 1 |
11 files changed, 586 insertions, 172 deletions
diff --git a/src/main/Makefile.in b/src/main/Makefile.in index 47a0c41..1e89eb9 100644 --- a/src/main/Makefile.in +++ b/src/main/Makefile.in @@ -340,6 +340,7 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_CUPS_PPDS = @BUILD_CUPS_PPDS@ +BZIP2 = @BZIP2@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ diff --git a/src/main/canon-media-mode.h b/src/main/canon-media-mode.h index da2f9e3..b2b088e 100644 --- a/src/main/canon-media-mode.h +++ b/src/main/canon-media-mode.h @@ -186,6 +186,7 @@ DECLARE_MODEUSES(canon_BJC_240); /* ----------------------------------- Canon BJC 2000 ----------------------------------- */ /* TODO: mode-media correlation */ +/* static const char* canon_BJC_2000_modeuses_plain[] = { "360x360dpi", "180x180dpi", @@ -208,6 +209,58 @@ static const canon_modeuse_t canon_BJC_2000_modeuses[] = { }; DECLARE_MODEUSES(canon_BJC_2000); +*/ + +/* ----------------------------------- Canon BJC 2100 ----------------------------------- */ + +static const char* canon_BJC_2100_modeuses_plain[] = { + "360x360dmt_high", + "360x360dpi_high", + "360x360dpi", + "720x360dpi", + "360x360dpi_draft", + "180x180dpi", + /* Photo */ + "360x360dmt_photo", + NULL +}; + +static const char* canon_BJC_2100_modeuses_PPgloss[] = { + "360x360dmt_high", + "360x360dpi_high", + "360x360dpi", + /* Photo */ + "360x360dmt_photo", + NULL +}; + +static const char* canon_BJC_2100_modeuses_coated[] = { + "360x360dmt_high", + "360x360dpi_high", + "360x360dpi", + "720x360dpi", + "360x360dpi_draft", + /* Photo */ + "360x360dmt_photo", + NULL +}; + +static const canon_modeuse_t canon_BJC_2100_modeuses[] = { + { "Plain", canon_BJC_2100_modeuses_plain, INKSET_BLACK_SUPPORT | INKSET_PHOTO_SUPPORT | INKSET_PHOTO_MODEREPL }, + { "Transparency", canon_BJC_2100_modeuses_PPgloss, INKSET_BLACK_SUPPORT }, + { "BackPrint", canon_BJC_2100_modeuses_PPgloss, INKSET_BLACK_SUPPORT }, + { "Fabric", canon_BJC_2100_modeuses_PPgloss, INKSET_BLACK_SUPPORT }, + { "Envelope", canon_BJC_2100_modeuses_plain, INKSET_BLACK_SUPPORT | INKSET_PHOTO_SUPPORT | INKSET_PHOTO_MODEREPL }, + { "Coated", canon_BJC_2100_modeuses_coated, INKSET_BLACK_SUPPORT | INKSET_PHOTO_SUPPORT | INKSET_PHOTO_MODEREPL }, + { "TShirt", canon_BJC_2100_modeuses_PPgloss, INKSET_BLACK_SUPPORT }, + { "GlossyFilm", canon_BJC_2100_modeuses_PPgloss, INKSET_BLACK_SUPPORT }, + { "GlossyPaper", canon_BJC_2100_modeuses_PPgloss, INKSET_BLACK_SUPPORT | INKSET_PHOTO_SUPPORT | INKSET_PHOTO_MODEREPL }, + { "GlossyCard", canon_BJC_2100_modeuses_PPgloss, INKSET_BLACK_SUPPORT | INKSET_PHOTO_SUPPORT | INKSET_PHOTO_MODEREPL }, + { "GlossyPro", canon_BJC_2100_modeuses_PPgloss, INKSET_BLACK_SUPPORT | INKSET_PHOTO_SUPPORT | INKSET_PHOTO_MODEREPL },/*untested*/ + { "Other", canon_BJC_2100_modeuses_plain, INKSET_BLACK_SUPPORT | INKSET_PHOTO_SUPPORT | INKSET_PHOTO_MODEREPL }, +}; + +DECLARE_MODEUSES(canon_BJC_2100); /* ----------------------------------- Canon BJC 3000 ----------------------------------- */ diff --git a/src/main/canon-media.h b/src/main/canon-media.h index 2b37391..62c641e 100644 --- a/src/main/canon-media.h +++ b/src/main/canon-media.h @@ -311,6 +311,23 @@ static const canon_paper_t canon_default_papers[] = { /* }; DECLARE_PAPERS(canon_default); +static const canon_paper_t canon_BJC_2100_papers[] = { + /* Name Text (c (l (P (w Density k_upper lum_adj */ + { "Plain", N_ ("Plain Paper"), 0x00,0x00,0x00,0x00,0.50, 0.25, 0.500, 0, 0, 0 }, + { "Transparency", N_ ("Transparencies"), 0x02,0x02,0x00,0x00,1.00, 1.00, 0.900, 0, 0, 0 }, + { "BackPrint", N_ ("Back Print Film"), 0x03,0x03,0x00,0x00,1.00, 1.00, 0.900, 0, 0, 0 }, + { "Fabric", N_ ("Fabric Sheets"), 0x04,0x05,0x00,0x00,0.50, 0.25, 0.500, 0, 0, 0 }, + { "Envelope", N_ ("Envelope"), 0x08,0x08,0x00,0x00,0.50, 0.25, 0.500, 0, 0, 0 }, + { "Coated", N_ ("High Resolution Paper"), 0x07,0x0b,0x00,0x00,0.78, 0.25, 0.500, 0, 0, 0 }, + { "TShirt", N_ ("T-Shirt Transfers"), 0x03,0x03,0x00,0x00,0.50, 0.25, 0.500, 0, 0, 0 }, + { "GlossyFilm", N_ ("High Gloss Film"), 0x06,0x07,0x00,0x00,1.00, 1.00, 0.999, 0, 0, 0 }, + { "GlossyPaper", N_ ("Glossy Photo Paper"), 0x05,0x06,0x00,0x00,1.00, 1.00, 0.999, 0, 0, 0 }, + { "GlossyCard", N_ ("Glossy Photo Cards"), 0x05,0x0c,0x00,0x00,1.00, 1.00, 0.999, 0, 0, 0 }, + { "GlossyPro", N_ ("Photo Paper Pro"), 0x09,0x09,0x00,0x00,1.00, 1.00, 0.999, 0, 0, 0 }, + { "Other", N_ ("Other"), 0x01,0x09,0x00,0x00,0.50, 0.25, 0.500, 0, 0, 0 }, +}; +DECLARE_PAPERS(canon_BJC_2100); + static const canon_paper_t canon_PIXMA_iP4000_papers[] = { { "Plain", N_ ("Plain Paper"), 0x00,0x00,0x00,0x00,1.00, 0.25, 0.500, 0, 0, 0 }, { "Transparency", N_ ("Transparencies"), 0x02,0x02,0x00,0x00,0.78, 0.25, 0.500, 0, 0, 0 }, diff --git a/src/main/canon-modes.h b/src/main/canon-modes.h index bb9ed09..41bb12e 100644 --- a/src/main/canon-modes.h +++ b/src/main/canon-modes.h @@ -180,12 +180,29 @@ static const canon_mode_t canon_BJC_240_modes[] = { }; DECLARE_MODES(canon_BJC_240,0); - -static const canon_mode_t canon_BJC_2000_modes[] = { +/* BJC-2000 has same modes as BJC-2100, hence the below are outmoded */ +/* + * static const canon_mode_t canon_BJC_2000_modes[] = { { 360, 360,CANON_INK_CMYK,"360x360dpi",N_("360x360 DPI"),INKSET(4_C2M2Y2K2),8,0,NULL,1.0,1.0,NULL,NULL,NULL,2}, { 180, 180,CANON_INK_CMYK,"180x180dpi",N_("180x180 DPI"),INKSET(4_C2M2Y2K2),8,0,NULL,1.0,1.0,NULL,NULL,NULL,2}, }; DECLARE_MODES(canon_BJC_2000,0); +*/ + +/* these printers only have K and CMYK */ +/* using color (CMYK) cartridge, all media use CMYK */ +/* some modes use ESC (t 0x02 0x80 0x09 which implies bits per ink > 1, but how to know how many? guess 2 bits */ +/* added MODE_FLAG_PHOTO as a means to set ESC (t to 0x02 0x80 0x0a --- no idea if 1 bit or 2 bits here */ +static const canon_mode_t canon_BJC_2100_modes[] = { + { 360, 360,CANON_INK_K | CANON_INK_CMYK,"360x360dmt_high",N_("360x360 DMT HIGH (plain/Env/PPgloss/HR/HGF/GPC/TST/BPF/TPY/O)"),INKSET(4_C4M4Y4K4),8,0,NULL,1.0,1.0,NULL,NULL,NULL,1},/* 0x02 0x80 0x9 */ + { 360, 360,CANON_INK_K | CANON_INK_CMYK,"360x360dpi_high",N_("360x360 DPI (high legacy)"),INKSET(4_C2M2Y2K2),8,0,NULL,1.0,1.0,NULL,NULL,NULL,2}, + { 360, 360,CANON_INK_K | CANON_INK_CMYK,"360x360dpi",N_("360x360 DPI (plain ud2/PPgloss std/Env/HR/HGF/GPC/TST/BPF/TPY/O)"),INKSET(4_C2M2Y2K2),8,0,NULL,1.0,1.0,NULL,NULL,NULL,1}, + { 720, 360,CANON_INK_K | CANON_INK_CMYK,"720x360dpi",N_("720x360 DPI (plain ud3/Env/HR/O)"),INKSET(4_C2M2Y2K2),8,0,NULL,1.0,1.0,NULL,NULL,NULL,0}, + { 360, 360,CANON_INK_K | CANON_INK_CMYK,"360x360dpi_draft",N_("360x360 DPI DRAFT (plain std/Env/HR/O)"),INKSET(4_C2M2Y2K2),8,0,NULL,1.0,1.0,NULL,NULL,NULL,0}, + { 180, 180,CANON_INK_K | CANON_INK_CMYK,"180x180dpi",N_("180x180 DPI (plain fast/Env/O)"),INKSET(4_C2M2Y2K2),8,0,NULL,1.0,1.0,NULL,NULL,NULL,2}, + { 360, 360,CANON_INK_CMYK,"360x360dmt_photo",N_("360x360 DMT PHOTO CARTRIDGE"),INKSET(4_C4M4Y4K4),8,MODE_FLAG_PHOTO,NULL,1.0,1.0,NULL,NULL,NULL,1}, +}; +DECLARE_MODES(canon_BJC_2100,1); /* these printers only have CMYK, so CcMmYK is not required I think */ /* using color (CMYK) cartridge, some media use CMYK, others only use CMY --- need to check this as my test image lacked Y apparently */ @@ -207,7 +224,7 @@ DECLARE_MODES(canon_BJC_3000,1); /* some modes use ESC (t 0x2 0x80 0x9 which implies bits per ink > 1, but how to know how many? */ /* added MODE_FLAG_PHOTO as a means to set ESC (t */ static const canon_mode_t canon_BJC_4300_modes[] = { - { 760, 360,CANON_INK_K | CANON_INK_CMYK,"720x360dpi",N_("720x360 DPI"),INKSET(4_C4M4Y4K4),8,0,NULL,1.0,1.0,NULL,NULL,NULL,0}, + { 720, 360,CANON_INK_K | CANON_INK_CMYK,"720x360dpi",N_("720x360 DPI"),INKSET(4_C4M4Y4K4),8,0,NULL,1.0,1.0,NULL,NULL,NULL,0}, { 360, 360,CANON_INK_K | CANON_INK_CMYK,"360x360dpi_high",N_("360x360 DPI HIGH"),INKSET(4_C2M2Y2K2),8,0,NULL,1.0,1.0,NULL,NULL,NULL,1},/* different code */ { 360, 360,CANON_INK_K | CANON_INK_CMYK,"360x360dpi",N_("360x360 DPI"),INKSET(4_C2M2Y2K2),8,0,NULL,1.0,1.0,NULL,NULL,NULL,1}, { 360, 360,CANON_INK_K | CANON_INK_CMYK,"360x360dmt",N_("360x360 DMT"),INKSET(4_C4M4Y4K4),8,0,NULL,1.0,1.0,NULL,NULL,NULL,1}, diff --git a/src/main/canon-printers.h b/src/main/canon-printers.h index fae13b9..91bfaac 100644 --- a/src/main/canon-printers.h +++ b/src/main/canon-printers.h @@ -631,6 +631,25 @@ static const canon_cap_t canon_model_capabilities[] = NULL }, + { /* Canon BJC 2100 *//* heads: BC-20 (black), BC-21e (color/black), BC-22e (photo) (also IS-22 color scanner cartridge) */ + /* 720 (hor) x 360 dpi (vert) */ + "2100", 1, + 618, 980, /* 8.58" x 13.61" different per paper size, and banner (max 70") */ + 10, 10, 9, 20, /* for A4 from user manual */ + &canon_default_slotlist, + CANON_CAP_STD0 | CANON_CAP_a | CANON_CAP_cart,0, + 2,0, + 0, /* Upper/Lower Cassette option */ + NULL,/* only SetTime */ + &canon_BJC_2100_modelist, + &canon_BJC_2100_paperlist, + &canon_BJC_2100_modeuselist, + NULL, + NULL, + NULL, + NULL + }, + { /* Canon BJC 4300 *//* heads: BC-20 BC-21 BC-22 BC-29 */ "4300", 1, 618, 936, /* 8.58" x 13 " */ @@ -835,13 +854,13 @@ static const canon_cap_t canon_model_capabilities[] = 842, INCH(17), 11, 9, 10, 18, /* unconfirmed */ &canon_default_slotlist, - CANON_CAP_STD0 | CANON_CAP_a,0, + CANON_CAP_STD0 | CANON_CAP_a | CANON_CAP_cart,0, 2,0, 0, /* Upper/Lower Cassette option */ NULL, - &canon_BJC_2000_modelist, - &canon_default_paperlist, - &canon_BJC_2000_modeuselist, + &canon_BJC_2100_modelist, + &canon_BJC_2100_paperlist, + &canon_BJC_2100_modeuselist, NULL, NULL, NULL, diff --git a/src/main/curve.c b/src/main/curve.c index 8425c05..9c0795e 100644 --- a/src/main/curve.c +++ b/src/main/curve.c @@ -36,6 +36,7 @@ #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> +#include <strings.h> #ifdef __GNUC__ #define inline __inline__ diff --git a/src/main/escp2-papers.c b/src/main/escp2-papers.c index c96d42f..5eebc49 100644 --- a/src/main/escp2-papers.c +++ b/src/main/escp2-papers.c @@ -26,6 +26,7 @@ #include <gutenprint/gutenprint.h> #include "gutenprint-internal.h" #include <gutenprint/gutenprint-intl-internal.h> +#include <strings.h> #include "print-escp2.h" static stp_mxml_node_t * diff --git a/src/main/print-canon.c b/src/main/print-canon.c index 6d27060..3a76c01 100644 --- a/src/main/print-canon.c +++ b/src/main/print-canon.c @@ -4942,7 +4942,7 @@ canon_init_setImage(const stp_vars_t *v, const canon_privdata_t *init) generic condition based on CANON_INK_CMY */ if (init->used_inks == CANON_INK_CMY) arg_74_3= 0x02; /* for BC-06 cartridge!!! */ /* example of better way: for BJC-3000 series */ - if (!strcmp(init->caps->name,"3000") || !strcmp(init->caps->name,"4300")) { + if ( !strcmp(init->caps->name,"3000") || !strcmp(init->caps->name,"4300")) { /* but if photo cartridge selection, set differently again */ if (init->mode->flags & MODE_FLAG_PHOTO) arg_74_3= 0x0a; @@ -4953,6 +4953,15 @@ canon_init_setImage(const stp_vars_t *v, const canon_privdata_t *init) /* other media */ arg_74_3= 0x09; /* return to default after broken code above */ } + if ( (!strcmp(init->caps->name,"2000")) || (!strcmp(init->caps->name,"2100")) ) { + /* but if photo cartridge selection, set differently again */ + if (init->mode->flags & MODE_FLAG_PHOTO) + arg_74_3= 0x0a; + else + /* other media */ + arg_74_3= 0x09; /* return to default after broken code above */ + } + } /* workaround for the bjc8200 in 6color mode - not really understood */ diff --git a/src/main/print-olympus.c b/src/main/print-olympus.c index 5af9d28..ad26726 100644 --- a/src/main/print-olympus.c +++ b/src/main/print-olympus.c @@ -232,9 +232,12 @@ typedef struct /* printer specific parameters */ const char *adj_yellow; const laminate_list_t *laminate; const dyesub_media_list_t *media; - const dyesub_stringlist_t *uiconstraints; void (*job_start_func)(stp_vars_t *); void (*job_end_func)(stp_vars_t *); + const stp_parameter_t *parameters; + int parameter_count; + int (*load_parameters)(const stp_vars_t *, const char *name, stp_parameter_t *); + void (*parse_parameters)(stp_vars_t *); } dyesub_cap_t; @@ -2279,7 +2282,7 @@ static void kodak_8500_printer_init(stp_vars_t *v) /* Number of copies */ stp_putc(0x1b, v); stp_putc(0x4e, v); - stp_putc(1, v); /* XXX always 1 for now, up to 50 */ + stp_putc(1, v); /* 1-50 */ dyesub_nputc(v, 0x00, 61); /* Paper type. Fixed. */ stp_putc(0x1b, v); @@ -2317,7 +2320,6 @@ static void kodak_8500_printer_init(stp_vars_t *v) stp_putc(0x47, v); dyesub_nputc(v, 0x00, 61); - /* Data header */ stp_putc(0x1b, v); stp_putc(0x5a, v); @@ -2382,7 +2384,7 @@ static void mitsu_cp3020d_printer_init(stp_vars_t *v) /* Number of copies */ stp_putc(0x1b, v); stp_putc(0x4e, v); - stp_putc(1, v); /* XXX always 1 for now, up to 50 */ + stp_putc(1, v); /* 1-50 */ dyesub_nputc(v, 0x00, 61); /* Unknown */ stp_putc(0x1b, v); @@ -2529,7 +2531,7 @@ static const dyesub_pagesize_t mitsu_cp9550_page[] = DYESUB_LANDSCAPE}, { "w288h432-div2", "2x6*2", PT(1416,346)+1, PT(2152,346)+1, 0, 0, 0, 0, DYESUB_LANDSCAPE}, - { "w360h504", "5x7", PT(1812,346)+1, PT(2402,346)+1, 0, 0, 0, 0, + { "w360h504", "5x7", PT(1812,346)+1, PT(2452,346)+1, 0, 0, 0, 0, DYESUB_PORTRAIT}, { "w432h576", "6x8", PT(2152,346)+1, PT(2792,346)+1, 0, 0, 0, 0, DYESUB_PORTRAIT}, @@ -2537,6 +2539,8 @@ static const dyesub_pagesize_t mitsu_cp9550_page[] = DYESUB_PORTRAIT}, { "w432h648", "6x9", PT(2152,346)+1, PT(3146,346)+1, 0, 0, 0, 0, DYESUB_PORTRAIT}, + /* XXX also 3.3x6 and 3.5x6! + XXX also 4x6*2, 4.4*6*2, 3x6*3, 2x6*4! (Built on 6x9 media) */ }; LIST(dyesub_pagesize_list_t, mitsu_cp9550_page_list, dyesub_pagesize_t, mitsu_cp9550_page); @@ -2546,7 +2550,7 @@ static const dyesub_printsize_t mitsu_cp9550_printsize[] = { "346x346", "B7", 1240, 1812}, { "346x346", "w288h432", 1416, 2152}, { "346x346", "w288h432-div2", 1416, 2152}, - { "346x346", "w360h504", 1812, 2402}, + { "346x346", "w360h504", 1812, 2452}, { "346x346", "w432h576", 2152, 2792}, { "346x346", "w432h612", 2152, 2956}, { "346x346", "w432h648", 2152, 3146}, @@ -2580,7 +2584,7 @@ static void mitsu_cp9550_printer_init(stp_vars_t *v) stp_putc(0x08, v); stp_putc(0x03, v); dyesub_nputc(v, 0x00, 19); - stp_putc(0x01, v); /* This is Copies on other models.. */ + stp_putc(0x01, v); /* Copies */ dyesub_nputc(v, 0x00, 2); if (strcmp(privdata.pagesize,"w288h432-div2") == 0) stp_putc(0x83, v); @@ -2622,6 +2626,101 @@ static void mitsu_cp9550_printer_end(stp_vars_t *v) stp_putc(0x00, v); } +/* Mitsubishi 9600D/DW */ +static const dyesub_resolution_t res_mitsu9600_dpi[] = +{ + { "300x300", 300, 300}, + { "600x600", 600, 600}, +}; + +LIST(dyesub_resolution_list_t, res_mitsu9600_dpi_list, dyesub_resolution_t, res_mitsu9600_dpi); + +static const dyesub_pagesize_t mitsu_cp9600_page[] = +{ + { "B7", "3.5x5", PT(1076,300)+1, PT(1572,300)+1, 0, 0, 0, 0, + DYESUB_LANDSCAPE}, + { "w288h432", "4x6", PT(1228,300)+1, PT(1868,300)+1, 0, 0, 0, 0, + DYESUB_LANDSCAPE}, + { "w360h504", "5x7", PT(1572,300)+1, PT(2128,300)+1, 0, 0, 0, 0, + DYESUB_PORTRAIT}, + { "w432h576", "6x8", PT(1868,300)+1, PT(2442,300)+1, 0, 0, 0, 0, + DYESUB_PORTRAIT}, + { "w432h612", "6x8.5", PT(1868,300)+1, PT(2564,300)+1, 0, 0, 0, 0, + DYESUB_PORTRAIT}, + { "w432h648", "6x9", PT(1868,300)+1, PT(2730,300)+1, 0, 0, 0, 0, + DYESUB_PORTRAIT}, +}; + +LIST(dyesub_pagesize_list_t, mitsu_cp9600_page_list, dyesub_pagesize_t, mitsu_cp9600_page); + +static const dyesub_printsize_t mitsu_cp9600_printsize[] = +{ + { "300x300", "B7", 1076, 1572}, + { "600x600", "B7", 2152, 3144}, + { "300x300", "w288h432", 1228, 1868}, + { "600x600", "w288h432", 2458, 3736}, + { "300x300", "w360h504", 1572, 2128}, + { "600x600", "w360h504", 3144, 4256}, + { "300x300", "w432h576", 1868, 2442}, + { "600x600", "w432h576", 3736, 4846}, + { "300x300", "w432h612", 1868, 2564}, + { "600x600", "w432h612", 3736, 5130}, + { "300x300", "w432h648", 1868, 2730}, + { "600x600", "w432h648", 3736, 5462}, +}; + +LIST(dyesub_printsize_list_t, mitsu_cp9600_printsize_list, dyesub_printsize_t, mitsu_cp9600_printsize); + +static void mitsu_cp9600_printer_init(stp_vars_t *v) +{ + /* Parameters 1 */ + stp_putc(0x1b, v); + stp_putc(0x57, v); + stp_putc(0x21, v); + stp_putc(0x2e, v); + stp_putc(0x00, v); + stp_putc(0x80, v); + stp_putc(0x00, v); + stp_putc(0x22, v); + stp_putc(0x00, v); + stp_putc(0x03, v); + dyesub_nputc(v, 0x00, 19); + stp_putc(0x01, v); /* Copies */ + dyesub_nputc(v, 0x00, 19); + stp_putc(0x01, v); + /* Parameters 2 */ + stp_putc(0x1b, v); + stp_putc(0x57, v); + stp_putc(0x20, v); + stp_putc(0x2e, v); + stp_putc(0x00, v); + stp_putc(0x0a, v); + stp_putc(0x10, v); + dyesub_nputc(v, 0x00, 7); + stp_put16_be(privdata.w_size, v); + stp_put16_be(privdata.h_size, v); + dyesub_nputc(v, 0x00, 32); + /* Parameters 3 */ + stp_putc(0x1b, v); + stp_putc(0x57, v); + stp_putc(0x26, v); + stp_putc(0x2e, v); + stp_putc(0x00, v); + stp_putc(0x60, v); + dyesub_nputc(v, 0x00, 6); + stp_putc(0x01, v); + dyesub_nputc(v, 0x00, 37); +} + +static void mitsu_cp9600_printer_end(stp_vars_t *v) +{ + /* Page Footer */ + stp_putc(0x1b, v); + stp_putc(0x50, v); + stp_putc(0x48, v); + stp_putc(0x00, v); +} + /* Mitsubishi 9810D/DW */ static const dyesub_pagesize_t mitsu_cp9810_page[] = { @@ -2805,8 +2904,100 @@ static const laminate_t mitsu_cpd70x_laminate[] = LIST(laminate_list_t, mitsu_cpd70x_laminate_list, laminate_t, mitsu_cpd70x_laminate); +/* This list is *not* translated */ +static const dyesub_stringitem_t mitsu70x_uiconstraints[] = { + /* PPD generation handles constraint reciprocation */ + /* Basically, exclude Matte and "Fine" quality */ + {"UIConstraints", "*StpLaminate Matte *StpPrintSpeed Fine"}, +}; +LIST(dyesub_stringlist_t, mitsu70x_uiconstraints_list, dyesub_stringitem_t, mitsu70x_uiconstraints); + +typedef struct +{ + const char *quality; + int laminate_offset; +} mitsu70x_privdata_t; + +static mitsu70x_privdata_t mitsu70x_privdata; + +static const dyesub_stringitem_t mitsu70x_qualities[] = +{ + { "Fine", N_ ("Fine") }, + { "SuperFine", N_ ("Super Fine") }, + { "UltraFine", N_ ("Ultra Fine") } +}; +LIST(dyesub_stringlist_t, mitsu70x_quality_list, dyesub_stringitem_t, mitsu70x_qualities); + +static const stp_parameter_t mitsu70x_parameters[] = +{ + { + "PrintSpeed", N_("Print Speed"), "Color=No,Category=Advanced Printer Setup", + N_("Print Speed"), + STP_PARAMETER_TYPE_STRING_LIST, STP_PARAMETER_CLASS_FEATURE, + STP_PARAMETER_LEVEL_BASIC, 1, 1, STP_CHANNEL_NONE, 1, 0 + }, +}; +#define mitsu70x_parameter_count (sizeof(mitsu70x_parameters) / sizeof(const stp_parameter_t)) + +static int +mitsu70x_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, "PrintSpeed") == 0) + { + description->bounds.str = stp_string_list_create(); + + const dyesub_stringlist_t *mlist = &mitsu70x_quality_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 + { + return 0; + } + return 1; +} + +static void mitsu70x_parse_parameters(stp_vars_t *v) +{ + mitsu70x_privdata.quality = stp_get_string_parameter(v, "PrintSpeed"); +} + static void mitsu_cpd70k60_printer_init(stp_vars_t *v, unsigned char model) { + int quality; + + /* Parse options */ + if (strcmp(mitsu70x_privdata.quality, "SuperFine") == 0) { + quality = 3; + } else if (strcmp(mitsu70x_privdata.quality, "UltraFine") == 0) { + quality = 4; + } else if (strcmp(mitsu70x_privdata.quality, "Fine") == 0) { + quality = 0; + } else { + quality = 0; + } + /* Printer wakeup */ stp_putc(0x1b, v); stp_putc(0x45, v); @@ -2818,30 +3009,32 @@ static void mitsu_cpd70k60_printer_init(stp_vars_t *v, unsigned char model) stp_putc(0x1b, v); stp_putc(0x5a, v); stp_putc(0x54, v); - stp_putc(model, v); /* k60 == x02, 305 == x90, d70x == x01 */ + stp_putc(model, v); /* k60 == x02, 305 == x90, d70x/d80 == x01 */ dyesub_nputc(v, 0x00, 12); stp_put16_be(privdata.w_size, v); stp_put16_be(privdata.h_size, v); if (*((const char*)((privdata.laminate->seq).data)) != 0x00) { - /* Laminate a slightly larger boundary in Matte mode */ stp_put16_be(privdata.w_size, v); - stp_put16_be(privdata.h_size + 12, v); if (model == 0x02 || model == 0x90) { - stp_putc(0x04, v); /* Matte Lamination forces UltraFine on K60 or K305 */ + mitsu70x_privdata.laminate_offset = 0; + quality = 4; /* Matte Lamination forces UltraFine on K60 or K305 */ } else { - stp_putc(0x03, v); /* Matte Lamination forces Superfine (or UltraFine) */ + /* Laminate a slightly larger boundary in Matte mode */ + mitsu70x_privdata.laminate_offset = 12; + quality = 3; /* Matte Lamination forces Superfine (or UltraFine) */ } + stp_put16_be(privdata.h_size + mitsu70x_privdata.laminate_offset, v); } else { /* Glossy lamination here */ stp_put16_be(0, v); - stp_put16_be(0, v); - stp_putc(0x00, v); /* ...and just use fine mode. XXX (optional?) */ + stp_put16_be(0, v); } + stp_putc(quality, v); dyesub_nputc(v, 0x00, 7); if (model != 0x01) { - stp_putc(0x00, v); /* D70x: 0x00 Auto deck selection, 0x01 for Lower, 0x02 for Upper */ + stp_putc(0x00, v); /* D70x: 0x00 Auto deck selection, 0x01 for Lower, 0x02 for Upper. */ } else { stp_putc(0x01, v); /* All others have a single "lower" deck */ } @@ -2852,7 +3045,7 @@ static void mitsu_cpd70k60_printer_init(stp_vars_t *v, unsigned char model) (privdata.laminate->seq).bytes, v); /* Lamination mode */ dyesub_nputc(v, 0x00, 6); - /* Multi-cut controlx */ + /* Multi-cut control */ if (strcmp(privdata.pagesize,"w432h576-div2") == 0) { stp_putc(0x01, v); } else if (strcmp(privdata.pagesize,"w360h504-div2") == 0) { @@ -2869,7 +3062,7 @@ static void mitsu_cpd70k60_printer_init(stp_vars_t *v, unsigned char model) static void mitsu_cpd70x_printer_init(stp_vars_t *v) { - mitsu_cpd70k60_printer_init(v, 0x01); + mitsu_cpd70k60_printer_init(v, 0x01); } static void mitsu_cpd70x_printer_end(stp_vars_t *v) @@ -2877,54 +3070,32 @@ static void mitsu_cpd70x_printer_end(stp_vars_t *v) /* If Matte lamination is enabled, generate a lamination plane */ if (*((const char*)((privdata.laminate->seq).data)) != 0x00) { - /* The Windows drivers generate a lamination pattern consisting of - three values: 0xe84b, 0x286a, 0x6c22 */ - - int r, c; - unsigned long seed = 1; - - /* Now generate lamination pattern */ - for (c = 0 ; c < privdata.w_size ; c++) { - for (r = 0 ; r < privdata.h_size + 12 ; r++) { - int i = xrand(&seed) & 0x3f; - if (i < 42) - stp_put16_be(0xe84b, v); - else if (i < 62) - stp_put16_be(0x286a, v); - else - stp_put16_be(0x6c22, v); - } - } - /* Pad up to a 512-byte block */ - dyesub_nputc(v, 0x00, 512 - ((privdata.w_size * (privdata.h_size + 12) * 2) % 512)); - } -} - -static void mitsu_cpk60_printer_end(stp_vars_t *v) -{ - /* If Matte lamination is enabled, generate a lamination plane */ - if (*((const char*)((privdata.laminate->seq).data)) != 0x00) { - - /* The Windows drivers generate a lamination pattern consisting of - three values: 0x9d00, 0x6500, 0x2900 */ - int r, c; unsigned long seed = 1; /* Now generate lamination pattern */ for (c = 0 ; c < privdata.w_size ; c++) { - for (r = 0 ; r < privdata.h_size + 12 ; r++) { + for (r = 0 ; r < privdata.h_size + mitsu70x_privdata.laminate_offset ; r++) { int i = xrand(&seed) & 0x3f; - if (i < 42) - stp_put16_be(0x9d00, v); - else if (i < 62) - stp_put16_be(0x2900, v); - else - stp_put16_be(0x6500, v); + if (mitsu70x_privdata.laminate_offset) { /* D70x uses 0x384b, 0x286a, 0x6c22 */ + if (i < 42) + stp_put16_be(0xe84b, v); + else if (i < 62) + stp_put16_be(0x286a, v); + else + stp_put16_be(0x6c22, v); + } else { /* K60 and EK305 use 0x9d00, 0x6500, 0x2900 */ + if (i < 42) + stp_put16_be(0x9d00, v); + else if (i < 62) + stp_put16_be(0x2900, v); + else + stp_put16_be(0x6500, v); + } } } /* Pad up to a 512-byte block */ - dyesub_nputc(v, 0x00, 512 - ((privdata.w_size * (privdata.h_size + 12) * 2) % 512)); + dyesub_nputc(v, 0x00, 512 - ((privdata.w_size * (privdata.h_size + mitsu70x_privdata.laminate_offset) * 2) % 512)); } } @@ -2977,6 +3148,53 @@ static void mitsu_cpk60_printer_init(stp_vars_t *v) mitsu_cpd70k60_printer_init(v, 0x02); } +/* Identical to the D70 except for one fewer quality mode */ +static const dyesub_stringitem_t mitsu_k60_qualities[] = +{ + { "Fine", N_ ("Fine") }, + { "UltraFine", N_ ("Ultra Fine") } +}; +LIST(dyesub_stringlist_t, mitsu_k60_quality_list, dyesub_stringitem_t, mitsu_k60_qualities); + +static int +mitsu_k60_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, "PrintSpeed") == 0) + { + description->bounds.str = stp_string_list_create(); + + const dyesub_stringlist_t *mlist = &mitsu_k60_quality_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 + { + return 0; + } + return 1; +} + static const dyesub_pagesize_t mitsu_cpd80_page[] = { { "w288h432", "4x6", PT(1228,300)+1, PT(1864,300)+1, 0, 0, 0, 0, @@ -3010,7 +3228,6 @@ static const dyesub_printsize_t mitsu_cpd80_printsize[] = LIST(dyesub_printsize_list_t, mitsu_cpd80_printsize_list, dyesub_printsize_t, mitsu_cpd80_printsize); - /* Kodak 305 */ static const dyesub_pagesize_t kodak305_page[] = { @@ -3427,10 +3644,10 @@ static void shinko_chcs1245_printer_init(stp_vars_t *v) ((const unsigned char*)(privdata.laminate->seq).data)[0] == 0x03) { stp_put32_le(0x07fffffff, v); /* Glossy */ } else { - stp_put32_le(0x0, v); /* XXX -25>0>+25 */ + stp_put32_le(0x0, v); /* XXX matte intensity -25>0>+25 */ } - stp_put32_le(0x00, v); /* XXX 0x00 printer default, 0x02 for "dust removal" on, 0x01 for off. */ + stp_put32_le(0x00, v); /* XXX "dust removal mode" -- 0x00 printer default, 0x02 on, 0x01 for off. */ stp_put32_le(privdata.w_size, v); /* Columns */ stp_put32_le(privdata.h_size, v); /* Rows */ stp_put32_le(0x01, v); /* Copies */ @@ -3987,31 +4204,12 @@ static const dyesub_media_t dnpds80dx_medias[] = LIST(dyesub_media_list_t, dnpds80dx_media_list, dyesub_media_t, dnpds80dx_medias); -/* This list is *not* translated */ -static const dyesub_stringitem_t dnpds80dx_uiconstraints[] = -{ - /* PPD generation handles constraint reciprocation */ - {"UIConstraints", "*Duplex *MediaType Roll"}, - {"UIConstraints", "*PageSize A4 *MediaType Sheet"}, - {"UIConstraints", "*PageSize w576h792-w576h432_w576h360 *MediaType Sheet"}, - {"UIConstraints", "*PageSize w576h648-w576h360_w576h288 *MediaType Sheet"}, - {"UIConstraints", "*PageSize c8x10-w576h432_w576h288 *MediaType Sheet"}, - {"UIConstraints", "*PageSize w576h864-w576h576_w576h288 *MediaType Sheet"}, - {"UIConstraints", "*PageSize w576h864-div3 *MediaType Sheet"}, - {"UIConstraints", "*PageSize w576h864-div3sheet *MediaType Roll"}, - {"UIConstraints", "*PageSize w576h774-w576h756 *MediaType Roll"}, - {"UIConstraints", "*PageSize w576h774 *MediaType Roll"}, -}; - -LIST(dyesub_stringlist_t, dnpds80dx_uiconstraints_list, dyesub_stringitem_t, dnpds80dx_uiconstraints); - /* This is the same as the DS80, except with 10.5" and 10.75" sizes only meant for sheet media. Duplex is *only* supported on sheet media. Also, 8x4*3 differs depending on if you're using sheet or roll media, hence the almost-duplicated definition. - See the constraints list for the illegal combinations */ static const dyesub_pagesize_t dnpds80dx_page[] = @@ -4458,8 +4656,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, NULL, &p10_block_init_func, NULL, NULL, NULL, NULL, /* color profile/adjustment is built into printer */ - &p10_laminate_list, NULL, NULL, + &p10_laminate_list, NULL, NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Olympus P-200 */ 4, @@ -4474,8 +4673,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = &p200_plane_init_func, NULL, NULL, NULL, p200_adj_any, p200_adj_any, p200_adj_any, - NULL, NULL, NULL, NULL, NULL, + NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Olympus P-300 */ 0, @@ -4490,8 +4690,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, &p300_plane_end_func, &p300_block_init_func, NULL, p300_adj_cyan, p300_adj_magenta, p300_adj_yellow, - NULL, NULL, NULL, + NULL, NULL, NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Olympus P-400 */ 1, @@ -4506,8 +4707,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = &p400_plane_init_func, &p400_plane_end_func, &p400_block_init_func, NULL, p400_adj_cyan, p400_adj_magenta, p400_adj_yellow, - NULL, NULL, NULL, NULL, NULL, + NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Olympus P-440 */ 3, @@ -4521,8 +4723,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, NULL, &p440_block_init_func, &p440_block_end_func, NULL, NULL, NULL, /* color profile/adjustment is built into printer */ - &p10_laminate_list, NULL, NULL, + &p10_laminate_list, NULL, NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Olympus P-S100 */ 20, @@ -4536,8 +4739,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* color profile/adjustment is built into printer */ - NULL, NULL, NULL, NULL, NULL, + NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Canon CP-10 */ 1002, @@ -4553,8 +4757,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = &cpx00_plane_init_func, NULL, NULL, NULL, cpx00_adj_cyan, cpx00_adj_magenta, cpx00_adj_yellow, - NULL, NULL, NULL, NULL, NULL, + NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Canon CP-100, CP-200, CP-300 */ 1000, @@ -4570,8 +4775,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = &cpx00_plane_init_func, NULL, NULL, NULL, cpx00_adj_cyan, cpx00_adj_magenta, cpx00_adj_yellow, - NULL, NULL, NULL, NULL, NULL, + NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Canon CP-220, CP-330, SELPHY CP400, SELPHY CP500, SELPHY CP510, SELPHY CP520, SELPHY CP530, SELPHY CP600, SELPHY CP710, @@ -4590,8 +4796,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = &cpx00_plane_init_func, NULL, NULL, NULL, cpx00_adj_cyan, cpx00_adj_magenta, cpx00_adj_yellow, - NULL, NULL, NULL, NULL, NULL, + NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Canon SELPHY ES1 */ 1003, @@ -4607,8 +4814,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = &es1_plane_init_func, NULL, NULL, NULL, cpx00_adj_cyan, cpx00_adj_magenta, cpx00_adj_yellow, - NULL, NULL, NULL, NULL, NULL, + NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Canon SELPHY ES2, SELPHY ES20 */ 1005, @@ -4624,8 +4832,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = &es2_plane_init_func, NULL, NULL, NULL, cpx00_adj_cyan, cpx00_adj_magenta, cpx00_adj_yellow, - NULL, NULL, NULL, NULL, NULL, + NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Canon SELPHY ES3, SELPHY ES30 */ 1006, @@ -4641,8 +4850,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = &es2_plane_init_func, NULL, NULL, NULL, cpx00_adj_cyan, cpx00_adj_magenta, cpx00_adj_yellow, - NULL, NULL, NULL, NULL, NULL, + NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Canon SELPHY ES40 */ 1007, @@ -4658,8 +4868,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = &es2_plane_init_func, NULL, NULL, NULL, cpx00_adj_cyan, cpx00_adj_magenta, cpx00_adj_yellow, - NULL, NULL, NULL, NULL, NULL, + NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Canon SELPHY CP790 */ 1008, @@ -4675,8 +4886,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = &es2_plane_init_func, NULL, NULL, NULL, cpx00_adj_cyan, cpx00_adj_magenta, cpx00_adj_yellow, - NULL, NULL, NULL, NULL, NULL, + NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Canon SELPHY CP800 */ 1009, @@ -4692,8 +4904,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = &cpx00_plane_init_func, NULL, NULL, NULL, cpx00_adj_cyan, cpx00_adj_magenta, cpx00_adj_yellow, - NULL, NULL, NULL, NULL, NULL, + NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Canon SELPHY CP900 */ 1010, @@ -4709,8 +4922,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = &cpx00_plane_init_func, NULL, NULL, NULL, cpx00_adj_cyan, cpx00_adj_magenta, cpx00_adj_yellow, - NULL, NULL, NULL, NULL, NULL, + NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Canon CP820, CP910 */ 1011, @@ -4726,8 +4940,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* Printer handles color correction! */ - NULL, NULL, NULL, NULL, NULL, + NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Sony UP-DP10 */ 2000, @@ -4742,8 +4957,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, NULL, NULL, NULL, updp10_adj_cyan, updp10_adj_magenta, updp10_adj_yellow, - &updp10_laminate_list, NULL, NULL, + &updp10_laminate_list, NULL, NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Sony UP-DR150 */ 2001, @@ -4757,8 +4973,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, NULL, NULL, NULL, NULL, NULL, NULL, - &updp10_laminate_list, NULL, NULL, + &updp10_laminate_list, NULL, NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Sony DPP-EX5, DPP-EX7 */ 2002, @@ -4773,8 +4990,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, NULL, &dppex5_block_init, NULL, NULL, NULL, NULL, - &dppex5_laminate_list, NULL, NULL, + &dppex5_laminate_list, NULL, NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Sony UP-DR100 */ 2003, @@ -4788,8 +5006,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, NULL, NULL, NULL, NULL, NULL, NULL, - &updr100_laminate_list, NULL, NULL, + &updr100_laminate_list, NULL, NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Sony UP-DR200 */ 2004, @@ -4803,8 +5022,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, NULL, NULL, NULL, NULL, NULL, NULL, - &updr200_laminate_list, NULL, NULL, + &updr200_laminate_list, NULL, NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Sony UP-CR10L / DNP SL10 */ 2005, @@ -4818,8 +5038,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, + NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Fujifilm Printpix CX-400 */ 3000, @@ -4834,8 +5055,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* color profile/adjustment is built into printer */ - NULL, NULL, NULL, NULL, NULL, + NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Fujifilm Printpix CX-550 */ 3001, @@ -4850,8 +5072,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* color profile/adjustment is built into printer */ - NULL, NULL, NULL, NULL, NULL, + NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Fujifilm FinePix NX-500 */ 3002, @@ -4865,8 +5088,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* color profile/adjustment is built into printer */ - NULL, NULL, NULL, NULL, NULL, + NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Kodak Easyshare Dock family */ 4000, @@ -4881,8 +5105,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = &kodak_dock_plane_init, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, + NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Kodak Photo Printer 6800 */ 4001, @@ -4896,8 +5121,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, NULL, /* No plane funcs */ NULL, NULL, /* No block funcs */ NULL, NULL, NULL, /* color profile/adjustment is built into printer */ - &kodak_6800_laminate_list, NULL, NULL, + &kodak_6800_laminate_list, NULL, NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Kodak Photo Printer 6850 */ 4002, @@ -4911,8 +5137,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, NULL, /* No plane funcs */ NULL, NULL, /* No block funcs */ NULL, NULL, NULL, /* color profile/adjustment is built into printer */ - &kodak_6800_laminate_list, NULL, NULL, + &kodak_6800_laminate_list, NULL, NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Kodak Photo Printer 605 */ 4003, @@ -4926,8 +5153,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, NULL, /* No plane funcs */ NULL, NULL, /* No block funcs */ NULL, NULL, NULL, /* color profile/adjustment is built into printer */ - &kodak_605_laminate_list, NULL, NULL, + &kodak_605_laminate_list, NULL, NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Kodak Professional 1400 */ 4004, @@ -4943,8 +5171,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, NULL, NULL, NULL, NULL, NULL, NULL, - &kodak_6800_laminate_list, &kodak_1400_media_list, NULL, + &kodak_6800_laminate_list, &kodak_1400_media_list, NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Kodak Photo Printer 805 */ 4005, @@ -4960,8 +5189,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, NULL, /* No plane funcs */ NULL, NULL, /* No block funcs */ NULL, NULL, NULL, /* color profile/adjustment is built into printer */ - &kodak_6800_laminate_list, NULL, NULL, + &kodak_6800_laminate_list, NULL, NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Kodak Professional 9810 */ 4006, @@ -4976,8 +5206,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = &kodak_9810_plane_init, NULL, NULL, NULL, /* No block funcs */ NULL, NULL, NULL, /* color profile/adjustment is built into printer */ - &kodak_9810_laminate_list, NULL, NULL, + &kodak_9810_laminate_list, NULL, NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Kodak 8810 */ 4007, @@ -4992,8 +5223,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, NULL, NULL, NULL, /* No block funcs */ NULL, NULL, NULL, /* color profile/adjustment is built into printer */ - &kodak_8810_laminate_list, NULL, NULL, + &kodak_8810_laminate_list, NULL, NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Kodak 7000/7010 */ 4008, @@ -5008,8 +5240,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, NULL, NULL, NULL, /* No block funcs */ NULL, NULL, NULL, /* color profile/adjustment is built into printer */ - &kodak_7000_laminate_list, NULL, NULL, + &kodak_7000_laminate_list, NULL, NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Kodak 7015 */ 4009, @@ -5024,8 +5257,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, NULL, NULL, NULL, /* No block funcs */ NULL, NULL, NULL, /* color profile/adjustment is built into printer */ - &kodak_7000_laminate_list, NULL, NULL, + &kodak_7000_laminate_list, NULL, NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Kodak Professional 8500 */ 4100, @@ -5039,8 +5273,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, NULL, /* No plane funcs */ NULL, NULL, /* No block funcs */ NULL, NULL, NULL, /* color profile/adjustment is built into printer */ - &kodak_8500_laminate_list, &kodak_8500_media_list, NULL, + &kodak_8500_laminate_list, &kodak_8500_media_list, NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Mitsubishi CP3020D/DU/DE */ 4101, @@ -5055,8 +5290,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = &mitsu_cp3020d_plane_init, &mitsu_cp3020d_plane_end, NULL, NULL, /* No block funcs */ NULL, NULL, NULL, /* color profile/adjustment is built into printer */ - NULL, NULL, NULL, NULL, NULL, + NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Mitsubishi CP3020DA/DAE */ 4102, @@ -5071,8 +5307,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = &mitsu_cp3020da_plane_init, NULL, NULL, NULL, /* No block funcs */ NULL, NULL, NULL, /* color profile/adjustment is built into printer */ - NULL, NULL, NULL, NULL, NULL, + NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Mitsubishi CP9550D */ 4103, @@ -5087,8 +5324,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = &mitsu_cp3020da_plane_init, NULL, NULL, NULL, /* No block funcs */ NULL, NULL, NULL, /* color profile/adjustment is built into printer */ - NULL, NULL, NULL, NULL, NULL, + NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Mitsubishi CP9810D */ 4104, @@ -5104,8 +5342,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = &mitsu_cp3020da_plane_init, NULL, NULL, NULL, /* No block funcs */ NULL, NULL, NULL, /* color profile/adjustment is built into printer */ - &mitsu_cp9810_laminate_list, NULL, NULL, + &mitsu_cp9810_laminate_list, NULL, NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Mitsubishi CPD70D/CPD707D */ 4105, @@ -5121,8 +5360,12 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, &mitsu_cpd70x_plane_end, NULL, NULL, /* No block funcs */ NULL, NULL, NULL, /* color profile/adjustment is built into printer */ - &mitsu_cpd70x_laminate_list, NULL, NULL, + &mitsu_cpd70x_laminate_list, NULL, NULL, NULL, + mitsu70x_parameters, + mitsu70x_parameter_count, + mitsu70x_load_parameters, + mitsu70x_parse_parameters, }, { /* Mitsubishi CPK60D */ 4106, @@ -5134,12 +5377,16 @@ static const dyesub_cap_t dyesub_model_capabilities[] = DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT | DYESUB_FEATURE_PLANE_INTERLACE | DYESUB_FEATURE_16BPP | DYESUB_FEATURE_BIGENDIAN, - &mitsu_cpk60_printer_init, &mitsu_cpk60_printer_end, + &mitsu_cpk60_printer_init, &mitsu_cpd70x_printer_end, NULL, &mitsu_cpd70x_plane_end, NULL, NULL, /* No block funcs */ NULL, NULL, NULL, /* color profile/adjustment is built into printer */ - &mitsu_cpd70x_laminate_list, NULL, NULL, + &mitsu_cpd70x_laminate_list, NULL, NULL, NULL, + mitsu70x_parameters, + mitsu70x_parameter_count, + mitsu_k60_load_parameters, + mitsu70x_parse_parameters, }, { /* Mitsubishi CPD80D */ 4107, @@ -5155,8 +5402,12 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, &mitsu_cpd70x_plane_end, NULL, NULL, /* No block funcs */ NULL, NULL, NULL, /* color profile/adjustment is built into printer */ - &mitsu_cpd70x_laminate_list, NULL, NULL, + &mitsu_cpd70x_laminate_list, NULL, NULL, NULL, + mitsu70x_parameters, + mitsu70x_parameter_count, + mitsu70x_load_parameters, + mitsu70x_parse_parameters, }, { /* Kodak 305 */ 4108, @@ -5168,12 +5419,16 @@ static const dyesub_cap_t dyesub_model_capabilities[] = DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT | DYESUB_FEATURE_PLANE_INTERLACE | DYESUB_FEATURE_16BPP | DYESUB_FEATURE_BIGENDIAN, - &kodak305_printer_init, &mitsu_cpk60_printer_end, + &kodak305_printer_init, &mitsu_cpd70x_printer_end, NULL, &mitsu_cpd70x_plane_end, NULL, NULL, /* No block funcs */ NULL, NULL, NULL, /* color profile/adjustment is built into printer */ - &mitsu_cpd70x_laminate_list, NULL, NULL, + &mitsu_cpd70x_laminate_list, NULL, NULL, NULL, + mitsu70x_parameters, + mitsu70x_parameter_count, + mitsu_k60_load_parameters, + mitsu70x_parse_parameters, }, { /* Mitsubishi CPD90D */ 4109, @@ -5187,8 +5442,43 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, NULL, NULL, NULL, /* No block funcs */ NULL, NULL, NULL, /* color profile/adjustment is built into printer */ - &mitsu_cpd70x_laminate_list, NULL, NULL, + &mitsu_cpd70x_laminate_list, NULL, + NULL, NULL, + NULL, 0, NULL, NULL, + }, + { /* Mitsubishi CP9600D */ + 4110, + &bgr_ink_list, + &res_mitsu9600_dpi_list, + &mitsu_cp9600_page_list, + &mitsu_cp9600_printsize_list, + SHRT_MAX, + DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT + | DYESUB_FEATURE_PLANE_INTERLACE, + &mitsu_cp9600_printer_init, &mitsu_cp9600_printer_end, + &mitsu_cp3020da_plane_init, NULL, + NULL, NULL, /* No block funcs */ + NULL, NULL, NULL, /* color profile/adjustment is built into printer */ + NULL, NULL, + NULL, NULL, + NULL, 0, NULL, NULL, + }, + { /* Mitsubishi CP9550DW-S */ + 4111, + &rgb_ink_list, /* Identical to 9550D except it's rgb instead of bgr */ + &res_346dpi_list, + &mitsu_cp9550_page_list, + &mitsu_cp9550_printsize_list, + SHRT_MAX, + DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT + | DYESUB_FEATURE_PLANE_INTERLACE, + &mitsu_cp9550_printer_init, &mitsu_cp9550_printer_end, + &mitsu_cp3020da_plane_init, NULL, + NULL, NULL, /* No block funcs */ + NULL, NULL, NULL, /* color profile/adjustment is built into printer */ NULL, NULL, + NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Shinko CHC-S9045 (experimental) */ 5000, @@ -5202,8 +5492,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, + NULL, NULL, NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Shinko/Sinfonia CHC-S2145 */ 5001, @@ -5217,8 +5508,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, NULL, /* No planes */ NULL, NULL, /* No blocks */ NULL, NULL, NULL, /* Color correction in printer */ - &shinko_chcs2145_laminate_list, NULL, NULL, + &shinko_chcs2145_laminate_list, NULL, NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Shinko/Sinfonia CHC-S1245 */ 5002, @@ -5232,7 +5524,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, NULL, /* No planes */ NULL, NULL, /* No blocks */ NULL, NULL, NULL, /* Color correction in printer */ - &shinko_chcs1245_laminate_list, NULL, NULL, + &shinko_chcs1245_laminate_list, NULL, + NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Shinko/Sinfonia CHC-S6245 */ 5003, @@ -5246,8 +5540,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, NULL, /* No planes */ NULL, NULL, /* No blocks */ NULL, NULL, NULL, /* Color correction in printer */ - &shinko_chcs6245_laminate_list, NULL, NULL, + &shinko_chcs6245_laminate_list, NULL, NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Shinko/Sinfonia CHC-S6145 */ 5004, @@ -5261,8 +5556,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, NULL, /* No planes */ NULL, NULL, /* No blocks */ NULL, NULL, NULL, /* Color correction in printer */ - &shinko_chcs6145_laminate_list, NULL, NULL, + &shinko_chcs6145_laminate_list, NULL, NULL, NULL, + NULL, 0, NULL, NULL, }, { /* CIAAT Brava 21 (aka CHC-S6145D) */ 5005, @@ -5276,8 +5572,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = NULL, NULL, /* No planes */ NULL, NULL, /* No blocks */ NULL, NULL, NULL, /* Color correction in printer */ - &shinko_chcs6145_laminate_list, NULL, NULL, + &shinko_chcs6145_laminate_list, NULL, NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Dai Nippon Printing DS40 */ 6000, @@ -5292,8 +5589,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = &dnpds40_plane_init, NULL, NULL, NULL, NULL, NULL, NULL, - &dnpds40_laminate_list, NULL, NULL, + &dnpds40_laminate_list, NULL, NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Dai Nippon Printing DS80 */ 6001, @@ -5308,8 +5606,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = &dnpds40_plane_init, NULL, NULL, NULL, NULL, NULL, NULL, - &dnpds40_laminate_list, NULL, NULL, + &dnpds40_laminate_list, NULL, NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Dai Nippon Printing DSRX1 */ 6002, @@ -5324,8 +5623,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = &dnpds40_plane_init, NULL, NULL, NULL, NULL, NULL, NULL, - &dnpds40_laminate_list, NULL, NULL, + &dnpds40_laminate_list, NULL, NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Dai Nippon Printing DS620 */ 6003, @@ -5340,8 +5640,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = &dnpds40_plane_init, NULL, NULL, NULL, NULL, NULL, NULL, - &dnpds620_laminate_list, NULL, NULL, + &dnpds620_laminate_list, NULL, NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Citizen CW-01 */ 6005, @@ -5356,8 +5657,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = &citizen_cw01_plane_init, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, + NULL, NULL, NULL, NULL, + NULL, 0, NULL, NULL, }, { /* Dai Nippon Printing DS80DX */ 6006, @@ -5372,8 +5674,9 @@ static const dyesub_cap_t dyesub_model_capabilities[] = &dnpds40_plane_init, NULL, NULL, NULL, NULL, NULL, NULL, - &dnpds40_laminate_list, &dnpds80dx_media_list, &dnpds80dx_uiconstraints_list, + &dnpds40_laminate_list, &dnpds80dx_media_list, NULL, NULL, + NULL, 0, NULL, NULL, }, }; @@ -5443,12 +5746,6 @@ 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, 1, 0 }, - { - "PPDUIConstraints", N_("PPD User Interface Constraints"), "Color=No,Category=Advanced Printer Functionality", - N_("PPD UIConstraints List"), - STP_PARAMETER_TYPE_STRING_LIST, STP_PARAMETER_CLASS_FEATURE, - STP_PARAMETER_LEVEL_INTERNAL, 0, 0, STP_CHANNEL_NONE, 0, 1 - }, }; static int the_parameter_count = @@ -5602,6 +5899,8 @@ dyesub_feature(const dyesub_cap_t *caps, int feature) static stp_parameter_list_t dyesub_list_parameters(const stp_vars_t *v) { + const dyesub_cap_t *caps = dyesub_get_model_capabilities(stp_get_model_id(v)); + stp_parameter_list_t *ret = stp_parameter_list_create(); int i; @@ -5609,6 +5908,10 @@ dyesub_list_parameters(const stp_vars_t *v) stp_parameter_list_add_param(ret, &(the_parameters[i])); for (i = 0; i < float_parameter_count; i++) stp_parameter_list_add_param(ret, &(float_parameters[i].param)); + if (caps->parameter_count && caps->parameters) + for (i = 0; i < caps->parameter_count ; i++) + stp_parameter_list_add_param(ret, &(caps->parameters[i])); + return ret; } @@ -5641,6 +5944,12 @@ dyesub_parameters(const stp_vars_t *v, const char *name, stp_fill_parameter_settings(description, &(the_parameters[i])); break; } + if (caps->load_parameters) /* do *NOT* use dyesub_exec() here */ + { + if (caps->load_parameters(v, name, description)) + return; /* Ie parameter handled */ + } + if (strcmp(name, "PageSize") == 0) { int default_specified = 0; @@ -5746,24 +6055,6 @@ dyesub_parameters(const stp_vars_t *v, const char *name, description->deflt.str = stp_string_list_param(description->bounds.str, 0)->name; } - else if (strcmp(name, "PPDUIConstraints") == 0) - { - description->bounds.str = stp_string_list_create(); - if (caps->uiconstraints) { - const dyesub_stringlist_t *mlist = caps->uiconstraints; - 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 */ - } - description->deflt.str = - stp_string_list_param(description->bounds.str, 0)->name; - description->is_active = 1; - } else { - description->is_active = 0; - } - } else if (strcmp(name, "Duplex") == 0) { int offer_duplex=0; @@ -5782,7 +6073,7 @@ dyesub_parameters(const stp_vars_t *v, const char *name, else offer_duplex=1; - if (offer_duplex && (caps->features & DYESUB_FEATURE_DUPLEX)) + if (offer_duplex && dyesub_feature(caps, DYESUB_FEATURE_DUPLEX)) { description->deflt.str = duplex_types[0].name; for (i=0; i < NUM_DUPLEX; i++) @@ -6329,6 +6620,9 @@ dyesub_do_print(stp_vars_t *v, stp_image_t *image) stp_describe_resolution(v, &w_dpi, &h_dpi); dyesub_printsize(v, &max_print_px_width, &max_print_px_height); + /* Parse any per-printer parameters */ + dyesub_exec(v, caps->parse_parameters, "caps->parse_parameters"); + /* Duplex processing -- Rotate even pages for DuplexNoTumble */ privdata.duplex_mode = stp_get_string_parameter(v, "Duplex"); privdata.page_number = stp_get_int_parameter(v, "PageNumber"); @@ -6426,7 +6720,7 @@ dyesub_do_print(stp_vars_t *v, stp_image_t *image) pv.byteswap = !dyesub_feature(caps, DYESUB_FEATURE_BIGENDIAN); #else #error "Unable to determine endianness, aborting compilation!" -#endif +#endif } pv.image_data = dyesub_read_image(v, &pv, image); diff --git a/src/main/print-ps.c b/src/main/print-ps.c index 3596e01..6a4a85f 100644 --- a/src/main/print-ps.c +++ b/src/main/print-ps.c @@ -39,6 +39,7 @@ #endif #include <stdio.h> #include <unistd.h> +#include <strings.h> #include "xmlppd.h" #ifdef _MSC_VER diff --git a/src/main/xmlppd.c b/src/main/xmlppd.c index 0ee9dc9..27bd6b8 100644 --- a/src/main/xmlppd.c +++ b/src/main/xmlppd.c @@ -26,6 +26,7 @@ #include <gutenprint/util.h> #include <gutenprint/string-list.h> #include <stdlib.h> +#include <strings.h> #include "xmlppd.h" typedef struct |