| 1 |
#ifndef IMGUI_ADJUST_HH |
| 2 |
#define IMGUI_ADJUST_HH |
| 3 |
|
| 4 |
#include "ImGuiPartInterface.hh" |
| 5 |
|
| 6 |
#include "gl_vec.hh" |
| 7 |
|
| 8 |
namespace openmsx { |
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
class AdjustWindowInMainViewPort |
| 27 |
{ |
| 28 |
public: |
| 29 |
|
| 30 |
void pre(); |
| 31 |
|
| 32 |
|
| 33 |
bool post(); |
| 34 |
|
| 35 |
void save(ImGuiTextBuffer& buf); |
| 36 |
bool loadLine(std::string_view name, zstring_view value); |
| 37 |
|
| 38 |
private: |
| 39 |
gl::vec2 oldViewPortSize; |
| 40 |
gl::vec2 oldRelWindowPos; |
| 41 |
bool oldIsOnMainViewPort = false; |
| 42 |
bool setMainViewPort = false; |
| 43 |
|
| 44 |
static constexpr auto persistentElements = std::tuple{ |
| 45 |
PersistentElement{"viewPortSize", &AdjustWindowInMainViewPort::oldViewPortSize}, |
| 46 |
PersistentElement{"windowPos", &AdjustWindowInMainViewPort::oldRelWindowPos}, |
| 47 |
PersistentElement{"onMainViewPort", &AdjustWindowInMainViewPort::oldIsOnMainViewPort} |
| 48 |
}; |
| 49 |
}; |
| 50 |
|
| 51 |
} |
| 52 |
|
| 53 |
#endif |