Date: Tue, 17 May 2011 18:43:10 -0500 From: Zhihao Yuan <lichray@gmail.com> To: freebsd-ports@freebsd.org Subject: ports/157095: graphics/mupdf: optional scroll hack + DPI detection Message-ID: <BANLkTino4_HO3RASDErG5%2B-5z=RNwR9P_Q@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
--20cf30433ec0b63bac04a3815591 Content-Type: text/plain; charset=UTF-8 Hi, I made two patches for mupdf. The first one makes the key 'j' and 'k', and the mouse wheel scroll to next/prev page when hits the bottom/top of the current page. The second one replaces the hard coded DPI(72) with a X11 DPI detection. Check http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/157095 for details. I attaches the final patch for the port, and the two separated patches. -- Zhihao Yuan The best way to predict the future is to invent it. --20cf30433ec0b63bac04a3815591 Content-Type: application/octet-stream; name="mupdf_1.patch" Content-Disposition: attachment; filename="mupdf_1.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gnthmc5m0 ZGlmZiAtcnVOIC0tZXhjbHVkZT1DVlMgL3Vzci9wb3J0cy9ncmFwaGljcy9tdXBkZi5vcmlnL01h a2VmaWxlIC91c3IvcG9ydHMvZ3JhcGhpY3MvbXVwZGYvTWFrZWZpbGUKLS0tIC91c3IvcG9ydHMv Z3JhcGhpY3MvbXVwZGYub3JpZy9NYWtlZmlsZQkyMDExLTA1LTA3IDA5OjIxOjQzLjAwMDAwMDAw MCAtMDUwMAorKysgL3Vzci9wb3J0cy9ncmFwaGljcy9tdXBkZi9NYWtlZmlsZQkyMDExLTA1LTE2 IDE1OjMwOjE3LjY0MTQ0OTc0NCAtMDUwMApAQCAtNiw2ICs2LDcgQEAKIAogUE9SVE5BTUU9CW11 cGRmCiBQT1JUVkVSU0lPTj0JMC44LjE2NQorUE9SVFJFVklTSU9OPQkxCiBQT1JURVBPQ0g9CTEK IENBVEVHT1JJRVM9CWdyYXBoaWNzCiBNQVNURVJfU0lURVM9CUdPT0dMRV9DT0RFIFwKQEAgLTMx LDYgKzMyLDEyIEBACiBMSU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oKKysJcGFnZXVwOgorIAkJcGFudG8gPSBQQU5fVE9fQk9UVE9NOworIAkJaWYgKGFwcC0+bnVt YmVybGVuID4gMCkKKyAJCQlhcHAtPnBhZ2VubyAtPSBhdG9pKGFwcC0+bnVtYmVyKTsKK0BAIC04 NTEsNiArODU2LDcgQEAgdm9pZCBwZGZhcHBfb25rZXkocGRmYXBwX3QgKmFwcCwgaW50IGMpCisg CQlicmVhazsKKyAKKyAJY2FzZSAnLic6CisrCXBhZ2Vkb3duOgorIAkJcGFudG8gPSBQQU5fVE9f VE9QOworIAkJaWYgKGFwcC0+bnVtYmVybGVuID4gMCkKKyAJCQlhcHAtPnBhZ2VubyArPSBhdG9p KGFwcC0+bnVtYmVyKTsKK0BAIC0xMDIyLDYgKzEwMjgsMTEgQEAgdm9pZCBwZGZhcHBfb25tb3Vz ZShwZGZhcHBfdCAqYXBwLCBpbnQgeAorIAkJCQlpbnQgaXN4ID0gKG1vZGlmaWVycyAmICgxPDww KSk7CisgCQkJCWludCB4c3RlcCA9IGlzeCA/IDIwICogZGlyIDogMDsKKyAJCQkJaW50IHlzdGVw ID0gIWlzeCA/IDIwICogZGlyIDogMDsKKysJCQkJaWYgKCFpc3ggJiYgZGlyIDwgMCAmJiBhcHAt PnBhbnkgKyBhcHAtPmltYWdlLT5oIDw9IGFwcC0+d2luaCkKKysJCQkJCXBkZmFwcF9vbmtleShh cHAsICdqJyk7CisrCQkJCWVsc2UgaWYgKCFpc3ggJiYgZGlyID4gMCAmJiBhcHAtPnBhbnkgPj0g MCkKKysJCQkJCXBkZmFwcF9vbmtleShhcHAsICdrJyk7CisrCQkJCWVsc2UKKyAJCQkJcGRmYXBw X3BhbnZpZXcoYXBwLCBhcHAtPnBhbnggKyB4c3RlcCwgYXBwLT5wYW55ICsgeXN0ZXApOworIAkJ CX0KKyAJCX0K --20cf30433ec0b63bac04a3815591--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BANLkTino4_HO3RASDErG5%2B-5z=RNwR9P_Q>