~ubuntu-branches/ubuntu/jaunty/ghostscript/jaunty-updates

« back to all changes in this revision

Viewing changes to base/gsnamecl.h

  • Committer: Bazaar Package Importer
  • Author(s): Till Kamppeter
  • Date: 2009-01-20 16:40:45 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20090120164045-lnfhi0n30o5lwhwa
Tags: 8.64.dfsg.1~svn9377-0ubuntu1
* New upstream release (SVN rev 9377)
   o Fixes many bugs concerning PDF rendering, to make the PDF printing
     workflow correctly working.
   o Fixes long-standing bugs in many drivers, like input paper tray and
     duplex options not working for the built-in PCL 4, 5, 5c, 5e, and
     6/XL drivers, PDF input not working for bjc600, bjc800, and cups
     output devices, several options not working and uninitialized
     memory with cups output device.
   o Merged nearly all patches of the Ubuntu and Debian packages upstream.
   o Fixes LP: #317810, LP: #314439, LP: #314018.
* debian/patches/03_libpaper_support.dpatch,
  debian/patches/11_gs-cjk_font_glyph_handling_fix.dpatch,
  debian/patches/12_gs-cjk_vertical_writing_metrics_fix.dpatch,
  debian/patches/13_gs-cjk_cjkps_examples.dpatch,
  debian/patches/20_bbox_segv_fix.dpatch,
  debian/patches/21_brother_7x0_gdi_fix.dpatch,
  debian/patches/22_epsn_margin_workaround.dpatch,
  debian/patches/24_gs_man_fix.dpatch,
  debian/patches/25_toolbin_insecure_tmp_usage_fix.dpatch,
  debian/patches/26_assorted_script_fixes.dpatch,
  debian/patches/29_gs_css_fix.dpatch,
  debian/patches/30_ps2pdf_man_improvement.dpatch,
  debian/patches/31_fix-gc-sigbus.dpatch,
  debian/patches/34_ftbfs-on-hurd-fix.dpatch,
  debian/patches/35_disable_libcairo.dpatch,
  debian/patches/38_pxl-duplex.dpatch,
  debian/patches/39_pxl-resolution.dpatch,
  debian/patches/42_gs-init-ps-delaybind-fix.dpatch,
  debian/patches/45_bjc600-bjc800-pdf-input.dpatch,
  debian/patches/48_cups-output-device-pdf-duplex-uninitialized-memory-fix.dpatch,
  debian/patches/50_lips4-floating-point-exception.dpatch,
  debian/patches/52_cups-device-logging.dpatch,
  debian/patches/55_pcl-input-slot-fix.dpatch,
  debian/patches/57_pxl-input-slot-fix.dpatch,
  debian/patches/60_pxl-cups-driver-pdf.dpatch,
  debian/patches/62_onebitcmyk-pdf.dpatch,
  debian/patches/65_too-big-temp-files-1.dpatch,
  debian/patches/67_too-big-temp-files-2.dpatch,
  debian/patches/70_take-into-account-data-in-stream-buffer-before-refill.dpatch:
  Removed, applied upstream.
* debian/patches/01_docdir_fix_for_debian.dpatch,
  debian/patches/02_gs_man_fix_debian.dpatch,
  debian/patches/01_docdir-fix-for-debian.dpatch,
  debian/patches/02_docdir-fix-for-debian.dpatch: Renamed patches to
  make merging with Debian easier.
* debian/patches/32_improve-handling-of-media-size-changes-from-gv.dpatch, 
  debian/patches/33_bad-params-to-xinitimage-on-large-bitmaps.dpatch:
  regenerated for new source directory structure.
* debian/rules: Corrected paths to remove cidfmap (it is in Resource/Init/
  in GS 8.64) and to install headers (source paths are psi/ and base/ now).
* debian/rules: Remove all fontmaps, as DeFoMa replaces them.
* debian/local/pdftoraster/pdftoraster.c,
  debian/local/pdftoraster/pdftoraster.convs, debian/rules: Removed
  added pdftoraster filter and use the one which comes with Ghostscript.
* debian/ghostscript.links: s/8.63/8.64/

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 2001-2007 Artifex Software, Inc.
 
2
   All Rights Reserved.
 
3
  
 
4
   This software is provided AS-IS with no warranty, either express or
 
5
   implied.
 
6
 
 
7
   This software is distributed under license and may not be copied, modified
 
8
   or distributed except as expressly authorized under the terms of that
 
9
   license.  Refer to licensing information at http://www.artifex.com/
 
10
   or contact Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134,
 
11
   San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
 
12
*/
 
13
/* $Id: gsnamecl.h 8764 2008-05-21 18:27:42Z mvrhel $ */
 
14
/* Global definitions for the 'Named Color' callback handling. */
 
15
 
 
16
#ifndef gsnamecl_INCLUDED
 
17
# define gsnamecl_INCLUDED
 
18
 
 
19
#include "gxfrac.h"
 
20
#include "gsccolor.h"
 
21
#include "gscsel.h"
 
22
#include "gxcspace.h"
 
23
 
 
24
/*
 
25
 * Enable custom client callback color processing.  Note:  There is a sample
 
26
 * implementation in src/gsncdummy.c.
 
27
 */
 
28
#ifndef ENABLE_CUSTOM_COLOR_CALLBACK
 
29
#define ENABLE_CUSTOM_COLOR_CALLBACK 0  /* 0 --> disabled, 1 --> enabled */
 
30
#endif
 
31
 
 
32
#if ENABLE_CUSTOM_COLOR_CALLBACK
 
33
/* Ptr to custom color callback struct */
 
34
#define CUSTOM_COLOR_PTR void * custom_color_callback;
 
35
#define INIT_CUSTOM_COLOR_PTR   NULL,           /* Initial value */
 
36
#else
 
37
#define CUSTOM_COLOR_PTR
 
38
#define INIT_CUSTOM_COLOR_PTR
 
39
#endif
 
40
 
 
41
#define CustomColorCallbackParamName "CustomColorCallback"
 
42
 
 
43
/*
 
44
 * For comments upon the client API for working with the custom client
 
45
 * callback logic see the section labeled:  "CLIENT COLOR CALLBACK 
 
46
 * APPLICATION INTERFACE" below.
 
47
 *
 
48
 * Also see the comments at the start of src/gsnamecl.c
 
49
 */
 
50
 
 
51
#ifndef gs_color_space_DEFINED
 
52
#  define gs_color_space_DEFINED
 
53
typedef struct gs_color_space_s gs_color_space;
 
54
#endif
 
55
 
 
56
#ifndef gx_device_color_DEFINED
 
57
#  define gx_device_color_DEFINED
 
58
typedef struct gx_device_color_s gx_device_color;
 
59
#endif
 
60
 
 
61
#ifndef gs_state_DEFINED
 
62
#  define gs_state_DEFINED
 
63
typedef struct gs_state_s gs_state;
 
64
#endif
 
65
 
 
66
#ifndef gs_imager_state_DEFINED
 
67
#  define gs_imager_state_DEFINED
 
68
typedef struct gs_imager_state_s gs_imager_state;
 
69
#endif
 
70
 
 
71
#ifndef gx_device_DEFINED
 
72
#  define gx_device_DEFINED
 
73
typedef struct gx_device_s gx_device;
 
74
#endif
 
75
 
 
76
#ifndef i_ctx_t_DEFINED
 
77
#define i_ctx_t_DEFINED
 
78
typedef struct gs_context_state_s i_ctx_t;
 
79
#endif
 
80
 
 
81
/* Define an opaque type for parameter lists. */
 
82
#ifndef gs_param_list_DEFINED
 
83
#  define gs_param_list_DEFINED
 
84
typedef struct gs_param_list_s gs_param_list;
 
85
#endif
 
86
 
 
87
#define cs_proc_adjust_client_cspace_count(proc)\
 
88
  void proc(const gs_color_space *, int)
 
89
 
 
90
/*
 
91
 * Put the 'custom color' client callback parameter block pointer.  This value
 
92
 * is passed as a string type user paramter.  A string is being used since
 
93
 * PostScript does not support pointers as a type.  Note:  An integer type
 
94
 * is not being used since PS integers are nominally 32 bits.  Thus there
 
95
 * would be a problem using integers to pass pointer values on 64 bit systems.
 
96
 */
 
97
int custom_color_callback_put_params(gs_state * pgs, gs_param_list * plist);
 
98
 
 
99
/*
 
100
 * Get the custom client client callback parameter block pointer.  This value
 
101
 * is passed as a string type user paramter.  A string is being used since
 
102
 * PostScript does not support pointers as a type.  Note:  An integer type
 
103
 * is not being used since PS intergers are nominally 32 bits.  Thus there
 
104
 * would be a problem using integers to pass pointer values on 64 bit systems.
 
105
 */
 
106
int custom_color_callback_get_params(gs_state * pgs, gs_param_list * plist);
 
107
 
 
108
/*
 
109
 * Check if we want to use the callback color processing logic for the given
 
110
 * Separation color space.
 
111
 */
 
112
bool custom_color_callback_install_Separation(gs_color_space * pcs,
 
113
                                                        gs_state * pgs);
 
114
 
 
115
/*
 
116
 * Check if we want to use the custom client callback processing logic for the
 
117
 * given DeviceN color space.
 
118
 */
 
119
bool custom_color_callback_install_DeviceN(gs_color_space * pcs, gs_state * pgs);
 
120
 
 
121
/*
 
122
 * Convert a Separation color into device colorants using the custom client
 
123
 * client callback.
 
124
 */
 
125
int gx_remap_concrete_custom_color_Separation(const frac * pconc,
 
126
        const gs_color_space * pcs, gx_device_color * pdc,
 
127
        const gs_imager_state * pis, gx_device * dev, gs_color_select_t select);
 
128
 
 
129
/*
 
130
 * Convert a DeviceN color into device colorants using the custom client
 
131
 * client callback.
 
132
 */
 
133
int gx_remap_concrete_custom_color_DeviceN(const frac * pconc,
 
134
        const gs_color_space * pcs, gx_device_color * pdc,
 
135
        const gs_imager_state * pis, gx_device * dev, gs_color_select_t select);
 
136
 
 
137
/* "CLIENT COLOR CALLBACK APPLICATION INTERFACE" */
 
138
/*
 
139
 * In order to give some flexibility to the Ghostscript client API, we are
 
140
 * allowing the client to define a set of call back procedures for processing
 
141
 * color spaces.
 
142
 *
 
143
 * See the comments at the start of src/gsnamecl.c
 
144
 */
 
145
/*
 
146
 * The 'client color' call back structure definitions.  The call back structure
 
147
 * consists of a pointer to a list of client color space handling procedures
 
148
 * and a pointer to a client data structure.
 
149
 */
 
150
 
 
151
#ifndef client_custom_color_params_DEFINED
 
152
#define client_custom_color_params_DEFINED
 
153
typedef struct client_custom_color_params_s {
 
154
    /* Client callback handlers */
 
155
    struct client_custom_color_procs_s * client_procs;
 
156
    /* For global client data */
 
157
    void * data;
 
158
} client_custom_color_params_t;
 
159
#endif
 
160
 
 
161
 
 
162
/*
 
163
 * Define a base type for client color space data.  Most clients will
 
164
 * overload this type with a structure of their own.  That type must
 
165
 * start with a pointer to a handler routine for the structure's
 
166
 * reference count.
 
167
 */
 
168
typedef struct client_color_space_data_s {
 
169
        cs_proc_adjust_client_cspace_count((*client_adjust_cspace_count));
 
170
} client_color_space__data_t;
 
171
 
 
172
/*
 
173
 * Define the client custom client callback procedures.
 
174
 */
 
175
typedef struct client_custom_color_procs_s {
 
176
    /*
 
177
     * Install a DeviceGray color space.
 
178
     */
 
179
    bool (* install_DeviceGray)(client_custom_color_params_t * pparams,
 
180
            gs_color_space * pcs, gs_state * pgs);
 
181
    /*
 
182
     * Convert a DeviceGray color into device color.
 
183
     */
 
184
    int (* remap_DeviceGray)(client_custom_color_params_t * pparams,
 
185
            const frac * pconc, const gs_color_space * pcs,
 
186
            gx_device_color * pdc, const gs_imager_state * pis,
 
187
            gx_device * dev, gs_color_select_t select);
 
188
    /*
 
189
     * Install a DeviceRGB color space.
 
190
     */
 
191
    bool (* install_DeviceRGB)(client_custom_color_params_t * pparams,
 
192
            gs_color_space * pcs, gs_state * pgs);
 
193
    /*
 
194
     * Convert a DeviceRGB color into device color.
 
195
     */
 
196
    int (* remap_DeviceRGB)(client_custom_color_params_t * pparams,
 
197
            const frac * pconc, const gs_color_space * pcs,
 
198
            gx_device_color * pdc, const gs_imager_state * pis,
 
199
            gx_device * dev, gs_color_select_t select);
 
200
    /*
 
201
     * Install a DeviceCMYK color space.
 
202
     */
 
203
    bool (* install_DeviceCMYK)(client_custom_color_params_t * pparams,
 
204
            gs_color_space * pcs, gs_state * pgs);
 
205
    /*
 
206
     * Convert a DeviceGray color into device color.
 
207
     */
 
208
    int (* remap_DeviceCMYK)(client_custom_color_params_t * pparams,
 
209
            const frac * pconc, const gs_color_space * pcs,
 
210
            gx_device_color * pdc, const gs_imager_state * pis,
 
211
            gx_device * dev, gs_color_select_t select);
 
212
    /*
 
213
     * Check if we want to use the callback color processing logic for the
 
214
     * given Separation color space.
 
215
     */
 
216
    bool (* install_Separation)(client_custom_color_params_t * pparams,
 
217
            gs_color_space * pcs, gs_state * pgs);
 
218
    /*
 
219
     * Convert a Separation color into device color.
 
220
     */
 
221
    int (* remap_Separation)(client_custom_color_params_t * pparams,
 
222
            const frac * pconc, const gs_color_space * pcs,
 
223
            gx_device_color * pdc, const gs_imager_state * pis,
 
224
            gx_device * dev, gs_color_select_t select);
 
225
    /*
 
226
     * Check if we want to use the callback color processing logic for the
 
227
     * given DeviceN color space.
 
228
     */
 
229
    bool (* install_DeviceN)(client_custom_color_params_t * pparams,
 
230
            gs_color_space * pcs, gs_state * pgs);
 
231
    /*
 
232
     * Convert a DeviceN color into device color.
 
233
     */
 
234
    int (* remap_DeviceN)(client_custom_color_params_t * pparams,
 
235
            const frac * pconc, const gs_color_space * pcs,
 
236
            gx_device_color * pdc, const gs_imager_state * pis,
 
237
            gx_device * dev, gs_color_select_t select);
 
238
    /*
 
239
     * Check if we want to use the callback color processing logic for the
 
240
     * given CIEBasedA color space.
 
241
     */
 
242
    bool (* install_CIEBasedA)(client_custom_color_params_t * pparams,
 
243
            gs_color_space * pcs, gs_state * pgs);
 
244
    /*
 
245
     * Please note that the 'complex' color spaces (CIEBasedA, CIEBasedABC,
 
246
     * CIEBasedDEF, CIEBasedDEFG, and ICCBased) have a different prototype,
 
247
     * versus the simpler color spces, for the callback for converting a
 
248
     * the color values.
 
249
     */
 
250
    /*
 
251
     * Convert a CIEBasedA color into device color.
 
252
     */
 
253
    int (* remap_CIEBasedA)(client_custom_color_params_t * pparams,
 
254
            const gs_client_color * pc, const gs_color_space * pcs,
 
255
            gx_device_color * pdc, const gs_imager_state * pis,
 
256
            gx_device * dev, gs_color_select_t select);
 
257
    /*
 
258
     * Check if we want to use the callback color processing logic for the
 
259
     * given CIEBasedABC color space.
 
260
     */
 
261
    bool (* install_CIEBasedABC)(client_custom_color_params_t * pparams,
 
262
            gs_color_space * pcs, gs_state * pgs);
 
263
    /*
 
264
     * Convert a CIEBasedABC color into device color.
 
265
     */
 
266
    int (* remap_CIEBasedABC)(client_custom_color_params_t * pparams,
 
267
            const gs_client_color * pc, const gs_color_space * pcs,
 
268
            gx_device_color * pdc, const gs_imager_state * pis,
 
269
            gx_device * dev, gs_color_select_t select);
 
270
    /*
 
271
     * Check if we want to use the callback color processing logic for the
 
272
     * given CIEBasedDEF color space.
 
273
     */
 
274
    bool (* install_CIEBasedDEF)(client_custom_color_params_t * pparams,
 
275
            gs_color_space * pcs, gs_state * pgs);
 
276
    /*
 
277
     * Convert a CIEBasedDEF color into device color.
 
278
     */
 
279
    int (* remap_CIEBasedDEF)(client_custom_color_params_t * pparams,
 
280
            const gs_client_color * pc, const gs_color_space * pcs,
 
281
            gx_device_color * pdc, const gs_imager_state * pis,
 
282
            gx_device * dev, gs_color_select_t select);
 
283
    /*
 
284
     * Check if we want to use the callback color processing logic for the
 
285
     * given CIEBasedDEFG color space.
 
286
     */
 
287
    bool (* install_CIEBasedDEFG)(client_custom_color_params_t * pparams,
 
288
            gs_color_space * pcs, gs_state * pgs);
 
289
    /*
 
290
     * Convert a CIEBasedDEFG color into device color.
 
291
     */
 
292
    int (* remap_CIEBasedDEFG)(client_custom_color_params_t * pparams,
 
293
            const gs_client_color * pc, const gs_color_space * pcs,
 
294
            gx_device_color * pdc, const gs_imager_state * pis,
 
295
            gx_device * dev, gs_color_select_t select);
 
296
    /*
 
297
     * Check if we want to use the callback color processing logic for the
 
298
     * given ICCBased color space.
 
299
     */
 
300
    bool (* install_ICCBased)(client_custom_color_params_t * pparams,
 
301
            gs_color_space * pcs, gs_state * pgs);
 
302
    /*
 
303
     * Convert a ICCBased color into device color.
 
304
     */
 
305
    int (* remap_ICCBased)(client_custom_color_params_t * pparams,
 
306
            const gs_client_color * pc, const gs_color_space * pcs,
 
307
            gx_device_color * pdc, const gs_imager_state * pis,
 
308
            gx_device * dev, gs_color_select_t select);
 
309
 
 
310
} client_custom_color_procs_t;
 
311
    
 
312
#endif          /* ifndef gsnamecl_INCLUDED */