Code Review
/
apps
/
agl-service-windowmanager.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Add commit_change after layer size changed
[apps/agl-service-windowmanager.git]
/
src
/
wm_layer.cpp
diff --git
a/src/wm_layer.cpp
b/src/wm_layer.cpp
index
7f8dbd9
..
cd381c2
100644
(file)
--- a/
src/wm_layer.cpp
+++ b/
src/wm_layer.cpp
@@
-82,7
+82,7
@@
void LayerState::setArea(const string& app, const string& area)
this->area2appid[area] = app;
}
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");
{
this->name = jh::getStringFromJson(j, "name");
this->role_list = jh::getStringFromJson(j, "role");
@@
-127,8
+127,8
@@
unsigned WMLayer::getNewLayerID(const string& role)
return ret;
}
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
{
HMI_NOTICE("id %d is not available then generate new id", ret);
ret = 0; // reset
@@
-162,10
+162,15
@@
const string& WMLayer::layerName()
WMError WMLayer::setLayerState(const LayerState& l)
{
WMError WMLayer::setLayerState(const LayerState& l)
{
- this->
before
_state = l;
+ this->
tmp
_state = l;
return WMError::SUCCESS;
}
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);
void WMLayer::appendArea(const string& area)
{
this->area_list.push_back(area);
@@
-203,14
+208,15
@@
bool WMLayer::hasRole(const string& role)
return false;
}
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
}
*/
} // namespace wm