1
//========================================================================
5
// Copyright 2001-2003 Glyph & Cog, LLC
6
// 2007 Modefied by BBR Inc.
8
//========================================================================
13
#ifdef USE_GCC_PRAGMAS
17
#include "poppler-config.h"
18
#include "goo/gtypes.h"
19
#include "CharTypes.h"
22
#include <goo/GooMutex.h>
26
struct CMapVectorEntry;
29
//------------------------------------------------------------------------
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);
44
// Return collection name (<registry>-<ordering>).
45
GooString *getCollection() { return collection; }
47
// Return true if this CMap matches the specified <collectionA>, and
49
GBool match(GooString *collectionA, GooString *cMapNameA);
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);
56
// Return the writing mode (0=horizontal, 1=vertical).
57
int getWMode() { return wMode; }
59
void setReverseMap(Guint *rmap, Guint rmapSize, Guint ncand);
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,
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);
74
GooString *collection;
76
int wMode; // writing mode (0=horizontal, 1=vertical)
77
CMapVectorEntry *vector; // vector for first byte (NULL for
85
//------------------------------------------------------------------------
87
#define cMapCacheSize 4
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
99
P2PCMap *getCMap(GooString *collection, GooString *cMapName);
103
P2PCMap *cache[cMapCacheSize];