2
0
mirror of https://github.com/koreader/koreader synced 2024-10-31 21:20:20 +00:00
Commit Graph

635 Commits

Author SHA1 Message Date
Martín Fernández
f9a820d682 android: unbreak KO on scoped storage devices 2019-12-12 21:17:03 +01:00
Martín Fernández
72e5574ca7 android: allow overrides on 3rd party dictionary list 2019-12-07 17:22:00 +01:00
Martín Fernández
f1f75c5cb0 android: touchscreen toggle option (#5564) 2019-11-06 00:52:44 +01:00
Martín Fernández
87334801ea android: fix ko paths when primary storage is a SD card 2019-10-14 09:11:58 +02:00
NiLuJe
9f4ba77fab [Kobo] Always set the warmth on the KA1 (#5468)
It might be possible to instead only set the white led, but I don't
have the hardware to test that theory, se, eh.

Fix #5465 (probably.)
2019-10-11 20:37:18 +02:00
Martín Fernández
b75fec4971 tweak timeouts, add haptic feedback support
Co-Authored-By: Frans de Jonge <fransdejonge@gmail.com>
2019-10-08 18:22:56 +02:00
Frans de Jonge
f7861bc1eb
[feat] Add haptic feedback (#5380)
References <https://github.com/koreader/koreader/issues/5374>.
2019-09-29 15:42:05 +02:00
NiLuJe
abc86323fc [Kobo/Cervantes] Always use setBrightness to set the brightness (#5429)
sysfs_light handles every case sanely already, no need to be cute ;).

This prevents always setting the warmth when setting the FL on NL
devices with a mixer, because, besides being useless, it's also slow
(lua does mmap'ed io, so every handle requires an fstat + mmap).

It was subtly affecting the fluidity of the toggle ramp, and much less
subtly wreaking havoc on #5373 ;).

KA1 owners might want to investigate keeping the fds around one way or
another, like we do for the fl ioctl, to alleviate the overhead of doing
that for not one but three or four fds...
I won't be doing that, since I lack the hardware to test it, and FL+NL
stuff is pain.

* Do the same on Cervantes

* Bump base to pickup related ioctl tweaks
2019-09-26 23:59:31 +02:00
NiLuJe
e7cfc65780 [Kobo] Unbreak the FL ramp-up/down (#5421)
I got my wires crossed.

It's fast on Mk. 5, slow on Mk. 7.
So, slow it down on Mk. 5 so we actually get a ramp and not a jump.
2019-09-24 20:27:28 +02:00
NiLuJe
f96cfe940b
Use the proper LED driver on the Libra (#5416)
So that we can actually set the warmth ;)
2019-09-23 18:06:57 +02:00
NiLuJe
bcceb94603
Hotfix the startup orientation on the Kobo Libra (#5409) 2019-09-22 02:22:22 +02:00
NiLuJe
1c2c471c5f
[Kobo/Cervantes] Prefer using the ioctl over sysfs when setting the FL. (#5407)
* Prefer using the ioctl over sysfs when setting the FL.
It's much lower latency (re #5373).

We can do so on NL devices with a mixer.
2019-09-22 02:11:18 +02:00
tobiasarndt
a2f605ba38 [fix] added PocketBook InkPad 3 Pro to device.lua (#5398) 2019-09-18 15:21:04 +02:00
Frans de Jonge
672d29fbcc [fix] WakeupMgr: pass through task epoch for proximity check 2019-09-14 16:27:54 +02:00
Frans de Jonge
0c290be055 WakeupMgr: add log when scheduling wakeup 2019-09-14 16:27:54 +02:00
Frans de Jonge
3836184f9d [Kobo] Always write scheduled wakeup info to log 2019-09-14 16:27:54 +02:00
NiLuJe
4363576066 Support the Kobo Libra
(Hopefully?).
2019-09-12 14:27:05 +02:00
Frans de Jonge
e257c4e45e
[feat, Kobo] Autoshutdown (#5335)
The methods used here will likely work on most embedded devices, which is why I put them in their own WakeupMgr interface/scheduler module, separate from Kobo.

See https://www.mobileread.com/forums/showthread.php?p=3886403#post3886403 for more context.

Fixes #3806.
2019-09-12 14:15:08 +02:00
Frans de Jonge
0dad707e2e
[fix, Kobo] Don't crash trying to sync frontlight with Nickel. (#5361)
When reasonably possible, the program should only crash in debug mode.

Adds a couple of extra unit tests to prevent regressions and adds docs.

Fixes <https://github.com/koreader/koreader/issues/5356>.
2019-09-11 18:11:24 +02:00
Martín Fernández
20ebb55703 [Cervantes] Disable wifi before returning to QT, improved sysfs read (#5326) 2019-09-06 15:56:16 +02:00
Frans de Jonge
7019ff15bd
[chore] Drop SDL 1.2 (#5324)
Depends on https://github.com/koreader/koreader-base/pull/963.

Also includes Initial import of <linux/rtc.h> related stuff https://github.com/koreader/koreader-base/pull/965
2019-09-05 23:30:13 +02:00
Robert
ae50569055 Frontlight - Add checkbox use system settings (#5307)
See: https://github.com/koreader/koreader/issues/5205#issuecomment-526935357

Devices with `hasLightLevelFallback = true` (for now Android) has extra checkbutton `Use system settings`. Default unchecked.
2019-09-04 20:52:24 +02:00
Frans de Jonge
1b17ce8ba0
[fix, Kobo] Save frontlight state on shutdown after suspend (#5305)
Fixes <https://github.com/koreader/koreader/issues/5292>.
2019-09-01 21:25:32 +02:00
Frans de Jonge
cfa73be940
[feat, Kobo] Implement shutdown from suspend (#5280)
This allows to shutdown straight from suspend just like Nickel.

Fixes <https://github.com/koreader/koreader/issues/2431>.
2019-08-29 22:02:08 +02:00
Frans de Jonge
be87fb27a0
[chore] Convert a couple more todos (#5267)
Cf. <https://github.com/koreader/koreader/pull/5244>.

Also update check.
2019-08-26 15:49:50 +02:00
Frans de Jonge
9cd8e4a53a [chore] Work around weird LDoc bug
Using two `@fixme` tags directly following each other can result in a crash.

See <https://github.com/stevedonovan/LDoc/issues/314> for the upstream issue.
2019-08-25 11:44:43 +02:00
Frans de Jonge
59bb3ac8ea
[chore] Remove executable bit on device/input.lua (#5258)
I've got no idea why that might be there.
2019-08-25 11:43:56 +02:00
Frans de Jonge
a2dcfe9aec
[doc] Tag @todo, @fixme and @warning (#5244)
This commit standardizes the various todos around the code a bit in a manner recognized by LDoc.

Besides drawing more attention by being displayed in the developer docs, they're also extractable with LDoc on the command line:

```sh
ldoc --tags todo,fixme *.lua
```

However, whether that particular usage offers any advantage over other search tools is questionable at best.

* and some random beautification
2019-08-23 19:53:53 +02:00
Martín Fernández
3a957d71e3 [Desktop] Open writable font dir, toggle system+user/user fonts, fix openLink on mac (#5220)
Fixes #5093
2019-08-20 18:38:02 +02:00
Martín Fernández
3161673d70 fix #5228 2019-08-20 16:26:39 +02:00
vvasseur
c104724a58 PocketBook 626 new codename (#5215) 2019-08-16 22:59:36 +02:00
Martín Fernández
50ce8d47cd do not request write settings permission at launch 2019-08-15 15:28:28 +02:00
Robert
939538cc25 [UX] Add gesture - poweroff and restart device (#5202)
Also abstract canRestart, canReboot and CanPowerOff.
2019-08-15 14:49:15 +02:00
NiLuJe
10511220e5 Simplify isWifiOn on Kobo (#5211)
Don't fork for lsmod + grep, we can perfectly well parse /proc/modules
ourselves ;).

c.f., https://github.com/koreader/koreader/pull/5203#issuecomment-521277628
2019-08-14 20:50:03 +02:00
jetomit
20493eebc3 [fix, Kobo] Add missing parentheses (#5198)
Prevents a crash when the WIFI_MODULE environment variable is not
defined.
2019-08-12 16:06:55 +02:00
Martín Fernández
10456169e5
Android: ignore touchscreen by user request (using a hardware key) (#5164)
* android: ignore touchscreen by user request (using a hardware key)
2019-08-03 01:02:50 +02:00
NiLuJe
e2961097e7
Don't use WAL on devices where it's not supported (#5162)
(i.e., truly ancient kernels and weird FS).

In which case, we use TRUNCATE, which might be a tad less terrible than
DELETE on said weird crap FS.
2019-08-01 19:10:46 +02:00
Martín Fernández
91b2faae6a android: add an option to ignore volume keys or use them to turn pages 2019-08-01 19:05:23 +02:00
NiLuJe
53adb9d0e1
On (really old) Kindles, don't crash if there's no sysfs entry to read for battery capacity (#5161)
Parse gasgaucge-info's output instead.

Fix #5159
2019-08-01 18:45:30 +02:00
NiLuJe
e9eca55d90
Minor auto_restore_wifi tweaks (#5143)
* Try to make sure restoreWifiAsync eventually sends a NetworkConnected
event...

re: #5109

* Take a page from @shermp's book, and make sure wpa_supplicant managed to
connect to the AP before acquiring an IP.
Tear down WiFi modules in case of failure.
c.f., https://github.com/shermp/Kobo-UNCaGED/pull/21

* Don't let restore-wifi-async.sh enable WiFi behind our back when we're
killing it to start Nickel...

* Don't even call ping if there's no default gw
2019-07-31 01:00:51 +02:00
Robert
803a143764 [sdl] Add support arrow key for next/prev page (#5149)
Close: #4997 
This PR add support arrow key and mouse scroll wheel for next/previous page.

- Document in page mode:

PageDown, Arrow down, Arrow right - go to next page
PageUp, Arrow up, arrow left - go to prev page
Mouse scroll wheel down - go to next page
Mouse scroll wheel up - go to prev page

- Document in scroll mode:

PageDown, Arrow right - go to next page
PageUp, Arrow, arrow left - go to prev page
Arrow down - scroll document down
Arrow up - scroll document up
Mouse scroll wheel down - scroll document down
Mouse scroll wheel up - scroll document up
2019-07-28 13:57:03 +02:00
Martín Fernández
cd0f1acd7f android: add support for different screen timeout setups 2019-07-26 23:16:23 +02:00
Robert
1f6af80817 [feat] Make gesture intervals configurable (#5138)
Discussion: #4842
Close: #4842
2019-07-24 14:31:20 +02:00
NiLuJe
74518c79d1
Fix Kindle model detection in some corner-cases (#5125)
* Fix Kindle model detection in some corner-cases

We were (currently) unaffected because we don't support the K1.
Still, this should be slightly more robust.
2019-07-19 23:16:25 +02:00
NiLuJe
564ee15679
Auto-detect the touchscreen input device on the PW4 (#5113)
Once again, LTE devices have an extra proximity sensors that shifts the
evdev path by one...

Fix #5110
2019-07-18 22:36:41 +02:00
Андрей Тюрин
bea7ca7008 Pocketbook 622 preliminary support (#5118) 2019-07-15 14:39:37 +02:00
Martín Fernández
b385e443e6 [Android] Add support for 3rd party dictionary apps (#5108)
Co-Authored-By: poire-z <poire-z@users.noreply.github.com>
2019-07-08 14:19:36 +02:00
Martín Fernández
338bc8cced fullscreen toggle for Jelly Bean devices 2019-07-06 17:09:18 +02:00
NiLuJe
38e7975728
More robust Gyro toggle (#5104)
* Make toggling Gyro events more robust

Actually ask to turn it on/off depending on the setting, instead of a
blind toggle

A quick succession of suspend/resume events could otherwise leave it
in an unexpected state (i.e., off when it should have been on).
2019-07-01 17:12:24 +02:00
NiLuJe
2ab3e48286 Make sure we only pass a single IP to ping
For some mysterious reason, I have a duplicate default gateway on my
Forma, one with no metrics, and a proper one.
This ensures we pick the proper one.

I'm fairly sure this is temporary insanity on the part of my device,
but, still, it can't hurt.

route -n:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 eth0
0.0.0.0         192.168.0.1     0.0.0.0         UG    208    0        0 eth0
192.168.0.0     0.0.0.0         255.255.255.0   U     208    0        0 eth0

ip r:
default via 192.168.0.1 dev eth0
default via 192.168.0.1 dev eth0  metric 208
192.168.0.0/24 dev eth0  src 192.168.0.49  metric 208
2019-06-29 19:53:14 +02:00
Martín Fernández
75ff5dcaae Add Device:Info for android and use it in report a bug infomessage.
Move local function getCodename to top, use android.app.activity.sdkVersion directly,
instead of relying on Device.firmware_rev
2019-06-21 19:55:19 +02:00
Martín Fernández
c60d672b04 bump base & luajit-launcher: workaround for buggy firmwares and more 2019-06-13 22:16:58 +02:00
Frans de Jonge
6f153255d6
[fix] Kindle Basic 3: use Kobo snow protocol (#5071)
Otherwise touch will be stuck in perpetual hold.

Fixes https://github.com/koreader/koreader/issues/5070
2019-06-11 09:12:57 +02:00
NiLuJe
89e002f236
Minor networking fixes on legacy Kindles (#5059)
* Allow toggling WiFi & Suspend on legacy Kindles
* Fix ping invocations on Legacy Kindles
* Don't crash when disabling WiFi on legacy Kindles
2019-06-05 21:36:38 +02:00
NiLuJe
3798e1b72c Kindle Basic 3 support (#5057)
* Detect a few new PW4 variants

* Detect the new Kindle Basic 3

* Bump base for KT4 mxcfb support
2019-06-04 21:36:21 +02:00
NiLuJe
efe34b6fee Fix shutdown action on Kobo (#5055)
Bypass init, like Nickel does.
Otherwise, some devices either deadlock or panic.
2019-06-03 18:54:45 +02:00
NiLuJe
de1146c0b5 [Kobo] Tweak the Aura viewport (#5034)
Officially, the bezel should only cover the bottom 10 pixels ;).
(The Aura was officially advertised as having a 758x1014 screen).
2019-05-21 20:31:23 +02:00
NiLuJe
4ba7f984bf Sync powerd.fl brightness with powerd when toggling the FL (#4999)
Possibly helps with some more edge cases related to interaction with
autowarmth & the KA1...

re: #4925
2019-05-05 22:08:53 +02:00
NiLuJe
aec7594af5
Blacklist the C BB on devices where it cannot be used (#4989)
Either at all, or because it would impose reduced functionality.

Meaning:
* On 4bpp fb, because those are completely unsupported by the C BB
* On 24bpp fb, because it has limited support for that target format (no alpha blending).
* On 8bpp Linux eInk fb with an inverted palette (that's basically only the K4 ;)).
* On Linux eInk devices w/ no HW inversion support, as that would render NightMode inoperable.

That last point means that it's currently *always* blacklisted on PocketBook, because I don't have a PB device, so I don't know how safe HW inversion would be, meaning none of them are marked as being HW invert capable.

(I was a tiny bit hasty with https://github.com/koreader/koreader-base/pull/912 ;).)
2019-05-02 04:27:48 +02:00
NiLuJe
d9ab5d2f43 Make sure the AutoWarmth feature will never try to turn the light back (#4953)
on if it's off.
Because, on the KA1, since wetting the warmth *has* to set the
brightness, it could ;).

Patch only actually needed on Kobo, as all Cervantes devices with warmth
support have a mixer, which mean they *can* set the warmth without
affecting the brightness ;).
2019-04-21 20:46:29 +02:00
Martín Fernández
a69c09a275 [Android] do not log verbose blitbuffer messages on release builds, unless specified in settings.lua. Keep debug builds as they are (#4933) 2019-04-17 20:04:07 +02:00
NiLuJe
717db55566
Some more FL fixes when we start with the FL off (#4924)
* Don't override hw_intensity when we start with the FL off
* And add an insane workaround to make the first toggle behave sanely in this case.
* And also handle the sneakier case where the first toggle happening would not be manual, but triggered by a suspend/resume cycle.
2019-04-16 00:04:29 +02:00
NiLuJe
33946aa732
Some FL regression fixes after #4901 (#4921)
* Make hasNaturalLight* caps safe to call without a device check. (fix #4919)
Make it clear that it's expecting the NTX implementation, though.
* Don't turn the FL on on resume if it was off on suspend
* Make sure turnOn/turnOff actually updates hw_intensity in the process where it matters, instead of just in a short lived fork ;). (fix #4923)
2019-04-15 20:06:24 +02:00
NiLuJe
f63ca005c6 [fix] Update AutoWarmth state on resume (#4901)
Regression since #4871
Fix #4895

* Hide the "Configure" button in the FL/NL widget on devices where it
won't do anything

(i.e., those w/ a NL mixer).
2019-04-12 22:46:10 +02:00
NiLuJe
4005bf69aa
Slightly less crappy Nightmode (#4871)
Companion PR to https://github.com/koreader/koreader-base/pull/884
* Basically flags devices known to be stable when using PxP inversion.
* Plus, random fix for #4870 ;).
* A few FrontLight tweaks & cleanups on Kobo:
  * Moved the Kobo-specific startup status insanity to Kobo-specific init
  * Made turnOff/turnOn frontlight do a smooth ramp down/up
  * On Kobo, use turnOff/turnOn for suspend/resume, to get that smooth toggle
  * On Kobo, for NaturalLight w/ a mixer, only set warmth for setWarmth, and only set Brightness for setBrightness, otherwise, it tried to set both with not in-sync values, which made the FL widget jittery.
2019-04-08 23:05:08 +02:00
Martín Fernández
dde301e765 [Android] use the same tag for all logs (#4862) 2019-04-01 15:48:10 +02:00
Frans de Jonge
709207a621
[feat, UX] Add external link to Wallabag (#4863)
Offers a choice when Wallabag is available.
2019-03-31 19:19:07 +02:00
NiLuJe
7210fb478d
Faster blitting @ BB8/BBRGB32 when no processing is needed (#4847)
* Pickup the eponymous blitting performance tweaks from koreader/koreader-base#878
* Cleanup BitOpts usage (require & cache)
* Unify oddness checks (MOD -> AND)
* Enforce the native Portrait orientation on Kobo (except @ 16bpp, i.e., KSM w/ 8bpp swap disabled), to allow for faster blitting when unrotted.
* Switch CRe BB to 32BPP on color screens
* Minor cleanups
2019-03-27 22:50:44 +01:00
NiLuJe
04f5bc7823 Remove the Aura SE viewport
This feels somewhat arbitrary and potentially unneeded,
and it'll prevent full blits, so, off it goes.
2019-03-27 17:34:41 +01:00
NiLuJe
9ecc2dd119 There's no viewport on the H2O²
Fix #4834
2019-03-27 17:34:41 +01:00
Galunid
5f44ef5dad [feat] Kindle suspend using lipc (#4825)
Fixes problems with making Kindle go to sleep using menu or gesture manager action.
2019-03-21 11:52:58 +01:00
Frans de Jonge
2f65fb94ec
[Android, UX] Add Device:openLink() implementation (#4824)
Fixes https://github.com/koreader/koreader/issues/4821

Same as https://github.com/koreader/koreader/pull/4822

Thanks to @pazos who implemented the Android backend, see https://github.com/koreader/android-luajit-launcher/pull/133
2019-03-20 17:28:19 +01:00
Frans de Jonge
b1ed2838c8
[UX] Add Device:openLink() stub for Linux SDL (#4822)
References #4821.
2019-03-20 16:58:32 +01:00
Frans de Jonge
728bb187fa
[UX] Gesture manager: add two-finger swipe left and right (#4815)
Also add Device:hasMultitouch() to control whether the configuration menu is shown.

Cf. #4727.
2019-03-19 20:18:38 +01:00
Frans de Jonge
e357165f17
[fix] GestureDetector: fix typo in ges_coordinate_translation_90 (#4804)
Fixes #4803.
2019-03-15 19:53:15 +01:00
NiLuJe
2011cf1ad1 Various blitting related cleanups (#4789)
* Fix the "Enable debug logging" checkbox so that it properly disables "Enable verbose debug logging" when it gets disabled
* Avoid asking ImageWidget for alpha-blending when it's not useful
* Make ImageWidget's alpha-blending code-path double-check that alpha-blending actually is needed, and avoid it if possible
* In the same vein, only do alpha-blending in textboxwidget when absolutely necessary
* Prefer color constants over the gray() method, ensuring that they're part of the eInk palette

Depends on https://github.com/koreader/koreader-base/pull/853

Fix #4774
2019-03-14 20:58:45 +01:00
NiLuJe
fdf92e13ea
Remove the Kobo-specific 16bpp JIT loopunroll tweak (#4784)
* Remove the Kobo-specific 16bpp JIT loopunroll tweak
It's now generic, and handled in ffi/blitbuffer.lua directly.
2019-03-14 04:48:03 +01:00
tob1az
89c17092e8 [feat] PocketBook: implement Wi-Fi connection toggling (#4775)
Partially resolves #4747. Will enable switching Wi-Fi on/off in the menu and getting the network status. However, a new Wi-Fi session lasts ~100 seconds and then terminates automatically, apparently, to save the energy. I believe it can be prolonged by some networking activity. Also it is not shut down if the auto suspension is disabled.
2019-03-12 07:05:43 +01:00
Qingping Hou
fc69257660 fix: auto dpi menu checkbox display (#4771) 2019-03-11 10:01:37 +01:00
NiLuJe
7c2df53808
Update FBInk (#4765)
* Add a bit of logging before fbdepth calls, to make the progression
easier to grasp.
* Bump base (pickup FBInk update)
2019-03-10 00:59:49 +01:00
Frans de Jonge
2cbec1b54e
[fix] Add fake delayed pan to SDL scroll event (#4758)
Not actually delayed. Avoids a crash otherwise caused by #4666.
2019-03-08 19:39:50 +01:00
Martín Fernández
fda231adcd scheduleIn actions needed to open a new file from an intent on resume, to provide feedback since we cannot blit to the window yet 2019-03-05 20:46:47 +01:00
Martín Fernández
39be43ad84 do not refresh eink on activity changes, system will do that! (#4735) 2019-03-05 12:25:04 +01:00
Qingping Hou
4b7d5c82b7 fix: update gesturedector constant for custom screen dpi 2019-03-05 01:17:37 -08:00
Frans de Jonge
c5b2bad6d6
[fix] Allow overriding low pan rate on E Ink device (#4729)
Cf. #4721.
2019-03-04 19:15:00 +01:00
Frans de Jonge
17fa07ee43
[fix] GestureDetector: deep copies of events for multiswipes when rotated (#4728)
Fixes #4724.
2019-03-04 19:01:01 +01:00
Martín Fernández
5e01a0c264 android: hasColorScreen depends on hasEinkScreen 2019-03-03 16:06:39 +01:00
Martín Fernández
f8c71f6a45 disable low_pan_rate on non e-ink devices by default 2019-03-03 16:06:39 +01:00
Qingping Hou
1605409c60 rename runtimectl to document/canvascontext 2019-03-03 13:10:45 +01:00
Qingping Hou
adb5d5a52c use screen for UI color control 2019-03-03 13:10:45 +01:00
Qingping Hou
855c8c2569 add dummy device & rename runtimectl:setDevice to runtimectl:init 2019-03-03 13:10:45 +01:00
Qingping Hou
02eca23649 decouple device from document modules 2019-03-03 13:10:45 +01:00
NiLuJe
bb3f49a566 [feat, Kobo] On Kobo, drop fb to 8bpp on startup (#4637)
* The Great 8bpp Experiment

Swap to 8bpp on Kobo, because we're 'effing grayscale, for pete's sake!

* Always swap to 8bpp, no matter the launch method.

Because it turned out that, even when restarting Nickel, we had to
restore the expected bitdepth ourselves, because pickel/Nickel didn't do
the job completely.

(I'm going to guess the grayscale flag wasn't getting flipped properly).

* Dither every non-transparent icon to the eInk palette

* Make sure hasBGRFrameBuffer is only enabled when the Kobo fb actually is
@ 32bpp...

* Re-process badly grayscaled icons

* And re-grayscale that one w/ gamma correction so the squares show up
better.

* Allow the fbdepth switch to be disabled (in Developer settings).

Also, allow setting debug mode that way.

Also, forcibly disable verbose logging when disabling debug.

* Update setting name to piggyback on the existing check in reader.lua

* Update icons postprocessing info
2019-03-03 12:31:55 +01:00
Martín Fernández
be407d1059 [Android] Disable ota updates on fdroid builds 2019-03-03 11:47:52 +01:00
Frans de Jonge
ab53d798e5
[UX] GestureDetector: add diagonal multiswipes (#4704)
Multiswipes consisting of mixed straight and diagonal strokes are not dependable and too easy to mess up, but making them mutually exclusive seems to work out quite well.
2019-03-02 13:22:44 +01:00
Frans de Jonge
d8845f8589
[fix] GestureDetector: only initiate multiswipe with clear N/S/E/W direction (#4698)
Accidentally lost while refacturing. See <https://github.com/koreader/koreader/pull/4640#issuecomment-468788986>.
2019-03-01 21:47:45 +01:00
Frans de Jonge
4547b2d65f
[fix] GestureDetector: add PAN_DELAYED_INTERVAL (#4666)
When multiswipes are enabled, this fixes the long-standing complaint that swiping to open the menu could unintentionally trigger some light panning. With the introduction of multiswipes, this problem has become more noticeable.
2019-02-28 23:49:23 +01:00
Frans de Jonge
abba7ba873
[fix] TimeVal: add dbg:guard against incorrect subtraction order (#4669)
In principle, any negative subtraction result should be caused by a logical error.
2019-02-27 22:20:47 +01:00
Frans de Jonge
d090f3e651
[fix, UX] GestureDetector: fix multiswipe length detection (#4649)
Reported by @poire-z, cf. https://github.com/koreader/koreader/pull/4640#issuecomment-466544922

Apparently it's natural for me to make the second swipe slightly longer than the first, so I never noticed a logic issue. I did notice that it seemed slightly harder to make 4-swipe multiswipes than I expected it to be, but those are not necessarily easy gestures to make.

The problem was that I needed to prevent obviously silly gestures like west west west east. In ignoring such duplication, what I accidentally did was to ignore any further movement west after the first multiswipe direction was detected, meaning that the following swipe east could still end up as a relatively western movement overall.

By simply updating the current multiswipe slot in case of the same direction, both problems are prevented. We'll never get the same direction twice, and X moves over to where it's supposed to be on the left.
2019-02-23 21:34:03 +01:00
Martín Fernández
0532d7a507 [Android] (re)enable update downloads using full apks (#4639) 2019-02-23 14:25:29 +01:00
Frans de Jonge
260427d226
[fix] GestureDetector: fix multiswipe direction detection code (#4640)
Unfortunately a mistake snuck into the final steps of refactoring <https://github.com/koreader/koreader/pull/4607>.

Thanks to @poire-z for pointing it out [here](https://github.com/koreader/koreader/pull/4607#issuecomment-464856789).
2019-02-22 12:36:03 +01:00
Frans de Jonge
8e5c1addf5
[feat] Update check (#4620)
The concept is quite simple: stick a file on the OTA server named
something like `koreader-appimage-latest-stable` (by analogy with
`koreader-cervantes-latest-stable.zsync`), which contains nothing
but a filename.

The difference with the zsync update is that the link is then launched
in the user's browser (AppImage) or DownloadManager (Android, not yet
implemented).

* Android hasOTAUpdate = no for the moment
2019-02-21 08:26:48 +01:00
NiLuJe
5495c5d108 [fix] Fix partial refresh when coming out of ScreenSaver in landscape (#4622)
When we rotate to show a screensaver, restore original rotation *before* closing the ScreenSaver window.

And ensure closing the ScreenSaver *always* triggers a full update, no
matter the settings.

Fix #4621
2019-02-19 18:17:58 +01:00
Frans de Jonge
c09045efcd
[fix] GestureDetector: multiswipe rotation (#4613)
Reported by @poire-z in <https://github.com/koreader/koreader/pull/4607#issuecomment-464622906>.

Also refactor slightly along the way to make the translations more straightforward.
2019-02-18 16:42:34 +01:00
Martín Fernández
b6683b7a9f android: update wifi menus 2019-02-18 14:32:35 +01:00
Martín Fernández
4ab7e367b5 strings, not ints 2019-02-18 14:32:35 +01:00
Martín Fernández
04e17424d0 display network settings based on device capabilities + fix android basic network info 2019-02-18 14:32:35 +01:00
Frans de Jonge
f3a36f8285
[fix] GestureDetector typo (#4612) 2019-02-18 09:18:10 +01:00
Frans de Jonge
0adbd510c1
[feat] GestureDetector: add multiswipes (#4606)
The basic idea is that you gain an infinite amount of extra gestures,
although in practice you're probably mostly limited to your 16 basic
two swipe combinations and maybe a few three swipe ones.
2019-02-17 21:09:09 +01:00
Martín Fernández
301aa580cc cervantes: add usb storage on devices w/updated 3rd party tools 2019-02-16 17:32:43 +01:00
Martín Fernández
51ce6664e5 move Cervantes4 to new natural light interface, like Kobo Forma and Kobo ClaraHD 2019-02-16 17:32:43 +01:00
NiLuJe
134998a323 [fix] Eliminate ghosting on eInk when showing an image ScreenSaver (#4591)
* Flash a white screen before showing a screensaver image, to prevent
ghosting.

* Really limit the white flash to full-screen images

* Limit that behavior to eInk screens

(Not that clear() is implemented anywhere else, but, still).
2019-02-14 20:23:28 +01:00
NiLuJe
011370882f [chore] Some Wi-Fi tweaks (#4564)
* On Kobo, kill WiFi on startup if we detect an inconsistent state...

Untested, not terribly pretty.

The other solution is to slow down the Wi-Fi meny by doing the same
check for the "Wi-Fi connection" checkbox as in the later wifi_status
one...

* Don't enable auto_restore_wifi by default

It's liable to silently murder batteries for no good reason, given that
we prompt to enable WiFi by default when needed, and we otherwise have
no actual need to keep WiFi on in the background.

re #2215 (in particular, this directly contradicts @houqp in
https://github.com/koreader/koreader/pull/2215#discussion_r74696133 ;)).
2019-02-08 22:29:11 +01:00
NiLuJe
abc6d17a25
A few minor fixes after #4541 (#4561)
* Enforce dithering in PicDocument
* Ensure we'll get a flashing update on ScreenSaver exit
2019-02-08 18:31:40 +01:00
Frans de Jonge
e6b3542bdb
[fix, Android] hasEinkScreen should be a function (#4557)
Fixes https://github.com/koreader/koreader/pull/4541#issuecomment-461739983
2019-02-08 10:45:09 +01:00
NiLuJe
812e595608
Enable HW dithering in a few key places (#4541)
* Enable HW dithering on supported devices (Clara HD, Forma; Oasis 2, PW4)
  * FileManager and co. (where appropriate, i.e., when covers are shown)
  * Book Status
  * Reader, where appropriate:
    * CRe: on pages whith image content (for over 7.5% of the screen area, should hopefully leave stuff like bullet points or small scene breaks alone).
    * Other engines: on user-request (in the gear tab of the bottom menu), via the new "Dithering" knob (will only appear on supported devices).
  * ScreenSaver
  * ImageViewer
* Minimize repaints when flash_ui is enabled (by, almost everywhere, only repainting the flashing element, and not the toplevel window which hosts it).
  (The first pass of this involved fixing a few Button instances whose show_parent was wrong, in particular, chevrons in the FM & TopMenu).
* Hunted down a few redundant repaints (unneeded setDirty("all") calls),
  either by switching the widget to nil when only a refresh was needed, and not a repaint,
  or by passing the appropritate widget to setDirty.
  (Note to self: Enable *verbose* debugging to catch broken setDirty calls via its post guard).
  There were also a few instances of 'em right behind a widget close.
* Don't repaint the underlying widget when initially showing TopMenu & ConfigDialog.
  We unfortunately do need to do it when switching tabs, because of their variable heights.
* On Kobo, disabled the extra and completely useless full refresh before suspend/reboot/poweroff, as well as on resume. No more double refreshes!
* Fix another debug guard in Kobo sysfs_light
* Switch ImageWidget & ImageViewer mostly to "ui" updates, which will be better suited to image content pretty much everywhere, REAGL or not.

PS: (Almost 💯 commits! :D)
2019-02-07 01:14:37 +01:00
Martín Fernández
19d13b1876 [feat, Android] Add basic support for android eink refreshes on some rockchip devices (#4517)
Supported devices:

- Boyue T61 and *some* clones
- Boyue T62 and *some* clones
- Onyx C67
- Energy Sistem (which are in fact Boyue T62 clones). Was tested on a energy pro 4.

Others may work with the same controller too, but are disabled by default.

Requires https://github.com/koreader/koreader-base/pull/798
Requires https://github.com/koreader/android-luajit-launcher/pull/96

Fixes #4373 
Fixes #1613 (supported devices will show the "full refresh rate" option under eink settings. Others won't)

Related #4228 (need to add support for this specific device to work)
2019-02-01 09:18:27 +01:00
Martín Fernández
67644f6200 [chore, Kobo] Move Clara HD to frontlight mixer (#4531)
Move Clara HD to same interface used in the Forma.

Fixes #4523

The same should apply to other devices without green leds, but needs testing.
2019-01-31 14:55:14 +01:00
Martín Fernández
6b3158e497 android: disable wakelocks by default 2019-01-22 14:27:14 +01:00
NiLuJe
81b255cb85 Better-than-nothing key repeat handling.
Mainly aimed at the Forma.
Still fairly terrible, as these things goes ;p.
2019-01-20 23:05:25 +01:00
NiLuJe
cd4181ba49 Fix WiFi status on Kindle
WiFi handling is handled asynchronously (deferred to lipc), so this is a
bit clunkier than on devices where we handle WiFi ourselves...

But, basically, try to honor the menu callback when toggling WiFi so
that the status gets updated in the menu.

Fix #4472
2019-01-20 23:05:25 +01:00
Martín Fernández
b15c2ed0c5 [Android] misc fixes (#4478)
* use product as device model
* print android version (codename + number) + api at launch
* exit the application properly
* fix fullscreen switching (and disable it on newer android versions)
* gettext: lower log level for message: cannot open translation file
* android common settings refactor
2019-01-17 21:44:15 +01:00
poire-z
a245630422 Implement generic internal clipboard for all devices
Will allow copying selected text from a book to the TextEditor.
Will be overriden on devices that implement interactions with
the system clipboard.
2019-01-15 23:56:11 +01:00
NiLuJe
c327069f43
Set actual model names on PB devices (#4479)
* Set an actually useful model name for PocketBook devices
* Pickup yet another PB fb setup fix ;).
2019-01-14 00:49:29 +01:00
Frans de Jonge
2cb4be7cad
[fix] PocketBook 626 new firmware with new codename (#4474)
Might need to be repeated for the others?

Fixes #4473.
2019-01-13 12:34:53 +01:00
Martín Fernández
ab09dedf33 open new files from intent 2019-01-11 22:12:00 +01:00
Martín Fernández
2009ffa12f android: keep screen awake toggle (using wakelocks) & bump luajit-launcher 2019-01-10 22:57:37 +01:00
NiLuJe
bc8d92c5d9 Detect the PocketBook Basic Touch 2 (PB625)
AFAICT, Pearl -> Carta, but same resolution/feature set.

Fix #4366
2019-01-09 03:19:06 +01:00
Sergey Avseyev
973e61557b [cervantes] automatically restore wifi connection (#4463) 2019-01-08 21:03:05 +01:00
Sergey Avseyev
12c8d4fd17 [cervantes] wifi: try to connect to known network before listing (#4462)
Defines new function reconnectOrShowNetworkMenu(), which iterates over
available networks ordered by signal power, and check if we can connect
to saved SSIDs. If we can, then skip network list dialog.
2019-01-08 16:54:21 +01:00
NiLuJe
d113cb9475
A few Kobo input tweaks (#4450)
* Fix the Touch input probe on Trilogy devices that depend on the touch_probe_ev_epoch_time quirk (fix #630)
* Expose a "Pageturn button inversion" feature in the Navigation menu (for all devices with keys) (fix #4446)
* Allow ignoring the accelerometer on the Forma (Screen > Ignore accelerometer rotation events; also available from the Gesture Manager) (fix #4451)
* Fix SleepCover handling on the Forma (fix #4457)
* Make isWifiOn a tiny bit more accurate (check the actual WiFi module instead of sdio_wifi_pwr)
* Move all flash related Screen options to the eInk submenu
2019-01-08 02:59:47 +01:00
NiLuJe
cc9f58687a [Kindle] Handle the two newish Indian PW4 variants (#4459)
xref: https://www.mobileread.com/forums/showthread.php?t=314156
2019-01-07 20:33:37 +01:00
Viktor Sokyrko
ea424e621e Add PB641 aka Aqua 2 support (#4445)
Add Pocketbook 641 aka Aqua 2 support.
It has 212 ppi. The model code detected is 641.
Tested on real device, works well.
2019-01-05 09:02:45 +01:00
Martín Fernández
6de5927dc2 [build] Add support for Debian packages (#4434)
* Add support for Debian packages

* SDL: add device probe
2019-01-03 18:21:35 +01:00
NiLuJe
f6743a45db
Proper Forma support (#4414)
* Enforce a known rotation on startup, to make sure we handle touch input coordinates properly.
* Proper FrontLight warmth support (thanks to @cairnsh & @pazos in #4291)!
* Fix the PageTurn buttons mapping to match Nickel's defaults
* Properly remap PageTurn buttons depending on the current rotation.
* Actually enable the Mk.7 screen refresh codepath on *all* Mk.7 devices (I'd messed up the device check...).
* Full accelerometer handling (includes a touch of refactoring regarding orientation handling in general).
* Fix insidiously broken USBMS behavior in Nickel after we exit on FW >4.8.

Fix #4291
Fix #3002
2018-12-28 04:32:42 +01:00
jperon
8e575a5f3b Add support for PocketBook Touch HD Plus (#4419) 2018-12-26 00:56:02 +01:00
NiLuJe
f020b1264a
A few Kindle fixes (#4394)
* Implement isWifiOn on Kindle (fix #4380)
* Ensure frontlight intensity is properly restored on resume on Kindle. (fix #Fix #4392)
Only actually matters when the frontlight is *off*.
2018-12-10 22:10:35 +01:00
patrick-tang
a2e7e62be7 Fix wrong keymapping for Forma (#4376) 2018-12-07 13:53:53 +01:00
wsotest
7841351a81 Added support for pb627 (touch lux 4) (#4362) 2018-11-26 15:19:00 +01:00
mbab
c5ff3dcca1 Add support for PocketBook 630 (#4357) 2018-11-23 13:33:43 +01:00
NiLuJe
f6fb2ded5d Fix frontlight sysfs path on the PW4 (#4350)
Fix toggling the FL on/off (as that's the only instance we're not using
lipc)
2018-11-20 19:46:53 +01:00
Martín Fernández
6a844136cf [Cervantes]: wifi fix & misc improvements. (#4341)
* remove unused setting 'internal_storage_mount_point

use filemanagerutil.getDefaultDir() instead
https://github.com/koreader/koreader/blob/master/frontend/apps/filemanager/filemanagerutil.lua#L15

* more info about device frontlight/naturalLight capabilities

* make stock reader fonts available in KOReader

* remove restore-wifi-async leftovers

* wireless: fix wpa_supplicant configuration:

make it compatible w/ debian wheezy binaries
don't try to run enable-wifi.sh more than once
2018-11-16 10:21:57 +01:00
NiLuJe
bd6c852cc8
Fix Kindle FW detection (#4336)
* Fix version comparisons...
2018-11-14 22:58:04 +01:00
NiLuJe
772cdefe92
Support the Kindle PW4 (#4324)
* Fix version checks on FW >= 5.10.x
* Bump base
2018-11-11 02:05:38 +01:00
NiLuJe
419769d07e
Initial Kobo Forma support (#4325)
* Initial Kobo Forma support

re #4291
c.f., https://www.mobileread.com/forums/showpost.php?p=3771404&postcount=2994
& https://www.mobileread.com/forums/showpost.php?p=3772378&postcount=2998

Big fat warning: something is *definitely* rotten in the state of
Denmark:

* FrontLight/NaturalLight might need some more testing/tweaks
* Rotation (initial or accelerometer-induced) is *NOT* handled.
  This'll require someone with an actual Forma, shell access,
  and a bit of courage, because rotation is hell.
  Programming chops greatly appreciated!
2018-11-11 01:01:08 +01:00
Martín Fdez
4e1a4978cc wireless: read wireless carrier from sysfs 2018-11-10 16:00:03 +01:00
Martín Fdez
56a1b14418 remove spaces from model names 2018-11-10 16:00:03 +01:00
frio
4ae43aee2c [fix, cervantes] Old Cervantes devices should return false for hasNaturalLights (#4320) 2018-11-10 11:31:24 +01:00
Martín Fernández
1e69fae7bc [feat] Add support for BQ/Fnac devices (#4294)
Adds support for devices found in https://blog.bq.com/es/bq-ereaders-developers-program/. Tested on BQ Cervantes 4 (last BQ device from 2017).

It adds a new touch input event handler (discussed in #4275) which should work on other single touch devices (ie: Kobo Touch, Mini, Glo, Aura HD) but wasn't tested.

Includes base bump with: [feat] Add BQ/Fnac device support (https://github.com/koreader/koreader-base/pull/745)
2018-10-31 23:48:36 +01:00
Martín Fernández
29835b3072 [chore] Refactor sysfs_light (#4283) 2018-10-27 22:49:18 +02:00
Martín Fernández
717184f1d6 move e-ink related settings to a submenu (#4246) 2018-10-10 21:34:47 +02:00
Martín Fernández
b8d95984d1 [UX] Show OTA updates only on supported devices (#4256) 2018-10-06 07:55:35 +02:00
Thomas Rebele
1e275fdc4f Add support for Pocketbook Color Lux (#4212)
* Pocketbook Color Lux detection

* fix rotation for Pocketbook Color Lux

* deal with 24bit RGB framebuffer that are reported as 8bit

* use default DPI for Pocketbook Color Lux

* bump base
2018-09-30 21:37:14 +02:00
Matias N
94d8f2d397 Sony PRSTUX support (#4198)
* Sony PRSTUX support
2018-09-08 01:37:04 +02:00
NiLuJe
5f4841e277
Tweak JIT's loopunroll threshold on Kobo 16bpp (#4157)
* Tweak JIT's loopunroll threshold on Kobo 16bpp
    To avoid early blacklist of the blitbuffer code on alpha-blending
    workloads.
    Least terrible workaround we could come up with to "fix" #4137

* gzip kindle/kobo/pb OTA tarballs w/ --rsyncable
    Should make them more zsync friendly.
2018-08-12 20:01:04 +02:00
Robert
225b5d417d Adds ReaderDeviceStatus: low battery alarm (#4144) 2018-08-11 22:47:33 +02:00
NiLuJe
c1965ea8a9
Don't rotate on suspend for Kobo/PB when we're showing something news (#4111)
that's not full-screen (i.e., "message" ScreenSaver mode).

Fix #4098
2018-07-26 00:46:52 +02:00
NiLuJe
fea0d8dbaf
Another set of fixes (#4083)
* Make findcalibre actually useful

By setting SEARCH_LIBRARY_PATH when a Calibre tree is found, so that
book paths can properly be constructed.

Users should still very much set it themselves, but at least everything
works as intended when not, instead of mysteriously half-breaking later.

Drop the SetDefaults bits, it appeared to have been added to fix no-ops
detected by Luacheck, and it's actually non-functional, because
SetDefaults doesn't handle saving variables it did not itself assign.
So this was just causing the "Do you want to save new defaults" popup to
show up on exit, but it couldn't actually do anything useful (like, say,
save the new SEARCH_LIBRARY_PATH value).

fix #4082

* Better comments about the state of NaturalLight on the Clara, and how this might translate to the H2O²r2.

re #4015

* Make ScrolltextWidget refresh as "partial" only on actual Scroll events

Moving the cursor should stay "ui", or things gets annoying really fast
;).

re #4084

* Bump base to pickup ZMQ fixes (fix #4086)
2018-07-21 21:51:25 +02:00
NiLuJe
464672108e
Misc. minor fixes (#4080)
* Unbreak dropbear after #4077
* Move the Kindle SO check to init
* Various virtual keyboard fixes to eradicate the remaining refresh conflicts (i.e., tearing artifacts), no matter the user's settings. (re #4069, re #3130).
2018-07-16 17:24:04 +02:00
NiLuJe
8089d916a5
Visual feedback around tar/zsync on Kobo during OTA updates (#4043)
* With a bonus version normalizer fix.
  * And a zsync bump/fix to avoid softlocks with OpenStack HTTP frontends (also, pull those from the OTA mirror list).
2018-07-03 23:16:45 +02:00
NiLuJe
2d44baa561
Fix Android nightlies (#4038)
* Also, bonus KOA2 fix (third time's the charm!)
    Fix #3695
2018-07-02 00:23:18 +02:00
NiLuJe
e2a0929c51
Better KOA2 support (#4037)
* Better KOA2 support
    * Fix FL
    * Add physical pageturn keys
    * Add accelerometer support
* Possibly better NaturalLight handling on the Clara
* Fix WiFi module name used in some(?) Mk7 Kobos
* A bunch of kodev fixes
2018-07-01 17:35:12 +02:00
NiLuJe
2f3d1c80dd
Minimal KOA2 support (#4016)
* Minimal KOA2 support
(Touch, Screen, Battery). Hopefully :).
2018-06-23 18:08:11 -04:00
NiLuJe
18db509325 Assorted bag of fixes (#4014)
* Link to the WiKi, it's a bit more explainy ;).

* More WiFi trickery for some HW revs

* Fix Rev2 detection under KSM

That's to future-proof it, the other end of this hasn't made it into
current KSM build yet.

* Resync nickel.sh w/ current rcS

We don't have CPU, but we have PLATFORM, which is based on CPU, so,
that'll do :).

* Go back to using rmmod instead of modprobe -r

Functionally identical on current FW, will potentially avoid getting
outsmarted by modprobe if Kobo ever deigns shipping an actually usable
Linux system one day...

* Don't crash if screensavers directory doesn't exist

c.f., https://www.mobileread.com/forums/showpost.php?p=3706979&postcount=2919
2018-06-16 23:05:20 +02:00
NiLuJe
586b42aa20 Kobo Clara HD support (#4004)
Thanks to https://www.mobileread.com/forums/showpost.php?p=3702997&postcount=291

* Possibly saner H2O²r2 Touch protocol handling

re #3925

* Proper fix for H2O²r2 touch protocol.

Thanks to https://www.mobileread.com/forums/showpost.php?p=3704325&postcount=2904
2018-06-10 14:46:29 +02:00
NiLuJe
5871132c25
UI Behavior tweaks (#3983)
* Switch all initial highlights to "fast" update

i.e., everything that does an invert
Plus a few other things that refresh small UI elements onTap
Re #3130

* Tweak refreshtype for a number of widgets:
  * Fix iconbutton dimen
  * Make touchmenu flash on close & initial menu popup. Full-screen on close.
  * Use flashing updates when opening/closing dictionary popup. Full-screen on close.
  * Switch FileManager to partial.
    It's mostly text, and we want flash promotion there.
  * Make configdialog & menu flash on exit
  * Make FLWidget flash on close
  * virtualkeyboard: flash on layout change & popup.
  * Potentially not that great workaround to ensure we actually see the
highlights in the FM's chevrons
  * Flash when closing BookStatus Widget
  * Optimize away a quirk of the dual "fast" update in touchmenu

* Promote updates to flashing slightly more agressively.

* Document what each refreshtype actually does.

With a few guidelines on their optimal usecases.

* Switch remaining scheduleIn(0.0) to nextTick()

* Tighter scheduling timers

Shaving a hundred ms off UI callbacks...

* Cache FFI C Library namespace

* Ask MuPDF to convert pixmaps to BGR on Kobo

Fix #3949

* Mention koxtoolchain in the README

re #3972

* Kindle: Handle *all* fonts via EXT_FONT_DIR instead of bind mounts insanity

* Make black flashes in UI elements user-configurable

(All or nothing).

* Jot down some random KOA2 sysfs path
2018-06-02 12:10:55 -04:00
NiLuJe
0dbdd2f61f
Try to inhibit USBMS on Kindles (#3957)
re: #3955
2018-05-18 12:54:44 -04:00
NiLuJe
68c1246575
A round of Kindle fixes (#3955)
* Refresh Kindle model ID routines

* Pickup current OTA packages

We stopped shipping files w/ the full .tar.gz extension a looooong time
ago.

* And actually generally handle current packages properly

* Kindle screensaver handling experiment

WIP, because there's a fair bit of insanity left in there.
Namely, USBMS is anathema. We simply shouldn't do that, at all,
but the system allows us to do it and basically shoot ourselves in the
head one way or another.

* Don't try to handle the insanity that would be USBMS on Kindles

* Yay, one less thing to worry about :).

* Okay, that should be much saner...

Since the whole deal w/ letting the WM handle stuff was for SO, restrict
that to SO devices.
The other concern was USBMS, but we can't support it.

* Reword that

* And move that comment inside the branch, like its counterpart
2018-05-16 17:26:27 -04:00
NiLuJe
e3b7524d9c Another round of Kobo Fixes (#3939)
* Trim unneeded stuff from startup script

I was somehow convinced I'd already done that...
While we're there, explain why we need to siphon those specific vars

* Fix a stray eth0

-> $INTERFACE

* Be very very sure we have INTERFACE set in our env

re #3936

* Make getFirmwareVersion less fragile on Kobo

Not that we actually use it right now, but, still. :D

* Use the same syntax as the PRODUCT check

* Actually implement getProductId

Instead of a stray c/p ^^

* Properly identify the Rev2/Mark7 variants of existing devices

Namely, the H2O² and Aura SE
Not that the H2O²r2 support is still broken, this just allows us to
implement it cleanyl without breaking handling of the original H2O²

re #3925

* Tweak sleeps a bit around Kobo WiFi modules...

See if that jog things up (re #3936)

* Try harder not to suspend with WiFi on on Kobos

Because otherwise, things go boom. (re #3936)
2018-05-10 12:26:07 +02:00
mezzarobba
a3e16b3920 [fix] make wifi control work with my Kobo Touch N905 (#3920) 2018-05-01 14:49:37 +02:00
onde2rock
dad7f209fa [CI] Add a check to detect tab in lua files (#3919) 2018-04-29 15:15:11 +02:00
NiLuJe
95bc5d7081 [fix] tar args order & Kobo IR grid regression (#3895)
* Fix order of tar args

Otherwise, current tar versions abort

* Unbreak Kobo IR grid resume workaround

Regression after f402ee5f6f

I'm going to assume my H2O is really, really weird, because that
commit's more than a year old o_O.
2018-04-19 21:08:55 +02:00
Frans de Jonge
88dee4194d
[feat] SDL2: add window icon (new logo) (#3884)
Also update Ubuntu Touch icon

Fixes #2000, fixes #3858
2018-04-15 23:39:42 +02:00
David Engster
7c527aa5dd [chg] kobo/powerd: Keep max. warmth 2h after bedtime (issue #3825)
Keep max. warmth for 2h after bedtime, and then start reducing for 2h,
so that 4h after bedtime we have reached zero warmth.
2018-04-06 22:12:25 +02:00
David Engster
f8d43b5c09 [fix] kobo/nickel_conf: Remove redundant 'return nil' 2018-04-06 22:12:25 +02:00
Frans de Jonge
989e319af9
[PocketBook] Add Inkpad 3 (PB740) definition (#3830)
Fixes #3687

Thanks to @Maradar for testing, see https://github.com/koreader/koreader/issues/3687#issuecomment-378652074
2018-04-04 18:26:44 +02:00
Frans de Jonge
b4002dc9ce
[chore] device/input: migrate custom event map to settings dir (#3822) 2018-04-03 20:28:37 +02:00
Frans de Jonge
086ced07f9
[feat, UX] SDL: add Gtk3 filechooser (#3827)
The specifics for other implementations are easy to change in the backend.
2018-04-03 20:03:56 +02:00
Frans de Jonge
7f4be45d4e
[chore] Handle SDL_MOUSEWHEEL and less hackish SDL events (#3826) 2018-04-03 14:56:28 +02:00
David Engster
e80951413d [feat] kobo/powerd, kobo/nickel_conf: Saving of auto-warmth settings
Add support in nickel_conf to save/retrieve setting of
'autoColorEnabled', which is the automatic warmth feature in
Nickel. We do not support reading of 'BedTime', because it is encoded
as a QVariant. This setting is hence saved/loaded solely in/from
G_reader_settings.
2018-04-01 15:35:05 +02:00
David Engster
596e20e588 [feat] kobo/powerd: Support for automatic warmth
This is the first step to support "automatic warmth", meaning that
warmth will be set according to the current time. The user can set a
"bedtime" at which warmth should be maximal. Warmth will increase
towards approaching bedtime and decrease afterwards.

Add new members 'auto_warmth' and 'max_warmth_hour' which tell if this
feature is enabled and the "bedtime", resp. Add a method
'calculateAutoWarmth' which will set the current warmth according to
the current time. The progression is linear but not symmetrical: we
start 5h before "bedtime", but turn back warmth to '0' 2h after it, to
make sure that warmth is '0' in the morning.

For automatically setting warmth in the background we use the
backgroundrunner plugin, because not only is it more comfortable to
use, but we also cannot require 'uimanager' during device
initialization.
2018-04-01 15:35:05 +02:00
onde2rock
74a06d98a2 [chore] Code cleanup : deprecate the 'Enter' event, replaced with 'Press' (#3815)
'Escape' now do 'Back' on SDL
'Enter' now do 'Press' on SDL
2018-03-30 23:22:18 +02:00
Frans de Jonge
7e6de30889
[feat, UX] SDL2: drop file to open (#3793)
Includes:

* crengine: use cache files renamed as .cr3.keep https://github.com/koreader/crengine/pull/137
2018-03-22 19:13:54 +01:00
Frans de Jonge
f1aae6a03c [UX, fix] Redraw PdfDocument and DjvuDocument after resizing window 2018-03-19 21:19:23 +01:00
Frans de Jonge
24c0132744
[feat] SDL2: resize window (#3775)
References #1417 

Bumps base for https://github.com/koreader/koreader-base/pull/614

Also includes:
* Speedup loading from cache EPUB with many files https://github.com/koreader/crengine/pull/133
* Avoid rewriting cache file when no change were made https://github.com/koreader/crengine/pull/134
2018-03-18 21:32:39 +01:00
onde2rock
e8aab49ee9 Kindle4NT improvements (#3745)
* [device][kindle4] add fake event to kindle4

* modify focusmanager to allow for more complex layout

The focusmanager now naviguate the layout by avoiding nil value
instead of relying on table lenght. It should be completely backward
compatible

* add Dpad naviguation to the touchmenu

* fix crash because virtualkeyboard on non touch device

the kindle4NT has no keyboard nor touch, the fix open the virtual
keyboard so koreader dont crash but it's not useable

* Enable device with keys to use the touchmenu

* Don't get stuck in reader progress statistics plugin

* [underlinecontainer] Fix and remove unused function

References #1898.
2018-03-14 22:16:38 +01:00
David Engster
bfd55c76c2 device/kobo/powerd: Read natural light configuration
Define 'frontlight_settings' table for all Kobo devices, and read
configuration from settings file.
2018-03-13 22:09:29 +01:00
David Engster
a912e00aa3 device/kobo/sysfs_light: Make used exponent in formulas a variable 2018-03-13 22:09:29 +01:00
David Engster
effc7135a1 device/kobo/sysfs_light: Explicitly handle warmth/brightness = 0
For warmth and/or brightness = 0, we need to make sure that the
red/green/white LEDs are actually turned off, regardless of the values
for gain/offset.
2018-03-13 22:09:29 +01:00
David Engster
201370a220 device/kobo/sysfs_light: Use current brightness/warmth if none given 2018-03-13 22:09:29 +01:00
cairnsh
8a5b888789 [refactor] Input: added Input:addSlotIfChanged() (#3716)
Changed handleTouchEv, handleTouchEvPhoenix to use that
2018-03-04 19:15:46 +01:00
cairnsh
f74f19bd9f [feat] Make touch work on the H2O2 (#3715) 2018-03-04 18:31:46 +01:00
Frans de Jonge
68e63df442
[feat] Add H2O2 natural light (#3709)
See https://www.mobileread.com/forums/showpost.php?p=3664352&postcount=66
2018-03-02 23:03:00 +01:00
Frans de Jonge
857e88147f
[Kindle] Add preliminary support for Kindle Oasis 2 (#3698)
Screen refresh may still be broken.

References #3695.
2018-02-27 12:28:37 +01:00
Frans de Jonge
aadb81eb48
[feat] Add Android clipboard definition (#3479)
References https://github.com/koreader/koreader/issues/3441
2018-02-16 21:44:10 +01:00
David Engster
f77ce9bf7c kobo/powerd, kobo/nickel_conf: Support reading/setting natural light
Nickel stores the 'warmth' values as 'ColorSetting' in a linear
mapping from '1500' to '6400'.
2018-02-06 10:21:16 +01:00
David Engster
5c1f97eeb3 kobo/powerd: Use sysfs interface for natural light support
If the device has natural light support (currently only KA1), use the
sysfs interface instead of the ioctl-based one. It might also be
usable on other Kobo devices for setting brightness without natural
light, but since I cannot test this, this is currently restricted to
the KA1.
2018-02-06 10:21:16 +01:00
David Engster
7aefad6de9 kobo/device: Add field for natural light support
Currently, only the Kobo Aura One has natural light.
2018-02-06 10:21:16 +01:00
David Engster
6b4a548fe1 kobo: Add sysfs-based interface to frontlight
By default, the ioctl interface is used for accessing the
frontlight. However, the ioctl interface has two problems: the overall
brightness seems to be lower (issue #2321), and it does not support
the natural light support from the Kobo Aura One (issue #2285). This
interface is the first step to fix both these issues.

From observing Nickel's behavior, it appears the white/green/red
intensities are roughly linear dependent on the 4th root of brightness
and warmth values. This leads to a very quick increase of the
intensities for lower brightness/warmth values, which then saturate
for larger ones. The values for gain/offset were determined by a
simple linear regression, but the plan is to create a widget so that
users may adapt these values to their liking.
2018-02-06 10:21:16 +01:00
Fabian Müller-Knapp
88c03c08d1 Partial fix for 3477 (#3568)
Partial, as it will safe the state when suspending the reader by pressing the power-button.

However, it will still not safe the state when Pocketbooks autoPowerOff-Feature kicks in, as this does not create an event (e.g. no EVT_BACKGROUND) of any kind.

* Clean up device.lua

* Save state on suspend
2018-01-06 13:14:26 +01:00
Robert
efa0d06df9 Add new options to screensaver (#3535)
* Prevent open screensaver more than one in the same time

* Add option to enable/disable background in message screensaver

* fallback to random images if this book cover is excluded feature + fix Disabled (leave screen/page as it is)

* Autostretch disable by default, more fallback options, leave screen as it is
2017-12-17 18:27:24 +01:00
Fabian Müller-Knapp
279329227a Add PB623 alias Touch Lux (#3542) 2017-12-10 20:02:33 +01:00
Fabian Müller-Knapp
f0f59afcdd Added Pocketbook 624 alias Basic Touch (#3528)
Fix #3525
2017-12-02 10:28:11 +01:00
Frans de Jonge
021e3db002
kobo/device: finetune KoboStar (Aura 2) viewport (#3513)
See https://github.com/koreader/koreader/issues/2418#issuecomment-346287297 and  https://github.com/koreader/koreader/issues/2418#issuecomment-346426685
2017-11-24 17:15:37 +01:00
Frans de Jonge
06dfe4fb78
[feat] Add Device:hasClipboard() (#3465)
References https://github.com/koreader/koreader/issues/3441
2017-11-14 19:20:58 +01:00
Frans de Jonge
aa7d4f9751
[Kobo] Update H2O2 to nearly working touch. (#3481)
See https://www.mobileread.com/forums/showpost.php?p=3610605&postcount=24 for evtest output.
2017-11-13 08:38:42 +01:00
Fabian Müller-Knapp
8ef783fd1b Add PocketBook626 (#3472) 2017-11-07 20:51:52 +01:00
mwoz123
a01271b8a6 [Android] Wifi status in footer (#3396)
Implemented through the Android API so it's reasonably cheap.
2017-10-28 17:51:34 +02:00
Fabian Müller-Knapp
7009e98ee8 PocketBook: Basic device-detection / PocketBook631 (Touch HD) support (#3403)
Add basic device-detection via libinkview, support PocketBook631. Fixes https://github.com/koreader/koreader/issues/3312
2017-10-22 16:08:53 +00:00
Fabian Müller-Knapp
749112f57a [PocketBook] Use inkview-calls for battery-percentage/charging (#3402) 2017-10-22 15:49:48 +00:00
mwoz123
ff3d8f3df7 Android NetworkManager (#3386) 2017-10-21 20:27:09 +00:00
Frans de Jonge
ed3c0e707a [Kobo] Add preliminary Kobo Aura H2O2 definition (#3372)
Cf. ongoing discussion in KSM8 thread: https://www.mobileread.com/forums/showthread.php?p=3596020#post3596020
2017-10-18 22:42:59 -07:00
Frans de Jonge
6e52e559ae [fix, Android] Don't steal frontlight control on start (#3319)
I believe this should be `if isKobo()`, or better yet that the entire
block should be moved to `KoboPowerD:init()` because afaik that is the
only platform where the system doesn't provide trustworthy frontlight
information. But to be absolutely sure that I don't break anything (and I
don't want to spend any time on this atm) I'm temporarily excluding only
Android where this behavior is known to be problematic.

See discussion in https://github.com/koreader/koreader/issues/3118#issuecomment-334995879

References #3118 (using keyword "references" because phrases like "possibly fixes"
result in GH autoclose).
2017-10-08 16:40:24 +02:00
Frans de Jonge
bf61e6f093 [fix] Android frontlight control 2017-10-03 21:14:38 +02:00
Fabian Müller-Knapp
7d81aa5cf4 [feat] Pocketbook840 enable frontlight (#3294)
* Detect PocketBook840 by GetSoftwareVersion()

* implement Frontlight-support for 840 via inkview
2017-10-03 14:59:41 +02:00
poire-z
92e0067466 Enable color rendering on Android 2017-10-02 00:10:29 +02:00
poire-z
53f083f516 Allow for toggling color rendering
New menu item in Screen submenu.
hasColorScreen enabled for SDL device.
2017-10-02 00:10:29 +02:00
poire-z
180f5755f4 Allow for colored rendering (#3276)
* Allow for colored rendering

Available with all engines (CRE, PDF, Images).
Needs to manually add setting: "color_rendering" = true

* Disable color for djvudocument

* Use Screen:isColorEnabled()

* Bump base
2017-10-01 00:16:38 +02:00
Huang Xin
a4e1a3ba5e reflect changes in koreader/android-luajit-launcher#62 (#3254) 2017-09-24 05:58:34 +08:00
Robert
5258643a85 Add a date setting (#3234) 2017-09-18 19:04:36 +02:00
poire-z
0122c086f2 Fix crash on exit on Kobo devices with no frontlight (#3221) 2017-09-15 20:05:46 +02:00
Frans de Jonge
a39db783c0 [SDL] Add quit through regular window manager actions (#3206)
* [SDL] Add quit through regular window manager actions

Depends on https://github.com/koreader/koreader-base/pull/506

* proper exit and fix bug in restart function as a bonus
2017-09-11 21:37:00 +02:00
poire-z
d4fd0b9428 frontlight on kobo: a few fixes (#3163)
* frontlight on kobo: a few fixes

Rewritten to not update NickelConf on every change, and never
if KOBO_SYNC_BRIGHTNESS_WITH_NICKEL = false.
Reintroduce global settings frontlight_intensity and
is_frontlight_on to keep level and state across koreader
sessions.
Fix a few of the remaining issues on kobo light.
Ensure settings are saved when rebooting/powering off from
File browser.

* Ensure untoggle works when starting with light off
2017-09-04 21:05:05 +02:00
Robert
dbaea8c1c8 Refresh Kindle with SO on exit (#3168) 2017-09-03 15:49:08 +02:00
poire-z
c6cfed92d7 Fix kobo fl_min and frontlightwidget (#3143)
* Put back fl_min=0 as it is for all other devices (the idea
fl_min should be 1 and toggling managed some other way is
not implemented in current code).
* Fix a few frontlightwidget issues
2017-08-29 17:37:08 +02:00
poire-z
3159548f3e Avoid warning on input timeout on the emulator 2017-08-19 16:30:43 +02:00
Robert
7f58a13626 Ability to setup clock (#3085)
* Ability to setup clock
2017-08-15 19:54:02 +02:00
Frans de Jonge
06d7eea507 [Kindle] Add support for Kindle PW3 "manga" model
Model number either `0LK` or `0LL`

See discussion in https://www.mobileread.com/forums/showthread.php?p=3565878#post3565878
2017-08-11 00:05:32 +02:00
Hzj_jie
a8513c95b6 Several minor fixes (#3057)
1. Android.getScreenBrightness() is used in frontend/device/android/powerd.lua to retrieve the frontlight intensity.
2. kosync.koplugin won't save settings for whisper sync.
3. batterstat.koplugin won't work correctly if several on* events are fired.
2017-08-08 08:29:57 +02:00
robert00s
4651954364 Prevent liblipclua crashes 2017-07-25 09:51:53 +02:00
Hzj_jie
a4d5165f7a Several fixes in frontlight logic (#2991)
* Use PluginShare to exchange data between plugins

* Remove legacy code in reader.lua and kobo/device.lua, and move KOBO_LIGHT_ON_START to kobo/powerd.lua

* A better sync config logic

* Consider kobo without hardware frontlight toggle

* update frontlight widget once toggle is tapped.
2017-06-29 08:23:32 +02:00
Hzj_jie
970f2e7306 Several improvements of AutoFrontlight plugin and enable it by default (#2975)
* Force refresh when kindle is out of screensaver or usb is unpluged.

* Improve AutoFrontlight

* More plugins sub menu

* Last brightness should always be updated

* Finish autofrontlight improvement and enable it by default.

* More tets

* onFlushSettings

* MenuSorter can now correctly sort sub menus
2017-06-24 09:55:31 +02:00
Hzj_jie
7d2ed4c3d0 Move kobo auto-suspension logic out of UIManager (#2933) 2017-06-23 10:04:11 -07:00
Hzj_jie
c8be27481c Fix synchronizing issue of Kobo front light between KOReader and nickel (#2977) 2017-06-21 19:10:44 -07:00
Hzj_jie
b5c77af15c Typo in last change. (BasePowerD -> KoboPowerD) 2017-06-20 23:58:33 -07:00
Hzj_jie
05769872c7 Allow Kobo to entirely turn off the front light. 2017-06-20 23:57:18 -07:00
Hzj_jie
d83de47204 Add onFrontlightStateChanged event (#2966)
So we do not need the hacky solution in KoboLight plugin anymore. PageFooter can receive and process the event itself.
2017-06-19 19:00:36 -07:00
Hzj_jie
bc487b7fe6 Force refresh when kindle is out of screensaver or usb is unpluged. (#2965)
* Force refresh when kindle is out of screensaver or usb is unpluged.

* unused variable warning
2017-06-17 11:57:57 +08:00
Hzj_jie
63f2284f21 Fix several crash errors triggered by legacy code (#2962) 2017-06-15 15:27:04 -07:00
Hzj_jie
53eb4dee50 AutoFrontlight plugin (#2941)
* Add AutoFrontlight plugin

* Add configuration to control autofrontlight feature
2017-06-14 19:32:16 +02:00
Hzj_jie
30378eb2a8 Add restart koreader function and ensure FlushSettings event can be delivered to all widgets (#2772) 2017-05-16 02:11:11 -07:00
Martín Fernández
474c011f21 [kobo]: add reboot and poweroff menu actions (#2888) 2017-05-14 09:43:08 -07:00
poire-z
a05f23d8fe Really disable double tap when 'disable_double_tap' is set
Closes #1594
2017-04-22 16:10:50 +02:00
Robert
9a247e86ae Screensaver on Kindle without Special Offers (#2757) 2017-04-13 19:55:31 +02:00
Frans de Jonge
c847d628e1 Docs: cosmetic updates and additions
* Content from wiki had some cosmetic leftover glitches
* Added/adapted some docs for other modules
2017-04-12 11:27:22 -07:00
Qingping Hou
f51285e89b revert code that enables screensaver on kindle by default 2017-04-11 11:47:33 +02:00
Robert
59873ae293 Screensaver option on Kindle devices (#2734)
* Screensaver on Kindle devices
2017-04-08 23:21:03 +02:00
Cosmin Gorgovan
10132d1c59 Disable the network asynchronously to avoid blocking the UI
Noticeable latency between toggling the power switch and the device
showing the screensaver has been tracked down to the two network
manager calls. This change allows the screen to be updated first.
Note that unloading the open source brcmfmac driver used on okreader
is slower than unloading the proprietary driver shipped by Kobo,
making this delay even more noticeable.

self.suspend() is scheduled after the network manager calls to avoid
race conditions.
2017-04-01 21:54:59 +02:00
Cosmin Gorgovan
11d6bfbc40 Fix typo in frontend/device/generic/device.lua 2017-04-01 17:15:02 +02:00
Hzj_jie
8f4ec13841 Remove powerd:refreshCapacity() (#2671) 2017-03-24 00:18:03 -07:00