Luna/libui/include/ui/Window.h

46 lines
676 B
C++

/**
* @file Window.h
* @author apio (cloudapio.eu)
* @brief UI windows.
*
* @copyright Copyright (c) 2023, the Luna authors.
*
*/
#pragma once
#include <luna/OwnedPtr.h>
#include <luna/StringView.h>
#include <ui/Canvas.h>
#include <ui/Rect.h>
namespace ui
{
class Window
{
public:
static Result<Window*> create(Rect rect);
void set_title(StringView title);
Canvas& canvas()
{
return m_canvas;
}
void update();
void close();
int id() const
{
return m_id;
}
~Window();
private:
int m_id;
Canvas m_canvas;
};
}