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

1323 Commits

Author SHA1 Message Date
Tigran Aivazian
82831f4312 Get rid of comments showing bad practice. 2012-10-09 23:20:42 +01: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
ef4d0a2ae4 Merge branch 'master' into picviewer 2012-10-09 21:02:03 +01: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
Tigran Aivazian
da3e336de5 Page redraw when pressing Alt-M and I in readers 2012-10-09 15:27:25 +01: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
55532b0cd6 Add picviewer.lua to LUA_FILES
We need to do this in order for picviewer.lua to be included when doing
"make customupdate".
2012-10-09 09:26:58 +01:00
Tigran Aivazian
0e84f27512 Fix the leftover from the old name jpg.h 2012-10-08 23:00:28 +01:00
Tigran Aivazian
8d88aa8901 Fix the "upside down mirror image" problem. 2012-10-08 22:52:57 +01:00
Tigran Aivazian
76d91a9ec4 Render grayscale images. 2012-10-08 20:53:59 +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
b2b9f425dd Decode the JPEG's dimensions. 2012-10-08 18:54:44 +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
Tigran Aivazian
30de5e0a23 Initial commit of picviewer. 2012-10-08 16:39:03 +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
Dobrica Pavlinusic
d14d0ba137 use visible_links for selected link 2012-10-08 15:35:53 +02:00
Dobrica Pavlinusic
905a7e704d invert all four sides of link rectangle
this helps with huge areas (Linux Journal comes to mind) for which
is somewhat hard to figure out which shortcut corresponds to which
link area
2012-10-08 15:35:41 +02:00
Dobrica Pavlinusic
4a331ab8e8 recalculate font size for each link
This fixes problems with pages full of links where first link
is so big that rest of link shotcuts overlap on page
and size of link shortcuts under different zoom #385
2012-10-08 15:35:00 +02: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