diff options
author | Kazumasa Mitsunari <knimitz@witz-inc.co.jp> | 2018-09-10 17:42:44 +0900 |
---|---|---|
committer | Kazumasa Mitsunari <knimitz@witz-inc.co.jp> | 2018-09-10 17:42:44 +0900 |
commit | 2ce7162980b40cf5587ed8a0247f3e9bd3407ad7 (patch) | |
tree | ba513752a2d31fc5106e5f49d2bbfd85f63f0d1b /src/wm_layer.cpp | |
parent | af7d388bbfcbd560e4d24432a863717ef95cd819 (diff) |
Update wm_layer* : Render order change
Change-Id: I3e417785d36e113a2b97076774d80c46defd3be4
Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
Diffstat (limited to 'src/wm_layer.cpp')
-rw-r--r-- | src/wm_layer.cpp | 40 |
1 files changed, 35 insertions, 5 deletions
diff --git a/src/wm_layer.cpp b/src/wm_layer.cpp index cd381c2..154d874 100644 --- a/src/wm_layer.cpp +++ b/src/wm_layer.cpp @@ -71,6 +71,8 @@ void LayerState::removeLayer(unsigned layer) auto fwd_itr = std::remove_if( this->render_order.begin(), this->render_order.end(), [layer](unsigned elm) { + if(elm == layer) + HMI_DEBUG("remove layer %d", elm); return elm == layer; } ); @@ -82,6 +84,17 @@ void LayerState::setArea(const string& app, const string& area) this->area2appid[area] = app; } +void LayerState::dump() +{ + std::string str; + for(const auto& ro : this->render_order) + { + str += std::to_string(ro); + str += ","; + } + DUMP(" render order : %s", str.c_str()); +} + WMLayer::WMLayer(json_object* j, unsigned uuid) : tmp_state(), state(), uuid(uuid) { this->name = jh::getStringFromJson(j, "name"); @@ -107,6 +120,8 @@ WMLayer::WMLayer(json_object* j, unsigned uuid) : tmp_state(), state(), uuid(uui unsigned WMLayer::getNewLayerID(const string& role) { unsigned ret = 0; + if(this->name == BG_LAYER_NAME) + return ret; // generate new layer id; if(this->hasRole(role)) @@ -166,23 +181,31 @@ WMError WMLayer::setLayerState(const LayerState& l) return WMError::SUCCESS; } -void WMLayer::addLayer(unsigned layer) +void WMLayer::addLayerToState(unsigned layer) { this->tmp_state.addLayer(layer); } +void WMLayer::removeLayerFromState(unsigned layer) +{ + this->tmp_state.removeLayer(layer); +} + void WMLayer::appendArea(const string& area) { this->area_list.push_back(area); } -void WMLayer::removeLayerID(unsigned id) +void WMLayer::terminateApp(unsigned id) { auto fwd_itr = std::remove_if(this->id_list.begin(), this->id_list.end(), [id](unsigned elm) { return elm == id; }); this->id_list.erase(fwd_itr, this->id_list.end()); + this->tmp_state.removeLayer(id); + this->state.removeLayer(id); + ilm_layerRemove(id); } bool WMLayer::hasLayerID(unsigned id) @@ -196,9 +219,6 @@ bool WMLayer::hasLayerID(unsigned id) bool WMLayer::hasRole(const string& role) { - // TODO : use virtual to avoid compare - if(this->name == BG_LAYER_NAME) - return false; auto re = std::regex(this->role_list); if (std::regex_match(role, re)) { @@ -214,6 +234,16 @@ WMError WMLayer::commitChange() return WMError::SUCCESS; } +void WMLayer::dump() +{ + DUMP("===== wm layer status ====="); + DUMP("Layer :%s", this->name.c_str()); + this->tmp_state.dump(); + this->state.dump(); + DUMP("===== wm layer status end ====="); + +} + /* void WMLayer::undo() { this->tmp_state = this->state; |