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

267 Commits

Author SHA1 Message Date
NuPogodi
676a4610cf Following requests...
1. Replace hotkeys Alt+<> & Shift+<> (houpq's request)
2. Restrict maximum X/Y-panning steps by G_width/G_height, respectively.
3. Remove warning out about redrawing in new zoom mode (tigran's request)
2012-09-05 20:54:49 +03:00
NuPogodi
1f89704b90 storing rcountmax; user-configurable zoom step & pan steps, etc
1. In order to close issue #59, I've introduced user-configurable values for panning steps - for X- & Y-axis, separately. Now panning is called by pressing fiveway without mod_keys. When one presses Shift+FW, he/she changes panning steps in the following way - Shift-Left/Right = decrease / increase X-panning step (divide or multiply on factor 2), Shift-Up/Down = increase / decrease Y-panning step. The lowest value for panning steps is set 1. Both parameters, shift_x & shift_y, are saved to local settings (i.e. history file).

2. Manual zoom step was also made user-configurable. So, instead of two old zooming functions (with fixed 10% and 20%-steps), I made one function to zoom (Shift+<>), while the other (Alt+<>) changes the zoom step downto minimum 1%. 

3. Fresh introduced function to change parameter rcountmax was added by storing rcountmax to both setting files - global settings & local ones (i.e. history file) - so that the rcountmax-priority (from low to high) is the following: default rcountmax=5 < its value in global settings < rcountmax stored for each concrete document.

3. Dirty, the extention-based hack to avoid reading not crengine-related parameters stored in history files. TODO: one has to finally introduce loadSpecialSettings() & readSpecialSettings() for PDFReader & DJVUReader and to store therein the reader-specific parameters (like globalgamma, bbox, globalzoom, globalzoom_mode; render_mode = for djvu-files only, etc.)

4. Some lua-code cosmetics (to make code more readable); for example: "self.pan_margin = settings:readSetting("pan_margin") or self.pan_margin" instead of 
"local pan_margin = settings:readSetting("pan_margin")
if pan_margin then
		self.pan_margin = pan_margin
	end"

5. Fix for the today's tigran123 fix: issue #246 (details are included). Added InfoMessage:show() to inform most impatient users that the reader tries to redraw new zoo mode.

6. The fontface for the reading info (called by 'Menu') is restored to be in accordance with original intentions and with the same fontface in crereader.lua - namely, Font:getFace("rifont", 20)

7. Moved the exit hotkeys (Alt+Back & Home) to the end of hotkey list.
2012-09-03 22:23:06 +03:00
Tigran Aivazian
b70865286c Remove Debug() --- I keep forgetting to remove them before commit :) 2012-09-03 17:40:13 +01:00
Tigran Aivazian
df18cae233 Bugfix: In zoom mode menu selection we need to redraw the screen even if the selected mode is the same as the current one,
otherwise it gives an impression that the program hangs (unless the user presses Next page or does anything else that causes
screen refresh, e.g. manual screen refresh).
2012-09-03 17:34:48 +01:00
Tigran Aivazian
3b1da21cfd Merge remote branch 'upstream/master'
Conflicts:
	djvureader.lua
	unireader.lua
2012-09-01 16:36:52 +01:00
NuPogodi
4bb8ef7f45 unireader: refresh frequency; zoommode-menu, etc.
1. Restored default value rcountmax=5; the function to make manual full screen refresh is no more silent; at first, it asks user to set a number of partial refreshes (rcountmax) and then performs full refresh. TODO: saving parameter 'rcountmax' in the global reader settings (or separately, for each document). 
2. The hotkey 'R' and the respective function toggle_render_mode() for djvu-documents are moved to djvureader.
3. Added hotkey 'M' and the respective function that calls menu with zoom-modes. Probably, one needs to remove unappropriate items, like "Fit zoom to page" and, less probably, the hotkeys (A, S, D, F and ^A, ^S, ^D, ^F) to set zoom-mode directly.
2012-09-01 13:39:14 +03:00
Tigran Aivazian
711cee787e Merge remote branch 'upstream/master' 2012-09-01 00:17:25 +01:00
Tigran Aivazian
60b87b4b95 Update the name of the function cycle_render_mode() -> select_render_mode() in the comment. 2012-08-30 16:11:37 +01:00
Qingping Hou
461c135c5d patch for #234 by Nupogoddi
refresh screen if no input from search highlight.

close #234
2012-08-30 12:44:13 +08:00
Tigran Aivazian
2e0876a4ae Merge remote branch 'upstream/master' 2012-08-29 23:13:13 +01:00
NuPogodi
25edd3101f TOC position on current place in the tree #235 2012-08-29 22:47:16 +02:00
Tigran Aivazian
3fd33805c5 Save/restore the setting of render_mode. 2012-08-29 11:37:38 +01:00
Dobrica Pavlinusic
d577ed9b00 show search results as inverted block 2012-08-29 12:26:25 +02:00
Tigran Aivazian
42491bfefd Merge remote branch 'upstream/master' 2012-08-29 10:17:21 +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
Dobrica Pavlinusic
f0476ab481 hide inputbox after entry 2012-08-28 22:14:04 +02:00
Tigran Aivazian
5c9a8fbec6 DjVu enhancements: a) add support for switching the rendering mode between B&W (default, 1) and COLOUR (0) values. b) handle the gamma values correctly. 2012-08-27 15:33:32 +01:00
Tigran Aivazian
0a4e11d4af In the status line shorten "Memory:" -> "M:" and "Section:" -> "Sec:" and also show the battery level. 2012-08-27 15:27:51 +01:00
Tigran Aivazian
424a6a895b Refresh the screen completely on every page, not every 5th. 2012-08-27 15:25:29 +01:00
Dobrica Pavlinusic
2dfee0a2fb remember last search so it's incremental now 2012-08-26 16:19:51 +02:00
Dobrica Pavlinusic
d827301639 search through whole document 2012-08-26 16:03:55 +02:00
Dobrica Pavlinusic
eb38dfedd4 show search highlight until next page refresh 2012-08-26 15:16:08 +02:00
Dobrica Pavlinusic
e8ab2381c3 extract code into new function UniReader:searchHighLight(search) 2012-08-26 14:48:51 +02:00
Dobrica Pavlinusic
ed59adecea naive implementation of search highlight issue #75 2012-08-26 14:28:34 +02:00
Qingping Hou
2dfbf3177f revert shift+page turn bindings
previously, they are overwritten by mistakes
2012-06-06 20:43:11 +08:00
Qingping Hou
dec86586e8 bug fix in CREReader:prevBookMarkedPage
handle two more corner situations
2012-06-06 20:16:40 +08:00
Qingping Hou
d0e7f2240d add bookmark navigation function to crereader 2012-06-06 16:21:25 +08:00
Qingping Hou
763e2223d2 sort bookmark table after addition 2012-06-06 15:35:45 +08:00
Qingping Hou
b76be2b87d add bookmark navigation functions in unireader.lua 2012-06-06 15:30:16 +08:00
HW
0d12ff70cd rename debug() to Debug() to stop clashing with the debug submodule from Lua 2012-06-04 00:49:23 +02:00
HW
ab400b97ac faster refresh path for the cursor 2012-05-28 19:45:08 +02:00
Qingping Hou
d2d8ad84ed handle djvu getPageText API changes. 2012-05-23 13:04:05 +08:00
{Qingping,Dave} Hou
763b97744b Merge pull request #170 from dpavlin/NuPogodi
NuPogodi patch 19.05.2012
2012-05-20 03:39:41 -07:00
Dobrica Pavlinusic
a08c35a52c added Screen:screenshot() 2012-05-19 23:04:40 +02:00
Dobrica Pavlinusic
28161ae3d0 added Registering fonts dialog on startup
This operation can take some time on device
2012-05-18 23:28:05 +02:00
Dobrica Pavlinusic
54657bb74c use hpkfont for ruler, increase size and fix aligment #35
This is maximum font size which allows vertical ruler to have
spacing between vertical letters.
2012-05-02 16:03:04 +02:00
Dobrica Pavlinusic
bca64dd4ef use showInfoMsgWithDelay for new bbox and redraw page #153 2012-05-02 15:50:19 +02:00
Qingping Hou
c275862ffe fix bug in jump_history
record current page when jump_history.cur points to
empty head.
2012-04-30 20:33:10 +08:00
Qingping Hou
c818d7e90e screenshot shorcut patch by NuPogodi@mobileread 2012-04-30 17:03:45 +08:00
Dobrica Pavlinusic
55cdb26823 force next full refresh 2012-04-29 19:36:23 +02:00
Dobrica Pavlinusic
de12c6aac0 second try to implement rouler idea by y @eLiNK2gl in #35 2012-04-29 19:15:53 +02:00
Dobrica Pavlinusic
90b8860ed5 always use partial refresh 2012-04-29 15:56:56 +02:00
Dobrica Pavlinusic
31108d536c manually select page bounding box
I hope we can finally close #35 with this.
2012-04-29 14:31:45 +02:00
Dobrica Pavlinusic
761cd68964 highlight mode also benefits from key repeat 2012-04-27 23:45:07 +02:00
Dobrica Pavlinusic
9bdf4bf4c7 prevent full screen refresh if key is repeating #142 2012-04-27 20:38:29 +02:00
Dobrica Pavlinusic
6a479aee80 support pressed or repeating keys 2012-04-27 20:37:07 +02:00
Dobrica Pavlinusic
44be823115 use getRectInScreen 2012-04-26 22:27:00 +02:00
Dobrica Pavlinusic
37289fb18d invert page bbox on X #35 2012-04-26 22:16:36 +02:00
Dobrica Pavlinusic
5492025a38 pan_margin is really in screen pixels
I don't know what I was thinking when implementing this code. If I
modify it with global zoom, it keeps moving, as we zoom in on multiple
key presses
2012-04-26 14:20:15 +02: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
Qingping Hou
1a2be0453d fix bug in highlight engine
handle left end of line in highlight delete.
2012-04-21 09:46:30 +08:00
Qingping Hou
8d74649642 adjust wording 2012-04-20 18:29:08 +08:00
Qingping Hou
c350f5af87 add: hint message for inputbox
use hint message to indicate current page
in goto page feature.
2012-04-20 14:04:37 +08:00
Qingping Hou
eaafcafb9e add fix KEY_LPG{BCK,FWD} listening for unireader 2012-04-20 10:16:14 +08:00
Qingping Hou
b03d589ae9 add preLoadSettings methods for cache_document_size setting
cache_document_size should be configurable for
every docuemnt and it must be loaded before
document open, so I added the preLoadSettings method
2012-04-19 14:39:50 +08:00
Qingping Hou
9144cabc76 fix bug in partial refresh count 2012-04-19 14:10:37 +08:00
Qingping Hou
ca55b39756 fix turn to previous page with KEY_LPGBCK 2012-04-19 13:57:30 +08:00
Qingping Hou
e282179793 fix bug in addJump and addBookmark
Pointed out by kljohann, thanks.
Now addJump and addBookmark get notes
from specified pageno/xpointer instead
of current page.

* also fixed bug in page number counting
  in cre.cpp
2012-04-19 09:58:34 +08:00
Qingping Hou
3306346dba use debug to print debug info 2012-04-19 00:16:49 +08:00
Qingping Hou
35e4ceaf57 fix page comparing in addJump 2012-04-19 00:04:41 +08:00
Qingping Hou
b1e49446a0 fix typo in unireader 2012-04-18 20:05:12 +08:00
Qingping Hou
fa414af1eb handle obselete jumpstack settings
* remove jumpstack settings if found
* add DocSettings:delSetting method
* rename DocSettings:savesetting to
  DocSettings:savesetting.
2012-04-18 17:29:27 +08:00
Qingping Hou
84fe9f49a4 rewrite jump stack and add bookmark feature
* jump stack is rewritten as jump history
* add bookmark feature
2012-04-18 17:01:22 +08:00
Dobrica Pavlinusic
eeffcc4f21 unireader now users debug #121 2012-04-17 19:05:22 +02:00
Dobrica Pavlinusic
f8f8a58bd9 fixed my first use of showInfoMsgWithDelay 2012-04-17 18:58:49 +02:00
Dobrica Pavlinusic
38bbe0f227 showInfoMsgWithDelay for highlight 2012-04-17 18:10:03 +02:00
Qingping Hou
dc36e61422 put cursor on the left of first word 2012-04-17 18:05:12 +08:00
Qingping Hou
1bc250591e add left page turn key back to unireader commands 2012-04-17 17:47:19 +08:00
Qingping Hou
0075580b09 more notifications for manual crop shortcuts 2012-04-17 14:36:37 +08:00
Qingping Hou
14bc4ece53 add notification for manual crop settings 2012-04-17 14:29:38 +08:00
Dobrica Pavlinusic
53fcb2490b exit with just home (no modifier) 2012-04-16 14:28:46 +02:00
Dobrica Pavlinusic
b06927dcfe fix modifier for zoom in 2012-04-16 14:24:03 +02:00
traycold
02dd9b023f Merge remote branch 'hwhw/master'
* hwhw/master: (183 commits)
  show infomessage on document open
  use InfoMessage for empty TOC, jump history and highlights
  copy resources dir on customupdate
  add resource: info icon
  display document open error message
  added infomessage dialog implementation
  bugfix, removed old test constant
  Added widget abstraction framework
  added interface to get blitbuffers from JPEG/PNG files
  fix typo
  added reading of pan_margin settings
  fix full screen refresh command, close #99
  add: sleep and usleep in util module
  fix: add back KEY_FW{LEFT,RIGHT} commands to NumInputBox
  reverted removal of last-doc shortcut, introduced framework restart
  kill our own child process. not quite finished.
  added line spacing setting for crereader
  remove page:getPageText debug dump to improve performance on device
  remove page:getPageText debug dump to improve performance on device
  display crash.log on error
  ...

Conflicts:
	ft.c
	helppage.lua
	inputbox.lua
	rendertext.lua
	rendertext_example.lua
	unireader.lua
2012-04-16 00:08:19 +02:00
traycold
6c9ec8c896 refactoring for display help page 2012-04-15 16:07:39 +02:00
Qingping Hou
f24f2a01f6 use InfoMessage for empty TOC, jump history and highlights 2012-04-15 11:02:42 +08:00
Dobrica Pavlinusic
eeae5982dd added reading of pan_margin settings 2012-04-14 16:23:41 +02:00
Qingping Hou
cde796f6b5 fix full screen refresh command, close #99 2012-04-14 14:27:17 +08:00
Dobrica Pavlinusic
b6d167f8ca remove page:getPageText debug dump to improve performance on device
And leave it in unireader if we can't find text on page
2012-04-14 00:03:16 +02:00
Dobrica Pavlinusic
81c6dc5997 commands.map is very large, impacts startup performance on device 2012-04-13 20:46:10 +02:00
Dobrica Pavlinusic
96958c62ca added UniReader:screenOffset and use it 2012-04-13 18:10:11 +02:00
Dobrica Pavlinusic
4d49e9f28b correct two-column margin calculation respecting globalzoom 2012-04-13 17:57:49 +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
3828a6c440 fix: clear show_overlap in two column mode on KEY_FW_{LEFT, RIGHT} 2012-04-13 17:09:15 +08:00
Qingping Hou
75f244eb60 fix: typo in unireader 2012-04-13 10:37:50 +08:00
HW
57d769e0ae added wrapper function for input.waitForEvent that retries on EINTR 2012-04-12 21:00:44 +02:00
Qingping Hou
1407579ea8 mod: remove debug code 2012-04-12 17:49:38 +08: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
75d5b5f984 fix: three bugs in highlight mode
* handle left end of first line in cursor move
* properly highlight first word if cursor starts
  from left end of first line
* handle right end of last line in cursor move
2012-04-12 13:43:20 +08:00
Qingping Hou
66ab3a2f56 fix: typo in unireader's comment 2012-04-12 11:34:24 +08:00
Qingping Hou
56d4700001 mod: changes APIs in highlighting code 2012-04-12 11:23:22 +08:00
HW
face8b44c0 fixed cursor positioning 2012-04-11 23:33:47 +02:00
HW
46d197954b put highlight implementation into unireader 2012-04-11 22:52:48 +02:00
Dobrica Pavlinusic
b555596f42 correctly dim part of page when hitting margins 2012-04-10 23:15:09 +02:00
Qingping Hou
7093e7377e fix: reset dc after screen rotate
handle ZOOM_FIT_TO_CONTENT_WIDTH_PAN mode
seperately.
2012-04-10 21:34:38 +08: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
95998a7397 add: NumInputBox class for goto page feature 2012-04-10 15:52:51 +08:00
HW
040a4e88b9 Merge pull request #95 from dpavlin/master
show overlap when moving with pan_by_page
2012-04-09 11:42:40 -07:00
HW
1c50a5676a free blitbuffers when cleaning complete cache 2012-04-09 19:58:34 +02:00
HW
ec2eda0c05 switched font handling to only work with external fonts
now you can use a environment variable, FONTDIR, to point
to a font dir. Otherwise, "./fonts" is used by default.
Subdirectories are indexed.
2012-04-09 19:04:26 +02:00