Files
Crosspoint/src/util/ScreenshotInfo.h
T
Jon Stieglitz 2f969a93b4 feat: context-aware screenshot filenames with book title (#1589)
## Summary

I love the new screenshot feature but I can tell that soon I'm gonna
have a folder full of screenshots and not know what's what. It would be
great if the folder could self organize.

When a screenshot is taken while reading, the filename would now include
the book title, chapter (EPUB), page number, and progress percentage.

Example: My-Great-Book_ch3_p5_42pct_12345.bmp

* **What is the goal of this PR?** (e.g., Implements the new feature for
file uploading.)
* **What changes are included?**

## Additional Context

* Non-reader screens keep the existing screenshot-<millis>.bmp naming.

---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? _**< YES >**_

I reviewed all the changes but I don't have any experience with this
project so this is my best guess
2026-04-30 13:56:45 -05:00

13 lines
502 B
C++

#pragma once
#include <cstdint>
struct ScreenshotInfo {
enum class ReaderType : uint8_t { None, Epub, Txt, Xtc };
ReaderType readerType = ReaderType::None;
char title[64] = {}; // Sanitized, truncated book title (null-terminated)
int spineIndex = -1; // EPUB only: current spine/chapter index
int currentPage = 0; // 1-based page number
int totalPages = 0; // Total pages in chapter (EPUB) or book (TXT/XTC)
int progressPercent = 0; // 0-100 whole-book progress
};