X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=src%2Ftype3_AndroidCloud%2Fanbox-master%2Fsrc%2Fanbox%2Fwm%2Fsingle_window_manager.cpp;fp=src%2Ftype3_AndroidCloud%2Fanbox-master%2Fsrc%2Fanbox%2Fwm%2Fsingle_window_manager.cpp;h=b8937cbd55b17ea677702c70af9181e7771807cf;hb=e26c1ec581be598521517829adba8c8dd23a768f;hp=0000000000000000000000000000000000000000;hpb=6699c1aea74eeb0eb400e6299079f0c7576f716f;p=iec.git diff --git a/src/type3_AndroidCloud/anbox-master/src/anbox/wm/single_window_manager.cpp b/src/type3_AndroidCloud/anbox-master/src/anbox/wm/single_window_manager.cpp new file mode 100644 index 0000000..b8937cb --- /dev/null +++ b/src/type3_AndroidCloud/anbox-master/src/anbox/wm/single_window_manager.cpp @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2016 Simon Fels + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 3, as published + * by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranties of + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + * + */ + +#include "anbox/wm/single_window_manager.h" +#include "anbox/platform/base_platform.h" +#include "anbox/logger.h" + +#include + +#include +#include + +namespace anbox { +namespace wm { +SingleWindowManager::SingleWindowManager(const std::weak_ptr &platform, + const graphics::Rect &window_size, + const std::shared_ptr &app_db) + : platform_(platform), window_size_(window_size), app_db_(app_db) {} + +SingleWindowManager::~SingleWindowManager() {} + +void SingleWindowManager::setup() { + if (auto p = platform_.lock()) { + window_ = p->create_window(0, window_size_, "Anbox - Android in a Box"); + if (!window_->attach()) + WARNING("Failed to attach window to renderer"); + } else { + throw std::runtime_error("Can't create window as we don't have a platform abstraction"); + } +} + +void SingleWindowManager::apply_window_state_update(const WindowState::List &updated, const WindowState::List &removed) { + (void)updated; + (void)removed; +} + +std::shared_ptr SingleWindowManager::find_window_for_task(const Task::Id &task) { + (void)task; + return window_; +} + +void SingleWindowManager::resize_task(const Task::Id &task, const anbox::graphics::Rect &rect, + const std::int32_t &resize_mode) { + (void)task; + (void)rect; + (void)resize_mode; +} + +void SingleWindowManager::set_focused_task(const Task::Id &task) { + (void)task; +} + +void SingleWindowManager::remove_task(const Task::Id &task) { + if (task != 0) { + WARNING("Window with invalid task id was closed"); + return; + } + + // FIXME easiest to terminate is sending ourself the terminate signal + // which will be then processed by the main loop and terminate the whole + // application. + kill(getpid(), SIGTERM); +} +} // namespace wm +} // namespace anbox