My favorites | Sign in
Project Home Downloads Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221

Introduction
------------

This is work in progress/experimentation of writing an application
toolkit for a kobo touch e-book reader.

It includes a gadget toolkit which talks to a linux framebuffer
(written from scratch), as well as some demo applications one of which
is a PDF, Text, EPub, and XHTML reader.

It's hosted at: https://code.google.com/p/mediaz/
Along with the related projects PDFZ and CSZ.

Installation
------------

The application will run in a Swing window if run on a host machine,
in which case 'finger' motions are emulated using the mouse in an
obvious way. The swing image updates are not properly synchronised
with the rendering loop: so it isn't the prettiest of interfaces.

For the kobo touch, you need to enable telnet access to the kobo touch
in order to run the programme. Search on the internet for such
information.

You also need to enable wifi before you can telnet in - the easiest
way i find is to run the included web browser. I then telnet in
and then run:

killall nickel

Copy the dist/ directory to a location on the device. Using a '.'
prefixed name will prevent the built-in kobo software from scanning
it (which you don't want).

Install a JRE and use that to execute the jar file
as required. I used the one from oracle (requires registration and
cannot be redistributed):

ejre-7u2-fcs-b13-linux-arm-vfp-client_headful-22_nov_2011.tar.gz

Requirements
------------

This requires PDFZ for compilation, and rendering PDF files. The PDFZ
native library must be compiled from source at the moment.

It also required CSZ for compilation and rendering XHTML.

PDFZ and CSZ are both also part of mediaz.

kobo 'driver'
------------

native/* contains a `driver' for the linux framebuffer, and e-ink device.

To make changes requires an arm cross compiler, see
native/linux-arm-gnueabi/Makefile for details.

I've included pre-built library anyway.

The library must be placed somewhere in the library path to function.

There is also java code to read the input event devices in au.notzed.fb.

GadgetZ
-------

This is a fairly comprehensive gadget (== windowless widget) toolkit
which renders to a BufferedImage. It has display drivers for a swing
'emulator' front-end, or for the Kobo touch e-ink display (a linux
framebuffer with a couple of extra ioctls) and input devices.

It works much like swing, but in addition to the event thread
has a separate repaint thread to improve perceived performance.

ReaderZ
-------

There is a collection of mostly test stuff in the au.notzed.readerz
namespace, although some of it is working toward an
'e-book reading application'.

Main classes of interest
------------------------

Running as a jar will run the main library viewer.

Run these with:
java -classpath ReaderZ.jar:lib/PDFZ.jar mainclass [arguments]

au.notzed.gadgetz.demo.GadgetTest

A test of the few earliest gadgets. Text, Slider, Button, and
BoxLayout.

au.notzed.readerz.demo.LibraryTest

This is a front-end which presents a list of articles, which
can be viewed by clicking on them. If you quit out of the
reader it returns to the list.

It is configured using readerz.properties

au.notzed.readerz.demo.ReaderTest filename

This is just the document viewer part. It will read
pdf, text or image files from the command line. PDFs must end in .pdf,
images in .png, .jpeg or .jpg, and everything else is opened
as a text file.

The user interface for the reader is entirely based on hot zones
which are not visible! There are two types of zones, drag zones and
press zones. Drag zones take precedence over press zones, so once a
drag has started no press will be processed for that geasture. Press
zones are tested in order, and the first one to match takes it -
allowing overlapping zones.

drag zones
----------

zoom: drag your finger along the top of the screen
flip pages: drag your finger along the bottom of the screen
pan: drag your finger anywhere else

press zones
-----------
pan up: press your finger in the middle-top of the screen.
pan down: press your finger in the middle-top of the screen.
next page: press your finger in the right third of the screen.
prev page: press your finger in the left third of the screen.
menu: press your finger in the middle third of the screen.
refresh e-ink: press your finger anywhere for more than 300ms and release.

The 'Settings' menu is not implemented, and can currently be used
to dismiss the menu if you don't wish to quit (clicking elsewhere will
not work).

EPub
----

The epub reader uses CSZ for the XHTML layout: i.e. it's pretty basic.

Currently it's user interface isn't very ideal: it works like the PDF
viewer, where each chapter (or strictly: spine entry) is treated as a
separate page. So you must pan around within individual chapters, and
changing `pages' goes to the adjacent chapter.

Any SVG images appear blank, so the title page may be blank on some
epub files.

The only navigation possible is to flip through the spine entries.

Changing chapters causes the chapter to be loaded and formatted: it
may take some time to present long chapters. Flipping pages using the
bottom drag zone may lead to frustration!

Text
----

This uses the Java2D stuff for layout, which unfortunately is very
complex and somewhat slow. To get around this the pagination is
cached. As such opening a large text file for the first time may
take some time (10s of seconds), although subsequent visits
should be quite fast.

PDF
---

PDFZ is used to render PDF files. That uses muPDF as the backend,
so it is both very fast, and generates a very high quality rendering.

Only unproctected PDF files are implemented.

There is no table of contents or in-document navigation implemented.

Images
------

For a lark I also implemented an image viewer. It works like
the PDF viewer, for one image at a time.

XHTML
-----

XHTML is implemented using CSZ, my own, completely unfinished and
crappy XHTL and CSS 2.1 library.

HTML
----

There is also a very simple test HTML renderer that is commented out
to reduce the build requirements in au.notzed.rederz.html

If the code is uncommented, then additional requirements must be included:

CSSBox-3.4 http://cssbox.sourceforge.net/
jStyleParser-1.5 http://cssbox.sourceforge.net/jstyleparser/
htmlparser-1.3.1 http://about.validator.nu/htmlparser/

Unfortuantely it is quite slow at formatting although otherwise seems
to do a fairly decent job.

License & Warrantee
-------------------

Copyright (c) 2012 Michael Zucchi

ReaderZ is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

ReaderZ is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

See COPYING for the full license terms.

Change log

r30 by notzed on Feb 3, 2012   Diff
Added basic epub viewer.
Go to: 
Project members, sign in to write a code review

Older revisions

r26 by notzed on Jan 31, 2012   Diff
Updated README with CSZ stuff.
r18 by notzed on Jan 26, 2012   Diff
Initial load of ReaderZ
All revisions of this file

File info

Size: 7055 bytes, 221 lines
Powered by Google Project Hosting