Package: gambas3
Version: 3.1.1-2
Severity: normal
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu quantal ubuntu-patch

Dear Maintainer,

We are using this patch in Ubuntu to handle the changes in libpoppler's
API version 19 to version 25/26.  Please consider for Debian.

  * Track changes to libpoppler25 API.


Thanks for considering the patch.

-apw
-- System Information:
Debian Release: wheezy/sid
  APT prefers precise-updates
  APT policy: (500, 'precise-updates'), (500, 'precise-security'), (500, 
'precise-proposed'), (500, 'precise'), (100, 'precise-backports')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-26-generic (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -Nru gambas3-3.1.1/debian/patches/series gambas3-3.1.1/debian/patches/series
--- gambas3-3.1.1/debian/patches/series	2012-05-24 12:00:02.000000000 +0100
+++ gambas3-3.1.1/debian/patches/series	2012-06-20 10:49:18.000000000 +0100
@@ -1,2 +1,3 @@
 detect_browser_debian
 dont_compile_examples
+track_libpoppler25_api
diff -Nru gambas3-3.1.1/debian/patches/track_libpoppler25_api gambas3-3.1.1/debian/patches/track_libpoppler25_api
--- gambas3-3.1.1/debian/patches/track_libpoppler25_api	1970-01-01 01:00:00.000000000 +0100
+++ gambas3-3.1.1/debian/patches/track_libpoppler25_api	2012-06-20 13:09:05.000000000 +0100
@@ -0,0 +1,136 @@
+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 <a...@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
+ 

Reply via email to