aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/wm_layer_control.cpp30
-rw-r--r--src/wm_layer_control.hpp16
2 files changed, 44 insertions, 2 deletions
diff --git a/src/wm_layer_control.cpp b/src/wm_layer_control.cpp
index 72a3a19..0e72fab 100644
--- a/src/wm_layer_control.cpp
+++ b/src/wm_layer_control.cpp
@@ -126,6 +126,36 @@ unsigned LayerControl::getNewLayerID(const string& role)
return ret;
}
+struct rect LayerControl::getAreaSize(const std::string& area)
+{
+ return area2size[area];
+}
+
+void LayerControl::setupArea(double scaling)
+{
+ struct rect rct;
+
+ rct = this->area2size["normal.full"];
+ this->area2size["normalfull"] = rct;
+ this->area2size["normal"] = rct;
+
+ for (auto &i : this->area2size)
+ {
+ i.second.x = static_cast<int>(scaling * i.second.x + 0.5);
+ i.second.y = static_cast<int>(scaling * i.second.y + 0.5);
+ i.second.w = static_cast<int>(scaling * i.second.w + 0.5);
+ i.second.h = static_cast<int>(scaling * i.second.h + 0.5);
+
+ HMI_DEBUG("wm:lm", "area:%s size(after) : x:%d y:%d w:%d h:%d",
+ i.first.c_str(), i.second.x, i.second.y, i.second.w, i.second.h);
+ }
+}
+
+Screen LayerControl::getScreenInfo()
+{
+ return Screen(this->screen_prop.screenWidth, this->screen_prop.screenHeight);
+}
+
WMError LayerControl::updateLayer(LayerState& layer_state)
{
return WMError::SUCCESS;
diff --git a/src/wm_layer_control.hpp b/src/wm_layer_control.hpp
index ad6bf53..647a5c7 100644
--- a/src/wm_layer_control.hpp
+++ b/src/wm_layer_control.hpp
@@ -25,8 +25,17 @@
namespace wm {
-class Screen : public rectangle {
-
+class Screen {
+ public:
+ Screen(unsigned w, unsigned h);
+ ~Screen();
+ unsigned width() { return _width; }
+ unsigned height() { return _height; }
+ private:
+ unsigned _width;
+ unsigned _height;
+ unsigned _pysical_width = 0;
+ unsigned _pysical_height = 0;
};
class LayerControlCallbacks {
@@ -52,6 +61,9 @@ class LayerControl
~LayerControl() = default;
WMError init(const LayerControlCallbacks& cb);
unsigned getNewLayerID(const std::string& role);
+ struct rect getAreaSize(const std::string& area);
+ void setupArea(double scaling);
+ Screen getScreenInfo();
// void setRenderOrder(const std::vector<unsigned> layer_render_order);
// std::vector<unsigned> getAllRenderOrder();
// std::vector<std::shared_ptr<WMLayer>>& getAllLayers();