You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Go to file
NiLuJe 6d53f83286
The great Input/GestureDetector/TimeVal spring cleanup (a.k.a., a saner main loop) (#7415)
* ReaderDictionary: Port delay computations to TimeVal
* ReaderHighlight: Port delay computations to TimeVal
* ReaderView: Port delay computations to TimeVal
* Android: Reset gesture detection state on APP_CMD_TERM_WINDOW.
  This prevents potentially being stuck in bogus gesture states when switching apps.
* GestureDetector:
  * Port delay computations to TimeVal
  * Fixed delay computations to handle time warps (large and negative deltas).
  * Simplified timed callback handling to invalidate timers much earlier, preventing accumulating useless timers that no longer have any chance of ever detecting a gesture.
  * Fixed state clearing to handle the actual effective slots, instead of hard-coding slot 0 & slot 1.
  * Simplified timed callback handling in general, and added support for a timerfd backend for better performance and accuracy.
  * The improved timed callback handling allows us to detect and honor (as much as possible) the three possible clock sources usable by Linux evdev events.
    The only case where synthetic timestamps are used (and that only to handle timed callbacks) is limited to non-timerfd platforms where input events use
    a clock source that is *NOT* MONOTONIC.
    AFAICT, that's pretty much... PocketBook, and that's it?
* Input:
  * Use the <linux/input.h> FFI module instead of re-declaring every constant
  * Fixed (verbose) debug logging of input events to actually translate said constants properly.
  * Completely reset gesture detection state on suspend. This should prevent bogus gesture detection on resume.
  * Refactored the waitEvent loop to make it easier to comprehend (hopefully) and much more efficient.
    Of specific note, it no longer does a crazy select spam every 100µs, instead computing and relying on sane timeouts,
    as afforded by switching the UI event/input loop to the MONOTONIC time base, and the refactored timed callbacks in GestureDetector.
* reMarkable: Stopped enforcing synthetic timestamps on input events, as it should no longer be necessary.
* TimeVal:
  * Refactored and simplified, especially as far as metamethods are concerned (based on <bsd/sys/time.h>).
  * Added a host of new methods to query the various POSIX clock sources, and made :now default to MONOTONIC.
  * Removed the debug guard in __sub, as time going backwards can be a perfectly normal occurrence.
  * New methods:
    * Clock sources: :realtime, :monotonic, :monotonic_coarse, :realtime_coarse, :boottime
    * Utility: :tonumber, :tousecs, :tomsecs, :fromnumber, :isPositive, :isZero
* UIManager:
  * Ported event loop & scheduling to TimeVal, and switched to the MONOTONIC time base.
    This ensures reliable and consistent scheduling, as time is ensured never to go backwards.
  * Added a :getTime() method, that returns a cached TimeVal:now(), updated at the top of every UI frame.
    It's used throughout the codebase to cadge a syscall in circumstances where we are guaranteed that a syscall would return a mostly identical value,
    because very few time has passed.
    The only code left that does live syscalls does it because it's actually necessary for accuracy,
    and the only code left that does that in a REALTIME time base is code that *actually* deals with calendar time (e.g., Statistics).
* DictQuickLookup: Port delay computations to TimeVal
* FootNoteWidget: Port delay computations to TimeVal
* HTMLBoxWidget: Port delay computations to TimeVal
* Notification: Port delay computations to TimeVal
* TextBoxWidget: Port delay computations to TimeVal
* AutoSuspend: Port to TimeVal
* AutoTurn:
  * Fix it so that settings are actually honored.
  * Port to TimeVal
* BackgroundRunner: Port to TimeVal
* Calibre: Port benchmarking code to TimeVal
* BookInfoManager: Removed unnecessary yield in the metadata extraction subprocess now that subprocesses get scheduled properly.

* All in all, these changes reduced the CPU cost of a single tap by a factor of ten (!), and got rid of an insane amount of weird poll/wakeup cycles that must have been hell on CPU schedulers and batteries..
3 years ago
.ci CI: Update to Busted 2.0.0 3 years ago
.circleci [chore] (#6764) 4 years ago
.github Unbreak macOS build (#7313) 3 years ago
base@3a754c7288 The great Input/GestureDetector/TimeVal spring cleanup (a.k.a., a saner main loop) (#7415) 3 years ago
doc Add Lua 5.1 to sample Debubuntu apt-get command (#7421) 3 years ago
frontend The great Input/GestureDetector/TimeVal spring cleanup (a.k.a., a saner main loop) (#7415) 3 years ago
l10n@ea65427674 Update translations for 2021.03 (#7450) 3 years ago
metadata@98fd6c8fe0 add metadata, to be used by fdroid 4 years ago
platform Remarkable1 wifi (#7216) 3 years ago
plugins The great Input/GestureDetector/TimeVal spring cleanup (a.k.a., a saner main loop) (#7415) 3 years ago
resources Rotation icons: make 'em dynamic. (#7440) 3 years ago
spec/unit The great Input/GestureDetector/TimeVal spring cleanup (a.k.a., a saner main loop) (#7415) 3 years ago
test@86eeb0b43d various test/coverage optimization 8 years ago
tools Remove PNG icons, add koreader.svg 3 years ago
.busted Travis update 9 years ago
.codecov.yml [CI] Add .codecov.yml (#4695) 5 years ago
.editorconfig experimental port to Mac OSX 8 years ago
.gitignore Add macOS target 4 years ago
.gitmodules add metadata, to be used by fdroid 4 years ago
.luacheckrc Update UI layout code to use new SVG icons 3 years ago
.luacov [CI] Also run coverage on plugins (#3447) 7 years ago
.shellcheckrc [CI] Add curly braces check (#5809) 4 years ago
.travis.yml quickstart fix (#2804) 7 years ago
COPYING switch license to AGPLv3 10 years ago
Makefile Remove PNG icons, add koreader.svg 3 years ago
README.md Remove sourceror.io (#6986) 3 years ago
datastorage.lua [CI] Mac OS app (#6955) 3 years ago
defaults.lua Fix y origin of the configmenu extended tapzone (#7015) 3 years ago
kodev reader.lua: rework file/directory argument handling. (#7053) 3 years ago
reader.lua The great Input/GestureDetector/TimeVal spring cleanup (a.k.a., a saner main loop) (#7415) 3 years ago
setupkoenv.lua The great Input/GestureDetector/TimeVal spring cleanup (a.k.a., a saner main loop) (#7415) 3 years ago

README.md

KOReader

KOReader is a document viewer primarily aimed at e-ink readers.

AGPL Licence Latest release Gitter Mobileread Build Status Coverage Status Weblate Status

DownloadWikiDeveloper docs

Main features

  • portable: runs on embedded devices (Cervantes, Kindle, Kobo, PocketBook, reMarkable), Android and Linux computers. Developers can run a KOReader emulator in Linux and MacOS.

  • multi-format documents: supports fixed page formats (PDF, DjVu, CBT, CBZ) and reflowable e-book formats (EPUB, FB2, Mobi, DOC, CHM, TXT). Scanned PDF/DjVu documents can also be reflowed with the built-in K2pdfopt library.

  • full-featured reading: multi-lingual user interface with a highly customizable reader view and many typesetting options. You can set arbitrary page margins, override line spacing and choose external fonts and styles. It has multi-lingual hyphenation dictionaries bundled into the application.

  • integrated with calibre (search metadata, receive ebooks wirelessly, browse library via OPDS), Evernote (export hightlights), Wallabag, Wikipedia, Google Translate and other content providers.

  • optimized for e-ink devices: custom UI without animation, with paginated menus, adjustable text contrast, and easy zoom to fit content or page in paged media.

  • extensible: via plugins

  • and much more: look up words with StarDict dictionaries / Wikipedia, add your own online OPDS catalogs and RSS feeds, share ebooks with other KOReader devices wirelessly, online over-the-air software updates, an FTP client, an SSH server, …

Please check the wiki to discover more features and to help us document them.

Screenshots

Installation

Please follow the model specific steps for your device:

AndroidCervantesKindleKoboLinuxPocketbookreMarkable

Development

Setting up a build environmentCollaborating with GitBuilding targetsPortingDeveloper docs

Support

KOReader is developed and supported by volunteers all around the world. There are many ways you can help:

Right now we only support liberapay donations, but you can also create a bounty to motivate others to work on a specific bug or feature request.

Contributors

Last commit Commit activity