summaryrefslogtreecommitdiff
path: root/pcl/pccprint.c
diff options
context:
space:
mode:
authorJan Stockenius <jan@ghostscript.com>1998-09-04 02:34:39 +0000
committerJan Stockenius <jan@ghostscript.com>1998-09-04 02:34:39 +0000
commit285a4c1dc6f3aa48868a14a9567a9307931d7a6b (patch)
treeb0e0f8b291b4048555ee765b2731beba5a988b1d /pcl/pccprint.c
parentd2b8b3082e84a6514e30fe0f78f256a11fc00c55 (diff)
Modified the code for the pixel placement operator for the new manner
in which pixel placement information is kept in the PCL state. Modified the pccprint_do_reset routine to support overlay macros. git-svn-id: http://svn.ghostscript.com/ghostpcl/trunk/ghostpcl@390 06663e23-700e-0410-b217-a244a6096597
Diffstat (limited to 'pcl/pccprint.c')
-rw-r--r--pcl/pccprint.c155
1 files changed, 100 insertions, 55 deletions
diff --git a/pcl/pccprint.c b/pcl/pccprint.c
index 4e6dd6e58..80d267f52 100644
--- a/pcl/pccprint.c
+++ b/pcl/pccprint.c
@@ -1,9 +1,25 @@
-/* Copyright (C) 1996, 1997 Aladdin Enterprises. All rights reserved.
- Unauthorized use, copying, and/or distribution prohibited.
+/*
+ * Copyright (C) 1998 Aladdin Enterprises.
+ * All rights reserved.
+ *
+ * This file is part of Aladdin Ghostscript.
+ *
+ * Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND. No author
+ * or distributor accepts any responsibility for the consequences of using it,
+ * or for whether it serves any particular purpose or works at all, unless he
+ * or she says so in writing. Refer to the Aladdin Ghostscript Free Public
+ * License (the "License") for full details.
+ *
+ * Every copy of Aladdin Ghostscript must include a copy of the License,
+ * normally in a plain ASCII text file named PUBLIC. The License grants you
+ * the right to copy, modify and redistribute Aladdin Ghostscript, but only
+ * under certain conditions described in the License. Among other things, the
+ * License requires that the copyright notice and this notice be preserved on
+ * all copies.
*/
-/* pccprint.c */
-/* PCL5c print model commands */
+/* pccprint.c - PCL5c print model commands */
+
#include "std.h"
#include "pcommand.h"
#include "pcstate.h"
@@ -12,64 +28,93 @@
#include "gsstate.h"
#include "gsrop.h"
-private int /* ESC * l <rop> O */
-pcl_logical_operation(pcl_args_t *pargs, pcl_state_t *pcls)
-{ uint rop = uint_arg(pargs);
+/*
+ * ESC * l <rop> O
+ *
+ * Set logical operation.
+ */
+ private int
+pcl_logical_operation(
+ pcl_args_t * pargs,
+ pcl_state_t * pcs
+)
+{
+ uint rop = uint_arg(pargs);
- if ( rop > 255 )
- return e_Range;
- pcl_break_underline(pcls); /* use the 5c convention; in 5e, the
- * underline is not broken by a change in
- * the logical operation */
- pcls->logical_op = rop;
- return 0;
+ if (rop > 255)
+ return e_Range;
+
+ pcl_break_underline(pcs); /* use the 5c convention; in 5e, the
+ * underline is not broken by a change in
+ * the logical operation */
+ pcs->logical_op = rop;
+ return 0;
}
-private int /* ESC * l <bool> R */
-pcl_pixel_placement(pcl_args_t *pargs, pcl_state_t *pcls)
-{ uint i = uint_arg(pargs);
+/*
+ * ESC * l <bool> R
+ *
+ * Set prixel placement. Note that this feature is not yet properly
+ * implemented.
+ */
+ private int
+pcl_pixel_placement(
+ pcl_args_t * pargs,
+ pcl_state_t * pcs
+)
+{
+ uint i = uint_arg(pargs);
- if ( i > 1 )
- return 0;
- pcls->grid_adjust = (i == 0) ? 0.5 : 0.0;
+ if (i > 1)
return 0;
+ pcs->pp_mode = i;
+ return 0;
}
-/* Initialization */
-private int
-pccprint_do_init(gs_memory_t *mem)
-{ /* Register commands */
- DEFINE_CLASS('*')
- {'l', 'O',
- PCL_COMMAND("Logical Operation", pcl_logical_operation,
- pca_neg_error|pca_big_error)},
- {'l', 'R',
- PCL_COMMAND("Pixel Placement", pcl_pixel_placement,
- pca_neg_ignore|pca_big_ignore)},
- END_CLASS
- return 0;
+/*
+ * Initialization
+ */
+ private int
+pccprint_do_init(
+ gs_memory_t * mem
+)
+{
+ /* Register commands */
+ DEFINE_CLASS('*')
+ {
+ 'l', 'O',
+ PCL_COMMAND( "Logical Operation",
+ pcl_logical_operation,
+ pca_neg_ok | pca_big_error
+ )
+ },
+ {
+ 'l', 'R',
+ PCL_COMMAND( "Pixel Placement",
+ pcl_pixel_placement,
+ pca_neg_ok | pca_big_ignore
+ )
+ },
+ END_CLASS
+ return 0;
}
-private void
-pccprint_do_reset(pcl_state_t *pcls, pcl_reset_type_t type)
-{ if ( type & (pcl_reset_initial | pcl_reset_printer) )
- { pcl_args_t args;
- arg_set_uint(&args, 252);
- pcl_logical_operation(&args, pcls);
- arg_set_uint(&args, 0);
- pcl_pixel_placement(&args, pcls);
- }
-}
-private int
-pccprint_do_copy(pcl_state_t *psaved, const pcl_state_t *pcls,
- pcl_copy_operation_t operation)
-{ if ( operation & pcl_copy_after )
- { gs_setrasterop(pcls->pgs, (gs_rop3_t)psaved->logical_op);
- gs_setfilladjust(pcls->pgs,
- psaved->grid_adjust, psaved->grid_adjust);
- }
- return 0;
+ private void
+pccprint_do_reset(
+ pcl_state_t * pcs,
+ pcl_reset_type_t type
+)
+{
+ static const uint mask = ( pcl_reset_initial
+ | pcl_reset_printer
+ | pcl_reset_overlay );
+
+ if ((type & mask) != 0) {
+ pcl_args_t args;
+
+ pcs->logical_op = 252;
+ pcs->pp_mode = 0;
+ }
}
-const pcl_init_t pccprint_init = {
- pccprint_do_init, pccprint_do_reset, pccprint_do_copy
-};
+
+const pcl_init_t pccprint_init = { pccprint_do_init, pccprint_do_reset, 0 };