diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2009-05-10 14:20:16 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2009-05-10 14:20:16 +0000 |
commit | 1bb2e91774ffe4ac4202fd9263e77eb800d27d24 (patch) | |
tree | cc5b77471e13242a63028c63b6ef108587489372 | |
parent | 614b955807224ff49f0add7cc8e3597689006912 (diff) |
reorganize pdftex patches applied to xpfd
git-svn-id: svn://tug.org/texlive/trunk@13028 c570f23f-e606-0410-a88d-b1316a301751
17 files changed, 537 insertions, 1288 deletions
diff --git a/Build/source/libs/xpdf/ChangeLog b/Build/source/libs/xpdf/ChangeLog index 5321108b993..e13b47e2cf8 100644 --- a/Build/source/libs/xpdf/ChangeLog +++ b/Build/source/libs/xpdf/ChangeLog @@ -1,40 +1,18 @@ -2009-05-05 Peter Breitenlohner <peb@mppmu.mpg.de> +2009-01-28 Peter Breitenlohner <peb@mppmu.mpg.de> - * xpdf-3.02-PATCHES/patch-15-fix-pow-arg, - xpdf-3.02-PATCHES/patch-16-size-of-struct, - xpdf-3.02-PATCHES/patch-17-strCrypt (new): - three small patches split off from ... - * xpdf-3.02-PATCHES/patch-20-pdftex: ... this file. + Adapt to TL2009 build system. -2009-04-30 Peter Breitenlohner <peb@mppmu.mpg.de> - - Applied official 3.02pl3 patch - adapted xpdf-3.02-PATCHES/patch-[12]?-* - - * xpdf/config.h (xpdfVersion): "3.02pl2" -> "3.02pl3" - -2009-04-02 Peter Breitenlohner <peb@mppmu.mpg.de> - - * xpdf/GlobalParams.cc: '#undef WIN32' for mingw32 as patch - xpdf-3.02-PATCHES/patch-12-mingw32 - -2009-03-05 Peter Breitenlohner <peb@mppmu.mpg.de> - - * goo/gfile.cc: '#include <time.h>' as patch - xpdf-3.02-PATCHES/patch-11-time_h - -2009-02-14 Peter Breitenlohner <peb@mppmu.mpg.de> - - * configure.ac: for the new TeX Live build system. * Makefile.am, fofi/Makefile.am, goo/Makefile.am, - xpdf/Makefile.am: proxy Makefiles for the patched original - sources in xpdf-3.02/ + xpdf/Makefile.am, configure.ac: + Proxy build system using source tree xpdf-3.02/ as obtained + from http://www.foolabs.com/xpdf/ with patches. -2008-05-08 Peter Breitenlohner <peb@mppmu.mpg.de> + * xpdf-3.02-foolabs/*: Orignal patches for xpdf-3.02pl1 etc. + from http://www.foolabs.com/xpdf/. - Imported/updated changes for pdfTeX as patches - xpdf-3.02-PATCHES/patch-10-PDF_PARSER_ONLY - xpdf-3.02-PATCHES/patch-20-pdftex + * xpdf-3.02-PATCHES/*: Actual patches applied to the original + source tree. + See xpdf-3.02-PATCHES/ChangeLog for details. 2008-01-31 Peter Breitenlohner <peb@mppmu.mpg.de> @@ -46,21 +24,3 @@ * aclocal.m4 (new): Generated (aclocal -I ../../texk/m4). * configure: Regenerated (autoconf). -2007-11-12 Peter Breitenlohner <peb@mppmu.mpg.de> - - Applied official 3.02pl2 patch - - * xpdf/config.h (xpdfVersion): "3.02pl1" -> "3.02pl2" - -2007-08-01 Peter Breitenlohner <peb@mppmu.mpg.de> - - Applied official 3.02pl1 patch - - * xpdf/config.h (xpdfVersion): "3.02" -> "3.02pl1" - -2007-02-29 Peter Breitenlohner <peb@mppmu.mpg.de> - - Imported xpdf-3.02 source tree: - ftp://ftp.foolabs.com/pub/xpdf/xpdf-3.02.tar.gz - http://www.foolabs.com/xpdf/xpdf-3.02.tar.gz - diff --git a/Build/source/libs/xpdf/Makefile.am b/Build/source/libs/xpdf/Makefile.am index ea12b331bdc..161d5266505 100644 --- a/Build/source/libs/xpdf/Makefile.am +++ b/Build/source/libs/xpdf/Makefile.am @@ -37,6 +37,7 @@ EXTRA_DIST += $(XPDF_TREE)-PATCHES # in case of an SVN repository dist-hook: rm -rf `find $(distdir)/$(XPDF_TREE) -name .svn` + rm -f $(distdir)/$(XPDF_TREE)/install-sh SUBDIRS = goo fofi xpdf diff --git a/Build/source/libs/xpdf/Makefile.in b/Build/source/libs/xpdf/Makefile.in index 8fd073a30d4..03c1e70ee6d 100644 --- a/Build/source/libs/xpdf/Makefile.in +++ b/Build/source/libs/xpdf/Makefile.in @@ -1457,6 +1457,7 @@ uninstall-am: # in case of an SVN repository dist-hook: rm -rf `find $(distdir)/$(XPDF_TREE) -name .svn` + rm -f $(distdir)/$(XPDF_TREE)/install-sh # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/Build/source/libs/xpdf/xpdf-3.02-PATCHES/ChangeLog b/Build/source/libs/xpdf/xpdf-3.02-PATCHES/ChangeLog new file mode 100644 index 00000000000..58a9e24fa1e --- /dev/null +++ b/Build/source/libs/xpdf/xpdf-3.02-PATCHES/ChangeLog @@ -0,0 +1,66 @@ +2009-05-10 Peter Breitenlohner <peb@mppmu.mpg.de> + + Reorganize and simplify pdftex patches. + + * patch-10-PDF_PARSER_ONLY (removed): replaced by ... + * patch-10-exclude-body-of-Page::getDefaultCTM (new): ... this. + + from Derek B. Noonburg <derek@foolabs.com> + + * patch-20-pdftex (removed): split into several pieces. + * patch-20-skip-reading-config-file (new): simplified version + of previous code. + * patch-22-exclude-openTempFile: new file. + * patch-23-exclude-keyBindings: new file. + * patch-40-objectStream-support-for-pdftosrc: new file. + + from Han The Thanh <thanh@pdftex.org> + +2009-05-05 Peter Breitenlohner <peb@mppmu.mpg.de> + + * patch-15-fix-pow-arg (new): Three ... + * patch-16-size-of-struct (new): ... small patches ... + * patch-17-strCrypt (new): ... split of from ... + * patch-20-pdftex: ... this one. + +2009-04-30 Peter Breitenlohner <peb@mppmu.mpg.de> + + * patch-02-pl3 (new): Official 3.02pl3 patch plus change of + xpdfVersion "3.02pl2" -> "3.02pl3" + * patch-[12]?-*: adapted to presence of patch-01-pl3. + +2009-04-02 Peter Breitenlohner <peb@mppmu.mpg.de> + + * patch-12-mingw32 (new): Buld fix for mingw32. + + from Derek B. Noonburg <derek@foolabs.com> + +2009-03-05 Peter Breitenlohner <peb@mppmu.mpg.de> + + * patch-11-time_h (new): Buld fix for djgpp. + + from Derek B. Noonburg <derek@foolabs.com> + +2009-02-08 Peter Breitenlohner <peb@mppmu.mpg.de> + + * patch-10-PDF_PARSER_ONLY (new): required build with + PDF_PARSER_ONLY defined. + + * patch-20-pdftex (new): To restore former tree for pdfTeX. + +2007-11-12 Peter Breitenlohner <peb@mppmu.mpg.de> + + * patch-02-pl2 (new): Official 3.02pl2 patch plus change of + xpdfVersion "3.02pl1" -> "3.02pl2" + +2007-08-01 Peter Breitenlohner <peb@mppmu.mpg.de> + + * patch-01-pl1 (new): Official 3.02pl1 patch plus change of + xpdfVersion "3.02" -> "3.02pl1" in ../xpdf/config.h. + +2007-02-29 Peter Breitenlohner <peb@mppmu.mpg.de> + + Imported xpdf-3.02 source tree: + ftp://ftp.foolabs.com/pub/xpdf/xpdf-3.02.tar.gz + http://www.foolabs.com/xpdf/xpdf-3.02.tar.gz + diff --git a/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-10-PDF_PARSER_ONLY b/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-10-PDF_PARSER_ONLY deleted file mode 100644 index 55e16622d93..00000000000 --- a/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-10-PDF_PARSER_ONLY +++ /dev/null @@ -1,28 +0,0 @@ - Enable compilation with -DPDF_PARSER_ONLY - -diff -ur -N xpdf-3.02.orig/xpdf/Page.cc xpdf-3.02/xpdf/Page.cc ---- xpdf-3.02.orig/xpdf/Page.cc 2007-02-27 23:05:52.000000000 +0100 -+++ xpdf-3.02/xpdf/Page.cc 2009-02-08 03:15:12.000000000 +0100 -@@ -5,6 +5,9 @@ - // Copyright 1996-2007 Glyph & Cog, LLC - // - //======================================================================== -+// Modified for TeX Live by Peter Breitenlohner <tex-live@tug.org> -+// See top-level ChangeLog for a list of all modifications -+//======================================================================== - - #include <aconf.h> - -@@ -420,6 +423,7 @@ - delete links; - } - -+#ifndef PDF_PARSER_ONLY - void Page::getDefaultCTM(double *ctm, double hDPI, double vDPI, - int rotate, GBool useMediaBox, GBool upsideDown) { - GfxState *state; -@@ -439,3 +443,4 @@ - } - delete state; - } -+#endif diff --git a/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-10-exclude-body-of-Page::getDefaultCTM b/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-10-exclude-body-of-Page::getDefaultCTM new file mode 100644 index 00000000000..5037bf1ba02 --- /dev/null +++ b/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-10-exclude-body-of-Page::getDefaultCTM @@ -0,0 +1,21 @@ + Enable compilation with -DPDF_PARSER_ONLY + + from: + Derek B. Noonburg <derek@foolabs.com> + +--- xpdf-3.02.orig/xpdf/Page.cc 2007-02-27 23:05:52.000000000 +0100 ++++ xpdf-3.02/xpdf/Page.cc 2009-05-07 00:22:58.085044699 +0200 +@@ -422,6 +422,7 @@ + + void Page::getDefaultCTM(double *ctm, double hDPI, double vDPI, + int rotate, GBool useMediaBox, GBool upsideDown) { ++#ifndef PDF_PARSER_ONLY + GfxState *state; + int i; + +@@ -438,4 +439,5 @@ + ctm[i] = state->getCTM()[i]; + } + delete state; ++#endif + } diff --git a/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-20-pdftex b/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-20-pdftex deleted file mode 100644 index b4d71a8748b..00000000000 --- a/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-20-pdftex +++ /dev/null @@ -1,534 +0,0 @@ - Patches for pdfTeX / luaTeX / XeTeX - - from: - Han The Thanh <thanh@pdftex.org> - Martin Schroeder <martin@pdftex.org> - -diff -ur -N xpdf-3.02.orig/goo/gfile.cc xpdf-3.02/goo/gfile.cc ---- xpdf-3.02.orig/goo/gfile.cc 2009-03-05 23:36:46.000000000 +0100 -+++ xpdf-3.02/goo/gfile.cc 2009-04-30 21:29:39.000000000 +0200 -@@ -443,6 +443,7 @@ - #endif - } - -+#ifndef PDF_PARSER_ONLY - GBool openTempFile(GString **name, FILE **f, char *mode, char *ext) { - #if defined(WIN32) - //---------- Win32 ---------- -@@ -551,6 +552,7 @@ - return gTrue; - #endif - } -+#endif - - GBool executeCommand(char *cmd) { - #ifdef VMS -diff -ur -N xpdf-3.02.orig/xpdf/GlobalParams.cc xpdf-3.02/xpdf/GlobalParams.cc ---- xpdf-3.02.orig/xpdf/GlobalParams.cc 2009-04-02 10:22:18.000000000 +0200 -+++ xpdf-3.02/xpdf/GlobalParams.cc 2009-04-30 21:35:00.000000000 +0200 -@@ -429,6 +429,7 @@ - } - } - -+#ifndef PDF_PARSER_ONLY - //------------------------------------------------------------------------ - // KeyBinding - //------------------------------------------------------------------------ -@@ -461,6 +462,7 @@ - KeyBinding::~KeyBinding() { - deleteGList(cmds, GString); - } -+#endif - - #ifdef ENABLE_PLUGINS - //------------------------------------------------------------------------ -@@ -608,6 +610,138 @@ - // parsing - //------------------------------------------------------------------------ - -+GlobalParams::GlobalParams() { -+ UnicodeMap *map; -+ int i; -+ -+#if MULTITHREADED -+ gInitMutex(&mutex); -+ gInitMutex(&unicodeMapCacheMutex); -+ gInitMutex(&cMapCacheMutex); -+#endif -+ -+ initBuiltinFontTables(); -+ -+ // scan the encoding in reverse because we want the lowest-numbered -+ // index for each char name ('space' is encoded twice) -+ macRomanReverseMap = new NameToCharCode(); -+ for (i = 255; i >= 0; --i) { -+ if (macRomanEncoding[i]) { -+ macRomanReverseMap->add(macRomanEncoding[i], (CharCode)i); -+ } -+ } -+ -+#ifdef WIN32 -+ // baseDir will be set by a call to setBaseDir -+ baseDir = new GString(); -+#else -+ baseDir = appendToPath(getHomeDir(), ".xpdf"); -+#endif -+ nameToUnicode = new NameToCharCode(); -+ cidToUnicodes = new GHash(gTrue); -+ unicodeToUnicodes = new GHash(gTrue); -+ residentUnicodeMaps = new GHash(); -+ unicodeMaps = new GHash(gTrue); -+ cMapDirs = new GHash(gTrue); -+ toUnicodeDirs = new GList(); -+ displayFonts = new GHash(); -+ displayCIDFonts = new GHash(); -+ displayNamedCIDFonts = new GHash(); -+#if HAVE_PAPER_H -+ char *paperName; -+ const struct paper *paperType; -+ paperinit(); -+ if ((paperName = systempapername())) { -+ paperType = paperinfo(paperName); -+ psPaperWidth = (int)paperpswidth(paperType); -+ psPaperHeight = (int)paperpsheight(paperType); -+ } else { -+ error(-1, "No paper information available - using defaults"); -+ psPaperWidth = defPaperWidth; -+ psPaperHeight = defPaperHeight; -+ } -+ paperdone(); -+#else -+ psPaperWidth = defPaperWidth; -+ psPaperHeight = defPaperHeight; -+#endif -+ psImageableLLX = psImageableLLY = 0; -+ psImageableURX = psPaperWidth; -+ psImageableURY = psPaperHeight; -+ psCrop = gTrue; -+ psExpandSmaller = gFalse; -+ psShrinkLarger = gTrue; -+ psCenter = gTrue; -+ psDuplex = gFalse; -+ psLevel = psLevel2; -+ psFile = NULL; -+ psFonts = new GHash(); -+ psNamedFonts16 = new GList(); -+ psFonts16 = new GList(); -+ psEmbedType1 = gTrue; -+ psEmbedTrueType = gTrue; -+ psEmbedCIDPostScript = gTrue; -+ psEmbedCIDTrueType = gTrue; -+ psOPI = gFalse; -+ psASCIIHex = gFalse; -+ textEncoding = new GString("Latin1"); -+#if defined(WIN32) -+ textEOL = eolDOS; -+#elif defined(MACOS) -+ textEOL = eolMac; -+#else -+ textEOL = eolUnix; -+#endif -+ textPageBreaks = gTrue; -+ textKeepTinyChars = gFalse; -+ fontDirs = new GList(); -+ initialZoom = new GString("125"); -+ continuousView = gFalse; -+ enableT1lib = gTrue; -+ enableFreeType = gTrue; -+ antialias = gTrue; -+ urlCommand = NULL; -+ movieCommand = NULL; -+ mapNumericCharNames = gTrue; -+ printCommands = gFalse; -+ errQuiet = gFalse; -+ -+ cidToUnicodeCache = new CharCodeToUnicodeCache(cidToUnicodeCacheSize); -+ unicodeToUnicodeCache = -+ new CharCodeToUnicodeCache(unicodeToUnicodeCacheSize); -+ unicodeMapCache = new UnicodeMapCache(); -+ cMapCache = new CMapCache(); -+ -+#ifdef ENABLE_PLUGINS -+ plugins = new GList(); -+ securityHandlers = new GList(); -+#endif -+ -+ // set up the initial nameToUnicode table -+ for (i = 0; nameToUnicodeTab[i].name; ++i) { -+ nameToUnicode->add(nameToUnicodeTab[i].name, nameToUnicodeTab[i].u); -+ } -+ -+ // set up the residentUnicodeMaps table -+ map = new UnicodeMap("Latin1", gFalse, -+ latin1UnicodeMapRanges, latin1UnicodeMapLen); -+ residentUnicodeMaps->add(map->getEncodingName(), map); -+ map = new UnicodeMap("ASCII7", gFalse, -+ ascii7UnicodeMapRanges, ascii7UnicodeMapLen); -+ residentUnicodeMaps->add(map->getEncodingName(), map); -+ map = new UnicodeMap("Symbol", gFalse, -+ symbolUnicodeMapRanges, symbolUnicodeMapLen); -+ residentUnicodeMaps->add(map->getEncodingName(), map); -+ map = new UnicodeMap("ZapfDingbats", gFalse, zapfDingbatsUnicodeMapRanges, -+ zapfDingbatsUnicodeMapLen); -+ residentUnicodeMaps->add(map->getEncodingName(), map); -+ map = new UnicodeMap("UTF-8", gTrue, &mapUTF8); -+ residentUnicodeMaps->add(map->getEncodingName(), map); -+ map = new UnicodeMap("UCS-2", gTrue, &mapUCS2); -+ residentUnicodeMaps->add(map->getEncodingName(), map); -+ -+} -+ - GlobalParams::GlobalParams(char *cfgFileName) { - UnicodeMap *map; - GString *fileName; -@@ -713,7 +847,9 @@ - movieCommand = NULL; - mapNumericCharNames = gTrue; - mapUnknownCharNames = gFalse; -+#ifndef PDF_PARSER_ONLY - createDefaultKeyBindings(); -+#endif - printCommands = gFalse; - errQuiet = gFalse; - -@@ -788,12 +924,15 @@ - } - } - if (f) { -+#ifndef PDF_PARSER_ONLY - parseFile(fileName, f); -+#endif - delete fileName; - fclose(f); - } - } - -+#ifndef PDF_PARSER_ONLY - void GlobalParams::createDefaultKeyBindings() { - keyBindings = new GList(); - -@@ -1120,6 +1259,7 @@ - - deleteGList(tokens, GString); - } -+#endif - - void GlobalParams::parseNameToUnicode(GList *tokens, GString *fileName, - int line) { -@@ -1464,6 +1604,7 @@ - } - } - -+#ifndef PDF_PARSER_ONLY - void GlobalParams::parseBind(GList *tokens, GString *fileName, int line) { - KeyBinding *binding; - GList *cmds; -@@ -1649,6 +1790,7 @@ - - return gTrue; - } -+#endif - - void GlobalParams::parseCommand(char *cmdName, GString **val, - GList *tokens, GString *fileName, int line) { -@@ -1792,7 +1934,9 @@ - if (movieCommand) { - delete movieCommand; - } -+#ifndef PDF_PARSER_ONLY - deleteGList(keyBindings, KeyBinding); -+#endif - - cMapDirs->startIter(&iter); - while (cMapDirs->getNext(&iter, &key, (void **)&list)) { -@@ -2443,6 +2587,7 @@ - return map; - } - -+#ifndef PDF_PARSER_ONLY - GList *GlobalParams::getKeyBinding(int code, int mods, int context) { - KeyBinding *binding; - GList *cmds; -@@ -2468,6 +2613,7 @@ - unlockGlobalParams; - return cmds; - } -+#endif - - GBool GlobalParams::getPrintCommands() { - GBool p; -diff -ur -N xpdf-3.02.orig/xpdf/GlobalParams.h xpdf-3.02/xpdf/GlobalParams.h ---- xpdf-3.02.orig/xpdf/GlobalParams.h 2007-02-27 23:05:52.000000000 +0100 -+++ xpdf-3.02/xpdf/GlobalParams.h 2008-05-08 15:40:41.000000000 +0200 -@@ -5,6 +5,9 @@ - // Copyright 2001-2003 Glyph & Cog, LLC - // - //======================================================================== -+// Modified for TeX Live by Peter Breitenlohner <tex-live@tug.org> -+// See top-level ChangeLog for a list of all modifications -+//======================================================================== - - #ifndef GLOBALPARAMS_H - #define GLOBALPARAMS_H -@@ -123,6 +126,7 @@ - - //------------------------------------------------------------------------ - -+#ifndef PDF_PARSER_ONLY - class KeyBinding { - public: - -@@ -186,6 +190,7 @@ - #define xpdfKeyContextMainWin (2 << 6) - #define xpdfKeyContextScrLockOn (1 << 8) - #define xpdfKeyContextScrLockOff (2 << 8) -+#endif - - //------------------------------------------------------------------------ - -@@ -196,12 +201,17 @@ - // file. - GlobalParams(char *cfgFileName); - -+ // Initialize it without reading the config -+ GlobalParams(); -+ - ~GlobalParams(); - - void setBaseDir(char *dir); - void setupBaseFonts(char *dir); - -+#ifndef PDF_PARSER_ONLY - void parseLine(char *buf, GString *fileName, int line); -+#endif - - //----- accessors - -@@ -256,7 +266,9 @@ - GString *getMovieCommand() { return movieCommand; } - GBool getMapNumericCharNames(); - GBool getMapUnknownCharNames(); -+#ifndef PDF_PARSER_ONLY - GList *getKeyBinding(int code, int mods, int context); -+#endif - GBool getPrintCommands(); - GBool getErrQuiet(); - -@@ -315,7 +327,9 @@ - - private: - -+#ifndef PDF_PARSER_ONLY - void createDefaultKeyBindings(); -+#endif - void parseFile(GString *fileName, FILE *f); - void parseNameToUnicode(GList *tokens, GString *fileName, int line); - void parseCIDToUnicode(GList *tokens, GString *fileName, int line); -@@ -338,12 +352,14 @@ - void parseFontDir(GList *tokens, GString *fileName, int line); - void parseInitialZoom(GList *tokens, GString *fileName, int line); - void parseScreenType(GList *tokens, GString *fileName, int line); -+#ifndef PDF_PARSER_ONLY - void parseBind(GList *tokens, GString *fileName, int line); - void parseUnbind(GList *tokens, GString *fileName, int line); - GBool parseKey(GString *modKeyStr, GString *contextStr, - int *code, int *mods, int *context, - char *cmdName, - GList *tokens, GString *fileName, int line); -+#endif - void parseCommand(char *cmdName, GString **val, - GList *tokens, GString *fileName, int line); - void parseYesNo(char *cmdName, GBool *flag, -@@ -438,7 +454,9 @@ - GString *movieCommand; // command executed for movie annotations - GBool mapNumericCharNames; // map numeric char names (from font subsets)? - GBool mapUnknownCharNames; // map unknown char names? -+#ifndef PDF_PARSER_ONLY - GList *keyBindings; // key & mouse button bindings [KeyBinding] -+#endif - GBool printCommands; // print the drawing commands - GBool errQuiet; // suppress error messages? - -diff -ur -N xpdf-3.02.orig/xpdf/Page.h xpdf-3.02/xpdf/Page.h ---- xpdf-3.02.orig/xpdf/Page.h 2007-02-27 23:05:52.000000000 +0100 -+++ xpdf-3.02/xpdf/Page.h 2008-05-08 15:40:41.000000000 +0200 -@@ -5,6 +5,9 @@ - // Copyright 1996-2003 Glyph & Cog, LLC - // - //======================================================================== -+// Modified for TeX Live by Peter Breitenlohner <tex-live@tug.org> -+// See top-level ChangeLog for a list of all modifications -+//======================================================================== - - #ifndef PAGE_H - #define PAGE_H -@@ -170,9 +173,11 @@ - - void processLinks(OutputDev *out, Catalog *catalog); - -+#ifndef PDF_PARSER_ONLY - // Get the page's default CTM. - void getDefaultCTM(double *ctm, double hDPI, double vDPI, - int rotate, GBool useMediaBox, GBool upsideDown); -+#endif - - private: - -diff -ur -N xpdf-3.02.orig/xpdf/XRef.cc xpdf-3.02/xpdf/XRef.cc ---- xpdf-3.02.orig/xpdf/XRef.cc 2007-02-27 23:05:52.000000000 +0100 -+++ xpdf-3.02/xpdf/XRef.cc 2008-05-08 15:40:41.000000000 +0200 -@@ -5,6 +5,9 @@ - // Copyright 1996-2003 Glyph & Cog, LLC - // - //======================================================================== -+// Modified for TeX Live by Peter Breitenlohner <tex-live@tug.org> -+// See top-level ChangeLog for a list of all modifications -+//======================================================================== - - #include <aconf.h> - -@@ -45,34 +48,9 @@ - // ObjectStream - //------------------------------------------------------------------------ - --class ObjectStream { --public: -- -- // Create an object stream, using object number <objStrNum>, -- // generation 0. -- ObjectStream(XRef *xref, int objStrNumA); -- -- ~ObjectStream(); -- -- // Return the object number of this object stream. -- int getObjStrNum() { return objStrNum; } -- -- // Get the <objIdx>th object from this stream, which should be -- // object number <objNum>, generation 0. -- Object *getObject(int objIdx, int objNum, Object *obj); -- --private: -- -- int objStrNum; // object number of the object stream -- int nObjects; // number of objects in the stream -- Object *objs; // the objects (length = nObjects) -- int *objNums; // the object numbers (length = nObjects) --}; -- - ObjectStream::ObjectStream(XRef *xref, int objStrNumA) { - Stream *str; - Parser *parser; -- int *offsets; - Object objStr, obj1, obj2; - int first, i; - -@@ -80,6 +58,7 @@ - nObjects = 0; - objs = NULL; - objNums = NULL; -+ offsets = NULL; - - if (!xref->fetch(objStrNum, 0, &objStr)->isStream()) { - goto err1; -@@ -100,6 +79,7 @@ - goto err1; - } - first = obj1.getInt(); -+ firstOffset = objStr.getStream()->getBaseStream()->getStart() + first; - obj1.free(); - if (first < 0) { - goto err1; -@@ -121,7 +101,7 @@ - obj1.free(); - obj2.free(); - delete parser; -- gfree(offsets); -+// gfree(offsets); - goto err1; - } - objNums[i] = obj1.getInt(); -@@ -131,7 +111,7 @@ - if (objNums[i] < 0 || offsets[i] < 0 || - (i > 0 && offsets[i] < offsets[i-1])) { - delete parser; -- gfree(offsets); -+// gfree(offsets); - goto err1; - } - } -@@ -160,7 +140,7 @@ - delete parser; - } - -- gfree(offsets); -+// gfree(offsets); - - err1: - objStr.free(); -@@ -177,6 +157,7 @@ - delete[] objs; - } - gfree(objNums); -+ gfree(offsets); - } - - Object *ObjectStream::getObject(int objIdx, int objNum, Object *obj) { -diff -ur -N xpdf-3.02.orig/xpdf/XRef.h xpdf-3.02/xpdf/XRef.h ---- xpdf-3.02.orig/xpdf/XRef.h 2007-02-27 23:05:52.000000000 +0100 -+++ xpdf-3.02/xpdf/XRef.h 2008-05-08 15:40:41.000000000 +0200 -@@ -5,6 +5,9 @@ - // Copyright 1996-2003 Glyph & Cog, LLC - // - //======================================================================== -+// Modified for TeX Live by Peter Breitenlohner <tex-live@tug.org> -+// See top-level ChangeLog for a list of all modifications -+//======================================================================== - - #ifndef XREF_H - #define XREF_H -@@ -21,7 +24,36 @@ - class Dict; - class Stream; - class Parser; --class ObjectStream; -+ -+class ObjectStream { -+public: -+ -+ // Create an object stream, using object number <objStrNum>, -+ // generation 0. -+ ObjectStream(XRef *xref, int objStrNumA); -+ -+ ~ObjectStream(); -+ -+ // Return the object number of this object stream. -+ int getObjStrNum() { return objStrNum; } -+ -+ // Get the <objIdx>th object from this stream, which should be -+ // object number <objNum>, generation 0. -+ Object *getObject(int objIdx, int objNum, Object *obj); -+ -+ int *getOffsets() { return offsets; } -+ Guint getFirstOffset() { return firstOffset; } -+ -+private: -+ -+ int objStrNum; // object number of the object stream -+ int nObjects; // number of objects in the stream -+ Object *objs; // the objects (length = nObjects) -+ int *objNums; // the object numbers (length = nObjects) -+ int *offsets; // the object offsets (length = nObjects) -+ Guint firstOffset; -+}; -+ - - //------------------------------------------------------------------------ - // XRef -@@ -96,6 +128,7 @@ - int getSize() { return size; } - XRefEntry *getEntry(int i) { return &entries[i]; } - Object *getTrailerDict() { return &trailerDict; } -+ ObjectStream *getObjStr() { return objStr; } - - private: - diff --git a/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-20-skip-reading-config-file b/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-20-skip-reading-config-file new file mode 100644 index 00000000000..c00527abb3b --- /dev/null +++ b/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-20-skip-reading-config-file @@ -0,0 +1,72 @@ + Patches for pdfTeX / luaTeX / XeTeX + + Declare GlobalParams constructor without config file argument + and skip reading a config file. + + from: + Han The Thanh <thanh@pdftex.org> + Peter Breitenlohner <tex-live@tug.org> + +diff -ur -N xpdf-3.02.orig/xpdf/GlobalParams.cc xpdf-3.02/xpdf/GlobalParams.cc +--- xpdf-3.02.orig/xpdf/GlobalParams.cc 2009-04-02 10:22:18.000000000 +0200 ++++ xpdf-3.02/xpdf/GlobalParams.cc 2009-05-10 13:01:34.000000000 +0200 +@@ -608,10 +608,15 @@ + // parsing + //------------------------------------------------------------------------ + ++#ifdef PDF_PARSER_ONLY ++GlobalParams::GlobalParams() { ++ UnicodeMap *map; ++#else + GlobalParams::GlobalParams(char *cfgFileName) { + UnicodeMap *map; + GString *fileName; + FILE *f; ++#endif + int i; + + #if MULTITHREADED +@@ -755,6 +760,7 @@ + map = new UnicodeMap("UCS-2", gTrue, &mapUCS2); + residentUnicodeMaps->add(map->getEncodingName(), map); + ++#ifndef PDF_PARSER_ONLY + // look for a user config file, then a system-wide config file + f = NULL; + fileName = NULL; +@@ -792,6 +798,7 @@ + delete fileName; + fclose(f); + } ++#endif /* !PDF_PARSER_ONLY */ + } + + void GlobalParams::createDefaultKeyBindings() { +diff -ur -N xpdf-3.02.orig/xpdf/GlobalParams.h xpdf-3.02/xpdf/GlobalParams.h +--- xpdf-3.02.orig/xpdf/GlobalParams.h 2007-02-27 23:05:52.000000000 +0100 ++++ xpdf-3.02/xpdf/GlobalParams.h 2009-05-10 13:01:46.000000000 +0200 +@@ -5,6 +5,9 @@ + // Copyright 2001-2003 Glyph & Cog, LLC + // + //======================================================================== ++// Modified for TeX Live by Peter Breitenlohner <tex-live@tug.org> ++// See top-level ChangeLog for a list of all modifications ++//======================================================================== + + #ifndef GLOBALPARAMS_H + #define GLOBALPARAMS_H +@@ -192,9 +195,14 @@ + class GlobalParams { + public: + ++#ifdef PDF_PARSER_ONLY ++ // Initialize the global parameters without reading a config file. ++ GlobalParams(); ++#else + // Initialize the global parameters by attempting to read a config + // file. + GlobalParams(char *cfgFileName); ++#endif + + ~GlobalParams(); + diff --git a/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-22-exclude-openTempFile b/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-22-exclude-openTempFile new file mode 100644 index 00000000000..31dbce834a8 --- /dev/null +++ b/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-22-exclude-openTempFile @@ -0,0 +1,24 @@ + Patches for pdfTeX / luaTeX / XeTeX + + from: + Han The Thanh <thanh@pdftex.org> + +diff -ur -N xpdf-3.02.orig/goo/gfile.cc xpdf-3.02/goo/gfile.cc +--- xpdf-3.02.orig/goo/gfile.cc 2009-03-05 23:36:46.000000000 +0100 ++++ xpdf-3.02/goo/gfile.cc 2009-05-08 21:14:18.000000000 +0200 +@@ -443,6 +443,7 @@ + #endif + } + ++#ifndef PDF_PARSER_ONLY + GBool openTempFile(GString **name, FILE **f, char *mode, char *ext) { + #if defined(WIN32) + //---------- Win32 ---------- +@@ -551,6 +552,7 @@ + return gTrue; + #endif + } ++#endif + + GBool executeCommand(char *cmd) { + #ifdef VMS diff --git a/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-23-exclude-keyBindings b/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-23-exclude-keyBindings new file mode 100644 index 00000000000..c1de3c7837c --- /dev/null +++ b/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-23-exclude-keyBindings @@ -0,0 +1,156 @@ + Patches for pdfTeX / luaTeX / XeTeX + + from: + Han The Thanh <thanh@pdftex.org> + +diff -ur -N xpdf-3.02.orig/xpdf/GlobalParams.cc xpdf-3.02/xpdf/GlobalParams.cc +--- xpdf-3.02.orig/xpdf/GlobalParams.cc 2009-05-10 13:01:34.000000000 +0200 ++++ xpdf-3.02/xpdf/GlobalParams.cc 2009-05-10 13:16:03.000000000 +0200 +@@ -429,6 +429,7 @@ + } + } + ++#ifndef PDF_PARSER_ONLY + //------------------------------------------------------------------------ + // KeyBinding + //------------------------------------------------------------------------ +@@ -461,6 +462,7 @@ + KeyBinding::~KeyBinding() { + deleteGList(cmds, GString); + } ++#endif /* !PDF_PARSER_ONLY */ + + #ifdef ENABLE_PLUGINS + //------------------------------------------------------------------------ +@@ -718,7 +720,9 @@ + movieCommand = NULL; + mapNumericCharNames = gTrue; + mapUnknownCharNames = gFalse; ++#ifndef PDF_PARSER_ONLY + createDefaultKeyBindings(); ++#endif + printCommands = gFalse; + errQuiet = gFalse; + +@@ -801,6 +805,7 @@ + #endif /* !PDF_PARSER_ONLY */ + } + ++#ifndef PDF_PARSER_ONLY + void GlobalParams::createDefaultKeyBindings() { + keyBindings = new GList(); + +@@ -1127,6 +1132,7 @@ + + deleteGList(tokens, GString); + } ++#endif /* !PDF_PARSER_ONLY */ + + void GlobalParams::parseNameToUnicode(GList *tokens, GString *fileName, + int line) { +@@ -1471,6 +1477,7 @@ + } + } + ++#ifndef PDF_PARSER_ONLY + void GlobalParams::parseBind(GList *tokens, GString *fileName, int line) { + KeyBinding *binding; + GList *cmds; +@@ -1656,6 +1663,7 @@ + + return gTrue; + } ++#endif /* !PDF_PARSER_ONLY */ + + void GlobalParams::parseCommand(char *cmdName, GString **val, + GList *tokens, GString *fileName, int line) { +@@ -1799,7 +1807,9 @@ + if (movieCommand) { + delete movieCommand; + } ++#ifndef PDF_PARSER_ONLY + deleteGList(keyBindings, KeyBinding); ++#endif + + cMapDirs->startIter(&iter); + while (cMapDirs->getNext(&iter, &key, (void **)&list)) { +@@ -2450,6 +2460,7 @@ + return map; + } + ++#ifndef PDF_PARSER_ONLY + GList *GlobalParams::getKeyBinding(int code, int mods, int context) { + KeyBinding *binding; + GList *cmds; +@@ -2475,6 +2486,7 @@ + unlockGlobalParams; + return cmds; + } ++#endif /* !PDF_PARSER_ONLY */ + + GBool GlobalParams::getPrintCommands() { + GBool p; +diff -ur -N xpdf-3.02.orig/xpdf/GlobalParams.h xpdf-3.02/xpdf/GlobalParams.h +--- xpdf-3.02.orig/xpdf/GlobalParams.h 2009-05-10 13:01:46.000000000 +0200 ++++ xpdf-3.02/xpdf/GlobalParams.h 2009-05-10 13:16:03.000000000 +0200 +@@ -126,6 +126,7 @@ + + //------------------------------------------------------------------------ + ++#ifndef PDF_PARSER_ONLY + class KeyBinding { + public: + +@@ -189,6 +190,7 @@ + #define xpdfKeyContextMainWin (2 << 6) + #define xpdfKeyContextScrLockOn (1 << 8) + #define xpdfKeyContextScrLockOff (2 << 8) ++#endif /* !PDF_PARSER_ONLY */ + + //------------------------------------------------------------------------ + +@@ -264,7 +266,9 @@ + GString *getMovieCommand() { return movieCommand; } + GBool getMapNumericCharNames(); + GBool getMapUnknownCharNames(); ++#ifndef PDF_PARSER_ONLY + GList *getKeyBinding(int code, int mods, int context); ++#endif + GBool getPrintCommands(); + GBool getErrQuiet(); + +@@ -323,7 +327,9 @@ + + private: + ++#ifndef PDF_PARSER_ONLY + void createDefaultKeyBindings(); ++#endif + void parseFile(GString *fileName, FILE *f); + void parseNameToUnicode(GList *tokens, GString *fileName, int line); + void parseCIDToUnicode(GList *tokens, GString *fileName, int line); +@@ -346,12 +352,14 @@ + void parseFontDir(GList *tokens, GString *fileName, int line); + void parseInitialZoom(GList *tokens, GString *fileName, int line); + void parseScreenType(GList *tokens, GString *fileName, int line); ++#ifndef PDF_PARSER_ONLY + void parseBind(GList *tokens, GString *fileName, int line); + void parseUnbind(GList *tokens, GString *fileName, int line); + GBool parseKey(GString *modKeyStr, GString *contextStr, + int *code, int *mods, int *context, + char *cmdName, + GList *tokens, GString *fileName, int line); ++#endif + void parseCommand(char *cmdName, GString **val, + GList *tokens, GString *fileName, int line); + void parseYesNo(char *cmdName, GBool *flag, +@@ -446,7 +454,9 @@ + GString *movieCommand; // command executed for movie annotations + GBool mapNumericCharNames; // map numeric char names (from font subsets)? + GBool mapUnknownCharNames; // map unknown char names? ++#ifndef PDF_PARSER_ONLY + GList *keyBindings; // key & mouse button bindings [KeyBinding] ++#endif + GBool printCommands; // print the drawing commands + GBool errQuiet; // suppress error messages? + diff --git a/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-40-objectStream-support-for-pdftosrc b/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-40-objectStream-support-for-pdftosrc new file mode 100644 index 00000000000..03d11926eaa --- /dev/null +++ b/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-40-objectStream-support-for-pdftosrc @@ -0,0 +1,165 @@ + Patches for pdfTeX / luaTeX / XeTeX + + Object stream support for pdftosrc + + from: + Han The Thanh <thanh@pdftex.org> + +diff -ur -N xpdf-3.02.orig/xpdf/XRef.cc xpdf-3.02/xpdf/XRef.cc +--- xpdf-3.02.orig/xpdf/XRef.cc 2007-02-27 23:05:52.000000000 +0100 ++++ xpdf-3.02/xpdf/XRef.cc 2009-05-08 21:39:44.000000000 +0200 +@@ -5,6 +5,9 @@ + // Copyright 1996-2003 Glyph & Cog, LLC + // + //======================================================================== ++// Modified for TeX Live by Peter Breitenlohner <tex-live@tug.org> ++// See top-level ChangeLog for a list of all modifications ++//======================================================================== + + #include <aconf.h> + +@@ -45,34 +48,9 @@ + // ObjectStream + //------------------------------------------------------------------------ + +-class ObjectStream { +-public: +- +- // Create an object stream, using object number <objStrNum>, +- // generation 0. +- ObjectStream(XRef *xref, int objStrNumA); +- +- ~ObjectStream(); +- +- // Return the object number of this object stream. +- int getObjStrNum() { return objStrNum; } +- +- // Get the <objIdx>th object from this stream, which should be +- // object number <objNum>, generation 0. +- Object *getObject(int objIdx, int objNum, Object *obj); +- +-private: +- +- int objStrNum; // object number of the object stream +- int nObjects; // number of objects in the stream +- Object *objs; // the objects (length = nObjects) +- int *objNums; // the object numbers (length = nObjects) +-}; +- + ObjectStream::ObjectStream(XRef *xref, int objStrNumA) { + Stream *str; + Parser *parser; +- int *offsets; + Object objStr, obj1, obj2; + int first, i; + +@@ -80,6 +58,7 @@ + nObjects = 0; + objs = NULL; + objNums = NULL; ++ offsets = NULL; + + if (!xref->fetch(objStrNum, 0, &objStr)->isStream()) { + goto err1; +@@ -100,6 +79,7 @@ + goto err1; + } + first = obj1.getInt(); ++ firstOffset = objStr.getStream()->getBaseStream()->getStart() + first; + obj1.free(); + if (first < 0) { + goto err1; +@@ -121,7 +101,7 @@ + obj1.free(); + obj2.free(); + delete parser; +- gfree(offsets); ++// gfree(offsets); + goto err1; + } + objNums[i] = obj1.getInt(); +@@ -131,7 +111,7 @@ + if (objNums[i] < 0 || offsets[i] < 0 || + (i > 0 && offsets[i] < offsets[i-1])) { + delete parser; +- gfree(offsets); ++// gfree(offsets); + goto err1; + } + } +@@ -160,7 +140,7 @@ + delete parser; + } + +- gfree(offsets); ++// gfree(offsets); + + err1: + objStr.free(); +@@ -177,6 +157,7 @@ + delete[] objs; + } + gfree(objNums); ++ gfree(offsets); + } + + Object *ObjectStream::getObject(int objIdx, int objNum, Object *obj) { +diff -ur -N xpdf-3.02.orig/xpdf/XRef.h xpdf-3.02/xpdf/XRef.h +--- xpdf-3.02.orig/xpdf/XRef.h 2007-02-27 23:05:52.000000000 +0100 ++++ xpdf-3.02/xpdf/XRef.h 2009-05-08 21:39:41.000000000 +0200 +@@ -5,6 +5,9 @@ + // Copyright 1996-2003 Glyph & Cog, LLC + // + //======================================================================== ++// Modified for TeX Live by Peter Breitenlohner <tex-live@tug.org> ++// See top-level ChangeLog for a list of all modifications ++//======================================================================== + + #ifndef XREF_H + #define XREF_H +@@ -21,7 +24,36 @@ + class Dict; + class Stream; + class Parser; +-class ObjectStream; ++ ++class ObjectStream { ++public: ++ ++ // Create an object stream, using object number <objStrNum>, ++ // generation 0. ++ ObjectStream(XRef *xref, int objStrNumA); ++ ++ ~ObjectStream(); ++ ++ // Return the object number of this object stream. ++ int getObjStrNum() { return objStrNum; } ++ ++ // Get the <objIdx>th object from this stream, which should be ++ // object number <objNum>, generation 0. ++ Object *getObject(int objIdx, int objNum, Object *obj); ++ ++ int *getOffsets() { return offsets; } ++ Guint getFirstOffset() { return firstOffset; } ++ ++private: ++ ++ int objStrNum; // object number of the object stream ++ int nObjects; // number of objects in the stream ++ Object *objs; // the objects (length = nObjects) ++ int *objNums; // the object numbers (length = nObjects) ++ int *offsets; // the object offsets (length = nObjects) ++ Guint firstOffset; ++}; ++ + + //------------------------------------------------------------------------ + // XRef +@@ -96,6 +128,7 @@ + int getSize() { return size; } + XRefEntry *getEntry(int i) { return &entries[i]; } + Object *getTrailerDict() { return &trailerDict; } ++ ObjectStream *getObjStr() { return objStr; } + + private: + diff --git a/Build/source/libs/xpdf/xpdf-3.02/install-sh b/Build/source/libs/xpdf/xpdf-3.02/install-sh deleted file mode 100755 index 6781b987bdb..00000000000 --- a/Build/source/libs/xpdf/xpdf-3.02/install-sh +++ /dev/null @@ -1,520 +0,0 @@ -#!/bin/sh -# install - install a program, script, or datafile - -scriptversion=2009-04-28.21; # UTC - -# This originates from X11R5 (mit/util/scripts/install.sh), which was -# later released in X11R6 (xc/config/util/install.sh) with the -# following copyright and license. -# -# Copyright (C) 1994 X Consortium -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- -# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name of the X Consortium shall not -# be used in advertising or otherwise to promote the sale, use or other deal- -# ings in this Software without prior written authorization from the X Consor- -# tium. -# -# -# FSF changes to this file are in the public domain. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. - -nl=' -' -IFS=" "" $nl" - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit=${DOITPROG-} -if test -z "$doit"; then - doit_exec=exec -else - doit_exec=$doit -fi - -# Put in absolute file names if you don't have them in your path; -# or use environment vars. - -chgrpprog=${CHGRPPROG-chgrp} -chmodprog=${CHMODPROG-chmod} -chownprog=${CHOWNPROG-chown} -cmpprog=${CMPPROG-cmp} -cpprog=${CPPROG-cp} -mkdirprog=${MKDIRPROG-mkdir} -mvprog=${MVPROG-mv} -rmprog=${RMPROG-rm} -stripprog=${STRIPPROG-strip} - -posix_glob='?' -initialize_posix_glob=' - test "$posix_glob" != "?" || { - if (set -f) 2>/dev/null; then - posix_glob= - else - posix_glob=: - fi - } -' - -posix_mkdir= - -# Desired mode of installed file. -mode=0755 - -chgrpcmd= -chmodcmd=$chmodprog -chowncmd= -mvcmd=$mvprog -rmcmd="$rmprog -f" -stripcmd= - -src= -dst= -dir_arg= -dst_arg= - -copy_on_change=false -no_target_directory= - -usage="\ -Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE - or: $0 [OPTION]... SRCFILES... DIRECTORY - or: $0 [OPTION]... -t DIRECTORY SRCFILES... - or: $0 [OPTION]... -d DIRECTORIES... - -In the 1st form, copy SRCFILE to DSTFILE. -In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. -In the 4th, create DIRECTORIES. - -Options: - --help display this help and exit. - --version display version info and exit. - - -c (ignored) - -C install only if different (preserve the last data modification time) - -d create directories instead of installing files. - -g GROUP $chgrpprog installed files to GROUP. - -m MODE $chmodprog installed files to MODE. - -o USER $chownprog installed files to USER. - -s $stripprog installed files. - -t DIRECTORY install into DIRECTORY. - -T report an error if DSTFILE is a directory. - -Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG - RMPROG STRIPPROG -" - -while test $# -ne 0; do - case $1 in - -c) ;; - - -C) copy_on_change=true;; - - -d) dir_arg=true;; - - -g) chgrpcmd="$chgrpprog $2" - shift;; - - --help) echo "$usage"; exit $?;; - - -m) mode=$2 - case $mode in - *' '* | *' '* | *' -'* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; - - -o) chowncmd="$chownprog $2" - shift;; - - -s) stripcmd=$stripprog;; - - -t) dst_arg=$2 - shift;; - - -T) no_target_directory=true;; - - --version) echo "$0 $scriptversion"; exit $?;; - - --) shift - break;; - - -*) echo "$0: invalid option: $1" >&2 - exit 1;; - - *) break;; - esac - shift -done - -if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then - # When -d is used, all remaining arguments are directories to create. - # When -t is used, the destination is already specified. - # Otherwise, the last argument is the destination. Remove it from $@. - for arg - do - if test -n "$dst_arg"; then - # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dst_arg" - shift # fnord - fi - shift # arg - dst_arg=$arg - done -fi - -if test $# -eq 0; then - if test -z "$dir_arg"; then - echo "$0: no input file specified." >&2 - exit 1 - fi - # It's OK to call `install-sh -d' without argument. - # This can happen when creating conditional directories. - exit 0 -fi - -if test -z "$dir_arg"; then - trap '(exit $?); exit' 1 2 13 15 - - # Set umask so as not to create temps with too-generous modes. - # However, 'strip' requires both read and write access to temps. - case $mode in - # Optimize common cases. - *644) cp_umask=133;; - *755) cp_umask=22;; - - *[0-7]) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw='% 200' - fi - cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; - *) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw=,u+rw - fi - cp_umask=$mode$u_plus_rw;; - esac -fi - -for src -do - # Protect names starting with `-'. - case $src in - -*) src=./$src;; - esac - - if test -n "$dir_arg"; then - dst=$src - dstdir=$dst - test -d "$dstdir" - dstdir_status=$? - else - - # Waiting for this to be detected by the "$cpprog $src $dsttmp" command - # might cause directories to be created, which would be especially bad - # if $src (and thus $dsttmp) contains '*'. - if test ! -f "$src" && test ! -d "$src"; then - echo "$0: $src does not exist." >&2 - exit 1 - fi - - if test -z "$dst_arg"; then - echo "$0: no destination specified." >&2 - exit 1 - fi - - dst=$dst_arg - # Protect names starting with `-'. - case $dst in - -*) dst=./$dst;; - esac - - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. - if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 - fi - dstdir=$dst - dst=$dstdir/`basename "$src"` - dstdir_status=0 - else - # Prefer dirname, but fall back on a substitute if dirname fails. - dstdir=` - (dirname "$dst") 2>/dev/null || - expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$dst" : 'X\(//\)[^/]' \| \ - X"$dst" : 'X\(//\)$' \| \ - X"$dst" : 'X\(/\)' \| . 2>/dev/null || - echo X"$dst" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q' - ` - - test -d "$dstdir" - dstdir_status=$? - fi - fi - - obsolete_mkdir_used=false - - if test $dstdir_status != 0; then - case $posix_mkdir in - '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - - # With -d, create the new directory with the user-specified mode. - # Otherwise, rely on $mkdir_umask. - if test -n "$dir_arg"; then - mkdir_mode=-m$mode - else - mkdir_mode= - fi - - posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 - - if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writeable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/d" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null - fi - trap '' 0;; - esac;; - esac - - if - $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" - ) - then : - else - - # The umask is ridiculous, or mkdir does not conform to POSIX, - # or it failed possibly due to a race condition. Create the - # directory the slow way, step by step, checking for races as we go. - - case $dstdir in - /*) prefix='/';; - -*) prefix='./';; - *) prefix='';; - esac - - eval "$initialize_posix_glob" - - oIFS=$IFS - IFS=/ - $posix_glob set -f - set fnord $dstdir - shift - $posix_glob set +f - IFS=$oIFS - - prefixes= - - for d - do - test -z "$d" && continue - - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask=$mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ - done - - if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true - fi - fi - fi - - if test -n "$dir_arg"; then - { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && - { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || - test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 - else - - # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ - - # Trap to clean up those temp files at exit. - trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 - - # Copy the file name to the temp name. - (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && - - # and set any options; do chmod last to preserve setuid bits. - # - # If any of these fail, we abort the whole thing. If we want to - # ignore errors from any of these, just make sure not to ignore - # errors from the above "$doit $cpprog $src $dsttmp" command. - # - { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && - { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && - { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && - - # If -C, don't bother to copy if it wouldn't change the file. - if $copy_on_change && - old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && - new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - - eval "$initialize_posix_glob" && - $posix_glob set -f && - set X $old && old=:$2:$4:$5:$6 && - set X $new && new=:$2:$4:$5:$6 && - $posix_glob set +f && - - test "$old" = "$new" && - $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 - then - rm -f "$dsttmp" - else - # Rename the file to the real destination. - $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || - - # The rename failed, perhaps because mv can't rename something else - # to itself, or perhaps because mv is so ancient that it does not - # support -f. - { - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || - { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } - } || - { echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" - } - fi || exit 1 - - trap '' 0 - fi -done - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff --git a/Build/source/libs/xpdf/xpdf-3.02/xpdf/GlobalParams.cc b/Build/source/libs/xpdf/xpdf-3.02/xpdf/GlobalParams.cc index ad63b7d69d0..d701803e33a 100644 --- a/Build/source/libs/xpdf/xpdf-3.02/xpdf/GlobalParams.cc +++ b/Build/source/libs/xpdf/xpdf-3.02/xpdf/GlobalParams.cc @@ -462,7 +462,7 @@ KeyBinding::KeyBinding(int codeA, int modsA, int contextA, GList *cmdsA) { KeyBinding::~KeyBinding() { deleteGList(cmds, GString); } -#endif +#endif /* !PDF_PARSER_ONLY */ #ifdef ENABLE_PLUGINS //------------------------------------------------------------------------ @@ -610,142 +610,15 @@ Plugin::~Plugin() { // parsing //------------------------------------------------------------------------ +#ifdef PDF_PARSER_ONLY GlobalParams::GlobalParams() { UnicodeMap *map; - int i; - -#if MULTITHREADED - gInitMutex(&mutex); - gInitMutex(&unicodeMapCacheMutex); - gInitMutex(&cMapCacheMutex); -#endif - - initBuiltinFontTables(); - - // scan the encoding in reverse because we want the lowest-numbered - // index for each char name ('space' is encoded twice) - macRomanReverseMap = new NameToCharCode(); - for (i = 255; i >= 0; --i) { - if (macRomanEncoding[i]) { - macRomanReverseMap->add(macRomanEncoding[i], (CharCode)i); - } - } - -#ifdef WIN32 - // baseDir will be set by a call to setBaseDir - baseDir = new GString(); #else - baseDir = appendToPath(getHomeDir(), ".xpdf"); -#endif - nameToUnicode = new NameToCharCode(); - cidToUnicodes = new GHash(gTrue); - unicodeToUnicodes = new GHash(gTrue); - residentUnicodeMaps = new GHash(); - unicodeMaps = new GHash(gTrue); - cMapDirs = new GHash(gTrue); - toUnicodeDirs = new GList(); - displayFonts = new GHash(); - displayCIDFonts = new GHash(); - displayNamedCIDFonts = new GHash(); -#if HAVE_PAPER_H - char *paperName; - const struct paper *paperType; - paperinit(); - if ((paperName = systempapername())) { - paperType = paperinfo(paperName); - psPaperWidth = (int)paperpswidth(paperType); - psPaperHeight = (int)paperpsheight(paperType); - } else { - error(-1, "No paper information available - using defaults"); - psPaperWidth = defPaperWidth; - psPaperHeight = defPaperHeight; - } - paperdone(); -#else - psPaperWidth = defPaperWidth; - psPaperHeight = defPaperHeight; -#endif - psImageableLLX = psImageableLLY = 0; - psImageableURX = psPaperWidth; - psImageableURY = psPaperHeight; - psCrop = gTrue; - psExpandSmaller = gFalse; - psShrinkLarger = gTrue; - psCenter = gTrue; - psDuplex = gFalse; - psLevel = psLevel2; - psFile = NULL; - psFonts = new GHash(); - psNamedFonts16 = new GList(); - psFonts16 = new GList(); - psEmbedType1 = gTrue; - psEmbedTrueType = gTrue; - psEmbedCIDPostScript = gTrue; - psEmbedCIDTrueType = gTrue; - psOPI = gFalse; - psASCIIHex = gFalse; - textEncoding = new GString("Latin1"); -#if defined(WIN32) - textEOL = eolDOS; -#elif defined(MACOS) - textEOL = eolMac; -#else - textEOL = eolUnix; -#endif - textPageBreaks = gTrue; - textKeepTinyChars = gFalse; - fontDirs = new GList(); - initialZoom = new GString("125"); - continuousView = gFalse; - enableT1lib = gTrue; - enableFreeType = gTrue; - antialias = gTrue; - urlCommand = NULL; - movieCommand = NULL; - mapNumericCharNames = gTrue; - printCommands = gFalse; - errQuiet = gFalse; - - cidToUnicodeCache = new CharCodeToUnicodeCache(cidToUnicodeCacheSize); - unicodeToUnicodeCache = - new CharCodeToUnicodeCache(unicodeToUnicodeCacheSize); - unicodeMapCache = new UnicodeMapCache(); - cMapCache = new CMapCache(); - -#ifdef ENABLE_PLUGINS - plugins = new GList(); - securityHandlers = new GList(); -#endif - - // set up the initial nameToUnicode table - for (i = 0; nameToUnicodeTab[i].name; ++i) { - nameToUnicode->add(nameToUnicodeTab[i].name, nameToUnicodeTab[i].u); - } - - // set up the residentUnicodeMaps table - map = new UnicodeMap("Latin1", gFalse, - latin1UnicodeMapRanges, latin1UnicodeMapLen); - residentUnicodeMaps->add(map->getEncodingName(), map); - map = new UnicodeMap("ASCII7", gFalse, - ascii7UnicodeMapRanges, ascii7UnicodeMapLen); - residentUnicodeMaps->add(map->getEncodingName(), map); - map = new UnicodeMap("Symbol", gFalse, - symbolUnicodeMapRanges, symbolUnicodeMapLen); - residentUnicodeMaps->add(map->getEncodingName(), map); - map = new UnicodeMap("ZapfDingbats", gFalse, zapfDingbatsUnicodeMapRanges, - zapfDingbatsUnicodeMapLen); - residentUnicodeMaps->add(map->getEncodingName(), map); - map = new UnicodeMap("UTF-8", gTrue, &mapUTF8); - residentUnicodeMaps->add(map->getEncodingName(), map); - map = new UnicodeMap("UCS-2", gTrue, &mapUCS2); - residentUnicodeMaps->add(map->getEncodingName(), map); - -} - GlobalParams::GlobalParams(char *cfgFileName) { UnicodeMap *map; GString *fileName; FILE *f; +#endif int i; #if MULTITHREADED @@ -891,6 +764,7 @@ GlobalParams::GlobalParams(char *cfgFileName) { map = new UnicodeMap("UCS-2", gTrue, &mapUCS2); residentUnicodeMaps->add(map->getEncodingName(), map); +#ifndef PDF_PARSER_ONLY // look for a user config file, then a system-wide config file f = NULL; fileName = NULL; @@ -924,12 +798,11 @@ GlobalParams::GlobalParams(char *cfgFileName) { } } if (f) { -#ifndef PDF_PARSER_ONLY parseFile(fileName, f); -#endif delete fileName; fclose(f); } +#endif /* !PDF_PARSER_ONLY */ } #ifndef PDF_PARSER_ONLY @@ -1259,7 +1132,7 @@ void GlobalParams::parseLine(char *buf, GString *fileName, int line) { deleteGList(tokens, GString); } -#endif +#endif /* !PDF_PARSER_ONLY */ void GlobalParams::parseNameToUnicode(GList *tokens, GString *fileName, int line) { @@ -1790,7 +1663,7 @@ GBool GlobalParams::parseKey(GString *modKeyStr, GString *contextStr, return gTrue; } -#endif +#endif /* !PDF_PARSER_ONLY */ void GlobalParams::parseCommand(char *cmdName, GString **val, GList *tokens, GString *fileName, int line) { @@ -2613,7 +2486,7 @@ GList *GlobalParams::getKeyBinding(int code, int mods, int context) { unlockGlobalParams; return cmds; } -#endif +#endif /* !PDF_PARSER_ONLY */ GBool GlobalParams::getPrintCommands() { GBool p; diff --git a/Build/source/libs/xpdf/xpdf-3.02/xpdf/GlobalParams.h b/Build/source/libs/xpdf/xpdf-3.02/xpdf/GlobalParams.h index 3d19e4f4f4c..b57a1698d3f 100644 --- a/Build/source/libs/xpdf/xpdf-3.02/xpdf/GlobalParams.h +++ b/Build/source/libs/xpdf/xpdf-3.02/xpdf/GlobalParams.h @@ -190,28 +190,28 @@ public: #define xpdfKeyContextMainWin (2 << 6) #define xpdfKeyContextScrLockOn (1 << 8) #define xpdfKeyContextScrLockOff (2 << 8) -#endif +#endif /* !PDF_PARSER_ONLY */ //------------------------------------------------------------------------ class GlobalParams { public: +#ifdef PDF_PARSER_ONLY + // Initialize the global parameters without reading a config file. + GlobalParams(); +#else // Initialize the global parameters by attempting to read a config // file. GlobalParams(char *cfgFileName); - - // Initialize it without reading the config - GlobalParams(); +#endif ~GlobalParams(); void setBaseDir(char *dir); void setupBaseFonts(char *dir); -#ifndef PDF_PARSER_ONLY void parseLine(char *buf, GString *fileName, int line); -#endif //----- accessors diff --git a/Build/source/libs/xpdf/xpdf-3.02/xpdf/Page.cc b/Build/source/libs/xpdf/xpdf-3.02/xpdf/Page.cc index 376edf04f1f..6b52ba936ff 100644 --- a/Build/source/libs/xpdf/xpdf-3.02/xpdf/Page.cc +++ b/Build/source/libs/xpdf/xpdf-3.02/xpdf/Page.cc @@ -5,9 +5,6 @@ // Copyright 1996-2007 Glyph & Cog, LLC // //======================================================================== -// Modified for TeX Live by Peter Breitenlohner <tex-live@tug.org> -// See top-level ChangeLog for a list of all modifications -//======================================================================== #include <aconf.h> @@ -423,9 +420,9 @@ void Page::processLinks(OutputDev *out, Catalog *catalog) { delete links; } -#ifndef PDF_PARSER_ONLY void Page::getDefaultCTM(double *ctm, double hDPI, double vDPI, int rotate, GBool useMediaBox, GBool upsideDown) { +#ifndef PDF_PARSER_ONLY GfxState *state; int i; @@ -442,5 +439,5 @@ void Page::getDefaultCTM(double *ctm, double hDPI, double vDPI, ctm[i] = state->getCTM()[i]; } delete state; -} #endif +} diff --git a/Build/source/libs/xpdf/xpdf-3.02/xpdf/Page.h b/Build/source/libs/xpdf/xpdf-3.02/xpdf/Page.h index ab2d296d424..2b011756e85 100644 --- a/Build/source/libs/xpdf/xpdf-3.02/xpdf/Page.h +++ b/Build/source/libs/xpdf/xpdf-3.02/xpdf/Page.h @@ -5,9 +5,6 @@ // Copyright 1996-2003 Glyph & Cog, LLC // //======================================================================== -// Modified for TeX Live by Peter Breitenlohner <tex-live@tug.org> -// See top-level ChangeLog for a list of all modifications -//======================================================================== #ifndef PAGE_H #define PAGE_H @@ -173,11 +170,9 @@ public: void processLinks(OutputDev *out, Catalog *catalog); -#ifndef PDF_PARSER_ONLY // Get the page's default CTM. void getDefaultCTM(double *ctm, double hDPI, double vDPI, int rotate, GBool useMediaBox, GBool upsideDown); -#endif private: diff --git a/Build/source/libs/xpdf/xpdf-3.02/xpdf/XRef.h b/Build/source/libs/xpdf/xpdf-3.02/xpdf/XRef.h index c8ecaaec436..f244264b3de 100644 --- a/Build/source/libs/xpdf/xpdf-3.02/xpdf/XRef.h +++ b/Build/source/libs/xpdf/xpdf-3.02/xpdf/XRef.h @@ -46,11 +46,11 @@ public: private: - int objStrNum; // object number of the object stream - int nObjects; // number of objects in the stream - Object *objs; // the objects (length = nObjects) - int *objNums; // the object numbers (length = nObjects) - int *offsets; // the object offsets (length = nObjects) + int objStrNum; // object number of the object stream + int nObjects; // number of objects in the stream + Object *objs; // the objects (length = nObjects) + int *objNums; // the object numbers (length = nObjects) + int *offsets; // the object offsets (length = nObjects) Guint firstOffset; }; |