mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2025-12-19 15:47:40 +03:00
* white sleep screen * quicker pwr button * no extra spacing between paragraphs * Added settings class with de/serialization and whiteSleepScreen setting to control inverting the sleep screen * Added Settings screen for real, made settings a global singleton * Added setting for extra paragraph spacing. * fixed typo * Rework after feedback * Fixed type from bool to uint8
36 lines
1.2 KiB
C++
36 lines
1.2 KiB
C++
#pragma once
|
|
#include <memory>
|
|
|
|
#include "Epub.h"
|
|
|
|
class Page;
|
|
class GfxRenderer;
|
|
|
|
class Section {
|
|
std::shared_ptr<Epub> epub;
|
|
const int spineIndex;
|
|
GfxRenderer& renderer;
|
|
std::string cachePath;
|
|
|
|
void writeCacheMetadata(int fontId, float lineCompression, int marginTop, int marginRight, int marginBottom,
|
|
int marginLeft, bool extraParagraphSpacing) const;
|
|
void onPageComplete(std::unique_ptr<Page> page);
|
|
|
|
public:
|
|
int pageCount = 0;
|
|
int currentPage = 0;
|
|
|
|
explicit Section(const std::shared_ptr<Epub>& epub, const int spineIndex, GfxRenderer& renderer)
|
|
: epub(epub), spineIndex(spineIndex), renderer(renderer) {
|
|
cachePath = epub->getCachePath() + "/" + std::to_string(spineIndex);
|
|
}
|
|
~Section() = default;
|
|
bool loadCacheMetadata(int fontId, float lineCompression, int marginTop, int marginRight, int marginBottom,
|
|
int marginLeft, bool extraParagraphSpacing);
|
|
void setupCacheDir() const;
|
|
bool clearCache() const;
|
|
bool persistPageDataToSD(int fontId, float lineCompression, int marginTop, int marginRight, int marginBottom,
|
|
int marginLeft, bool extraParagraphSpacing);
|
|
std::unique_ptr<Page> loadPageFromSD() const;
|
|
};
|