TYPE3
[iec.git] / src / type3_AndroidCloud / anbox-master / src / anbox / wm / single_window_manager.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_WM_SINGLE_WINDOW_MANAGER_H_
19 #define ANBOX_WM_SINGLE_WINDOW_MANAGER_H_
20
21 #include "anbox/wm/manager.h"
22
23 #include <map>
24 #include <memory>
25 #include <mutex>
26
27 namespace anbox {
28 namespace application {
29 class Database;
30 } // namespace application
31 namespace platform {
32 class BasePlatform;
33 } // namespace platform
34 namespace wm {
35 class Window;
36 class SingleWindowManager : public Manager {
37  public:
38   SingleWindowManager(const std::weak_ptr<platform::BasePlatform> &platform,
39                       const graphics::Rect &window_size,
40                       const std::shared_ptr<application::Database> &app_db);
41   ~SingleWindowManager();
42
43   void setup() override;
44
45   void apply_window_state_update(const WindowState::List &updated, const WindowState::List &removed) override;
46
47   std::shared_ptr<Window> find_window_for_task(const Task::Id &task) override;
48
49   void resize_task(const Task::Id &task, const anbox::graphics::Rect &rect,
50                    const std::int32_t &resize_mode) override;
51   void set_focused_task(const Task::Id &task) override;
52   void remove_task(const Task::Id &task) override;
53
54  private:
55   std::weak_ptr<platform::BasePlatform> platform_;
56   graphics::Rect window_size_;
57   std::shared_ptr<application::Database> app_db_;
58   std::shared_ptr<Window> window_;
59 };
60 }  // namespace wm
61 }  // namespace anbox
62
63 #endif