#pragma once

#include <pake/dirtiable-image.hpp>
#include <pake/widget.hpp>
#include <memory>

namespace pake {

  class window {

    euler::syscall::stream_handle socket;

    int width;
    int height;

    dirtiable_image contents;
    std::unique_ptr<widget> root;

  public:
    window(int width, int height, const std::string &title);
    ~window();

    void show();
    void hide();

    void set_root(std::unique_ptr<widget> &&w);

    void render_and_send_to_compositor();

  };

}
