14#include <egt/detail/meta.h>
18#include <egt/screen.h>
19#include <egt/widgetflags.h>
68 :
Window({}, format_hint, hint)
127 void damage(const
Rect& rect) override;
133 EGT_NODISCARD
Screen* screen() const override;
135 EGT_NODISCARD
bool has_screen() const override;
137 void move(const
Point& point) override;
139 void show() override;
141 void hide() override;
143 void resize(const
Size& size) override;
147 void scale(
float hscale,
float vscale) override;
152 EGT_NODISCARD
float hscale()
const
175 using Frame::begin_draw;
182 auto frame = find_screen();
184 return frame->screen()->format();
186 return PixelFormat::invalid;
197 m_format_hint = format_hint;
238 virtual
void do_draw();
241 virtual
void allocate_screen();
246 void create_impl(const
Rect& rect,
251 virtual
void default_damage(const
Rect& rect)
257 virtual void default_resize(
const Size& size)
263 virtual void default_scale(
float scalex,
float scaley)
265 Frame::scale(scalex, scaley);
269 virtual void default_move(
const Point& point)
275 virtual void default_begin_draw()
279 begin_draw(m_parent);
287 virtual void default_show()
293 virtual void default_hide()
299 virtual void default_paint(Painter& painter)
301 Frame::paint(painter);
305 std::unique_ptr<detail::WindowImpl> m_impl;
322 friend class detail::WindowImpl;
323 friend class detail::PlaneWindow;
338 using Window::Window;
A Frame is a Widget that has children widgets.
Definition frame.h:45
Raster image resource used for drawing or displaying.
Definition image.h:39
Base object class with fundamental properties.
Definition object.h:32
uint64_t RegisterHandle
Handle type.
Definition object.h:61
Drawing interface for 2D graphics.
Definition painter.h:45
Manages one of more buffers that make up a Screen.
Definition screen.h:34
Abstract base serializer class.
Definition serialize.h:34
std::list< std::tuple< std::string, std::string, Serializer::Attributes > > Properties
Definition serialize.h:47
Top level Window.
Definition window.h:335
TopWindow & operator=(TopWindow &&)=default
void hide_cursor()
Hide the cursor.
~TopWindow() noexcept override
TopWindow & operator=(const TopWindow &)=delete
void show_cursor(const Image &image=Image("res:internal_cursor"))
Show the cursor.
A Window is a Widget that handles drawing to a Screen.
Definition window.h:47
EGT_NODISCARD PixelFormat format_hint() const
Get the pixel format hint of the window.
Definition window.h:207
Window(Serializer::Properties &props, bool is_derived)
void main_window()
Set this window as the main window.
void format_hint(PixelFormat format_hint)
Set the pixel format hint of the window.
Definition window.h:195
Window(Serializer::Properties &props)
Construct a window.
Definition window.h:109
Window(const Rect &rect, PixelFormat format_hint=DEFAULT_FORMAT, WindowHint hint=WindowHint::automatic)
Construct a window.
Window(Frame &parent, const Rect &rect, PixelFormat format_hint=DEFAULT_FORMAT, WindowHint hint=WindowHint::automatic)
Construct a window.
EGT_NODISCARD float vscale() const
Get vertical scale value.
Definition window.h:160
void window_hint(WindowHint hint)
Set the window hint.
Definition window.h:215
Window(const Window &)=delete
static const PixelFormat DEFAULT_FORMAT
Default pixel format used for Window.
Definition window.h:53
EGT_NODISCARD WindowHint window_hint() const
Get the window hint.
Definition window.h:226
void paint(Painter &painter) override
Paint the Widget using a Painter.
void serialize(Serializer &serializer) const override
Serialize the widget to the specified serializer.
Window(Window &&) noexcept
Window & operator=(const Window &)=delete
EGT_NODISCARD PixelFormat format() const
Get the pixel format of the window.
Definition window.h:180
~Window() noexcept override
Window(PixelFormat format_hint=DEFAULT_FORMAT, WindowHint hint=WindowHint::automatic)
Construct a window.
Definition window.h:66
void begin_draw() override
Cause the widget to draw itself and all of its children.
WindowHint
Hint used for configuring Window backends.
Definition widgetflags.h:683
PixelFormat
Supported pixel formats.
Definition types.h:94
EGT framework namespace.
Definition animation.h:24
A single event that has information about the event and state for the event.
Definition event.h:255