epdfview: add patches for poppler-0.16, bumprev.

This commit is contained in:
Juan RP 2011-01-29 16:53:21 +01:00
parent 634839e8ee
commit b51b813e3c
3 changed files with 146 additions and 1 deletions

View file

@ -0,0 +1,54 @@
--- src/PDFDocument.cxx (revision 351)
+++ src/PDFDocument.cxx (revision 354)
@@ -682,4 +682,10 @@
poppler_page_get_size(page, &pageWidth, &pageHeight);
+#if defined (HAVE_POPPLER_0_15_0)
+ PopplerRectangle textRect = { rect->getX1() / getZoom(),
+ rect->getY1() / getZoom(),
+ rect->getX2() / getZoom(),
+ rect->getY2() / getZoom()};
+#else // !HAVE_POPPLER_0_15_0
//for get text we must exchange y coordinate, don't ask me where logic here.
PopplerRectangle textRect = { rect->getX1() / getZoom(),
@@ -687,7 +693,11 @@
rect->getX2() / getZoom(),
(pageHeight - rect->getY1() / getZoom())};
+#endif // HAVE_POPPLER_0_15_0
repairEmpty(textRect);
-#if defined (HAVE_POPPLER_0_6_0)
+#if defined (HAVE_POPPLER_0_15_0)
+ gchar *text = poppler_page_get_selected_text(page, POPPLER_SELECTION_GLYPH,
+ &textRect);
+#elif defined (HAVE_POPPLER_0_6_0)
gchar *text = poppler_page_get_text(page, POPPLER_SELECTION_GLYPH,
&textRect);
--- configure.ac (revision 344)
+++ configure.ac (revision 354)
@@ -42,15 +42,19 @@
AC_SUBST([POPPLER_LIBS])
dnl Check if we have poppler version 0.5.2 or higher.
-PKG_CHECK_EXISTS([poppler-glib >= 0.5.2], [have_poppler_052=yes])
-if test "x$have_poppler_052" = "xyes"; then
+PKG_CHECK_EXISTS([poppler-glib >= 0.5.2], [have_poppler_0_5_2=yes])
+if test "x$have_poppler_0_5_2" = "xyes"; then
AC_DEFINE([HAVE_POPPLER_0_5_2], [1], [Define to 1 if you have Poppler version 0.5.2 or higher.])
fi
-PKG_CHECK_EXISTS([poppler-glib >= 0.6], [have_poppler_060=yes])
-if test "x$have_poppler_060" = "xyes"; then
+PKG_CHECK_EXISTS([poppler-glib >= 0.6], [have_poppler_0_6_0=yes])
+if test "x$have_poppler_0_6_0" = "xyes"; then
AC_DEFINE([HAVE_POPPLER_0_6_0], [1], [Define to 1 if you have Poppler version 0.6.0 or higher.])
fi
-PKG_CHECK_EXISTS([poppler-glib >= 0.8], [have_poppler_080=yes])
-if test "x$have_poppler_080" = "xyes"; then
+PKG_CHECK_EXISTS([poppler-glib >= 0.8], [have_poppler_0_8_0=yes])
+if test "x$have_poppler_0_8_0" = "xyes"; then
AC_DEFINE([HAVE_POPPLER_0_8_0], [1], [Define to 1 if you have Poppler version 0.8.0 or higher.])
+fi
+PKG_CHECK_EXISTS([poppler-glib >= 0.15], [have_poppler_0_15_0=yes])
+if test "x$have_poppler_0_15_0" = "xyes"; then
+ AC_DEFINE([HAVE_POPPLER_0_15_0], [1], [Define to 1 if you have Poppler version 0.15.0 or higher.])
fi

View file

@ -0,0 +1,85 @@
--- src/IDocument.cxx (revision 338)
+++ src/IDocument.cxx (revision 357)
@@ -750,4 +750,8 @@
IDocument::getLinearized ()
{
+#if defined (HAVE_POPPLER_0_15_1)
+ if ( m_Linearized ) return "Yes";
+ else return "No";
+#else
if ( NULL == m_Linearized )
{
@@ -755,4 +759,5 @@
}
return m_Linearized;
+#endif
}
@@ -763,6 +768,13 @@
/// otherwise. IDocument will free it.
///
-void
-IDocument::setLinearized (gchar *linearized)
+#if defined (HAVE_POPPLER_0_15_1)
+void
+IDocument::setLinearized (gboolean *linearized)
+{
+ m_Linearized = linearized;
+}
+#else
+void
+ IDocument::setLinearized (gchar *linearized)
{
g_free (m_Linearized);
@@ -770,4 +782,5 @@
g_free (linearized);
}
+#endif
///
--- src/PDFDocument.cxx (revision 356)
+++ src/PDFDocument.cxx (revision 357)
@@ -328,5 +328,9 @@
gchar *keywords = NULL;
PopplerPageLayout layout = POPPLER_PAGE_LAYOUT_UNSET;
+#if defined (HAVE_POPPLER_0_15_1)
+ gboolean *linearized = NULL;
+#else
gchar *linearized = NULL;
+#endif
GTime modDate;
PopplerPageMode mode = POPPLER_PAGE_MODE_UNSET;
--- src/IDocument.h (revision 340)
+++ src/IDocument.h (revision 357)
@@ -307,5 +307,9 @@
void setFormat (gchar *format);
const gchar *getLinearized (void);
+#if defined (HAVE_POPPLER_0_15_1)
+ void setLinearized (gboolean *linearized);
+#else
void setLinearized (gchar *linearized);
+#endif
const gchar *getCreationDate (void);
void setCreationDate (gchar *date);
@@ -383,5 +387,9 @@
gchar *m_Keywords;
/// Tells if the document is linearized or not.
+#if defined (HAVE_POPPLER_0_15_1)
+ gboolean *m_Linearized;
+#else
gchar *m_Linearized;
+#endif
/// The document's modification date and time.
gchar *m_ModifiedDate;
--- configure.ac (revision 354)
+++ configure.ac (revision 357)
@@ -58,4 +58,9 @@
AC_DEFINE([HAVE_POPPLER_0_15_0], [1], [Define to 1 if you have Poppler version 0.15.0 or higher.])
fi
+PKG_CHECK_EXISTS([poppler-glib >= 0.15.1], [have_poppler_0_15_1=yes])
+if test "x$have_poppler_0_15_1" = "xyes"; then
+ AC_DEFINE([HAVE_POPPLER_0_15_1], [1], [Define to 1 if you have Poppler version 0.15.1 or higher.])
+fi
+
AC_MSG_CHECKING([for native Win32])

View file

@ -1,7 +1,7 @@
# Template build file for 'epdfview'.
pkgname=epdfview
version=0.1.7
revision=6
revision=7
distfiles="http://trac.emma-soft.com/$pkgname/chrome/site/releases/$pkgname-$version.tar.bz2"
build_style=gnu_configure
short_desc="Lightweight PDF viewer using Poppler and GTK+"
@ -31,10 +31,16 @@ Add_dependency build pango-devel
Add_dependency build gtk+-devel
Add_dependency build poppler-glib-devel
Add_dependency build libstdc++-devel
Add_dependency build automake
Add_dependency full hicolor-icon-theme
Add_dependency full desktop-file-utils
pre_configure()
{
cd ${wrksrc} && touch ChangeLog && autoreconf -fi
}
post_install()
{
install -Dm644 ${wrksrc}/data/icon_epdfview-24.png \