| Age | Commit message (Collapse) | Author | Files | Lines |
|
Add a get_doc_handle virtual method to EvDocumentClass so the view layer
can obtain the underlying GepubDoc without depending on backend types
directly. This prepares for replacing EvWebView with GepubWidget which
needs the GepubDoc to render content.
Assisted-by: OpenCode:claude-opus-4-6
|
|
Remove the bundled minizip directory, unused includes, and the night
mode virtual methods from EvDocumentClass which are no longer called by
any code. Night mode is now handled entirely through WebKit user
stylesheets.
Assisted-by: OpenCode:claude-opus-4-6
|
|
Pre-compute all page URI paths at load time so get_page is thread-safe
and does not mutate GepubDoc state. Remove the EvDocumentFind interface
because the threaded find job is incompatible with the single-threaded
GepubDoc and WebKit. EPUB search will be reimplemented using WebKit's
native find controller in a future commit.
Assisted-by: OpenCode:claude-opus-4-6
|
|
Replace the old approach of modifying extracted HTML files on disk with
a WebKitUserStyleSheet injected via the WebKitUserContentManager. This
is cleaner and works with the new libgepub backend which no longer
extracts files to a temporary directory.
Assisted-by: OpenCode:claude-opus-4-6
|
|
Replace the hand-rolled EPUB parsing with libgepub. This removes the
bundled minizip library, custom XML utilities, and temporary directory
extraction in favor of GepubDoc which handles archive access, metadata,
spine navigation, and table of contents. An epub:// URI scheme handler
serves resources directly from the archive without extracting to disk.
Search and night mode are stubbed as no-ops pending follow-up commits.
Assisted-by: OpenCode:claude-opus-4-6
|
|
Add libgepub as a required dependency for the EPUB backend in both meson
and autotools build systems. No source code changes yet, but this
prepares for replacing the hand-rolled EPUB parsing with libgepub.
Assisted-by: OpenCode:claude-opus-4-6
|
|
EPUB files with missing or incomplete metadata (like no title or missing
navigation elements) can cause NULL pointer dereferences in the XML
parsing functions. This adds NULL checks to xml_parse_children_of_node,
get_child_list, and the TOC text parsing loop.
Fixes #707
|
|
Check that the content file exists before attempting to parse it, and
handle failures in document title extraction gracefully.
|
|
Replace manual byte-by-byte copy loop with g_strndup when extracting the
directory component from the epub container's full-path attribute.
|
|
Based on an XReader change[1], look up the MathJax source at configure
time for better portability. If not specified manually, look in the
common locations.
This adds the --with-mathjax-directory=DIR configure option to manually
specify the location, overriding the automatic discovery.
The Meson part already exists, although was not used by the code.
[1]: https://github.com/linuxmint/xreader/commit/9c6f363ad47f33b290d270489e50f7ad6071987a
|
|
Signed-off-by: Oz Tiram <[email protected]>
|
|
Signed-off-by: Oz Tiram <[email protected]>
|
|
Mostly copy and paste from linuxmint/xreader
Signed-off-by: Oz Tiram <[email protected]>
|
|
|
|
* fix a incompatible pointer type warning for gcc14
Co-authored-by: Colomban Wendling <[email protected]>
|
|
This commit also fixes an incorrect sizeof call detected by
AddressSanitizer.
Closes #599
|
|
Test each file's resolved path against the temporary directory
before extracting.
|
|
|
|
instead of epub:id.
Add a null check as well.
ref:
https://help.apple.com/itc/booksassetguide/en.lproj/itc0f175a5b9.html#apdd3c4c6d1c0904
https://idpf.org/epub/301/spec/epub-contentdocs-20140626.html#sec-xhtml-nav
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- tab to spaces
- fix some indents
|
|
|
|
|
|
Fixes the warnings:
backend/comics/comics-document.c:767:21: style: Condition 'bytes<=0' is always true [knownConditionTrueFalse]
backend/epub/minizip/unzip.c:603:25: style: Condition 'unz_copyright[0]!=' '' is always false [knownConditionTrueFalse]
properties/ev-properties-view.c:197:33: style: Condition 'text' is always true [knownConditionTrueFalse]
shell/ev-sidebar-thumbnails.c:598:7: style: Condition '!loading_icon' is always true [knownConditionTrueFalse]
shell/main.c:115:6: style: Condition '!error' is always true [knownConditionTrueFalse]
|
|
|
|
Fixes the build warnings:
ev-window.c:6379:1: warning: function 'menubar_deactivate_cb' is not needed and will not be emitted [-Wunneeded-internal-declaration]
menubar_deactivate_cb (GtkWidget *menubar,
^
epub-document.c:946:1: warning: function 'check_add_page_numbers' is not needed and will not be emitted [-Wunneeded-internal-declaration]
check_add_page_numbers(linknode *listdata, contentListNode *comparenode)
^
|
|
|
|
|
|
|
|
|
|
inspired by:
https://github.com/linuxmint/xreader/commit/63a28f
https://github.com/linuxmint/xreader/issues/165
|
|
origin commit:
https://github.com/linuxmint/xreader/commit/6ed0ee1
Note: origin commit causes some serious build warnings,
......fixed.
|
|
closes https://github.com/mate-desktop/atril/issues/290 which has the original patch
|
|
Once epub support has been implemented, atril crashes with all epubs.
Backtrace for 1.10.2+repack1-1 (Debian Stretch):
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffd26d2700 (LWP 22276)]
0x0000000000000000 in ?? ()
(gdb) bt
#0 0x0000000000000000 in ()
#1 0x00007ffff755914e in ev_job_page_data_run (job=0x9e3850 [EvJobPageData]) at ev-jobs.c:762
#2 0x00007ffff755a85a in ev_job_thread_proxy (job=0x9e3850 [EvJobPageData]) at ev-job-scheduler.c:184
#3 0x00007ffff755a85a in ev_job_thread_proxy (data=<optimized out>) at ev-job-scheduler.c:217
#4 0x00007ffff14e1955 in g_thread_proxy (data=0x7fff84002280) at /build/glib2.0-VKSJTv/glib2.0-2.46.1/./glib/gthread.c:778
#5 0x00007ffff08690a4 in start_thread (arg=0x7fffd26d2700) at pthread_create.c:309
#6 0x00007ffff059e06d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
(gdb)
It turns out it couldn't really work since one function pointer is
uninitialized. But nobody complained. Thus I investigated it further,
why it fails only for me. First, I tried a gtk3 version. And it works
properly, but the broken code is not hit at all. Due to the threaded
design, it was harder to figure out, why. Here is the code path:
-->
ev_window_load_job_cb (shell/ev-window.c) -->
ev_document_model_set_document (libview/ev-document-model.c) -->
ev_view_document_changed_cb (libview/ev-view.c) -->
setup_caches (libview/ev-view.c) -->
if (ev_view_is_a11y_enabled (view)) {
ev_page_cache_set_flags();
}
ev_page_cache_set_flags (libview/ev-page-cache.c) -->
ev_page_cache_set_page_range (libview/ev-page-cache.c) -->
data->job = ev_job_page_data_new (cache->document, i, flags);
...
ev_job_scheduler_push_job (data->job, EV_JOB_PRIORITY_NONE);
...
-->
ev_job_thread_proxy (libview/ev-job-scheduler.c) -->
ev_job_page_data_run (libview/ev-jobs.c) -->
ev_document_links_get_links (libdocument/ev-document-links.c) -->
EvDocumentLinksInterface *iface = EV_DOCUMENT_LINKS_GET_IFACE (document_links);
return iface->get_links (document_links, page);
(get_links == NULL) --> crash
As one can see it depends on the accessibility. And it is enabled on my
box.
It can be reproduced with
gsettings set org.mate.interface accessibility true
(mate logout and login)
Why the enabled accessibility is not discovered by the gtk3 version is
another story. My question [1] was motivated by this.
[1] https://github.com/mate-desktop/atril/issues/171
|
|
closes https://github.com/mate-desktop/atril/issues/158
|
|
because backends manager frees that var already.
actually, adding ev_backends_manager_get_backends_dir to the public
API was still careless. backends manager and epub document jobs seem
to be in the different threads, and there's no mutex seen anywhere
around. luckily, what we have here is just a reading of a variable
that has been assigned only once (in backends_dir function), so it's
not as catastrophic as it would be if it was e.g. concurrent writing
without a mutex.
Closes https://github.com/mate-desktop/atril/pull/124
|
|
Thanks to tibbi <[email protected]> for spotting them.
|
|
|
|
|
|
|
|
|
|
I always thought all ePub documents had either a traditional ncx or an epub3 nav. Now as it turns out,
sometimes neither of these are present. Fixed.
|
|
Toc may include links with strings escaped for URI format. We needed to un-escape them.
|
|
|
|
|