Commit Graph

1253 Commits (b8ee33871f6cbed6748b3401d29f3c545605b009)

Author SHA1 Message Date
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.
10 years ago
Frans de Jonge 47d7a48555 OPDS: refactored unit test and fixed a minor bug with undefined image_rel 10 years ago
Hans-Werner Hilse 3f9dc46315 fix dict window refresh
was still using old API
also, move this to another place.
10 years ago
Frans de Jonge c25254a7ec OPDS: embryonic unit test for OPDS browser
This initial seed specifically tests against what recently broke in Gutenberg and FeedBooks.
10 years ago
Hans-Werner Hilse f02be20a65 refresh fixes for the menus
this will only refresh the areas that actually need to be refreshed.
10 years ago
Hans-Werner Hilse 6793a4fee1 reader config dialog: properly refresh config pane
This serves as a good example for the way refreshes are done:
setDirty("all", function() ... end)
* the "all" will have all widgets on screen repainted.
  In this case that is needed because the config pane has
  different sizes, covering different parts of underlying
  widgets. So they need to be repainted every time.
* the function will return the area to refresh and is evaluated
  after painting. In this example, we take the area that is covered
  by the config pane before switching it (if present at all), and
  hand it to the refresh area function as an upvalue.
  When the function is called later after painting, it will
  use that saved area and combine it with the area that is covered
  then by the widget. That way, parts that are covered no more are
  included in the refresh area, too.
10 years ago
Hans-Werner Hilse 82c26b1f18 adapt widgets to new refresh/repaint API 10 years ago
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.
10 years ago
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
10 years ago
Andrey Golovizin 296f63b22a OPDS: ignore links with unknown rel values, treat empty rel as rel="subsection". 10 years ago
HW cceac98180 Merge pull request #1298 from Frenzie/master
Language: prevent spaces from disappearing in localizations with util.template
10 years ago
Frans de Jonge 73a6f71a0b Prevent spaces from being eaten by Transifex
Fixes #1276
10 years ago
Frans de Jonge 7a87b66fa1 OPDS catalog: auto-fill http:// if no protocol given and revert #1106
This fixes #1259.
10 years ago
Huang Xin 1b07698952 Merge pull request #1296 from hwhw/imagewidget_alpha
Imagewidget alpha
10 years ago
Hans-Werner Hilse 0c80537003 allow image widgets to do alpha-blitting
when the image (e.g. a PNG) does contain an alpha channel, that can
be honored by ImageWidget. It doesn't do so by default for compatibility
(arguably, we should change that in the future), it has to be enabled
by setting the "alpha" property to "true" (boolean, not string).
10 years ago
Hans-Werner Hilse a82bafc63c fix handling of invalid UTF8 sequences
external data (and in bad cases our own) can contain invalid byte
sequences in UTF8 strings. A prominent example are file names.
There was a 1-off bug in calculating the allowed length for multibyte
chars, and the iterator was a bit too greedy when stumbling upon
invalid sequences, returning a single "invalid" char for a sequence
up to the point where it became invalid in calculation. Now, we present
one invalid char for the first byte of that sequence and then check
for a valid char starting with the next byte.
10 years ago
Huang Xin a72bc33022 Merge pull request #1293 from Frenzie/language
Reworked several strings
10 years ago
Frans de Jonge 693fa0837e Reworked several strings
This is the remaining gruntwork of #1276. I believe that only leaves networkmgr.lua and filemanagersearch.lua, which will require a little more thought.
10 years ago
Huang Xin e835c1e502 Merge pull request #1280 from hwhw/master
fix a case when "ip r" command fails
10 years ago
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.
10 years ago
Hans-Werner Hilse 48610006d5 fix a case when "ip r" command fails
our network manager script isn't the beauty of the code base.
However, this fixes a case where it would crash the reader when an
external command fails.

fixes #1279.
10 years ago
Frans de Jonge cf93605d04 Change "Screen Mode" to "Orientation"
Screen mode isn't user-oriented. Orientation is.

"Page" in "Page Margin" is redundant
10 years ago
chrox ca60ceacd0 make radius field respects popout flag 10 years ago
chrox e1af7f2ed3 prompt users to long press directory to set inbox
This should fix #1233.
10 years ago
chrox 0a06041cd9 fix calculation of widget height of filechooser
the height of filechooser is provided when creating filechooser
widget since there may be no title as in filemanger which needs
a special title widget to contain filemanger menu.
10 years ago
chrox 67693367b9 init width and height of filechooser widget during init
so that everytime a filechooser is inited right dimension
size is used.
10 years ago
Hans-Werner Hilse 21ded080dd fix refactor bug: invalidate update_regions_func 10 years ago
Hans-Werner Hilse 8696ca1fa1 fix old (pre-refactor) refresh call syntax 10 years ago
Hans-Werner Hilse 22697adf20 switch from scaleByDPI() to scaleBySize() 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
HW 7b91935df0 Merge pull request #1230 from chrox/fix_1170
fix #1169 and #1170
10 years ago
chrox d11dba0558 fix #1169 and #1170 10 years ago
chrox 3574865dcb fix #1166 by auto alignment of option name 10 years ago
Frans de Jonge da00b4b8a9 Refactored menu
While looking into #1219 I accidentally ended up refactoring some stuff.

Tested in emulator and on H2O, but be wary because I might have overlooked something.
10 years ago
chrox dbf8faa9b1 remove hardcoded footer height of reader menu 10 years ago
chrox f52872b081 default autoscale for IconButton 10 years ago
chrox e66801039b refactoring: reuse IconButton for config menu bar 10 years ago
Hans-Werner Hilse ab44d1f7e3 fix item number distinction (plural forms) 10 years ago
Frans de Jonge 8b9bbf918c Fix typo in #1176 10 years ago
Frans de Jonge d701d9b198 First util.template encapsulated strings 10 years ago
NiLuJe e9573ebe58 Try to avoid more update_regions_func mismatches
scheduling tricks
10 years ago
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 ^^]
10 years ago
Hans-Werner Hilse 3d03713cb1 implement case-insensitive sort, make default and configurable
This will convert any file name to lowercase before doing the comparison.
Note that this will only work for ASCII character range, a full Unicode
aware solution will be much more complicated. And in the end, file names
are byte arrays, not character strings ;-)

fixes #1183.
10 years ago
Hans-Werner Hilse e031599c0a fix strcoll() workaround
The strcoll() workaround we had in place for Kobo devices was (or has
become) ineffective. We had set self.strcoll to nil on Kobo devices -
but this was the instance variable. Setting it to nil effectively makes
the instance variable vanish, so when trying to access it later, it
was not there and got looked up via the metatable - which had the original
reference. Setting it to nil had no effect whatsoever.

We simplify that approach and set the replacement function where before we
had set this to nil.

This is a partial fix for issue #1183 (and explains a comment in issue #686
which says that the old fix did not work).

However, to really fix #1183 - if we want to do so - we would need a collate
function that normalizes uppercase/lowercase before compare.
10 years ago
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.
10 years ago
Hans-Werner Hilse c22dbbe3ae factor out repaint to its own method
it's gotten complex enough to isolate it
10 years ago
chrox 111ad02143 fix #1154
And koreader release version is normalized to a 10 digits containing
a four digits year field followed by a two digits month field followed
by a four digits revision field like "2014041079".
10 years ago
NiLuJe 13cbed8ea5 Fix partial refreshes on older Kobo devices
Fix #1146 (regression).
10 years ago
NiLuJe 1ee09010c4 Make ScrollTextWidget updates regional
Because I like breaking stuff in fun & interesting ways :D
10 years ago
NiLuJe 3d5dd44a4c Don't hijack "fast" UI refresh w/ the REAGL stuff 10 years ago
Frans de Jonge e5029b54c1 Capitalization: change a few mentions of calibre to lowercase
The author likes it that way. See http://calibre-ebook.com/about
10 years ago
Frans de Jonge ff4e2f3458 Minor English improvements. 10 years ago
chrox efbd7f7b5d schedule in menu option callback
so that new reginal update on menu entry don't
affect screen update from callback results
10 years ago
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 ;).
10 years ago
Qingping Hou 123d0a1230 Merge pull request #1126 from chrox/wifi_toggler
add network settings in reader menu
10 years ago
Qingping Hou fac2e121d2 Merge pull request #1124 from chrox/remember_menutab
remember menu tab index when showing reader menu
10 years ago
chrox 590073e4a8 add network settings in reader menu
and remove the wifi toggler on the footer of each menu page,
so that network status is only checked (currently with the stdout of ip cmd)
when navigating to the "Network settings" submenu instead of checking
on each menu popup.
10 years ago
NiLuJe d018a31b0a Me speak english good. ya! 10 years ago
NiLuJe dbe816062b Be consistent in how we refer to stuff 10 years ago
NiLuJe c3274a9d5e Unbreak FM by reverting 7a812f
:D
10 years ago
NiLuJe b88e304845 Make TouchMenu updates regional 10 years ago
NiLuJe 88c26b4112 Make ConfigDialog updates regional 10 years ago
chrox 95ac27df5c remember menu tab index when showing reader menu 10 years ago
NiLuJe 7a812ff86d Make Button update regional 10 years ago
NiLuJe 39244aa0cb Make ToggleSwitch updates regional 10 years ago
NiLuJe 041f11cba0 Tweak some comments 10 years ago
NiLuJe a4a50b3d0d Fix the REAGL logic.
Never use REAGL to handle UI elements. It makes for a much smoother
experience.
10 years ago
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.
10 years ago
NiLuJe 3ce10b697a Moar comments! 10 years ago
NiLuJe 8cfbcca7c5 More comments on the H2O weirdness... 10 years ago
NiLuJe a44c5e99d1 Use the proper constants for Kobo's waveform modes 10 years ago
NiLuJe 8f3598bec3 Make IconButton updates regional
Beginning of the quest to make menu refreshes slightly smoother ;).
10 years ago
NiLuJe a2f107075d Shot in the dark at matching the H2O's behavior... 10 years ago
NiLuJe a12015c0d1 Force the dictionary popup to do a partial update.
It was done the other way around on purpose, so I probably broke some
very specific use-case ;). Feel free to shout at me ^^.
10 years ago
chrox befa3aa63c normalize version when checking packages in OTA manager
This fixes a bug that version 987 was treated newer than version 1010.
10 years ago
Frans de Jonge ca75b7a030 Add usage note to unschedule 10 years ago
NiLuJe d340159de8 Simplify the whole wait_for_marker commit.
Companion commit to the same stuff in base ;).
10 years ago
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.
10 years ago
NiLuJe d488ca43fa Some potentially fun stuff TODO :) 10 years ago
NiLuJe ed6f027d68 Whee, the eink driver was updated for the KT2/KV! 10 years ago
NiLuJe 76c3a3aa44 Minor comment tweaks 10 years ago
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).
10 years ago
NiLuJe 25adccbcd6 More notes for tomorrow 10 years ago
NiLuJe 374d993355 One more thing to look into/fix... 10 years ago
NiLuJe 13b02cbad9 Request regal waveform on phoenix & dahlia
Depends on the corresponding changes in koreader-base ;)
10 years ago
NiLuJe 1c22c38a5d Review some of my waveform switcheroo logic... 10 years ago
Andrey Golovizin 8bce54a6a0 Ignore OPDS links with unknown rel values. 10 years ago
Andrey Golovizin 5888773c95 Try to fetch next page if loading a new catalog resulted in a single page 10 years ago
Andrey Golovizin 500ad9ba4c Fetch enough items to fill at lest one new page 10 years ago
HW 9a7834113b Merge pull request #1097 from Frenzie/master
Implement UIManager:unschedule(action). Fixes #1007.
10 years ago
HW a7938b1680 Merge pull request #1090 from chrox/fix_869
fix #869
10 years ago
Frans de Jonge 8cd80288a0 Implement UIManager:unschedule(action). Fixes #1007. 10 years ago
chrox dd308f6be1 allow closing non-existent widget but throw a warning 10 years ago
chrox 0dd3a1f8a1 add option to turn off e-ink optimization
which currently just sets free the limitation of panning gestures
emitting rate. This should fix #1039 when unchecking the
"E-ink optimization" in the "Screen settings".
10 years ago
Huang Xin 62eef02c86 Merge pull request #1080 from houqp/fix
fix kobo aura hd input handling
10 years ago
Qingping Hou 6eca26f610 fix(screensaver): lastfile will be nil for fresh installation 10 years ago
chrox bd0975896d add fulltext search for EPUB documents 10 years ago
chrox 8ddca4bf49 close reader config panel when touching reader menu 10 years ago
chrox a766ec51ae only update neccessary screen regions when typing with virtual keyboard 10 years ago
chrox 3a1fe689e2 update multiple screen regions
This is useful when updating keyboard and inputbox.
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
chrox a32991d898 add new sorting methods for file list in filemanager
Now files can be sorted by filename or last accessed time
10 years ago
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.
10 years ago
chrox dfcd67c5bf move screenshot settings to submenu of Screenshot entry in readermenu
And also fix a touchmenu bug that prevent some menu entries
(always at the bottom of the menu) from showing submenus. The reason is
that the onTapSelect method of TouchMenuItem doesn't return true, so that
the tap gesture will propagate to the parent widget and be captured by
touchmenu itself. But at this time the dimen of touchmenu is changed to
the submenu of the tapped menuitem. If the submenu is short enough the
tap will be outside of touchmenu which will cause a TapCloseAllMenus
event and the submenu will never be shown.
10 years ago
chrox 68265336f4 fix #1034 by refactoring path chooser to a download manager
Now directories visible in the filemanager should also
be visible in the path chooser
10 years ago
Michael Hall 79cb75b153 Added option for proportional cover image screensaver 10 years ago
Huang Xin 2dcf65c912 Merge pull request #1049 from gontofe/wifi_toggle
Leave both readerconfig and readermenu open on wifi toggle
10 years ago
Michael Hall dd80d61155 Leave both readerconfig and readermenu open on wifi toggle 10 years ago
Qingping Hou b0682b0470 chore: code clean up 10 years ago
Qingping Hou 394c847e2b fix(app): initilize menu properly in reader and filemanager 10 years ago
Qingping Hou d1627337e0 fix(ui): fix dynamic menu height calculation 10 years ago
Hans-Werner Hilse ba40cc56e9 fill background of intermediary blitbuffers
we need to explicitly fill those buffers, now that white is not "0"
anymore.
10 years ago
Hans-Werner Hilse 5982e24d57 unify color specification
colors were a mixture of 4bpp integers (0=white, 15=black) and
fractional blackness levels (0=white, 1.0=black) before. This is
now unified to use the color specification of the Blitbuffer API.
10 years ago
chrox c994e30cff fix #1024
if toc item has expand/collapse state and tap select on the left side
the state switch action is triggered, otherwise goto the
linked page.
10 years ago
HW 1cb3c85f34 Merge pull request #1021 from chrox/fix_1011
fix #1011
10 years ago
chrox 07ae0cba81 fix #1011
The #1011 bug is caused by the `contains` check of link box with
visible area. When the link is at the very right (left?) of
the page, enlarged link box often exceeds the page bound rendering
the mentioned `contains` check failed. This patch uses an `intersectWith`
test to check if the link is in current page.
10 years ago
Hans-Werner Hilse e0868826ad use new FFI based mupdf API
This will use the new API where the Lua/C interface was used before
and also drop usage of mupdfimg wrapper which is now implemented
within the mupdf interface
10 years ago
chrox 2ad63fc1a3 expand/collapse TOC only by tap on the icon 10 years ago
Qingping Hou c1c3bcb3fe fix: various fixes for kindle dxg 10 years ago
Frans de Jonge f3d5d5b030 Kobo Aura H2O: fix offset for reverse landscape (rotation_mode 3) 10 years ago
Frans de Jonge 7117235414 Kobo Aura H2O: fix bezel. 10 years ago
Frans de Jonge c50bdfd11c Kobo Aura H2O detection: slight code refactoring. 10 years ago
Frans de Jonge 629c32f6ba Changes for Kobo Aura H2O. 10 years ago
chrox f3417c5488 fix #987 10 years ago
chrox 96960cd554 don't dim icon button by default 10 years ago
chrox 7c9130744c add collapsable TOC menu 10 years ago
chrox 46963df0bb don't need to rebuild ota installed package if it's detected 10 years ago
chrox b09bb87d4e refactoring readertoc and readerfooter
so that they don't repeat themselves.
10 years ago
Qingping Hou a44cc3150d fix: use correct entry for Ukrainian in language menu 10 years ago
Qingping Hou 16b393ff47 chore(device.lua): remove frontlight hack for kobo 10 years ago
chrox 330e5a2789 don't open SDL if input device is dummy 10 years ago
Qingping Hou 05e47c8c9c Merge pull request #955 from chrox/network_proxy
http proxy support by setting NETWORK_PROXY variable
10 years ago
Qingping Hou 55cb0271cb Merge pull request #954 from chrox/fix_950
get rid of query filed of baseurl when building href
10 years ago
chrox 3147ffb08a http proxy support by setting NETWORK_PROXY variable
This should implement feature request in #919.
10 years ago
chrox 549f54ab07 get rid of query filed of baseurl when building href
otherwise there will be "?offset=90" query in downloading href
for calibre opds server which doesn't accept the url

This should fix #950.
10 years ago
chrox 7b78d70c74 fix fgcolor of inputbox is always 0.0 10 years ago
chrox 6152198e88 still needs button bgcolor
This bgcolor is for framecontainer background color.
10 years ago
Hans-Werner Hilse 7b1777e095 adapt widgets and text rendering to new font rendering
no background for text rendering anymore
10 years ago
Qingping Hou 7df2e0fb28 Merge pull request #944 from chrox/lazy_loading
refactoring: lazy loading of unused modules
10 years ago
evgsh aae2c4de27 Added acquisition relation types , fixes issue #940 10 years ago
chrox 14e2bf3d69 refatoring: lazy loading of packages 10 years ago
chrox 9adf8ac327 also paint widget if any widget underneath is dirty 10 years ago
chrox 508cf94f98 fix run out of memory when receiving large files from Calibre 10 years ago
Hans-Werner Hilse e47b43e8b5 add implementation of a container widget with alpha-blitting
This is a container that will honor a given alpha value (0..1)
when painting, so it will be translucent for values < 1.
10 years ago
Hans-Werner Hilse adbcdddb56 undo wrong use of addblitFrom()
rendertext.lua did use addblitFrom() for rendering text - i.e. blitting
the letters to a BlitBuffer. However, it used intensity=1.0, which is
the same as doing a (faster, more efficient) blitFrom(). So use that
instead.

What was probably intented here is a different kind of blitting - using
the bitbuffer of the glyph as a mask.
10 years ago
chrox 97e7a90865 encode lfs.dir iterated file path to UTF-8 10 years ago
chrox a0cd4816a7 no mkfifo on Windows 10 years ago
chrox 7d22318641 don't require ssl.https since it cannot yet be built for win32 10 years ago
evgsh aabee1f3bc Update opdsbrowser.lua 10 years ago
chrox 7871af3489 add Calibre Companion plugin
This plugin implements a simple Calibre Companion protocol that
communicates with Calibre Wireless Server from which users can
send documents to Koreader devices directly with WIFI connection.

Note that Calibre Companion(CC) is a trade mark held by MultiPie Ltd.
The Android app Calibre Companion provided by MultiPie is closed-source.
This plugin only implements a subset function of CC according to the
open-source smart device driver from Calibre source tree.

More details can be found at calibre/devices/smart_device_app/driver.py.
10 years ago