Commit Graph

12 Commits (fadee1f5dc5ffb6cd386a2fdadea4290e174069d)

Author SHA1 Message Date
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.
2 years ago
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)
2 years ago
poire-z 55c0fc6190
CanvasContext.hasEinkScreen(): avoid crash on Android (#9417)
It is used by CoverBrowser, in a subprocess, when extracting
metadata from PicDocuments, and crash on Android as calling
android methods is only allowed from the main thread.
2 years ago
NiLuJe 3122bcd9bc KOptOptions: Allow toggling SW dithering
Fix #8748
2 years ago
NiLuJe 7018853940 Stash enableCPUCores in CanvasContext
Avoids requring Device direction in Document.

The method needs complete access to the Device object, though, so it's
just another layer of indirection, with an extra reference on the Device
object stashed in CanvasContext...
(much like it already does for Screen)
2 years ago
Martín Fernández 53234fcdc1
add hasSystemFonts device property (#7535)
Add system + user paths to the ReMarkable (has normal linux paths)
3 years ago
Martín Fdez 454ed0ebeb enable usage of system fonts 4 years ago
Martín Fdez 8e831eb756 desktop: disable battery on touch menu and reader footer
isDesktop and isEmulator are now different entities
4 years ago
Martín Fernández 3a957d71e3 [Desktop] Open writable font dir, toggle system+user/user fonts, fix openLink on mac (#5220)
Fixes #5093
5 years ago
Qingping Hou 080c079d01 chore: add test for screen color toggle 5 years ago
Qingping Hou 05f62cc4ba add more comment 5 years ago
Qingping Hou 1605409c60 rename runtimectl to document/canvascontext 5 years ago