2
0
mirror of https://github.com/koreader/koreader synced 2024-11-04 12:00:25 +00:00
Commit Graph

5028 Commits

Author SHA1 Message Date
NiLuJe
38919c22eb
ImageViewer: Clamp zoom factor to sane values (#9529)
Should avoid egregious values that would potentially alloc insanely large buffers (and likely fail to do so).

In the process, tweak the scale_factor computations when zooming so as to produce slightly less annoying behavior.
2022-09-19 23:25:18 +02:00
hius07
b81a407690
Profiles: add QuickMenu (#9526) 2022-09-17 18:11:03 -04:00
NiLuJe
83a2965d6b
Misc: Unify error logging on network errors (#9523)
Making sure we get the relevant information in the logs, and that the UI feedback (if any), is meaningful and readable.
2022-09-17 00:08:00 +02:00
hasezoey
c8d84ffc77
Version::getShortVersion: handle "rev" being empty (#9502)
In which case we reply "unknown" instead of an empty string ;).
2022-09-16 17:45:42 +02:00
hasezoey
61415a3723
add custom mapping for tolino buttons (#9509) 2022-09-16 12:42:45 +02:00
NiLuJe
2fe2515ace
FontList: Always use the binary cache format (#9519)
Since I never actually needed to look into that data ever until today, let's just get rid of the weird debug-specific behavior.

Instead, just add a dedicated "Developer options" entry that will dump it on demand (and it'll be sorted to boot, which makes it 500% more usable).

Plus, since yesterday's change, the cache format switch between debug or not miiiight actually be crashy, so re-trigger the migration ;p.

* Includes a couple of noteworthy base bumps:

https://github.com/koreader/koreader-base/pull/1516 (update to sdcv 0.5.4 + fixes pending upstream)
https://github.com/koreader/koreader-base/pull/1517 (fix ffiUtil.orderedPairs with keys of mixed types)
2022-09-15 04:42:13 +02:00
Hannes Krumbiegel
29985c9c5c
Add Russian Wiktionary dictionary (#9517)
This adds a Russian-Russian dictionary that I created, extracted from Wiktionary.
2022-09-14 21:28:12 +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
hius07
e89d856ad9
textboxwidget: add math.floor (#9516) 2022-09-13 19:04:03 -04:00
hius07
56388aa491
TextViewer: add Find (#9507) 2022-09-13 17:09:49 -04:00
poire-z
c3cd88e019 Wikipedia EPUBs: keep math SVG images 2022-09-12 00:40:08 +02:00
poire-z
8ff55b9c94 RenderImage: use crengine to render SVG image data
Mostly only used when rendering cover and wikipedia images.
Our SVG icons are still rendered with renderSVGImageFile()
and libkoreader-nnsvg.so (NanoSVG).
2022-09-12 00:40:08 +02:00
poire-z
76a7d83079 CRE/ImageViewer: get scaled blitbuffer when long-press on SVG
Get a Lua userdata wrapping a crengine LVSvgImageSource object
when long-press on a SVG image, and have crengine/LunaSVG render
it smoothly scaled to the requested size by ImageViewer.
2022-09-12 00:40:08 +02:00
poire-z
1c44c4c584 bump crengine: better SVG support with extended LunaSVG
Build crengine against LunaSVG instead of NanoSVG.
Includes:
- SerialBuf: allow serializing longer strings
- Support '<img src="data:image/svg+xml,<svg...', remove ;-cr-plain,
- CSS: attribute selectors: accept ' or " as the quote char
- Embedded fonts: fix ignored name when sharing same url
- LVImg: fix possible crash on GIF images
- Fonts: DrawTextString(): allow collecting glyphs as SVG paths
- Images parsing: cache native sizes
- SVG: enhanced SVG support with LunaSVG extended
- Add ldomNode::isImage(), handle <object> and <embed> as images
- Handle the <svg> element as an SVG image
- Support SVG images as first class documents

Make credocument the preferred engine for .svg files.
2022-09-12 00:40:08 +02:00
poire-z
087f605fd9 Allow F5 key to reload document 2022-09-12 00:40:08 +02:00
zwim
6f5c229c90
[UIManager] Outsource device specific event handlers (was: some nits) (#9448) 2022-09-10 13:45:31 +02:00
NiLuJe
e051d3d703
Kobo: Fix a few bad interactions between suspend & checkUnexpectedWakeup (#9499)
* Kobo: Make sure checkUnexpectedWakeup won't run between scheduled
suspend calls

Because of the suspend_wait_timeout, a previously scheduled check *could* shortcircuit a suspend scheduled a tiny bit later by a real Power event.
This led to fun breakage when you plugged/unplugged a "sleeping" device, for instance.

Fix #9457

* And clear up the unexpected_wakeup_count semantics

Bits of an older design seeped through and were causing weird corner-cases...
2022-09-10 01:56:01 +02:00
zwim
d972b7fcfa
[core] Remove a bunch of superflous semicolons (#9449) 2022-09-08 21:52:06 +02:00
NiLuJe
96930f230f
Add "Invert page turn buttons" to Dispatcher (#9494)
Fix #9492
2022-09-08 04:19:34 +02:00
NiLuJe
8de4e8d785
Kindle: Attempt to deal with sticky "waking up" hibernation banners (#9491)
Fix #9482
2022-09-06 23:05:00 +02:00
NiLuJe
1ac35cb865
Input: Minor simplification for the Mk. 3 input quirk (#9481)
I was afraid that ABS_PRESSURE could be sent out of order, but that appears to never be the case, so we can simplify the code a bit :}.
2022-09-05 22:44:06 +02:00
NiLuJe
1b14ee36b3
Kobo: Fix input on Mk. 3 (i.e., Kobo Touch A/B). (#9474)
* Kobo: Discriminate between the Touch A/B and the Touch C properly, and implement actual support for the A/B input quirks. This means the clunky touchscreen probe widget shown on fresh installs on those devices is now gone :}.
* Input: Fix an off-by-one in most adjustTouchMirrorX/Y callers (only rM was doing it right), and adjust their documentation to avoid similar mistakes in the future.
* GestureDetector: Unify logging to always display transformed coordinates for simple gestures.
* GestureDetector: Fix two-contact hold lifts to be computed at the midpoint between the two contacts, like their holds counterpart already did.
2022-09-04 23:38:13 +02:00
NiLuJe
49e5200c8a
Kobo: Unbreak touch input on fresh setups on Trilogy (#9473)
By making sure we setup the right evdev parser first ;).
2022-09-04 03:33:07 +02:00
NiLuJe
8e1bb9bafc
GestureDetector: Full refactor for almost-sane(TM) MT gesture handling (#9463)
Should hopefully make two-contact gestures *much* more reliable, among other things.

See the PR for all the details ;).
2022-09-04 02:38:27 +02:00
NiLuJe
2678d2c49b
Input: Unbreak evdev handling on Kobo single-touch devices (#9465)
* Kobo: Switch ST devices to a dedicated input handler

Instead of shoehorning a hack into the standard handler.

* Use setCurrentMtSlotChecked in handleTouchEvLegacy
2022-08-31 07:12:33 +02:00
Alex Cabal
39b0ca2f36
Update Standard Ebooks OPDS URLs to new URL (#9371) 2022-08-19 19:20:34 +02:00
Hannes Krumbiegel
e7ec729adb
Update Czech-English Dictonary with inflections (#9370) 2022-08-19 17:43:50 +02:00
NiLuJe
2d5bde3ade
Input: Unbreak event handling on strict protocol B devices (#9445)
Regression since #9377
Fix #9444
2022-08-17 23:02:27 +02:00
Frans de Jonge
f8e888c832
[fix, SDL] Remove useless Device call from exit (#9443)
Fixes #9439.
2022-08-17 09:19:25 +02:00
NiLuJe
939a64438a
Input: Minor comment tweaks (#9441) 2022-08-17 00:25:33 +02:00
NiLuJe
841e67e018 Input: Make sure GestureDetector:feedEvent will actually consume all
slots

This ensures we won't leave *any* slot in an undefined state because
we skipped parsing 'em because what we consumed first yielded a
gesture.

(In particular, this could leave a few slots dangling in the "hold"
state in corner cases involving spider-hand finger tapping ;p).

Cleans up the slot state clearing in GestureDetector to only clear the
necessary slots (e.g., two-finger gestures now only clear their own two
slots; and holds only clear their own slot).
The fact that every slot will be consumed ensures that every slot will
naturally get their contact up handled, which wasn't the case before,
hence those crappy workarounds.

As far as timerfd callbacks are concerned, this *does* introduce the
possibility of deadline collisions, so, do reimplement minimal safety
checks to ensure we run (and free) the right timerfd callback.
2022-08-16 18:09:46 +02:00
NiLuJe
32ff263294 Input: Don't insert duplicate references to the event list
Some drivers can bundle the same slot multiple times in the same input
frame. We were only correctly coalescing *consecutive* slots, but some
drivers can do that in non-consecutive sequences (e.g., 1a -> 2a -> 1b
-> 2b), so, handle that, too.

Seen on neonode v2 grids.
2022-08-16 18:09:46 +02:00
NiLuJe
36d0bcc703 Input: Don't re-run the slot creation check on key sets
Make sure we always create the storage table when we add its reference
to the MTSlots list instead.

(The reasoning being we only add the reference once, and it's the first
thing we do, and we kinda need the storage to be created to get its
reference anyway; while we may set multiple keys per frame).
2022-08-16 18:09:46 +02:00
NiLuJe
ba43ac1833 Input: Actually fix the timer double-free
For realz, this time.

This reverts the original attempt, because it was gratuitous
overcomplexification that turns out to be completely unnecessary.

This also fixes a few subtle MT handling snafus on some devices.
2022-08-16 18:09:46 +02:00
NiLuJe
db2ba08617 Kobo: Handle the IR grid wakeup workaround on the Glo HD, too
Because the sysfs path is different, of course ;).
2022-08-16 18:09:46 +02:00
NiLuJe
3768aa0b56 GestureDetector: Clear *all* pending hold states on hold_release.
We'll only honor one (the last one) anyway, and we've already cleared
the timers, so the others are essentially lost and stuck in limbo.

(Repro: do a series of staggered holds on different words with different
fingers in a CRe document; the one that'll "take" is the last one,
but *every* slot will be stuck in a hold state, which can essentially
semi lock you into broken input until you manage to clear the right
slots by doing duplicate multi-slot holds again...).
2022-08-16 18:09:46 +02:00
NiLuJe
e3228abb19 ScreenSaver: On race-y platforms, only force a refresh on close if the
widget was actually closed *immediately*.

If it's delayed (by time, tap or gesture), leave it alone.

Fix #9285
2022-08-16 18:09:46 +02:00
NiLuJe
8e7dddd927 Input: Make sure we consume & clear the right timerfd callback
Multitouch gestures can create multiple timers on the same deadline, but
on different slots, so simply hoping that the head of the list would
match was somewhat optimistic... ;o).

Fix #9376

It's trickier in the !timerfd case, though,
so do the best we can there...
(It wouldn't crash, but it might fire the "wrong" callback).
2022-08-16 18:09:46 +02:00
yparitcher
c4a802c486 kindle: allow stopping the framework on 5.X
this reclaims a bunch of memory useful on low memory devices
2022-08-15 10:40:16 -04:00
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.
2022-08-08 11:42:56 +02:00
poire-z
9cba1904ee
CRe, MuPDF, PicDocument: add support for WebP images (#9402)
Bump base, includes:
- thirdparty/luasec 1.2.0
- Bump NanoSVG: various small fixes
- Add thirdparty/libwebp and ffi/webp.lua wrapper
- MuPDF: add support for webp images
- bump crengine: add support for webp images
- thirdparty/harfbuzz 5.1.0
RenderImage:renderImageData(): render webp images
with ffi/webp.lua.
2022-08-03 23:19:31 +02:00
hius07
f67469bab4
Highlight: add note marker (#9395) 2022-08-03 09:51:57 -04:00
poire-z
d352579d06
BookMap: allow tap on ToC titles and outside page slots (#9400)
This helps jumping to page when ToC chapters are short
and the bookmap page rows narrow.
Also fix crash when invoking BookMap and PageBrowser
on a PicDocument (considered DocLess by Statistics).
2022-08-03 08:45:45 +02:00
weijiuqiao
30915546f0
vocabbuilder.koplugin: always show more button, add book filtering (#9393)
Always show more button instead of delete regardless of review count per #9383.
Adds book filtering per #9256 (from menu or by swiping up).
2022-07-31 09:02:09 +02:00
zwim
70642ba040
Bottom Menu: fix contrast has no units (#9392)
This should fix https://github.com/koreader/koreader/pull/9205#issuecomment-1200130686
2022-07-30 13:46:23 +02:00
hius07
460d42293a
PathChooser: add creating folder (#9354) 2022-07-27 12:02:37 -04:00
hius07
bff1e8deb7
InputText: fix 'number' hint (#9362)
When input_type == "number" convert the hint to "string" type.
Closes #9359.
2022-07-26 12:04:40 +02:00
ElimGarak1
bbc5652c1d
Add PocketBook Era (PB700) (#9365) 2022-07-23 15:29:09 +02:00
poire-z
5e2ed5ae2a
bump crengine: monospace and fallback fonts tweaks (#9343)
Includes:
- Text: fix possible overflow with "white-space: pre"
- Fonts: getFontFileNameAndFaceIndex(): return family type
- Fonts: account for _bias in Font hash
- epub.css, fb2.css: remove hardcoded monospace font names
- Fonts: allow scaling monospace fonts
- Fonts: allow adjusting fallback font sizes to x-height
- HTML parser: trust xml encoding before html charset

In our list of fonts, show a "M" indicator alongside
monospace fonts, and allow long-press to select the one
to be use for "font-family: monospace".
Add 2 options to Font settings, to scale monospace fonts
by a percentage, and to adjust fallback fonts to their
x-height.
2022-07-18 01:16:51 +02:00
NiLuJe
f92dfeae21
Android: Leave the EV_MSC input handler alone. (#9335)
It's used to communicate state changes from Android to Lua, we really
really don't want to lose these ;).

Fix #9326
2022-07-14 17:05:57 +02:00