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

103 Commits

Author SHA1 Message Date
chrox
8836225cec fix freeze when register for KOSync on Kindle 2015-03-21 13:19:00 +08:00
chrox
d3bb0d159a disable Turbo on Android to save precious mcode
This is a workaround to fix #1456.
2015-03-20 10:15:41 +08:00
chrox
9299b9a5e8 add async http client
it uses non-blocking turbo I/O looper to process http request
so that multiple http request can be handled simultaneously and http request
won't block user input, and most importantly, in Lua's way.
2015-03-02 17:21:26 +08:00
chrox
6a06cfaea5 refactor out flush settings when device goes into screensaver 2015-01-18 00:58:08 +08:00
chrox
8555f24c45 make sure refresh_count is incremented by only once at most for each repaint 2014-12-04 15:46:47 +08:00
Hans-Werner Hilse
844c1babf7 UIManager:_refresh(): no more default refresh
If no refresh type is specified, don't do a refresh.
There should be now refresh types specified in all relevant places.
2014-12-01 16:03:41 +00:00
Hans-Werner Hilse
9c4088a3ac small change of UIManager:show(): No more automatic refresh
This eliminates the API difference between the extra parameters of
UIManager:show() and setDirty(). They work the same now.
Note that this also eliminates the automatic refresh that took place
before when using show() without refresh options. It always refreshed
the full screen, which led to too big refresh regions all over the
place. Thus, refresh has now explicitly to be asked for, hopefully
encouraging to implement it in the widget that gets shown (and is
aware about the screen region it covers).

Also add an event that is triggered when a widget is closed:
CloseWidget. So a widget can implement "onCloseWidget()" to trigger
actions upon closing - most commonly, this is a refresh for the area
previously taken by the widget. That way, the widget's user does not
have to take measures to ensure that the area is refreshed later.
2014-12-01 14:42:38 +00:00
Hans-Werner Hilse
1091a8a3b9 add refresh control to UIManager:close() 2014-11-30 22:35:07 +00:00
Hans-Werner Hilse
afb59667c0 allow for more control on refreshes when show()ing widgets
for now, we have show() automatically call setDirty() for the new
widget, as before. However, now show() takes two arguments for
refresh configuration that will get passed on to setDirty().

For compatibility, the default is here in show() to do a partial
refresh. So if you want no refresh triggered (via this show() call),
add a function that doesn't return anything.
2014-11-30 22:33:36 +00:00
Hans-Werner Hilse
229c5ad61c change setDirty/refresh API
See documentation in the code.
In short: There is now one single method, setDirty(), that triggers
repaints and/or refreshes.
All variables in UIManager are gone - at least from an external
perspective. Everything is done through setDirty().
This also allows for easier debugging, since all requests come
in via function calls.
2014-11-30 00:15:17 +00:00
Hans-Werner Hilse
2f9386cd69 move refresh menu table out of UIManager
no need to clutter a core file of the whole UI concept with definitions
of UI elements
2014-11-30 00:15:17 +00:00
Frans de Jonge
66f04af8fb Various applications of util.template
This is the first bunch for #1276. I'd like to resolve #1281 before doing more.
2014-11-28 12:48:15 +01:00
Hans-Werner Hilse
21ded080dd fix refactor bug: invalidate update_regions_func 2014-11-23 12:13:33 +00:00
Hans-Werner Hilse
8696ca1fa1 fix old (pre-refactor) refresh call syntax 2014-11-23 12:13:33 +00:00
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.
2014-11-23 12:13:32 +00:00
NiLuJe
9bd089812b Tweaks and fixes for refresh logic
Don't increase counter for regional updates
Also some workarounds for Kobos

Try to avoid update_regions_func poisoning

Reset it at the end of repaint() even if nothing was found dirty

Ensure regional updates are always PARTIAL, in
case we get a region attached to an automatically triggered refresh, not
marked force_partial [which, hey, shouldn't happen, but apparently does
sometimes ^^]
2014-11-18 10:31:32 +01:00
Hans-Werner Hilse
45cf927ee8 Fix double-check of task list
Since commit 12a76fee33, we had a potential
bug on the event mechanism:

It introduced (besides the checkTasks method itself) a second run of the
checkTasks() method. In the second run, however, scheduled events were
not taken into consideration in how long to wait for input events
afterwards.

So when the after the first run of checkTasks() there were new scheduled
tasks added to the task queue, they were not properly scheduled and
and depended on an already existing scheduled event or an input event
to trigger.

This might have led to unexpected order of execution (though the order
is not guaranteed by the task scheduling anyway!) or to events triggering
not at all until the next input event.
2014-11-14 09:12:46 +01:00
Hans-Werner Hilse
c22dbbe3ae factor out repaint to its own method
it's gotten complex enough to isolate it
2014-11-14 09:09:50 +01:00
NiLuJe
13cbed8ea5 Fix partial refreshes on older Kobo devices
Fix #1146 (regression).
2014-11-12 19:12:22 +01:00
NiLuJe
3d5dd44a4c Don't hijack "fast" UI refresh w/ the REAGL stuff 2014-11-12 15:03:59 +01:00
NiLuJe
859031222e Simplify the H2O special-casing
re #1119

AUTO appears to be doing the right thing...
(even if that baffles me, given the state of the Kernel sources,
unless they flip some switches at compile time
[NTX_WFM_MODE_OPTIMIZED_REAGL / NO_AUTO_REAGL_MODE] ...)

Anyway, that's what nickel does, so follow its lead ;).
2014-11-11 17:08:41 +01:00
NiLuJe
d018a31b0a Me speak english good. ya! 2014-11-11 03:58:57 +01:00
NiLuJe
dbe816062b Be consistent in how we refer to stuff 2014-11-11 03:39:47 +01:00
NiLuJe
041f11cba0 Tweak some comments 2014-11-11 02:42:07 +01:00
NiLuJe
a4a50b3d0d Fix the REAGL logic.
Never use REAGL to handle UI elements. It makes for a much smoother
experience.
2014-11-11 02:28:41 +01:00
NiLuJe
656a2c7cb6 Actually do what the comment says.
Don't hijack forced partial updates (i.e., from UI elements) on always
FULL REAGL devices. It doesn't implode if we don't, and it makes for a
snappier UI.
2014-11-11 02:15:08 +01:00
NiLuJe
3ce10b697a Moar comments! 2014-11-11 01:27:44 +01:00
NiLuJe
8cfbcca7c5 More comments on the H2O weirdness... 2014-11-11 01:25:44 +01:00
NiLuJe
a44c5e99d1 Use the proper constants for Kobo's waveform modes 2014-11-11 00:48:19 +01:00
NiLuJe
a2f107075d Shot in the dark at matching the H2O's behavior... 2014-11-10 20:04:34 +01:00
Frans de Jonge
ca75b7a030 Add usage note to unschedule 2014-11-09 16:38:58 +01:00
NiLuJe
d340159de8 Simplify the whole wait_for_marker commit.
Companion commit to the same stuff in base ;).
2014-11-08 15:50:57 +01:00
NiLuJe
cd7e9c3257 First stab at revamping the wait for marker stuff
WIP, untested, can probably simplified some more.
Good news is, it should be smarter, and thus provide a smoother user
experience :).
Relies on the relevant changes in base.
2014-11-08 15:50:57 +01:00
NiLuJe
d488ca43fa Some potentially fun stuff TODO :) 2014-11-08 15:50:56 +01:00
NiLuJe
ed6f027d68 Whee, the eink driver was updated for the KT2/KV! 2014-11-08 15:50:56 +01:00
NiLuJe
76c3a3aa44 Minor comment tweaks 2014-11-08 15:50:56 +01:00
NiLuJe
b3137736c8 Don't highjack regional updates on REAGL devices
We wouldn't want those to become full updates ;).
Also apply an optionally different waveform mode for such partial,
regional updates (right now, only Kindle devices make use of this finer
grained control).
2014-11-08 15:50:56 +01:00
NiLuJe
25adccbcd6 More notes for tomorrow 2014-11-08 15:50:56 +01:00
NiLuJe
374d993355 One more thing to look into/fix... 2014-11-08 15:50:56 +01:00
NiLuJe
13b02cbad9 Request regal waveform on phoenix & dahlia
Depends on the corresponding changes in koreader-base ;)
2014-11-08 15:50:56 +01:00
NiLuJe
1c22c38a5d Review some of my waveform switcheroo logic... 2014-11-08 15:50:56 +01:00
HW
9a7834113b Merge pull request #1097 from Frenzie/master
Implement UIManager:unschedule(action). Fixes #1007.
2014-11-06 17:53:35 +01:00
Frans de Jonge
8cd80288a0 Implement UIManager:unschedule(action). Fixes #1007. 2014-11-06 12:59:00 +01:00
chrox
dd308f6be1 allow closing non-existent widget but throw a warning 2014-11-06 14:00:47 +08:00
chrox
3a1fe689e2 update multiple screen regions
This is useful when updating keyboard and inputbox.
2014-11-05 12:28:28 +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
84029e9694 add modal widget type that will stay on the top of window stack
ConfirmBox and InfoMessage are default to be modal.
Now returning to filamanager after highlighting a PDF page
the confirmbox asking users to save the document will not be hidden by
the filamanager window.
And it's tested on Kindle that #791 is already been solved probably by
out refacorting of MuPDF backend.
2014-10-30 16:01:04 +08:00
chrox
9adf8ac327 also paint widget if any widget underneath is dirty 2014-09-29 14:23:38 +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
40bddf0735 emulate Power button with F2 on emulator 2014-08-26 18:10:26 +08:00