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