Something went wrong. Try again.
A fork of https://github.com/crosspoint-reader/crosspoint-reader
Something went wrong. Try again.
1.6 kB · 48 lines
C
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849#pragma once
#include <Xtc.h>
#include <memory>#include <string>
#include "ReaderActivity.h"
class XtcReaderActivity final : public ReaderActivity { std::shared_ptr<Xtc> xtc; uint32_t currentPage = 0;
enum class StatusBarOverlayPosition { Bottom, Top }; struct StatusBarInfo { int currentPage; int pageCount; std::string title; };
void renderPage(); void openChapterSelection(); void renderStatusBarOverlay(GfxRenderer& renderer, StatusBarOverlayPosition position) const; StatusBarInfo getStatusBarInfo() const; void saveProgress() const; void loadProgress();
bool loadBook() override; std::string getBookTitle() const override { return xtc ? xtc->getTitle() : ""; } std::string getBookAuthor() const override { return xtc ? xtc->getAuthor() : ""; } std::string getBookThumbBmpPath() const override { return xtc ? xtc->getThumbBmpPath() : ""; } bool handleFormatInput() override; void renderBook() override; void applyInitialOrientation() override;
public: explicit XtcReaderActivity(GfxRenderer& renderer, MappedInputManager& mappedInput, std::string bookPath, bool allowFastInitialRefresh) : ReaderActivity("XtcReader", renderer, mappedInput, std::move(bookPath), allowFastInitialRefresh) {} ~XtcReaderActivity() override = default;
bool pageTurn(bool isForward) override; bool skipPages(int amount) override; bool isAtEndOfBook() const override; void onReturnFromEndOfBook() override;
ScreenshotInfo getScreenshotInfo() const override;};