]> git.pld-linux.org Git - packages/poppler0.61.git/blob - poppler-cvs.patch
- ver. 0.5.1
[packages/poppler0.61.git] / poppler-cvs.patch
1 diff -Nur poppler.0_5_0/ChangeLog poppler.HEAD/ChangeLog
2 --- poppler.0_5_0/ChangeLog     2006-01-11 17:52:58.000000000 +0100
3 +++ poppler.HEAD/ChangeLog      2006-02-23 23:26:05.000000000 +0100
4 @@ -1,3 +1,240 @@
5 +2006-02-23  Albert Astals Cid  <aacid@kde.org>
6 +
7 +       * utils/Makefile.am: Do not build pdftoppm when SplashOutputDev is
8 +       disabled as that does not work
9 +
10 +2006-02-18  Jeff Muizelaar  <jeff@infidigm.net>
11 +
12 +       * poppler/CairoOutputDev.cc:
13 +       * poppler/CairoOutputDev.h:
14 +       * poppler/GfxState.cc:
15 +       * poppler/GfxState.h: Add support for drawSoftMaskedImage to
16 +       CairoOutputDev. Ugly but works.
17 +
18 +2006-02-16  Jeff Muizelaar  <jeff@infidigm.net>
19 +
20 +       * poppler/CairoOutputDev.cc: Work around cairo bug when scaling
21 +       1x1 bitmaps. Fixes #3387. Also gives a performance improvement.
22 +
23 +2006-02-16  Albert Astals Cid  <aacid@kde.org>
24 +
25 +       * qt4/src/Makefile.am:
26 +       * qt/Makefile.am:
27 +       * poppler/Makefile.am:
28 +       * glib/Makefile.am: Update soname as we are not really compatible
29 +       anymore with previous releases that had soname 0.0.0
30 +
31 +2006-02-13  Albert Astals Cid  <aacid@kde.org>
32 +
33 +       * poppler/ArthurOutputDev.cc: Make it compile after changing code so
34 +       we did not pass files to freetype but buffers
35 +
36 +2006-02-13  Albert Astals Cid  <aacid@kde.org>
37 +
38 +       * poppler/PSOutputDev.cc: Commit setupExternalCIDTrueTypeFont patch
39 +       kpdf got from Takashi Iwai (SuSe) a long time ago
40 +
41 +2006-02-06  Albert Astals Cid  <aacid@kde.org>
42 +
43 +       * configure.ac:
44 +       * goo/FixedPoint.h:
45 +       * splash/Splash.cc:
46 +       * splash/SplashTypes.h: Various fixes from Frank Meerkötter to enable
47 +       fixedpoint arithmetic
48 +
49 +2006-02-06  Albert Astals Cid  <aacid@kde.org>
50 +       
51 +       * poppler/Annot.cc: Fix small leaks
52 +       * poppler/JBIG2Stream.cc: Remove check improving as really did not
53 +       improve anything
54 +       
55 +2006-02-05  Albert Astals Cid  <aacid@kde.org>
56 +
57 +       * poppler/Gfx.cc: Fix small leak
58 +       * poppler/GfxFont.cc: I needed that guard in kpdf to fix a crash and
59 +       it surely does not hurt
60 +       * poppler/JBIG2Stream.cc: Improve check (comes from kpdf)
61 +       * poppler/SplashOutputDev.cc: Unneeded var--
62 +
63 +2006-02-04  Jeff Muizelaar  <jeff@infidigm.net>
64 +
65 +       * poppler/Gfx.cc:
66 +       * poppler/OutputDev.cc:
67 +       * poppler/OutputDev.h: Let output devices know about pdf grouping
68 +       operators.
69 +       Patch by Thorkild Stray.
70 +
71 +2006-02-04  Jeff Muizelaar  <jeff@infidigm.net>
72 +
73 +       * poppler/GlobalParams.cc: Check all fonts returned by fontconfig.
74 +       Discard the ones that are not truetype or type1. Fixes #5758.
75 +       Patch by Ed Catmur.
76 +
77 +2006-02-04  Albert Astals Cid  <aacid@kde.org>
78 +
79 +       * utils/Makefile.am:
80 +       * utils/pdftoppm.cc: Actually create pdftoppm patch by Stefan
81 +       Schweizer
82 +       * utils/pdf2xml.dtd: Added a DTD of the xml pdftohtml creates patch by
83 +       Stefan Schweizer
84 +       * poppler/SplashOutputDev.cc: Remove bug from "do not use an external
85 +       file to pass fonts to Freetype" patch, patch by Stefan Schweizer
86 +               
87 +
88 +2006-02-02  Albert Astals Cid  <aacid@kde.org>
89 +
90 +       * splash/SplashXPathScanner.cc: CVE-2006-0301 fix by Derek (xpdf man
91 +       itslef) got though Dirk Mueller of KDE security team
92 +
93 +2006-02-02  Albert Astals Cid  <aacid@kde.org>
94 +
95 +       * fofi/FoFiTrueType.cc:
96 +       * fofi/FoFiTrueType.h:
97 +       * fofi/FoFiType1C.h:
98 +       * goo/gfile.cc:
99 +       * poppler/GfxFont.cc:
100 +       * poppler/GfxFont.h:
101 +       * poppler/GlobalParams.cc:
102 +       * poppler/GlobalParams.h:
103 +       * poppler/SplashOutputDev.cc:
104 +       * splash/SplashFTFontEngine.cc:
105 +       * splash/SplashFTFontEngine.h:
106 +       * splash/SplashFTFontFile.cc:
107 +       * splash/SplashFTFontFile.h:
108 +       * splash/SplashFontEngine.cc:
109 +       * splash/SplashFontEngine.h:
110 +       * splash/SplashFontFile.cc:
111 +       * splash/SplashFontFile.h:
112 +       * splash/SplashT1FontEngine.cc:
113 +       * splash/SplashT1FontFile.cc:
114 +       * splash/SplashT1FontFile.h: Merge patch to not use external file
115 +         when passing the font to Freetype, original patch by Takashi Iwai
116 +         adapted by me to kpdf rediffed by Stefan Schweizer against poppler
117 +         cvs
118 +
119 +2006-01-31  Jeff Muizelaar  <jeff@infidigm.net>
120 +
121 +       * poppler/GlobalParams.cc (GlobalParams::getDisplayFont):
122 +       Allow ttc fonts to be used.
123 +
124 +2006-01-28  Jeff Muizelaar  <jeff@infidigm.net>
125 +
126 +       * glib/poppler-attachment.h: fix compile by adding <time.h> include.
127 +       Acked-by: Jonathan Blanford <jrb@redhat.com>
128 +
129 +2006-01-26  Kristian Høgsberg  <krh@redhat.com>
130 +
131 +       * poppler/CairoOutputDev.cc: Patch from Christian Krause; handle
132 +       0-width lines (#5545).
133 +
134 +Tue Jan 24 01:19:40 2006  Jonathan Blandford  <jrb@redhat.com>
135 +
136 +       * glib/Makefile.am:
137 +       * glib/poppler-attachment.cc:
138 +       * glib/poppler-attachment.h:
139 +       * glib/poppler-document.cc:
140 +       * glib/poppler-document.h:
141 +       * glib/poppler-page.cc:
142 +       * glib/poppler-private.h:
143 +       * glib/poppler.h:
144 +       * glib/test-poppler-glib.c:
145 +       * glib/reference/tmpl/poppler-enums.sgml:
146 +       * glib/reference/tmpl/poppler-unused.sgml: glib bindings for the
147 +       embedded file support.  It doesn't support mtime and ctime yet,
148 +       but the rest works.
149 +
150 +2006-01-23  Kristian Høgsberg  <krh@redhat.com>
151 +
152 +       * configure.ac:
153 +       * poppler/GlobalParams.cc:
154 +       * poppler/poppler-config.h.in:
155 +       * utils/pdftohtml.cc:
156 +       * utils/pdftops.cc: Respect command line paper size settings (#5641).
157 +       Drop the built-in paper sizes.
158 +
159 +2006-01-23  Kristian Høgsberg  <krh@redhat.com>
160 +
161 +       * glib/test-poppler-glib.c (print_document_info, print_index):
162 +       Move variable declarations to top (#5692).
163 +
164 +       * utils/*.cc: Move config.h #include to top of #include's (#5693).
165 +
166 +       * splash/SplashFTFont.cc: Don't use deprecated freetype include
167 +       files.
168 +
169 +2006-01-21  Jeff Muizelaar  <jeff@infidigm.net>
170 +
171 +       * TODO: Add my todo list.
172 +
173 +2006-01-18  Albert Astals Cid  <aacid@kde.org>
174 +
175 +       * glib/poppler-action.cc:
176 +       * glib/poppler-document.cc:
177 +       * poppler/Annot.cc:
178 +       * poppler/Catalog.cc:
179 +       * poppler/Catalog.h:
180 +       * poppler/Dict.cc:
181 +       * poppler/Dict.h:
182 +       * poppler/FontInfo.cc:
183 +       * poppler/Function.cc:
184 +       * poppler/Gfx.cc:
185 +       * poppler/GfxFont.cc:
186 +       * poppler/GfxState.cc:
187 +       * poppler/Link.cc:
188 +       * poppler/Link.h:
189 +       * poppler/Makefile.am:
190 +       * poppler/Object.h:
191 +       * poppler/Outline.cc:
192 +       * poppler/PDFDoc.cc:
193 +       * poppler/PDFDoc.h:
194 +       * poppler/PSOutputDev.cc:
195 +       * poppler/Page.cc:
196 +       * poppler/PageLabelInfo.cc:
197 +       * poppler/Parser.cc:
198 +       * poppler/SecurityHandler.cc:
199 +       * poppler/Stream.cc:
200 +       * poppler/XRef.cc:
201 +       * qt/poppler-document.cc:
202 +       * qt/poppler-page-transition.cc:
203 +       * qt4/src/Makefile.am:
204 +       * qt4/src/poppler-document.cc:
205 +       * qt4/src/poppler-private.h:
206 +       * qt4/src/poppler-qt4.h:
207 +       * qt4/tests/Makefile.am:
208 +       * utils/HtmlOutputDev.cc:
209 +       * utils/pdffonts.cc:
210 +       * utils/pdfinfo.cc:
211 +       * utils/pdftohtml.cc:
212 +       * utils/pdftotext.cc: Brad patch for embedded document extraction,
213 +       only has Qt4 bindings for now, needs Qt3 and glib work
214 +
215 +2006-01-18  Albert Astals Cid  <aacid@kde.org>
216 +
217 +       * qt/poppler-page-transition.h:
218 +       * qt4/src/Doxyfile: Add some more documentation to PageTransition,
219 +       patch by Stefan Kebekus
220 +
221 +2006-01-18  Albert Astals Cid  <aacid@kde.org>
222 +
223 +       * poppler/CharCodeToUnicode.cc: Fix check for length that was not
224 +       having into account that there could be \n or \r in tokens an that
225 +       those do not have to be took into account. Fixes
226 +       http://bugs.kde.org/show_bug.cgi?id=120310
227 +
228 +2006-01-17  Albert Astals Cid  <aacid@kde.org>
229 +
230 +       * poppler/Lexer.cc:
231 +       * poppler/Lexer.h:
232 +       * poppler/Parser.cc:
233 +       * poppler/Parser.h:
234 +       * poppler/XRef.cc:
235 +       * poppler/XRef.h: When doing the parsing check with XREF we did not
236 +       grow too much. Fixes serialata10a.pdf
237 +
238 +2006-01-12  Jeff Muizelaar  <jeff@infidigm.net>
239 +
240 +       * poppler/GlobalParams.cc: Make buildFcPattern() static.
241 +
242  2006-01-11  Kristian Høgsberg  <krh@redhat.com>
243  
244         * poppler/JBIG2Stream.cc:
245 diff -Nur poppler.0_5_0/configure.ac poppler.HEAD/configure.ac
246 --- poppler.0_5_0/configure.ac  2006-01-06 11:05:58.000000000 +0100
247 +++ poppler.HEAD/configure.ac   2006-02-06 21:49:21.000000000 +0100
248 @@ -17,7 +17,6 @@
249  AC_CHECK_FUNC(gettimeofday, AC_DEFINE(HAVE_GETTIMEOFDAY, 1, [Defines if gettimeofday is available on your system]))
250  
251  dnl Enable these unconditionally.
252 -AC_DEFINE([A4_PAPER], [1], [Default to A4 paper.])
253  AC_DEFINE([OPI_SUPPORT], [1], [Generate OPI comments in PS output.])
254  AC_DEFINE([MULTITHREADED], [1], [Enable multithreading support.])
255  AC_DEFINE([TEXTOUT_WORD_LIST], [1], [Enable word list support.])
256 @@ -32,7 +31,7 @@
257  
258  AC_ARG_ENABLE(fixedpoint,
259  [  --enable-fixedpoint     use fixed point (instead of floating point) arithmetic],
260 -AC_DEFINE(USE_FIXEDPOINT, [], [Use fixed point arithmetic]))
261 +AC_DEFINE(USE_FIXEDPOINT, [1], [Use fixed point arithmetic]))
262  
263  dnl ##### Path to xpdfrc.
264  dnl This ugly kludge to get the sysconfdir path is needed because
265 @@ -243,19 +242,13 @@
266  AM_CONDITIONAL(BUILD_POPPLER_QT4, test x$enable_poppler_qt4 = xyes)
267  
268  if test x$enable_poppler_qt4 = xyes; then
269 -  POPPLER_FIND_QT4TEST(POPPLER_QTTEST)
270 +  POPPLER_FIND_QT4TEST(POPPLER_QTTEST,
271 +                      [enable_poppler_qt4testlib="yes"],
272 +                      [enable_poppler_qt4testlib="no"])
273    AC_SUBST(POPPLER_QTTEST_CXXFLAGS)
274    AC_SUBST(POPPLER_QTTEST_LIBS)
275 -fi
276 -
277 -if test x$have_qt4testlib = xno ; then
278 -    AC_MSG_WARN([QtTestLib libraries not found])
279 -fi
280 -
281 -if test x$have_qt4testlib = xyes; then
282 -    enable_poppler_qt4testlib="yes"
283  else
284 -    enable_poppler_qt4testlib="no"
285 +  enable_poppler_qt4testlib="no"
286  fi
287  
288  AM_CONDITIONAL(BUILD_POPPLER_QT4TESTS, test x$enable_poppler_qt4testlib = xyes)
289 diff -Nur poppler.0_5_0/fofi/FoFiTrueType.cc poppler.HEAD/fofi/FoFiTrueType.cc
290 --- poppler.0_5_0/fofi/FoFiTrueType.cc  2005-09-14 23:20:36.000000000 +0200
291 +++ poppler.HEAD/fofi/FoFiTrueType.cc   2006-02-02 23:50:01.000000000 +0100
292 @@ -241,10 +241,10 @@
293  // FoFiTrueType
294  //------------------------------------------------------------------------
295  
296 -FoFiTrueType *FoFiTrueType::make(char *fileA, int lenA) {
297 +FoFiTrueType *FoFiTrueType::make(char *fileA, int lenA, int faceIndexA) {
298    FoFiTrueType *ff;
299  
300 -  ff = new FoFiTrueType(fileA, lenA, gFalse);
301 +  ff = new FoFiTrueType(fileA, lenA, gFalse, faceIndexA);
302    if (!ff->parsedOk) {
303      delete ff;
304      return NULL;
305 @@ -252,7 +252,7 @@
306    return ff;
307  }
308  
309 -FoFiTrueType *FoFiTrueType::load(char *fileName) {
310 +FoFiTrueType *FoFiTrueType::load(char *fileName, int faceIndexA) {
311    FoFiTrueType *ff;
312    char *fileA;
313    int lenA;
314 @@ -260,7 +260,7 @@
315    if (!(fileA = FoFiBase::readFile(fileName, &lenA))) {
316      return NULL;
317    }
318 -  ff = new FoFiTrueType(fileA, lenA, gTrue);
319 +  ff = new FoFiTrueType(fileA, lenA, gTrue, faceIndexA);
320    if (!ff->parsedOk) {
321      delete ff;
322      return NULL;
323 @@ -268,7 +268,7 @@
324    return ff;
325  }
326  
327 -FoFiTrueType::FoFiTrueType(char *fileA, int lenA, GBool freeFileDataA):
328 +FoFiTrueType::FoFiTrueType(char *fileA, int lenA, GBool freeFileDataA, int faceIndexA):
329    FoFiBase(fileA, lenA, freeFileDataA)
330  {
331    tables = NULL;
332 @@ -277,6 +277,7 @@
333    nCmaps = 0;
334    nameToGID = NULL;
335    parsedOk = gFalse;
336 +  faceIndex = faceIndexA;
337  
338    parse();
339  }
340 @@ -1535,9 +1536,12 @@
341    return checksum;
342  }
343  
344 +#define toTag(a,b,c,d) (((unsigned int)(a)<<24) | ((unsigned int)(b)<<16) | ((unsigned int)(c)<<8) | (d))
345 +
346  void FoFiTrueType::parse() {
347    Guint topTag;
348    int pos, i, j;
349 +  unsigned int head;
350  
351    parsedOk = gTrue;
352  
353 @@ -1556,12 +1560,37 @@
354    }
355  
356    // read the table directory
357 -  nTables = getU16BE(pos + 4, &parsedOk);
358 +  head = getU32BE(pos, &parsedOk);
359 +  if (! parsedOk)
360 +    return;
361 +  if (head == toTag('t','t','c','f')) {
362 +    /* TTC font */
363 +    unsigned int tableDir;
364 +    int dircount;
365 +
366 +    dircount = getU32BE(8, &parsedOk);
367 +    if (!parsedOk)
368 +      return;
369 +    if (! dircount) {
370 +      parsedOk = gFalse;
371 +      return;
372 +    }
373 +
374 +    if (faceIndex >= dircount)
375 +      faceIndex = 0;
376 +    pos = getU32BE(12 + faceIndex * 4, &parsedOk);
377 +    if (! parsedOk)
378 +      return;
379 +  }
380 +
381 +  pos += 4;
382 +  nTables = getU16BE(pos, &parsedOk);
383    if (!parsedOk) {
384      return;
385    }
386 +
387 +  pos += 8;
388    tables = (TrueTypeTable *)gmallocn(nTables, sizeof(TrueTypeTable));
389 -  pos += 12;
390    for (i = 0; i < nTables; ++i) {
391      tables[i].tag = getU32BE(pos, &parsedOk);
392      tables[i].checksum = getU32BE(pos + 4, &parsedOk);
393 diff -Nur poppler.0_5_0/fofi/FoFiTrueType.h poppler.HEAD/fofi/FoFiTrueType.h
394 --- poppler.0_5_0/fofi/FoFiTrueType.h   2005-09-14 23:20:36.000000000 +0200
395 +++ poppler.HEAD/fofi/FoFiTrueType.h    2006-02-02 23:50:01.000000000 +0100
396 @@ -29,11 +29,12 @@
397  public:
398  
399    // Create a FoFiTrueType object from a memory buffer.
400 -  static FoFiTrueType *make(char *fileA, int lenA);
401 +  static FoFiTrueType *make(char *fileA, int lenA, int faceIndexA=0);
402  
403    // Create a FoFiTrueType object from a file on disk.
404 -  static FoFiTrueType *load(char *fileName);
405 +  static FoFiTrueType *load(char *fileName, int faceIndexA=0);
406  
407 +  FoFiTrueType(char *fileA, int lenA, GBool freeFileDataA, int faceIndexA=0);
408    virtual ~FoFiTrueType();
409  
410    // Return the number of cmaps defined by this font.
411 @@ -104,7 +105,6 @@
412  
413  private:
414  
415 -  FoFiTrueType(char *fileA, int lenA, GBool freeFileDataA);
416    void cvtEncoding(char **encoding,
417                    FoFiOutputFunc outputFunc,
418                    void *outputStream);
419 @@ -133,6 +133,7 @@
420    GooHash *nameToGID;
421  
422    GBool parsedOk;
423 +  int faceIndex;
424  };
425  
426  #endif
427 diff -Nur poppler.0_5_0/fofi/FoFiType1C.h poppler.HEAD/fofi/FoFiType1C.h
428 --- poppler.0_5_0/fofi/FoFiType1C.h     2005-09-14 23:20:36.000000000 +0200
429 +++ poppler.HEAD/fofi/FoFiType1C.h      2006-02-02 23:50:01.000000000 +0100
430 @@ -138,6 +138,7 @@
431    // Create a FoFiType1C object from a file on disk.
432    static FoFiType1C *load(char *fileName);
433  
434 +  FoFiType1C(char *fileA, int lenA, GBool freeFileDataA);
435    virtual ~FoFiType1C();
436  
437    // Return the font name.
438 @@ -173,7 +174,6 @@
439  
440  private:
441  
442 -  FoFiType1C(char *fileA, int lenA, GBool freeFileDataA);
443    void eexecCvtGlyph(Type1CEexecBuf *eb, char *glyphName,
444                      int offset, int nBytes,
445                      Type1CIndex *subrIdx,
446 diff -Nur poppler.0_5_0/glib/Makefile.am poppler.HEAD/glib/Makefile.am
447 --- poppler.0_5_0/glib/Makefile.am      2006-01-02 01:06:46.000000000 +0100
448 +++ poppler.HEAD/glib/Makefile.am       2006-02-16 20:28:54.000000000 +0100
449 @@ -58,6 +58,7 @@
450         poppler-action.h                        \
451         poppler-document.h                      \
452         poppler-page.h                          \
453 +       poppler-attachment.h                    \
454         poppler.h
455  
456  poppler_glib_includedir = $(includedir)/poppler/glib
457 @@ -72,6 +73,7 @@
458         poppler-action.cc                       \
459         poppler-document.cc                     \
460         poppler-page.cc                         \
461 +       poppler-attachment.cc                   \
462         poppler.cc                              \
463         poppler-private.h
464  
465 @@ -81,6 +83,8 @@
466         $(FREETYPE_LIBS)                        \
467         $(cairo_libs)
468  
469 +libpoppler_glib_la_LDFLAGS = -version-info 1:0:0
470 +
471  noinst_PROGRAMS = test-poppler-glib
472  
473  test_poppler_glib_SOURCES =                    \
474 diff -Nur poppler.0_5_0/glib/poppler-action.cc poppler.HEAD/glib/poppler-action.cc
475 --- poppler.0_5_0/glib/poppler-action.cc        2005-12-31 03:10:33.000000000 +0100
476 +++ poppler.HEAD/glib/poppler-action.cc 2006-01-18 23:32:13.000000000 +0100
477 @@ -182,7 +182,7 @@
478                  LinkGoTo        *link)
479  {
480         LinkDest *link_dest;
481 -       GooString *named_dest;
482 +       UGooString *named_dest;
483  
484         /* Return if it isn't OK */
485         if (! link->isOk ()) {
486 diff -Nur poppler.0_5_0/glib/poppler-attachment.cc poppler.HEAD/glib/poppler-attachment.cc
487 --- poppler.0_5_0/glib/poppler-attachment.cc    1970-01-01 01:00:00.000000000 +0100
488 +++ poppler.HEAD/glib/poppler-attachment.cc     2006-01-24 07:21:39.000000000 +0100
489 @@ -0,0 +1,223 @@
490 +/* poppler-attachment.cc: glib wrapper for poppler
491 + * Copyright (C) 2006, Red Hat, Inc.
492 + *
493 + * This program is free software; you can redistribute it and/or modify
494 + * it under the terms of the GNU General Public License as published by
495 + * the Free Software Foundation; either version 2, or (at your option)
496 + * any later version.
497 + *
498 + * This program is distributed in the hope that it will be useful,
499 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
500 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
501 + * GNU General Public License for more details.
502 + *
503 + * You should have received a copy of the GNU General Public License
504 + * along with this program; if not, write to the Free Software
505 + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
506 + */
507 +
508 +#include "config.h"
509 +#include <errno.h>
510 +#include <glib/gstdio.h>
511 +
512 +#include "poppler.h"
513 +#include "poppler-private.h"
514 +#include "poppler-attachment.h"
515 +
516 +/* FIXME: We need to add gettext support sometime */
517 +#define _(x) (x)
518 +
519 +typedef struct _PopplerAttachmentPrivate PopplerAttachmentPrivate;
520 +struct _PopplerAttachmentPrivate
521 +{
522 +  Object obj_stream;
523 +};
524 +
525 +#define POPPLER_ATTACHMENT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), POPPLER_TYPE_ATTACHMENT, PopplerAttachmentPrivate))
526 +
527 +static void poppler_attachment_finalize (GObject *obj);
528 +
529 +G_DEFINE_TYPE (PopplerAttachment, poppler_attachment, G_TYPE_OBJECT);
530 +
531 +static void
532 +poppler_attachment_init (PopplerAttachment *attachment)
533 +{
534 +
535 +}
536 +
537 +static void
538 +poppler_attachment_class_init (PopplerAttachmentClass *klass)
539 +{
540 +  G_OBJECT_CLASS (klass)->finalize = poppler_attachment_finalize;
541 +  g_type_class_add_private (klass, sizeof (PopplerAttachmentPrivate));
542 +}
543 +
544 +static void
545 +poppler_attachment_finalize (GObject *obj)
546 +{
547 +  PopplerAttachment *attachment;
548 +
549 +  attachment = (PopplerAttachment *) obj;
550 +  POPPLER_ATTACHMENT_GET_PRIVATE (attachment)->obj_stream.free();
551 +}
552 +
553 +/* Public functions */
554 +
555 +PopplerAttachment *
556 +_poppler_attachment_new (PopplerDocument *document,
557 +                        EmbFile         *emb_file)
558 +{
559 +  PopplerAttachment *attachment;
560 +
561 +  g_assert (document != NULL);
562 +  g_assert (emb_file != NULL);
563 +
564 +  attachment = (PopplerAttachment *) g_object_new (POPPLER_TYPE_ATTACHMENT, NULL);
565 +  
566 +  if (emb_file->name ())
567 +    attachment->name = g_strdup (emb_file->name ()->getCString ());
568 +  if (emb_file->description ())
569 +    attachment->description = g_strdup (emb_file->description ()->getCString ());
570 +
571 +  emb_file->streamObject().copy(&POPPLER_ATTACHMENT_GET_PRIVATE (attachment)->obj_stream);
572 +
573 +  return attachment;
574 +}
575 +
576 +static gboolean
577 +save_helper (const gchar  *buf,
578 +            gsize         count,
579 +            gpointer      data,
580 +            GError      **error)
581 +{
582 +  FILE *f = (FILE *) data;
583 +  gsize n;
584 +
585 +  n = fwrite (buf, 1, count, f);
586 +  if (n != count)
587 +    {
588 +      g_set_error (error,
589 +                  G_FILE_ERROR,
590 +                  g_file_error_from_errno (errno),
591 +                  _("Error writing to image file: %s"),
592 +                  g_strerror (errno));
593 +      return FALSE;
594 +    }
595 +
596 +  return TRUE;
597 +}
598 +
599 +/**
600 + * poppler_attachment_save:
601 + * @attachment: A #PopplerAttachment.
602 + * @filename: name of file to save
603 + * @error: return location for error, or %NULL.
604 + * 
605 + * Saves @attachment to a file indicated by @filename.  If @error is set, %FALSE
606 + * will be returned. Possible errors include those in the #G_FILE_ERROR domain
607 + * and whatever the save function generates.
608 + * 
609 + * Return value: %TRUE, if the file successfully saved
610 + **/
611 +gboolean
612 +poppler_attachment_save (PopplerAttachment  *attachment,
613 +                        const char         *filename,
614 +                        GError            **error)
615 +{
616 +  gboolean result;
617 +  FILE *f;
618 +  
619 +  g_return_val_if_fail (POPPLER_IS_ATTACHMENT (attachment), FALSE);
620 +
621 +  f = g_fopen (filename, "wb");
622 +
623 +  if (f == NULL)
624 +    {
625 +      gchar *display_name = g_filename_display_name (filename);
626 +      g_set_error (error,
627 +                  G_FILE_ERROR,
628 +                  g_file_error_from_errno (errno),
629 +                  _("Failed to open '%s' for writing: %s"),
630 +                  display_name,
631 +                  g_strerror (errno));
632 +      g_free (display_name);
633 +      return FALSE;
634 +    }
635 +
636 +  result = poppler_attachment_save_to_callback (attachment, save_helper, f, error);
637 +
638 +  if (fclose (f) < 0)
639 +    {
640 +      gchar *display_name = g_filename_display_name (filename);
641 +      g_set_error (error,
642 +                  G_FILE_ERROR,
643 +                  g_file_error_from_errno (errno),
644 +                  _("Failed to close '%s', all data may not have been saved: %s"),
645 +                  display_name,
646 +                  g_strerror (errno));
647 +      g_free (display_name);
648 +      return FALSE;
649 +    }
650 +
651 +  return TRUE;
652 +}
653 +
654 +#define BUF_SIZE 1024
655 +
656 +/**
657 + * poppler_attachment_save_to_callback:
658 + * @attachment: A #GdkPixbuf.
659 + * @save_func: a function that is called to save each block of data that the save routine generates.
660 + * @user_data: user data to pass to the save function.
661 + * @error: return location for error, or %NULL.
662 + * 
663 + * Saves @attachment by feeding the produced data to @save_func. Can be used
664 + * when you want to store the attachment to something other than a file, such as
665 + * an in-memory buffer or a socket. If @error is set, %FALSE will be
666 + * returned. Possible errors include those in the #G_FILE_ERROR domain and
667 + * whatever the save function generates.
668 + * 
669 + * Return value: %TRUE, if the save successfully completed
670 + **/
671 +gboolean
672 +poppler_attachment_save_to_callback (PopplerAttachment          *attachment,
673 +                                    PopplerAttachmentSaveFunc   save_func,
674 +                                    gpointer                    user_data,
675 +                                    GError                    **error)
676 +{
677 +  Stream *stream;
678 +  gchar buf[BUF_SIZE]; 
679 +  int i;
680 +  gboolean eof_reached = FALSE;
681 +
682 +  g_return_val_if_fail (POPPLER_IS_ATTACHMENT (attachment), FALSE);
683 +
684 +  stream = POPPLER_ATTACHMENT_GET_PRIVATE (attachment)->obj_stream.getStream();
685 +  stream->reset();
686 +
687 +  do
688 +    {
689 +      int data;
690 +
691 +      for (i = 0; i < BUF_SIZE; i++)
692 +       {
693 +         data = stream->getChar ();
694 +         if (data == EOF)
695 +           {
696 +             eof_reached = TRUE;
697 +             break;
698 +           }
699 +         buf[i] = data;
700 +       }
701 +
702 +      if (i > 0)
703 +       {
704 +         if (! (save_func) (buf, i, user_data, error))
705 +           return FALSE;
706 +       }
707 +    }
708 +  while (! eof_reached);
709 +
710 +
711 +  return TRUE;
712 +}
713 diff -Nur poppler.0_5_0/glib/poppler-attachment.h poppler.HEAD/glib/poppler-attachment.h
714 --- poppler.0_5_0/glib/poppler-attachment.h     1970-01-01 01:00:00.000000000 +0100
715 +++ poppler.HEAD/glib/poppler-attachment.h      2006-01-29 06:16:31.000000000 +0100
716 @@ -0,0 +1,68 @@
717 +/* poppler-attachment.h: glib interface to poppler
718 + * Copyright (C) 2004, Red Hat, Inc.
719 + *
720 + * This program is free software; you can redistribute it and/or modify
721 + * it under the terms of the GNU General Public License as published by
722 + * the Free Software Foundation; either version 2, or (at your option)
723 + * any later version.
724 + *
725 + * This program is distributed in the hope that it will be useful,
726 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
727 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
728 + * GNU General Public License for more details.
729 + *
730 + * You should have received a copy of the GNU General Public License
731 + * along with this program; if not, write to the Free Software
732 + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
733 + */
734 +
735 +#ifndef __POPPLER_ATTACHMENT_H__
736 +#define __POPPLER_ATTACHMENT_H__
737 +
738 +#include <time.h>
739 +#include <glib-object.h>
740 +
741 +#include "poppler.h"
742 +
743 +G_BEGIN_DECLS
744 +
745 +
746 +#define POPPLER_TYPE_ATTACHMENT             (poppler_attachment_get_type ())
747 +#define POPPLER_ATTACHMENT(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), POPPLER_TYPE_ATTACHMENT, PopplerAttachment))
748 +#define POPPLER_IS_ATTACHMENT(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), POPPLER_TYPE_ATTACHMENT))
749 +
750 +
751 +typedef gboolean (*PopplerAttachmentSaveFunc) (const gchar  *buf,
752 +                                              gsize         count,
753 +                                              gpointer      data,
754 +                                              GError      **error);
755 +
756 +typedef struct _PopplerAttachment
757 +{
758 +  GObject parent;
759 +
760 +  const char *name;
761 +  const char *description;
762 +  time_t mtime;
763 +  time_t ctime;
764 +} PopplerAttachment;
765 +
766 +typedef struct _PopplerAttachmentClass
767 +{
768 +  GObjectClass parent_class;
769 +} PopplerAttachmentClass;
770 +
771 +
772 +GType     poppler_attachment_get_type         (void) G_GNUC_CONST;
773 +gboolean  poppler_attachment_save             (PopplerAttachment          *attachment,
774 +                                              const char                 *filename,
775 +                                              GError                    **error);
776 +gboolean  poppler_attachment_save_to_callback (PopplerAttachment          *attachment,
777 +                                              PopplerAttachmentSaveFunc   save_func,
778 +                                              gpointer                    user_data,
779 +                                              GError                    **error);
780 +
781 +
782 +G_END_DECLS
783 +
784 +#endif /* __POPPLER_ATTACHMENT_H__ */
785 diff -Nur poppler.0_5_0/glib/poppler-document.cc poppler.HEAD/glib/poppler-document.cc
786 --- poppler.0_5_0/glib/poppler-document.cc      2005-12-31 03:10:33.000000000 +0100
787 +++ poppler.HEAD/glib/poppler-document.cc       2006-01-24 07:21:39.000000000 +0100
788 @@ -28,9 +28,11 @@
789  #include <Stream.h>
790  #include <FontInfo.h>
791  #include <PDFDocEncoding.h>
792 +#include <UGooString.h>
793  
794  #include "poppler.h"
795  #include "poppler-private.h"
796 +#include "poppler-attachment.h"
797  #include "poppler-enums.h"
798  
799  enum {
800 @@ -251,6 +253,68 @@
801    return poppler_document_get_page (document, index);
802  }
803  
804 +/**
805 + * poppler_document_has_attachments:
806 + * @document: A #PopplerDocument
807 + * 
808 + * Returns %TRUE of @document has any attachments.
809 + * 
810 + * Return value: %TRUE, if @document has attachments.
811 + **/
812 +gboolean
813 +poppler_document_has_attachments (PopplerDocument *document)
814 +{
815 +  Catalog *catalog;
816 +  int n_files = 0;
817 +
818 +  g_return_val_if_fail (POPPLER_IS_DOCUMENT (document), FALSE);
819 +
820 +  catalog = document->doc->getCatalog ();
821 +  if (catalog && catalog->isOk ())
822 +    {
823 +      n_files = catalog->numEmbeddedFiles ();
824 +    }
825 +
826 +  return (n_files != 0);
827 +}
828 +
829 +/**
830 + * poppler_document_get_attachments:
831 + * @document: A #PopplerDocument
832 + * 
833 + * Returns a #GList containing #PopplerAttachment<!-- -->s.  These attachments
834 + * are unowned, and must be unreffed, and the list must be freed with
835 + * g_list_free().
836 + * 
837 + * Return value: a list of available attachments.
838 + **/
839 +GList *
840 +poppler_document_get_attachments (PopplerDocument *document)
841 +{
842 +  Catalog *catalog;
843 +  int n_files, i;
844 +  GList *retval = NULL;
845 +
846 +  g_return_val_if_fail (POPPLER_IS_DOCUMENT (document), NULL);
847 +
848 +  catalog = document->doc->getCatalog ();
849 +  if (catalog == NULL || ! catalog->isOk ())
850 +    return NULL;
851 +
852 +  n_files = catalog->numEmbeddedFiles ();
853 +  for (i = 0; i < n_files; i++)
854 +    {
855 +      PopplerAttachment *attachment;
856 +      EmbFile *emb_file;
857 +
858 +      emb_file = catalog->embeddedFile (i);
859 +      attachment = _poppler_attachment_new (document, emb_file);
860 +
861 +      retval = g_list_prepend (retval, attachment);
862 +    }
863 +  return g_list_reverse (retval);
864 +}
865 +
866  static gboolean
867  has_unicode_marker (GooString *string)
868  {
869 diff -Nur poppler.0_5_0/glib/poppler-document.h poppler.HEAD/glib/poppler-document.h
870 --- poppler.0_5_0/glib/poppler-document.h       2005-12-31 03:10:33.000000000 +0100
871 +++ poppler.HEAD/glib/poppler-document.h        2006-01-24 07:21:39.000000000 +0100
872 @@ -100,6 +100,10 @@
873                                                      int               index);
874  PopplerPage     *poppler_document_get_page_by_label (PopplerDocument  *document,
875                                                      const char       *label);
876 +/* Attachments */
877 +gboolean         poppler_document_has_attachments   (PopplerDocument  *document);
878 +GList           *poppler_document_get_attachments   (PopplerDocument  *document);
879 +
880  
881  
882  /* Interface for getting the Index of a poppler_document */
883 @@ -142,6 +146,8 @@
884                                                 gboolean         duplex);
885  void           poppler_ps_file_free           (PopplerPSFile   *ps_file);
886  
887 +
888 +
889  G_END_DECLS
890  
891  #endif /* __POPPLER_DOCUMENT_H__ */
892 diff -Nur poppler.0_5_0/glib/poppler.h poppler.HEAD/glib/poppler.h
893 --- poppler.0_5_0/glib/poppler.h        2005-06-20 19:58:38.000000000 +0200
894 +++ poppler.HEAD/glib/poppler.h 2006-01-24 07:21:39.000000000 +0100
895 @@ -69,5 +69,6 @@
896  #include "poppler-page.h"
897  #include "poppler-action.h"
898  #include "poppler-enums.h"
899 +#include "poppler-attachment.h"
900  
901  #endif /* __POPPLER_GLIB_H__ */
902 diff -Nur poppler.0_5_0/glib/poppler-page.cc poppler.HEAD/glib/poppler-page.cc
903 --- poppler.0_5_0/glib/poppler-page.cc  2005-12-31 03:10:33.000000000 +0100
904 +++ poppler.HEAD/glib/poppler-page.cc   2006-01-24 07:21:39.000000000 +0100
905 @@ -1,4 +1,4 @@
906 -/* poppler.h: glib wrapper for poppler
907 +/* poppler-page.cc: glib wrapper for poppler
908   * Copyright (C) 2005, Red Hat, Inc.
909   *
910   * This program is free software; you can redistribute it and/or modify
911 diff -Nur poppler.0_5_0/glib/poppler-private.h poppler.HEAD/glib/poppler-private.h
912 --- poppler.0_5_0/glib/poppler-private.h        2005-08-22 20:20:12.000000000 +0200
913 +++ poppler.HEAD/glib/poppler-private.h 2006-01-24 07:21:39.000000000 +0100
914 @@ -8,6 +8,9 @@
915  #include <Gfx.h>
916  #include <FontInfo.h>
917  #include <TextOutputDev.h>
918 +#include <Catalog.h>
919 +
920 +#include "poppler-attachment.h"
921  
922  #if defined (HAVE_CAIRO)
923  #include <CairoOutputDev.h>
924 @@ -62,5 +65,6 @@
925                                     LinkAction      *link,
926                                     const gchar     *title);
927  
928 -
929 +PopplerAttachment *_poppler_attachment_new (PopplerDocument *document,
930 +                                           EmbFile         *file);
931  #endif
932 diff -Nur poppler.0_5_0/glib/reference/tmpl/poppler-enums.sgml poppler.HEAD/glib/reference/tmpl/poppler-enums.sgml
933 --- poppler.0_5_0/glib/reference/tmpl/poppler-enums.sgml        2006-01-06 11:05:58.000000000 +0100
934 +++ poppler.HEAD/glib/reference/tmpl/poppler-enums.sgml 2006-01-24 07:21:39.000000000 +0100
935 @@ -17,3 +17,153 @@
936  <!-- ##### SECTION Stability_Level ##### -->
937  
938  
939 +<!-- ##### MACRO POPPLER_TYPE_ACTION_TYPE ##### -->
940 +<para>
941 +
942 +</para>
943 +
944 +
945 +
946 +<!-- ##### FUNCTION poppler_action_type_get_type ##### -->
947 +<para>
948 +
949 +</para>
950 +
951 +@Returns: 
952 +
953 +
954 +<!-- ##### MACRO POPPLER_TYPE_DEST_TYPE ##### -->
955 +<para>
956 +
957 +</para>
958 +
959 +
960 +
961 +<!-- ##### FUNCTION poppler_dest_type_get_type ##### -->
962 +<para>
963 +
964 +</para>
965 +
966 +@Returns: 
967 +
968 +
969 +<!-- ##### MACRO POPPLER_TYPE_PAGE_LAYOUT ##### -->
970 +<para>
971 +
972 +</para>
973 +
974 +
975 +
976 +<!-- ##### FUNCTION poppler_page_layout_get_type ##### -->
977 +<para>
978 +
979 +</para>
980 +
981 +@Returns: 
982 +
983 +
984 +<!-- ##### MACRO POPPLER_TYPE_PAGE_MODE ##### -->
985 +<para>
986 +
987 +</para>
988 +
989 +
990 +
991 +<!-- ##### FUNCTION poppler_page_mode_get_type ##### -->
992 +<para>
993 +
994 +</para>
995 +
996 +@Returns: 
997 +
998 +
999 +<!-- ##### MACRO POPPLER_TYPE_FONT_TYPE ##### -->
1000 +<para>
1001 +
1002 +</para>
1003 +
1004 +
1005 +
1006 +<!-- ##### FUNCTION poppler_font_type_get_type ##### -->
1007 +<para>
1008 +
1009 +</para>
1010 +
1011 +@Returns: 
1012 +
1013 +
1014 +<!-- ##### MACRO POPPLER_TYPE_VIEWER_PREFERENCES ##### -->
1015 +<para>
1016 +
1017 +</para>
1018 +
1019 +
1020 +
1021 +<!-- ##### FUNCTION poppler_viewer_preferences_get_type ##### -->
1022 +<para>
1023 +
1024 +</para>
1025 +
1026 +@Returns: 
1027 +
1028 +
1029 +<!-- ##### MACRO POPPLER_TYPE_PERMISSIONS ##### -->
1030 +<para>
1031 +
1032 +</para>
1033 +
1034 +
1035 +
1036 +<!-- ##### FUNCTION poppler_permissions_get_type ##### -->
1037 +<para>
1038 +
1039 +</para>
1040 +
1041 +@Returns: 
1042 +
1043 +
1044 +<!-- ##### MACRO POPPLER_TYPE_ERROR ##### -->
1045 +<para>
1046 +
1047 +</para>
1048 +
1049 +
1050 +
1051 +<!-- ##### FUNCTION poppler_error_get_type ##### -->
1052 +<para>
1053 +
1054 +</para>
1055 +
1056 +@Returns: 
1057 +
1058 +
1059 +<!-- ##### MACRO POPPLER_TYPE_ORIENTATION ##### -->
1060 +<para>
1061 +
1062 +</para>
1063 +
1064 +
1065 +
1066 +<!-- ##### FUNCTION poppler_orientation_get_type ##### -->
1067 +<para>
1068 +
1069 +</para>
1070 +
1071 +@Returns: 
1072 +
1073 +
1074 +<!-- ##### MACRO POPPLER_TYPE_BACKEND ##### -->
1075 +<para>
1076 +
1077 +</para>
1078 +
1079 +
1080 +
1081 +<!-- ##### FUNCTION poppler_backend_get_type ##### -->
1082 +<para>
1083 +
1084 +</para>
1085 +
1086 +@Returns: 
1087 +
1088 +
1089 diff -Nur poppler.0_5_0/glib/reference/tmpl/poppler-unused.sgml poppler.HEAD/glib/reference/tmpl/poppler-unused.sgml
1090 --- poppler.0_5_0/glib/reference/tmpl/poppler-unused.sgml       2006-01-06 11:05:58.000000000 +0100
1091 +++ poppler.HEAD/glib/reference/tmpl/poppler-unused.sgml        2006-01-24 07:21:39.000000000 +0100
1092 @@ -1,130 +0,0 @@
1093 -<!-- ##### MACRO POPPLER_TYPE_ACTION_TYPE ##### -->
1094 -<para>
1095 -
1096 -</para>
1097 -
1098 -
1099 -<!-- ##### MACRO POPPLER_TYPE_BACKEND ##### -->
1100 -<para>
1101 -
1102 -</para>
1103 -
1104 -
1105 -<!-- ##### MACRO POPPLER_TYPE_DEST_TYPE ##### -->
1106 -<para>
1107 -
1108 -</para>
1109 -
1110 -
1111 -<!-- ##### MACRO POPPLER_TYPE_ERROR ##### -->
1112 -<para>
1113 -
1114 -</para>
1115 -
1116 -
1117 -<!-- ##### MACRO POPPLER_TYPE_FONT_TYPE ##### -->
1118 -<para>
1119 -
1120 -</para>
1121 -
1122 -
1123 -<!-- ##### MACRO POPPLER_TYPE_ORIENTATION ##### -->
1124 -<para>
1125 -
1126 -</para>
1127 -
1128 -
1129 -<!-- ##### MACRO POPPLER_TYPE_PAGE_LAYOUT ##### -->
1130 -<para>
1131 -
1132 -</para>
1133 -
1134 -
1135 -<!-- ##### MACRO POPPLER_TYPE_PAGE_MODE ##### -->
1136 -<para>
1137 -
1138 -</para>
1139 -
1140 -
1141 -<!-- ##### MACRO POPPLER_TYPE_PERMISSIONS ##### -->
1142 -<para>
1143 -
1144 -</para>
1145 -
1146 -
1147 -<!-- ##### MACRO POPPLER_TYPE_VIEWER_PREFERENCES ##### -->
1148 -<para>
1149 -
1150 -</para>
1151 -
1152 -
1153 -<!-- ##### FUNCTION poppler_action_type_get_type ##### -->
1154 -<para>
1155 -
1156 -</para>
1157 -
1158 -@Returns: 
1159 -
1160 -<!-- ##### FUNCTION poppler_backend_get_type ##### -->
1161 -<para>
1162 -
1163 -</para>
1164 -
1165 -@Returns: 
1166 -
1167 -<!-- ##### FUNCTION poppler_dest_type_get_type ##### -->
1168 -<para>
1169 -
1170 -</para>
1171 -
1172 -@Returns: 
1173 -
1174 -<!-- ##### FUNCTION poppler_error_get_type ##### -->
1175 -<para>
1176 -
1177 -</para>
1178 -
1179 -@Returns: 
1180 -
1181 -<!-- ##### FUNCTION poppler_font_type_get_type ##### -->
1182 -<para>
1183 -
1184 -</para>
1185 -
1186 -@Returns: 
1187 -
1188 -<!-- ##### FUNCTION poppler_orientation_get_type ##### -->
1189 -<para>
1190 -
1191 -</para>
1192 -
1193 -@Returns: 
1194 -
1195 -<!-- ##### FUNCTION poppler_page_layout_get_type ##### -->
1196 -<para>
1197 -
1198 -</para>
1199 -
1200 -@Returns: 
1201 -
1202 -<!-- ##### FUNCTION poppler_page_mode_get_type ##### -->
1203 -<para>
1204 -
1205 -</para>
1206 -
1207 -@Returns: 
1208 -
1209 -<!-- ##### FUNCTION poppler_permissions_get_type ##### -->
1210 -<para>
1211 -
1212 -</para>
1213 -
1214 -@Returns: 
1215 -
1216 -<!-- ##### FUNCTION poppler_viewer_preferences_get_type ##### -->
1217 -<para>
1218 -
1219 -</para>
1220 -
1221 -@Returns: 
1222 -
1223 diff -Nur poppler.0_5_0/glib/test-poppler-glib.c poppler.HEAD/glib/test-poppler-glib.c
1224 --- poppler.0_5_0/glib/test-poppler-glib.c      2005-12-31 03:10:33.000000000 +0100
1225 +++ poppler.HEAD/glib/test-poppler-glib.c       2006-01-24 07:21:39.000000000 +0100
1226 @@ -13,11 +13,12 @@
1227    do
1228      {
1229        PopplerAction *action;
1230 +      PopplerIndexIter *child;
1231  
1232        action = poppler_index_iter_get_action (iter);
1233        g_print ("Action: %d\n", action->type);
1234        poppler_action_free (action);
1235 -      PopplerIndexIter *child = poppler_index_iter_get_child (iter);
1236 +      child = poppler_index_iter_get_child (iter);
1237        if (child)
1238         print_index (child);
1239        poppler_index_iter_free (child);
1240 @@ -35,6 +36,7 @@
1241    PopplerViewerPreferences view_prefs;
1242    PopplerFontInfo *font_info;
1243    PopplerFontsIter *fonts_iter;
1244 +  PopplerIndexIter *index_iter;
1245    GEnumValue *enum_value;
1246  
1247    g_object_get (document,
1248 @@ -85,7 +87,6 @@
1249    }
1250    poppler_font_info_free (font_info);
1251  
1252 -  PopplerIndexIter *index_iter;
1253    index_iter = poppler_index_iter_new (document);
1254    if (index_iter)
1255      {
1256 @@ -197,7 +198,31 @@
1257  
1258        printf ("  (%f,%f)-(%f,%f)\n", rect->x1, rect->y1, rect->x2, rect->y2);
1259      }
1260 -    
1261 +
1262 +  if (poppler_document_has_attachments (document))
1263 +    {
1264 +      int i = 0;
1265 +
1266 +      g_print ("Attachments found:\n\n");
1267 +
1268 +      list = poppler_document_get_attachments (document);
1269 +      for (l = list; l; l = l->next)
1270 +       {
1271 +         PopplerAttachment *attachment;
1272 +         char *name;
1273 +
1274 +         name = g_strdup_printf ("/tmp/attach%d", i);
1275 +         attachment = l->data;
1276 +         g_print ("\tname: %s\n", attachment->name);
1277 +         g_print ("\tdescription: %s\n\n", attachment->description);
1278 +         poppler_attachment_save (attachment, name, NULL);
1279 +         i++;
1280 +       }
1281 +      g_list_foreach (list, g_object_unref, NULL);
1282 +      g_list_free (list);
1283 +    }
1284 +  else
1285 +    g_print ("no attachment\n");
1286  
1287    g_object_unref (G_OBJECT (page));
1288  
1289 diff -Nur poppler.0_5_0/goo/FixedPoint.h poppler.HEAD/goo/FixedPoint.h
1290 --- poppler.0_5_0/goo/FixedPoint.h      2005-09-16 20:29:18.000000000 +0200
1291 +++ poppler.HEAD/goo/FixedPoint.h       2006-02-06 21:49:21.000000000 +0100
1292 @@ -11,7 +11,7 @@
1293  #ifndef FIXEDPOINT_H
1294  #define FIXEDPOINT_H
1295  
1296 -#include <aconf.h>
1297 +#include <config.h>
1298  
1299  #if USE_FIXEDPOINT
1300  
1301 diff -Nur poppler.0_5_0/goo/gfile.cc poppler.HEAD/goo/gfile.cc
1302 --- poppler.0_5_0/goo/gfile.cc  2005-03-03 20:45:58.000000000 +0100
1303 +++ poppler.HEAD/goo/gfile.cc   2006-02-02 23:50:01.000000000 +0100
1304 @@ -489,6 +489,14 @@
1305      }
1306      (*name)->append("/XXXXXX")->append(ext);
1307      fd = mkstemps((*name)->getCString(), strlen(ext));
1308 +#elif defined(HAVE_MKSTEMP)
1309 +    if ((s = getenv("TMPDIR"))) {
1310 +      *name = new GooString(s);
1311 +    } else {
1312 +      *name = new GooString("/tmp");
1313 +    }
1314 +    (*name)->append("/XXXXXX")->append(ext);
1315 +    fd = mkstemp((*name)->getCString());
1316  #else
1317      if (!(s = tmpnam(NULL))) {
1318        return gFalse;
1319 diff -Nur poppler.0_5_0/m4/qt.m4 poppler.HEAD/m4/qt.m4
1320 --- poppler.0_5_0/m4/qt.m4      2006-01-06 11:05:58.000000000 +0100
1321 +++ poppler.HEAD/m4/qt.m4       2006-01-10 22:57:28.000000000 +0100
1322 @@ -156,6 +156,11 @@
1323  qt4_incdirs="/usr/local/qt/include /usr/include/qt4 /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/lib/qt/include"
1324  qt4_libdirs="/usr/local/qt/lib /usr/lib/qt /usr/lib /usr/X11R6/lib/X11/qt /usr/X11R6/lib/qt /usr/lib/qt/lib"
1325  
1326 +if test -n "$QTDIR" ; then
1327 +    qt4_incdirs="$QTDIR/include $qt4_incdirs"
1328 +    qt4_libdirs="$QTDIR/lib $qt4_libdirs"
1329 +fi
1330 +
1331  dnl What to test
1332  qt4test_test_include="QtTest/QtTest"
1333  qt4test_test_la_library="libQtTest.la"
1334 diff -Nur poppler.0_5_0/poppler/Annot.cc poppler.HEAD/poppler/Annot.cc
1335 --- poppler.0_5_0/poppler/Annot.cc      2005-10-16 16:54:17.000000000 +0200
1336 +++ poppler.HEAD/poppler/Annot.cc       2006-02-06 19:50:11.000000000 +0100
1337 @@ -18,6 +18,7 @@
1338  #include "Catalog.h"
1339  #include "Gfx.h"
1340  #include "Lexer.h"
1341 +#include "UGooString.h"
1342  #include "Annot.h"
1343  
1344  //------------------------------------------------------------------------
1345 @@ -210,15 +211,14 @@
1346  
1347      // build the appearance stream dictionary
1348      appearDict.initDict(xref);
1349 -    appearDict.dictAdd(copyString("Length"),
1350 -                      obj1.initInt(appearBuf->getLength()));
1351 -    appearDict.dictAdd(copyString("Subtype"), obj1.initName("Form"));
1352 +    appearDict.dictAdd("Length", obj1.initInt(appearBuf->getLength()));
1353 +    appearDict.dictAdd("Subtype", obj1.initName("Form"));
1354      obj1.initArray(xref);
1355      obj1.arrayAdd(obj2.initReal(0));
1356      obj1.arrayAdd(obj2.initReal(0));
1357      obj1.arrayAdd(obj2.initReal(xMax - xMin));
1358      obj1.arrayAdd(obj2.initReal(yMax - yMin));
1359 -    appearDict.dictAdd(copyString("BBox"), &obj1);
1360 +    appearDict.dictAdd("BBox", &obj1);
1361  
1362      // find the resource dictionary
1363      dict->lookup("DR", &drObj);
1364 @@ -243,7 +243,7 @@
1365        }
1366      }
1367      if (drObj.isDict()) {
1368 -      appearDict.dictAdd(copyString("Resources"), drObj.copy(&obj1));
1369 +      appearDict.dictAdd("Resources", drObj.copy(&obj1));
1370      }
1371      drObj.free();
1372  
1373 diff -Nur poppler.0_5_0/poppler/ArthurOutputDev.cc poppler.HEAD/poppler/ArthurOutputDev.cc
1374 --- poppler.0_5_0/poppler/ArthurOutputDev.cc    2005-10-30 21:29:05.000000000 +0100
1375 +++ poppler.HEAD/poppler/ArthurOutputDev.cc     2006-02-14 00:04:54.000000000 +0100
1376 @@ -245,11 +245,13 @@
1377    GfxFontType fontType;
1378    SplashOutFontFileID *id;
1379    SplashFontFile *fontFile;
1380 +  SplashFontSrc *fontsrc;
1381    FoFiTrueType *ff;
1382    Ref embRef;
1383    Object refObj, strObj;
1384 -  GooString *tmpFileName, *fileName, *substName;
1385 -  FILE *tmpFile;
1386 +  GooString *fileName, *substName;
1387 +  char *tmpBuf;
1388 +  int tmpBufLen;
1389    Gushort *codeToGID;
1390    DisplayFontParam *dfp;
1391    double m11, m12, m21, m22, w1, w2;
1392 @@ -259,7 +261,8 @@
1393  
1394    m_needFontUpdate = false;
1395    m_font = NULL;
1396 -  tmpFileName = NULL;
1397 +  fileName = NULL;
1398 +  tmpBuf = NULL;
1399    substIdx = -1;
1400  
1401    if (!(gfxFont = state->getFont())) {
1402 @@ -279,22 +282,9 @@
1403  
1404      // if there is an embedded font, write it to disk
1405      if (gfxFont->getEmbeddedFontID(&embRef)) {
1406 -      if (!openTempFile(&tmpFileName, &tmpFile, "wb", NULL)) {
1407 -       error(-1, "Couldn't create temporary font file");
1408 +      tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
1409 +      if (! tmpBuf)
1410         goto err2;
1411 -      }
1412 -      refObj.initRef(embRef.num, embRef.gen);
1413 -      refObj.fetch(xref, &strObj);
1414 -      refObj.free();
1415 -      strObj.streamReset();
1416 -      while ((c = strObj.streamGetChar()) != EOF) {
1417 -       fputc(c, tmpFile);
1418 -      }
1419 -      strObj.streamClose();
1420 -      strObj.free();
1421 -      fclose(tmpFile);
1422 -      fileName = tmpFileName;
1423 -
1424      // if there is an external font file, use it
1425      } else if (!(fileName = gfxFont->getExtFontFile())) {
1426  
1427 @@ -321,13 +311,18 @@
1428        }
1429      }
1430  
1431 +    fontsrc = new SplashFontSrc;
1432 +    if (fileName)
1433 +      fontsrc->setFile(fileName, gFalse);
1434 +    else
1435 +      fontsrc->setBuf(tmpBuf, tmpBufLen, gFalse);
1436 +
1437      // load the font file
1438      switch (fontType) {
1439      case fontType1:
1440        if (!(fontFile = m_fontEngine->loadType1Font(
1441                            id,
1442 -                          fileName->getCString(),
1443 -                          fileName == tmpFileName,
1444 +                          fontsrc,
1445                            ((Gfx8BitFont *)gfxFont)->getEncoding()))) {
1446         error(-1, "Couldn't create a font for '%s'",
1447               gfxFont->getName() ? gfxFont->getName()->getCString()
1448 @@ -338,8 +333,7 @@
1449      case fontType1C:
1450        if (!(fontFile = m_fontEngine->loadType1CFont(
1451                            id,
1452 -                          fileName->getCString(),
1453 -                          fileName == tmpFileName,
1454 +                          fontsrc,
1455                            ((Gfx8BitFont *)gfxFont)->getEncoding()))) {
1456         error(-1, "Couldn't create a font for '%s'",
1457               gfxFont->getName() ? gfxFont->getName()->getCString()
1458 @@ -355,8 +349,7 @@
1459        delete ff;
1460        if (!(fontFile = m_fontEngine->loadTrueTypeFont(
1461                            id,
1462 -                          fileName->getCString(),
1463 -                          fileName == tmpFileName,
1464 +                          fontsrc,
1465                            codeToGID, 256))) {
1466         error(-1, "Couldn't create a font for '%s'",
1467               gfxFont->getName() ? gfxFont->getName()->getCString()
1468 @@ -368,8 +361,7 @@
1469      case fontCIDType0C:
1470        if (!(fontFile = m_fontEngine->loadCIDFont(
1471                            id,
1472 -                          fileName->getCString(),
1473 -                          fileName == tmpFileName))) {
1474 +                          fontsrc))) {
1475         error(-1, "Couldn't create a font for '%s'",
1476               gfxFont->getName() ? gfxFont->getName()->getCString()
1477                                  : "(unnamed)");
1478 @@ -383,8 +375,7 @@
1479              n * sizeof(Gushort));
1480        if (!(fontFile = m_fontEngine->loadTrueTypeFont(
1481                            id,
1482 -                          fileName->getCString(),
1483 -                          fileName == tmpFileName,
1484 +                          fontsrc,
1485                            codeToGID, n))) {
1486         error(-1, "Couldn't create a font for '%s'",
1487               gfxFont->getName() ? gfxFont->getName()->getCString()
1488 @@ -408,17 +399,11 @@
1489    mat[2] = m21;  mat[3] = -m22;
1490    m_font = m_fontEngine->getFont(fontFile, mat);
1491  
1492 -  if (tmpFileName) {
1493 -    delete tmpFileName;
1494 -  }
1495    return;
1496  
1497   err2:
1498    delete id;
1499   err1:
1500 -  if (tmpFileName) {
1501 -    delete tmpFileName;
1502 -  }
1503    return;
1504  }
1505  
1506 diff -Nur poppler.0_5_0/poppler/CairoOutputDev.cc poppler.HEAD/poppler/CairoOutputDev.cc
1507 --- poppler.0_5_0/poppler/CairoOutputDev.cc     2006-01-10 18:55:59.000000000 +0100
1508 +++ poppler.HEAD/poppler/CairoOutputDev.cc      2006-02-18 21:17:00.000000000 +0100
1509 @@ -194,7 +194,11 @@
1510  
1511  void CairoOutputDev::updateLineWidth(GfxState *state) {
1512    LOG(printf ("line width: %f\n", state->getTransformedLineWidth()));
1513 -  cairo_set_line_width (cairo, state->getTransformedLineWidth());
1514 +  if (state->getTransformedLineWidth() == 0.0) {
1515 +      cairo_set_line_width (cairo, 72.0/300.0);
1516 +  } else {
1517 +      cairo_set_line_width (cairo, state->getTransformedLineWidth());
1518 +  }
1519  }
1520  
1521  void CairoOutputDev::updateFillColor(GfxState *state) {
1522 @@ -477,6 +481,26 @@
1523    int invert_bit;
1524    int row_stride;
1525  
1526 +  ctm = state->getCTM();
1527 +  LOG (printf ("drawImageMask %dx%d, matrix: %f, %f, %f, %f, %f, %f\n",
1528 +              width, height, ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]));
1529 +  matrix.xx = ctm[0] / width;
1530 +  matrix.xy = -ctm[2] / height;
1531 +  matrix.yx = ctm[1] / width;
1532 +  matrix.yy = -ctm[3] / height;
1533 +  matrix.x0 = ctm[2] + ctm[4];
1534 +  matrix.y0 = ctm[3] + ctm[5];
1535 +
1536 +  /* work around a cairo bug when scaling 1x1 surfaces */
1537 +  if (width == 1 && height == 1) {
1538 +    cairo_save (cairo);
1539 +    cairo_set_matrix (cairo, &matrix);
1540 +    cairo_rectangle (cairo, 0., 0., 1., 1.);
1541 +    cairo_fill (cairo);
1542 +    cairo_restore (cairo);
1543 +    return;
1544 +  }
1545 +
1546    row_stride = (width + 3) & ~3;
1547    buffer = (unsigned char *) malloc (height * row_stride);
1548    if (buffer == NULL) {
1549 @@ -510,6 +534,98 @@
1550    if (pattern == NULL)
1551      return;
1552  
1553 +  cairo_matrix_invert (&matrix);
1554 +  cairo_pattern_set_matrix (pattern, &matrix);
1555 +
1556 +  /* we should actually be using CAIRO_FILTER_NEAREST here. However,
1557 +   * cairo doesn't yet do minifaction filtering causing scaled down
1558 +   * images with CAIRO_FILTER_NEAREST to look really bad */
1559 +  cairo_pattern_set_filter (pattern, CAIRO_FILTER_BEST);
1560 +
1561 +  /* FIXME: Doesn't the image mask support any colorspace? */
1562 +  cairo_set_source (cairo, fill_pattern);
1563 +  cairo_mask (cairo, pattern);
1564 +
1565 +  cairo_pattern_destroy (pattern);
1566 +  cairo_surface_destroy (image);
1567 +  free (buffer);
1568 +  delete imgStr;
1569 +}
1570 +
1571 +void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
1572 +                               int width, int height,
1573 +                               GfxImageColorMap *colorMap,
1574 +                               Stream *maskStr,
1575 +                               int maskWidth, int maskHeight,
1576 +                               GfxImageColorMap *maskColorMap)
1577 +{
1578 +  ImageStream *maskImgStr;
1579 +  maskImgStr = new ImageStream(maskStr, maskWidth,
1580 +                                      maskColorMap->getNumPixelComps(),
1581 +                                      maskColorMap->getBits());
1582 +  maskImgStr->reset();
1583 +
1584 +  int row_stride = (maskWidth + 3) & ~3;
1585 +  unsigned char *maskBuffer;
1586 +  maskBuffer = (unsigned char *)gmalloc (row_stride * maskHeight);
1587 +  unsigned char *maskDest;
1588 +  cairo_surface_t *maskImage;
1589 +  cairo_pattern_t *maskPattern;
1590 +  Guchar *pix;
1591 +  int x, y;
1592 +  for (y = 0; y < maskHeight; y++) {
1593 +    maskDest = (unsigned char *) (maskBuffer + y * row_stride);
1594 +    pix = maskImgStr->getLine();
1595 +    maskColorMap->getGrayLine (pix, maskDest, maskWidth);
1596 +  }
1597 +
1598 +  maskImage = cairo_image_surface_create_for_data (maskBuffer, CAIRO_FORMAT_A8,
1599 +                                                maskWidth, maskHeight, row_stride);
1600 +
1601 +  delete maskImgStr;
1602 +  maskStr->close();
1603 +
1604 +  unsigned char *buffer;
1605 +  unsigned int *dest;
1606 +  cairo_surface_t *image;
1607 +  cairo_pattern_t *pattern;
1608 +  ImageStream *imgStr;
1609 +  GfxRGB rgb;
1610 +  int alpha, i;
1611 +  double *ctm;
1612 +  cairo_matrix_t matrix;
1613 +  int is_identity_transform;
1614 +
1615 +  buffer = (unsigned char *)gmalloc (width * height * 4);
1616 +
1617 +  /* TODO: Do we want to cache these? */
1618 +  imgStr = new ImageStream(str, width,
1619 +                          colorMap->getNumPixelComps(),
1620 +                          colorMap->getBits());
1621 +  imgStr->reset();
1622 +  
1623 +  /* ICCBased color space doesn't do any color correction
1624 +   * so check its underlying color space as well */
1625 +  is_identity_transform = colorMap->getColorSpace()->getMode() == csDeviceRGB ||
1626 +                 colorMap->getColorSpace()->getMode() == csICCBased && 
1627 +                 ((GfxICCBasedColorSpace*)colorMap->getColorSpace())->getAlt()->getMode() == csDeviceRGB;
1628 +
1629 +  for (y = 0; y < height; y++) {
1630 +    dest = (unsigned int *) (buffer + y * 4 * width);
1631 +    pix = imgStr->getLine();
1632 +    colorMap->getRGBLine (pix, dest, width);
1633 +  }
1634 +
1635 +  image = cairo_image_surface_create_for_data (buffer, CAIRO_FORMAT_RGB24,
1636 +                                                width, height, width * 4);
1637 +
1638 +  if (image == NULL)
1639 +    return;
1640 +  pattern = cairo_pattern_create_for_surface (image);
1641 +  maskPattern = cairo_pattern_create_for_surface (maskImage);
1642 +  if (pattern == NULL)
1643 +    return;
1644 +
1645    ctm = state->getCTM();
1646    LOG (printf ("drawImageMask %dx%d, matrix: %f, %f, %f, %f, %f, %f\n",
1647                width, height, ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]));
1648 @@ -519,20 +635,24 @@
1649    matrix.yy = -ctm[3] / height;
1650    matrix.x0 = ctm[2] + ctm[4];
1651    matrix.y0 = ctm[3] + ctm[5];
1652 +
1653    cairo_matrix_invert (&matrix);
1654 +
1655    cairo_pattern_set_matrix (pattern, &matrix);
1656 +  cairo_pattern_set_matrix (maskPattern, &matrix);
1657  
1658 -  cairo_pattern_set_filter (pattern, CAIRO_FILTER_BEST);
1659 -  /* FIXME: Doesn't the image mask support any colorspace? */
1660 -  cairo_set_source (cairo, fill_pattern);
1661 -  cairo_mask (cairo, pattern);
1662 +  cairo_pattern_set_filter (pattern, CAIRO_FILTER_BILINEAR);
1663 +  cairo_set_source (cairo, pattern);
1664 +  cairo_mask (cairo, maskPattern);
1665  
1666 +  cairo_pattern_destroy (maskPattern);
1667 +  cairo_surface_destroy (maskImage);
1668    cairo_pattern_destroy (pattern);
1669    cairo_surface_destroy (image);
1670    free (buffer);
1671 +  free (maskBuffer);
1672    delete imgStr;
1673  }
1674 -
1675  void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
1676                                 int width, int height,
1677                                 GfxImageColorMap *colorMap,
1678 diff -Nur poppler.0_5_0/poppler/CairoOutputDev.h poppler.HEAD/poppler/CairoOutputDev.h
1679 --- poppler.0_5_0/poppler/CairoOutputDev.h      2006-01-10 18:55:59.000000000 +0100
1680 +++ poppler.HEAD/poppler/CairoOutputDev.h       2006-02-18 21:17:00.000000000 +0100
1681 @@ -117,6 +117,12 @@
1682    virtual void drawImage(GfxState *state, Object *ref, Stream *str,
1683                          int width, int height, GfxImageColorMap *colorMap,
1684                          int *maskColors, GBool inlineImg);
1685 +  virtual void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
1686 +                               int width, int height,
1687 +                               GfxImageColorMap *colorMap,
1688 +                               Stream *maskStr,
1689 +                               int maskWidth, int maskHeight,
1690 +                               GfxImageColorMap *maskColorMap);
1691  
1692    //----- Type 3 font operators
1693    virtual void type3D0(GfxState *state, double wx, double wy);
1694 diff -Nur poppler.0_5_0/poppler/Catalog.cc poppler.HEAD/poppler/Catalog.cc
1695 --- poppler.0_5_0/poppler/Catalog.cc    2005-09-15 14:52:36.000000000 +0200
1696 +++ poppler.HEAD/poppler/Catalog.cc     2006-01-18 23:32:13.000000000 +0100
1697 @@ -23,6 +23,7 @@
1698  #include "Error.h"
1699  #include "Link.h"
1700  #include "PageLabelInfo.h"
1701 +#include "UGooString.h"
1702  #include "Catalog.h"
1703  
1704  //------------------------------------------------------------------------
1705 @@ -83,11 +84,14 @@
1706    // read named destination dictionary
1707    catDict.dictLookup("Dests", &dests);
1708  
1709 -  // read root of named destination tree
1710 +  // read root of named destination tree - PDF1.6 table 3.28
1711    if (catDict.dictLookup("Names", &obj)->isDict()) {
1712      obj.dictLookup("Dests", &obj2);
1713      destNameTree.init(xref, &obj2);
1714      obj2.free();
1715 +    obj.dictLookup("EmbeddedFiles", &obj2);
1716 +    embeddedFileNameTree.init(xref, &obj2);
1717 +    obj2.free();
1718    }
1719    obj.free();
1720  
1721 @@ -178,6 +182,7 @@
1722    }
1723    dests.free();
1724    destNameTree.free();
1725 +  embeddedFileNameTree.free();
1726    if (baseURI) {
1727      delete baseURI;
1728    }
1729 @@ -291,7 +296,7 @@
1730    return 0;
1731  }
1732  
1733 -LinkDest *Catalog::findDest(GooString *name) {
1734 +LinkDest *Catalog::findDest(UGooString *name) {
1735    LinkDest *dest;
1736    Object obj1, obj2;
1737    GBool found;
1738 @@ -299,7 +304,7 @@
1739    // try named destination dictionary then name tree
1740    found = gFalse;
1741    if (dests.isDict()) {
1742 -    if (!dests.dictLookup(name->getCString(), &obj1)->isNull())
1743 +    if (!dests.dictLookup(*name, &obj1)->isNull())
1744        found = gTrue;
1745      else
1746        obj1.free();
1747 @@ -335,6 +340,97 @@
1748    return dest;
1749  }
1750  
1751 +EmbFile *Catalog::embeddedFile(int i)
1752 +{
1753 +    Object efDict;
1754 +    Object fileSpec;
1755 +    Object fileDesc;
1756 +    Object paramDict;
1757 +    Object paramObj;
1758 +    Object strObj;
1759 +    Object obj, obj2;
1760 +    obj = embeddedFileNameTree.getValue(i);
1761 +    GooString *fileName = new GooString();
1762 +    char *descString = embeddedFileNameTree.getName(i)->getCString();
1763 +    GooString *desc = new GooString(descString);
1764 +    delete[] descString;
1765 +    GooString *createDate = new GooString();
1766 +    GooString *modDate = new GooString();
1767 +    Stream *efStream;
1768 +    if (obj.isRef()) {
1769 +       if (obj.fetch(xref, &efDict)->isDict()) {
1770 +           // efDict matches Table 3.40 in the PDF1.6 spec
1771 +           efDict.dictLookup("F", &fileSpec);
1772 +           if (fileSpec.isString()) {
1773 +               delete fileName;
1774 +               fileName = new GooString(fileSpec.getString());
1775 +           }
1776 +           fileSpec.free();
1777 +
1778 +           // the logic here is that the description from the name
1779 +           // dictionary is used if we don't have a more specific
1780 +           // description - see the Note: on page 157 of the PDF1.6 spec
1781 +           efDict.dictLookup("Desc", &fileDesc);
1782 +           if (fileDesc.isString()) {
1783 +               delete desc;
1784 +               desc = new GooString(fileDesc.getString());
1785 +           } else {
1786 +               efDict.dictLookup("Description", &fileDesc);
1787 +               if (fileDesc.isString()) {
1788 +                   delete desc;
1789 +                   desc = new GooString(fileDesc.getString());
1790 +               }
1791 +           }
1792 +           fileDesc.free();
1793 +           
1794 +           efDict.dictLookup("EF", &obj2);
1795 +           if (obj2.isDict()) {
1796 +               // This gives us the raw data stream bytes
1797 +
1798 +               obj2.dictLookup("F", &strObj);
1799 +               if (strObj.isStream()) {
1800 +                   efStream = strObj.getStream();
1801 +               }
1802 +
1803 +               // dataDict corresponds to Table 3.41 in the PDF1.6 spec.
1804 +               Dict *dataDict = efStream->getDict();
1805 +
1806 +               // subtype is normally mimetype. You can extract it with code like this:
1807 +               // Object subtypeName;
1808 +               // dataDict->lookup( "Subtype", &subtypeName );
1809 +               // It is optional, so this will sometimes return a null object
1810 +               // if (subtypeName.isName()) {
1811 +               //        std::cout << "got subtype name: " << subtypeName.getName() << std::endl;
1812 +               // }
1813 +
1814 +               // paramDict corresponds to Table 3.42 in the PDF1.6 spec
1815 +               Object paramDict;
1816 +               dataDict->lookup( "Params", &paramDict );
1817 +               if (paramDict.isDict()) {
1818 +                   paramDict.dictLookup("ModDate", &paramObj);
1819 +                   if (paramObj.isString()) {
1820 +                       delete modDate;
1821 +                       modDate = new GooString(paramObj.getString());
1822 +                   }
1823 +                   paramObj.free();
1824 +                   paramDict.dictLookup("CreationDate", &paramObj);
1825 +                   if (paramObj.isString()) {
1826 +                       delete createDate;
1827 +                       createDate = new GooString(paramObj.getString());
1828 +                   }
1829 +                   paramObj.free();
1830 +               }
1831 +               paramDict.free();
1832 +           }
1833 +           efDict.free();
1834 +           obj2.free();
1835 +       }
1836 +    }
1837 +    EmbFile *embeddedFile = new EmbFile(fileName, desc, createDate, modDate, strObj);
1838 +    strObj.free();
1839 +    return embeddedFile;
1840 +}
1841 +
1842  NameTree::NameTree(void)
1843  {
1844    size = 0;
1845 @@ -343,12 +439,15 @@
1846  }
1847  
1848  NameTree::Entry::Entry(Array *array, int index) {
1849 -  if (!array->getString(index, &name) || !array->getNF(index + 1, &value))
1850 -    error(-1, "Invalid page tree");
1851 +    GooString n;
1852 +    if (!array->getString(index, &n) || !array->getNF(index + 1, &value))
1853 +       error(-1, "Invalid page tree");
1854 +    name = new UGooString(n);
1855  }
1856  
1857  NameTree::Entry::~Entry() {
1858    value.free();
1859 +  delete name;
1860  }
1861  
1862  void NameTree::addEntry(Entry *entry)
1863 @@ -402,13 +501,13 @@
1864  
1865  int NameTree::Entry::cmp(const void *voidKey, const void *voidEntry)
1866  {
1867 -  GooString *key = (GooString *) voidKey;
1868 +  UGooString *key = (UGooString *) voidKey;
1869    Entry *entry = *(NameTree::Entry **) voidEntry;
1870  
1871 -  return key->cmp(&entry->name);
1872 +  return key->cmp(entry->name);
1873  }
1874  
1875 -GBool NameTree::lookup(GooString *name, Object *obj)
1876 +GBool NameTree::lookup(UGooString *name, Object *obj)
1877  {
1878    Entry **entry;
1879  
1880 @@ -424,6 +523,24 @@
1881    }
1882  }
1883  
1884 +Object NameTree::getValue(int index)
1885 +{
1886 +  if (index < length) {
1887 +    return entries[index]->value;
1888 +  } else {
1889 +    return Object();
1890 +  }
1891 +}
1892 +
1893 +UGooString *NameTree::getName(int index)
1894 +{
1895 +    if (index < length) {
1896 +       return entries[index]->name;
1897 +    } else {
1898 +       return NULL;
1899 +    }
1900 +}
1901 +
1902  void NameTree::free()
1903  {
1904    int i;
1905 diff -Nur poppler.0_5_0/poppler/Catalog.h poppler.HEAD/poppler/Catalog.h
1906 --- poppler.0_5_0/poppler/Catalog.h     2005-09-15 14:52:36.000000000 +0200
1907 +++ poppler.HEAD/poppler/Catalog.h      2006-01-18 23:32:13.000000000 +0100
1908 @@ -19,6 +19,7 @@
1909  class PageAttrs;
1910  struct Ref;
1911  class LinkDest;
1912 +class UGooString;
1913  class PageLabelInfo;
1914  
1915  //------------------------------------------------------------------------
1916 @@ -30,14 +31,18 @@
1917    NameTree();
1918    void init(XRef *xref, Object *tree);
1919    void parse(Object *tree);
1920 -  GBool lookup(GooString *name, Object *obj);
1921 +  GBool lookup(UGooString *name, Object *obj);
1922    void free();
1923 +  int numEntries() { return length; };
1924 +  // iterator accessor
1925 +  Object getValue(int i);
1926 +  UGooString *getName(int i);
1927  
1928  private:
1929    struct Entry {
1930      Entry(Array *array, int index);
1931      ~Entry();
1932 -    GooString name;
1933 +    UGooString *name;
1934      Object value;
1935      void free();
1936      static int cmp(const void *key, const void *entry);
1937 @@ -48,7 +53,45 @@
1938    XRef *xref;
1939    Object *root;
1940    Entry **entries;
1941 -  int size, length;
1942 +  int size, length; // size is the number of entries in
1943 +                    // the array of Entry*
1944 +                    // length is the number of real Entry
1945 +};
1946 +
1947 +class EmbFile {
1948 +public:
1949 +  EmbFile(GooString *name, GooString *description, 
1950 +         GooString *createDate,
1951 +         GooString *modDate, Object objStr) :
1952 +    m_name(name),
1953 +    m_description(description),
1954 +    m_createDate(createDate),
1955 +    m_modDate(modDate)
1956 +  {
1957 +    objStr.copy(&m_objStr);
1958 +  }
1959 +
1960 +  ~EmbFile()
1961 +  {
1962 +    delete m_name;
1963 +    delete m_description;
1964 +    delete m_modDate;
1965 +    delete m_createDate;
1966 +    m_objStr.free();
1967 +  }
1968 +
1969 +  GooString *name() { return m_name; }
1970 +  GooString *description() { return m_description; }
1971 +  GooString *modDate() { return m_modDate; }
1972 +  GooString *createDate() { return m_createDate; }
1973 +  Object &streamObject() { return m_objStr; }
1974 +
1975 +private:
1976 +  GooString *m_name;
1977 +  GooString *m_description;
1978 +  GooString *m_createDate;
1979 +  GooString *m_modDate;
1980 +  Object m_objStr;
1981  };
1982  
1983  //------------------------------------------------------------------------
1984 @@ -92,7 +135,13 @@
1985  
1986    // Find a named destination.  Returns the link destination, or
1987    // NULL if <name> is not a destination.
1988 -  LinkDest *findDest(GooString *name);
1989 +  LinkDest *findDest(UGooString *name);
1990 +
1991 +  // Get the number of embedded files
1992 +  int numEmbeddedFiles() { return embeddedFileNameTree.numEntries(); }
1993 +
1994 +  // Get the i'th file embedded (at the Document level) in the document
1995 +  EmbFile *embeddedFile(int i);
1996  
1997    // Convert between page indices and page labels.
1998    GBool labelToIndex(GooString *label, int *index);
1999 @@ -132,7 +181,8 @@
2000    int numPages;                        // number of pages
2001    int pagesSize;               // size of pages array
2002    Object dests;                        // named destination dictionary
2003 -  NameTree destNameTree;       // name tree
2004 +  NameTree destNameTree;       // named destination name-tree
2005 +  NameTree embeddedFileNameTree;  // embedded file name-tree
2006    GooString *baseURI;          // base URI for URI-type links
2007    Object metadata;             // metadata stream
2008    Object structTreeRoot;       // structure tree root dictionary
2009 diff -Nur poppler.0_5_0/poppler/CharCodeToUnicode.cc poppler.HEAD/poppler/CharCodeToUnicode.cc
2010 --- poppler.0_5_0/poppler/CharCodeToUnicode.cc  2005-09-16 20:38:58.000000000 +0200
2011 +++ poppler.HEAD/poppler/CharCodeToUnicode.cc   2006-01-18 19:54:12.000000000 +0100
2012 @@ -243,8 +243,18 @@
2013         }
2014         if (!(n1 == 2 + nDigits && tok1[0] == '<' && tok1[n1 - 1] == '>' &&
2015               tok2[0] == '<' && tok2[n2 - 1] == '>')) {
2016 -         error(-1, "Illegal entry in bfchar block in ToUnicode CMap");
2017 -         continue;
2018 +         
2019 +         // check there was no line jump inside the token and so the length is 
2020 +         // longer than it should be
2021 +         int countAux = 0;
2022 +         for (int k = 0; k < n1; k++)
2023 +           if (tok1[k] != '\n' && tok1[k] != '\r') countAux++;
2024 +       
2025 +         if (!(countAux == 2 + nDigits && tok1[0] == '<' && tok1[n1 - 1] == '>' &&
2026 +             tok2[0] == '<' && tok2[n2 - 1] == '>')) {
2027 +           error(-1, "Illegal entry in bfchar block in ToUnicode CMap");
2028 +           continue;
2029 +         }
2030         }
2031         tok1[n1 - 1] = tok2[n2 - 1] = '\0';
2032         if (sscanf(tok1 + 1, "%x", &code1) != 1) {
2033 @@ -268,8 +278,21 @@
2034         }
2035         if (!(n1 == 2 + nDigits && tok1[0] == '<' && tok1[n1 - 1] == '>' &&
2036               n2 == 2 + nDigits && tok2[0] == '<' && tok2[n2 - 1] == '>')) {
2037 -         error(-1, "Illegal entry in bfrange block in ToUnicode CMap");
2038 -         continue;
2039 +         // check there was no line jump inside the token and so the length is 
2040 +         // longer than it should be
2041 +         int countAux = 0;
2042 +         for (int k = 0; k < n1; k++)
2043 +           if (tok1[k] != '\n' && tok1[k] != '\r') countAux++;
2044 +         
2045 +         int countAux2 = 0;
2046 +         for (int k = 0; k < n1; k++)
2047 +           if (tok2[k] != '\n' && tok2[k] != '\r') countAux++;
2048 +         
2049 +         if (!(countAux == 2 + nDigits && tok1[0] == '<' && tok1[n1 - 1] == '>' &&
2050 +             countAux2 == 2 + nDigits && tok2[0] == '<' && tok2[n2 - 1] == '>')) {
2051 +           error(-1, "Illegal entry in bfrange block in ToUnicode CMap");
2052 +           continue;
2053 +         }
2054         }
2055         tok1[n1 - 1] = tok2[n2 - 1] = '\0';
2056         if (sscanf(tok1 + 1, "%x", &code1) != 1 ||
2057 diff -Nur poppler.0_5_0/poppler/Dict.cc poppler.HEAD/poppler/Dict.cc
2058 --- poppler.0_5_0/poppler/Dict.cc       2005-08-27 10:43:43.000000000 +0200
2059 +++ poppler.HEAD/poppler/Dict.cc        2006-01-18 23:32:13.000000000 +0100
2060 @@ -16,6 +16,7 @@
2061  #include <string.h>
2062  #include "goo/gmem.h"
2063  #include "Object.h"
2064 +#include "UGooString.h"
2065  #include "XRef.h"
2066  #include "Dict.h"
2067  
2068 @@ -34,13 +35,13 @@
2069    int i;
2070  
2071    for (i = 0; i < length; ++i) {
2072 -    gfree(entries[i].key);
2073 +    delete entries[i].key;
2074      entries[i].val.free();
2075    }
2076    gfree(entries);
2077  }
2078  
2079 -void Dict::add(char *key, Object *val) {
2080 +void Dict::add(const UGooString &key, Object *val) {
2081    if (length == size) {
2082      if (length == 0) {
2083        size = 8;
2084 @@ -49,16 +50,16 @@
2085      }
2086      entries = (DictEntry *)greallocn(entries, size, sizeof(DictEntry));
2087    }
2088 -  entries[length].key = key;
2089 +  entries[length].key = new UGooString(key);
2090    entries[length].val = *val;
2091    ++length;
2092  }
2093  
2094 -inline DictEntry *Dict::find(char *key) {
2095 +inline DictEntry *Dict::find(const UGooString &key) {
2096    int i;
2097  
2098    for (i = 0; i < length; ++i) {
2099 -    if (!strcmp(key, entries[i].key))
2100 +    if (!key.cmp(entries[i].key))
2101        return &entries[i];
2102    }
2103    return NULL;
2104 @@ -70,13 +71,13 @@
2105    return (e = find("Type")) && e->val.isName(type);
2106  }
2107  
2108 -Object *Dict::lookup(char *key, Object *obj) {
2109 +Object *Dict::lookup(const UGooString &key, Object *obj) {
2110    DictEntry *e;
2111  
2112    return (e = find(key)) ? e->val.fetch(xref, obj) : obj->initNull();
2113  }
2114  
2115 -Object *Dict::lookupNF(char *key, Object *obj) {
2116 +Object *Dict::lookupNF(const UGooString &key, Object *obj) {
2117    DictEntry *e;
2118  
2119    return (e = find(key)) ? e->val.copy(obj) : obj->initNull();
2120 @@ -102,7 +103,7 @@
2121    return success;
2122  }
2123  
2124 -char *Dict::getKey(int i) {
2125 +UGooString *Dict::getKey(int i) {
2126    return entries[i].key;
2127  }
2128  
2129 diff -Nur poppler.0_5_0/poppler/Dict.h poppler.HEAD/poppler/Dict.h
2130 --- poppler.0_5_0/poppler/Dict.h        2005-03-28 09:49:55.000000000 +0200
2131 +++ poppler.HEAD/poppler/Dict.h 2006-01-18 23:32:13.000000000 +0100
2132 @@ -15,12 +15,13 @@
2133  
2134  #include "Object.h"
2135  
2136 +class UGooString;
2137  //------------------------------------------------------------------------
2138  // Dict
2139  //------------------------------------------------------------------------
2140  
2141  struct DictEntry {
2142 -  char *key;
2143 +  UGooString *key;
2144    Object val;
2145  };
2146  
2147 @@ -40,20 +41,20 @@
2148    // Get number of entries.
2149    int getLength() { return length; }
2150  
2151 -  // Add an entry.  NB: does not copy key.
2152 -  void add(char *key, Object *val);
2153 +  // Add an entry
2154 +  void add(const UGooString &key, Object *val);
2155  
2156    // Check if dictionary is of specified type.
2157    GBool is(char *type);
2158  
2159    // Look up an entry and return the value.  Returns a null object
2160    // if <key> is not in the dictionary.
2161 -  Object *lookup(char *key, Object *obj);
2162 -  Object *lookupNF(char *key, Object *obj);
2163 +  Object *lookup(const UGooString &key, Object *obj);
2164 +  Object *lookupNF(const UGooString &key, Object *obj);
2165    GBool lookupInt(const char *key, const char *alt_key, int *value);
2166  
2167    // Iterative accessors.
2168 -  char *getKey(int i);
2169 +  UGooString *getKey(int i);
2170    Object *getVal(int i, Object *obj);
2171    Object *getValNF(int i, Object *obj);
2172  
2173 @@ -70,7 +71,7 @@
2174    int length;                  // number of entries in dictionary
2175    int ref;                     // reference count
2176  
2177 -  DictEntry *find(char *key);
2178 +  DictEntry *find(const UGooString &key);
2179  };
2180  
2181  #endif
2182 diff -Nur poppler.0_5_0/poppler/FontInfo.cc poppler.HEAD/poppler/FontInfo.cc
2183 --- poppler.0_5_0/poppler/FontInfo.cc   2005-10-16 16:54:17.000000000 +0200
2184 +++ poppler.HEAD/poppler/FontInfo.cc    2006-01-23 16:40:54.000000000 +0100
2185 @@ -1,3 +1,4 @@
2186 +#include "config.h"
2187  #include <stdio.h>
2188  #include <stdlib.h>
2189  #include <stddef.h>
2190 @@ -10,8 +11,8 @@
2191  #include "GfxFont.h"
2192  #include "Annot.h"
2193  #include "PDFDoc.h"
2194 -#include "config.h"
2195  #include "FontInfo.h"
2196 +#include "UGooString.h"
2197  
2198  FontInfoScanner::FontInfoScanner(PDFDoc *docA) {
2199    doc = docA;
2200 diff -Nur poppler.0_5_0/poppler/Function.cc poppler.HEAD/poppler/Function.cc
2201 --- poppler.0_5_0/poppler/Function.cc   2005-10-16 16:58:14.000000000 +0200
2202 +++ poppler.HEAD/poppler/Function.cc    2006-01-18 23:32:13.000000000 +0100
2203 @@ -22,6 +22,7 @@
2204  #include "Stream.h"
2205  #include "Error.h"
2206  #include "Function.h"
2207 +#include "UGooString.h"
2208  
2209  //------------------------------------------------------------------------
2210  // Function
2211 diff -Nur poppler.0_5_0/poppler/Gfx.cc poppler.HEAD/poppler/Gfx.cc
2212 --- poppler.0_5_0/poppler/Gfx.cc        2005-12-08 19:17:42.000000000 +0100
2213 +++ poppler.HEAD/poppler/Gfx.cc 2006-02-05 16:46:10.000000000 +0100
2214 @@ -35,6 +35,7 @@
2215  #include "Error.h"
2216  #include "Gfx.h"
2217  #include "ProfileData.h"
2218 +#include "UGooString.h"
2219  
2220  // the MSVC math.h doesn't define this
2221  #ifndef M_PI
2222 @@ -3525,6 +3526,7 @@
2223         break;
2224        }
2225        dict.dictAdd(key, &obj);
2226 +      gfree(key);
2227      }
2228      parser->getObj(&obj);
2229    }
2230 @@ -3590,9 +3592,16 @@
2231      printf("\n");
2232      fflush(stdout);
2233    }
2234 +
2235 +  if(numArgs == 2) {
2236 +    out->beginMarkedContent(args[0].getName(),args[1].getDict());
2237 +  } else {
2238 +    out->beginMarkedContent(args[0].getName());
2239 +  }
2240  }
2241  
2242  void Gfx::opEndMarkedContent(Object args[], int numArgs) {
2243 +  out->endMarkedContent();
2244  }
2245  
2246  void Gfx::opMarkPoint(Object args[], int numArgs) {
2247 @@ -3603,6 +3612,13 @@
2248      printf("\n");
2249      fflush(stdout);
2250    }
2251 +
2252 +  if(numArgs == 2) {
2253 +    out->markPoint(args[0].getName(),args[1].getDict());
2254 +  } else {
2255 +    out->markPoint(args[0].getName());
2256 +  }
2257 +
2258  }
2259  
2260  //------------------------------------------------------------------------
2261 diff -Nur poppler.0_5_0/poppler/GfxFont.cc poppler.HEAD/poppler/GfxFont.cc
2262 --- poppler.0_5_0/poppler/GfxFont.cc    2005-10-16 17:11:32.000000000 +0200
2263 +++ poppler.HEAD/poppler/GfxFont.cc     2006-02-05 16:46:10.000000000 +0100
2264 @@ -28,6 +28,7 @@
2265  #include <fofi/FoFiType1.h>
2266  #include <fofi/FoFiType1C.h>
2267  #include <fofi/FoFiTrueType.h>
2268 +#include "UGooString.h"
2269  #include "GfxFont.h"
2270  
2271  //------------------------------------------------------------------------
2272 @@ -360,7 +361,7 @@
2273  
2274  void GfxFont::findExtFontFile() {
2275    static char *type1Exts[] = { ".pfa", ".pfb", ".ps", "", NULL };
2276 -  static char *ttExts[] = { ".ttf", NULL };
2277 +  static char *ttExts[] = { ".ttf", ".ttc", NULL };
2278  
2279    if (name) {
2280      if (type == fontType1) {
2281 @@ -1521,6 +1522,54 @@
2282    return cMap ? cMap->getCollection() : (GooString *)NULL;
2283  }
2284  
2285 +Gushort *GfxCIDFont::getCodeToGIDMap(FoFiTrueType *ff, int *mapsizep) {
2286 +  Gushort *map;
2287 +  int cmapPlatform, cmapEncoding;
2288 +  int unicodeCmap, macRomanCmap, msSymbolCmap, cmap;
2289 +  GBool useMacRoman, useUnicode;
2290 +  char *charName;
2291 +  Unicode u;
2292 +  int code, i;
2293 +  int mapsize;
2294 +  int cidlen;
2295 +
2296 +  *mapsizep = 0;
2297 +  if (!ctu) return NULL;
2298 +
2299 +  /* we use only unicode cmap */
2300 +  cmap = -1;
2301 +  for (i = 0; i < ff->getNumCmaps(); ++i) {
2302 +    cmapPlatform = ff->getCmapPlatform(i);
2303 +    cmapEncoding = ff->getCmapEncoding(i);
2304 +    if ((cmapPlatform == 3 && cmapEncoding == 1) || cmapPlatform == 0)
2305 +      cmap = i;
2306 +  }
2307 +  if (cmap < 0)
2308 +    return NULL;
2309 +
2310 +  cidlen = 0;
2311 +  mapsize = 64;
2312 +  map = (Gushort *)gmalloc(mapsize * sizeof(Gushort));
2313 +
2314 +  while (cidlen < ctu->getLength()) {
2315 +    int n;
2316 +    if ((n = ctu->mapToUnicode((CharCode)cidlen, &u, 1)) == 0) {
2317 +      cidlen++;
2318 +      continue;
2319 +    }
2320 +    if (cidlen >= mapsize) {
2321 +      while (cidlen >= mapsize)
2322 +       mapsize *= 2;
2323 +      map = (Gushort *)grealloc(map, mapsize * sizeof(Gushort));
2324 +    }
2325 +    map[cidlen] = ff->mapCodeToGID(cmap, u);
2326 +    cidlen++;
2327 +  }
2328 +
2329 +  *mapsizep = cidlen;
2330 +  return map;
2331 +}
2332 +
2333  //------------------------------------------------------------------------
2334  // GfxFontDict
2335  //------------------------------------------------------------------------
2336 @@ -1549,8 +1598,10 @@
2337           r.gen = 999999;
2338         }
2339        }
2340 -      fonts[i] = GfxFont::makeFont(xref, fontDict->getKey(i),
2341 +      char *aux = fontDict->getKey(i)->getCString();
2342 +      fonts[i] = GfxFont::makeFont(xref, aux,
2343                                    r, obj2.getDict());
2344 +      delete[] aux;
2345        if (fonts[i] && !fonts[i]->isOk()) {
2346         delete fonts[i];
2347         fonts[i] = NULL;
2348 diff -Nur poppler.0_5_0/poppler/GfxFont.h poppler.HEAD/poppler/GfxFont.h
2349 --- poppler.0_5_0/poppler/GfxFont.h     2005-07-06 19:12:36.000000000 +0200
2350 +++ poppler.HEAD/poppler/GfxFont.h      2006-02-02 23:50:01.000000000 +0100
2351 @@ -310,6 +310,8 @@
2352    Gushort *getCIDToGID() { return cidToGID; }
2353    int getCIDToGIDLen() { return cidToGIDLen; }
2354  
2355 +  Gushort *getCodeToGIDMap(FoFiTrueType *ff, int *length);
2356 +
2357  private:
2358  
2359    CMap *cMap;                  // char code --> CID
2360 diff -Nur poppler.0_5_0/poppler/GfxState.cc poppler.HEAD/poppler/GfxState.cc
2361 --- poppler.0_5_0/poppler/GfxState.cc   2005-12-09 21:49:59.000000000 +0100
2362 +++ poppler.HEAD/poppler/GfxState.cc    2006-02-18 21:17:00.000000000 +0100
2363 @@ -21,6 +21,7 @@
2364  #include "Array.h"
2365  #include "Page.h"
2366  #include "GfxState.h"
2367 +#include "UGooString.h"
2368  
2369  //------------------------------------------------------------------------
2370  
2371 @@ -204,6 +205,23 @@
2372    }
2373  }
2374  
2375 +void GfxColorSpace::getGrayLine(Guchar *in, unsigned char *out, int length) {
2376 +  int i, j, n;
2377 +  GfxColor color;
2378 +  GfxGray gray;
2379 +
2380 +  n = getNComps();
2381 +  for (i = 0; i < length; i++) {
2382 +    
2383 +    for (j = 0; j < n; j++)
2384 +      color.c[j] = in[i * n + j] * 256;
2385 +
2386 +    getGray (&color, &gray);
2387 +    out[i] = colToByte(gray);
2388 +  }
2389 +}
2390 +
2391 +
2392  //------------------------------------------------------------------------
2393  // GfxDeviceGrayColorSpace
2394  //------------------------------------------------------------------------
2395 @@ -3433,6 +3451,39 @@
2396    }
2397  }
2398  
2399 +void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) {
2400 +  GfxColor color;
2401 +  double *p;
2402 +  int i, j;
2403 +  Guchar *inp, *outp, *tmp_line;
2404 +  GfxColorSpace *base;
2405 +
2406 +  switch (colorSpace->getMode()) {
2407 +  case csIndexed:
2408 +  case csSeparation:
2409 +    tmp_line = (Guchar *) gmalloc (length * nComps2);
2410 +    for (i = 0; i < length; i++) {
2411 +      for (j = 0; j < nComps2; j++) {
2412 +       tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
2413 +      }
2414 +    }
2415 +    colorSpace2->getGrayLine(tmp_line, out, length);
2416 +    gfree (tmp_line);
2417 +    break;
2418 +
2419 +  default:
2420 +    inp = in;
2421 +    for (j = 0; j < length; j++)
2422 +      for (i = 0; i < nComps; i++) {
2423 +       *inp = byte_lookup[*inp * nComps + i];
2424 +       inp++;
2425 +      }
2426 +    colorSpace->getGrayLine(in, out, length);
2427 +    break;
2428 +  }
2429 +
2430 +}
2431 +
2432  void GfxImageColorMap::getRGBLine(Guchar *in, unsigned int *out, int length) {
2433    GfxColor color;
2434    double *p;
2435 diff -Nur poppler.0_5_0/poppler/GfxState.h poppler.HEAD/poppler/GfxState.h
2436 --- poppler.0_5_0/poppler/GfxState.h    2005-10-30 21:29:05.000000000 +0100
2437 +++ poppler.HEAD/poppler/GfxState.h     2006-02-18 21:17:00.000000000 +0100
2438 @@ -151,6 +151,7 @@
2439    virtual void getRGB(GfxColor *color, GfxRGB *rgb) = 0;
2440    virtual void getCMYK(GfxColor *color, GfxCMYK *cmyk) = 0;
2441    virtual void getRGBLine(Guchar *in, unsigned int *out, int length);
2442 +  virtual void getGrayLine(Guchar *in, Guchar *out, int length);
2443  
2444    // Return the number of color components.
2445    virtual int getNComps() = 0;
2446 @@ -869,6 +870,7 @@
2447    void getGray(Guchar *x, GfxGray *gray);
2448    void getRGB(Guchar *x, GfxRGB *rgb);
2449    void getRGBLine(Guchar *in, unsigned int *out, int length);
2450 +  void getGrayLine(Guchar *in, Guchar *out, int length);
2451    void getCMYK(Guchar *x, GfxCMYK *cmyk);
2452    void getColor(Guchar *x, GfxColor *color);
2453  
2454 diff -Nur poppler.0_5_0/poppler/GlobalParams.cc poppler.HEAD/poppler/GlobalParams.cc
2455 --- poppler.0_5_0/poppler/GlobalParams.cc       2005-12-08 19:17:42.000000000 +0100
2456 +++ poppler.HEAD/poppler/GlobalParams.cc        2006-02-04 21:48:25.000000000 +0100
2457 @@ -23,9 +23,6 @@
2458  #ifdef WIN32
2459  #  include <shlobj.h>
2460  #endif
2461 -#if HAVE_PAPER_H
2462 -#include <paper.h>
2463 -#endif
2464  #include <fontconfig/fontconfig.h>
2465  #include "goo/gmem.h"
2466  #include "goo/GooString.h"
2467 @@ -324,24 +321,8 @@
2468    cMapDirs = new GooHash(gTrue);
2469    toUnicodeDirs = new GooList();
2470    displayFonts = new GooHash();
2471 -#if HAVE_PAPER_H
2472 -  char *paperName;
2473 -  const struct paper *paperType;
2474 -  paperinit();
2475 -  if ((paperName = systempapername())) {
2476 -    paperType = paperinfo(paperName);
2477 -    psPaperWidth = (int)paperpswidth(paperType);
2478 -    psPaperHeight = (int)paperpsheight(paperType);
2479 -  } else {
2480 -    error(-1, "No paper information available - using defaults");
2481 -    psPaperWidth = defPaperWidth;
2482 -    psPaperHeight = defPaperHeight;
2483 -  }
2484 -  paperdone();
2485 -#else
2486 -  psPaperWidth = defPaperWidth;
2487 -  psPaperHeight = defPaperHeight;
2488 -#endif
2489 +  psPaperWidth = -1;
2490 +  psPaperHeight = -1;
2491    psImageableLLX = psImageableLLY = 0;
2492    psImageableURX = psPaperWidth;
2493    psImageableURY = psPaperHeight;
2494 @@ -1122,7 +1103,7 @@
2495    }
2496  }
2497  
2498 -FcPattern *buildFcPattern(GfxFont *font)
2499 +static FcPattern *buildFcPattern(GfxFont *font)
2500  {
2501    int weight = FC_WEIGHT_NORMAL,
2502        slant = FC_SLANT_ROMAN,
2503 @@ -1266,7 +1247,7 @@
2504  
2505  DisplayFontParam *GlobalParams::getDisplayFont(GfxFont *font) {
2506    DisplayFontParam *dfp;
2507 -  FcPattern *p=0,*m=0;
2508 +  FcPattern *p=0;
2509  
2510    GooString *fontName = font->getName();
2511    if (!fontName) return NULL;
2512 @@ -1278,38 +1259,44 @@
2513      FcChar8* s;
2514      char * ext;
2515      FcResult res;
2516 +    FcFontSet *set;
2517 +    int i;
2518      p = buildFcPattern(font);
2519  
2520      if (!p)
2521        goto fin;
2522      FcConfigSubstitute(FCcfg, p, FcMatchPattern);
2523      FcDefaultSubstitute(p);
2524 -    m = FcFontMatch(FCcfg,p,&res);
2525 -    if (!m)
2526 -      goto fin; 
2527 -    res = FcPatternGetString(m, FC_FILE, 0, &s);
2528 -    if (res != FcResultMatch || !s)
2529 -      goto fin; 
2530 -    ext = strrchr((char*)s,'.');
2531 -    if (!ext)
2532 +    set = FcFontSort(FCcfg, p, FcFalse, NULL, &res);
2533 +    if (!set)
2534        goto fin;
2535 -    if (!strncasecmp(ext,".ttf",4))
2536 -    {
2537 -      dfp = new DisplayFontParam(fontName->copy(), displayFontTT);  
2538 -      dfp->tt.fileName = new GooString((char*)s);
2539 -    }
2540 -    else if (!strncasecmp(ext,".pfa",4) || !strncasecmp(ext,".pfb",4)) 
2541 +    for (i = 0; i < set->nfont; ++i)
2542      {
2543 -      dfp = new DisplayFontParam(fontName->copy(), displayFontT1);  
2544 -      dfp->t1.fileName = new GooString((char*)s);
2545 +      res = FcPatternGetString(set->fonts[i], FC_FILE, 0, &s);
2546 +      if (res != FcResultMatch || !s)
2547 +        continue;
2548 +      ext = strrchr((char*)s,'.');
2549 +      if (!ext)
2550 +        continue;
2551 +      if (!strncasecmp(ext,".ttf",4) || !strncasecmp(ext, ".ttc", 4))
2552 +      {
2553 +        dfp = new DisplayFontParam(fontName->copy(), displayFontTT);  
2554 +        dfp->tt.fileName = new GooString((char*)s);
2555 +        FcPatternGetInteger(set->fonts[i], FC_INDEX, 0, &(dfp->tt.faceIndex));
2556 +      }
2557 +      else if (!strncasecmp(ext,".pfa",4) || !strncasecmp(ext,".pfb",4)) 
2558 +      {
2559 +        dfp = new DisplayFontParam(fontName->copy(), displayFontT1);  
2560 +        dfp->t1.fileName = new GooString((char*)s);
2561 +      }
2562 +      else
2563 +        continue;
2564 +      displayFonts->add(dfp->name,dfp);
2565 +      break;
2566      }
2567 -    else
2568 -      goto fin;
2569 -    displayFonts->add(dfp->name,dfp);
2570 +    FcFontSetDestroy(set);
2571    }
2572  fin:
2573 -  if (m)
2574 -    FcPatternDestroy(m);
2575    if (p)
2576      FcPatternDestroy(p);
2577  
2578 diff -Nur poppler.0_5_0/poppler/GlobalParams.h poppler.HEAD/poppler/GlobalParams.h
2579 --- poppler.0_5_0/poppler/GlobalParams.h        2005-09-20 16:00:43.000000000 +0200
2580 +++ poppler.HEAD/poppler/GlobalParams.h 2006-02-02 23:50:01.000000000 +0100
2581 @@ -55,6 +55,7 @@
2582  
2583  struct DisplayFontParamTT {
2584    GooString *fileName;
2585 +  int faceIndex;
2586  };
2587  
2588  class DisplayFontParam {
2589 diff -Nur poppler.0_5_0/poppler/Lexer.cc poppler.HEAD/poppler/Lexer.cc
2590 --- poppler.0_5_0/poppler/Lexer.cc      2005-08-31 17:28:46.000000000 +0200
2591 +++ poppler.HEAD/poppler/Lexer.cc       2006-01-17 22:35:31.000000000 +0100
2592 @@ -18,6 +18,7 @@
2593  #include <ctype.h>
2594  #include "Lexer.h"
2595  #include "Error.h"
2596 +#include "XRef.h"
2597  
2598  //------------------------------------------------------------------------
2599  
2600 @@ -46,9 +47,11 @@
2601  // Lexer
2602  //------------------------------------------------------------------------
2603  
2604 -Lexer::Lexer(XRef *xref, Stream *str) {
2605 +Lexer::Lexer(XRef *xrefA, Stream *str) {
2606    Object obj;
2607  
2608 +  xref = xrefA;
2609 +
2610    curStr.initStream(str);
2611    streams = new Array(xref);
2612    streams->add(curStr.copy(&obj));
2613 @@ -57,9 +60,11 @@
2614    curStr.streamReset();
2615  }
2616  
2617 -Lexer::Lexer(XRef *xref, Object *obj) {
2618 +Lexer::Lexer(XRef *xrefA, Object *obj) {
2619    Object obj2;
2620  
2621 +  xref = xrefA;
2622 +
2623    if (obj->isStream()) {
2624      streams = new Array(xref);
2625      freeArray = gTrue;
2626 @@ -108,7 +113,7 @@
2627    return curStr.streamLookChar();
2628  }
2629  
2630 -Object *Lexer::getObj(Object *obj) {
2631 +Object *Lexer::getObj(Object *obj, int objNum) {
2632    char *p;
2633    int c, c2;
2634    GBool comment, neg, done;
2635 @@ -291,6 +296,17 @@
2636             s->append(tokBuf, tokBufSize);
2637           p = tokBuf;
2638           n = 0;
2639 +         
2640 +         // we are growing see if the document is not malformed and we are growing too much
2641 +         if (objNum != -1)
2642 +         {
2643 +           int newObjNum = xref->getNumEntry(getPos());
2644 +           if (newObjNum != objNum)
2645 +           {
2646 +             error(getPos(), "Unterminated string");
2647 +             done = gTrue;
2648 +           }
2649 +         }
2650         }
2651         *p++ = (char)c2;
2652         ++n;
2653 diff -Nur poppler.0_5_0/poppler/Lexer.h poppler.HEAD/poppler/Lexer.h
2654 --- poppler.0_5_0/poppler/Lexer.h       2005-08-31 17:28:46.000000000 +0200
2655 +++ poppler.HEAD/poppler/Lexer.h        2006-01-17 22:35:31.000000000 +0100
2656 @@ -29,17 +29,17 @@
2657  
2658    // Construct a lexer for a single stream.  Deletes the stream when
2659    // lexer is deleted.
2660 -  Lexer(XRef *xref, Stream *str);
2661 +  Lexer(XRef *xrefA, Stream *str);
2662  
2663    // Construct a lexer for a stream or array of streams (assumes obj
2664    // is either a stream or array of streams).
2665 -  Lexer(XRef *xref, Object *obj);
2666 +  Lexer(XRef *xrefA, Object *obj);
2667  
2668    // Destructor.
2669    ~Lexer();
2670  
2671    // Get the next object from the input stream.
2672 -  Object *getObj(Object *obj);
2673 +  Object *getObj(Object *obj, int objNum = -1);
2674  
2675    // Skip to the beginning of the next line in the input stream.
2676    void skipToNextLine();
2677 @@ -73,6 +73,8 @@
2678    Object curStr;               // current stream
2679    GBool freeArray;             // should lexer free the streams array?
2680    char tokBuf[tokBufSize];     // temporary token buffer
2681 +
2682 +  XRef *xref;
2683  };
2684  
2685  #endif
2686 diff -Nur poppler.0_5_0/poppler/Link.cc poppler.HEAD/poppler/Link.cc
2687 --- poppler.0_5_0/poppler/Link.cc       2005-09-20 16:34:31.000000000 +0200
2688 +++ poppler.HEAD/poppler/Link.cc        2006-01-18 23:32:13.000000000 +0100
2689 @@ -21,6 +21,7 @@
2690  #include "Array.h"
2691  #include "Dict.h"
2692  #include "Link.h"
2693 +#include "UGooString.h"
2694  
2695  //------------------------------------------------------------------------
2696  // LinkAction
2697 @@ -421,9 +422,9 @@
2698  
2699    // named destination
2700    if (destObj->isName()) {
2701 -    namedDest = new GooString(destObj->getName());
2702 +    namedDest = new UGooString(destObj->getName());
2703    } else if (destObj->isString()) {
2704 -    namedDest = destObj->getString()->copy();
2705 +    namedDest = new UGooString(*destObj->getString());
2706  
2707    // destination dictionary
2708    } else if (destObj->isArray()) {
2709 @@ -459,9 +460,9 @@
2710  
2711    // named destination
2712    if (destObj->isName()) {
2713 -    namedDest = new GooString(destObj->getName());
2714 +    namedDest = new UGooString(destObj->getName());
2715    } else if (destObj->isString()) {
2716 -    namedDest = destObj->getString()->copy();
2717 +    namedDest = new UGooString(*destObj->getString());
2718  
2719    // destination dictionary
2720    } else if (destObj->isArray()) {
2721 diff -Nur poppler.0_5_0/poppler/Link.h poppler.HEAD/poppler/Link.h
2722 --- poppler.0_5_0/poppler/Link.h        2005-03-03 20:46:01.000000000 +0100
2723 +++ poppler.HEAD/poppler/Link.h 2006-01-18 23:32:13.000000000 +0100
2724 @@ -16,6 +16,7 @@
2725  #include "Object.h"
2726  
2727  class GooString;
2728 +class UGooString;
2729  class Array;
2730  class Dict;
2731  
2732 @@ -134,13 +135,13 @@
2733    // Accessors.
2734    virtual LinkActionKind getKind() { return actionGoTo; }
2735    LinkDest *getDest() { return dest; }
2736 -  GooString *getNamedDest() { return namedDest; }
2737 +  UGooString *getNamedDest() { return namedDest; }
2738  
2739  private:
2740  
2741    LinkDest *dest;              // regular destination (NULL for remote
2742                                 //   link with bad destination)
2743 -  GooString *namedDest;                // named destination (only one of dest and
2744 +  UGooString *namedDest;       // named destination (only one of dest and
2745                                 //   and namedDest may be non-NULL)
2746  };
2747  
2748 @@ -165,14 +166,14 @@
2749    virtual LinkActionKind getKind() { return actionGoToR; }
2750    GooString *getFileName() { return fileName; }
2751    LinkDest *getDest() { return dest; }
2752 -  GooString *getNamedDest() { return namedDest; }
2753 +  UGooString *getNamedDest() { return namedDest; }
2754  
2755  private:
2756  
2757    GooString *fileName;         // file name
2758    LinkDest *dest;              // regular destination (NULL for remote
2759                                 //   link with bad destination)
2760 -  GooString *namedDest;                // named destination (only one of dest and
2761 +  UGooString *namedDest;       // named destination (only one of dest and
2762                                 //   and namedDest may be non-NULL)
2763  };
2764  
2765 diff -Nur poppler.0_5_0/poppler/Makefile.am poppler.HEAD/poppler/Makefile.am
2766 --- poppler.0_5_0/poppler/Makefile.am   2006-01-06 11:05:58.000000000 +0100
2767 +++ poppler.HEAD/poppler/Makefile.am    2006-02-16 20:28:54.000000000 +0100
2768 @@ -92,6 +92,8 @@
2769         $(zlib_libs)                            \
2770         $(FREETYPE_LIBS)
2771  
2772 +libpoppler_la_LDFLAGS = -version-info 1:0:0
2773 +
2774  if ENABLE_XPDF_HEADERS
2775  
2776  poppler_includedir = $(includedir)/poppler
2777 @@ -146,6 +148,7 @@
2778         PSOutputDev.h           \
2779         TextOutputDev.h         \
2780         SecurityHandler.h       \
2781 +       UGooString.h            \
2782         UTF8.h                  \
2783         XpdfPluginAPI.h         \
2784         poppler-config.h
2785 @@ -199,4 +202,5 @@
2786         PageLabelInfo.h         \
2787         PageLabelInfo.cc        \
2788         SecurityHandler.cc      \
2789 +       UGooString.cc           \
2790         XpdfPluginAPI.cc
2791 diff -Nur poppler.0_5_0/poppler/Object.h poppler.HEAD/poppler/Object.h
2792 --- poppler.0_5_0/poppler/Object.h      2005-03-03 20:46:01.000000000 +0100
2793 +++ poppler.HEAD/poppler/Object.h       2006-01-18 23:32:13.000000000 +0100
2794 @@ -23,6 +23,7 @@
2795  class Array;
2796  class Dict;
2797  class Stream;
2798 +class UGooString;
2799  
2800  //------------------------------------------------------------------------
2801  // Ref
2802 @@ -163,11 +164,11 @@
2803  
2804    // Dict accessors.
2805    int dictGetLength();
2806 -  void dictAdd(char *key, Object *val);
2807 +  void dictAdd(const UGooString &key, Object *val);
2808    GBool dictIs(char *dictType);
2809 -  Object *dictLookup(char *key, Object *obj);
2810 -  Object *dictLookupNF(char *key, Object *obj);
2811 -  char *dictGetKey(int i);
2812 +  Object *dictLookup(const UGooString &key, Object *obj);
2813 +  Object *dictLookupNF(const UGooString &key, Object *obj);
2814 +  UGooString *dictGetKey(int i);
2815    Object *dictGetVal(int i, Object *obj);
2816    Object *dictGetValNF(int i, Object *obj);
2817  
2818 @@ -238,7 +239,7 @@
2819  inline int Object::dictGetLength()
2820    { return dict->getLength(); }
2821  
2822 -inline void Object::dictAdd(char *key, Object *val)
2823 +inline void Object::dictAdd(const UGooString &key, Object *val)
2824    { dict->add(key, val); }
2825  
2826  inline GBool Object::dictIs(char *dictType)
2827 @@ -247,13 +248,13 @@
2828  inline GBool Object::isDict(char *dictType)
2829    { return type == objDict && dictIs(dictType); }
2830  
2831 -inline Object *Object::dictLookup(char *key, Object *obj)
2832 +inline Object *Object::dictLookup(const UGooString &key, Object *obj)
2833    { return dict->lookup(key, obj); }
2834  
2835 -inline Object *Object::dictLookupNF(char *key, Object *obj)
2836 +inline Object *Object::dictLookupNF(const UGooString &key, Object *obj)
2837    { return dict->lookupNF(key, obj); }
2838  
2839 -inline char *Object::dictGetKey(int i)
2840 +inline UGooString *Object::dictGetKey(int i)
2841    { return dict->getKey(i); }
2842  
2843  inline Object *Object::dictGetVal(int i, Object *obj)
2844 diff -Nur poppler.0_5_0/poppler/Outline.cc poppler.HEAD/poppler/Outline.cc
2845 --- poppler.0_5_0/poppler/Outline.cc    2005-09-15 14:32:25.000000000 +0200
2846 +++ poppler.HEAD/poppler/Outline.cc     2006-01-18 23:32:13.000000000 +0100
2847 @@ -18,6 +18,7 @@
2848  #include "Link.h"
2849  #include "PDFDocEncoding.h"
2850  #include "Outline.h"
2851 +#include "UGooString.h"
2852  
2853  //------------------------------------------------------------------------
2854  
2855 diff -Nur poppler.0_5_0/poppler/OutputDev.cc poppler.HEAD/poppler/OutputDev.cc
2856 --- poppler.0_5_0/poppler/OutputDev.cc  2005-10-30 21:29:05.000000000 +0100
2857 +++ poppler.HEAD/poppler/OutputDev.cc   2006-02-04 22:10:41.000000000 +0100
2858 @@ -121,6 +121,22 @@
2859    drawImage(state, ref, str, width, height, colorMap, NULL, gFalse);
2860  }
2861  
2862 +void OutputDev::endMarkedContent() {
2863 +}
2864 +
2865 +void OutputDev::beginMarkedContent(char *name) {
2866 +}
2867 +
2868 +void OutputDev::beginMarkedContent(char *name, Dict *properties) {
2869 +}
2870 +
2871 +void OutputDev::markPoint(char *name) {
2872 +}
2873 +
2874 +void OutputDev::markPoint(char *name, Dict *properties) {
2875 +}
2876 +
2877 +
2878  #if OPI_SUPPORT
2879  void OutputDev::opiBegin(GfxState *state, Dict *opiDict) {
2880  }
2881 diff -Nur poppler.0_5_0/poppler/OutputDev.h poppler.HEAD/poppler/OutputDev.h
2882 --- poppler.0_5_0/poppler/OutputDev.h   2005-11-01 16:29:32.000000000 +0100
2883 +++ poppler.HEAD/poppler/OutputDev.h    2006-02-04 22:10:41.000000000 +0100
2884 @@ -183,6 +183,16 @@
2885                                    int maskWidth, int maskHeight,
2886                                    GfxImageColorMap *maskColorMap);
2887  
2888 +  //----- grouping operators
2889 +
2890 +  virtual void endMarkedContent();
2891 +  virtual void beginMarkedContent(char *name);
2892 +  virtual void beginMarkedContent(char *name, Dict *properties);
2893 +  virtual void markPoint(char *name);
2894 +  virtual void markPoint(char *name, Dict *properties);
2895 +  
2896 +  
2897 +
2898  #if OPI_SUPPORT
2899    //----- OPI functions
2900    virtual void opiBegin(GfxState *state, Dict *opiDict);
2901 diff -Nur poppler.0_5_0/poppler/Page.cc poppler.HEAD/poppler/Page.cc
2902 --- poppler.0_5_0/poppler/Page.cc       2006-01-08 23:51:17.000000000 +0100
2903 +++ poppler.HEAD/poppler/Page.cc        2006-01-18 23:32:13.000000000 +0100
2904 @@ -29,6 +29,7 @@
2905  #endif
2906  #include "Error.h"
2907  #include "Page.h"
2908 +#include "UGooString.h"
2909  
2910  //------------------------------------------------------------------------
2911  // PageAttrs
2912 diff -Nur poppler.0_5_0/poppler/PageLabelInfo.cc poppler.HEAD/poppler/PageLabelInfo.cc
2913 --- poppler.0_5_0/poppler/PageLabelInfo.cc      2005-07-29 00:56:17.000000000 +0200
2914 +++ poppler.HEAD/poppler/PageLabelInfo.cc       2006-01-18 23:32:13.000000000 +0100
2915 @@ -2,6 +2,7 @@
2916  #include <stdlib.h>
2917  #include <stdio.h>
2918  #include <assert.h>
2919 +#include "UGooString.h"
2920  
2921  #include "PageLabelInfo.h"
2922  
2923 diff -Nur poppler.0_5_0/poppler/Parser.cc poppler.HEAD/poppler/Parser.cc
2924 --- poppler.0_5_0/poppler/Parser.cc     2005-09-20 17:27:31.000000000 +0200
2925 +++ poppler.HEAD/poppler/Parser.cc      2006-01-18 23:32:13.000000000 +0100
2926 @@ -20,6 +20,7 @@
2927  #include "XRef.h"
2928  #include "Error.h"
2929  #include "Decrypt.h"
2930 +#include "UGooString.h"
2931  
2932  Parser::Parser(XRef *xrefA, Lexer *lexerA) {
2933    xref = xrefA;
2934 @@ -68,7 +69,7 @@
2935  
2936    // dictionary or stream
2937    } else if (buf1.isCmd("<<")) {
2938 -    shift();
2939 +    shift(objNum);
2940      obj->initDict(xref);
2941      while (!buf1.isCmd(">>") && !buf1.isEOF()) {
2942        if (!buf1.isName()) {
2943 @@ -82,6 +83,7 @@
2944           break;
2945         }
2946         obj->dictAdd(key, getObj(&obj2, fileKey, keyLength, objNum, objGen));
2947 +       gfree(key);
2948        }
2949      }
2950      if (buf1.isEOF())
2951 @@ -192,7 +194,7 @@
2952    return str;
2953  }
2954  
2955 -void Parser::shift() {
2956 +void Parser::shift(int objNum) {
2957    if (inlineImg > 0) {
2958      if (inlineImg < 2) {
2959        ++inlineImg;
2960 @@ -210,5 +212,5 @@
2961    if (inlineImg > 0)           // don't buffer inline image data
2962      buf2.initNull();
2963    else
2964 -    lexer->getObj(&buf2);
2965 +    lexer->getObj(&buf2, objNum);
2966  }
2967 diff -Nur poppler.0_5_0/poppler/Parser.h poppler.HEAD/poppler/Parser.h
2968 --- poppler.0_5_0/poppler/Parser.h      2005-09-16 20:29:18.000000000 +0200
2969 +++ poppler.HEAD/poppler/Parser.h       2006-01-17 22:35:31.000000000 +0100
2970 @@ -47,7 +47,7 @@
2971    int inlineImg;               // set when inline image data is encountered
2972  
2973    Stream *makeStream(Object *dict);
2974 -  void shift();
2975 +  void shift(int objNum = -1);
2976  };
2977  
2978  #endif
2979 diff -Nur poppler.0_5_0/poppler/PDFDoc.cc poppler.HEAD/poppler/PDFDoc.cc
2980 --- poppler.0_5_0/poppler/PDFDoc.cc     2005-12-07 09:42:21.000000000 +0100
2981 +++ poppler.HEAD/poppler/PDFDoc.cc      2006-01-18 23:32:13.000000000 +0100
2982 @@ -38,6 +38,7 @@
2983  #include "Outline.h"
2984  #endif
2985  #include "PDFDoc.h"
2986 +#include "UGooString.h"
2987  
2988  //------------------------------------------------------------------------
2989  
2990 diff -Nur poppler.0_5_0/poppler/PDFDoc.h poppler.HEAD/poppler/PDFDoc.h
2991 --- poppler.0_5_0/poppler/PDFDoc.h      2005-10-30 21:29:05.000000000 +0100
2992 +++ poppler.HEAD/poppler/PDFDoc.h       2006-01-18 23:32:13.000000000 +0100
2993 @@ -123,7 +123,7 @@
2994  
2995    // Find a named destination.  Returns the link destination, or
2996    // NULL if <name> is not a destination.
2997 -  LinkDest *findDest(GooString *name)
2998 +  LinkDest *findDest(UGooString *name)
2999      { return catalog->findDest(name); }
3000  
3001  #ifndef DISABLE_OUTLINE
3002 diff -Nur poppler.0_5_0/poppler/poppler-config.h.in poppler.HEAD/poppler/poppler-config.h.in
3003 --- poppler.0_5_0/poppler/poppler-config.h.in   2005-10-17 04:17:52.000000000 +0200
3004 +++ poppler.HEAD/poppler/poppler-config.h.in    2006-01-23 19:52:48.000000000 +0100
3005 @@ -14,11 +14,6 @@
3006  // around #undef look odd, but it's to silence warnings about
3007  // redefining those symbols.
3008  
3009 -/* Use A4 paper size instead of Letter for PostScript output. */
3010 -#ifndef A4_PAPER
3011 -#undef A4_PAPER
3012 -#endif
3013 -
3014  /* Enable multithreading support. */
3015  #ifndef MULTITHREADING
3016  #undef MULTITHREADED
3017 diff -Nur poppler.0_5_0/poppler/PSOutputDev.cc poppler.HEAD/poppler/PSOutputDev.cc
3018 --- poppler.0_5_0/poppler/PSOutputDev.cc        2005-10-30 21:29:05.000000000 +0100
3019 +++ poppler.HEAD/poppler/PSOutputDev.cc 2006-02-13 23:38:44.000000000 +0100
3020 @@ -35,6 +35,7 @@
3021  #include "Stream.h"
3022  #include "Annot.h"
3023  #include "PSOutputDev.h"
3024 +#include "UGooString.h"
3025  
3026  #ifdef MACOS
3027  // needed for setting type/creator of MacOS files
3028 @@ -1039,6 +1040,7 @@
3029    fontFileNameSize = 64;
3030    fontFileNameLen = 0;
3031    fontFileNames = (GooString **)gmallocn(fontFileNameSize, sizeof(GooString *));
3032 +  psFileNames = (GooString **)gmallocn(fontFileNameSize, sizeof(GooString *));
3033    nextTrueTypeNum = 0;
3034    font16EncLen = 0;
3035    font16EncSize = 0;
3036 @@ -1123,6 +1125,13 @@
3037      }
3038      gfree(fontFileNames);
3039    }
3040 +  if (psFileNames) {
3041 +    for (i = 0; i < fontFileNameLen; ++i) {
3042 +      if (psFileNames[i])
3043 +        delete psFileNames[i];
3044 +    }
3045 +    gfree(psFileNames);
3046 +  }
3047    if (font16Enc) {
3048      for (i = 0; i < font16EncLen; ++i) {
3049        delete font16Enc[i].enc;
3050 @@ -1490,6 +1499,7 @@
3051    double w1, w2;
3052    double *fm;
3053    int i, j;
3054 +  DisplayFontParam *dfp;
3055  
3056    // check if font is already set up
3057    for (i = 0; i < fontIDLen; ++i) {
3058 @@ -1547,8 +1557,7 @@
3059    } else if (globalParams->getPSEmbedTrueType() &&
3060              font->getType() == fontTrueType &&
3061              font->getExtFontFile()) {
3062 -    psName = filterPSName(font->getName());
3063 -    setupExternalTrueTypeFont(font, psName);
3064 +    psName = setupExternalTrueTypeFont(font);
3065  
3066    // check for embedded CID PostScript font
3067    } else if (globalParams->getPSEmbedCIDPostScript() &&
3068 @@ -1570,6 +1579,12 @@
3069      psName = new GooString(type3Name);
3070      setupType3Font(font, psName, parentResDict);
3071  
3072 +  // check for external CID TrueType font file
3073 +  } else if (globalParams->getPSEmbedCIDTrueType() &&
3074 +            font->getType() == fontCIDType2 &&
3075 +            font->getExtFontFile()) {
3076 +    psName = setupExternalCIDTrueTypeFont(font, font->getExtFontFile());
3077 +
3078    // do 8-bit font substitution
3079    } else if (!font->isCIDFont()) {
3080      subst = gTrue;
3081 @@ -1651,6 +1666,14 @@
3082             font16Enc[font16EncLen].enc->getCString());
3083      }
3084  
3085 +  // try the display font for embedding
3086 +  } else if (globalParams->getPSEmbedCIDTrueType() &&
3087 +            ((GfxCIDFont *)font)->getCollection() &&
3088 +            (dfp = globalParams->
3089 +             getDisplayFont(font)) &&
3090 +            dfp->kind == displayFontTT) {
3091 +    psName = setupExternalCIDTrueTypeFont(font, dfp->tt.fileName, dfp->tt.faceIndex);
3092 +
3093    // give up - can't do anything with this font
3094    } else {
3095      error(-1, "Couldn't find a font to substitute for '%s' ('%s' character collection)",
3096 @@ -1860,8 +1883,12 @@
3097      fontFileNameSize += 64;
3098      fontFileNames = (GooString **)greallocn(fontFileNames,
3099                                           fontFileNameSize, sizeof(GooString *));
3100 +    psFileNames = (GooString **)greallocn(psFileNames,
3101 +                                      fontFileNameSize, sizeof(GooString *));
3102    }
3103 -  fontFileNames[fontFileNameLen++] = fileName->copy();
3104 +  fontFileNames[fontFileNameLen] = fileName->copy();
3105 +  psFileNames[fontFileNameLen] = psName->copy();
3106 +  fontFileNameLen++;
3107  
3108    // beginning comment
3109    writePSFmt("%%%%BeginResource: font %s\n", psName->getCString());
3110 @@ -1974,25 +2001,24 @@
3111    writePS("%%EndResource\n");
3112  }
3113  
3114 -void PSOutputDev::setupExternalTrueTypeFont(GfxFont *font, GooString *psName) {
3115 -  char unique[32];
3116 +GooString *PSOutputDev::setupExternalTrueTypeFont(GfxFont *font) {
3117    GooString *fileName;
3118    char *fontBuf;
3119    int fontLen;
3120    FoFiTrueType *ffTT;
3121    Gushort *codeToGID;
3122 +  GooString *psName;
3123    int i;
3124  
3125    // check if font is already embedded
3126    fileName = font->getExtFontFile();
3127    for (i = 0; i < fontFileNameLen; ++i) {
3128      if (!fontFileNames[i]->cmp(fileName)) {
3129 -      sprintf(unique, "_%d", nextTrueTypeNum++);
3130 -      psName->append(unique);
3131 -      break;
3132 +      return psFileNames[i]->copy();
3133      }
3134    }
3135  
3136 +  psName = filterPSName(font->getName());
3137    // add entry to fontFileNames list
3138    if (i == fontFileNameLen) {
3139      if (fontFileNameLen >= fontFileNameSize) {
3140 @@ -2000,9 +2026,14 @@
3141        fontFileNames =
3142         (GooString **)greallocn(fontFileNames,
3143                               fontFileNameSize, sizeof(GooString *));
3144 +      psFileNames =
3145 +       (GooString **)greallocn(psFileNames,
3146 +                            fontFileNameSize, sizeof(GooString *));
3147      }
3148    }
3149 -  fontFileNames[fontFileNameLen++] = fileName->copy();
3150 +  fontFileNames[fontFileNameLen] = fileName->copy();
3151 +  psFileNames[fontFileNameLen] = psName->copy();
3152 +  fontFileNameLen++;
3153  
3154    // beginning comment
3155    writePSFmt("%%%%BeginResource: font %s\n", psName->getCString());
3156 @@ -2025,6 +2056,82 @@
3157  
3158    // ending comment
3159    writePS("%%EndResource\n");
3160 +  return psName;
3161 +}
3162 +
3163 +GooString *PSOutputDev::setupExternalCIDTrueTypeFont(GfxFont *font, GooString *fileName, int faceIndex) {
3164 +//   char *fontBuf;
3165 +//   int fontLen;
3166 +  FoFiTrueType *ffTT;
3167 +  Gushort *codeToGID;
3168 +  GooString *psName;
3169 +  int i;
3170 +  GooString *myFileName;
3171 +
3172 +  myFileName = fileName->copy();
3173 +  if (faceIndex > 0) {
3174 +    char tmp[32];
3175 +    sprintf(tmp, ",%d", faceIndex);
3176 +    myFileName->append(tmp);
3177 +  }
3178 +  // check if font is already embedded
3179 +  for (i = 0; i < fontFileNameLen; ++i) {
3180 +    if (!fontFileNames[i]->cmp(myFileName)) {
3181 +      delete myFileName;
3182 +      return psFileNames[i]->copy();
3183 +    }
3184 +  }
3185 +
3186 +  psName = filterPSName(font->getName());
3187 +  // add entry to fontFileNames list
3188 +  if (i == fontFileNameLen) {
3189 +    if (fontFileNameLen >= fontFileNameSize) {
3190 +      fontFileNameSize += 64;
3191 +      fontFileNames =
3192 +       (GooString **)grealloc(fontFileNames,
3193 +                            fontFileNameSize * sizeof(GooString *));
3194 +      psFileNames =
3195 +       (GooString **)grealloc(psFileNames,
3196 +                            fontFileNameSize * sizeof(GooString *));
3197 +    }
3198 +  }
3199 +  fontFileNames[fontFileNameLen] = myFileName;
3200 +  psFileNames[fontFileNameLen] = psName->copy();
3201 +  fontFileNameLen++;
3202 +
3203 +  // beginning comment
3204 +  writePSFmt("%%%%BeginResource: font %s\n", psName->getCString());
3205 +  embFontList->append("%%+ font ");
3206 +  embFontList->append(psName->getCString());
3207 +  embFontList->append("\n");
3208 +
3209 +  // convert it to a CID type2 font
3210 +  if ((ffTT = FoFiTrueType::load(fileName->getCString(), faceIndex))) {
3211 +      int n = ((GfxCIDFont *)font)->getCIDToGIDLen();
3212 +      if (n) {
3213 +       codeToGID = (Gushort *)gmalloc(n * sizeof(Gushort));
3214 +       memcpy(codeToGID, ((GfxCIDFont *)font)->getCIDToGID(), n * sizeof(Gushort));
3215 +      } else {
3216 +       codeToGID = ((GfxCIDFont *)font)->getCodeToGIDMap(ffTT, &n);
3217 +      }
3218 +      if (globalParams->getPSLevel() >= psLevel3) {
3219 +       // Level 3: use a CID font
3220 +       ffTT->convertToCIDType2(psName->getCString(),
3221 +                               codeToGID, n, gTrue,
3222 +                               outputFunc, outputStream);
3223 +      } else {
3224 +       // otherwise: use a non-CID composite font
3225 +       ffTT->convertToType0(psName->getCString(),
3226 +                            codeToGID, n, gTrue,
3227 +                            outputFunc, outputStream);
3228 +      }
3229 +      gfree(codeToGID);
3230 +      delete ffTT;
3231 +  }
3232 +
3233 +  // ending comment
3234 +  writePS("%%EndResource\n");
3235 +  return psName;
3236  }
3237  
3238  void PSOutputDev::setupEmbeddedCIDType0Font(GfxFont *font, Ref *id,
3239 @@ -2188,7 +2295,9 @@
3240      t3Cacheable = gFalse;
3241      for (i = 0; i < charProcs->getLength(); ++i) {
3242        writePS("/");
3243 -      writePSName(charProcs->getKey(i));
3244 +      char *aux = charProcs->getKey(i)->getCString();
3245 +      writePSName(aux);
3246 +      delete[] aux;
3247        writePS(" {\n");
3248        gfx->display(charProcs->getVal(i, &charProc));
3249        charProc.free();
3250 diff -Nur poppler.0_5_0/poppler/PSOutputDev.h poppler.HEAD/poppler/PSOutputDev.h
3251 --- poppler.0_5_0/poppler/PSOutputDev.h 2005-10-30 21:29:05.000000000 +0100
3252 +++ poppler.HEAD/poppler/PSOutputDev.h  2006-02-13 23:38:44.000000000 +0100
3253 @@ -237,10 +237,11 @@
3254    void setupExternalType1Font(GooString *fileName, GooString *psName);
3255    void setupEmbeddedType1CFont(GfxFont *font, Ref *id, GooString *psName);
3256    void setupEmbeddedTrueTypeFont(GfxFont *font, Ref *id, GooString *psName);
3257 -  void setupExternalTrueTypeFont(GfxFont *font, GooString *psName);
3258 +  GooString *setupExternalTrueTypeFont(GfxFont *font);
3259    void setupEmbeddedCIDType0Font(GfxFont *font, Ref *id, GooString *psName);
3260    void setupEmbeddedCIDTrueTypeFont(GfxFont *font, Ref *id, GooString *psName,
3261                                     GBool needVerticalMetrics);
3262 +  GooString *setupExternalCIDTrueTypeFont(GfxFont *font, GooString *fileName, int faceIndex = 0);
3263    void setupType3Font(GfxFont *font, GooString *psName, Dict *parentResDict);
3264    void setupImages(Dict *resDict);
3265    void setupImage(Ref id, Stream *str);
3266 @@ -301,6 +302,7 @@
3267    int fontFileIDLen;           // number of entries in fontFileIDs array
3268    int fontFileIDSize;          // size of fontFileIDs array
3269    GooString **fontFileNames;   // list of names of all embedded external fonts
3270 +  GooString **psFileNames;     // list of names of all embedded external fonts
3271    int fontFileNameLen;         // number of entries in fontFileNames array
3272    int fontFileNameSize;                // size of fontFileNames array
3273    int nextTrueTypeNum;         // next unique number to append to a TrueType
3274 diff -Nur poppler.0_5_0/poppler/SecurityHandler.cc poppler.HEAD/poppler/SecurityHandler.cc
3275 --- poppler.0_5_0/poppler/SecurityHandler.cc    2005-09-16 20:29:18.000000000 +0200
3276 +++ poppler.HEAD/poppler/SecurityHandler.cc     2006-01-18 23:32:13.000000000 +0100
3277 @@ -26,6 +26,7 @@
3278  #  include "XpdfPluginAPI.h"
3279  #endif
3280  #include "SecurityHandler.h"
3281 +#include "UGooString.h"
3282  
3283  //------------------------------------------------------------------------
3284  // SecurityHandler
3285 diff -Nur poppler.0_5_0/poppler/SplashOutputDev.cc poppler.HEAD/poppler/SplashOutputDev.cc
3286 --- poppler.0_5_0/poppler/SplashOutputDev.cc    2005-10-30 21:29:05.000000000 +0100
3287 +++ poppler.HEAD/poppler/SplashOutputDev.cc     2006-02-05 16:46:10.000000000 +0100
3288 @@ -941,11 +941,13 @@
3289    GfxFontType fontType;
3290    SplashOutFontFileID *id;
3291    SplashFontFile *fontFile;
3292 +  SplashFontSrc *fontsrc;
3293    FoFiTrueType *ff;
3294    Ref embRef;
3295    Object refObj, strObj;
3296 -  GooString *tmpFileName, *fileName, *substName;
3297 -  FILE *tmpFile;
3298 +  GooString *fileName, *substName;
3299 +  char *tmpBuf;
3300 +  int tmpBufLen;
3301    Gushort *codeToGID;
3302    DisplayFontParam *dfp;
3303    CharCodeToUnicode *ctu;
3304 @@ -954,10 +956,12 @@
3305    char *name;
3306    Unicode uBuf[8];
3307    int c, substIdx, n, code, cmap;
3308 +  int faceIndex = 0;
3309  
3310    needFontUpdate = gFalse;
3311    font = NULL;
3312 -  tmpFileName = NULL;
3313 +  fileName = NULL;
3314 +  tmpBuf = NULL;
3315    substIdx = -1;
3316    dfp = NULL;
3317  
3318 @@ -978,22 +982,9 @@
3319  
3320      // if there is an embedded font, write it to disk
3321      if (gfxFont->getEmbeddedFontID(&embRef)) {
3322 -      if (!openTempFile(&tmpFileName, &tmpFile, "wb", NULL)) {
3323 -       error(-1, "Couldn't create temporary font file");
3324 +      tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
3325 +      if (! tmpBuf)
3326         goto err2;
3327 -      }
3328 -      refObj.initRef(embRef.num, embRef.gen);
3329 -      refObj.fetch(xref, &strObj);
3330 -      refObj.free();
3331 -      strObj.streamReset();
3332 -      while ((c = strObj.streamGetChar()) != EOF) {
3333 -       fputc(c, tmpFile);
3334 -      }
3335 -      strObj.streamClose();
3336 -      strObj.free();
3337 -      fclose(tmpFile);
3338 -      fileName = tmpFileName;
3339 -
3340      // if there is an external font file, use it
3341      } else if (!(fileName = gfxFont->getExtFontFile())) {
3342  
3343 @@ -1016,18 +1007,23 @@
3344        case displayFontTT:
3345         fileName = dfp->tt.fileName;
3346         fontType = gfxFont->isCIDFont() ? fontCIDType2 : fontTrueType;
3347 +       faceIndex = dfp->tt.faceIndex;
3348         break;
3349        }
3350      }
3351  
3352 +    fontsrc = new SplashFontSrc;
3353 +    if (fileName)
3354 +      fontsrc->setFile(fileName, gFalse);
3355 +    else
3356 +      fontsrc->setBuf(tmpBuf, tmpBufLen, gFalse);
3357 +
3358      // load the font file
3359      switch (fontType) {
3360      case fontType1:
3361 -      if (!(fontFile = fontEngine->loadType1Font(
3362 -                          id,
3363 -                          fileName->getCString(),
3364 -                          fileName == tmpFileName,
3365 -                          ((Gfx8BitFont *)gfxFont)->getEncoding()))) {
3366 +      fontFile = fontEngine->loadType1Font(id, fontsrc, 
3367 +                                          ((Gfx8BitFont *)gfxFont)->getEncoding());
3368 +      if (! fontFile) {
3369         error(-1, "Couldn't create a font for '%s'",
3370               gfxFont->getName() ? gfxFont->getName()->getCString()
3371                                  : "(unnamed)");
3372 @@ -1035,11 +1031,9 @@
3373        }
3374        break;
3375      case fontType1C:
3376 -      if (!(fontFile = fontEngine->loadType1CFont(
3377 -                          id,
3378 -                          fileName->getCString(),
3379 -                          fileName == tmpFileName,
3380 -                          ((Gfx8BitFont *)gfxFont)->getEncoding()))) {
3381 +      fontFile = fontEngine->loadType1CFont(id, fontsrc,
3382 +                                           ((Gfx8BitFont *)gfxFont)->getEncoding());
3383 +      if (! fontFile) {
3384         error(-1, "Couldn't create a font for '%s'",
3385               gfxFont->getName() ? gfxFont->getName()->getCString()
3386                                  : "(unnamed)");
3387 @@ -1047,7 +1041,11 @@
3388        }
3389        break;
3390      case fontTrueType:
3391 -      if ((ff = FoFiTrueType::load(fileName->getCString()))) {
3392 +       if (fileName)
3393 +        ff = FoFiTrueType::load(fileName->getCString());
3394 +       else
3395 +        ff = new FoFiTrueType(tmpBuf, tmpBufLen, gFalse);
3396 +       if (ff) {
3397        codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
3398         n = 256;
3399        delete ff;
3400 @@ -1057,8 +1055,7 @@
3401        }
3402        if (!(fontFile = fontEngine->loadTrueTypeFont(
3403                            id,
3404 -                          fileName->getCString(),
3405 -                          fileName == tmpFileName,
3406 +                          fontsrc,
3407                            codeToGID, n))) {
3408         error(-1, "Couldn't create a font for '%s'",
3409               gfxFont->getName() ? gfxFont->getName()->getCString()
3410 @@ -1068,10 +1065,8 @@
3411        break;
3412      case fontCIDType0:
3413      case fontCIDType0C:
3414 -      if (!(fontFile = fontEngine->loadCIDFont(
3415 -                          id,
3416 -                          fileName->getCString(),
3417 -                          fileName == tmpFileName))) {
3418 +      fontFile = fontEngine->loadCIDFont(id, fontsrc);
3419 +      if (! fontFile) {
3420         error(-1, "Couldn't create a font for '%s'",
3421               gfxFont->getName() ? gfxFont->getName()->getCString()
3422                                  : "(unnamed)");
3423 @@ -1084,7 +1079,11 @@
3424        if (dfp) {
3425         // create a CID-to-GID mapping, via Unicode
3426         if ((ctu = ((GfxCIDFont *)gfxFont)->getToUnicode())) {
3427 -         if ((ff = FoFiTrueType::load(fileName->getCString()))) {
3428 +               if (fileName)
3429 +                ff = FoFiTrueType::load(fileName->getCString());
3430 +               else
3431 +                ff = new FoFiTrueType(tmpBuf, tmpBufLen, gFalse);
3432 +               if (ff) {
3433             // look for a Unicode cmap
3434             for (cmap = 0; cmap < ff->getNumCmaps(); ++cmap) {
3435               if ((ff->getCmapPlatform(cmap) == 3 &&
3436 @@ -1116,16 +1115,28 @@
3437        } else {
3438         if (((GfxCIDFont *)gfxFont)->getCIDToGID()) {
3439        n = ((GfxCIDFont *)gfxFont)->getCIDToGIDLen();
3440 -         codeToGID = (Gushort *)gmallocn(n, sizeof(Gushort));
3441 -      memcpy(codeToGID, ((GfxCIDFont *)gfxFont)->getCIDToGID(),
3442 -            n * sizeof(Gushort));
3443 +       if (n) {
3444 +               codeToGID = (Gushort *)gmallocn(n, sizeof(Gushort));
3445 +               memcpy(codeToGID, ((GfxCIDFont *)gfxFont)->getCIDToGID(),
3446 +                       n * sizeof(Gushort));
3447 +       } else {
3448 +               if (fileName)
3449 +                ff = FoFiTrueType::load(fileName->getCString());
3450 +               else
3451 +                ff = new FoFiTrueType(tmpBuf, tmpBufLen, gFalse);
3452 +               if (! ff)
3453 +                goto err2;
3454 +               codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n);
3455 +               delete ff;
3456 +       }
3457         }
3458        }
3459        if (!(fontFile = fontEngine->loadTrueTypeFont(
3460                            id,
3461 -                          fileName->getCString(),
3462 -                          fileName == tmpFileName,
3463 -                          codeToGID, n))) {
3464 +                          fontsrc,
3465 +                          codeToGID,
3466 +                          n,
3467 +                          faceIndex))) {
3468         error(-1, "Couldn't create a font for '%s'",
3469               gfxFont->getName() ? gfxFont->getName()->getCString()
3470                                  : "(unnamed)");
3471 @@ -1153,17 +1164,11 @@
3472    }
3473    font = fontEngine->getFont(fontFile, mat);
3474  
3475 -  if (tmpFileName) {
3476 -    delete tmpFileName;
3477 -  }
3478    return;
3479  
3480   err2:
3481    delete id;
3482   err1:
3483 -  if (tmpFileName) {
3484 -    delete tmpFileName;
3485 -  }
3486    return;
3487  }
3488  
3489 diff -Nur poppler.0_5_0/poppler/Stream.cc poppler.HEAD/poppler/Stream.cc
3490 --- poppler.0_5_0/poppler/Stream.cc     2006-01-11 17:52:58.000000000 +0100
3491 +++ poppler.HEAD/poppler/Stream.cc      2006-01-18 23:32:13.000000000 +0100
3492 @@ -33,6 +33,7 @@
3493  #include "JBIG2Stream.h"
3494  #include "JPXStream.h"
3495  #include "Stream-CCITT.h"
3496 +#include "UGooString.h"
3497  
3498  #ifdef ENABLE_LIBJPEG
3499  #include "DCTStream.h"
3500 diff -Nur poppler.0_5_0/poppler/UGooString.cc poppler.HEAD/poppler/UGooString.cc
3501 --- poppler.0_5_0/poppler/UGooString.cc 1970-01-01 01:00:00.000000000 +0100
3502 +++ poppler.HEAD/poppler/UGooString.cc  2006-01-18 23:36:01.000000000 +0100
3503 @@ -0,0 +1,86 @@
3504 +//========================================================================
3505 +//
3506 +// UGooString.cc
3507 +//
3508 +// Unicode string
3509 +//
3510 +// Copyright 2005 Albert Astals Cid <aacid@kde.org>
3511 +//
3512 +//========================================================================
3513 +
3514 +#include <string.h>
3515 +
3516 +#include "goo/gmem.h"
3517 +#include "goo/GooString.h"
3518 +#include "PDFDocEncoding.h"
3519 +#include "UGooString.h"
3520 +
3521 +UGooString::UGooString(Unicode *u, int l)
3522 +{
3523 +  s = u;
3524 +  length = l;
3525 +}
3526 +
3527 +UGooString::UGooString(GooString &str)
3528 +{
3529 +  if ((str.getChar(0) & 0xff) == 0xfe && (str.getChar(1) & 0xff) == 0xff)
3530 +  {
3531 +    length = (str.getLength() - 2) / 2;
3532 +    s = (Unicode *)gmallocn(length, sizeof(Unicode));
3533 +    for (int j = 0; j < length; ++j) {
3534 +      s[j] = ((str.getChar(2 + 2*j) & 0xff) << 8) | (str.getChar(3 + 2*j) & 0xff);
3535 +    }
3536 +  } else
3537 +    initChar(str);
3538 +}
3539 +
3540 +UGooString::UGooString(const UGooString &str)
3541 +{
3542 +  length = str.length;
3543 +  s = (Unicode *)gmallocn(length, sizeof(Unicode));
3544 +  memcpy(s, str.s, length * sizeof(Unicode));
3545 +}
3546 +
3547 +UGooString::UGooString(const char *str)
3548 +{
3549 +  GooString aux(str);
3550 +  initChar(aux);
3551 +}
3552 +
3553 +void UGooString::initChar(GooString &str)
3554 +{
3555 +  length = str.getLength();
3556 +  s = (Unicode *)gmallocn(length, sizeof(Unicode));
3557 +  for (int j = 0; j < length; ++j) {
3558 +    s[j] = pdfDocEncoding[str.getChar(j) & 0xff];
3559 +  }
3560 +}
3561 +
3562 +UGooString::~UGooString()
3563 +{
3564 +  gfree(s);
3565 +}
3566 +
3567 +int UGooString::cmp(UGooString *str) const
3568 +{
3569 +  int n1, n2, i, x;
3570 +  Unicode *p1, *p2;
3571 +
3572 +  n1 = length;
3573 +  n2 = str->length;
3574 +  for (i = 0, p1 = s, p2 = str->s; i < n1 && i < n2; ++i, ++p1, ++p2) {
3575 +    x = *p1 - *p2;
3576 +    if (x != 0) {
3577 +      return x;
3578 +    }
3579 +  }
3580 +  return n1 - n2;
3581 +}
3582 +
3583 +char *UGooString::getCString() const
3584 +{
3585 +  char *res = new char[length + 1];
3586 +  for (int i = 0; i < length; i++) res[i] = s[i];
3587 +  res[length] = '\0';
3588 +  return res;
3589 +}
3590 diff -Nur poppler.0_5_0/poppler/UGooString.h poppler.HEAD/poppler/UGooString.h
3591 --- poppler.0_5_0/poppler/UGooString.h  1970-01-01 01:00:00.000000000 +0100
3592 +++ poppler.HEAD/poppler/UGooString.h   2006-01-18 23:36:01.000000000 +0100
3593 @@ -0,0 +1,55 @@
3594 +//========================================================================
3595 +//
3596 +// UGooString.h
3597 +//
3598 +// Unicode string
3599 +//
3600 +// Copyright 2005 Albert Astals Cid <aacid@kde.org>
3601 +//
3602 +//========================================================================
3603 +
3604 +#ifndef UGooString_H
3605 +#define UGooString_H
3606 +
3607 +#include "CharTypes.h"
3608 +
3609 +class GooString;
3610 +
3611 +class UGooString
3612 +{
3613 +public:
3614 +  // Create an unicode string
3615 +  UGooString(Unicode *u, int l);
3616 +
3617 +  // Create a unicode string from <str>.
3618 +  UGooString(GooString &str);
3619 +
3620 +  // Copy the unicode string
3621 +  UGooString(const UGooString &str);
3622 +
3623 +  // Create a unicode string from <str>.
3624 +  UGooString(const char *str);
3625 +
3626 +  // Destructor.
3627 +  ~UGooString();
3628 +
3629 +  // Get length.
3630 +  int getLength() const { return length; }
3631 +
3632 +  // Compare two strings:  -1:<  0:=  +1:>
3633 +  int cmp(UGooString *str) const;
3634 +
3635 +  // get the unicode
3636 +  Unicode *unicode() const { return s; }
3637 +
3638 +  // get the const char*
3639 +  char *getCString() const;
3640 +
3641 +private:
3642 +  void initChar(GooString &str);
3643 +
3644 +  int length;
3645 +  Unicode *s;
3646 +};
3647 +
3648 +#endif
3649 diff -Nur poppler.0_5_0/poppler/XRef.cc poppler.HEAD/poppler/XRef.cc
3650 --- poppler.0_5_0/poppler/XRef.cc       2005-09-20 16:59:43.000000000 +0200
3651 +++ poppler.HEAD/poppler/XRef.cc        2006-01-18 23:32:13.000000000 +0100
3652 @@ -24,6 +24,7 @@
3653  #include "Dict.h"
3654  #include "Error.h"
3655  #include "ErrorCodes.h"
3656 +#include "UGooString.h"
3657  #include "XRef.h"
3658  
3659  //------------------------------------------------------------------------
3660 @@ -934,6 +935,23 @@
3661    return gTrue;
3662  }
3663  
3664 +int XRef::getNumEntry(int offset) const
3665 +{
3666 +  int res = -1;
3667 +  int resOffset = -1;
3668 +  XRefEntry e;
3669 +  for (int i = 0; i < size; ++i)
3670 +  {
3671 +    e = entries[i];
3672 +    if (e.offset < offset && e.offset > resOffset)
3673 +    {
3674 +      res = i;
3675 +      resOffset = e.offset;
3676 +    }
3677 +  }
3678 +  return res;
3679 +}
3680 +
3681  Guint XRef::strToUnsigned(char *s) {
3682    Guint x;
3683    char *p;
3684 diff -Nur poppler.0_5_0/poppler/XRef.h poppler.HEAD/poppler/XRef.h
3685 --- poppler.0_5_0/poppler/XRef.h        2005-09-20 16:00:43.000000000 +0200
3686 +++ poppler.HEAD/poppler/XRef.h 2006-01-17 22:35:31.000000000 +0100
3687 @@ -94,6 +94,9 @@
3688    // Returns false if unknown or file is not damaged.
3689    GBool getStreamEnd(Guint streamStart, Guint *streamEnd);
3690  
3691 +  // Retuns the entry that belongs to the offset
3692 +  int getNumEntry(int offset) const;
3693 +
3694    // Direct access.
3695    int getSize() { return size; }
3696    XRefEntry *getEntry(int i) { return &entries[i]; }
3697 diff -Nur poppler.0_5_0/qt/Makefile.am poppler.HEAD/qt/Makefile.am
3698 --- poppler.0_5_0/qt/Makefile.am        2006-01-06 11:05:59.000000000 +0100
3699 +++ poppler.HEAD/qt/Makefile.am 2006-02-16 20:28:54.000000000 +0100
3700 @@ -25,6 +25,8 @@
3701         $(POPPLER_QT_LIBS)                      \
3702         $(FREETYPE_LIBS)
3703  
3704 +libpoppler_qt_la_LDFLAGS = -version-info 1:0:0
3705 +
3706  if BUILD_SPLASH_OUTPUT
3707  
3708  noinst_PROGRAMS = test-poppler-qt
3709 diff -Nur poppler.0_5_0/qt/poppler-document.cc poppler.HEAD/qt/poppler-document.cc
3710 --- poppler.0_5_0/qt/poppler-document.cc        2005-12-03 23:20:54.000000000 +0100
3711 +++ poppler.HEAD/qt/poppler-document.cc 2006-01-18 23:32:13.000000000 +0100
3712 @@ -24,6 +24,7 @@
3713  #include <Catalog.h>
3714  #include <ErrorCodes.h>
3715  #include <SplashOutputDev.h>
3716 +#include <UGooString.h>
3717  #include <splash/SplashBitmap.h>
3718  #include "poppler-private.h"
3719  
3720 diff -Nur poppler.0_5_0/qt/poppler-page.cc poppler.HEAD/qt/poppler-page.cc
3721 --- poppler.0_5_0/qt/poppler-page.cc    2006-01-06 11:05:59.000000000 +0100
3722 +++ poppler.HEAD/qt/poppler-page.cc     2006-01-10 22:57:28.000000000 +0100
3723 @@ -28,6 +28,7 @@
3724  #include <TextOutputDev.h>
3725  #include <splash/SplashBitmap.h>
3726  #include "poppler-private.h"
3727 +#include "poppler-page-transition-private.h"
3728  
3729  namespace Poppler {
3730  
3731 diff -Nur poppler.0_5_0/qt/poppler-page-transition.cc poppler.HEAD/qt/poppler-page-transition.cc
3732 --- poppler.0_5_0/qt/poppler-page-transition.cc 2006-01-06 11:05:59.000000000 +0100
3733 +++ poppler.HEAD/qt/poppler-page-transition.cc  2006-01-18 23:32:13.000000000 +0100
3734 @@ -18,8 +18,9 @@
3735  
3736  #include "Object.h"
3737  #include "Error.h"
3738 +#include "UGooString.h"
3739  #include "poppler-page-transition.h"
3740 -#include "poppler-private.h"
3741 +#include "poppler-page-transition-private.h"
3742  
3743  namespace Poppler {
3744  
3745 diff -Nur poppler.0_5_0/qt/poppler-page-transition.h poppler.HEAD/qt/poppler-page-transition.h
3746 --- poppler.0_5_0/qt/poppler-page-transition.h  2006-01-06 11:05:59.000000000 +0100
3747 +++ poppler.HEAD/qt/poppler-page-transition.h   2006-01-18 22:22:12.000000000 +0100
3748 @@ -25,8 +25,25 @@
3749  class PageTransitionParams;
3750  class PageTransitionData;
3751  
3752 +/**
3753 +   \brief Describes how a PDF file viewer shall perform the transition
3754 +   from one page to another
3755 +
3756 +   In PDF files there is a way to specify if the viewer shall use
3757 +   certain effects to perform the transition from one page to
3758 +   another. This feature can be used, e.g., in a PDF-based beamer
3759 +   presentation.
3760 +
3761 +   This utility class represents the transition effect, and can be
3762 +   used to extract the information from a PDF object.
3763 +*/
3764 +
3765 +
3766  class PageTransition {
3767   public:
3768 +
3769 +  /** \brief transition effect that shall be used
3770 +   */
3771    enum Type {
3772      Replace,
3773      Split,
3774 @@ -42,11 +59,15 @@
3775      Fade
3776    };
3777    
3778 +  /** \brief alignment of the transition effect that shall be used
3779 +   */
3780    enum Alignment {
3781      Horizontal,
3782      Vertical
3783    };
3784    
3785 +  /** \brief direction of the transition effect that shall be used
3786 +   */
3787    enum Direction {
3788      Inward,
3789      Outward
3790 @@ -54,17 +75,22 @@
3791    
3792    /** \brief Construct a new PageTransition object from a page dictionary.
3793  
3794 -  In case or error, this method will print an error message to stderr,
3795 +  Users of the library will rarely need to construct a
3796 +  PageTransition object themselves. Instead, the method
3797 +  Poppler::Page::transition() can be used to find out if a certain
3798 +  transition effect is specified.
3799 +
3800 +  @warning In case or error, this method will print an error message to stderr,
3801    and construct a default object.
3802  
3803 -  @param dictObj pointer to an object whose dictionary will be read
3804 -  and parsed. The pointer dictObj must point to a valid object, whose
3805 -  dictionaries are accessed by the constructor. The dictObj is only
3806 -  accessed by this constructor, and may be deleted after the
3807 -  constructor returns.
3808 +  @param params an object whose dictionary will be read and
3809 +   parsed. This must be a valid object, whose dictionaries are
3810 +   accessed by the constructor. The object is only accessed by this
3811 +   constructor, and may be deleted after the constructor returns.
3812    */
3813    PageTransition(const PageTransitionParams &params);
3814 -  
3815 +
3816 +  /** \brief copy constructor */
3817    PageTransition(const PageTransition &pt);
3818    
3819    /**
3820 diff -Nur poppler.0_5_0/qt/poppler-page-transition-private.h poppler.HEAD/qt/poppler-page-transition-private.h
3821 --- poppler.0_5_0/qt/poppler-page-transition-private.h  1970-01-01 01:00:00.000000000 +0100
3822 +++ poppler.HEAD/qt/poppler-page-transition-private.h   2006-01-17 21:33:08.000000000 +0100
3823 @@ -0,0 +1,28 @@
3824 +/*
3825 + * Copyright (C) 2005, Albert Astals Cid
3826 + *
3827 + * This program is free software; you can redistribute it and/or modify
3828 + * it under the terms of the GNU General Public License as published by
3829 + * the Free Software Foundation; either version 2, or (at your option)
3830 + * any later version.
3831 + *
3832 + * This program is distributed in the hope that it will be useful,
3833 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
3834 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
3835 + * GNU General Public License for more details.
3836 + *
3837 + * You should have received a copy of the GNU General Public License
3838 + * along with this program; if not, write to the Free Software
3839 + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
3840 + */
3841 +
3842 +class Object;
3843 +
3844 +namespace Poppler {
3845 +
3846 +class PageTransitionParams {
3847 +  public:
3848 +    Object *dictObj;
3849 +};
3850 +
3851 +}
3852 diff -Nur poppler.0_5_0/qt/poppler-private.h poppler.HEAD/qt/poppler-private.h
3853 --- poppler.0_5_0/qt/poppler-private.h  2006-01-06 11:05:59.000000000 +0100
3854 +++ poppler.HEAD/qt/poppler-private.h   2006-01-10 22:57:28.000000000 +0100
3855 @@ -53,9 +53,4 @@
3856    SplashOutputDev *m_outputDev;
3857  };
3858  
3859 -class PageTransitionParams {
3860 -  public:
3861 -    Object *dictObj;
3862 -};
3863 -
3864  }
3865 diff -Nur poppler.0_5_0/qt4/src/Doxyfile poppler.HEAD/qt4/src/Doxyfile
3866 --- poppler.0_5_0/qt4/src/Doxyfile      1970-01-01 01:00:00.000000000 +0100
3867 +++ poppler.HEAD/qt4/src/Doxyfile       2006-01-18 22:22:12.000000000 +0100
3868 @@ -0,0 +1,1212 @@
3869 +# Doxyfile 1.4.1
3870 +
3871 +# This file describes the settings to be used by the documentation system
3872 +# doxygen (www.doxygen.org) for a project
3873 +#
3874 +# All text after a hash (#) is considered a comment and will be ignored
3875 +# The format is:
3876 +#       TAG = value [value, ...]
3877 +# For lists items can also be appended using:
3878 +#       TAG += value [value, ...]
3879 +# Values that contain spaces should be placed between quotes (" ")
3880 +
3881 +#---------------------------------------------------------------------------
3882 +# Project related configuration options
3883 +#---------------------------------------------------------------------------
3884 +
3885 +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
3886 +# by quotes) that should identify the project.
3887 +
3888 +PROJECT_NAME           = 
3889 +
3890 +# The PROJECT_NUMBER tag can be used to enter a project or revision number. 
3891 +# This could be handy for archiving the generated documentation or 
3892 +# if some version control system is used.
3893 +
3894 +PROJECT_NUMBER         = 
3895 +
3896 +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
3897 +# base path where the generated documentation will be put. 
3898 +# If a relative path is entered, it will be relative to the location 
3899 +# where doxygen was started. If left blank the current directory will be used.
3900 +
3901 +OUTPUT_DIRECTORY       = 
3902 +
3903 +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 
3904 +# 4096 sub-directories (in 2 levels) under the output directory of each output 
3905 +# format and will distribute the generated files over these directories. 
3906 +# Enabling this option can be useful when feeding doxygen a huge amount of 
3907 +# source files, where putting all generated files in the same directory would 
3908 +# otherwise cause performance problems for the file system.
3909 +
3910 +CREATE_SUBDIRS         = NO
3911 +
3912 +# The OUTPUT_LANGUAGE tag is used to specify the language in which all 
3913 +# documentation generated by doxygen is written. Doxygen will use this 
3914 +# information to generate all constant output in the proper language. 
3915 +# The default language is English, other supported languages are: 
3916 +# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, 
3917 +# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese, 
3918 +# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian, 
3919 +# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, 
3920 +# Swedish, and Ukrainian.
3921 +
3922 +OUTPUT_LANGUAGE        = English
3923 +
3924 +# This tag can be used to specify the encoding used in the generated output. 
3925 +# The encoding is not always determined by the language that is chosen, 
3926 +# but also whether or not the output is meant for Windows or non-Windows users. 
3927 +# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES 
3928 +# forces the Windows encoding (this is the default for the Windows binary), 
3929 +# whereas setting the tag to NO uses a Unix-style encoding (the default for 
3930 +# all platforms other than Windows).
3931 +
3932 +USE_WINDOWS_ENCODING   = NO
3933 +
3934 +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 
3935 +# include brief member descriptions after the members that are listed in 
3936 +# the file and class documentation (similar to JavaDoc). 
3937 +# Set to NO to disable this.
3938 +
3939 +BRIEF_MEMBER_DESC      = YES
3940 +
3941 +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 
3942 +# the brief description of a member or function before the detailed description. 
3943 +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 
3944 +# brief descriptions will be completely suppressed.
3945 +
3946 +REPEAT_BRIEF           = YES
3947 +
3948 +# This tag implements a quasi-intelligent brief description abbreviator 
3949 +# that is used to form the text in various listings. Each string 
3950 +# in this list, if found as the leading text of the brief description, will be 
3951 +# stripped from the text and the result after processing the whole list, is 
3952 +# used as the annotated text. Otherwise, the brief description is used as-is. 
3953 +# If left blank, the following values are used ("$name" is automatically 
3954 +# replaced with the name of the entity): "The $name class" "The $name widget" 
3955 +# "The $name file" "is" "provides" "specifies" "contains" 
3956 +# "represents" "a" "an" "the"
3957 +
3958 +ABBREVIATE_BRIEF       = 
3959 +
3960 +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 
3961 +# Doxygen will generate a detailed section even if there is only a brief 
3962 +# description.
3963 +
3964 +ALWAYS_DETAILED_SEC    = NO
3965 +
3966 +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all 
3967 +# inherited members of a class in the documentation of that class as if those 
3968 +# members were ordinary class members. Constructors, destructors and assignment 
3969 +# operators of the base classes will not be shown.
3970 +
3971 +INLINE_INHERITED_MEMB  = NO
3972 +
3973 +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 
3974 +# path before files name in the file list and in the header files. If set 
3975 +# to NO the shortest path that makes the file name unique will be used.
3976 +
3977 +FULL_PATH_NAMES        = YES
3978 +
3979 +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 
3980 +# can be used to strip a user-defined part of the path. Stripping is 
3981 +# only done if one of the specified strings matches the left-hand part of 
3982 +# the path. The tag can be used to show relative paths in the file list. 
3983 +# If left blank the directory from which doxygen is run is used as the 
3984 +# path to strip.
3985 +
3986 +STRIP_FROM_PATH        = 
3987 +
3988 +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 
3989 +# the path mentioned in the documentation of a class, which tells 
3990 +# the reader which header file to include in order to use a class. 
3991 +# If left blank only the name of the header file containing the class 
3992 +# definition is used. Otherwise one should specify the include paths that 
3993 +# are normally passed to the compiler using the -I flag.
3994 +
3995 +STRIP_FROM_INC_PATH    = 
3996 +
3997 +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 
3998 +# (but less readable) file names. This can be useful is your file systems 
3999 +# doesn't support long names like on DOS, Mac, or CD-ROM.
4000 +
4001 +SHORT_NAMES            = NO
4002 +
4003 +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 
4004 +# will interpret the first line (until the first dot) of a JavaDoc-style 
4005 +# comment as the brief description. If set to NO, the JavaDoc 
4006 +# comments will behave just like the Qt-style comments (thus requiring an 
4007 +# explicit @brief command for a brief description.
4008 +
4009 +JAVADOC_AUTOBRIEF      = YES
4010 +
4011 +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen 
4012 +# treat a multi-line C++ special comment block (i.e. a block of //! or /// 
4013 +# comments) as a brief description. This used to be the default behaviour. 
4014 +# The new default is to treat a multi-line C++ comment block as a detailed 
4015 +# description. Set this tag to YES if you prefer the old behaviour instead.
4016 +
4017 +MULTILINE_CPP_IS_BRIEF = NO
4018 +
4019 +# If the DETAILS_AT_TOP tag is set to YES then Doxygen 
4020 +# will output the detailed description near the top, like JavaDoc.
4021 +# If set to NO, the detailed description appears after the member 
4022 +# documentation.
4023 +
4024 +DETAILS_AT_TOP         = NO
4025 +
4026 +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 
4027 +# member inherits the documentation from any documented member that it 
4028 +# re-implements.
4029 +
4030 +INHERIT_DOCS           = YES
4031 +
4032 +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 
4033 +# tag is set to YES, then doxygen will reuse the documentation of the first 
4034 +# member in the group (if any) for the other members of the group. By default 
4035 +# all members of a group must be documented explicitly.
4036 +
4037 +DISTRIBUTE_GROUP_DOC   = NO
4038 +
4039 +# The TAB_SIZE tag can be used to set the number of spaces in a tab. 
4040 +# Doxygen uses this value to replace tabs by spaces in code fragments.
4041 +
4042 +TAB_SIZE               = 8
4043 +
4044 +# This tag can be used to specify a number of aliases that acts 
4045 +# as commands in the documentation. An alias has the form "name=value". 
4046 +# For example adding "sideeffect=\par Side Effects:\n" will allow you to 
4047 +# put the command \sideeffect (or @sideeffect) in the documentation, which 
4048 +# will result in a user-defined paragraph with heading "Side Effects:". 
4049 +# You can put \n's in the value part of an alias to insert newlines.
4050 +
4051 +ALIASES                = 
4052 +
4053 +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C 
4054 +# sources only. Doxygen will then generate output that is more tailored for C. 
4055 +# For instance, some of the names that are used will be different. The list 
4056 +# of all members will be omitted, etc.
4057 +
4058 +OPTIMIZE_OUTPUT_FOR_C  = NO
4059 +
4060 +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources 
4061 +# only. Doxygen will then generate output that is more tailored for Java. 
4062 +# For instance, namespaces will be presented as packages, qualified scopes 
4063 +# will look different, etc.
4064 +
4065 +OPTIMIZE_OUTPUT_JAVA   = NO
4066 +
4067 +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of 
4068 +# the same type (for instance a group of public functions) to be put as a 
4069 +# subgroup of that type (e.g. under the Public Functions section). Set it to 
4070 +# NO to prevent subgrouping. Alternatively, this can be done per class using 
4071 +# the \nosubgrouping command.
4072 +
4073 +SUBGROUPING            = YES
4074 +
4075 +#---------------------------------------------------------------------------
4076 +# Build related configuration options
4077 +#---------------------------------------------------------------------------
4078 +
4079 +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 
4080 +# documentation are documented, even if no documentation was available. 
4081 +# Private class members and static file members will be hidden unless 
4082 +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
4083 +
4084 +EXTRACT_ALL            = NO
4085 +
4086 +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
4087 +# will be included in the documentation.
4088 +
4089 +EXTRACT_PRIVATE        = NO
4090 +
4091 +# If the EXTRACT_STATIC tag is set to YES all static members of a file 
4092 +# will be included in the documentation.
4093 +
4094 +EXTRACT_STATIC         = NO
4095 +
4096 +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 
4097 +# defined locally in source files will be included in the documentation. 
4098 +# If set to NO only classes defined in header files are included.
4099 +
4100 +EXTRACT_LOCAL_CLASSES  = YES
4101 +
4102 +# This flag is only useful for Objective-C code. When set to YES local 
4103 +# methods, which are defined in the implementation section but not in 
4104 +# the interface are included in the documentation. 
4105 +# If set to NO (the default) only methods in the interface are included.
4106 +
4107 +EXTRACT_LOCAL_METHODS  = NO
4108 +
4109 +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 
4110 +# undocumented members of documented classes, files or namespaces. 
4111 +# If set to NO (the default) these members will be included in the 
4112 +# various overviews, but no documentation section is generated. 
4113 +# This option has no effect if EXTRACT_ALL is enabled.
4114 +
4115 +HIDE_UNDOC_MEMBERS     = NO
4116 +
4117 +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 
4118 +# undocumented classes that are normally visible in the class hierarchy. 
4119 +# If set to NO (the default) these classes will be included in the various 
4120 +# overviews. This option has no effect if EXTRACT_ALL is enabled.
4121 +
4122 +HIDE_UNDOC_CLASSES     = NO
4123 +
4124 +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all 
4125 +# friend (class|struct|union) declarations. 
4126 +# If set to NO (the default) these declarations will be included in the 
4127 +# documentation.
4128 +
4129 +HIDE_FRIEND_COMPOUNDS  = NO
4130 +
4131 +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any 
4132 +# documentation blocks found inside the body of a function. 
4133 +# If set to NO (the default) these blocks will be appended to the 
4134 +# function's detailed documentation block.
4135 +
4136 +HIDE_IN_BODY_DOCS      = NO
4137 +
4138 +# The INTERNAL_DOCS tag determines if documentation 
4139 +# that is typed after a \internal command is included. If the tag is set 
4140 +# to NO (the default) then the documentation will be excluded. 
4141 +# Set it to YES to include the internal documentation.
4142 +
4143 +INTERNAL_DOCS          = NO
4144 +
4145 +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 
4146 +# file names in lower-case letters. If set to YES upper-case letters are also 
4147 +# allowed. This is useful if you have classes or files whose names only differ 
4148 +# in case and if your file system supports case sensitive file names. Windows 
4149 +# and Mac users are advised to set this option to NO.
4150 +
4151 +CASE_SENSE_NAMES       = YES
4152 +
4153 +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 
4154 +# will show members with their full class and namespace scopes in the 
4155 +# documentation. If set to YES the scope will be hidden.
4156 +
4157 +HIDE_SCOPE_NAMES       = NO
4158 +
4159 +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 
4160 +# will put a list of the files that are included by a file in the documentation 
4161 +# of that file.
4162 +
4163 +SHOW_INCLUDE_FILES     = YES
4164 +
4165 +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 
4166 +# is inserted in the documentation for inline members.
4167 +
4168 +INLINE_INFO            = YES
4169 +
4170 +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 
4171 +# will sort the (detailed) documentation of file and class members 
4172 +# alphabetically by member name. If set to NO the members will appear in 
4173 +# declaration order.
4174 +
4175 +SORT_MEMBER_DOCS       = YES
4176 +
4177 +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 
4178 +# brief documentation of file, namespace and class members alphabetically 
4179 +# by member name. If set to NO (the default) the members will appear in 
4180 +# declaration order.
4181 +
4182 +SORT_BRIEF_DOCS        = NO
4183 +
4184 +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be 
4185 +# sorted by fully-qualified names, including namespaces. If set to 
4186 +# NO (the default), the class list will be sorted only by class name, 
4187 +# not including the namespace part. 
4188 +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
4189 +# Note: This option applies only to the class list, not to the 
4190 +# alphabetical list.
4191 +
4192 +SORT_BY_SCOPE_NAME     = NO
4193 +
4194 +# The GENERATE_TODOLIST tag can be used to enable (YES) or 
4195 +# disable (NO) the todo list. This list is created by putting \todo 
4196 +# commands in the documentation.
4197 +
4198 +GENERATE_TODOLIST      = YES
4199 +
4200 +# The GENERATE_TESTLIST tag can be used to enable (YES) or 
4201 +# disable (NO) the test list. This list is created by putting \test 
4202 +# commands in the documentation.
4203 +
4204 +GENERATE_TESTLIST      = YES
4205 +
4206 +# The GENERATE_BUGLIST tag can be used to enable (YES) or 
4207 +# disable (NO) the bug list. This list is created by putting \bug 
4208 +# commands in the documentation.
4209 +
4210 +GENERATE_BUGLIST       = YES
4211 +
4212 +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or 
4213 +# disable (NO) the deprecated list. This list is created by putting 
4214 +# \deprecated commands in the documentation.
4215 +
4216 +GENERATE_DEPRECATEDLIST= YES
4217 +
4218 +# The ENABLED_SECTIONS tag can be used to enable conditional 
4219 +# documentation sections, marked by \if sectionname ... \endif.
4220 +
4221 +ENABLED_SECTIONS       = 
4222 +
4223 +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines 
4224 +# the initial value of a variable or define consists of for it to appear in 
4225 +# the documentation. If the initializer consists of more lines than specified 
4226 +# here it will be hidden. Use a value of 0 to hide initializers completely. 
4227 +# The appearance of the initializer of individual variables and defines in the 
4228 +# documentation can be controlled using \showinitializer or \hideinitializer 
4229 +# command in the documentation regardless of this setting.
4230 +
4231 +MAX_INITIALIZER_LINES  = 30
4232 +
4233 +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated 
4234 +# at the bottom of the documentation of classes and structs. If set to YES the 
4235 +# list will mention the files that were used to generate the documentation.
4236 +
4237 +SHOW_USED_FILES        = YES
4238 +
4239 +# If the sources in your project are distributed over multiple directories 
4240 +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy 
4241 +# in the documentation.
4242 +
4243 +SHOW_DIRECTORIES       = YES
4244 +
4245 +# The FILE_VERSION_FILTER tag can be used to specify a program or script that 
4246 +# doxygen should invoke to get the current version for each file (typically from the 
4247 +# version control system). Doxygen will invoke the program by executing (via 
4248 +# popen()) the command <command> <input-file>, where <command> is the value of 
4249 +# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file 
4250 +# provided by doxygen. Whatever the progam writes to standard output 
4251 +# is used as the file version. See the manual for examples.
4252 +
4253 +FILE_VERSION_FILTER    = 
4254 +
4255 +#---------------------------------------------------------------------------
4256 +# configuration options related to warning and progress messages
4257 +#---------------------------------------------------------------------------
4258 +
4259 +# The QUIET tag can be used to turn on/off the messages that are generated 
4260 +# by doxygen. Possible values are YES and NO. If left blank NO is used.
4261 +
4262 +QUIET                  = NO
4263 +
4264 +# The WARNINGS tag can be used to turn on/off the warning messages that are 
4265 +# generated by doxygen. Possible values are YES and NO. If left blank 
4266 +# NO is used.
4267 +
4268 +WARNINGS               = YES
4269 +
4270 +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 
4271 +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will 
4272 +# automatically be disabled.
4273 +
4274 +WARN_IF_UNDOCUMENTED   = YES
4275 +
4276 +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 
4277 +# potential errors in the documentation, such as not documenting some 
4278 +# parameters in a documented function, or documenting parameters that 
4279 +# don't exist or using markup commands wrongly.
4280 +
4281 +WARN_IF_DOC_ERROR      = YES
4282 +
4283 +# This WARN_NO_PARAMDOC option can be abled to get warnings for 
4284 +# functions that are documented, but have no documentation for their parameters 
4285 +# or return value. If set to NO (the default) doxygen will only warn about 
4286 +# wrong or incomplete parameter documentation, but not about the absence of 
4287 +# documentation.
4288 +
4289 +WARN_NO_PARAMDOC       = NO
4290 +
4291 +# The WARN_FORMAT tag determines the format of the warning messages that 
4292 +# doxygen can produce. The string should contain the $file, $line, and $text 
4293 +# tags, which will be replaced by the file and line number from which the 
4294 +# warning originated and the warning text. Optionally the format may contain 
4295 +# $version, which will be replaced by the version of the file (if it could 
4296 +# be obtained via FILE_VERSION_FILTER)
4297 +
4298 +WARN_FORMAT            = "$file:$line: $text"
4299 +
4300 +# The WARN_LOGFILE tag can be used to specify a file to which warning 
4301 +# and error messages should be written. If left blank the output is written 
4302 +# to stderr.
4303 +
4304 +WARN_LOGFILE           = 
4305 +
4306 +#---------------------------------------------------------------------------
4307 +# configuration options related to the input files
4308 +#---------------------------------------------------------------------------
4309 +
4310 +# The INPUT tag can be used to specify the files and/or directories that contain 
4311 +# documented source files. You may enter file names like "myfile.cpp" or 
4312 +# directories like "/usr/src/myproject". Separate the files or directories 
4313 +# with spaces.
4314 +
4315 +INPUT                  = . ../../qt/poppler-page-transition.h
4316 +
4317 +# If the value of the INPUT tag contains directories, you can use the 
4318 +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
4319 +# and *.h) to filter out the source-files in the directories. If left 
4320 +# blank the following patterns are tested: 
4321 +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx 
4322 +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm
4323 +
4324 +FILE_PATTERNS          = 
4325 +
4326 +# The RECURSIVE tag can be used to turn specify whether or not subdirectories 
4327 +# should be searched for input files as well. Possible values are YES and NO. 
4328 +# If left blank NO is used.
4329 +
4330 +RECURSIVE              = NO
4331 +
4332 +# The EXCLUDE tag can be used to specify files and/or directories that should 
4333 +# excluded from the INPUT source files. This way you can easily exclude a 
4334 +# subdirectory from a directory tree whose root is specified with the INPUT tag.
4335 +
4336 +EXCLUDE                = 
4337 +
4338 +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or 
4339 +# directories that are symbolic links (a Unix filesystem feature) are excluded 
4340 +# from the input.
4341 +
4342 +EXCLUDE_SYMLINKS       = NO
4343 +
4344 +# If the value of the INPUT tag contains directories, you can use the 
4345 +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 
4346 +# certain files from those directories.
4347 +
4348 +EXCLUDE_PATTERNS       = 
4349 +
4350 +# The EXAMPLE_PATH tag can be used to specify one or more files or 
4351 +# directories that contain example code fragments that are included (see 
4352 +# the \include command).
4353 +
4354 +EXAMPLE_PATH           = 
4355 +
4356 +# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
4357 +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
4358 +# and *.h) to filter out the source-files in the directories. If left 
4359 +# blank all files are included.
4360 +
4361 +EXAMPLE_PATTERNS       = 
4362 +
4363 +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 
4364 +# searched for input files to be used with the \include or \dontinclude 
4365 +# commands irrespective of the value of the RECURSIVE tag. 
4366 +# Possible values are YES and NO. If left blank NO is used.
4367 +
4368 +EXAMPLE_RECURSIVE      = NO
4369 +
4370 +# The IMAGE_PATH tag can be used to specify one or more files or 
4371 +# directories that contain image that are included in the documentation (see 
4372 +# the \image command).
4373 +
4374 +IMAGE_PATH             = 
4375 +
4376 +# The INPUT_FILTER tag can be used to specify a program that doxygen should 
4377 +# invoke to filter for each input file. Doxygen will invoke the filter program 
4378 +# by executing (via popen()) the command <filter> <input-file>, where <filter> 
4379 +# is the value of the INPUT_FILTER tag, and <input-file> is the name of an 
4380 +# input file. Doxygen will then use the output that the filter program writes 
4381 +# to standard output.  If FILTER_PATTERNS is specified, this tag will be 
4382 +# ignored.
4383 +
4384 +INPUT_FILTER           = 
4385 +
4386 +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 
4387 +# basis.  Doxygen will compare the file name with each pattern and apply the 
4388 +# filter if there is a match.  The filters are a list of the form: 
4389 +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 
4390 +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER 
4391 +# is applied to all files.
4392 +
4393 +FILTER_PATTERNS        = 
4394 +
4395 +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 
4396 +# INPUT_FILTER) will be used to filter the input files when producing source 
4397 +# files to browse (i.e. when SOURCE_BROWSER is set to YES).
4398 +
4399 +FILTER_SOURCE_FILES    = NO
4400 +
4401 +#---------------------------------------------------------------------------
4402 +# configuration options related to source browsing
4403 +#---------------------------------------------------------------------------
4404 +
4405 +# If the SOURCE_BROWSER tag is set to YES then a list of source files will 
4406 +# be generated. Documented entities will be cross-referenced with these sources. 
4407 +# Note: To get rid of all source code in the generated output, make sure also 
4408 +# VERBATIM_HEADERS is set to NO.
4409 +
4410 +SOURCE_BROWSER         = NO
4411 +
4412 +# Setting the INLINE_SOURCES tag to YES will include the body 
4413 +# of functions and classes directly in the documentation.
4414 +
4415 +INLINE_SOURCES         = NO
4416 +
4417 +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 
4418 +# doxygen to hide any special comment blocks from generated source code 
4419 +# fragments. Normal C and C++ comments will always remain visible.
4420 +
4421 +STRIP_CODE_COMMENTS    = YES
4422 +
4423 +# If the REFERENCED_BY_RELATION tag is set to YES (the default) 
4424 +# then for each documented function all documented 
4425 +# functions referencing it will be listed.
4426 +
4427 +REFERENCED_BY_RELATION = YES
4428 +
4429 +# If the REFERENCES_RELATION tag is set to YES (the default) 
4430 +# then for each documented function all documented entities 
4431 +# called/used by that function will be listed.
4432 +
4433 +REFERENCES_RELATION    = YES
4434 +
4435 +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 
4436 +# will generate a verbatim copy of the header file for each class for 
4437 +# which an include is specified. Set to NO to disable this.
4438 +
4439 +VERBATIM_HEADERS       = YES
4440 +
4441 +#---------------------------------------------------------------------------
4442 +# configuration options related to the alphabetical class index
4443 +#---------------------------------------------------------------------------
4444 +
4445 +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 
4446 +# of all compounds will be generated. Enable this if the project 
4447 +# contains a lot of classes, structs, unions or interfaces.
4448 +
4449 +ALPHABETICAL_INDEX     = NO
4450 +
4451 +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 
4452 +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 
4453 +# in which this list will be split (can be a number in the range [1..20])
4454 +
4455 +COLS_IN_ALPHA_INDEX    = 5
4456 +
4457 +# In case all classes in a project start with a common prefix, all 
4458 +# classes will be put under the same header in the alphabetical index. 
4459 +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that 
4460 +# should be ignored while generating the index headers.
4461 +
4462 +IGNORE_PREFIX          = 
4463 +
4464 +#---------------------------------------------------------------------------
4465 +# configuration options related to the HTML output
4466 +#---------------------------------------------------------------------------
4467 +
4468 +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will 
4469 +# generate HTML output.
4470 +
4471 +GENERATE_HTML          = YES
4472 +
4473 +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 
4474 +# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
4475 +# put in front of it. If left blank `html' will be used as the default path.
4476 +
4477 +HTML_OUTPUT            = APIDOCS-html
4478 +
4479 +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for 
4480 +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank 
4481 +# doxygen will generate files with .html extension.
4482 +
4483 +HTML_FILE_EXTENSION    = .html
4484 +
4485 +# The HTML_HEADER tag can be used to specify a personal HTML header for 
4486 +# each generated HTML page. If it is left blank doxygen will generate a 
4487 +# standard header.
4488 +
4489 +HTML_HEADER            = 
4490 +
4491 +# The HTML_FOOTER tag can be used to specify a personal HTML footer for 
4492 +# each generated HTML page. If it is left blank doxygen will generate a 
4493 +# standard footer.
4494 +
4495 +HTML_FOOTER            = 
4496 +
4497 +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading 
4498 +# style sheet that is used by each HTML page. It can be used to 
4499 +# fine-tune the look of the HTML output. If the tag is left blank doxygen 
4500 +# will generate a default style sheet. Note that doxygen will try to copy 
4501 +# the style sheet file to the HTML output directory, so don't put your own 
4502 +# stylesheet in the HTML output directory as well, or it will be erased!
4503 +
4504 +HTML_STYLESHEET        = 
4505 +
4506 +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 
4507 +# files or namespaces will be aligned in HTML using tables. If set to 
4508 +# NO a bullet list will be used.
4509 +
4510 +HTML_ALIGN_MEMBERS     = YES
4511 +
4512 +# If the GENERATE_HTMLHELP tag is set to YES, additional index files 
4513 +# will be generated that can be used as input for tools like the 
4514 +# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) 
4515 +# of the generated HTML documentation.
4516 +
4517 +GENERATE_HTMLHELP      = NO
4518 +
4519 +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 
4520 +# be used to specify the file name of the resulting .chm file. You 
4521 +# can add a path in front of the file if the result should not be 
4522 +# written to the html output directory.
4523 +
4524 +CHM_FILE               = 
4525 +
4526 +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can 
4527 +# be used to specify the location (absolute path including file name) of 
4528 +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run 
4529 +# the HTML help compiler on the generated index.hhp.
4530 +
4531 +HHC_LOCATION           = 
4532 +
4533 +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 
4534 +# controls if a separate .chi index file is generated (YES) or that 
4535 +# it should be included in the master .chm file (NO).
4536 +
4537 +GENERATE_CHI           = NO
4538 +
4539 +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 
4540 +# controls whether a binary table of contents is generated (YES) or a 
4541 +# normal table of contents (NO) in the .chm file.
4542 +
4543 +BINARY_TOC             = NO
4544 +
4545 +# The TOC_EXPAND flag can be set to YES to add extra items for group members 
4546 +# to the contents of the HTML help documentation and to the tree view.
4547 +
4548 +TOC_EXPAND             = NO
4549 +
4550 +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at 
4551 +# top of each HTML page. The value NO (the default) enables the index and 
4552 +# the value YES disables it.
4553 +
4554 +DISABLE_INDEX          = NO
4555 +
4556 +# This tag can be used to set the number of enum values (range [1..20]) 
4557 +# that doxygen will group on one line in the generated HTML documentation.
4558 +
4559 +ENUM_VALUES_PER_LINE   = 4
4560 +
4561 +# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
4562 +# generated containing a tree-like index structure (just like the one that 
4563 +# is generated for HTML Help). For this to work a browser that supports 
4564 +# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, 
4565 +# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are 
4566 +# probably better off using the HTML help feature.
4567 +
4568 +GENERATE_TREEVIEW      = NO
4569 +
4570 +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 
4571 +# used to set the initial width (in pixels) of the frame in which the tree 
4572 +# is shown.
4573 +
4574 +TREEVIEW_WIDTH         = 250
4575 +
4576 +#---------------------------------------------------------------------------
4577 +# configuration options related to the LaTeX output
4578 +#---------------------------------------------------------------------------
4579 +
4580 +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 
4581 +# generate Latex output.
4582 +
4583 +GENERATE_LATEX         = YES
4584 +
4585 +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 
4586 +# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
4587 +# put in front of it. If left blank `latex' will be used as the default path.
4588 +
4589 +LATEX_OUTPUT           = APIDOCS-latex
4590 +
4591 +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 
4592 +# invoked. If left blank `latex' will be used as the default command name.
4593 +
4594 +LATEX_CMD_NAME         = latex
4595 +
4596 +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 
4597 +# generate index for LaTeX. If left blank `makeindex' will be used as the 
4598 +# default command name.
4599 +
4600 +MAKEINDEX_CMD_NAME     = makeindex
4601 +
4602 +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 
4603 +# LaTeX documents. This may be useful for small projects and may help to 
4604 +# save some trees in general.
4605 +
4606 +COMPACT_LATEX          = NO
4607 +
4608 +# The PAPER_TYPE tag can be used to set the paper type that is used 
4609 +# by the printer. Possible values are: a4, a4wide, letter, legal and 
4610 +# executive. If left blank a4wide will be used.
4611 +
4612 +PAPER_TYPE             = a4wide
4613 +
4614 +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 
4615 +# packages that should be included in the LaTeX output.
4616 +
4617 +EXTRA_PACKAGES         = 
4618 +
4619 +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for 
4620 +# the generated latex document. The header should contain everything until 
4621 +# the first chapter. If it is left blank doxygen will generate a 
4622 +# standard header. Notice: only use this tag if you know what you are doing!
4623 +
4624 +LATEX_HEADER           = 
4625 +
4626 +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 
4627 +# is prepared for conversion to pdf (using ps2pdf). The pdf file will 
4628 +# contain links (just like the HTML output) instead of page references 
4629 +# This makes the output suitable for online browsing using a pdf viewer.
4630 +
4631 +PDF_HYPERLINKS         = NO
4632 +
4633 +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 
4634 +# plain latex in the generated Makefile. Set this option to YES to get a 
4635 +# higher quality PDF documentation.
4636 +
4637 +USE_PDFLATEX           = NO
4638 +
4639 +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 
4640 +# command to the generated LaTeX files. This will instruct LaTeX to keep 
4641 +# running if errors occur, instead of asking the user for help. 
4642 +# This option is also used when generating formulas in HTML.
4643 +
4644 +LATEX_BATCHMODE        = NO
4645 +
4646 +# If LATEX_HIDE_INDICES is set to YES then doxygen will not 
4647 +# include the index chapters (such as File Index, Compound Index, etc.) 
4648 +# in the output.
4649 +
4650 +LATEX_HIDE_INDICES     = NO
4651 +
4652 +#---------------------------------------------------------------------------
4653 +# configuration options related to the RTF output
4654 +#---------------------------------------------------------------------------
4655 +
4656 +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 
4657 +# The RTF output is optimized for Word 97 and may not look very pretty with 
4658 +# other RTF readers or editors.
4659 +
4660 +GENERATE_RTF           = NO
4661 +
4662 +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 
4663 +# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
4664 +# put in front of it. If left blank `rtf' will be used as the default path.
4665 +
4666 +RTF_OUTPUT             = rtf
4667 +
4668 +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact 
4669 +# RTF documents. This may be useful for small projects and may help to 
4670 +# save some trees in general.
4671 +
4672 +COMPACT_RTF            = NO
4673 +
4674 +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 
4675 +# will contain hyperlink fields. The RTF file will 
4676 +# contain links (just like the HTML output) instead of page references. 
4677 +# This makes the output suitable for online browsing using WORD or other 
4678 +# programs which support those fields. 
4679 +# Note: wordpad (write) and others do not support links.
4680 +
4681 +RTF_HYPERLINKS         = NO
4682 +
4683 +# Load stylesheet definitions from file. Syntax is similar to doxygen's 
4684 +# config file, i.e. a series of assignments. You only have to provide 
4685 +# replacements, missing definitions are set to their default value.
4686 +
4687 +RTF_STYLESHEET_FILE    = 
4688 +
4689 +# Set optional variables used in the generation of an rtf document. 
4690 +# Syntax is similar to doxygen's config file.
4691 +
4692 +RTF_EXTENSIONS_FILE    = 
4693 +
4694 +#---------------------------------------------------------------------------
4695 +# configuration options related to the man page output
4696 +#---------------------------------------------------------------------------
4697 +
4698 +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will 
4699 +# generate man pages
4700 +
4701 +GENERATE_MAN           = NO
4702 +
4703 +# The MAN_OUTPUT tag is used to specify where the man pages will be put. 
4704 +# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
4705 +# put in front of it. If left blank `man' will be used as the default path.
4706 +
4707 +MAN_OUTPUT             = man
4708 +
4709 +# The MAN_EXTENSION tag determines the extension that is added to 
4710 +# the generated man pages (default is the subroutine's section .3)
4711 +
4712 +MAN_EXTENSION          = .3
4713 +
4714 +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, 
4715 +# then it will generate one additional man file for each entity 
4716 +# documented in the real man page(s). These additional files 
4717 +# only source the real man page, but without them the man command 
4718 +# would be unable to find the correct page. The default is NO.
4719 +
4720 +MAN_LINKS              = NO
4721 +
4722 +#---------------------------------------------------------------------------
4723 +# configuration options related to the XML output
4724 +#---------------------------------------------------------------------------
4725 +
4726 +# If the GENERATE_XML tag is set to YES Doxygen will 
4727 +# generate an XML file that captures the structure of 
4728 +# the code including all documentation.
4729 +
4730 +GENERATE_XML           = NO
4731 +
4732 +# The XML_OUTPUT tag is used to specify where the XML pages will be put. 
4733 +# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
4734 +# put in front of it. If left blank `xml' will be used as the default path.
4735 +
4736 +XML_OUTPUT             = xml
4737 +
4738 +# The XML_SCHEMA tag can be used to specify an XML schema, 
4739 +# which can be used by a validating XML parser to check the 
4740 +# syntax of the XML files.
4741 +
4742 +XML_SCHEMA             = 
4743 +
4744 +# The XML_DTD tag can be used to specify an XML DTD, 
4745 +# which can be used by a validating XML parser to check the 
4746 +# syntax of the XML files.
4747 +
4748 +XML_DTD                = 
4749 +
4750 +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will 
4751 +# dump the program listings (including syntax highlighting 
4752 +# and cross-referencing information) to the XML output. Note that 
4753 +# enabling this will significantly increase the size of the XML output.
4754 +
4755 +XML_PROGRAMLISTING     = YES
4756 +
4757 +#---------------------------------------------------------------------------
4758 +# configuration options for the AutoGen Definitions output
4759 +#---------------------------------------------------------------------------
4760 +
4761 +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 
4762 +# generate an AutoGen Definitions (see autogen.sf.net) file 
4763 +# that captures the structure of the code including all 
4764 +# documentation. Note that this feature is still experimental 
4765 +# and incomplete at the moment.
4766 +
4767 +GENERATE_AUTOGEN_DEF   = NO
4768 +
4769 +#---------------------------------------------------------------------------
4770 +# configuration options related to the Perl module output
4771 +#---------------------------------------------------------------------------
4772 +
4773 +# If the GENERATE_PERLMOD tag is set to YES Doxygen will 
4774 +# generate a Perl module file that captures the structure of 
4775 +# the code including all documentation. Note that this 
4776 +# feature is still experimental and incomplete at the 
4777 +# moment.
4778 +
4779 +GENERATE_PERLMOD       = NO
4780 +
4781 +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate 
4782 +# the necessary Makefile rules, Perl scripts and LaTeX code to be able 
4783 +# to generate PDF and DVI output from the Perl module output.
4784 +
4785 +PERLMOD_LATEX          = NO
4786 +
4787 +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be 
4788 +# nicely formatted so it can be parsed by a human reader.  This is useful 
4789 +# if you want to understand what is going on.  On the other hand, if this 
4790 +# tag is set to NO the size of the Perl module output will be much smaller 
4791 +# and Perl will parse it just the same.
4792 +
4793 +PERLMOD_PRETTY         = YES
4794 +
4795 +# The names of the make variables in the generated doxyrules.make file 
4796 +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. 
4797 +# This is useful so different doxyrules.make files included by the same 
4798 +# Makefile don't overwrite each other's variables.
4799 +
4800 +PERLMOD_MAKEVAR_PREFIX = 
4801 +
4802 +#---------------------------------------------------------------------------
4803 +# Configuration options related to the preprocessor   
4804 +#---------------------------------------------------------------------------
4805 +
4806 +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 
4807 +# evaluate all C-preprocessor directives found in the sources and include 
4808 +# files.
4809 +
4810 +ENABLE_PREPROCESSING   = YES
4811 +
4812 +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 
4813 +# names in the source code. If set to NO (the default) only conditional 
4814 +# compilation will be performed. Macro expansion can be done in a controlled 
4815 +# way by setting EXPAND_ONLY_PREDEF to YES.
4816 +
4817 +MACRO_EXPANSION        = NO
4818 +
4819 +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 
4820 +# then the macro expansion is limited to the macros specified with the 
4821 +# PREDEFINED and EXPAND_AS_PREDEFINED tags.
4822 +
4823 +EXPAND_ONLY_PREDEF     = NO
4824 +
4825 +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 
4826 +# in the INCLUDE_PATH (see below) will be search if a #include is found.
4827 +
4828 +SEARCH_INCLUDES        = YES
4829 +
4830 +# The INCLUDE_PATH tag can be used to specify one or more directories that 
4831 +# contain include files that are not input files but should be processed by 
4832 +# the preprocessor.
4833 +
4834 +INCLUDE_PATH           = 
4835 +
4836 +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 
4837 +# patterns (like *.h and *.hpp) to filter out the header-files in the 
4838 +# directories. If left blank, the patterns specified with FILE_PATTERNS will 
4839 +# be used.
4840 +
4841 +INCLUDE_FILE_PATTERNS  = 
4842 +
4843 +# The PREDEFINED tag can be used to specify one or more macro names that 
4844 +# are defined before the preprocessor is started (similar to the -D option of 
4845 +# gcc). The argument of the tag is a list of macros of the form: name 
4846 +# or name=definition (no spaces). If the definition and the = are 
4847 +# omitted =1 is assumed. To prevent a macro definition from being 
4848 +# undefined via #undef or recursively expanded use the := operator 
4849 +# instead of the = operator.
4850 +
4851 +PREDEFINED             = UNSTABLE_POPPLER_QT4
4852 +
4853 +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 
4854 +# this tag can be used to specify a list of macro names that should be expanded. 
4855 +# The macro definition that is found in the sources will be used. 
4856 +# Use the PREDEFINED tag if you want to use a different macro definition.
4857 +
4858 +EXPAND_AS_DEFINED      = 
4859 +
4860 +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 
4861 +# doxygen's preprocessor will remove all function-like macros that are alone 
4862 +# on a line, have an all uppercase name, and do not end with a semicolon. Such 
4863 +# function macros are typically used for boiler-plate code, and will confuse 
4864 +# the parser if not removed.
4865 +
4866 +SKIP_FUNCTION_MACROS   = YES
4867 +
4868 +#---------------------------------------------------------------------------
4869 +# Configuration::additions related to external references   
4870 +#---------------------------------------------------------------------------
4871 +
4872 +# The TAGFILES option can be used to specify one or more tagfiles. 
4873 +# Optionally an initial location of the external documentation 
4874 +# can be added for each tagfile. The format of a tag file without 
4875 +# this location is as follows: 
4876 +#   TAGFILES = file1 file2 ... 
4877 +# Adding location for the tag files is done as follows: 
4878 +#   TAGFILES = file1=loc1 "file2 = loc2" ... 
4879 +# where "loc1" and "loc2" can be relative or absolute paths or 
4880 +# URLs. If a location is present for each tag, the installdox tool 
4881 +# does not have to be run to correct the links.
4882 +# Note that each tag file must have a unique name
4883 +# (where the name does NOT include the path)
4884 +# If a tag file is not located in the directory in which doxygen 
4885 +# is run, you must also specify the path to the tagfile here.
4886 +
4887 +TAGFILES               = 
4888 +
4889 +# When a file name is specified after GENERATE_TAGFILE, doxygen will create 
4890 +# a tag file that is based on the input files it reads.
4891 +
4892 +GENERATE_TAGFILE       = 
4893 +
4894 +# If the ALLEXTERNALS tag is set to YES all external classes will be listed 
4895 +# in the class index. If set to NO only the inherited external classes 
4896 +# will be listed.
4897 +
4898 +ALLEXTERNALS           = NO
4899 +
4900 +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 
4901 +# in the modules index. If set to NO, only the current project's groups will 
4902 +# be listed.
4903 +
4904 +EXTERNAL_GROUPS        = YES
4905 +
4906 +# The PERL_PATH should be the absolute path and name of the perl script 
4907 +# interpreter (i.e. the result of `which perl').
4908 +
4909 +PERL_PATH              = /usr/bin/perl
4910 +
4911 +#---------------------------------------------------------------------------
4912 +# Configuration options related to the dot tool   
4913 +#---------------------------------------------------------------------------
4914 +
4915 +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 
4916 +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base 
4917 +# or super classes. Setting the tag to NO turns the diagrams off. Note that 
4918 +# this option is superseded by the HAVE_DOT option below. This is only a 
4919 +# fallback. It is recommended to install and use dot, since it yields more 
4920 +# powerful graphs.
4921 +
4922 +CLASS_DIAGRAMS         = YES
4923 +
4924 +# If set to YES, the inheritance and collaboration graphs will hide 
4925 +# inheritance and usage relations if the target is undocumented 
4926 +# or is not a class.
4927 +
4928 +HIDE_UNDOC_RELATIONS   = YES
4929 +
4930 +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 
4931 +# available from the path. This tool is part of Graphviz, a graph visualization 
4932 +# toolkit from AT&T and Lucent Bell Labs. The other options in this section 
4933 +# have no effect if this option is set to NO (the default)
4934 +
4935 +HAVE_DOT               = NO
4936 +
4937 +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 
4938 +# will generate a graph for each documented class showing the direct and 
4939 +# indirect inheritance relations. Setting this tag to YES will force the 
4940 +# the CLASS_DIAGRAMS tag to NO.
4941 +
4942 +CLASS_GRAPH            = YES
4943 +
4944 +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 
4945 +# will generate a graph for each documented class showing the direct and 
4946 +# indirect implementation dependencies (inheritance, containment, and 
4947 +# class references variables) of the class with other documented classes.
4948 +
4949 +COLLABORATION_GRAPH    = YES
4950 +
4951 +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen 
4952 +# will generate a graph for groups, showing the direct groups dependencies
4953 +
4954 +GROUP_GRAPHS           = YES
4955 +
4956 +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and 
4957 +# collaboration diagrams in a style similar to the OMG's Unified Modeling 
4958 +# Language.
4959 +
4960 +UML_LOOK               = NO
4961 +
4962 +# If set to YES, the inheritance and collaboration graphs will show the 
4963 +# relations between templates and their instances.
4964 +
4965 +TEMPLATE_RELATIONS     = NO
4966 +
4967 +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 
4968 +# tags are set to YES then doxygen will generate a graph for each documented 
4969 +# file showing the direct and indirect include dependencies of the file with 
4970 +# other documented files.
4971 +
4972 +INCLUDE_GRAPH          = YES
4973 +
4974 +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 
4975 +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each 
4976 +# documented header file showing the documented files that directly or 
4977 +# indirectly include this file.
4978 +
4979 +INCLUDED_BY_GRAPH      = YES
4980 +
4981 +# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will 
4982 +# generate a call dependency graph for every global function or class method. 
4983 +# Note that enabling this option will significantly increase the time of a run. 
4984 +# So in most cases it will be better to enable call graphs for selected 
4985 +# functions only using the \callgraph command.
4986 +
4987 +CALL_GRAPH             = NO
4988 +
4989 +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
4990 +# will graphical hierarchy of all classes instead of a textual one.
4991 +
4992 +GRAPHICAL_HIERARCHY    = YES
4993 +
4994 +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES 
4995 +# then doxygen will show the dependencies a directory has on other directories 
4996 +# in a graphical way. The dependency relations are determined by the #include
4997 +# relations between the files in the directories.
4998 +
4999 +DIRECTORY_GRAPH        = YES
5000 +
5001 +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 
5002 +# generated by dot. Possible values are png, jpg, or gif
5003 +# If left blank png will be used.
5004 +
5005 +DOT_IMAGE_FORMAT       = png
5006 +
5007 +# The tag DOT_PATH can be used to specify the path where the dot tool can be 
5008 +# found. If left blank, it is assumed the dot tool can be found in the path.
5009 +
5010 +DOT_PATH               = 
5011 +
5012 +# The DOTFILE_DIRS tag can be used to specify one or more directories that 
5013 +# contain dot files that are included in the documentation (see the 
5014 +# \dotfile command).
5015 +
5016 +DOTFILE_DIRS           = 
5017 +
5018 +# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width 
5019 +# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
5020 +# this value, doxygen will try to truncate the graph, so that it fits within 
5021 +# the specified constraint. Beware that most browsers cannot cope with very 
5022 +# large images.
5023 +
5024 +MAX_DOT_GRAPH_WIDTH    = 1024
5025 +
5026 +# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height 
5027 +# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
5028 +# this value, doxygen will try to truncate the graph, so that it fits within 
5029 +# the specified constraint. Beware that most browsers cannot cope with very 
5030 +# large images.
5031 +
5032 +MAX_DOT_GRAPH_HEIGHT   = 1024
5033 +
5034 +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the 
5035 +# graphs generated by dot. A depth value of 3 means that only nodes reachable 
5036 +# from the root by following a path via at most 3 edges will be shown. Nodes 
5037 +# that lay further from the root node will be omitted. Note that setting this 
5038 +# option to 1 or 2 may greatly reduce the computation time needed for large 
5039 +# code bases. Also note that a graph may be further truncated if the graph's 
5040 +# image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH 
5041 +# and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default), 
5042 +# the graph is not depth-constrained.
5043 +
5044 +MAX_DOT_GRAPH_DEPTH    = 0
5045 +
5046 +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent 
5047 +# background. This is disabled by default, which results in a white background. 
5048 +# Warning: Depending on the platform used, enabling this option may lead to 
5049 +# badly anti-aliased labels on the edges of a graph (i.e. they become hard to 
5050 +# read).
5051 +
5052 +DOT_TRANSPARENT        = NO
5053 +
5054 +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output 
5055 +# files in one run (i.e. multiple -o and -T options on the command line). This 
5056 +# makes dot run faster, but since only newer versions of dot (>1.8.10) 
5057 +# support this, this feature is disabled by default.
5058 +
5059 +DOT_MULTI_TARGETS      = NO
5060 +
5061 +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 
5062 +# generate a legend page explaining the meaning of the various boxes and 
5063 +# arrows in the dot generated graphs.
5064 +
5065 +GENERATE_LEGEND        = YES
5066 +
5067 +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 
5068 +# remove the intermediate dot files that are used to generate 
5069 +# the various graphs.
5070 +
5071 +DOT_CLEANUP            = YES
5072 +
5073 +#---------------------------------------------------------------------------
5074 +# Configuration::additions related to the search engine   
5075 +#---------------------------------------------------------------------------
5076 +
5077 +# The SEARCHENGINE tag specifies whether or not a search engine should be 
5078 +# used. If set to NO the values of all tags below this one will be ignored.
5079 +
5080 +SEARCHENGINE           = NO
5081 diff -Nur poppler.0_5_0/qt4/src/Makefile.am poppler.HEAD/qt4/src/Makefile.am
5082 --- poppler.0_5_0/qt4/src/Makefile.am   2006-01-06 11:05:59.000000000 +0100
5083 +++ poppler.HEAD/qt4/src/Makefile.am    2006-02-16 20:28:54.000000000 +0100
5084 @@ -1,6 +1,7 @@
5085  INCLUDES =                                     \
5086         -I$(top_srcdir)                         \
5087         -I$(top_srcdir)/poppler                 \
5088 +       -I$(top_srcdir)/qt                      \
5089         $(POPPLER_QT4_CXXFLAGS)
5090  
5091  
5092 @@ -16,6 +17,7 @@
5093         poppler-document.cc                     \
5094         poppler-page.cc                         \
5095         poppler-fontinfo.cc                     \
5096 +       poppler-embeddedfile.cc                 \
5097         poppler-textbox.cc                      \
5098         ../../qt/poppler-page-transition.cc     \
5099         poppler-private.h
5100 @@ -24,3 +26,5 @@
5101         $(top_builddir)/poppler/libpoppler.la   \
5102         $(POPPLER_QT4_LIBS)
5103  
5104 +libpoppler_qt4_la_LDFLAGS = -version-info 1:0:0
5105 +
5106 diff -Nur poppler.0_5_0/qt4/src/poppler-document.cc poppler.HEAD/qt4/src/poppler-document.cc
5107 --- poppler.0_5_0/qt4/src/poppler-document.cc   2006-01-01 23:35:48.000000000 +0100
5108 +++ poppler.HEAD/qt4/src/poppler-document.cc    2006-01-18 23:32:13.000000000 +0100
5109 @@ -25,10 +25,13 @@
5110  #include <GlobalParams.h>
5111  #include <PDFDoc.h>
5112  #include <Catalog.h>
5113 +#include "UGooString.h"
5114  #include <ErrorCodes.h>
5115  #include <SplashOutputDev.h>
5116  #include <splash/SplashBitmap.h>
5117  #include "poppler-private.h"
5118 +#include <Stream.h>
5119 +#include <QtCore/QDebug>
5120  
5121  namespace Poppler {
5122  
5123 @@ -50,6 +53,15 @@
5124             else
5125                 pdoc->m_doc->locked = false;
5126             pdoc->m_doc->m_fontInfoScanner = new FontInfoScanner(&(doc->doc));
5127 +           int numEmb = doc->doc.getCatalog()->numEmbeddedFiles();
5128 +           if (!(0 == numEmb)) {
5129 +               // we have some embedded documents, build the list
5130 +               for (int yalv = 0; yalv < numEmb; ++yalv) {
5131 +                   EmbFile *ef = doc->doc.getCatalog()->embeddedFile(yalv);
5132 +                   pdoc->m_doc->m_embeddedFiles.append(new EmbeddedFile(ef));
5133 +                   delete ef;
5134 +               }
5135 +           }
5136             return pdoc;
5137         }
5138         else
5139 @@ -150,6 +162,11 @@
5140         return ourList;
5141      }
5142  
5143 +    const QList<EmbeddedFile*> &Document::embeddedFiles() const
5144 +    {
5145 +       return m_doc->m_embeddedFiles;
5146 +    }
5147 +
5148      bool Document::scanForFonts( int numPages, QList<FontInfo> *fontList ) const
5149      {
5150         GooList *items = m_doc->m_fontInfoScanner->scan( numPages );
5151 @@ -257,7 +274,7 @@
5152         Dict *infoDict = info.getDict();
5153         // somehow iterate over keys in infoDict
5154         for( int i=0; i < infoDict->getLength(); ++i ) {
5155 -           keys.append( QString::fromAscii(infoDict->getKey(i)) );
5156 +           keys.append( QString::fromAscii(infoDict->getKey(i)->getCString()) );
5157         }
5158  
5159         info.free();
5160 @@ -279,8 +296,6 @@
5161         }
5162  
5163         Object obj;
5164 -       char *s;
5165 -       int year, mon, day, hour, min, sec;
5166         Dict *infoDict = info.getDict();
5167         QDateTime result;
5168  
5169 @@ -364,6 +379,11 @@
5170         return page(index);
5171      }
5172  
5173 +    bool Document::hasEmbeddedFiles() const
5174 +    {
5175 +       return (!(0 == m_doc->doc.getCatalog()->numEmbeddedFiles()));
5176 +    }
5177 +
5178      QDateTime convertDate( char *dateString )
5179      {
5180          int year;
5181 diff -Nur poppler.0_5_0/qt4/src/poppler-embeddedfile.cc poppler.HEAD/qt4/src/poppler-embeddedfile.cc
5182 --- poppler.0_5_0/qt4/src/poppler-embeddedfile.cc       1970-01-01 01:00:00.000000000 +0100
5183 +++ poppler.HEAD/qt4/src/poppler-embeddedfile.cc        2006-01-18 23:38:59.000000000 +0100
5184 @@ -0,0 +1,106 @@
5185 +/* poppler-document.cc: qt interface to poppler
5186 + * Copyright (C) 2005, Albert Astals Cid <aacid@kde.org>
5187 + * Copyright (C) 2005, Brad Hards <bradh@frogmouth.net>
5188 + *
5189 + * This program is free software; you can redistribute it and/or modify
5190 + * it under the terms of the GNU General Public License as published by
5191 + * the Free Software Foundation; either version 2, or (at your option)
5192 + * any later version.
5193 + *
5194 + * This program is distributed in the hope that it will be useful,
5195 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
5196 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
5197 + * GNU General Public License for more details.
5198 + *
5199 + * You should have received a copy of the GNU General Public License
5200 + * along with this program; if not, write to the Free Software
5201 + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
5202 + */
5203 +
5204 +#define UNSTABLE_POPPLER_QT4
5205 +
5206 +#include <QtCore/QString>
5207 +#include <QtCore/QDateTime>
5208 +
5209 +#include "Object.h"
5210 +#include "Stream.h"
5211 +#include "Catalog.h"
5212 +
5213 +#include "poppler-qt4.h"
5214 +
5215 +namespace Poppler
5216 +{
5217 +
5218 +class EmbeddedFileData
5219 +{
5220 +public:
5221 +       QString m_label;
5222 +       QString m_description;
5223 +       QDateTime m_modDate;
5224 +       QDateTime m_createDate;
5225 +       Object m_streamObject;
5226 +};
5227 +
5228 +EmbeddedFile::EmbeddedFile(EmbFile *embfile)
5229 +{
5230 +       m_embeddedFile = new EmbeddedFileData();
5231 +       m_embeddedFile->m_label = QString(embfile->name()->getCString());
5232 +       m_embeddedFile->m_description = QString(embfile->description()->getCString());
5233 +       m_embeddedFile->m_modDate = convertDate(embfile->modDate()->getCString());
5234 +       m_embeddedFile->m_createDate = convertDate(embfile->createDate()->getCString());
5235 +       embfile->streamObject().copy(&m_embeddedFile->m_streamObject);
5236 +}
5237 +
5238 +EmbeddedFile::EmbeddedFile(const EmbeddedFile &ef)
5239 +{
5240 +       m_embeddedFile = new EmbeddedFileData();
5241 +       m_embeddedFile->m_label = ef.m_embeddedFile->m_label;
5242 +       m_embeddedFile->m_description = ef.m_embeddedFile->m_description;
5243 +       m_embeddedFile->m_modDate = ef.m_embeddedFile->m_modDate;
5244 +       m_embeddedFile->m_createDate = ef.m_embeddedFile->m_createDate;
5245 +       ef.m_embeddedFile->m_streamObject.copy(&m_embeddedFile->m_streamObject);
5246 +}
5247 +
5248 +EmbeddedFile::~EmbeddedFile()
5249 +{
5250 +       m_embeddedFile->m_streamObject.free();
5251 +       delete m_embeddedFile;
5252 +}
5253 +
5254 +QString EmbeddedFile::name() const
5255 +{
5256 +       return m_embeddedFile->m_label;
5257 +}
5258 +
5259 +QString EmbeddedFile::description() const
5260 +{
5261 +       return m_embeddedFile->m_description;
5262 +}
5263 +
5264 +QDateTime EmbeddedFile::modDate() const
5265 +{
5266 +       return m_embeddedFile->m_modDate;
5267 +}
5268 +
5269 +QDateTime EmbeddedFile::createDate() const
5270 +{
5271 +       return m_embeddedFile->m_createDate;
5272 +}
5273 +
5274 +QByteArray EmbeddedFile::data()
5275 +{
5276 +       Object obj;
5277 +       Stream *stream = m_embeddedFile->m_streamObject.getStream();
5278 +       stream->reset();
5279 +       int dataLen = 0;
5280 +       QByteArray fileArray;
5281 +       int i;
5282 +       while ( (i = stream->getChar()) != EOF) {
5283 +               fileArray[dataLen] = (char)i;
5284 +               ++dataLen;
5285 +       }
5286 +       fileArray.resize(dataLen);
5287 +       return fileArray;
5288 +};
5289 +
5290 +}
5291 diff -Nur poppler.0_5_0/qt4/src/poppler-page.cc poppler.HEAD/qt4/src/poppler-page.cc
5292 --- poppler.0_5_0/qt4/src/poppler-page.cc       2006-01-05 14:53:58.000000000 +0100
5293 +++ poppler.HEAD/qt4/src/poppler-page.cc        2006-01-10 22:57:28.000000000 +0100
5294 @@ -26,12 +26,12 @@
5295  #include <Catalog.h>
5296  #include <ErrorCodes.h>
5297  #include <ArthurOutputDev.h>
5298 -#include <Private.h>
5299  #include <SplashOutputDev.h>
5300  #include <TextOutputDev.h>
5301  #include <splash/SplashBitmap.h>
5302  
5303  #include "poppler-private.h"
5304 +#include "poppler-page-transition-private.h"
5305  
5306  namespace Poppler {
5307  
5308 diff -Nur poppler.0_5_0/qt4/src/poppler-private.h poppler.HEAD/qt4/src/poppler-private.h
5309 --- poppler.0_5_0/qt4/src/poppler-private.h     2006-01-01 23:35:48.000000000 +0100
5310 +++ poppler.HEAD/qt4/src/poppler-private.h      2006-01-18 23:32:13.000000000 +0100
5311 @@ -34,6 +34,7 @@
5312         
5313         ~DocumentData()
5314         {
5315 +               qDeleteAll(m_embeddedFiles);
5316                 delete m_splashOutputDev;
5317                 delete m_fontInfoScanner;
5318         }
5319 @@ -56,6 +57,7 @@
5320         bool locked;
5321         FontInfoScanner *m_fontInfoScanner;
5322         SplashOutputDev *m_splashOutputDev;
5323 +       QList<EmbeddedFile*> m_embeddedFiles;
5324      };
5325  
5326  }
5327 diff -Nur poppler.0_5_0/qt4/src/poppler-qt4.h poppler.HEAD/qt4/src/poppler-qt4.h
5328 --- poppler.0_5_0/qt4/src/poppler-qt4.h 2006-01-05 14:53:58.000000000 +0100
5329 +++ poppler.HEAD/qt4/src/poppler-qt4.h  2006-01-18 23:32:13.000000000 +0100
5330 @@ -26,7 +26,9 @@
5331  #include <QtCore/QDateTime>
5332  #include <QtGui/QPixmap>
5333  
5334 -#include <PageTransition.h>
5335 +#include <poppler-page-transition.h>
5336 +
5337 +class EmbFile;
5338  
5339  /**
5340     The Poppler Qt bindings
5341 @@ -146,6 +148,58 @@
5342  
5343  
5344      /**
5345 +       Container class for an embedded file with a PDF document
5346 +    */
5347 +    class EmbeddedFileData;
5348 +    class EmbeddedFile {
5349 +    public:
5350 +       /**
5351 +          Create a new embedded file container
5352 +       */
5353 +       EmbeddedFile(EmbFile *embfile);
5354 +       
5355 +       EmbeddedFile(const EmbeddedFile &ef);
5356 +       
5357 +       ~EmbeddedFile();
5358 +
5359 +       /**
5360 +          The name associated with the file
5361 +       */
5362 +       QString name() const;
5363 +
5364 +       /**
5365 +          The description associated with the file, if any.
5366 +
5367 +          This will return an empty QString if there is no description element
5368 +       */
5369 +       QString description() const;
5370 +
5371 +       /**
5372 +          The modification date for the embedded file, if known.
5373 +       */
5374 +       QDateTime modDate() const;
5375 +
5376 +       /**
5377 +          The creation date for the embedded file, if known.
5378 +       */
5379 +       QDateTime createDate() const;
5380 +
5381 +       /**
5382 +          The data as an array
5383 +       */
5384 +       QByteArray data();
5385 +
5386 +       /**
5387 +          A QDataStream for the actual data?
5388 +       */
5389 +       //QDataStream dataStream() const;
5390 +
5391 +    private:
5392 +       EmbeddedFileData *m_embeddedFile;
5393 +    };
5394 +
5395 +
5396 +    /**
5397         Page within a PDF document
5398      */
5399      class Page {
5400 @@ -544,6 +598,20 @@
5401         */
5402         bool scanForFonts( int numPages, QList<FontInfo> *fontList ) const; 
5403  
5404 +
5405 +       /**
5406 +          The documents embedded within the PDF document.
5407 +
5408 +          \note there are two types of embedded document - this call
5409 +          only accesses documents that are embedded at the document level.
5410 +       */
5411 +       const QList<EmbeddedFile*> &embeddedFiles() const;
5412 +
5413 +       /**
5414 +          Whether there are any documents embedded in this PDF document.
5415 +       */
5416 +       bool hasEmbeddedFiles() const;
5417 +
5418         Document::~Document();
5419    
5420      private:
5421 diff -Nur poppler.0_5_0/qt4/tests/check_attachments.cpp poppler.HEAD/qt4/tests/check_attachments.cpp
5422 --- poppler.0_5_0/qt4/tests/check_attachments.cpp       1970-01-01 01:00:00.000000000 +0100
5423 +++ poppler.HEAD/qt4/tests/check_attachments.cpp        2006-01-18 23:40:26.000000000 +0100
5424 @@ -0,0 +1,151 @@
5425 +#include <QtTest/QtTest>
5426 +
5427 +#define UNSTABLE_POPPLER_QT4
5428 +#include <poppler-qt4.h>
5429 +
5430 +#include <QtCore/QFile>
5431 +
5432 +class TestAttachments: public QObject
5433 +{
5434 +    Q_OBJECT
5435 +private slots:
5436 +    void checkNoAttachments();
5437 +    void checkAttach1();
5438 +    void checkAttach2();
5439 +    void checkAttach3();
5440 +    void checkAttach4();
5441 +};
5442 +
5443 +void TestAttachments::checkNoAttachments()
5444 +{
5445 +    Poppler::Document *doc;
5446 +    doc = Poppler::Document::load("../../../test/unittestcases/truetype.pdf");
5447 +    QVERIFY( doc );
5448 +
5449 +    QCOMPARE( doc->hasEmbeddedFiles(), false );
5450 +
5451 +    delete doc;
5452 +}
5453 +
5454 +void TestAttachments::checkAttach1()
5455 +{
5456 +
5457 +    Poppler::Document *doc;
5458 +    doc = Poppler::Document::load("../../../test/unittestcases/WithAttachments.pdf");
5459 +    QVERIFY( doc );
5460 +
5461 +    QVERIFY( doc->hasEmbeddedFiles() );
5462 +
5463 +    QList<Poppler::EmbeddedFile*> fileList = doc->embeddedFiles();
5464 +    QCOMPARE( fileList.size(), 2 );
5465 +
5466 +    Poppler::EmbeddedFile *embfile = fileList.at(0);
5467 +    QCOMPARE( embfile->name(), QString( "kroller.png" ) );
5468 +    QCOMPARE( embfile->description(), QString("/home/bradh/coding/svn-vers/KDE/kdeartwork/wallpapers/kroller.png") );
5469 +    QCOMPARE( embfile->createDate(), QDateTime( QDate(), QTime() ) );
5470 +    QCOMPARE( embfile->modDate(), QDateTime( QDate(), QTime() ) );
5471 +
5472 +    QFile file( "../../../test/unittestcases/kroller.png" );
5473 +    QVERIFY(  file.open( QIODevice::ReadOnly ) );
5474 +    QByteArray krollerData = file.readAll();
5475 +    QByteArray embdata = embfile->data();
5476 +    QCOMPARE( krollerData, embdata );
5477 +           
5478 +
5479 +    Poppler::EmbeddedFile *embfile2 = fileList.at(1);
5480 +    QCOMPARE( embfile2->name(), QString("gnome-64.gif") );
5481 +    QCOMPARE( embfile2->description(), QString("/usr/share/gnome-about/gnome-64.gif") );
5482 +    QCOMPARE( embfile2->modDate(), QDateTime( QDate(), QTime() ) );
5483 +    QCOMPARE( embfile2->createDate(), QDateTime( QDate(), QTime() ) );
5484 +
5485 +    QFile file2( "../../../test/unittestcases/gnome-64.gif" );
5486 +    QVERIFY(  file2.open( QIODevice::ReadOnly ) );
5487 +    QByteArray g64Data = file2.readAll();
5488 +    QByteArray emb2data = embfile2->data();
5489 +    QCOMPARE( g64Data, emb2data );
5490 +
5491 +    delete doc;
5492 +}
5493 +
5494 +
5495 +void TestAttachments::checkAttach2()
5496 +{
5497 +
5498 +    Poppler::Document *doc;
5499 +    doc = Poppler::Document::load("../../../test/unittestcases/A6EmbeddedFiles.pdf");
5500 +    QVERIFY( doc );
5501 +
5502 +    QVERIFY( doc->hasEmbeddedFiles() );
5503 +
5504 +    QList<Poppler::EmbeddedFile*> fileList;
5505 +    fileList = doc->embeddedFiles();
5506 +    QCOMPARE( fileList.size(), 3 );
5507 +
5508 +    Poppler::EmbeddedFile *embfile1 = fileList.at(0);
5509 +    QCOMPARE( embfile1->name(), QString("Acro7 thoughts") );
5510 +    QCOMPARE( embfile1->description(), QString("Acro7 Thoughts") );
5511 +    QCOMPARE( embfile1->createDate(), QDateTime( QDate( 2003, 8, 4 ), QTime( 13, 54, 54), Qt::UTC ) );
5512 +    QCOMPARE( embfile1->modDate(), QDateTime( QDate( 2003, 8, 4 ), QTime( 14, 15, 27), Qt::UTC ) );
5513 +
5514 +    Poppler::EmbeddedFile *embfile2 = fileList.at(1);
5515 +    QCOMPARE( embfile2->name(), QString("acro transitions 1.xls") );
5516 +    QCOMPARE( embfile2->description(), QString("AcroTransitions") );
5517 +    QCOMPARE( embfile2->createDate(), QDateTime( QDate( 2003, 7, 18 ), QTime( 21, 7, 16), Qt::UTC ) );
5518 +    QCOMPARE( embfile2->modDate(), QDateTime( QDate( 2003, 7, 22 ), QTime( 13, 4, 40), Qt::UTC ) );
5519 +
5520 +    Poppler::EmbeddedFile *embfile3 = fileList.at(2);
5521 +    QCOMPARE( embfile3->name(), QString("apago_pdfe_wide.gif") );
5522 +    QCOMPARE( embfile3->description(), QString("PDFE Animation") );
5523 +    QCOMPARE( embfile3->createDate(), QDateTime( QDate( 2003, 1, 31 ), QTime( 15, 54, 29), Qt::UTC ) );
5524 +    QCOMPARE( embfile3->modDate(), QDateTime( QDate( 2003, 1, 31 ), QTime( 15, 52, 58), Qt::UTC ) );
5525 +
5526 +    delete doc;
5527 +}
5528 +
5529 +void TestAttachments::checkAttach3()
5530 +{
5531 +
5532 +    Poppler::Document *doc;
5533 +    doc = Poppler::Document::load("../../../test/unittestcases/shapes+attachments.pdf");
5534 +    QVERIFY( doc );
5535 +
5536 +    QVERIFY( doc->hasEmbeddedFiles() );
5537 +
5538 +    QList<Poppler::EmbeddedFile*> fileList;
5539 +    fileList = doc->embeddedFiles();
5540 +    QCOMPARE( fileList.size(), 1 );
5541 +
5542 +    Poppler::EmbeddedFile *embfile = fileList.at(0);
5543 +    QCOMPARE( embfile->name(), QString( "ADEX1.xpdf.pgp" ) );
5544 +    QCOMPARE( embfile->description(), QString("encrypted version of document") );
5545 +    QCOMPARE( embfile->createDate(), QDateTime( QDate( 2004, 3, 29 ), QTime( 19, 37, 16), Qt::UTC ) );
5546 +    QCOMPARE( embfile->modDate(), QDateTime( QDate( 2004, 3, 29 ), QTime( 19, 37, 16), Qt::UTC ) );
5547 +    delete doc;
5548 +
5549 +}
5550 +
5551 +void TestAttachments::checkAttach4()
5552 +{
5553 +
5554 +    Poppler::Document *doc;
5555 +    doc = Poppler::Document::load("../../../test/unittestcases/imageretrieve+attachment.pdf");
5556 +    QVERIFY( doc );
5557 +
5558 +    QVERIFY( doc->hasEmbeddedFiles() );
5559 +
5560 +    QList<Poppler::EmbeddedFile*> fileList;
5561 +    fileList = doc->embeddedFiles();
5562 +    QCOMPARE( fileList.size(), 1 );
5563 +
5564 +    Poppler::EmbeddedFile *embfile = fileList.at(0);
5565 +    QCOMPARE( embfile->name(), QString( "export-altona.csv" ) );
5566 +    QCOMPARE( embfile->description(), QString("Altona Export") );
5567 +    QCOMPARE( embfile->createDate(), QDateTime( QDate( 2005, 8, 30 ), QTime( 20, 49, 35), Qt::UTC ) );
5568 +    QCOMPARE( embfile->modDate(), QDateTime( QDate( 2005, 8, 30 ), QTime( 20, 49, 52), Qt::UTC ) );
5569 +    delete doc;
5570 +
5571 +}
5572 +
5573 +QTEST_MAIN(TestAttachments)
5574 +#include "check_attachments.moc"
5575 +
5576 diff -Nur poppler.0_5_0/qt4/tests/Makefile.am poppler.HEAD/qt4/tests/Makefile.am
5577 --- poppler.0_5_0/qt4/tests/Makefile.am 2005-12-27 07:10:02.000000000 +0100
5578 +++ poppler.HEAD/qt4/tests/Makefile.am  2006-01-18 23:32:13.000000000 +0100
5579 @@ -2,6 +2,7 @@
5580         -I$(top_srcdir)                         \
5581         -I$(top_srcdir)/poppler                 \
5582         -I$(top_srcdir)/qt4/src                 \
5583 +       -I$(top_srcdir)/qt                      \
5584         $(POPPLER_QT4_CXXFLAGS)                 \
5585         $(POPPLER_QTTEST_CXXFLAGS)
5586  
5587 @@ -18,7 +19,7 @@
5588         moc -i $< -o $@
5589  
5590  noinst_PROGRAMS = test-poppler-qt4 stress-poppler-qt4 \
5591 -       poppler-fonts test-password-qt4
5592 +       poppler-fonts test-password-qt4 poppler-attachments
5593  
5594  
5595  test_poppler_qt4_SOURCES =                     \
5596 @@ -38,6 +39,11 @@
5597  
5598  poppler_fonts_LDADD = $(LDADDS)
5599  
5600 +poppler_attachments_SOURCES =                  \
5601 +       poppler-attachments.cpp
5602 +
5603 +poppler_attachments_LDADD = $(LDADDS)
5604 +
5605  
5606  stress_poppler_qt4_SOURCES =                   \
5607         stress-poppler-qt4.cpp
5608 @@ -46,7 +52,8 @@
5609  
5610  if BUILD_POPPLER_QT4TESTS
5611  TESTS = \
5612 -       check_dateConversion    \
5613 +       check_attachments       \
5614 +       check_dateConversion    \
5615         check_fonts             \
5616         check_metadata          \
5617         check_permissions       \
5618 @@ -55,6 +62,10 @@
5619  
5620  check_PROGRAMS = $(TESTS)
5621  
5622 +check_attachments_SOURCES = check_attachments.cpp
5623 +check_attachments.$(OBJEXT): check_attachments.moc
5624 +check_attachments_LDADD = $(UT_LDADDS)
5625 +
5626  check_dateConversion_SOURCES = check_dateConversion.cpp
5627  check_dateConversion.$(OBJEXT): check_dateConversion.moc
5628  check_dateConversion_LDADD = $(UT_LDADDS)
5629 @@ -72,7 +83,7 @@
5630  check_pagemode_LDADD = $(UT_LDADDS)
5631  
5632  check_permissions_SOURCES = check_permissions.cpp
5633 -check_metadata.$(OBJEXT): check_permissions.moc
5634 +check_permissions.$(OBJEXT): check_permissions.moc
5635  check_permissions_LDADD = $(UT_LDADDS)
5636  
5637  check_pagelayout_SOURCES = check_pagelayout.cpp
5638 diff -Nur poppler.0_5_0/qt4/tests/poppler-attachments.cpp poppler.HEAD/qt4/tests/poppler-attachments.cpp
5639 --- poppler.0_5_0/qt4/tests/poppler-attachments.cpp     1970-01-01 01:00:00.000000000 +0100
5640 +++ poppler.HEAD/qt4/tests/poppler-attachments.cpp      2006-01-18 23:40:26.000000000 +0100
5641 @@ -0,0 +1,37 @@
5642 +#include <QtCore/QtCore>
5643 +#include <iostream>
5644 +
5645 +#define UNSTABLE_POPPLER_QT4
5646 +#include <poppler-qt4.h>
5647 +
5648 +int main( int argc, char **argv )
5649 +{
5650 +    QCoreApplication a( argc, argv );               // QApplication required!
5651 +
5652 +    if (!( argc == 2 ))
5653 +    {
5654 +       qWarning() << "usage: poppler-attachments filename";
5655 +       exit(1);
5656 +    }
5657 +  
5658 +    Poppler::Document *doc = Poppler::Document::load(argv[1]);
5659 +    if (!doc)
5660 +    {
5661 +       qWarning() << "doc not loaded";
5662 +       exit(1);
5663 +    }
5664 +
5665 +    if (doc->hasEmbeddedFiles()) {
5666 +       std::cout << "Embedded files: " << std::endl;
5667 +       foreach(Poppler::EmbeddedFile *file, doc->embeddedFiles()) {
5668 +           std::cout << "    " << qPrintable(file->name()) << std::endl;
5669 +           std::cout << "    desc:" << qPrintable(file->description()) << std::endl;
5670 +           QByteArray data = file->data();
5671 +           std::cout << "       data: " << data.constData() << std::endl;
5672 +       }
5673 +       
5674 +    } else {
5675 +       std::cout << "There are no embedded document at the top level" << std::endl;
5676 +    }
5677 +  
5678 +}
5679 diff -Nur poppler.0_5_0/splash/Splash.cc poppler.HEAD/splash/Splash.cc
5680 --- poppler.0_5_0/splash/Splash.cc      2005-10-30 21:29:05.000000000 +0100
5681 +++ poppler.HEAD/splash/Splash.cc       2006-02-06 21:49:21.000000000 +0100
5682 @@ -2020,10 +2020,10 @@
5683           for (xx = 0, x1 = x0 - glyph->x; xx < glyph->w; ++xx, ++x1) {
5684             alpha = *p++;
5685             if (softMask) {
5686 -             alpha = (int)(alpha * state->fillAlpha *
5687 +             alpha = (int)(alpha * (float)state->fillAlpha *
5688                             softMask->data[y1 * softMask->rowSize + x1]);
5689             } else {
5690 -             alpha = (int)(alpha * state->fillAlpha);
5691 +             alpha = (int)(alpha * (float)state->fillAlpha);
5692             }
5693             if (alpha > 0) {
5694               if (noClip || state->clip->test(x1, y1)) {
5695 diff -Nur poppler.0_5_0/splash/SplashFontEngine.cc poppler.HEAD/splash/SplashFontEngine.cc
5696 --- poppler.0_5_0/splash/SplashFontEngine.cc    2005-09-16 19:42:56.000000000 +0200
5697 +++ poppler.HEAD/splash/SplashFontEngine.cc     2006-02-02 23:50:01.000000000 +0100
5698 @@ -105,19 +105,19 @@
5699  }
5700  
5701  SplashFontFile *SplashFontEngine::loadType1Font(SplashFontFileID *idA,
5702 -                                               char *fileName,
5703 -                                               GBool deleteFile, char **enc) {
5704 +                                               SplashFontSrc *src,
5705 +                                               char **enc) {
5706    SplashFontFile *fontFile;
5707  
5708    fontFile = NULL;
5709  #if HAVE_T1LIB_H
5710    if (!fontFile && t1Engine) {
5711 -    fontFile = t1Engine->loadType1Font(idA, fileName, deleteFile, enc);
5712 +    fontFile = t1Engine->loadType1Font(idA, src, enc);
5713    }
5714  #endif
5715  #if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
5716    if (!fontFile && ftEngine) {
5717 -    fontFile = ftEngine->loadType1Font(idA, fileName, deleteFile, enc);
5718 +    fontFile = ftEngine->loadType1Font(idA, src, enc);
5719    }
5720  #endif
5721  
5722 @@ -126,29 +126,26 @@
5723    // semantics, this will remove the last link; otherwise it will
5724    // return an error, leaving the file to be deleted later (if
5725    // loadXYZFont failed, the file will always be deleted)
5726 -  if (deleteFile) {
5727 -    unlink(fontFile ? fontFile->fileName->getCString() : fileName);
5728 -  }
5729 +  src->unref();
5730  #endif
5731  
5732    return fontFile;
5733  }
5734  
5735  SplashFontFile *SplashFontEngine::loadType1CFont(SplashFontFileID *idA,
5736 -                                                char *fileName,
5737 -                                                GBool deleteFile,
5738 +                                                SplashFontSrc *src,
5739                                                  char **enc) {
5740    SplashFontFile *fontFile;
5741  
5742    fontFile = NULL;
5743  #if HAVE_T1LIB_H
5744    if (!fontFile && t1Engine) {
5745 -    fontFile = t1Engine->loadType1CFont(idA, fileName, deleteFile, enc);
5746 +    fontFile = t1Engine->loadType1CFont(idA, src, enc);
5747    }
5748  #endif
5749  #if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
5750    if (!fontFile && ftEngine) {
5751 -    fontFile = ftEngine->loadType1CFont(idA, fileName, deleteFile, enc);
5752 +    fontFile = ftEngine->loadType1CFont(idA, src, enc);
5753    }
5754  #endif
5755  
5756 @@ -157,23 +154,20 @@
5757    // semantics, this will remove the last link; otherwise it will
5758    // return an error, leaving the file to be deleted later (if
5759    // loadXYZFont failed, the file will always be deleted)
5760 -  if (deleteFile) {
5761 -    unlink(fontFile ? fontFile->fileName->getCString() : fileName);
5762 -  }
5763 +  src->unref();
5764  #endif
5765  
5766    return fontFile;
5767  }
5768  
5769  SplashFontFile *SplashFontEngine::loadCIDFont(SplashFontFileID *idA,
5770 -                                             char *fileName,
5771 -                                             GBool deleteFile) {
5772 +                                             SplashFontSrc *src) {
5773    SplashFontFile *fontFile;
5774  
5775    fontFile = NULL;
5776  #if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
5777    if (!fontFile && ftEngine) {
5778 -    fontFile = ftEngine->loadCIDFont(idA, fileName, deleteFile);
5779 +    fontFile = ftEngine->loadCIDFont(idA, src);
5780    }
5781  #endif
5782  
5783 @@ -182,26 +176,24 @@
5784    // semantics, this will remove the last link; otherwise it will
5785    // return an error, leaving the file to be deleted later (if
5786    // loadXYZFont failed, the file will always be deleted)
5787 -  if (deleteFile) {
5788 -    unlink(fontFile ? fontFile->fileName->getCString() : fileName);
5789 -  }
5790 +  src->unref();
5791  #endif
5792  
5793    return fontFile;
5794  }
5795  
5796  SplashFontFile *SplashFontEngine::loadTrueTypeFont(SplashFontFileID *idA,
5797 -                                                  char *fileName,
5798 -                                                  GBool deleteFile,
5799 +                                                  SplashFontSrc *src,
5800                                                    Gushort *codeToGID,
5801 -                                                  int codeToGIDLen) {
5802 +                                                  int codeToGIDLen,
5803 +                                                  int faceIndex) {
5804    SplashFontFile *fontFile;
5805  
5806    fontFile = NULL;
5807  #if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
5808    if (!fontFile && ftEngine) {
5809 -    fontFile = ftEngine->loadTrueTypeFont(idA, fileName, deleteFile,
5810 -                                         codeToGID, codeToGIDLen);
5811 +    fontFile = ftEngine->loadTrueTypeFont(idA, src,
5812 +                                        codeToGID, codeToGIDLen, faceIndex);
5813    }
5814  #endif
5815  
5816 @@ -214,9 +206,7 @@
5817    // semantics, this will remove the last link; otherwise it will
5818    // return an error, leaving the file to be deleted later (if
5819    // loadXYZFont failed, the file will always be deleted)
5820 -  if (deleteFile) {
5821 -    unlink(fontFile ? fontFile->fileName->getCString() : fileName);
5822 -  }
5823 +  src->unref();
5824  #endif
5825  
5826    return fontFile;
5827 diff -Nur poppler.0_5_0/splash/SplashFontEngine.h poppler.HEAD/splash/SplashFontEngine.h
5828 --- poppler.0_5_0/splash/SplashFontEngine.h     2005-03-03 20:45:59.000000000 +0100
5829 +++ poppler.HEAD/splash/SplashFontEngine.h      2006-02-02 23:50:01.000000000 +0100
5830 @@ -19,6 +19,7 @@
5831  class SplashFontFile;
5832  class SplashFontFileID;
5833  class SplashFont;
5834 +class SplashFontSrc;
5835  
5836  //------------------------------------------------------------------------
5837  
5838 @@ -48,15 +49,12 @@
5839    SplashFontFile *getFontFile(SplashFontFileID *id);
5840  
5841    // Load fonts - these create new SplashFontFile objects.
5842 -  SplashFontFile *loadType1Font(SplashFontFileID *idA, char *fileName,
5843 -                               GBool deleteFile, char **enc);
5844 -  SplashFontFile *loadType1CFont(SplashFontFileID *idA, char *fileName,
5845 -                                GBool deleteFile, char **enc);
5846 -  SplashFontFile *loadCIDFont(SplashFontFileID *idA, char *fileName,
5847 -                             GBool deleteFile);
5848 -  SplashFontFile *loadTrueTypeFont(SplashFontFileID *idA, char *fileName,
5849 -                                  GBool deleteFile,
5850 -                                  Gushort *codeToGID, int codeToGIDLen);
5851 +  SplashFontFile *loadType1Font(SplashFontFileID *idA, SplashFontSrc *src, char **enc);
5852 +  SplashFontFile *loadType1CFont(SplashFontFileID *idA, SplashFontSrc *src, char **enc);
5853 +  SplashFontFile *loadCIDFont(SplashFontFileID *idA, SplashFontSrc *src);
5854 +  SplashFontFile *loadTrueTypeFont(SplashFontFileID *idA, SplashFontSrc *src,
5855 +                                  Gushort *codeToGID, int codeToGIDLen,
5856 +                                  int faceIndex=0);
5857  
5858    // Get a font - this does a cache lookup first, and if not found,
5859    // creates a new SplashFont object and adds it to the cache.  The
5860 diff -Nur poppler.0_5_0/splash/SplashFontFile.cc poppler.HEAD/splash/SplashFontFile.cc
5861 --- poppler.0_5_0/splash/SplashFontFile.cc      2005-12-08 19:17:42.000000000 +0100
5862 +++ poppler.HEAD/splash/SplashFontFile.cc       2006-02-02 23:50:01.000000000 +0100
5863 @@ -12,6 +12,7 @@
5864  
5865  #include <stdio.h>
5866  #include <unistd.h>
5867 +#include "goo/gmem.h"
5868  #include "goo/GooString.h"
5869  #include "SplashFontFile.h"
5870  #include "SplashFontFileID.h"
5871 @@ -26,19 +27,15 @@
5872  // SplashFontFile
5873  //------------------------------------------------------------------------
5874  
5875 -SplashFontFile::SplashFontFile(SplashFontFileID *idA, char *fileNameA,
5876 -                              GBool deleteFileA) {
5877 +SplashFontFile::SplashFontFile(SplashFontFileID *idA, SplashFontSrc *srcA) {
5878    id = idA;
5879 -  fileName = new GooString(fileNameA);
5880 -  deleteFile = deleteFileA;
5881 +  src = srcA;
5882 +  src->ref();
5883    refCnt = 0;
5884  }
5885  
5886  SplashFontFile::~SplashFontFile() {
5887 -  if (deleteFile) {
5888 -    unlink(fileName->getCString());
5889 -  }
5890 -  delete fileName;
5891 +  src->unref();
5892    delete id;
5893  }
5894  
5895 @@ -51,3 +48,60 @@
5896      delete this;
5897    }
5898  }
5899 +
5900 +//
5901 +
5902 +SplashFontSrc::SplashFontSrc() {
5903 +  isFile = gFalse;
5904 +  deleteSrc = gFalse;
5905 +  fileName = NULL;
5906 +  buf = NULL;
5907 +  refcnt = 1;
5908 +}
5909 +
5910 +SplashFontSrc::~SplashFontSrc() {
5911 +  if (deleteSrc) {
5912 +    if (isFile) {
5913 +      if (fileName)
5914 +       unlink(fileName->getCString());
5915 +    } else {
5916 +      if (buf)
5917 +       gfree(buf);
5918 +    }
5919 +  }
5920 +
5921 +  if (isFile && fileName)
5922 +    delete fileName;
5923 +}
5924 +
5925 +void SplashFontSrc::ref() {
5926 +  refcnt++;
5927 +}
5928 +
5929 +void SplashFontSrc::unref() {
5930 +  if (! --refcnt)
5931 +    delete this;
5932 +}
5933 +
5934 +void SplashFontSrc::setFile(GooString *file, GBool del)
5935 +{
5936 +  isFile = gTrue;
5937 +  fileName = file->copy();
5938 +  deleteSrc = del;
5939 +}
5940 +
5941 +void SplashFontSrc::setFile(const char *file, GBool del)
5942 +{
5943 +  isFile = gTrue;
5944 +  fileName = new GooString(file);
5945 +  deleteSrc = del;
5946 +}
5947 +
5948 +void SplashFontSrc::setBuf(char *bufA, int bufLenA, GBool del)
5949 +{
5950 +  isFile = gFalse;
5951 +  buf = bufA;
5952 +  bufLen = bufLenA;
5953 +  deleteSrc = del;
5954 +}
5955 +
5956 diff -Nur poppler.0_5_0/splash/SplashFontFile.h poppler.HEAD/splash/SplashFontFile.h
5957 --- poppler.0_5_0/splash/SplashFontFile.h       2005-03-03 20:45:59.000000000 +0100
5958 +++ poppler.HEAD/splash/SplashFontFile.h        2006-02-02 23:50:01.000000000 +0100
5959 @@ -23,6 +23,25 @@
5960  // SplashFontFile
5961  //------------------------------------------------------------------------
5962  
5963 +struct SplashFontSrc {
5964 +  SplashFontSrc();
5965 +  ~SplashFontSrc();
5966 +
5967 +  void setFile(GooString *file, GBool del);
5968 +  void setFile(const char *file, GBool del);
5969 +  void setBuf(char *bufA, int buflenA, GBool del);
5970 +
5971 +  void ref();
5972 +  void unref();
5973 +
5974 +  GBool isFile;
5975 +  GooString *fileName;
5976 +  char *buf;
5977 +  int bufLen;
5978 +  GBool deleteSrc;
5979 +  int refcnt;
5980 +};
5981 +
5982  class SplashFontFile {
5983  public:
5984  
5985 @@ -44,12 +63,10 @@
5986  
5987  protected:
5988  
5989 -  SplashFontFile(SplashFontFileID *idA, char *fileNameA,
5990 -                GBool deleteFileA);
5991 +  SplashFontFile(SplashFontFileID *idA, SplashFontSrc *srcA);
5992  
5993    SplashFontFileID *id;
5994 -  GooString *fileName;
5995 -  GBool deleteFile;
5996 +  SplashFontSrc *src;
5997    int refCnt;
5998  
5999    friend class SplashFontEngine;
6000 diff -Nur poppler.0_5_0/splash/SplashFTFont.cc poppler.HEAD/splash/SplashFTFont.cc
6001 --- poppler.0_5_0/splash/SplashFTFont.cc        2005-11-17 22:37:34.000000000 +0100
6002 +++ poppler.HEAD/splash/SplashFTFont.cc 2006-01-23 15:45:30.000000000 +0100
6003 @@ -19,7 +19,8 @@
6004  
6005  #include <ft2build.h>
6006  #include FT_OUTLINE_H
6007 -#include FT_INTERNAL_OBJECTS_H // needed for FT_New_Size decl
6008 +#include FT_SIZES_H
6009 +#include FT_GLYPH_H
6010  #include "goo/gmem.h"
6011  #include "SplashMath.h"
6012  #include "SplashGlyphBitmap.h"
6013 diff -Nur poppler.0_5_0/splash/SplashFTFontEngine.cc poppler.HEAD/splash/SplashFTFontEngine.cc
6014 --- poppler.0_5_0/splash/SplashFTFontEngine.cc  2005-12-08 19:17:42.000000000 +0100
6015 +++ poppler.HEAD/splash/SplashFTFontEngine.cc   2006-02-02 23:50:01.000000000 +0100
6016 @@ -64,22 +64,19 @@
6017  }
6018  
6019  SplashFontFile *SplashFTFontEngine::loadType1Font(SplashFontFileID *idA,
6020 -                                                 char *fileName,
6021 -                                                 GBool deleteFile,
6022 +                                                 SplashFontSrc *src,
6023                                                   char **enc) {
6024 -  return SplashFTFontFile::loadType1Font(this, idA, fileName, deleteFile, enc);
6025 +  return SplashFTFontFile::loadType1Font(this, idA, src, enc);
6026  }
6027  
6028  SplashFontFile *SplashFTFontEngine::loadType1CFont(SplashFontFileID *idA,
6029 -                                                  char *fileName,
6030 -                                                  GBool deleteFile,
6031 +                                                  SplashFontSrc *src,
6032                                                    char **enc) {
6033 -  return SplashFTFontFile::loadType1Font(this, idA, fileName, deleteFile, enc);
6034 +  return SplashFTFontFile::loadType1Font(this, idA, src, enc);
6035  }
6036  
6037  SplashFontFile *SplashFTFontEngine::loadCIDFont(SplashFontFileID *idA,
6038 -                                               char *fileName,
6039 -                                               GBool deleteFile) {
6040 +                                               SplashFontSrc *src) {
6041    FoFiType1C *ff;
6042    Gushort *cidToGIDMap;
6043    int nCIDs;
6044 @@ -89,15 +86,21 @@
6045    if (useCIDs) {
6046      cidToGIDMap = NULL;
6047      nCIDs = 0;
6048 -  } else if ((ff = FoFiType1C::load(fileName))) {
6049 +  } else {
6050 +    if (src->isFile) {
6051 +      ff = FoFiType1C::load(src->fileName->getCString());
6052 +    } else {
6053 +      ff = new FoFiType1C(src->buf, src->bufLen, gFalse);
6054 +    }
6055 +    if (ff) {
6056      cidToGIDMap = ff->getCIDToGIDMap(&nCIDs);
6057      delete ff;
6058    } else {
6059      cidToGIDMap = NULL;
6060      nCIDs = 0;
6061    }
6062 -  ret = SplashFTFontFile::loadCIDFont(this, idA, fileName, deleteFile,
6063 -                                     cidToGIDMap, nCIDs);
6064 +  }
6065 +  ret = SplashFTFontFile::loadCIDFont(this, idA, src, cidToGIDMap, nCIDs);
6066    if (!ret) {
6067      gfree(cidToGIDMap);
6068    }
6069 @@ -105,16 +108,17 @@
6070  }
6071  
6072  SplashFontFile *SplashFTFontEngine::loadTrueTypeFont(SplashFontFileID *idA,
6073 -                                                    char *fileName,
6074 -                                                    GBool deleteFile,
6075 +                                                    SplashFontSrc *src,
6076                                                      Gushort *codeToGID,
6077 -                                                    int codeToGIDLen) {
6078 +                                                    int codeToGIDLen,
6079 +                                                    int faceIndex) {
6080 +#if 0
6081    FoFiTrueType *ff;
6082    GooString *tmpFileName;
6083    FILE *tmpFile;
6084    SplashFontFile *ret;
6085  
6086 -  if (!(ff = FoFiTrueType::load(fileName))) {
6087 +  if (!(ff = FoFiTrueType::load(fileName, faceIndex))) {
6088      return NULL;
6089    }
6090    tmpFileName = NULL;
6091 @@ -127,7 +131,8 @@
6092    fclose(tmpFile);
6093    ret = SplashFTFontFile::loadTrueTypeFont(this, idA,
6094                                            tmpFileName->getCString(),
6095 -                                          gTrue, codeToGID, codeToGIDLen);
6096 +                                          gTrue, codeToGID, codeToGIDLen,
6097 +                                          faceIndex);
6098    if (ret) {
6099      if (deleteFile) {
6100        unlink(fileName);
6101 @@ -137,6 +142,13 @@
6102    }
6103    delete tmpFileName;
6104    return ret;
6105 +#else
6106 +  SplashFontFile *ret;
6107 +  ret = SplashFTFontFile::loadTrueTypeFont(this, idA, src,
6108 +                                          codeToGID, codeToGIDLen,
6109 +                                          faceIndex);
6110 +  return ret;
6111 +#endif
6112  }
6113  
6114  #endif // HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
6115 diff -Nur poppler.0_5_0/splash/SplashFTFontEngine.h poppler.HEAD/splash/SplashFTFontEngine.h
6116 --- poppler.0_5_0/splash/SplashFTFontEngine.h   2005-09-16 00:09:50.000000000 +0200
6117 +++ poppler.HEAD/splash/SplashFTFontEngine.h    2006-02-02 23:50:01.000000000 +0100
6118 @@ -19,6 +19,7 @@
6119  
6120  class SplashFontFile;
6121  class SplashFontFileID;
6122 +class SplashFontSrc;
6123  
6124  //------------------------------------------------------------------------
6125  // SplashFTFontEngine
6126 @@ -32,15 +33,12 @@
6127    ~SplashFTFontEngine();
6128  
6129    // Load fonts.
6130 -  SplashFontFile *loadType1Font(SplashFontFileID *idA, char *fileName,
6131 -                               GBool deleteFile, char **enc);
6132 -  SplashFontFile *loadType1CFont(SplashFontFileID *idA, char *fileName,
6133 -                                GBool deleteFile, char **enc);
6134 -  SplashFontFile *loadCIDFont(SplashFontFileID *idA, char *fileName,
6135 -                             GBool deleteFile);
6136 -  SplashFontFile *loadTrueTypeFont(SplashFontFileID *idA, char *fileName,
6137 -                                  GBool deleteFile,
6138 -                                  Gushort *codeToGID, int codeToGIDLen);
6139 +  SplashFontFile *loadType1Font(SplashFontFileID *idA, SplashFontSrc *src, char **enc);
6140 +  SplashFontFile *loadType1CFont(SplashFontFileID *idA, SplashFontSrc *src, char **enc);
6141 +  SplashFontFile *loadCIDFont(SplashFontFileID *idA, SplashFontSrc *src);
6142 +  SplashFontFile *loadTrueTypeFont(SplashFontFileID *idA, SplashFontSrc *src,
6143 +                                  Gushort *codeToGID, int codeToGIDLen,
6144 +                                  int faceIndex=0);
6145  
6146  private:
6147  
6148 diff -Nur poppler.0_5_0/splash/SplashFTFontFile.cc poppler.HEAD/splash/SplashFTFontFile.cc
6149 --- poppler.0_5_0/splash/SplashFTFontFile.cc    2005-08-27 10:43:43.000000000 +0200
6150 +++ poppler.HEAD/splash/SplashFTFontFile.cc     2006-02-02 23:50:01.000000000 +0100
6151 @@ -13,6 +13,7 @@
6152  #endif
6153  
6154  #include "goo/gmem.h"
6155 +#include "goo/GooString.h"
6156  #include "SplashFTFontEngine.h"
6157  #include "SplashFTFont.h"
6158  #include "SplashFTFontFile.h"
6159 @@ -23,16 +24,19 @@
6160  
6161  SplashFontFile *SplashFTFontFile::loadType1Font(SplashFTFontEngine *engineA,
6162                                                 SplashFontFileID *idA,
6163 -                                               char *fileNameA,
6164 -                                               GBool deleteFileA,
6165 +                                               SplashFontSrc *src,
6166                                                 char **encA) {
6167    FT_Face faceA;
6168    Gushort *codeToGIDA;
6169    char *name;
6170    int i;
6171  
6172 -  if (FT_New_Face(engineA->lib, fileNameA, 0, &faceA)) {
6173 -    return NULL;
6174 +  if (src->isFile) {
6175 +    if (FT_New_Face(engineA->lib, src->fileName->getCString(), 0, &faceA))
6176 +      return NULL;
6177 +  } else {
6178 +    if (FT_New_Memory_Face(engineA->lib, (const FT_Byte *)src->buf, src->bufLen, 0, &faceA))
6179 +      return NULL;
6180    }
6181    codeToGIDA = (Gushort *)gmallocn(256, sizeof(int));
6182    for (i = 0; i < 256; ++i) {
6183 @@ -42,48 +46,55 @@
6184      }
6185    }
6186  
6187 -  return new SplashFTFontFile(engineA, idA, fileNameA, deleteFileA,
6188 +  return new SplashFTFontFile(engineA, idA, src,
6189                               faceA, codeToGIDA, 256);
6190  }
6191  
6192  SplashFontFile *SplashFTFontFile::loadCIDFont(SplashFTFontEngine *engineA,
6193                                               SplashFontFileID *idA,
6194 -                                             char *fileNameA,
6195 -                                             GBool deleteFileA,
6196 +                                             SplashFontSrc *src,
6197                                               Gushort *codeToGIDA,
6198                                               int codeToGIDLenA) {
6199    FT_Face faceA;
6200  
6201 -  if (FT_New_Face(engineA->lib, fileNameA, 0, &faceA)) {
6202 -    return NULL;
6203 +  if (src->isFile) {
6204 +    if (FT_New_Face(engineA->lib, src->fileName->getCString(), 0, &faceA))
6205 +      return NULL;
6206 +  } else {
6207 +    if (FT_New_Memory_Face(engineA->lib, (const FT_Byte *)src->buf, src->bufLen, 0, &faceA))
6208 +      return NULL;
6209    }
6210  
6211 -  return new SplashFTFontFile(engineA, idA, fileNameA, deleteFileA,
6212 +  return new SplashFTFontFile(engineA, idA, src,
6213                               faceA, codeToGIDA, codeToGIDLenA);
6214  }
6215  
6216  SplashFontFile *SplashFTFontFile::loadTrueTypeFont(SplashFTFontEngine *engineA,
6217                                                    SplashFontFileID *idA,
6218 -                                                  char *fileNameA,
6219 -                                                  GBool deleteFileA,
6220 +                                                  SplashFontSrc *src,
6221                                                    Gushort *codeToGIDA,
6222 -                                                  int codeToGIDLenA) {
6223 +                                                  int codeToGIDLenA,
6224 +                                                  int faceIndexA) {
6225    FT_Face faceA;
6226  
6227 -  if (FT_New_Face(engineA->lib, fileNameA, 0, &faceA)) {
6228 -    return NULL;
6229 +  if (src->isFile) {
6230 +    if (FT_New_Face(engineA->lib, src->fileName->getCString(), faceIndexA, &faceA))
6231 +      return NULL;
6232 +  } else {
6233 +    if (FT_New_Memory_Face(engineA->lib, (const FT_Byte *)src->buf, src->bufLen, faceIndexA, &faceA))
6234 +      return NULL;
6235    }
6236  
6237 -  return new SplashFTFontFile(engineA, idA, fileNameA, deleteFileA,
6238 +  return new SplashFTFontFile(engineA, idA, src,
6239                               faceA, codeToGIDA, codeToGIDLenA);
6240  }
6241  
6242  SplashFTFontFile::SplashFTFontFile(SplashFTFontEngine *engineA,
6243                                    SplashFontFileID *idA,
6244 -                                  char *fileNameA, GBool deleteFileA,
6245 +                                  SplashFontSrc *srcA,
6246                                    FT_Face faceA,
6247                                    Gushort *codeToGIDA, int codeToGIDLenA):
6248 -  SplashFontFile(idA, fileNameA, deleteFileA)
6249 +  SplashFontFile(idA, srcA)
6250  {
6251    engine = engineA;
6252    face = faceA;
6253 diff -Nur poppler.0_5_0/splash/SplashFTFontFile.h poppler.HEAD/splash/SplashFTFontFile.h
6254 --- poppler.0_5_0/splash/SplashFTFontFile.h     2005-03-03 20:45:59.000000000 +0100
6255 +++ poppler.HEAD/splash/SplashFTFontFile.h      2006-02-02 23:50:01.000000000 +0100
6256 @@ -28,18 +28,18 @@
6257  public:
6258  
6259    static SplashFontFile *loadType1Font(SplashFTFontEngine *engineA,
6260 -                                      SplashFontFileID *idA, char *fileNameA,
6261 -                                      GBool deleteFileA, char **encA);
6262 +                                      SplashFontFileID *idA,
6263 +                                      SplashFontSrc *src, char **encA);
6264    static SplashFontFile *loadCIDFont(SplashFTFontEngine *engineA,
6265 -                                    SplashFontFileID *idA, char *fileNameA,
6266 -                                    GBool deleteFileA,
6267 -                                    Gushort *codeToCIDA, int codeToGIDLenA);
6268 +                                        SplashFontFileID *idA,
6269 +                                        SplashFontSrc *src,
6270 +                                        Gushort *codeToCIDA, int codeToGIDLenA);
6271    static SplashFontFile *loadTrueTypeFont(SplashFTFontEngine *engineA,
6272                                           SplashFontFileID *idA,
6273 -                                         char *fileNameA,
6274 -                                         GBool deleteFileA,
6275 +                                         SplashFontSrc *src,
6276                                           Gushort *codeToGIDA,
6277 -                                         int codeToGIDLenA);
6278 +                                         int codeToGIDLenA,
6279 +                                         int faceIndexA=0);
6280  
6281    virtual ~SplashFTFontFile();
6282  
6283 @@ -51,7 +51,7 @@
6284  
6285    SplashFTFontFile(SplashFTFontEngine *engineA,
6286                    SplashFontFileID *idA,
6287 -                  char *fileNameA, GBool deleteFileA,
6288 +                  SplashFontSrc *srcA,
6289                    FT_Face faceA,
6290                    Gushort *codeToGIDA, int codeToGIDLenA);
6291  
6292 diff -Nur poppler.0_5_0/splash/SplashT1FontEngine.cc poppler.HEAD/splash/SplashT1FontEngine.cc
6293 --- poppler.0_5_0/splash/SplashT1FontEngine.cc  2005-03-03 20:46:00.000000000 +0100
6294 +++ poppler.HEAD/splash/SplashT1FontEngine.cc   2006-02-02 23:50:01.000000000 +0100
6295 @@ -82,22 +82,26 @@
6296  }
6297  
6298  SplashFontFile *SplashT1FontEngine::loadType1Font(SplashFontFileID *idA,
6299 -                                                 char *fileName,
6300 -                                                 GBool deleteFile,
6301 +                                                 SplashFontSrc *src,
6302                                                   char **enc) {
6303 -  return SplashT1FontFile::loadType1Font(this, idA, fileName, deleteFile, enc);
6304 +  return SplashT1FontFile::loadType1Font(this, idA, src, enc);
6305  }
6306  
6307  SplashFontFile *SplashT1FontEngine::loadType1CFont(SplashFontFileID *idA,
6308 -                                                  char *fileName,
6309 -                                                  GBool deleteFile,
6310 +                                                  SplashFontSrc *src,
6311                                                    char **enc) {
6312    FoFiType1C *ff;
6313    GooString *tmpFileName;
6314    FILE *tmpFile;
6315    SplashFontFile *ret;
6316  
6317 -  if (!(ff = FoFiType1C::load(fileName))) {
6318 +  SplashFontSrc *newsrc;
6319 +  
6320 +  if (src->isFile)
6321 +    ff = FoFiType1C::load(src->fileName);
6322 +  else
6323 +    ff = new FoFiType1C(src->buf, src->bufLen, gFalse);
6324 +  if (! ff)
6325      return NULL;
6326    }
6327    tmpFileName = NULL;
6328 @@ -108,16 +112,11 @@
6329    ff->convertToType1(NULL, gTrue, &fileWrite, tmpFile);
6330    delete ff;
6331    fclose(tmpFile);
6332 -  ret = SplashT1FontFile::loadType1Font(this, idA, tmpFileName->getCString(),
6333 -                                       gTrue, enc);
6334 -  if (ret) {
6335 -    if (deleteFile) {
6336 -      unlink(fileName);
6337 -    }
6338 -  } else {
6339 -    unlink(tmpFileName->getCString());
6340 -  }
6341 +  newsrc = new SplashFontSrc;
6342 +  newsrc->setFile(tmpFileName, gTrue);
6343    delete tmpFileName;
6344 +  ret = SplashT1FontFile::loadType1Font(this, idA, newsrc, enc);
6345 +  newsrc->unref();
6346    return ret;
6347  }
6348  
6349 diff -Nur poppler.0_5_0/splash/SplashT1FontFile.cc poppler.HEAD/splash/SplashT1FontFile.cc
6350 --- poppler.0_5_0/splash/SplashT1FontFile.cc    2005-08-27 10:43:43.000000000 +0200
6351 +++ poppler.HEAD/splash/SplashT1FontFile.cc     2006-02-02 23:50:01.000000000 +0100
6352 @@ -25,8 +25,7 @@
6353  
6354  SplashFontFile *SplashT1FontFile::loadType1Font(SplashT1FontEngine *engineA,
6355                                                 SplashFontFileID *idA,
6356 -                                               char *fileNameA,
6357 -                                               GBool deleteFileA,
6358 +                                               SplashFontSrc *src,
6359                                                 char **encA) {
6360    int t1libIDA;
6361    char **encTmp;
6362 @@ -34,9 +33,27 @@
6363    int encStrSize;
6364    char *encPtr;
6365    int i;
6366 -
6367 +  GString *fileNameA;
6368 +  SplashFontSrc *newsrc = NULL;
6369 +  SplashFontFile *ff;
6370 +
6371 +  if (! src->isFile) {
6372 +    GString *tmpFileName;
6373 +    FILE *tmpFile;
6374 +    if (!openTempFile(&tmpFileName, &tmpFile, "wb", NULL))
6375 +      return NULL;
6376 +    fwrite(src->buf, 1, src->bufLen, tmpFile);
6377 +    fclose(tmpFile);
6378 +    newsrc = new SplashFontSrc;
6379 +    newsrc->setFile(tmpFileName, gTrue);
6380 +    src = newsrc;
6381 +    delete tmpFileName;
6382 +  }
6383 +  fileNameA = src->fileName;
6384    // load the font file
6385    if ((t1libIDA = T1_AddFont(fileNameA)) < 0) {
6386 +    if (newsrc)
6387 +      delete newsrc;
6388      return NULL;
6389    }
6390    T1_LoadFont(t1libIDA);
6391 @@ -63,15 +80,18 @@
6392    encTmp[256] = "custom";
6393    T1_ReencodeFont(t1libIDA, encTmp);
6394  
6395 -  return new SplashT1FontFile(engineA, idA, fileNameA, deleteFileA,
6396 +  ff = new SplashT1FontFile(engineA, idA, src,
6397                               t1libIDA, encTmp, encStrTmp);
6398 +  if (newsrc)
6399 +    newsrc->unref();
6400 +  return ff;
6401  }
6402  
6403  SplashT1FontFile::SplashT1FontFile(SplashT1FontEngine *engineA,
6404                                    SplashFontFileID *idA,
6405 -                                  char *fileNameA, GBool deleteFileA,
6406 +                                  SplashFontSrc *srcA,
6407                                    int t1libIDA, char **encA, char *encStrA):
6408 -  SplashFontFile(idA, fileNameA, deleteFileA)
6409 +  SplashFontFile(idA, srcA)
6410  {
6411    engine = engineA;
6412    t1libID = t1libIDA;
6413 diff -Nur poppler.0_5_0/splash/SplashT1FontFile.h poppler.HEAD/splash/SplashT1FontFile.h
6414 --- poppler.0_5_0/splash/SplashT1FontFile.h     2005-03-03 20:45:59.000000000 +0100
6415 +++ poppler.HEAD/splash/SplashT1FontFile.h      2006-02-02 23:50:01.000000000 +0100
6416 @@ -26,7 +26,7 @@
6417  
6418    static SplashFontFile *loadType1Font(SplashT1FontEngine *engineA,
6419                                        SplashFontFileID *idA,
6420 -                                      char *fileNameA, GBool deleteFileA,
6421 +                                      SplashFontSrc *src,
6422                                        char **encA);
6423  
6424    virtual ~SplashT1FontFile();
6425 @@ -39,7 +39,7 @@
6426  
6427    SplashT1FontFile(SplashT1FontEngine *engineA,
6428                    SplashFontFileID *idA,
6429 -                  char *fileNameA, GBool deleteFileA,
6430 +                  SplashFontSrc *src,
6431                    int t1libIDA, char **encA, char *encStrA);
6432  
6433    SplashT1FontEngine *engine;
6434 diff -Nur poppler.0_5_0/splash/SplashTypes.h poppler.HEAD/splash/SplashTypes.h
6435 --- poppler.0_5_0/splash/SplashTypes.h  2005-10-30 21:29:05.000000000 +0100
6436 +++ poppler.HEAD/splash/SplashTypes.h   2006-02-06 21:49:21.000000000 +0100
6437 @@ -14,7 +14,7 @@
6438  //------------------------------------------------------------------------
6439  
6440  #if USE_FIXEDPOINT
6441 -#include "FixedPoint.h"
6442 +#include "goo/FixedPoint.h"
6443  typedef FixedPoint SplashCoord;
6444  #else
6445  typedef double SplashCoord;
6446 diff -Nur poppler.0_5_0/splash/SplashXPathScanner.cc poppler.HEAD/splash/SplashXPathScanner.cc
6447 --- poppler.0_5_0/splash/SplashXPathScanner.cc  2005-10-16 16:19:47.000000000 +0200
6448 +++ poppler.HEAD/splash/SplashXPathScanner.cc   2006-02-03 00:06:20.000000000 +0100
6449 @@ -186,7 +186,7 @@
6450  }
6451  
6452  void SplashXPathScanner::computeIntersections(int y) {
6453 -  SplashCoord ySegMin, ySegMax, xx0, xx1;
6454 +  SplashCoord xSegMin, xSegMax, ySegMin, ySegMax, xx0, xx1;
6455    SplashXPathSeg *seg;
6456    int i, j;
6457  
6458 @@ -236,19 +236,27 @@
6459      } else if (seg->flags & splashXPathVert) {
6460        xx0 = xx1 = seg->x0;
6461      } else {
6462 -      if (ySegMin <= y) {
6463 -       // intersection with top edge
6464 -       xx0 = seg->x0 + ((SplashCoord)y - seg->y0) * seg->dxdy;
6465 +      if (seg->x0 < seg->x1) {
6466 +       xSegMin = seg->x0;
6467 +       xSegMax = seg->x1;
6468        } else {
6469 -       // x coord of segment endpoint with min y coord
6470 -       xx0 = (seg->flags & splashXPathFlip) ? seg->x1 : seg->x0;
6471 +       xSegMin = seg->x1;
6472 +       xSegMax = seg->x0;
6473        }
6474 -      if (ySegMax >= y + 1) {
6475 -       // intersection with bottom edge
6476 -       xx1 = seg->x0 + ((SplashCoord)y + 1 - seg->y0) * seg->dxdy;
6477 -      } else {
6478 -       // x coord of segment endpoint with max y coord
6479 -       xx1 = (seg->flags & splashXPathFlip) ? seg->x0 : seg->x1;
6480 +      // intersection with top edge
6481 +      xx0 = seg->x0 + ((SplashCoord)y - seg->y0) * seg->dxdy;
6482 +      // intersection with bottom edge
6483 +      xx1 = seg->x0 + ((SplashCoord)y + 1 - seg->y0) * seg->dxdy;
6484 +      // the segment may not actually extend to the top and/or bottom edges
6485 +      if (xx0 < xSegMin) {
6486 +       xx0 = xSegMin;
6487 +      } else if (xx0 > xSegMax) {
6488 +       xx0 = xSegMax;
6489 +      }
6490 +      if (xx1 < xSegMin) {
6491 +       xx1 = xSegMin;
6492 +      } else if (xx1 > xSegMax) {
6493 +       xx1 = xSegMax;
6494        }
6495      }
6496      if (xx0 < xx1) {
6497 diff -Nur poppler.0_5_0/TODO poppler.HEAD/TODO
6498 --- poppler.0_5_0/TODO  2005-04-05 04:49:18.000000000 +0200
6499 +++ poppler.HEAD/TODO   2006-01-21 22:56:40.000000000 +0100
6500 @@ -42,3 +42,13 @@
6501  
6502           [ This will go away again once we get the wrappers done. ]
6503  
6504 +Jeff Muizelaar's TODO:
6505 +       Short Term:
6506 +       - factor out some of the color conversion code from CairoOutputDev and ArthurOutputDev.
6507 +       - add CairoOutputDev::drawSoftMaskedImage. (done, but too messy)
6508 +       - fix CairoOutputDev asking cairo to draw nonexistant glyphs.
6509 +       - fix patterned text fills.
6510 +       - merge kpdf's ttc support code.
6511 +       Long Term:
6512 +       - use cairo glyph cache for type3 fonts.
6513 +       - try to use cairo pattern support.
6514 diff -Nur poppler.0_5_0/utils/HtmlOutputDev.cc poppler.HEAD/utils/HtmlOutputDev.cc
6515 --- poppler.0_5_0/utils/HtmlOutputDev.cc        2005-12-30 22:59:58.000000000 +0100
6516 +++ poppler.HEAD/utils/HtmlOutputDev.cc 2006-01-23 16:40:54.000000000 +0100
6517 @@ -14,6 +14,7 @@
6518  #pragma implementation
6519  #endif
6520  
6521 +#include "config.h"
6522  #include <stdio.h>
6523  #include <stdlib.h>
6524  #include <stdarg.h>
6525 @@ -24,7 +25,6 @@
6526  #include "goo/GooList.h"
6527  #include "UnicodeMap.h"
6528  #include "goo/gmem.h"
6529 -#include "config.h"
6530  #include "Error.h"
6531  #include "GfxState.h"
6532  #ifdef ENABLE_LIBJPEG
6533 @@ -33,6 +33,7 @@
6534  #include "GlobalParams.h"
6535  #include "HtmlOutputDev.h"
6536  #include "HtmlFonts.h"
6537 +#include "UGooString.h"
6538  
6539  int HtmlPage::pgNum=0;
6540  int HtmlOutputDev::imgNum=1;
6541 diff -Nur poppler.0_5_0/utils/ImageOutputDev.cc poppler.HEAD/utils/ImageOutputDev.cc
6542 --- poppler.0_5_0/utils/ImageOutputDev.cc       2005-12-30 22:59:58.000000000 +0100
6543 +++ poppler.HEAD/utils/ImageOutputDev.cc        2006-01-23 16:40:54.000000000 +0100
6544 @@ -6,6 +6,7 @@
6545  //
6546  //========================================================================
6547  
6548 +#include "config.h"
6549  #include <poppler-config.h>
6550  
6551  #ifdef USE_GCC_PRAGMAS
6552 @@ -17,7 +18,6 @@
6553  #include <stddef.h>
6554  #include <ctype.h>
6555  #include "goo/gmem.h"
6556 -#include "config.h"
6557  #include "Error.h"
6558  #include "GfxState.h"
6559  #include "Object.h"
6560 diff -Nur poppler.0_5_0/utils/Makefile.am poppler.HEAD/utils/Makefile.am
6561 --- poppler.0_5_0/utils/Makefile.am     2006-01-06 11:05:59.000000000 +0100
6562 +++ poppler.HEAD/utils/Makefile.am      2006-02-23 23:26:05.000000000 +0100
6563 @@ -13,7 +13,10 @@
6564         pdfinfo                                 \
6565         pdftops                                 \
6566         pdftotext                               \
6567 -       pdftohtml
6568 +       pdftohtml                               \
6569 +       $(pdftoppm_binary)
6570 +
6571 +EXTRA_DIST = pdf2xml.dtd
6572  
6573  dist_man1_MANS =                               \
6574         pdffonts.1                              \
6575 @@ -21,7 +24,9 @@
6576         pdfinfo.1                               \
6577         pdftops.1                               \
6578         pdftotext.1                             \
6579 -       pdftohtml.1
6580 +       pdftohtml.1                             \
6581 +       $(pdftoppm_manpage)
6582 +       
6583  
6584  common = parseargs.c parseargs.h
6585  
6586 @@ -56,3 +61,15 @@
6587         HtmlOutputDev.cc                        \
6588         HtmlOutputDev.h                         \
6589         $(common)
6590 +
6591 +if BUILD_SPLASH_OUTPUT
6592 +
6593 +pdftoppm_SOURCES =                             \
6594 +       pdftoppm.cc                             \
6595 +       $(common)
6596 +
6597 +pdftoppm_binary = pdftoppm
6598 +
6599 +pdftoppm_manpage =pdftoppm.1
6600 +
6601 +endif
6602 \ No hi ha cap caràcter de salt de línia al final del fitxer
6603 diff -Nur poppler.0_5_0/utils/pdf2xml.dtd poppler.HEAD/utils/pdf2xml.dtd
6604 --- poppler.0_5_0/utils/pdf2xml.dtd     1970-01-01 01:00:00.000000000 +0100
6605 +++ poppler.HEAD/utils/pdf2xml.dtd      2006-02-04 21:31:00.000000000 +0100
6606 @@ -0,0 +1,28 @@
6607 +<?xml version="1.0"?>
6608 +<!ELEMENT pdf2xml (page+)>
6609 +<!ELEMENT page (fontspec*, text*)>
6610 +<!ATTLIST page
6611 +       number CDATA #REQUIRED
6612 +       position CDATA #REQUIRED
6613 +       top CDATA #REQUIRED
6614 +       left CDATA #REQUIRED
6615 +       height CDATA #REQUIRED
6616 +       width CDATA #REQUIRED
6617 +>
6618 +<!ELEMENT fontspec EMPTY>
6619 +<!ATTLIST fontspec
6620 +       id CDATA #REQUIRED
6621 +       size CDATA #REQUIRED
6622 +       family CDATA #REQUIRED
6623 +       color CDATA #REQUIRED
6624 +>
6625 +<!ELEMENT text (#PCDATA | b | i)*>
6626 +<!ATTLIST text
6627 +       top CDATA #REQUIRED
6628 +       left CDATA #REQUIRED
6629 +       width CDATA #REQUIRED
6630 +       height CDATA #REQUIRED
6631 +       font CDATA #REQUIRED
6632 +>
6633 +<!ELEMENT b (#PCDATA)>
6634 +<!ELEMENT i (#PCDATA)>
6635 diff -Nur poppler.0_5_0/utils/pdffonts.cc poppler.HEAD/utils/pdffonts.cc
6636 --- poppler.0_5_0/utils/pdffonts.cc     2005-12-12 21:15:11.000000000 +0100
6637 +++ poppler.HEAD/utils/pdffonts.cc      2006-01-23 16:40:54.000000000 +0100
6638 @@ -6,6 +6,7 @@
6639  //
6640  //========================================================================
6641  
6642 +#include "config.h"
6643  #include <poppler-config.h>
6644  #include <stdio.h>
6645  #include <stdlib.h>
6646 @@ -22,7 +23,7 @@
6647  #include "GfxFont.h"
6648  #include "Annot.h"
6649  #include "PDFDoc.h"
6650 -#include "config.h"
6651 +#include "UGooString.h"
6652  
6653  static char *fontTypeNames[] = {
6654    "unknown",
6655 diff -Nur poppler.0_5_0/utils/pdfimages.cc poppler.HEAD/utils/pdfimages.cc
6656 --- poppler.0_5_0/utils/pdfimages.cc    2005-12-12 21:15:11.000000000 +0100
6657 +++ poppler.HEAD/utils/pdfimages.cc     2006-01-23 16:40:54.000000000 +0100
6658 @@ -8,6 +8,7 @@
6659  //
6660  //========================================================================
6661  
6662 +#include "config.h"
6663  #include <poppler-config.h>
6664  #include <stdio.h>
6665  #include <stdlib.h>
6666 @@ -27,7 +28,6 @@
6667  #include "PDFDoc.h"
6668  #include "ImageOutputDev.h"
6669  #include "Error.h"
6670 -#include "config.h"
6671  
6672  static int firstPage = 1;
6673  static int lastPage = 0;
6674 diff -Nur poppler.0_5_0/utils/pdfinfo.cc poppler.HEAD/utils/pdfinfo.cc
6675 --- poppler.0_5_0/utils/pdfinfo.cc      2005-12-12 21:15:11.000000000 +0100
6676 +++ poppler.HEAD/utils/pdfinfo.cc       2006-01-23 16:40:54.000000000 +0100
6677 @@ -6,6 +6,7 @@
6678  //
6679  //========================================================================
6680  
6681 +#include "config.h"
6682  #include <poppler-config.h>
6683  #include <stdio.h>
6684  #include <stdlib.h>
6685 @@ -28,7 +29,7 @@
6686  #include "CharTypes.h"
6687  #include "UnicodeMap.h"
6688  #include "Error.h"
6689 -#include "config.h"
6690 +#include "UGooString.h"
6691  
6692  static void printInfoString(Dict *infoDict, char *key, char *text,
6693                             UnicodeMap *uMap);
6694 diff -Nur poppler.0_5_0/utils/pdftohtml.cc poppler.HEAD/utils/pdftohtml.cc
6695 --- poppler.0_5_0/utils/pdftohtml.cc    2005-12-12 21:15:11.000000000 +0100
6696 +++ poppler.HEAD/utils/pdftohtml.cc     2006-01-23 19:52:48.000000000 +0100
6697 @@ -6,12 +6,13 @@
6698  // Copyright 1999-2000 G. Ovtcharov
6699  //========================================================================
6700  
6701 +#include "config.h"
6702 +#include <poppler-config.h>
6703  #include <stdio.h>
6704  #include <stdlib.h>
6705  #include <stddef.h>
6706  #include <string.h>
6707  #include <dirent.h>
6708 -#include <poppler-config.h>
6709  #include <time.h>
6710  #include "parseargs.h"
6711  #include "goo/GooString.h"
6712 @@ -28,7 +29,7 @@
6713  #include "PSOutputDev.h"
6714  #include "GlobalParams.h"
6715  #include "Error.h"
6716 -#include "config.h"
6717 +#include "UGooString.h"
6718  #include "goo/gfile.h"
6719  
6720  #ifndef GHOSTSCRIPT
6721 @@ -315,12 +316,10 @@
6722      psFileName = new GooString(htmlFileName->getCString());
6723      psFileName->append(".ps");
6724  
6725 -    globalParams->setPSPaperWidth(w);
6726 -    globalParams->setPSPaperHeight(h);
6727      // XXX
6728      // globalParams->setPSNoText(gTrue);
6729      psOut = new PSOutputDev(psFileName->getCString(), doc->getXRef(),
6730 -                           doc->getCatalog(), firstPage, lastPage, psModePS);
6731 +                           doc->getCatalog(), firstPage, lastPage, psModePS, w, h);
6732      doc->displayPages(psOut, firstPage, lastPage, 72, 72, 0,
6733                       gTrue, gFalse, gFalse);
6734      delete psOut;
6735 diff -Nur poppler.0_5_0/utils/pdftoppm.1 poppler.HEAD/utils/pdftoppm.1
6736 --- poppler.0_5_0/utils/pdftoppm.1      1970-01-01 01:00:00.000000000 +0100
6737 +++ poppler.HEAD/utils/pdftoppm.1       2005-12-12 21:15:11.000000000 +0100
6738 @@ -0,0 +1,113 @@
6739 +.\" Copyright 2004 Glyph & Cog, LLC
6740 +.TH pdftoppm 1 "22 January 2004"
6741 +.SH NAME
6742 +pdftoppm \- Portable Document Format (PDF) to Portable Pixmap (PPM)
6743 +converter (version 3.00)
6744 +.SH SYNOPSIS
6745 +.B pdftoppm
6746 +[options]
6747 +.I PDF-file PPM-root
6748 +.SH DESCRIPTION
6749 +.B Pdftoppm
6750 +converts Portable Document Format (PDF) files to color image files in
6751 +Portable Pixmap (PPM) format, grayscale image files in Portable
6752 +Graymap (PGM) format, or monochrome image files in Portable Bitmap
6753 +(PBM) format.
6754 +.PP
6755 +Pdftoppm reads the PDF file,
6756 +.IR PDF-file ,
6757 +and writes one PPM file for each page,
6758 +.IR PPM-root - nnnnnn .ppm,
6759 +where
6760 +.I nnnnnn
6761 +is the page number.
6762 +.SH CONFIGURATION FILE
6763 +Pdftoppm reads a configuration file at startup.  It first tries to
6764 +find the user's private config file, ~/.xpdfrc.  If that doesn't
6765 +exist, it looks for a system-wide config file, /etc/xpdf/xpdfrc. See the
6766 +.BR xpdfrc (5)
6767 +man page for details.
6768 +.SH OPTIONS
6769 +Many of the following options can be set with configuration file
6770 +commands.  These are listed in square brackets with the description of
6771 +the corresponding command line option.
6772 +.TP
6773 +.BI \-f " number"
6774 +Specifies the first page to convert.
6775 +.TP
6776 +.BI \-l " number"
6777 +Specifies the last page to convert.
6778 +.TP
6779 +.BI \-r " number"
6780 +Specifies the resolution, in DPI.  The default is 150 DPI.
6781 +.TP
6782 +.B \-mono
6783 +Generate a monochrome PBM file (instead of a color PPM file).
6784 +.TP
6785 +.B \-gray
6786 +Generate a grayscale PGM file (instead of a color PPM file).
6787 +.TP
6788 +.BI \-t1lib " yes | no"
6789 +Enable or disable t1lib (a Type 1 font rasterizer).  This defaults to
6790 +"yes".
6791 +.RB "[config file: " enableT1lib ]
6792 +.TP
6793 +.BI \-freetype " yes | no"
6794 +Enable or disable FreeType (a TrueType / Type 1 font rasterizer).
6795 +This defaults to "yes".
6796 +.RB "[config file: " enableFreeType ]
6797 +.TP
6798 +.BI \-aa " yes | no"
6799 +Enable or disable font anti-aliasing.  This defaults to "yes".
6800 +.RB "[config file: " antialias ]
6801 +.TP
6802 +.BI \-opw " password"
6803 +Specify the owner password for the PDF file.  Providing this will
6804 +bypass all security restrictions.
6805 +.TP
6806 +.BI \-upw " password"
6807 +Specify the user password for the PDF file.
6808 +.TP
6809 +.B \-q
6810 +Don't print any messages or errors.
6811 +.RB "[config file: " errQuiet ]
6812 +.TP
6813 +.B \-v
6814 +Print copyright and version information.
6815 +.TP
6816 +.B \-h
6817 +Print usage information.
6818 +.RB ( \-help
6819 +and
6820 +.B \-\-help
6821 +are equivalent.)
6822 +.SH EXIT CODES
6823 +The Xpdf tools use the following exit codes:
6824 +.TP
6825 +0
6826 +No error.
6827 +.TP
6828 +1
6829 +Error opening a PDF file.
6830 +.TP
6831 +2
6832 +Error opening an output file.
6833 +.TP
6834 +3
6835 +Error related to PDF permissions.
6836 +.TP
6837 +99
6838 +Other error.
6839 +.SH AUTHOR
6840 +The pdftoppm software and documentation are copyright 1996-2004 Glyph
6841 +& Cog, LLC.
6842 +.SH "SEE ALSO"
6843 +.BR xpdf (1),
6844 +.BR pdftops (1),
6845 +.BR pdftotext (1),
6846 +.BR pdfinfo (1),
6847 +.BR pdffonts (1),
6848 +.BR pdfimages (1),
6849 +.BR xpdfrc (5)
6850 +.br
6851 +.B http://www.foolabs.com/xpdf/
6852 diff -Nur poppler.0_5_0/utils/pdftoppm.cc poppler.HEAD/utils/pdftoppm.cc
6853 --- poppler.0_5_0/utils/pdftoppm.cc     1970-01-01 01:00:00.000000000 +0100
6854 +++ poppler.HEAD/utils/pdftoppm.cc      2006-02-04 21:07:08.000000000 +0100
6855 @@ -0,0 +1,190 @@
6856 +//========================================================================
6857 +//
6858 +// pdftoppm.cc
6859 +//
6860 +// Copyright 2003 Glyph & Cog, LLC
6861 +//
6862 +//========================================================================
6863 +
6864 +#include "config.h"
6865 +#include <poppler-config.h>
6866 +#include <stdio.h>
6867 +#include "parseargs.h"
6868 +#include "goo/gmem.h"
6869 +#include "goo/GooString.h"
6870 +#include "GlobalParams.h"
6871 +#include "Object.h"
6872 +#include "PDFDoc.h"
6873 +#include "splash/SplashBitmap.h"
6874 +#include "splash/Splash.h"
6875 +#include "SplashOutputDev.h"
6876 +
6877 +static int firstPage = 1;
6878 +static int lastPage = 0;
6879 +static int resolution = 150;
6880 +static GBool mono = gFalse;
6881 +static GBool gray = gFalse;
6882 +static char enableT1libStr[16] = "";
6883 +static char enableFreeTypeStr[16] = "";
6884 +static char antialiasStr[16] = "";
6885 +static char ownerPassword[33] = "";
6886 +static char userPassword[33] = "";
6887 +static GBool quiet = gFalse;
6888 +static char cfgFileName[256] = "";
6889 +static GBool printVersion = gFalse;
6890 +static GBool printHelp = gFalse;
6891 +
6892 +static ArgDesc argDesc[] = {
6893 +  {"-f",      argInt,      &firstPage,     0,
6894 +   "first page to print"},
6895 +  {"-l",      argInt,      &lastPage,      0,
6896 +   "last page to print"},
6897 +  {"-r",      argInt,      &resolution,    0,
6898 +   "resolution, in DPI (default is 150)"},
6899 +  {"-mono",   argFlag,     &mono,          0,
6900 +   "generate a monochrome PBM file"},
6901 +  {"-gray",   argFlag,     &gray,          0,
6902 +   "generate a grayscale PGM file"},
6903 +#if HAVE_T1LIB_H
6904 +  {"-t1lib",      argString,      enableT1libStr, sizeof(enableT1libStr),
6905 +   "enable t1lib font rasterizer: yes, no"},
6906 +#endif
6907 +#if HAVE_FREETYPE_FREETYPE_H | HAVE_FREETYPE_H
6908 +  {"-freetype",   argString,      enableFreeTypeStr, sizeof(enableFreeTypeStr),
6909 +   "enable FreeType font rasterizer: yes, no"},
6910 +#endif
6911 +  {"-aa",         argString,      antialiasStr,   sizeof(antialiasStr),
6912 +   "enable font anti-aliasing: yes, no"},
6913 +  {"-opw",    argString,   ownerPassword,  sizeof(ownerPassword),
6914 +   "owner password (for encrypted files)"},
6915 +  {"-upw",    argString,   userPassword,   sizeof(userPassword),
6916 +   "user password (for encrypted files)"},
6917 +  {"-q",      argFlag,     &quiet,         0,
6918 +   "don't print any messages or errors"},
6919 +  {"-cfg",        argString,      cfgFileName,    sizeof(cfgFileName),
6920 +   "configuration file to use in place of .xpdfrc"},
6921 +  {"-v",      argFlag,     &printVersion,  0,
6922 +   "print copyright and version info"},
6923 +  {"-h",      argFlag,     &printHelp,     0,
6924 +   "print usage information"},
6925 +  {"-help",   argFlag,     &printHelp,     0,
6926 +   "print usage information"},
6927 +  {"--help",  argFlag,     &printHelp,     0,
6928 +   "print usage information"},
6929 +  {"-?",      argFlag,     &printHelp,     0,
6930 +   "print usage information"},
6931 +  {NULL}
6932 +};
6933 +
6934 +int main(int argc, char *argv[]) {
6935 +  PDFDoc *doc;
6936 +  GooString *fileName;
6937 +  char *ppmRoot;
6938 +  char ppmFile[512];
6939 +  GooString *ownerPW, *userPW;
6940 +  SplashColor paperColor;
6941 +  SplashOutputDev *splashOut;
6942 +  GBool ok;
6943 +  int exitCode;
6944 +  int pg;
6945 +
6946 +  exitCode = 99;
6947 +
6948 +  // parse args
6949 +  ok = parseArgs(argDesc, &argc, argv);
6950 +  if (mono && gray) {
6951 +    ok = gFalse;
6952 +  }
6953 +  if (!ok || argc != 3 || printVersion || printHelp) {
6954 +    fprintf(stderr, "pdftoppm version %s\n", xpdfVersion);
6955 +    fprintf(stderr, "%s\n", xpdfCopyright);
6956 +    if (!printVersion) {
6957 +      printUsage("pdftoppm", "<PDF-file> <PPM-root>", argDesc);
6958 +    }
6959 +    goto err0;
6960 +  }
6961 +  fileName = new GooString(argv[1]);
6962 +  ppmRoot = argv[2];
6963 +
6964 +  // read config file
6965 +  globalParams = new GlobalParams(cfgFileName);
6966 +  if (enableT1libStr[0]) {
6967 +    if (!globalParams->setEnableT1lib(enableT1libStr)) {
6968 +      fprintf(stderr, "Bad '-t1lib' value on command line\n");
6969 +    }
6970 +  }
6971 +  if (enableFreeTypeStr[0]) {
6972 +    if (!globalParams->setEnableFreeType(enableFreeTypeStr)) {
6973 +      fprintf(stderr, "Bad '-freetype' value on command line\n");
6974 +    }
6975 +  }
6976 +  if (antialiasStr[0]) {
6977 +    if (!globalParams->setAntialias(antialiasStr)) {
6978 +      fprintf(stderr, "Bad '-aa' value on command line\n");
6979 +    }
6980 +  }
6981 +  if (quiet) {
6982 +    globalParams->setErrQuiet(quiet);
6983 +  }
6984 +
6985 +  // open PDF file
6986 +  if (ownerPassword[0]) {
6987 +    ownerPW = new GooString(ownerPassword);
6988 +  } else {
6989 +    ownerPW = NULL;
6990 +  }
6991 +  if (userPassword[0]) {
6992 +    userPW = new GooString(userPassword);
6993 +  } else {
6994 +    userPW = NULL;
6995 +  }
6996 +  doc = new PDFDoc(fileName, ownerPW, userPW);
6997 +  if (userPW) {
6998 +    delete userPW;
6999 +  }
7000 +  if (ownerPW) {
7001 +    delete ownerPW;
7002 +  }
7003 +  if (!doc->isOk()) {
7004 +    exitCode = 1;
7005 +    goto err1;
7006 +  }
7007 +
7008 +  // get page range
7009 +  if (firstPage < 1)
7010 +    firstPage = 1;
7011 +  if (lastPage < 1 || lastPage > doc->getNumPages())
7012 +    lastPage = doc->getNumPages();
7013 +
7014 +  // write PPM files
7015 +  paperColor[0] = 255;
7016 +  paperColor[1] = 255;
7017 +  paperColor[2] = 255;
7018 +  splashOut = new SplashOutputDev(mono ? splashModeMono1 :
7019 +                                   gray ? splashModeMono8 :
7020 +                                            splashModeRGB8, 4,
7021 +                                 gFalse, paperColor);
7022 +  splashOut->startDoc(doc->getXRef());
7023 +  for (pg = firstPage; pg <= lastPage; ++pg) {
7024 +    doc->displayPage(splashOut, pg, resolution, resolution, 0, gTrue, gFalse, gFalse);
7025 +    sprintf(ppmFile, "%.*s-%06d.%s",
7026 +           (int)sizeof(ppmFile) - 32, ppmRoot, pg,
7027 +           mono ? "pbm" : gray ? "pgm" : "ppm");
7028 +    splashOut->getBitmap()->writePNMFile(ppmFile);
7029 +  }
7030 +  delete splashOut;
7031 +
7032 +  exitCode = 0;
7033 +
7034 +  // clean up
7035 + err1:
7036 +  delete doc;
7037 +  delete globalParams;
7038 + err0:
7039 +
7040 +  // check for memory leaks
7041 +  Object::memCheck(stderr);
7042 +  gMemReport(stderr);
7043 +
7044 +  return exitCode;
7045 +}
7046 diff -Nur poppler.0_5_0/utils/pdftops.cc poppler.HEAD/utils/pdftops.cc
7047 --- poppler.0_5_0/utils/pdftops.cc      2005-12-12 21:15:11.000000000 +0100
7048 +++ poppler.HEAD/utils/pdftops.cc       2006-01-23 19:52:48.000000000 +0100
7049 @@ -8,6 +8,7 @@
7050  //
7051  //========================================================================
7052  
7053 +#include "config.h"
7054  #include <poppler-config.h>
7055  #include <stdio.h>
7056  #include <stdlib.h>
7057 @@ -27,7 +28,6 @@
7058  #include "PDFDoc.h"
7059  #include "PSOutputDev.h"
7060  #include "Error.h"
7061 -#include "config.h"
7062  
7063  static int firstPage = 1;
7064  static int lastPage = 0;
7065 @@ -307,7 +307,9 @@
7066  
7067    // write PostScript file
7068    psOut = new PSOutputDev(psFileName->getCString(), doc->getXRef(),
7069 -                         doc->getCatalog(), firstPage, lastPage, mode);
7070 +                         doc->getCatalog(), firstPage, lastPage, mode,
7071 +                         globalParams->getPSPaperWidth(),
7072 +                         globalParams->getPSPaperHeight());
7073    if (psOut->isOk()) {
7074      doc->displayPages(psOut, firstPage, lastPage, 72, 72,
7075                       0, globalParams->getPSCrop(), gFalse, gFalse);
7076 diff -Nur poppler.0_5_0/utils/pdftotext.cc poppler.HEAD/utils/pdftotext.cc
7077 --- poppler.0_5_0/utils/pdftotext.cc    2005-12-12 21:15:11.000000000 +0100
7078 +++ poppler.HEAD/utils/pdftotext.cc     2006-01-23 16:40:54.000000000 +0100
7079 @@ -8,6 +8,7 @@
7080  //
7081  //========================================================================
7082  
7083 +#include "config.h"
7084  #include <poppler-config.h>
7085  #include <stdio.h>
7086  #include <stdlib.h>
7087 @@ -29,7 +30,7 @@
7088  #include "CharTypes.h"
7089  #include "UnicodeMap.h"
7090  #include "Error.h"
7091 -#include "config.h"
7092 +#include "UGooString.h"
7093  
7094  static void printInfoString(FILE *f, Dict *infoDict, char *key,
7095                             char *text1, char *text2, UnicodeMap *uMap);
This page took 0.937905 seconds and 3 git commands to generate.