Commit Graph

654 Commits (863255c9f426bdd6845f3f3eced4f270f1baecee)

Author SHA1 Message Date
Martín Fernández b9ffb2e0d0
pocketbook: warmth lights support (#6531)
* also enables natural light controls for the emulator
4 years ago
Teteros 01ed79fb92
Update PB633 device definition (#6529) 4 years ago
roshavagarga a9aa63d94c
Update PocketBook device definitions (#6525) 4 years ago
zwim b3f64dc73b
gesture: messages and sensitivity changes for small (warmth) scales; devicelistener dedup (#6468)
* deduplicate code on warmth/brightness swipes

if device has a small scale (e.g. warmth is going from 0..10)
* adjust warmth message
* use a smaller gesture sensitivity
4 years ago
Martín Fernández d935ca6937
sdl: keep track of window position and size (#6495) 4 years ago
roshavagarga ec87d36e57
PocketBook: Add new device definitions (#6481) 4 years ago
Martín Fdez 9037a1f4f2 bump luajit-launcher and remove frontlightwidget leftovers 4 years ago
Martín Fdez bdbebb9e08 standalone osx application bundle 4 years ago
zwim a6763465b4
[Android]: Native light dialog (#6426)
* Adds support for Tolino Epos 2 warmth light
4 years ago
Galunid a9d0990f84
Add Set Frontlight/Set Frontlight Warmth to dispatcher (#6440)
Add Set Frontlight/Set Frontlight warmth events to dispatcher. This allows users to set day/night profiles with different fl/warmth values as requested in #6444
4 years ago
NiLuJe 2ad976387d
More #6424 cleanups (#6442)
* Simplify logic, and more detailed debug logging
* Kill Nickel's FIFO on startup
Avoids udev/udhcpc scripts hanging when trying to open() it.
4 years ago
NiLuJe 37a01100b7
Various Wi-Fi QoL improvements (#6424)
* Revamped most actions that require an internet connection to a new/fixed backend that allows forwarding the initial action and running it automatically once connected. (i.e., it'll allow you to set "Action when Wi-Fi is off" to "turn_on", and whatch stuff connect and do what you wanted automatically without having to re-click anywhere instead of showing you a Wi-Fi prompt and then not doing anything without any other feedback).
* Speaking of, fixed the "turn_on" beforeWifi action to, well, actually work. It's no longer marked as experimental.
* Consistently use "Wi-Fi" everywhere.
* On Kobo/Cervantes/Sony, implemented a "Kill Wi-Fi connection when inactive" system that will automatically disconnect from Wi-Fi after sustained *network* inactivity (i.e., you can keep reading, it'll eventually turn off on its own). This should be smart and flexible enough not to murder Wi-Fi while you need it, while still not keeping it uselessly on and murdering your battery.
(i.e., enable that + turn Wi-Fi on when off and enjoy never having to bother about Wi-Fi ever again).
* Made sending `NetworkConnected` / `NetworkDisconnected` events consistent (they were only being sent... sometimes, which made relying on 'em somewhat problematic).
* restoreWifiAsync is now only run when really needed (i.e., we no longer stomp on an existing working connection just for the hell of it).
* We no longer attempt to kill a bogus non-existent Wi-Fi connection when going to suspend, we only do it when it's actually needed.
* Every method of enabling Wi-Fi will now properly tear down Wi-Fi on failure, instead of leaving it in an undefined state.
* Fixed an issue in the fancy crash screen on Kobo/reMarkable that could sometime lead to the log excerpt being missing.
* Worked-around a number of sneaky issues related to low-level Wi-Fi/DHCP/DNS handling on Kobo (see the lengthy comments [below](https://github.com/koreader/koreader/pull/6424#issuecomment-663881059) for details). Fix #6421 
Incidentally, this should also fix the inconsistencies experienced re: Wi-Fi behavior in Nickel when toggling between KOReader and Nickel (use NM/KFMon, and run a current FW for best results).
* For developers, this involves various cleanups around NetworkMgr and NetworkListener. Documentation is in-line, above the concerned functions.
4 years ago
Frans de Jonge 7c1a716d57
Fake battery status in readerfooter_spec to succeed on devices with batteries (#6417)
Cf. <https://github.com/koreader/koreader/pull/6370#issuecomment-662382487>.
4 years ago
Martín Fernández ca21d1401a SDL: use platform as model for desktop computers, report battery if available 4 years ago
Martín Fernández 94c0d7854f remove filechooser 4 years ago
Martín Fdez fca7f9e7d5 desktop/emulator 4 years ago
yparitcher 1db2b7d875
better logic for #6386 (#6388) 4 years ago
yparitcher 6671d984ed
SetNightMode event & Night Mode refresh rate (#6386)
If the user has not set a separate refresh rate for night mode
the default one will be used, as was the previous behavior

Closes: #5019
Closes: #6094
4 years ago
NiLuJe a8da762955
Initial handling of the upcoming Kobo Nia (#6380)
Obviously untested ;p
4 years ago
yparitcher bda44a99ef
Dispatcher: use sections (#6364)
use `device` `filemanager` `rolling` and `paging` sections to organize the
dispatcher menu and allow the user to know when the action will apply

add events from ReaderGesture

allow profiles in FM
4 years ago
yparitcher 70f89c4df1
ReaderGesture: cleanup (#6292)
convert all gesture actions to use events for better modularity
add network event handlers and device event handlers
4 years ago
Martín Fernández 1adea4a497 Add macOS target
Co-authored-by: Jason Benwell <jbenwell@hotmail.com>
4 years ago
Martín Fdez a376a52c3a easier user font paths with Device.home_dir 4 years ago
NiLuJe 509ee7bb86
Allow locking the gyro to the current screen mode (#6347)
* Allow locking the gyro to the current screen mode (i.e., orientation).
* Tweak the "sticky rota" option to work both ways
* More rotation constant usage instead of magic numbers
4 years ago
Martín Fdez 8324154177 keep newlines outside translations 4 years ago
Martín Fdez 7094519e1b android: support for native surface rotation 4 years ago
yparitcher f7d538b108
Landscape FM / Refactor rotation (#6309)
* landscape FM / Refactor rotation

refactor and simplify the orientation handling code. the user generally cares about the rotation (what direction the device is facing) and not about if koreader is displaying in portrait or landscape mode

* bump base

update luasocket, libjpeg-turbo, curl
add logging to evernote-sdk-lua
update framebuffer for proper rotation
4 years ago
Martín Fernández 32207523b0
emulator: add fake network manager (#6314) 4 years ago
roshavagarga 46bf88c573
Add PocketBook 614W (Basic 3) definition (#6312)
Cf. <#6311>.
4 years ago
zwim 43693c9fe9
Add the possibility run shell scripts from filemanager on android (#6288) 4 years ago
NiLuJe ff1e50c5c0
Don't rotate BookStatus & ReadingProgress in screensavers. (#6286)
They're full-screen, and they work fine in Landscape.

re: #5724

* Fix multiline indents in the Kindle c/p ;p
4 years ago
Martín Fernández 83cde64bcc
unified calibre plugin (#6177)
joins calibre metadata search and calibre wireless connections into a single plugin

search metadata changes:

- search directly into calibre metadata files.
- search can be performed on more than one library (configurable from a menu)
- device scans now find all calibre libraries under a given root
- search options can be configured from a menu. (case sensitive, find by title, author and path)
- removed legacy global variables.
- *option* to search from the reader
- *option* to generate a cache of books for faster searches.

calibre wireless connection changes:

- keep track of books in a library (includes prunning books from calibre metadata if the file was deleted locally)
- remove files on device from calibre
- support password protected connections
- FM integration: if we're in the inbox dir it will be updated each time a book is added or deleted.
- disconnect when requested by calibre, available on newer calibre versions (+4.17)
- remove unused opcodes.
- better report of client name, version and device id
- free disk space checks for all calibre versions
- bump supported extensions to match what KOReader can handle. Users can override this with their own list of extensions (or from calibre, by configuring the wireless device).
4 years ago
Martín Fernández 2e731dd4dd
[chore] Device abstraction (#6280)
* generic Device:info() function which returns the model

* add Device:canSuspend() and make it true in all devices that have suspend routines and the emulator

* also enable fake poweroff/reboot on the emulator

* add Device.home_dir

* add Device:hasExitOptions() and update menus & comments
4 years ago
Martín Fernández 765b35a7bf
android: add a toggle to ignore back button events (#6269)
Requires koreader/android-luajit-launcher#233
Requires koreader/koreader-base#1117

It is a workaround for #6263 but can be useful on some devices with erratic back key behaviour too (yep, Onyx)
4 years ago
Martín Fdez 835f9f62c6 fix ANRs in Kosync plugin login/register 4 years ago
Martín Fdez 3e3ddbfc4b desktop: don't show which results on console 4 years ago
NiLuJe 9c4e246038
Ensure feature-parity in ScreenSaver handling on Kindle (#6240)
* Ensure feature-parity in ScreenSaver handling on Kindle

We were missing the fancy extra white flash and landscape handling that
most every other eInk device gets ;).

Fix #5724

* Minor SO tweaks

The "swipe to unlock" ad screen was possibly managing to seep through on
slow devices.

* Less convoluted and more consistent logic

Thanks, @yparitcher ;).
4 years ago
NiLuJe 95567d8af8
Disable the RTC alarm on shutdown (#6211)
* Disable the RTC alarm on shutdown

* Nice typo.

* Bump base

https://github.com/koreader/koreader-base/pull/1103
https://github.com/koreader/koreader-base/pull/1105
https://github.com/koreader/koreader-base/pull/1106
4 years ago
Frans de Jonge 0fb9113078
[feat] Add Device:hasFewKeys() (#6193)
This will allow to behave subtly different in certain instances.
Cf. <https://github.com/koreader/koreader/issues/4029>.
4 years ago
Frans de Jonge 528e993eb3
[PocketBook] Add PocketBook 613 Basic definition (#6192)
Cf. <https://github.com/koreader/koreader/issues/4029>.
4 years ago
poire-z 16e42116ee
[fix] GestureDetector: prevent hold timers overlap (#6186)
Prevent the Tap>Hold setTimeout'ed function to trigger
on another later Tap.
Fix a Tap quickly following a Swipe (which triggers this
Tap>Hold timer) from becoming a Hold.
4 years ago
Frank LENORMAND 23cbabd539
[PocketBook] Refine 515 model attributes (#6184)
References <#6168>.
4 years ago
Frank LENORMAND 0b0548fade
[PocketBook] Map d-pad key events (#6183)
References <#6168>.
4 years ago
Frans de Jonge eb92a95fa0
[PocketBook] Add 515 and PB616W definition stubs (#6182)
Might need further tweaks. References <https://github.com/koreader/koreader/issues/6168>.
4 years ago
Martín Fernández 3a4b5d3cab
desktop: add support for 3rd party dictionary apps (#6167) 4 years ago
Martín Fdez 607dbf0808 clean PB device definition 4 years ago
Martín Fernández 5704f63bfc
fix openLink on linux (#6161) 4 years ago
Martín Fernández 58a6b01d03
add eudic dictionary support (#6154) 4 years ago
Martín Fdez 48727a984b android: add a toggle to force haptic feedback in spite of system settings 4 years ago
Roman Artiukhin 9588b51f24 Correct name for GoldenDict Pro dictionary 4 years ago
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