forked from od-contrib/commander
-
Notifications
You must be signed in to change notification settings - Fork 0
/
image_viewer.h
40 lines (31 loc) · 979 Bytes
/
image_viewer.h
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
#ifndef IMAGE_VIEWER_H_
#define IMAGE_VIEWER_H_
#include <cstddef>
#include <string>
#include "panel.h"
#include "sdl_ptrs.h"
#include "window.h"
class ImageViewer : public CWindow {
public:
explicit ImageViewer(CPanel *panel);
virtual ~ImageViewer() = default;
ImageViewer(const ImageViewer &) = delete;
ImageViewer &operator=(const ImageViewer &) = delete;
bool ok() const { return ok_; }
private:
void setPath(std::string &&path);
void init();
void render(const bool focused) const override;
bool keyPress(const SDL_Event &event, SDLC_Keycode key,
ControllerButton button) override;
bool mouseWheel(int dx, int dy) override;
void onResize() override;
bool isFullScreen() const override { return true; }
bool nextOrPreviousImage(int direction);
SDLSurfaceUniquePtr background_;
SDLSurfaceUniquePtr image_;
bool ok_;
CPanel *panel_;
std::string filename_;
};
#endif // IMAGE_VIEWER_H_