aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-09-11 12:15:28 +0900
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-09-11 12:15:48 +0900
commitb77279919e694ff49dc8032840aff0f5be8b7967 (patch)
tree59d1210619aa2e9d57dfe5b199d5673f66e7420e /src
parent845d2b5ed9f70d110fe731b8c5d17694523ce0e5 (diff)
Change API in wm_layer
* commitChange -> update * add undo Change-Id: I81a10fe5fcaa802f224af75457869dadc7a83f25 Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
Diffstat (limited to 'src')
-rw-r--r--src/wm_layer.cpp8
-rw-r--r--src/wm_layer.hpp3
-rw-r--r--src/wm_layer_control.cpp15
3 files changed, 21 insertions, 5 deletions
diff --git a/src/wm_layer.cpp b/src/wm_layer.cpp
index 28e1cd9..b3e3d2c 100644
--- a/src/wm_layer.cpp
+++ b/src/wm_layer.cpp
@@ -241,10 +241,14 @@ bool WMLayer::hasRole(const string& role)
return false;
}
-WMError WMLayer::commitChange()
+void WMLayer::update()
{
this->state = this->tmp_state;
- return WMError::SUCCESS;
+}
+
+void WMLayer::undo()
+{
+ this->tmp_state = this->state;
}
void WMLayer::dump()
diff --git a/src/wm_layer.hpp b/src/wm_layer.hpp
index c291151..a6a359e 100644
--- a/src/wm_layer.hpp
+++ b/src/wm_layer.hpp
@@ -80,7 +80,8 @@ class WMLayer
void removeLayerFromState(unsigned layer);
void setAreaToState(const std::string& app, const std::string& area);
void terminateApp(unsigned layer);
- WMError commitChange();
+ void update();
+ void undo();
// Debug
void dump();
diff --git a/src/wm_layer_control.cpp b/src/wm_layer_control.cpp
index acf41f6..9756d5e 100644
--- a/src/wm_layer_control.cpp
+++ b/src/wm_layer_control.cpp
@@ -213,6 +213,8 @@ WMError LayerControl::renderLayers()
{
HMI_INFO("Commit change");
WMError rc = WMError::SUCCESS;
+
+ // Check the number of layers
vector<unsigned> ivi_l_ids;
for(auto& l : this->wm_layers)
{
@@ -224,6 +226,8 @@ WMError LayerControl::renderLayers()
ivi_l_ids.push_back(id);
}
}
+
+ // Create render order
t_ilm_layer* id_array = new t_ilm_layer[ivi_l_ids.size()];
if(id_array == nullptr)
{
@@ -238,6 +242,7 @@ WMError LayerControl::renderLayers()
++count;
}
+ // Display
ilmErrorTypes ret = ilm_displaySetRenderOrder(this->screenID, id_array, ivi_l_ids.size());
if(ret != ILM_SUCCESS)
{
@@ -248,7 +253,7 @@ WMError LayerControl::renderLayers()
{
for(auto& l : this->wm_layers)
{
- l->commitChange();
+ l->update();
}
}
ilm_commitChanges();
@@ -256,7 +261,13 @@ WMError LayerControl::renderLayers()
return rc;
}
-void LayerControl::undoUpdate() {}
+void LayerControl::undoUpdate()
+{
+ for(auto& l : this->wm_layers)
+ {
+ l->undo();
+ }
+}
WMError LayerControl::loadLayerSetting(const string &path)
{