summaryrefslogtreecommitdiff
path: root/src/main/print-canon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/print-canon.c')
-rw-r--r--src/main/print-canon.c197
1 files changed, 116 insertions, 81 deletions
diff --git a/src/main/print-canon.c b/src/main/print-canon.c
index 4405fae..6ba401a 100644
--- a/src/main/print-canon.c
+++ b/src/main/print-canon.c
@@ -19,8 +19,7 @@
* 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.
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/*
@@ -259,18 +258,18 @@ typedef struct
double cd_outer_radius;
} canon_privdata_t;
-const canon_modeuse_t* select_media_modes(stp_vars_t *v, const canon_paper_t* media_type,const canon_modeuselist_t* mlist);
-int compare_mode_valid(stp_vars_t *v,const canon_mode_t* mode,const canon_modeuse_t* muse, const canon_modeuselist_t* mlist);
-const canon_mode_t* suitable_mode_monochrome(stp_vars_t *v,const canon_modeuse_t* muse,const canon_cap_t *caps,int quality,const char *duplex_mode);
-const canon_mode_t* find_first_matching_mode_monochrome(stp_vars_t *v,const canon_modeuse_t* muse,const canon_cap_t *caps,const char *duplex_mode);
-const canon_mode_t* find_first_matching_mode(stp_vars_t *v,const canon_modeuse_t* muse,const canon_cap_t *caps,const char *duplex_mode);
-const canon_mode_t* suitable_mode_color(stp_vars_t *v,const canon_modeuse_t* muse,const canon_cap_t *caps,int quality,const char *duplex_mode);
-const canon_mode_t* find_first_matching_mode_color(stp_vars_t *v,const canon_modeuse_t* muse,const canon_cap_t *caps,const char *duplex_mode);
-const canon_mode_t* suitable_mode_photo(stp_vars_t *v,const canon_modeuse_t* muse,const canon_cap_t *caps,int quality,const char *duplex_mode);
-const canon_mode_t* find_first_matching_mode_photo(stp_vars_t *v,const canon_modeuse_t* muse,const canon_cap_t *caps,const char *duplex_mode);
-const canon_mode_t* suitable_mode_general(stp_vars_t *v,const canon_modeuse_t* muse,const canon_cap_t *caps,int quality,const char *duplex_mode);
-const char* find_ink_type(stp_vars_t *v,const canon_mode_t* mode,const char *printing_mode);
-const canon_mode_t* canon_check_current_mode(stp_vars_t *v);
+static const canon_modeuse_t* select_media_modes(stp_vars_t *v, const canon_paper_t* media_type,const canon_modeuselist_t* mlist);
+static int compare_mode_valid(stp_vars_t *v,const canon_mode_t* mode,const canon_modeuse_t* muse, const canon_modeuselist_t* mlist);
+static const canon_mode_t* suitable_mode_monochrome(stp_vars_t *v,const canon_modeuse_t* muse,const canon_cap_t *caps,int quality,const char *duplex_mode);
+static const canon_mode_t* find_first_matching_mode_monochrome(stp_vars_t *v,const canon_modeuse_t* muse,const canon_cap_t *caps,const char *duplex_mode);
+static const canon_mode_t* find_first_matching_mode(stp_vars_t *v,const canon_modeuse_t* muse,const canon_cap_t *caps,const char *duplex_mode);
+static const canon_mode_t* suitable_mode_color(stp_vars_t *v,const canon_modeuse_t* muse,const canon_cap_t *caps,int quality,const char *duplex_mode);
+static const canon_mode_t* find_first_matching_mode_color(stp_vars_t *v,const canon_modeuse_t* muse,const canon_cap_t *caps,const char *duplex_mode);
+static const canon_mode_t* suitable_mode_photo(stp_vars_t *v,const canon_modeuse_t* muse,const canon_cap_t *caps,int quality,const char *duplex_mode);
+static const canon_mode_t* find_first_matching_mode_photo(stp_vars_t *v,const canon_modeuse_t* muse,const canon_cap_t *caps,const char *duplex_mode);
+static const canon_mode_t* suitable_mode_general(stp_vars_t *v,const canon_modeuse_t* muse,const canon_cap_t *caps,int quality,const char *duplex_mode);
+static const char* find_ink_type(stp_vars_t *v,const canon_mode_t* mode,const char *printing_mode);
+static const canon_mode_t* canon_check_current_mode(stp_vars_t *v);
static void canon_write_line(stp_vars_t *v);
@@ -547,6 +546,8 @@ static const char* canon_families[] = {
"PIXMA MPC", /* 16 */
"PIXMA G", /* 17 */
"PIXMA TS", /* 18 */
+ "PIXMA TR", /* 19 */
+ "PIXMA XK", /* 20 */
};
/* canon model ids look like the following
@@ -2555,15 +2556,17 @@ canon_printhead_colors(const stp_vars_t*v)
static unsigned char
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),
+ const stp_papersize_list_t *list = stpi_get_standard_papersize_list();
+ const stp_papersize_t *pp = stpi_get_papersize_by_size(list,
+ stp_get_page_height(v),
stp_get_page_width(v));
- stp_deprintf(STP_DBG_CANON,"canon: entered canon_size_type\n");
+ stp_dprintf(STP_DBG_CANON, v,"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);
+ stp_dprintf(STP_DBG_CANON, v,"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;
@@ -2664,9 +2667,9 @@ canon_size_type(const stp_vars_t *v, const canon_cap_t * caps)
/* custom */
- stp_deprintf(STP_DBG_CANON,"canon: Unknown paper size '%s' - using custom\n",name);
+ stp_dprintf(STP_DBG_CANON, v,"canon: Unknown paper size '%s' - using custom\n",name);
} else {
- stp_deprintf(STP_DBG_CANON,"canon: Couldn't look up paper size %fx%f - "
+ stp_dprintf(STP_DBG_CANON, v,"canon: Couldn't look up paper size %fx%f - "
"using custom\n",stp_get_page_height(v), stp_get_page_width(v));
}
return 0;
@@ -2861,7 +2864,6 @@ canon_parameters(const stp_vars_t *v, const char *name,
{
const char* input_slot = stp_get_string_parameter(v, "InputSlot");
unsigned int height_limit, width_limit;
- int papersizes = stp_known_papersizes();
description->bounds.str = stp_string_list_create();
width_limit = caps->max_width;
@@ -2875,17 +2877,23 @@ canon_parameters(const stp_vars_t *v, const char *name,
stp_string_list_add_string
(description->bounds.str, "CDCustom", _("CD - Custom"));
}else{
- for (i = 0; i < papersizes; i++) {
- const stp_papersize_t *pt = stp_get_papersize_by_index(i);
- if (pt->paper_size_type != PAPERSIZE_TYPE_STANDARD &&
- pt->paper_size_type != PAPERSIZE_TYPE_ENVELOPE)
- continue;
- if (strlen(pt->name) > 0 &&
- pt->width <= width_limit && pt->height <= height_limit){
- stp_string_list_add_string(description->bounds.str,
- pt->name, gettext(pt->text));
- }
- }
+ const stp_papersize_list_t *paper_sizes =
+ stpi_get_standard_papersize_list();
+ const stp_papersize_list_item_t *ptli =
+ stpi_papersize_list_get_start(paper_sizes);
+ while (ptli)
+ {
+ const stp_papersize_t *pt = stpi_paperlist_item_get_data(ptli);
+ if (pt->paper_size_type == PAPERSIZE_TYPE_STANDARD ||
+ pt->paper_size_type == PAPERSIZE_TYPE_ENVELOPE) {
+ if (strlen(pt->name) > 0 &&
+ pt->width <= width_limit && pt->height <= height_limit){
+ stp_string_list_add_string(description->bounds.str,
+ pt->name, gettext(pt->text));
+ }
+ }
+ ptli = stpi_paperlist_item_next(ptli);
+ }
}
description->deflt.str =
stp_string_list_param(description->bounds.str, 0)->name;
@@ -2959,7 +2967,7 @@ canon_parameters(const stp_vars_t *v, const char *name,
#endif
stp_string_list_add_string(description->bounds.str,
caps->modelist->modes[i].name, gettext(caps->modelist->modes[i].text));
- stp_deprintf(STP_DBG_CANON,"supports mode '%s'\n",
+ stp_dprintf(STP_DBG_CANON, v,"supports mode '%s'\n",
caps->modelist->modes[i].name);
if(i == caps->modelist->default_mode)
description->deflt.str=caps->modelist->modes[i].name;
@@ -3310,7 +3318,7 @@ internal_imageable_area(const stp_vars_t *v, /* I */
const canon_cap_t * caps= canon_get_model_capabilities(v);
if (media_size)
- pt = stp_get_papersize_by_name(media_size);
+ pt = stp_describe_papersize(v, media_size);
if(input_slot && !strcmp(input_slot,"CD"))
cd = 1;
@@ -3473,7 +3481,7 @@ canon_cmd(const stp_vars_t *v, /* I - the printer */
stp_free(buffer);
}
-#define PUT(WHAT,VAL,RES) stp_deprintf(STP_DBG_CANON,"canon: "WHAT\
+#define PUT(V,WHAT,VAL,RES) stp_dprintf(STP_DBG_CANON,V,"canon: "WHAT \
" is %04x =% 5d = %f\" = %f mm\n",(VAL),(VAL),(VAL)/(1.*RES),(VAL)/(RES/25.4))
#define ESC28 "\033\050"
@@ -3573,10 +3581,24 @@ canon_init_setColor(const stp_vars_t *v, const canon_privdata_t *init)
if (init->used_inks == CANON_INK_K)
arg_63[0]|= 0x01; /* PRINT_COLOUR */
- arg_63[1] = ((init->pt ? init->pt->media_code_c : 0) << 4) /* PRINT_MEDIA */
- + 1; /* hardcode to High quality for now */ /* PRINT_QUALITY */
- canon_cmd(v,ESC28,0x63, 2, arg_63[0], arg_63[1]);
+// if ( (!strcmp(init->caps->name,"85")) || (!strcmp(init->caps->name,"1000")) ) /* BJC-85, BJC-1000 */
+// arg_63[1] = (init->pt) ? init->pt->media_code_c : 0; /* print media type */
+// else /* original, not sure which models follow this at all */
+ arg_63[1] = ((init->pt ? init->pt->media_code_c : 0) << 4) /* PRINT_MEDIA */
+ + 1; /* hardcode to High quality for now */ /* PRINT_QUALITY */
+
+ if (!strcmp(init->caps->name,"2100")) { /* BJC-2100: ESC (c command length is 3 */
+ if (!strcmp(init->mode->name,"720x360dpi"))
+ arg_63[1] = 0x00;
+ else if (!strcmp(init->mode->name,"360x360dpi_draft"))
+ arg_63[1] = 0x00;
+ else if (!strcmp(init->mode->name,"180x180dpi"))
+ arg_63[1] = 0x02;
+ /* else keep at 01 hard-coded as above - logic unknown */
+ canon_cmd(v,ESC28,0x63, 3, arg_63[0], arg_63[1], 0x00);
+ } else /* length 2 in legacy code */
+ canon_cmd(v,ESC28,0x63, 2, arg_63[0], arg_63[1]);
break;
case 2: /* are any models using this? */
@@ -3694,7 +3716,19 @@ canon_init_setTray(const stp_vars_t *v, const canon_privdata_t *init)
if ( (!strcmp(init->caps->name,"PIXMA MP710")) || (!strcmp(init->caps->name,"PIXMA MP740")) )
arg_6c_3 = 0x10;
- if (init->pt) arg_6c_2 = init->pt->media_code_l;
+ switch ( init->caps->model_id ) {
+ case 0:
+ break;
+ case 1:
+ if (init->pt) arg_6c_2 = ((init->pt ? init->pt->media_code_l : 0) << 4); /* PRINT_MEDIA */
+ break;
+ case 2:
+ break;
+ case 3:
+ if (init->pt) arg_6c_2 = init->pt->media_code_l; /* PRINT_MEDIA */
+ break;
+ }
+
/* select between length 2 and 3 byte variations of command */
/*if(init->caps->model_id >= 3)*/
if(init->caps->ESC_l_len == 3)
@@ -4426,7 +4460,7 @@ canon_init_setESC_P(const stp_vars_t *v, const canon_privdata_t *init)
return;
/* if (media_size)
- pt = stp_get_papersize_by_name(media_size); */
+ pt = stp_describe_papersize(v, media_size); */
stp_default_media_size(v, &width, &length);
if (tray_upper || tray_lower)
tray_user_select=1;
@@ -4440,7 +4474,7 @@ canon_init_setESC_P(const stp_vars_t *v, const canon_privdata_t *init)
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; /* media size: 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);
+ stp_dprintf(STP_DBG_CANON, v,"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; /* media type: set to plain as default */
arg_ESCP_5 = 0x01; /* default for portrait orientation */
arg_ESCP_6 = 0x00; /* default for portrait orientation */
@@ -4589,7 +4623,7 @@ canon_init_setESC_P(const stp_vars_t *v, const canon_privdata_t *init)
if ( !(strcmp(init->caps->name,"PIXMA TS8000")) ) {
arg_ESCP_1 = 0xbc;
}
-
+
}
}
/* 850i: CD Tray custom: none --- no ESC (P */
@@ -4876,7 +4910,7 @@ canon_init_setESC_P(const stp_vars_t *v, const canon_privdata_t *init)
canon_cmd( v,ESC28,0x50,2,0x00,arg_ESCP_1 );
}
else /* error in definition */
- stp_deprintf(STP_DBG_CANON,"SEVERE BUG IN print-canon.c::canon_init_setESC_P() "
+ stp_dprintf(STP_DBG_CANON, v,"SEVERE BUG IN print-canon.c::canon_init_setESC_P() "
"ESC_P_len=%d!!\n",init->caps->ESC_P_len);
}
@@ -5054,7 +5088,7 @@ canon_init_setX72(const stp_vars_t *v, const canon_privdata_t *init)
canon_cmd(v,ESC28,0x72, 3, 0x63, 1, 0); /* whatever for - S200 needs it */
/* probably to set the print direction of the head */
}
- else if ( !(strcmp(init->caps->name,"S820")) || !(strcmp(init->caps->name,"S900")) || !(strcmp(init->caps->name,"i950")) || !(strcmp(init->caps->name,"i960")) || !(strcmp(init->caps->name,"i9100")) || !(strcmp(init->caps->name,"i9900")) || !(strcmp(init->caps->name,"PIXMA iP7100")) || !(strcmp(init->caps->name,"PIXMA iP8100")) || !(strcmp(init->caps->name,"PIXMA iP8500")) || !(strcmp(init->caps->name,"PIXMA iP8600")) || !(strcmp(init->caps->name,"PIXMA iP9910")) || !(strcmp(init->caps->name,"PIXMA MP900")) || !(strcmp(init->caps->name,"PIXMA Pro9000")) || !(strcmp(init->caps->name,"PIXMA Pro9002")) || !(strcmp(init->caps->name,"PIXMA Pro9500")) || !(strcmp(init->caps->name,"PIXMA Pro9502")) ) {
+ else if ( !(strcmp(init->caps->name,"S820")) || !(strcmp(init->caps->name,"S900")) || !(strcmp(init->caps->name,"S9000")) || !(strcmp(init->caps->name,"i950")) || !(strcmp(init->caps->name,"i960")) || !(strcmp(init->caps->name,"i9100")) || !(strcmp(init->caps->name,"i9900")) || !(strcmp(init->caps->name,"PIXMA iP7100")) || !(strcmp(init->caps->name,"PIXMA iP8100")) || !(strcmp(init->caps->name,"PIXMA iP8500")) || !(strcmp(init->caps->name,"PIXMA iP8600")) || !(strcmp(init->caps->name,"PIXMA iP9910")) || !(strcmp(init->caps->name,"PIXMA MP900")) || !(strcmp(init->caps->name,"PIXMA Pro9000")) || !(strcmp(init->caps->name,"PIXMA Pro9002")) || !(strcmp(init->caps->name,"PIXMA Pro9500")) || !(strcmp(init->caps->name,"PIXMA Pro9502")) ) {
canon_cmd(v,ESC28,0x72, 2, 0x62, 0); /* 2 bytes */
}
/* CD mode only */
@@ -5705,7 +5739,8 @@ static void setup_page(stp_vars_t* v,canon_privdata_t* privdata){
#if 0
/* needed in workaround for Oufuku Hagaki */
- const stp_papersize_t *pp = stp_get_papersize_by_size(stp_get_page_height(v),
+ const stp_papersize_t *pp = stpi_get_papersize_by_size(v,
+ stp_get_page_height(v),
stp_get_page_width(v));
if (pp)
@@ -5745,8 +5780,8 @@ static void setup_page(stp_vars_t* v,canon_privdata_t* privdata){
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_dprintf(STP_DBG_CANON, v,"stp_get_width: privdata->out_width is %i\n",privdata->out_width);
+ stp_dprintf(STP_DBG_CANON, v,"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)
@@ -6017,21 +6052,21 @@ canon_do_print(stp_vars_t *v, stp_image_t *image)
* Convert image size to printer resolution...
*/
#if 0
- stp_deprintf(STP_DBG_CANON,"canon_do_print: unused image_width is %i pts(?)\n",image_width);
+ stp_dprintf(STP_DBG_CANON, v,"canon_do_print: unused image_width is %i pts(?)\n",image_width);
#endif
- stp_deprintf(STP_DBG_CANON,"canon_do_print: privdata.out_width is %i pts\n",privdata.out_width);
- stp_deprintf(STP_DBG_CANON,"canon_do_print: privdata.out_height is %i pts\n",privdata.out_height);
- stp_deprintf(STP_DBG_CANON,"canon_do_print: privdata.left is %i pts\n",privdata.left);
+ stp_dprintf(STP_DBG_CANON, v,"canon_do_print: privdata.out_width is %i pts\n",privdata.out_width);
+ stp_dprintf(STP_DBG_CANON, v,"canon_do_print: privdata.out_height is %i pts\n",privdata.out_height);
+ stp_dprintf(STP_DBG_CANON, v,"canon_do_print: privdata.left is %i pts\n",privdata.left);
privdata.out_width = privdata.mode->xdpi * privdata.out_width / 72;
privdata.out_height = privdata.mode->ydpi * privdata.out_height / 72;
privdata.left = privdata.mode->xdpi * privdata.left / 72;
- stp_deprintf(STP_DBG_CANON,"canon_do_print: privdata.out_width is %i dots\n",privdata.out_width);
- stp_deprintf(STP_DBG_CANON,"canon_do_print: privdata.out_height is %i dots\n",privdata.out_height);
- stp_deprintf(STP_DBG_CANON,"canon_do_print: privdata.left is %i dots\n",privdata.left);
+ stp_dprintf(STP_DBG_CANON, v,"canon_do_print: privdata.out_width is %i dots\n",privdata.out_width);
+ stp_dprintf(STP_DBG_CANON, v,"canon_do_print: privdata.out_height is %i dots\n",privdata.out_height);
+ stp_dprintf(STP_DBG_CANON, v,"canon_do_print: privdata.left is %i dots\n",privdata.left);
- stp_deprintf(STP_DBG_CANON,"density is %f\n",
+ stp_dprintf(STP_DBG_CANON, v,"density is %f\n",
stp_get_float_parameter(v, "Density"));
/*
@@ -6055,7 +6090,7 @@ canon_do_print(stp_vars_t *v, stp_image_t *image)
stp_scale_float_parameter(v, "Gamma", 1.25);
stp_scale_float_parameter( v, "Gamma", privdata.mode->gamma );
- stp_deprintf(STP_DBG_CANON,"density is %f\n",
+ stp_dprintf(STP_DBG_CANON, v,"density is %f\n",
stp_get_float_parameter(v, "Density"));
if(privdata.used_inks & CANON_INK_CMYK_MASK)
@@ -6070,23 +6105,23 @@ canon_do_print(stp_vars_t *v, stp_image_t *image)
privdata.length = (privdata.out_width + 7) / 8;
- stp_deprintf(STP_DBG_CANON,"privdata.length is %i\n",privdata.length);
- stp_deprintf(STP_DBG_CANON,"canon_do_print: privdata.num_channels is %i\n",privdata.num_channels);
+ stp_dprintf(STP_DBG_CANON, v,"privdata.length is %i\n",privdata.length);
+ stp_dprintf(STP_DBG_CANON, v,"canon_do_print: privdata.num_channels is %i\n",privdata.num_channels);
stp_dither_init(v, image, privdata.out_width, privdata.mode->xdpi, privdata.mode->ydpi);
- stp_deprintf(STP_DBG_CANON,"privdata.out_width is %i (after stp_dither_init)\n",privdata.out_width);
- stp_deprintf(STP_DBG_CANON,"privdata.length is %i (after stp_dither_init)\n",privdata.length);
- stp_deprintf(STP_DBG_CANON,"canon_do_print: privdata.num_channels is %i (after stp_dither_init)\n",privdata.num_channels);
+ stp_dprintf(STP_DBG_CANON, v,"privdata.out_width is %i (after stp_dither_init)\n",privdata.out_width);
+ stp_dprintf(STP_DBG_CANON, v,"privdata.length is %i (after stp_dither_init)\n",privdata.length);
+ stp_dprintf(STP_DBG_CANON, v,"canon_do_print: privdata.num_channels is %i (after stp_dither_init)\n",privdata.num_channels);
canon_setup_channels(v,&privdata);
- stp_deprintf(STP_DBG_CANON,"privdata.out_width is %i (after canon_setup_channels)\n",privdata.out_width);
- stp_deprintf(STP_DBG_CANON,"privdata.length is %i (after canon_setup_channels)\n",privdata.length);
- stp_deprintf(STP_DBG_CANON,"canon_do_print: privdata.num_channels is %i (after canon_setup_channels)\n",privdata.num_channels);
+ stp_dprintf(STP_DBG_CANON, v,"privdata.out_width is %i (after canon_setup_channels)\n",privdata.out_width);
+ stp_dprintf(STP_DBG_CANON, v,"privdata.length is %i (after canon_setup_channels)\n",privdata.length);
+ stp_dprintf(STP_DBG_CANON, v,"canon_do_print: privdata.num_channels is %i (after canon_setup_channels)\n",privdata.num_channels);
- stp_deprintf(STP_DBG_CANON,
+ stp_dprintf(STP_DBG_CANON, v,
"canon: driver will use colors %s\n",privdata.channel_order);
/* Allocate compression buffer */
@@ -6134,9 +6169,9 @@ canon_do_print(stp_vars_t *v, stp_image_t *image)
else
privdata.physical_xdpi = 720;
- stp_deprintf(STP_DBG_CANON,"canon: adjust leftskip: old=%d,\n", privdata.left);
+ stp_dprintf(STP_DBG_CANON, v,"canon: adjust leftskip: old=%d,\n", privdata.left);
privdata.left = (int)( (float)privdata.left * (float)privdata.physical_xdpi / (float)privdata.mode->xdpi ); /* adjust left margin */
- stp_deprintf(STP_DBG_CANON,"canon: adjust leftskip: new=%d,\n", privdata.left);
+ stp_dprintf(STP_DBG_CANON, v,"canon: adjust leftskip: new=%d,\n", privdata.left);
privdata.ncolors = 4;
privdata.head_offset = stp_zalloc(sizeof(int) * privdata.ncolors);
@@ -6180,7 +6215,7 @@ canon_do_print(stp_vars_t *v, stp_image_t *image)
privdata.bidirectional = 1; /* 1: bidirectional; 0: unidirectional printing */
privdata.direction = 1;
stp_allocate_component_data(v, "Driver", NULL, NULL, &privdata);
- stp_deprintf(STP_DBG_CANON,"canon: initializing weaving: nozzles=%d, nozzle_separation=%d,\n"
+ stp_dprintf(STP_DBG_CANON, v,"canon: initializing weaving: nozzles=%d, nozzle_separation=%d,\n"
"horizontal_passes=%d, vertical_passes=%d,vertical_oversample=%d,\n"
"ncolors=%d, out_width=%d, out_height=%d\n"
"weave_top=%d, weave_page_height=%d \n"
@@ -6205,7 +6240,7 @@ canon_do_print(stp_vars_t *v, stp_image_t *image)
canon_flush_pass,
stp_fill_uncompressed,
stp_pack_uncompressed,
- stp_compute_uncompressed_linewidth);
+ stp_compute_tiff_linewidth);
privdata.last_pass_offset = 0;
if (stp_get_debug_level() & STP_DBG_CANON) {
@@ -6327,7 +6362,7 @@ canon_do_print(stp_vars_t *v, stp_image_t *image)
*/
if (privdata.delay_max) {
- stp_deprintf(STP_DBG_CANON,"\ncanon: flushing %d possibly delayed buffers\n",
+ stp_dprintf(STP_DBG_CANON, v,"\ncanon: flushing %d possibly delayed buffers\n",
privdata.delay_max);
for (y= 0; y<privdata.delay_max; y++) {
@@ -6377,7 +6412,6 @@ canon_print(const stp_vars_t *v, stp_image_t *image)
{
int status;
stp_vars_t *nv = stp_vars_create_copy(v);
- stp_prune_inactive_options(nv);
status = canon_do_print(nv, image);
stp_vars_destroy(nv);
return status;
@@ -6397,7 +6431,8 @@ static const stp_printfuncs_t print_canon_printfuncs =
stp_verify_printer_params,
canon_start_job,
canon_end_job,
- NULL
+ NULL,
+ stpi_standard_describe_papersize
};
static void
@@ -6506,7 +6541,7 @@ static int canon_compress(stp_vars_t *v, canon_privdata_t *pd, unsigned char* li
in_ptr[0] = 0;
}
else
- stp_deprintf(STP_DBG_CANON,"SEVERE BUG IN print-canon.c::canon_write() "
+ stp_dprintf(STP_DBG_CANON, v,"SEVERE BUG IN print-canon.c::canon_write() "
"bitoffset=%d!!\n",bitoffset);
}
@@ -6661,7 +6696,7 @@ canon_advance_paper(stp_vars_t *v, int advance)
if ( advance > 0 )
{
int a0, a1, a2, a3;
- stp_deprintf(STP_DBG_CANON," --advance paper %d\n", advance);
+ stp_dprintf(STP_DBG_CANON, v," --advance paper %d\n", advance);
a0 = advance & 0xff;
a1 = (advance >> 8) & 0xff;
a2 = (advance >> 16) & 0xff;
@@ -6684,7 +6719,7 @@ canon_flush_pass(stp_vars_t *v, int passno, int vertical_subpass)
int color, line, written = 0, linelength = 0, lines = 0;
int idx[4]={3, 0, 1, 2}; /* color numbering is different between canon_write and weaving */
- stp_deprintf(STP_DBG_CANON,"canon_flush_pass: ----pass=%d,---- \n", passno);
+ stp_dprintf(STP_DBG_CANON, v,"canon_flush_pass: ----pass=%d,---- \n", passno);
(pd->emptylines) = 0;
for ( color = 0; color < pd->ncolors; color++ ) /* find max. linecount */
@@ -6695,7 +6730,7 @@ canon_flush_pass(stp_vars_t *v, int passno, int vertical_subpass)
for ( line = 0; line < lines; line++ ) /* go through each nozzle f that pass */
{
- stp_deprintf(STP_DBG_CANON," --line=%d\n", line);
+ stp_dprintf(STP_DBG_CANON, v," --line=%d\n", line);
if ( written > 0 )
canon_cmd(v,ESC28,0x65, 2, 0, 1); /* go to next nozzle*/
@@ -6709,7 +6744,7 @@ canon_flush_pass(stp_vars_t *v, int passno, int vertical_subpass)
if ( lineactive[0].v[color] > 0 )
{
linelength = lineoffs[0].v[color] / linecount[0].v[color];
-/* stp_deprintf(STP_DBG_CANON,"canon_flush_pass: linelength=%d, bufs[0].v[color]=%p,"
+/* stp_dprintf(STP_DBG_CANON, v,"canon_flush_pass: linelength=%d, bufs[0].v[color]=%p,"
"bufs[0].v[color]+line * linelength=%p, empty=%d \n", linelength, bufs[0].v[color],
bufs[0].v[color] + line * linelength, (pd->emptylines));
*/
@@ -6721,7 +6756,7 @@ canon_flush_pass(stp_vars_t *v, int passno, int vertical_subpass)
{
pd->direction = (pd->direction +1) & 1;
canon_set_X72(v, pd->direction);
- stp_deprintf(STP_DBG_CANON," --set direction %d\n", pd->direction);
+ stp_dprintf(STP_DBG_CANON, v," --set direction %d\n", pd->direction);
}
}
@@ -6730,7 +6765,7 @@ canon_flush_pass(stp_vars_t *v, int passno, int vertical_subpass)
linelength, idx[color],
&(pd->emptylines), pd->out_width,
pd->left, pd->weave_bits[color],0);
- if (written) stp_deprintf(STP_DBG_CANON," --written color %d,\n", color);
+ if (written) stp_dprintf(STP_DBG_CANON, v," --written color %d,\n", color);
}
}
@@ -6745,7 +6780,7 @@ canon_flush_pass(stp_vars_t *v, int passno, int vertical_subpass)
lineoffs[0].v[color] = 0;
linecount[0].v[color] = 0;
}
- stp_deprintf(STP_DBG_CANON," --ended-- with empty=%d \n", (pd->emptylines));
+ stp_dprintf(STP_DBG_CANON, v," --ended-- with empty=%d \n", (pd->emptylines));
}
static stp_family_t print_canon_module_data =
@@ -6758,14 +6793,14 @@ static stp_family_t print_canon_module_data =
static int
print_canon_module_init(void)
{
- return stp_family_register(print_canon_module_data.printer_list);
+ return stpi_family_register(print_canon_module_data.printer_list);
}
static int
print_canon_module_exit(void)
{
- return stp_family_unregister(print_canon_module_data.printer_list);
+ return stpi_family_unregister(print_canon_module_data.printer_list);
}