mirror of https://github.com/koreader/koreader
Step #3 factoring out the frontend code
This is a first try, but some work is still needed to bring the build system back into shape.pull/2/merge
parent
1f2fb33674
commit
6a92cb99e8
@ -1,21 +1,3 @@
|
|||||||
[submodule "mupdf"]
|
|
||||||
path = mupdf
|
|
||||||
url = git://git.ghostscript.com/mupdf.git
|
|
||||||
[submodule "luafilesystem"]
|
|
||||||
path = luafilesystem
|
|
||||||
url = git://github.com/keplerproject/luafilesystem.git
|
|
||||||
[submodule "djvulibre"]
|
|
||||||
path = djvulibre
|
|
||||||
url = git://djvu.git.sourceforge.net/gitroot/djvu/djvulibre.git
|
|
||||||
[submodule "kpvcrlib/crengine"]
|
|
||||||
path = kpvcrlib/crengine
|
|
||||||
url = git://crengine.git.sourceforge.net/gitroot/crengine/crengine
|
|
||||||
[submodule "luajit-2.0"]
|
|
||||||
path = luajit-2.0
|
|
||||||
url = http://luajit.org/git/luajit-2.0.git
|
|
||||||
[submodule "libk2pdfopt"]
|
|
||||||
path = libk2pdfopt
|
|
||||||
url = git://github.com/chrox/libk2pdfopt.git
|
|
||||||
[submodule "koreader-base"]
|
[submodule "koreader-base"]
|
||||||
path = koreader-base
|
path = koreader-base
|
||||||
url = git://github.com/hwhw/koreader-base.git
|
url = git://github.com/hwhw/koreader-base.git
|
||||||
|
@ -1,87 +1,20 @@
|
|||||||
KindlePDFViewer
|
Koreader
|
||||||
===============
|
|
||||||
|
|
||||||
This is a PDF viewer application, created for usage on the Kindle e-ink reader.
|
|
||||||
It currently supports Kindle 2, DXG, 3 and 4, but not Touch. It's using the
|
|
||||||
muPDF library (see http://mupdf.com/), djvulibre library, CREngine library and
|
|
||||||
its UI is scripted using Lua (see http://www.lua.org/).
|
|
||||||
|
|
||||||
The application is licensed under the GPLv3 (see COPYING file).
|
|
||||||
|
|
||||||
|
|
||||||
Building
|
|
||||||
========
|
========
|
||||||
|
|
||||||
|
This is a document viewer application, created for usage on the Kindle e-ink reader.
|
||||||
|
It currently supports Kindle 5 (Touch) and Kindle Paperwhite. The devices need
|
||||||
|
to be jailbroken in order to install the application. Also, a kind of external
|
||||||
|
launcher is needed.
|
||||||
|
|
||||||
Follow these steps:
|
Koreader started as the KindlePDFViewer application, but it supports much more
|
||||||
|
formats than PDF now. Among them are DJVU, FB2, EPUB, TXT, CBZ, HTML.
|
||||||
* fetch thirdparty sources
|
|
||||||
* manually fetch all the thirdparty sources:
|
|
||||||
* install muPDF sources into subfolder "mupdf"
|
|
||||||
* install muPDF third-party sources (see muPDF homepage) into a new
|
|
||||||
subfolder "mupdf/thirdparty"
|
|
||||||
* install libDjvuLibre sources into subfolder "djvulibre"
|
|
||||||
* install CREngine sources into subfolder "kpvcrlib/crengine"
|
|
||||||
* install LuaJit sources into subfolder "luajit-2.0"
|
|
||||||
* install popen_noshell sources into subfolder "popen-noshell"
|
|
||||||
|
|
||||||
* automatically fetch thirdparty sources with Makefile:
|
|
||||||
* make sure you have patch, wget, unzip, git and svn installed
|
|
||||||
* run `make fetchthirdparty`.
|
|
||||||
|
|
||||||
* adapt Makefile to your needs
|
|
||||||
|
|
||||||
* run `make thirdparty`. This will build MuPDF (plus the libraries it depends
|
|
||||||
on), libDjvuLibre, CREngine and Lua.
|
|
||||||
|
|
||||||
* run `make`. This will build the kpdfview application
|
|
||||||
|
|
||||||
|
|
||||||
Running
|
|
||||||
=======
|
|
||||||
|
|
||||||
The user interface (or what's there yet) is scripted in Lua. See "reader.lua".
|
Koreader is a frontend written in Lua and uses the API presented by the
|
||||||
It uses the Linux feature to run scripts by using a corresponding line at its
|
Koreader-base framework. Koreader implements a GUI and is currently targeted
|
||||||
start.
|
at Touch-based devices - for the classic user interface for button-driven
|
||||||
|
e-ink devices (like the Kindle 2, Kindle DX, Kindle 3, Kindle 4) see the
|
||||||
|
KindlePDFviewer legacy project or - especially for the Kindle 4 - have a look
|
||||||
|
at its fork Librerator.
|
||||||
|
|
||||||
So you might just call that script. Note that the script and the kpdfview
|
The application is licensed under the GPLv3 (see COPYING file).
|
||||||
binary currently must be in the same directory.
|
|
||||||
|
|
||||||
You would then just call reader.lua, giving the document file path, or any
|
|
||||||
directory path, as its first argument. Run reader.lua without arguments to see
|
|
||||||
usage notes. The reader.lua script can also show a file chooser: it will do
|
|
||||||
this when you call it with a directory (instead of a file) as first argument.
|
|
||||||
|
|
||||||
|
|
||||||
Device emulation
|
|
||||||
================
|
|
||||||
|
|
||||||
The code also features a device emulation. You need SDL headers and library
|
|
||||||
for this. It allows to develop on a standard PC and saves precious development
|
|
||||||
time. It might also compose the most unfriendly desktop PDF reader, depending
|
|
||||||
on your view.
|
|
||||||
|
|
||||||
If you are using Fedora Core Linux, do `yum install SDL SDL-devel`.
|
|
||||||
If you are using Ubuntu, install `libsdl-dev1.2` package.
|
|
||||||
|
|
||||||
To build in "emulation mode", you need to run make like this:
|
|
||||||
make clean cleanthirdparty
|
|
||||||
EMULATE_READER=1 make thirdparty kpdfview
|
|
||||||
|
|
||||||
And run the emulator like this:
|
|
||||||
```
|
|
||||||
./reader.lua /PATH/TO/PDF.pdf
|
|
||||||
```
|
|
||||||
|
|
||||||
or:
|
|
||||||
```
|
|
||||||
./reader.lua /ANY/PATH
|
|
||||||
```
|
|
||||||
|
|
||||||
By default emulation will provide DXG resolution of 824*1200. It can be
|
|
||||||
specified at compile time, this is example for Kindle 3:
|
|
||||||
|
|
||||||
```
|
|
||||||
EMULATE_READER_W=600 EMULATE_READER_H=800 EMULATE_READER=1 make kpdfview
|
|
||||||
```
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue