#include <memory>
#include <iostream>
enum class WindowShowMode
{
Hide = 0, // SW_HIDE,
Show = 1, // SW_SHOWNORMAL,
Minimize = 6, // SW_MINIMIZE,
Maximize = 3, // SW_SHOWMAXIMIZED,
};
class NativeWindow {
public:
void show(WindowShowMode showMode)
{
std::cout << "I'm a window!";
}
};
class Window {
public:
Window();
~Window();
void show();
void hide();
private:
class NativeControl;
std::unique_ptr<NativeControl> _window;
};
class Window::NativeControl : public NativeWindow {
public:
NativeControl() : NativeWindow() { }
};
Window::Window()
: _window(std::make_unique<Window::NativeControl>()) {
}
Window::~Window() {
}
void Window::show()
{
_window->show(WindowShowMode::Show);
}
void Window::hide()
{
_window->show(WindowShowMode::Hide);
}
int main()
{
Window window;
window.show();
}
I2luY2x1ZGUgPG1lbW9yeT4KI2luY2x1ZGUgPGlvc3RyZWFtPgoKCWVudW0gY2xhc3MgV2luZG93U2hvd01vZGUKCXsKCQlIaWRlID0gMCwgLy8gU1dfSElERSwKCQlTaG93ID0gMSwgLy8gU1dfU0hPV05PUk1BTCwKCQlNaW5pbWl6ZSA9IDYsIC8vIFNXX01JTklNSVpFLAoJCU1heGltaXplID0gMywgLy8gU1dfU0hPV01BWElNSVpFRCwKCX07CgkKCWNsYXNzIE5hdGl2ZVdpbmRvdyB7CglwdWJsaWM6CgkJdm9pZCBzaG93KFdpbmRvd1Nob3dNb2RlIHNob3dNb2RlKQoJCXsKCQkJc3RkOjpjb3V0IDw8ICJJJ20gYSB3aW5kb3chIjsKCQl9Cgl9OwoJCmNsYXNzIFdpbmRvdyB7CnB1YmxpYzoKICAgIFdpbmRvdygpOwogICAgfldpbmRvdygpOwogICAgdm9pZCBzaG93KCk7CiAgICB2b2lkIGhpZGUoKTsKcHJpdmF0ZToKICAgIGNsYXNzIE5hdGl2ZUNvbnRyb2w7CiAgICBzdGQ6OnVuaXF1ZV9wdHI8TmF0aXZlQ29udHJvbD4gX3dpbmRvdzsKfTsKCgljbGFzcyBXaW5kb3c6Ok5hdGl2ZUNv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