From: Angus Ainslie <nytowl@openmoko.org>
To: openembedded-devel@openembedded.org
Subject: [PATCH] epdfview: add page scrolling patch
Date: Thu, 09 Apr 2009 10:42:56 -0600 [thread overview]
Message-ID: <1239295376.4784.179.camel@alap> (raw)
From a3c28e2ab81cf7fd1ff49c6be0380075230722d2 Mon Sep 17 00:00:00 2001
From: Previdi Roberto <previdi.roberto@gmail.com>
Date: Thu, 9 Apr 2009 10:26:51 -0600
Subject: [PATCH] epdfview: add page scrolling patch
Signed-off-by: Angus Ainslie <nytowl@openmoko.org>
---
recipes/epdfview/epdfview_0.1.6.bb | 3 +-
recipes/epdfview/files/page-scroll.patch | 82 ++++++++++++++++++++++++++++++
2 files changed, 84 insertions(+), 1 deletions(-)
create mode 100644 recipes/epdfview/files/page-scroll.patch
diff --git a/recipes/epdfview/epdfview_0.1.6.bb b/recipes/epdfview/epdfview_0.1.6.bb
index 3cf2e5f..f4ec351 100644
--- a/recipes/epdfview/epdfview_0.1.6.bb
+++ b/recipes/epdfview/epdfview_0.1.6.bb
@@ -3,10 +3,11 @@ HOMEPAGE = "http://www.emma-soft.com/projects/epdfview/"
LICENSE = "GPLv2"
SECTION = "x11/applications"
DEPENDS = "poppler gtk+ cups"
-PR = "r3"
+PR = "r4"
SRC_URI = "http://www.emma-soft.com/projects/epdfview/chrome/site/releases/epdfview-${PV}.tar.bz2 \
file://poppler8.diff;patch=1 \
+ file://page-scroll.patch;patch=1 \
"
inherit autotools
diff --git a/recipes/epdfview/files/page-scroll.patch b/recipes/epdfview/files/page-scroll.patch
new file mode 100644
index 0000000..20fbfea
--- /dev/null
+++ b/recipes/epdfview/files/page-scroll.patch
@@ -0,0 +1,82 @@
+diff -c -r -x '*.[ao]' -x '*~' -x '*anjuta*' patcher_original/epdfview-0.1.6/data/epdfview.desktop epdfview-0.1.6/data/epdfview.desktop
+*** patcher_original/epdfview-0.1.6/data/epdfview.desktop 2006-10-17 16:23:23.000000000 +0200
+--- epdfview-0.1.6/data/epdfview.desktop 2009-04-07 16:39:43.000000000 +0200
+***************
+*** 8,14 ****
+ GenericName=PDF Viewer
+ GenericName[ca]=Visor PDF
+ GenericName[es]=Visor PDF
+! Icon=postscript-viewer.png
+ Name=ePDFViewer
+ Name[ca]=ePDFViewer
+ Name[es]=ePDFViewer
+--- 8,14 ----
+ GenericName=PDF Viewer
+ GenericName[ca]=Visor PDF
+ GenericName[es]=Visor PDF
+! Icon=/usr/share/epdfview/pixmaps/icon_epdfview-48.png
+ Name=ePDFViewer
+ Name[ca]=ePDFViewer
+ Name[es]=ePDFViewer
+diff -c -r -x '*.[ao]' -x '*~' -x '*anjuta*' patcher_original/epdfview-0.1.6/src/gtk/PageView.cxx epdfview-0.1.6/src/gtk/PageView.cxx
+*** patcher_original/epdfview-0.1.6/src/gtk/PageView.cxx 2006-10-17 16:23:18.000000000 +0200
+--- epdfview-0.1.6/src/gtk/PageView.cxx 2009-04-07 16:38:48.000000000 +0200
+***************
+*** 26,31 ****
+--- 26,32 ----
+
+ // Constants
+ static gint PAGE_VIEW_PADDING = 12;
++ static gint SCROLL_PAGE_DRAG_LENGTH = 50;
+
+ // Forwards declarations.
+ static gboolean page_view_button_press_cb (GtkWidget *, GdkEventButton *,
+***************
+*** 236,242 ****
+ void
+ PageView::scrollPage (gdouble scrollX, gdouble scrollY, gint dx, gint dy)
+ {
+! GtkAdjustment *hAdjustment = gtk_scrolled_window_get_hadjustment (
+ GTK_SCROLLED_WINDOW (m_PageScroll));
+ gdouble hAdjValue = hAdjustment->page_size *
+ (gdouble)dx / m_PageImage->allocation.width;
+--- 237,245 ----
+ void
+ PageView::scrollPage (gdouble scrollX, gdouble scrollY, gint dx, gint dy)
+ {
+! /* if the page cannot scroll and i'm dragging bottom to up, or left to right,
+! i will go to the next page. viceversa previous page */
+! GtkAdjustment *hAdjustment = gtk_scrolled_window_get_hadjustment (
+ GTK_SCROLLED_WINDOW (m_PageScroll));
+ gdouble hAdjValue = hAdjustment->page_size *
+ (gdouble)dx / m_PageImage->allocation.width;
+***************
+*** 253,258 ****
+--- 256,282 ----
+ CLAMP (scrollY - vAdjValue,
+ vAdjustment->lower,
+ vAdjustment->upper - vAdjustment->page_size));
++
++ /* if the page cannot scroll and i'm dragging bottom to up, or left to right,
++
++ i will go to the next page. viceversa previous page */
++ if ((scrollY==vAdjustment->upper - vAdjustment->page_size && dy<(0-SCROLL_PAGE_DRAG_LENGTH))
++ ||
++ (scrollX==hAdjustment->upper - hAdjustment->page_size && dx<(0-SCROLL_PAGE_DRAG_LENGTH))
++ )
++ {
++ m_Pter->scrollToNextPage();
++ m_Pter->mouseButtonReleased(1);
++ }
++ else
++ if((scrollY==vAdjustment->lower && dy>SCROLL_PAGE_DRAG_LENGTH)
++ ||
++ (scrollX==hAdjustment->lower && dx>SCROLL_PAGE_DRAG_LENGTH)
++ )
++ {
++ m_Pter->scrollToPreviousPage();
++ m_Pter->mouseButtonReleased(1);
++ }
+ }
+
+ void
--
1.5.6.3
next reply other threads:[~2009-04-09 16:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-09 16:42 Angus Ainslie [this message]
2009-04-11 14:13 ` [PATCH] epdfview: add page scrolling patch Koen Kooi
2009-04-13 13:50 ` Angus Ainslie
2009-04-15 9:12 ` Koen Kooi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1239295376.4784.179.camel@alap \
--to=nytowl@openmoko.org \
--cc=openembedded-devel@lists.openembedded.org \
--cc=openembedded-devel@openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.