2
0
mirror of https://github.com/koreader/koreader synced 2024-10-31 21:20:20 +00:00
Commit Graph

58 Commits

Author SHA1 Message Date
kai771
3293acd3a3 Implements page mode as a toggle 2012-11-09 00:58:40 +01:00
kai771
57ce4b201f separates configurable options from the code 2012-11-04 14:19:21 +01:00
Tigran Aivazian
aeb6248424 Merge pull request #515 from kai771/rtl_mode
implements rtl_mode
2012-11-03 12:46:58 -07:00
Tigran Aivazian
83fb0cd69b Add simple memory usage indicator.
The function memUsage() parses the file "/proc/self/status" and extracts
the sizes (in KB) of RSS, Data, Stack, Lib and TotalVM.
These are displayed when Menu button is pressed inside readers.
2012-11-01 10:58:17 +00:00
kai771
a127ec2c47 implements rtl_mode 2012-10-31 21:45:23 +01:00
kai771
a4322e44b9 fixes :setDefaults for other readers 2012-10-27 23:56:11 +02:00
Tigran Aivazian
e57730b128 Bugfix: initialize show_overlap_enable flag
We must initialize show_overlap_enable to true in
DJVUReader:setDefaults() method, otherwise it will be uninitialized on
the first open of a DjVu file (i.e. with no history file).
2012-10-18 09:50:05 +01:00
Tigran Aivazian
5b2ffc7a53 Provide :setDefaults() for overriding defaults
Because we re-use the same instance of UniReader object (i.e. PDFReader,
DJVUReader, CREReader and PICViewer) we have to re-initialize the
defaults on closing the document. The clean way to do this which allows
to keep the default values in a single place is in a :setDefaults()
method which this commit provides, together with the example of usage in
DJVUReader and PICViewer.
2012-10-13 10:42:21 +01:00
Tigran Aivazian
7d53f8d34c Set show_links_enable=false by default for DjVu 2012-10-12 23:37:38 +01:00
Tigran Aivazian
4705ec60ad Use the local copy of the global G_width variable. 2012-10-10 13:57:28 +01:00
{Qingping,Dave} Hou
80bdcd6cf6 Merge pull request #397 from tigran123/djvu-validate
Validate DjVu magic string before opening.
2012-10-09 13:17:54 -07:00
Tigran Aivazian
30415e8e3b Show zoom factor in DjVu info.
It is useful to know which zoom factor the page is shown at, right after
showing the physical dimensions of the page.
2012-10-09 09:41:18 +01:00
Tigran Aivazian
64b6ef4afd Validate DjVu magic string before opening.
While browsing libdjvu sources I remembered that I always validated DjVu
magic string before passing the file to djvulibre. This is because
forcing djvulibre errors on open is a bad idea --- it can lead to
very strange side effects, such as refusing to open the next (valid!)
DjVu file.
So, I have now implemented the same in KPV --- check DjVu magic string
before passing it to the proper DjVu :openDocument() method.
I timed the difference between opening with and without validation and
it was absolutely negligible (i.e. by far most of the time is spent in DjVu
document decoding anyway).
2012-10-08 19:46:45 +01:00
Tigran Aivazian
4945994516 Flush the date/time and battery info to the right.
Because it looks nicer that way.
2012-10-06 15:00:02 +01:00
Tigran Aivazian
1dccc29c7d Show the current rendering mode in DjVu info
Although the current rendering mode can also be ascertained by pressing
"R" and noting the current position in the menu, it is convenient to
show it alongside the page type in the Menu status info.
2012-10-06 14:43:21 +01:00
Tigran Aivazian
057c461e7d Display DjVu info in the status line.
The DjVu info shown in the status line includes:
1. Physical page dimensions.
2. Current value of gamma and (in square brackets) the value of the
display for which the page was designed.
3. Page resolution (in dpi).
4. Page type.
For the end-user probably the most useful bit is the page type as it
helps him decide which rendering mode to choose for this page (and also
explains why he can't see anything on the page --- e.g. when rendering
some COMPOUND or PHOTO pages in B&W mode). For the developer the
physical page dimensions are also interesting as they allow to estimate
the amount of time needed for page decoding and cache efficiency.
2012-10-04 22:08:52 +01:00
Tigran Aivazian
c7b82f938a First stage of improving the DjVu status info. 2012-10-04 21:08:39 +01:00
Tigran Aivazian
28ba1c7e37 1. It is customary to call DjVu context by the name of the program.
2. When changing DjVu page rendering mode there is no need to clear DjVu cache, only our own tile cache.
2012-09-14 23:22:19 +01:00
Tigran Aivazian
b2e0ecb7b0 Add description of MASK ONLY djvu page rendering mode. 2012-09-01 22:21:29 +01:00
Tigran Aivazian
9a22a022bf Tidy up the help text on the 'R' command. 2012-08-30 13:38:18 +01:00
Tigran Aivazian
c6a1d22bc9 Redraw the page even if the user did not select any rendering mode, otherwise nothing is displayed (except menu). 2012-08-29 12:09:41 +01:00
Tigran Aivazian
b0b0b85ca1 Re-implement the interface for setting DjVu page rendering mode as a menu.
Thanks to NuPogodi for showing how to do this.
2012-08-29 11:39:17 +01:00
Tigran Aivazian
32333ca1d6 Make the function cycle_render_mode() slightly more readable. 2012-08-29 10:48:33 +01:00
Tigran Aivazian
824e9d139e Move render_mode support out of unireader.lua into djvureader.lua as it is djvu-specific.
Also added support for all other rendering modes handled by djvulibre.
Also made the message print a human-readable description of the mode rather than just the number.
2012-08-28 23:48:56 +01:00
Qingping Hou
d2d8ad84ed handle djvu getPageText API changes. 2012-05-23 13:04:05 +08:00
Qingping Hou
a672cf4ee0 unified coordinates system in djvrereader
fix bug in showing manual corp area.
this also fixes #132.
2012-04-30 22:12:15 +08:00
Qingping Hou
a99a0a9489 fix bug in highlight engine
only goto next view when the word is in next view.
same for previous view
2012-04-21 12:14:35 +08:00
Dobrica Pavlinusic
96958c62ca added UniReader:screenOffset and use it 2012-04-13 18:10:11 +02:00
Dobrica Pavlinusic
0a8ca94218 make highlight working in all zoom modes #103
This change introduce object's dest_x and dest_y coordinates which
are needed in zoomedRectCoordTransform to make highlight scale and
move according to current pan position.
2012-04-13 16:51:17 +02:00
Qingping Hou
dcd485c84c fix: bug in highlighting words
Properly highlight words that partially fit
into screen range.
2012-04-12 17:31:01 +08:00
Qingping Hou
3438d6749d mod: rewrite part of highlight code
* add _isEntireLineInScreenHeightRange() method
  For better page view navigation when highlighting
  or moving cursor.

* bug fix in _isWordInScreenRange() method

* add _nextGap(), _prevGap(), _gapInNextLine()
  and _gapInPrevLine() methods, so now key event
  handling code in cursor moving mode only focuses
  on drawing, calculation task is passed to these
  four methods.
2012-04-12 15:50:19 +08:00
Qingping Hou
56d4700001 mod: changes APIs in highlighting code 2012-04-12 11:23:22 +08:00
HW
46d197954b put highlight implementation into unireader 2012-04-11 22:52:48 +02:00
Qingping Hou
c85b768c0e switched shortcut between 10 degree and 90 degree rotation
* also deleted 10 degree rotation shortcut in
djvureader, becuase it is not supported by the
library.
2012-04-10 20:45:22 +08:00
Qingping Hou
ecd56a3745 mod: prefix global variables width and height with G_ 2012-04-09 15:42:19 +08:00
Qingping Hou
5e58a94632 mod: rm unused shortcuts in crereader 2012-04-06 20:13:46 +08:00
Dobrica Pavlinusic
5b1deedd86 remove setCacheSize set cache in openDocument 2012-03-31 14:41:23 +02:00
Qingping Hou
a8c40cd5b6 fix: highlight words that partially fit into screen 2012-03-27 01:15:58 +08:00
Qingping Hou
0c2afd805e fix: enable pan by page from right end to next line left end 2012-03-24 22:06:29 +08:00
Qingping Hou
74d1760260 fix: start position of cursor 2012-03-24 21:27:35 +08:00
Qingping Hou
5d087d0a84 fix: handle out or view range word in highlight mode 2012-03-24 20:12:00 +08:00
Qingping Hou
e15fc5e21e mod: delete useless variable is_next_view 2012-03-24 18:39:33 +08:00
Qingping Hou
e5acbeb363 mod: fix bug in cursor move
only move cursor to word in current view
2012-03-24 18:28:52 +08:00
Qingping Hou
c756fcbf10 fix: cursor move in zoom in mode
only move cursor to word within screen range
2012-03-23 18:28:15 +08:00
Qingping Hou
35abbc93d4 add: configurable highlight drawer
* underscore style (default)
* marker style
2012-03-23 17:20:51 +08:00
Qingping Hou
e30b88d135 add: delete feature in djvu highlight 2012-03-23 16:56:01 +08:00
Qingping Hou
81a1f3d366 demo of text highlight
* text selection
* highlight save and restore
2012-03-23 15:51:48 +08:00
Qingping Hou
7c81f60a58 rewrite highlight again :( finished the cursor part 2012-03-22 23:12:57 +08:00
Qingping Hou
1e2d7f62ac record and save highlight table 2012-03-21 10:37:18 +08:00
Qingping Hou
a185f238eb mod: rewrite highlight feature 2012-03-20 16:42:22 +08:00