aboutsummaryrefslogtreecommitdiffstats
path: root/src/wm_layer_control.cpp
diff options
context:
space:
mode:
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;