Add Book map and Page browser features

- Book map: shows a map of content, including TOC,
  boomarks, read pages, non-linear flows...
- Page browser: shows thumbnails of pages.

- ReaderThumbnail: new Reader module that provides
  a service for generating thumbnails of book pages.
  It makes available these 2 new fullscreen widgets.
- ReaderBookmark, ReaderLink, Statistics: add methods
  to return new views of bookmarks, previous locations
  and read pages, that are needed by BookMapWidget.
- ReaderToc: compute TOC max_depth.
- ReaderBookmark, ReaderHighlight: send events on
  bookmark add/update/remove so thumbnails of the
  pages impacted can be trashed.
This commit is contained in:
poire-z
2022-01-04 21:58:56 +01:00
parent 2530e954a2
commit bc16b32395
12 changed files with 3012 additions and 5 deletions

View File

@@ -524,6 +524,21 @@ function ReaderLink:onClearLocationStack(show_notification)
return true
end
function ReaderLink:getPreviousLocationPages()
local previous_locations = {}
if #self.location_stack > 0 then
for num, location in ipairs(self.location_stack) do
if self.ui.rolling and location.xpointer then
previous_locations[self.ui.document:getPageFromXPointer(location.xpointer)] = num
end
if self.ui.paging and location[1] and location[1].page then
previous_locations[location[1].page] = num
end
end
end
return previous_locations
end
--- Goes to link.
-- (This is called by other modules (highlight, search) to jump to a xpointer,
-- they should not provide allow_footnote_popup=true)