~ubuntu-branches/ubuntu/oneiric/ghostscript/oneiric

« back to all changes in this revision

Viewing changes to base/gdevprn.h

  • Committer: Bazaar Package Importer
  • Author(s): Till Kamppeter
  • Date: 2011-07-15 16:49:55 UTC
  • mfrom: (1.1.23 upstream)
  • Revision ID: james.westby@ubuntu.com-20110715164955-uga6qibao6kez05c
Tags: 9.04~dfsg~20110715-0ubuntu1
* New upstream release
   - GIT snapshot from Jult, 12 2011.
* debian/patches/020110406~a54df2d.patch,
  debian/patches/020110408~0791cc8.patch,
  debian/patches/020110408~507cbee.patch,
  debian/patches/020110411~4509a49.patch,
  debian/patches/020110412~78bb9a6.patch,
  debian/patches/020110418~a05ab8a.patch,
  debian/patches/020110420~20b6c78.patch,
  debian/patches/020110420~4ddefa2.patch: Removed upstream patches.
* debian/rules: Generate ABI version number (variable "abi") correctly,
  cutting off repackaging and pre-release parts.
* debian/rules: Added ./lcms2/ directory to DEB_UPSTREAM_REPACKAGE_EXCLUDES.
* debian/copyright: Added lcms2/* to the list of excluded files.
* debian/symbols.common: Updated for new upstream source. Applied patch
  which dpkg-gensymbols generated for debian/libgs9.symbols to this file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Copyright (C) 2001-2006 Artifex Software, Inc.
2
2
   All Rights Reserved.
3
 
  
 
3
 
4
4
   This software is provided AS-IS with no warranty, either express or
5
5
   implied.
6
6
 
11
11
   San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
12
12
*/
13
13
 
14
 
/* $Id: gdevprn.h 9683 2009-04-24 01:06:30Z giles $ */
 
14
/* $Id$ */
15
15
/* Common header file for memory-buffered printers */
16
16
 
17
17
#ifndef gdevprn_INCLUDED
218
218
};
219
219
 
220
220
#define gx_prn_device_common\
221
 
        byte skip[max(sizeof(gx_device_memory), sizeof(gx_device_clist)) -\
222
 
                  sizeof(gx_device) + sizeof(double) /* padding */];\
223
 
        gx_printer_device_procs printer_procs;\
224
 
                /* ------ Device parameters that must be set ------ */\
225
 
                /* ------ before calling the device open routine. ------ */\
226
 
        gdev_prn_space_params space_params;\
227
 
        char fname[prn_fname_sizeof];   /* OutputFile */\
228
 
                /* ------ Other device parameters ------ */\
229
 
        bool OpenOutputFile;\
230
 
        bool ReopenPerPage;\
 
221
        byte skip[max(sizeof(gx_device_memory), sizeof(gx_device_clist)) -\
 
222
                  sizeof(gx_device) + sizeof(double) /* padding */];\
 
223
        gx_printer_device_procs printer_procs;\
 
224
                /* ------ Device parameters that must be set ------ */\
 
225
                /* ------ before calling the device open routine. ------ */\
 
226
        gdev_prn_space_params space_params;\
 
227
        char fname[prn_fname_sizeof];   /* OutputFile */\
 
228
                /* ------ Other device parameters ------ */\
 
229
        bool OpenOutputFile;\
 
230
        bool ReopenPerPage;\
231
231
        bool page_uses_transparency; /* PDF 1.4 transparency is used on page */\
232
 
        bool Duplex;\
233
 
          int Duplex_set;               /* -1 = not supported */\
234
 
                /* ------ End of parameters ------ */\
235
 
        bool file_is_new;               /* true iff file just opened */\
236
 
        FILE *file;                     /* output file */\
237
 
        long buffer_space;      /* amount of space for clist buffer, */\
238
 
                                        /* 0 means not using clist */\
239
 
        byte *buf;                      /* buffer for rendering */\
240
 
                /* ---- Begin async rendering support --- */\
241
 
        gs_memory_t *buffer_memory;     /* allocator for command list */\
242
 
        gs_memory_t *bandlist_memory;   /* allocator for bandlist files */\
243
 
        proc_free_up_bandlist_memory((*free_up_bandlist_memory));       /* if nz, proc to free some bandlist memory */\
244
 
        gx_page_queue_t *page_queue;    /* if <> 0,page queue for gdevprna NOT GC'd */\
245
 
        bool is_async_renderer;         /* device is only the rendering part of async device */\
246
 
        gx_device_printer *async_renderer;      /* in async writer, pointer to async renderer */\
247
 
        uint clist_disable_mask;        /* mask of clist options to disable */\
248
 
                /* ---- End async rendering support --- */\
249
 
        int num_render_threads_requested;       /* for multiple band rendering threads */\
250
 
        gx_device_procs save_procs_while_delaying_erasepage;    /* save device procs while delaying erasepage. */\
251
 
        gx_device_procs orig_procs      /* original (std_)procs */
 
232
        bool Duplex;\
 
233
          int Duplex_set;               /* -1 = not supported */\
 
234
                /* ------ End of parameters ------ */\
 
235
        bool file_is_new;               /* true iff file just opened */\
 
236
        FILE *file;                     /* output file */\
 
237
        long buffer_space;      /* amount of space for clist buffer, */\
 
238
                                        /* 0 means not using clist */\
 
239
        byte *buf;                      /* buffer for rendering */\
 
240
                /* ---- Begin async rendering support --- */\
 
241
        gs_memory_t *buffer_memory;     /* allocator for command list */\
 
242
        gs_memory_t *bandlist_memory;   /* allocator for bandlist files */\
 
243
        proc_free_up_bandlist_memory((*free_up_bandlist_memory));       /* if nz, proc to free some bandlist memory */\
 
244
        gx_page_queue_t *page_queue;    /* if <> 0,page queue for gdevprna NOT GC'd */\
 
245
        bool is_async_renderer;         /* device is only the rendering part of async device */\
 
246
        gx_device_printer *async_renderer;      /* in async writer, pointer to async renderer */\
 
247
        uint clist_disable_mask;        /* mask of clist options to disable */\
 
248
                /* ---- End async rendering support --- */\
 
249
        int num_render_threads_requested;       /* for multiple band rendering threads */\
 
250
        gx_device_procs save_procs_while_delaying_erasepage;    /* save device procs while delaying erasepage. */\
 
251
        gx_device_procs orig_procs      /* original (std_)procs */
252
252
 
253
253
/* The device descriptor */
254
254
struct gx_device_printer_s {
293
293
  prn_color_params_procs(p_open, p_output_page, p_close, p_map_rgb_color, p_map_color_rgb, gdev_prn_get_params, gdev_prn_put_params)
294
294
/* See gdev_prn_open for explanation of the NULLs below. */
295
295
#define prn_color_params_procs(p_open, p_output_page, p_close, p_map_rgb_color, p_map_color_rgb, p_get_params, p_put_params) {\
296
 
        p_open,\
297
 
        NULL,   /* get_initial_matrix */\
298
 
        NULL,   /* sync_output */\
299
 
        p_output_page,\
300
 
        p_close,\
301
 
        p_map_rgb_color,\
302
 
        p_map_color_rgb,\
303
 
        NULL,   /* fill_rectangle */\
304
 
        NULL,   /* tile_rectangle */\
305
 
        NULL,   /* copy_mono */\
306
 
        NULL,   /* copy_color */\
307
 
        NULL,   /* draw_line */\
308
 
        NULL,   /* get_bits */\
309
 
        p_get_params,\
310
 
        p_put_params,\
311
 
        NULL,   /* map_cmyk_color */\
312
 
        NULL,   /* get_xfont_procs */\
313
 
        NULL,   /* get_xfont_device */\
314
 
        NULL,   /* map_rgb_alpha_color */\
315
 
        gx_page_device_get_page_device,\
316
 
        NULL,   /* get_alpha_bits */\
317
 
        NULL,   /* copy_alpha */\
318
 
        NULL,   /* get_band */\
319
 
        NULL,   /* copy_rop */\
320
 
        NULL,   /* fill_path */\
321
 
        NULL,   /* stroke_path */\
322
 
        NULL,   /* fill_mask */\
323
 
        NULL,   /* fill_trapezoid */\
324
 
        NULL,   /* fill_parallelogram */\
325
 
        NULL,   /* fill_triangle */\
326
 
        NULL,   /* draw_thin_line */\
327
 
        NULL,   /* begin_image */\
328
 
        NULL,   /* image_data */\
329
 
        NULL,   /* end_image */\
330
 
        NULL,   /* strip_tile_rectangle */\
331
 
        NULL,   /* strip_copy_rop, */\
332
 
        NULL,   /* get_clipping_box */\
333
 
        NULL,   /* begin_typed_image */\
334
 
        NULL,   /* get_bits_rectangle */\
335
 
        NULL,   /* map_color_rgb_alpha */\
336
 
        NULL,   /* create_compositor */\
337
 
        NULL,   /* get_hardware_params */\
338
 
        NULL,   /* text_begin */\
339
 
        NULL    /* finish_copydevice */\
 
296
        p_open,\
 
297
        NULL,   /* get_initial_matrix */\
 
298
        NULL,   /* sync_output */\
 
299
        p_output_page,\
 
300
        p_close,\
 
301
        p_map_rgb_color,\
 
302
        p_map_color_rgb,\
 
303
        NULL,   /* fill_rectangle */\
 
304
        NULL,   /* tile_rectangle */\
 
305
        NULL,   /* copy_mono */\
 
306
        NULL,   /* copy_color */\
 
307
        NULL,   /* draw_line */\
 
308
        NULL,   /* get_bits */\
 
309
        p_get_params,\
 
310
        p_put_params,\
 
311
        NULL,   /* map_cmyk_color */\
 
312
        NULL,   /* get_xfont_procs */\
 
313
        NULL,   /* get_xfont_device */\
 
314
        NULL,   /* map_rgb_alpha_color */\
 
315
        gx_page_device_get_page_device,\
 
316
        NULL,   /* get_alpha_bits */\
 
317
        NULL,   /* copy_alpha */\
 
318
        NULL,   /* get_band */\
 
319
        NULL,   /* copy_rop */\
 
320
        NULL,   /* fill_path */\
 
321
        NULL,   /* stroke_path */\
 
322
        NULL,   /* fill_mask */\
 
323
        NULL,   /* fill_trapezoid */\
 
324
        NULL,   /* fill_parallelogram */\
 
325
        NULL,   /* fill_triangle */\
 
326
        NULL,   /* draw_thin_line */\
 
327
        NULL,   /* begin_image */\
 
328
        NULL,   /* image_data */\
 
329
        NULL,   /* end_image */\
 
330
        NULL,   /* strip_tile_rectangle */\
 
331
        NULL,   /* strip_copy_rop, */\
 
332
        NULL,   /* get_clipping_box */\
 
333
        NULL,   /* begin_typed_image */\
 
334
        NULL,   /* get_bits_rectangle */\
 
335
        NULL,   /* map_color_rgb_alpha */\
 
336
        NULL,   /* create_compositor */\
 
337
        NULL,   /* get_hardware_params */\
 
338
        NULL,   /* text_begin */\
 
339
        NULL,   /* finish_copydevice */\
 
340
        NULL,   /* begin_transparency_group */\
 
341
        NULL,   /* end_transparency_group */\
 
342
        NULL,   /* begin_transparency_mask */\
 
343
        NULL,   /* end_transparency_mask */\
 
344
        NULL,   /* discard_transparency_layer */\
 
345
        NULL,  /* get_color_mapping_procs */\
 
346
        NULL,  /* get_color_comp_index */\
 
347
        NULL,  /* encode_color */\
 
348
        NULL,  /* decode_color */\
 
349
        NULL,  /* pattern_manage */\
 
350
        NULL,  /* fill_rectangle_hl_color */\
 
351
        NULL,  /* include_color_space */\
 
352
        NULL,  /* fill_linear_color_scanline */\
 
353
        NULL,  /* fill_linear_color_trapezoid */\
 
354
        NULL,  /* fill_linear_color_triangle */\
 
355
        NULL,  /* update_spot_equivalent_colors */\
 
356
        NULL,  /* ret_devn_params */\
 
357
        NULL,  /* fillpage */\
 
358
        NULL,  /* push_transparency_state */\
 
359
        NULL,  /* pop_transparency_state */\
 
360
        NULL,  /* put_image */\
 
361
        NULL,  /* dev_spec_op */\
 
362
        NULL,  /* copy plane */\
 
363
        gx_default_get_profile, /* get_profile */\
 
364
        gx_default_set_graphics_type_tag /* set_graphics_type_tag */\
340
365
}
341
366
 
342
367
/* The standard printer device procedures */
358
383
 * Note that print_page and print_page_copies must not both be defaulted.
359
384
 */
360
385
#define prn_device_body_rest2_(print_page, print_page_copies, duplex_set)\
361
 
         { 0 },         /* std_procs */\
362
 
         { 0 },         /* skip */\
363
 
         { print_page,\
364
 
           print_page_copies,\
365
 
           { gx_default_create_buf_device,\
366
 
             gx_default_size_buf_device,\
367
 
             gx_default_setup_buf_device,\
368
 
             gx_default_destroy_buf_device\
369
 
           },\
370
 
           gdev_prn_default_get_space_params,\
371
 
           gx_default_start_render_thread,\
372
 
           gx_default_open_render_device,\
373
 
           gx_default_close_render_device,\
374
 
           gx_default_buffer_page\
375
 
         },\
376
 
         { PRN_MAX_BITMAP, PRN_BUFFER_SPACE,\
377
 
             { BAND_PARAMS_INITIAL_VALUES },\
378
 
           0/*false*/,  /* params_are_read_only */\
379
 
           BandingAuto  /* banding_type */\
380
 
         },\
381
 
         { 0 },         /* fname */\
382
 
        0/*false*/,     /* OpenOutputFile */\
383
 
        0/*false*/,     /* ReopenPerPage */\
384
 
        0/*false*/,     /* page_uses_transparency */\
385
 
        0/*false*/, duplex_set, /* Duplex[_set] */\
386
 
        0/*false*/, 0, 0, 0, /* file_is_new ... buf */\
387
 
        0, 0, 0, 0, 0/*false*/, 0, 0, /* buffer_memory ... clist_dis'_mask */\
388
 
        0,              /* num_render_threads_requested */\
389
 
        { 0 },  /* save_procs_while_delaying_erasepage */\
390
 
        { 0 }   /* ... orig_procs */
 
386
         { 0 },         /* std_procs */\
 
387
         { 0 },         /* skip */\
 
388
         { print_page,\
 
389
           print_page_copies,\
 
390
           { gx_default_create_buf_device,\
 
391
             gx_default_size_buf_device,\
 
392
             gx_default_setup_buf_device,\
 
393
             gx_default_destroy_buf_device\
 
394
           },\
 
395
           gdev_prn_default_get_space_params,\
 
396
           gx_default_start_render_thread,\
 
397
           gx_default_open_render_device,\
 
398
           gx_default_close_render_device,\
 
399
           gx_default_buffer_page\
 
400
         },\
 
401
         { PRN_MAX_BITMAP, PRN_BUFFER_SPACE,\
 
402
             { BAND_PARAMS_INITIAL_VALUES },\
 
403
           0/*false*/,  /* params_are_read_only */\
 
404
           BandingAuto  /* banding_type */\
 
405
         },\
 
406
         { 0 },         /* fname */\
 
407
        0/*false*/,     /* OpenOutputFile */\
 
408
        0/*false*/,     /* ReopenPerPage */\
 
409
        0/*false*/,     /* page_uses_transparency */\
 
410
        0/*false*/, duplex_set, /* Duplex[_set] */\
 
411
        0/*false*/, 0, 0, 0, /* file_is_new ... buf */\
 
412
        0, 0, 0, 0, 0/*false*/, 0, 0, /* buffer_memory ... clist_dis'_mask */\
 
413
        0,              /* num_render_threads_requested */\
 
414
        { 0 },  /* save_procs_while_delaying_erasepage */\
 
415
        { 0 }   /* ... orig_procs */
391
416
#define prn_device_body_rest_(print_page)\
392
417
  prn_device_body_rest2_(print_page, gx_default_print_page_copies, -1)
393
418
#define prn_device_body_copies_rest_(print_page_copies)\
396
421
/* The Sun cc compiler won't allow \ within a macro argument list. */
397
422
/* This accounts for the short parameter names here and below. */
398
423
#define prn_device_margins_body(dtype, procs, dname, w10, h10, xdpi, ydpi, lo, to, lm, bm, rm, tm, ncomp, depth, mg, mc, dg, dc, print_page)\
399
 
        std_device_full_body_type(dtype, &procs, dname, &st_device_printer,\
400
 
          (int)((float)(w10) * (xdpi) / 10 + 0.5),\
401
 
          (int)((float)(h10) * (ydpi) / 10 + 0.5),\
402
 
          xdpi, ydpi,\
403
 
          ncomp, depth, mg, mc, dg, dc,\
404
 
          (float)(-(lo) * (xdpi)), (float)(-(to) * (ydpi)),\
405
 
          (float)((lm) * 72.0), (float)((bm) * 72.0),\
406
 
          (float)((rm) * 72.0), (float)((tm) * 72.0)\
407
 
        ),\
408
 
        prn_device_body_rest_(print_page)
 
424
        std_device_full_body_type(dtype, &procs, dname, &st_device_printer,\
 
425
          (int)((float)(w10) * (xdpi) / 10 + 0.5),\
 
426
          (int)((float)(h10) * (ydpi) / 10 + 0.5),\
 
427
          xdpi, ydpi,\
 
428
          ncomp, depth, mg, mc, dg, dc,\
 
429
          (float)(-(lo) * (xdpi)), (float)(-(to) * (ydpi)),\
 
430
          (float)((lm) * 72.0), (float)((bm) * 72.0),\
 
431
          (float)((rm) * 72.0), (float)((tm) * 72.0)\
 
432
        ),\
 
433
        prn_device_body_rest_(print_page)
409
434
#define prn_device_margins_stype_body(dtype, procs, dname, stype, w10, h10, xdpi, ydpi, lo, to, lm, bm, rm, tm, ncomp, depth, mg, mc, dg, dc, print_page)\
410
 
        std_device_full_body_type(dtype, &procs, dname, stype,\
411
 
          (int)((float)(w10) * (xdpi) / 10 + 0.5),\
412
 
          (int)((float)(h10) * (ydpi) / 10 + 0.5),\
413
 
          xdpi, ydpi,\
414
 
          ncomp, depth, mg, mc, dg, dc,\
415
 
          (float)(-(lo) * (xdpi)), (float)(-(to) * (ydpi)),\
416
 
          (float)((lm) * 72.0), (float)((bm) * 72.0),\
417
 
          (float)((rm) * 72.0), (float)((tm) * 72.0)\
418
 
        ),\
419
 
        prn_device_body_rest_(print_page)
 
435
        std_device_full_body_type(dtype, &procs, dname, stype,\
 
436
          (int)((float)(w10) * (xdpi) / 10 + 0.5),\
 
437
          (int)((float)(h10) * (ydpi) / 10 + 0.5),\
 
438
          xdpi, ydpi,\
 
439
          ncomp, depth, mg, mc, dg, dc,\
 
440
          (float)(-(lo) * (xdpi)), (float)(-(to) * (ydpi)),\
 
441
          (float)((lm) * 72.0), (float)((bm) * 72.0),\
 
442
          (float)((rm) * 72.0), (float)((tm) * 72.0)\
 
443
        ),\
 
444
        prn_device_body_rest_(print_page)
420
445
 
421
446
#define prn_device_body(dtype, procs, dname, w10, h10, xdpi, ydpi, lm, bm, rm, tm, ncomp, depth, mg, mc, dg, dc, print_page)\
422
447
  prn_device_margins_body(dtype, procs, dname, w10, h10, xdpi, ydpi,\
426
451
    lm, tm, lm, bm, rm, tm, ncomp, depth, mg, mc, dg, dc, print_page)
427
452
 
428
453
#define prn_device_margins_body_extended(dtype, procs, dname, w10, h10, xdpi, ydpi, lo, to, lm, bm, rm, tm, mcomp, ncomp, pol, depth, gi, mg, mc, dg, dc, ef, cn, print_page)\
429
 
        std_device_full_body_type_extended(dtype, &procs, dname, &st_device_printer,\
430
 
          (int)((long)(w10) * (xdpi) / 10),\
431
 
          (int)((long)(h10) * (ydpi) / 10),\
432
 
          xdpi, ydpi,\
433
 
          mcomp, ncomp, pol, depth, gi, mg, mc, dg, dc, ef, cn,\
434
 
          -(lo) * (xdpi), -(to) * (ydpi),\
435
 
          (lm) * 72.0, (bm) * 72.0,\
436
 
          (rm) * 72.0, (tm) * 72.0\
437
 
        ),\
438
 
        prn_device_body_rest_(print_page)
 
454
        std_device_full_body_type_extended(dtype, &procs, dname, &st_device_printer,\
 
455
          (int)((long)(w10) * (xdpi) / 10),\
 
456
          (int)((long)(h10) * (ydpi) / 10),\
 
457
          xdpi, ydpi,\
 
458
          mcomp, ncomp, pol, depth, gi, mg, mc, dg, dc, ef, cn,\
 
459
          -(lo) * (xdpi), -(to) * (ydpi),\
 
460
          (lm) * 72.0, (bm) * 72.0,\
 
461
          (rm) * 72.0, (tm) * 72.0\
 
462
        ),\
 
463
        prn_device_body_rest_(print_page)
439
464
 
440
465
#define prn_device_body_extended(dtype, procs, dname, w10, h10, xdpi, ydpi, lm, bm, rm, tm, mcomp, ncomp, pol, depth, gi, mg, mc, dg, dc, ef, cn, print_page)\
441
466
  prn_device_margins_body_extended(dtype, procs, dname, w10, h10, xdpi, ydpi,\
442
467
    lm, tm, lm, bm, rm, tm, mcomp, ncomp, pol, depth, gi, mg, mc, dg, dc, ef, cn, print_page)
443
468
 
444
469
#define prn_device_std_margins_body(dtype, procs, dname, w10, h10, xdpi, ydpi, lo, to, lm, bm, rm, tm, color_bits, print_page)\
445
 
        std_device_std_color_full_body_type(dtype, &procs, dname, &st_device_printer,\
446
 
          (int)((float)(w10) * (xdpi) / 10 + 0.5),\
447
 
          (int)((float)(h10) * (ydpi) / 10 + 0.5),\
448
 
          xdpi, ydpi, color_bits,\
449
 
          (float)(-(lo) * (xdpi)), (float)(-(to) * (ydpi)),\
450
 
          (float)((lm) * 72.0), (float)((bm) * 72.0),\
451
 
          (float)((rm) * 72.0), (float)((tm) * 72.0)\
452
 
        ),\
453
 
        prn_device_body_rest_(print_page)
 
470
        std_device_std_color_full_body_type(dtype, &procs, dname, &st_device_printer,\
 
471
          (int)((float)(w10) * (xdpi) / 10 + 0.5),\
 
472
          (int)((float)(h10) * (ydpi) / 10 + 0.5),\
 
473
          xdpi, ydpi, color_bits,\
 
474
          (float)(-(lo) * (xdpi)), (float)(-(to) * (ydpi)),\
 
475
          (float)((lm) * 72.0), (float)((bm) * 72.0),\
 
476
          (float)((rm) * 72.0), (float)((tm) * 72.0)\
 
477
        ),\
 
478
        prn_device_body_rest_(print_page)
454
479
 
455
480
#define prn_device_std_body(dtype, procs, dname, w10, h10, xdpi, ydpi, lm, bm, rm, tm, color_bits, print_page)\
456
481
  prn_device_std_margins_body(dtype, procs, dname, w10, h10, xdpi, ydpi,\
457
482
    lm, tm, lm, bm, rm, tm, color_bits, print_page)
458
483
 
459
484
#define prn_device_std_margins_body_copies(dtype, procs, dname, w10, h10, xdpi, ydpi, lo, to, lm, bm, rm, tm, color_bits, print_page_copies)\
460
 
        std_device_std_color_full_body_type(dtype, &procs, dname, &st_device_printer,\
461
 
          (int)((float)(w10) * (xdpi) / 10 + 0.5),\
462
 
          (int)((float)(h10) * (ydpi) / 10 + 0.5),\
463
 
          xdpi, ydpi, color_bits,\
464
 
          (float)(-(lo) * (xdpi)), (float)(-(to) * (ydpi)),\
465
 
          (float)((lm) * 72.0), (float)((bm) * 72.0),\
466
 
          (float)((rm) * 72.0), (float)((tm) * 72.0)\
467
 
        ),\
468
 
        prn_device_body_copies_rest_(print_page_copies)
 
485
        std_device_std_color_full_body_type(dtype, &procs, dname, &st_device_printer,\
 
486
          (int)((float)(w10) * (xdpi) / 10 + 0.5),\
 
487
          (int)((float)(h10) * (ydpi) / 10 + 0.5),\
 
488
          xdpi, ydpi, color_bits,\
 
489
          (float)(-(lo) * (xdpi)), (float)(-(to) * (ydpi)),\
 
490
          (float)((lm) * 72.0), (float)((bm) * 72.0),\
 
491
          (float)((rm) * 72.0), (float)((tm) * 72.0)\
 
492
        ),\
 
493
        prn_device_body_copies_rest_(print_page_copies)
469
494
 
470
495
#define prn_device_std_body_copies(dtype, procs, dname, w10, h10, xdpi, ydpi, lm, bm, rm, tm, color_bits, print_page_copies)\
471
496
  prn_device_std_margins_body_copies(dtype, procs, dname, w10, h10, xdpi, ydpi,\
499
524
 */
500
525
/* VMS limits procedure names to 31 characters. */
501
526
int gdev_prn_open_printer_seekable(gx_device *dev, bool binary_mode,
502
 
                                   bool seekable);
 
527
                                   bool seekable);
503
528
/* BACKWARD COMPATIBILITY */
504
529
#define gdev_prn_open_printer_positionable gdev_prn_open_printer_seekable
505
530
/* open_printer defaults positionable = false */
530
555
 * If the parameters are invalid, the procedure returns -1.
531
556
 */
532
557
int gdev_prn_colors_used(gx_device *dev, int y, int height,
533
 
                         gx_colors_used_t *colors_used,
534
 
                         int *range_start);
 
558
                         gx_colors_used_t *colors_used,
 
559
                         int *range_start);
535
560
/*
536
561
 * Determine the colors used in a saved page.  We still need the device
537
562
 * in order to know the total page height.
538
563
 */
539
564
int gx_page_info_colors_used(const gx_device *dev,
540
 
                             const gx_band_page_info_t *page_info,
541
 
                             int y, int height,
542
 
                             gx_colors_used_t *colors_used,
543
 
                             int *range_start);
 
565
                             const gx_band_page_info_t *page_info,
 
566
                             int y, int height,
 
567
                             gx_colors_used_t *colors_used,
 
568
                             int *range_start);
544
569
 
545
570
/*
546
571
 * Render a subrectangle of the page into a target device provided by the
565
590
 * an error.
566
591
 */
567
592
int gdev_prn_render_rectangle(gx_device_printer *pdev,
568
 
                              const gs_int_rect *prect,
569
 
                              gx_device *target,
570
 
                              const gx_render_plane_t *render_plane,
571
 
                              bool clear);
 
593
                              const gs_int_rect *prect,
 
594
                              gx_device *target,
 
595
                              const gx_render_plane_t *render_plane,
 
596
                              bool clear);
572
597
 
573
598
/*
574
599
 * Read one or more rasterized scan lines for printing.
587
612
 * returned.
588
613
 */
589
614
int gdev_prn_get_lines(gx_device_printer *pdev, int y, int height,
590
 
                       byte *buffer, uint bytes_per_line,
591
 
                       byte **actual_buffer, uint *actual_bytes_per_line,
592
 
                       const gx_render_plane_t *render_plane);
 
615
                       byte *buffer, uint bytes_per_line,
 
616
                       byte **actual_buffer, uint *actual_bytes_per_line,
 
617
                       const gx_render_plane_t *render_plane);
593
618
 
594
619
/*
595
620
 * Read a rasterized scan line for sending to the printer.
597
622
 * except that it also calls gdev_prn_clear_trailing_bits.
598
623
 */
599
624
int gdev_prn_get_bits(gx_device_printer *pdev, int y, byte *buffer,
600
 
                      byte **actual_buffer);
 
625
                      byte **actual_buffer);
601
626
 
602
627
/*
603
628
 * Copy scan lines to send to the printer.  This is now DEPRECATED,
614
639
 * a printer device.
615
640
 */
616
641
void gdev_prn_clear_trailing_bits(byte *data, uint raster, int height,
617
 
                                  const gx_device *dev);
 
642
                                  const gx_device *dev);
618
643
 
619
644
/*
620
645
 * Close the printer's output file.
638
663
 
639
664
/* Allocate / reallocate / free printer memory. */
640
665
int gdev_prn_allocate_memory(gx_device *pdev,
641
 
                             gdev_prn_space_params *space,
642
 
                             int new_width, int new_height);
 
666
                             gdev_prn_space_params *space,
 
667
                             int new_width, int new_height);
643
668
int gdev_prn_reallocate_memory(gx_device *pdev,
644
 
                               gdev_prn_space_params *space,
645
 
                               int new_width, int new_height);
 
669
                               gdev_prn_space_params *space,
 
670
                               int new_width, int new_height);
646
671
int gdev_prn_free_memory(gx_device *pdev);
647
672
 
648
673
/*
653
678
 */
654
679
typedef dev_proc_create_buf_device((*create_buf_device_proc_t));
655
680
int gdev_create_buf_device(create_buf_device_proc_t cbd_proc,
656
 
                           gx_device **pbdev, gx_device *target, int y,
657
 
                           const gx_render_plane_t *render_plane,
658
 
                           gs_memory_t *mem, gx_band_complexity_t *band_complexity);
 
681
                           gx_device **pbdev, gx_device *target, int y,
 
682
                           const gx_render_plane_t *render_plane,
 
683
                           gs_memory_t *mem, gx_band_complexity_t *band_complexity);
659
684
 
660
685
/* BACKWARD COMPATIBILITY */
661
686
#define dev_print_scan_lines(dev)\
690
715
static int \
691
716
initproc(gx_device *dev)\
692
717
{       int code = gdev_prn_initialize(dev, dname, pageproc);\
693
 
        gdev_prn_init_color(dev, depth, rcproc, crproc);\
694
 
        return code;\
 
718
        gdev_prn_init_color(dev, depth, rcproc, crproc);\
 
719
        return code;\
695
720
}\
696
721
device_type(dtname, st_prn_device, initproc)
697
722