From 3ebdf4e37dd3993a48ff73e8ae01325ec033eb1f Mon Sep 17 00:00:00 2001 From: Kazumasa Mitsunari Date: Tue, 28 Aug 2018 16:13:13 +0900 Subject: [PATCH] Remove lookup_id and lookup_name No need to wrap object Change-Id: I2cb403aabd6d55d7b06024e1535c26c48fe74ac7 Signed-off-by: Kazumasa Mitsunari --- src/window_manager.cpp | 23 +++++++---------------- src/window_manager.hpp | 2 -- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/src/window_manager.cpp b/src/window_manager.cpp index d284279..ea3c794 100644 --- a/src/window_manager.cpp +++ b/src/window_manager.cpp @@ -272,7 +272,7 @@ result WindowManager::api_request_surface(char const *appid, char const *dr // generate surface ID for ivi-shell application - auto rname = this->lookup_id(role); + auto rname = this->id_alloc.lookup(string(role)); if (!rname) { // name does not exist yet, allocate surface id... @@ -336,7 +336,7 @@ char const *WindowManager::api_request_surface(char const *appid, char const *dr } } - auto rname = this->lookup_id(role); + auto rname = this->id_alloc.lookup(str); if (rname) { @@ -646,7 +646,7 @@ result WindowManager::api_get_area_info(char const *drawing_name) const char *role = this->convertRoleOldToNew(drawing_name); // Check drawing name, surface/layer id - auto const &surface_id = this->lookup_id(role); + auto const &surface_id = this->id_alloc.lookup(string(role)); if (!surface_id) { return Err("Surface does not exist"); @@ -830,7 +830,7 @@ void WindowManager::startTransitionWrapper(vector &actions) if ("" != act.role) { bool found; - auto const &surface_id = this->lookup_id(act.role.c_str()); + auto const &surface_id = this->id_alloc.lookup(act.role); string appid = g_app_list.getAppID(*surface_id, act.role, &found); if (!found) { @@ -898,15 +898,6 @@ void WindowManager::processError(WMError error) ******* Private Functions ******* */ -optional WindowManager::lookup_id(char const *name) -{ - return this->id_alloc.lookup(string(name)); -} -optional WindowManager::lookup_name(int id) -{ - return this->id_alloc.lookup(id); -} - /** * init_layers() */ @@ -1076,7 +1067,7 @@ void WindowManager::activate(int id) this->controller->surfaces[id]->set_visibility(1); */ char const *label = - this->lookup_name(id).value_or("unknown-name").c_str(); + this->id_alloc.lookup(id).value_or("unknown-name").c_str(); /* // FOR CES DEMO >>> if ((0 == strcmp(label, "radio")) || @@ -1126,7 +1117,7 @@ void WindowManager::deactivate(int id) if (ip != this->controller->sprops.end()) {*/ char const *label = - this->lookup_name(id).value_or("unknown-name").c_str(); + this->id_alloc.lookup(id).value_or("unknown-name").c_str(); /*// FOR CES DEMO >>> if ((0 == strcmp(label, "radio")) || @@ -1608,7 +1599,7 @@ int WindowManager::loadOldRoleDb() const char *WindowManager::check_surface_exist(const char *drawing_name) { - auto const &surface_id = this->lookup_id(drawing_name); + auto const &surface_id = this->id_alloc.lookup(string(drawing_name)); if (!surface_id) { return "Surface does not exist"; diff --git a/src/window_manager.hpp b/src/window_manager.hpp index afafeb1..3bf62c2 100644 --- a/src/window_manager.hpp +++ b/src/window_manager.hpp @@ -229,8 +229,6 @@ class WindowManager void processError(WMError error); private: - optional lookup_id(char const *name); - optional lookup_name(int id); int init_layers(); void surface_set_layout(int surface_id, const std::string& area = ""); void layout_commit(); -- 2.16.6