Date: Mon, 16 May 2011 15:56:45 -0500 From: Zhihao Yuan <lichray@gmail.com> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/157095: graphics/mupdf: optional scroll hack Message-ID: <4dd18f93.113d2b0a.120d.ffff84a5@mx.google.com> Resent-Message-ID: <201105162100.p4GL0MXg014119@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 157095 >Category: ports >Synopsis: graphics/mupdf: optional scroll hack >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Mon May 16 21:00:22 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Zhihao Yuan >Release: FreeBSD 8.2-STABLE amd64 >Organization: Northern Illinois University >Environment: System: FreeBSD compaq.yuetime 8.2-STABLE FreeBSD 8.2-STABLE #1 r221793M: Wed May 11 21:44:19 CDT 2011 lichray@compaq.yuetime:/home/lichray/temp/obj/home/lichray/devel/freebsd-stable/sys/HOUKAGO amd64 >Description: In mupdf, j and k only scroll within one page. This patch adds an optional KNOB, WITH_SCROLL, to turn on a scroll hack, which makes j and k scroll to next/prev page when hits the bottom/top of the current page. Originates from http://www.linuxsir.org/bbs/thread376003.html (Chinese, membership required; follow up this PR so that I can send you the original patch). >How-To-Repeat: >Fix: --- mupdf_1-scroll_hack.patch begins here --- diff -ruN --exclude=CVS /usr/ports/graphics/mupdf.orig/Makefile /usr/ports/graphics/mupdf/Makefile --- /usr/ports/graphics/mupdf.orig/Makefile 2011-05-07 09:21:43.000000000 -0500 +++ /usr/ports/graphics/mupdf/Makefile 2011-05-16 15:30:17.641449744 -0500 @@ -6,6 +6,7 @@ PORTNAME= mupdf PORTVERSION= 0.8.165 +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES= graphics MASTER_SITES= GOOGLE_CODE \ @@ -31,6 +32,12 @@ LICENSE= GPLv3 LICENSE_FILE= ${WRKSRC}/COPYING +.include <bsd.port.options.mk> + +.if defined(WITH_SCROLL) +EXTRA_PATCHES+= ${FILESDIR}/scroll_hack-apps_pdfapp.c +.endif + post-patch: .SILENT ${REINPLACE_CMD} \ -e 's#\(PDF_APPS :=.*/\)#\1mu_#' \ diff -ruN --exclude=CVS /usr/ports/graphics/mupdf.orig/files/scroll_hack-apps_pdfapp.c /usr/ports/graphics/mupdf/files/scroll_hack-apps_pdfapp.c --- /usr/ports/graphics/mupdf.orig/files/scroll_hack-apps_pdfapp.c 1969-12-31 18:00:00.000000000 -0600 +++ /usr/ports/graphics/mupdf/files/scroll_hack-apps_pdfapp.c 2011-05-16 15:35:13.782785093 -0500 @@ -0,0 +1,34 @@ +--- apps/pdfapp.c.orig 2011-04-29 14:06:09.000000000 -0500 ++++ apps/pdfapp.c 2011-05-16 15:34:57.393494127 -0500 +@@ -777,11 +777,15 @@ void pdfapp_onkey(pdfapp_t *app, int c) + break; + + case 'j': ++ if (app->pany + app->image->h <= app->winh) ++ goto pagedown; + app->pany -= app->image->h / 10; + pdfapp_showpage(app, 0, 0, 1); + break; + + case 'k': ++ if (app->pany >= 0) ++ goto pageup; + app->pany += app->image->h / 10; + pdfapp_showpage(app, 0, 0, 1); + break; +@@ -843,6 +847,7 @@ void pdfapp_onkey(pdfapp_t *app, int c) + */ + + case ',': ++ pageup: + panto = PAN_TO_BOTTOM; + if (app->numberlen > 0) + app->pageno -= atoi(app->number); +@@ -851,6 +856,7 @@ void pdfapp_onkey(pdfapp_t *app, int c) + break; + + case '.': ++ pagedown: + panto = PAN_TO_TOP; + if (app->numberlen > 0) + app->pageno += atoi(app->number); --- mupdf_1-scroll_hack.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4dd18f93.113d2b0a.120d.ffff84a5>