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

1263 Commits

Author SHA1 Message Date
{Qingping,Dave} Hou
fd27ba693b Merge pull request #409 from tigran123/long-msg
Allow two decimal digits point for gamma/zoom
2012-10-09 15:29:01 -07:00
{Qingping,Dave} Hou
78301d98ff Merge pull request #408 from tigran123/crash-fix
Possible fix for the memory corruption issue #401
2012-10-09 15:28:15 -07:00
Tigran Aivazian
832a36c624 Allow two decimal digits point for gamma/zoom
Allowing only one digit seems insufficient, especially for zoom.
2012-10-09 23:17:56 +01:00
Tigran Aivazian
1dec3def12 Fix for the memory corruption issue #401
In the function renderUtf8Text() I added a variable buffer_width which
was intended to be local but I forgot the keyword "local" in front of
it. This overwrote whatever global "buffer_width" there might be and
caused a serious memory corruption described in issue #401. Although
grepping our *.lua sources did not reveal any "buffer_width" variable I
assume that there is one elsewhere (i.e. Lua's own internal namespace is
"pollutable" by user's code) because this little change definitely does
make an awful amount of difference...
2012-10-09 23:10:28 +01:00
{Qingping,Dave} Hou
83874931f5 Merge pull request #406 from tigran123/long-msg
Restrict the value of gamma in the window message.
2012-10-09 14:52:40 -07: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
339bda372a Restrict the value gamma in the window message.
In order to make sure that the message is always visible we should not
show all the decimal places --- one is more than enough. Otherwise the
whole thing is invisible, often enough to be irritating...
2012-10-09 18:42:49 +01:00
Tigran Aivazian
4d1945d0de Merge pull request #405 from hwhw/hwhw-master
changed page number reading
2012-10-09 09:12:32 -07:00
HW
723362e469 changed page number reading
this is far from complete since in fact, we read page references
which follow a more complex syntax. while specifying page numbers
is one option for them, they might also specify page names. we
currently do not yet have code for this case and we will return
"-1" for all page references we can not parse.
2012-10-09 18:00:19 +02:00
Dobrica Pavlinušić
495a24b972 Merge pull request #398 from tigran123/showzoom
Show current zoom value when changing it.
2012-10-09 04:19:19 -07:00
Dobrica Pavlinušić
224327406c Merge pull request #399 from tigran123/djvu-zoom
Show zoom factor in DjVu info.
2012-10-09 04:18:38 -07:00
Dobrica Pavlinušić
7d5b2e6962 Merge pull request #400 from tigran123/djvu-memset
Optimize DjVu drawPage() function
2012-10-09 04:18:05 -07:00
Tigran Aivazian
4a727c8595 Optimize DjVu drawPage() function
We only need to fill the image buffer with white colour if DjVu page
rendering function did not fill it in with page data.
2012-10-09 10:23:29 +01: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
62b2261555 Show current zoom value when changing it. 2012-10-09 09:35:15 +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
Dobrica Pavlinušić
08ef1e3666 Merge pull request #396 from tigran123/djvu-cleanup
Cleanup of getUsedBBox() function.
2012-10-08 09:02:21 -07:00
Tigran Aivazian
7177f71c55 Cleanup of getUsedBBox() function.
The function getUsedBBox() does not need to perform any operations on
the DjvuPage structure, so there is no need to obtain it from Lua.
2012-10-08 16:41:30 +01:00
Dobrica Pavlinušić
fe77be4830 Merge pull request #395 from tigran123/dim-overlap
Add dim_overlap configurable
2012-10-08 07:08:11 -07:00
Tigran Aivazian
0de624a7ea Rename dim_overlap -> show_overlap_enable
The new name is more intuitive.
2012-10-08 14:59:32 +01:00
Tigran Aivazian
3dd2fba241 Merge branch 'master' into dim-overlap 2012-10-08 14:55:15 +01:00
Dobrica Pavlinušić
436d738b43 Merge pull request #394 from tigran123/dirinfo
Bugfix: count books like BOOK.PDF and BOOK.DJVU
2012-10-08 06:43:13 -07:00
Tigran Aivazian
cd48bc4d8b Add dim_overlap configurable
On request of users (dracodoc, kai771 et al.) I have added a new command
`O` which toggles the display (via dimmed box) of the page overlap
areas. This setting is saved on a per-book basis, i.e. is specific to
the book, which is the desired behaviour as one wants dimming on some
books (math, physics, etc) but not others (fiction).
2012-10-08 12:48:01 +01:00
Dobrica Pavlinušić
5608759e0f Merge pull request #393 from tigran123/bookmark-refresh
No need for page redraw in UniReader:addBookmark()
2012-10-08 04:08:00 -07:00
Dobrica Pavlinušić
621b787a85 Merge pull request #392 from tigran123/refresh-help
Explain Shift-R function in the help better
2012-10-08 04:07:04 -07:00
Tigran Aivazian
c115127e1c Bugfix: count books like BOOK.PDF and BOOK.DJVU
In the function FileInfo:getFolderContent() we need to lowercase the
extension before deciding if it is a book or not --- otherwise files
like BOOK.PDF and BOOK.DJVU are not counted as books.
2012-10-08 12:04:52 +01:00
Tigran Aivazian
e06069c147 Comment out a Debug() for page jumping.
All those functions get called even if Debug() itself is a do-nothing,
so this type of Debug()s should only be uncommented when needed.
2012-10-08 11:13:59 +01:00
Tigran Aivazian
a63140e9c8 Add "manual full screen refresh" on pressing Space
Overloading the function "set full screen refresh count" (Shift-R) with
forcing screen refresh is rather counter-intuitive and inconvenient in
practice, because the InputBox dialog obscures the large part of the
page and when it disappears it is not obvious whether the full page
redraw occurred or not.
Therefore, it is more convenient to have a separate function (bound to
KEY_SPACE as in KPV's filemanager, K3Chess and in most other readers)
that does the full screen refresh.
2012-10-08 10:39:40 +01:00
Tigran Aivazian
aeb8bcf729 No need for page redraw in UniReader:addBookmark()
The call to self:redrawCurrentPage() in UniReader:addBookmark() comes
from the days when this function was causing a "Retrieving TOC..."
message via getTocTitleByPage()->fillToc() codepath. Now that message is
gone so we should kill the redraw as well.
2012-10-08 08:50:09 +01:00
Tigran Aivazian
33768b50a7 Explain Shift-R function in the help better
1. Explain the purpose of `Shift-R` function better in the help screen.
2. Show the range of valid values when the user presses `Shift-R`.
2012-10-08 08:31:34 +01:00
Dobrica Pavlinušić
5ce6bf87ca Merge pull request #386 from tigran123/rendertext-part2
Fix the kerning check in renderUtf8TextWidth()
2012-10-07 08:52:54 -07:00
Tigran Aivazian
cb25029ddd Fix the kerning check in renderUtf8TextWidth()
This is a completion of my fixes that went into PR \#383.
In the function renderUtf8TextWidth() the check for kerning was
meaningless (always true).
2012-10-07 16:00:41 +01:00
Dobrica Pavlinušić
36486d0697 Merge pull request #383 from tigran123/rendertext
Fixes to text rendering functions and their callers.
2012-10-07 07:28:31 -07:00
Dobrica Pavlinušić
239c3bbcbc Merge pull request #384 from tigran123/show-version
Show the program version in the Help header.
2012-10-07 07:27:13 -07:00
Tigran Aivazian
7fe288ace3 No need for the local variable 'title' 2012-10-07 15:20:31 +01:00
Tigran Aivazian
e9913dce40 Generate git-rev file at compile time.
The file git-rev containing the program's version should be generated at
kpdfview compile time rather than package generation time.
2012-10-07 15:05:00 +01:00
Dobrica Pavlinušić
c1827b1d9a Merge pull request #381 from tigran123/selectmenu-nokerning
Don't use kerning for monospaced fonts.
2012-10-07 06:42:17 -07:00
Tigran Aivazian
ba0e4460d7 Merge branch 'master' into show-version 2012-10-07 14:32:09 +01:00
Tigran Aivazian
cf557bdaf8 Merge pull request #372 from dpavlin/screen_offset
Screen offset fixes
2012-10-07 06:24:59 -07:00
Tigran Aivazian
87712cf0e4 Show the program version in the Help header.
1. On startup read the file git-rev if exists and initialize a new global
G_program_version.
2. In filechooser's help page's header show the version.
This helps to easily identify what version the user is running without
asking him to cat git-rev file manually.
2012-10-07 12:59:37 +01:00
Tigran Aivazian
c7b4cf71f8 Fix the kerning logic in text size/rendering.
1. Fix the functions sizeUtf8Text(), renderUtf8Text() and
renderUtf8TextWidth() to have a meaningful test whether to kern or not
(the current code is meaningless as it contains the `else` clause that is never
executed).
2. Whitespace changes to filechooser.lua
2012-10-07 12:28:22 +01:00
Dobrica Pavlinusic
fea2eea7a4 create shortcuts just for visible links 2012-10-07 12:35:49 +02:00
Dobrica Pavlinusic
6ab06cb584 reset screen offsets after pre-cache
Code which tried to restore offsets didn't do anything since old and
self point to same values
2012-10-07 12:35:23 +02:00
Dobrica Pavlinusic
cceae8ad0a add negative x,y checking in dimRect 2012-10-07 12:34:57 +02:00
Dobrica Pavlinusic
d6bbf5d1ef paintRect should support negative x and y
without this page, highlights which land outside of page in negative
direction will core-dump reader
2012-10-07 12:34:43 +02:00
Tigran Aivazian
379cba7b68 Pass the boolean kerning to renderUtf8Text()
The last argument of renderUtf8Text() accepts only boolean values of
`kerning`.
2012-10-07 11:27:55 +01:00
Tigran Aivazian
ea92f8c1fc Don't use kerning for monospaced fonts.
If you happened to have a word like "HISTORY" in the book's TOC you will know
how ugly it looks when kerning is enabled. Since we use monospaced font
(by default) for selectmenu, it makes sense to disable kerning for the
actual items (but leave it on for shortcuts and "..." etc).
2012-10-06 20:46:19 +01:00
Dobrica Pavlinušić
1ced4ceb17 Merge pull request #376 from tigran123/nupogodi-inform
Switch to new InfoMessage API (from NuPogodi).
2012-10-06 11:33:37 -07:00
{Qingping,Dave} Hou
d916c55a87 Merge pull request #380 from tigran123/master
TTS in EMU and PDF/DjVu info cleanup.
2012-10-06 07:47:17 -07:00
Tigran Aivazian
e541a378a2 Flush the time/battery info to the right for PDF
Do the same for PDF that I have done for DjVu, to be consistent.
2012-10-06 15:10:46 +01:00