mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2025-12-18 07:07:41 +03:00
* First pass at moving to SDK EInkDisplay library * Add 2-bit grayscale text and anti-aliased rendering of text * Render status bar for empty chapters * Refresh screen every 15 pages to avoid ghosting * Simplify boot and sleep screens * Give FileSelectionScreen task more stack memory * Move text around slightly on Boot and Sleep screens * Re-use existing buffer and write to whole screen for 'partial update'
31 lines
692 B
C++
31 lines
692 B
C++
#pragma once
|
|
#include "Epub.h"
|
|
|
|
class Page;
|
|
class EpdRenderer;
|
|
|
|
class Section {
|
|
Epub* epub;
|
|
const int spineIndex;
|
|
EpdRenderer& renderer;
|
|
std::string cachePath;
|
|
|
|
void onPageComplete(const Page* page);
|
|
|
|
public:
|
|
int pageCount = 0;
|
|
int currentPage = 0;
|
|
|
|
explicit Section(Epub* epub, const int spineIndex, EpdRenderer& renderer)
|
|
: epub(epub), spineIndex(spineIndex), renderer(renderer) {
|
|
cachePath = epub->getCachePath() + "/" + std::to_string(spineIndex);
|
|
}
|
|
~Section() = default;
|
|
void writeCacheMetadata() const;
|
|
bool loadCacheMetadata();
|
|
void setupCacheDir() const;
|
|
void clearCache() const;
|
|
bool persistPageDataToSD();
|
|
Page* loadPageFromSD() const;
|
|
};
|