#pragma once
#include <luna/LinkedList.h>
#include <luna/String.h>
#include <ui/Canvas.h>
#include <ui/Color.h>
#include <ui/Rect.h>
#include <ui/ipc/Server.h>

struct Client;

struct Window : public LinkedListNode<Window>
{
    ui::Rect surface;
    ui::Rect titlebar;
    u32* pixels;
    String name;
    String shm_path;
    bool dirty { false };
    Client* client;
    int id;
    ui::WindowAttributes attributes { 0 };

    Window(ui::Rect, String&&);
    ~Window();

    void focus();

    void draw(ui::Canvas& screen);
};

extern LinkedList<Window> g_windows;