2
0
mirror of https://github.com/koreader/koreader synced 2024-11-10 01:10:34 +00:00
Commit Graph

283 Commits

Author SHA1 Message Date
Qingping Hou
4b7d5c82b7 fix: update gesturedector constant for custom screen dpi 2019-03-05 01:17:37 -08:00
Qingping Hou
1605409c60 rename runtimectl to document/canvascontext 2019-03-03 13:10:45 +01:00
Qingping Hou
4d8da96177 fix test 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
d749591984 decouple device from pdfdocument, font & bgr checking 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
Robert
192bc175fc New startup option: Folder shortcuts (#4220) 2018-09-12 21:42:24 +02:00
Frans de Jonge
d0130ae9da
reader.lua: add version to ascii art (#3724)
As suggested by @poire-z in https://github.com/koreader/koreader/pull/3723#issuecomment-370557018
2018-03-05 23:27:03 +01:00
Frans de Jonge
ea033431aa CircleCI fixes
* shellcheck 0.4.5 fix `LC_ALL: en_US.UTF8` (can be removed for shellcheck 0.4.6)

* hush updated luacheck on `reader.lua`; we're not assigning any variables but `= nil` is redundant
2017-10-08 18:38:00 +02:00
poire-z
308c243238 Inform once about color rendering on supported devices (#3289) 2017-10-02 15:17:17 +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
Frans de Jonge
23cd585fae Support history as default view for filemanager (#3058)
Fixes #2774

* make history view borderless
* add new menu for what to start with

Should combine nicely with #2940
2017-08-14 13:15:12 +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
808766b7f3 Remove the deprecated restore_settings flag 2017-06-23 18:29:38 -07: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
Frans de Jonge
89099e2c94 Swipe for menu and quickstart guide (#2761)
* Swipe for menu and quickstart guide

Because swiping for the menu is a big change from what we're used to, this commit includes a new quickstart guide.

Fixes #2608.

* add some dev docs
* add FileConverter spec
* add QuickStart spec
* add Version module
* add Version spec
2017-04-15 14:45:56 +02:00
robert00s
1749ab7227 Fix 2716 2017-04-04 09:43:04 -07:00
Robert
b4462da1b6 Dialog when reopening book at start (#2259) (#2603) 2017-03-04 18:54:23 -08:00
Frans de Jonge
c855494ba0 Minor: don't turn off wifi on exit
This fixes #2379 and #2511.
2017-02-24 00:28:57 -08:00
Qingping Hou
f95ad00b9e feat: add logger module & rewrite kobo suspend script in lua 2017-01-02 19:52:09 -08:00
Qingping Hou
dae4a5a413 refactor: move bootstrap code into setupkoenv.lua
add ffi.load patch
add kodev prompt command
2016-11-12 23:48:56 -08:00
Qingping Hou
93873bfd69 plugins(chore): fix static check errors 2016-11-01 00:31:24 -07:00
Qingping Hou
4540d51a6e settings: add entry to toggle debug mode 2016-10-30 15:25:51 -07:00
Qingping Hou
a407036acd minor: always flush banner to stdout 2016-10-30 15:25:51 -07:00
Qingping Hou
db5a872ec6 minor: turn off wifi on exit 2016-10-16 01:29:02 -07:00
Qingping Hou
5309a0a47f misc: rotate crash.log for kobo/kindle/pocketbook 2016-10-14 20:37:54 -07:00
chrox
9ab005a1d3 fix unit test of readerlink and readerpaging
and have more confidence with the unit testing framework.

Now `make testfront` won't retry on failure and testing files are
ordered in each run so that it's possible to reproduce testing failure.

And this patch also fix flush settings not working before suspend issue:
at some point the `FlushSettings` event is sent to `UIManager` instead
of `ReaderUI`, but `UIManager` only delegated events to active widgets
and `ReaderUI` is actually not an active widgets thus will miss the event.

This patch also add a verbose debug mode with "-v" as a switch to turn
on this mode. With verbose mode on, event handling will be logged.
2016-08-12 17:05:07 +08:00
chrox
7ea12c0198 fix broken unit tests on Travis CI
1. It turns out that `device_id` is not defined in unit test environment
which makes the `assert(self.kosync_device_id)` fail and somehow makes `luajit` segmentation fault.
2. In the device spec, stubbing `io.open` will make subsquent `require`
all return boolean value and segmentation fault `luajit`.

This patch is a minimum viable change that makes CI work on both my
local box and Travis.
2016-08-11 18:17:09 +08:00
Zijie He
820a39c8f7 Update KOSyncClient 2016-08-10 10:42:51 -07:00
Qingping Hou
85398dc2d5 luasettings: new module to handle genric settings
also use luasettings for reader settings
2016-07-10 23:25:32 -07:00
Zijie He
882a815f6c Use default font if settings.reader.lua does not provide one. Provide a Toggle button if readerfooter gesture actions are disabled. 2016-05-22 22:32:57 -07:00
Frans de Jonge
5638819f25 Removed a bunch of "successfully", replaced an ellipsis, and some deviant spellings of KOReader. 2016-04-16 12:37:08 +02:00
NiLuJe
dfe321d87a Fix a hasFrontLight call in reader.lua...
(it's a function, not a bool ;'( ).

Fix #1961
2016-04-15 16:50:51 +02:00
Qingping Hou
eb37d9b8b6 kobo: fix screen probe for touch 2016-04-02 23:06:09 -07:00
hzj-jie
d1e8b8098d Koreader won't start on Kobo without frontlight, powerd.fl may be nil. 2016-03-28 15:48:50 +08:00
Qingping Hou
9a3e262bb3 fix(reader.lua): typo 2016-03-21 16:30:45 -07:00
Qingping Hou
6446f9d2b0 minor(reader.lua): remove unnecessary import 2016-03-18 21:11:13 -07:00
Qingping Hou
3334bf8fe7 fix: delay showReader after UIManager:run is called 2016-03-08 22:56:54 -08:00
NiLuJe
a82fe3ac44 is_fl_on -> is_frontlight_on outside of powerd
Matches the reader setting we're reading/writing at that point,
and avoids confusion related to scoping because it doesn't necessarily
match powerd.is_fl_on at that point.

Well, at least I had to wrap my mind around it ^^
2016-03-02 19:15:11 +01:00
Qingping Hou
399d676cf0 kobo: rename frontlight_state config to is_frontlight_on 2016-03-02 18:25:17 +01:00
Qingping Hou
08b08d69f7 kobo: always set light intensity to 0 if state is nil or false 2016-03-02 18:25:17 +01:00
Qingping Hou
9afae91b13 chore: rename frontlight related variables to keep style consistent
flIntensity -> fl_intensity
flState -> is_fl_on
fallback_FrontLightLevel -> fallback_fl_level
2016-03-02 18:25:17 +01:00
zijiehe
e84093c414 Add a flState in Kobo, and KoboPowerD:toggleFrontlight uses flState to control the light instead of intensity. 2016-02-26 15:34:23 +08:00
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.
2016-01-11 23:30:22 +02:00
chrox
5cbbac6b43 fix typo 2015-10-18 00:30:29 +08:00
chrox
9654e9ce6c fix #1608 with touch coordinates detection
Some kobo touch devices have X Y coordinates in touch events swapped.
This patch provides a GUI to probe if the device needs to swap the XY.
The Kobo Touch users will be directed to tap on the upper right corner
of the screen and the probe will check if the X value is smaller than
the Y value in the tap event.
2015-10-18 00:25:40 +08:00
chrox
34ea9ac574 add datastorage module to handle data directory on various platform
On kindle, kobo and pocketbook the data directory is the current
running directory but on Android the app is installed in system
defined location and users may have no access to that location.
The same circumstances should be true for the upcoming Koreader for
Ubuntu touch, so the data directory (in which tessdata, dictionaries,
global settings, persistant defaults and probably history data are
stored) could be stored in another place.
2015-06-15 16:56:27 +08:00
chrox
82393f0ed3 fix loading frontend/JSON.lua for json.lua on Kindle
The VFAT file system of `/mnt/us` is case insensitive so that
require("json") from Spore which intends to load luajson module in
rock directory actually will load `frontend/JSON.lua`, the two JSON
parser libraries have slightly different APIs.

This patch remove the pure Lua JSON library in favor of `luajson` which
uses LPeg pattern marching backend for better performance.
2015-03-21 13:19:00 +08:00
chrox
69e6b6b9cb hold on directory in filemanager can set the it as HOME directory
and this "HOME" directory will override the command line option passed to
koreader.

This patch implements #1434.
2015-03-12 16:29:15 +08:00
chrox
d08e22ec2e add simple sync service as a plugin
The 'KOSync' plugin will synchronize furthest reading progress
across different koreader devices after users registering their
devices.

The synchronizing service is open-sourced as the project
[koreader/koreader-sync-server](https://github.com/koreader/koreader-sync-server).
2015-03-09 20:20:36 +08:00
Huang Xin
b4574a7359 fix crash on kindle 2015-03-03 21:14:35 +08:00
chrox
efe8e65dd9 refactoring search path 2015-03-02 14:55:16 +08:00
Hans-Werner Hilse
d91dccae80 fix night mode setting
implement bezel cleaning with proper background color
2014-11-09 18:03:33 +01:00
chrox
dec9a99fba load Device module after DEBUG is turned on
otherwise some DEBUGs are not printed.
2014-11-06 15:07:53 +08:00
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.
2014-11-02 21:19:04 +01:00
chrox
a197f31da7 check if last opened file exists before opening it
This should fix #916.
2014-10-05 14:52:37 +08:00
chrox
14e2bf3d69 refatoring: lazy loading of packages 2014-10-03 16:13:34 +08:00
chrox
c4a1e4d10d update PATH variable on startup for Windows 2014-09-25 22:33:58 +08:00
chrox
69919435ac restore frontlight setting only for Kobo devices 2014-09-05 21:07:42 +08:00
chrox
2bec0017a0 refactor out global functions showHomePage and showReaderUI 2014-09-05 21:07:42 +08:00
chrox
c74c258fc7 add filemanager icon in reader menu
now we can access the filemanager in all launcher configurations
2014-09-05 21:07:42 +08:00
chrox
c8bc9ee37c close screen framebuffer when exiting reader 2014-08-19 12:11:48 +08:00
chrox
b7c7287bab remove more global variables 2014-08-14 19:52:30 +08:00
chrox
e1af17938c remove global variable Image 2014-08-14 19:51:40 +08:00
WS64
2d72bb7e3f Update reader.lua 2014-08-11 14:03:22 +02:00
WS64
5a2b9103e9 Update reader.lua 2014-08-11 13:49:18 +02:00
NiLuJe
6e10b877ad We don't need those at startup, delay until needed. 2014-07-05 15:04:14 +02:00
NiLuJe
f1cc984cbf Close lipc handles on exit.
No idea if bad things happen if we don't, but at least this sounds more
correct. (re #696)
2014-07-04 20:10:38 +02:00
NiLuJe
834ff9a1fb Don't fake the swipe to unlock if not needed.
Re: #695
2014-07-04 05:16:28 +02:00
chrox
26f5a4731e add peer-to-peer file sharing plugin ZSync 2014-06-23 22:35:41 +08:00
Markismus
aaa84808e8 add persistent option for defaults.lua 2014-06-18 19:18:27 +02:00
chrox
b92860c22a add night mode option that inverts screen color 2014-06-08 14:06:16 +08:00
chrox
e23e48ffa5 fix license version in reader usage 2014-06-05 19:23:54 +08:00
chrox
d2eaeeaeed add option to load last opened file automatically 2014-06-05 19:06:35 +08:00
chrox
857bd6fcc8 strings not shown on GUI will not be translated
This may encourage users in transifex to join Koreader project.
2014-06-05 14:59:06 +08:00
chrox
8e278c0d62 remove global util module 2014-06-04 18:19:43 +08:00
Qingping Hou
f6a9c694dc refactor: update reader to use new launcher 2014-06-01 12:46:55 -04:00
Huang Xin
4156b2edd0 Merge pull request #559 from Markismus/master
Return to Home screen for Kobo devices Mini, Touch and Aura
2014-05-08 16:30:35 +08:00
Markismus
a153286f44 Kobo Frontlight Tweaks
Now the frontlight remains unchanged from Nickel to koreader and vice
versa.
Also ffi/kobolight.lua has been changed to allow for usage of the toggle
button in the filemanager.
2014-05-02 16:06:18 +02:00
chrox
659e5f6bdd use buildin LuaJIT profiler 2014-05-01 11:58:05 +08:00
chrox
34fd9f3efa add koreader plugin mechanism
This should implement #505.
2014-04-23 22:30:36 +08:00
Qingping Hou
f07c0c4fba require FileManager on demand in reader.lua 2014-04-02 17:05:28 -04:00
Qingping Hou
4b357c1466 move reader code into frontend/apps/reader
it makes more sense to completely separate the UI framework and
application code

also move frontend/ui/configurable.lua to frontend/configurable.lua
2014-04-02 17:02:01 -04:00
chrox
92219a1f1e cleanup: expand tab to 4 spaces 2014-03-13 21:52:43 +08:00
Qingping Hou
5dc9d5d565 rename language_po setting entry to language 2014-01-19 12:59:27 -05:00
Paulo Matias
a7af79d3c8 Language chooser fixes
- Change order of module loading so that every string is localized
- Fix changing the language to English
2014-01-18 20:04:14 -02:00
Qingping Hou
ae1cf90006 add language setting menu item 2014-01-18 12:23:55 -05:00
Paulo Matias
1b1e65edfe Avoid crash if trying to open a non-existent file
which currently might occur by clicking in the history entry of a file which was removed
2014-01-17 16:41:44 -02:00
chrox
92b62c907a refactoring frontlight device to more generic power device 2014-01-04 21:38:07 +08:00
chrox
62e12ddfba import document module on-demand 2013-12-31 13:12:56 +08:00
chrox
1fb4dfab95 add visual indication on document loading
This should implement #265.
2013-12-28 18:21:39 +08:00
chrox
c205503828 remove global variable DEBUG 2013-10-25 20:09:21 +08:00
chrox
f49f64bc15 add missing gettext and Menu module 2013-10-23 22:51:07 +08:00
HW
ef111b99c6 Refactored to use strictly locals 2013-10-18 22:38:07 +02:00
Paulo Matias
d7b747d6dd Change util.isEmulated to boolean and fix frontlight
Device:hasFrontlight always returned a true-like value because util.isEmulated was an integer.
Fixed this, also, used a polymorphic object design to reduce FrontLight code, and
adapted BaseFrontLight for the emulator.
2013-08-22 10:10:29 -03:00
Paulo Matias
8f53571e06 No need for lulip to be global 2013-08-19 11:07:19 -03:00
Paulo Matias
2492ca247a Use ffi/lulip.lua from koreader-base; change package.path 2013-08-19 10:58:42 -03:00
Huang Xin
2e8b5cb39c Merge pull request #215 from houqp/houqp-master
check frontlight before setting intensity
2013-08-14 03:54:43 -07:00
Huang Xin
4e83288040 Merge pull request #214 from houqp/filemanager
bug fix in class system & rewrite filemanager
2013-08-14 03:39:36 -07:00