aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-09-18 12:24:58 +0900
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-09-18 13:14:10 +0900
commitb7957f3fc1e5f5ce0525d62c67da64457ef1d9e0 (patch)
treea948b3d66438908237f9a8045a189b0f0c810eb0
parentbb6647d071a188defa2a36b8aead23d48f7df85d (diff)
Add setRenderOrder into WMClient
Implement finishes but not tested Change-Id: I59929038c163c445b562e9d9f28516da57516339 Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
-rw-r--r--src/window_manager.cpp6
-rw-r--r--src/wm_client.cpp46
-rw-r--r--src/wm_client.hpp1
3 files changed, 53 insertions, 0 deletions
diff --git a/src/window_manager.cpp b/src/window_manager.cpp
index a72f4a5..60470b4 100644
--- a/src/window_manager.cpp
+++ b/src/window_manager.cpp
@@ -505,6 +505,12 @@ void WindowManager::api_enddraw(char const *appid, char const *drawing_name)
bool WindowManager::api_client_set_render_order(char const* appid, const vector<string>& render_order)
{
bool ret = false;
+ string id = appid;
+ auto client = g_app_list.lookUpClient(id);
+ if(client)
+ {
+ client->setRenderOrder(render_order);
+ }
return ret;
}
diff --git a/src/wm_client.cpp b/src/wm_client.cpp
index 691c3cb..84f9842 100644
--- a/src/wm_client.cpp
+++ b/src/wm_client.cpp
@@ -142,6 +142,52 @@ bool WMClient::removeSurfaceIfExist(unsigned surface)
return ret;
}
+WMError WMClient::setRenderOrder(const vector<string> &order)
+{
+ WMError ret = WMError::SUCCESS;
+ this->surface_render_order.clear();
+ for(const auto& x : order)
+ {
+ unsigned s; // surface
+ if(x == this->role())
+ {
+ s = this->surfaceID();
+ }
+ else if(this->service2surfaces.count(x) != 0)
+ {
+ s = this->service2surfaces[x];
+ }
+ else
+ {
+ ret = WMError::NOT_REGISTERED;
+ break;
+ }
+ this->surface_render_order.push_back(s);
+ }
+ if(ret == WMError::SUCCESS)
+ {
+ int count = 0;
+ t_ilm_layer* id_array = new t_ilm_surface[this->surface_render_order.size()];
+ if(id_array == nullptr)
+ {
+ HMI_WARNING("short memory");
+ ret = WMError::FAIL;
+ }
+ else
+ {
+ for(const auto& i : this->surface_render_order)
+ {
+ id_array[count] = i;
+ ++count;
+ }
+ ilm_layerSetRenderOrder(this->layerID(),
+ id_array, this->surface_render_order.size());
+ delete id_array;
+ }
+ }
+ return ret;
+}
+
#if GTEST_ENABLED
bool WMClient::subscribe(afb_req req, const string &evname)
{
diff --git a/src/wm_client.hpp b/src/wm_client.hpp
index 40a0d1d..65c68b9 100644
--- a/src/wm_client.hpp
+++ b/src/wm_client.hpp
@@ -58,6 +58,7 @@ class WMClient
bool removeSurfaceIfExist(unsigned surface);
// bool removeRole(const std::string& role);
std::vector<unsigned> renderOrder() const;
+ WMError setRenderOrder(const std::vector<std::string>& order);
#if GTEST_ENABLED
bool subscribe(afb_req req, const std::string &event_name);