Commit Graph

281 Commits (master)

Author SHA1 Message Date
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
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
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
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 04e17424d0 display network settings based on device capabilities + fix android basic network info 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
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 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
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
NiLuJe d113cb9475
A few Kobo input tweaks (#4450)
* Fix the Touch input probe on Trilogy devices that depend on the touch_probe_ev_epoch_time quirk (fix #630)
* Expose a "Pageturn button inversion" feature in the Navigation menu (for all devices with keys) (fix #4446)
* Allow ignoring the accelerometer on the Forma (Screen > Ignore accelerometer rotation events; also available from the Gesture Manager) (fix #4451)
* Fix SleepCover handling on the Forma (fix #4457)
* Make isWifiOn a tiny bit more accurate (check the actual WiFi module instead of sdio_wifi_pwr)
* Move all flash related Screen options to the eInk submenu
5 years ago
NiLuJe f6743a45db
Proper Forma support (#4414)
* Enforce a known rotation on startup, to make sure we handle touch input coordinates properly.
* Proper FrontLight warmth support (thanks to @cairnsh & @pazos in #4291)!
* Fix the PageTurn buttons mapping to match Nickel's defaults
* Properly remap PageTurn buttons depending on the current rotation.
* Actually enable the Mk.7 screen refresh codepath on *all* Mk.7 devices (I'd messed up the device check...).
* Full accelerometer handling (includes a touch of refactoring regarding orientation handling in general).
* Fix insidiously broken USBMS behavior in Nickel after we exit on FW >4.8.

Fix #4291
Fix #3002
5 years ago
patrick-tang a2e7e62be7 Fix wrong keymapping for Forma (#4376) 6 years ago
NiLuJe 419769d07e
Initial Kobo Forma support (#4325)
* Initial Kobo Forma support

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

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

* FrontLight/NaturalLight might need some more testing/tweaks
* Rotation (initial or accelerometer-induced) is *NOT* handled.
  This'll require someone with an actual Forma, shell access,
  and a bit of courage, because rotation is hell.
  Programming chops greatly appreciated!
6 years ago
Martín Fernández 29835b3072 [chore] Refactor sysfs_light (#4283) 6 years ago
Martín Fernández b8d95984d1 [UX] Show OTA updates only on supported devices (#4256) 6 years ago
NiLuJe 5f4841e277
Tweak JIT's loopunroll threshold on Kobo 16bpp (#4157)
* Tweak JIT's loopunroll threshold on Kobo 16bpp
    To avoid early blacklist of the blitbuffer code on alpha-blending
    workloads.
    Least terrible workaround we could come up with to "fix" #4137

* gzip kindle/kobo/pb OTA tarballs w/ --rsyncable
    Should make them more zsync friendly.
6 years ago
NiLuJe fea0d8dbaf
Another set of fixes (#4083)
* Make findcalibre actually useful

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

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

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

fix #4082

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

re #4015

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

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

re #4084

* Bump base to pickup ZMQ fixes (fix #4086)
6 years ago
NiLuJe e2a0929c51
Better KOA2 support (#4037)
* Better KOA2 support
    * Fix FL
    * Add physical pageturn keys
    * Add accelerometer support
* Possibly better NaturalLight handling on the Clara
* Fix WiFi module name used in some(?) Mk7 Kobos
* A bunch of kodev fixes
6 years ago
NiLuJe 2f3d1c80dd
Minimal KOA2 support (#4016)
* Minimal KOA2 support
(Touch, Screen, Battery). Hopefully :).
6 years ago
NiLuJe 18db509325 Assorted bag of fixes (#4014)
* Link to the WiKi, it's a bit more explainy ;).

* More WiFi trickery for some HW revs

* Fix Rev2 detection under KSM

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

* Resync nickel.sh w/ current rcS

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

* Go back to using rmmod instead of modprobe -r

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

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

c.f., https://www.mobileread.com/forums/showpost.php?p=3706979&postcount=2919
6 years ago
NiLuJe 586b42aa20 Kobo Clara HD support (#4004)
Thanks to https://www.mobileread.com/forums/showpost.php?p=3702997&postcount=291

* Possibly saner H2O²r2 Touch protocol handling

re #3925

* Proper fix for H2O²r2 touch protocol.

Thanks to https://www.mobileread.com/forums/showpost.php?p=3704325&postcount=2904
6 years ago
NiLuJe 5871132c25
UI Behavior tweaks (#3983)
* Switch all initial highlights to "fast" update

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

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

* Promote updates to flashing slightly more agressively.

* Document what each refreshtype actually does.

With a few guidelines on their optimal usecases.

* Switch remaining scheduleIn(0.0) to nextTick()

* Tighter scheduling timers

Shaving a hundred ms off UI callbacks...

* Cache FFI C Library namespace

* Ask MuPDF to convert pixmaps to BGR on Kobo

Fix #3949

* Mention koxtoolchain in the README

re #3972

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

* Make black flashes in UI elements user-configurable

(All or nothing).

* Jot down some random KOA2 sysfs path
6 years ago
NiLuJe e3b7524d9c Another round of Kobo Fixes (#3939)
* Trim unneeded stuff from startup script

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

* Fix a stray eth0

-> $INTERFACE

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

re #3936

* Make getFirmwareVersion less fragile on Kobo

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

* Use the same syntax as the PRODUCT check

* Actually implement getProductId

Instead of a stray c/p ^^

* Properly identify the Rev2/Mark7 variants of existing devices

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

re #3925

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

See if that jog things up (re #3936)

* Try harder not to suspend with WiFi on on Kobos

Because otherwise, things go boom. (re #3936)
6 years ago
mezzarobba a3e16b3920 [fix] make wifi control work with my Kobo Touch N905 (#3920) 6 years ago
NiLuJe 95bc5d7081 [fix] tar args order & Kobo IR grid regression (#3895)
* Fix order of tar args

Otherwise, current tar versions abort

* Unbreak Kobo IR grid resume workaround

Regression after f402ee5f6f

I'm going to assume my H2O is really, really weird, because that
commit's more than a year old o_O.
6 years ago
David Engster 7c527aa5dd [chg] kobo/powerd: Keep max. warmth 2h after bedtime (issue #3825)
Keep max. warmth for 2h after bedtime, and then start reducing for 2h,
so that 4h after bedtime we have reached zero warmth.
6 years ago
David Engster f8d43b5c09 [fix] kobo/nickel_conf: Remove redundant 'return nil' 6 years ago
David Engster e80951413d [feat] kobo/powerd, kobo/nickel_conf: Saving of auto-warmth settings
Add support in nickel_conf to save/retrieve setting of
'autoColorEnabled', which is the automatic warmth feature in
Nickel. We do not support reading of 'BedTime', because it is encoded
as a QVariant. This setting is hence saved/loaded solely in/from
G_reader_settings.
6 years ago
David Engster 596e20e588 [feat] kobo/powerd: Support for automatic warmth
This is the first step to support "automatic warmth", meaning that
warmth will be set according to the current time. The user can set a
"bedtime" at which warmth should be maximal. Warmth will increase
towards approaching bedtime and decrease afterwards.

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

For automatically setting warmth in the background we use the
backgroundrunner plugin, because not only is it more comfortable to
use, but we also cannot require 'uimanager' during device
initialization.
6 years ago
David Engster bfd55c76c2 device/kobo/powerd: Read natural light configuration
Define 'frontlight_settings' table for all Kobo devices, and read
configuration from settings file.
6 years ago
David Engster a912e00aa3 device/kobo/sysfs_light: Make used exponent in formulas a variable 6 years ago
David Engster effc7135a1 device/kobo/sysfs_light: Explicitly handle warmth/brightness = 0
For warmth and/or brightness = 0, we need to make sure that the
red/green/white LEDs are actually turned off, regardless of the values
for gain/offset.
6 years ago
David Engster 201370a220 device/kobo/sysfs_light: Use current brightness/warmth if none given 6 years ago
cairnsh f74f19bd9f [feat] Make touch work on the H2O2 (#3715) 6 years ago
Frans de Jonge 68e63df442
[feat] Add H2O2 natural light (#3709)
See https://www.mobileread.com/forums/showpost.php?p=3664352&postcount=66
6 years ago
David Engster f77ce9bf7c kobo/powerd, kobo/nickel_conf: Support reading/setting natural light
Nickel stores the 'warmth' values as 'ColorSetting' in a linear
mapping from '1500' to '6400'.
6 years ago
David Engster 5c1f97eeb3 kobo/powerd: Use sysfs interface for natural light support
If the device has natural light support (currently only KA1), use the
sysfs interface instead of the ioctl-based one. It might also be
usable on other Kobo devices for setting brightness without natural
light, but since I cannot test this, this is currently restricted to
the KA1.
6 years ago
David Engster 7aefad6de9 kobo/device: Add field for natural light support
Currently, only the Kobo Aura One has natural light.
6 years ago
David Engster 6b4a548fe1 kobo: Add sysfs-based interface to frontlight
By default, the ioctl interface is used for accessing the
frontlight. However, the ioctl interface has two problems: the overall
brightness seems to be lower (issue #2321), and it does not support
the natural light support from the Kobo Aura One (issue #2285). This
interface is the first step to fix both these issues.

From observing Nickel's behavior, it appears the white/green/red
intensities are roughly linear dependent on the 4th root of brightness
and warmth values. This leads to a very quick increase of the
intensities for lower brightness/warmth values, which then saturate
for larger ones. The values for gain/offset were determined by a
simple linear regression, but the plan is to create a widget so that
users may adapt these values to their liking.
6 years ago
Frans de Jonge 021e3db002
kobo/device: finetune KoboStar (Aura 2) viewport (#3513)
See https://github.com/koreader/koreader/issues/2418#issuecomment-346287297 and  https://github.com/koreader/koreader/issues/2418#issuecomment-346426685
7 years ago
Frans de Jonge aa7d4f9751
[Kobo] Update H2O2 to nearly working touch. (#3481)
See https://www.mobileread.com/forums/showpost.php?p=3610605&postcount=24 for evtest output.
7 years ago
Frans de Jonge ed3c0e707a [Kobo] Add preliminary Kobo Aura H2O2 definition (#3372)
Cf. ongoing discussion in KSM8 thread: https://www.mobileread.com/forums/showthread.php?p=3596020#post3596020
7 years ago
Robert 5258643a85 Add a date setting (#3234) 7 years ago
poire-z 0122c086f2 Fix crash on exit on Kobo devices with no frontlight (#3221) 7 years ago
poire-z d4fd0b9428 frontlight on kobo: a few fixes (#3163)
* frontlight on kobo: a few fixes

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

* Ensure untoggle works when starting with light off
7 years ago
poire-z c6cfed92d7 Fix kobo fl_min and frontlightwidget (#3143)
* Put back fl_min=0 as it is for all other devices (the idea
fl_min should be 1 and toggling managed some other way is
not implemented in current code).
* Fix a few frontlightwidget issues
7 years ago
Robert 7f58a13626 Ability to setup clock (#3085)
* Ability to setup clock
7 years ago
Hzj_jie a4d5165f7a Several fixes in frontlight logic (#2991)
* Use PluginShare to exchange data between plugins

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

* A better sync config logic

* Consider kobo without hardware frontlight toggle

* update frontlight widget once toggle is tapped.
7 years ago
Hzj_jie c8be27481c Fix synchronizing issue of Kobo front light between KOReader and nickel (#2977) 7 years ago
Hzj_jie b5c77af15c Typo in last change. (BasePowerD -> KoboPowerD) 7 years ago
Hzj_jie 05769872c7 Allow Kobo to entirely turn off the front light. 7 years ago
Hzj_jie 63f2284f21 Fix several crash errors triggered by legacy code (#2962) 7 years ago
Hzj_jie 53eb4dee50 AutoFrontlight plugin (#2941)
* Add AutoFrontlight plugin

* Add configuration to control autofrontlight feature
7 years ago
Martín Fernández 474c011f21 [kobo]: add reboot and poweroff menu actions (#2888) 7 years ago
Robert 9a247e86ae Screensaver on Kindle without Special Offers (#2757) 7 years ago
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()
7 years ago
Qingping Hou d168db9db5 kobo(suspend): put device back to sleep after unexpected wakeup 7 years ago
Qingping Hou 06562fa582 input(optimization): replace ev type reflection with table lookup 7 years ago
Qingping Hou f402ee5f6f chore: remove all echo shell out in kobo resume routine 7 years ago
Qingping Hou f95ad00b9e feat: add logger module & rewrite kobo suspend script in lua 7 years ago
Frans de Jonge 0fb29e9cd3 Kobo: fix Kobo Aura second edition highlighting 8 years ago
Frans de Jonge 69f70ac16e Kobo: initial support for Kobo Aura second edition (Kobo star)
This fixes #2418.
8 years ago
Qingping Hou d1f9cf932b kobo(minor): add debug log for suspend action 8 years ago
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.
8 years ago
Qingping Hou 816d0a551a kobo: handle charging/uncharging event 8 years ago
Qingping Hou 705d3e4cb4 doc(minor): document alternative usb plug event source for kobo 8 years ago
Qingping Hou ef5c8ced60 chore: disable wrong usbplug event handler 8 years ago
Qingping Hou 902403bf0a kobo(fix): prevent usb plug events from interrupting sleep 8 years ago
Qingping Hou 93b3262db7 kobo(fix): make sure sleep cover is not interrupting sleeping when ignore_power_sleepcover is set 8 years ago
Qingping Hou ebc7055b43 chore: move kobo specific code into kobo/device.lua 8 years ago
Matej Mihelič 6600410c08 Aura One support 8 years ago
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
8 years ago
chrox 9afad43a3e refactoring utils to tools as discussed in #2197 8 years ago
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
8 years ago
Qingping Hou 20eb36a03d feat: add network management UI for kobo 8 years ago
Qingping Hou 44d62f6f41 networkmanager: move device specific code into device module 8 years ago
Qingping Hou 38a1758889 kobo: detect non-epoch timestamp using current second 8 years ago
Qingping Hou 82a3e0f9ad automatically adjust ev time for kobo touch 8 years ago
NiLuJe 103e4eaeb8 Use the GloHD quirks on the Touch 2.0...
re #2005
8 years ago
NiLuJe 9a7c46e8f5 Unbreak previous commit
Weeeeee!
8 years ago
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
8 years ago
Cosmin Gorgovan 19338cb439 Kobo: Offer to power off if the power button is held for at least 3 seconds 8 years ago
Zijie He f33f78cf08 Add an ignore_power_sleepcover setting to ignore Kobo power_sleepcover keycode 8 years ago
Hzj_jie 1be9264a0c Resolve review comments 8 years ago
Zijie He 7d4bd076f7 Resolve review comments 8 years ago
NiLuJe f43cbc74e6 Always forcibly wake the H2O IR grid on wakeup
Fix #1862
Fix #1943
8 years ago
Qingping Hou eb37d9b8b6 kobo: fix screen probe for touch 8 years ago
Qingping Hou c35aad3ae1 fix(kobo): return 0 frontlight level config to signal frontlight off state 8 years ago
Qingping Hou 824bdb4463 comment for kobo sleep 8 years ago
Zijie He 767e6e2b71 Add a sleep after kobo resume to resolve partial blank screen issue (#1874) 8 years ago
Qingping Hou e812f7d0d6 kobo: fix typo during refactoring, luacheck is the best check 8 years ago
Qingping Hou cf70e86552 kobo: move reader setting outside of nicke_conf module 8 years ago
NiLuJe e60de3044c Keep intensity in sync at the config level too
Make sure frontlight_intensity in reader.lua settings matches what we
write into Nikcel's config
8 years ago
Qingping Hou 4751aba46c kobo: rewording, turns out has_toggle_btn != has_state_cfg :( 8 years ago
Qingping Hou 8190093f83 kobo: don't create FrontLightState config if it didn't exist to begin with 8 years ago
Qingping Hou 8b7658b8cd kobo: always keep intensity value and is_fl_on in sync 8 years ago
Qingping Hou cf3b97537b kobo: build fl_state based on fl_intensity if model does not support toggle 8 years ago
Qingping Hou 9afae91b13 chore: rename frontlight related variables to keep style consistent
flIntensity -> fl_intensity
flState -> is_fl_on
fallback_FrontLightLevel -> fallback_fl_level
8 years ago
NiLuJe f213fb6405 Bypass flState on suspend/wakeup
We pretty much always want to turn it off on suspend, and turn it on to
some measure on wakeup.

That, and nickel's FrontLightState is completely nonsensical on my device anyway...
8 years ago
NiLuJe 770625d756 Tweak the 'IR down on resume' workaround...
Only apply it when started from nickel, because I'm guessing we'd have
seen a number of reports of this if it happened more widely...
8 years ago
NiLuJe 85737e2b9d Forcibly re-activate IR grid on resume...
re #1862
8 years ago
NiLuJe 6c8bbfd470 Unbreak Kobo frontlight -> off when suspending.
If no-one touches anything, flState stays false...
And anyway, we should unconditionally disable the fl on sleep.
8 years ago
zijiehe a183c1c64b Slightly refector device & powerd component, remove some magic code 8 years ago
zijiehe e84093c414 Add a flState in Kobo, and KoboPowerD:toggleFrontlight uses flState to control the light instead of intensity. 8 years ago
Qingping Hou 59c17ef420 minor: more luacheck fixes 8 years ago
Qingping Hou 71ef994318 test: add nickle conf spec 8 years ago
Qingping Hou 1609becd61 Merge pull request #1772 from dset0x/frontlight-sync
WIP Synchronise frontlight level with nickel config
8 years ago
Qingping Hou 5a3b9c6856 style: make staick-check happier 8 years ago
Dimitrios Semitsoglou-Tsiapos 699781de68 nickel_conf: handle missing file/key/section 8 years ago
Dimitrios Semitsoglou-Tsiapos eb47c5a39f Synchronise frontlight level with nickel config
* Drops support for mocking the frontlight setting internally which may
  cause incorrect in-memory values.

* Adds new supported value for `KOBO_LIGHT_ON_START` (-2), which sets
  'Kobo eReader.conf' as the source to update `settings.reader.lua`'s
  brightness setting on startup, thus using the value from it
  indirectly.

* Adds the `KOBO_SYNC_BRIGHTNESS_WITH_NICKEL` configuration variable
  which updates 'Kobo eReader.conf' every time the brightness setting is
  changed within koreader.

* Fixes missing call to save brightness when modifying via two-finger
  swipe.

Closes #1523.
8 years ago
Guangda Hu 7491cd7b9d fix spaces 9 years ago
Guangda Hu 69db627136 Glo HD support 9 years ago
NiLuJe a6a2b3d6a3 Try to get the Kobo codename from the env first
My batch of startup script tweaks should ensure PRODUCT is always
exported.
Leave the fallback in place, to avoid blowing up in weird corner-cases I
haven't thought about.
9 years ago
NiLuJe c6a3f9002c Tweak the H2O viewport to make it pixel-perfect.
As confirmed by checking a fb dump via fbgrab, and nickel's
broken cropping of screenshots ;).
9 years ago
Cosmin Gorgovan 41045dab99 Fix charging detection for Kobo devices
I've tested this on a N905C. I assume this implementation never
worked (since charge_now is supposed to show state of charge), but
it would be useful to get a confirmation.
9 years ago
chrox d0b450efde refresh battery capacity when going out of suspend
This should fix #1383.
9 years ago
Michael Hall 9a66805b5a Handle Kobo Touch Key 10 years ago
Hans-Werner Hilse 3d73ff5ae7 only open frontlight device on Kobo devices that actually have light 10 years ago
Hans-Werner Hilse 173de615db Revert "smaller viewport for Kobo H2O (bezel overlaps bottom)"
This reverts commit fc36d6db37.
10 years ago
Hans-Werner Hilse fc36d6db37 smaller viewport for Kobo H2O (bezel overlaps bottom) 10 years ago
Hans-Werner Hilse dacb59f6b2 move debug function handover, set viewport for Kobo Mini
in order to have debugging facilities in framebuffer:init(), we hand
over the debug function as soon as we can.

Also, set a viewport for Kobo Mini. Hopefully, it fits most people -
I can only test on my unit.
10 years ago
Hans-Werner Hilse 4a497cfcfb fix initialization order on Kobos
notably, this will set up input offsets for viewport stuff after the
input rotation has been set up.
10 years ago
Hans-Werner Hilse bf7ea7af6d add device names as comments
we use mostly code names internally, but it is probably a good idea
to annotate the actual device names.
10 years ago
Hans-Werner Hilse 63af71188a refactor refresh
Lots of the device-related distinction wandered into
base/ffi/framebuffer_<driver>. This eases the refresh logic in
UI manager, which basically only decides what kind of refresh
to trigger. The device specific configuration in the framebuffer
driver decides how to realize that whish.

screen.lua is gone, in its place is now the framebuffer driver.
The device abstraction decides what framebuffer driver to load.
10 years ago
chrox 8384eba810 consider also the screen size when scaling by DPI 10 years ago
Andrey Golovizin f785b29f34 Fix the viewport on Kobo Aura (phoenix). 10 years ago
WS64 67c4bb365d Center screen for Kobo Aura
Why was it 
viewport = Geom:new{x=6, y=12, w=752, h=1012},?
viewport = Geom:new{x=0, y=0, w=752, h=1012}, looks way better!
10 years ago
Frans de Jonge c4f1687c22 Remove KOBO_LIGHT_OFF_ON_SUSPEND option and move workaround to ffi/kobolight.ua 10 years ago
Frans de Jonge 011c5b6544 Fix Kobo resume in new hardware abstraction. 10 years ago
Qingping Hou 8927f901da fix(input): use elseif conditional logic in adjustTouchSwitchXY 10 years ago
Hans-Werner Hilse 3066c86e38 Refactoring hardware abstraction
This is a major overhaul of the hardware abstraction layer.
A few notes:

General platform distinction happens in
  frontend/device.lua
which will delegate everything else to
  frontend/device/<platform_name>/device.lua
which should extend
  frontend/device/generic/device.lua

Screen handling is implemented in
  frontend/device/screen.lua
which includes the *functionality* to support device specifics.
Actually setting up the device specific functionality, however,
is done in the device specific setup code in the relevant
device.lua file.

The same goes for input handling.
10 years ago