summaryrefslogtreecommitdiff
path: root/src/main/escp2-driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/escp2-driver.c')
-rw-r--r--src/main/escp2-driver.c39
1 files changed, 15 insertions, 24 deletions
diff --git a/src/main/escp2-driver.c b/src/main/escp2-driver.c
index abaac0f..fe964ec 100644
--- a/src/main/escp2-driver.c
+++ b/src/main/escp2-driver.c
@@ -1,5 +1,5 @@
/*
- * "$Id: escp2-driver.c,v 1.54 2008/07/26 23:15:47 rlk Exp $"
+ * "$Id: escp2-driver.c,v 1.56 2010/06/26 20:02:02 rlk Exp $"
*
* Print plug-in EPSON ESC/P2 driver for the GIMP.
*
@@ -54,7 +54,7 @@ escp2_reset_printer(stp_vars_t *v)
* packet mode.
*/
if (pd->preinit_sequence)
- stp_zfwrite(pd->preinit_sequence->data, pd->preinit_sequence->bytes, 1, v);
+ stp_write_raw(pd->preinit_sequence, v);
stp_send_command(v, "\033@", "");
}
@@ -226,24 +226,20 @@ escp2_set_remote_sequence(stp_vars_t *v)
pd->input_slot->roll_feed_cut_flags == ROLL_FEED_CUT_ALL)
stp_send_command(v, "JS", "bh", 0);
if (pd->preinit_remote_sequence)
- stp_zfwrite(pd->preinit_remote_sequence->data,
- pd->preinit_remote_sequence->bytes, 1, v);
+ stp_write_raw(pd->preinit_remote_sequence, v);
if (stp_check_int_parameter(pv, "FeedAdjustment", STP_PARAMETER_ACTIVE))
stp_send_command(v, "SN", "bccc", 0, 4,
stp_get_int_parameter(pv, "FeedAdjustment"));
if (stp_check_int_parameter(pv, "VacuumIntensity", STP_PARAMETER_ACTIVE))
stp_send_command(v, "SN", "bccc", 0, 5,
stp_get_int_parameter(pv, "VacuumIntensity"));
- if (stp_check_int_parameter(pv, "ScanDryTime", STP_PARAMETER_ACTIVE))
- stp_send_command(v, "DR", "bcch", 0, 1,
- (int) stp_get_float_parameter(pv, "ScanDryTime") * 1000);
- if (stp_check_int_parameter(pv, "ScanMinDryTime", STP_PARAMETER_ACTIVE))
- {
- stp_send_command(v, "DR", "bcccc", 0, 0x41, 0xff, 0xff);
- stp_send_command(v, "DR", "bcch", 0, 1,
- (int) stp_get_float_parameter(pv, "ScanMinDryTime") * 1000);
- }
- if (stp_check_int_parameter(pv, "PageDryTime", STP_PARAMETER_ACTIVE))
+ if (stp_check_float_parameter(pv, "ScanDryTime", STP_PARAMETER_ACTIVE))
+ stp_send_command(v, "DR", "bcch", 0, 0,
+ (int) (stp_get_float_parameter(pv, "ScanDryTime") * 1000));
+ if (stp_check_float_parameter(pv, "ScanMinDryTime", STP_PARAMETER_ACTIVE))
+ stp_send_command(v, "DR", "bcch", 0, 0x40,
+ (int) (stp_get_float_parameter(pv, "ScanMinDryTime") * 1000));
+ if (stp_check_float_parameter(pv, "PageDryTime", STP_PARAMETER_ACTIVE))
stp_send_command(v, "DR", "bcch", 0, 1,
(int) stp_get_float_parameter(pv, "PageDryTime"));
/* Next comes paper path */
@@ -252,8 +248,7 @@ escp2_set_remote_sequence(stp_vars_t *v)
int divisor = pd->base_separation / 360;
int height = pd->page_true_height * 5 / divisor;
if (pd->input_slot->init_sequence)
- stp_zfwrite(pd->input_slot->init_sequence->data,
- pd->input_slot->init_sequence->bytes, 1, v);
+ stp_write_raw(pd->input_slot->init_sequence, v);
switch (pd->input_slot->roll_feed_cut_flags)
{
case ROLL_FEED_CUT_ALL:
@@ -297,9 +292,7 @@ escp2_set_remote_sequence(stp_vars_t *v)
stp_send_command(v, "FP", "bch", 0,
(unsigned short) -pd->zero_margin_offset);
if (pd->borderless_sequence)
- stp_zfwrite(pd->borderless_sequence->data,
- pd->borderless_sequence->bytes,
- 1, v);
+ stp_write_raw(pd->borderless_sequence, v);
}
/* Exit remote mode */
@@ -344,7 +337,7 @@ escp2_set_printer_weave(stp_vars_t *v)
{
escp2_privdata_t *pd = get_privdata(v);
if (pd->printer_weave)
- stp_zfwrite(pd->printer_weave->data, pd->printer_weave->bytes, 1, v);
+ stp_write_raw(pd->printer_weave, v);
else
stp_send_command(v, "\033(i", "bc", 0);
}
@@ -635,15 +628,13 @@ stpi_escp2_deinit_printer(stp_vars_t *v)
{
stp_send_command(v, "\033(R", "bcs", 0, "REMOTE1");
if (pd->input_slot && pd->input_slot->deinit_sequence)
- stp_zfwrite(pd->input_slot->deinit_sequence->data,
- pd->input_slot->deinit_sequence->bytes, 1, v);
+ stp_write_raw(pd->input_slot->deinit_sequence, v);
/* Load settings from NVRAM */
stp_send_command(v, "LD", "b");
/* Magic deinit sequence reported by Simone Falsini */
if (pd->deinit_remote_sequence)
- stp_zfwrite(pd->deinit_remote_sequence->data,
- pd->deinit_remote_sequence->bytes, 1, v);
+ stp_write_raw(pd->deinit_remote_sequence, v);
/* Exit remote mode */
stp_send_command(v, "\033", "ccc", 0, 0, 0);
}