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 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
..
container Clarify our OOP semantics across the codebase (#9586) 2 years ago
bboxwidget.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
bookmapwidget.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
bookstatuswidget.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
button.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
buttondialog.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
buttondialogtitle.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
buttonprogresswidget.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
buttontable.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
checkbutton.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
checkmark.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
closebutton.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
configdialog.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
confirmbox.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
datetimewidget.lua Misc: Get rid of the legacy defaults.lua globals (#9546) 2 years ago
dictquicklookup.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
doublespinwidget.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
eventlistener.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
filechooser.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
fixedtextwidget.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
focusmanager.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
footnotewidget.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
frontlightwidget.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
horizontalgroup.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
horizontalscrollbar.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
horizontalspan.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
htmlboxwidget.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
iconbutton.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
iconwidget.lua Misc: Get rid of the legacy defaults.lua globals (#9546) 2 years ago
imageviewer.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
imagewidget.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
infomessage.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
inputdialog.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
inputtext.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
keyboardlayoutdialog.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
keyvaluepage.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
linewidget.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
linkbox.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
listview.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
logindialog.lua InputDialog: insert TitleBar (#8695) 2 years ago
menu.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
multiconfirmbox.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
multiinputdialog.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
naturallightwidget.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
networksetting.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
notification.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
numberpickerwidget.lua Misc: Get rid of the legacy defaults.lua globals (#9546) 2 years ago
openwithdialog.lua Non-touch: highlight support (#8877) 2 years ago
overlapgroup.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
pagebrowserwidget.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
pathchooser.lua PathChooser: add creating folder (#9354) 2 years ago
physicalkeyboard.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
progresswidget.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
qrmessage.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
qrwidget.lua Qrcode support (#6844) 4 years ago
radiobutton.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
radiobuttontable.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
radiobuttonwidget.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
radiomark.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
rectspan.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
screensaverwidget.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
screenshoter.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
scrollhtmlwidget.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
scrolltextwidget.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
skimtowidget.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
sortwidget.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
spinwidget.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
textboxwidget.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
textviewer.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
textwidget.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
titlebar.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
toggleswitch.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
touchmenu.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
trapwidget.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
verticalgroup.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
verticalscrollbar.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
verticalspan.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
virtualkeyboard.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago
widget.lua Clarify our OOP semantics across the codebase (#9586) 2 years ago