Adds ReaderPageMap, to optionally show source pages numbers

bump crengine: support for EPUB3 nav toc and page maps
Includes:
- Fix lvRect:isRectInside(rc) with 0-width or 0-height rect
- TOC: parse EPUB3 nav toc, fallback to spine when no toc
- Parse and cache various hardcopy page list maps
- epub.css: hide EPUB3 <span epub:type="pagebreak"> content
cre.cpp: add a few PageMap helper functions.

Adds ReaderPageMap which will add a new menu (under TOC and
Bookmarks) that will allow:
- to list source page numbers (like a TOC)
- to show visible page labels in the right margin
- to use these source page numbers in the footer, the TOC,
  the GoTo and SkimTo widgets, and to use the source page
  number in the standard bookmark and highlight initial text.
This commit is contained in:
poire-z
2020-03-26 14:04:59 +01:00
parent 1cb3be324a
commit 026140f809
12 changed files with 506 additions and 9 deletions

View File

@@ -221,7 +221,11 @@ function ReaderBookmark:onShowBookmark()
local page = v.page
-- for CREngine, bookmark page is xpointer
if not self.ui.document.info.has_pages then
page = self.ui.document:getPageFromXPointer(page)
if self.ui.pagemap and self.ui.pagemap:wantsPageLabels() then
page = self.ui.pagemap:getXPointerPageLabel(page, true)
else
page = self.ui.document:getPageFromXPointer(page)
end
end
if v.text == nil or v.text == "" then
v.text = T(_("Page %1 %2 @ %3"), page, v.notes, v.datetime)