diff options
author | Roger Leigh <rleigh@debian.org> | 2009-01-04 18:17:34 +0000 |
---|---|---|
committer | Roger Leigh <rleigh@debian.org> | 2009-01-04 18:17:34 +0000 |
commit | a68ece422e0be1a0101dae2fa2408ef0e533c2e9 (patch) | |
tree | 5d93ef65025dd086862fed887902ebaddc3d3291 /src/main | |
parent | 15fd5cc391273464beef576568675599633a9827 (diff) |
Imported Upstream version 5.2.3
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/canon-inks.h | 105 | ||||
-rw-r--r-- | src/main/canon-media.h | 80 | ||||
-rw-r--r-- | src/main/canon-printers.h | 56 | ||||
-rw-r--r-- | src/main/print-canon.c | 18 | ||||
-rw-r--r-- | src/main/print-escp2-data.c | 18 | ||||
-rw-r--r-- | src/main/print-escp2.c | 39 | ||||
-rw-r--r-- | src/main/print-escp2.h | 9 |
7 files changed, 286 insertions, 39 deletions
diff --git a/src/main/canon-inks.h b/src/main/canon-inks.h index 1cd69fc..a86578d 100644 --- a/src/main/canon-inks.h +++ b/src/main/canon-inks.h @@ -117,6 +117,16 @@ static const stp_dotsize_t dotsizes_7l[] = { DECLARE_INK(3,7); +static const stp_dotsize_t dotsizes_6l[] = { + { 0x1, 0.2 }, + { 0x2, 0.4 }, + { 0x3, 0.6 }, + { 0x4, 0.8 }, + { 0x5, 1.0 } +}; + +DECLARE_INK(4,6); + static const stp_dotsize_t dotsizes_8l[] = { { 0x1, 0.14 }, { 0x2, 0.29 }, @@ -398,6 +408,38 @@ static const canon_inkset_t canon_11_C2M2Y2K2_inkset[] = { {0,0.0,NULL} }; +static const canon_inkset_t canon_13_C2M2Y2K2_inkset[] = { + {'C',1.0,&canon_1b_2l_ink}, + {'M',1.0,&canon_1b_2l_ink}, + {'Y',1.0,&canon_1b_2l_ink}, + {'K',1.0,&canon_1b_2l_ink}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, +}; + +static const canon_inkset_t canon_13_C2M2Y2K2k2_inkset[] = { + {'C',1.0,&canon_1b_2l_ink}, + {'M',1.0,&canon_1b_2l_ink}, + {'Y',1.0,&canon_1b_2l_ink}, + {'K',1.0,&canon_1b_2l_ink}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {'k',1.0,&canon_1b_2l_ink}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, +}; + static const canon_inkset_t canon_13_C3M3Y2K2_inkset[] = { {'C',1.0,&canon_2b_3l_ink}, {'M',1.0,&canon_2b_3l_ink}, @@ -430,6 +472,69 @@ static const canon_inkset_t canon_13_C3M3Y2K2k3_c_inkset[] = { {0,0.0,NULL}, }; +static const canon_inkset_t canon_13_C6M6Y4K2k4_inkset[] = { + {'C',1.0,&canon_4b_6l_ink}, + {'M',1.0,&canon_4b_6l_ink}, + {'Y',1.0,&canon_2b_4l_ink}, + {'K',1.0,&canon_1b_2l_ink}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {'k',0.0,&canon_2b_4l_ink}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, +}; + +static const canon_inkset_t canon_13_C6M6Y4k4yask_inkset[] = { + {'C',1.0,&canon_4b_6l_ink}, + {'M',1.0,&canon_4b_6l_ink}, + {'Y',1.0,&canon_2b_4l_ink}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {'k',1.0,&canon_2b_4l_ink}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, +}; + +static const canon_inkset_t canon_13_C8M8Y4K4k4_inkset[] = { + {'C',1.0,&canon_4b_8l_ink}, + {'M',1.0,&canon_4b_8l_ink}, + {'Y',1.0,&canon_2b_4l_ink}, + {'K',1.0,&canon_2b_4l_ink}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {'k',1.0,&canon_2b_4l_ink}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, +}; + +static const canon_inkset_t canon_13_C8M8Y4k4yask_inkset[] = { + {'C',1.0,&canon_4b_8l_ink}, + {'M',1.0,&canon_4b_8l_ink}, + {'Y',1.0,&canon_2b_4l_ink}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {'k',1.0,&canon_2b_4l_ink}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, +}; static const canon_inkset_t canon_19_C3M3Y3k3_inkset[] = { {'C',1.0,&canon_2b_3l_ink}, diff --git a/src/main/canon-media.h b/src/main/canon-media.h index 11e5ef2..0db683f 100644 --- a/src/main/canon-media.h +++ b/src/main/canon-media.h @@ -72,6 +72,15 @@ static const canon_slot_t canon_PIXMA_iP4000_slots[] = { }; DECLARE_SLOTS(canon_PIXMA_iP4000); +static const canon_slot_t canon_PIXMA_iP4600_slots[] = { + { "AutoSwitch", N_ ("Automatic Paper Source Switching"), 0xe }, + { "Rear", N_ ("Rear tray"), 0x4 }, + { "Cassette", N_ ("Cassette"), 0x8 }, + { "Continuous", N_ ("Continuous autofeed (both)"), 0xf }, + { "CD", N_ ("CD tray"), 0xa } +}; +DECLARE_SLOTS(canon_PIXMA_iP4600); + /* media types */ typedef struct { @@ -79,6 +88,7 @@ typedef struct { const char *text; /* Translateable name */ unsigned char media_code_c; /* Media Code used for the ESC (c (SetColor) command */ unsigned char media_code_l; /* Media Code used for the ESC (l (SetTray) command */ + unsigned char media_code_P; /* Media Code used for the ESC (P (Unknown) command */ double base_density; double k_lower_scale; double k_upper; @@ -104,37 +114,59 @@ static const canon_paperlist_t name##_paperlist = { \ /* paperlists for the various printers. The first entry will be the default */ static const canon_paper_t canon_default_papers[] = { - { "Plain", N_ ("Plain Paper"), 0x00, 0x00,0.50, 0.25, 0.500, 0, 0, 0 }, - { "Transparency", N_ ("Transparencies"), 0x02, 0x02,1.00, 1.00, 0.900, 0, 0, 0 }, - { "BackPrint", N_ ("Back Print Film"), 0x03, 0x03,1.00, 1.00, 0.900, 0, 0, 0 }, - { "Fabric", N_ ("Fabric Sheets"), 0x04, 0x04,0.50, 0.25, 0.500, 0, 0, 0 }, - { "Envelope", N_ ("Envelope"), 0x08, 0x08,0.50, 0.25, 0.500, 0, 0, 0 }, - { "Coated", N_ ("High Resolution Paper"), 0x07, 0x07,0.78, 0.25, 0.500, 0, 0, 0 }, - { "TShirt", N_ ("T-Shirt Transfers"), 0x03, 0x03,0.50, 0.25, 0.500, 0, 0, 0 }, - { "GlossyFilm", N_ ("High Gloss Film"), 0x06, 0x06,1.00, 1.00, 0.999, 0, 0, 0 }, - { "GlossyPaper", N_ ("Glossy Photo Paper"), 0x05, 0x05,1.00, 1.00, 0.999, 0, 0, 0 }, - { "GlossyCard", N_ ("Glossy Photo Cards"), 0x0a, 0x0a,1.00, 1.00, 0.999, 0, 0, 0 }, - { "GlossyPro", N_ ("Photo Paper Pro"), 0x09, 0x09,1.00, 1.00, 0.999, 0, 0, 0 }, - { "Other", N_ ("Other"), 0x00, 0x00,0.50, 0.25, .5, 0, 0, 0 }, + { "Plain", N_ ("Plain Paper"), 0x00, 0x00,0x00,0.50, 0.25, 0.500, 0, 0, 0 }, + { "Transparency", N_ ("Transparencies"), 0x02, 0x02,0x00,1.00, 1.00, 0.900, 0, 0, 0 }, + { "BackPrint", N_ ("Back Print Film"), 0x03, 0x03,0x00,1.00, 1.00, 0.900, 0, 0, 0 }, + { "Fabric", N_ ("Fabric Sheets"), 0x04, 0x04,0x00,0.50, 0.25, 0.500, 0, 0, 0 }, + { "Envelope", N_ ("Envelope"), 0x08, 0x08,0x00,0.50, 0.25, 0.500, 0, 0, 0 }, + { "Coated", N_ ("High Resolution Paper"), 0x07, 0x07,0x00,0.78, 0.25, 0.500, 0, 0, 0 }, + { "TShirt", N_ ("T-Shirt Transfers"), 0x03, 0x03,0x00,0.50, 0.25, 0.500, 0, 0, 0 }, + { "GlossyFilm", N_ ("High Gloss Film"), 0x06, 0x06,0x00,1.00, 1.00, 0.999, 0, 0, 0 }, + { "GlossyPaper", N_ ("Glossy Photo Paper"), 0x05, 0x05,0x00,1.00, 1.00, 0.999, 0, 0, 0 }, + { "GlossyCard", N_ ("Glossy Photo Cards"), 0x0a, 0x0a,0x00,1.00, 1.00, 0.999, 0, 0, 0 }, + { "GlossyPro", N_ ("Photo Paper Pro"), 0x09, 0x09,0x00,1.00, 1.00, 0.999, 0, 0, 0 }, + { "Other", N_ ("Other"), 0x00, 0x00,0x00,0.50, 0.25, .5, 0, 0, 0 }, }; DECLARE_PAPERS(canon_default); static const canon_paper_t canon_PIXMA_iP4000_papers[] = { - { "Plain", N_ ("Plain Paper"), 0x00,0x00,1.00, 0.25, 0.500, 0, 0, 0 }, - { "Transparency", N_ ("Transparencies"), 0x02,0x02,0.78, 0.25, 0.500, 0, 0, 0 }, - { "TShirt", N_ ("T-Shirt Transfers"), 0x03,0x03,0.78, 0.25, 0.500, 0, 0, 0 }, - { "GlossyPaper", N_ ("Glossy Photo Paper"), 0x05,0x05,0.78, 0.25, 0.500, 0, 0, 0 }, - { "Coated", N_ ("High Resolution Paper"), 0x07,0x07,0.78, 0.25, 0.500, 0, 0, 0 }, - { "Envelope", N_ ("Envelope"), 0x08,0x08,0.78, 0.25, 0.500, 0, 0, 0 }, - { "PhotopaperPro", N_ ("Professional Photo Paper"), 0x09,0x0d,0.78, 0.25, 0.500, 0, 0, 0 }, - { "PhotopaperMatte", N_ ("Photo Paper Matte"), 0x0a,0x10,0.78, 0.25, 0.500, 0, 0, 0 }, - { "PhotopaperPlus", N_ ("Glossy Photo Paper Plus"), 0x0b,0x11,0.78, 0.25, 0.500, 0, 0, 0 }, - { "CD", N_ ("CD"), 0x00,0x12,0.78, 0.25, 0.500, 0, 0, 0 }, + { "Plain", N_ ("Plain Paper"), 0x00,0x00,0x00,1.00, 0.25, 0.500, 0, 0, 0 }, + { "Transparency", N_ ("Transparencies"), 0x02,0x02,0x00,0.78, 0.25, 0.500, 0, 0, 0 }, + { "TShirt", N_ ("T-Shirt Transfers"), 0x03,0x03,0x00,0.78, 0.25, 0.500, 0, 0, 0 }, + { "GlossyPaper", N_ ("Glossy Photo Paper"), 0x05,0x05,0x00,0.78, 0.25, 0.500, 0, 0, 0 }, + { "Coated", N_ ("High Resolution Paper"), 0x07,0x07,0x00,0.78, 0.25, 0.500, 0, 0, 0 }, + { "Envelope", N_ ("Envelope"), 0x08,0x08,0x00,0.78, 0.25, 0.500, 0, 0, 0 }, + { "PhotopaperPro", N_ ("Professional Photo Paper"), 0x09,0x0d,0x00,0.78, 0.25, 0.500, 0, 0, 0 }, + { "PhotopaperMatte", N_ ("Photo Paper Matte"), 0x0a,0x10,0x00,0.78, 0.25, 0.500, 0, 0, 0 }, + { "PhotopaperPlus", N_ ("Glossy Photo Paper Plus"), 0x0b,0x11,0x00,0.78, 0.25, 0.500, 0, 0, 0 }, + { "CD", N_ ("CD"), 0x00,0x12,0x00,0.78, 0.25, 0.500, 0, 0, 0 }, /* FIXME media code for c) should be 0x0c for CD but this will restrict CD printing to a single, not well supported, resolution */ - { "PhotopaperOther", N_ ("Other Photo Paper"), 0x0f,0x14,0.78, 0.25, 0.500, 0, 0, 0 }, - { "PhotopaperPlusDouble", N_ ("Photoper Plus Double-Sided"), 0x10,0x15,0.78, 0.25, 0.500, 0, 0, 0 }, + { "PhotopaperOther", N_ ("Other Photo Paper"), 0x0f,0x14,0x00,0.78, 0.25, 0.500, 0, 0, 0 }, + { "PhotopaperPlusDouble", N_ ("Photoper Plus Double-Sided"), 0x10,0x15,0x00,0.78, 0.25, 0.500, 0, 0, 0 }, }; DECLARE_PAPERS(canon_PIXMA_iP4000); + +static const canon_paper_t canon_PIXMA_iP4600_papers[] = { /* k_lower_scale *hue_adjustment *sat_adjustment */ + /* Name Text (c (l (P Density k_upper *lum_adjustment */ + { "Plain", N_ ("Plain Paper"), 0x00,0x00,0x00,0.78, 0.25, 0.500, 0, 0, 0 }, + { "PhotoPlusGloss2", N_ ("Photo Paper Plus Glossy II"), 0x1d,0x23,0x32,0.78, 0.25, 0.500, 0, 0, 0 }, + { "PhotoPro2", N_ ("Photo Paper Pro II"), 0x1f,0x25,0x34,0.78, 0.25, 0.500, 0, 0, 0 }, + { "PhotoProPlat", N_ ("Photo Paper Platinum"), 0x1e,0x24,0x33,0.78, 0.25, 0.500, 0, 0, 0 }, + { "PhotoProSemiGloss",N_ ("Photo Paper Plus Semi-gloss"), 0x1a,0x1f,0x2a,0.78, 0.25, 0.500, 0, 0, 0 }, + { "GlossyPhoto", N_ ("Glossy Photo Paper"), 0x05,0x05,0x16,0.78, 0.25, 0.500, 0, 0, 0 }, + { "MattePhoto", N_ ("Matte Photo Paper"), 0x0a,0x10,0x1c,0.78, 0.25, 0.500, 0, 0, 0 }, + { "HighResolution", N_ ("High Resolution Paper"), 0x07,0x07,0x10,0.78, 0.25, 0.500, 0, 0, 0 }, + { "InkJetHagaki", N_ ("Ink Jet Hagaki"), 0x0d,0x09,0x1b,0.78, 0.25, 0.500, 0, 0, 0 }, + { "Hagaki", N_ ("Hagaki"), 0x08,0x09,0x07,0.78, 0.25, 0.500, 0, 0, 0 }, + { "DiscCompat", N_ ("Printable Disc (Compatible)"), 0x0c,0x12,0x1f,0.78, 0.25, 0.500, 0, 0, 0 }, + { "DiscOthers", N_ ("Printable Disc (Other)"), 0x0c,0x12,0x20,0.78, 0.25, 0.500, 0, 0, 0 }, + { "TShirtTransfer", N_ ("T-Shirt Transfer"), 0x03,0x03,0x12,0.78, 0.25, 0.500, 0, 0, 0 }, + { "Envelope", N_ ("Envelope"), 0x08,0x08,0x08,0.78, 0.25, 0.500, 0, 0, 0 }, + { "Other", N_ ("Other Photo Paper"), 0x0f,0x14,0x24,0.78, 0.25, 0.500, 0, 0, 0 } +}; +DECLARE_PAPERS(canon_PIXMA_iP4600); + + #endif diff --git a/src/main/canon-printers.h b/src/main/canon-printers.h index cd44195..df48e0e 100644 --- a/src/main/canon-printers.h +++ b/src/main/canon-printers.h @@ -37,6 +37,7 @@ typedef struct canon_caps { int border_right; /* right margin, points */ int border_top; /* absolute top margin, points */ int border_bottom; /* absolute bottom margin, points */ + int raster_lines_per_block; /* number of raster lines in every F) command */ const canon_slotlist_t* slotlist; /*available paperslots */ unsigned long features; /* special bjl settings */ unsigned char ESC_r_arg; /* argument used for the ESC (r command during init */ @@ -174,6 +175,7 @@ static const canon_cap_t canon_model_capabilities[] = "PIXMA MP830", 3, /*model, model_id*/ 842, 17*72, /* max paper width and height */ 10, 10, 15, 15, /*border_left, border_right, border_top, border_bottom */ + 8, &canon_PIXMA_iP4000_slotlist, CANON_CAP_STD0|CANON_CAP_DUPLEX|CANON_CAP_px,0,control_cmd_MULTIPASS_MP150, /*features */ &canon_MULTIPASS_MP830_modelist, @@ -202,6 +204,7 @@ static const canon_cap_t canon_model_capabilities[] = "S200", 3, 618, 936, /* 8.58" x 13 " */ 10, 10, 9, 20, + 8, &canon_default_slotlist, CANON_CAP_STD1 | CANON_CAP_rr,0x61,NULL, &canon_S200_modelist, @@ -216,6 +219,7 @@ static const canon_cap_t canon_model_capabilities[] = "S300", 3, 842, 17*72, 11, 9, 10, 18, + 8, &canon_default_slotlist, CANON_CAP_STD1 | CANON_CAP_r,0x61,control_cmd_ackshort, &canon_BJC_8500_modelist, @@ -230,6 +234,7 @@ static const canon_cap_t canon_model_capabilities[] = "30", 1, 9.5*72, 14*72, 11, 9, 10, 18, + 8, &canon_default_slotlist, CANON_CAP_STD0 | CANON_CAP_a,0,NULL, &canon_BJC_30_modelist, @@ -243,6 +248,7 @@ static const canon_cap_t canon_model_capabilities[] = "85", 1, 9.5*72, 14*72, 11, 9, 10, 18, + 8, &canon_default_slotlist, CANON_CAP_STD0 | CANON_CAP_a,0,NULL, &canon_BJC_85_modelist, @@ -257,6 +263,7 @@ static const canon_cap_t canon_model_capabilities[] = "4300", 1, 618, 936, /* 8.58" x 13 " */ 11, 9, 10, 18, + 8, &canon_default_slotlist, CANON_CAP_STD0,0,NULL, &canon_BJC_4300_modelist, @@ -271,6 +278,7 @@ static const canon_cap_t canon_model_capabilities[] = "4400", 1, 9.5*72, 14*72, 11, 9, 10, 18, + 8, &canon_default_slotlist, CANON_CAP_STD0 | CANON_CAP_a,0,NULL, &canon_BJC_4400_modelist, @@ -285,6 +293,7 @@ static const canon_cap_t canon_model_capabilities[] = "6000", 3, 618, 936, /* 8.58" x 13 " */ 11, 9, 10, 18, + 8, &canon_default_slotlist, CANON_CAP_STD1,0,control_cmd_ackshort, &canon_BJC_6000_modelist, @@ -299,6 +308,7 @@ static const canon_cap_t canon_model_capabilities[] = "6200", 3, 618, 936, /* 8.58" x 13 " */ 11, 9, 10, 18, + 8, &canon_default_slotlist, CANON_CAP_STD1,0,control_cmd_ackshort, &canon_BJC_6000_modelist, @@ -313,6 +323,7 @@ static const canon_cap_t canon_model_capabilities[] = "6500", 3, 842, 17*72, 11, 9, 10, 18, + 8, &canon_default_slotlist, CANON_CAP_STD1,0,NULL, &canon_BJC_6000_modelist, @@ -326,6 +337,7 @@ static const canon_cap_t canon_model_capabilities[] = "8200", 3, 842, 17*72, 11, 9, 10, 18, + 8, &canon_default_slotlist, CANON_CAP_STD1 | CANON_CAP_r,0x61,control_cmd_ackshort, &canon_BJC_8200_modelist, @@ -339,6 +351,7 @@ static const canon_cap_t canon_model_capabilities[] = "S500", 3, 842, 17*72, 10, 10, 15, 15, + 8, &canon_default_slotlist, CANON_CAP_STD0 | CANON_CAP_r | CANON_CAP_p,0x61,control_cmd_ackshort, &canon_S500_modelist, @@ -360,6 +373,7 @@ static const canon_cap_t canon_model_capabilities[] = "210", 1, 618, 936, /* 8.58" x 13 " */ 11, 9, 10, 18, + 8, &canon_default_slotlist, CANON_CAP_STD0,0,NULL, &canon_BJC_210_modelist, @@ -373,6 +387,7 @@ static const canon_cap_t canon_model_capabilities[] = "240", 1, 618, 936, /* 8.58" x 13 " */ 11, 9, 10, 18, + 8, &canon_default_slotlist, CANON_CAP_STD0,0,NULL, &canon_BJC_240_modelist, @@ -386,6 +401,7 @@ static const canon_cap_t canon_model_capabilities[] = "250", 1, 618, 936, /* 8.58" x 13 " */ 11, 9, 10, 18, + 8, &canon_default_slotlist, CANON_CAP_STD0,0,NULL, &canon_BJC_240_modelist, @@ -399,6 +415,7 @@ static const canon_cap_t canon_model_capabilities[] = "1000", 1, 842, 17*72, 11, 9, 10, 18, + 8, &canon_default_slotlist, CANON_CAP_STD0 | CANON_CAP_a,0,NULL, &canon_BJC_240_modelist, @@ -412,6 +429,7 @@ static const canon_cap_t canon_model_capabilities[] = "2000", 1, 842, 17*72, 11, 9, 10, 18, + 8, &canon_default_slotlist, CANON_CAP_STD0 | CANON_CAP_a,0,NULL, &canon_BJC_2000_modelist, @@ -425,6 +443,7 @@ static const canon_cap_t canon_model_capabilities[] = "3000", 3, 842, 17*72, 10, 10, 9, 15, + 8, &canon_default_slotlist, CANON_CAP_STD0 | CANON_CAP_a | CANON_CAP_p,0,NULL, /*FIX? should have _r? */ &canon_BJC_3000_modelist, @@ -438,6 +457,7 @@ static const canon_cap_t canon_model_capabilities[] = "6100", 3, 842, 17*72, 11, 9, 10, 18, + 8, &canon_default_slotlist, CANON_CAP_STD1 | CANON_CAP_a | CANON_CAP_r,0x61,NULL, &canon_BJC_3000_modelist, @@ -451,6 +471,7 @@ static const canon_cap_t canon_model_capabilities[] = "7000", 3, 842, 17*72, 11, 9, 10, 18, + 8, &canon_default_slotlist, CANON_CAP_STD1,0,NULL, &canon_BJC_7000_modelist, @@ -464,6 +485,7 @@ static const canon_cap_t canon_model_capabilities[] = "i560", 3, 842, 17*72, 11, 9, 10, 18, + 8, &canon_default_slotlist, CANON_CAP_STD1,0,NULL, &canon_BJC_i560_modelist, @@ -477,6 +499,7 @@ static const canon_cap_t canon_model_capabilities[] = "7100", 3, 842, 17*72, 11, 9, 10, 18, + 8, &canon_default_slotlist, CANON_CAP_STD0,0,NULL, &canon_BJC_7100_modelist, @@ -490,6 +513,7 @@ static const canon_cap_t canon_model_capabilities[] = "i80", 3, 842, 17*72, 11, 9, 10, 18, + 8, &canon_default_slotlist, CANON_CAP_STD0,0,NULL, &canon_BJC_i80_modelist, @@ -511,6 +535,7 @@ static const canon_cap_t canon_model_capabilities[] = "5100", 1, 17*72, 22*72, 11, 9, 10, 18, + 8, &canon_default_slotlist, CANON_CAP_STD0,0,NULL, &canon_BJC_3000_modelist, @@ -524,6 +549,7 @@ static const canon_cap_t canon_model_capabilities[] = "5500", 1, 22*72, 34*72, 11, 9, 10, 18, + 8, &canon_default_slotlist, CANON_CAP_STD0 | CANON_CAP_a,0,NULL, &canon_BJC_5500_modelist, @@ -537,6 +563,7 @@ static const canon_cap_t canon_model_capabilities[] = "6500", 3, 17*72, 22*72, 11, 9, 10, 18, + 8, &canon_default_slotlist, CANON_CAP_STD1 | CANON_CAP_a,0,NULL, &canon_BJC_3000_modelist, @@ -550,6 +577,7 @@ static const canon_cap_t canon_model_capabilities[] = "8500", 3, 17*72, 22*72, 11, 9, 10, 18, + 8, &canon_default_slotlist, CANON_CAP_STD0,0,NULL, &canon_BJC_8500_modelist, @@ -563,6 +591,7 @@ static const canon_cap_t canon_model_capabilities[] = "PIXMA iP2000", 3, /*model, model_id*/ 842, 17*72, /* max paper width and height */ 10, 10, 15, 15, /*border_left, border_right, border_top, border_bottom */ + 8, &canon_PIXMA_iP4000_slotlist, CANON_CAP_STD0|CANON_CAP_DUPLEX|CANON_CAP_r|CANON_CAP_px,0x61,control_cmd_PIXMA_iP4000, /*features */ &canon_PIXMA_iP2000_modelist, @@ -576,6 +605,7 @@ static const canon_cap_t canon_model_capabilities[] = "PIXMA iP3000", 3, /*model, model_id*/ 842, 17*72, /* max paper width and height */ 10, 10, 15, 15, /*border_left, border_right, border_top, border_bottom */ + 8, &canon_PIXMA_iP4000_slotlist, CANON_CAP_STD0|CANON_CAP_DUPLEX|CANON_CAP_r|CANON_CAP_px,0x61,control_cmd_PIXMA_iP4000, /*features */ &canon_PIXMA_iP3000_modelist, @@ -589,6 +619,7 @@ static const canon_cap_t canon_model_capabilities[] = "PIXMA iP4000", 3, /*model, model_id*/ 842, 17*72, /* max paper width and height */ 10, 10, 15, 15, /*border_left, border_right, border_top, border_bottom */ + 8, &canon_PIXMA_iP4000_slotlist, CANON_CAP_STD0|CANON_CAP_DUPLEX|CANON_CAP_r|CANON_CAP_px /*|CANON_CAP_I*/,0x64,control_cmd_PIXMA_iP4000, /*features */ &canon_PIXMA_iP4000_modelist, @@ -602,6 +633,7 @@ static const canon_cap_t canon_model_capabilities[] = "PIXMA MP740", 3, /*model, model_id*/ 842, 17*72, /* max paper width and height */ 10, 10, 15, 15, /*border_left, border_right, border_top, border_bottom */ + 8, &canon_PIXMA_iP4000_slotlist, CANON_CAP_STD0|CANON_CAP_r|CANON_CAP_px /*,|CANON_CAP_I*/,0x64,control_cmd_PIXMA_iP4000, /*features */ &canon_PIXMA_iP4000_modelist, @@ -615,6 +647,7 @@ static const canon_cap_t canon_model_capabilities[] = "PIXMA iP5300", 3, /*model, model_id*/ 842, 17*72, /* max paper width and height */ 10, 10, 15, 15, /*border_left, border_right, border_top, border_bottom */ + 8, &canon_PIXMA_iP4000_slotlist, CANON_CAP_STD0|CANON_CAP_DUPLEX|CANON_CAP_r|CANON_CAP_px|CANON_CAP_I,0x64,control_cmd_PIXMA_iP4000, /*features */ &canon_PIXMA_iP5300_modelist, @@ -624,10 +657,25 @@ static const canon_cap_t canon_model_capabilities[] = NULL, NULL }, + { /* Canon PIXMA iP4600 */ + "PIXMA iP4600", 3, /*model, model_id*/ + 8.5*72, 26.625*72, /* max paper width and height */ + 10, 10, 9, 15, /*border_left, border_right, border_top, border_bottom */ + 16, + &canon_PIXMA_iP4600_slotlist, + CANON_CAP_STD0|CANON_CAP_DUPLEX|CANON_CAP_r|CANON_CAP_px|CANON_CAP_I,0x61,control_cmd_MULTIPASS_MP150, /*features */ + &canon_PIXMA_iP5300_modelist, + &canon_PIXMA_iP4600_paperlist, + NULL, + NULL, + NULL, + iP4500_channel_order + }, { /* Canon PIXMA iP4500 */ "PIXMA iP4500", 3, /*model, model_id*/ 842, 17*72, /* max paper width and height */ 10, 10, 15, 15, /*border_left, border_right, border_top, border_bottom */ + 8, &canon_PIXMA_iP4000_slotlist, CANON_CAP_STD0|CANON_CAP_DUPLEX|CANON_CAP_r|CANON_CAP_px|CANON_CAP_I,0x61,control_cmd_MULTIPASS_MP150, /*features */ &canon_PIXMA_iP5300_modelist, @@ -641,6 +689,7 @@ static const canon_cap_t canon_model_capabilities[] = "PIXMA iP4200", 3, /*model, model_id*/ 842, 17*72, /* max paper width and height */ 10, 10, 15, 15, /*border_left, border_right, border_top, border_bottom */ + 8, &canon_PIXMA_iP4000_slotlist, CANON_CAP_STD0|CANON_CAP_DUPLEX|CANON_CAP_r|CANON_CAP_px|CANON_CAP_P,0x64,control_cmd_PIXMA_iP4200, /*features */ &canon_PIXMA_iP4200_modelist, @@ -653,6 +702,7 @@ static const canon_cap_t canon_model_capabilities[] = "PIXMA iP6000", 3, /*model, model_id*/ 842, 17*72, /* max paper width and height */ 10, 10, 15, 15, /*border_left, border_right, border_top, border_bottom */ + 8, &canon_PIXMA_iP4000_slotlist, CANON_CAP_STD0|CANON_CAP_DUPLEX|CANON_CAP_r|CANON_CAP_px,0x64,control_cmd_PIXMA_iP4000, /*features */ &canon_PIXMA_iP6000_modelist, @@ -666,6 +716,7 @@ static const canon_cap_t canon_model_capabilities[] = "PIXMA iP6700", 3, /*model, model_id*/ 842, 17*72, /* max paper width and height */ 10, 10, 15, 15, /*border_left, border_right, border_top, border_bottom */ + 8, &canon_PIXMA_iP4000_slotlist, CANON_CAP_STD0|CANON_CAP_DUPLEX|CANON_CAP_r|CANON_CAP_px,0x64,control_cmd_PIXMA_iP4000, /*features */ &canon_PIXMA_iP6700_modelist, @@ -679,6 +730,7 @@ static const canon_cap_t canon_model_capabilities[] = "PIXMA iX5000", 3, /*model, model_id*/ 842, 17*72, /* max paper width and height */ 10, 10, 15, 15, /*border_left, border_right, border_top, border_bottom */ + 8, &canon_PIXMA_iP4000_slotlist, CANON_CAP_STD0|CANON_CAP_DUPLEX|CANON_CAP_r|CANON_CAP_px|CANON_CAP_I,0x61,control_cmd_PIXMA_iP4000, /*features */ &canon_PIXMA_iX5000_modelist, @@ -692,6 +744,7 @@ static const canon_cap_t canon_model_capabilities[] = "PIXMA MP520", 3, /*model, model_id*/ 842, 17*72, /* max paper width and height */ 10, 10, 15, 15, /*border_left, border_right, border_top, border_bottom */ + 8, &canon_PIXMA_iP4000_slotlist, CANON_CAP_STD0|CANON_CAP_DUPLEX|CANON_CAP_r|CANON_CAP_px|CANON_CAP_I,0x61,control_cmd_PIXMA_iP4000, /*features */ &canon_PIXMA_iX5000_modelist, @@ -705,6 +758,7 @@ static const canon_cap_t canon_model_capabilities[] = "PIXMA Pro9500", 3, /*model, model_id*/ 842, 17*72, /* max paper width and height */ 10, 10, 15, 15, /*border_left, border_right, border_top, border_bottom */ + 8, &canon_PIXMA_iP4000_slotlist, CANON_CAP_STD0|CANON_CAP_DUPLEX|CANON_CAP_r|CANON_CAP_px,0x61,control_cmd_PIXMA_iP4000, /*features */ &canon_PIXMA_Pro9500_modelist, @@ -718,6 +772,7 @@ static const canon_cap_t canon_model_capabilities[] = "PIXMA iP8500", 3, /*model, model_id*/ 842, 17*72, /* max paper width and height */ 10, 10, 15, 15, /*border_left, border_right, border_top, border_bottom */ + 8, &canon_PIXMA_iP4000_slotlist, CANON_CAP_STD0|CANON_CAP_DUPLEX|CANON_CAP_r|CANON_CAP_px,0x61,control_cmd_PIXMA_iP4000, /*features */ &canon_PIXMA_iP8500_modelist, @@ -731,6 +786,7 @@ static const canon_cap_t canon_model_capabilities[] = "PIXMA MP150", 3, /*model, model_id*/ 842, 17*72, /* max paper width and height */ 10, 10, 15, 15, /*border_left, border_right, border_top, border_bottom */ + 8, &canon_PIXMA_iP4000_slotlist, CANON_CAP_STD0|CANON_CAP_DUPLEX|CANON_CAP_r|CANON_CAP_px|CANON_CAP_I,0x61,control_cmd_MULTIPASS_MP150, /*features */ &canon_MULTIPASS_MP150_modelist, diff --git a/src/main/print-canon.c b/src/main/print-canon.c index 6e085fb..149202e 100644 --- a/src/main/print-canon.c +++ b/src/main/print-canon.c @@ -1,5 +1,5 @@ /* - * "$Id: print-canon.c,v 1.229 2008/08/06 20:46:49 faust3 Exp $" + * "$Id: print-canon.c,v 1.230 2008/12/21 10:49:50 faust3 Exp $" * * Print plug-in CANON BJL driver for the GIMP. * @@ -70,7 +70,6 @@ -#define RASTER_LINES_PER_BLOCK 8 /* number of raster lines in every F) command */ @@ -1388,7 +1387,7 @@ canon_init_setMultiRaster(const stp_vars_t *v, const canon_privdata_t *init){ return; canon_cmd(v,ESC28,0x49, 1, 0x1); /* enable MultiLine Raster? */ - canon_cmd(v,ESC28,0x4a, 1, RASTER_LINES_PER_BLOCK); /* set number of lines per raster block */ + canon_cmd(v,ESC28,0x4a, 1, init->caps->raster_lines_per_block); /* set number of lines per raster block */ /* set the color sequence */ stp_zfwrite("\033(L", 3, 1, v); @@ -1427,7 +1426,7 @@ canon_init_printer(const stp_vars_t *v, const canon_privdata_t *init) mytop= (init->top*init->mode->ydpi)/72; if(init->caps->features & CANON_CAP_I) - mytop /= RASTER_LINES_PER_BLOCK; + mytop /= init->caps->raster_lines_per_block; if(mytop) canon_cmd(v,ESC28,0x65, 2, (mytop >> 8 ),(mytop & 255)); @@ -1912,7 +1911,7 @@ 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 * RASTER_LINES_PER_BLOCK * privdata.num_channels); /* for multiraster we need to buffer 8 lines for every color */ + privdata.comp_buf = stp_zalloc(privdata.buf_length_max * 2 * caps->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); /* Allocate fold buffer */ @@ -2394,9 +2393,10 @@ static void canon_write_block(stp_vars_t* v,canon_privdata_t* pd,unsigned char* static void canon_write_multiraster(stp_vars_t *v,canon_privdata_t* pd,int y){ int i; - unsigned int max_length = 2*pd->buf_length_max * RASTER_LINES_PER_BLOCK; + int raster_lines_per_block = pd->caps->raster_lines_per_block; + unsigned int max_length = 2*pd->buf_length_max * raster_lines_per_block; /* a new raster block begins */ - if(!(y % RASTER_LINES_PER_BLOCK)){ + if(!(y % raster_lines_per_block)){ if(y != 0){ /* write finished blocks */ for(i=0;i<pd->num_channels;i++) @@ -2414,9 +2414,9 @@ static void canon_write_multiraster(stp_vars_t *v,canon_privdata_t* pd,int y){ } if(y == pd->out_height - 1){ /* we just compressed our last line */ - if(pd->out_height % RASTER_LINES_PER_BLOCK){ + if(pd->out_height % raster_lines_per_block){ /* but our raster block is not finished yet */ - int missing = RASTER_LINES_PER_BLOCK - (pd->out_height % RASTER_LINES_PER_BLOCK); /* calculate missing lines */ + int missing = raster_lines_per_block - (pd->out_height % raster_lines_per_block); /* calculate missing lines */ for(i=0;i<pd->num_channels;i++){ /* add missing empty lines and write blocks */ int x; diff --git a/src/main/print-escp2-data.c b/src/main/print-escp2-data.c index 5a51947..ec2230d 100644 --- a/src/main/print-escp2-data.c +++ b/src/main/print-escp2-data.c @@ -1,5 +1,5 @@ /* - * "$Id: print-escp2-data.c,v 1.270 2008/07/16 02:00:17 rlk Exp $" + * "$Id: print-escp2-data.c,v 1.271 2008/11/22 20:28:04 rlk Exp $" * * Print plug-in EPSON ESC/P2 driver for the GIMP. * @@ -65,6 +65,10 @@ load_model_from_file(const stp_vars_t *v, stp_mxml_node_t *xmod, int model) p->max_black_resolution = -1; p->cd_x_offset = -1; p->cd_y_offset = -1; + p->duplex_left_margin = SHRT_MIN; + p->duplex_right_margin = SHRT_MIN; + p->duplex_top_margin = SHRT_MIN; + p->duplex_bottom_margin = SHRT_MIN; while (tmp) { if (tmp->type == STP_MXML_ELEMENT) @@ -217,6 +221,7 @@ load_model_from_file(const stp_vars_t *v, stp_mxml_node_t *xmod, int model) { const char *itype = stp_mxmlElementGetAttr(tmp, "interleave"); const char *mtype = stp_mxmlElementGetAttr(tmp, "media"); + const char *dtype = stp_mxmlElementGetAttr(tmp, "duplex"); unsigned long data[4]; int i = 0; while (child && i < 4) @@ -225,8 +230,15 @@ load_model_from_file(const stp_vars_t *v, stp_mxml_node_t *xmod, int model) data[i++] = stp_xmlstrtoul(child->value.text.string); child = child->next; } - if (itype && !strcmp(itype, "soft") && - mtype && !strcmp(mtype, "sheet")) + if (dtype && !strcmp(dtype, "duplex")) + { + p->duplex_left_margin = data[0]; + p->duplex_right_margin = data[1]; + p->duplex_top_margin = data[2]; + p->duplex_bottom_margin = data[3]; + } + else if (itype && !strcmp(itype, "soft") && + mtype && !strcmp(mtype, "sheet")) { p->left_margin = data[0]; p->right_margin = data[1]; diff --git a/src/main/print-escp2.c b/src/main/print-escp2.c index 1aebc0a..096fb43 100644 --- a/src/main/print-escp2.c +++ b/src/main/print-escp2.c @@ -1,5 +1,5 @@ /* - * "$Id: print-escp2.c,v 1.414 2008/07/26 15:16:15 rlk Exp $" + * "$Id: print-escp2.c,v 1.416 2008/11/22 20:34:29 rlk Exp $" * * Print plug-in EPSON ESC/P2 driver for the GIMP. * @@ -1000,6 +1000,34 @@ escp2_quality_list(const stp_vars_t *v) return printdef->quality_list; } +static short +escp2_duplex_left_margin(const stp_vars_t *v) +{ + stpi_escp2_printer_t *printdef = stp_escp2_get_printer(v); + return printdef->duplex_left_margin; +} + +static short +escp2_duplex_right_margin(const stp_vars_t *v) +{ + stpi_escp2_printer_t *printdef = stp_escp2_get_printer(v); + return printdef->duplex_right_margin; +} + +static short +escp2_duplex_top_margin(const stp_vars_t *v) +{ + stpi_escp2_printer_t *printdef = stp_escp2_get_printer(v); + return printdef->duplex_top_margin; +} + +static short +escp2_duplex_bottom_margin(const stp_vars_t *v) +{ + stpi_escp2_printer_t *printdef = stp_escp2_get_printer(v); + return printdef->duplex_bottom_margin; +} + static const channel_count_t * get_channel_count_by_name(const char *name) { @@ -2594,6 +2622,7 @@ internal_imageable_area(const stp_vars_t *v, int use_paper_margins, int rollfeed = 0; /* Roll feed selected */ int cd = 0; /* CD selected */ const char *media_size = stp_get_string_parameter(v, "PageSize"); + const char *duplex = stp_get_string_parameter(v, "Duplex"); int left_margin = 0; int right_margin = 0; int bottom_margin = 0; @@ -2677,6 +2706,14 @@ internal_imageable_area(const stp_vars_t *v, int use_paper_margins, } } } + if (!use_maximum_area && duplex && strcmp(duplex, "None") != 0) + { + left_margin = imax(left_margin, escp2_duplex_left_margin(v)); + right_margin = imax(right_margin, escp2_duplex_right_margin(v)); + bottom_margin = imax(bottom_margin, escp2_duplex_bottom_margin(v)); + top_margin = imax(top_margin, escp2_duplex_top_margin(v)); + } + if (width > escp2_max_imageable_width(v)) width = escp2_max_imageable_width(v); if (height > escp2_max_imageable_height(v)) diff --git a/src/main/print-escp2.h b/src/main/print-escp2.h index c4a8ef9..4f27add 100644 --- a/src/main/print-escp2.h +++ b/src/main/print-escp2.h @@ -1,5 +1,5 @@ /* - * "$Id: print-escp2.h,v 1.132 2008/07/11 01:24:25 rlk Exp $" + * "$Id: print-escp2.h,v 1.133 2008/11/22 20:28:04 rlk Exp $" * * Print plug-in EPSON ESC/P2 driver for the GIMP. * @@ -401,6 +401,11 @@ typedef struct escp2_printer short m_roll_right_margin; /* Right margin, points */ short m_roll_top_margin; /* Absolute top margin, points */ short m_roll_bottom_margin; /* Absolute bottom margin, points */ + /* Duplex margin limit (SHRT_MIN = no limit): */ + short duplex_left_margin; /* Left margin, points */ + short duplex_right_margin; /* Right margin, points */ + short duplex_top_margin; /* Absolute top margin, points */ + short duplex_bottom_margin; /* Absolute bottom margin, points */ /* Print directly to CD */ short cd_x_offset; /* Center of CD (horizontal offset) */ short cd_y_offset; /* Center of CD (vertical offset) */ @@ -609,5 +614,5 @@ extern void stpi_escp2_terminate_page(stp_vars_t *v); #endif /* GUTENPRINT_INTERNAL_ESCP2_H */ /* - * End of "$Id: print-escp2.h,v 1.132 2008/07/11 01:24:25 rlk Exp $". + * End of "$Id: print-escp2.h,v 1.133 2008/11/22 20:28:04 rlk Exp $". */ |