From bfa5b6fc4658ea3ab968f89abfdee458effdf29d Mon Sep 17 00:00:00 2001 From: Nakamura Hayato Date: Tue, 4 Jun 2013 17:23:46 +0900 Subject: [PATCH] Fix for TIVI-842. Change-Id: I9cb56ed1e3b161a2ff214f20e0abc157ffd37b91 Signed-off-by: Nakamura Hayato --- ico-app-framework/Makefile.am.bk | 41 -------- ico-app-framework/ico_uxf_conf_app.c | 96 ++++++++++++++---- ico-app-framework/ico_uxf_init.c | 62 ++++++++++-- ico-app-framework/ico_uxf_private.h | 4 +- ico-app-framework/ico_uxf_window.c | 191 ++++++++++++++++++++++++++--------- include/home_screen.h | 1 + include/ico_uxf_conf.h | 8 +- include/ico_uxf_proto.h | 5 +- include/ico_uxf_sysdef.h | 4 +- packaging/ico-uxf-HomeScreen.changes | 7 ++ packaging/ico-uxf-HomeScreen.spec | 6 +- res/config/app_attr.conf | 6 +- src/home_screen_lib.c | 15 +-- src/home_screen_main.c | 167 +++++++++++++++++++++++++++--- src/home_screen_parser.c | 3 + src/on_screen.c | 38 ++++++- src/status_bar.c | 12 ++- test/homescreen-test.sh | 31 +++--- 18 files changed, 534 insertions(+), 163 deletions(-) delete mode 100644 ico-app-framework/Makefile.am.bk diff --git a/ico-app-framework/Makefile.am.bk b/ico-app-framework/Makefile.am.bk deleted file mode 100644 index 0fb7db8..0000000 --- a/ico-app-framework/Makefile.am.bk +++ /dev/null @@ -1,41 +0,0 @@ -lib_LTLIBRARIES = libico-app-fw.la \ - libico-app-fw-efl.la - -#include_HEADERS = \ -# ico_apf.h \ -# ico_apf_error.h \ -# ico_apf_resource_control.h \ -# ico_apf_ecore.h - -libico_app_fw_la_CFLAGS = -I../include -I/usr/include/ico-uxf-weston-plugin $(AUL_CFLAGS) $(SLPPKGMGR_CFLAGS) @GLIB_CFLAGS@ -libico_app_fw_la_LIBADD = $(AUL_LIBS) $(SLPPKGMGR_LIBS) @GLIB_LIBS@ -libico_app_fw_la_LDFLAGS = -version-info 0:5:0 -libico_app_fw_la_SOURCES = \ - ico_uxf_conf_common.c \ - ico_uxf_conf_sys.c \ - ico_uxf_conf_app.c \ - ico_uxf_init.c \ - ico_uxf_launcher.c \ - ico_uxf_window.c \ - ico_uxf_inputdev.c \ - ico_apf_log.c \ - ico_apf_communication.c \ - ico_apf_resource_control.c \ - ico_apf_appmgr.c - -libico_app_fw_efl_la_CFLAGS = -I../include -I/usr/include/ico-uxf-weston-plugin $(EFL_CFLAGS) @GLIB_CFLAGS@ -libico_app_fw_efl_la_LIBADD = $(EFL_LIBS) @GLIB_LIBS@ -libico_app_fw_efl_la_LDFLAGS = -version-info 0:5:0 -libico_app_fw_efl_la_SOURCES = \ - ico_apf_ecore.c \ - ico_uxf_conf_ecore.c - -AM_CFLAGS = $(GCC_CFLAGS) -AM_CPPFLAGS = $(GCC_CFLAGS) \ - -DDATADIR='"$(datadir)"' \ - -DMODULEDIR='"$(moduledir)"' \ - -DLIBEXECDIR='"$(libexecdir)"' -AM_LDFLAGS = -module -avoid-version -rpath $(libdir) -lwayland-egl -lEGL -lGLESv2 - -.FORCE : - diff --git a/ico-app-framework/ico_uxf_conf_app.c b/ico-app-framework/ico_uxf_conf_app.c index 310ad7b..0e4b4df 100644 --- a/ico-app-framework/ico_uxf_conf_app.c +++ b/ico-app-framework/ico_uxf_conf_app.c @@ -113,7 +113,10 @@ infoAilpkg(const ail_appinfo_h appinfo, void *data) char *exec; GError *error; char *app_category; - char add_category[256]; + int app_category_type; + char add_category[400]; + int add_category_len; + char work[80]; int i; bool bval; struct stat buff; @@ -155,25 +158,43 @@ infoAilpkg(const ail_appinfo_h appinfo, void *data) add_category[0] = 0; error = NULL; app_category = g_key_file_get_string(sappfile, "app-attributes", package, &error); - if (error != NULL) { + if (error == NULL) { + app_category_type = 0; + } + else { g_clear_error(&error); error = NULL; app_category = g_key_file_get_string(sappfile, "app-attributes", name, &error); + if (error == NULL) { + app_category_type = 1; + } } + add_category_len = 0; if (error != NULL) { g_clear_error(&error); apfw_trace("infoAilpkg: %s(%s) dose not has app-attributes", package, name); } else { - apfw_trace("infoAilpkg: %s(%s) has app-category=%s", package, name, app_category); - strncpy(add_category, app_category, sizeof(add_category)-2); - add_category[sizeof(add_category)-2] = 0; - i = strlen(add_category); - if (i > 0) { - if (add_category[i-1] != ';') { - strcpy(&add_category[i], ";"); + for (i = 1;; i++) { + strncpy(&add_category[add_category_len], + app_category, sizeof(add_category)-add_category_len-2); + add_category[sizeof(add_category)-2] = 0; + add_category_len = strlen(add_category); + if (add_category_len > 0) { + if (add_category[add_category_len-1] != ';') { + strcpy(&add_category[add_category_len++], ";"); + } + } + snprintf(work, sizeof(work)-1, "%s.%d", + app_category_type == 0 ? package : name, i); + error = NULL; + app_category = g_key_file_get_string(sappfile, "app-attributes", work, &error); + if (error != NULL) { + g_clear_error(&error); + break; } } + apfw_trace("infoAilpkg: %s(%s) has app-category=%s", package, name, add_category); } g_clear_error(&error); @@ -181,9 +202,9 @@ infoAilpkg(const ail_appinfo_h appinfo, void *data) ail_appinfo_get_str(appinfo, AIL_PROP_CATEGORIES_STR, &category); if (strcmp(category, APP_CONF_AIL_NULL_STR) != 0) { apfw_trace("infoAilpkg: %s + %s", add_category, category); - i = strlen(add_category); - strncpy(&add_category[i], category, sizeof(add_category)-i-1); - add_category[sizeof(add_category)-i-1] = 0; + strncpy(&add_category[add_category_len], + category, sizeof(add_category)-add_category_len-1); + add_category[sizeof(add_category)-1] = 0; } if (add_category[0]) { category = add_category; @@ -606,6 +627,36 @@ infoAilpkg(const ail_appinfo_h appinfo, void *data) } } + /* surface animation */ + if ((found == 0) && (work[0] != 0)) { + if (strncasecmp(work, "Animation", 9) == 0) { + k = 9; + if (work[9] == '.') { + if (strncasecmp(&work[10], "visible", 7) == 0) { + k = 17; + } + else if (strncasecmp(&work[10], "resize", 6) == 0) { + k = 16; + } + else if (strncasecmp(&work[10], "move", 4) == 0) { + k = 14; + } + } + if (work[k] == '=') { + if (k == 14) { + apptbl->animation_move = strdup(&work[k+1]); + } + else if (k == 16) { + apptbl->animation_resize = strdup(&work[k+1]); + } + else { + apptbl->animation_visible = strdup(&work[k+1]); + } + } + found = 9; + } + } + /* cpu % at invisible */ if ((found == 0) && (work[0] != 0)) { if (strncasecmp(work, "invisiblecpu", 12) == 0) { @@ -624,12 +675,20 @@ infoAilpkg(const ail_appinfo_h appinfo, void *data) } } + /* configure event */ + if ((found == 0) && (work[0] != 0)) { + if (strcasecmp(work, "noconfigure") == 0) { + apptbl->noconfigure = 1; + found = 9; + } + } + /* start mode */ if ((found == 0) && (work[0] != 0)) { - if (strcasecmp(work, "autostart") == 0) { + if (strncasecmp(work, "auto", 4) == 0) { apptbl->autostart = 1; } - else if (strcasecmp(work, "noautostart") == 0) { + else if (strncasecmp(work, "noauto", 6) == 0) { apptbl->autostart = 0; } else { @@ -658,12 +717,13 @@ infoAilpkg(const ail_appinfo_h appinfo, void *data) _ico_app_config_update->applicationNum, apptbl->appid, apptbl->name, apptbl->exec, apptbl->type); apfw_trace("Ail.%d: categ=%d kind=%d disp=%d layer=%d zone=%d " - "sound=%d zone=%d auto=%d noicon=%d cpu=%d", + "sound=%d zone=%d auto=%d noicon=%d anim=%s cpu=%d", _ico_app_config_update->applicationNum, apptbl->categoryId, apptbl->kindId, apptbl->display[0].displayId, apptbl->display[0].layerId, apptbl->display[0].zoneId, apptbl->sound[0].soundId, apptbl->sound[0].zoneId, apptbl->autostart, apptbl->noicon, - apptbl->invisiblecpu); + apptbl->animation_visible ? apptbl->animation_visible : "(none)", + apptbl->invisiblecpu); _ico_app_config_update->applicationNum++; } else { @@ -792,7 +852,7 @@ readAilApplist(void) g_key_file_free(sappfile); sappfile = NULL; } - apfw_trace("readAilApplist: Leave(cannot read ail correctly %d =! %d", + apfw_trace("readAilApplist: Leave(cannot read ail correctly %d =! %d", _ico_app_config_update->ailNum, num); return NULL; } @@ -803,7 +863,7 @@ readAilApplist(void) if( sappfile) { g_key_file_free(sappfile); } - + apfw_trace("readAilApplist: Leave"); return _ico_app_config_update; diff --git a/ico-app-framework/ico_uxf_init.c b/ico-app-framework/ico_uxf_init.c index fa1721e..9a3b70d 100644 --- a/ico-app-framework/ico_uxf_init.c +++ b/ico-app-framework/ico_uxf_init.c @@ -198,6 +198,7 @@ ico_uxf_init(const char *name) for(dn = 0; dn < appconf->applicationNum; dn++) { prc = ico_uxf_mng_process(appconf->application[dn].appid, 1); prc->attr.internalid = 0; + prc->appconf = (void *)&appconf->application[dn]; prc->attr.status = ICO_UXF_PROCSTATUS_STOP; prc->attr.type = appconf->application[dn].categoryId; prc->attr.hostId = appconf->application[dn].hostId; @@ -289,6 +290,20 @@ ico_uxf_init(const char *name) wl_display_flush(gIco_Uxf_Api_Mng.Wayland_Display); uifw_trace("ico_uxf_init: Wayland/Weston connect OK"); + /* set client attribute if need */ + if (gIco_Uxf_Api_Mng.Wayland_WindowMgr) { + for(dn = 0; dn < appconf->applicationNum; dn++) { + if (appconf->application[dn].noconfigure) { + uifw_trace("ico_uxf_init: %s no need configure event", + appconf->application[dn].appid); + ico_window_mgr_set_client_attr(gIco_Uxf_Api_Mng.Wayland_WindowMgr, + appconf->application[dn].appid, + ICO_WINDOW_MGR_CLIENT_ATTR_NOCONFIGURE, 1); + wl_display_flush(gIco_Uxf_Api_Mng.Wayland_Display); + } + } + } + gIco_Uxf_Api_Mng.WaylandFd = wl_display_get_fd(gIco_Uxf_Api_Mng.Wayland_Display); @@ -780,6 +795,27 @@ ico_uxf_window_createdcb(void *data, struct ico_window_mgr *ico_window_mgr, prc = ico_uxf_mng_process(appid, 0); if (prc) { + /* set window animation */ + if (prc->appconf != NULL) { + if (((Ico_Uxf_conf_application *)prc->appconf)->animation_visible) { + ico_window_mgr_set_animation( + gIco_Uxf_Api_Mng.Wayland_WindowMgr, + surfaceid, ICO_WINDOW_MGR_ANIMATION_CHANGE_VISIBLE, + ((Ico_Uxf_conf_application *)prc->appconf)->animation_visible); + } + if (((Ico_Uxf_conf_application *)prc->appconf)->animation_resize) { + ico_window_mgr_set_animation( + gIco_Uxf_Api_Mng.Wayland_WindowMgr, + surfaceid, ICO_WINDOW_MGR_ANIMATION_CHANGE_RESIZE, + ((Ico_Uxf_conf_application *)prc->appconf)->animation_resize); + } + if (((Ico_Uxf_conf_application *)prc->appconf)->animation_move) { + ico_window_mgr_set_animation( + gIco_Uxf_Api_Mng.Wayland_WindowMgr, + surfaceid, ICO_WINDOW_MGR_ANIMATION_CHANGE_MOVE, + ((Ico_Uxf_conf_application *)prc->appconf)->animation_move); + } + } if (prc->attr.mainwin.window <= 0) { uifw_trace("ico_uxf_window_createdcb: Set Main Window, Config Data"); prc->attr.mainwin.window = surfaceid; @@ -1103,7 +1139,7 @@ ico_uxf_window_configurecb(void *data, struct ico_window_mgr *ico_window_mgr, layer, 0); } } - else if ((win->attr.w != width) || (win->attr.h != height)) { + else if ((win->attr.w != width) || (win->attr.h != height)) { (void)ico_uxf_window_resize(win->attr.window, win->attr.w, win->attr.h); } } @@ -1436,13 +1472,16 @@ ico_uxf_aul_aulcb(int pid, void *data) proc->attr.internalid = pid; if (proc->attr.status != ICO_UXF_PROCSTATUS_INIT) { /* child process, search parent process */ - uifw_trace("ico_uxf_aul_aulcb: fork&exec %s(proc=%08x, last=%08x)", - proc->attr.process, (unsigned int)proc, (unsigned int)gIco_Uxf_Api_Mng.Mng_LastProcess); + uifw_trace("ico_uxf_aul_aulcb: fork&exec %s", proc->attr.process); proc->attr.child = 1; /* save parent application if exist */ - if (proc != gIco_Uxf_Api_Mng.Mng_LastProcess) { + if (gIco_Uxf_Api_Mng.Mng_LastProcess != proc) { proc->parent = gIco_Uxf_Api_Mng.Mng_LastProcess; } + else { + uifw_trace("ico_uxf_aul_aulcb: same process %s real %s", proc->attr.process, + proc->parent ? proc->parent->attr.process : "(None)"); + } } else { proc->attr.child = 0; @@ -1472,11 +1511,9 @@ ICO_APF_API void ico_uxf_set_lastapp(const char *appid) { if (appid) { - uifw_trace("ico_uxf_set_lastapp: set last app %s", appid); gIco_Uxf_Api_Mng.Mng_LastProcess = ico_uxf_mng_process(appid, 0); } else { - uifw_trace("ico_uxf_set_lastapp: set last app NULL"); gIco_Uxf_Api_Mng.Mng_LastProcess = NULL; } } @@ -1547,7 +1584,6 @@ ico_uxf_timer_wake(const int msec) return; } gIco_Uxf_Api_Mng.NeedTimer = 0; - for (hash = 0; hash < ICO_UXF_MISC_HASHSIZE; hash++) { proc = gIco_Uxf_Api_Mng.Hash_ProcessId[hash]; while (proc) { @@ -1562,6 +1598,18 @@ ico_uxf_timer_wake(const int msec) kill(proc->attr.internalid, SIGSTOP); } } + else if (proc->susp == 0) { + uifw_trace("ico_uxf_timer_wake: CPU resume pid=%d(show=%d)", + proc->attr.internalid, proc->showmode); + ico_window_mgr_set_visible(gIco_Uxf_Api_Mng.Wayland_WindowMgr, + proc->attr.mainwin.window, + proc->showmode == + ICO_WINDOW_MGR_VISIBLE_SHOW_WO_ANIMATION ? + ICO_WINDOW_MGR_VISIBLE_SHOW_WO_ANIMATION : + ICO_WINDOW_MGR_VISIBLE_SHOW, + ICO_WINDOW_MGR_RAISE_NOCHANGE); + wl_display_flush(gIco_Uxf_Api_Mng.Wayland_Display); + } } else { proc->susptimer -= msec; diff --git a/ico-app-framework/ico_uxf_private.h b/ico-app-framework/ico_uxf_private.h index 196225b..191a964 100644 --- a/ico-app-framework/ico_uxf_private.h +++ b/ico-app-framework/ico_uxf_private.h @@ -61,11 +61,11 @@ typedef struct _Ico_Uxf_Mng_ProcWin { typedef struct _Ico_Uxf_Mng_Process { struct _Ico_Uxf_Mng_Process *nextidhash;/* next process of the same id and hash */ Ico_Uxf_Mng_ProcWin *procwin; /* process's subwindow */ - void *exttable; /* extended table */ + void *appconf; /* configuration table address */ struct _Ico_Uxf_Mng_Process *parent; /* parent process */ short susptimer; /* suspend timer */ char susp; /* real suspend flag */ - char res; /* (unused) */ + char showmode; /* resume show mode */ Ico_Uxf_ProcessAttr attr; /* process configuration */ } Ico_Uxf_Mng_Process; diff --git a/ico-app-framework/ico_uxf_window.c b/ico-app-framework/ico_uxf_window.c index f65673c..c322af1 100644 --- a/ico-app-framework/ico_uxf_window.c +++ b/ico-app-framework/ico_uxf_window.c @@ -38,35 +38,69 @@ extern Ico_Uxf_Api_Mng gIco_Uxf_Api_Mng; void ico_uxf_window_visible_control(Ico_Uxf_Mng_Window *winmng, const int show, const int raise) { + int showshow = show & 0x0ffff; + uifw_trace("ico_uxf_window_visible_control: send visible to weston(%s,%08x,%d,%d)", - (winmng->mng_process)->attr.process, winmng->attr.window, show, raise); - if ((show == 1) && ((winmng->mng_process)->attr.invisiblecpu == 0) && - ((winmng->mng_process)->attr.suspend != 0)) { - /* change to show, application resume */ - (winmng->mng_process)->attr.suspend = 0; - (winmng->mng_process)->susptimer = 0; - if ((winmng->mng_process)->susp) { - (winmng->mng_process)->susp = 0; - uifw_trace("ico_uxf_window_visible_control: CPU resume(%s)", - (winmng->mng_process)->attr.process); - kill((winmng->mng_process)->attr.internalid, SIGCONT); + (winmng->mng_process)->attr.process, winmng->attr.window, showshow, raise); + + if ((showshow == ICO_WINDOW_MGR_VISIBLE_SHOW) || + (showshow == ICO_WINDOW_MGR_VISIBLE_SHOW_WO_ANIMATION)) { + + if (((winmng->mng_process)->attr.invisiblecpu == 0) && + ((winmng->mng_process)->attr.suspend != 0)) { + + /* change to show, application resume */ + (winmng->mng_process)->attr.suspend = 0; + (winmng->mng_process)->susptimer = 0; + if ((winmng->mng_process)->susp) { + (winmng->mng_process)->susp = 0; + (winmng->mng_process)->showmode = showshow; + (winmng->mng_process)->susptimer = ICO_UXF_SUSP_DELAY; + gIco_Uxf_Api_Mng.NeedTimer = 1; + kill((winmng->mng_process)->attr.internalid, SIGCONT); + uifw_trace("ico_uxf_window_visible_control: CPU resume(%s)", + (winmng->mng_process)->attr.process); + if (raise != ICO_WINDOW_MGR_RAISE_NOCHANGE) { + ico_window_mgr_set_visible(gIco_Uxf_Api_Mng.Wayland_WindowMgr, + winmng->attr.window, + ICO_WINDOW_MGR_VISIBLE_NOCHANGE, raise); + if ((show & 0x00010000) == 0) { + wl_display_flush(gIco_Uxf_Api_Mng.Wayland_Display); + } + } + return; + } + } + else if (((winmng->mng_process)->showmode == + ICO_WINDOW_MGR_VISIBLE_SHOW) || + ((winmng->mng_process)->showmode == + ICO_WINDOW_MGR_VISIBLE_SHOW_WO_ANIMATION)) { + return; } } /* send visible control to Weston(Multi Window Manager) */ ico_window_mgr_set_visible(gIco_Uxf_Api_Mng.Wayland_WindowMgr, - winmng->attr.window, show, raise); - wl_display_flush(gIco_Uxf_Api_Mng.Wayland_Display); - - if ((show == 0) && ((winmng->mng_process)->attr.invisiblecpu == 0) && + winmng->attr.window, showshow, raise); + if ((show & 0x00010000) == 0) { + wl_display_flush(gIco_Uxf_Api_Mng.Wayland_Display); + } + if (((showshow == ICO_WINDOW_MGR_VISIBLE_HIDE) || + (showshow == ICO_WINDOW_MGR_VISIBLE_HIDE_WO_ANIMATION)) && + ((winmng->mng_process)->attr.invisiblecpu == 0) && ((winmng->mng_process)->attr.suspend == 0)) { /* change to hide, application suspend */ (winmng->mng_process)->attr.suspend = 1; + (winmng->mng_process)->showmode = showshow; (winmng->mng_process)->susptimer = ICO_UXF_SUSP_DELAY; gIco_Uxf_Api_Mng.NeedTimer = 1; uifw_trace("ico_uxf_window_visible_control: set CPU suspend(%s)", (winmng->mng_process)->attr.process); } + else { + (winmng->mng_process)->showmode = -1; + (winmng->mng_process)->susptimer = 0; + } } /*--------------------------------------------------------------------------*/ @@ -197,7 +231,7 @@ ico_uxf_window_resize(const int window, const int w, const int h) winmng->attr.h = h; ico_window_mgr_set_positionsize(gIco_Uxf_Api_Mng.Wayland_WindowMgr, window, - winmng->attr.x, winmng->attr.y, + ICO_UXF_MAX_COORDINATE, ICO_UXF_MAX_COORDINATE, winmng->attr.w, winmng->attr.h); wl_display_flush(gIco_Uxf_Api_Mng.Wayland_Display); @@ -241,7 +275,7 @@ ico_uxf_window_move(const int window, const int x, const int y) ico_window_mgr_set_positionsize(gIco_Uxf_Api_Mng.Wayland_WindowMgr, window, winmng->attr.x, winmng->attr.y, - winmng->attr.w, winmng->attr.h); + ICO_UXF_MAX_COORDINATE, ICO_UXF_MAX_COORDINATE); wl_display_flush(gIco_Uxf_Api_Mng.Wayland_Display); uifw_trace("ico_uxf_window_move: Leave(EOK)"); @@ -277,7 +311,8 @@ ico_uxf_window_raise(const int window) return ICO_UXF_ENOENT; } - ico_uxf_window_visible_control(winmng, 9, 1); + ico_uxf_window_visible_control(winmng, ICO_WINDOW_MGR_VISIBLE_NOCHANGE, + ICO_WINDOW_MGR_RAISE_RAISE); uifw_trace("ico_uxf_window_raise: Leave(EOK)"); return ICO_UXF_EOK; @@ -312,7 +347,8 @@ ico_uxf_window_lower(const int window) return ICO_UXF_ENOENT; } - ico_uxf_window_visible_control(winmng, 9, 0); + ico_uxf_window_visible_control(winmng, ICO_WINDOW_MGR_VISIBLE_NOCHANGE, + ICO_WINDOW_MGR_RAISE_LOWER); uifw_trace("ico_uxf_window_lower: Leave(EOK)"); return ICO_UXF_EOK; @@ -578,26 +614,28 @@ ico_uxf_window_control(const char *appid, const int winidx, if ((winmng->mng_process)->attr.noicon == 0) { if ((gIco_Uxf_Api_Mng.AppsCtlVisible != 0) || (winmng->attr.control == 0)) { - i = 1; + i = ICO_WINDOW_MGR_VISIBLE_SHOW_WO_ANIMATION; } else { - i = 0; + i = ICO_WINDOW_MGR_VISIBLE_HIDE_WO_ANIMATION; } } else { if ((gIco_Uxf_Api_Mng.AppsCtlVisible == 0) && (winmng->attr.control == 0)) { - i = 1; + i = ICO_WINDOW_MGR_VISIBLE_SHOW_WO_ANIMATION; } else { - i = 0; + i = ICO_WINDOW_MGR_VISIBLE_HIDE_WO_ANIMATION; } } - ico_uxf_window_visible_control(winmng, i, 9); + ico_uxf_window_visible_control(winmng, i | 0x00010000, + ICO_WINDOW_MGR_RAISE_NOCHANGE); } winmng = winmng->nextidhash; } } + wl_display_flush(gIco_Uxf_Api_Mng.Wayland_Display); } uifw_trace("ico_uxf_window_control: Leave(EOK)"); } @@ -685,7 +723,8 @@ ico_uxf_window_show(const int window) if (winmng->attr.control == 0) { /* request to display to Weston(Multi Window Manager) */ - ico_uxf_window_visible_control(winmng, 1, 9); + ico_uxf_window_visible_control(winmng, ICO_WINDOW_MGR_VISIBLE_SHOW, + ICO_WINDOW_MGR_RAISE_NOCHANGE); } uifw_trace("ico_uxf_window_show: Leave(EOK) control=%x", winmng->attr.control); return ICO_UXF_EOK; @@ -723,7 +762,8 @@ ico_uxf_window_hide(const int window) winmng->attr.visible = 0; /* request to hide to Weston(Multi Window Manager) */ - ico_uxf_window_visible_control(winmng, 0, 9); + ico_uxf_window_visible_control(winmng, ICO_WINDOW_MGR_VISIBLE_HIDE, + ICO_WINDOW_MGR_RAISE_NOCHANGE); uifw_trace("ico_uxf_window_hide: Leave(EOK)"); return ICO_UXF_EOK; @@ -762,17 +802,17 @@ ico_uxf_window_visible_raise(const int window, const int visible, const int rais return ICO_UXF_ENOENT; } - if (vis == 0) { - winmng->attr.visible = 0; + if (vis == ICO_WINDOW_MGR_VISIBLE_HIDE) { + winmng->attr.visible = ICO_WINDOW_MGR_VISIBLE_HIDE; } - else if (vis == 1) { - winmng->attr.visible = 1; + else if (vis == ICO_WINDOW_MGR_VISIBLE_SHOW) { + winmng->attr.visible = ICO_WINDOW_MGR_VISIBLE_SHOW; if (gIco_Uxf_Api_Mng.AppsCtlVisible == 0) { /* application screen */ if (winmng->attr.control != 0) { uifw_trace("ico_uxf_window_visible_raise: change to hide(ctrl=%x menu=0)", winmng->attr.control); - vis = 0; + vis = ICO_WINDOW_MGR_VISIBLE_HIDE; } } else { @@ -780,12 +820,13 @@ ico_uxf_window_visible_raise(const int window, const int visible, const int rais if ((winmng->mng_process)->attr.noicon != 0) { uifw_trace("ico_uxf_window_visible_raise: change to hide(ctrl=%x menu=1)", winmng->attr.control); - vis = 0; + vis = ICO_WINDOW_MGR_VISIBLE_HIDE; } } } - if ((vis != 9) || (raise != 9)) { + if ((vis != ICO_WINDOW_MGR_VISIBLE_NOCHANGE) || + (raise != ICO_WINDOW_MGR_RAISE_NOCHANGE)) { /* request to visible status and order status to Weston(Multi Window Manager) */ ico_uxf_window_visible_control(winmng, vis, raise); } @@ -795,10 +836,59 @@ ico_uxf_window_visible_raise(const int window, const int visible, const int rais /*--------------------------------------------------------------------------*/ /** - * @brief ico_uxf_window_animation: set window animation + * @brief ico_uxf_window_visible_noanimation(: show/hide a target window without animation * * @param[in] window Window identity - * @param[in] animation Animation name + * @param[in] show Show(1)/Hide(0) + * @return result + * @retval ICO_UXF_EOK success + * @retval ICO_UXF_ESRCH error(not initialized) + * @retval ICO_UXF_ENOENT error(not exist) + */ +/*--------------------------------------------------------------------------*/ +ICO_APF_API int +ico_uxf_window_visible_noanimation(const int window, const int show) +{ + Ico_Uxf_Mng_Window *winmng; /* window management table */ + + uifw_trace("ico_uxf_window_visible_noanimation: Enter(%08x,%d)", window, show); + + if (gIco_Uxf_Api_Mng.Initialized <= 0) { + uifw_warn("ico_uxf_window_visible_noanimation: Leave(ESRCH)"); + return ICO_UXF_ESRCH; + } + + winmng = ico_uxf_mng_window(window, 0); + if ((! winmng) || (! winmng->mng_display)) { + uifw_warn("ico_uxf_window_visible_noanimation: Leave(ENOENT)"); + return ICO_UXF_ENOENT; + } + winmng->attr.visible = show ? 1 : 0; + + if (show) { + if (winmng->attr.control == 0) { + /* request to display to Weston(Multi Window Manager) */ + ico_uxf_window_visible_control(winmng, ICO_WINDOW_MGR_VISIBLE_SHOW_WO_ANIMATION, + ICO_WINDOW_MGR_RAISE_NOCHANGE); + } + } + else { + ico_uxf_window_visible_control(winmng, ICO_WINDOW_MGR_VISIBLE_HIDE_WO_ANIMATION, + ICO_WINDOW_MGR_RAISE_NOCHANGE); + } + uifw_trace("ico_uxf_window_visible_noanimation: Leave(EOK) control=%x", + winmng->attr.control); + return ICO_UXF_EOK; +} + +/*--------------------------------------------------------------------------*/ +/** + * @brief ico_uxf_window_animation: set window animation + * + * @param[in] window Window identity + * @param[in] visible_animation Animation name of change show/hide + * @param[in] resize_animation Animation name of change surface size + * @param[in] move_animation Animation name of change surface position * @return result * @retval ICO_UXF_EOK success * @retval ICO_UXF_ESRCH error(not initialized) @@ -806,13 +896,15 @@ ico_uxf_window_visible_raise(const int window, const int visible, const int rais */ /*--------------------------------------------------------------------------*/ ICO_APF_API int -ico_uxf_window_animation(const int window, const char *animation) +ico_uxf_window_animation(const int window, const char *visible_animation, + const char *resize_animation, const char *move_animation) { Ico_Uxf_Mng_Window *winmng; /* window management table */ - char nullname[4]; - uifw_trace("ico_uxf_window_animation: Enter(%08x, %s)", - window, animation ? animation : "NULL"); + uifw_trace("ico_uxf_window_animation: Enter(%08x,%s,%s,%s)", + window, visible_animation ? visible_animation : "NULL", + resize_animation ? resize_animation : "NULL", + move_animation ? move_animation : "NULL"); if (gIco_Uxf_Api_Mng.Initialized <= 0) { uifw_warn("ico_uxf_window_animation: Leave(ESRCH)"); @@ -825,16 +917,25 @@ ico_uxf_window_animation(const int window, const char *animation) return ICO_UXF_ENOENT; } - if (animation) { + if (visible_animation) { ico_window_mgr_set_animation(gIco_Uxf_Api_Mng.Wayland_WindowMgr, - winmng->attr.window, animation); + winmng->attr.window, + ICO_WINDOW_MGR_ANIMATION_CHANGE_VISIBLE, + visible_animation); } - else { - nullname[0] = ' '; - nullname[1] = 0; + if (resize_animation) { ico_window_mgr_set_animation(gIco_Uxf_Api_Mng.Wayland_WindowMgr, - winmng->attr.window, nullname); + winmng->attr.window, + ICO_WINDOW_MGR_ANIMATION_CHANGE_RESIZE, + resize_animation); } + if (move_animation) { + ico_window_mgr_set_animation(gIco_Uxf_Api_Mng.Wayland_WindowMgr, + winmng->attr.window, + ICO_WINDOW_MGR_ANIMATION_CHANGE_MOVE, + move_animation); + } + uifw_trace("ico_uxf_window_animation: Leave(EOK)"); return ICO_UXF_EOK; } diff --git a/include/home_screen.h b/include/home_screen.h index 8788309..5b98e23 100644 --- a/include/home_screen.h +++ b/include/home_screen.h @@ -142,6 +142,7 @@ extern int hs_click_applist(void); extern void hs_show_onscreen(void); extern void hs_hide_onscreen(void); extern void hs_show_appscreen(const char *appid); +extern void hs_tile_delete_hide(const char *appid); extern void hs_get_image_path(char *buff, int len); extern void hs_get_sound_path(char *buff, int len); diff --git a/include/ico_uxf_conf.h b/include/ico_uxf_conf.h index 8a80590..d9d173c 100644 --- a/include/ico_uxf_conf.h +++ b/include/ico_uxf_conf.h @@ -100,18 +100,22 @@ typedef struct _ico_uxf_conf_application { char *group; char *exec; char *type; + char *animation_visible; + char *animation_resize; + char *animation_move; int hostId; char *location; char *icon_key_name; char autostart; char noicon; + char noconfigure; + char res; unsigned short invisiblecpu; short kindId; short categoryId; short displayzoneNum; short soundzoneNum; short inputdevNum; - char res[2]; Ico_Uxf_conf_appdisplay display[ICO_UXF_APPDISPLAY_MAX]; Ico_Uxf_conf_appsound sound[ICO_UXF_APPSOUND_MAX]; Ico_Uxf_conf_appinput input[ICO_UXF_APPINPUT_MAX]; @@ -207,7 +211,7 @@ typedef struct _ico_uxf_sys_config { typedef struct _ico_uxf_app_config { int applicationNum; - int ailNum; + int ailNum; Ico_Uxf_conf_application *application; Ico_Uxf_conf_application *hashidtable[ICO_UXF_MISC_HASHSIZE]; Ico_Uxf_conf_application *hashnametable[ICO_UXF_MISC_HASHSIZE]; diff --git a/include/ico_uxf_proto.h b/include/ico_uxf_proto.h index 79e33f5..e456afd 100644 --- a/include/ico_uxf_proto.h +++ b/include/ico_uxf_proto.h @@ -64,6 +64,8 @@ int ico_uxf_window_show(const int window); /* Show window */ int ico_uxf_window_hide(const int window); /* Hide window */ +int ico_uxf_window_visible_noanimation(const int window, const int show); + /* Show/Hide without animation */ int ico_uxf_window_visible_raise(const int window, const int visible, const int raise); /* Set window show/hide and raise/lower */ @@ -77,7 +79,8 @@ int ico_uxf_window_lower(const int window); /* Lower window */ int ico_uxf_window_active(const int window, const int target); /* Activate window */ -int ico_uxf_window_animation(const int window, const char *animation); +int ico_uxf_window_animation(const int window, const char *animation_visible, + const char *animation_resize, const char *animation_move); /* Set window animation */ int ico_uxf_window_control(const char *appid, const int winidx, const int control, const int onoff); diff --git a/include/ico_uxf_sysdef.h b/include/ico_uxf_sysdef.h index c218c89..a462700 100644 --- a/include/ico_uxf_sysdef.h +++ b/include/ico_uxf_sysdef.h @@ -62,8 +62,8 @@ extern "C" { #define ICO_UXF_MAX_COORDINATE 16384 /* maximum coordinate position + 1 */ /* timer */ -#define ICO_UXF_SUSP_INITTIME (10*1000) /* initiale no suspend time (ms) */ -#define ICO_UXF_SUSP_DELAY (300) /* suspend delay time (ms) */ +#define ICO_UXF_SUSP_INITTIME (5*1000) /* initiale no suspend time (ms) */ +#define ICO_UXF_SUSP_DELAY (200) /* suspend delay time (ms) */ #ifdef __cplusplus } diff --git a/packaging/ico-uxf-HomeScreen.changes b/packaging/ico-uxf-HomeScreen.changes index ab9612e..8e39a30 100644 --- a/packaging/ico-uxf-HomeScreen.changes +++ b/packaging/ico-uxf-HomeScreen.changes @@ -1,3 +1,10 @@ +* Tue Jun 04 2013 Shibata Makoto accepted/2.0alpha-wayland/20130603.172554@344634f +- 0.3.05 release. +- Fix for TIVI-842 - [WLD] Previously existing app thumbnails missing on homescreen after launch and terminate more apps + Homescreen stores the hided app thumbnail's information. +- Work around - Addition of the window animation interface. +- Appoint that more than ico-uxf-weston-plugin-0.5.04 are necessary for spec file. + * Fri May 24 2013 Shibata Makoto accepted/2.0alpha-wayland/20130520.093309@f56086f - 0.3.03 release - Fix for TIVI-839 - [WLD] Install app with wrt install, No new app icon shown in Homescreen App list. diff --git a/packaging/ico-uxf-HomeScreen.spec b/packaging/ico-uxf-HomeScreen.spec index fba465b..eefb84f 100644 --- a/packaging/ico-uxf-HomeScreen.spec +++ b/packaging/ico-uxf-HomeScreen.spec @@ -1,6 +1,6 @@ Name: ico-uxf-HomeScreen Summary: sample homescreen -Version: 0.3.04 +Version: 0.3.05 Release: 1.1 Group: TO_BE/FILLED_IN License: Apache License, Version 2.0 @@ -9,7 +9,7 @@ Source0: %{name}-%{version}.tar.bz2 BuildRequires: pkgconfig(wayland-client) >= 1.0 BuildRequires: pkgconfig(glib-2.0) -BuildRequires: ico-uxf-weston-plugin-devel >= 0.5.03 +BuildRequires: ico-uxf-weston-plugin-devel >= 0.5.04 BuildRequires: pkgconfig(eina) BuildRequires: pkgconfig(evas) BuildRequires: pkgconfig(eina) @@ -27,7 +27,7 @@ BuildRequires: libwebsockets-devel BuildRequires: capi-base-common-devel BuildRequires: edje-tools Requires: weston >= 1.0 -Requires: ico-uxf-weston-plugin >= 0.5.03 +Requires: ico-uxf-weston-plugin >= 0.5.04 %description Sample homescreen application. diff --git a/res/config/app_attr.conf b/res/config/app_attr.conf index fdc7084..427e165 100644 --- a/res/config/app_attr.conf +++ b/res/config/app_attr.conf @@ -12,7 +12,9 @@ org.tizen.music-player=Map # attributes of web applications DemoMeterApp=Map GhostCluster=Map -WinkerLeft=Camera.Left;kind=Maker;dispzone=SysApp.Left;layer=InterruptApp;NoDisplay;autostart;invisiblecpu=no -WinkerRight=Camera.Right;kind=Maker;dispzone=SysApp.Right;layer=InterruptApp;NoDisplay;autostart;invisiblecpu=no +WinkerLeft=Camera.Left;kind=Maker;dispzone=SysApp.Left;layer=InterruptApp +WinkerLeft.1=NoDisplay;autostart;Animation=Slide.toRight;invisiblecpu=no;noconfigure +WinkerRight=Camera.Right;kind=Maker;dispzone=SysApp.Right;layer=InterruptApp +WinkerRight.1=NoDisplay;autostart;Animation=Slide.toLeft;invisiblecpu=no;noconfigure # diff --git a/src/home_screen_lib.c b/src/home_screen_lib.c index 2ed2ac8..67b4f27 100644 --- a/src/home_screen_lib.c +++ b/src/home_screen_lib.c @@ -570,13 +570,6 @@ hs_lib_handle_statusbar(hs_lib_msg_t *msg) else if ((ret >= 0) && (attr.status != ICO_UXF_PROCSTATUS_RUN)) { /* launch the application */ ret = ico_uxf_process_execute(cmd); - if ((ret == ICO_UXF_EOK) || (ret == ICO_UXF_EBUSY)) { - idx = hs_tile_get_index_app(cmd); - if (idx < 0) { - idx = hs_tile_get_minchange(); - } - hs_tile_set_app(idx, cmd); - } } } else { @@ -593,6 +586,14 @@ hs_lib_handle_statusbar(hs_lib_msg_t *msg) cnt++; } } + ret = ico_uxf_process_attribute_get(cmd, &attr); + if ((ret >= 0) && (attr.status == ICO_UXF_PROCSTATUS_RUN)) { + idx = hs_tile_get_index_app(cmd); + if (idx < 0) { + idx = hs_tile_get_minchange(); + } + hs_tile_set_app(idx, cmd); + } /* show the application screen*/ hs_show_appscreen(cmd); diff --git a/src/home_screen_main.c b/src/home_screen_main.c index d66b17d..f9205ce 100644 --- a/src/home_screen_main.c +++ b/src/home_screen_main.c @@ -42,8 +42,15 @@ #define ICO_HS_WINDOW_TYPE_TOUCH (2) #define ICO_HS_TOUCH_TIME_OUT (1.0) /* Long press for timer */ typedef struct _hs_tile_info hs_tile_info_t; +typedef struct _hs_tile_hide hs_tile_hide_t; + +struct _hs_tile_hide { + hs_tile_hide_t *next; /* next hide app on the same tile */ + char appid[ICO_UXF_MAX_PROCESS_NAME]; +}; struct _hs_tile_info { + hs_tile_hide_t *next; int idx; /* index: 0 to ... */ int valid; /* 0: invalid, 1:valid */ /* dont't touch now */ char appid[ICO_UXF_MAX_PROCESS_NAME]; /* active app id */ @@ -214,6 +221,9 @@ hs_uxf_event(int ev, Ico_Uxf_EventDetail dd, int arg) if (idx >= 0) { hs_tile_free_app(idx); } + else { + hs_tile_delete_hide(dd.process.process); + } } } else if (ev == ICO_UXF_EVENT_ACTIVEWINDOW) { @@ -237,7 +247,6 @@ hs_uxf_event(int ev, Ico_Uxf_EventDetail dd, int arg) } else { ico_uxf_window_active(dd.window.window, - ICO_UXF_WINDOW_POINTER_ACTIVE | ICO_UXF_WINDOW_KEYBOARD_ACTIVE); ico_uxf_window_raise(dd.window.window); ico_syc_apc_active(winAttr.process); @@ -573,7 +582,6 @@ hs_show_appscreen(const char *appid) } else { ico_uxf_window_active(window.window, - ICO_UXF_WINDOW_POINTER_ACTIVE | ICO_UXF_WINDOW_KEYBOARD_ACTIVE); } ico_uxf_window_raise(window.window); @@ -712,6 +720,7 @@ hs_tile_init_info(void) uifw_warn("hs_tile_init_info: Leave(err malloc tile str failed)"); return ICO_HS_ERR; } + memset(hs_tile_info, 0, sizeof(hs_tile_info_t) * (tilecnt + ICO_HS_NOTILE_APP_MAX)); /* get screen size */ ico_uxf_window_screen_size_get(&dispW, &dispH); @@ -809,6 +818,45 @@ hs_tile_init_info(void) /*--------------------------------------------------------------------------*/ /** + * @brief hs_tile_delete_hide + * delete hide app information. + * + * @param[in] appid application id + * @return none + */ +/*--------------------------------------------------------------------------*/ +void +hs_tile_delete_hide(const char *appid) +{ + int ii; + hs_tile_info_t *tinfo; + hs_tile_hide_t *hide, *bhide; + + for (ii = 0; ii < hs_tile_cnt; ii++) { + tinfo = &hs_tile_info[ii]; + hide = tinfo->next; + bhide = NULL; + while (hide) { + if (strcmp(appid, hide->appid) == 0) { + if (! bhide) { + tinfo->next = hide->next; + } + else { + bhide->next = hide->next; + } + free(hide); + break; + } + bhide = hide; + hide = hide->next; + } + } + + return; +} + +/*--------------------------------------------------------------------------*/ +/** * @brief hs_tile_free_app * delete all information of the indicated tile. * @@ -820,10 +868,38 @@ void hs_tile_free_app(int idx) { hs_tile_info_t *tinfo; + hs_tile_hide_t *hide; + int win; if ((idx >= 0) && (idx < hs_tile_cnt)) { tinfo = &hs_tile_info[idx]; - memset(tinfo->appid, 0, ICO_UXF_MAX_PROCESS_NAME + 1); + if (tinfo->next) { + hide = tinfo->next; + tinfo->next = hide->next; + strncpy(tinfo->appid, hide->appid, ICO_UXF_MAX_PROCESS_NAME); + free(hide); + } + else { + memset(tinfo->appid, 0, ICO_UXF_MAX_PROCESS_NAME + 1); + } + } + else { + return; + } + + if (strlen(hs_active_onscreen) > 0) { + return; + } + if (hs_regulation_visible == 0) { + return; + } + + if ((hs_stat_touch == ICO_HS_TOUCH_IN_SHOW) + && (strlen(tinfo->appid) > 0)) { + win = hs_get_process_window(tinfo->appid); + if (win > 0) { + ico_uxf_window_visible_raise(win, 1, 1); + } } } @@ -970,13 +1046,15 @@ hs_tile_kill_app(const char *appid) int idx, ret; idx = hs_tile_get_index_app(appid); - if (idx < 0) { - return; - } ret = ico_uxf_process_terminate(appid); if (ret == ICO_UXF_EOK) { - hs_tile_free_app(idx); + if (idx >= 0) { + hs_tile_free_app(idx); + } + else { + hs_tile_delete_hide(appid); + } } return; @@ -1024,19 +1102,76 @@ void hs_tile_set_app(int idx, const char *appid) { hs_tile_info_t *tinfo; + hs_tile_hide_t *search, *bsearch, *hide = NULL; + int ii; uifw_trace("hs_tile_set_app: Enter(idx=%d appid=%s)", idx, appid); - if (idx >= 0) { - tinfo = &hs_tile_info[idx]; - if (tinfo->valid > 0) { + if ((idx < 0) && (idx >= hs_tile_cnt)) { + return; + } + + /* check whether the app is same as tile one */ + tinfo = &hs_tile_info[idx]; + if (strcmp(tinfo->appid, appid) == 0) { + return; + } + + /* check whether the app is hide */ + for (ii = 0; ii < hs_tile_cnt; ii++) { + tinfo = &hs_tile_info[ii]; + if (tinfo->valid == 0) continue; + search = tinfo->next; + bsearch = NULL; + while (search) { + if (strcmp(search->appid, appid) == 0) { + hide = search; + if (! bsearch) { + tinfo->next = search->next; + } + else { + bsearch->next = search->next; + } + break; + } + bsearch = search; + search = search->next; + } + if (hide) { + break; + } + } + + /* set */ + tinfo = &hs_tile_info[idx]; + if (tinfo->valid > 0) { + if (strlen(tinfo->appid) != 0) { int oldwin = hs_get_process_window(tinfo->appid); if (oldwin > 0) { (void) ico_uxf_window_hide(oldwin); } - strncpy(tinfo->appid, appid, ICO_UXF_MAX_PROCESS_NAME); - tinfo->change++; + + if (! hide) { + hide = malloc(sizeof(hs_tile_hide_t)); + } + if (! hide) { + uifw_warn("hs_tile_set_app: cannot allocate app table"); + } + else { + memset(hide, 0, sizeof(hs_tile_hide_t)); + strncpy(hide->appid, tinfo->appid, ICO_UXF_MAX_PROCESS_NAME); + if (tinfo->next) { + hide->next = tinfo->next; + } + tinfo->next = hide; + } + } + else { + free(hide); } + + strncpy(tinfo->appid, appid, ICO_UXF_MAX_PROCESS_NAME); + tinfo->change++; } } @@ -1453,6 +1588,12 @@ hs_touch_up_tile(void *data, Evas *evas, Evas_Object *obj, void *event_info) hs_tile_info_t *tinfo; uifw_trace("hs_touch_up_tile: idx=%d", idx); + + if (strlen(hs_active_onscreen) != 0) { + uifw_trace("hs_touch_up_tile: active=%s", hs_active_onscreen); + return; + } + tinfo = &hs_tile_info[idx]; if (tinfo->l_press == 1) { /* flag reset */ @@ -1779,7 +1920,7 @@ hs_regulation_listener(const int appcategory, hs_show_appscreen(NULL); } hs_hide_onscreen(); - memset(hs_active_onscreen, 0, sizeof(hs_active_onscreen)); + memset(hs_active_onscreen, 0, sizeof(hs_active_onscreen)); } } else { diff --git a/src/home_screen_parser.c b/src/home_screen_parser.c index 3829592..dbba3ba 100644 --- a/src/home_screen_parser.c +++ b/src/home_screen_parser.c @@ -370,6 +370,9 @@ hs_conftrol_form(const char *process, int window) if (idx >= 0) { hs_tile_free_app(idx); } + else { + hs_tile_delete_hide(hs_command_req[ii].program.terminate.appid); + } uifw_debug("FORM terminate %s = %d", hs_command_req[ii].program.terminate.appid, st); if (hs_command_delay > 0) diff --git a/src/on_screen.c b/src/on_screen.c index 07a0573..0539157 100644 --- a/src/on_screen.c +++ b/src/on_screen.c @@ -57,7 +57,8 @@ struct _ons_msg { /*============================================================================*/ static int ons_loadinons_edje_file(const char *edje_file); static void ons_event_message(char *format, ...); -static ons_msg_t *ons_alloc_seendmsg(char *data, int len); +static ons_msg_t *ons_alloc_sendmsg(char *data, int len); +static void ons_free_msgst(ons_msg_t *msg); static ons_msg_t *ons_get_sendmsg(void); static int ons_put_sendmsg(ons_msg_t *send); static char *ons_edje_parse_str(void *in, int arg_num); @@ -151,7 +152,7 @@ ons_event_message(char *format, ...) uifw_trace("OnScreen: ons_event_message %s", message); - send = ons_alloc_seendmsg(message, strlen(message)); + send = ons_alloc_sendmsg(message, strlen(message)); if (!send) { uifw_warn("ons_event_message: ERROR(allocate send msg)"); } @@ -236,7 +237,35 @@ ons_put_sendmsg(ons_msg_t *send) /*--------------------------------------------------------------------------*/ /** - * @brief ons_alloc_seendmsg + * @brief ons_free_msgst + * free the message structure + * + * @param[in] msg message to free + * @return none + */ +/*--------------------------------------------------------------------------*/ +static void +ons_free_msgst(ons_msg_t *msg) +{ + if (!msg) { + return; + } + + if (msg->data) { + free(msg->data); + } + + memset(msg, 0, sizeof(ons_msg_t)); + + msg->next = ons_free_msg; + ons_free_msg = msg; + + return; +} + +/*--------------------------------------------------------------------------*/ +/** + * @brief ons_alloc_sendmsg * Allocate a send message buffer. * * @param[in] data data @@ -247,7 +276,7 @@ ons_put_sendmsg(ons_msg_t *send) */ /*--------------------------------------------------------------------------*/ static ons_msg_t * -ons_alloc_seendmsg(char *data, int len) +ons_alloc_sendmsg(char *data, int len) { ons_msg_t *msg; @@ -389,6 +418,7 @@ ons_callback_onscreen(struct libwebsocket_context *context, uifw_warn("ons_callback_onscreen: ERROR(fail to write ws)"); } } + ons_free_msgst(msg); if (ons_send_msg) { libwebsocket_callback_on_writable(context, wsi); } diff --git a/src/status_bar.c b/src/status_bar.c index 6b43eeb..31c8dac 100644 --- a/src/status_bar.c +++ b/src/status_bar.c @@ -467,6 +467,8 @@ sb_touch_up_shortcut(void *data, Evas *evas, Evas_Object *obj, void *event_info) unsigned char *p = &buf[LWS_SEND_BUFFER_PRE_PADDING]; char *appid = (char *)data; + uifw_trace("TOUCH UP: SHORTCUT %s", appid); + if (sb_wait_reply == ICO_SB_NO_WAIT) { if ((sb_wsi_mirror != NULL) && (appid != NULL)) { n = sprintf((char *)p, "SHOW %s %s", appid, getenv("PKG_NAME")); @@ -498,6 +500,8 @@ sb_touch_down_applist(void *data, Evas *evas, Evas_Object *obj, void *event_info char img[ICO_HS_TEMP_BUF_SIZE]; char path[ICO_HS_TEMP_BUF_SIZE]; + uifw_trace("TOUCH DOWN: APPLIST"); + hs_get_image_path(path, sizeof(path)); sprintf(img, "%s"ICO_SB_APPLIST_ONICON, path); @@ -527,6 +531,8 @@ sb_touch_up_applist(void *data, Evas *evas, Evas_Object *obj, void *event_info) char path[ICO_HS_TEMP_BUF_SIZE]; char img[ICO_HS_TEMP_BUF_SIZE]; + uifw_trace("TOUCH UP: APPLIST"); + hs_get_image_path(path, sizeof(path)); sprintf(img, "%s"ICO_SB_APPLIST_OFFICON, path); @@ -564,6 +570,8 @@ sb_touch_down_escathion(void *data, Evas *evas, Evas_Object *obj, void *event_in char img[ICO_HS_TEMP_BUF_SIZE]; char path[ICO_HS_TEMP_BUF_SIZE]; + uifw_trace("TOUCH DOWN: CHANGE"); + hs_get_image_path(path, sizeof(path)); sprintf(img, "%s"ICO_SB_HOME_ONICON, path); @@ -593,6 +601,8 @@ sb_touch_up_escathion(void *data, Evas *evas, Evas_Object *obj, void *event_info char path[ICO_HS_TEMP_BUF_SIZE]; char img[ICO_HS_TEMP_BUF_SIZE]; + uifw_trace("TOUCH UP: CHANGE"); + hs_get_image_path(path, sizeof(path)); sprintf(img, "%s"ICO_SB_HOME_OFFICON, path); @@ -715,7 +725,7 @@ sb_add_shortcut(Evas *canvas) appid = hs_conf_get_string(ICO_HS_CONFIG_STATUBAR, config, NULL); if ((appid != NULL) && (strcmp(appid, "none") != 0)) { appconf = ico_uxf_getAppByAppid(appid); - if (appid) { + if (appconf) { tile = evas_object_image_filled_add(canvas); evas_object_image_file_set(tile, appconf->icon_key_name, NULL); diff --git a/test/homescreen-test.sh b/test/homescreen-test.sh index 7813942..ffdf6d3 100755 --- a/test/homescreen-test.sh +++ b/test/homescreen-test.sh @@ -1,46 +1,47 @@ #!/bin/sh ## log file -export HOMESCREEN_LOG=/tmp/log/org.tizen.ico.homescreen.log -export ONSCREEN_LOG=/tmp/log/org.tizen.ico.onscreen.log +mkdir /var/log/ico > /dev/null 2>&1 +export HOMESCREEN_LOG=/var/log/ico/org.tizen.ico.homescreen.log +export ONSCREEN_LOG=/var/log/ico/org.tizen.ico.onscreen.log ## make dat ./homescreen-test-makedat.sh ## GUI test -./ico_send_inputevent -m < testdata/gui-test.dat +ico_send_inputevent -m < testdata/gui-test.dat ## CUI test #Hide tile screen -./ico_send_hscommand json/hide-tile.json +ico_send_hscommand json/hide-tile.json sleep 3 #Show tile screen -./ico_send_hscommand json/show-tile.json +ico_send_hscommand json/show-tile.json sleep 3 #Show application -./ico_send_hscommand json/hide-tile.json +ico_send_hscommand json/hide-tile.json sleep 3 -./ico_send_hscommand json/show-app1.json +ico_send_hscommand json/show-app1.json sleep 3 #Move and resize application -./ico_send_hscommand json/geom-app1-1.json +ico_send_hscommand json/geom-app1-1.json sleep 3 -./ico_send_hscommand json/geom-app1-2.json +ico_send_hscommand json/geom-app1-2.json sleep 3 -./ico_send_hscommand json/geom-app1-3.json +ico_send_hscommand json/geom-app1-3.json sleep 3 #Terminate application -./ico_send_hscommand json/term-app1.json +ico_send_hscommand json/term-app1.json sleep 3 -./ico_send_hscommand json/show-tile.json +ico_send_hscommand json/show-tile.json sleep 3 #Terminate application -./ico_send_hscommand json/hide-tile.json +ico_send_hscommand json/hide-tile.json sleep 3 -./ico_send_hscommand json/exec-app1.json +ico_send_hscommand json/exec-app1.json sleep 3 #Application on tile screen -./ico_send_hscommand json/show-tile.json +ico_send_hscommand json/show-tile.json sleep 3 ## Check Error -- 2.7.4