Commit 4e9490c0 authored by Albert Astals Cid's avatar Albert Astals Cid

Merge GlobalParam.* changes, they are worthless for us as poppler but this way...

Merge GlobalParam.* changes, they are worthless for us as poppler but this way we are nearer to have the 3.01 sources merged, then we can remove them if we decide we don't need this options.
Remove a setEncryption from the Xref.h marco probably forgot to remove when merging
parent 22da021b
2005-09-20 Albert Astals Cid <aacid@kde.org>
* poppler/GlobalParams.[cc|h]: Merge from xpdf 3.01
2005-09-20 Marco Pesenti Gritti <mpg@redhat.com>
* poppler/XRef.cc:
......
......@@ -310,6 +310,12 @@ GlobalParams::GlobalParams(char *cfgFileName) {
}
}
#ifdef WIN32
// baseDir will be set by a call to setBaseDir
baseDir = new GooString();
#else
baseDir = appendToPath(getHomeDir(), ".xpdf");
#endif
nameToUnicode = new NameToCharCode();
cidToUnicodes = new GooHash(gTrue);
unicodeToUnicodes = new GooHash(gTrue);
......@@ -367,6 +373,7 @@ GlobalParams::GlobalParams(char *cfgFileName) {
textKeepTinyChars = gFalse;
fontDirs = new GooList();
initialZoom = new GooString("125");
continuousView = gFalse;
enableT1lib = gTrue;
enableFreeType = gTrue;
antialias = gTrue;
......@@ -575,6 +582,8 @@ void GlobalParams::parseFile(GooString *fileName, FILE *f) {
parseFontDir(tokens, fileName, line);
} else if (!cmd->cmp("initialZoom")) {
parseInitialZoom(tokens, fileName, line);
} else if (!cmd->cmp("continuousView")) {
parseYesNo("continuousView", &continuousView, tokens, fileName, line);
} else if (!cmd->cmp("enableT1lib")) {
parseYesNo("enableT1lib", &enableT1lib, tokens, fileName, line);
} else if (!cmd->cmp("enableFreeType")) {
......@@ -946,6 +955,7 @@ GlobalParams::~GlobalParams() {
delete macRomanReverseMap;
delete baseDir;
delete nameToUnicode;
deleteGooHash(cidToUnicodes, GooString);
deleteGooHash(unicodeToUnicodes, GooString);
......@@ -992,6 +1002,13 @@ GlobalParams::~GlobalParams() {
#endif
}
//------------------------------------------------------------------------
void GlobalParams::setBaseDir(char *dir) {
delete baseDir;
baseDir = new GooString(dir);
}
//------------------------------------------------------------------------
// accessors
//------------------------------------------------------------------------
......@@ -1001,6 +1018,15 @@ CharCode GlobalParams::getMacRomanCharCode(char *charName) {
return macRomanReverseMap->lookup(charName);
}
GooString *GlobalParams::getBaseDir() {
GooString *s;
lockGlobalParams;
s = baseDir->copy();
unlockGlobalParams;
return s;
}
Unicode GlobalParams::mapNameToUnicode(char *charName) {
// no need to lock - nameToUnicode is constant
return nameToUnicode->lookup(charName);
......@@ -1545,6 +1571,15 @@ GooString *GlobalParams::getInitialZoom() {
return s;
}
GBool GlobalParams::getContinuousView() {
GBool f;
lockGlobalParams;
f = continuousView;
unlockGlobalParams;
return f;
}
GBool GlobalParams::getEnableT1lib() {
GBool f;
......@@ -1859,6 +1894,12 @@ void GlobalParams::setInitialZoom(char *s) {
unlockGlobalParams;
}
void GlobalParams::setContinuousView(GBool cont) {
lockGlobalParams;
continuousView = cont;
unlockGlobalParams;
}
GBool GlobalParams::setEnableT1lib(char *s) {
GBool ok;
......
......@@ -49,6 +49,14 @@ enum DisplayFontParamKind {
displayFontTT
};
struct DisplayFontParamT1 {
GooString *fileName;
};
struct DisplayFontParamTT {
GooString *fileName;
};
class DisplayFontParam {
public:
......@@ -57,12 +65,8 @@ public:
// generic CID fonts
DisplayFontParamKind kind;
union {
struct {
GooString *fileName;
} t1;
struct {
GooString *fileName;
} tt;
DisplayFontParamT1 t1;
DisplayFontParamTT tt;
};
DisplayFontParam(GooString *nameA, DisplayFontParamKind kindA);
......@@ -117,10 +121,13 @@ public:
~GlobalParams();
void setBaseDir(char *dir);
//----- accessors
CharCode getMacRomanCharCode(char *charName);
GooString *getBaseDir();
Unicode mapNameToUnicode(char *charName);
UnicodeMap *getResidentUnicodeMap(GooString *encodingName);
FILE *getUnicodeMapFile(GooString *encodingName);
......@@ -151,6 +158,7 @@ public:
GBool getTextKeepTinyChars();
GooString *findFontFile(GooString *fontName, char **exts);
GooString *getInitialZoom();
GBool getContinuousView();
GBool getEnableT1lib();
GBool getEnableFreeType();
GBool getAntialias();
......@@ -194,6 +202,7 @@ public:
void setTextPageBreaks(GBool pageBreaks);
void setTextKeepTinyChars(GBool keep);
void setInitialZoom(char *s);
void setContinuousView(GBool cont);
GBool setEnableT1lib(char *s);
GBool setEnableFreeType(char *s);
GBool setAntialias(char *s);
......@@ -289,6 +298,7 @@ private:
GBool textKeepTinyChars; // keep all characters in text output
GooList *fontDirs; // list of font dirs [GooString]
GooString *initialZoom; // initial zoom level
GBool continuousView; // continuous view mode
GBool enableT1lib; // t1lib enable flag
GBool enableFreeType; // FreeType enable flag
GBool antialias; // anti-aliasing enable flag
......
......@@ -57,10 +57,6 @@ public:
Guchar *fileKeyA, int keyLengthA,
int encVersionA, int encRevisionA);
// Set the encryption parameters.
void setEncryption(int permFlagsA, GBool ownerPasswordOkA,
Guchar *fileKeyA, int keyLengthA, int encVersionA);
// Is the file encrypted?
GBool isEncrypted() { return encrypted; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment