[gambas3] add support for poppler 0.20
Tom Callaway
spot at fedoraproject.org
Tue May 29 15:07:09 UTC 2012
commit 727c7aa59e63938921863c7504c3c5d96fe5ac70
Author: Tom Callaway <spot at fedoraproject.org>
Date: Tue May 29 11:07:06 2012 -0400
add support for poppler 0.20
gambas3-poppler-0.20.patch | 105 ++++++++++++++++++++++++++++++++++++++++++++
gambas3.spec | 7 +++-
2 files changed, 111 insertions(+), 1 deletions(-)
---
diff --git a/gambas3-poppler-0.20.patch b/gambas3-poppler-0.20.patch
new file mode 100644
index 0000000..e9ea9f0
--- /dev/null
+++ b/gambas3-poppler-0.20.patch
@@ -0,0 +1,105 @@
+diff -up gambas3-3.1.1/gb.pdf/configure.ac.poppler20 gambas3-3.1.1/gb.pdf/configure.ac
+--- gambas3-3.1.1/gb.pdf/configure.ac.poppler20 2012-05-29 10:59:35.738878376 -0400
++++ gambas3-3.1.1/gb.pdf/configure.ac 2012-05-29 11:02:55.966216806 -0400
+@@ -24,6 +24,8 @@ if test "$have_poppler" = "yes"; then
+ 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( \
+--- gambas-3.1.1/gb.pdf/src/CPdfDocument.cpp 2012-05-29 01:22:45 4729
++++ gambas-3.1.1/gb.pdf/src/CPdfDocument.cpp 2012-05-29 07:32:03 4730
+@@ -449,9 +449,13 @@
+
+ white[0] = 0xFF; white[1] = 0xFF; white[2] = 0xFF;
+ THIS->dev=new SplashOutputDev(splashModeRGB8, 3, gFalse, white);
+-
+- THIS->dev->startDoc(THIS->doc->getXRef ());
+
++ #if POPPLER_VERSION_0_20
++ THIS->dev->startDoc(THIS->doc);
++ #else
++ THIS->dev->startDoc(THIS->doc->getXRef ());
++ #endif
++
+ outline=THIS->doc->getOutline();
+ if (outline) THIS->index=outline->getItems();
+
+@@ -875,6 +879,14 @@
+
+ if ( (w<0) || (h<0) ) return NULL;
+
++ #if POPPLER_VERSION_0_20
++ THIS->page->displaySlice(THIS->dev,72.0*scale,72.0*scale,
++ rotation,
++ gFalse,
++ gTrue,
++ x,y,w,h,
++ gFalse);
++ #else
+ THIS->page->displaySlice(THIS->dev,72.0*scale,72.0*scale,
+ rotation,
+ gFalse,
+@@ -882,7 +894,8 @@
+ x,y,w,h,
+ gFalse,
+ THIS->doc->getCatalog ());
+-
++ #endif
++
+ map=THIS->dev->getBitmap();
+
+ data=(uint32_t*)map->getDataPtr();
+@@ -940,9 +953,14 @@
+ w = VARGOPT(W, (int32_t)THIS->page->getMediaWidth());
+ h = VARGOPT(H, (int32_t)THIS->page->getMediaHeight());
+
++ #if POPPLER_VERSION_0_20
++ dev = new TextOutputDev (NULL, gTrue, 0, gFalse, gFalse);
++ gfx = THIS->page->createGfx(dev,72.0,72.0,0,gFalse,gTrue,-1, -1, -1, -1, gFalse);
++ #else
+ 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);
+-
++ #endif
++
+ THIS->page->display(gfx);
+ dev->endPage();
+
+@@ -970,7 +988,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 +1172,22 @@
+
+ if (!MISSING(Sensitive)) sensitive=VARG(Sensitive);
+
++ #if POPPLER_VERSION_0_20
++ textdev = new TextOutputDev (NULL, true, 0, false, false);
++ THIS->page->display (textdev, 72, 72, 0, false, false, false);
++ #else
+ textdev = new TextOutputDev (NULL, true, false, false);
+ THIS->page->display (textdev, 72, 72, 0, false, false, false, THIS->doc->getCatalog());
++ #endif
+
+ if (THIS->Found) { GB.FreeArray(POINTER(&THIS->Found)); THIS->Found=NULL; }
+
+ count = 0;
++ #if POPPLER_VERSION_0_20
++ while (textdev->findText (block,nlen,gFalse,gTrue,gTrue,gFalse,sensitive,gFalse,gFalse,&x0,&y0,&x1,&y1))
++ #else
+ while (textdev->findText (block,nlen,gFalse,gTrue,gTrue,gFalse,sensitive,gFalse,&x0,&y0,&x1,&y1))
++ #endif
+ {
+ if (!THIS->Found)
+ GB.NewArray(POINTER(&THIS->Found),sizeof(CPDFFIND),1);
diff --git a/gambas3.spec b/gambas3.spec
index 7e6172d..90f5824 100644
--- a/gambas3.spec
+++ b/gambas3.spec
@@ -1,7 +1,7 @@
Name: gambas3
Summary: IDE based on a basic interpreter with object extensions
Version: 3.1.1
-Release: 2%{?dist}
+Release: 3%{?dist}
License: GPL+
Group: Development/Tools
URL: http://gambas.sourceforge.net/
@@ -26,6 +26,7 @@ BuildRequires: libv4l-devel
ExcludeArch: ppc ppc64
Patch1: %{name}-2.99.1-nolintl.patch
Patch2: %{name}-2.99.1-noliconv.patch
+Patch3: gambas3-poppler-0.20.patch
# Use libv4l1
Patch4: %{name}-2.99.1-use-libv4l1.patch
@@ -558,6 +559,7 @@ Requires: %{name}-runtime = %{version}-%{release}
%setup -q
%patch1 -p1 -b .nolintl
%patch2 -p1 -b .noliconv
+%patch3 -p1 -b .poppler20
# %patch4 -p1 -b .libv4l1
# We used to patch these out, but this is simpler.
for i in `find . |grep acinclude.m4`; do
@@ -1988,6 +1990,9 @@ update-mime-database %{_datadir}/mime &> /dev/null || :
%{_datadir}/%{name}/info/gb.xml.xslt.*
%changelog
+* Tue May 29 2012 Tom Callaway <spot at fedoraproject.org> - 3.1.1-3
+- add support for poppler 0.20
+
* Wed May 2 2012 Tom Callaway <spot at fedoraproject.org> - 3.1.1-2
- add BR: gsl-devel
More information about the scm-commits
mailing list