mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-06 23:57:39 +03:00
clang-format-fix
This commit is contained in:
parent
4f227ec277
commit
e97bcb717e
@ -53,7 +53,6 @@ bool Page::serialize(FsFile& file) const {
|
||||
file.write(&isInlineFlag, 1);
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#include <SdFat.h>
|
||||
#include <vector>
|
||||
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "FootnoteEntry.h"
|
||||
#include "blocks/TextBlock.h"
|
||||
|
||||
@ -163,8 +163,6 @@ bool Section::loadSectionFile(const int fontId, const float lineCompression, con
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool Section::clearCache() const {
|
||||
if (!SdMan.exists(filePath.c_str())) {
|
||||
Serial.printf("[%lu] [SCT] Cache does not exist, no action needed\n", millis());
|
||||
|
||||
@ -273,7 +273,6 @@ void XMLCALL ChapterHtmlSlimParser::startElement(void* userData, const XML_Char*
|
||||
// PASS 2: Normal parsing
|
||||
// ============================================================================
|
||||
|
||||
|
||||
// Middle of skip
|
||||
if (self->skipUntilDepth < self->depth) {
|
||||
self->depth += 1;
|
||||
@ -293,9 +292,12 @@ void XMLCALL ChapterHtmlSlimParser::startElement(void* userData, const XML_Char*
|
||||
if (self->partWordBufferIndex > 0) {
|
||||
// Copy of the existing flush logic
|
||||
EpdFontFamily::Style fontStyle = EpdFontFamily::REGULAR;
|
||||
if (self->boldUntilDepth < self->depth && self->italicUntilDepth < self->depth) fontStyle = EpdFontFamily::BOLD_ITALIC;
|
||||
else if (self->boldUntilDepth < self->depth) fontStyle = EpdFontFamily::BOLD;
|
||||
else if (self->italicUntilDepth < self->depth) fontStyle = EpdFontFamily::ITALIC;
|
||||
if (self->boldUntilDepth < self->depth && self->italicUntilDepth < self->depth)
|
||||
fontStyle = EpdFontFamily::BOLD_ITALIC;
|
||||
else if (self->boldUntilDepth < self->depth)
|
||||
fontStyle = EpdFontFamily::BOLD;
|
||||
else if (self->italicUntilDepth < self->depth)
|
||||
fontStyle = EpdFontFamily::ITALIC;
|
||||
|
||||
self->partWordBuffer[self->partWordBufferIndex] = '\0';
|
||||
self->currentTextBlock->addWord(std::move(replaceHtmlEntities(self->partWordBuffer)), fontStyle);
|
||||
@ -611,7 +613,6 @@ void XMLCALL ChapterHtmlSlimParser::characterData(void* userData, const XML_Char
|
||||
void XMLCALL ChapterHtmlSlimParser::endElement(void* userData, const XML_Char* name) {
|
||||
auto* self = static_cast<ChapterHtmlSlimParser*>(userData);
|
||||
|
||||
|
||||
// Closing paragraph note in Pass 1
|
||||
if (strcmp(name, "p") == 0 && self->insideParagraphNote && self->depth - 1 == self->paragraphNoteDepth) {
|
||||
if (self->isPass1CollectingAsides && self->currentParagraphNoteTextLen > 0 && self->paragraphNoteCount < 32 &&
|
||||
@ -691,7 +692,6 @@ void XMLCALL ChapterHtmlSlimParser::endElement(void* userData, const XML_Char* n
|
||||
// [MODIFIED] 2. Handle 'a' tags (Anchors/Footnotes)
|
||||
// We check "a" generally now, to handle both Noterefs AND resetting regular links
|
||||
if (strcmp(name, "a") == 0) {
|
||||
|
||||
// Track if this was a noteref so we can return early later
|
||||
bool wasNoteref = self->insideNoteref;
|
||||
|
||||
@ -758,7 +758,6 @@ void XMLCALL ChapterHtmlSlimParser::endElement(void* userData, const XML_Char* n
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (self->partWordBufferIndex > 0) {
|
||||
const bool shouldBreakText =
|
||||
matches(name, BLOCK_TAGS, NUM_BLOCK_TAGS) || matches(name, HEADER_TAGS, NUM_HEADER_TAGS) ||
|
||||
|
||||
@ -8,10 +8,8 @@
|
||||
#include "CrossPointSettings.h"
|
||||
#include "CrossPointState.h"
|
||||
#include "EpubReaderChapterSelectionActivity.h"
|
||||
|
||||
#include "EpubReaderFootnotesActivity.h"
|
||||
#include "EpubReaderMenuActivity.h"
|
||||
|
||||
#include "MappedInputManager.h"
|
||||
#include "RecentBooksStore.h"
|
||||
#include "ScreenComponents.h"
|
||||
@ -205,7 +203,6 @@ void EpubReaderActivity::loop() {
|
||||
onGoBack();
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const bool prevReleased = mappedInput.wasReleased(MappedInputManager::Button::PageBack) ||
|
||||
@ -414,7 +411,8 @@ void EpubReaderActivity::renderScreen() {
|
||||
return renderScreen();
|
||||
}
|
||||
|
||||
Serial.printf("[%lu] [ERS] Page loaded: %d elements, %d footnotes\n", millis(), p->elements.size(), p->footnotes.size());
|
||||
Serial.printf("[%lu] [ERS] Page loaded: %d elements, %d footnotes\n", millis(), p->elements.size(),
|
||||
p->footnotes.size());
|
||||
|
||||
// Copy footnotes from page to currentPageFootnotes
|
||||
currentPageFootnotes.clear();
|
||||
@ -499,7 +497,6 @@ void EpubReaderActivity::renderStatusBar(const int orientedMarginRight, const in
|
||||
const auto screenHeight = renderer.getScreenHeight();
|
||||
const auto textY = screenHeight - orientedMarginBottom - 4;
|
||||
|
||||
|
||||
if (showProgress) {
|
||||
// Calculate progress in book
|
||||
// TODO: use progress values for UI
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
#include <freertos/semphr.h>
|
||||
#include <freertos/task.h>
|
||||
|
||||
#include "activities/ActivityWithSubactivity.h"
|
||||
#include "EpubReaderFootnotesActivity.h"
|
||||
#include "activities/ActivityWithSubactivity.h"
|
||||
|
||||
class EpubReaderActivity final : public ActivityWithSubactivity {
|
||||
std::shared_ptr<Epub> epub;
|
||||
|
||||
@ -14,8 +14,6 @@ constexpr int SKIP_PAGE_MS = 700;
|
||||
|
||||
bool EpubReaderChapterSelectionActivity::hasSyncOption() const { return KOREADER_STORE.hasCredentials(); }
|
||||
|
||||
|
||||
|
||||
int EpubReaderChapterSelectionActivity::getPageItems() const {
|
||||
// Layout constants used in renderScreen
|
||||
constexpr int startY = 60;
|
||||
|
||||
@ -27,7 +27,6 @@ class EpubReaderChapterSelectionActivity final : public ActivityWithSubactivity
|
||||
// This adapts automatically when switching between portrait and landscape.
|
||||
int getPageItems() const;
|
||||
|
||||
|
||||
// Check if sync option is available (credentials configured)
|
||||
bool hasSyncOption() const;
|
||||
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
#include "EpubReaderFootnotesActivity.h"
|
||||
|
||||
#include <GfxRenderer.h>
|
||||
#include <EpdFontFamily.h>
|
||||
#include <GfxRenderer.h>
|
||||
|
||||
#include "fontIds.h"
|
||||
#include "MappedInputManager.h"
|
||||
#include "fontIds.h"
|
||||
|
||||
void EpubReaderFootnotesActivity::onEnter() {
|
||||
selectedIndex = 0;
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
#include "EpubReaderMenuActivity.h"
|
||||
|
||||
#include <GfxRenderer.h>
|
||||
#include <EpdFontFamily.h>
|
||||
#include <GfxRenderer.h>
|
||||
|
||||
#include "fontIds.h"
|
||||
#include "MappedInputManager.h"
|
||||
#include "fontIds.h"
|
||||
|
||||
constexpr int MENU_ITEMS_COUNT = 2;
|
||||
|
||||
@ -39,10 +39,10 @@ void EpubReaderMenuActivity::onExit() {
|
||||
}
|
||||
|
||||
void EpubReaderMenuActivity::loop() {
|
||||
const bool prevReleased =
|
||||
mappedInput.wasReleased(MappedInputManager::Button::Up) || mappedInput.wasReleased(MappedInputManager::Button::Left);
|
||||
const bool nextReleased =
|
||||
mappedInput.wasReleased(MappedInputManager::Button::Down) || mappedInput.wasReleased(MappedInputManager::Button::Right);
|
||||
const bool prevReleased = mappedInput.wasReleased(MappedInputManager::Button::Up) ||
|
||||
mappedInput.wasReleased(MappedInputManager::Button::Left);
|
||||
const bool nextReleased = mappedInput.wasReleased(MappedInputManager::Button::Down) ||
|
||||
mappedInput.wasReleased(MappedInputManager::Button::Right);
|
||||
|
||||
if (mappedInput.wasReleased(MappedInputManager::Button::Confirm)) {
|
||||
onSelectOption(static_cast<MenuOption>(selectorIndex));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user