X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=src%2Ftype3_AndroidCloud%2Fanbox-master%2Fsrc%2Fanbox%2Fwm%2Fwindow.cpp;fp=src%2Ftype3_AndroidCloud%2Fanbox-master%2Fsrc%2Fanbox%2Fwm%2Fwindow.cpp;h=0fc948b9df4ec36c855274c429cb20f1700cab63;hb=e26c1ec581be598521517829adba8c8dd23a768f;hp=0000000000000000000000000000000000000000;hpb=6699c1aea74eeb0eb400e6299079f0c7576f716f;p=iec.git diff --git a/src/type3_AndroidCloud/anbox-master/src/anbox/wm/window.cpp b/src/type3_AndroidCloud/anbox-master/src/anbox/wm/window.cpp new file mode 100644 index 0000000..0fc948b --- /dev/null +++ b/src/type3_AndroidCloud/anbox-master/src/anbox/wm/window.cpp @@ -0,0 +1,62 @@ +/* + * 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/window.h" +#include "anbox/graphics/emugl/Renderer.h" +#include "anbox/logger.h" + +namespace anbox { +namespace wm { +Window::Window(const std::shared_ptr &renderer, const Task::Id &task, const graphics::Rect &frame, const std::string &title) + : renderer_(renderer), task_(task), frame_(frame), title_(title) {} + +Window::~Window() { + release(); +} + +void Window::update_state(const WindowState::List &states) { + (void)states; +} + +void Window::update_frame(const graphics::Rect &frame) { + if (frame == frame_) return; + + frame_ = frame; +} + +Task::Id Window::task() const { return task_; } + +graphics::Rect Window::frame() const { return frame_; } + +EGLNativeWindowType Window::native_handle() const { return 0; } + +std::string Window::title() const { return title_; } + +bool Window::attach() { + if (!renderer_) + return false; + attached_ = renderer_->createNativeWindow(native_handle()); + return attached_; +} + +void Window::release() { + if (!renderer_ || !attached_) + return; + renderer_->destroyNativeWindow(native_handle()); +} +} // namespace wm +} // namespace anbox