summaryrefslogtreecommitdiff
path: root/src/bookmouse.hpp
blob: 95cbd61200e40950fa5f0be4799095a8435642d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifndef BOOKMOUSE_HPP
#define BOOKMOUSE_HPP

#include "archive.hpp"
#include "gl_context.hpp"
#include "imgui_context.hpp"
#include "sdl_context.hpp"
#include "sdl_main_window.hpp"

#include <memory>

namespace bookmouse {

constexpr const char* AppName = "Bookmouse";
constexpr const char* AppVersionString = "1.0.0";

enum class PageLayout : uint8_t
{
    Single,
    Dual,
    Manga
};

class Bookmouse {
  public:
    Bookmouse() noexcept(false);

    int run();

  private:
    SDL_Event pollEvent();
    void updateState();
    void renderFrame();

    void menuing();
    void openDialog();

    void setArchive(std::unique_ptr<Archive>&& archive);

    SdlContext m_sdlContext;
    SdlMainWindow m_mainWindow;
    GlContext m_glContext;
    ImguiContext m_imgui;

    bool m_running{true};
    bool m_openDialog{false};

    std::unique_ptr<Archive> m_archive{nullptr};
    PageLayout m_pageLayout{PageLayout::Single};

    size_t m_pageNumber{0};

    // pageLeft
    // pageRight
    /*
    void setPages();
    void setPages(QLabel& label1, QLabel& label2);
    void setPagesNormal();
    void setPagesDual();
    void setPagesManga();
    */
};

} // namespace bookmouse

#endif