Cleanup formatting
This commit is contained in:
parent
3a55cf9189
commit
abb0497a5d
7 changed files with 20 additions and 14 deletions
|
|
@ -143,7 +143,8 @@ void AndroidApiStub::task_removed(Request<protobuf::rpc::Void> *request) {
|
||||||
remove_task_handle_.result_received();
|
remove_task_handle_.result_received();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AndroidApiStub::resize_task(const std::int32_t &id, const anbox::graphics::Rect &rect,
|
void AndroidApiStub::resize_task(const std::int32_t &id,
|
||||||
|
const anbox::graphics::Rect &rect,
|
||||||
const std::int32_t &resize_mode) {
|
const std::int32_t &resize_mode) {
|
||||||
ensure_rpc_channel();
|
ensure_rpc_channel();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,8 @@ class AndroidApiStub : public anbox::ApplicationManager {
|
||||||
|
|
||||||
void set_focused_task(const std::int32_t &id);
|
void set_focused_task(const std::int32_t &id);
|
||||||
void remove_task(const std::int32_t &id);
|
void remove_task(const std::int32_t &id);
|
||||||
void resize_task(const std::int32_t &id, const anbox::graphics::Rect &rect, const std::int32_t &resize_mode);
|
void resize_task(const std::int32_t &id, const anbox::graphics::Rect &rect,
|
||||||
|
const std::int32_t &resize_mode);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void ensure_rpc_channel();
|
void ensure_rpc_channel();
|
||||||
|
|
|
||||||
|
|
@ -43,8 +43,7 @@ Daemon::Daemon()
|
||||||
|
|
||||||
int Daemon::Run(const std::vector<std::string> &arguments) try {
|
int Daemon::Run(const std::vector<std::string> &arguments) try {
|
||||||
auto argv = arguments;
|
auto argv = arguments;
|
||||||
if (arguments.size() == 0)
|
if (arguments.size() == 0) argv = {"run"};
|
||||||
argv = {"run"};
|
|
||||||
return cmd.run({std::cin, std::cout, argv});
|
return cmd.run({std::cin, std::cout, argv});
|
||||||
} catch (std::exception &err) {
|
} catch (std::exception &err) {
|
||||||
ERROR("%s", err.what());
|
ERROR("%s", err.what());
|
||||||
|
|
|
||||||
|
|
@ -194,8 +194,7 @@ void PlatformPolicy::window_deleted(const Window::Id &id) {
|
||||||
WARNING("Got window removed event for unknown window (id %d)", id);
|
WARNING("Got window removed event for unknown window (id %d)", id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (auto window = w->second.lock())
|
if (auto window = w->second.lock()) android_api_->remove_task(window->task());
|
||||||
android_api_->remove_task(window->task());
|
|
||||||
windows_.erase(w);
|
windows_.erase(w);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -207,7 +206,8 @@ void PlatformPolicy::window_wants_focus(const Window::Id &id) {
|
||||||
android_api_->set_focused_task(window->task());
|
android_api_->set_focused_task(window->task());
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlatformPolicy::window_moved(const Window::Id &id, const std::int32_t &x, const std::int32_t &y) {
|
void PlatformPolicy::window_moved(const Window::Id &id, const std::int32_t &x,
|
||||||
|
const std::int32_t &y) {
|
||||||
auto w = windows_.find(id);
|
auto w = windows_.find(id);
|
||||||
if (w == windows_.end()) return;
|
if (w == windows_.end()) return;
|
||||||
|
|
||||||
|
|
@ -218,7 +218,9 @@ void PlatformPolicy::window_moved(const Window::Id &id, const std::int32_t &x, c
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlatformPolicy::window_resized(const Window::Id &id, const std::int32_t &width, const std::int32_t &height) {
|
void PlatformPolicy::window_resized(const Window::Id &id,
|
||||||
|
const std::int32_t &width,
|
||||||
|
const std::int32_t &height) {
|
||||||
auto w = windows_.find(id);
|
auto w = windows_.find(id);
|
||||||
if (w == windows_.end()) return;
|
if (w == windows_.end()) return;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,8 +52,10 @@ class PlatformPolicy : public std::enable_shared_from_this<PlatformPolicy>,
|
||||||
|
|
||||||
void window_deleted(const Window::Id &id) override;
|
void window_deleted(const Window::Id &id) override;
|
||||||
void window_wants_focus(const Window::Id &id) override;
|
void window_wants_focus(const Window::Id &id) override;
|
||||||
void window_moved(const Window::Id &id, const std::int32_t &x, const std::int32_t &y) override;
|
void window_moved(const Window::Id &id, const std::int32_t &x,
|
||||||
void window_resized(const Window::Id &id, const std::int32_t &width, const std::int32_t &height) override;
|
const std::int32_t &y) override;
|
||||||
|
void window_resized(const Window::Id &id, const std::int32_t &width,
|
||||||
|
const std::int32_t &height) override;
|
||||||
|
|
||||||
DisplayInfo display_info() const override;
|
DisplayInfo display_info() const override;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -100,8 +100,7 @@ void Window::process_event(const SDL_Event &event) {
|
||||||
case SDL_WINDOWEVENT_HIDDEN:
|
case SDL_WINDOWEVENT_HIDDEN:
|
||||||
break;
|
break;
|
||||||
case SDL_WINDOWEVENT_CLOSE:
|
case SDL_WINDOWEVENT_CLOSE:
|
||||||
if (observer_)
|
if (observer_) observer_->window_deleted(id_);
|
||||||
observer_->window_deleted(id_);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,8 +39,10 @@ class Window : public std::enable_shared_from_this<Window>, public wm::Window {
|
||||||
virtual ~Observer();
|
virtual ~Observer();
|
||||||
virtual void window_deleted(const Id &id) = 0;
|
virtual void window_deleted(const Id &id) = 0;
|
||||||
virtual void window_wants_focus(const Id &id) = 0;
|
virtual void window_wants_focus(const Id &id) = 0;
|
||||||
virtual void window_moved(const Id &id, const std::int32_t &x, const std::int32_t &y) = 0;
|
virtual void window_moved(const Id &id, const std::int32_t &x,
|
||||||
virtual void window_resized(const Id &id, const std::int32_t &x, const std::int32_t &y) = 0;
|
const std::int32_t &y) = 0;
|
||||||
|
virtual void window_resized(const Id &id, const std::int32_t &x,
|
||||||
|
const std::int32_t &y) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
Window(const Id &id, const wm::Task::Id &task,
|
Window(const Id &id, const wm::Task::Id &task,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue