#include <json-c/json.h>
#include "wm_client.hpp"
#include "util.hpp"
+#include <ilm/ilm_control.h>
#define INVALID_SURFACE_ID 0
}
}
-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
return this->surface;
}
-const string& WMClient::getWMLayerName()
-{
- return this->wm_layer_name;
-}
-
void WMClient::setRole(const string& role)
{
this->role_list.clear();
* @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))
}
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)