Index: Etoile/Frameworks/PopplerKit/bindings/poppler_page.cc =================================================================== --- Etoile/Frameworks/PopplerKit/bindings/poppler_page.cc (révision 2341) +++ Etoile/Frameworks/PopplerKit/bindings/poppler_page.cc (révision 2342) @@ -33,7 +33,8 @@ return NULL; } - if ((pageIndex <= 0) || (pageIndex > PDF_DOC(poppler_document)->getNumPages())) + if ((pageIndex <= 0) || + ((int)pageIndex > PDF_DOC(poppler_document)->getNumPages())) { return NULL; } @@ -69,8 +70,7 @@ #ifdef POPPLER_0_4 return PAGE(poppler_page)->getWidth(); -#endif -#ifdef POPPLER_0_5 +#else return PAGE(poppler_page)->getMediaWidth(); #endif @@ -85,9 +85,7 @@ #ifdef POPPLER_0_4 return PAGE(poppler_page)->getHeight(); -#endif -#ifdef POPPLER_0_5 +#else return PAGE(poppler_page)->getMediaHeight(); #endif - } Index: Etoile/Frameworks/PopplerKit/bindings/poppler.cc =================================================================== --- Etoile/Frameworks/PopplerKit/bindings/poppler.cc (révision 2341) +++ Etoile/Frameworks/PopplerKit/bindings/poppler.cc (révision 2342) @@ -110,7 +110,7 @@ } // tell fontconfig about application fonts - for (int i = 0; i < nappFonts; i++) + for (unsigned int i = 0; i < nappFonts; i++) { if (FcConfigAppFontAddFile(FcConfigGetCurrent(), appFonts[i])) { @@ -118,12 +118,16 @@ } else { - fprintf(stderr, "failed to register application font %s\n"); + fprintf(stderr, "failed to register application font %s\n", appFonts[i]); } fflush(stderr); } +#ifdef POPPLER_0_6 + globalParams = new GlobalParams(); +#else globalParams = new GlobalParams(NULL); +#endif #ifdef POPPLER_0_4 globalParams->setupBaseFontsFc(NULL); #endif Index: Etoile/Frameworks/PopplerKit/bindings/poppler_splash_renderer.cc =================================================================== --- Etoile/Frameworks/PopplerKit/bindings/poppler_splash_renderer.cc (révision 2341) +++ Etoile/Frameworks/PopplerKit/bindings/poppler_splash_renderer.cc (révision 2342) @@ -38,8 +38,7 @@ #ifdef POPPLER_0_4 white.rgb8 = splashMakeRGB8(bg_red, bg_green, bg_blue); void* splashDevice = new SplashOutputDev(splashModeRGB8, gFalse, white); -#endif -#ifdef POPPLER_0_5 +#else // 0.5, 0.6 white[0] = bg_red; white[1] = bg_green; white[2] = bg_blue; @@ -86,13 +85,17 @@ SYNCHRONIZED(PAGE(poppler_page)->displaySlice(SPLASH_DEV(output_dev), (double)hDPI, (double)vDPI, rotate, -#ifdef POPPLER_0_5 +#ifndef POPPLER_0_4 // 0.5, 0.6 gTrue, // useMediaBox #endif gTrue, // Crop (int)sliceX, (int)sliceY, (int)sliceW, (int)sliceH, +#ifdef POPPLER_0_6 + gFalse, // printing +#else NULL, // Links +#endif PDF_DOC(poppler_document)->getCatalog())); return 1; @@ -123,16 +126,14 @@ #ifdef POPPLER_0_4 SplashRGB8* rgb8; -#endif -#ifdef POPPLER_0_5 +#else // 0.5, 0.6 SplashColorPtr color; #endif unsigned char* dataPtr; #ifdef POPPLER_0_4 rgb8 = SPLASH_BITMAP(bitmap)->getDataPtr().rgb8; -#endif -#ifdef POPPLER_0_5 +#else // 0.5, 0.6 color = SPLASH_BITMAP(bitmap)->getDataPtr(); #endif @@ -146,8 +147,7 @@ *dataPtr++ = splashRGB8G(*rgb8); *dataPtr++ = splashRGB8B(*rgb8); ++rgb8; -#endif -#ifdef POPPLER_0_5 +#else // 0.5, 0.6 *dataPtr++ = splashRGB8R(color); *dataPtr++ = splashRGB8G(color); *dataPtr++ = splashRGB8B(color); Index: Etoile/Frameworks/PopplerKit/bindings/GNUmakefile =================================================================== --- Etoile/Frameworks/PopplerKit/bindings/GNUmakefile (révision 2341) +++ Etoile/Frameworks/PopplerKit/bindings/GNUmakefile (révision 2342) @@ -55,4 +55,8 @@ bindings_CFLAGS += -DPOPPLER_0_5 endif +ifeq ($(POPPLER_0_6), YES) + bindings_CFLAGS += -DPOPPLER_0_6 +endif + include $(GNUSTEP_MAKEFILES)/subproject.make Index: Etoile/Frameworks/PopplerKit/bindings/poppler_text.cc =================================================================== --- Etoile/Frameworks/PopplerKit/bindings/poppler_text.cc (révision 2341) +++ Etoile/Frameworks/PopplerKit/bindings/poppler_text.cc (révision 2342) @@ -51,10 +51,16 @@ SYNCHRONIZED(PAGE(poppler_page)->display(TEXT_DEV(text_device), hDPI, vDPI, rotate, -#ifdef POPPLER_0_5 +#ifndef POPPLER_0_4 gTrue, // useMediaBox #endif - crop, NULL, PDF_DOC(poppler_document)->getCatalog())); + crop, +#ifdef POPPLER_0_6 + gFalse, // printing +#else + NULL, // links +#endif + PDF_DOC(poppler_document)->getCatalog())); return 1; } @@ -70,7 +76,7 @@ int result = TEXT_DEV(text_device)->findText(text_utf32, text_len, start_at_top, stop_at_bottom, start_at_last, stop_at_last, -#ifdef POPPLER_0_5 +#ifndef POPPLER_0_4 // 0.5, 0.6 gTrue, gFalse, #endif x_min, y_min, x_max, y_max); Index: Etoile/Frameworks/PopplerKit/config.sh =================================================================== --- Etoile/Frameworks/PopplerKit/config.sh (révision 2341) +++ Etoile/Frameworks/PopplerKit/config.sh (révision 2342) @@ -60,6 +60,13 @@ POPPLER_VERSION="POPPLER_0_5" fi +${PKG_CONFIG} --atleast-version=0.5.9 poppler +if [ $? -eq 0 ]; then + POPPLER_VERSION="POPPLER_0_6" +fi + +echo $POPPLER_VERSION + # include freetype, just to be sure ${PKG_CONFIG} --exists freetype2 if [ $? -eq 0 ]; then