Commit Graph
132 Commits
Author SHA1 Message Date
jpirnay 3b8b389408 Refactor Settings usage 2026-04-17 15:38:37 +02:00
jpirnay 51e6be58c8 Merge pull request #82 from jpirnay/feat-globalbookmarks
feat: Add global bookmarks screen
2026-04-15 10:52:04 +02:00
jpirnay 65107d9891 fix ghosting regression when opening subactivity from within reader 2026-04-15 09:57:08 +02:00
jpirnay 2f4cea3706 Add Global Bookmark feature 2026-04-15 09:32:52 +02:00
jpirnay f9f856f961 Extending 2026-04-14 18:23:10 +02:00
jpirnay 4aabcc934c Integrate and extend pr 1372 by andreaturchet 2026-04-14 18:22:54 +02:00
jpirnay b39c4710d2 Integrate upstream 1626 + 1658 2026-04-14 10:00:46 +02:00
jpirnay d4a7c156f2 Deal with out of bounds scenario 2026-04-13 20:42:51 +02:00
jpirnay a03d232dd3 Finalize implementation 2026-04-13 20:24:28 +02:00
jpirnay 1c3ba11563 Attempt at closing reader and sync 2026-04-13 19:10:32 +02:00
jpirnay df82061ceb Merge pull request #44 from jpirnay/chore-mutex
chore: Add a couple of mutex locks
2026-04-08 19:48:44 +02:00
jpirnay 72a2a91550 Add UI support for darkness levels 2026-04-08 19:24:17 +02:00
jpirnay e719d3d457 Put things out of loop 2026-04-08 14:43:16 +02:00
jpirnay 07906853d6 Add aditional RenderLocks 2026-04-08 14:17:43 +02:00
jpirnay b3d6562cb6 Fix power button leak on startup 2026-04-08 10:14:35 +02:00
jpirnay 54034f3af2 Merge pull request #37 from jpirnay/refactor-koreader
refactor: refactor koreader to avoid OOM regressions
2026-04-07 22:36:32 +02:00
jpirnay 16fd0bbba1 Refresh screen on reader exit to heal ghosting 2026-04-07 22:10:17 +02:00
jpirnay 6dd905fb5a Split menu actions for smaller footprint 2026-04-07 21:39:03 +02:00
jpirnay abbf69649e Revert "Merge pull request #25 from jpirnay/fix-pr1582" and refactor koreader 2026-04-07 20:24:51 +02:00
jpirnay f75bbf5b1e Short press will go back to origin / long press will go back to home 2026-04-05 21:37:28 +02:00
jpirnay 25207d57cb Address cppcheck complaints 2026-04-04 09:43:15 +02:00
jpirnay 1d3405318c Integrate PT 1455 2026-03-26 11:16:53 +01:00
nscheung d8334e9fa4 Adjust navigation at end of book to home page on forward press
(cherry picked from commit deb6ff3b9d1a284594540513f19a3191936915c9)
2026-03-25 20:16:47 +01:00
jpirnay f87aec499e Merge branch 'master' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-24 09:15:47 +01:00
Zach Nelson 44d7a15b12 fix: Overlapping battery percentage on image pages with anti-aliasing (#1452)
## Summary

**What is the goal of this PR?**

When viewing a page with images and anti-aliasing enabled, the
`imagePageWithAA` path renders the page twice with fast refreshes (blank
image area, then restore). Both passes called `renderStatusBar()`, which
reads the battery percentage live. If the value changed between the two
renders (e.g. 88% -> 87%), the digits would overlap on screen.
Fix: Removed the redundant `renderStatusBar()` from the second BW
render. The status bar is already drawn and displayed in the first pass,
and only the image area needs restoration.

---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? _**NO**_
2026-03-23 22:05:15 +00:00
jpirnay 2b1cdcd85e yaclf 2026-03-23 18:45:25 +01:00
jpirnay 3c4dd90bc1 Merge branch 'feat-kosync-onlongpress' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-23 13:31:19 +01:00
jpirnay b4dfd168ba Nitpick comments 2026-03-23 13:29:52 +01:00
jpirnay e0ee59cbdf Merge branch 'feat-kosync-onlongpress' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-23 12:42:23 +01:00
jpirnay ad6036c162 regular menu action if no koreader credentials are defined 2026-03-23 12:23:21 +01:00
jpirnay a78cbf9bd1 fix 2026-03-23 12:09:48 +01:00
jpirnay 9d5d468d86 Merge branch 'feat-indexing-feedback' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-23 12:03:00 +01:00
jpirnay 84e3850d5d Merge branch 'feat-kosync-onlongpress' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-23 12:02:25 +01:00
jpirnay dad37ecf3c Call KoSyncActivity on long press of confirmation button 2026-03-23 12:02:03 +01:00
jpirnay 2d1f635f10 Provide visual progress feedback during indexing 2026-03-23 11:29:33 +01:00
jpirnayandClaude Opus 4.6 b625b8bd26 Add paragraph index LUT for accurate KOReader position sync
Store per-page paragraph indices in section cache to enable precise
XPath-to-page and page-to-XPath mapping without reparsing XHTML.

Forward path (upload): generates XPath directly from paragraph LUT
instead of byte-offset estimation, eliminating drift in chapters
with non-uniform content density.

Reverse path (download): resolves incoming KOReader XPath p[N] to
the exact page via paragraph LUT lookup.

Paragraph counter counts all <p> elements including display:none
to match ChapterXPathIndexer and crengine's standard XPath counting.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 12:29:26 +01:00
jpirnay 70f53871f7 Fix 2 2026-03-20 18:44:30 +01:00
jpirnay b240ef1e21 Merge branch 'feat-localoverride' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-20 18:38:23 +01:00
jpirnay 09e65c30a3 Local overrides for css and img display 2026-03-20 18:17:34 +01:00
jpirnay c149700689 Merge branch 'master' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-20 09:44:34 +01:00
LSTARandJake Kenneally 2ab4e30b9a feat: Implement silent pre-indexing for the next chapter in EpubReaderActivity (#979)
## Summary

* A simple tweak to pre-index the next chapter silently during normal
reading.
* Triggers silent pre-indexing of the next chapter when the penultimate
page of a chapter is rendered to reduce visible interruptions.
* Keeps existing indexing with popup when a reader jumps directly into
an unindexed chapter.

## Additional Context

* Reader input is temporarily blocked during silent indexing to avoid
navigation/index state conflicts.
* The penultimate page is used because readers typically spend longer
there than on the final page.
* This change optimizes linear reading flow while preserving reliable
indexing for non-linear navigation.

## Possible Improvements

* Add a setting for First Page Indexing vs Penultimate Page Pre-indexing
* Display an indexing icon in the status bar instead of using a popup
that overlaps book text.

Tested on device:

https://www.dropbox.com/scl/fi/29g5kjqgsi5e4hgujv38u/Silent-Indexing.MOV?rlkey=yemi4mosmev5vicaa7gpe49qw&dl=0

---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? _**YES**_

---------

Co-authored-by: Jake Kenneally <jakekenneally@gmail.com>
2026-03-19 23:20:26 -05:00
jpirnay 7a940d0a4b Fix 2026-03-13 21:38:29 +01:00
jpirnay 9b70ddc93b Merge branch 'master' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-13 21:24:04 +01:00
Adrian Wilkins-Caruana 1409259721 perf: font-compression improvements (#1056)
## Purpose

This PR includes some preparatory changes that are needed for an
upcoming performant CJK font feature. The changes have no impact on
render time and heap allocation for latin text. **Despite this, I think
these changes stand on their own as a better font
compression/decompression implementation.**

## Summary

- Font decompressor rewrite: Replaced the 4-slot LRU group cache with a
two-tier system — a page buffer (glyphs prewarmed before rendering
begins) and a hot-group fallback (last decompressed group retained for
non-prewarmed
  glyphs). 
- Byte-aligned compressed bitmap format: Glyph bitmaps within compressed
groups are now stored row-padded rather than tightly packed before
DEFLATE compression, improving compression ratios by making identical
pixel rows produce
identical byte patterns. Glyphs are compacted back to packed format on
demand at render time. Reduces flash size by 155 KB.
- Page prewarm system: Added `Page::collectText` and
`Page::getDominantStyle` to extract per-style glyph requirements before
rendering, and `GfxRenderer::prewarmFontCache` to pre-decompress only
the groups needed for the dominant style
   — eliminating mid-render decompression for the common case.
- UTF-8 robustness fixes: `utf8NextCodepoint` now validates continuation
bytes and returns a replacement glyph on malformed input;
`ChapterHtmlSlimParser` correctly preserves incomplete multi-byte
sequences across word-buffer flush
  boundaries rather than splitting them.

---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? _**YES**_ Architecture and
design was done by me, refined a bit by Claude. Code mostly by Claude,
but not entirely.
2026-03-11 21:05:46 +01:00
Uri Tauber c986a274ee refactor: reader utils (#1329)
## Summary

Extract shared reader utilities (`ReaderUtils.h`) to reduce duplication
across `EpubReaderActivity`, `TxtReaderActivity`, and (upcoming)
`MarkdownReaderActivity`.

  Utilities extracted:

   - `applyOrientation()` — orientation switch logic
   - `detectPageTurn()` — page navigation input detection
   - `renderAntiAliased()` — grayscale anti-aliasing pass
   - `displayWithRefreshCycle()` — refresh mode cadence
   - `GO_HOME_MS` — back button timing constant

  ## Impact

Flash: 32 bytes saved (6006441 → 6006409 bytes). Minimal immediate gain,
but meaningful once markdown reader and future reader types share these
functions.

Code quality: Eliminates ~100 lines of duplicated logic spread across
multiple files. All readers now follow the same patterns for
orientation, input handling, and rendering.

  ## Rationale

This refactor is preparation for markdown support, which requires
identical input and rendering logic. Instead of copy-pasting these
patterns a third time, all readers now share a single, tested
implementation. Future reader types can reuse `ReaderUtils` without
duplication.

  ---

  ## AI Usage

Did you use AI tools to help write this code? YES Claude extracted the
code, under my guidance. Tested on my device and seems to work fine.
2026-03-08 11:45:54 -05:00
jpirnay 786fbfa7c1 Merge branch 'feat-page-overlay' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-08 09:55:09 +01:00
jpirnay 3ed96a7e49 Use and populate metadata 2026-03-07 18:02:21 +01:00
jpirnay 34a96d717d Merge branch 'master' of https://github.com/crosspoint-reader/crosspoint-reader into feat-page-overlay 2026-03-07 10:22:18 +01:00
Uri Tauber 8fbb37b359 feat: footnote anchor navigation (#1245)
## Summary: Enable footnote anchor navigation in EPUB reader

This PR extracts the core anchor-to-page mapping mechanism from PR #1143
(TOC fragment navigation) to provide immediate footnote navigation
support. By merging this focused subset first, users get a complete
footnote experience now while simplifying the eventual review and merge
of the full #1143 PR.

  ---

## What this extracts from PR #1143

PR #1143 implements comprehensive TOC fragment navigation for EPUBs with
multi-chapter spine files. This PR takes only the anchor resolution
infrastructure:

- Anchor-to-page mapping in section cache: During page layout,
ChapterHtmlSlimParser records which page each HTML id attribute lands
on, serializing the map into the .bin cache file.
- Anchor resolution in `EpubReaderActivity`: When navigating to a
footnote link with a fragment (e.g., `chapter2.xhtml#note1`), the reader
resolves the anchor to a page number and jumps directly to it.
- Section file format change: Bumped to version 15, adds anchor map
offset in header.

  ---

## Simplified scope vs. PR #1143

To minimize conflicts and complexity, this PR differs from #1143 in key
ways:

* **Anchors tracked**
  * **Origin:** Only TOC anchors (passed via `std::set`)
  * **This branch:** All `id` attributes

* **Page breaks**
  * **Origin**: Forces new page at TOC chapter boundaries
  * **This branch:** None — natural flow

* **TOC integration**
  * **Origin**: `tocBoundaries`, `getTocIndexForPage()`, chapter skip
  * **This branch:** None — just footnote links

* **Bug fix**
  * **This branch:** Fixed anchor page off-by-1/2 bug


The anchor recording bug (recording page number before `makePages()`
flushes previous block) was identified and fixed during this extraction.
The fix uses a deferred `pendingAnchorId` pattern that records the
anchor after page completion.

  ---

## Positioning for future merge

Changes are structured to minimize conflicts when #1143 eventually
merges:

- `ChapterHtmlSlimParser.cpp` `startElement()`: Both branches rewrite
the same if `(!idAttr.empty())` block. The merged version will combine
both approaches (TOC anchors get page breaks + immediate recording;
footnote anchors get deferred recording).
- `EpubReaderActivity.cpp` `render()`: The `pendingAnchor` resolution
block is positioned at the exact same insertion point where #1143 places
its `pendingTocIndex` block (line 596, right after `nextPageNumber`
assignment). During merge, both blocks will sit side-by-side.
   
  ---

## Why merge separately?

1. Immediate user value: Footnote navigation works now without waiting
for the full TOC overhaul
   2. Easier review: ~100 lines vs. 500+ lines in #1143 
3. Bug fix included: The page recording bug is fixed here and will carry
into #1143
4. Minimal conflicts: Structured for clean merge — both PRs touch the
same files but in complementary ways
---

### AI Usage

Did you use AI tools to help write this code? _**< YES >**_ Done by
Claude Opus 4.6
2026-03-06 21:10:45 +03:00
jpirnay f5cc2915d7 Sync to new master 2026-03-05 18:29:33 +01:00