1.10
x11screen.h
1/*
2 * Copyright (C) 2018 Microchip Technology Inc. All rights reserved.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6#ifndef EGT_DETAIL_SCREEN_X11SCREEN_H
7#define EGT_DETAIL_SCREEN_X11SCREEN_H
8
14#include <egt/asio.hpp>
15#include <egt/detail/meta.h>
16#include <egt/input.h>
17#include <egt/screen.h>
18#include <memory>
19#include <string>
20
21namespace egt
22{
23inline namespace v1
24{
25class Application;
26
27namespace detail
28{
29struct X11Data;
30
34class EGT_API X11Screen : public Screen
35{
36public:
37
38 X11Screen() = delete;
39
45 explicit X11Screen(Application& app, const Size& size = Size(800, 480),
46 const std::string& name = {}, bool borderless = false);
47
48 X11Screen(const X11Screen&) = delete;
49 X11Screen& operator=(const X11Screen&) = delete;
50 X11Screen(X11Screen&&) = delete;
52
53 void schedule_flip() override
54 {}
55
56 void flip(const DamageArray& damage) override;
57
60
61 ~X11Screen() noexcept override;
62
63protected:
64
66 void handle_read(const asio::error_code& error);
67
68 void copy_to_buffer(ScreenBuffer& buffer) override;
69
72
74 std::unique_ptr<detail::X11Data> m_priv;
75
77 asio::posix::stream_descriptor m_input;
78
86 struct X11Input : public Input
87 {
88 using Input::Input;
89 friend class X11Screen;
90 };
91
93 X11Input m_in;
94};
95
96}
97}
98}
99
100#endif
Application definition.
Definition app.h:49
Base Input device class.
Definition input.h:39
Manages one of more buffers that make up a Screen.
Definition screen.h:34
std::vector< Rect > DamageArray
Type used for damage arrays.
Definition screen.h:40
Screen in an X11 window.
Definition x11screen.h:35
void disable_window_decorations()
Disable window decorations.
X11Input m_in
Custom input for dispatching events.
Definition x11screen.h:93
void flip(const DamageArray &damage) override
Perform a flip of the buffers.
X11Screen & operator=(const X11Screen &)=delete
X11Screen(Application &app, const Size &size=Size(800, 480), const std::string &name={}, bool borderless=false)
void schedule_flip() override
Schedule a flip to occur later.
Definition x11screen.h:53
X11Screen & operator=(X11Screen &&)=delete
X11Screen(const X11Screen &)=delete
~X11Screen() noexcept override
X11Screen(X11Screen &&)=delete
EGT framework namespace.
Definition animation.h:24