2 * Copyright (C) 2016 Simon Fels <morphis@gravedo.de>
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.
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.
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/>.
18 #ifndef ANBOX_PLATFORM_POLICY_H_
19 #define ANBOX_PLATFORM_POLICY_H_
21 #include "anbox/graphics/rect.h"
22 #include "anbox/wm/window_state.h"
43 virtual ~BasePlatform() {}
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;
47 struct ClipboardData {
51 virtual void set_clipboard_data(const ClipboardData &data) = 0;
52 virtual ClipboardData get_clipboard_data() = 0;
54 virtual std::shared_ptr<audio::Sink> create_audio_sink() = 0;
55 virtual std::shared_ptr<audio::Source> create_audio_source() = 0;
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;
60 virtual bool supports_multi_window() const = 0;
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;
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