2023-08-03 17:38:49 +02:00
|
|
|
#pragma once
|
|
|
|
#include <luna/LinkedList.h>
|
2023-08-14 18:15:29 +02:00
|
|
|
#include <luna/String.h>
|
2023-08-03 17:38:49 +02:00
|
|
|
#include <ui/Canvas.h>
|
|
|
|
#include <ui/Color.h>
|
|
|
|
#include <ui/Rect.h>
|
|
|
|
|
2023-08-15 11:20:17 +02:00
|
|
|
struct Client;
|
|
|
|
|
2023-08-03 17:38:49 +02:00
|
|
|
struct Window : public LinkedListNode<Window>
|
|
|
|
{
|
|
|
|
ui::Rect surface;
|
2023-08-04 16:08:58 +02:00
|
|
|
ui::Rect titlebar;
|
2023-08-04 21:17:50 +02:00
|
|
|
ui::Rect close_button;
|
2023-08-04 16:08:58 +02:00
|
|
|
ui::Rect contents;
|
2023-08-14 20:08:05 +02:00
|
|
|
u32* pixels;
|
2023-08-14 18:15:29 +02:00
|
|
|
String name;
|
2023-08-14 20:08:05 +02:00
|
|
|
bool dirty { false };
|
2023-08-15 11:20:17 +02:00
|
|
|
Client* client;
|
|
|
|
int id;
|
2023-08-15 12:56:55 +02:00
|
|
|
bool decorated;
|
2023-08-03 17:38:49 +02:00
|
|
|
|
2023-08-14 18:15:29 +02:00
|
|
|
static int titlebar_height();
|
|
|
|
|
2023-08-15 12:56:55 +02:00
|
|
|
Window(ui::Rect, String&&, bool);
|
2023-08-14 20:08:05 +02:00
|
|
|
~Window();
|
2023-08-03 17:38:49 +02:00
|
|
|
|
|
|
|
void focus();
|
|
|
|
|
|
|
|
void draw(ui::Canvas& screen);
|
|
|
|
};
|
|
|
|
|
|
|
|
extern LinkedList<Window> g_windows;
|