~ubuntu-branches/ubuntu/raring/cups-filters/raring-proposed

« back to all changes in this revision

Viewing changes to filter/pdftopdf.old/P2PCMap.h

  • Committer: Package Import Robot
  • Author(s): Till Kamppeter
  • Date: 2012-09-07 15:32:43 UTC
  • mfrom: (1.1.19)
  • Revision ID: package-import@ubuntu.com-20120907153243-obmuufi2z1wp436n
Tags: 1.0.24-1
* New upstream release
   - pdftopdf now generates the necessary pdf comments to disable
     duplicate number-up when pdftops is also applied (Upstream bug #1063).
   - pdftops: Added support for using Adobe Reader (acroread) in command
     line mode for turning PDF to PostScript (Upstream bug #1065).
   - pdftops: Fix stripping of page management options from the pstops
     command line which got already applied by pdftopdf. If the name
     of the option to be removed is contained in the name of a option
     in the command line (like "number-up" in "number-up-layout" or
     "scaling" in "Natural-scaling"), this option gets stripped instead
     of the correct option (Upstream bug #1064).
   - Removed filter/pdftopdf.old
   - Fixed the requires.private for cupsfilters lib
* debian/control: Versioned build dependency on libqpdf-dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//========================================================================
2
 
//
3
 
// P2PCMap.h
4
 
//
5
 
// Copyright 2001-2003 Glyph & Cog, LLC
6
 
// 2007 Modefied by BBR Inc.
7
 
//
8
 
//========================================================================
9
 
 
10
 
#ifndef CMAP_H
11
 
#define CMAP_H
12
 
 
13
 
#ifdef USE_GCC_PRAGMAS
14
 
#pragma interface
15
 
#endif
16
 
 
17
 
#include "poppler-config.h"
18
 
#include "goo/gtypes.h"
19
 
#include "CharTypes.h"
20
 
 
21
 
#if MULTITHREADED
22
 
#include <goo/GooMutex.h>
23
 
#endif
24
 
 
25
 
class GooString;
26
 
struct CMapVectorEntry;
27
 
class P2PCMapCache;
28
 
 
29
 
//------------------------------------------------------------------------
30
 
 
31
 
class P2PCMap {
32
 
public:
33
 
 
34
 
  // Create the CMap specified by <collection> and <cMapName>.  Sets
35
 
  // the initial reference count to 1.  Returns NULL on failure.
36
 
  static P2PCMap *parse(P2PCMapCache *cache, GooString *collectionA,
37
 
                     GooString *cMapNameA);
38
 
 
39
 
  ~P2PCMap();
40
 
 
41
 
  void incRefCnt();
42
 
  void decRefCnt();
43
 
 
44
 
  // Return collection name (<registry>-<ordering>).
45
 
  GooString *getCollection() { return collection; }
46
 
 
47
 
  // Return true if this CMap matches the specified <collectionA>, and
48
 
  // <cMapNameA>.
49
 
  GBool match(GooString *collectionA, GooString *cMapNameA);
50
 
 
51
 
  // Return the CID corresponding to the character code starting at
52
 
  // <s>, which contains <len> bytes.  Sets *<nUsed> to the number of
53
 
  // bytes used by the char code.
54
 
  CID getCID(char *s, int len, int *nUsed);
55
 
 
56
 
  // Return the writing mode (0=horizontal, 1=vertical).
57
 
  int getWMode() { return wMode; }
58
 
 
59
 
  void setReverseMap(Guint *rmap, Guint rmapSize, Guint ncand);
60
 
 
61
 
private:
62
 
 
63
 
  P2PCMap(GooString *collectionA, GooString *cMapNameA);
64
 
  P2PCMap(GooString *collectionA, GooString *cMapNameA, int wModeA);
65
 
  void useCMap(P2PCMapCache *cache, char *useName);
66
 
  void copyVector(CMapVectorEntry *dest, CMapVectorEntry *src);
67
 
  void addCodeSpace(CMapVectorEntry *vec, Guint start, Guint end,
68
 
                    Guint nBytes);
69
 
  void addCIDs(Guint start, Guint end, Guint nBytes, CID firstCID);
70
 
  void freeCMapVector(CMapVectorEntry *vec);
71
 
  void setReverseMapVector(Guint startCode, CMapVectorEntry *vec,
72
 
          Guint *rmap, Guint rmapSize, Guint ncand);
73
 
 
74
 
  GooString *collection;
75
 
  GooString *cMapName;
76
 
  int wMode;                    // writing mode (0=horizontal, 1=vertical)
77
 
  CMapVectorEntry *vector;      // vector for first byte (NULL for
78
 
                                //   identity CMap)
79
 
  int refCnt;
80
 
#if MULTITHREADED
81
 
  GooMutex mutex;
82
 
#endif
83
 
};
84
 
 
85
 
//------------------------------------------------------------------------
86
 
 
87
 
#define cMapCacheSize 4
88
 
 
89
 
class P2PCMapCache {
90
 
public:
91
 
 
92
 
  P2PCMapCache();
93
 
  ~P2PCMapCache();
94
 
 
95
 
  // Get the <cMapName> CMap for the specified character collection.
96
 
  // Increments its reference count; there will be one reference for
97
 
  // the cache plus one for the caller of this function.  Returns NULL
98
 
  // on failure.
99
 
  P2PCMap *getCMap(GooString *collection, GooString *cMapName);
100
 
 
101
 
private:
102
 
 
103
 
  P2PCMap *cache[cMapCacheSize];
104
 
};
105
 
 
106
 
#endif