summaryrefslogtreecommitdiff
path: root/src/bookmouse.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bookmouse.hpp')
-rw-r--r--src/bookmouse.hpp49
1 files changed, 15 insertions, 34 deletions
diff --git a/src/bookmouse.hpp b/src/bookmouse.hpp
index b2a3a5a..58872d8 100644
--- a/src/bookmouse.hpp
+++ b/src/bookmouse.hpp
@@ -1,49 +1,30 @@
#ifndef BOOKMOUSE_HPP
#define BOOKMOUSE_HPP
-#include "archive.hpp"
-
-#include <QtWidgets>
-#include <cstdint>
-#include <vector>
+#include "gl_context.hpp"
+#include "imgui_context.hpp"
+#include "sdl_context.hpp"
+#include "sdl_main_window.hpp"
namespace bookmouse {
-enum class PageLayout : uint8_t {
- Single,
- Dual,
- Manga
-};
-
-class Bookmouse : public QWidget {
- Q_OBJECT
-
+class Bookmouse {
public:
- friend class BookmouseApp;
- Bookmouse();
+ Bookmouse() noexcept(false);
- public slots:
- void setArchive(Archive* archive);
- void next();
- void back();
+ int run();
private:
- void setPages();
- void setPagesNormal();
- void setPagesDual();
- void setPagesManga();
- void setPages(QLabel& label1, QLabel& label2);
-
- QLayout* m_layout{nullptr};
-
- Archive* m_archive{nullptr};
-
- PageLayout m_pageLayout{PageLayout::Single};
+ SDL_Event pollEvent();
+ void updateState();
+ void renderFrame();
- QLabel m_pageLeft{};
- QLabel m_pageRight{};
+ SdlContext m_sdlContext;
+ SdlMainWindow m_mainWindow;
+ GlContext m_glContext;
+ ImguiContext m_imgui;
- size_t m_pageNumber{0};
+ bool m_running{true};
};
} // namespace bookmouse