aboutsummaryrefslogtreecommitdiffstats
path: root/src/wm_layer_control.cpp
diff options
context:
space:
mode:
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-08-27 15:28:00 +0900
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-08-27 19:17:17 +0900
commita5106227c3c9ddbe2b07fbc2ecfc4e2ae1e4de74 (patch)
tree94d568f2af40af4a8c92387a659e1351853834e2 /src/wm_layer_control.cpp
parent0a414d1909a0f356e195d81593eb6b50d470daab (diff)
Update wm_layer
Change-Id: Ia8277ba20a97a0a5b3617ae14a447e0e962afafd Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
Diffstat (limited to 'src/wm_layer_control.cpp')
-rw-r--r--src/wm_layer_control.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/wm_layer_control.cpp b/src/wm_layer_control.cpp
index 0e72fab..9c60286 100644
--- a/src/wm_layer_control.cpp
+++ b/src/wm_layer_control.cpp
@@ -21,6 +21,7 @@
#define LC_AREA_PATH "/etc/areas.db"
#define LC_LAYER_SETTING_PATH "/etc/layer_setting.json"
+#define LC_DEFAULT_AREA "normal.full"
using std::string;
using std::vector;
@@ -112,7 +113,19 @@ lc_init_error:
return WMError::FAIL;
}
-unsigned LayerControl::getNewLayerID(const string& role)
+void LayerControl::createNewLayer(unsigned id)
+{
+ HMI_INFO("create new ID :%d", id);
+ struct rect rct = this->area2size[LC_DEFAULT_AREA];
+ ilm_layerCreateWithDimension(&id, rct.w, rct.h);
+ ilm_layerSetSourceRectangle(id, rct.x, rct.y, rct.w, rct.h);
+ ilm_layerSetDestinationRectangle(id, rct.x, rct.y, rct.w, rct.h);
+ ilm_layerSetOpacity(id, 1.0);
+ ilm_layerSetVisibility(id, ILM_TRUE);
+ ilm_commitChanges();
+}
+
+unsigned LayerControl::getNewLayerID(const string& role, string* layer_name)
{
unsigned ret = 0;
for(const auto& l: this->wm_layers)
@@ -120,6 +133,7 @@ unsigned LayerControl::getNewLayerID(const string& role)
ret = l->getNewLayerID(role);
if(ret != 0)
{
+ *layer_name = l->layerName();
break;
}
}
@@ -134,6 +148,7 @@ struct rect LayerControl::getAreaSize(const std::string& area)
void LayerControl::setupArea(double scaling)
{
struct rect rct;
+ this->scaling = scaling;
rct = this->area2size["normal.full"];
this->area2size["normalfull"] = rct;
@@ -156,6 +171,11 @@ Screen LayerControl::getScreenInfo()
return Screen(this->screen_prop.screenWidth, this->screen_prop.screenHeight);
}
+double LayerControl::scale()
+{
+ return this->scaling;
+}
+
WMError LayerControl::updateLayer(LayerState& layer_state)
{
return WMError::SUCCESS;