mirror of
https://github.com/SeanOMik/eBookReaderSwitch.git
synced 2025-02-18 08:40:06 +00:00
I've finally gotten a working build. No longer crashes your switch. So far I've only been able to get it to read most PDF files. Some PDF files do crash the app.
51 lines
1.2 KiB
C++
51 lines
1.2 KiB
C++
#ifndef EBOOK_READER_BOOK_READER_HPP
|
|
#define EBOOK_READER_BOOK_READER_HPP
|
|
|
|
#include <mupdf/pdf.h>
|
|
#include <string>
|
|
#include "PageLayout.hpp"
|
|
|
|
struct SDL_Texture;
|
|
|
|
typedef enum {
|
|
BookPageLayoutPortrait,
|
|
BookPageLayoutLandscape
|
|
} BookPageLayout;
|
|
|
|
class BookReader {
|
|
public:
|
|
BookReader(const char *path);
|
|
~BookReader();
|
|
|
|
bool permStatusBar = false;
|
|
|
|
void previous_page(int n);
|
|
void next_page(int n);
|
|
void zoom_in();
|
|
void zoom_out();
|
|
void move_page_up();
|
|
void move_page_down();
|
|
void move_page_left();
|
|
void move_page_right();
|
|
void reset_page();
|
|
void switch_page_layout();
|
|
void draw();
|
|
|
|
BookPageLayout currentPageLayout() {
|
|
return _currentPageLayout;
|
|
}
|
|
|
|
private:
|
|
void show_status_bar();
|
|
void switch_current_page_layout(BookPageLayout bookPageLayout, int current_page);
|
|
|
|
fz_document *doc = NULL;
|
|
int status_bar_visible_counter = 0;
|
|
|
|
BookPageLayout _currentPageLayout = BookPageLayoutPortrait;
|
|
PageLayout *layout = NULL;
|
|
|
|
std::string book_name;
|
|
};
|
|
|
|
#endif
|