1b43958da8375ff9e5a839a306dda81920c02b30
[iec.git] / src / type3_AndroidCloud / anbox-master / src / anbox / platform / base_platform.h
1 /*
2  * Copyright (C) 2016 Simon Fels <morphis@gravedo.de>
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License version 3, as published
6  * by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranties of
10  * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11  * PURPOSE.  See the GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License along
14  * with this program.  If not, see <http://www.gnu.org/licenses/>.
15  *
16  */
17
18 #ifndef ANBOX_PLATFORM_POLICY_H_
19 #define ANBOX_PLATFORM_POLICY_H_
20
21 #include "anbox/graphics/rect.h"
22 #include "anbox/wm/window_state.h"
23
24 #include <memory>
25
26 class Renderer;
27
28 namespace anbox {
29 namespace audio {
30 class Sink;
31 class Source;
32 } // namespace audio
33 namespace wm {
34 class Window;
35 class Manager;
36 } // namespace wm
37 namespace input {
38 class Manager;
39 } // namespace input
40 namespace platform {
41 class BasePlatform {
42  public:
43   virtual ~BasePlatform() {}
44
45   virtual std::shared_ptr<wm::Window> create_window(const anbox::wm::Task::Id &task, const anbox::graphics::Rect &frame, const std::string &title) = 0;
46
47   struct ClipboardData {
48     std::string text;
49   };
50
51   virtual void set_clipboard_data(const ClipboardData &data) = 0;
52   virtual ClipboardData get_clipboard_data() = 0;
53
54   virtual std::shared_ptr<audio::Sink> create_audio_sink() = 0;
55   virtual std::shared_ptr<audio::Source> create_audio_source() = 0;
56
57   virtual void set_renderer(const std::shared_ptr<Renderer> &renderer) = 0;
58   virtual void set_window_manager(const std::shared_ptr<wm::Manager> &window_manager) = 0;
59
60   virtual bool supports_multi_window() const = 0;
61 };
62
63 struct Configuration {
64   graphics::Rect display_frame = graphics::Rect::Invalid;
65   bool single_window = false;
66   bool no_touch_emulation = false;
67   bool server_side_decoration = false;
68 };
69
70 std::shared_ptr<BasePlatform> create(const std::string &name,
71                                      const std::shared_ptr<input::Manager> &input_manager,
72                                      const Configuration &config);
73 }  // namespace platform
74 }  // namespace anbox
75
76 #endif