X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fwm_client.cpp;h=baed82814767e0df95d18972b1d2432e648f5c5a;hb=1b5e2af2499199c8fa763fbe9769bd0bc2ed8c94;hp=3bc2d3127f9a7e444d14385cc8ae9f8a28e4a745;hpb=b73c8310f2ca06b356135ef3a1b17e5cb6e2ec5d;p=apps%2Fagl-service-windowmanager.git diff --git a/src/wm_client.cpp b/src/wm_client.cpp index 3bc2d31..baed828 100644 --- a/src/wm_client.cpp +++ b/src/wm_client.cpp @@ -17,6 +17,7 @@ #include #include "wm_client.hpp" #include "util.hpp" +#include #define INVALID_SURFACE_ID 0 @@ -71,12 +72,14 @@ WMClient::WMClient(const string &appid, const string &role) } } -WMClient::WMClient(const string &appid, unsigned layer, - const string& layer_name, unsigned surface, const string &role) - : id(appid), layer(layer), wm_layer_name(layer_name), - role2surface(0) +WMClient::WMClient(const string &appid, unsigned layer, const string &role) + : id(appid), + layer(layer), + main_role(role), + role2surface(0), + evname2afb_event(0) { - role2surface[role] = surface; + role2surface[role] = INVALID_SURFACE_ID; for (auto x : kWMEvents) { #if GTEST_ENABLED @@ -129,11 +132,6 @@ unsigned WMClient::surfaceID() const return this->surface; } -const string& WMClient::getWMLayerName() -{ - return this->wm_layer_name; -} - void WMClient::setRole(const string& role) { this->role_list.clear(); @@ -158,7 +156,7 @@ void WMClient::appendRole(const string& role) * @param unsigned[in] surface * @return true */ -bool WMClient::addSurface(const string &role, unsigned surface) +/* bool WMClient::addSurface(const string &role, unsigned surface) { HMI_DEBUG("Add role %s with surface %d", role.c_str(), surface); if (0 != this->role2surface.count(role)) @@ -167,6 +165,18 @@ bool WMClient::addSurface(const string &role, unsigned surface) } this->role2surface[role] = surface; return true; +} */ + +WMError WMClient::addSurface(unsigned surface) +{ + this->surface = surface; + ilmErrorTypes err = ilm_layerAddSurface(this->layer, surface); + + if(err == ILM_SUCCESS) + { + err = ilm_commitChanges(); + } + return (err == ILM_SUCCESS) ? WMError::SUCCESS : WMError::FAIL; } bool WMClient::removeSurfaceIfExist(unsigned surface)