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.
koreader/frontend/ui/widget
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
..
container [RFC] Pagination UI shenanigans (#7335) 3 years ago
bboxwidget.lua Add support for physical button for page crop (#6091) 4 years ago
bookstatuswidget.lua Tame some ButtonTable users into re-using Buttontable instances if possible (#7166) 3 years ago
button.lua [RFC] Pagination UI shenanigans (#7335) 3 years ago
buttondialog.lua Button: Better handling of translucent MovableContainer (#7223) 3 years ago
buttondialogtitle.lua Tame some ButtonTable users into re-using Buttontable instances if possible (#7166) 3 years ago
buttonprogresswidget.lua [UX] Use a full-width plus for buttons paired with a unicode minus (#7018) 3 years ago
buttontable.lua Tame some ButtonTable users into re-using Buttontable instances if possible (#7166) 3 years ago
checkbutton.lua flash_ui: Workaround potential EPDC races (#7332) 3 years ago
checkmark.lua [RTL UI] update widgets and apps for UI mirroring 5 years ago
closebutton.lua [RTL UI] update widgets and apps for UI mirroring 5 years ago
configdialog.lua Rotation icons: make 'em dynamic. (#7440) 3 years ago
confirmbox.lua Tame some ButtonTable users into re-using Buttontable instances if possible (#7166) 3 years ago
datewidget.lua Tame some ButtonTable users into re-using Buttontable instances if possible (#7166) 3 years ago
dictquicklookup.lua The great Input/GestureDetector/TimeVal spring cleanup (a.k.a., a saner main loop) (#7415) 3 years ago
doublespinwidget.lua Revamp flash_ui handling, once more, with feeling ;) (#7262) 3 years ago
eventlistener.lua Revamp flash_ui handling, once more, with feeling ;) (#7262) 3 years ago
filechooser.lua LuaSettings: Add a method to initialize a setting properly (#7371) 3 years ago
fixedtextwidget.lua TextWidget: small refactoring, better handle max_width (#5503) 5 years ago
focusmanager.lua [feat] FocusManager: wrap around horizontally (#6315) 4 years ago
footnotewidget.lua The great Input/GestureDetector/TimeVal spring cleanup (a.k.a., a saner main loop) (#7415) 3 years ago
frontlightwidget.lua Tame some ButtonTable users into re-using Buttontable instances if possible (#7166) 3 years ago
horizontalgroup.lua Tame some ButtonTable users into re-using Buttontable instances if possible (#7166) 3 years ago
horizontalspan.lua cleanup: expand tab to 4 spaces 10 years ago
htmlboxwidget.lua The great Input/GestureDetector/TimeVal spring cleanup (a.k.a., a saner main loop) (#7415) 3 years ago
iconbutton.lua flash_ui: Workaround potential EPDC races (#7332) 3 years ago
iconwidget.lua Page Overlap: Fix rectangle computation and arrow mode (#7269) 3 years ago
imageviewer.lua Fix a few things after #7166 (#7212) 3 years ago
imagewidget.lua Page Overlap: Fix rectangle computation and arrow mode (#7269) 3 years ago
infomessage.lua ConfigDialog: temporarily hide when showing SpinWidgets 3 years ago
inputdialog.lua Revamp flash_ui handling, once more, with feeling ;) (#7262) 3 years ago
inputtext.lua Revamp flash_ui handling, once more, with feeling ;) (#7262) 3 years ago
keyboardlayoutdialog.lua Tame some ButtonTable users into re-using Buttontable instances if possible (#7166) 3 years ago
keyvaluepage.lua Menu/KVP: Make sure icons are hidden when no items are to be shown. 3 years ago
linewidget.lua [chore] Convert a couple more todos (#5267) 5 years ago
linkbox.lua Various blitting related cleanups (#4789) 5 years ago
listview.lua [RTL UI] update widgets and apps for UI mirroring 5 years ago
logindialog.lua Floor dimension computations (mul/div). (#6264) 4 years ago
menu.lua Menu/KVP: Make sure icons are hidden when no items are to be shown. 3 years ago
multiconfirmbox.lua Tame some ButtonTable users into re-using Buttontable instances if possible (#7166) 3 years ago
multiinputdialog.lua Floor dimension computations (mul/div). (#6264) 4 years ago
naturallightwidget.lua Tame some ButtonTable users into re-using Buttontable instances if possible (#7166) 3 years ago
networksetting.lua WiFi: Handle inconsistent states a tad better. (#7368) 3 years ago
notification.lua The great Input/GestureDetector/TimeVal spring cleanup (a.k.a., a saner main loop) (#7415) 3 years ago
numberpickerwidget.lua Button: Better handling of translucent MovableContainer (#7223) 3 years ago
openwithdialog.lua Tame some ButtonTable users into re-using Buttontable instances if possible (#7166) 3 years ago
overlapgroup.lua Statistics: new Calendar view (#5854) 4 years ago
pathchooser.lua LuaSettings: Add a method to initialize a setting properly (#7371) 3 years ago
physicalkeyboard.lua Various blitting related cleanups (#4789) 5 years ago
progresswidget.lua Hide non-linear fragments 4 years ago
qrmessage.lua Qrcode support (#6844) 4 years ago
qrwidget.lua Qrcode support (#6844) 4 years ago
radiobutton.lua flash_ui: Workaround potential EPDC races (#7332) 3 years ago
radiobuttontable.lua Open with: add Text Editor plugin 4 years ago
rectspan.lua cleanup: expand tab to 4 spaces 10 years ago
screensaverwidget.lua ScreenSaver: Delay footer/header repaint if screensaver_delay is enabled (#7334) 3 years ago
screenshoter.lua Standardize directory/folder to folder (#7328) 3 years ago
scrollhtmlwidget.lua Button: Better handling of translucent MovableContainer (#7223) 3 years ago
scrolltextwidget.lua Revamp flash_ui handling, once more, with feeling ;) (#7262) 3 years ago
skimtowidget.lua SkimToWidget: swap '1' and '10' buttons (#7408) 3 years ago
sortwidget.lua Minor followup to #7335 (#7347) 3 years ago
spinwidget.lua Revamp flash_ui handling, once more, with feeling ;) (#7262) 3 years ago
textboxwidget.lua The great Input/GestureDetector/TimeVal spring cleanup (a.k.a., a saner main loop) (#7415) 3 years ago
textviewer.lua Revamp flash_ui handling, once more, with feeling ;) (#7262) 3 years ago
textwidget.lua Top menu: long-press on truncated menu item to show full text 3 years ago
timewidget.lua Tame some ButtonTable users into re-using Buttontable instances if possible (#7166) 3 years ago
toggleswitch.lua ConfigDialog: temporarily hide when showing SpinWidgets 3 years ago
touchmenu.lua flash_ui: Workaround potential EPDC races (#7332) 3 years ago
trapwidget.lua TextWidget: small refactoring, better handle max_width (#5503) 5 years ago
verticalgroup.lua Tame some ButtonTable users into re-using Buttontable instances if possible (#7166) 3 years ago
verticalscrollbar.lua Text/HTML widgets: allow scrolling with the scrollbar 4 years ago
verticalspan.lua cleanup: expand tab to 4 spaces 10 years ago
virtualkeyboard.lua The great Input/GestureDetector/TimeVal spring cleanup (a.k.a., a saner main loop) (#7415) 3 years ago
widget.lua doc: fix document build 8 years ago