epdfview: update to 0.1.8.

This commit is contained in:
Juan RP 2011-05-29 15:51:13 +02:00
parent 3cd2c05533
commit f8068bde76
4 changed files with 8 additions and 190 deletions

View file

@ -1,54 +0,0 @@
--- 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

@ -1,85 +0,0 @@
--- 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,33 +0,0 @@
--- ./src/gtk/MainView.cxx.old 2009-02-28 22:00:55.000000000 +0100
+++ ./src/gtk/MainView.cxx 2009-03-20 03:12:10.000000000 +0100
@@ -77,7 +77,7 @@
static void main_window_zoom_out_cb (GtkWidget *, gpointer);
static void main_window_zoom_width_cb (GtkToggleAction *, gpointer);
static void main_window_set_page_mode (GtkRadioAction *, GtkRadioAction *, gpointer);
-static void main_window_page_scrolled_cb (GtkWidget *widget, GdkEventScroll *event, gpointer data);
+static gboolean main_window_page_scrolled_cb (GtkWidget *widget, GdkEventScroll *event, gpointer data);
#if defined (HAVE_CUPS)
static void main_window_print_cb (GtkWidget *, gpointer);
@@ -1479,18 +1479,19 @@
pter->setPageMode (mode);
}
-void
+gboolean
main_window_page_scrolled_cb (GtkWidget *widget, GdkEventScroll *event, gpointer data)
{
g_assert ( NULL != data && "The data parameter is NULL.");
MainPter *pter = (MainPter *)data;
// Only zoom when the CTRL-Button is down...
- if ( !(event->state & GDK_CONTROL_MASK) ) return;
+ if ( !(event->state & GDK_CONTROL_MASK) ) return FALSE;
if ( event->direction == GDK_SCROLL_UP ) {
pter->zoomInActivated ();
} else if ( event->direction == GDK_SCROLL_DOWN ) {
pter->zoomOutActivated ();
}
+ return TRUE;
}

View file

@ -1,12 +1,13 @@
# Template build file for 'epdfview'.
pkgname=epdfview
version=0.1.7
revision=7
version=0.1.8
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+"
maintainer="Juan RP <xtraeme@gmail.com>"
checksum=0afbb0f348d4ba916cf58da48b4749b7cca6a9038136b27dc652161913704ae8
checksum=948648ae7c9d7b3b408d738bd4f48d87375b1196cae1129d6b846a8de0f2f8f0
homepage="http://www.emma-soft.com/projects/epdfview/"
license="GPL-2"
long_desc="
ePDFView is a free lightweight PDF document viewer using Poppler and
GTK+ libraries.
@ -31,25 +32,14 @@ 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 \
"${DESTDIR}/usr/share/icons/hicolor/24x24/apps/epdfview.png" \
|| return 1
install -Dm644 ${wrksrc}/data/icon_epdfview-32.png \
"${DESTDIR}/usr/share/icons/hicolor/32x32/apps/epdfview.png" \
|| return 1
install -Dm644 ${wrksrc}/data/icon_epdfview-48.png \
"${DESTDIR}/usr/share/icons/hicolor/48x48/apps/epdfview.png" \
|| return 1
for f in 24 32 48; do
install -D -m644 data/icon_${pkgname}-${f}.png \
${DESTDIR}/usr/share/icons/hicolor/${f}x${f}/apps/${pkgname}.png
done
}