Commit Graph

182 Commits

Author SHA1 Message Date
hius07
d5a54f6c16 Reference pages: add synthetic pagemap (#14405)
Discussed in and closes #9020.
2025-10-14 21:35:58 +02:00
hius07
2facbef59a Export highlights: export backlinks to markdown (#14233) 2025-09-02 08:54:55 +03:00
Benoit Pierre
f63c76d6d4 Use new Archiver module where applicable (#13782)
- ArchiveViewer: instead of using unzip and to support more formats
  (only CBR & RAR for now)
- NewsDownloader & Wikipedia plugins: instead of using `ZipWriter`
- device: re-implement `Device:unpackArchive` and get rid of device
  specific `untar` implementations
- readerui: instead of using unzip for document provider detection
2025-05-26 16:52:38 +02:00
hius07
4ca5b92892 readerui: boolean is_txt 2025-03-13 08:08:24 +02:00
hius07
a614577c56 readerui: add is_txt 2025-03-10 18:14:21 +02:00
hius07
7c45700ceb Collections: sort (#13264) 2025-02-22 10:17:19 +02:00
hius07
435c2868a9 ReaderUI: fix BookList cache (#13245) 2025-02-13 17:53:17 +02:00
hius07
8606b132e4 Couple of minor fixes (#13185) 2025-02-01 21:25:51 +02:00
hius07
17504993ae CoverBrowser info_cache: move to core (#13018) 2025-01-18 10:08:18 +02:00
hius07
15f5dbef83 Reader: inspect zip file content to choose provider (#12902) 2024-12-19 09:41:19 +02:00
hius07
97a7ebefb9 Text editor: rotate (#12658) 2024-10-29 20:49:43 +02:00
mergen3107
f8446538c0 Fix KOReader spelling in the code (#12670) 2024-10-24 10:46:46 +02:00
hius07
b937a079ea Profiles: auto-execute on events (#12564) 2024-09-30 19:22:20 +03:00
hius07
bf290e0c2b Write highlights into PDF: revisited (#12509) 2024-09-14 15:21:26 +03:00
hius07
f0c9a642d1 ReaderStatus, Book status widget: cleanup (#12343) 2024-08-19 08:05:19 +03:00
NiLuJe
cafa9c8251 Disable the legacy ReaderRotation module (#12309)
AFAICT, this has never worked since the KPV -> KOReader refactor, as it relies on a weird little DrawContext "feature", while the actually in-use rotation framework is handled via BlitBuffer.

That kludge pollutes *a lot* of both the backend and frontend code, so I plan to annihilate that in a followup PR.

See #12303 for more context
2024-08-08 04:53:04 +02:00
ziz57
c213bd779c ReaderUI: add seamless argument to switchDocument (#12290) 2024-08-04 20:02:45 +02:00
hius07
6d73442ecd Reader: always exit to book folder (#12129) 2024-06-30 14:29:22 +03:00
hius07
585afda4be File searcher: group operations (#11980) 2024-06-06 11:44:03 +03:00
Frans de Jonge
8f2bd5420d Introduce Device:useDPadAsActionKeys() (#11900)
1. Non-Kindle-specific `hasFiveWay` behavior is changed to `hasDPad and useDPadAsActionKeys`. For now they remain Kindle-specific in practice, unless one sets `useDPadAsActionKeys = yes` in a user patch.
2. With that disambiguation out of the way, `hasFiveWay` itself is further disambiguated into `hasScreenKB` and `hasSymKey`, as per the actual property being used, rather than something that tends to correlate with it. (It needn't be Kindle-specific per se, but non-Kindle devices have equivalent shortcuts with for example `Shift`.)
  Running the emulator with `DISABLE_TOUCH=1` will set `hasSymKey = yes`, which can be tested with right shift.

Closes #11887.
2024-05-26 21:25:54 +02:00
SomeGuy
577c5d454f Non-touch DPad improvements (#11749)
Closes #11295.
2024-05-20 21:20:50 +02:00
yparitcher
59fb906921 NetworkListener: fix FM integration & properly gate behind hasWifiToggle (#11858) 2024-05-20 08:37:40 +02:00
Nico Hirsch
3b97e2988a Shorten home folder path for info messages (#11853)
The info messages for opening files always show the full path. By using `filemanagerutil.abbreviate`, the info messages now show the shortened home folder path (only if the setting "shorten home folder" is enabled).
2024-05-19 13:19:38 +02:00
hius07
db63db11b2 FileManager: safe initial path (#11774)
We do not like trailing slash in the path (except root).
Closes #11772.
2024-05-16 20:42:08 +02:00
hius07
d82815952e Annotations, part 1 (#11563)
New format to handle annotations (page bookmarks, highlights, notes) and store them in the book metadata files.
2024-05-03 09:08:57 +03:00
hius07
b8090c641c Minimize DocSettings:open() calls (#11437) 2024-02-07 10:35:52 +02:00
hius07
2ed2c2c23d md5: centralize and deduplicate (#11003)
Document partial md5 hash is calculated by util.partialMD5() and stored in doc_settings as "partial_md5_checksum" on the first document opening.
2023-10-15 07:47:09 +03:00
poire-z
ea3f8951a3 Add ReaderHandmade: support for custom TOC and hidden flows
Checkboxes under TOC>Settings> allow enabling Custom TOC
and Custom hidden flows (similar to "Hide non-linear fragments"
available with some EPUBs).
Handled by a new ReaderHandmade module.
Adding and removing TOC chapters is done in PageBrowser
with long-press on a page thumbnail, and for chapters also
in the popup dialog after selecting some text in a page.

ReaderToc: add a symbol in title when the TOC is the
alternative TOC or the custom TOC.
2023-10-09 00:15:05 +02:00
hius07
73378cd9d7 copt deduplicate: line_spacing (#10768) 2023-09-08 08:40:47 +03:00
hius07
912ae156f7 copt deduplicate: smooth_scaling, nightmode_images (#10801)
Main discussion in #10763.
2023-09-04 23:12:08 +02:00
hius07
ed2ea6803f Custom metadata (#10861) 2023-09-01 08:07:29 +03:00
hius07
1ef7821b66 getProps: centralize 2 (#10837)
Centralize and optimize handling document properties.
2023-08-30 07:53:59 +03:00
poire-z
8a240dd635 bump LunaSVG, crengine: add support for .docm (#10702)
Includes:
- bump LunaSVG: intermediate upstream bump, cleanup
- bump LunaSVG: minor upstream tweaks
crengine:
- DocX: add support for similar DocM format
- LVStyleSheet: fix LVCssDeclaration::getHash()
- CSS parsing: accept Unicode values for ID and classnames
- update for Harfbuzz 8, fix some compiler warning
Also fix input not restored when loading failed,
and KOReader not able to exit.
2023-07-16 19:18:10 +02:00
hius07
dee1c902ec ReaderUI: minor optimization (#10634) 2023-07-03 17:43:13 +03:00
poire-z
7bae2ed920 Dispatcher: add "Save book metadata" 2023-04-30 20:46:09 +02:00
hius07
5c9ba53353 History: update last book access time (#10156) 2023-02-23 19:23:30 +02:00
poire-z
b610facfdc Partial rerendering: really avoid flash on reload (#10155)
Also restore input if ReaderUI crashed.
Also avoid refresh_count management when "Full refresh
rate" is set to "never".
2023-02-22 20:32:13 +01:00
hius07
54b3b5a8cc ReaderHighlight: minor fixes (#10142)
* readerui: save highlight to pdf requires button press

* readerhighlight: fix select mode confirmbox icon
2023-02-19 20:49:09 +01:00
poire-z
81f2aed086 ReaderRolling: quicker partial rerenderings with EPUBs
Only available with EPUBs containing 2 or more fragments,
and a file size large enough to ensure a cache file is used.
The idea is simply, on any rendering setting change, to
skip the rerendering of the full book and to defer any
rerendering to the moment we draw a DocFragment, and
render only it.
So, on a setting change, only the fragment containing the
current page will be rerendered, and the new fragments we
may cross while turning pages.
When having done so, KOReader is in a degraded state (the
full page count is incorrect, the ToC is invalid...).
So, a full rerendering is needed, and one will happen
in the background, and when the user is idle, we reload
seamlessly and quickly from the cache file it has made.
ReaderFlipping will show some icons in the top left
corner to let it know at which steps in this procress
we are.
2023-02-16 23:36:26 +01:00
hius07
d5a4ac14e1 ReaderUI: fix status and history (#9993) 2023-01-07 08:09:16 +02:00
poire-z
b1b7773237 TouchMenu: tweak menu search (#9926)
- Cleanup search and animation codes, fix inconsistencies
  between animation/no-animation opening, and refreshes
  glitches on eInk.
- Show menu item on tap, with buttons to either open
  directly, or to walk there (removed earlier "Animation"
  checkbox, so the choice can be decided later).
- Move event handlers into ReaderMenu/FileManagerMenu.
- Avoid duplicated and confusing results from gestures
  and font-family submenus.
2022-12-18 01:25:41 +01:00
Frans de Jonge
e58a12ba04 TouchMenu: Search menu to search the menu (#9876)
Fixes #9800.
2022-12-06 22:02:21 +01:00
NiLuJe
925fd647dc InputContainer/FocusManager: Simplify key_events clearing on unplug
Thanks to @poire-z for the idea, it's indeed much nicer this way ;).
2022-11-02 03:48:39 +01:00
NiLuJe
09498d4bbb ReaderUI: Refresh key_events handlers on keyboard hotplug 2022-11-02 03:48:39 +01:00
NiLuJe
b523c2e8b9 InputContainer: Fall cleanup ;).
Get rid of the doc & seqtext fields, as they are not actually used (nor
are they particularly useful, the event handler's name should be pretty
self-explanatory).

Also, tweak the key_events documentation to highlight the quirks of the
API, especially as far as array nesting is involved...

Random drive-by cleanup of the declarations of key_events & ges_events
to re-use the existing instance object (now that we know they're sane
;p) for tables with a single member (less GC pressure).
2022-10-29 22:55:20 +02:00
NiLuJe
fadee1f5dc Clarify our OOP semantics across the codebase (#9586)
Basically:

* Use `extend` for class definitions
* Use `new` for object instantiations

That includes some minor code cleanups along the way:

* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
  * ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2022-10-06 02:14:48 +02:00
NiLuJe
13e8213e0a A random assortment of fixes (#9513)
* Android: Make sure sdcv can find the STL
* DocCache: Be less greedy when serializing to disk, and only do that for the *current* document ;).
* CanvasContext: Explicitly document API quirks.
* Fontlist: Switch the on-disk Persist format to zstd (it's ever so slightly faster).
* Bump base for https://github.com/koreader/koreader-base/pull/1515 (fix #9506)
2022-09-14 03:49:50 +02:00
poire-z
087f605fd9 Allow F5 key to reload document 2022-09-12 00:40:08 +02:00
zwim
9b9cfe29a4 [feat] Replace TimeVal (RIP) with time, fixed point time seconds (#8999) 2022-05-05 21:00:22 +02:00
hius07
d7549dbd87 File searcher: fix show folders, include subfolders checkbutton (#8807) 2022-03-12 11:24:07 +01:00