summaryrefslogtreecommitdiffstats
path: root/src/app.cpp
diff options
context:
space:
mode:
authorTadao Tanikawa <tanikawa.tadao@jp.panasonic.com>2017-12-12 21:44:57 +0900
committerTadao Tanikawa <tanikawa.tadao@jp.panasonic.com>2017-12-12 21:44:57 +0900
commitd6cd19121e0821cf40633533ae22c93c88f9e33b (patch)
tree69fc30ab41fd9ffa4b64627be4b0b9096f95f0be /src/app.cpp
parent9f9abc58011121722a82759124d061a645cee112 (diff)
Support XDG application
To run XDG application on AGL HomeScreen/WindowManager, a new binding API of WindowManager is added. This api is used only by AGL XDG-Launcher and all xdg applications should be packed as wgt compatible to AGL Application framework. Bug-AGL: SPEC-1096 Change-Id: I33dd3b056c736ef374e2251e818541ddd699877b Signed-off-by: Tadao Tanikawa <tanikawa.tadao@jp.panasonic.com>
Diffstat (limited to 'src/app.cpp')
-rw-r--r--src/app.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/app.cpp b/src/app.cpp
index 307217e..82701b7 100644
--- a/src/app.cpp
+++ b/src/app.cpp
@@ -686,6 +686,36 @@ result<int> App::api_request_surface(char const *drawing_name) {
return Err<int>("Surface already present");
}
+char const *App::api_request_surface(char const *drawing_name,
+ char const *ivi_id) {
+ ST();
+
+ auto lid = this->layers.get_layer_id(std::string(drawing_name));
+ unsigned sid = std::stol(ivi_id);
+
+ if (!lid) {
+ return "Drawing name does not match any role";
+ }
+
+ auto rname = this->lookup_id(drawing_name);
+
+ if (rname) {
+ return "Surface already present";
+ }
+
+ // register pair drawing_name and ivi_id
+ this->id_alloc.register_name_id(drawing_name, sid);
+ this->layers.add_surface(sid, *lid);
+
+ // this surface is already created
+ HMI_DEBUG("wm", "surface_id is %u, layer_id is %u", sid, *lid);
+
+ this->controller->layers[*lid]->add_surface(
+ this->controller->surfaces[sid].get());
+
+ return nullptr;
+}
+
void App::activate(int id) {
auto ip = this->controller->sprops.find(id);
if (ip != this->controller->sprops.end()) {