summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-08-07 12:04:39 +0900
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-08-08 12:20:36 +0900
commitab84647365b34b3e054d56c33619cdfdf7396e7c (patch)
tree9373c8006880fe756db3217e53337d3d3e09b587
parent25d7a9506643d28929393af5d4c97dffe7570300 (diff)
Fix simple-egl because of update libwindowmanager API
Change-Id: Ic4f8435eab9ad054c75bef668a3b05373d17f712 Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
-rw-r--r--sample/simple-egl/src/simple-egl.cpp42
-rw-r--r--src/libwindowmanager.h6
2 files changed, 25 insertions, 23 deletions
diff --git a/sample/simple-egl/src/simple-egl.cpp b/sample/simple-egl/src/simple-egl.cpp
index 0f601c2..6a2d0d8 100644
--- a/sample/simple-egl/src/simple-egl.cpp
+++ b/sample/simple-egl/src/simple-egl.cpp
@@ -60,7 +60,7 @@ uint32_t g_id_ivisurf = 9009;
long port = 1700;
string token = string("wm");
-const char* role = "test";
+const char* main_role = "test";
LibHomeScreen* hs;
LibWindowmanager *wm;
@@ -532,18 +532,19 @@ init_wm(LibWindowmanager *wm, struct window *window)
return -1;
}
- g_id_ivisurf = wm->requestSurface(role);
+ g_id_ivisurf = wm->requestSurface(main_role);
if (g_id_ivisurf < 0) {
HMI_ERROR(log_prefix,"wm request surface failed ");
return -1;
}
HMI_DEBUG(log_prefix,"IVI_SURFACE_ID: %d ", g_id_ivisurf);
- wm->setSyncDrawHandler([wm, window](const char* role, const char* area, const Rect& rect) {
+ wm->setSyncDrawHandler([wm, window](const char* role, const char* area, Rect rect) {
- HMI_DEBUG(log_prefix,"Surface %s got syncDraw! Area: %s. ", role, area);
+ HMI_DEBUG(log_prefix,"Surface %s got syncDraw! Area: %s. w:%d, h:%d", role, area, rect.width(), rect.height());
- window->geometry.width = rect.width();
- window->geometry.width = rect.height();
+ wl_egl_window_resize(window->native, rect.width(), rect.height(), 0, 0);
+ window->geometry.width = rect.width();
+ window->geometry.height = rect.height();
wm->endDraw(role);
@@ -566,23 +567,20 @@ init_wm(LibWindowmanager *wm, struct window *window)
wm->endDraw(obj);*/
});
- wm->setActivatedHandler([](const char* role){
- HMI_DEBUG(log_prefix, "activated : %s", role);
+ wm->setActiveHandler([](const char* role, bool active){
+ HMI_DEBUG(log_prefix, "role %s, active : %d", role, active);
});
- wm->setInactivedHandler([](const char* role){
- HMI_DEBUG(log_prefix, "inactivated : %s", role);
- });
- wm->setVisibleHandler([](const char* role){
- HMI_DEBUG(log_prefix, "visible : %s", role);
- });
- wm->setInvisibleHandler([](const char* role){
- HMI_DEBUG(log_prefix, "invisible : %s", role);
+ wm->setVisibleHandler([](const char* role, bool visible){
+ HMI_DEBUG(log_prefix, "role %s, visible : %d", role, visible);
});
wm->setFlushDrawHandler([](const char* role){
HMI_DEBUG(log_prefix, "flushDraw : %s", role);
});
- wm->setScreenUpdatedHandler([](const vector<string> &ids){
- HMI_DEBUG(log_prefix, "id : %s", ids[0].c_str());
+ wm->setScreenUpdatedHandler([](const vector<string>& ids){
+ if(ids.size() != 0)
+ HMI_DEBUG(log_prefix, "id : %s", ids[0].c_str());
+ else
+ HMI_DEBUG(log_prefix, "no id");
});
@@ -603,8 +601,8 @@ init_hs(LibHomeScreen* hs){
HMI_DEBUG(log_prefix,"Event_TapShortcut application_name = %s ", application_name);
if(strcmp(application_name, "Navigation") == 0)
{
- wm->activateWindow(role, "normal.full");
- HMI_DEBUG(log_prefix,"try to activesurface %s ", role);
+ wm->activateWindow(main_role);
+ HMI_DEBUG(log_prefix,"try to activesurface %s ", main_role);
}
});
@@ -631,7 +629,7 @@ main(int argc, char **argv)
token = argv[2];
}
- HMI_DEBUG(log_prefix,"app_name: %s, port: %d, token: %s. ", role, port, token.c_str());
+ HMI_DEBUG(log_prefix,"app_name: %s, port: %d, token: %s. ", main_role, port, token.c_str());
display.display = wl_display_connect(NULL);
assert(display.display);
@@ -678,7 +676,7 @@ main(int argc, char **argv)
sigaction(SIGINT, &sigint, NULL);
eglSwapBuffers(window.display->egl.dpy, window.egl_surface);
- wm->activateWindow(role, "normal.full");
+ wm->activateWindow(main_role);
/* The mainloop here is a little subtle. Redrawing will cause
* EGL to read events so we can just call
diff --git a/src/libwindowmanager.h b/src/libwindowmanager.h
index 10715ce..027e6fb 100644
--- a/src/libwindowmanager.h
+++ b/src/libwindowmanager.h
@@ -69,7 +69,11 @@ public:
/* DrawingArea name (usage: {layout}.{area}) */
const std::string kDefaultArea = "normal.full";
-
+ const std::string kStrLayoutNormal = "normal";
+ const std::string kStrLayoutSplit = "split";
+ const std::string kStrAreaFull = "full";
+ const std::string kStrAreaMain = "main";
+ const std::string kStrAreaSub = "sub";
/* Key for json obejct */
const char *kKeyDrawingName = "drawing_name";
const char *kKeyDrawingArea = "drawing_area";