Description: track changes to libpoppler25 API
 Track changes to libpoppler25 API:
 .
 startDoc now takes a PDFDoc rather than its XRef.
 displaySlice no longer takes a Catalog argument.
 TextOutputDev now takes a fixedPitch argument (0 for previous behavior).
 createGfx no longer takes a Catalog nor (unused) annotation
 callback descriminator.
 getAnnots no longer takes a Catalog argument.
 .
 Also adds configure support for poppler version 20 (API version 25)
Author: Andy Whitcroft <apw@ubuntu.com>
Last-Update: 2012-06-20
Index: gambas3-3.1.1/gb.pdf/src/CPdfDocument.cpp
===================================================================
--- gambas3-3.1.1.orig/gb.pdf/src/CPdfDocument.cpp	2012-06-20 12:13:11.670036741 +0100
+++ gambas3-3.1.1/gb.pdf/src/CPdfDocument.cpp	2012-06-20 12:54:39.618373811 +0100
@@ -450,7 +450,13 @@
 	white[0] = 0xFF; white[1] = 0xFF; white[2] = 0xFF;
 	THIS->dev=new SplashOutputDev(splashModeRGB8, 3, gFalse, white);
 		
-	THIS->dev->startDoc(THIS->doc->getXRef ());
+	THIS->dev->startDoc(
+#ifdef POPPLER_VERSION_0_20
+			    THIS->doc
+#else
+			    THIS->doc->getXref ()
+#endif
+	);
 
 	outline=THIS->doc->getOutline();
 	if (outline) THIS->index=outline->getItems();
@@ -880,8 +886,11 @@
 			   gFalse,
 			   gTrue,
 			   x,y,w,h,
-			   gFalse,
-			   THIS->doc->getCatalog ());
+			   gFalse
+#ifndef POPPLER_VERSION_0_20
+			   , THIS->doc->getCatalog ()
+#endif
+	);
 
 	map=THIS->dev->getBitmap();
 	
@@ -940,8 +949,20 @@
 	w = VARGOPT(W, (int32_t)THIS->page->getMediaWidth());
 	h = VARGOPT(H, (int32_t)THIS->page->getMediaHeight());
 
-	dev = new TextOutputDev (NULL, gTrue, gFalse, gFalse);
-	gfx = THIS->page->createGfx(dev,72.0,72.0,0,gFalse,gTrue,-1, -1, -1, -1, gFalse,THIS->doc->getCatalog (),NULL, NULL, NULL, NULL);
+	dev = new TextOutputDev (NULL, gTrue,
+#ifdef POPPLER_VERSION_0_20
+                                 0,
+#endif
+                                 gFalse, gFalse);
+	gfx = THIS->page->createGfx(dev,72.0,72.0,0,gFalse,gTrue,-1, -1, -1, -1, gFalse
+#ifndef POPPLER_VERSION_0_20
+				    , THIS->doc->getCatalog ()
+#endif
+				    , NULL, NULL
+#ifndef POPPLER_VERSION_0_20
+				    , NULL, NULL
+#endif
+	);
 	
 	THIS->page->display(gfx);
 	dev->endPage();
@@ -970,7 +991,9 @@
 
 void aux_fill_links(void *_object)
 {
-	#if POPPLER_VERSION_0_17
+	#if POPPLER_VERSION_0_20
+	THIS->links = new Links (THIS->page->getAnnots ());
+	#elif POPPLER_VERSION_0_17
 	THIS->links = new Links (THIS->page->getAnnots (THIS->doc->getCatalog()));
 	#else
 	Object obj;
@@ -1152,13 +1175,25 @@
 
 	if (!MISSING(Sensitive)) sensitive=VARG(Sensitive);
 
-	textdev = new TextOutputDev (NULL, true, false, false);
-	THIS->page->display (textdev, 72, 72, 0, false, false, false, THIS->doc->getCatalog());
+	textdev = new TextOutputDev (NULL, true,
+#ifdef POPPLER_VERSION_0_20
+                                     0,
+#endif
+                                     false, false);
+	THIS->page->display (textdev, 72, 72, 0, false, false, false
+#ifndef POPPLER_VERSION_0_20
+                             , THIS->doc->getCatalog()
+#endif
+                            );
 
 	if (THIS->Found) { GB.FreeArray(POINTER(&THIS->Found)); THIS->Found=NULL; }
 
 	count = 0;
-	while (textdev->findText (block,nlen,gFalse,gTrue,gTrue,gFalse,sensitive,gFalse,&x0,&y0,&x1,&y1))
+	while (textdev->findText (block,nlen,gFalse,gTrue,gTrue,gFalse,sensitive,gFalse,
+#ifdef POPPLER_VERSION_0_20
+				 gFalse,
+#endif
+				 &x0,&y0,&x1,&y1))
 	{
 		if (!THIS->Found)
 			GB.NewArray(POINTER(&THIS->Found),sizeof(CPDFFIND),1);
Index: gambas3-3.1.1/gb.pdf/configure.ac
===================================================================
--- gambas3-3.1.1.orig/gb.pdf/configure.ac	2012-06-20 12:13:11.654036663 +0100
+++ gambas3-3.1.1/gb.pdf/configure.ac	2012-06-20 12:13:15.138053936 +0100
@@ -24,6 +24,8 @@
   AC_DEFINE_UNQUOTED(POPPLER_VERSION_0_11_3, $((1-$?)), Poppler version >= 0.11.3)
   pkg-config --atleast-version=0.17.0 poppler
   AC_DEFINE_UNQUOTED(POPPLER_VERSION_0_17, $((1-$?)), Poppler version >= 0.17)
+  pkg-config --atleast-version=0.20.0 poppler
+  AC_DEFINE_UNQUOTED(POPPLER_VERSION_0_20, $((1-$?)), Poppler version >= 0.20)
 fi
 
 AC_OUTPUT( \
Index: gambas3-3.1.1/gb.pdf/config.h.in
===================================================================
--- gambas3-3.1.1.orig/gb.pdf/config.h.in	2012-06-20 12:13:11.642036604 +0100
+++ gambas3-3.1.1/gb.pdf/config.h.in	2012-06-20 12:13:15.138053936 +0100
@@ -147,6 +147,9 @@
 /* Poppler version >= 0.11.3 */
 #undef POPPLER_VERSION_0_11_3
 
+/* Poppler version >= 0.20 */
+#undef POPPLER_VERSION_0_20
+
 /* Poppler version >= 0.17 */
 #undef POPPLER_VERSION_0_17
 
