Commit Graph

654 Commits (863255c9f426bdd6845f3f3eced4f270f1baecee)

Author SHA1 Message Date
Martín Fdez 8e831eb756 desktop: disable battery on touch menu and reader footer
isDesktop and isEmulator are now different entities
4 years ago
NiLuJe 2ae796eb2a
[Kindle] Be more thorough when toggling WiFi (#6039)
Fix #6019
4 years ago
dfhall 04ca12bb7f
Fix remarkable pen input (#6031)
fixes #6030
4 years ago
NiLuJe 0b898624ac
[Kindle] More accurate on/off FL detection/toggle (#5989)
* Kindle FL shenanigans

Either fix #5986, or break a whole crapload of weird corner-cases.
Possibly the insane AutoFrontLight checks.

* Make fl step 0 usable on devices where 0 doesn't turn the light off.

By fudging an extra step on our own side.

* Also, add some debug logging around wmctrl to try to figure out what's
happening there...
4 years ago
NiLuJe 4a5a2eb708
Unbreak nightmode on Cervantes (#5966)
* Unbreak nightmode on Cervantes

Regression after https://github.com/koreader/koreader-base/pull/1047 (I
thought it was already implemented).

Fix #5963

* make luacheck happy
4 years ago
clarkspark 1d58eb8b6c
Correct Frontlight status on suspend when screensaver mode is 'Leave … (#5928)
Also use a var in place of a long function name
4 years ago
Lukáš Kucharczyk ab744e1945
Add support for PocketBook InkPad X (#5890)
Closes #5887.
4 years ago
Frans de Jonge 5692f7df75 sort 4 years ago
Matias Nitsche 0575ed4c14 PRSTUX: interact with USB charger 4 years ago
Thomas Spurden 6f849c5285
A couple of minor remarkable port fixes (#5834)
* remarkable: remove unnecessary screen invalidate on resume

This is handled in uimanager if needsScreenRefreshAfterResume is enabled
(which is the default).

* remarkable: pass a path argument to reader.lua

Otherwise if lastfile is not set in the settings (e.g. install and then
exit without opening a file) koreader will just refuse to start.

* remarkable: pass koreader.sh args (if any) through to reader.lua
4 years ago
Frans de Jonge 1177baaf01 [CI] Ignore unscaled size check on mt_width/height (#5829)
See https://github.com/koreader/koreader/pull/5828#issuecomment-583677718

* fix luacheck too
4 years ago
Martín Fernández 67627ce2d9
Remarkable port (#5828)
Touchscreen is mirrored in X & Y and has a different resolution from the eink panel.

Uses systemd for time/date/suspend/poweroff/reboot
Two systemd units for platform integration. button-listen is a very
simple launcher.
to-do: add support for wifi by implementing  a wpa supplicant dbus client.

Authored-by: Thomas Spurden <tcrs@users.noreply.github.com>
4 years ago
Martín Fernández 3856f04445 android: switch to connectivity manager
Co-Authored-By: Frans de Jonge <fransdejonge@gmail.com>
4 years ago
NiLuJe 5499d85cbc
Allow running shell scripts from the FileManager/Favorites (#5804)
* Allow running Shell/Python scripts from the FM

* Show an InfoMessage before/after running the script

Since we're blocking the UI ;).

* Allow running scripts from the favorites menu, too.
4 years ago
NiLuJe f44b031702
Make Inverted Portrait a first-class citizen (#5783)
* Don't store stale screen/rotation modes in book's settings!

Gyro events *may* entirely bypass the local copy...
In any case, using a local copy was essentially asking for trouble...

Actually fix #5772

(because the issue was indeed that a Gyro swap from Portrait to Inverted
Portrait wasn't stored properly).

* Allow showing ScreenSavers in Inverted Portrait.

That works just fine, and won't lead to the confusing situation where a
lefty might pick up the device as a righty because the ScreenSaver
happens to be shown that way, only to have it rotate back to its lefty
orientation on wakeup...
4 years ago
Martín Fernández 5ef329c19c android: share text (#5745) 4 years ago
Martín Fernández 419b42cf2c
android: call EPD test from within KOReader (#5737)
* android: call EPD test from within KOReader

Co-Authored-By: Frans de Jonge <fransdejonge@gmail.com>
4 years ago
poire-z 0599c440cc [RTL UI] Bidi-wrap filenames, paths, urls, metadata
bidi.lua:
- Revert "Alias everything to Bidi.nowrap() when in LTR UI,
  as using LTR isolates seems uneeded when already LTR" (part
  of a628714f) which was a wrong assumption: we need proper
  wrappers for all things paths. Enhance some of these wrappers.
- Fix GetText RTL wrapping which was losing empty lines and
  trailing \n.

- Wrap all paths, directories, filenames in the code with
  these wrappers.
- Wrap all book metadata (title, authors...) with BD.auto(),
  as it helps fixing some edge cases (like open/close quotation
  marks which are not considered as bracket types by FriBiDi).
  (Needed some minor logic changes in CoverBrowser.)

- Tweak hyphenation menu text
- Update forgotten SortWidget for UI mirroring
- KoptConfig: update "justification" index for RTL re-ordering,
  following the recent addition of the page_gap_height option.
4 years ago
Martín Fernández 25e80358dc android: import files from Storage Access Framework 4 years ago
Martín Fernández f9a820d682 android: unbreak KO on scoped storage devices 4 years ago
Martín Fernández 72e5574ca7 android: allow overrides on 3rd party dictionary list 4 years ago
Martín Fernández f1f75c5cb0 android: touchscreen toggle option (#5564) 5 years ago
Martín Fernández 87334801ea android: fix ko paths when primary storage is a SD card 5 years ago
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.)
5 years ago
Martín Fernández b75fec4971 tweak timeouts, add haptic feedback support
Co-Authored-By: Frans de Jonge <fransdejonge@gmail.com>
5 years ago
Frans de Jonge f7861bc1eb
[feat] Add haptic feedback (#5380)
References <https://github.com/koreader/koreader/issues/5374>.
5 years ago
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
5 years ago
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.
5 years ago
NiLuJe f96cfe940b
Use the proper LED driver on the Libra (#5416)
So that we can actually set the warmth ;)
5 years ago
NiLuJe bcceb94603
Hotfix the startup orientation on the Kobo Libra (#5409) 5 years ago
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.
5 years ago
tobiasarndt a2f605ba38 [fix] added PocketBook InkPad 3 Pro to device.lua (#5398) 5 years ago
Frans de Jonge 672d29fbcc [fix] WakeupMgr: pass through task epoch for proximity check 5 years ago
Frans de Jonge 0c290be055 WakeupMgr: add log when scheduling wakeup 5 years ago
Frans de Jonge 3836184f9d [Kobo] Always write scheduled wakeup info to log 5 years ago
NiLuJe 4363576066 Support the Kobo Libra
(Hopefully?).
5 years ago
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.
5 years ago
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>.
5 years ago
Martín Fernández 20ebb55703 [Cervantes] Disable wifi before returning to QT, improved sysfs read (#5326) 5 years ago
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
5 years ago
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.
5 years ago
Frans de Jonge 1b17ce8ba0
[fix, Kobo] Save frontlight state on shutdown after suspend (#5305)
Fixes <https://github.com/koreader/koreader/issues/5292>.
5 years ago
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>.
5 years ago
Frans de Jonge be87fb27a0
[chore] Convert a couple more todos (#5267)
Cf. <https://github.com/koreader/koreader/pull/5244>.

Also update check.
5 years ago
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.
5 years ago
Frans de Jonge 59bb3ac8ea
[chore] Remove executable bit on device/input.lua (#5258)
I've got no idea why that might be there.
5 years ago
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
5 years ago
Martín Fernández 3a957d71e3 [Desktop] Open writable font dir, toggle system+user/user fonts, fix openLink on mac (#5220)
Fixes #5093
5 years ago
Martín Fernández 3161673d70 fix #5228 5 years ago
vvasseur c104724a58 PocketBook 626 new codename (#5215) 5 years ago
Martín Fernández 50ce8d47cd do not request write settings permission at launch 5 years ago
Robert 939538cc25 [UX] Add gesture - poweroff and restart device (#5202)
Also abstract canRestart, canReboot and CanPowerOff.
5 years ago
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
5 years ago
jetomit 20493eebc3 [fix, Kobo] Add missing parentheses (#5198)
Prevents a crash when the WIFI_MODULE environment variable is not
defined.
5 years ago
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)
5 years ago
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.
5 years ago
Martín Fernández 91b2faae6a android: add an option to ignore volume keys or use them to turn pages 5 years ago
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
5 years ago
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
5 years ago
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
5 years ago
Martín Fernández cd0f1acd7f android: add support for different screen timeout setups 5 years ago
Robert 1f6af80817 [feat] Make gesture intervals configurable (#5138)
Discussion: #4842
Close: #4842
5 years ago
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.
5 years ago
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
5 years ago
Андрей Тюрин bea7ca7008 Pocketbook 622 preliminary support (#5118) 5 years ago
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>
5 years ago
Martín Fernández 338bc8cced fullscreen toggle for Jelly Bean devices 5 years ago
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).
5 years ago
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
5 years ago
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
5 years ago
Martín Fernández c60d672b04 bump base & luajit-launcher: workaround for buggy firmwares and more 5 years ago
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
5 years ago
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
5 years ago
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
5 years ago
NiLuJe efe34b6fee Fix shutdown action on Kobo (#5055)
Bypass init, like Nickel does.
Otherwise, some devices either deadlock or panic.
5 years ago
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).
5 years ago
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
5 years ago
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 ;).)
5 years ago
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 ;).
5 years ago
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) 5 years ago
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.
5 years ago
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)
5 years ago
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).
5 years ago
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.
5 years ago
Martín Fernández dde301e765 [Android] use the same tag for all logs (#4862) 5 years ago
Frans de Jonge 709207a621
[feat, UX] Add external link to Wallabag (#4863)
Offers a choice when Wallabag is available.
5 years ago
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
5 years ago
NiLuJe 04f5bc7823 Remove the Aura SE viewport
This feels somewhat arbitrary and potentially unneeded,
and it'll prevent full blits, so, off it goes.
5 years ago
NiLuJe 9ecc2dd119 There's no viewport on the H2O²
Fix #4834
5 years ago
Galunid 5f44ef5dad [feat] Kindle suspend using lipc (#4825)
Fixes problems with making Kindle go to sleep using menu or gesture manager action.
5 years ago
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
5 years ago
Frans de Jonge b1ed2838c8
[UX] Add Device:openLink() stub for Linux SDL (#4822)
References #4821.
5 years ago
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.
5 years ago
Frans de Jonge e357165f17
[fix] GestureDetector: fix typo in ges_coordinate_translation_90 (#4804)
Fixes #4803.
5 years ago
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
5 years ago
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.
5 years ago
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.
5 years ago
Qingping Hou fc69257660 fix: auto dpi menu checkbox display (#4771) 5 years ago
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)
5 years ago
Frans de Jonge 2cbec1b54e
[fix] Add fake delayed pan to SDL scroll event (#4758)
Not actually delayed. Avoids a crash otherwise caused by #4666.
5 years ago
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 5 years ago
Martín Fernández 39be43ad84 do not refresh eink on activity changes, system will do that! (#4735) 5 years ago
Qingping Hou 4b7d5c82b7 fix: update gesturedector constant for custom screen dpi 5 years ago
Frans de Jonge c5b2bad6d6
[fix] Allow overriding low pan rate on E Ink device (#4729)
Cf. #4721.
5 years ago
Frans de Jonge 17fa07ee43
[fix] GestureDetector: deep copies of events for multiswipes when rotated (#4728)
Fixes #4724.
5 years ago
Martín Fernández 5e01a0c264 android: hasColorScreen depends on hasEinkScreen 5 years ago
Martín Fernández f8c71f6a45 disable low_pan_rate on non e-ink devices by default 5 years ago
Qingping Hou 1605409c60 rename runtimectl to document/canvascontext 5 years ago
Qingping Hou adb5d5a52c use screen for UI color control 5 years ago
Qingping Hou 855c8c2569 add dummy device & rename runtimectl:setDevice to runtimectl:init 5 years ago
Qingping Hou 02eca23649 decouple device from document modules 5 years ago
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
5 years ago
Martín Fernández be407d1059 [Android] Disable ota updates on fdroid builds 5 years ago
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.
5 years ago
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>.
5 years ago
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.
5 years ago
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.
5 years ago
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.
5 years ago
Martín Fernández 0532d7a507 [Android] (re)enable update downloads using full apks (#4639) 5 years ago
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).
5 years ago
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
5 years ago
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
5 years ago
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.
5 years ago
Martín Fernández b6683b7a9f android: update wifi menus 5 years ago
Martín Fernández 4ab7e367b5 strings, not ints 5 years ago
Martín Fernández 04e17424d0 display network settings based on device capabilities + fix android basic network info 5 years ago
Frans de Jonge f3a36f8285
[fix] GestureDetector typo (#4612) 5 years ago
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.
5 years ago
Martín Fernández 301aa580cc cervantes: add usb storage on devices w/updated 3rd party tools 5 years ago
Martín Fernández 51ce6664e5 move Cervantes4 to new natural light interface, like Kobo Forma and Kobo ClaraHD 5 years ago
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).
5 years ago
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 ;)).
5 years ago
NiLuJe abc6d17a25
A few minor fixes after #4541 (#4561)
* Enforce dithering in PicDocument
* Ensure we'll get a flashing update on ScreenSaver exit
5 years ago
Frans de Jonge e6b3542bdb
[fix, Android] hasEinkScreen should be a function (#4557)
Fixes https://github.com/koreader/koreader/pull/4541#issuecomment-461739983
5 years ago
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)
5 years ago
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)
5 years ago
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.
5 years ago
Martín Fernández 6b3158e497 android: disable wakelocks by default 5 years ago
NiLuJe 81b255cb85 Better-than-nothing key repeat handling.
Mainly aimed at the Forma.
Still fairly terrible, as these things goes ;p.
5 years ago
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
5 years ago
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
5 years ago
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.
5 years ago
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 ;).
5 years ago
Frans de Jonge 2cb4be7cad
[fix] PocketBook 626 new firmware with new codename (#4474)
Might need to be repeated for the others?

Fixes #4473.
5 years ago
Martín Fernández ab09dedf33 open new files from intent 5 years ago
Martín Fernández 2009ffa12f android: keep screen awake toggle (using wakelocks) & bump luajit-launcher 5 years ago
NiLuJe bc8d92c5d9 Detect the PocketBook Basic Touch 2 (PB625)
AFAICT, Pearl -> Carta, but same resolution/feature set.

Fix #4366
5 years ago
Sergey Avseyev 973e61557b [cervantes] automatically restore wifi connection (#4463) 5 years ago
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.
5 years ago
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
5 years ago
NiLuJe cc9f58687a [Kindle] Handle the two newish Indian PW4 variants (#4459)
xref: https://www.mobileread.com/forums/showthread.php?t=314156
5 years ago
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.
5 years ago
Martín Fernández 6de5927dc2 [build] Add support for Debian packages (#4434)
* Add support for Debian packages

* SDL: add device probe
5 years ago
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
5 years ago
jperon 8e575a5f3b Add support for PocketBook Touch HD Plus (#4419) 5 years ago
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*.
5 years ago
patrick-tang a2e7e62be7 Fix wrong keymapping for Forma (#4376) 5 years ago
wsotest 7841351a81 Added support for pb627 (touch lux 4) (#4362) 6 years ago
mbab c5ff3dcca1 Add support for PocketBook 630 (#4357) 6 years ago
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)
6 years ago
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
6 years ago
NiLuJe bd6c852cc8
Fix Kindle FW detection (#4336)
* Fix version comparisons...
6 years ago
NiLuJe 772cdefe92
Support the Kindle PW4 (#4324)
* Fix version checks on FW >= 5.10.x
* Bump base
6 years ago
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!
6 years ago
Martín Fdez 4e1a4978cc wireless: read wireless carrier from sysfs 6 years ago
Martín Fdez 56a1b14418 remove spaces from model names 6 years ago
frio 4ae43aee2c [fix, cervantes] Old Cervantes devices should return false for hasNaturalLights (#4320) 6 years ago
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)
6 years ago
Martín Fernández 29835b3072 [chore] Refactor sysfs_light (#4283) 6 years ago
Martín Fernández 717184f1d6 move e-ink related settings to a submenu (#4246) 6 years ago
Martín Fernández b8d95984d1 [UX] Show OTA updates only on supported devices (#4256) 6 years ago
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
6 years ago
Matias N 94d8f2d397 Sony PRSTUX support (#4198)
* Sony PRSTUX support
6 years ago
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.
6 years ago
Robert 225b5d417d Adds ReaderDeviceStatus: low battery alarm (#4144) 6 years ago
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
6 years ago
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)
6 years ago
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).
6 years ago
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).
6 years ago
NiLuJe 2d44baa561
Fix Android nightlies (#4038)
* Also, bonus KOA2 fix (third time's the charm!)
    Fix #3695
6 years ago
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
6 years ago
NiLuJe 2f3d1c80dd
Minimal KOA2 support (#4016)
* Minimal KOA2 support
(Touch, Screen, Battery). Hopefully :).
6 years ago
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
6 years ago
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
6 years ago
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
6 years ago
NiLuJe 0dbdd2f61f
Try to inhibit USBMS on Kindles (#3957)
re: #3955
6 years ago
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
6 years ago
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)
6 years ago
mezzarobba a3e16b3920 [fix] make wifi control work with my Kobo Touch N905 (#3920) 6 years ago
onde2rock dad7f209fa [CI] Add a check to detect tab in lua files (#3919) 6 years ago
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.
6 years ago
Frans de Jonge 88dee4194d
[feat] SDL2: add window icon (new logo) (#3884)
Also update Ubuntu Touch icon

Fixes #2000, fixes #3858
6 years ago
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.
6 years ago
David Engster f8d43b5c09 [fix] kobo/nickel_conf: Remove redundant 'return nil' 6 years ago
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
6 years ago
Frans de Jonge b4002dc9ce
[chore] device/input: migrate custom event map to settings dir (#3822) 6 years ago
Frans de Jonge 086ced07f9
[feat, UX] SDL: add Gtk3 filechooser (#3827)
The specifics for other implementations are easy to change in the backend.
6 years ago
Frans de Jonge 7f4be45d4e
[chore] Handle SDL_MOUSEWHEEL and less hackish SDL events (#3826) 6 years ago
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.
6 years ago
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.
6 years ago
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
6 years ago
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
6 years ago
Frans de Jonge f1aae6a03c [UX, fix] Redraw PdfDocument and DjvuDocument after resizing window 6 years ago
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
6 years ago
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.
6 years ago
David Engster bfd55c76c2 device/kobo/powerd: Read natural light configuration
Define 'frontlight_settings' table for all Kobo devices, and read
configuration from settings file.
6 years ago
David Engster a912e00aa3 device/kobo/sysfs_light: Make used exponent in formulas a variable 6 years ago
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.
6 years ago
David Engster 201370a220 device/kobo/sysfs_light: Use current brightness/warmth if none given 6 years ago
cairnsh 8a5b888789 [refactor] Input: added Input:addSlotIfChanged() (#3716)
Changed handleTouchEv, handleTouchEvPhoenix to use that
6 years ago
cairnsh f74f19bd9f [feat] Make touch work on the H2O2 (#3715) 6 years ago
Frans de Jonge 68e63df442
[feat] Add H2O2 natural light (#3709)
See https://www.mobileread.com/forums/showpost.php?p=3664352&postcount=66
6 years ago
Frans de Jonge 857e88147f
[Kindle] Add preliminary support for Kindle Oasis 2 (#3698)
Screen refresh may still be broken.

References #3695.
6 years ago
Frans de Jonge aadb81eb48
[feat] Add Android clipboard definition (#3479)
References https://github.com/koreader/koreader/issues/3441
6 years ago
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'.
6 years ago
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.
6 years ago
David Engster 7aefad6de9 kobo/device: Add field for natural light support
Currently, only the Kobo Aura One has natural light.
6 years ago
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.
6 years ago
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
6 years ago
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
6 years ago
Fabian Müller-Knapp 279329227a Add PB623 alias Touch Lux (#3542) 7 years ago
Fabian Müller-Knapp f0f59afcdd Added Pocketbook 624 alias Basic Touch (#3528)
Fix #3525
7 years ago
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
7 years ago
Frans de Jonge 06dfe4fb78
[feat] Add Device:hasClipboard() (#3465)
References https://github.com/koreader/koreader/issues/3441
7 years ago
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.
7 years ago
Fabian Müller-Knapp 8ef783fd1b Add PocketBook626 (#3472) 7 years ago
mwoz123 a01271b8a6 [Android] Wifi status in footer (#3396)
Implemented through the Android API so it's reasonably cheap.
7 years ago
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
7 years ago
Fabian Müller-Knapp 749112f57a [PocketBook] Use inkview-calls for battery-percentage/charging (#3402) 7 years ago
mwoz123 ff3d8f3df7 Android NetworkManager (#3386) 7 years ago
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
7 years ago
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).
7 years ago
Frans de Jonge bf61e6f093 [fix] Android frontlight control 7 years ago
Fabian Müller-Knapp 7d81aa5cf4 [feat] Pocketbook840 enable frontlight (#3294)
* Detect PocketBook840 by GetSoftwareVersion()

* implement Frontlight-support for 840 via inkview
7 years ago
poire-z 92e0067466 Enable color rendering on Android 7 years ago
poire-z 53f083f516 Allow for toggling color rendering
New menu item in Screen submenu.
hasColorScreen enabled for SDL device.
7 years ago
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
7 years ago
Huang Xin a4e1a3ba5e reflect changes in koreader/android-luajit-launcher#62 (#3254) 7 years ago
Robert 5258643a85 Add a date setting (#3234) 7 years ago
poire-z 0122c086f2 Fix crash on exit on Kobo devices with no frontlight (#3221) 7 years ago
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
7 years ago
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
7 years ago
Robert dbaea8c1c8 Refresh Kindle with SO on exit (#3168) 7 years ago
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
7 years ago
poire-z 3159548f3e Avoid warning on input timeout on the emulator 7 years ago
Robert 7f58a13626 Ability to setup clock (#3085)
* Ability to setup clock
7 years ago
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
7 years ago
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.
7 years ago
robert00s 4651954364 Prevent liblipclua crashes 7 years ago
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.
7 years ago