diff options
Diffstat (limited to 'pcl/pcident.h')
-rw-r--r-- | pcl/pcident.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/pcl/pcident.h b/pcl/pcident.h new file mode 100644 index 000000000..ea0c015ae --- /dev/null +++ b/pcl/pcident.h @@ -0,0 +1,55 @@ +/* Portions Copyright (C) 2001 artofcode LLC. + Portions Copyright (C) 1996, 2001 Artifex Software Inc. + Portions Copyright (C) 1988, 2000 Aladdin Enterprises. + This software is based in part on the work of the Independent JPEG Group. + All Rights Reserved. + + This software is distributed under license and may not be copied, modified + or distributed except as expressly authorized under the terms of that + license. Refer to licensing information at http://www.artifex.com/ or + contact Artifex Software, Inc., 101 Lucas Valley Road #110, + San Rafael, CA 94903, (415)492-9861, for further information. */ +/*$Id$ */ + +/* pcident.h - object identification mechanism for PCL */ + +#ifndef pcident_INCLUDED +#define pcident_INCLUDED + +#include "gx.h" + +/* + * Various "graphic attribute" objects created by PCL are used in the graphic + * state: patterns, color spaces, halftones, and rendering dictionaries. Unlike + * PostScript, these objects also have an existence outside of the graphic state. + * When graphic objects are rendered, it is necessary to determine the set of + * attribute objects they should use, and which of these is currently installed + * in the graphic state. + * + * There is no way to do this directly in the graphic library, as its attribute + * objects do not carry any identifiers (they provide no benefit in a PostScript + * setting). Hence, we pair the graphic library objects with PCL objects, and + * assign identifiers to the latter. So long as the two objects are kept in a + * one-to-one relationship, the identifiers can be used as identifiers of the + * graphic library objects as well. + * + * Though objects of different types can in principle be assigned the same + * identifier, for simplicity the current code assigns unique identifiers for + * all objects. These identifiers are unsigned longs. They are assigned + * consecutively beginning from 8 at boot time. In the unlikely event that + * they should reach 0 once more, they will restart at 16 * 1024 * 1024; this + * should prevent overlap with codes that are assigned to statically allocated + * objects at boot time. + */ + +typedef ulong pcl_gsid_t; + +/* Define an opaque type for the PCL state. */ +#ifndef pcl_state_DEFINED +# define pcl_state_DEFINED +typedef struct pcl_state_s pcl_state_t; +#endif + +pcl_gsid_t pcl_next_id(pcl_state_t *pcs); + +#endif /* pcident_INCLUDED */ |