forked from od-contrib/commander
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathimage_viewer.h
More file actions
32 lines (24 loc) · 753 Bytes
/
image_viewer.h
File metadata and controls
32 lines (24 loc) · 753 Bytes
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
#ifndef IMAGE_VIEWER_H_
#define IMAGE_VIEWER_H_
#include <string>
#include "sdl_ptrs.h"
#include "window.h"
class ImageViewer : public CWindow {
public:
explicit ImageViewer(std::string filename);
virtual ~ImageViewer() = default;
ImageViewer(const ImageViewer &) = delete;
ImageViewer &operator=(const ImageViewer &) = delete;
bool ok() const { return ok_; }
private:
void init();
void render(const bool focused) const override;
const bool keyPress(const SDL_Event &event) override;
void onResize() override;
bool isFullScreen() const override { return true; }
std::string filename_;
SDLSurfaceUniquePtr background_;
SDLSurfaceUniquePtr image_;
bool ok_;
};
#endif // IMAGE_VIEWER_H_