- Fix device freeze at end-of-book by deferring EndOfBookMenuActivity creation from render() to loop() (avoids RenderLock deadlock) in EpubReaderActivity and XtcReaderActivity - Add initialSkipRelease to BookManageMenuActivity to prevent stale Confirm release from triggering actions when opened via long-press - Add initialSkipRelease to MyLibraryActivity for long-press Browse Files -> archive navigation - Thread skip-release through HomeActivity callback and main.cpp - Fix HomeActivity stale cover buffer after archive/delete by fully resetting render state (freeCoverBuffer, firstRenderDone, etc.) - Swap short/long-press actions in .archive context: short-press opens manage menu, long-press unarchives and opens the book - Add deferred open pattern (pendingOpenPath) to wait for Confirm release before navigating to reader after unarchive - Add BookManager::cleanupEmptyArchiveDirs() to remove empty parent directories after unarchive/delete inside .archive - Add optional unarchivedPath output parameter to BookManager::unarchiveBook - Restyle EndOfBookMenuActivity to standard list layout with proper header, margins, and button hints matching other screens - Change EndOfBookMenuActivity back button hint to "« Back" - Add Table of Contents option to EndOfBookMenuActivity Co-authored-by: Cursor <cursoragent@cursor.com>
41 lines
1.1 KiB
C++
41 lines
1.1 KiB
C++
/**
|
|
* XtcReaderActivity.h
|
|
*
|
|
* XTC ebook reader activity for CrossPoint Reader
|
|
* Displays pre-rendered XTC pages on e-ink display
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <Xtc.h>
|
|
|
|
#include "activities/ActivityWithSubactivity.h"
|
|
|
|
class XtcReaderActivity final : public ActivityWithSubactivity {
|
|
std::shared_ptr<Xtc> xtc;
|
|
|
|
uint32_t currentPage = 0;
|
|
int pagesUntilFullRefresh = 0;
|
|
|
|
bool endOfBookMenuOpened = false;
|
|
bool pendingEndOfBookMenu = false;
|
|
const std::function<void()> onGoBack;
|
|
const std::function<void()> onGoHome;
|
|
|
|
void renderPage();
|
|
void saveProgress() const;
|
|
void loadProgress();
|
|
|
|
public:
|
|
explicit XtcReaderActivity(GfxRenderer& renderer, MappedInputManager& mappedInput, std::unique_ptr<Xtc> xtc,
|
|
const std::function<void()>& onGoBack, const std::function<void()>& onGoHome)
|
|
: ActivityWithSubactivity("XtcReader", renderer, mappedInput),
|
|
xtc(std::move(xtc)),
|
|
onGoBack(onGoBack),
|
|
onGoHome(onGoHome) {}
|
|
void onEnter() override;
|
|
void onExit() override;
|
|
void loop() override;
|
|
void render(Activity::RenderLock&&) override;
|
|
};
|