Gentoo Archives: gentoo-commits

From: "Michael Weber (xmw)" <xmw@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-text/mupdf/files: mupdf-0.9-scroll_hack.patch mupdf-0.9-dpi_hack.patch mupdf-0.8.15-buildsystem.patch mupdf-0.8.15-zoom.patch
Date: Fri, 30 Sep 2011 12:49:23
Message-Id: 20110930124910.22D602001D@flycatcher.gentoo.org
1 xmw 11/09/30 12:49:10
2
3 Added: mupdf-0.9-scroll_hack.patch
4 mupdf-0.9-dpi_hack.patch
5 Removed: mupdf-0.8.15-buildsystem.patch
6 mupdf-0.8.15-zoom.patch
7 Log:
8 Remove old version, version bump (thanks radhermit, bug 385031), added patches for dpi and scrolling
9
10 (Portage version: 2.1.10.11/cvs/Linux x86_64)
11
12 Revision Changes Path
13 1.1 app-text/mupdf/files/mupdf-0.9-scroll_hack.patch
14
15 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/mupdf/files/mupdf-0.9-scroll_hack.patch?rev=1.1&view=markup
16 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/mupdf/files/mupdf-0.9-scroll_hack.patch?rev=1.1&content-type=text/plain
17
18 Index: mupdf-0.9-scroll_hack.patch
19 ===================================================================
20 From http://aur.archlinux.org/packages.php?ID=52333
21
22 --- mupdf-0.9/apps/pdfapp.c
23 +++ mupdf-0.9/apps/pdfapp.c
24 @@ -817,11 +817,15 @@
25 break;
26
27 case 'j':
28 + if (app->pany + app->image->h <= app->winh)
29 + goto pagedown;
30 app->pany -= app->image->h / 10;
31 pdfapp_showpage(app, 0, 0, 1);
32 break;
33
34 case 'k':
35 + if (app->pany >= 0)
36 + goto pageup;
37 app->pany += app->image->h / 10;
38 pdfapp_showpage(app, 0, 0, 1);
39 break;
40 @@ -885,6 +889,7 @@
41 */
42
43 case ',':
44 + pageup:
45 panto = PAN_TO_BOTTOM;
46 if (app->numberlen > 0)
47 app->pageno -= atoi(app->number);
48 @@ -893,6 +898,7 @@
49 break;
50
51 case '.':
52 + pagedown:
53 panto = PAN_TO_TOP;
54 if (app->numberlen > 0)
55 app->pageno += atoi(app->number);
56 @@ -902,7 +908,7 @@
57
58 case 'b':
59 case '\b': //backspace
60 - panto = DONT_PAN;
61 + panto = PAN_TO_TOP;
62 if (app->numberlen > 0)
63 app->pageno -= atoi(app->number);
64 else
65 @@ -911,7 +917,7 @@
66
67 case ' ':
68 case 'f':
69 - panto = DONT_PAN;
70 + panto = PAN_TO_TOP;
71 if (app->numberlen > 0)
72 app->pageno += atoi(app->number);
73 else
74 @@ -1067,7 +1073,12 @@
75 int isx = (modifiers & (1<<0));
76 int xstep = isx ? 20 * dir : 0;
77 int ystep = !isx ? 20 * dir : 0;
78 - pdfapp_panview(app, app->panx + xstep, app->pany + ystep);
79 + if (!isx && dir < 0 && app->pany + app->image->h <= app->winh)
80 + pdfapp_onkey(app, 'j');
81 + else if (!isx && dir > 0 && app->pany >= 0)
82 + pdfapp_onkey(app, 'k');
83 + else
84 + pdfapp_panview(app, app->panx + xstep, app->pany + ystep);
85 }
86 }
87 }
88
89
90
91 1.1 app-text/mupdf/files/mupdf-0.9-dpi_hack.patch
92
93 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/mupdf/files/mupdf-0.9-dpi_hack.patch?rev=1.1&view=markup
94 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/mupdf/files/mupdf-0.9-dpi_hack.patch?rev=1.1&content-type=text/plain
95
96 Index: mupdf-0.9-dpi_hack.patch
97 ===================================================================
98 From http://aur.archlinux.org/packages.php?ID=52333
99
100 --- mupdf-0.9/apps/x11_main.c
101 +++ mupdf-0.9/apps/x11_main.c
102 @@ -539,6 +539,21 @@
103 exit(1);
104 }
105
106 +int get_dpi(void)
107 +{
108 + Display *xdpy;
109 + int xscr;
110 + int x = 0;
111 +
112 + if ((xdpy = XOpenDisplay(NULL))) {
113 + xscr = DefaultScreen(xdpy);
114 + x = (int) (DisplayWidth(xdpy, xscr) * 25.4 /
115 + DisplayWidthMM(xdpy, xscr) + 0.5);
116 + XCloseDisplay(xdpy);
117 + }
118 + return x;
119 +}
120 +
121 int main(int argc, char **argv)
122 {
123 int c;
124 @@ -547,7 +562,7 @@
125 KeySym keysym;
126 int oldx = 0;
127 int oldy = 0;
128 - int resolution = 72;
129 + int resolution = get_dpi();
130 int pageno = 1;
131 int accelerate = 1;
132 int fd;