~ubuntu-branches/ubuntu/jaunty/cups/jaunty

« back to all changes in this revision

Viewing changes to debian/local/filters/pdf-filters/pdftopdf/P2PResources.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt, Till Kamppeter, Martin Pitt
  • Date: 2009-02-15 18:39:03 UTC
  • mfrom: (6.1.30 jaunty)
  • Revision ID: james.westby@ubuntu.com-20090215183903-i0nhvqyqj4vyn52a
Tags: 1.3.9-13
[ Till Kamppeter ]
* debian/local/filters/pdf-filters/filter/imagetopdf.c: Added support for
  the new "fit-to-page" option (new, more intuitive name for "fitplot").
* debian/filters/pstopdf: Only apply paper size if the "fitplot" or the
  "fit-to-page" option is set.
* debian/local/filters/cpdftocps: Only the last digit of the number of
  copies was used (LP: #309314).
* debian/local/filters/pdf-filters/pdftopdf/pdftopdf.cxx: Do not preceed the
  PDF output with a newline (LP: #303691). Only impose the page size from
  the PPD file to all pages if the "fitplot" or the "fit-to-page" option is 
  set. This prevented from automatic paper tray switching to the correct paper
  sizes when a multiple-page-size document is printed (partial fix for
  LP: #310575).
* debian/patches/pdftops-cups-1.4.dpatch: Updated from CUPS 1.4 SVN. Contains
  fixes for multiple-page-size document printing (partial fix for
  LP: #310575).
* debian/patches/pdftops-dont_fail_on_cancel.dpatch: Removed, should be
  fixed in the new upstream version of pdftops.

[ Martin Pitt ]
* debian/patches/pdftops-cups-1.4.dpatch: Add definition of
  HAVE_PDFTOPS and CUPS_PDFTOPS, so that the filter actually gets
  again built with pdftops support. (Fixes Till's change from above).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 
 
3
Copyright (c) 2006-2007, BBR Inc.  All rights reserved.
 
4
 
 
5
Permission is hereby granted, free of charge, to any person obtaining
 
6
a copy of this software and associated documentation files (the
 
7
"Software"), to deal in the Software without restriction, including
 
8
without limitation the rights to use, copy, modify, merge, publish,
 
9
distribute, sublicense, and/or sell copies of the Software, and to
 
10
permit persons to whom the Software is furnished to do so, subject to
 
11
the following conditions:
 
12
 
 
13
The above copyright notice and this permission notice shall be included
 
14
in all copies or substantial portions of the Software.
 
15
 
 
16
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 
17
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 
18
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 
19
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 
20
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 
21
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 
22
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
23
 
 
24
*/
 
25
/*
 
26
 P2PResources.h
 
27
 pdftopdf resouces dictionary
 
28
*/
 
29
#ifndef _P2PRESOURCES_H_
 
30
#define _P2PRESOURCES_H_
 
31
 
 
32
#include "goo/gmem.h"
 
33
#include "Object.h"
 
34
#include "P2PObject.h"
 
35
#include "Dict.h"
 
36
#include "XRef.h"
 
37
#include "P2POutputStream.h"
 
38
#include "P2PPattern.h"
 
39
#include "UGooString.h"
 
40
 
 
41
class P2PResourceMap;
 
42
class P2PFontResource;
 
43
 
 
44
class P2PResources: public P2PObject {
 
45
public:
 
46
  enum {
 
47
    ExtGState = 0,
 
48
    ColorSpace,
 
49
    Pattern,
 
50
    Shading,
 
51
    XObject,
 
52
    Font,
 
53
    NDict
 
54
  };
 
55
  static const char *dictNames[NDict];
 
56
  P2PResources(XRef *xrefA);
 
57
  ~P2PResources();
 
58
  void output(P2POutputStream *str, P2PFontResource *fontResource);
 
59
  /* merge resources and return mapping table */
 
60
  P2PResourceMap *merge(Dict *res);
 
61
  P2PResourceMap *merge(P2PResources *res);
 
62
  Dict *getFontResource() {
 
63
    return dictionaries[Font];
 
64
  }
 
65
  Dict *getExtGState() {
 
66
    return dictionaries[ExtGState];
 
67
  }
 
68
  void setupPattern();
 
69
  void refPattern(char *name, P2PMatrix *matA);
 
70
 
 
71
  class P2PPatternDict {
 
72
  public:
 
73
    P2PPatternDict() {
 
74
      name = 0;
 
75
      pattern = 0;
 
76
    }
 
77
    ~P2PPatternDict() {
 
78
      if (name != 0) delete[] name;
 
79
      if (pattern != 0) delete pattern;
 
80
    }
 
81
    char *name;
 
82
    P2PPattern *pattern;
 
83
  };
 
84
private:
 
85
  XRef *xref;
 
86
  Dict *dictionaries[NDict];
 
87
  unsigned int resourceNo;
 
88
  P2PPatternDict *patternDict;
 
89
  int nPattern;
 
90
 
 
91
  void mergeOneDict(Dict *dst, Dict *src, Dict *map, GBool unify);
 
92
#ifdef HAVE_UGOOSTRING_H
 
93
  void addDict(Dict *dict, Object *obj, UGooString *srckey, Dict *map);
 
94
#else
 
95
  void addDict(Dict *dict, Object *obj, char *srckey, Dict *map);
 
96
#endif
 
97
#ifdef HAVE_UGOOSTRING_H
 
98
  void addMap(UGooString *org, char *mapped, Dict *map);
 
99
#else
 
100
  void addMap(char *org, char *mapped, Dict *map);
 
101
#endif
 
102
};
 
103
 
 
104
/* resource name mapping table */
 
105
class P2PResourceMap {
 
106
public:
 
107
  P2PResourceMap();
 
108
  ~P2PResourceMap();
 
109
 
 
110
  Dict *tables[P2PResources::NDict];
 
111
};
 
112
 
 
113
#endif