/src/ghostpdl/base/gdevflp.c
Line | Count | Source |
1 | | /* Copyright (C) 2001-2026 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, |
8 | | modified or distributed except as expressly authorized under the terms |
9 | | of the license contained in the file LICENSE in this distribution. |
10 | | |
11 | | Refer to licensing information at http://www.artifex.com or contact |
12 | | Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco, |
13 | | CA 94129, USA, for further information. |
14 | | */ |
15 | | |
16 | | /* Device for first/last page handling device */ |
17 | | /* This device is the first 'subclassing' device; the intention of subclassing |
18 | | * is to allow us to develop a 'chain' or 'pipeline' of devices, each of which |
19 | | * can process some aspect of the graphics methods before passing them on to the |
20 | | * next device in the chain. |
21 | | * |
22 | | * This device's purpose is to implement the 'FirstPage' and 'LastPage' parameters |
23 | | * in Ghostscript. Initially only implemented in the PDF interpreter this functionality |
24 | | * has been shifted internally so that it can be implemented in all the interpreters. |
25 | | * The approach is pretty simple, we modify gdevprn.c and gdevvec.c so that if -dFirstPage |
26 | | * or -dLastPage is defined the device in question is subclassed and this device inserted. |
27 | | * This device then 'black hole's any graphics operations until we reach 'FirstPage'. We then |
28 | | * allow graphics to pass to the device until we reach the end of 'LastPage' at which time we |
29 | | * discard operations again until we reach the end, and close the device. |
30 | | */ |
31 | | |
32 | | #include "math_.h" |
33 | | #include "string_.h" /* for strlen */ |
34 | | #include "memory_.h" |
35 | | #include "gx.h" |
36 | | #include "gserrors.h" |
37 | | #include "gsparam.h" |
38 | | #include "gxdevice.h" |
39 | | #include "gsdevice.h" /* requires gsmatrix.h */ |
40 | | #include "gxdcolor.h" /* for gx_device_black/white */ |
41 | | #include "gxiparam.h" /* for image source size */ |
42 | | #include "gxgstate.h" |
43 | | #include "gxpaint.h" |
44 | | #include "gxpath.h" |
45 | | #include "gxcpath.h" |
46 | | #include "gxcmap.h" /* color mapping procs */ |
47 | | #include "gsstype.h" |
48 | | #include "gdevprn.h" |
49 | | #include "gdevp14.h" /* Needed to patch up the procs after compositor creation */ |
50 | | #include "gximage.h" /* For gx_image_enum */ |
51 | | #include "gdevsclass.h" |
52 | | #include "gdevflp.h" |
53 | | #include "pagelist.h" |
54 | | #include <stdlib.h> |
55 | | |
56 | | /* GC descriptor */ |
57 | | public_st_device_flp(); |
58 | | /* we need text and image enumerators, because of the crazy way that text and images work */ |
59 | | private_st_flp_text_enum(); |
60 | | |
61 | | /* Device procedures, we need quite a lot of them */ |
62 | | static dev_proc_output_page(flp_output_page); |
63 | | static dev_proc_close_device(flp_close_device); |
64 | | static dev_proc_fill_rectangle(flp_fill_rectangle); |
65 | | static dev_proc_copy_mono(flp_copy_mono); |
66 | | static dev_proc_copy_color(flp_copy_color); |
67 | | static dev_proc_get_bits_rectangle(flp_get_bits_rectangle); |
68 | | static dev_proc_get_params(flp_put_params); |
69 | | static dev_proc_get_alpha_bits(flp_get_alpha_bits); |
70 | | static dev_proc_copy_alpha(flp_copy_alpha); |
71 | | static dev_proc_fill_path(flp_fill_path); |
72 | | static dev_proc_stroke_path(flp_stroke_path); |
73 | | static dev_proc_fill_mask(flp_fill_mask); |
74 | | static dev_proc_fill_trapezoid(flp_fill_trapezoid); |
75 | | static dev_proc_fill_parallelogram(flp_fill_parallelogram); |
76 | | static dev_proc_fill_triangle(flp_fill_triangle); |
77 | | static dev_proc_draw_thin_line(flp_draw_thin_line); |
78 | | static dev_proc_strip_tile_rectangle(flp_strip_tile_rectangle); |
79 | | static dev_proc_begin_typed_image(flp_begin_typed_image); |
80 | | static dev_proc_get_bits_rectangle(flp_get_bits_rectangle); |
81 | | static dev_proc_composite(flp_composite); |
82 | | static dev_proc_text_begin(flp_text_begin); |
83 | | static dev_proc_begin_transparency_group(flp_begin_transparency_group); |
84 | | static dev_proc_end_transparency_group(flp_end_transparency_group); |
85 | | static dev_proc_begin_transparency_mask(flp_begin_transparency_mask); |
86 | | static dev_proc_end_transparency_mask(flp_end_transparency_mask); |
87 | | static dev_proc_discard_transparency_layer(flp_discard_transparency_layer); |
88 | | static dev_proc_fill_rectangle_hl_color(flp_fill_rectangle_hl_color); |
89 | | static dev_proc_fill_linear_color_scanline(flp_fill_linear_color_scanline); |
90 | | static dev_proc_fill_linear_color_trapezoid(flp_fill_linear_color_trapezoid); |
91 | | static dev_proc_fill_linear_color_triangle(flp_fill_linear_color_triangle); |
92 | | static dev_proc_fillpage(flp_fillpage); |
93 | | static dev_proc_push_transparency_state(flp_push_transparency_state); |
94 | | static dev_proc_pop_transparency_state(flp_pop_transparency_state); |
95 | | static dev_proc_put_image(flp_put_image); |
96 | | static dev_proc_copy_planes(flp_copy_planes); |
97 | | static dev_proc_strip_copy_rop2(flp_strip_copy_rop2); |
98 | | static dev_proc_strip_tile_rect_devn(flp_strip_tile_rect_devn); |
99 | | static dev_proc_copy_alpha_hl_color(flp_copy_alpha_hl_color); |
100 | | static dev_proc_process_page(flp_process_page); |
101 | | static dev_proc_transform_pixel_region(flp_transform_pixel_region); |
102 | | static dev_proc_fill_stroke_path(flp_fill_stroke_path); |
103 | | static dev_proc_initialize_device_procs(flp_initialize_device_procs); |
104 | | |
105 | | /* The device prototype */ |
106 | | #define MAX_COORD (max_int_in_fixed - 1000) |
107 | | #define MAX_RESOLUTION 4000 |
108 | | |
109 | | #define public_st_flp_device() /* in gsdevice.c */\ |
110 | | gs_public_st_complex_only(st_flp_device, gx_device, "first_lastpage",\ |
111 | | 0, flp_enum_ptrs, flp_reloc_ptrs, default_subclass_finalize) |
112 | | |
113 | | static |
114 | 0 | ENUM_PTRS_WITH(flp_enum_ptrs, gx_device *dev); |
115 | 0 | return 0; /* default case */ |
116 | 0 | case 0:ENUM_RETURN(gx_device_enum_ptr(dev->parent)); |
117 | 0 | case 1:ENUM_RETURN(gx_device_enum_ptr(dev->child)); |
118 | 0 | ENUM_PTRS_END |
119 | 0 | static RELOC_PTRS_WITH(flp_reloc_ptrs, gx_device *dev) |
120 | 0 | { |
121 | 0 | dev->parent = gx_device_reloc_ptr(dev->parent, gcst); |
122 | 0 | dev->child = gx_device_reloc_ptr(dev->child, gcst); |
123 | 0 | }RELOC_PTRS_END |
124 | | |
125 | | public_st_flp_device(); |
126 | | |
127 | | const |
128 | | gx_device_flp gs_flp_device = |
129 | | { |
130 | | std_device_dci_type_body_sc(gx_device_flp, flp_initialize_device_procs, |
131 | | "first_lastpage", &st_flp_device, |
132 | | MAX_COORD, MAX_COORD, |
133 | | MAX_RESOLUTION, MAX_RESOLUTION, |
134 | | 1, 8, 255, 0, 256, 1, NULL, NULL, NULL) |
135 | | }; |
136 | | |
137 | | #undef MAX_COORD |
138 | | #undef MAX_RESOLUTION |
139 | | |
140 | | static int ParsePageList(gx_device *dev, first_last_subclass_data *psubclass_data, char *PageList) |
141 | 0 | { |
142 | 0 | return pagelist_parse_to_array(PageList, dev->memory->non_gc_memory, 0x7fffffff, |
143 | 0 | &(psubclass_data->page_range_array)); |
144 | 0 | } |
145 | | |
146 | | static int SkipPage(gx_device *dev) |
147 | 0 | { |
148 | 0 | first_last_subclass_data *psubclass_data = dev->subclass_data; |
149 | 0 | int code; |
150 | | |
151 | | /* If we're disabled, don't skip any pages, and don't bother parsing the PageList */ |
152 | 0 | if (dev->DisablePageHandler) |
153 | 0 | return 0; |
154 | | |
155 | | /* If we haven't parsed any extant PageList, do it now */ |
156 | 0 | if (dev->PageList && psubclass_data->page_range_array == NULL) { |
157 | 0 | code = ParsePageList(dev, psubclass_data, dev->PageList->Pages); |
158 | 0 | if (code < 0) { |
159 | 0 | emprintf1(dev->memory, "*** Invalid PageList=%s ***\n", dev->PageList->Pages); |
160 | 0 | return code; |
161 | 0 | } |
162 | 0 | } |
163 | | |
164 | | /* SkipPage can only handle PageList that moves forward */ |
165 | 0 | if (psubclass_data->page_range_array != NULL && |
166 | 0 | pagelist_test_ordered(psubclass_data->page_range_array) == false) { |
167 | 0 | emprintf(dev->memory, "*** Bad PageList: Must be increasing order. ***\n"); |
168 | 0 | return gs_error_rangecheck; |
169 | 0 | } |
170 | | |
171 | 0 | if (psubclass_data->page_range_array != NULL) { |
172 | | /* PageCount is 0 based, page_range_array starts at page 1 */ |
173 | 0 | return pagelist_test_printed(psubclass_data->page_range_array, psubclass_data->PageCount + 1) == false; |
174 | 0 | } else { |
175 | 0 | if (psubclass_data->PageCount >= dev->FirstPage - 1) |
176 | 0 | if (!dev->LastPage || psubclass_data->PageCount <= dev->LastPage - 1) |
177 | 0 | return 0; |
178 | 0 | } |
179 | 0 | return 1; |
180 | 0 | } |
181 | | |
182 | | int flp_output_page(gx_device *dev, int num_copies, int flush) |
183 | 0 | { |
184 | 0 | int code = 0; |
185 | |
|
186 | 0 | first_last_subclass_data *psubclass_data = dev->subclass_data; |
187 | |
|
188 | 0 | if (!SkipPage(dev)) |
189 | 0 | code = default_subclass_output_page(dev, num_copies, flush); |
190 | |
|
191 | 0 | psubclass_data->PageCount++; |
192 | |
|
193 | 0 | return code; |
194 | 0 | } |
195 | | |
196 | | int flp_close_device(gx_device *dev) |
197 | 0 | { |
198 | 0 | first_last_subclass_data *psubclass_data = dev->subclass_data; |
199 | |
|
200 | 0 | if (psubclass_data->page_range_array != NULL) |
201 | 0 | { |
202 | 0 | pagelist_free_range_array(dev->memory->non_gc_memory, psubclass_data->page_range_array); |
203 | 0 | psubclass_data->page_range_array = NULL; |
204 | 0 | } |
205 | |
|
206 | 0 | return default_subclass_close_device(dev); |
207 | 0 | } |
208 | | |
209 | | int flp_fill_rectangle(gx_device *dev, int x, int y, int width, int height, gx_color_index color) |
210 | 0 | { |
211 | 0 | int code = SkipPage(dev); |
212 | |
|
213 | 0 | if (code < 0) |
214 | 0 | return code; |
215 | 0 | if (!code) |
216 | 0 | return default_subclass_fill_rectangle(dev, x, y, width, height, color); |
217 | | |
218 | 0 | return 0; |
219 | 0 | } |
220 | | |
221 | | int flp_copy_mono(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, |
222 | | int x, int y, int width, int height, |
223 | | gx_color_index color0, gx_color_index color1) |
224 | 0 | { |
225 | 0 | int code = SkipPage(dev); |
226 | |
|
227 | 0 | if (code < 0) |
228 | 0 | return code; |
229 | 0 | if (!code) |
230 | 0 | return default_subclass_copy_mono(dev, data, data_x, raster, id, x, y, width, height, color0, color1); |
231 | | |
232 | 0 | return 0; |
233 | 0 | } |
234 | | |
235 | | int flp_copy_color(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id,\ |
236 | | int x, int y, int width, int height) |
237 | 0 | { |
238 | 0 | int code = SkipPage(dev); |
239 | |
|
240 | 0 | if (code < 0) |
241 | 0 | return code; |
242 | 0 | if (!code) |
243 | 0 | return default_subclass_copy_color(dev, data, data_x, raster, id, x, y, width, height); |
244 | | |
245 | 0 | return 0; |
246 | 0 | } |
247 | | |
248 | | static void |
249 | | flp_rc_free_pages_list(gs_memory_t * mem, void *ptr_in, client_name_t cname) |
250 | 0 | { |
251 | 0 | gdev_pagelist *PageList = (gdev_pagelist *)ptr_in; |
252 | |
|
253 | 0 | if (PageList->rc.ref_count <= 1) { |
254 | 0 | gs_free(mem->non_gc_memory, PageList->Pages, 1, strlen(PageList->Pages), "free page list"); |
255 | 0 | gs_free(mem->non_gc_memory, PageList, 1, sizeof(gdev_pagelist), "free structure to hold page list"); |
256 | 0 | } |
257 | 0 | } |
258 | | |
259 | | int |
260 | | flp_put_params(gx_device * dev, gs_param_list * plist) |
261 | 0 | { |
262 | 0 | bool temp_bool = false; |
263 | 0 | int code, ecode = 0; |
264 | 0 | gs_param_string pagelist; |
265 | |
|
266 | 0 | code = param_read_bool(plist, "DisablePageHandler", &temp_bool); |
267 | 0 | if (code < 0) |
268 | 0 | ecode = code; |
269 | 0 | if (code == 0) { |
270 | 0 | dev->DisablePageHandler = temp_bool; |
271 | 0 | if (dev->DisablePageHandler == false) { |
272 | 0 | first_last_subclass_data *psubclass_data = dev->subclass_data; |
273 | |
|
274 | 0 | psubclass_data->PageCount = 0; |
275 | 0 | psubclass_data->page_range_array = NULL; |
276 | 0 | } |
277 | 0 | } |
278 | |
|
279 | 0 | if (dev->DisablePageHandler == false) { |
280 | 0 | code = param_read_int(plist, "FirstPage", &dev->FirstPage); |
281 | 0 | if (code < 0) |
282 | 0 | ecode = code; |
283 | 0 | if (code == 0) { |
284 | 0 | first_last_subclass_data *psubclass_data = dev->subclass_data; |
285 | |
|
286 | 0 | dev->DisablePageHandler = false; |
287 | 0 | psubclass_data->PageCount = 0; |
288 | 0 | psubclass_data->page_range_array = NULL; |
289 | 0 | if (dev->PageList) { |
290 | 0 | rc_decrement(dev->PageList, "flp_put_params"); |
291 | 0 | dev->PageList = NULL; |
292 | 0 | } |
293 | 0 | if (psubclass_data->page_range_array != NULL) { |
294 | 0 | pagelist_free_range_array(dev->memory->non_gc_memory, psubclass_data->page_range_array); |
295 | 0 | psubclass_data->page_range_array = NULL; |
296 | 0 | } |
297 | 0 | } |
298 | |
|
299 | 0 | code = param_read_int(plist, "LastPage", &dev->LastPage); |
300 | 0 | if (code < 0) |
301 | 0 | ecode = code; |
302 | 0 | if (code == 0) { |
303 | 0 | first_last_subclass_data *psubclass_data = dev->subclass_data; |
304 | |
|
305 | 0 | dev->DisablePageHandler = false; |
306 | 0 | psubclass_data->PageCount = 0; |
307 | 0 | psubclass_data->page_range_array = NULL; |
308 | 0 | if (dev->PageList) { |
309 | 0 | rc_decrement(dev->PageList, "flp_put_params"); |
310 | 0 | dev->PageList = NULL; |
311 | 0 | } |
312 | 0 | if (psubclass_data->page_range_array != NULL) { |
313 | 0 | pagelist_free_range_array(dev->memory->non_gc_memory, psubclass_data->page_range_array); |
314 | 0 | psubclass_data->page_range_array = NULL; |
315 | 0 | } |
316 | 0 | } |
317 | |
|
318 | 0 | code = param_read_string(plist, "PageList", &pagelist); |
319 | 0 | if (code < 0) |
320 | 0 | ecode = code; |
321 | |
|
322 | 0 | if (code == 0 && pagelist.size > 0) { |
323 | 0 | first_last_subclass_data *psubclass_data = dev->subclass_data; |
324 | |
|
325 | 0 | if (dev->PageList) |
326 | 0 | rc_decrement(dev->PageList, "flp_put_params"); |
327 | |
|
328 | 0 | if (psubclass_data->page_range_array != NULL) { |
329 | 0 | pagelist_free_range_array(dev->memory->non_gc_memory, psubclass_data->page_range_array); |
330 | 0 | psubclass_data->page_range_array = NULL; |
331 | 0 | } |
332 | |
|
333 | 0 | dev->PageList = (gdev_pagelist *)gs_alloc_bytes(dev->memory->non_gc_memory, sizeof(gdev_pagelist), "structure to hold page list"); |
334 | 0 | if (!dev->PageList) |
335 | 0 | return gs_note_error(gs_error_VMerror); |
336 | 0 | dev->PageList->Pages = (void *)gs_alloc_bytes(dev->memory->non_gc_memory, pagelist.size + 1, "String to hold page list"); |
337 | 0 | if (!dev->PageList->Pages){ |
338 | 0 | gs_free(dev->memory->non_gc_memory, dev->PageList, 1, sizeof(gdev_pagelist), "free structure to hold page list"); |
339 | 0 | dev->PageList = 0; |
340 | 0 | return gs_note_error(gs_error_VMerror); |
341 | 0 | } |
342 | 0 | memset(dev->PageList->Pages, 0x00, pagelist.size + 1); |
343 | 0 | memcpy(dev->PageList->Pages, pagelist.data, pagelist.size); |
344 | 0 | rc_init_free(dev->PageList, dev->memory->non_gc_memory, 1, flp_rc_free_pages_list); |
345 | 0 | psubclass_data->page_range_array = NULL; |
346 | 0 | dev->DisablePageHandler = false; |
347 | 0 | psubclass_data->PageCount = 0; |
348 | 0 | psubclass_data->page_range_array = NULL; |
349 | 0 | } |
350 | 0 | } |
351 | 0 | code = default_subclass_put_params(dev, plist); |
352 | |
|
353 | 0 | if (code < 0) |
354 | 0 | return code; |
355 | | |
356 | 0 | if (ecode < 0) |
357 | 0 | code = ecode; |
358 | |
|
359 | 0 | return code; |
360 | 0 | } |
361 | | |
362 | | int flp_get_alpha_bits(gx_device *dev, graphics_object_type type) |
363 | 0 | { |
364 | 0 | int code = SkipPage(dev); |
365 | |
|
366 | 0 | if (code < 0) |
367 | 0 | return code; |
368 | 0 | if (!code) |
369 | 0 | return default_subclass_get_alpha_bits(dev, type); |
370 | | |
371 | 0 | return 0; |
372 | 0 | } |
373 | | |
374 | | int flp_copy_alpha(gx_device *dev, const byte *data, int data_x, |
375 | | int raster, gx_bitmap_id id, int x, int y, int width, int height, |
376 | | gx_color_index color, int depth) |
377 | 0 | { |
378 | 0 | int code = SkipPage(dev); |
379 | |
|
380 | 0 | if (code < 0) |
381 | 0 | return code; |
382 | 0 | if (!code) |
383 | 0 | return default_subclass_copy_alpha(dev, data, data_x, raster, id, x, y, width, height, color, depth); |
384 | | |
385 | 0 | return 0; |
386 | 0 | } |
387 | | |
388 | | int flp_fill_path(gx_device *dev, const gs_gstate *pgs, gx_path *ppath, |
389 | | const gx_fill_params *params, |
390 | | const gx_drawing_color *pdcolor, const gx_clip_path *pcpath) |
391 | 0 | { |
392 | 0 | int code = SkipPage(dev); |
393 | |
|
394 | 0 | if (code < 0) |
395 | 0 | return code; |
396 | 0 | if (!code) |
397 | 0 | return default_subclass_fill_path(dev, pgs, ppath, params, pdcolor, pcpath); |
398 | | |
399 | 0 | return 0; |
400 | 0 | } |
401 | | |
402 | | int flp_stroke_path(gx_device *dev, const gs_gstate *pgs, gx_path *ppath, |
403 | | const gx_stroke_params *params, |
404 | | const gx_drawing_color *pdcolor, const gx_clip_path *pcpath) |
405 | 0 | { |
406 | 0 | int code = SkipPage(dev); |
407 | |
|
408 | 0 | if (code < 0) |
409 | 0 | return code; |
410 | 0 | if (!code) |
411 | 0 | return default_subclass_stroke_path(dev, pgs, ppath, params, pdcolor, pcpath); |
412 | | |
413 | 0 | return 0; |
414 | 0 | } |
415 | | |
416 | | int flp_fill_mask(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, |
417 | | int x, int y, int width, int height, |
418 | | const gx_drawing_color *pdcolor, int depth, |
419 | | gs_logical_operation_t lop, const gx_clip_path *pcpath) |
420 | 0 | { |
421 | 0 | int code = SkipPage(dev); |
422 | |
|
423 | 0 | if (code < 0) |
424 | 0 | return code; |
425 | 0 | if (!code) |
426 | 0 | return default_subclass_fill_mask(dev, data, data_x, raster, id, x, y, width, height, pdcolor, depth, lop, pcpath); |
427 | | |
428 | 0 | return 0; |
429 | 0 | } |
430 | | |
431 | | int flp_fill_trapezoid(gx_device *dev, const gs_fixed_edge *left, const gs_fixed_edge *right, |
432 | | fixed ybot, fixed ytop, bool swap_axes, |
433 | | const gx_drawing_color *pdcolor, gs_logical_operation_t lop) |
434 | 0 | { |
435 | 0 | int code = SkipPage(dev); |
436 | |
|
437 | 0 | if (code < 0) |
438 | 0 | return code; |
439 | 0 | if (!code) |
440 | 0 | return default_subclass_fill_trapezoid(dev, left, right, ybot, ytop, swap_axes, pdcolor, lop); |
441 | | |
442 | 0 | return 0; |
443 | 0 | } |
444 | | |
445 | | int flp_fill_parallelogram(gx_device *dev, fixed px, fixed py, fixed ax, fixed ay, fixed bx, fixed by, |
446 | | const gx_drawing_color *pdcolor, gs_logical_operation_t lop) |
447 | 0 | { |
448 | 0 | int code = SkipPage(dev); |
449 | |
|
450 | 0 | if (code < 0) |
451 | 0 | return code; |
452 | 0 | if (!code) |
453 | 0 | return default_subclass_fill_parallelogram(dev, px, py, ax, ay, bx, by, pdcolor, lop); |
454 | | |
455 | 0 | return 0; |
456 | 0 | } |
457 | | |
458 | | int flp_fill_triangle(gx_device *dev, fixed px, fixed py, fixed ax, fixed ay, fixed bx, fixed by, |
459 | | const gx_drawing_color *pdcolor, gs_logical_operation_t lop) |
460 | 0 | { |
461 | 0 | int code = SkipPage(dev); |
462 | |
|
463 | 0 | if (code < 0) |
464 | 0 | return code; |
465 | 0 | if (!code) |
466 | 0 | return default_subclass_fill_triangle(dev, px, py, ax, ay, bx, by, pdcolor, lop); |
467 | | |
468 | 0 | return 0; |
469 | 0 | } |
470 | | |
471 | | int flp_draw_thin_line(gx_device *dev, fixed fx0, fixed fy0, fixed fx1, fixed fy1, |
472 | | const gx_drawing_color *pdcolor, gs_logical_operation_t lop, |
473 | | fixed adjustx, fixed adjusty) |
474 | 0 | { |
475 | 0 | int code = SkipPage(dev); |
476 | |
|
477 | 0 | if (code < 0) |
478 | 0 | return code; |
479 | 0 | if (!code) |
480 | 0 | return default_subclass_draw_thin_line(dev, fx0, fy0, fx1, fy1, pdcolor, lop, adjustx, adjusty); |
481 | | |
482 | 0 | return 0; |
483 | 0 | } |
484 | | |
485 | | int flp_strip_tile_rectangle(gx_device *dev, const gx_strip_bitmap *tiles, int x, int y, int width, int height, |
486 | | gx_color_index color0, gx_color_index color1, |
487 | | int phase_x, int phase_y) |
488 | 0 | { |
489 | 0 | int code = SkipPage(dev); |
490 | |
|
491 | 0 | if (code < 0) |
492 | 0 | return code; |
493 | 0 | if (!code) |
494 | 0 | return default_subclass_strip_tile_rectangle(dev, tiles, x, y, width, height, color0, color1, phase_x, phase_y); |
495 | | |
496 | 0 | return 0; |
497 | 0 | } |
498 | | |
499 | | typedef struct flp_image_enum_s { |
500 | | gx_image_enum_common; |
501 | | int y; |
502 | | int height; |
503 | | } flp_image_enum; |
504 | | gs_private_st_composite(st_flp_image_enum, flp_image_enum, "flp_image_enum", |
505 | | flp_image_enum_enum_ptrs, flp_image_enum_reloc_ptrs); |
506 | | |
507 | 0 | static ENUM_PTRS_WITH(flp_image_enum_enum_ptrs, flp_image_enum *pie) |
508 | 0 | (void)pie; /* Silence unused var warning */ |
509 | 0 | return ENUM_USING_PREFIX(st_gx_image_enum_common, 0); |
510 | 0 | ENUM_PTRS_END |
511 | 0 | static RELOC_PTRS_WITH(flp_image_enum_reloc_ptrs, flp_image_enum *pie) |
512 | 0 | { |
513 | 0 | (void)pie; /* Silence unused var warning */ |
514 | 0 | RELOC_USING(st_gx_image_enum_common, vptr, size); |
515 | 0 | } |
516 | 0 | RELOC_PTRS_END |
517 | | |
518 | | static int |
519 | | flp_image_plane_data(gx_image_enum_common_t * info, |
520 | | const gx_image_plane_t * planes, int height, |
521 | | int *rows_used) |
522 | 0 | { |
523 | 0 | flp_image_enum *pie = (flp_image_enum *)info; |
524 | |
|
525 | 0 | pie->y += height; |
526 | 0 | *rows_used = height; |
527 | |
|
528 | 0 | if (pie->y < pie->height) |
529 | 0 | return 0; |
530 | 0 | return 1; |
531 | 0 | } |
532 | | |
533 | | static int |
534 | | flp_image_end_image(gx_image_enum_common_t * info, bool draw_last) |
535 | 0 | { |
536 | 0 | gs_free_object(info->memory, info, "flp_end_image"); |
537 | 0 | return 0; |
538 | 0 | } |
539 | | |
540 | | static const gx_image_enum_procs_t flp_image_enum_procs = { |
541 | | flp_image_plane_data, |
542 | | flp_image_end_image |
543 | | }; |
544 | | |
545 | | int flp_begin_typed_image(gx_device *dev, const gs_gstate *pgs, const gs_matrix *pmat, |
546 | | const gs_image_common_t *pic, const gs_int_rect *prect, |
547 | | const gx_drawing_color *pdcolor, const gx_clip_path *pcpath, |
548 | | gs_memory_t *memory, gx_image_enum_common_t **pinfo) |
549 | 0 | { |
550 | 0 | flp_image_enum *pie; |
551 | 0 | const gs_pixel_image_t *pim = (const gs_pixel_image_t *)pic; |
552 | 0 | int num_components; |
553 | 0 | int code = SkipPage(dev); |
554 | |
|
555 | 0 | if (code < 0) |
556 | 0 | return code; |
557 | 0 | if (!code) |
558 | 0 | return default_subclass_begin_typed_image(dev, pgs, pmat, pic, prect, pdcolor, pcpath, memory, pinfo); |
559 | | |
560 | 0 | if (pic->type->index == 1) { |
561 | 0 | const gs_image_t *pim1 = (const gs_image_t *)pic; |
562 | |
|
563 | 0 | if (pim1->ImageMask) |
564 | 0 | num_components = 1; |
565 | 0 | else |
566 | 0 | num_components = gs_color_space_num_components(pim->ColorSpace); |
567 | 0 | } else { |
568 | 0 | num_components = gs_color_space_num_components(pim->ColorSpace); |
569 | 0 | } |
570 | |
|
571 | 0 | pie = gs_alloc_struct(memory, flp_image_enum, &st_flp_image_enum, |
572 | 0 | "flp_begin_image"); |
573 | 0 | if (pie == 0) |
574 | 0 | return_error(gs_error_VMerror); |
575 | 0 | memset(pie, 0, sizeof(*pie)); /* cleanup entirely for GC to work in all cases. */ |
576 | 0 | *pinfo = (gx_image_enum_common_t *) pie; |
577 | 0 | code = gx_image_enum_common_init(*pinfo, (const gs_data_image_t *) pim, &flp_image_enum_procs, |
578 | 0 | (gx_device *)dev, num_components, pim->format); |
579 | 0 | if (code < 0) { |
580 | 0 | gs_free_object(memory, pie, "flp_begin_image"); |
581 | 0 | *pinfo = NULL; |
582 | 0 | return code; |
583 | 0 | } |
584 | | |
585 | 0 | pie->memory = memory; |
586 | 0 | pie->skipping = true; |
587 | 0 | pie->height = pim->Height; |
588 | 0 | pie->y = 0; |
589 | |
|
590 | 0 | return 0; |
591 | 0 | } |
592 | | |
593 | | int flp_get_bits_rectangle(gx_device *dev, const gs_int_rect *prect, |
594 | | gs_get_bits_params_t *params) |
595 | 0 | { |
596 | 0 | int code = SkipPage(dev); |
597 | |
|
598 | 0 | if (code < 0) |
599 | 0 | return code; |
600 | 0 | if (!code) |
601 | 0 | return default_subclass_get_bits_rectangle(dev, prect, params); |
602 | | |
603 | 0 | return gx_default_get_bits_rectangle(dev->child, prect, params); |
604 | 0 | } |
605 | | |
606 | | int flp_composite(gx_device *dev, gx_device **pcdev, const gs_composite_t *pcte, |
607 | | gs_gstate *pgs, gs_memory_t *memory, gx_device *cdev) |
608 | 0 | { |
609 | 0 | int code = SkipPage(dev); |
610 | | |
611 | | /* The returned pointer 'pcdev' is a signal to the caller, if its not the same as the current |
612 | | * device in the graphics state, then it gets set as the current device (basically if its not the |
613 | | * same its a signal that we want to push a new compositor device to the head). So here we start |
614 | | * by making sure that its set to the one in the graphics state. If the child device wants a |
615 | | * compositor it will overwrite this value. |
616 | | */ |
617 | 0 | *pcdev = pgs->device; |
618 | |
|
619 | 0 | if (code < 0) |
620 | 0 | return code; |
621 | 0 | if (!code) |
622 | 0 | return default_subclass_composite(dev, pcdev, pcte, pgs, memory, cdev); |
623 | | |
624 | 0 | return 0; |
625 | 0 | } |
626 | | |
627 | | /* Text processing (like images) works differently to other device |
628 | | * methods. Instead of the interpreter calling a device method, only |
629 | | * the 'begin' method is called, this creates a text enumerator which |
630 | | * it fills in (in part with the routines for processing text) and returns |
631 | | * to the interpreter. The interpreter then calls the methods defined in |
632 | | * the text enumerator to process the text. |
633 | | * Mad as a fish..... |
634 | | */ |
635 | | |
636 | | /* For our purposes if we are handling the text its because we are not |
637 | | * printing the page, so we cna afford to ignore all the text processing. |
638 | | * A more complex device might need to define real handlers for these, and |
639 | | * pass them on to the subclassed device. |
640 | | */ |
641 | | static text_enum_proc_process(flp_text_process); |
642 | | static int |
643 | | flp_text_resync(gs_text_enum_t *pte, const gs_text_enum_t *pfrom) |
644 | 0 | { |
645 | 0 | return 0; |
646 | 0 | } |
647 | | int |
648 | | flp_text_process(gs_text_enum_t *pte) |
649 | 0 | { |
650 | 0 | return 0; |
651 | 0 | } |
652 | | static bool |
653 | | flp_text_is_width_only(const gs_text_enum_t *pte) |
654 | 0 | { |
655 | 0 | return false; |
656 | 0 | } |
657 | | static int |
658 | | flp_text_current_width(const gs_text_enum_t *pte, gs_point *pwidth) |
659 | 0 | { |
660 | 0 | return 0; |
661 | 0 | } |
662 | | static int |
663 | | flp_text_set_cache(gs_text_enum_t *pte, const double *pw, |
664 | | gs_text_cache_control_t control) |
665 | 0 | { |
666 | 0 | return 0; |
667 | 0 | } |
668 | | static int |
669 | | flp_text_retry(gs_text_enum_t *pte) |
670 | 0 | { |
671 | 0 | return 0; |
672 | 0 | } |
673 | | static void |
674 | | flp_text_release(gs_text_enum_t *pte, client_name_t cname) |
675 | 0 | { |
676 | 0 | gx_default_text_release(pte, cname); |
677 | 0 | } |
678 | | |
679 | | static const gs_text_enum_procs_t flp_text_procs = { |
680 | | flp_text_resync, flp_text_process, |
681 | | flp_text_is_width_only, flp_text_current_width, |
682 | | flp_text_set_cache, flp_text_retry, |
683 | | flp_text_release |
684 | | }; |
685 | | |
686 | | /* The device method which we do actually need to define. Either we are skipping the page, |
687 | | * in which case we create a text enumerator with our dummy procedures, or we are leaving it |
688 | | * up to the device, in which case we simply pass on the 'begin' method to the device. |
689 | | */ |
690 | | int flp_text_begin(gx_device *dev, gs_gstate *pgs, const gs_text_params_t *text, |
691 | | gs_font *font, const gx_clip_path *pcpath, |
692 | | gs_text_enum_t **ppte) |
693 | 0 | { |
694 | 0 | flp_text_enum_t *penum; |
695 | 0 | int code; |
696 | 0 | gs_memory_t *memory = pgs->memory; |
697 | | |
698 | | /* We don't want to simply ignore stringwidth for 2 reasons; |
699 | | * firstly because following elelments may be positioned based on the value returned |
700 | | * secondly because op_show_restore executes an unconditional grestore, assuming |
701 | | * that a gsave has been done simply *because* its a tringwidth operation ! |
702 | | */ |
703 | 0 | if (dev->DisablePageHandler || ((text->operation & TEXT_DO_NONE) && (text->operation & TEXT_RETURN_WIDTH) && pgs->text_rendering_mode != 3)) |
704 | | /* Note that the high level devices *must* be given the opportunity to 'see' the |
705 | | * stringwidth operation, or they won;t be able to cache the glyphs properly. |
706 | | * So always pass stringwidth operations to the child. |
707 | | */ |
708 | 0 | return default_subclass_text_begin(dev, pgs, text, font, pcpath, ppte); |
709 | | |
710 | 0 | code = SkipPage(dev); |
711 | 0 | if (code < 0) |
712 | 0 | return code; |
713 | 0 | if (!code) |
714 | 0 | return default_subclass_text_begin(dev, pgs, text, font, pcpath, ppte); |
715 | | |
716 | 0 | rc_alloc_struct_1(penum, flp_text_enum_t, &st_flp_text_enum, memory, |
717 | 0 | return_error(gs_error_VMerror), "gdev_flp_text_begin"); |
718 | 0 | penum->rc.free = rc_free_text_enum; |
719 | 0 | code = gs_text_enum_init((gs_text_enum_t *)penum, &flp_text_procs, |
720 | 0 | dev, pgs, text, font, pcpath, memory); |
721 | 0 | if (code < 0) { |
722 | 0 | gs_free_object(memory, penum, "gdev_flp_text_begin"); |
723 | 0 | return code; |
724 | 0 | } |
725 | 0 | *ppte = (gs_text_enum_t *)penum; |
726 | |
|
727 | 0 | return 0; |
728 | 0 | } |
729 | | |
730 | | int flp_begin_transparency_group(gx_device *dev, const gs_transparency_group_params_t *ptgp, |
731 | | const gs_rect *pbbox, gs_gstate *pgs, gs_memory_t *mem) |
732 | 0 | { |
733 | 0 | int code = SkipPage(dev); |
734 | |
|
735 | 0 | if (code < 0) |
736 | 0 | return code; |
737 | 0 | if (!code) |
738 | 0 | return default_subclass_begin_transparency_group(dev, ptgp, pbbox, pgs, mem); |
739 | | |
740 | 0 | return 0; |
741 | 0 | } |
742 | | |
743 | | int flp_end_transparency_group(gx_device *dev, gs_gstate *pgs) |
744 | 0 | { |
745 | 0 | int code = SkipPage(dev); |
746 | |
|
747 | 0 | if (code < 0) |
748 | 0 | return code; |
749 | 0 | if (!code) |
750 | 0 | return default_subclass_end_transparency_group(dev, pgs); |
751 | | |
752 | 0 | return 0; |
753 | 0 | } |
754 | | |
755 | | int flp_begin_transparency_mask(gx_device *dev, const gx_transparency_mask_params_t *ptmp, |
756 | | const gs_rect *pbbox, gs_gstate *pgs, gs_memory_t *mem) |
757 | 0 | { |
758 | 0 | int code = SkipPage(dev); |
759 | |
|
760 | 0 | if (code < 0) |
761 | 0 | return code; |
762 | 0 | if (!code) |
763 | 0 | return default_subclass_begin_transparency_mask(dev, ptmp, pbbox, pgs, mem); |
764 | | |
765 | 0 | return 0; |
766 | 0 | } |
767 | | |
768 | | int flp_end_transparency_mask(gx_device *dev, gs_gstate *pgs) |
769 | 0 | { |
770 | 0 | int code = SkipPage(dev); |
771 | |
|
772 | 0 | if (code < 0) |
773 | 0 | return code; |
774 | 0 | if (!code) |
775 | 0 | return default_subclass_end_transparency_mask(dev, pgs); |
776 | | |
777 | 0 | return 0; |
778 | 0 | } |
779 | | |
780 | | int flp_discard_transparency_layer(gx_device *dev, gs_gstate *pgs) |
781 | 0 | { |
782 | 0 | int code = SkipPage(dev); |
783 | |
|
784 | 0 | if (code < 0) |
785 | 0 | return code; |
786 | 0 | if (!code) |
787 | 0 | return default_subclass_discard_transparency_layer(dev, pgs); |
788 | | |
789 | 0 | return 0; |
790 | 0 | } |
791 | | |
792 | | int flp_fill_rectangle_hl_color(gx_device *dev, const gs_fixed_rect *rect, |
793 | | const gs_gstate *pgs, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath) |
794 | 0 | { |
795 | 0 | int code = SkipPage(dev); |
796 | |
|
797 | 0 | if (code < 0) |
798 | 0 | return code; |
799 | 0 | if (!code) |
800 | 0 | return default_subclass_fill_rectangle_hl_color(dev, rect, pgs, pdcolor, pcpath); |
801 | | |
802 | 0 | return 0; |
803 | 0 | } |
804 | | |
805 | | int flp_fill_linear_color_scanline(gx_device *dev, const gs_fill_attributes *fa, |
806 | | int i, int j, int w, const frac31 *c0, const int32_t *c0_f, const int32_t *cg_num, |
807 | | int32_t cg_den) |
808 | 0 | { |
809 | 0 | int code = SkipPage(dev); |
810 | |
|
811 | 0 | if (code < 0) |
812 | 0 | return code; |
813 | 0 | if (!code) |
814 | 0 | return default_subclass_fill_linear_color_scanline(dev, fa, i, j, w, c0, c0_f, cg_num, cg_den); |
815 | | |
816 | 0 | return 0; |
817 | 0 | } |
818 | | |
819 | | int flp_fill_linear_color_trapezoid(gx_device *dev, const gs_fill_attributes *fa, |
820 | | const gs_fixed_point *p0, const gs_fixed_point *p1, |
821 | | const gs_fixed_point *p2, const gs_fixed_point *p3, |
822 | | const frac31 *c0, const frac31 *c1, |
823 | | const frac31 *c2, const frac31 *c3) |
824 | 0 | { |
825 | 0 | int code = SkipPage(dev); |
826 | |
|
827 | 0 | if (code < 0) |
828 | 0 | return code; |
829 | 0 | if (!code) |
830 | 0 | return default_subclass_fill_linear_color_trapezoid(dev, fa, p0, p1, p2, p3, c0, c1, c2, c3); |
831 | | |
832 | 0 | return 0; |
833 | 0 | } |
834 | | |
835 | | int flp_fill_linear_color_triangle(gx_device *dev, const gs_fill_attributes *fa, |
836 | | const gs_fixed_point *p0, const gs_fixed_point *p1, |
837 | | const gs_fixed_point *p2, const frac31 *c0, const frac31 *c1, const frac31 *c2) |
838 | 0 | { |
839 | 0 | int code = SkipPage(dev); |
840 | |
|
841 | 0 | if (code < 0) |
842 | 0 | return code; |
843 | 0 | if (!code) |
844 | 0 | return default_subclass_fill_linear_color_triangle(dev, fa, p0, p1, p2, c0, c1, c2); |
845 | | |
846 | 0 | return 0; |
847 | 0 | } |
848 | | |
849 | | int flp_fillpage(gx_device *dev, gs_gstate * pgs, gx_device_color *pdevc) |
850 | 0 | { |
851 | 0 | first_last_subclass_data *psubclass_data = dev->subclass_data; |
852 | 0 | int code = SkipPage(dev); |
853 | |
|
854 | 0 | if (code < 0) |
855 | 0 | return code; |
856 | | |
857 | | /* allow fillpage to be processed at the first page */ |
858 | | /* This is needed to allow all parsers to start with non-ordered PageList */ |
859 | 0 | if (!code || psubclass_data->PageCount == 0) |
860 | 0 | return default_subclass_fillpage(dev, pgs, pdevc); |
861 | | |
862 | 0 | return 0; |
863 | 0 | } |
864 | | |
865 | | int flp_push_transparency_state(gx_device *dev, gs_gstate *pgs) |
866 | 0 | { |
867 | 0 | int code = SkipPage(dev); |
868 | |
|
869 | 0 | if (code < 0) |
870 | 0 | return code; |
871 | 0 | if (!code) |
872 | 0 | return default_subclass_push_transparency_state(dev, pgs); |
873 | | |
874 | 0 | return 0; |
875 | 0 | } |
876 | | |
877 | | int flp_pop_transparency_state(gx_device *dev, gs_gstate *pgs) |
878 | 0 | { |
879 | 0 | int code = SkipPage(dev); |
880 | |
|
881 | 0 | if (code < 0) |
882 | 0 | return code; |
883 | 0 | if (!code) |
884 | 0 | return default_subclass_pop_transparency_state(dev, pgs); |
885 | | |
886 | 0 | return 0; |
887 | 0 | } |
888 | | |
889 | | int flp_put_image(gx_device *dev, gx_device *mdev, const byte **buffers, int num_chan, int x, int y, |
890 | | int width, int height, int row_stride, |
891 | | int alpha_plane_index, int tag_plane_index) |
892 | 0 | { |
893 | 0 | int code = SkipPage(dev); |
894 | |
|
895 | 0 | if (code < 0) |
896 | 0 | return code; |
897 | 0 | if (!code) |
898 | 0 | return default_subclass_put_image(dev, mdev, buffers, num_chan, x, y, width, height, row_stride, alpha_plane_index, tag_plane_index); |
899 | | |
900 | 0 | return 0; |
901 | 0 | } |
902 | | |
903 | | int flp_copy_planes(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, |
904 | | int x, int y, int width, int height, int plane_height) |
905 | 0 | { |
906 | 0 | int code = SkipPage(dev); |
907 | |
|
908 | 0 | if (code < 0) |
909 | 0 | return code; |
910 | 0 | if (!code) |
911 | 0 | return default_subclass_copy_planes(dev, data, data_x, raster, id, x, y, width, height, plane_height); |
912 | | |
913 | 0 | return 0; |
914 | 0 | } |
915 | | |
916 | | int flp_strip_copy_rop2(gx_device *dev, const byte *sdata, int sourcex, uint sraster, gx_bitmap_id id, |
917 | | const gx_color_index *scolors, const gx_strip_bitmap *textures, const gx_color_index *tcolors, |
918 | | int x, int y, int width, int height, int phase_x, int phase_y, gs_logical_operation_t lop, uint planar_height) |
919 | 0 | { |
920 | 0 | int code = SkipPage(dev); |
921 | |
|
922 | 0 | if (code < 0) |
923 | 0 | return code; |
924 | 0 | if (!code) |
925 | 0 | return default_subclass_strip_copy_rop2(dev, sdata, sourcex, sraster, id, scolors, textures, tcolors, x, y, width, height, phase_x, phase_y, lop, planar_height); |
926 | | |
927 | 0 | return 0; |
928 | 0 | } |
929 | | |
930 | | int flp_strip_tile_rect_devn(gx_device *dev, const gx_strip_bitmap *tiles, int x, int y, int width, int height, |
931 | | const gx_drawing_color *pdcolor0, const gx_drawing_color *pdcolor1, int phase_x, int phase_y) |
932 | 0 | { |
933 | 0 | int code = SkipPage(dev); |
934 | |
|
935 | 0 | if (code < 0) |
936 | 0 | return code; |
937 | 0 | if (!code) |
938 | 0 | return default_subclass_strip_tile_rect_devn(dev, tiles, x, y, width, height, pdcolor0, pdcolor1, phase_x, phase_y); |
939 | | |
940 | 0 | return 0; |
941 | 0 | } |
942 | | |
943 | | int flp_copy_alpha_hl_color(gx_device *dev, const byte *data, int data_x, |
944 | | int raster, gx_bitmap_id id, int x, int y, int width, int height, |
945 | | const gx_drawing_color *pdcolor, int depth) |
946 | 0 | { |
947 | 0 | int code = SkipPage(dev); |
948 | |
|
949 | 0 | if (code < 0) |
950 | 0 | return code; |
951 | 0 | if (!code) |
952 | 0 | return default_subclass_copy_alpha_hl_color(dev, data, data_x, raster, id, x, y, width, height, pdcolor, depth); |
953 | | |
954 | 0 | return 0; |
955 | 0 | } |
956 | | |
957 | | int flp_process_page(gx_device *dev, gx_process_page_options_t *options) |
958 | 0 | { |
959 | 0 | int code = SkipPage(dev); |
960 | |
|
961 | 0 | if (code < 0) |
962 | 0 | return code; |
963 | 0 | if (!code) |
964 | 0 | return default_subclass_process_page(dev, options); |
965 | | |
966 | 0 | return 0; |
967 | 0 | } |
968 | | |
969 | | int flp_fill_stroke_path(gx_device *dev, const gs_gstate *pgs, gx_path *ppath, |
970 | | const gx_fill_params *fill_params, const gx_drawing_color *pdcolor_fill, |
971 | | const gx_stroke_params *stroke_params, const gx_drawing_color *pdcolor_stroke, |
972 | | const gx_clip_path *pcpath) |
973 | 0 | { |
974 | 0 | int code = SkipPage(dev); |
975 | |
|
976 | 0 | if (code < 0) |
977 | 0 | return code; |
978 | 0 | if (!code) |
979 | 0 | return default_subclass_fill_stroke_path(dev, pgs, ppath, fill_params, pdcolor_fill, |
980 | 0 | stroke_params, pdcolor_stroke, pcpath); |
981 | 0 | return 0; |
982 | 0 | } |
983 | | |
984 | | int flp_transform_pixel_region(gx_device *dev, transform_pixel_region_reason reason, transform_pixel_region_data *data) |
985 | 0 | { |
986 | 0 | int code = SkipPage(dev); |
987 | |
|
988 | 0 | if (code < 0) |
989 | 0 | return code; |
990 | 0 | if (!code) |
991 | 0 | return default_subclass_transform_pixel_region(dev, reason, data); |
992 | | |
993 | 0 | return 0; |
994 | 0 | } |
995 | | |
996 | | static void |
997 | | flp_initialize_device_procs(gx_device *dev) |
998 | 0 | { |
999 | 0 | default_subclass_initialize_device_procs(dev); |
1000 | |
|
1001 | 0 | set_dev_proc(dev, output_page, flp_output_page); |
1002 | 0 | set_dev_proc(dev, close_device, flp_close_device); |
1003 | 0 | set_dev_proc(dev, fill_rectangle, flp_fill_rectangle); |
1004 | 0 | set_dev_proc(dev, copy_mono, flp_copy_mono); |
1005 | 0 | set_dev_proc(dev, copy_color, flp_copy_color); |
1006 | 0 | set_dev_proc(dev, put_params, flp_put_params); |
1007 | 0 | set_dev_proc(dev, get_alpha_bits, flp_get_alpha_bits); |
1008 | 0 | set_dev_proc(dev, copy_alpha, flp_copy_alpha); |
1009 | 0 | set_dev_proc(dev, fill_path, flp_fill_path); |
1010 | 0 | set_dev_proc(dev, stroke_path, flp_stroke_path); |
1011 | 0 | set_dev_proc(dev, fill_mask, flp_fill_mask); |
1012 | 0 | set_dev_proc(dev, fill_trapezoid, flp_fill_trapezoid); |
1013 | 0 | set_dev_proc(dev, fill_parallelogram, flp_fill_parallelogram); |
1014 | 0 | set_dev_proc(dev, fill_triangle, flp_fill_triangle); |
1015 | 0 | set_dev_proc(dev, draw_thin_line, flp_draw_thin_line); |
1016 | 0 | set_dev_proc(dev, strip_tile_rectangle, flp_strip_tile_rectangle); |
1017 | 0 | set_dev_proc(dev, begin_typed_image, flp_begin_typed_image); |
1018 | 0 | set_dev_proc(dev, get_bits_rectangle, flp_get_bits_rectangle); |
1019 | 0 | set_dev_proc(dev, composite, flp_composite); |
1020 | 0 | set_dev_proc(dev, text_begin, flp_text_begin); |
1021 | 0 | set_dev_proc(dev, begin_transparency_group, flp_begin_transparency_group); |
1022 | 0 | set_dev_proc(dev, end_transparency_group, flp_end_transparency_group); |
1023 | 0 | set_dev_proc(dev, begin_transparency_mask, flp_begin_transparency_mask); |
1024 | 0 | set_dev_proc(dev, end_transparency_mask, flp_end_transparency_mask); |
1025 | 0 | set_dev_proc(dev, discard_transparency_layer, flp_discard_transparency_layer); |
1026 | 0 | set_dev_proc(dev, fill_rectangle_hl_color, flp_fill_rectangle_hl_color); |
1027 | 0 | set_dev_proc(dev, fill_linear_color_scanline, flp_fill_linear_color_scanline); |
1028 | 0 | set_dev_proc(dev, fill_linear_color_trapezoid, flp_fill_linear_color_trapezoid); |
1029 | 0 | set_dev_proc(dev, fill_linear_color_triangle, flp_fill_linear_color_triangle); |
1030 | 0 | set_dev_proc(dev, fillpage, flp_fillpage); |
1031 | 0 | set_dev_proc(dev, push_transparency_state, flp_push_transparency_state); |
1032 | 0 | set_dev_proc(dev, pop_transparency_state, flp_pop_transparency_state); |
1033 | 0 | set_dev_proc(dev, put_image, flp_put_image); |
1034 | 0 | set_dev_proc(dev, copy_planes, flp_copy_planes); |
1035 | 0 | set_dev_proc(dev, strip_copy_rop2, flp_strip_copy_rop2); |
1036 | 0 | set_dev_proc(dev, strip_tile_rect_devn, flp_strip_tile_rect_devn); |
1037 | 0 | set_dev_proc(dev, copy_alpha_hl_color, flp_copy_alpha_hl_color); |
1038 | 0 | set_dev_proc(dev, process_page, flp_process_page); |
1039 | 0 | set_dev_proc(dev, transform_pixel_region, flp_transform_pixel_region); |
1040 | 0 | set_dev_proc(dev, fill_stroke_path, flp_fill_stroke_path); |
1041 | 0 | } |