this->area2appid[area] = app;
}
-WMLayer::WMLayer(json_object* j) : before_state(), state()
+WMLayer::WMLayer(json_object* j, unsigned uuid) : tmp_state(), state(), uuid(uuid)
{
this->name = jh::getStringFromJson(j, "name");
this->role_list = jh::getStringFromJson(j, "role");
return ret;
}
- auto id_found = std::find(id_list.begin(), id_list.end(), ret);
- if( (ret > this->idEnd()) || (id_found != id_list.cend()) )
+ size_t count = std::count(id_list.begin(), id_list.end(), ret);
+ if( (ret > this->idEnd()) || (count > 1))
{
HMI_NOTICE("id %d is not available then generate new id", ret);
ret = 0; // reset
WMError WMLayer::setLayerState(const LayerState& l)
{
- this->before_state = l;
+ this->tmp_state = l;
return WMError::SUCCESS;
}
+void WMLayer::addLayer(unsigned layer)
+{
+ this->tmp_state.addLayer(layer);
+}
+
void WMLayer::appendArea(const string& area)
{
this->area_list.push_back(area);
return false;
}
-/* WMError WMLayer::commitChange()
+WMError WMLayer::commitChange()
{
- this->state = this->before_state;
+ this->state = this->tmp_state;
+ return WMError::SUCCESS;
}
-void WMLayer::undo()
+/* void WMLayer::undo()
{
- this->before_state = this->state;
+ this->tmp_state = this->state;
}
*/
} // namespace wm