diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2009-05-06 08:19:56 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2009-05-06 08:19:56 +0000 |
commit | 72351c3e68ec7574a578bd41f7a0b17578d857af (patch) | |
tree | 84f9dfe9627578aee454107602231168c950cc83 /Build | |
parent | f4c2f03b11aecc0d90f836edfd44da8bd24e1bd8 (diff) |
support libpoppler as 'system-xpdf'
git-svn-id: svn://tug.org/texlive/trunk@12943 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r-- | Build/source/Makefile.am | 11 | ||||
-rw-r--r-- | Build/source/Makefile.in | 6 | ||||
-rwxr-xr-x | Build/source/configure | 6 | ||||
-rw-r--r-- | Build/source/libs/xpdf/ac/xpdf.ac | 2 | ||||
-rw-r--r-- | Build/source/m4/kpse-xpdf-flags.m4 | 6 | ||||
-rw-r--r-- | Build/source/texk/web2c/Makefile.in | 46 | ||||
-rwxr-xr-x | Build/source/texk/web2c/configure | 6 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/ChangeLog | 6 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/image/pdftoepdf.cc | 9 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/utils/utils.c | 11 | ||||
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/ChangeLog | 6 | ||||
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/pdftoepdf.cc | 12 | ||||
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/pdftosrc.cc | 212 | ||||
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/utils.c | 11 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/ChangeLog | 6 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/XeTeX_ext.c | 12 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/am/xetex.am | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/am/xetex.mk | 205 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/pdfimage.cpp | 12 |
19 files changed, 334 insertions, 255 deletions
diff --git a/Build/source/Makefile.am b/Build/source/Makefile.am index 63a51a56999..9e519bf0b60 100644 --- a/Build/source/Makefile.am +++ b/Build/source/Makefile.am @@ -10,6 +10,7 @@ DISTCHECK_CONFIGURE_FLAGS = -C EXTRA_DIST = \ Build \ + README.config \ README.cross \ README.layout \ build-aux/README.TL \ @@ -26,12 +27,12 @@ SUBDIRS = endif !build_kpathsea SUBDIRS += libs utils texk -## This is the default target for the Build script in TeX Live. +# This is the default target for the Build script in TeX Live. +# +# run texlinks here since the binaries won't be there +# at install-data, and fmtutil.cnf won't be there at install-exec, +# and there is no install-hook or install-local. world: install-strip -## -## run texlinks here since the binaries won't be there -## at install-data, and fmtutil.cnf won't be there at install-exec, -## and there is no hook or -local for install. echo "top-level make $@: running texlinks ..." cd texk/tetex && $(MAKE) $(AM_MAKEFLAGS) run-texlinks ## diff --git a/Build/source/Makefile.in b/Build/source/Makefile.in index a8b27cd8a21..bdb1159ad7b 100644 --- a/Build/source/Makefile.in +++ b/Build/source/Makefile.in @@ -283,6 +283,7 @@ ACLOCAL_AMFLAGS = -I m4 DISTCHECK_CONFIGURE_FLAGS = -C EXTRA_DIST = \ Build \ + README.config \ README.cross \ README.layout \ build-aux/README.TL \ @@ -727,6 +728,11 @@ uninstall-am: dist-hook: rm -rf `find $(distdir) -name .svn` +# This is the default target for the Build script in TeX Live. +# +# run texlinks here since the binaries won't be there +# at install-data, and fmtutil.cnf won't be there at install-exec, +# and there is no install-hook or install-local. world: install-strip echo "top-level make $@: running texlinks ..." cd texk/tetex && $(MAKE) $(AM_MAKEFLAGS) run-texlinks diff --git a/Build/source/configure b/Build/source/configure index 35faadcf388..7caf7a3b12f 100755 --- a/Build/source/configure +++ b/Build/source/configure @@ -20395,9 +20395,7 @@ fi if $PKG_CONFIG poppler --atleast-version=0.10; then POPPLER_VERSION='-DPOPPLER_VERSION=\"'`$PKG_CONFIG poppler --modversion`'\"' - XPDF_INCLUDES=`$PKG_CONFIG poppler --cflags` - XPDF_INCLUDES=`echo $XPDF_INCLUDES` - XPDF_INCLUDES="$POPPLER_VERSION $XPDF_INCLUDES $XPDF_INCLUDES/goo" + XPDF_INCLUDES="$POPPLER_VERSION `$PKG_CONFIG poppler --cflags`" XPDF_LIBS=`$PKG_CONFIG poppler --libs` fi @@ -22135,7 +22133,7 @@ fi done -for ac_header in gtypes.h +for ac_header in goo/gtypes.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then diff --git a/Build/source/libs/xpdf/ac/xpdf.ac b/Build/source/libs/xpdf/ac/xpdf.ac index e588ec794c5..9ac2b70bc95 100644 --- a/Build/source/libs/xpdf/ac/xpdf.ac +++ b/Build/source/libs/xpdf/ac/xpdf.ac @@ -4,4 +4,4 @@ dnl Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org> dnl You may freely use, modify and/or distribute this file. dnl ## define required functions and headers from system xpdf -KPSE_CHECK_LIB([xpdf], [free], [gtypes.h]) +KPSE_CHECK_LIB([xpdf], [free], [goo/gtypes.h]) diff --git a/Build/source/m4/kpse-xpdf-flags.m4 b/Build/source/m4/kpse-xpdf-flags.m4 index fa3166739c4..6da80749f2e 100644 --- a/Build/source/m4/kpse-xpdf-flags.m4 +++ b/Build/source/m4/kpse-xpdf-flags.m4 @@ -13,7 +13,7 @@ # LIBS required for the `-lxpdf' library in libs/xpdf/ of the TL tree. AC_DEFUN([KPSE_XPDF_FLAGS], [_KPSE_LIB_FLAGS([xpdf], [xpdf], [], - [-DPDF_PARSER_ONLY -IBLD/libs/xpdf -IBLD/libs/xpdf/goo -IBLD/libs/xpdf/fofi -IBLD/libs/xpdf/xpdf], + [-DPDF_PARSER_ONLY -IBLD/libs/xpdf -IBLD/libs/xpdf/goo -IBLD/libs/xpdf/xpdf], [BLD/libs/xpdf/libxpdf.a], [], [], [${top_builddir}/../../libs/xpdf/xpdf/Stream.h])[]dnl ]) # KPSE_XPDF_FLAGS @@ -34,9 +34,7 @@ AC_DEFUN([KPSE_XPDF_SYSTEM_FLAGS], [AC_REQUIRE([_KPSE_CHECK_PKG_CONFIG])[]dnl if $PKG_CONFIG poppler --atleast-version=0.10; then POPPLER_VERSION='-DPOPPLER_VERSION=\"'`$PKG_CONFIG poppler --modversion`'\"' - XPDF_INCLUDES=`$PKG_CONFIG poppler --cflags` - XPDF_INCLUDES=`echo $XPDF_INCLUDES` - XPDF_INCLUDES="$POPPLER_VERSION $XPDF_INCLUDES $XPDF_INCLUDES/goo" + XPDF_INCLUDES="$POPPLER_VERSION `$PKG_CONFIG poppler --cflags`" XPDF_LIBS=`$PKG_CONFIG poppler --libs` fi ]) # KPSE_XPDF_SYSTEM_FLAGS diff --git a/Build/source/texk/web2c/Makefile.in b/Build/source/texk/web2c/Makefile.in index cb7729dbfb0..8cca5b4ab38 100644 --- a/Build/source/texk/web2c/Makefile.in +++ b/Build/source/texk/web2c/Makefile.in @@ -1117,29 +1117,29 @@ EXTRA_DIST = PROJECTS cftests config.h cpascal.h help.h tangle.web \ xetexdir/xetex.defines xetexdir/xetexextra.in \ xetexdir/pool2c.pl xetexdir/unicode-char-prep.pl \ xetexdir/appleGlyphNames.c xetexdir/XeTeXFontMgr_Mac.mm \ - xetexdir/LICENSE.txt xetexdir/acx_pthread.m4 \ - xetexdir/am/xetex.mk xetexdir/tests.ac xetexdir/withenable.ac \ - xetexdir/xetex.mk omegaware/ChangeLog $(odvicopy_sources) \ - $(odvitype_sources) $(ofm2opl_sources) $(opl2ofm_sources) \ - $(otangle_sources) $(ovf2ovp_sources) $(ovp2ovf_sources) \ - $(aleph_web_srcs) $(aleph_ch_srcs) lib/texmfmp.c \ - alephdir/ChangeLog alephdir/Makefile alephdir/aleph.defines \ - alephdir/aleph.version alephdir/eomega.ech alephdir/etex.ch \ - alephdir/omega.ch0 alephdir/omega.ch1 alephdir/omega.ch2 \ - alephdir/omxml.ch alephdir/aleph.mk synctexdir/INSTALL \ - synctexdir/Makefile synctexdir/Makefile.in \ - synctexdir/README.txt synctexdir/synctex-common.h \ - synctexdir/synctex-convert.sh synctexdir/synctex.c \ - synctexdir/synctex.defines synctexdir/synctex.h \ - synctexdir/synctex-mem.ch0 synctexdir/synctex-mem.ch1 \ - synctexdir/synctex-mem.ch2 synctexdir/synctex-rec.ch0 \ - synctexdir/synctex-rec.ch1 synctexdir/synctex-rec.ch2 \ - synctexdir/synctex-e-mem.ch0 synctexdir/synctex-e-mem.ch1 \ - synctexdir/synctex-e-rec.ch0 synctexdir/synctex-e-rec.ch1 \ - synctexdir/synctex-pdf-rec.ch2 synctexdir/synctex-xe-mem.ch2 \ - synctexdir/synctex-xe-rec.ch2 synctexdir/synctex-xe-rec.ch3 \ - synctexdir/synctex.mk fmtutil.in Makefile.in.orig \ - configure.in.orig + xetexdir/ChangeLog xetexdir/LICENSE.txt \ + xetexdir/acx_pthread.m4 xetexdir/tests.ac \ + xetexdir/withenable.ac xetexdir/xetex.mk omegaware/ChangeLog \ + $(odvicopy_sources) $(odvitype_sources) $(ofm2opl_sources) \ + $(opl2ofm_sources) $(otangle_sources) $(ovf2ovp_sources) \ + $(ovp2ovf_sources) $(aleph_web_srcs) $(aleph_ch_srcs) \ + lib/texmfmp.c alephdir/ChangeLog alephdir/Makefile \ + alephdir/aleph.defines alephdir/aleph.version \ + alephdir/eomega.ech alephdir/etex.ch alephdir/omega.ch0 \ + alephdir/omega.ch1 alephdir/omega.ch2 alephdir/omxml.ch \ + alephdir/aleph.mk synctexdir/INSTALL synctexdir/Makefile \ + synctexdir/Makefile.in synctexdir/README.txt \ + synctexdir/synctex-common.h synctexdir/synctex-convert.sh \ + synctexdir/synctex.c synctexdir/synctex.defines \ + synctexdir/synctex.h synctexdir/synctex-mem.ch0 \ + synctexdir/synctex-mem.ch1 synctexdir/synctex-mem.ch2 \ + synctexdir/synctex-rec.ch0 synctexdir/synctex-rec.ch1 \ + synctexdir/synctex-rec.ch2 synctexdir/synctex-e-mem.ch0 \ + synctexdir/synctex-e-mem.ch1 synctexdir/synctex-e-rec.ch0 \ + synctexdir/synctex-e-rec.ch1 synctexdir/synctex-pdf-rec.ch2 \ + synctexdir/synctex-xe-mem.ch2 synctexdir/synctex-xe-rec.ch2 \ + synctexdir/synctex-xe-rec.ch3 synctexdir/synctex.mk fmtutil.in \ + Makefile.in.orig configure.in.orig DISTCLEANFILES = $(EXTRA_LIBRARIES) tangle.c tangle.h tangle.p \ tangle-web2c stamp-tangle tangleboot.c tangleboot.h ctangle.c \ cweb.c stamp-ctangle cftest.p $(web_programs:=.c) \ diff --git a/Build/source/texk/web2c/configure b/Build/source/texk/web2c/configure index de54d5bee10..3931574e757 100755 --- a/Build/source/texk/web2c/configure +++ b/Build/source/texk/web2c/configure @@ -23761,13 +23761,11 @@ fi if test "x$with_system_xpdf" = xyes; then if $PKG_CONFIG poppler --atleast-version=0.10; then POPPLER_VERSION='-DPOPPLER_VERSION=\"'`$PKG_CONFIG poppler --modversion`'\"' - XPDF_INCLUDES=`$PKG_CONFIG poppler --cflags` - XPDF_INCLUDES=`echo $XPDF_INCLUDES` - XPDF_INCLUDES="$POPPLER_VERSION $XPDF_INCLUDES $XPDF_INCLUDES/goo" + XPDF_INCLUDES="$POPPLER_VERSION `$PKG_CONFIG poppler --cflags`" XPDF_LIBS=`$PKG_CONFIG poppler --libs` fi else - XPDF_INCLUDES=`echo '-DPDF_PARSER_ONLY -IBLD/libs/xpdf -IBLD/libs/xpdf/goo -IBLD/libs/xpdf/fofi -IBLD/libs/xpdf/xpdf' | sed \ + XPDF_INCLUDES=`echo '-DPDF_PARSER_ONLY -IBLD/libs/xpdf -IBLD/libs/xpdf/goo -IBLD/libs/xpdf/xpdf' | sed \ -e "s,SRC/,$kpse_SRC/,g" \ -e "s,BLD/,$kpse_BLD/,g"` XPDF_LIBS=`echo 'BLD/libs/xpdf/libxpdf.a' | sed \ diff --git a/Build/source/texk/web2c/luatexdir/ChangeLog b/Build/source/texk/web2c/luatexdir/ChangeLog index b117200df37..acf8f253f7f 100644 --- a/Build/source/texk/web2c/luatexdir/ChangeLog +++ b/Build/source/texk/web2c/luatexdir/ChangeLog @@ -1,3 +1,9 @@ +2009-05-05 Peter Breitenlohner <peb@mppmu.mpg.de> + + * image/pdftoepdf.cc, utils/utils.c: adapt for poppler. + + patches from Norbert Preinig <preining@logic.at> + 2009-04-27 Taco Hoekwater <taco@luatex.org> * pdf/pdfpage.c: rename exp10 to exp10_arr to solve a diff --git a/Build/source/texk/web2c/luatexdir/image/pdftoepdf.cc b/Build/source/texk/web2c/luatexdir/image/pdftoepdf.cc index 41d9fe0caec..ac74cde7e63 100644 --- a/Build/source/texk/web2c/luatexdir/image/pdftoepdf.cc +++ b/Build/source/texk/web2c/luatexdir/image/pdftoepdf.cc @@ -24,11 +24,20 @@ #include <stdio.h> #include <string.h> #include <ctype.h> +#ifdef POPPLER_VERSION +#define GString GooString +#include <dirent.h> +#include <poppler-config.h> +#include <goo/GooString.h> +#include <goo/gmem.h> +#include <goo/gfile.h> +#else #include <aconf.h> #include <GString.h> #include <gmem.h> #include <gfile.h> #include <assert.h> +#endif #include "Object.h" #include "Stream.h" #include "Array.h" diff --git a/Build/source/texk/web2c/luatexdir/utils/utils.c b/Build/source/texk/web2c/luatexdir/utils/utils.c index 926fef3d34a..f6afa5687ae 100644 --- a/Build/source/texk/web2c/luatexdir/utils/utils.c +++ b/Build/source/texk/web2c/luatexdir/utils/utils.c @@ -40,7 +40,14 @@ #include "ptexlib.h" #include "png.h" +#ifdef POPPLER_VERSION +#define xpdfString "poppler" +#define xpdfVersion POPPLER_VERSION +#include "poppler-config.h" +#else +#define xpdfString "xpdf" #include "xpdf/config.h" /* just to get the xpdf version */ +#endif static const char __svn_version[] = "$Id: utils.c 2329 2009-04-18 14:25:30Z hhenkel $ " @@ -1125,9 +1132,9 @@ void initversionstring(char **versions) (void) asprintf(versions, "Compiled with libpng %s; using libpng %s\n" "Compiled with zlib %s; using zlib %s\n" - "Compiled with xpdf version %s\n", + "Compiled with %s version %s\n", PNG_LIBPNG_VER_STRING, png_libpng_ver, - ZLIB_VERSION, zlib_version, xpdfVersion); + ZLIB_VERSION, zlib_version, xpdfString, xpdfVersion); } /*************************************************/ diff --git a/Build/source/texk/web2c/pdftexdir/ChangeLog b/Build/source/texk/web2c/pdftexdir/ChangeLog index b60cc4965a3..07175b9784b 100644 --- a/Build/source/texk/web2c/pdftexdir/ChangeLog +++ b/Build/source/texk/web2c/pdftexdir/ChangeLog @@ -1,3 +1,9 @@ +2009-05-05 Peter Breitenlohner <peb@mppmu.mpg.de> + + * pdftoepdf.cc, pdftosrc.cc, utils.c: adapt for poppler. + + patches from Norbert Preinig <preining@logic.at> + 2009-02-18 Peter Breitenlohner <peb@mppmu.mpg.de> * pdftoepdf.cc: Uninclude <config.h>, included later by "epdf.h". diff --git a/Build/source/texk/web2c/pdftexdir/pdftoepdf.cc b/Build/source/texk/web2c/pdftexdir/pdftoepdf.cc index 87684a39dc2..25f42ccbf58 100644 --- a/Build/source/texk/web2c/pdftexdir/pdftoepdf.cc +++ b/Build/source/texk/web2c/pdftexdir/pdftoepdf.cc @@ -18,17 +18,27 @@ with pdfTeX; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include <aconf.h> #include <stdlib.h> #include <math.h> #include <stddef.h> #include <stdio.h> #include <string.h> #include <ctype.h> + +#ifdef POPPLER_VERSION +#include <dirent.h> +#include <poppler-config.h> +#include <goo/GooString.h> +#include <goo/gmem.h> +#include <goo/gfile.h> +#define GString GooString +#else +#include <aconf.h> #include <GString.h> #include <gmem.h> #include <gfile.h> #include <assert.h> +#endif #include "Object.h" #include "Stream.h" #include "Array.h" diff --git a/Build/source/texk/web2c/pdftexdir/pdftosrc.cc b/Build/source/texk/web2c/pdftexdir/pdftosrc.cc index 014c4da7a64..c1334bed373 100644 --- a/Build/source/texk/web2c/pdftexdir/pdftosrc.cc +++ b/Build/source/texk/web2c/pdftexdir/pdftosrc.cc @@ -23,16 +23,228 @@ Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include <stdio.h> #include <string.h> #include <ctype.h> + +#ifdef POPPLER_VERSION +#define GString GooString +#define xpdfVersion POPPLER_VERSION +#include <dirent.h> +#include <goo/GooString.h> +#include <goo/gmem.h> +#include <goo/gfile.h> +#else #include <aconf.h> #include <assert.h> #include <GString.h> #include <gmem.h> #include <gfile.h> +#endif + #include "Object.h" #include "Stream.h" #include "Array.h" #include "Dict.h" +#ifdef POPPLER_VERSION +// here we include a fixed version of XRef.h + +//======================================================================== +// +// XRef.h +// +// Copyright 1996-2003 Glyph & Cog, LLC +// +//======================================================================== + +//======================================================================== +// +// Modified under the Poppler project - http://poppler.freedesktop.org +// +// All changes made under the Poppler project to this file are licensed +// under GPL version 2 or later +// +// Copyright (C) 2005 Brad Hards <bradh@frogmouth.net> +// Copyright (C) 2006, 2008 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2007-2008 Julien Rebetez <julienr@svn.gnome.org> +// Copyright (C) 2007 Carlos Garcia Campos <carlosgc@gnome.org> +// +// To see a description of the changes please see the Changelog file that +// came with your tarball or type make ChangeLog if you are building from git +// +//======================================================================== + +#ifndef XREF_H +#define XREF_H + +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + +#include "goo/gtypes.h" +#include "Object.h" + +class Dict; +class Stream; +class Parser; + +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 +//------------------------------------------------------------------------ + +enum XRefEntryType { + xrefEntryFree, + xrefEntryUncompressed, + xrefEntryCompressed +}; + +struct XRefEntry { + Guint offset; + int gen; + XRefEntryType type; + bool updated; + Object obj; //if this entry was updated, obj will contains the updated object +}; + +class XRef { +public: + + // Constructor, create an empty XRef, used for PDF writing + XRef(); + // Constructor. Read xref table from stream. + XRef(BaseStream *strA); + + // Destructor. + ~XRef(); + + // Is xref table valid? + GBool isOk() { return ok; } + + // Get the error code (if isOk() returns false). + int getErrorCode() { return errCode; } + + // Set the encryption parameters. + void setEncryption(int permFlagsA, GBool ownerPasswordOkA, + Guchar *fileKeyA, int keyLengthA, + int encVersionA, int encRevisionA, + CryptAlgorithm encAlgorithmA); + + // Is the file encrypted? + GBool isEncrypted() { return encrypted; } + + // Check various permissions. + GBool okToPrint(GBool ignoreOwnerPW = gFalse); + GBool okToPrintHighRes(GBool ignoreOwnerPW = gFalse); + GBool okToChange(GBool ignoreOwnerPW = gFalse); + GBool okToCopy(GBool ignoreOwnerPW = gFalse); + GBool okToAddNotes(GBool ignoreOwnerPW = gFalse); + GBool okToFillForm(GBool ignoreOwnerPW = gFalse); + GBool okToAccessibility(GBool ignoreOwnerPW = gFalse); + GBool okToAssemble(GBool ignoreOwnerPW = gFalse); + + // Get catalog object. + Object *getCatalog(Object *obj) { return fetch(rootNum, rootGen, obj); } + + // Fetch an indirect reference. + Object *fetch(int num, int gen, Object *obj); + + // Return the document's Info dictionary (if any). + Object *getDocInfo(Object *obj); + Object *getDocInfoNF(Object *obj); + + // Return the number of objects in the xref table. + int getNumObjects() { return size; } + + // Return the offset of the last xref table. + Guint getLastXRefPos() { return lastXRefPos; } + + // Return the catalog object reference. + int getRootNum() { return rootNum; } + int getRootGen() { return rootGen; } + + // Get end position for a stream in a damaged file. + // Returns false if unknown or file is not damaged. + GBool getStreamEnd(Guint streamStart, Guint *streamEnd); + + // Retuns the entry that belongs to the offset + int getNumEntry(Guint offset) const; + + // Direct access. + int getSize() { return size; } + XRefEntry *getEntry(int i) { return &entries[i]; } + Object *getTrailerDict() { return &trailerDict; } + ObjectStream *getObjStr() { return objStr; } + + // Write access + void setModifiedObject(Object* o, Ref r); + Ref addIndirectObject (Object* o); + void add(int num, int gen, Guint offs, GBool used); + void writeToFile(OutStream* outStr, GBool writeAllEntries); + +private: + + BaseStream *str; // input stream + Guint start; // offset in file (to allow for garbage + // at beginning of file) + XRefEntry *entries; // xref entries + int size; // size of <entries> array + int rootNum, rootGen; // catalog dict + GBool ok; // true if xref table is valid + int errCode; // error code (if <ok> is false) + Object trailerDict; // trailer dictionary + Guint lastXRefPos; // offset of last xref table + Guint *streamEnds; // 'endstream' positions - only used in + // damaged files + int streamEndsLen; // number of valid entries in streamEnds + ObjectStream *objStr; // cached object stream + GBool encrypted; // true if file is encrypted + int encRevision; + int encVersion; // encryption algorithm + CryptAlgorithm encAlgorithm; // encryption algorithm + int keyLength; // length of key, in bytes + int permFlags; // permission bits + Guchar fileKey[16]; // file decryption key + GBool ownerPasswordOk; // true if owner password is correct + + Guint getStartXref(); + GBool readXRef(Guint *pos); + GBool readXRefTable(Parser *parser, Guint *pos); + GBool readXRefStreamSection(Stream *xrefStr, int *w, int first, int n); + GBool readXRefStream(Stream *xrefStr, Guint *pos); + GBool constructXRef(); + Guint strToUnsigned(char *s); +}; + +#endif +#else #include "XRef.h" +#endif #include "Catalog.h" #include "Page.h" #include "GfxFont.h" diff --git a/Build/source/texk/web2c/pdftexdir/utils.c b/Build/source/texk/web2c/pdftexdir/utils.c index 919b9436c69..ecdeb6b8aa9 100644 --- a/Build/source/texk/web2c/pdftexdir/utils.c +++ b/Build/source/texk/web2c/pdftexdir/utils.c @@ -43,7 +43,14 @@ Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include "zlib.h" #include "ptexlib.h" #include "png.h" +#ifdef POPPLER_VERSION +#include "poppler-config.h" +#define xpdfVersion POPPLER_VERSION +#define xpdfString "poppler" +#else #include "xpdf/config.h" /* just to get the xpdf version */ +#define xpdfString "xpdf" +#endif #define check_nprintf(size_get, size_want) \ if ((unsigned)(size_get) >= (unsigned)(size_want)) \ @@ -1272,9 +1279,9 @@ void initversionstring(char **versions) (void) asprintf(versions, "Compiled with libpng %s; using libpng %s\n" "Compiled with zlib %s; using zlib %s\n" - "Compiled with xpdf version %s\n", + "Compiled with %s version %s\n", PNG_LIBPNG_VER_STRING, png_libpng_ver, - ZLIB_VERSION, zlib_version, xpdfVersion); + ZLIB_VERSION, zlib_version, xpdfString, xpdfVersion); } diff --git a/Build/source/texk/web2c/xetexdir/ChangeLog b/Build/source/texk/web2c/xetexdir/ChangeLog new file mode 100644 index 00000000000..df1b2896a5e --- /dev/null +++ b/Build/source/texk/web2c/xetexdir/ChangeLog @@ -0,0 +1,6 @@ +2009-05-05 Peter Breitenlohner <peb@mppmu.mpg.de> + + * XeTeX_ext.c, image/pdfimage.cpp: adapt for poppler. + + patches from Norbert Preinig <preining@logic.at> + diff --git a/Build/source/texk/web2c/xetexdir/XeTeX_ext.c b/Build/source/texk/web2c/xetexdir/XeTeX_ext.c index da3bf2f1e64..44abaa0afd3 100644 --- a/Build/source/texk/web2c/xetexdir/XeTeX_ext.c +++ b/Build/source/texk/web2c/xetexdir/XeTeX_ext.c @@ -33,7 +33,14 @@ authorization from SIL International. */ #ifdef XETEX_OTHER +#ifdef POPPLER_VERSION +#define xpdfVersion POPPLER_VERSION +#define xpdfString "poppler" +#include "poppler-config.h" +#else +#define xpdfString "xpdf" #include "xpdf/config.h" +#endif #include "png.h" #endif @@ -190,7 +197,7 @@ void initversionstring(char **versions) #else "Compiled with fontconfig version %d.%d.%d; using %d.%d.%d\n" "Compiled with libpng version %s; using %s\n" - "Compiled with xpdf version %s\n" + "Compiled with %s version %s\n" #endif ; @@ -201,6 +208,7 @@ void initversionstring(char **versions) #ifdef XETEX_OTHER + strlen(PNG_LIBPNG_VER_STRING) + strlen(png_libpng_ver) + + strlen(xpdfString) + strlen(xpdfVersion) + 6 * 3 /* for fontconfig version #s (won't really need 3 digits per field!) */ #endif @@ -226,7 +234,7 @@ void initversionstring(char **versions) FC_VERSION / 10000, (FC_VERSION % 10000) / 100, FC_VERSION % 100, fc_version / 10000, (fc_version % 10000) / 100, fc_version % 100, PNG_LIBPNG_VER_STRING, png_libpng_ver, - xpdfVersion + xpdfString, xpdfVersion #endif ); } diff --git a/Build/source/texk/web2c/xetexdir/am/xetex.am b/Build/source/texk/web2c/xetexdir/am/xetex.am index 97181592bec..bf8bad87a56 100644 --- a/Build/source/texk/web2c/xetexdir/am/xetex.am +++ b/Build/source/texk/web2c/xetexdir/am/xetex.am @@ -218,6 +218,9 @@ libxetexmm_a_SOURCES = \ ## included by xetexdir/XeTeXFontMgr_Mac.cpp EXTRA_DIST += xetexdir/XeTeXFontMgr_Mac.mm +EXTRA_DIST += \ + xetexdir/ChangeLog + ## Not used ## EXTRA_DIST += \ @@ -227,7 +230,6 @@ EXTRA_DIST += \ ## EXTRA_DIST += \ xetexdir/acx_pthread.m4 \ - xetexdir/am/xetex.mk \ xetexdir/tests.ac \ xetexdir/withenable.ac \ xetexdir/xetex.mk diff --git a/Build/source/texk/web2c/xetexdir/am/xetex.mk b/Build/source/texk/web2c/xetexdir/am/xetex.mk deleted file mode 100644 index 94c9a75727d..00000000000 --- a/Build/source/texk/web2c/xetexdir/am/xetex.mk +++ /dev/null @@ -1,205 +0,0 @@ -# Makefile fragment for XeTeX and web2c. -- Jonathan Kew -- Public domain. -# This fragment contains the parts of the makefile that are most likely to -# differ between releases of XeTeX. - -Makefile: $(srcdir)/xetexdir/xetex.mk - -# this should probably move to common.mk some day, -# but need to check possible effect on other programs -ALL_CXXFLAGS = @CXXFLAGS@ - -# We build xetex unless configure decides to skip it -xetex = @XETEX@ xetex - -### Platform-specific defines and files to be built - -# On Mac OS X: -@XETEX_MACOSX@ xetex_platform_o = XeTeXFontMgr_Mac.o - -# On non-Mac platforms: - -@XETEX_GENERIC@ EXTRADEPS = @LIBXPDFDEP@ @LIBPNGDEP@ - -### is Graphite support included? - -@XETEX_GRAPHITE@ GRAPHITEDIR = ../../libs/graphite-engine -@XETEX_GRAPHITE@ GRAPHITESRCDIR = $(srcdir)/$(GRAPHITEDIR) - -@XETEX_GRAPHITE@ GRAPHITEFLAGS = @GRAPHITECPPFLAGS@ -@XETEX_GRAPHITE@ LDGRAPHITE = @LDGRAPHITE@ -@XETEX_GRAPHITE@ GRAPHITEDEP = @GRAPHITEDEP@ - -### end of platform-specific setup - -LDLIBXPDF=@LDLIBXPDF@ -LIBXPDFCPPFLAGS=@LIBXPDFCPPFLAGS@ -LIBXPDFDEP=@LIBXPDFDEP@ - -LIBXPDFDIR=../../libs/xpdf -LIBXPDFSRCDIR=$(srcdir)/$(LIBXPDFDIR) - -LDLIBPNG=@LDLIBPNG@ -LIBPNGCPPFLAGS=@LIBPNGCPPFLAGS@ -LIBPNGDEP=@LIBPNGDEP@ - -LIBPNGDIR=../../libs/libpng -LIBPNGSRCDIR=$(srcdir)/$(LIBPNGDIR) - -LDFREETYPE2 = @LDFREETYPE2@ -FTFLAGS = @FREETYPE2CPPFLAGS@ -FREETYPE2DEP = @FREETYPE2DEP@ - -FREETYPE2DIR = ../../libs/freetype2 -FREETYPE2SRCDIR = $(srcdir)/$(FREETYPE2DIR) - -TECKITFLAGS = @TECKITCPPFLAGS@ -LDTECKIT = @LDTECKIT@ -TECKITDEP = @TECKITDEP@ - -TECKITDIR=../../libs/teckit -TECKITSRCDIR=$(srcdir)/$(TECKITDIR) - -ICUFLAGS = @ICUCPPFLAGS@ -LDICU = @LDICU@ -ICUDEP = @ICUDEP@ - -ICUDIR=../../libs/icu-xetex -ICUSRCDIR=$(srcdir)/$(ICUDIR) - -ICUCFLAGS = @ICUCPPFLAGS@ -DLE_USE_CMEMORY - -ZLIBCPPFLAGS = @ZLIBCPPFLAGS@ -LDZLIB = @LDZLIB@ - -ZLIBDIR = ../../libs/zlib -ZLIBSRCDIR = $(srcdir)/$(ZLIBDIR) - -FONTCONFIGCPPFLAGS = @FONTCONFIGCPPFLAGS@ -FONTCONFIGLDFLAGS = @FONTCONFIGLDFLAGS@ - -xetexlibs = $(LDICU) $(LDTECKIT) $(LDFREETYPE2) $(LDGRAPHITE) $(LDZLIB) - -# Font-related headers -XeTeXFontHdrs = \ - $(srcdir)/xetexdir/XeTeXFontMgr_Mac.h - - -# The C sources. -xetex_c = xetexini.c xetex0.c xetex1.c xetex2.c -xetex_o = xetexini.o xetex0.o xetex1.o xetex2.o xetexextra.o -xetex_add_o = xetex_pool.o $(xetex_platform_o) - -# these compilations require the path to TECkit headers; -# just setting it in XCFLAGS doesn't seem to work when we're called -# recursively from "make world" etc -xetexini.o: xetexini.c $(srcdir)/xetexdir/XeTeX_ext.h - $(compile) $(TECKITFLAGS) $(FTFLAGS) $(ALL_CFLAGS) $(XETEX_DEFINES) -c $< -o $@ -xetex0.o: xetex0.c $(srcdir)/xetexdir/XeTeX_ext.h - $(compile) $(TECKITFLAGS) $(FTFLAGS) $(ALL_CFLAGS) $(XETEX_DEFINES) -c $< -o $@ -xetex1.o: xetex1.c $(srcdir)/xetexdir/XeTeX_ext.h - $(compile) $(TECKITFLAGS) $(FTFLAGS) $(ALL_CFLAGS) $(XETEX_DEFINES) -c $< -o $@ -xetex2.o: xetex2.c $(srcdir)/xetexdir/XeTeX_ext.h - $(compile) $(TECKITFLAGS) $(FTFLAGS) $(ALL_CFLAGS) $(XETEX_DEFINES) -c $< -o $@ -xetexextra.o: xetexextra.c $(srcdir)/xetexdir/XeTeX_ext.h - $(compile) $(TECKITFLAGS) $(FTFLAGS) $(ALL_CFLAGS) $(XETEX_DEFINES) -c $< -o $@ -xetex_pool.o: xetex_pool.c $(srcdir)/xetexdir/XeTeX_ext.h - $(compile) $(TECKITFLAGS) $(FTFLAGS) $(ALL_CFLAGS) $(XETEX_DEFINES) -c $< -o $@ - -# image support -mfileio.o: $(srcdir)/xetexdir/mfileio.c $(srcdir)/xetexdir/mfileio.h - $(compile) $(ALL_CFLAGS) $(FTFLAGS) -c $< -o $@ - -numbers.o: $(srcdir)/xetexdir/numbers.c $(srcdir)/xetexdir/numbers.h - $(compile) $(ALL_CFLAGS) $(FTFLAGS) -c $< -o $@ - -bmpimage.o: $(srcdir)/xetexdir/bmpimage.c $(srcdir)/xetexdir/bmpimage.h - $(compile) $(ALL_CFLAGS) $(FTFLAGS) -c $< -o $@ - -jpegimage.o: $(srcdir)/xetexdir/jpegimage.c $(srcdir)/xetexdir/jpegimage.h - $(compile) $(ALL_CFLAGS) $(FTFLAGS) -c $< -o $@ - -pngimage.o: $(srcdir)/xetexdir/pngimage.c $(srcdir)/xetexdir/pngimage.h - $(compile) $(ALL_CFLAGS) $(FTFLAGS) $(LIBPNGCPPFLAGS) $(ZLIBCPPFLAGS) -c $< -o $@ - -pdfimage.o: $(srcdir)/xetexdir/pdfimage.cpp $(srcdir)/xetexdir/pdfimage.h - $(CXX) $(ALL_CFLAGS) $(FTFLAGS) $(LIBXPDFCPPFLAGS) -c $< -o $@ - -XeTeX_pic.o: $(srcdir)/xetexdir/XeTeX_pic.c $(srcdir)/xetexdir/XeTeX_ext.h $(XeTeXImageHdrs) - $(compile) $(TECKITFLAGS) $(FTFLAGS) $(ALL_CFLAGS) $(XETEX_DEFINES) -c $< -o $@ - -# Layout library -xetex_ot_layout_o = \ - $(xetex_platform_layout_o) - -XeTeXLayoutInterface.o: $(srcdir)/xetexdir/XeTeXLayoutInterface.cpp $(XeTeXFontHdrs) - $(CXX) $(ICUCFLAGS) $(FTFLAGS) $(GRAPHITEFLAGS) $(FONTCONFIGCPPFLAGS) $(ALL_CXXFLAGS) $(XETEX_DEFINES) $(XETEX_GRAPHITE) -c $< -o $@ -XeTeXOTLayoutEngine.o: $(srcdir)/xetexdir/XeTeXOTLayoutEngine.cpp $(XeTeXFontHdrs) - $(CXX) $(ICUCFLAGS) $(FTFLAGS) $(FONTCONFIGCPPFLAGS) $(ALL_CXXFLAGS) $(XETEX_DEFINES) -c $< -o $@ - -XeTeXFontMgr.o: $(srcdir)/xetexdir/XeTeXFontMgr.cpp $(XeTeXFontHdrs) - $(CXX) $(ICUCFLAGS) $(FTFLAGS) $(FONTCONFIGCPPFLAGS) $(ALL_CXXFLAGS) $(XETEX_DEFINES) -c $< -o $@ -XeTeXFontMgr_FC.o: $(srcdir)/xetexdir/XeTeXFontMgr_FC.cpp $(XeTeXFontHdrs) - $(CXX) $(ICUCFLAGS) $(FTFLAGS) $(FONTCONFIGCPPFLAGS) $(ALL_CXXFLAGS) $(XETEX_DEFINES) -c $< -o $@ - -XeTeXFontMgr_Mac.o: $(srcdir)/xetexdir/XeTeXFontMgr_Mac.mm $(XeTeXFontHdrs) - $(CXX) -ObjC++ $(ICUCFLAGS) $(FTFLAGS) $(ALL_CXXFLAGS) $(XETEX_DEFINES) -c $< -o $@ - -cmaps.o: $(srcdir)/xetexdir/cmaps.cpp - $(CXX) $(ICUCFLAGS) $(ALL_CXXFLAGS) $(XETEX_DEFINES) -c $< -o $@ -FontTableCache.o: $(srcdir)/xetexdir/FontTableCache.cpp - $(CXX) $(ICUCFLAGS) $(ALL_CXXFLAGS) $(XETEX_DEFINES) -c $< -o $@ - -XeTeXFontInst.o: $(srcdir)/xetexdir/XeTeXFontInst.cpp $(XeTeXFontHdrs) - $(CXX) $(ICUCFLAGS) $(FTFLAGS) $(FONTCONFIGCPPFLAGS) $(ALL_CXXFLAGS) $(XETEX_DEFINES) -c $< -o $@ -XeTeXFontInst_Mac.o: $(srcdir)/xetexdir/XeTeXFontInst_Mac.cpp $(XeTeXFontHdrs) - $(CXX) $(ICUCFLAGS) $(ALL_CXXFLAGS) $(XETEX_DEFINES) -c $< -o $@ -XeTeXFontInst_FT2.o: $(srcdir)/xetexdir/XeTeXFontInst_FT2.cpp $(XeTeXFontHdrs) - $(CXX) $(ICUCFLAGS) $(FTFLAGS) $(FONTCONFIGCPPFLAGS) $(ALL_CXXFLAGS) $(XETEX_DEFINES) -c $< -o $@ - -XeTeXOTMath.o: $(srcdir)/xetexdir/XeTeXOTMath.cpp $(XeTeXFontHdrs) - $(CXX) $(ICUCFLAGS) $(FTFLAGS) $(FONTCONFIGCPPFLAGS) $(ALL_CXXFLAGS) $(XETEX_DEFINES) -c $< -o $@ - -XeTeXGrLayout.o: $(srcdir)/xetexdir/XeTeXGrLayout.cpp $(srcdir)/xetexdir/XeTeXGrLayout.h \ - $(XeTeXFontHdrs) $(GRAPHITESRCDIR)/include/graphite/Font.h - $(CXX) $(ICUCFLAGS) $(FTFLAGS) $(FONTCONFIGCPPFLAGS) $(GRAPHITEFLAGS) $(ALL_CXXFLAGS) $(XETEX_DEFINES) -c $< -o $@ - -# special rules for files that need the TECkit headers as well -XeTeX_ext.o: $(srcdir)/xetexdir/XeTeX_ext.c xetexd.h - $(compile) $(ICUCFLAGS) $(FTFLAGS) $(TECKITFLAGS) $(LIBPNGCPPFLAGS) $(LIBXPDFCPPFLAGS) $(ZLIBCPPFLAGS) $(ALL_CFLAGS) $(XETEX_DEFINES) $(XETEX_GRAPHITE) -c $< -o $@ -XeTeX_mac.o: $(srcdir)/xetexdir/XeTeX_mac.c xetexd.h - $(compile) $(ICUCFLAGS) $(TECKITFLAGS) $(ALL_CFLAGS) $(XETEX_DEFINES) -c $< -o $@ - -trans.o: $(srcdir)/xetexdir/trans.c - $(compile) $(ALL_CFLAGS) $(XETEX_DEFINES) -c $< -o $@ - -# sync -synctex-xe.o: synctex-xe.c - $(compile) $(ALL_CFLAGS) $(TECKITFLAGS) $(FTFLAGS) $(XETEX_DEFINES) -c $< -o $@ - -# Making xetex. -xetex: $(xetex_o) $(xetex_add_o) $(xetex_images_o) $(xetex_ot_layout_o) \ - $(GRAPHITEDEP) $(TECKITDEP) $(FREETYPE2DEP) $(ICUDEP) $(EXTRADEPS) - @CXXHACKLINK@ $(xetex_o) $(xetex_add_o) $(xetex_images_o) $(xetex_ot_layout_o) \ - $(FONTCONFIGLDFLAGS) $(socketlibs) $(xetexlibs) $(EXTRALIBS) \ - @CXXHACKLDLIBS@ @CXXLDEXTRA@ @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ - - - -# Dumps -all_xefmts = xetex.fmt $(xefmts) - -dumps: @XETEX@ xefmts -xefmts: $(all_xefmts) - -xefmtdir = $(web2cdir)/xetex -$(xefmtdir):: - $(SHELL) $(top_srcdir)/../mkinstalldirs ${DESTDIR}$(xefmtdir) - -xetex.fmt: xetex - $(dumpenv) $(MAKE) progname=xetex files="xetex.ini unicode-letters.tex plain.tex cmr10.tfm" prereq-check - $(dumpenv) ./xetex --progname=xetex --jobname=xetex --ini \*\\input xetex.ini \\dump </dev/null - -xelatex.fmt: xetex - $(dumpenv) $(MAKE) progname=xelatex files="xelatex.ini unicode-letters.tex latex.ltx" prereq-check - $(dumpenv) ./xetex --progname=xelatex --jobname=xelatex --ini \*\\input xelatex.ini </dev/null - diff --git a/Build/source/texk/web2c/xetexdir/pdfimage.cpp b/Build/source/texk/web2c/xetexdir/pdfimage.cpp index 12eda2c68b0..c76f2372ca1 100644 --- a/Build/source/texk/web2c/xetexdir/pdfimage.cpp +++ b/Build/source/texk/web2c/xetexdir/pdfimage.cpp @@ -11,10 +11,20 @@ #include "pdfimage.h" +#ifdef POPPLER_VERSION +#include <dirent.h> +#include <poppler-config.h> +#include <goo/GooString.h> +#include <goo/gmem.h> +#include <goo/gfile.h> +#define GString GooString +#else +#include "goo/GString.h" +#endif + #include "PDFDoc.h" #include "Catalog.h" #include "Page.h" -#include "GString.h" #include "XeTeX_ext.h" |