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

571 Commits

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

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

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

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

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

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

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

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

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

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

* Dither every non-transparent icon to the eInk palette

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

* Re-process badly grayscaled icons

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

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

Also, allow setting debug mode that way.

Also, forcibly disable verbose logging when disabling debug.

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

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

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

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

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

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

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

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

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

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

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

* Really limit the white flash to full-screen images

* Limit that behavior to eInk screens

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

Untested, not terribly pretty.

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

* Don't enable auto_restore_wifi by default

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

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

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

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

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

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

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

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

Fixes #4523

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

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

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

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

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

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

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

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

* more info about device frontlight/naturalLight capabilities

* make stock reader fonts available in KOReader

* remove restore-wifi-async leftovers

* wireless: fix wpa_supplicant configuration:

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

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

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

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

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

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

* fix rotation for Pocketbook Color Lux

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

* use default DPI for Pocketbook Color Lux

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

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

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

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

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

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

fix #4082

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

re #4015

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

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

re #4084

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

* More WiFi trickery for some HW revs

* Fix Rev2 detection under KSM

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

* Resync nickel.sh w/ current rcS

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

* Go back to using rmmod instead of modprobe -r

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

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

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

* Possibly saner H2O²r2 Touch protocol handling

re #3925

* Proper fix for H2O²r2 touch protocol.

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

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

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

* Promote updates to flashing slightly more agressively.

* Document what each refreshtype actually does.

With a few guidelines on their optimal usecases.

* Switch remaining scheduleIn(0.0) to nextTick()

* Tighter scheduling timers

Shaving a hundred ms off UI callbacks...

* Cache FFI C Library namespace

* Ask MuPDF to convert pixmaps to BGR on Kobo

Fix #3949

* Mention koxtoolchain in the README

re #3972

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

* Make black flashes in UI elements user-configurable

(All or nothing).

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

* Pickup current OTA packages

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

* And actually generally handle current packages properly

* Kindle screensaver handling experiment

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

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

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

* Okay, that should be much saner...

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

* Reword that

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

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

* Fix a stray eth0

-> $INTERFACE

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

re #3936

* Make getFirmwareVersion less fragile on Kobo

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

* Use the same syntax as the PRODUCT check

* Actually implement getProductId

Instead of a stray c/p ^^

* Properly identify the Rev2/Mark7 variants of existing devices

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

re #3925

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

See if that jog things up (re #3936)

* Try harder not to suspend with WiFi on on Kobos

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

Otherwise, current tar versions abort

* Unbreak Kobo IR grid resume workaround

Regression after f402ee5f6f

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

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

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

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

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

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

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

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

* modify focusmanager to allow for more complex layout

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

* add Dpad naviguation to the touchmenu

* fix crash because virtualkeyboard on non touch device

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

* Enable device with keys to use the touchmenu

* Don't get stuck in reader progress statistics plugin

* [underlinecontainer] Fix and remove unused function

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

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

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

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

* Clean up device.lua

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

* Add option to enable/disable background in message screensaver

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

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

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

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

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

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

* Disable color for djvudocument

* Use Screen:isColorEnabled()

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

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

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

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

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

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

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

* A better sync config logic

* Consider kobo without hardware frontlight toggle

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

* Improve AutoFrontlight

* More plugins sub menu

* Last brightness should always be updated

* Finish autofrontlight improvement and enable it by default.

* More tets

* onFlushSettings

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

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

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

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

* BatteryStat & kobolight

* Several minor improvements

* Remove a useless function

* flush settings

* Some review feedbacks

* Resolve review comments

* Remaining Minutes -> Remaining Hours

* Add dump_file

* typo

* realpath

* realpath on folder

* Remove useless os.time()

* Resolve review comments

* warning

* Add BatteryStat.debugging flag

* treat log as txt

* Minor improvement

* Charging hour should be positive

* Use warn instead of info

* onSuspend in Kobo

* Charging events for kobo and kindle

* More events

* dumpOrLog

* Warnings

* Typo

* More space

* Singleton

* slightly format change

* BatteryStat singleton

* Init

* Remove debugging flag

* sleeping percentage is still negative

* Read settings

* Do not need to change was_suspending and was_charging

* Typo

* Remove debugging flag

* Not charging should happen before suspend

* Resolve review comments

* was_suspend and was_charging should be updated each time in onCallback()
2017-03-23 23:36:15 -07:00
Qingping Hou
d168db9db5 kobo(suspend): put device back to sleep after unexpected wakeup 2017-03-06 07:47:20 +01:00
Qingping Hou
06562fa582 input(optimization): replace ev type reflection with table lookup 2017-03-06 07:47:20 +01:00
Qingping Hou
597beab616 minor: do not double log key input event 2017-03-06 07:47:20 +01:00
Qingping Hou
77b07255f0 chore: make input debug less verbose 2017-02-27 11:08:57 +01:00
Hzj_jie
7fb2dc8d5c Update kobolight plugin to support kindle (#2587) 2017-02-26 02:19:20 -08:00
Qingping Hou
f402ee5f6f chore: remove all echo shell out in kobo resume routine 2017-01-30 05:53:44 -08:00
Qingping Hou
f95ad00b9e feat: add logger module & rewrite kobo suspend script in lua 2017-01-02 19:52:09 -08:00
Frans de Jonge
0fb29e9cd3 Kobo: fix Kobo Aura second edition highlighting 2016-12-16 22:37:19 -08:00
Frans de Jonge
69f70ac16e Kobo: initial support for Kobo Aura second edition (Kobo star)
This fixes #2418.
2016-12-13 14:39:24 -08:00
Qingping Hou
d1f9cf932b kobo(minor): add debug log for suspend action 2016-12-10 16:06:51 -08:00
Qingping Hou
0c49b915de refactor: add touch zone subsystem to inputcontainer
Touch zone decouples screen size from gesture event registration.

The win here is each individual widget does not need to update
gesture range on screen rotate/resize anymore.

Another advantage is we now have a centralized ordered array to handle
all registered touch event listeners, makes it much easier to resolve
gesture range conflicts between multiple widgets.

This patch also includes the following changes:

* migrate readerpaging to use readerui's touch zone
* migrate readerfooter to use readerui's touch zone
* move inverse read direction setting to touch menu's setting tab
* moved kobolight widget from readerview into readerui
* various dead code cleanups and comments
2016-12-10 16:06:51 -08:00
poire-z
283429fe9b Network Info: prettier and additional infos (#2394)
Left alignment of existing infos.
Added SSID and default gateway ping result.
2016-12-04 12:03:11 -08:00
Bastien Dejean
c71b176e0a Kobo Aura ONE: no viewport adjustments needed
Test image:
https://cloud.githubusercontent.com/assets/159419/20651651/5e344d1c-b4e9-11e6-8450-6fb165c792db.png

Fixes #2372.
2016-11-28 10:06:25 +01:00
Bastien Dejean
64bc5cd63c Make the powered off state customizable
This changes the behavior of the powered off transition phase for the
Kobo devices: instead of displaying a confirmation dialog, a screensaver
is used after a 2 seconds press delay.

Users can specify separate directories/files/messages for the powered
off and sleeping states through the `path` and `message` attributes of
the `{poweroff,suspend}_screensaver` settings.

Fixes #2327 and closes #2306.
2016-11-18 12:54:00 -08:00
Qingping Hou
816d0a551a kobo: handle charging/uncharging event 2016-10-30 15:25:51 -07:00
Qingping Hou
705d3e4cb4 doc(minor): document alternative usb plug event source for kobo 2016-10-17 23:45:47 -07:00
Qingping Hou
0ace252b64 device(minor): call restoreWifiAsync with self 2016-10-08 15:53:02 -07:00
Qingping Hou
ef5c8ced60 chore: disable wrong usbplug event handler 2016-10-08 15:53:02 -07:00
Qingping Hou
58500ba01b fix: delay screen refresh on resume 2016-10-08 15:53:02 -07:00
Qingping Hou
902403bf0a kobo(fix): prevent usb plug events from interrupting sleep 2016-09-21 23:32:56 -07:00
Qingping Hou
71afe3606c kobo(fix): set suspend wait timeout to 15 seconds
Otherwise, suspend might fail and the device will ended up in a false
sleep state and drain the battery.
2016-09-21 23:32:52 -07:00
Qingping Hou
4036e2c460 kobo(fix): do not wake up device when cover is closed 2016-09-21 23:29:22 -07:00
Qingping Hou
93b3262db7 kobo(fix): make sure sleep cover is not interrupting sleeping when ignore_power_sleepcover is set 2016-09-21 23:29:22 -07:00
Qingping Hou
22964a77a0 kobo(fix): always put device to suspend state when cover is closed 2016-09-21 23:29:17 -07:00
Qingping Hou
ebc7055b43 chore: move kobo specific code into kobo/device.lua 2016-09-19 01:10:53 -07:00
Qingping Hou
c619de324e chore: more luacheck fixes 2016-09-19 01:10:53 -07:00
Matej Mihelič
6600410c08 Aura One support 2016-09-13 06:50:07 +01:00
Hzj_jie
da2c57f93a Automatically connect WIFI after Kobo has been resumed (#2215)
* Add bash scripts to control WIFI / IP, so we can share them with frontend/device/kobo/device.lua.

* add test cases
2016-09-01 00:05:40 -07:00
chrox
b0498ec9b9 revert 9ab005a changes to UIManager:sendEvent
which would make readerui handle swipe event twice.

And use broadcastEvent to emit `FlushSettings` event.

This should fix #2225 and fix #2226.
2016-08-19 00:00:01 +08:00
chrox
7fd6037bb0 fix #2219
The ABS_PRESSURE ABS code is also detected on some KOBO devices
if ABS_PRESSURE events are feeded to handle orientation those devices
will have a unresponsive screen as described in #2219.

This patch registers an event adjustment handler for Kindle Oasis to
adjust the ABS_PRESSURE code to ABS_OASIS_ORIENTATION code so that
it won't affect event handling on other devices.
2016-08-13 18:57:15 +08:00
chrox
9afad43a3e refactoring utils to tools as discussed in #2197 2016-08-11 19:29:09 +08:00
bingo619
8e28ef6251 Oasis orientation 2016-08-08 19:57:40 +10:00
bingo619
43797ed813 Oasis orientation 2016-08-02 19:43:16 +10:00
bingo619
1edad106c3 Oasis page buttons (#2199)
Oasis page buttons
2016-07-31 15:25:34 -07:00
NiLuJe
2013a66fdd Some more Kobo suspend tweaks...
Disable wakeup_count handling, that's often causing more harm than
anything else...
Nickel doesn't even use it, that should have been a hint ;).

Make the logging slightly less confusing.
Add commented out debug features (dumping relevant dmesg output).

Re #2188
2016-07-31 19:01:15 +02:00
NiLuJe
2f7e32fa20 Fix KT3 input device
It's a zforce2 IR grid...

Fix #2195
2016-07-29 14:34:43 +02:00
Hzj_jie
ccbf8eac0c Add a network info page (#2187)
Add network info page
2016-07-26 21:32:13 -07:00
NiLuJe
04d07699cf Fix touch input on the 3G KOA (#2189)
* Fix touch input on the 3G KOA

There's an extra controller in there screwing things up for us,
because reasons, I guess?

Fix #2181

* Avoid touch_dev duplication
2016-07-26 21:30:12 -07:00
NiLuJe
88e3f54967 Fix KT3 battery sysfs entries 2016-07-18 21:11:50 +02:00
NiLuJe
e565ee289e Fix a few Kindle device codes 2016-07-14 19:05:46 +02:00
Qingping Hou
20eb36a03d feat: add network management UI for kobo 2016-07-11 23:50:19 -07:00
Qingping Hou
44d62f6f41 networkmanager: move device specific code into device module 2016-07-10 23:25:32 -07:00
NiLuJe
207af74527 Support the White Kindle PW3 & the Kindle Oasis.
Also attempts to support the new Kindle Basic, pending confirmation.
2016-07-09 03:16:08 +02:00
chrox
dee65a7999 add inactive touch zones around buttons on Kindle Voyage
This should fix #1801.
2016-07-01 23:47:32 +08:00
chrox
687b6df4f2 add support of screen brightness settings for Android
and use standrad Android API to query battery level and charging status
This should fix #2025, fix #1759 and fix #1415.
2016-06-24 02:05:20 +08:00
Qingping Hou
7d13d00eff uimanager(fix): honor second when calling Input:waitEvent 2016-06-22 01:11:23 -07:00
chrox
5983050d79 PDF free zoom mode revisit
this should implement feature request of zoom mode for multi-columns
page in #501
This PR depends on koreader/koreader-base#435

How to use?
1. Tap the top left corner of a PDF/Djvu page to get into the flipping
mode
2. Double-tap on text block will zoom in to that column
3. Double-tap on any area will zoom out to an overview of the page
4. repeat step 2 to focus to another page block

How does it work?
1. We first find the mask of text blocks in the page. (Pic 1)
2. Then we intersect page boxes with user tap to form a page block. (Pic 2)
3. Finally we zoom the page to the page block and center current view to
that block. (Pic 3)
2016-06-15 02:05:09 +08:00
Qingping Hou
bc9f60034e handle auto shutdown in pocketbook 2016-06-14 00:07:04 -07:00
Qingping Hou
38a1758889 kobo: detect non-epoch timestamp using current second 2016-06-05 14:19:37 -07:00
Qingping Hou
82a3e0f9ad automatically adjust ev time for kobo touch 2016-05-23 23:21:14 -07:00
NiLuJe
103e4eaeb8 Use the GloHD quirks on the Touch 2.0...
re #2005
2016-05-15 20:44:07 +02:00
NiLuJe
9a7c46e8f5 Unbreak previous commit
Weeeeee!
2016-05-15 20:44:07 +02:00
NiLuJe
467e65be3d Don't crash on the Kobo Touch 2.0
I wouldn't go so far as to say "support", though, since I don't have the
device, and the touch protocol might be wrong ;).

re #2005
2016-05-15 20:44:07 +02:00
Cosmin Gorgovan
19338cb439 Kobo: Offer to power off if the power button is held for at least 3 seconds 2016-05-01 14:09:21 +01:00
Zijie He
f33f78cf08 Add an ignore_power_sleepcover setting to ignore Kobo power_sleepcover keycode 2016-04-20 10:21:09 -07:00
Hzj_jie
1be9264a0c Resolve review comments 2016-04-17 22:30:46 -07:00
Zijie He
0b59d501a6 Merge remote-tracking branch 'upstream/master' into screen-saver 2016-04-15 13:21:55 -07:00
Zijie He
7d4bd076f7 Resolve review comments 2016-04-15 13:21:39 -07:00
NiLuJe
d4e5746eb3 Unbreak toggling the fL on Kindles
Fix #1960
2016-04-15 16:51:41 +02:00
NiLuJe
f43cbc74e6 Always forcibly wake the H2O IR grid on wakeup
Fix #1862
Fix #1943
2016-04-09 17:51:39 +02:00
Qingping Hou
eb37d9b8b6 kobo: fix screen probe for touch 2016-04-02 23:06:09 -07:00
Zijie He
b86aa5a02b Implement auto-suspend function for Kobo. Add test case for UIManager:_checkTasks, which should not clear _task_queue_dirty bit before looping. 2016-03-28 17:53:18 -07:00
Qingping Hou
26f5c8861b chore: minor style cleanup 2016-03-27 17:18:25 -07:00