namespace wm
{
-const vector<string> kWMEvents = {
+static const vector<string> kWMEvents = {
// Private event for applications
"syncDraw", "flushDraw", "visible", "invisible", "active", "inactive", "error"};
-const vector<string> kErrorDescription = {
+static const vector<string> kErrorDescription = {
"unknown-error"};
static const char kKeyDrawingName[] = "drawing_name";
{
if (0 == this->role2surface.count(role))
{
- HMI_NOTICE("wm", "invalid role %s : appID : %s", role.c_str(), this->id.c_str());
return INVALID_SURFACE_ID;
}
return this->role2surface.at(role);
std::string WMClient::role(unsigned surface) const
{
- for(const auto& [key, value] : this->role2surface)
+ for(const auto& x : this->role2surface)
{
- if(value == surface){
- return key;
+ if(x.second == surface)
+ {
+ return x.first;
}
}
return std::string("");
return this->layer;
}
+/**
+ * Set layerID the client belongs to
+ *
+ * This function set layerID the client belongs to.
+ * But this function may not used because the layer should be fixed at constructor.
+ * So this function will be used to change layer by some reasons.
+ *
+ * @param unsigned[in] layerID
+ * @return None
+ * @attention WMClient can't have multiple layer
+ */
void WMClient::registerLayer(unsigned layer)
{
this->layer = layer;
}
+/**
+ * Add the pair of role and surface to the client
+ *
+ * This function set the pair of role and surface to the client.
+ * This function is used for the client which has multi surfaces.
+ * If the model and relationship for role and surface(layer)
+ * is changed, this function will be changed
+ * Current Window Manager doesn't use this function.
+ *
+ * @param string[in] role
+ * @param unsigned[in] surface
+ * @return true
+ */
bool WMClient::addSurface(const string &role, unsigned surface)
{
HMI_DEBUG("wm", "Add role %s with surface %d", role.c_str(), surface);
{
if (surface == x.second)
{
+ HMI_INFO("wm", "Remove surface from client %s: role %s, surface: %d",
+ this->id.c_str(), x.first.c_str(), x.second);
this->role2surface.erase(x.first);
ret = true;
break;
return ret;
}
+#ifndef GTEST_ENABLED
bool WMClient::subscribe(afb_req req, const string &evname)
{
if(evname != kKeyError){
HMI_DEBUG("wm", "afb_event_push failed: %m");
}
}
+#endif
void WMClient::dumpInfo()
{