From 3a9996eb359accdbadb0e5eaa5259c910b7ae46a Mon Sep 17 00:00:00 2001 From: Kazumasa Mitsunari Date: Thu, 30 Aug 2018 21:00:53 +0900 Subject: temporary change Change-Id: I48618fd00e607176c95b4e3950fca7dbb058a3b1 Signed-off-by: Kazumasa Mitsunari --- src/wm_layer_control.cpp | 105 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) (limited to 'src/wm_layer_control.cpp') diff --git a/src/wm_layer_control.cpp b/src/wm_layer_control.cpp index 9c60286..3f39d65 100644 --- a/src/wm_layer_control.cpp +++ b/src/wm_layer_control.cpp @@ -17,6 +17,8 @@ #include #include "wm_layer_control.hpp" #include "wm_layer.hpp" +#include "wm_client.hpp" +#include "request.hpp" #include "json_helper.hpp" #define LC_AREA_PATH "/etc/areas.db" @@ -319,6 +321,52 @@ WMError LayerControl::loadAreaDb(const std::string& path) return WMError::SUCCESS; } +WMError LayerControl::layoutChange(const WMAction& action) +{ + WMError ret = WMError::FAIL; + if (action.visible == TaskVisible::INVISIBLE) + { + // Visibility is not change -> no redraw is required + return WMError::SUCCESS; + } + if(action.client == nullptr) + { + HMI_SEQ_ERROR(action.req_num, "client may vanish"); + return WMError::NOT_REGISTERED; + } + unsigned layer = action.client->layerID(); + + // Layout Manager + // WMError ret = this->setLayerSize(layer, action.area); + auto rect = this->getAreaSize(action.area); + ilmErrorTypes err = ilm_layerSetDestinationRectangle(layer, rect.x, rect.y, rect.w, rect.h); + if(err == ILM_SUCCESS) + { + ret = WMError::SUCCESS; + } + return ret; +} + +WMError LayerControl::visibilityChange(const WMAction& action) +{ + WMError ret = WMError::FAIL; + if(action.client == nullptr) + { + HMI_SEQ_ERROR(action.req_num, "client may vanish"); + return WMError::NOT_REGISTERED; + } + + if (action.visible != TaskVisible::INVISIBLE) + { + ret = this->makeVisible(action.client.get()); + } + else + { + ret = this->makeInvisible(action.client.get()); + } + return ret; +} + void LayerControl::dispatchCreateEvent(ilmObjectType object, unsigned id, bool created) { this->cb.test(id); @@ -477,4 +525,61 @@ void LayerControl::dispatchPropertyChangeEvent(unsigned id, } } +WMError LayerControl::makeVisible(const WMClient* client) +{ + WMError ret = WMError::FAIL; + // Don't check here the client is not nullptr + unsigned layer = client->layerID(); + bool contains;// = this->checkBackGround(action.client->role()); + if(contains) + { + std::shared_ptr l; + // Move background from back ground layer + for(const auto& wm_layer : this->wm_layers) + { + if(wm_layer->layerName() == "BackGroundLayer") + { + //wm_layer.removeLayer(layer); + } + else + { + if(wm_layer->checkIDBelongTo(layer)) + { + l = wm_layer; + } + } + } + if(l != nullptr) + { + // make invisible first + ilm_layerSetVisibility(layer, 0); + ilm_commitChanges(); + //l->addLayer(layer); + } + } + for(const auto& wm_layer : this->wm_layers) + { + // make visible + //l->makeVisible(layer); + } + + return ret; +} + +WMError LayerControl::makeInvisible(const WMClient* client) +{ + WMError ret = WMError::FAIL; + // Don't check here the client is not nullptr + unsigned layer = client->layerID(); + bool contains;// = this->checkBackGround(client->role()); + if(contains) + { + // Pop from background + } + else + { + + } + return ret; +} } // namespace wm \ No newline at end of file -- cgit 1.2.3-korg