Commit Graph

973 Commits

Author SHA1 Message Date
NiLuJe
aa421bf277 GestureDetector: Translate start & end gesture positions when rotated (#13101)
* GestureDetector:adjustGesCoordinate: Remove one layer of indirectiçon in
direction translation

That function call wrapper felt pretty unnecessary to me ;).

* GestureDetector: Translate complex gesture positions, too

i.e., if there's a start and end position, translate those, too.

Fix #13090
2025-01-31 18:30:23 +01:00
Tom van Dijk
0c05abb21f feat(readerdictionary): add ability to use kiwix standalone (#13060)
Problem: when you install Kiwix from FDroid or as a standalone apk (ergo not via
the Play Store) it installs as `org.kiwix.kiwixmobile.standalone`, which before
this commit isn't supported.

This commit simply just adds it as a seperate option :)
2025-01-14 18:24:14 +01:00
Marek Veselý
f3f518afd5 [device] add Kindle Scribe 2 support (#13051) 2025-01-12 09:03:03 +01:00
Marek Veselý
038df71ca5 [device] Add the new Kindle line-up (#12990)
* add Kindle ColorSoft
* add Kindle PW6 and KT6
2025-01-03 17:29:47 +01:00
hius07
6e84503b3d Add support for KindlePaperwhite5 Signature Edition light sensor (#12946) 2024-12-28 19:42:44 +01:00
Benoit Pierre
24f983b580 pocketbook: support "extended" key events (#12707)
Only for devices running with SDK >= 6.

Close #12703.
2024-11-20 21:45:53 +01:00
Martín Fernández
fd3727274b bump android-luajit-launcher (#12734)
Includes:

https://github.com/koreader/android-luajit-launcher/pull/526
https://github.com/koreader/android-luajit-launcher/pull/527
https://github.com/koreader/android-luajit-launcher/pull/528
https://github.com/koreader/android-luajit-launcher/pull/529
2024-11-13 14:55:40 +01:00
NiLuJe
b42b9a8799 DeviceListener: Restore onExit callback passing
That callback is used for custom exit paths (e.g., OTA).

Regression in #12509
2024-10-27 01:34:20 +02:00
NiLuJe
4c91bf9f63 OTA: Make the final ConfirmBox undismissable
It's relatively easy to miss-click the buttons, especially on devices
with questionable touch panels...

And while doing so is perfectly fine, you miss the InfoMessage telling
you that the update will be applied on restart, which is potentially
confusing.

Re: #12674
2024-10-27 01:34:20 +02:00
mergen3107
f8446538c0 Fix KOReader spelling in the code (#12670) 2024-10-24 10:46:46 +02:00
mergen3107
ee17b44b58 Kindle Scribe: fix elseif for orientation code (#12663)
Fixes #12662
2024-10-20 18:58:34 +02:00
NiLuJe
a979141ab2 Kobo: Minor simplification after #12616 (#12629)
The only codepath that sets pending_connection to true in NetworkManager calls turnOnWifi right after, so we can't really ever see pending_connection w/o isWifiOn being also true ;).
2024-10-12 19:47:01 +02:00
NiLuJe
75f7d862d4 Kobo: Explicitly murder Wi-Fi right before suspend if needed
In order to avoid similar catch-22, no matter the timing
2024-10-11 20:37:36 +02:00
jkl16
6138779124 Disabled rotation map for Android devices where "hw media keys follow gravity" (#12557) 2024-10-02 14:41:47 +02:00
NiLuJe
a6584e312d Add kobov4 & kobov5 targets
kobov4 exists solely because there's a dedicated TC for it,
but we don't distribute binaries for it (it doesn't differ enough from
kobo, and experience has taught us that this kind of split was not a
great idea (e.g., kindle5 vs. kindlepw2)).

kobov5 targets a massively updated userland, and requires further
changes, including to the delivery mechanism, so it very much warrants a
dedicated package (re: #12401)
2024-10-01 23:26:03 +02:00
Benoit Pierre
d98fe14ba8 input: fix loading of fbink_input library (#12560)
The library is versioned.
2024-09-26 23:07:15 +02:00
Benoit Pierre
a1edbbf0c4 use new ffi.loadlib helper (#12545)
To load our native libraries.
2024-09-26 18:36:09 +02:00
Benoit Pierre
88aea09f73 input: fix pocketbook init (#12555)
Regression from #12486.
2024-09-25 21:17:30 +02:00
David
08205c47c8 [ReaderFooter] Update status bar in real time when inverting page turning (#12424) 2024-09-25 21:16:06 +02:00
Benoit Pierre
beaad4d337 input: fix kobo init (#12553)
I missed converting one call of `Input.open` to a method call in #12486.
2024-09-25 20:16:25 +02:00
Benoit Pierre
0c0d2ab9f1 input: drop use of ffi/input
Get rid of the weird interaction between device implementations,
`ffi.util` (`isSDL`, `noSDL`) and the device input code: each
device knows if it's using SDL or not, so rely on that to load
the right underlying input implementation.
2024-09-24 16:08:58 +02:00
Benoit Pierre
283c764351 sdl: minor cleanup; remove dead code 2024-09-24 16:08:58 +02:00
ElimGarak1
6dcafb329a Add PocketBook Verse Pro Color (PB634K3) (#12476) 2024-09-18 20:07:05 +02:00
NiLuJe
3401bed3d1 Kindle: Restore hall effect sensor state on startup (#12521)
Fix #11744
2024-09-18 15:06:23 +02:00
NiLuJe
da74691515 Chore: Don't cache static data tables (ui/elements, ui/data, kb layouts & co) (#12519)
Using `require` didn't make much sense since most of them are only used in a single place anyway, and it takes care of a few weird interactions in the process (besides not polluting `package.loaded` with useless crap ;)).
2024-09-16 17:11:42 +02:00
hius07
bf290e0c2b Write highlights into PDF: revisited (#12509) 2024-09-14 15:21:26 +03:00
jonnyl2
2a9fe6fdcf Dispatcher/DeviceListener: temporarily turn on Accelerometer/GSensor for 5 sec (#12419) 2024-09-01 23:53:51 +02:00
NiLuJe
ca71bb2917 Input: Ignore ABS_X, ABS_Y & ABS_PRESSURE for snow_protocol (#12427)
On Monza, the lift frame can report these for *multiple contacts* without an id or a slot, which is super-duper invalid -_-".

(And we have ABS_MT_POSITION_X & ABS_MT_POSITION_Y for the "saner" frames, plus these devices generally don't support pens, so we don't make use of pressure).

(Also, switched to a dedicated handler like for the phoenix quirks, to avoid bogging down the standard handler with hacks for broken drivers).

Fix #11910
2024-08-30 16:04:28 +02:00
David
4910afffdd Add numerical key_codes to event_map on kindle 3 (#12358) 2024-08-24 14:17:40 +02:00
NiLuJe
4264d915b1 Kobo: Refactor suspend in order to be able to catch input events sent during the 2s window of ntx madness (#12330)
I don't even remember how badly things broke (at least on old devices) without it, despite it making absolutely no sense at all (state-extended just flips a global that dictates whether some things get flagged as wakeup sources or not).

So, don't rock the boat too much: we don't remove it, but instead of using a sleep, we use a task deadline instead, which ensures we'll keep processing input events in the right order in the meantime. We'll already have neutered input by this point, so we'll only process power events anyway.

That means that the only iffy things are potentially *when* and *where* we have to potentially cancel that task. Resume makes sense, of course, and we log an info message to make the log flow clear; but we also do so in suspend... just in case. With a warning log because that probably indicates something fishy went on.

Also cleanup the comments while I'm there, and actually rewrite the wakeup_count stuff properly so it could actually theoretically be used if ntx kernels were actually reliable. Spoiler alert: they're not, this is still horribly broken on at least Mk < 7. Works just fine on a Forma, though, so, yay.

Fix #12325
2024-08-12 03:47:43 +02:00
David
466971c0e2 ReaderFooter: add page-turn item (#12249) 2024-08-10 10:09:23 +02:00
NiLuJe
7e8cdbcf65 PowerD: Keep track of frontlight state change by interactive callers for suspend/resume purposes (#12283)
While #12256 papered over the tracking of a *single* suspend -> (resume->suspend) series of events, things still go out of sync if you tack on *more* suspend/resume events after that.

The upside is that our *actual* tracking of suspend/resume is solid, so at least we're actually doing the right thing as far as PM is concerned.

The downside is that on Kobo, the frontlight handling code is full of delays, and the ramping down/up itself also takes some time, so things can quickly overrun into the wrong event.

This means a couple of things:

* We need to cancel any scheduled frontlight toggles and ramps on Kobo, to ensure that only the one from the *last* event received goes through, in an attempt to limit the amount of potential crossover.
* Tracking fl_was_on *cannot* reliably be done from the suspend/resume handlers (especially on Kobo), as the ramps themselves may cross over the event barriers (and we potentially cancel the task anyway), so this was moved to the very few interactive callers that will actually change the frontlight state.
* On Kobo, crossover is still *somewhat* possible because the ramps take time. It's mostly harmless for the ramp down, we just need to tweak the ramp down to start from the actual intensity to avoid a weird jump on the initial step if there's an inconsistency. For the ramp up, we potentially need to manually kill the light first, because off -> on assumes it *really* starts from off ;).

Followup to #12256
Fix #12246 (again)
2024-08-06 01:13:14 +02:00
NiLuJe
9b9898d466 Kobo: Track frontlight state more accurately on suspend/resume (#12256)
Hopefully in the least intrusive way possible, because frontlight handling code is hell.

`self.fl_was_on` could go out of sync with the expected state when resume->suspend events happened in very quick succession, leading to it being set to false, preventing the frontlight from being turned back on on the next resume.

Fix #12246
2024-08-01 23:06:31 +02:00
NiLuJe
d59c837714 Kobo: Refactor various aspects of the Kaleido/MTK support (#12221)
* UIManager: Let the fb backend deal with Kaleido wfm promotion. This fixes a number of quirks that poisoned the refresh queue with spurious full-screen refreshes. See https://github.com/koreader/koreader-base/pull/1865 for more details.
* This also means we now disable Kaleido waveform modes when color rendering is disabled (remember to trash your thumbnail cache if you don't want to mix color w/ grayscale thumbnails, though).
* UIManager: Merge refreshes that share an edge, because that was driving me nuts (and would have most likely been merged by the kernel anyway). A perfect test-case is the FM, which trips two separate refreshes because of its title bar.
* ReaderFlipping: Use sensible dimensions, so that we only refresh the icon's region.
* ReaderBookmark: Only refresh the dogear instead of the whole page when toggling bookmarks.
* NetworkSetting: Make it a real boy, so it consistently refreshes properly on dismiss instead of relying on UIManager saving the day.
* Kobo: Aggressively prevent *both* suspend & standby while MTK devices are plugged-in, as both will horribly implode the kernel (we previously only prevent standby while charging).
* Kobo: Switch to 8bpp on B&W MTK devices (or when color rendering is disabled on Kaleido panels).
2024-07-28 01:19:40 +02:00
NiLuJe
761cf18222 SDL: Return true in NetworkMgr:isConnected on !hasWifiToggle platforms, (#12217)
so as not to break the beforeWifiction shenanigans...

Which is most of them, only the Emulator subclass sets it, for...
reasons.

(That Emulator quirk is also why we can't simply scrap the whole thing
to use NetworkMgr's default imps).

Fix #12203 (thanks to @benoit-pierre for spotting that one).

This was clearly an oversight on my part when working on #10669
2024-07-26 02:12:53 +02:00
Martín Fernández
617618d587 Add Device:otaModel() (#12014)
Devices with a single target might want to specify it in `Device.ota_model`
Devices with multiple targets want to override the function or to specify `ota_model` variants for each target.
2024-06-25 21:35:38 +02:00
Marek Veselý
4c4cfa2db0 Kindle: add wifi selector (#12056)
* Kindle: Implement a NetworkMgr backend loosely based on WpaClient in order to allow feature-parity with hasWifiManager platforms. This involves dealing with the native wifid over lipc (the native IPC system, based on DBus), through custom Lua bindings (https://github.com/notmarek/openlipclua), since the stock ones lack support for the needed hasharray data type.
* NetworkMgr: Clear up leftover hallucinations from #10669, making `enableWifi` much simpler (and much more similar to `turnOnWifiAndWaitForConnection`).
* NetworkMgr: Made it clearer that `turnOnWifi` implementations *must* deal with `complete_callback`, as part of the aforementioned changes mean that it's *always* wrapped in a connectivity check, and we need that for proper event signaling.
* Android, Emu: Run `complete_callback` properly in `turnOnWifi`.
* Kindle: Support `powerd:isCharged()` on the PW2 (yes, this is random, it just happened to be my test device :D).
* NetworkMgr:disableWifi: Properly tear down any potential ongoing connection attempt (e.g., connectivity check).
* NetworkMgr:promptWifi: Make the "wifi enabled but not connected" popup clearer if there's an ongoing connection attempt, and gray out the "Connect" button in this case (as it would only lead to another "connection already in progress" popup anyway).
* NetworkMgr:reconnectOrShowNetworkMenu: Make *total* scanning failures fatal (they will lead to an immediate wifi teardown).
* NetworkMgr:reconnectOrShowNetworkMenu: Clear up the long-press behavior (which *always* shows the network list popup) so that it doesn't weirdly break all the things (technical term!).
* NetworkMgr:reconnectOrShowNetworkMenu: When we manage to connect to a preferred network on our own *before* showing the network list, make sure it is flagged as "connected" in said list.
* NetworkMgr:reconnectOrShowNetworkMenu: Make connection failures fatal in non-interactive workflows (they'll lead to a wifi teardown).
* NetworkSetting (the aforementioned network list widget): Clear NetworkMgr's "connection pending" flag on dismiss when nothing else will (i.e., when there's no connectivity check ticking).
2024-06-25 21:17:36 +02:00
David
f330593233 Fixing button invert on start (#11982)
fixing issue described here https://github.com/koreader/koreader/pull/11963#issuecomment-2147876605
2024-06-05 16:05:36 +02:00
David
7a84cfef4a Individually invert left or right side page turn buttons on Kindle (#11963)
K4 is ergonomically designed to be held with one hand (one's hand wrapped around the back and both thumb and middle finger on either PgFwd buttons).

This PR allows users to individually invert left and right page turners such that it can be operated just with one hand. It also closes #9350

Not sure if there are any other devices with two sets of page turn buttons, so currently limited to kindle, excluding kindle Voyage, but could be added too, albeit with some gymnastics.
2024-06-05 08:51:45 +02:00
NiLuJe
6a4d433aa9 Kobo: check for RGBA vs BGRA the proper way (#11953)
i.e., poke at the fb vinfo data to check the component offsets.

Fix #11952
2024-06-01 20:39:17 +02:00
Frans de Jonge
8f2bd5420d Introduce Device:useDPadAsActionKeys() (#11900)
1. Non-Kindle-specific `hasFiveWay` behavior is changed to `hasDPad and useDPadAsActionKeys`. For now they remain Kindle-specific in practice, unless one sets `useDPadAsActionKeys = yes` in a user patch.
2. With that disambiguation out of the way, `hasFiveWay` itself is further disambiguated into `hasScreenKB` and `hasSymKey`, as per the actual property being used, rather than something that tends to correlate with it. (It needn't be Kindle-specific per se, but non-Kindle devices have equivalent shortcuts with for example `Shift`.)
  Running the emulator with `DISABLE_TOUCH=1` will set `hasSymKey = yes`, which can be tested with right shift.

Closes #11887.
2024-05-26 21:25:54 +02:00
NiLuJe
f0f37e3153 Kobo: Boost saturation for CFA refreshes (and add a dev setting to disable it) (#11883)
Being able to disable it can be interesting, because it *is* a somewhat destructive process.

* Requires a base bump:
https://github.com/koreader/koreader-base/pull/1793
https://github.com/koreader/koreader-base/pull/1794
2024-05-25 01:29:15 +02:00
SomeGuy
6c7e2a9c62 Support screenshots on Non-Touch with ScreenKB as modifier (#11802)
on devices (mostly kindles) with keyboards: Alt + Shift + G
on kindle 4: ScreenKB + Menu
2024-05-20 21:22:27 +02:00
SomeGuy
577c5d454f Non-touch DPad improvements (#11749)
Closes #11295.
2024-05-20 21:20:50 +02:00
NiLuJe
4d9c6523ad Input: Some more followups to the input device auto-detection stuff (#11855)
Switch to a new `input.fdopen` API & wrapper so we can keep the fds opened by `fbink_input_scan` instead of closing them to re-open them right after that...

This should hopefully help on racy zForce devices that attempt to handle power management when opening/closing the device. We know this sometimes horribly fail to re-activate the IR grid (c.f., our manual activation on resume), but this apparently could also happen here (re: #11844) because of the quick succession of open->close->open.
2024-05-19 22:53:14 +02:00
Tomáš Janoušek
e94550a261 PocketBook: Open links in the on-device web browser (#11787)
Many PocketBook devices include a web browser, but when clicking a link in KOReader, there was no option to open the link in the browser, there was only an option to show a QR code (which can then be scanned by a smartphone).

This commit implements `canOpenLink`/`openLink` on PocketBook using the "browser.app", if available.

Tested on PB740 (InkPad 3).

Fixes: https://github.com/koreader/koreader/issues/11782
Related: https://github.com/koreader/koreader/issues/6597
2024-05-18 16:57:03 +02:00
Martín Fernández
7bded465eb SDL: add flatpak flavor (#11833)
* ship metadata with generic linux binaries
* append release version & data at build time
2024-05-18 13:21:59 +02:00
NiLuJe
05168b22f5 Kindle: Don't forget about fiveways on legacy devices & fix a couple input-scan misdetections (#11827)
* Kindle: Don't forget to open INPU_DPAD devices for the fiveways. Somehow managed to skip my mind, they're often on a separate input device.

Regression since #11807

* Update FBInk to fix a few cases of input_scan misdetection (on misconfigured drivers (e.g., no DIRECT prop on supported kernels), or old kernels with no EVIOCGPROP support).

Fix #11824
2024-05-15 23:58:01 +02:00
NiLuJe
fd5260f2ce Support auto-detection of input devices via fbink_input (#11807)
* Kobo: Drop a bunch of if ladder crap and switch to auto-detection of input devices via fbink_input
* Kindle: Drop an even larger bundle of crap to do the same ;p. (re: #11392)
* ExternalKeyboard: Switch to fbink_input to whitelist keyboards instead of the manual parsing of caps via its FindKeyboard class
* Input: Extended open/close wrappers to handle logging & tracking of dupe open/close calls.
2024-05-15 05:42:48 +02:00
mergen3107
8a316f928a Kindle: remove separate L and R orientations (#11780)
Fixes #11743
2024-05-14 10:31:14 +02:00