~ubuntu-branches/ubuntu/oneiric/cups/oneiric-proposed

« back to all changes in this revision

Viewing changes to filter/interpret.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt, Till Kamppeter, Martin Pitt
  • Date: 2011-08-07 12:53:12 UTC
  • mfrom: (1.2.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20110807125312-s323cyb3oqaxaemo
Tags: 1.5.0-1
[ Till Kamppeter ]
* New upstream release
* debian/patches/usb-backend-no-segfault-on-bad-device-id.patch,
  debian/patches/usb-backend-accept-old-usblp-uris.patch,
  debian/patches/use-ps2write-ghostscript-device-for-pdftops-filter.patch:
  Removed, included upstream.
* debian/patches/poppler-based-pdftops-fixes.patch,
  debian/patches/do-not-emit-ps-level-3-with-poppler.patch: Replaced patch
  by a new one only containing the parts which remain after removing the
  parts included upstream.
* debian/patches/pidfile.patch,
  debian/patches/ppd-poll-with-client-conf.patch,
  debian/patches/cups-avahi.patch,
  debian/patches/drop_unnecessary_dependencies.patch,
  debian/patches/do-not-broadcast-with-hostnames.patch,
  debian/patches/ppdc-dynamic-linking.patch,
  debian/patches/pstops-based-workflow-only-for-printing-ps-on-a-ps-printer.patch:
  Manually regenerated to adapt to upstream changes.
* debian/patches/manpage-translations.patch,
  debian/patches/rootbackends-worldreadable.patch,
  debian/patches/no-conffile-timestamp.patch,
  debian/patches/read-embedded-options-from-incoming-postscript-and-add-to-ipp-attrs.patch,
  debian/patches/cups-snmp-oids-device-id-hp-ricoh.patch,
  debian/patches/configure-default-browse-protocols.patch,
  debian/patches/logfiles_adm_readable.patch,
  debian/patches/confdirperms.patch,
  debian/patches/printer-filtering.patch,
  debian/patches/show-compile-command-lines.patch,
  debian/patches/log-debug-history-nearly-unlimited.patch:
  Refreshed using quilt.
* debian/patches/default-ripcache-size-auto.patch: Dropped, as once,
  Ghostscript 9.04 is ignoring the cache size value as it crashes easily
  otherwise (Ghostscript upstream bug #691586) and second, CUPS defaults to
  more reasonable 128 MB (now only used for imagetops).
* debian/patches/support-gzipped-charmaps.patch: Dropped, as the SBCS and
  VBCS character maps are not used any more by CUPS.
* debian/rules: Enable threads in the ./configure command line, as otherwise
  CUPS 1.5.0 does not build at all.
* debian/local/filters/pdf-filters/filter/pdftoijs.cxx,
  debian/local/filters/pdf-filters/filter/pdftoraster.cxx,
  debian/local/filters/pdf-filters/pdftoopvp/pdftoopvp.cxx,
  debian/local/filters/pdf-filters/pdftopdf/pdftopdf.cxx: Under CUPS 1.5.x.
  all programs using the PPD API of CUPS need to explicitly include
  "<cups/ppd.h>". Updated the PDF filter add-on package.
* debian/local/filters/pdf-filters/addtocups: Make the addition of the
  pdftopdf and pdftoopvp directories also work with CUPS 1.5.x.
* debian/local/filters/pdf-filters/addtocups,
  debian/local/filters/pdf-filters/removefromcups: Added a symbolic link
  cups/i18n.h, so that texttopdf builds.
* debian/cups-client.install: Install the new ipptool and its sample
  files and manpages.
* debian/cups-client.install: Commented out lines for dropped man page
  translations: ipptool, lppasswd, client.conf, ipptoolfile, cupsenable,
  lpadmin, lpinfo, cupsreject, cupsdisable, cupsaccept
* debian/cups-common.install, debian/rules: The /usr/share/cups/charmaps
  directory got removed from CUPS.
* debian/libcups2-dev.install: cups/i18n.h got renamed to
  cups/language-private.h. Install this as /usr/include/cups/i18n.h.
* debian/libcups2.symbols, debian/libcupsmime1.symbols: Updated.
* debian/cups.lintian-overrides, debian/cups.postinst, debian/cups.prerm,
  debian/cups.templates, debian/local/apparmor-profile: The "scsi"
  CUPS backend got dropped upstream, removed its treatment from these files.

[ Martin Pitt ]
* Add Serbian (Cyrillic) debconf translations, thanks Zlatan Todoric.
  (Closes: #635105)
* Add Serbian (Latin) debconf translations, thanks Zlatan Todoric.
  (Closes: #635108)
* debian/local/apparmor-profile: Allow access to serial printers on USB
  adapters. (LP: #677432)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * "$Id: interpret.c 8742 2009-07-01 22:32:59Z mike $"
3
 
 *
4
 
 *   PPD command interpreter for the Common UNIX Printing System (CUPS).
5
 
 *
6
 
 *   Copyright 2007-2008 by Apple Inc.
 
2
 * "$Id: interpret.c 9788 2011-05-19 02:50:54Z mike $"
 
3
 *
 
4
 *   PPD command interpreter for CUPS.
 
5
 *
 
6
 *   Copyright 2007-2010 by Apple Inc.
7
7
 *   Copyright 1993-2007 by Easy Software Products.
8
8
 *
9
9
 *   These coded instructions, statements, and computer programs are the
40
40
 * Include necessary headers...
41
41
 */
42
42
 
43
 
#include <cups/string.h>
44
43
#include "image-private.h"
45
 
#include <stdlib.h>
46
44
 
47
45
 
48
46
/*
265
263
  if ((val = cupsGetOption("cupsBorderlessScalingFactor", num_options,
266
264
                           options)) != NULL)
267
265
  {
268
 
    float sc = atof(val);
 
266
    double sc = atof(val);              /* Scale factor */
269
267
 
270
268
    if (sc >= 0.1 && sc <= 2.0)
271
 
      h->cupsBorderlessScalingFactor = sc;
 
269
      h->cupsBorderlessScalingFactor = (float)sc;
272
270
  }
273
271
 
274
272
 /*
303
301
    top    = 792.0f;
304
302
  }
305
303
 
306
 
  h->PageSize[0]           = h->cupsPageSize[0] *
307
 
                             h->cupsBorderlessScalingFactor;
308
 
  h->PageSize[1]           = h->cupsPageSize[1] *
309
 
                             h->cupsBorderlessScalingFactor;
310
 
  h->Margins[0]            = left * h->cupsBorderlessScalingFactor;
311
 
  h->Margins[1]            = bottom * h->cupsBorderlessScalingFactor;
312
 
  h->ImagingBoundingBox[0] = left * h->cupsBorderlessScalingFactor;
313
 
  h->ImagingBoundingBox[1] = bottom * h->cupsBorderlessScalingFactor;
314
 
  h->ImagingBoundingBox[2] = right * h->cupsBorderlessScalingFactor;
315
 
  h->ImagingBoundingBox[3] = top * h->cupsBorderlessScalingFactor;
316
 
  h->cupsImagingBBox[0]    = left;
317
 
  h->cupsImagingBBox[1]    = bottom;
318
 
  h->cupsImagingBBox[2]    = right;
319
 
  h->cupsImagingBBox[3]    = top;
 
304
  h->PageSize[0]           = (unsigned)(h->cupsPageSize[0] *
 
305
                                        h->cupsBorderlessScalingFactor);
 
306
  h->PageSize[1]           = (unsigned)(h->cupsPageSize[1] *
 
307
                                        h->cupsBorderlessScalingFactor);
 
308
  h->Margins[0]            = (unsigned)(left *
 
309
                                        h->cupsBorderlessScalingFactor);
 
310
  h->Margins[1]            = (unsigned)(bottom *
 
311
                                        h->cupsBorderlessScalingFactor);
 
312
  h->ImagingBoundingBox[0] = (unsigned)(left *
 
313
                                        h->cupsBorderlessScalingFactor);
 
314
  h->ImagingBoundingBox[1] = (unsigned)(bottom *
 
315
                                        h->cupsBorderlessScalingFactor);
 
316
  h->ImagingBoundingBox[2] = (unsigned)(right *
 
317
                                        h->cupsBorderlessScalingFactor);
 
318
  h->ImagingBoundingBox[3] = (unsigned)(top *
 
319
                                        h->cupsBorderlessScalingFactor);
 
320
  h->cupsImagingBBox[0]    = (float)left;
 
321
  h->cupsImagingBBox[1]    = (float)bottom;
 
322
  h->cupsImagingBBox[2]    = (float)right;
 
323
  h->cupsImagingBBox[3]    = (float)top;
320
324
 
321
325
 /*
322
326
  * Use the callback to validate the page header...
360
364
    case CUPS_CSPACE_WHITE :
361
365
    case CUPS_CSPACE_GOLD :
362
366
    case CUPS_CSPACE_SILVER :
 
367
    case CUPS_CSPACE_SW :
363
368
        h->cupsNumColors    = 1;
364
369
        h->cupsBitsPerPixel = h->cupsBitsPerColor;
365
370
        break;
421
426
 
422
427
        h->cupsNumColors = 4;
423
428
        break;
 
429
 
 
430
    case CUPS_CSPACE_DEVICE1 :
 
431
    case CUPS_CSPACE_DEVICE2 :
 
432
    case CUPS_CSPACE_DEVICE3 :
 
433
    case CUPS_CSPACE_DEVICE4 :
 
434
    case CUPS_CSPACE_DEVICE5 :
 
435
    case CUPS_CSPACE_DEVICE6 :
 
436
    case CUPS_CSPACE_DEVICE7 :
 
437
    case CUPS_CSPACE_DEVICE8 :
 
438
    case CUPS_CSPACE_DEVICE9 :
 
439
    case CUPS_CSPACE_DEVICEA :
 
440
    case CUPS_CSPACE_DEVICEB :
 
441
    case CUPS_CSPACE_DEVICEC :
 
442
    case CUPS_CSPACE_DEVICED :
 
443
    case CUPS_CSPACE_DEVICEE :
 
444
    case CUPS_CSPACE_DEVICEF :
 
445
        h->cupsNumColors = h->cupsColorSpace - CUPS_CSPACE_DEVICE1 + 1;
 
446
 
 
447
        if (h->cupsColorOrder == CUPS_ORDER_CHUNKED)
 
448
          h->cupsBitsPerPixel = h->cupsBitsPerColor * h->cupsNumColors;
 
449
        else
 
450
          h->cupsBitsPerPixel = h->cupsBitsPerColor;
 
451
        break;
424
452
  }
425
453
 
426
454
  h->cupsBytesPerLine = (h->cupsBitsPerPixel * h->cupsWidth + 7) / 8;
1456
1484
      if (obj[1].type == CUPS_PS_NUMBER && obj[2].type == CUPS_PS_NUMBER &&
1457
1485
          obj[3].type == CUPS_PS_END_ARRAY)
1458
1486
      {
1459
 
        h->cupsPageSize[0] = obj[1].value.number;
1460
 
        h->cupsPageSize[1] = obj[2].value.number;
 
1487
        h->cupsPageSize[0] = (float)obj[1].value.number;
 
1488
        h->cupsPageSize[1] = (float)obj[2].value.number;
1461
1489
 
1462
1490
        h->PageSize[0] = (unsigned)obj[1].value.number;
1463
1491
        h->PageSize[1] = (unsigned)obj[2].value.number;
1494
1522
      h->cupsRowStep = (unsigned)obj->value.number;
1495
1523
    else if (!strcmp(name, "cupsBorderlessScalingFactor") &&
1496
1524
             obj->type == CUPS_PS_NUMBER)
1497
 
      h->cupsBorderlessScalingFactor = obj->value.number;
 
1525
      h->cupsBorderlessScalingFactor = (float)obj->value.number;
1498
1526
    else if (!strncmp(name, "cupsInteger", 11) && obj->type == CUPS_PS_NUMBER)
1499
1527
    {
1500
1528
      if ((i = atoi(name + 11)) < 0 || i > 15)
1507
1535
      if ((i = atoi(name + 8)) < 0 || i > 15)
1508
1536
        return (-1);
1509
1537
 
1510
 
      h->cupsReal[i] = obj->value.number;
 
1538
      h->cupsReal[i] = (float)obj->value.number;
1511
1539
    }
1512
1540
    else if (!strncmp(name, "cupsString", 10) && obj->type == CUPS_PS_STRING)
1513
1541
    {
1656
1684
 
1657
1685
 
1658
1686
/*
1659
 
 * End of "$Id: interpret.c 8742 2009-07-01 22:32:59Z mike $".
 
1687
 * End of "$Id: interpret.c 9788 2011-05-19 02:50:54Z mike $".
1660
1688
 */