]> git.pld-linux.org Git - packages/swftools.git/blob - swftools-poppler.patch
- rebuild with poppler 0.53
[packages/swftools.git] / swftools-poppler.patch
1 From git://people.freedesktop.org/~carlosgc/swftools ; git diff master xpdf303
2 diff --git a/config.h.in b/config.h.in
3 index 0ec7fb9..51fe5a3 100644
4 --- a/config.h.in
5 +++ b/config.h.in
6 @@ -266,6 +266,7 @@
7  #ifdef HAVE_POPPLER
8  #define GString GooString
9  #define GHash GooHash
10 +#define GHashIter GooHashIter
11  #endif
12  
13  #ifdef HAVE_ZZIP_LIB_H
14 diff --git a/configure.in b/configure.in
15 index 8b04d6f..7895338 100644
16 --- a/configure.in
17 +++ b/configure.in
18 @@ -331,7 +331,7 @@ xpdf_include=
19  
20  if test "x$USE_POPPLER" = "xtrue"; then
21      AC_DEFINE([HAVE_POPPLER],[1],[use poppler])
22 -    #PKG_CHECK_MODULES([POPPLER],[poppler poppler-splash],,[poppler_pkgconfig=no])
23 +    PKG_CHECK_MODULES([POPPLER],[poppler >= 0.20.0 poppler-splash >= 0.20.0],,[poppler_pkgconfig=no])
24      if test "x$poppler_pkgconfig" = "xno"; then
25          AC_LANG_PUSH([C++])
26          AC_CHECK_HEADERS([OutputDev.h],[
27 diff --git a/lib/pdf/BitmapOutputDev.cc b/lib/pdf/BitmapOutputDev.cc
28 index 7b175b3..11fa842 100644
29 --- a/lib/pdf/BitmapOutputDev.cc
30 +++ b/lib/pdf/BitmapOutputDev.cc
31 @@ -23,10 +23,12 @@
32  #include <assert.h>
33  #include "BitmapOutputDev.h"
34  #include "CharOutputDev.h"
35 +#include "GFXSplashOutputDev.h"
36  
37  #ifdef HAVE_POPPLER
38    #include "splash/SplashBitmap.h"
39    #include "splash/SplashPattern.h"
40 +  #include "splash/SplashGlyphBitmap.h"
41    #include "splash/Splash.h"
42  #else
43    #include "xpdf/config.h"
44 @@ -70,28 +72,28 @@ BitmapOutputDev::BitmapOutputDev(InfoOutputDev*info, PDFDoc*doc, int*page2page,
45      this->xref = doc->getXRef();
46      
47      /* color graphic output device, for creating bitmaps */
48 -    this->rgbdev = new SplashOutputDev(splashModeRGB8, 1, gFalse, splash_white, gTrue, gTrue);
49 +    this->rgbdev = new GFXSplashOutputDev(splashModeRGB8, 1, gFalse, splash_white, gTrue, gTrue);
50    
51      /* color mode for binary bitmaps */
52      SplashColorMode colorMode = splashModeMono1;
53  
54      /* two devices for testing things against clipping: one clips, the other doesn't */
55 -    this->clip0dev = new SplashOutputDev(colorMode, 1, gFalse, splash_black, gTrue, gFalse);
56 -    this->clip1dev = new SplashOutputDev(colorMode, 1, gFalse, splash_black, gTrue, gFalse);
57 +    this->clip0dev = new GFXSplashOutputDev(colorMode, 1, gFalse, splash_black, gTrue, gFalse);
58 +    this->clip1dev = new GFXSplashOutputDev(colorMode, 1, gFalse, splash_black, gTrue, gFalse);
59      
60      /* device indicating where polygonal pixels were drawn */
61 -    this->boolpolydev = new SplashOutputDev(colorMode, 1, gFalse, splash_black, gTrue, gFalse);
62 +    this->boolpolydev = new GFXSplashOutputDev(colorMode, 1, gFalse, splash_black, gTrue, gFalse);
63      /* device indicating where text pixels were drawn */
64 -    this->booltextdev = new SplashOutputDev(colorMode, 1, gFalse, splash_black, gTrue, gFalse);
65 +    this->booltextdev = new GFXSplashOutputDev(colorMode, 1, gFalse, splash_black, gTrue, gFalse);
66  
67      /* device for handling texts and links */
68      this->gfxdev = new CharOutputDev(info, this->doc, page2page, num_pages, x, y, x1, y1, x2, y2);
69  
70 -    this->rgbdev->startDoc(this->xref);
71 -    this->boolpolydev->startDoc(this->xref);
72 -    this->booltextdev->startDoc(this->xref);
73 -    this->clip0dev->startDoc(this->xref);
74 -    this->clip1dev->startDoc(this->xref);
75 +    this->rgbdev->startDoc(POPPLER_STARTDOC_ARG);
76 +    this->boolpolydev->startDoc(POPPLER_STARTDOC_ARG);
77 +    this->booltextdev->startDoc(POPPLER_STARTDOC_ARG);
78 +    this->clip0dev->startDoc(POPPLER_STARTDOC_ARG);
79 +    this->clip1dev->startDoc(POPPLER_STARTDOC_ARG);
80  
81      this->gfxoutput_string = device_new_record();
82      this->gfxoutput = device_new_record();
83 @@ -153,14 +155,6 @@ BitmapOutputDev::~BitmapOutputDev()
84  
85  }
86  
87 -GBool BitmapOutputDev::getVectorAntialias()
88 -{
89 -    return this->rgbdev->getVectorAntialias();
90 -}
91 -void BitmapOutputDev::setVectorAntialias(GBool vaa)
92 -{
93 -    this->rgbdev->setVectorAntialias(vaa);
94 -}
95  void BitmapOutputDev::setDevice(gfxdevice_t*dev)
96  {
97      this->dev = dev;
98 @@ -188,8 +182,8 @@ void BitmapOutputDev::flushBitmap()
99      int bitmap_width = rgbdev->getBitmapWidth();
100      int bitmap_height = rgbdev->getBitmapHeight();
101  
102 -    if(sizeof(SplashColor)!=3) {
103 -       msg("<error> sizeof(SplashColor)!=3");
104 +    if(sizeof(SplashColor)<3) {
105 +       msg("<error> sizeof(SplashColor)<3");
106         return;
107      }
108  
109 @@ -992,9 +986,10 @@ GBool BitmapOutputDev::intersection(SplashBitmap*boolpoly, SplashBitmap*booltext
110  GBool BitmapOutputDev::checkPageSlice(Page *page, double hDPI, double vDPI,
111               int rotate, GBool useMediaBox, GBool crop,
112               int sliceX, int sliceY, int sliceW, int sliceH,
113 -             GBool printing, Catalog *catalog,
114 +             GBool printing,
115               GBool (*abortCheckCbk)(void *data),
116 -             void *abortCheckCbkData)
117 +             void *abortCheckCbkData
118 +             POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_DATA)
119  {
120      this->setPage(page);
121      gfxdev->setPage(page);
122 @@ -1084,13 +1079,13 @@ GBool BitmapOutputDev::useTilingPatternFill()
123      return rgbdev->useTilingPatternFill();
124  }
125  
126 -GBool BitmapOutputDev::useShadedFills()
127 +GBool BitmapOutputDev::useShadedFills(POPPLER_SHADED_FILL_TYPE)
128  {
129 -    boolpolydev->useShadedFills();
130 -    booltextdev->useShadedFills();
131 -    clip0dev->useShadedFills();
132 -    clip1dev->useShadedFills();
133 -    return rgbdev->useShadedFills();
134 +    boolpolydev->useShadedFills(POPPLER_SHADED_FILL_TYPE_ARG);
135 +    booltextdev->useShadedFills(POPPLER_SHADED_FILL_TYPE_ARG);
136 +    clip0dev->useShadedFills(POPPLER_SHADED_FILL_TYPE_ARG);
137 +    clip1dev->useShadedFills(POPPLER_SHADED_FILL_TYPE_ARG);
138 +    return rgbdev->useShadedFills(POPPLER_SHADED_FILL_TYPE_ARG);
139  }
140  
141  GBool BitmapOutputDev::useDrawForm()
142 @@ -1507,17 +1502,19 @@ void BitmapOutputDev::eoFill(GfxState *state)
143      dbg_newdata("eofill");
144  }
145  
146 -POPPLER_TILING_PATERN_RETURN BitmapOutputDev::tilingPatternFill(GfxState *state, POPPLER_TILING_PATERN_GFX Object *str,
147 -                              int paintType, Dict *resDict,
148 +POPPLER_TILING_PATERN_RETURN BitmapOutputDev::tilingPatternFill(GfxState *state, Gfx *gfx, POPPLER_TILING_PATTERN_CATALOG Object *str,
149 +                              POPPLER_TILING_PATTERN_PMAT int paintType, POPPLER_TILING_PATTERN_TILING_TYPE Dict *resDict,
150                                double *mat, double *bbox,
151                                int x0, int y0, int x1, int y1,
152                                double xStep, double yStep) 
153  {
154      msg("<debug> tilingPatternFill");
155 -    boolpolydev->tilingPatternFill(state, POPPLER_TILING_PATERN_GFX_ARG str, paintType, resDict, mat,
156 +    boolpolydev->tilingPatternFill(state, gfx, POPPLER_TILING_PATTERN_CATALOG_ARG str, POPPLER_TILING_PATTERN_PMAT_ARG paintType,
157 +                                   POPPLER_TILING_PATTERN_TILING_TYPE_ARG resDict, mat,
158                                     bbox, x0, y0, x1, y1, xStep, yStep);
159      checkNewBitmap(UNKNOWN_BOUNDING_BOX);
160 -    rgbdev->tilingPatternFill(state, POPPLER_TILING_PATERN_GFX_ARG str, paintType, resDict, mat,
161 +    rgbdev->tilingPatternFill(state, gfx, POPPLER_TILING_PATTERN_CATALOG_ARG str, POPPLER_TILING_PATTERN_PMAT_ARG paintType,
162 +                              POPPLER_TILING_PATTERN_TILING_TYPE_ARG resDict, mat,
163                                bbox, x0, y0, x1, y1, xStep, yStep);
164      dbg_newdata("tilingpatternfill");
165  #ifdef HAVE_POPPLER
166 @@ -1615,7 +1612,7 @@ void BitmapOutputDev::clearBoolTextDev()
167  
168  #define USE_GETGLYPH_BBOX
169  
170 -static void getGlyphBbox(GfxState*state, SplashOutputDev*splash, double x, double y, double originX, double originY, CharCode code, int*_x1, int*_y1, int*_x2, int*_y2)
171 +static void getGlyphBbox(GfxState*state, GFXSplashOutputDev*splash, double x, double y, double originX, double originY, CharCode code, int*_x1, int*_y1, int*_x2, int*_y2)
172  {
173  #ifdef USE_GETGLYPH_BBOX
174      /* use getglyph to derive bounding box */
175 @@ -1634,7 +1631,14 @@ static void getGlyphBbox(GfxState*state, SplashOutputDev*splash, double x, doubl
176  
177      SplashCoord*matrix = font->getMatrix();
178  
179 -    if(font && font->getGlyph(code, xFrac, yFrac, &glyph)) {
180 +#ifdef HAVE_POPPLER
181 +    double clipx1, clipy1, clipx2, clipy2;
182 +    state->getClipBBox(&clipx1, &clipy1, &clipx2, &clipy2);
183 +    SplashClip clip(clipx1, clipy1, clipx2, clipy2, gFalse);
184 +    SplashClipResult clipRes;
185 +#endif
186 +
187 +    if(font && font->getGlyph(code, xFrac, yFrac, &glyph POPPLER_GET_GLYPH_ARGS)) {
188          x1 = floor(x0-glyph.x);
189          y1 = floor(y0-glyph.y);
190          x2 = ceil(x0-glyph.x+glyph.w);
191 @@ -1648,7 +1652,7 @@ static void getGlyphBbox(GfxState*state, SplashOutputDev*splash, double x, doubl
192      double x0,y0;
193      state->transform(x-originX,y-originY,&x0,&y0);
194      int x1 = (int)x0, x2 = (int)x0+1, y1 = (int)y0, y2 = (int)y0+1;
195 -    SplashFont*font = clip0dev->getCurrentFont();
196 +    SplashFont*font = splash->getCurrentFont();
197      SplashPath*path = font?font->getGlyphPath(code):NULL;
198      if(path) {
199          path->offset((SplashCoord)x, (SplashCoord)y);
200 @@ -1980,10 +1984,10 @@ void BitmapOutputDev::drawForm(Ref id)
201      rgbdev->drawForm(id);
202  }
203  
204 -void BitmapOutputDev::processLink(Link *link, Catalog *catalog)
205 +void BitmapOutputDev::processLink(Link *link)
206  {
207      msg("<debug> processLink");
208 -    gfxdev->processLink(link, catalog);
209 +    gfxdev->processLink(link);
210  }
211  void BitmapOutputDev::flushEverything()
212  {
213 diff --git a/lib/pdf/BitmapOutputDev.h b/lib/pdf/BitmapOutputDev.h
214 index 3644a0e..1ad7ec6 100644
215 --- a/lib/pdf/BitmapOutputDev.h
216 +++ b/lib/pdf/BitmapOutputDev.h
217 @@ -27,6 +27,7 @@
218  #include "../../config.h"
219  #include "CharOutputDev.h"
220  #include "InfoOutputDev.h"
221 +#include "GFXSplashOutputDev.h"
222  #include "PDFDoc.h"
223  #include "CommonOutputDev.h"
224  #include "popplercompat.h"
225 @@ -58,7 +59,7 @@ public:
226      virtual GBool upsideDown();
227      virtual GBool useDrawChar();
228      virtual GBool useTilingPatternFill();
229 -    virtual GBool useShadedFills();
230 +    virtual GBool useShadedFills(POPPLER_SHADED_FILL_TYPE);
231      virtual GBool useDrawForm();
232      virtual GBool interpretType3Chars();
233      virtual GBool needNonText();
234 @@ -66,9 +67,11 @@ public:
235      virtual GBool checkPageSlice(Page *page, double hDPI, double vDPI,
236                                int rotate, GBool useMediaBox, GBool crop,
237                                int sliceX, int sliceY, int sliceW, int sliceH,
238 -                              GBool printing, Catalog *catalog,
239 +                              GBool printing,
240                                GBool (*abortCheckCbk)(void *data) = NULL,
241 -                              void *abortCheckCbkData = NULL);
242 +                              void *abortCheckCbkData = NULL
243 +                               POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_H
244 +                               POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_DATA_H);
245  
246      virtual void beginPage(GfxState *state, int pageNum);
247      virtual void endPage();
248 @@ -110,8 +113,9 @@ public:
249      virtual void fill(GfxState *state);
250      virtual void eoFill(GfxState *state);
251      virtual POPPLER_TILING_PATERN_RETURN tilingPatternFill(
252 -             GfxState *state, POPPLER_TILING_PATERN_GFX Object *str,
253 -                              int paintType, Dict *resDict,
254 +                               GfxState *state, Gfx *gfx, POPPLER_TILING_PATTERN_CATALOG Object *str,
255 +                               POPPLER_TILING_PATTERN_PMAT
256 +                              int paintType, POPPLER_TILING_PATTERN_TILING_TYPE Dict *resDict,
257                                double *mat, double *bbox,
258                                int x0, int y0, int x1, int y1,
259                                double xStep, double yStep);
260 @@ -178,12 +182,9 @@ public:
261      virtual void setSoftMask(GfxState *state, double *bbox, GBool alpha, Function *transferFunc, GfxColor *backdropColor);
262      virtual void clearSoftMask(GfxState *state);
263  
264 -    virtual void processLink(Link *link, Catalog *catalog);
265 +    virtual void processLink(Link *link);
266    
267 -    virtual void setVectorAntialias(GBool vaa);
268 -    virtual GBool getVectorAntialias();
269  
270 -    
271  private:
272      void flushEverything();
273      void clearClips(int x1, int y1, int x2, int y2);
274 @@ -211,11 +212,11 @@ private:
275  
276      SplashPath*bboxpath;
277  
278 -    SplashOutputDev*rgbdev;
279 -    SplashOutputDev*clip0dev;
280 -    SplashOutputDev*clip1dev;
281 -    SplashOutputDev*boolpolydev;
282 -    SplashOutputDev*booltextdev;
283 +    GFXSplashOutputDev*rgbdev;
284 +    GFXSplashOutputDev*clip0dev;
285 +    GFXSplashOutputDev*clip1dev;
286 +    GFXSplashOutputDev*boolpolydev;
287 +    GFXSplashOutputDev*booltextdev;
288  
289      SplashBitmap*rgbbitmap;
290      SplashBitmap*clip0bitmap;
291 diff --git a/lib/pdf/CharOutputDev.cc b/lib/pdf/CharOutputDev.cc
292 index cd7ceff..2e6fd1a 100644
293 --- a/lib/pdf/CharOutputDev.cc
294 +++ b/lib/pdf/CharOutputDev.cc
295 @@ -83,7 +83,6 @@ struct fontentry {
296      char*pfb;
297      int pfblen;
298      char*fullfilename;
299 -    DisplayFontParam *dfp;
300  } pdf2t1map[] ={
301  {"Times-Roman",           "n021003l", n021003l_afm, n021003l_afm_len, n021003l_pfb, n021003l_pfb_len},
302  {"Times-Italic",          "n021023l", n021023l_afm, n021023l_afm_len, n021023l_pfb, n021023l_pfb_len},
303 @@ -198,6 +197,7 @@ void unlinkfont(char* filename)
304      }
305  }
306  
307 +#ifndef HAVE_POPPLER
308  static int config_use_fontconfig = 1;
309  static int fcinitcalled = 0; 
310  
311 @@ -424,16 +424,7 @@ char* fontconfig_searchForFont(char*name)
312  #endif
313  }
314  
315 -static DisplayFontParamKind detectFontType(const char*filename)
316 -{
317 -    if(strstr(filename, ".ttf") || strstr(filename, ".TTF"))
318 -       return displayFontTT;
319 -    if(strstr(filename, ".pfa") || strstr(filename, ".PFA") || strstr(filename, ".pfb"))
320 -       return displayFontT1;
321 -    return displayFontTT;
322 -}
323 -
324 -DisplayFontParam *GFXGlobalParams::getDisplayFont(GString *fontName)
325 +GString *GFXGlobalParams::findFontFile(GString *fontName)
326  {
327      msg("<verbose> looking for font %s", fontName->getCString());
328  
329 @@ -450,11 +441,8 @@ DisplayFontParam *GFXGlobalParams::getDisplayFont(GString *fontName)
330                 } else {
331                     msg("<verbose> Storing standard PDF font %s at %s", name, pdf2t1map[t].fullfilename);
332                 }
333 -               DisplayFontParam *dfp = new DisplayFontParam(new GString(fontName), displayFontT1);
334 -               dfp->t1.fileName = new GString(pdf2t1map[t].fullfilename);
335 -               pdf2t1map[t].dfp = dfp;
336             }
337 -           return pdf2t1map[t].dfp;
338 +            return pdf2t1map[t].fullfilename ? new GString(pdf2t1map[t].fullfilename) : NULL;
339         }
340      }
341      
342 @@ -485,30 +473,16 @@ DisplayFontParam *GFXGlobalParams::getDisplayFont(GString *fontName)
343      }
344  
345      if(filename) {
346 +        GString*retval = new GString(filename);
347          msg("<verbose> Font %s maps to %s\n", name, filename);
348 -       DisplayFontParamKind kind = detectFontType(filename);
349 -        DisplayFontParam *dfp = new DisplayFontParam(new GString(fontName), kind);
350 -       if(kind == displayFontTT) {
351 -           dfp->tt.fileName = new GString(filename);
352 -       } else {
353 -           dfp->t1.fileName = new GString(filename);
354 -       }
355 -       free(filename);
356 -        return dfp;
357 +        free(filename);
358 +        return retval;
359      } else {
360         msg("<verbose> Font %s not found\n", name);
361 -       return GlobalParams::getDisplayFont(fontName);
362 -    }
363 -}
364 -
365 -DisplayFontParam *GFXGlobalParams::getDisplayCIDFont(GString *fontName, GString *collection)
366 -{
367 -    DisplayFontParam*dfp = GlobalParams::getDisplayCIDFont(fontName, collection);
368 -    if(!dfp) {
369 -        dfp = this->getDisplayFont(fontName);
370 +        return GlobalParams::findFontFile(fontName);
371      }
372 -    return dfp;
373  }
374 +#endif // HAVE_POPPLER
375  
376  CharOutputDev::CharOutputDev(InfoOutputDev*info, PDFDoc*doc, int*page2page, int num_pages, int x, int y, int x1, int y1, int x2, int y2)
377  :CommonOutputDev(info, doc, page2page, num_pages, x, y, x1, y1, x2, y2)
378 @@ -652,7 +626,7 @@ static void dumpFontInfo(const char*loglevel, GfxFont*font)
379    if(embedded)
380     msg("%s| Embedded id: %s id: %d",loglevel, FIXNULL(embeddedName), embRef.num);
381  
382 -  gstr = font->getExtFontFile();
383 +  gstr = globalParams->findFontFile(font->getName());
384    if(gstr)
385     msg("%s| External Font file: %s", loglevel, FIXNULL(gstr->getCString()));
386  
387 @@ -1046,7 +1020,7 @@ GFXLink::~GFXLink()
388  }
389  
390  
391 -void CharOutputDev::processLink(Link *link, Catalog *catalog)
392 +void CharOutputDev::processLink(Link *link)
393  {
394      double x1, y1, x2, y2;
395      
396 @@ -1068,13 +1042,13 @@ void CharOutputDev::processLink(Link *link, Catalog *catalog)
397              LinkGoTo *ha=(LinkGoTo *)link->getAction();
398              LinkDest *dest=NULL;
399              if (ha->getDest()==NULL) 
400 -                dest=catalog->findDest(ha->getNamedDest());
401 +                dest=this->doc->findDest(ha->getNamedDest());
402              else 
403                  dest=ha->getDest()->copy();
404              if (dest){ 
405                if (dest->isPageRef()){
406                  Ref pageref=dest->getPageRef();
407 -                page=catalog->findPage(pageref.num,pageref.gen);
408 +                page=this->doc->findPage(pageref.num,pageref.gen);
409                }
410                else  page=dest->getPageNum();
411                sprintf(buf, "%d", page);
412 diff --git a/lib/pdf/CharOutputDev.h b/lib/pdf/CharOutputDev.h
413 index 0801090..86124db 100644
414 --- a/lib/pdf/CharOutputDev.h
415 +++ b/lib/pdf/CharOutputDev.h
416 @@ -33,7 +33,7 @@ public:
417    virtual GBool upsideDown();
418    virtual GBool useDrawChar();
419  
420 -  virtual void processLink(Link *link, Catalog *catalog);
421 +  virtual void processLink(Link *link);
422    virtual void saveState(GfxState *state) ;
423    virtual void restoreState(GfxState *state) ;
424  
425 @@ -108,12 +108,13 @@ class GFXLink {
426      ~GFXLink();
427  };
428  
429 +#ifndef HAVE_POPPLER
430  class GFXGlobalParams:  public GlobalParams {
431      public:
432      GFXGlobalParams();
433      ~GFXGlobalParams();
434 -    virtual DisplayFontParam *getDisplayFont(GString *fontName);
435 -    virtual DisplayFontParam *getDisplayCIDFont(GString *fontName, GString *collection);
436 +    virtual GString *findFontFile(GString *fontName);
437  };
438 +#endif
439  
440  #endif //__charoutputdev_h__
441 diff --git a/lib/pdf/CommonOutputDev.h b/lib/pdf/CommonOutputDev.h
442 index db2f4d8..ae10d7c 100644
443 --- a/lib/pdf/CommonOutputDev.h
444 +++ b/lib/pdf/CommonOutputDev.h
445 @@ -80,7 +80,9 @@ class CommonOutputDev: public OutputDev
446                                int sliceX, int sliceY, int sliceW, int sliceH,
447                                GBool printing, Catalog *catalog,
448                                GBool (*abortCheckCbk)(void *data) = NULL,
449 -                              void *abortCheckCbkData = NULL)
450 +                              void *abortCheckCbkData = NULL
451 +                               POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_H
452 +                               POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_DATA_H)
453      {
454          this->setPage(page);
455          return gTrue;
456 #diff --git a/lib/pdf/DummyOutputDev.cc b/lib/pdf/DummyOutputDev.cc
457 #index a89b5c7..6ad7608 100644
458 #--- a/lib/pdf/DummyOutputDev.cc
459 #+++ b/lib/pdf/DummyOutputDev.cc
460 #@@ -64,9 +64,9 @@ GBool DummyOutputDev::useTilingPatternFill()
461 #     return rgbdev->useTilingPatternFill();
462 # }
463
464 #-GBool DummyOutputDev::useShadedFills()
465 #+GBool DummyOutputDev::useShadedFills(POPPLER_SHADED_FILL_TYPE)
466 # {
467 #-    return rgbdev->useShadedFills();
468 #+    return rgbdev->useShadedFills(POPPLER_SHADED_FILL_TYPE_ARG);
469 # }
470
471 # GBool DummyOutputDev::useDrawForm()
472 #@@ -348,7 +348,7 @@ void DummyOutputDev::drawForm(Ref id)
473 #     rgbdev->drawForm(id);
474 # }
475
476 #-void DummyOutputDev::processLink(Link *link, Catalog *catalog)
477 #+void DummyOutputDev::processLink(Link *link)
478 # {
479 # }
480
481 #diff --git a/lib/pdf/DummyOutputDev.h b/lib/pdf/DummyOutputDev.h
482 #index ca831a8..6cc0519 100644
483 #--- a/lib/pdf/DummyOutputDev.h
484 #+++ b/lib/pdf/DummyOutputDev.h
485 #@@ -41,7 +41,7 @@ public:
486 #     virtual GBool upsideDown();
487 #     virtual GBool useDrawChar();
488 #     virtual GBool useTilingPatternFill();
489 #-    virtual GBool useShadedFills();
490 #+    virtual GBool useShadedFills(POPPLER_SHADED_FILL_TYPE);
491 #     virtual GBool useDrawForm();
492 #     virtual GBool interpretType3Chars();
493 #     virtual GBool needNonText();
494 #@@ -161,7 +161,7 @@ public:
495 #     virtual void setSoftMask(GfxState *state, double *bbox, GBool alpha, Function *transferFunc, GfxColor *backdropColor);
496 #     virtual void clearSoftMask(GfxState *state);
497
498 #-    virtual void processLink(Link *link, Catalog *catalog);
499 #+    virtual void processLink(Link *link);
500 #     
501 #     OutputDev*rgbdev;
502 # private:
503 diff --git a/lib/pdf/FullBitmapOutputDev.cc b/lib/pdf/FullBitmapOutputDev.cc
504 index 8faaa0b..b9efc8e 100644
505 --- a/lib/pdf/FullBitmapOutputDev.cc
506 +++ b/lib/pdf/FullBitmapOutputDev.cc
507 @@ -54,7 +54,7 @@ FullBitmapOutputDev::FullBitmapOutputDev(InfoOutputDev*info, PDFDoc*doc, int*pag
508      /* device for handling links */
509      this->gfxdev = new CharOutputDev(info, this->doc, page2page, num_pages, x, y, x1, y1, x2, y2);
510  
511 -    this->rgbdev->startDoc(this->xref);
512 +    this->rgbdev->startDoc(POPPLER_STARTDOC_ARG);
513  }
514  FullBitmapOutputDev::~FullBitmapOutputDev()
515  {
516 @@ -66,14 +66,6 @@ FullBitmapOutputDev::~FullBitmapOutputDev()
517      }
518  }
519  
520 -GBool FullBitmapOutputDev::getVectorAntialias()
521 -{
522 -    return this->rgbdev->getVectorAntialias();
523 -}
524 -void FullBitmapOutputDev::setVectorAntialias(GBool vaa)
525 -{
526 -    this->rgbdev->setVectorAntialias(vaa);
527 -}
528  void FullBitmapOutputDev::setDevice(gfxdevice_t*dev)
529  {
530      this->dev = dev;
531 @@ -138,8 +130,8 @@ void FullBitmapOutputDev::flushBitmap()
532      if((xmax-xmin)<=0 || (ymax-ymin)<=0) // no bitmap, nothing to do
533         return;
534  
535 -    if(sizeof(SplashColor)!=3) {
536 -       msg("<error> sizeof(SplashColor)!=3");
537 +    if(sizeof(SplashColor)<3) {
538 +       msg("<error> sizeof(SplashColor)<3");
539         return;
540      }
541      //xmin = ymin = 0;
542 @@ -187,9 +179,10 @@ void FullBitmapOutputDev::flushBitmap()
543  GBool FullBitmapOutputDev::checkPageSlice(Page *page, double hDPI, double vDPI,
544               int rotate, GBool useMediaBox, GBool crop,
545               int sliceX, int sliceY, int sliceW, int sliceH,
546 -             GBool printing, Catalog *catalog,
547 +             GBool printing,
548               GBool (*abortCheckCbk)(void *data),
549 -             void *abortCheckCbkData)
550 +             void *abortCheckCbkData
551 +             POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_DATA)
552  {
553      this->setPage(page);
554      gfxdev->setPage(page);
555 @@ -222,9 +215,9 @@ GBool FullBitmapOutputDev::useTilingPatternFill()
556  {
557      return rgbdev->useTilingPatternFill();
558  }
559 -GBool FullBitmapOutputDev::useShadedFills()
560 +GBool FullBitmapOutputDev::useShadedFills(POPPLER_SHADED_FILL_TYPE)
561  {
562 -    return rgbdev->useShadedFills();
563 +    return rgbdev->useShadedFills(POPPLER_SHADED_FILL_TYPE_ARG);
564  }
565  GBool FullBitmapOutputDev::useDrawForm()
566  {
567 @@ -380,18 +373,20 @@ void FullBitmapOutputDev::eoFill(GfxState *state)
568      msg("<debug> eoFill");
569      rgbdev->eoFill(state);
570  }
571 -POPPLER_TILING_PATERN_RETURN FullBitmapOutputDev::tilingPatternFill(GfxState *state, POPPLER_TILING_PATERN_GFX
572 -             Object *str,
573 -                              int paintType, Dict *resDict,
574 +POPPLER_TILING_PATERN_RETURN FullBitmapOutputDev::tilingPatternFill(GfxState *state, Gfx *gfx,
575 +                               POPPLER_TILING_PATTERN_CATALOG Object *str,
576 +                               POPPLER_TILING_PATTERN_PMAT
577 +                              int paintType, POPPLER_TILING_PATTERN_TILING_TYPE Dict *resDict,
578                                double *mat, double *bbox,
579                                int x0, int y0, int x1, int y1,
580                                double xStep, double yStep)
581  {
582      msg("<debug> tilingPatternFill");
583 +    rgbdev->tilingPatternFill(state, gfx, POPPLER_TILING_PATTERN_CATALOG_ARG str, POPPLER_TILING_PATTERN_PMAT_ARG paintType,
584 +                              POPPLER_TILING_PATTERN_TILING_TYPE_ARG resDict, mat, bbox, x0, y0, x1, y1, xStep, yStep);
585  #ifdef HAVE_POPPLER
586 -    return
587 +    return gTrue;
588  #endif
589 -    rgbdev->tilingPatternFill(state, POPPLER_TILING_PATERN_GFX_ARG str, paintType, resDict, mat, bbox, x0, y0, x1, y1, xStep, yStep);
590  }
591  
592  GBool FullBitmapOutputDev::functionShadedFill(GfxState *state, GfxFunctionShading *shading) 
593 @@ -536,10 +531,10 @@ void FullBitmapOutputDev::drawForm(Ref id)
594      rgbdev->drawForm(id);
595  }
596  
597 -void FullBitmapOutputDev::processLink(Link *link, Catalog *catalog)
598 +void FullBitmapOutputDev::processLink(Link *link)
599  {
600      msg("<debug> processLink");
601 -    gfxdev->processLink(link, catalog);
602 +    gfxdev->processLink(link);
603  }
604  
605  void FullBitmapOutputDev::beginTransparencyGroup(GfxState *state, double *bbox,
606 diff --git a/lib/pdf/FullBitmapOutputDev.h b/lib/pdf/FullBitmapOutputDev.h
607 index d9eb543..e9ce21e 100644
608 --- a/lib/pdf/FullBitmapOutputDev.h
609 +++ b/lib/pdf/FullBitmapOutputDev.h
610 @@ -47,7 +47,7 @@ public:
611      virtual GBool upsideDown();
612      virtual GBool useDrawChar();
613      virtual GBool useTilingPatternFill();
614 -    virtual GBool useShadedFills();
615 +    virtual GBool useShadedFills(POPPLER_SHADED_FILL_TYPE);
616      virtual GBool useDrawForm();
617      virtual GBool interpretType3Chars();
618      virtual GBool needNonText();
619 @@ -55,9 +55,11 @@ public:
620      virtual GBool checkPageSlice(Page *page, double hDPI, double vDPI,
621                                int rotate, GBool useMediaBox, GBool crop,
622                                int sliceX, int sliceY, int sliceW, int sliceH,
623 -                              GBool printing, Catalog *catalog,
624 +                              GBool printing,
625                                GBool (*abortCheckCbk)(void *data) = NULL,
626 -                              void *abortCheckCbkData = NULL);
627 +                              void *abortCheckCbkData = NULL
628 +                               POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_H
629 +                               POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_DATA_H);
630  
631      virtual void beginPage(GfxState *state, int pageNum);
632      virtual void endPage();
633 @@ -98,8 +100,9 @@ public:
634      virtual void fill(GfxState *state);
635      virtual void eoFill(GfxState *state);
636      virtual POPPLER_TILING_PATERN_RETURN tilingPatternFill(GfxState *state,
637 -             POPPLER_TILING_PATERN_GFX Object *str,
638 -                              int paintType, Dict *resDict,
639 +                               Gfx *gfx, POPPLER_TILING_PATTERN_CATALOG Object *str,
640 +                               POPPLER_TILING_PATTERN_PMAT
641 +                              int paintType, POPPLER_TILING_PATTERN_TILING_TYPE Dict *resDict,
642                                double *mat, double *bbox,
643                                int x0, int y0, int x1, int y1,
644                                double xStep, double yStep);
645 @@ -166,12 +169,9 @@ public:
646      virtual void setSoftMask(GfxState *state, double *bbox, GBool alpha, Function *transferFunc, GfxColor *backdropColor);
647      virtual void clearSoftMask(GfxState *state);
648  
649 -    virtual void processLink(Link *link, Catalog *catalog);
650 +    virtual void processLink(Link *link);
651    
652 -    virtual void setVectorAntialias(GBool vaa);
653 -    virtual GBool getVectorAntialias();
654  
655 -    
656  private:
657      void flushBitmap();
658      char config_extrafontdata;
659 diff --git a/lib/pdf/GFXSplashOutputDev.h b/lib/pdf/GFXSplashOutputDev.h
660 new file mode 100644
661 index 0000000..05cf47b
662 --- /dev/null
663 +++ b/lib/pdf/GFXSplashOutputDev.h
664 @@ -0,0 +1,58 @@
665 +/* GFXSplashOutputDev.h
666 +   Output device derived from SplashOutputDev.
667 +
668 +   This file is part of swftools.
669 +
670 +   Swftools is free software; you can redistribute it and/or modify
671 +   it under the terms of the GNU General Public License as published by
672 +   the Free Software Foundation; either version 2 of the License, or
673 +   (at your option) any later version.
674 +
675 +   Swftools is distributed in the hope that it will be useful,
676 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
677 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
678 +   GNU General Public License for more details.
679 +
680 +   You should have received a copy of the GNU General Public License
681 +   along with swftools; if not, write to the Free Software
682 +   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
683 +
684 +#ifndef __GFXSplashOutputDev_h__
685 +#define __GFXSplashOutputDev_h__
686 +
687 +#include "SplashOutputDev.h"
688 +
689 +#ifdef HAVE_POPPLER
690 +
691 +#include "../../config.h"
692 +#include <splash/SplashTypes.h>
693 +#include <splash/SplashPath.h>
694 +#include <splash/SplashFont.h>
695 +#include <splash/SplashFontFile.h>
696 +
697 +class GFXSplashOutputDev: public SplashOutputDev {
698 +public:
699 +    GFXSplashOutputDev(SplashColorMode colorModeA, int bitmapRowPadA,
700 +                       GBool reverseVideoA, SplashColorPtr paperColorA,
701 +                       GBool bitmapTopDownA = gTrue,
702 +                       GBool allowAntialiasA = gTrue)
703 +        : SplashOutputDev(colorModeA, bitmapRowPadA, reverseVideoA, paperColorA, bitmapTopDownA, allowAntialiasA)
704 +    {
705 +        needFontUpdate = gFalse;
706 +    }
707 +
708 +    // OutputDev:
709 +    virtual void restoreState(GfxState *state) { SplashOutputDev::restoreState(state); needFontUpdate = gTrue; }
710 +
711 +    virtual void updateAll(GfxState *state) { SplashOutputDev::updateAll(state); needFontUpdate = gTrue; }
712 +    virtual void updateFont(GfxState *state) { SplashOutputDev::updateFont(state); needFontUpdate = gTrue; }
713 +
714 +    // SplashOutputDev:
715 +    void doUpdateFont(GfxState *state) { SplashOutputDev::doUpdateFont(state); needFontUpdate = gFalse; }
716 +
717 +    GBool needFontUpdate;         // set when the font needs to be updated
718 +};
719 +
720 +#endif // HAVE_POPPLER
721 +
722 +#endif
723 diff --git a/lib/pdf/InfoOutputDev.cc b/lib/pdf/InfoOutputDev.cc
724 index edfb7e7..073bf99 100644
725 --- a/lib/pdf/InfoOutputDev.cc
726 +++ b/lib/pdf/InfoOutputDev.cc
727 @@ -1,7 +1,7 @@
728  #include "../../config.h"
729  #include "Object.h"
730  #include "InfoOutputDev.h"
731 -#include "SplashOutputDev.h"
732 +#include "GFXSplashOutputDev.h"
733  #include "GfxState.h"
734  #include "CommonOutputDev.h"
735  #include "../log.h"
736 @@ -90,7 +90,7 @@ static type_t fontclass_type = {
737      fontclass_destroy
738  };
739  
740 -InfoOutputDev::InfoOutputDev(XRef*xref) 
741 +InfoOutputDev::InfoOutputDev(PDFDoc*doc)
742  {
743      num_links = 0;
744      num_jpeg_images = 0;
745 @@ -103,8 +103,8 @@ InfoOutputDev::InfoOutputDev(XRef*xref)
746      currentglyph = 0;
747      previous_was_char = 0;
748      SplashColor white = {255,255,255};
749 -    splash = new SplashOutputDev(splashModeRGB8,320,0,white,0,0);
750 -    splash->startDoc(xref);
751 +    splash = new GFXSplashOutputDev(splashModeRGB8,320,0,white,0,0);
752 +    splash->startDoc(INFO_OUTPUT_DEV_STARTDOC_ARG);
753      last_font = 0;
754      current_type3_font = 0;
755      fontcache = dict_new2(&fontclass_type);
756 @@ -452,9 +452,10 @@ GBool InfoOutputDev::useTilingPatternFill() {return gFalse;}
757  GBool InfoOutputDev::checkPageSlice(Page *page, double hDPI, double vDPI,
758               int rotate, GBool useMediaBox, GBool crop,
759               int sliceX, int sliceY, int sliceW, int sliceH,
760 -             GBool printing, Catalog *catalog,
761 +             GBool printing,
762               GBool (*abortCheckCbk)(void *data),
763 -             void *abortCheckCbkData)
764 +             void *abortCheckCbkData
765 +             POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_DATA)
766  {
767      this->page = page;
768      return gTrue;
769 @@ -487,7 +488,7 @@ void InfoOutputDev::endPage()
770      if(num_chars) 
771         average_char_size /= num_chars;
772  }
773 -void InfoOutputDev::drawLink(Link *link, Catalog *catalog) 
774 +void InfoOutputDev::processLink(Link *link)
775  {
776      num_links++;
777  }
778 @@ -568,11 +569,14 @@ void InfoOutputDev::updateFont(GfxState *state)
779         current_splash_font = 0;
780         return;
781      }
782 -    GfxState* state2 = state->copy();
783 +    GfxState* state2 = state->copy(POPPLER_COPY_STATE_PATH);
784      state2->setPath(0);
785      state2->setCTM(1.0,0,0,1.0,0,0);
786      splash->updateCTM(state2, 0,0,0,0,0,0);
787      state2->setTextMat(1.0,0,0,1.0,0,0);
788 +#ifdef HAVE_POPPLER
789 +    font->incRefCnt();
790 +#endif
791      state2->setFont(font, 1024.0);
792      splash->doUpdateFont(state2);
793  
794 @@ -693,8 +697,12 @@ FontInfo* InfoOutputDev::getOrCreateFontInfo(GfxState*state)
795         fontinfo->font = font;
796         fontinfo->max_size = 0;
797         if(current_splash_font) {
798 +#ifdef HAVE_POPPLER
799 +            fontinfo->ascender = fontinfo->descender = 0;
800 +#else
801             fontinfo->ascender = current_splash_font->ascender;
802             fontinfo->descender = current_splash_font->descender;
803 +#endif
804         } else {
805             fontinfo->ascender = fontinfo->descender = 0;
806         }
807 @@ -778,9 +786,15 @@ void InfoOutputDev::drawChar(GfxState *state, double x, double y,
808      if(!g) {
809         g = fontinfo->glyphs[code] = new GlyphInfo();
810         g->advance_max = 0;
811 +#ifndef HAVE_POPPLER
812         current_splash_font->last_advance = -1;
813 +#endif
814         g->path = current_splash_font->getGlyphPath(code);
815 +#ifdef HAVE_POPPLER
816 +        g->advance = -1;
817 +#else
818         g->advance = current_splash_font->last_advance;
819 +#endif
820         g->unicode = 0;
821      }
822      if(uLen && ((u[0]>=32 && u[0]<g->unicode) || !g->unicode)) {
823 diff --git a/lib/pdf/InfoOutputDev.h b/lib/pdf/InfoOutputDev.h
824 index 07fd2e7..d423589 100644
825 --- a/lib/pdf/InfoOutputDev.h
826 +++ b/lib/pdf/InfoOutputDev.h
827 @@ -24,7 +24,7 @@
828  #include "popplercompat.h"
829  #include "GfxFont.h"
830  #include "OutputDev.h"
831 -#include "SplashOutputDev.h"
832 +#include "GFXSplashOutputDev.h"
833  #include "Page.h"
834  
835  #ifdef HAVE_POPPLER
836 @@ -116,7 +116,7 @@ extern gfxmatrix_t gfxmatrix_from_state(GfxState*state);
837  class InfoOutputDev: public OutputDev 
838  {
839      GlyphInfo* currentglyph;
840 -    SplashOutputDev*splash;
841 +    GFXSplashOutputDev*splash;
842      char previous_was_char;
843      Page *page;
844  
845 @@ -140,7 +140,7 @@ class InfoOutputDev: public OutputDev
846      void dumpfonts(gfxdevice_t*dev);
847      FontInfo* getFontInfo(GfxState*state);
848  
849 -    InfoOutputDev(XRef*xref);
850 +    InfoOutputDev(PDFDoc*doc);
851      virtual ~InfoOutputDev(); 
852      virtual GBool useTilingPatternFill();
853      virtual GBool upsideDown();
854 @@ -150,12 +150,15 @@ class InfoOutputDev: public OutputDev
855      virtual GBool checkPageSlice(Page *page, double hDPI, double vDPI,
856                                int rotate, GBool useMediaBox, GBool crop,
857                                int sliceX, int sliceY, int sliceW, int sliceH,
858 -                              GBool printing, Catalog *catalog,
859 +                              GBool printing,
860                                GBool (*abortCheckCbk)(void *data) = NULL,
861 -                              void *abortCheckCbkData = NULL);
862 +                               void *abortCheckCbkData = NULL
863 +                               POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_H
864 +                               POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_DATA_H);
865 +
866      virtual void startPage(int pageNum, GfxState *state);
867      virtual void endPage();
868 -    virtual void drawLink(Link *link, Catalog *catalog);
869 +    virtual void processLink(Link *link);
870      virtual void updateFont(GfxState *state);
871    
872      virtual void saveState(GfxState *state);
873 diff --git a/lib/pdf/Makefile.in b/lib/pdf/Makefile.in
874 index 77ff347..45232b8 100644
875 --- a/lib/pdf/Makefile.in
876 +++ b/lib/pdf/Makefile.in
877 @@ -15,7 +15,7 @@ libgfxpdf_objects = VectorGraphicOutputDev.$(O) BitmapOutputDev.$(O) FullBitmapO
878  xpdf_in_source = @xpdf_in_source@
879  
880  xpdf_objects =  xpdf/GHash.$(O) xpdf/GList.$(O) xpdf/GString.$(O) xpdf/gmem.$(O) xpdf/gfile.$(O) \
881 -                 xpdf/FoFiTrueType.$(O) xpdf/FoFiType1.$(O) xpdf/FoFiType1C.$(O) xpdf/FoFiBase.$(O) xpdf/FoFiEncodings.$(O) \
882 +                 xpdf/FoFiTrueType.$(O) xpdf/FoFiType1.$(O) xpdf/FoFiType1C.$(O) xpdf/FoFiBase.$(O) xpdf/FoFiEncodings.$(O) xpdf/FoFiIdentifier.$(O) \
883                   xpdf/OutputDev.$(O) xpdf/PDFDoc.$(O) xpdf/Error.$(O) xpdf/Stream.$(O) xpdf/Object.$(O) \
884                   xpdf/Decrypt.$(O) xpdf/Array.$(O) xpdf/XRef.$(O) xpdf/Dict.$(O) xpdf/Parser.$(O) \
885                   xpdf/Lexer.$(O) xpdf/Outline.$(O) xpdf/PDFDocEncoding.$(O) xpdf/Catalog.$(O) \
886 @@ -23,7 +23,7 @@ xpdf_objects =  xpdf/GHash.$(O) xpdf/GList.$(O) xpdf/GString.$(O) xpdf/gmem.$(O)
887                   xpdf/JArithmeticDecoder.$(O) xpdf/Gfx.$(O) xpdf/GfxFont.$(O) xpdf/CMap.$(O) xpdf/CharCodeToUnicode.$(O) \
888                   xpdf/PSTokenizer.$(O) xpdf/FontEncodingTables.$(O) xpdf/BuiltinFont.$(O) xpdf/BuiltinFontTables.$(O) \
889                   xpdf/GfxState.$(O) xpdf/Function.$(O) xpdf/Annot.$(O) xpdf/NameToCharCode.$(O) xpdf/UnicodeMap.$(O) \
890 -                 xpdf/SecurityHandler.$(O) xpdf/TextOutputDev.$(O) xpdf/UnicodeTypeTable.$(O)
891 +                 xpdf/SecurityHandler.$(O) xpdf/TextOutputDev.$(O) xpdf/UnicodeTypeTable.$(O) xpdf/OptionalContent.$(O)
892                   #xpdf/OptionalContent.$(O)
893  
894  splash_in_source = @splash_in_source@
895 @@ -49,9 +49,9 @@ VectorGraphicOutputDev.$(O): VectorGraphicOutputDev.cc VectorGraphicOutputDev.h
896         $(CC) -I ./ $(xpdf_include) VectorGraphicOutputDev.cc -o $@
897  CharOutputDev.$(O): CharOutputDev.cc CharOutputDev.h CommonOutputDev.h InfoOutputDev.h ../gfxpoly.h
898         $(CC) -I ./ $(xpdf_include) CharOutputDev.cc -o $@
899 -InfoOutputDev.$(O): InfoOutputDev.cc InfoOutputDev.h
900 +InfoOutputDev.$(O): InfoOutputDev.cc InfoOutputDev.h GFXSplashOutputDev.h
901         $(CC) -I ./ $(xpdf_include) InfoOutputDev.cc -o $@
902 -BitmapOutputDev.$(O): BitmapOutputDev.cc BitmapOutputDev.h CommonOutputDev.h InfoOutputDev.h
903 +BitmapOutputDev.$(O): BitmapOutputDev.cc BitmapOutputDev.h CommonOutputDev.h InfoOutputDev.h GFXSplashOutputDev.h
904         $(CC) -I ./ $(xpdf_include) BitmapOutputDev.cc -o $@
905  XMLOutputDev.$(O): XMLOutputDev.cc XMLOutputDev.h xpdf/TextOutputDev.h
906         $(CC) -I ./ $(xpdf_include) XMLOutputDev.cc -o $@
907 @@ -65,8 +65,8 @@ pdf.$(O): pdf.cc VectorGraphicOutputDev.h CharOutputDev.h InfoOutputDev.h Common
908  XPDFOK = xpdf/Gfx.cc
909  ifeq ($(shell echo inject*xpdf.pl),inject-xpdf.pl)
910  $(XPDFOK): Makefile.in inject-xpdf.pl xpdf-*tar.gz xpdf*patch
911 -       @if test xpdf-changes.patch -nt $(XPDFOK);then perl inject-xpdf.pl xpdf-3.02.tar.gz;fi
912 -       @if test '!' -d xpdf;then perl inject-xpdf.pl xpdf-3.02.tar.gz;fi
913 +       @if test xpdf-changes.patch -nt $(XPDFOK);then perl inject-xpdf.pl xpdf-3.03.tar.gz;fi
914 +       @if test '!' -d xpdf;then perl inject-xpdf.pl xpdf-3.03.tar.gz;fi
915  endif
916  
917  xpdf/UnicodeMap.$(O): xpdf/UnicodeMap.cc
918 @@ -131,6 +131,8 @@ xpdf/Error.$(O): xpdf/Error.cc aconf.h
919         $(CC) -I ./ -I xpdf xpdf/Error.cc -o $@
920  xpdf/Stream.$(O): xpdf/Stream.cc
921         $(CC) -I ./ -I xpdf xpdf/Stream.cc -o $@
922 +xpdf/OptionalContent.$(O): xpdf/OptionalContent.cc
923 +       $(CC) -I ./ -I xpdf xpdf/OptionalContent.cc -o $@
924  xpdf/PDFDoc.$(O): xpdf/PDFDoc.cc
925         $(CC) -I ./ -I xpdf xpdf/PDFDoc.cc -o $@
926  xpdf/SecurityHandler.$(O): xpdf/SecurityHandler.cc xpdf/SecurityHandler.h
927 @@ -147,6 +149,8 @@ xpdf/FoFiType1C.$(O): xpdf/FoFiType1C.cc xpdf/FoFiBase.h
928         $(CC) -I ./ -I xpdf xpdf/FoFiType1C.cc -o $@
929  xpdf/FoFiType1.$(O): xpdf/FoFiType1.cc xpdf/FoFiBase.h
930         $(CC) -I ./ -I xpdf xpdf/FoFiType1.cc -o $@
931 +xpdf/FoFiIdentifier.$(O): xpdf/FoFiIdentifier.cc
932 +       $(CC) -I ./ -I xpdf xpdf/FoFiIdentifier.cc -o $@
933  xpdf/GList.$(O): xpdf/GList.cc
934         $(CC) -I ./ -I xpdf xpdf/GList.cc -o $@
935  xpdf/GString.$(O): xpdf/GString.cc
936 diff --git a/lib/pdf/VectorGraphicOutputDev.cc b/lib/pdf/VectorGraphicOutputDev.cc
937 index 9194a02..abade59 100644
938 --- a/lib/pdf/VectorGraphicOutputDev.cc
939 +++ b/lib/pdf/VectorGraphicOutputDev.cc
940 @@ -262,7 +262,7 @@ GBool VectorGraphicOutputDev::useTilingPatternFill()
941          return gTrue;
942      return gFalse;
943  }
944 -GBool VectorGraphicOutputDev::useShadedFills()
945 +GBool VectorGraphicOutputDev::useShadedFills(POPPLER_SHADED_FILL_TYPE)
946  {
947      infofeature("shaded fills");
948      if(config_convertgradients)
949 @@ -271,9 +271,11 @@ GBool VectorGraphicOutputDev::useShadedFills()
950  }
951  
952  POPPLER_TILING_PATERN_RETURN VectorGraphicOutputDev::tilingPatternFill(GfxState *state,
953 -                              POPPLER_TILING_PATERN_GFX
954 +                               Gfx *gfx,
955 +                               POPPLER_TILING_PATTERN_CATALOG
956                                Object *str,
957 -                              int paintType, Dict *resDict,
958 +                               POPPLER_TILING_PATTERN_PMAT
959 +                              int paintType, POPPLER_TILING_PATTERN_TILING_TYPE Dict *resDict,
960                                double *mat, double *bbox,
961                                int x0, int y0, int x1, int y1,
962                                double xStep, double yStep) 
963 @@ -680,9 +682,9 @@ void VectorGraphicOutputDev::updateFont(GfxState*state)
964      charDev->updateFont(state);
965  }
966  
967 -void VectorGraphicOutputDev::processLink(Link *link, Catalog *catalog)
968 +void VectorGraphicOutputDev::processLink(Link *link)
969  {
970 -    charDev->processLink(link, catalog);
971 +    charDev->processLink(link);
972  }
973  
974  void VectorGraphicOutputDev::beginString(GfxState *state, GString *s) 
975 @@ -837,9 +839,10 @@ void VectorGraphicOutputDev::endType3Char(GfxState *state)
976  GBool VectorGraphicOutputDev::checkPageSlice(Page *page, double hDPI, double vDPI,
977                            int rotate, GBool useMediaBox, GBool crop,
978                            int sliceX, int sliceY, int sliceW, int sliceH,
979 -                          GBool printing, Catalog *catalog,
980 +                          GBool printing,
981                            GBool (*abortCheckCbk)(void *data),
982 -                          void *abortCheckCbkData)
983 +                          void *abortCheckCbkData
984 +                           POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_DATA)
985  {
986      this->setPage(page);
987      charDev->setPage(page);
988 @@ -1362,11 +1365,11 @@ void VectorGraphicOutputDev::drawGeneralImage(GfxState *state, Object *ref, Stre
989  }
990  
991  void VectorGraphicOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
992 -                                  int width, int height, GBool invert,
993 +                                  int width, int height, GBool invert, POPPLER_INTERPOLATE
994                                    GBool inlineImg) 
995  {
996      if(config_textonly) {
997 -       OutputDev::drawImageMask(state,ref,str,width,height,invert,inlineImg);
998 +        OutputDev::drawImageMask(state,ref,str,width,height,invert,POPPLER_INTERPOLATE_ARG inlineImg);
999         return;
1000      }
1001      dbg("drawImageMask %dx%d, invert=%d inline=%d", width, height, invert, inlineImg);
1002 @@ -1375,11 +1378,11 @@ void VectorGraphicOutputDev::drawImageMask(GfxState *state, Object *ref, Stream
1003  }
1004  
1005  void VectorGraphicOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
1006 -                        int width, int height, GfxImageColorMap *colorMap,
1007 +                        int width, int height, GfxImageColorMap *colorMap, POPPLER_INTERPOLATE
1008                          int *maskColors, GBool inlineImg)
1009  {
1010      if(config_textonly) {
1011 -       OutputDev::drawImage(state,ref,str,width,height,colorMap,maskColors,inlineImg);
1012 +       OutputDev::drawImage(state,ref,str,width,height,colorMap,POPPLER_INTERPOLATE_ARG maskColors,inlineImg);
1013         return;
1014      }
1015      dbg("drawImage %dx%d, %s, %s, inline=%d", width, height, 
1016 @@ -1398,12 +1401,12 @@ void VectorGraphicOutputDev::drawImage(GfxState *state, Object *ref, Stream *str
1017    
1018  void VectorGraphicOutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str,
1019                                int width, int height,
1020 -                              GfxImageColorMap *colorMap,
1021 +                              GfxImageColorMap *colorMap, POPPLER_INTERPOLATE
1022                                Stream *maskStr, int maskWidth, int maskHeight,
1023 -                              GBool maskInvert)
1024 +                              GBool maskInvert POPPLER_MASK_INTERPOLATE)
1025  {
1026      if(config_textonly) {
1027 -       OutputDev::drawMaskedImage(state,ref,str,width,height,colorMap,maskStr,maskWidth,maskHeight,maskInvert);
1028 +       OutputDev::drawMaskedImage(state,ref,str,width,height,colorMap,POPPLER_INTERPOLATE_ARG maskStr,maskWidth,maskHeight,maskInvert POPPLER_MASK_INTERPOLATE_ARG);
1029         return;
1030      }
1031      dbg("drawMaskedImage %dx%d, %s, %dx%d mask", width, height, 
1032 @@ -1420,13 +1423,13 @@ void VectorGraphicOutputDev::drawMaskedImage(GfxState *state, Object *ref, Strea
1033  
1034  void VectorGraphicOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
1035                                    int width, int height,
1036 -                                  GfxImageColorMap *colorMap,
1037 +                                  GfxImageColorMap *colorMap, POPPLER_INTERPOLATE
1038                                    Stream *maskStr,
1039                                    int maskWidth, int maskHeight,
1040 -                                  GfxImageColorMap *maskColorMap)
1041 +                                  GfxImageColorMap *maskColorMap POPPLER_MASK_INTERPOLATE)
1042  {
1043      if(config_textonly) {
1044 -       OutputDev::drawSoftMaskedImage(state,ref,str,width,height,colorMap,maskStr,maskWidth,maskHeight,maskColorMap);
1045 +       OutputDev::drawSoftMaskedImage(state,ref,str,width,height,colorMap,POPPLER_INTERPOLATE_ARG maskStr,maskWidth,maskHeight,maskColorMap POPPLER_MASK_INTERPOLATE_ARG);
1046         return;
1047      }
1048      dbg("drawSoftMaskedImage %dx%d, %s, %dx%d mask", width, height, 
1049 diff --git a/lib/pdf/VectorGraphicOutputDev.h b/lib/pdf/VectorGraphicOutputDev.h
1050 index 6e530d6..7a1e58f 100644
1051 --- a/lib/pdf/VectorGraphicOutputDev.h
1052 +++ b/lib/pdf/VectorGraphicOutputDev.h
1053 @@ -64,9 +64,11 @@ public:
1054    virtual GBool checkPageSlice(Page *page, double hDPI, double vDPI,
1055                                int rotate, GBool useMediaBox, GBool crop,
1056                                int sliceX, int sliceY, int sliceW, int sliceH,
1057 -                              GBool printing, Catalog *catalog,
1058 +                              GBool printing,
1059                                GBool (*abortCheckCbk)(void *data) = NULL,
1060 -                              void *abortCheckCbkData = NULL);
1061 +                              void *abortCheckCbkData = NULL
1062 +                               POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_H
1063 +                               POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_DATA_H);
1064    //----- get info about output device
1065  
1066    // Does this device use upside-down coordinates?
1067 @@ -79,7 +81,7 @@ public:
1068    //virtual GBool useShadedFills() { return gTrue; }
1069  
1070    //----- link borders
1071 -  virtual void processLink(Link *link, Catalog *catalog);
1072 +  virtual void processLink(Link *link);
1073    virtual void setDefaultCTM(double *ctm);
1074  
1075    //----- save/restore graphics state
1076 @@ -103,12 +105,14 @@ public:
1077    
1078    //----- shaded fills
1079    virtual GBool useTilingPatternFill();
1080 -  virtual GBool useShadedFills();
1081 +  virtual GBool useShadedFills(POPPLER_SHADED_FILL_TYPE);
1082  
1083  virtual POPPLER_TILING_PATERN_RETURN tilingPatternFill(GfxState *state,
1084 -                            POPPLER_TILING_PATERN_GFX
1085 +                             Gfx *gfx,
1086 +                             POPPLER_TILING_PATTERN_CATALOG
1087                              Object *str,
1088 -                            int paintType, Dict *resDict,
1089 +                             POPPLER_TILING_PATTERN_PMAT
1090 +                            int paintType, POPPLER_TILING_PATTERN_TILING_TYPE Dict *resDict,
1091                              double *mat, double *bbox,
1092                              int x0, int y0, int x1, int y1,
1093                              double xStep, double yStep);
1094 @@ -128,22 +132,22 @@ virtual POPPLER_TILING_PATERN_RETURN tilingPatternFill(GfxState *state,
1095  
1096    //----- image drawing
1097    virtual void drawImageMask(GfxState *state, Object *ref, Stream *str,
1098 -                            int width, int height, GBool invert,
1099 +                            int width, int height, GBool invert, POPPLER_INTERPOLATE
1100                              GBool inlineImg);
1101    virtual void drawImage(GfxState *state, Object *ref, Stream *str,
1102 -                        int width, int height, GfxImageColorMap *colorMap,
1103 +                        int width, int height, GfxImageColorMap *colorMap, POPPLER_INTERPOLATE
1104                          int *maskColors, GBool inlineImg);
1105    virtual void drawMaskedImage(GfxState *state, Object *ref, Stream *str,
1106                                int width, int height,
1107 -                              GfxImageColorMap *colorMap,
1108 +                              GfxImageColorMap *colorMap, POPPLER_INTERPOLATE
1109                                Stream *maskStr, int maskWidth, int maskHeight,
1110 -                              GBool maskInvert);
1111 +                              GBool maskInvert POPPLER_MASK_INTERPOLATE);
1112    virtual void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
1113                                    int width, int height,
1114 -                                  GfxImageColorMap *colorMap,
1115 +                                  GfxImageColorMap *colorMap, POPPLER_INTERPOLATE
1116                                    Stream *maskStr,
1117                                    int maskWidth, int maskHeight,
1118 -                                  GfxImageColorMap *maskColorMap);
1119 +                                  GfxImageColorMap *maskColorMap POPPLER_MASK_INTERPOLATE);
1120  
1121    //----- transparency groups and soft masks (xpdf >= ~ 3.01.16)
1122    virtual void beginTransparencyGroup(GfxState *state, double *bbox,
1123 diff --git a/lib/pdf/XMLOutputDev.cc b/lib/pdf/XMLOutputDev.cc
1124 index 06aad02..fb3aee1 100644
1125 --- a/lib/pdf/XMLOutputDev.cc
1126 +++ b/lib/pdf/XMLOutputDev.cc
1127 @@ -27,7 +27,7 @@
1128  #endif
1129  
1130  XMLOutputDev::XMLOutputDev(char*filename)
1131 -:TextOutputDev(mktmpname(0), false, false, false)
1132 +:TextOutputDev(mktmpname(0), false, 0, false, false)
1133  {
1134    out = fopen(filename, "wb");
1135    if(!out) {
1136 #diff --git a/lib/pdf/inject-xpdf.pl b/lib/pdf/inject-xpdf.pl
1137 #index 386dc12..f0e2fc1 100755
1138 #--- a/lib/pdf/inject-xpdf.pl
1139 #+++ b/lib/pdf/inject-xpdf.pl
1140 #@@ -59,7 +59,7 @@ fi
1141 # if test "x\$VERSION" = "xstable";then
1142 #     echo "Switching to stable version"
1143 #     rm -f xpdf
1144 #-    ln -s xpdf-3.02 xpdf
1145 #+    ln -s xpdf-3.03 xpdf
1146 # elif test "x\$VERSION" = "xlatest";then
1147 #     echo "Switching to latest version"
1148 #     rm -f xpdf
1149 diff --git a/lib/pdf/pdf.cc b/lib/pdf/pdf.cc
1150 index 1e668a0..61165fb 100644
1151 --- a/lib/pdf/pdf.cc
1152 +++ b/lib/pdf/pdf.cc
1153 @@ -16,6 +16,7 @@
1154  #include "FullBitmapOutputDev.h"
1155  #include "BitmapOutputDev.h"
1156  #include "VectorGraphicOutputDev.h"
1157 +#include "popplercompat.h"
1158  #include "../mem.h"
1159  #include "pdf.h"
1160  #define NO_ARGPARSER
1161 @@ -533,7 +534,7 @@ static gfxdocument_t*pdf_open(gfxsource_t*src, const char*filename)
1162         msg("<notice> Rendering at %f DPI. (Page width at 72 DPI: %f, target width: %d)", zoom, width_before, zoomtowidth);
1163      }
1164  
1165 -    i->info = new InfoOutputDev(i->doc->getXRef());
1166 +    i->info = new InfoOutputDev(i->doc);
1167      int t;
1168      i->pages = (pdf_page_info_t*)malloc(sizeof(pdf_page_info_t)*pdf_doc->num_pages);
1169      memset(i->pages,0,sizeof(pdf_page_info_t)*pdf_doc->num_pages);
1170 diff --git a/lib/pdf/popplercompat.h b/lib/pdf/popplercompat.h
1171 index 8303369..9727733 100644
1172 --- a/lib/pdf/popplercompat.h
1173 +++ b/lib/pdf/popplercompat.h
1174 @@ -17,17 +17,8 @@
1175  
1176  #ifdef HAVE_POPPLER
1177    #define POPPLER_TILING_PATERN_RETURN GBool
1178 -  #define POPPLER_TILING_PATERN_GFX
1179 -  #define POPPLER_TILING_PATERN_GFX_ARG
1180  #else
1181    #define POPPLER_TILING_PATERN_RETURN void
1182 -  #if (xpdfMajorVersion*10000 + xpdfMinorVersion*100 + xpdfUpdateVersion) < 30207
1183 -    #define POPPLER_TILING_PATERN_GFX
1184 -    #define POPPLER_TILING_PATERN_GFX_ARG
1185 -  #else
1186 -    #define POPPLER_TILING_PATERN_GFX Gfx *gfx,
1187 -    #define POPPLER_TILING_PATERN_GFX_ARG gfx,
1188 -  #endif
1189  #endif
1190  
1191  #ifdef HAVE_POPPLER
1192 @@ -43,6 +34,74 @@ char* mktmpname(char*ptr);
1193  #endif
1194  
1195  #ifdef HAVE_POPPLER
1196 +#define AnnotLink Link
1197 +#endif
1198 +
1199 +#ifdef HAVE_POPPLER
1200 +  #define POPPLER_STARTDOC_ARG this->doc
1201 +  #define INFO_OUTPUT_DEV_STARTDOC_ARG doc
1202 +#else
1203 +  #define POPPLER_STARTDOC_ARG this->xref
1204 +  #define INFO_OUTPUT_DEV_STARTDOC_ARG doc->getXRef()
1205 +#endif
1206 +
1207 +#ifdef HAVE_POPPLER
1208 +  #define POPPLER_SHADED_FILL_TYPE int type
1209 +  #define POPPLER_SHADED_FILL_TYPE_ARG type
1210 +#else
1211 +  #define POPPLER_SHADED_FILL_TYPE
1212 +  #define POPPLER_SHADED_FILL_TYPE_ARG
1213 +#endif
1214 +
1215 +#ifdef HAVE_POPPLER
1216 +  #define POPPLER_TILING_PATTERN_CATALOG Catalog *cat,
1217 +  #define POPPLER_TILING_PATTERN_CATALOG_ARG cat,
1218 +  #define POPPLER_TILING_PATTERN_PMAT double *pmat,
1219 +  #define POPPLER_TILING_PATTERN_PMAT_ARG pmat,
1220 +  #define POPPLER_TILING_PATTERN_TILING_TYPE int tilingType,
1221 +  #define POPPLER_TILING_PATTERN_TILING_TYPE_ARG tilingType,
1222 +#else
1223 +  #define POPPLER_TILING_PATTERN_CATALOG
1224 +  #define POPPLER_TILING_PATTERN_CATALOG_ARG
1225 +  #define POPPLER_TILING_PATTERN_PMAT
1226 +  #define POPPLER_TILING_PATTERN_PMAT_ARG
1227 +  #define POPPLER_TILING_PATTERN_TILING_TYPE
1228 +  #define POPPLER_TILING_PATTERN_TILING_TYPE_ARG
1229 +#endif
1230 +
1231 +#ifdef HAVE_POPPLER
1232 +  #define POPPLER_GET_GLYPH_ARGS , x0, y0, &clip, &clipRes
1233 +#else
1234 +  #define POPPLER_GET_GLYPH_ARGS
1235 +#endif
1236 +
1237 +#ifndef HAVE_POPPLER
1238 +  #define GFXSplashOutputDev SplashOutputDev
1239 +#endif
1240 +
1241 +#ifdef HAVE_POPPLER
1242 +  #define POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_H , GBool (*annotDisplayDecideCbk)(Annot *annot, void *user_data) = NULL
1243 +  #define POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK , GBool (*annotDisplayDecideCbk)(Annot *annot, void *user_data)
1244 +  #define POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_DATA_H , void *annotDisplayDecideCbkData = NULL
1245 +  #define POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_DATA , void *annotDisplayDecideCbkData
1246 +#else
1247 +  #define POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_H
1248 +  #define POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK
1249 +  #define POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_DATA_H
1250 +  #define POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_DATA
1251 +#endif
1252 +
1253 +#ifdef HAVE_POPPLER
1254 +  #define POPPLER_COPY_STATE_PATH gTrue
1255 +#else
1256 +  #define POPPLER_COPY_STATE_PATH gFalse
1257 +#endif
1258 +
1259 +#ifdef HAVE_POPPLER
1260 +  #define GFXGlobalParams GlobalParams
1261 +#endif
1262 +
1263 +#ifdef HAVE_POPPLER
1264    #include <goo/GooString.h>
1265    #include <goo/gfile.h>
1266  #else
1267 #diff --git a/lib/pdf/xpdf-3.02.tar.gz b/lib/pdf/xpdf-3.02.tar.gz
1268 #deleted file mode 100644
1269 #index 1411a87..0000000
1270 #Binary files a/lib/pdf/xpdf-3.02.tar.gz and /dev/null differ
1271 #diff --git a/lib/pdf/xpdf-3.03.tar.gz b/lib/pdf/xpdf-3.03.tar.gz
1272 #new file mode 100644
1273 #index 0000000..488e9bd
1274 #Binary files /dev/null and b/lib/pdf/xpdf-3.03.tar.gz differ
1275 #diff --git a/lib/pdf/xpdf-changes.patch b/lib/pdf/xpdf-changes.patch
1276 #index 23d19a4..ca547b7 100644
1277 #--- a/lib/pdf/xpdf-changes.patch
1278 #+++ b/lib/pdf/xpdf-changes.patch
1279 # *** deleted ***
This page took 0.330877 seconds and 3 git commands to generate.