Bug fix TIVI-839 ,change the design and permit operation of the music player while... 60/3660/1 accepted/2.0alpha-wayland/20130603.172554 submit/2.0alpha-wayland/20130527.085535
authorNakamura Hayato <hayato.nakamura@mail.toyota-td.jp>
Fri, 24 May 2013 11:22:12 +0000 (20:22 +0900)
committerNakamura Hayato <hayato.nakamura@mail.toyota-td.jp>
Fri, 24 May 2013 11:22:12 +0000 (20:22 +0900)
Change-Id: I0db2681a58a057f48cb0caccafd451fa17163555
Signed-off-by: Nakamura Hayato <hayato.nakamura@mail.toyota-td.jp>
42 files changed:
apps_controller/ico_syc_apc_control.c
apps_controller/ico_syc_apc_private.h
apps_controller/ico_syc_apc_regulation.c
configure.ac
ico-app-framework/Makefile.am
ico-app-framework/Makefile.am.bk [new file with mode: 0644]
ico-app-framework/ico_uxf_conf_app.c
ico-app-framework/ico_uxf_conf_ecore.c [new file with mode: 0644]
ico-app-framework/ico_uxf_init.c
ico-app-framework/ico_uxf_launcher.c
ico-app-framework/ico_uxf_private.h
ico-app-framework/ico_uxf_window.c
include/home_screen.h
include/ico_apf_resource_control.h
include/ico_syc_apc.h
include/ico_syc_def.h
include/ico_syc_error.h [deleted file]
include/ico_uxf_conf.h
include/ico_uxf_conf_ecore.h [new file with mode: 0644]
include/ico_uxf_proto.h
include/ico_uxf_sysdef.h
include/ico_uxf_typedef.h
install-appcore.sh
packaging/ico-uxf-HomeScreen.changes
packaging/ico-uxf-HomeScreen.spec
res/apps/org.tizen.ico.homescreen/homescreen.conf
res/apps/org.tizen.ico.statusbar/statusbar.conf
res/config/app_attr.conf
res/config/system.conf
res/images/applist_off.png [new file with mode: 0755]
res/images/applist_on.png [new file with mode: 0755]
res/images/home_off.png [new file with mode: 0755]
res/images/home_on.png [new file with mode: 0755]
settings/S99zz_ico_weston [deleted file]
src/Makefile.am
src/home_screen_lib.c
src/home_screen_main.c
src/on_screen.c
src/status_bar.c
start_homescreen_appcore
test/ico_send_hscommand.c
test/ico_set_vehicleinfo.c

index 0153e69..a19e20f 100644 (file)
@@ -94,6 +94,9 @@ static ico_apc_request_t *search_soundrequest(const Ico_Uxf_conf_application *co
 /*==============================================================================*/
 /* define fixed value                                                           */
 /*==============================================================================*/
+/* initiale allocate request blocks     */
+#define INIT_REQCB  50
+
 /* maximum number of request blocks     */
 #if ICO_UXF_DISPLAY_ZONE_MAX > ICO_UXF_SOUND_ZONE_MAX
   #if ICO_UXF_INPUT_SW_MAX > ICO_UXF_DISPLAY_ZONE_MAX
@@ -111,6 +114,30 @@ static ico_apc_request_t *search_soundrequest(const Ico_Uxf_conf_application *co
 
 /*--------------------------------------------------------------------------*/
 /**
+ * @brief   get_appconf: application configure(static function)
+ *
+ * @param       appid           application id
+ * @return      result
+ * @retval      != NULL         success(request block address)
+ * @retval      == NULL         error(out of memory)
+ */
+/*--------------------------------------------------------------------------*/
+static Ico_Uxf_conf_application *
+get_appconf(const char *appid)
+{
+    Ico_Uxf_conf_application *appconf = NULL;
+
+    appconf = (Ico_Uxf_conf_application *)ico_uxf_getAppByAppid(appid);
+    if (! appconf)  {
+        /* application id dose not exist, search application name   */
+        appconf = (Ico_Uxf_conf_application *)ico_uxf_getAppByName(appid);
+    }
+
+    return appconf;
+}
+
+/*--------------------------------------------------------------------------*/
+/**
  * @brief   get_freereq: get free request block(static function)
  *
  * @param       none
@@ -170,7 +197,7 @@ search_disprequest(const Ico_Uxf_conf_application *conf, const int resid, const
     for (i = 0; i < ndispzone; i++) {
         p = dispzone[i].req;
         while (p)   {
-            if ((p->conf == conf) &&
+            if ((strcmp(p->appid, conf->appid) == 0) &&
                 ((int)p->resid == resid))    {
                 if ((id < 0) || (p->id == id))  {
                     return p;
@@ -207,7 +234,7 @@ search_soundrequest(const Ico_Uxf_conf_application *conf, const int resid,
     for (i = 0; i < nsoundzone; i++) {
         p = soundzone[i].req;
         while (p)   {
-            if ((p->conf == conf) &&
+            if ((strcmp(p->appid, conf->appid) == 0) &&
                 ((int)p->resid == resid))    {
                 if ((id < 0) || (p->id == id))  {
                     if (first_req)  {
@@ -296,7 +323,7 @@ resource_reqcb(ico_apf_resource_notify_info_t* info, void *user_data)
         for (i = 0; i < ndispzone; i++) {
             p = dispzone[i].req;
             while (p)   {
-                if (p->conf == appconf) {
+                if (strcmp(p->appid, appconf->appid) == 0) {
                     reqsave[count++] = p;
                 }
                 p = p->next;
@@ -310,7 +337,7 @@ resource_reqcb(ico_apf_resource_notify_info_t* info, void *user_data)
         for (i = 0; i < nsoundzone; i++)    {
             p = soundzone[i].req;
             while (p)   {
-                if (p->conf == appconf) {
+                if (strcmp(p->appid, appconf->appid) == 0) {
                     reqsave[count++] = p;
                 }
                 p = p->next;
@@ -324,7 +351,7 @@ resource_reqcb(ico_apf_resource_notify_info_t* info, void *user_data)
         for (i = 0; i < ninputsw; i++)  {
             p = inputsw[i].req;
             while (p)   {
-                if (p->conf == appconf) {
+                if (strcmp(p->appid, appconf->appid) == 0) {
                     reqsave[count++] = p;
                 }
                 p = p->next;
@@ -341,7 +368,7 @@ resource_reqcb(ico_apf_resource_notify_info_t* info, void *user_data)
     if (! req)  {
         return;
     }
-    req->conf = appconf;
+    strncpy(req->appid, appconf->appid, ICO_UXF_MAX_PROCESS_NAME);
     req->resid = info->resid;
     if (info->device[0])    {
         strcpy(req->device, info->device);
@@ -490,7 +517,7 @@ resource_reqcb(ico_apf_resource_notify_info_t* info, void *user_data)
                         apfw_warn("resource_reqcb: send MSM Error");
                     }
                     if (soundcontrol) {
-                        (*soundcontrol)(p->conf, 1);
+                        (*soundcontrol)(get_appconf(req->appid), 1);
                     }
                 }
                 p->state &= ~(ICO_APC_REQSTATE_REPLYACTIVE|ICO_APC_REQSTATE_REPLYQUIET);
@@ -502,7 +529,7 @@ resource_reqcb(ico_apf_resource_notify_info_t* info, void *user_data)
             p = search_soundrequest(appconf, ICO_APF_RESID_BASIC_SOUND, -1, &freq);
             if (p)  {
                 apfw_trace("resource_reqcb: app(%s,state=%x,prio=%08x,pid=%d=>%d) "
-                           "requested sound, Nop", p->conf->appid, p->state, p->prio,
+                           "requested sound, Nop", p->appid, p->state, p->prio,
                            p->pid, info->pid);
                 p->pid = info->pid;
                 if (p->state & ICO_APC_REQSTATE_WAITREQ)    {
@@ -512,7 +539,7 @@ resource_reqcb(ico_apf_resource_notify_info_t* info, void *user_data)
                         apfw_warn("resource_reqcb: send MSM Error");
                     }
                     if (soundcontrol) {
-                        (*soundcontrol)(p->conf, 0);
+                        (*soundcontrol)(get_appconf(p->appid), 0);
                     }
                     if ((freq->state & ICO_APC_REQSTATE_WAITREQ) == 0)  {
                         if (ico_apf_resource_send_to_soundctl(ICO_APF_SOUND_COMMAND_MUTEOFF,
@@ -521,7 +548,7 @@ resource_reqcb(ico_apf_resource_notify_info_t* info, void *user_data)
                             apfw_warn("resource_reqcb: send MSM Error");
                         }
                         if (soundcontrol) {
-                            (*soundcontrol)(freq->conf, 1);
+                            (*soundcontrol)(get_appconf(freq->appid), 1);
                         }
                     }
                 }
@@ -569,7 +596,7 @@ resource_reqcb(ico_apf_resource_notify_info_t* info, void *user_data)
                         apfw_warn("resource_reqcb: send MSM Error");
                     }
                     if (soundcontrol) {
-                        (*soundcontrol)(p->conf, 1);
+                        (*soundcontrol)(get_appconf(p->appid), 1);
                     }
                 }
                 p->state &= ~(ICO_APC_REQSTATE_REPLYACTIVE|ICO_APC_REQSTATE_REPLYQUIET);
@@ -637,7 +664,7 @@ app_getdisplay(ico_apc_request_t *req, const int addprio)
 {
     int     prio;
     int     i, j;
-    Ico_Uxf_conf_application    *conf = req->conf;
+    Ico_Uxf_conf_application    *conf = (Ico_Uxf_conf_application *)get_appconf(req->appid);
     Ico_Uxf_conf_display_zone   *zone;
     ico_apc_dispzone_t          *czone;
     ico_apc_request_t           *p;
@@ -685,7 +712,7 @@ app_getdisplay(ico_apc_request_t *req, const int addprio)
     p = czone->req;
     bp = NULL;
     while (p)   {
-        if ((p->conf == req->conf) && (p->resid == req->resid) &&
+        if ((strcmp(p->appid, req->appid) == 0) && (p->resid == req->resid) &&
             (p->zoneidx == req->zoneidx))   {
             break;
         }
@@ -726,13 +753,13 @@ app_getdisplay(ico_apc_request_t *req, const int addprio)
         req->next = bp->next;
         bp->next = req;
         apfw_trace("app_getdisplay: app(%s) set after(%s) of zone(%s)",
-                   conf->appid, bp->conf->appid, req->device);
+                   conf->appid, bp->appid, req->device);
     }
     else    {
         req->next = czone->req;
         czone->req = req;
         apfw_trace("app_getdisplay: app(%s) set top of zone(%s) next %s",
-                   conf->appid, req->device, req->next ? req->next->conf->appid : "(NULL)");
+                   conf->appid, req->device, req->next ? req->next->appid : "(NULL)");
     }
 
     /* check if maximum priority    */
@@ -812,7 +839,7 @@ app_getdisplay(ico_apc_request_t *req, const int addprio)
         }
         /* send change event to invisible application   */
         apfw_trace("app_getdisplay: next=%08x %s next_state=%x",
-                   req->next, req->next ? req->next->conf->appid : " ",
+                   req->next, req->next ? req->next->appid : " ",
                    req->next ? req->next->state : 0x9999);
         if ((req->next) && ((req->next->state & ICO_APC_REQSTATE_WAITREQ) == 0))  {
             p = req->next;
@@ -826,12 +853,12 @@ app_getdisplay(ico_apc_request_t *req, const int addprio)
             if (p != NULL)  {
                 if ((p->state & ICO_APC_REQSTATE_WAITREQ) == 0)   {
                     p->state |= ICO_APC_REQSTATE_WAITREQ;
-                    apfw_trace("app_getdisplay: overlaped(%s), waitting", p->conf->appid);
+                    apfw_trace("app_getdisplay: overlaped(%s), waitting", p->appid);
                     if (p->reqtype == ICO_APC_REQTYPE_REQUEST)  {
                         if (ico_apf_resource_send_to_client(
-                                p->conf->appid, ICO_APF_RESOURCE_STATE_DEPRIVED,
+                                p->appid, ICO_APF_RESOURCE_STATE_DEPRIVED,
                                 p->resid, p->device, p->id) != ICO_APF_RESOURCE_E_NONE) {
-                            apfw_warn("app_getdisplay: send(%s) Error)", p->conf->appid);
+                            apfw_warn("app_getdisplay: send(%s) Error)", p->appid);
                         }
                         else    {
                             req->state &= ~ICO_APC_REQSTATE_REPLYACTIVE;
@@ -840,9 +867,9 @@ app_getdisplay(ico_apc_request_t *req, const int addprio)
                             timer_count ++;
                         }
                     }
-                    ico_uxf_window_control(p->conf->appid, -1, ICO_UXF_APPSCTL_INVISIBLE, 1);
+                    ico_uxf_window_control(p->appid, -1, ICO_UXF_APPSCTL_INVISIBLE, 1);
                     if (displaycontrol) {
-                        (*displaycontrol)(p->conf, 0);
+                        (*displaycontrol)(get_appconf(p->appid), 0);
                     }
                 }
             }
@@ -867,12 +894,12 @@ static void
 app_freedisplay(ico_apc_request_t *req, const int send)
 {
     int     idx;
-    Ico_Uxf_conf_application    *conf = req->conf;
+    Ico_Uxf_conf_application    *conf = get_appconf(req->appid);
     ico_apc_dispzone_t          *czone;
     ico_apc_request_t           *p;
     ico_apc_request_t           *bp;
 
-    apfw_trace("app_freedisplay: Entry(app=%s)", conf->appid);
+    apfw_trace("app_freedisplay: Entry(app=%s)", req->appid);
 
     czone = &dispzone[req->zoneidx];
     idx = czone->conf->display->id;
@@ -883,7 +910,7 @@ app_freedisplay(ico_apc_request_t *req, const int send)
     }
     if ((send !=0) && (req->reqtype == ICO_APC_REQTYPE_REQUEST))   {
         (void) ico_apf_resource_send_to_client(
-                                req->conf->appid, ICO_APF_RESOURCE_STATE_RELEASED,
+                                req->appid, ICO_APF_RESOURCE_STATE_RELEASED,
                                 req->resid, req->device, req->id);
     }
 
@@ -933,17 +960,17 @@ static void
 change_disprequest(ico_apc_request_t *req, const int active)
 {
     apfw_trace("change_disprequest: change to %s(%s)", active ? "active" : "inactive",
-               req->conf->appid);
+               req->appid);
 
     req->state &= ~(ICO_APC_REQSTATE_REPLYACTIVE|ICO_APC_REQSTATE_REPLYQUIET);
 
     if (req->reqtype == ICO_APC_REQTYPE_REQUEST)   {
         if (ico_apf_resource_send_to_client(
-                        req->conf->appid,
+                        req->appid,
                         active ? ICO_APF_RESOURCE_STATE_ACQUIRED :
                                  ICO_APF_RESOURCE_STATE_DEPRIVED,
                         req->resid, req->device, req->id) != ICO_APF_RESOURCE_E_NONE) {
-            apfw_warn("change_disprequest: send(%s) Error", req->conf->appid);
+            apfw_warn("change_disprequest: send(%s) Error", req->appid);
         }
         else    {
             req->state |= (active ? ICO_APC_REQSTATE_REPLYACTIVE :
@@ -953,10 +980,10 @@ change_disprequest(ico_apc_request_t *req, const int active)
         }
     }
     if ((req->state & ICO_APC_REQSTATE_REPLYACTIVE) == 0)   {
-        ico_uxf_window_control(req->conf->appid, req->id, ICO_UXF_APPSCTL_INVISIBLE,
+        ico_uxf_window_control(req->appid, req->id, ICO_UXF_APPSCTL_INVISIBLE,
                                active ? 0 : 1);
         if (displaycontrol) {
-            (*displaycontrol)(req->conf, active);
+            (*displaycontrol)(get_appconf(req->appid), active);
         }
     }
     if (active)   {
@@ -1014,7 +1041,7 @@ recalc_dispzone(const int idx)
             p->state &= ~ICO_APC_REQSTATE_WAITPROC;
         }
         apfw_trace("recalc_dispzone: Leave(%s no need visible control)",
-                   czone2->req->conf->appid);
+                   czone2->req->appid);
         return;
     }
 
@@ -1059,7 +1086,7 @@ app_getsound(ico_apc_request_t *req, const int addprio)
 {
     int     prio;
     int     i, j;
-    Ico_Uxf_conf_application    *conf = req->conf;
+    Ico_Uxf_conf_application    *conf = get_appconf(req->appid);
     Ico_Uxf_conf_sound_zone     *zone;
     ico_apc_soundzone_t         *czone;
     ico_apc_request_t           *p;
@@ -1107,7 +1134,7 @@ app_getsound(ico_apc_request_t *req, const int addprio)
     p = czone->req;
     bp = NULL;
     while (p)   {
-        if ((p->conf == req->conf) && (p->resid == req->resid) &&
+        if ((strcmp(p->appid, req->appid) == 0) && (p->resid == req->resid) &&
             (p->zoneidx == req->zoneidx))   {
             break;
         }
@@ -1205,7 +1232,7 @@ app_getsound(ico_apc_request_t *req, const int addprio)
         }
         /* send change event to mute application    */
         apfw_trace("app_getsound: next=%08x %s next_state=%x",
-                   req->next, req->next ? req->next->conf->appid : " ",
+                   req->next, req->next ? req->next->appid : " ",
                    req->next ? req->next->state : 0x9999);
         if ((req->next) && ((req->next->state & ICO_APC_REQSTATE_WAITREQ) == 0))  {
             p = req->next;
@@ -1219,12 +1246,12 @@ app_getsound(ico_apc_request_t *req, const int addprio)
             if (p != NULL)  {
                 if ((p->state & ICO_APC_REQSTATE_WAITREQ) == 0)   {
                     p->state |= ICO_APC_REQSTATE_WAITREQ;
-                    apfw_trace("app_getsound: overlaped(%s), waitting", p->conf->appid);
+                    apfw_trace("app_getsound: overlaped(%s), waitting", p->appid);
                     if (p->reqtype == ICO_APC_REQTYPE_REQUEST)  {
                         if (ico_apf_resource_send_to_client(
-                                p->conf->appid, ICO_APF_RESOURCE_STATE_DEPRIVED,
+                                p->appid, ICO_APF_RESOURCE_STATE_DEPRIVED,
                                 p->resid, p->device, p->id) != ICO_APF_RESOURCE_E_NONE) {
-                            apfw_warn("app_getsound: send(%s) Error)", p->conf->appid);
+                            apfw_warn("app_getsound: send(%s) Error)", p->appid);
                         }
                         else    {
                             p->state |= ICO_APC_REQSTATE_REPLYQUIET;
@@ -1238,7 +1265,7 @@ app_getsound(ico_apc_request_t *req, const int addprio)
                     apfw_warn("app_getsound: send MSM Error");
                 }
                 if (soundcontrol) {
-                    (*soundcontrol)(p->conf, 0);
+                    (*soundcontrol)(get_appconf(p->appid), 0);
                 }
             }
             if (i >= czone->noverlap)   break;
@@ -1263,12 +1290,12 @@ static void
 app_freesound(ico_apc_request_t *req, const int send)
 {
     int     idx;
-    Ico_Uxf_conf_application    *conf = req->conf;
+    Ico_Uxf_conf_application    *conf = get_appconf(req->appid);
     ico_apc_soundzone_t         *czone;
     ico_apc_request_t           *p;
     ico_apc_request_t           *bp;
 
-    apfw_trace("app_freesound: Entry(app=%s)", conf->appid);
+    apfw_trace("app_freesound: Entry(app=%s)", req->appid);
 
     czone = &soundzone[req->zoneidx];
     idx = czone->conf->sound->id;
@@ -1282,7 +1309,7 @@ app_freesound(ico_apc_request_t *req, const int send)
     }
     if ((send !=0) && (req->reqtype == ICO_APC_REQTYPE_REQUEST))   {
         (void) ico_apf_resource_send_to_client(
-                                req->conf->appid, ICO_APF_RESOURCE_STATE_RELEASED,
+                                req->appid, ICO_APF_RESOURCE_STATE_RELEASED,
                                 req->resid, req->device, req->id);
     }
 
@@ -1332,17 +1359,17 @@ static void
 change_soundrequest(ico_apc_request_t *req, const int active)
 {
     apfw_trace("change_soundrequest: change to %s(%s)", active ? "active" : "quiet",
-               req->conf->appid);
+               req->appid);
 
     req->state &= ~(ICO_APC_REQSTATE_REPLYACTIVE|ICO_APC_REQSTATE_REPLYQUIET);
 
     if (req->reqtype == ICO_APC_REQTYPE_REQUEST)   {
         if (ico_apf_resource_send_to_client(
-                        req->conf->appid,
+                        req->appid,
                         active ? ICO_APF_RESOURCE_STATE_ACQUIRED :
                                  ICO_APF_RESOURCE_STATE_DEPRIVED,
                         req->resid, req->device, req->id) != ICO_APF_RESOURCE_E_NONE) {
-            apfw_warn("change_soundrequest: send(%s) Error", req->conf->appid);
+            apfw_warn("change_soundrequest: send(%s) Error", req->appid);
         }
         else    {
             req->state |= (active ? ICO_APC_REQSTATE_REPLYACTIVE :
@@ -1358,7 +1385,7 @@ change_soundrequest(ico_apc_request_t *req, const int active)
             apfw_warn("change_soundrequest: send MSM Error");
         }
         if (soundcontrol) {
-            (*soundcontrol)(req->conf, active);
+            (*soundcontrol)(get_appconf(req->appid), active);
         }
     }
     if (active)   {
@@ -1416,7 +1443,7 @@ recalc_soundzone(const int idx)
             p->state &= ~ICO_APC_REQSTATE_WAITPROC;
         }
         apfw_trace("recalc_soundzone: Leave(%s no need sound control)",
-                   czone2->req->conf->appid);
+                   czone2->req->appid);
         return;
     }
 
@@ -1425,7 +1452,7 @@ recalc_soundzone(const int idx)
     p->state &= ~ICO_APC_REQSTATE_WAITPROC;
     if (p->prio & ICO_UXF_PRIO_REGULATION)  {
         apfw_trace("recalc_soundzone: Start %s(prio=%08x and no regulation)",
-                   p->conf->appid, p->prio);
+                   p->appid, p->prio);
         change_soundrequest(p, 1);
     }
 
@@ -1437,7 +1464,7 @@ recalc_soundzone(const int idx)
                 p->state &= ~ICO_APC_REQSTATE_WAITPROC;
                 if (p->prio & ICO_UXF_PRIO_REGULATION)  {
                     apfw_trace("recalc_soundzone: Overlap Stop %s(top and no regulation)",
-                               p->conf->appid);
+                               p->appid);
                     change_soundrequest(p, 0);
                 }
                 else    {
@@ -1456,7 +1483,7 @@ recalc_soundzone(const int idx)
         if (p->state & ICO_APC_REQSTATE_WAITREQ)    {
             if (p->prio & ICO_UXF_PRIO_REGULATION)  {
                 apfw_trace("recalc_soundzone: Overlap Start %s(top and no regulation)",
-                           p->conf->appid);
+                           p->appid);
                 change_soundrequest(p, 1);
             }
         }
@@ -1478,7 +1505,7 @@ app_getinput(ico_apc_request_t *req, const int addprio)
 {
     int     prio;
     int     i;
-    Ico_Uxf_conf_application    *conf = req->conf;
+    Ico_Uxf_conf_application    *conf = get_appconf(req->appid);
     ico_apc_inputsw_t           *czone;
     ico_apc_request_t           *p;
     ico_apc_request_t           *bp;
@@ -1524,7 +1551,7 @@ app_getinput(ico_apc_request_t *req, const int addprio)
     p = czone->req;
     bp = NULL;
     while (p)   {
-        if ((p->conf == req->conf) && (p->resid == req->resid) &&
+        if ((strcmp(p->appid, req->appid) == 0) && (p->resid == req->resid) &&
             (p->zoneidx == req->zoneidx))   {
             break;
         }
@@ -1575,7 +1602,7 @@ app_getinput(ico_apc_request_t *req, const int addprio)
         /* insert application to zone application list and      */
         /* change zone priority, if request application is top priority */
         req->state |= ICO_APC_REQSTATE_WAITREQ;
-        if (ico_uxf_input_control(0, req->conf->appid, czone->inputdev->device,
+        if (ico_uxf_input_control(0, req->appid, czone->inputdev->device,
                                   czone->inputsw->input) != ICO_UXF_EOK)    {
             apfw_warn("app_getinput: send MIM Error");
         }
@@ -1611,7 +1638,7 @@ app_getinput(ico_apc_request_t *req, const int addprio)
                 timer_count ++;
             }
         }
-        if (ico_uxf_input_control(1, req->conf->appid, czone->inputdev->device,
+        if (ico_uxf_input_control(1, req->appid, czone->inputdev->device,
                                   czone->inputsw->input) != ICO_UXF_EOK)    {
             apfw_warn("app_getinput: send MIM Error");
         }
@@ -1619,12 +1646,12 @@ app_getinput(ico_apc_request_t *req, const int addprio)
         if ((req->next) && ((req->next->state & ICO_APC_REQSTATE_WAITREQ) == 0))  {
             p = req->next;
             p->state |= ICO_APC_REQSTATE_WAITREQ;
-            apfw_trace("app_getinput: lower priority(%s), waitting", p->conf->appid);
+            apfw_trace("app_getinput: lower priority(%s), waitting", p->appid);
             if (p->reqtype == ICO_APC_REQTYPE_REQUEST)  {
                 if (ico_apf_resource_send_to_client(
-                            p->conf->appid, ICO_APF_RESOURCE_STATE_DEPRIVED,
+                            p->appid, ICO_APF_RESOURCE_STATE_DEPRIVED,
                             p->resid, p->device, p->id) != ICO_APF_RESOURCE_E_NONE) {
-                    apfw_warn("app_getinput: send(%s) Error)", p->conf->appid);
+                    apfw_warn("app_getinput: send(%s) Error)", p->appid);
                 }
                 else    {
                     p->state |= ICO_APC_REQSTATE_REPLYQUIET;
@@ -1650,12 +1677,12 @@ app_getinput(ico_apc_request_t *req, const int addprio)
 static void
 app_freeinput(ico_apc_request_t *req, const int send)
 {
-    Ico_Uxf_conf_application    *conf = req->conf;
+    Ico_Uxf_conf_application    *conf = get_appconf(req->appid);
     ico_apc_inputsw_t           *czone;
     ico_apc_request_t           *p;
     ico_apc_request_t           *bp;
 
-    apfw_trace("app_freeinput: Entry(app=%s)", conf->appid);
+    apfw_trace("app_freeinput: Entry(app=%s)", req->appid);
 
     czone = &inputsw[req->zoneidx];
 
@@ -1668,7 +1695,7 @@ app_freeinput(ico_apc_request_t *req, const int send)
     }
     if ((send !=0) && (req->reqtype == ICO_APC_REQTYPE_REQUEST))   {
         (void) ico_apf_resource_send_to_client(
-                                req->conf->appid, ICO_APF_RESOURCE_STATE_RELEASED,
+                                req->appid, ICO_APF_RESOURCE_STATE_RELEASED,
                                 req->resid, req->device, req->id);
     }
 
@@ -1720,17 +1747,17 @@ change_inputrequest(ico_apc_request_t *req, const int active)
     ico_apc_inputsw_t       *czone;
 
     apfw_trace("change_inputrequest: change to %s(%s)", active ? "use" : "unuse",
-               req->conf->appid);
+               req->appid);
 
     czone = &inputsw[req->zoneidx];
 
     if (req->reqtype == ICO_APC_REQTYPE_REQUEST)   {
         if (ico_apf_resource_send_to_client(
-                        req->conf->appid,
+                        req->appid,
                         active ? ICO_APF_RESOURCE_STATE_ACQUIRED :
                                  ICO_APF_RESOURCE_STATE_DEPRIVED,
                         req->resid, req->device, req->id) != ICO_APF_RESOURCE_E_NONE) {
-            apfw_warn("change_inputrequest: send(%s) Error", req->conf->appid);
+            apfw_warn("change_inputrequest: send(%s) Error", req->appid);
         }
         else    {
             req->state |= (active ? ICO_APC_REQSTATE_REPLYACTIVE :
@@ -1739,12 +1766,12 @@ change_inputrequest(ico_apc_request_t *req, const int active)
             timer_count ++;
         }
     }
-    if (ico_uxf_input_control(active, req->conf->appid, czone->inputdev->device,
+    if (ico_uxf_input_control(active, req->appid, czone->inputdev->device,
                               czone->inputsw->input) != ICO_UXF_EOK)    {
         apfw_warn("app_getinput: send MIM Error");
     }
     if (inputcontrol) {
-        (*inputcontrol)(req->conf, active);
+        (*inputcontrol)(get_appconf(req->appid), active);
     }
     if (active)   {
         req->state &= ~ICO_APC_REQSTATE_WAITREQ;
@@ -1780,7 +1807,7 @@ recalc_inputsw(const int idx)
     }
     if ((p->state & ICO_APC_REQSTATE_WAITREQ) == 0)   {
         /* not wait request                 */
-        apfw_trace("recalc_inputsw: Leave(%s no need input control)", p->conf->appid);
+        apfw_trace("recalc_inputsw: Leave(%s no need input control)", p->appid);
         return;
     }
 
@@ -1788,7 +1815,7 @@ recalc_inputsw(const int idx)
     p->state &= ~ICO_APC_REQSTATE_WAITPROC;
     if (p->prio & ICO_UXF_PRIO_REGULATION)  {
         apfw_trace("recalc_inputsw: Start %s(prio=%08x and no regulation)",
-                   p->conf->appid, p->prio);
+                   p->appid, p->prio);
         change_inputrequest(p, 1);
     }
 
@@ -1824,6 +1851,8 @@ regulation_listener(const int appcategory,
     sound = 0;
     input = 0;
 
+    confapp = (Ico_Uxf_App_Config *)ico_uxf_getAppConfig();
+
     if (control.display != ICO_SYC_APC_REGULATION_NOCHANGE) {
         /* display regulation control       */
         apfw_trace("regulation_listener: disp category=%d display=%d",
@@ -1835,13 +1864,13 @@ regulation_listener(const int appcategory,
                 if (!p) continue;
                 bp = NULL;
                 while (p)   {
-                    if (p->conf == &confapp->application[i])    {
+                    if (strcmp(p->appid, confapp->application[i].appid) == 0)    {
                         flag = 0;
                         if (control.display == ICO_SYC_APC_REGULATION_REGULATION)   {
                             if (p->prio & ICO_UXF_PRIO_REGULATION)  {
                                 p->prio &= ~ICO_UXF_PRIO_REGULATION;
                                 flag ++;
-                                ico_uxf_window_control(p->conf->appid, p->id,
+                                ico_uxf_window_control(p->appid, p->id,
                                                        ICO_UXF_APPSCTL_REGULATION, 1);
                             }
                         }
@@ -1849,7 +1878,7 @@ regulation_listener(const int appcategory,
                             if ((p->prio & ICO_UXF_PRIO_REGULATION) == 0)   {
                                 p->prio |= ICO_UXF_PRIO_REGULATION;
                                 flag ++;
-                                ico_uxf_window_control(p->conf->appid, p->id,
+                                ico_uxf_window_control(p->appid, p->id,
                                                        ICO_UXF_APPSCTL_REGULATION, 0);
                             }
                         }
@@ -1861,7 +1890,7 @@ regulation_listener(const int appcategory,
                                 reqdisp[disp++] = dispzone[k].conf->display->id;
                             }
                             apfw_trace("regulation_listener: disp %s %08x",
-                                       p->conf->appid, p->prio);
+                                       p->appid, p->prio);
                             if (bp) {
                                 bp->next = p->next;
                             }
@@ -1915,7 +1944,7 @@ regulation_listener(const int appcategory,
         }
     }
 
-    if (control.sound != ICO_SYC_APC_REGULATION_NOCHANGE)   {
+    if (control.sound != ICO_SYC_APC_REGULATION_NOCHANGE) {
         /* sound regulation control         */
         apfw_trace("regulation_listener: sound category=%d sound=%d",
                    appcategory, control.sound);
@@ -1926,7 +1955,7 @@ regulation_listener(const int appcategory,
                 if (!p) continue;
                 bp = NULL;
                 while (p)   {
-                    if (p->conf == &confapp->application[i])    {
+                    if (strcmp(p->appid, confapp->application[i].appid) == 0)    {
                         flag = 0;
                         if (control.sound == ICO_SYC_APC_REGULATION_REGULATION) {
                             if (p->prio & ICO_UXF_PRIO_REGULATION)  {
@@ -1946,7 +1975,7 @@ regulation_listener(const int appcategory,
                         if (flag)   {
                             apfw_trace("regulation_listener: sound change category=%d "
                                        "app(%s) sound=%d prio=%08x",
-                                       appcategory, p->conf->appid, control.sound, p->prio);
+                                       appcategory, p->appid, control.sound, p->prio);
                             for (j = 0; j < sound; j++)  {
                                 if (soundzone[k].conf->sound->id == reqsound[j])    break;
                             }
@@ -1954,7 +1983,7 @@ regulation_listener(const int appcategory,
                                 reqsound[sound++] = soundzone[k].conf->sound->id;
                             }
                             apfw_trace("regulation_listener: sound %s %08x %08x",
-                                       p->conf->appid, p->prio, (int)bp);
+                                       p->appid, p->prio, (int)bp);
                             if (bp) {
                                 bp->next = p->next;
                             }
@@ -2019,7 +2048,7 @@ regulation_listener(const int appcategory,
                 if (!p) continue;
                 bp = NULL;
                 while (p)   {
-                    if (p->conf == &confapp->application[i])    {
+                    if (strcmp(p->appid, confapp->application[i].appid) == 0)    {
                         flag = 0;
                         if (control.input == ICO_SYC_APC_REGULATION_REGULATION) {
                             if (p->prio & ICO_UXF_PRIO_REGULATION)  {
@@ -2039,7 +2068,7 @@ regulation_listener(const int appcategory,
                         if (flag)   {
                             apfw_trace("regulation_listener: input change category=%d "
                                        "app(%s) input=%d prio=%08x",
-                                       appcategory, p->conf->appid, control.input, p->prio);
+                                       appcategory, p->appid, control.input, p->prio);
                             for (j = 0; j < sound; j++)  {
                                 if (inputsw[k].inputsw->input == reqinput[j])    break;
                             }
@@ -2047,7 +2076,7 @@ regulation_listener(const int appcategory,
                                 reqinput[input++] = inputsw[k].inputsw->input;
                             }
                             apfw_trace("regulation_listener: input %s %08x %08x",
-                                       p->conf->appid, p->prio, (int)bp);
+                                       p->appid, p->prio, (int)bp);
                             if (bp) {
                                 bp->next = p->next;
                             }
@@ -2137,13 +2166,13 @@ request_timer(void *user_data)
                 p->timer --;
                 if (p->timer == 0)  {
                     apfw_trace("request_timer: display timedout(%s %d %d prio=%08x)",
-                               p->conf->appid, p->resid, p->id, p->prio);
+                               p->appid, p->resid, p->id, p->prio);
                     if ((p->state & ICO_APC_REQSTATE_REPLYACTIVE) &&
                         ((p->state & ICO_APC_REQSTATE_WAITREQ) == 0))  {
-                        ico_uxf_window_control(p->conf->appid, p->id,
+                        ico_uxf_window_control(p->appid, p->id,
                                                ICO_UXF_APPSCTL_INVISIBLE, 0);
                         if (displaycontrol) {
-                            (*displaycontrol)(p->conf, 1);
+                            (*displaycontrol)(get_appconf(p->appid), 1);
                         }
                     }
                     p->state &= ~(ICO_APC_REQSTATE_REPLYACTIVE|ICO_APC_REQSTATE_REPLYQUIET);
@@ -2164,7 +2193,7 @@ request_timer(void *user_data)
                 p->timer --;
                 if (p->timer == 0)  {
                     apfw_trace("request_timer: sound timedout(%s %d %d prio=%08x)",
-                               p->conf->appid, p->resid, p->id, p->prio);
+                               p->appid, p->resid, p->id, p->prio);
                     if ((p->state & ICO_APC_REQSTATE_REPLYACTIVE) &&
                         ((p->state & ICO_APC_REQSTATE_WAITREQ) == 0))  {
                         if (ico_apf_resource_send_to_soundctl(ICO_APF_SOUND_COMMAND_MUTEOFF,
@@ -2173,7 +2202,7 @@ request_timer(void *user_data)
                             apfw_warn("request_timer: send MSM Error");
                         }
                         if (soundcontrol) {
-                            (*soundcontrol)(p->conf, 1);
+                            (*soundcontrol)(get_appconf(p->appid), 1);
                         }
                     }
                     p->state &= ~(ICO_APC_REQSTATE_REPLYACTIVE|ICO_APC_REQSTATE_REPLYQUIET);
@@ -2203,6 +2232,7 @@ ico_syc_apc_active(const char *appid)
     int     disp, sound, input;
     int     flag;
     Ico_Uxf_conf_application    *appconf;
+    char    *child_appid;
     ico_apc_request_t   *p;
     ico_apc_request_t   *bp;
     ico_apc_request_t   *p2;
@@ -2225,6 +2255,18 @@ ico_syc_apc_active(const char *appid)
         appconf = NULL;
     }
 
+    if (appconf)    {
+        /* save child process if exist          */
+        child_appid = ico_uxf_getchild_appid(appconf->appid);
+        /* set last active process for child process    */
+        ico_uxf_set_lastapp(appconf->appid);
+    }
+    else    {
+        /* reset last active process for child process  */
+        ico_uxf_set_lastapp(NULL);
+        child_appid = NULL;
+    }
+
     /* change all screen request from this application  */
     disp = 0;
     for (i = 0; i < ndispzone; i++) {
@@ -2232,13 +2274,13 @@ ico_syc_apc_active(const char *appid)
         flag = 0;
         bp = NULL;
         while (p)   {
-            if (p->conf == appconf) {
+            if (appconf && (strcmp(p->appid, appconf->appid) == 0)) {
                 apfw_trace("ico_syc_apc_active: disp %s prio=%08x is %s",
-                           p->conf->appid, p->prio, bp ? "not top" : "top");
+                           p->appid, p->prio, bp ? "not top" : "top");
                 if ((p->prio & ICO_UXF_PRIO_ACTIVEAPP) != ICO_UXF_PRIO_ACTIVEAPP)   {
                     p->prio |= ICO_UXF_PRIO_ACTIVEAPP;
                     apfw_trace("ico_syc_apc_active: cgange active %s prio to %08x",
-                               p->conf->appid, p->prio);
+                               p->appid, p->prio);
                     flag ++;
 
                     if (bp) {
@@ -2250,12 +2292,12 @@ ico_syc_apc_active(const char *appid)
                                 p->next = p2;
                                 if (bp2) {
                                     apfw_trace("ico_syc_apc_active: %s is not top=%s(%08x)",
-                                               p->conf->appid, dispzone[i].req->conf->appid,
+                                               p->appid, dispzone[i].req->appid,
                                                dispzone[i].req->prio);
                                     bp2->next = p;
                                 }
                                 else    {
-                                    if ((p2->conf != appconf) &&
+                                    if (appconf && (strcmp(p2->appid, appconf->appid) != 0) &&
                                         ((p2->state & ICO_APC_REQSTATE_WAITREQ) == 0))  {
                                         change_disprequest(p2, 0);
                                     }
@@ -2268,7 +2310,7 @@ ico_syc_apc_active(const char *appid)
                         }
                         if (! p2)   {
                             apfw_trace("ico_syc_apc_active: %s is not top=%s(%08x)",
-                                       p->conf->appid, dispzone[i].req->conf->appid,
+                                       p->appid, dispzone[i].req->appid,
                                        dispzone[i].req->prio);
                             if (bp2)    {
                                 bp2->next = p;
@@ -2280,7 +2322,7 @@ ico_syc_apc_active(const char *appid)
                         }
                     }
                     else    {
-                        apfw_trace("ico_syc_apc_active: app %s is top", p->conf->appid);
+                        apfw_trace("ico_syc_apc_active: app %s is top", p->appid);
                     }
                 }
             }
@@ -2312,13 +2354,13 @@ ico_syc_apc_active(const char *appid)
         flag = 0;
         bp = NULL;
         while (p)   {
-            if (p->conf == appconf) {
+            if (appconf && (strcmp(p->appid, appconf->appid) == 0)) {
                 apfw_trace("ico_syc_apc_active: sound %s prio=%08x is %s",
-                           p->conf->appid, p->prio, bp ? "not top" : "top");
+                           p->appid, p->prio, bp ? "not top" : "top");
                 if ((p->prio & ICO_UXF_PRIO_ACTIVEAPP) != ICO_UXF_PRIO_ACTIVEAPP)   {
                     p->prio |= ICO_UXF_PRIO_ACTIVEAPP;
                     apfw_trace("ico_syc_apc_active: cgange active %s prio to %08x",
-                               p->conf->appid, p->prio);
+                               p->appid, p->prio);
                     flag ++;
 
                     if (bp) {
@@ -2330,12 +2372,12 @@ ico_syc_apc_active(const char *appid)
                                 p->next = p2;
                                 if (bp2) {
                                     apfw_trace("ico_syc_apc_active: %s is not top=%s(%08x)",
-                                               p->conf->appid, soundzone[i].req->conf->appid,
+                                               p->appid, soundzone[i].req->appid,
                                                soundzone[i].req->prio);
                                     bp2->next = p;
                                 }
                                 else    {
-                                    if ((p2->conf != appconf) &&
+                                    if (appconf && (strcmp(p2->appid, appconf->appid) != 0) &&
                                         ((p2->state & ICO_APC_REQSTATE_WAITREQ) == 0))  {
                                         change_soundrequest(p2, 0);
                                     }
@@ -2348,7 +2390,7 @@ ico_syc_apc_active(const char *appid)
                         }
                         if (! p2)   {
                             apfw_trace("ico_syc_apc_active: %s is not top=%s(%08x)",
-                                       p->conf->appid, soundzone[i].req->conf->appid,
+                                       p->appid, soundzone[i].req->appid,
                                        soundzone[i].req->prio);
                             if (bp2)    {
                                 bp2->next = p;
@@ -2360,7 +2402,7 @@ ico_syc_apc_active(const char *appid)
                         }
                     }
                     else    {
-                        apfw_trace("ico_syc_apc_active: app %s is top", p->conf->appid);
+                        apfw_trace("ico_syc_apc_active: app %s is top", p->appid);
                     }
                 }
             }
@@ -2392,11 +2434,11 @@ ico_syc_apc_active(const char *appid)
         flag = 0;
         bp = NULL;
         while (p)   {
-            if (p->conf == appconf) {
+            if (appconf && (strcmp(p->appid, appconf->appid) == 0)) {
                 if ((p->prio & ICO_UXF_PRIO_ACTIVEAPP) != ICO_UXF_PRIO_ACTIVEAPP)   {
                     p->prio |= ICO_UXF_PRIO_ACTIVEAPP;
                     apfw_trace("ico_syc_apc_active: cgange active %s prio to %08x",
-                               p->conf->appid, p->prio);
+                               p->appid, p->prio);
                     flag ++;
 
                     if (bp) {
@@ -2408,12 +2450,12 @@ ico_syc_apc_active(const char *appid)
                                 p->next = p2;
                                 if (bp2) {
                                     apfw_trace("ico_syc_apc_active: %s is not top=%s(%08x)",
-                                               p->conf->appid, inputsw[i].req->conf->appid,
+                                               p->appid, inputsw[i].req->appid,
                                                inputsw[i].req->prio);
                                     bp2->next = p;
                                 }
                                 else    {
-                                    if ((p2->conf != appconf) &&
+                                    if (appconf && (strcmp(p2->appid, appconf->appid) != 0) &&
                                         ((p2->state & ICO_APC_REQSTATE_WAITREQ) == 0))  {
                                         change_inputrequest(p2, 0);
                                     }
@@ -2426,7 +2468,7 @@ ico_syc_apc_active(const char *appid)
                         }
                         if (! p2)   {
                             apfw_trace("ico_syc_apc_active: %s is not top=%s(%08x)",
-                                       p->conf->appid, inputsw[i].req->conf->appid,
+                                       p->appid, inputsw[i].req->appid,
                                        inputsw[i].req->prio);
                             if (bp2)    {
                                 bp2->next = p;
@@ -2438,7 +2480,7 @@ ico_syc_apc_active(const char *appid)
                         }
                     }
                     else    {
-                        apfw_trace("ico_syc_apc_active: app %s is top", p->conf->appid);
+                        apfw_trace("ico_syc_apc_active: app %s is top", p->appid);
                     }
                 }
             }
@@ -2473,6 +2515,10 @@ ico_syc_apc_active(const char *appid)
     for (i = 0; i < input; i++) {
         recalc_inputsw(reqinput[i]);
     }
+    if (child_appid)    {
+        apfw_trace("ico_syc_apc_active: active child app(%s)", child_appid);
+        ico_syc_apc_active(child_appid);
+    }
     apfw_trace("ico_syc_apc_active: Leave");
 }
 
@@ -2495,7 +2541,7 @@ app_display_hook(const char *appid, const int surface, const int object)
     Ico_Uxf_conf_application    *appconf;
     ico_apc_request_t           *req;
 
-    apfw_trace("app_display_hook: Enter(%s,%x,%x)", appid, surface, object);
+    apfw_trace("app_display_hook: Enter(%s,%08x,%x)", appid, surface, object);
 
     appconf = (Ico_Uxf_conf_application *)ico_uxf_getAppByAppid(appid);
     if (! appconf)  {
@@ -2516,7 +2562,7 @@ app_display_hook(const char *appid, const int surface, const int object)
         for (i = 0; i < ndispzone; i++) {
             req = dispzone[i].req;
             while (req)   {
-                if ((req->conf == appconf) &&
+                if ((strcmp(req->appid, appconf->appid) == 0) &&
                     (req->resid == ICO_APF_RESID_BASIC_SCREEN)) break;
                 req = req->next;
             }
@@ -2526,16 +2572,18 @@ app_display_hook(const char *appid, const int surface, const int object)
             apfw_trace("app_display_hook: app(%s) requested display, Nop", appid);
         }
         else    {
-            apfw_trace("app_display_hook: app(%s) not requested display, set default",
-                       appid);
+            apfw_trace("app_display_hook: app(%s) not requested display, set default[%s]",
+                       appid,
+                       confsys->display[appconf->display[0].displayId].
+                           zone[appconf->display[0].zoneId].name);
             req = get_freereq();
             if (req)    {
-                req->conf = appconf;
+                strncpy(req->appid, appconf->appid, ICO_UXF_MAX_PROCESS_NAME);
                 req->resid = ICO_APF_RESID_BASIC_SCREEN;
                 req->reqtype = ICO_APC_REQTYPE_CREATE;
                 strcpy(req->device,
-                       confsys->display[confsys->misc.default_displayId].
-                           zone[confsys->misc.default_dispzoneId].name);
+                       confsys->display[appconf->display[0].displayId].
+                           zone[appconf->display[0].zoneId].name);
                 app_getdisplay(req, 0);
             }
         }
@@ -2546,7 +2594,7 @@ app_display_hook(const char *appid, const int surface, const int object)
         for (i = 0; i < ndispzone; i++) {
             req = dispzone[i].req;
             while (req)   {
-                if (req->conf == appconf) {
+                if (strcmp(req->appid, appconf->appid) == 0) {
                     reqsave[count++] = req;
                 }
                 req = req->next;
@@ -2652,7 +2700,7 @@ ico_syc_apc_init(ico_apc_resource_control_t display, ico_apc_resource_control_t
         apfw_error("ico_syc_apc_init: Leave(No Memory)");
         return ICO_SYC_ENOMEM;
     }
-    memset(soundzone, 0, sizeof(ico_apc_dispzone_t) * nsoundzone);
+    memset(soundzone, 0, sizeof(ico_apc_soundzone_t) * nsoundzone);
     count = 0;
     for (i = 0; i < confsys->soundNum; i++) {
         base_count = count;
@@ -2705,16 +2753,16 @@ ico_syc_apc_init(ico_apc_resource_control_t display, ico_apc_resource_control_t
     }
 
     /* initialize request table                     */
-    ico_apc_request_t *req = malloc(sizeof(ico_apc_request_t) * 50);
+    ico_apc_request_t *req = malloc(sizeof(ico_apc_request_t) * INIT_REQCB);
     ico_apc_request_t *breq;
     if (! req)  {
         ico_apps_controller_init = 0;
         apfw_error("ico_syc_apc_init: Leave(No Memory)");
         return ICO_SYC_ENOMEM;
     }
-    memset(req, 0, sizeof(ico_apc_request_t) * 50);
+    memset(req, 0, sizeof(ico_apc_request_t) * INIT_REQCB);
     free_request = req;
-    for (count = 1; count < 50; count++)    {
+    for (count = 1; count < INIT_REQCB; count++)    {
         breq = req;
         req ++;
         breq->next = req;
index d3eb1d7..390bb6b 100644 (file)
@@ -35,7 +35,8 @@ extern "C" {
 /* request information                          */
 typedef struct  _ico_apc_request    {
     struct _ico_apc_request     *next;          /* requestt list link               */
-    Ico_Uxf_conf_application    *conf;          /* application configuration        */
+    char                        appid[ICO_UXF_MAX_PROCESS_NAME+1];
+                                                /* application id                   */
     ico_apf_resid_e             resid;          /* resource id                      */
     char                        device[ICO_UXF_MAX_DEVICE_NAME+1];
                                                 /* request device                   */
index 2b058c8..3a11a4a 100644 (file)
@@ -28,6 +28,7 @@
 #include    <dbus/dbus.h>
 #include    <Ecore.h>
 #include    "ico_apf.h"
+#include    "ico_uxf.h"
 #include    "ico_syc_apc.h"
 #include    "ico_syc_apc_private.h"
 
@@ -35,8 +36,9 @@
 /* static tables                                                                */
 /*==============================================================================*/
 /* callback function            */
-static ico_apc_regulation_cb_t  regulation_cb = NULL;
-static void                     *regulation_cb_user_data = NULL;
+static int  nregulation_cb = 0;
+static ico_apc_regulation_cb_t  regulation_cb[ICO_SYC_APC_REGULATION_LISTENERS];
+static void                     *regulation_cb_user_data[ICO_SYC_APC_REGULATION_LISTENERS];
 
 /* Ecore/D-Bus static valiables */
 static Ecore_Timer *vehicle_timer = NULL;
@@ -54,8 +56,15 @@ static const struct _vehicle_info_property {
       "/org/automotive/runningstatus/vehicleSpeed", "org.automotive.vehicleSpeed" },
     { ICO_SYC_VEHICLEINFO_SHIFT_POSITION, "ShiftPosition",
       "/org/automotive/runningstatus/transmission", "org.automotive.transmission" },
+#if 0   /* use LightStatus, because AMB not support access of TurnSignal by D-Bus   */
     { ICO_SYC_VEHICLEINFO_TURN_SIGNAL, "TurnSignal",
       "/org/automotive/runningstatus/turnSignal", "org.automotive.turnSignal" },
+#else   /* use LightStatus, because AMB not support access of TurnSignal by D-Bus   */
+    { ICO_SYC_VEHICLEINFO_LIGHT_LEFT, "LeftTurn",
+      "/org/automotive/runningstatus/lightStatus", "org.automotive.lightStatus" },
+    { ICO_SYC_VEHICLEINFO_LIGHT_RIGHT, "RightTurn",
+      "/org/automotive/runningstatus/lightStatus", "org.automotive.lightStatus" },
+#endif  /* use LightStatus, because AMB not support access of TurnSignal by D-Bus   */
     { 0, "\0", "\0", "\0" }
 };
 
@@ -103,8 +112,6 @@ request_vehicle_info(void)
         vehicle_data[idx].key = vehicle_info[idx].key;
 
         if (vehicle_data[idx].pending)  {
-            apfw_trace("request_vehicle_info: (%s) not complite",
-                       vehicle_info[idx].property);
             continue;
         }
 
@@ -193,8 +200,6 @@ get_vehicle_info(void)
             continue;
         }
         if (! dbus_pending_call_get_completed(vehicle_data[idx].pending))   {
-            apfw_trace("get_vehicle_info: (%s) NOT complite",
-                       vehicle_info[idx].property);
             continue;
         }
 
@@ -254,6 +259,11 @@ get_vehicle_info(void)
                       vehicle_info[idx].property, ((int)type) & 0x0ff);
             break;
         }
+#if 0   /* too many logout, change to comment   */
+        apfw_trace("get_vehicle_info: %s = %d",
+                   vehicle_info[idx].property, (int)vehicle_data[idx].val);
+#endif  /* too many logout, change to comment   */
+
         /* free message and pending     */
         dbus_message_unref(dbus_message);
         dbus_pending_call_unref(vehicle_data[idx].pending);
@@ -274,11 +284,15 @@ static Eina_Bool
 rule_engine_wake(void *user_data)
 {
     int     idx;
+    int     i;
     ico_apc_reguration_control_t    wkcontrol[ICO_UXF_CATEGORY_MAX];
     ico_apc_reguration_control_t    change;
     double  VehicleSpeed = 0.0;
-    int     ShiftPosition = 0;
-    int     Blinker = 0;
+    int     ShiftPosition = ICO_SYC_APC_REGULATION_SHIFT_NEUTRALS;
+    int     Blinker = ICO_SYC_APC_REGULATION_BLINKER_NONE;
+
+    /* call UX-FW timer     */
+    ico_uxf_timer_wake(100);
 
     memset(wkcontrol, 0, sizeof(ico_apc_reguration_control_t) * ncategory);
 
@@ -293,9 +307,32 @@ rule_engine_wake(void *user_data)
         else if (vehicle_data[idx].key == ICO_SYC_VEHICLEINFO_SHIFT_POSITION) {
             ShiftPosition = (int)vehicle_data[idx].val;
         }
+#if 0   /* use LightStatus, because AMB not support access of TurnSignal by D-Bus   */
         else if (vehicle_data[idx].key == ICO_SYC_VEHICLEINFO_TURN_SIGNAL) {
             Blinker = (int)vehicle_data[idx].val;
         }
+#else   /* use LightStatus, because AMB not support access of TurnSignal by D-Bus   */
+        else if (vehicle_data[idx].key == ICO_SYC_VEHICLEINFO_LIGHT_LEFT) {
+            if (vehicle_data[idx].val == 0.0)   {
+                if (Blinker == ICO_SYC_APC_REGULATION_BLINKER_LEFT) {
+                    Blinker = ICO_SYC_APC_REGULATION_BLINKER_NONE;
+                }
+            }
+            else    {
+                Blinker = ICO_SYC_APC_REGULATION_BLINKER_LEFT;
+            }
+        }
+        else if (vehicle_data[idx].key == ICO_SYC_VEHICLEINFO_LIGHT_RIGHT) {
+            if (vehicle_data[idx].val == 0.0)   {
+                if (Blinker == ICO_SYC_APC_REGULATION_BLINKER_RIGHT)    {
+                    Blinker = ICO_SYC_APC_REGULATION_BLINKER_NONE;
+                }
+            }
+            else    {
+                Blinker = ICO_SYC_APC_REGULATION_BLINKER_RIGHT;
+            }
+        }
+#endif  /* use LightStatus, because AMB not support access of TurnSignal by D-Bus   */
     }
 
     /* Make control code            */
@@ -334,7 +371,6 @@ rule_engine_wake(void *user_data)
             break;
         case ICO_UXF_POLICY_BLINKER_LEFT:
             if ((Blinker != ICO_SYC_APC_REGULATION_BLINKER_LEFT) ||
-                (ShiftPosition == ICO_SYC_APC_REGULATION_SHIFT_PARKING) ||
                 (ShiftPosition == ICO_SYC_APC_REGULATION_SHIFT_REVERSES))
                 wkcontrol[idx].display = ICO_SYC_APC_REGULATION_REGULATION;
             else
@@ -342,7 +378,6 @@ rule_engine_wake(void *user_data)
             break;
         case ICO_UXF_POLICY_BLINKER_RIGHT:
             if ((Blinker != ICO_SYC_APC_REGULATION_BLINKER_RIGHT) ||
-                (ShiftPosition == ICO_SYC_APC_REGULATION_SHIFT_PARKING) ||
                 (ShiftPosition == ICO_SYC_APC_REGULATION_SHIFT_REVERSES))
                 wkcontrol[idx].display = ICO_SYC_APC_REGULATION_REGULATION;
             else
@@ -384,7 +419,6 @@ rule_engine_wake(void *user_data)
             break;
         case ICO_UXF_POLICY_BLINKER_LEFT:
             if ((Blinker != ICO_SYC_APC_REGULATION_BLINKER_LEFT) ||
-                (ShiftPosition == ICO_SYC_APC_REGULATION_SHIFT_PARKING) ||
                 (ShiftPosition == ICO_SYC_APC_REGULATION_SHIFT_REVERSES))
                 wkcontrol[idx].sound = ICO_SYC_APC_REGULATION_REGULATION;
             else
@@ -392,7 +426,6 @@ rule_engine_wake(void *user_data)
             break;
         case ICO_UXF_POLICY_BLINKER_RIGHT:
             if ((Blinker != ICO_SYC_APC_REGULATION_BLINKER_RIGHT) ||
-                (ShiftPosition == ICO_SYC_APC_REGULATION_SHIFT_PARKING) ||
                 (ShiftPosition == ICO_SYC_APC_REGULATION_SHIFT_REVERSES))
                 wkcontrol[idx].sound = ICO_SYC_APC_REGULATION_REGULATION;
             else
@@ -434,7 +467,6 @@ rule_engine_wake(void *user_data)
             break;
         case ICO_UXF_POLICY_BLINKER_LEFT:
             if ((Blinker != ICO_SYC_APC_REGULATION_BLINKER_LEFT) ||
-                (ShiftPosition == ICO_SYC_APC_REGULATION_SHIFT_PARKING) ||
                 (ShiftPosition == ICO_SYC_APC_REGULATION_SHIFT_REVERSES))
                 wkcontrol[idx].input = ICO_SYC_APC_REGULATION_REGULATION;
             else
@@ -442,7 +474,6 @@ rule_engine_wake(void *user_data)
             break;
         case ICO_UXF_POLICY_BLINKER_RIGHT:
             if ((Blinker != ICO_SYC_APC_REGULATION_BLINKER_RIGHT) ||
-                (ShiftPosition == ICO_SYC_APC_REGULATION_SHIFT_PARKING) ||
                 (ShiftPosition == ICO_SYC_APC_REGULATION_SHIFT_REVERSES))
                 wkcontrol[idx].input = ICO_SYC_APC_REGULATION_REGULATION;
             else
@@ -464,7 +495,7 @@ rule_engine_wake(void *user_data)
                        control[idx].sound, wkcontrol[idx].sound,
                        control[idx].input, wkcontrol[idx].input);
 
-            if (regulation_cb)  {
+            if (nregulation_cb > 0)  {
                 if (control[idx].display != wkcontrol[idx].display)
                     change.display = wkcontrol[idx].display;
                 else
@@ -478,7 +509,9 @@ rule_engine_wake(void *user_data)
                 else
                     change.input = ICO_SYC_APC_REGULATION_NOCHANGE;
 
-                (*regulation_cb)(idx, change, regulation_cb_user_data);
+                for (i = 0; i < nregulation_cb; i++)    {
+                    (*regulation_cb[i])(idx, change, regulation_cb_user_data[i]);
+                }
             }
             control[idx].display = wkcontrol[idx].display;
             control[idx].sound = wkcontrol[idx].sound;
@@ -589,13 +622,27 @@ ico_syc_apc_regulation_listener(ico_apc_regulation_cb_t func, void *user_data)
 {
     int     idx;
 
-    regulation_cb = func;
-    regulation_cb_user_data = user_data;
+    if (func == NULL)   {
+        nregulation_cb = 0;
+        return;
+    }
 
-    if (regulation_cb)  {
-        for (idx = 0; idx < ncategory; idx++) {
-            (*regulation_cb)(idx, control[idx], regulation_cb_user_data);
+    for (idx = 0; idx < nregulation_cb; idx++)  {
+        if (regulation_cb[idx] == func) break;
+    }
+    if (idx >= nregulation_cb)  {
+        if (nregulation_cb >= ICO_SYC_APC_REGULATION_LISTENERS) {
+            apfw_error("ico_syc_apc_regulation_listener: Too many listeners");
+            return;
         }
+        idx = nregulation_cb;
+        nregulation_cb ++;
+    }
+    regulation_cb[idx] = func;
+    regulation_cb_user_data[idx] = user_data;
+
+    for (idx = 0; idx < ncategory; idx++) {
+        (*func)(idx, control[idx], user_data);
     }
 }
 
index 4faae62..f8d94ba 100644 (file)
@@ -48,6 +48,12 @@ AUL_LIBS="$AUL_LIBS $AIL_LIBS $BUNDLE_LIBS"
 AC_SUBST(AUL_CFLAGS)
 AC_SUBST(AUL_LIBS)
 
+PKG_CHECK_MODULES([SLPPKGMGR], [pkgmgr])
+SLPPKGMGR_CFLAGS="$SLPPKGMGR_CFLAGS"
+SLPPKGMGR_LIBS="$SLPPKGMGR_LIBS"
+AC_SUBST(SLPPKGMGR_CFLAGS)
+AC_SUBST(SLPPKGMGR_LIBS)
+
 PKG_CHECK_MODULES([WAYLANDCLIENT], [wayland-client])
 PKG_CHECK_MODULES([WAYLANDCURSOR], [wayland-cursor])
 WL_CFLAGS="$WAYLANDCLIENT_CFLAGS $WAYLANDCURSOR_CFLAGS"
index f1aa819..9334c3b 100644 (file)
@@ -7,8 +7,9 @@ lib_LTLIBRARIES = libico-app-fw.la      \
 #      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) @GLIB_CFLAGS@
-libico_app_fw_la_LDFLAGS = -version-info 0:5:0
+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 = $(WL_LIBS) $(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                      \
@@ -22,17 +23,19 @@ libico_app_fw_la_SOURCES =          \
        ico_apf_resource_control.c      \
        ico_apf_appmgr.c
 
-libico_app_fw_efl_la_CFLAGS = -I../include $(EFL_CFLAGS) @GLIB_CFLAGS@
+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 = $(WL_LIBS) $(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_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
+AM_LDFLAGS = -module -avoid-version -rpath $(libdir) -lwayland-egl -lEGL -lGLESv2 
 
 .FORCE :
 
diff --git a/ico-app-framework/Makefile.am.bk b/ico-app-framework/Makefile.am.bk
new file mode 100644 (file)
index 0000000..0fb7db8
--- /dev/null
@@ -0,0 +1,41 @@
+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 :
+
index e35d776..310ad7b 100644 (file)
 #include <errno.h>
 #include <ail.h>
 
+#include <package-manager.h>
+
 #include "ico_apf_log.h"
 #include "ico_apf_apimacro.h"
 #include "ico_uxf_conf_common.h"
 
+/*==============================================================================*/
+/* define                                                                       */
+/*==============================================================================*/
 #define APP_CONF_AIL_NULL_STR   "(null)"
 
+#define APP_CONF_EVENT_OK           (0)
+#define APP_CONF_EVENT_FAIL         (1)
+
+typedef struct _conf_pkgmgr_event conf_pkgmgr_event_t;
+
+struct _conf_pkgmgr_event {
+    conf_pkgmgr_event_t *next;
+    char pkg_name[ICO_UXF_MAX_PROCESS_NAME];
+    int type;
+};
+
+/*==============================================================================*/
+/* define static function prototype                                             */
+/*==============================================================================*/
 static Ico_Uxf_App_Config *readAilApplist(void);
-static void Ico_Uxf_conf_remakeAppHash(void);
+static void ico_uxf_conf_remakeAppHash(void);
+static int ico_uxf_conf_pkgmgrEvent(int req_id, const char *pkg_type,
+                    const char *pkg_name, const char *key, const char *val,
+                    const void *pmsg, void *data);
+static int ico_uxf_conf_addPkgmgrEventListener(void);
+static int ico_uxf_conf_startEvent(const char *pkg_name, int type);
+static int ico_uxf_conf_endEvent(const char *pkg_name, int status);
 
+/*==============================================================================*/
+/* static tables                                                                */
+/*==============================================================================*/
 static Ico_Uxf_App_Config   *_ico_app_config = NULL;
+static Ico_Uxf_App_Config   *_ico_app_config_update = NULL;
 static Ico_Uxf_Sys_Config   *sys_config = NULL;
 static GKeyFile             *sappfile = NULL;
 
+static pkgmgr_client        *conf_pc = NULL;
+static conf_pkgmgr_event_t  *conf_prog_event = NULL;
+static Ico_Uxf_AppUpdata_Cb conf_cb_func = NULL;
 
 /*--------------------------------------------------------------------------*/
 /**
@@ -54,6 +86,7 @@ ico_uxf_getAppConfig(void)
         return _ico_app_config;
     }
     _ico_app_config = g_new0(Ico_Uxf_App_Config,1);
+    _ico_app_config_update = _ico_app_config;
     return readAilApplist();
 }
 
@@ -86,6 +119,8 @@ infoAilpkg(const ail_appinfo_h appinfo, void *data)
     struct stat buff;
     Ico_Uxf_conf_application *apptbl;
 
+    _ico_app_config_update->ailNum++;
+
     /* get package name for appid */
     ail_appinfo_get_str(appinfo, AIL_PROP_PACKAGE_STR, &package);
     if (strcmp(package, APP_CONF_AIL_NULL_STR) == 0) {
@@ -169,7 +204,7 @@ infoAilpkg(const ail_appinfo_h appinfo, void *data)
     }
 
     if ((package != NULL) && (*package != 0))   {
-        apptbl = &_ico_app_config->application[_ico_app_config->applicationNum];
+        apptbl = &_ico_app_config_update->application[_ico_app_config_update->applicationNum];
         apptbl->appid = strdup(package);
         if (icon)   {
             apptbl->icon_key_name = strdup(icon);
@@ -188,6 +223,7 @@ infoAilpkg(const ail_appinfo_h appinfo, void *data)
         apptbl->hostId = sys_config->misc.default_hostId;
         apptbl->kindId = sys_config->misc.default_kindId;
         apptbl->categoryId = sys_config->misc.default_categoryId;
+        apptbl->invisiblecpu = 100;
 
         /* get NoDisplay    */
         if ((icon != NULL) && (*icon != 0)) {
@@ -211,7 +247,7 @@ infoAilpkg(const ail_appinfo_h appinfo, void *data)
             Ico_Uxf_conf_sound      *sound;
             char    work[64];
 
-            apfw_trace("Ail.%d category=%s", _ico_app_config->applicationNum, category);
+            apfw_trace("Ail.%d category=%s", _ico_app_config_update->applicationNum, category);
 
             j = 0;
             for (i = 0;; i++)   {
@@ -557,12 +593,43 @@ infoAilpkg(const ail_appinfo_h appinfo, void *data)
                         apfw_error("infoAilpkg: [%s] unknown input", work);
                     }
 
+                    /* NoDisplay                */
+                    if ((found == 0) && (work[0] != 0)) {
+                        if (strncasecmp(work, "NoDisplay", 9) == 0)  {
+                            apptbl->noicon = 1;
+                            if (work[9] == '=') {
+                                if (strcasecmp(&work[10], "false") == 0)    {
+                                    apptbl->noicon = 0;
+                                }
+                            }
+                            found = 9;
+                        }
+                    }
+
+                    /* cpu % at invisible       */
+                    if ((found == 0) && (work[0] != 0)) {
+                        if (strncasecmp(work, "invisiblecpu", 12) == 0)  {
+                            apptbl->invisiblecpu = 0;
+                            if (work[12] == '=')    {
+                                if (strcasecmp(&work[13], "yes") == 0)  {
+                                    apptbl->invisiblecpu = 100;
+                                }
+                                else if (strcasecmp(&work[13], "no") != 0)  {
+                                    apptbl->invisiblecpu = strtol(&work[13], (char **)0, 0);
+                                    if (apptbl->invisiblecpu > 100)
+                                        apptbl->invisiblecpu = 100;
+                                }
+                            }
+                            found = 9;
+                        }
+                    }
+
                     /* start mode               */
                     if ((found == 0) && (work[0] != 0)) {
-                        if (strcasecmp(work, "auto") == 0)  {
+                        if (strcasecmp(work, "autostart") == 0)  {
                             apptbl->autostart = 1;
                         }
-                        else if (strcasecmp(work, "noauto") == 0)   {
+                        else if (strcasecmp(work, "noautostart") == 0)   {
                             apptbl->autostart = 0;
                         }
                         else    {
@@ -588,20 +655,21 @@ infoAilpkg(const ail_appinfo_h appinfo, void *data)
             apptbl->sound[0].zoneId = sys_config->misc.default_soundzoneId;
         }
         apfw_trace("Ail.%d: appid=%s name=%s exec=%s type=%s",
-                   _ico_app_config->applicationNum, apptbl->appid, apptbl->name,
+                   _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",
-                   _ico_app_config->applicationNum, apptbl->categoryId, apptbl->kindId,
+                   "sound=%d zone=%d auto=%d noicon=%d 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);
-        _ico_app_config->applicationNum++;
+                   apptbl->sound[0].zoneId, apptbl->autostart, apptbl->noicon,
+                   apptbl->invisiblecpu);
+        _ico_app_config_update->applicationNum++;
     }
     else    {
     }
 
-    if (_ico_app_config->applicationNum > num)
+    if (_ico_app_config_update->applicationNum > num)
         return AIL_CB_RET_CANCEL;
 
     return AIL_CB_RET_CONTINUE;
@@ -624,6 +692,8 @@ readAilApplist(void)
     ail_filter_h filter;
     GError  *error = NULL;
 
+    _ico_app_config_update->applicationNum = 0;
+
     /* get system configuration */
     sys_config = (Ico_Uxf_Sys_Config *)ico_uxf_getSysConfig();
     if (! sys_config)   {
@@ -653,43 +723,90 @@ readAilApplist(void)
             g_key_file_free(sappfile);
             sappfile = NULL;
         }
+        apfw_trace("readAilApplist: Leave(Ail:cannot count appinfo) = %d", ret);
         return NULL;
     }
     apfw_trace("readAilApplist: number of off AIL package = %d", num);
 
     ail_filter_new(&filter);
     ail_filter_add_str(filter, AIL_PROP_TYPE_STR, "menu");
-    ail_filter_count_appinfo(filter, &num);
+    ret = ail_filter_count_appinfo(filter, &num);
+    if (ret != AIL_ERROR_OK) {
+        if( sappfile)   {
+            g_key_file_free(sappfile);
+            sappfile = NULL;
+        }
+        apfw_trace("readAilApplist: Leave(Ail:cannot count appinfo(menu)) = %d", ret);
+        return NULL;
+    }
     apfw_trace("readAilApplist: number of menu AIL package = %d", num);
     ail_filter_destroy(filter);
 
     ail_filter_new(&filter);
     ail_filter_add_str(filter, AIL_PROP_TYPE_STR, "Application");
-    ail_filter_count_appinfo(filter, &wnum);
+    ret = ail_filter_count_appinfo(filter, &wnum);
+    if (ret != AIL_ERROR_OK) {
+        if( sappfile)   {
+            g_key_file_free(sappfile);
+            sappfile = NULL;
+        }
+        apfw_trace("readAilApplist: Leave(Ail:cannot count appinfo(Application)) = %d", ret);
+        return NULL;
+    }
     apfw_trace("readAilApplist: number of Application AIL package = %d", wnum);
     ail_filter_destroy(filter);
     num += wnum;
 
-    _ico_app_config->application = g_new0(Ico_Uxf_conf_application, num);
+    _ico_app_config_update->application = g_new0(Ico_Uxf_conf_application, num);
 
     ail_filter_new(&filter);
-    ail_filter_add_str(filter, AIL_PROP_TYPE_STR, "menu");
-    ail_filter_list_appinfo_foreach(filter, infoAilpkg, (void *)num);
+    ret = ail_filter_add_str(filter, AIL_PROP_TYPE_STR, "menu");
+    ret = ail_filter_list_appinfo_foreach(filter, infoAilpkg, (void *)num);
+    if (ret != AIL_ERROR_OK) {
+        if( sappfile)   {
+            g_key_file_free(sappfile);
+            sappfile = NULL;
+        }
+        ail_filter_destroy(filter);
+        apfw_trace("readAilApplist: Leave(Ail:cannot get appinfo(menu)) = %d", ret);
+        return NULL;
+    }
     ail_filter_destroy(filter);
 
     ail_filter_new(&filter);
     ail_filter_add_str(filter, AIL_PROP_TYPE_STR, "Application");
-    ail_filter_list_appinfo_foreach(filter, infoAilpkg, (void *)num);
+    ret = ail_filter_list_appinfo_foreach(filter, infoAilpkg, (void *)num);
+    if (ret != AIL_ERROR_OK) {
+        if( sappfile)   {
+            g_key_file_free(sappfile);
+            sappfile = NULL;
+        }
+        ail_filter_destroy(filter);
+        apfw_trace("readAilApplist: Leave(Ail:cannot get appinfo(Application)) = %d", ret);
+        return NULL;
+    }
     ail_filter_destroy(filter);
 
+    if (_ico_app_config_update->ailNum != num) {
+        if( sappfile)   {
+            g_key_file_free(sappfile);
+            sappfile = NULL;
+        }
+        apfw_trace("readAilApplist: Leave(cannot read ail correctly %d =! %d", 
+                    _ico_app_config_update->ailNum, num);
+        return NULL;
+    }
+
     /* create Hash Table                    */
-    Ico_Uxf_conf_remakeAppHash();
+    ico_uxf_conf_remakeAppHash();
 
     if( sappfile)   {
         g_key_file_free(sappfile);
     }
+    
+    apfw_trace("readAilApplist: Leave");
 
-    return _ico_app_config;
+    return _ico_app_config_update;
 }
 
 /*--------------------------------------------------------------------------*/
@@ -712,47 +829,47 @@ ico_uxf_closeAppConfig(void)
 
 /*--------------------------------------------------------------------------*/
 /**
- * @brief   Ico_Uxf_conf_remakeAppHash: make application hash table(static function)
+ * @brief   ico_uxf_conf_remakeAppHash: make application hash table(static function)
  *
  * @param       none
  * @return      none
  */
 /*--------------------------------------------------------------------------*/
 static void
-Ico_Uxf_conf_remakeAppHash(void)
+ico_uxf_conf_remakeAppHash(void)
 {
     int         i;
     int         hash;
     Ico_Uxf_conf_application    *app;
 
-    memset(_ico_app_config->hashnametable, 0, sizeof(_ico_app_config->hashnametable));
+    memset(_ico_app_config_update->hashnametable, 0, sizeof(_ico_app_config_update->hashnametable));
 
-    for (i = 0; i < _ico_app_config->applicationNum; i++)  {
+    for (i = 0; i < _ico_app_config_update->applicationNum; i++)  {
 
-        _ico_app_config->application[i].nextidhash = NULL;
+        _ico_app_config_update->application[i].nextidhash = NULL;
         hash = ICO_UXF_MISC_HASHBYID(i);
-        app = _ico_app_config->hashidtable[hash];
+        app = _ico_app_config_update->hashidtable[hash];
         if (! app) {
-            _ico_app_config->hashidtable[hash] = &_ico_app_config->application[i];
+            _ico_app_config_update->hashidtable[hash] = &_ico_app_config_update->application[i];
         }
         else    {
             while (app->nextidhash)    {
                 app = app->nextidhash;
             }
-            app->nextidhash = &_ico_app_config->application[i];
+            app->nextidhash = &_ico_app_config_update->application[i];
         }
 
-        _ico_app_config->application[i].nextnamehash = NULL;
-        hash = ICO_UXF_MISC_HASHBYNAME(_ico_app_config->application[i].appid);
-        app = _ico_app_config->hashnametable[hash];
+        _ico_app_config_update->application[i].nextnamehash = NULL;
+        hash = ICO_UXF_MISC_HASHBYNAME(_ico_app_config_update->application[i].appid);
+        app = _ico_app_config_update->hashnametable[hash];
         if (! app) {
-            _ico_app_config->hashnametable[hash] = &_ico_app_config->application[i];
+            _ico_app_config_update->hashnametable[hash] = &_ico_app_config_update->application[i];
         }
         else    {
             while (app->nextnamehash)  {
                 app = app->nextnamehash;
             }
-            app->nextnamehash = &_ico_app_config->application[i];
+            app->nextnamehash = &_ico_app_config_update->application[i];
         }
     }
 }
@@ -858,3 +975,299 @@ ico_uxf_getAppDisplay(const Ico_Uxf_conf_application *app, const int idx,
     return 0;
 }
 
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   ico_uxf_conf_addPkgmgrEventListener:
+ *          request to listen the pkgmgr's broadcasting.
+ *
+ * @param       none
+ * @return      result
+ * @retval      ICO_UXF_EOK     success
+ * @retval      ICO_UXF_ENOSYS  cannot regist listener
+ */
+/*--------------------------------------------------------------------------*/
+static int
+ico_uxf_conf_addPkgmgrEventListener(void)
+{
+    int     ret;
+
+    if (conf_pc) {
+        /* already registied listener */
+        return ICO_UXF_EOK;
+    }
+
+    conf_pc = pkgmgr_client_new(PC_LISTENING);
+    if (conf_pc == NULL) {
+        apfw_trace("ico_uxf_conf_addPkgmgrEventListener: cannot create pkgmgr client");
+        return ICO_UXF_ENOSYS;
+    }
+
+    ret = pkgmgr_client_listen_status(conf_pc, ico_uxf_conf_pkgmgrEvent, NULL);
+    if (ret < 0) {
+        apfw_trace("ico_uxf_conf_addPkgmgrEventListener: "
+                   "cannot register listener of pkgmgr(%d)", ret);
+        pkgmgr_client_free(conf_pc);
+        conf_pc = NULL;
+        return ICO_UXF_ENOSYS;
+    }
+
+    return ICO_UXF_EOK;
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   ico_uxf_conf_pkgmgrEvent:
+ *          This is callback function from pkgmgr.
+ *
+ * @param[in]   req_id          request id
+ * @param[in]   pkg_type        package type
+ * @param[in]   pkg_name        package name
+ * @param[in]   key             broadcast key(=start/end/...)
+ * @param[in]   val             broadcast value(=install/uninstall/ok/fail)
+ * @param[in]   pmsg            broadcast comment
+ * @param[in]   data            user data
+ * @return      always 0
+ */
+/*--------------------------------------------------------------------------*/
+static int
+ico_uxf_conf_pkgmgrEvent(int req_id, const char *pkg_type, const char *pkg_name,
+                    const char *key, const char *val, const void *pmsg, void *data)
+{
+    apfw_trace("ico_uxf_conf_PkgmgrEvent: "
+               "Enter(pkg_type=%s, pkg_name=%s, key=%s, val=%s, pmsg=%s)",
+               pkg_type, pkg_name, key, val, pmsg);
+
+    if (strcasecmp(key, "start") == 0) {
+        if (strcasecmp(val, "install") == 0) {
+            ico_uxf_conf_startEvent(pkg_name, ICO_UXF_CONF_EVENT_INSTALL);
+        }
+        else if (strcasecmp(val, "uninstall") == 0) {
+            ico_uxf_conf_startEvent(pkg_name, ICO_UXF_CONF_EVENT_UNINSTALL);
+        }
+    }
+    else if (strcasecmp(key, "install_percent") == 0) {
+        ico_uxf_conf_startEvent(pkg_name, ICO_UXF_CONF_EVENT_INSTALL);
+    }
+    else if (strcasecmp(key, "progress_percent") == 0) {
+
+    }
+    else if (strcasecmp(key, "error") == 0) {
+    }
+    else if (strcasecmp(key, "end") == 0) {
+        if (strcasecmp(val, "ok") == 0) {
+            ico_uxf_conf_endEvent(pkg_name, APP_CONF_EVENT_OK);
+        }
+        else if (strcasecmp(val, "fail") == 0) {
+            ico_uxf_conf_endEvent(pkg_name, APP_CONF_EVENT_FAIL);
+        }
+    }
+
+    return 0;
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   ico_uxf_conf_startEvent: mark event is start
+ *
+ * @param[in]   pkg_name        package name
+ * @param[in]   type            event type
+ * @return      result
+ * @retval      ICO_UXF_EOK     success
+ * @retval      ICO_UXF_ENOMEM  cannot allocate memory
+ */
+/*--------------------------------------------------------------------------*/
+static int
+ico_uxf_conf_startEvent(const char *pkg_name, int type)
+{
+    conf_pkgmgr_event_t *new = NULL;
+    conf_pkgmgr_event_t *event = NULL;
+
+    /* check the queue whether the package' event is exist */
+    event = conf_prog_event;
+    while (event) {
+        if (strncmp(event->pkg_name, pkg_name, ICO_UXF_MAX_PROCESS_NAME) == 0) {
+            new = event;
+            break;
+        }
+        event = event->next;
+    }
+
+    if (!new) {
+        new = malloc(sizeof(conf_pkgmgr_event_t));
+        if (!new) {
+            apfw_warn("ico_uxf_conf_startEvent: cannot allocate memory");
+            return ICO_UXF_ENOMEM;
+        }
+        memset(new, 0, sizeof(new));
+        /* insert queue */
+        event = conf_prog_event;
+        while (event) {
+            if (!event->next) {
+                break;
+            }
+            event = event->next;
+        }
+        if (!event) {
+            conf_prog_event = new;
+        }
+        else {
+            event->next = new;
+        }
+        strncpy(new->pkg_name, pkg_name, ICO_UXF_MAX_PROCESS_NAME);
+        new->type = type;
+    }
+
+
+
+    return ICO_UXF_EOK;
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   ico_uxf_conf_endEvent: mark event is end
+ *
+ * @param[in]   pkg_name        package name
+ * @param[in]   status          end status
+ * @return      result
+ * @retval      ICO_UXF_EOK     success
+ */
+/*--------------------------------------------------------------------------*/
+static int
+ico_uxf_conf_endEvent(const char *pkg_name, int status)
+{
+    int     type;
+    int     cnt;
+    int     ii, jj;
+    int     exist = 0;
+    conf_pkgmgr_event_t *current = NULL;
+    conf_pkgmgr_event_t *event;
+    conf_pkgmgr_event_t *bevent;
+    static Ico_Uxf_App_Config *config = NULL;
+    static Ico_Uxf_App_Config *tmp = NULL;
+
+    apfw_trace("ico_uxf_conf_endEvent: Enter(pkg=%s, stat=%d)", pkg_name, status);
+    /* get start event from queue */
+    event = conf_prog_event;
+    bevent = NULL;
+    while (event) {
+        if (strncmp(event->pkg_name, pkg_name, ICO_UXF_MAX_PROCESS_NAME) == 0) {
+            current = event;
+            break;
+        }
+        bevent = event;
+        event = event->next;
+    }
+    if (current) {
+        if (!bevent) {
+            /* top */
+            conf_prog_event = current->next;
+            current->next = NULL;
+        }
+        else {
+            bevent->next = current->next;
+            current->next = NULL;
+        }
+    }
+    else {
+        return ICO_UXF_ENOSYS;
+    }
+
+    type = current->type;
+    free(current);
+
+    if (status == APP_CONF_EVENT_OK) {
+        config = g_new0(Ico_Uxf_App_Config, 1);
+        _ico_app_config_update = config;
+        config = readAilApplist();
+        cnt = 0;
+        while (! config) {
+            usleep(10000);
+            apfw_trace("ico_uxf_conf_endEvent: Retry %d", cnt);
+            config = readAilApplist();
+            if (cnt > 500) {
+                break;
+            }
+            else {
+                cnt++;
+            }
+        }
+        if (! config) {
+            apfw_warn("ico_uxf_getAppByAppid: cannot access ail normally");
+            return ICO_UXF_EBUSY;
+        }
+        tmp = config;
+        /* old list */
+        config = _ico_app_config;
+        /* new list */
+        _ico_app_config = tmp;
+
+        if (type == ICO_UXF_CONF_EVENT_INSTALL) {
+            for (ii = 0; ii < _ico_app_config->applicationNum; ii++) {
+                exist = 0;
+                for (jj = 0; jj < config->applicationNum; jj++) {
+                    if (strcmp(_ico_app_config->application[ii].appid,
+                               config->application[jj].appid) == 0) {
+                        exist = 1;
+                        break;
+                    }
+                }
+                if ((exist == 0) && conf_cb_func) {
+                    conf_cb_func(_ico_app_config->application[ii].appid,
+                                 ICO_UXF_CONF_EVENT_INSTALL);
+                }
+            }
+        }
+        else if (type == ICO_UXF_CONF_EVENT_UNINSTALL) {
+            for (jj = 0; jj < config->applicationNum; jj++) {
+                exist = 0;
+                for (ii = 0; ii < _ico_app_config->applicationNum; ii++) {
+                    if (strcmp(config->application[jj].appid,
+                               _ico_app_config->application[ii].appid) == 0) {
+                        exist = 1;
+                        break;
+                    }
+                }
+                if ((exist == 0) && conf_cb_func) {
+                    conf_cb_func(config->application[jj].appid,
+                                 ICO_UXF_CONF_EVENT_UNINSTALL);
+                }
+            }
+        }
+        /* free old list */
+        if (config != NULL) {
+            g_free(config->application);
+            g_free(config);
+        }
+    }
+
+    apfw_trace("ico_uxf_conf_endEvent: Leave");
+
+    return ICO_UXF_EOK;
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   ico_uxf_setAppUpdateCb:
+ *
+ * @param       none
+ * @return      result
+ * @retval      ICO_UXF_EOK     success
+ * @retval      ICO_UXF_ENOSYS  cannot regist callback
+ */
+/*--------------------------------------------------------------------------*/
+ICO_APF_API int
+ico_uxf_conf_setAppUpdateCb(Ico_Uxf_AppUpdata_Cb func)
+{
+    int     ret;
+
+    ret = ico_uxf_conf_addPkgmgrEventListener();
+
+    if (ret != ICO_UXF_EOK) {
+        apfw_trace("ico_uxf_conf_setAppUpdateCb: cannot add listener");
+        return ICO_UXF_ENOSYS;
+    }
+    conf_cb_func = func;
+
+    return ICO_UXF_EOK;
+}
+
diff --git a/ico-app-framework/ico_uxf_conf_ecore.c b/ico-app-framework/ico_uxf_conf_ecore.c
new file mode 100644 (file)
index 0000000..16a9aeb
--- /dev/null
@@ -0,0 +1,168 @@
+/*
+ * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
+ *
+ * This program is licensed under the terms and conditions of the
+ * Apache License, version 2.0.  The full text of the Apache License is at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ */
+/**
+ * @brief   user experiance library(config's callback to Ecore(EFL) application)
+ *
+ * @date    May-17-2013
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <Ecore.h>
+
+#include "ico_apf_log.h"
+#include "ico_apf_apimacro.h"
+#include "ico_uxf_conf_common.h"
+#include "ico_uxf_conf_ecore.h"
+#include "ico_uxf_private.h"
+
+/*==============================================================================*/
+/* define                                                                       */
+/*==============================================================================*/
+typedef struct _econf_pkgmgr_event econf_pkgmgr_event_t;
+typedef struct _econf_cb_func_info econf_cb_func_info_t;
+
+struct _econf_pkgmgr_event {
+    char appid[ICO_UXF_MAX_PROCESS_NAME];
+    int type;
+};
+
+struct _econf_cb_func_info {
+    econf_cb_func_info_t *next;
+    Ico_Uxf_AppUpdata_Cb func;
+};
+/*==============================================================================*/
+/* define static function prototype                                             */
+/*==============================================================================*/
+static void ico_uxf_econf_updateEvent(const char *appid, int type);
+static Eina_Bool ico_uxf_econf_ecoreEvent(void *data, int type, void *event);
+
+/*==============================================================================*/
+/* static tables                                                                */
+/*==============================================================================*/
+static int                  econf_event_type = -1;
+static Ecore_Event_Handler   *econf_handle = NULL;
+
+static econf_cb_func_info_t *econf_cb_func = NULL;
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   ico_uxf_econf_setAppUpdateCb:
+ *
+ * @param       none
+ * @return      result
+ * @retval      ICO_UXF_EOK     success
+ * @retval      ICO_UXF_ENOSYS  cannot regist callback
+ */
+/*--------------------------------------------------------------------------*/
+ICO_APF_API int
+ico_uxf_econf_setAppUpdateCb(Ico_Uxf_AppUpdata_Cb func)
+{
+    econf_cb_func_info_t *func_info;
+
+    if (econf_handle == NULL) {
+        econf_event_type = ecore_event_type_new();
+
+        econf_handle = ecore_event_handler_add(econf_event_type,
+                                ico_uxf_econf_ecoreEvent, NULL);
+        if (econf_handle == NULL) {
+            apfw_warn("ico_uxf_setAppUpdateCb: cannot add ecore event handler");
+            return ICO_UXF_ENOSYS;
+        }
+        ico_uxf_conf_setAppUpdateCb(ico_uxf_econf_updateEvent);
+    }
+    if (func) {
+        func_info = malloc(sizeof(econf_cb_func_info_t));
+        if (! func_info) {
+            apfw_warn("ico_uxf_setAppUpdateCb: cannot allocate memory");
+            return ICO_UXF_ENOSYS;
+        }
+        memset(func_info, 0, sizeof(econf_cb_func_info_t));
+        func_info->func = func;
+        if (! econf_cb_func) {
+            econf_cb_func = func_info;
+        }
+        else {
+            func_info->next = econf_cb_func;
+            econf_cb_func = func_info;
+        }
+    }
+
+    return ICO_UXF_EOK;
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   ico_uxf_econf_updateEvent:
+ *          pass configuration change event to ecore event.
+ *
+ * @param[in]   data            data
+ * @param[in]   type            type
+ * @return      none
+ */
+/*--------------------------------------------------------------------------*/
+static void
+ico_uxf_econf_updateEvent(const char *appid, int type)
+{
+    econf_pkgmgr_event_t *conf_event;
+
+    apfw_trace("ico_uxf_econf_updateEvent: Enter(appid=%s, type=%d)", appid, type);
+
+    conf_event = malloc(sizeof(econf_pkgmgr_event_t));
+    if (!conf_event) {
+        apfw_warn("ico_uxf_econf_updateEvent: cannot allocate memory");
+        return;
+    }
+
+    strncpy(conf_event->appid, appid, ICO_UXF_MAX_PROCESS_NAME);
+    conf_event->type = type;
+
+    ecore_event_add(econf_event_type, conf_event, NULL, NULL);
+
+    apfw_trace("ico_uxf_econf_updateEvent: Leave");
+
+    return;
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   ico_uxf_econf_ecoreEvent:
+ *          callback function from ecore when change app configuration
+ *
+ * @param[in]   data            data
+ * @param[in]   type            type
+ * @param[in]   event           event
+ * @return      always ECORE_CALLBACK_PASS_ON
+ */
+/*--------------------------------------------------------------------------*/
+static Eina_Bool
+ico_uxf_econf_ecoreEvent(void *data, int type, void *event)
+{
+    econf_cb_func_info_t *func_info;
+    econf_pkgmgr_event_t *conf_event = (econf_pkgmgr_event_t *)event;
+    apfw_trace("ico_uxf_econf_ecoreEvent: Enter(ev=%08x)", (unsigned int)event);
+
+    if (conf_event) {
+        ico_uxf_update_procwin(conf_event->appid, conf_event->type);
+        func_info = econf_cb_func;
+        while (func_info) {
+            if (func_info->func) {
+                apfw_trace("ico_uxf_econf_ecoreEvent: func=%08x", (unsigned int)func_info->func);
+                func_info->func(conf_event->appid, conf_event->type);
+            }
+            func_info = func_info->next;
+        }
+    }
+
+    apfw_trace("ico_uxf_econf_ecoreEvent: Leave");
+
+    return ECORE_CALLBACK_DONE;
+}
+
index a394d94..fa1721e 100644 (file)
@@ -155,6 +155,7 @@ ico_uxf_init(const char *name)
     gIco_Uxf_Api_Mng.EventMask = 0;
     gIco_Uxf_Api_Mng.WaylandFd = -1;
     gIco_Uxf_Api_Mng.Wayland_Display = NULL;
+    gIco_Uxf_Api_Mng.InitTimer = ICO_UXF_SUSP_INITTIME;
 
     /* read configurations */
     sysconf = (Ico_Uxf_Sys_Config *)ico_uxf_getSysConfig();
@@ -201,6 +202,9 @@ ico_uxf_init(const char *name)
         prc->attr.type = appconf->application[dn].categoryId;
         prc->attr.hostId = appconf->application[dn].hostId;
         prc->attr.myHost = (prc->attr.hostId == sysconf->misc.myhostId) ? 1 : 0;
+        prc->attr.noicon = appconf->application[dn].noicon;
+        prc->attr.autostart = appconf->application[dn].autostart;
+        prc->attr.invisiblecpu = appconf->application[dn].invisiblecpu;
 
         appdsp = &appconf->application[dn].display[0];
         prc->attr.mainwin.window = 0;
@@ -936,16 +940,13 @@ ico_uxf_window_visiblecb(void *data, struct ico_window_mgr *ico_window_mgr,
     int                 ovisible;
     int                 oraise;
 
-    uifw_trace("ico_uxf_window_visiblecb: Enter(surf=%08x vis=%d raise=%d hint=%d)",
-               (int)surfaceid, visible, raise, hint);
-
     ico_uxf_enter_critical();
 
     win = ico_uxf_mng_window(surfaceid, 0);
 
     if (!win)  {
         ico_uxf_leave_critical();
-        uifw_trace("ico_uxf_window_visiblecb: Leave(Surface=%08x dose not exist)",
+        uifw_trace("ico_uxf_window_visiblecb: Surface=%08x dose not exist",
                    (int)surfaceid);
         return;
     }
@@ -985,7 +986,6 @@ ico_uxf_window_visiblecb(void *data, struct ico_window_mgr *ico_window_mgr,
         }
     }
     ico_uxf_leave_critical();
-    uifw_trace("ico_uxf_window_visiblecb: Leave");
 }
 
 /*--------------------------------------------------------------------------*/
@@ -1015,8 +1015,8 @@ ico_uxf_window_configurecb(void *data, struct ico_window_mgr *ico_window_mgr,
     int                 display;
     Ico_Uxf_Mng_Process *prc;
 
-    uifw_trace("ico_uxf_window_configurecb: Enter(surf=%08x app=%s layer=%d "
-               "x/y=%d/%d w/h=%d/%d hint=%d)",
+    uifw_trace("ico_uxf_window_configurecb: surf=%08x app=%s layer=%d "
+               "x/y=%d/%d w/h=%d/%d hint=%d",
                (int)surfaceid, appid, layer, x, y, width, height, hint);
 
     ico_uxf_enter_critical();
@@ -1040,6 +1040,7 @@ ico_uxf_window_configurecb(void *data, struct ico_window_mgr *ico_window_mgr,
         hint = 0;
 
         prc = ico_uxf_mng_process(appid, 0);
+        win->mng_process = prc;
         if ((prc != NULL) && (prc->attr.mainwin.window != (int)surfaceid)) {
             /* sub-window */
             win->attr.subwindow = 1;
@@ -1091,19 +1092,23 @@ ico_uxf_window_configurecb(void *data, struct ico_window_mgr *ico_window_mgr,
 
                 ico_uxf_regist_eventque(que);
             }
-            win->attr.x = x;
-            win->attr.y = y;
-            win->attr.w = width;
-            win->attr.h = height;
-            if (win->attr.layer != layer)  {
-                win->attr.layer = layer;
-                win->mng_layer = ico_uxf_mng_layer(win->mng_display->attr.display,
-                                                   layer, 0);
+            if (hint == 0)  {
+                win->attr.x = x;
+                win->attr.y = y;
+                win->attr.w = width;
+                win->attr.h = height;
+                if (win->attr.layer != layer)  {
+                    win->attr.layer = layer;
+                    win->mng_layer = ico_uxf_mng_layer(win->mng_display->attr.display,
+                                                       layer, 0);
+                }
+            }
+            else if ((win->attr.w != width) || (win->attr.h != height))    {
+                (void)ico_uxf_window_resize(win->attr.window, win->attr.w, win->attr.h);
             }
         }
     }
     ico_uxf_leave_critical();
-    uifw_trace("ico_uxf_window_configurecb: Leave");
 }
 
 /*--------------------------------------------------------------------------*/
@@ -1384,10 +1389,13 @@ ico_uxf_aul_aulcb(int pid, void *data)
 
     dead = (int)data;
     memset(appid, 0, sizeof(appid));
-    (void) aul_app_get_appid_bypid(pid, appid, sizeof(appid));
-
-    uifw_trace("ico_uxf_aul_aulcb: Enter(pid=%d, dead=%d, appid=%s)", pid, dead, appid);
-
+    if (dead == 0)  {
+        (void) aul_app_get_appid_bypid(pid, appid, sizeof(appid));
+        uifw_trace("ico_uxf_aul_aulcb: Enter(pid=%d, dead=No, appid=%s)", pid, appid);
+    }
+    else    {
+        uifw_trace("ico_uxf_aul_aulcb: Enter(pid=%d, dead=Yes)", pid);
+    }
     for (hash = 0; hash < ICO_UXF_MISC_HASHSIZE; hash++) {
         proc = gIco_Uxf_Api_Mng.Hash_ProcessId[hash];
         while (proc)   {
@@ -1428,8 +1436,13 @@ 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->attr.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);
                 proc->attr.child = 1;
+                /* save parent application if exist     */
+                if (proc != gIco_Uxf_Api_Mng.Mng_LastProcess) {
+                    proc->parent = gIco_Uxf_Api_Mng.Mng_LastProcess;
+                }
             }
             else    {
                 proc->attr.child = 0;
@@ -1449,6 +1462,119 @@ ico_uxf_aul_aulcb(int pid, void *data)
 
 /*--------------------------------------------------------------------------*/
 /**
+ * @brief   ico_uxf_set_lastapp: save last application
+ *
+ * @param[in]   appid   applicationId (if NULL, no last application)
+ * @return      none
+ */
+/*--------------------------------------------------------------------------*/
+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;
+    }
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   ico_uxf_getchild_appid: get child applicationId
+ *
+ * @param[in]   appid   parent applicationId
+ * @return      last child applicationId
+ * @retval      !=NULL      success(applicationId)
+ * @retval      ==NULL      no child application
+ */
+/*--------------------------------------------------------------------------*/
+ICO_APF_API char *
+ico_uxf_getchild_appid(const char *appid)
+{
+    Ico_Uxf_Mng_Process *pproc;
+    Ico_Uxf_Mng_Process *proc;
+    int     hash;
+
+    pproc = ico_uxf_mng_process(appid, 0);
+    if (! pproc)    {
+        /* unknown parent application, no child     */
+        uifw_trace("ico_uxf_getchild_appid: Unknown parent(%s)", appid);
+        return NULL;
+    }
+
+    /* search parent        */
+    for (hash = 0; hash < ICO_UXF_MISC_HASHSIZE; hash++)    {
+        proc = gIco_Uxf_Api_Mng.Hash_ProcessId[hash];
+        while (proc)    {
+            if (proc->parent == pproc)  {
+                uifw_trace("ico_uxf_getchild_appid: child(%s) parent(%s)",
+                           proc->attr.process, appid);
+                return proc->attr.process;
+            }
+            proc = proc->nextidhash;
+        }
+    }
+    uifw_trace("ico_uxf_getchild_appid: parent(%s) has no child", appid);
+    return NULL;
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   ico_uxf_set_lastapp: save last application
+ *
+ * @param[in]   appid   applicationId (if NULL, no last application)
+ * @return      none
+ */
+/*--------------------------------------------------------------------------*/
+ICO_APF_API void
+ico_uxf_timer_wake(const int msec)
+{
+    Ico_Uxf_Mng_Process *proc;
+    int     hash;
+
+    if (gIco_Uxf_Api_Mng.InitTimer > 0) {
+        gIco_Uxf_Api_Mng.InitTimer -= msec;
+        if (gIco_Uxf_Api_Mng.InitTimer > 0) {
+            return;
+        }
+        gIco_Uxf_Api_Mng.InitTimer = 0;
+    }
+
+    if (gIco_Uxf_Api_Mng.NeedTimer == 0)    {
+        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)    {
+            if (proc->susptimer > 0)    {
+                if (msec >= proc->susptimer)    {
+                    proc->susptimer = 0;
+                    if (proc->attr.suspend) {
+                        if (proc->susp == 0)    {
+                            proc->susp = 1;
+                            uifw_trace("ico_uxf_timer_wake: CPU suspend pid=%d",
+                                       proc->attr.internalid);
+                            kill(proc->attr.internalid, SIGSTOP);
+                        }
+                    }
+                }
+                else    {
+                    proc->susptimer -= msec;
+                    gIco_Uxf_Api_Mng.NeedTimer ++;
+                }
+            }
+            proc = proc->nextidhash;
+        }
+    }
+}
+
+/*--------------------------------------------------------------------------*/
+/**
  * @brief   ico_uxf_enter_critical: enter critical section(internal function)
  *
  * @param       none
@@ -1852,6 +1978,111 @@ ico_uxf_mng_process(const char *process, const int create)
 
 /*--------------------------------------------------------------------------*/
 /**
+ * @brief   ico_uxf_update_procwin: update a process management table
+ *
+ * @param[in]   appid       application id
+ * @param[in]   type        type(install/uninstall)
+ * @param[in]   func        window create/destroy hook function
+ * @return      none
+ */
+/*--------------------------------------------------------------------------*/
+ICO_APF_API void
+ico_uxf_update_procwin(const char *appid, int type)
+{
+    Ico_Uxf_Mng_Process     *prc = NULL;
+    Ico_Uxf_Sys_Config      *sysconf;
+    Ico_Uxf_App_Config      *appconf;
+    Ico_Uxf_conf_appdisplay *appdsp;
+    int                     dn, tn;
+    Ico_Uxf_conf_application *app = NULL;
+
+    uifw_trace("ico_uxf_update_procwin: Enter(appid=%s, type=%d)", appid, type);
+
+    if (gIco_Uxf_Api_Mng.Initialized <= 0) {
+        uifw_trace("ico_uxf_callback_remove: Leave(not initialized)");
+        return;
+    }
+    prc = ico_uxf_mng_process(appid, 0);
+
+    if (type == ICO_UXF_CONF_EVENT_INSTALL) {
+        if (!prc) {
+            sysconf = (Ico_Uxf_Sys_Config *)ico_uxf_getSysConfig();
+            appconf = (Ico_Uxf_App_Config *)ico_uxf_getAppConfig();
+            if ((sysconf == NULL) || (appconf == NULL)) {
+                uifw_trace("ico_uxf_update_procwin: Leave(cannot find tables)");
+                return;
+            }
+            for (dn = 0;  dn < appconf->applicationNum; dn++) {
+                app = &appconf->application[dn];
+                if (strncmp(app->appid, appid, ICO_UXF_MAX_PROCESS_NAME) == 0) {
+                    uifw_trace("ico_uxf_update_procwin: Install(%s)", appid);
+                    /* add process management table */
+                    prc = ico_uxf_mng_process(appid, 1);
+                    prc->attr.internalid = 0;
+                    prc->attr.status = ICO_UXF_PROCSTATUS_STOP;
+                    prc->attr.type = app->categoryId;
+                    prc->attr.hostId = app->hostId;
+                    prc->attr.myHost = (prc->attr.hostId == sysconf->misc.myhostId) ? 1 : 0;
+
+                    appdsp = &app->display[0];
+                    prc->attr.mainwin.window = 0;
+                    prc->attr.mainwin.windowtype = app->categoryId;
+                    prc->attr.mainwin.display = appdsp->displayId;
+                    prc->attr.mainwin.layer = appdsp->layerId;
+                    prc->attr.mainwin.x =
+                            sysconf->display[appdsp->displayId].zone[appdsp->zoneId].x;
+                    prc->attr.mainwin.y =
+                            sysconf->display[appdsp->displayId].zone[appdsp->zoneId].y;
+                    prc->attr.mainwin.w =
+                            sysconf->display[appdsp->displayId].zone[appdsp->zoneId].width;
+                    prc->attr.mainwin.h =
+                            sysconf->display[appdsp->displayId].zone[appdsp->zoneId].height;
+                    prc->attr.mainwin.name[ICO_UXF_MAX_WIN_NAME] = 0;
+                    prc->attr.numwindows = app->displayzoneNum;
+                    /* get sub windows                          */
+                    if (prc->attr.numwindows > 1)   {
+                        prc->attr.subwin = malloc(sizeof(Ico_Uxf_ProcessWin) *
+                                                  (prc->attr.numwindows - 1));
+                        if (! prc->attr.subwin) {
+                            uifw_trace("ico_uxf_update_procwin: Install(No memory)");
+                            app->displayzoneNum = 1;
+                            prc->attr.numwindows = 1;
+                        }
+                        else    {
+                            memset(prc->attr.subwin, 0, (prc->attr.numwindows - 1));
+                            for (tn = 0; tn < (prc->attr.numwindows - 1); tn++) {
+                                appdsp ++;
+                                prc->attr.subwin[tn].windowtype = prc->attr.mainwin.windowtype;
+                                prc->attr.subwin[tn].display = appdsp->displayId;
+                                prc->attr.subwin[tn].layer = appdsp->layerId;
+                                prc->attr.subwin[tn].x =
+                                    sysconf->display[appdsp->displayId].zone[appdsp->zoneId].x;
+                                prc->attr.subwin[tn].y =
+                                    sysconf->display[appdsp->displayId].zone[appdsp->zoneId].y;
+                                prc->attr.subwin[tn].w =
+                                    sysconf->display[appdsp->displayId].zone[appdsp->zoneId].width;
+                                prc->attr.subwin[tn].h =
+                                    sysconf->display[appdsp->displayId].zone[appdsp->zoneId].height;
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+    else if (type == ICO_UXF_CONF_EVENT_UNINSTALL) {
+        if (prc) {
+            /* not delete process management table */
+        }
+    }
+
+    uifw_trace("ico_uxf_update_procwin: Leave");
+
+    return;
+}
+
+/*--------------------------------------------------------------------------*/
+/**
  * @brief   ico_uxf_window_screen_size_get: get display physical size
  *
  * @param[out]  width       variable to receive the width of the display
index 924a561..35be2db 100644 (file)
@@ -60,7 +60,6 @@ ico_uxf_process_execute(const char *name)
     for (hash = 0; hash < ICO_UXF_MISC_HASHSIZE; hash++)    {
         proc = gIco_Uxf_Api_Mng.Hash_ProcessId[hash];
         while (proc)    {
-            uifw_trace("ico_uxf_process_execute: PROC(%s)", proc->attr.process);
             if (strcasecmp(proc->attr.process, name) == 0)  break;
             proc = proc->nextidhash;
         }
index 5ad7703..196225b 100644 (file)
@@ -62,6 +62,10 @@ 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                       */
+    struct _Ico_Uxf_Mng_Process *parent;    /* parent process                       */
+    short               susptimer;          /* suspend timer                        */
+    char                susp;               /* real suspend flag                    */
+    char                res;                /* (unused)                             */
     Ico_Uxf_ProcessAttr attr;               /* process configuration                */
 }   Ico_Uxf_Mng_Process;
 
@@ -92,7 +96,7 @@ typedef struct  _Ico_Uxf_Mng_Window {
     struct _Ico_Uxf_Mng_Window *mng_parent; /* parent window                        */
     short               state;              /* Window status                        */
     unsigned char       request;            /* Request                              */
-    unsigned char       timecount;          /* Time counter                         */
+    char                res;                /* (unused)                             */
     Ico_Uxf_WindowAttr  attr;               /* window attribute                     */
 }   Ico_Uxf_Mng_Window;
 
@@ -110,12 +114,15 @@ typedef struct  _Ico_Uxf_Api_Mng    {
     int                     EventMask;      /* receive event                        */
     unsigned int            LastEvent;      /* last receive event(end synchronization)*/
     int                     AppsCtlVisible; /* Tempolary visible all windows        */
+    int                     NeedTimer;      /* need timer control                   */
+    int                     InitTimer;      /* initial timer                        */
 
     /* process information myprocess        */
     char                    MyProcess[ICO_UXF_MAX_PROCESS_NAME+1];
                                             /* process id                           */
     Ico_Uxf_Mng_Process     *Mng_MyProcess; /* process management table             */
     int                     MyMainWindow;   /* main window id                       */
+    Ico_Uxf_Mng_Process     *Mng_LastProcess;/* last active process management table*/
 
     /* table management callback function            */
     Ico_Uxf_Mng_Callback    *Callback;      /* callback management table            */
@@ -179,8 +186,13 @@ Ico_Uxf_Mng_Window *ico_uxf_mng_window(const int window, const int create);
                                             /* get a window management table        */
 Ico_Uxf_Mng_Process *ico_uxf_mng_process(const char *process, const int create);
                                             /* get a process management table       */
+void ico_uxf_update_procwin(const char *appid, int type);
+                                            /* update a process management table    */
 void ico_uxf_free_procwin(Ico_Uxf_Mng_Process *prc);
                                             /* release application windows          */
+void ico_uxf_window_visible_control(Ico_Uxf_Mng_Window *winmng,
+                                    const int show, const int raise);
+                                            /* Window visible and cpu control       */
 int ico_uxf_gl_create_window(const int display, const int layer, const int x,
                              const int y, const int w, const int h, const int full);
                                             /* create window by OpenGL ES/EGL       */
index 3c8f356..f65673c 100644 (file)
@@ -16,6 +16,7 @@
 #include    <stdlib.h>
 #include    <unistd.h>
 #include    <string.h>
+#include    <signal.h>
 #include    <errno.h>
 
 #include    "ico_uxf.h"
@@ -26,6 +27,50 @@ extern Ico_Uxf_Api_Mng         gIco_Uxf_Api_Mng;
 
 /*--------------------------------------------------------------------------*/
 /**
+ * @brief   ico_uxf_window_visible_control: window visible control(internal function)
+ *
+ * @param[in]   winmng          process management table
+ * @param[in]   show            show(1)/hide(0)/nochange(9)
+ * @param[in]   raise           raise(1)/lower(0)/nochange(9)
+ * @return      none
+ */
+/*--------------------------------------------------------------------------*/
+void
+ico_uxf_window_visible_control(Ico_Uxf_Mng_Window *winmng, const int show, const int raise)
+{
+    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);
+        }
+    }
+
+    /* 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->mng_process)->attr.suspend == 0))   {
+        /* change to hide, application suspend  */
+        (winmng->mng_process)->attr.suspend = 1;
+        (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);
+    }
+}
+
+/*--------------------------------------------------------------------------*/
+/**
  * @brief   ico_uxf_window_layer: Set window layer
  *
  * @param[in]   window          window Id
@@ -142,23 +187,20 @@ ico_uxf_window_resize(const int window, const int w, const int h)
         return ICO_UXF_ENOENT;
     }
 
-    uifw_trace("ico_uxf_window_resize: layer(%d,%d)",
-               winmng->mng_layer->attr.w, winmng->mng_layer->attr.h);
     if ((w <= 0) || (w > winmng->mng_layer->attr.w) ||
         (h <= 0) || (h > winmng->mng_layer->attr.h))   {
         uifw_warn("ico_uxf_window_resize: Leave(EINVAL)");
         return ICO_UXF_EINVAL;
     }
 
-    if ((w != winmng->attr.w) || (h != winmng->attr.h))    {
-        winmng->attr.w = w;
-        winmng->attr.h = h;
+    winmng->attr.w = w;
+    winmng->attr.h = h;
+
+    ico_window_mgr_set_positionsize(gIco_Uxf_Api_Mng.Wayland_WindowMgr, window,
+                                    winmng->attr.x, winmng->attr.y,
+                                    winmng->attr.w, winmng->attr.h);
+    wl_display_flush(gIco_Uxf_Api_Mng.Wayland_Display);
 
-        ico_window_mgr_set_positionsize(gIco_Uxf_Api_Mng.Wayland_WindowMgr, window,
-                                        winmng->attr.x, winmng->attr.y,
-                                        winmng->attr.w, winmng->attr.h);
-        wl_display_flush(gIco_Uxf_Api_Mng.Wayland_Display);
-    }
     uifw_trace("ico_uxf_window_resize: Leave(EOK)");
     return ICO_UXF_EOK;
 }
@@ -235,9 +277,7 @@ ico_uxf_window_raise(const int window)
         return ICO_UXF_ENOENT;
     }
 
-    uifw_trace("ico_uxf_window_raise: ico_window_mgr_set_visible(%08x,%d,%d)", window, 9, 1);
-    ico_window_mgr_set_visible(gIco_Uxf_Api_Mng.Wayland_WindowMgr, window, 9, 1);
-    wl_display_flush(gIco_Uxf_Api_Mng.Wayland_Display);
+    ico_uxf_window_visible_control(winmng, 9, 1);
 
     uifw_trace("ico_uxf_window_raise: Leave(EOK)");
     return ICO_UXF_EOK;
@@ -272,9 +312,7 @@ ico_uxf_window_lower(const int window)
         return ICO_UXF_ENOENT;
     }
 
-    uifw_trace("ico_uxf_window_lower: ico_window_mgr_set_visible(%08x,%d,%d)", window, 9, 0);
-    ico_window_mgr_set_visible(gIco_Uxf_Api_Mng.Wayland_WindowMgr, window, 9, 0);
-    wl_display_flush(gIco_Uxf_Api_Mng.Wayland_Display);
+    ico_uxf_window_visible_control(winmng, 9, 0);
 
     uifw_trace("ico_uxf_window_lower: Leave(EOK)");
     return ICO_UXF_EOK;
@@ -537,18 +575,25 @@ ico_uxf_window_control(const char *appid, const int winidx,
                 winmng = gIco_Uxf_Api_Mng.Hash_WindowId[hash];
                 while (winmng)  {
                     if ((winmng->attr.window > 0) && (winmng->attr.visible))    {
-                        if ((gIco_Uxf_Api_Mng.AppsCtlVisible != 0) ||
-                            (winmng->attr.control == 0))    {
-                            i = 1;
+                        if ((winmng->mng_process)->attr.noicon == 0)    {
+                            if ((gIco_Uxf_Api_Mng.AppsCtlVisible != 0) ||
+                                (winmng->attr.control == 0))    {
+                                i = 1;
+                            }
+                            else    {
+                                i = 0;
+                            }
                         }
                         else    {
-                            i = 0;
+                            if ((gIco_Uxf_Api_Mng.AppsCtlVisible == 0) &&
+                                (winmng->attr.control == 0))    {
+                                i = 1;
+                            }
+                            else    {
+                                i = 0;
+                            }
                         }
-                        uifw_trace("ico_uxf_window_control: ico_window_mgr_set_visible"
-                                   "(%08x,%d,9)", winmng->attr.window, i);
-                        ico_window_mgr_set_visible(gIco_Uxf_Api_Mng.Wayland_WindowMgr,
-                                                   winmng->attr.window, i, 9);
-                        wl_display_flush(gIco_Uxf_Api_Mng.Wayland_Display);
+                        ico_uxf_window_visible_control(winmng, i, 9);
                     }
                     winmng = winmng->nextidhash;
                 }
@@ -583,19 +628,20 @@ ico_uxf_window_control(const char *appid, const int winidx,
             if (onoff)  newcontrol |= control;
             else        newcontrol &= (~control);
 
-            uifw_trace("ico_uxf_window_control: control %08x %02x=>%02x",
-                       procattr[i].window, winmng->attr.control, newcontrol);
+            uifw_trace("ico_uxf_window_control: control %08x(%s) %02x=>%02x vis=%d icon=%d",
+                       procattr[i].window, (winmng->mng_process)->attr.process,
+                       winmng->attr.control, newcontrol, winmng->attr.visible,
+                       (winmng->mng_process)->attr.noicon);
             if (winmng->attr.control != newcontrol) {
                 winmng->attr.control = newcontrol;
                 if (winmng->attr.visible != 0)  {
-                    if (gIco_Uxf_Api_Mng.AppsCtlVisible)    newcontrol = 0;
-                    /* request to Weston(Window Manager)     */
-                    uifw_trace("ico_uxf_window_control: visible(%08x,%d) to weston",
-                               procattr[i].window, (newcontrol != 0) ? 0 : 1);
-                    ico_window_mgr_set_visible(gIco_Uxf_Api_Mng.Wayland_WindowMgr,
-                                               procattr[i].window,
-                                               (newcontrol != 0) ? 0 : 1, 9);
-                    wl_display_flush(gIco_Uxf_Api_Mng.Wayland_Display);
+                    if (gIco_Uxf_Api_Mng.AppsCtlVisible != 0)   {
+                        if ((winmng->mng_process)->attr.noicon == 0)    newcontrol = 0;
+                        else                                            newcontrol = 1;
+                    }
+                    /* request to Weston(Multi Window Manager)  */
+                    ico_uxf_window_visible_control(winmng,
+                                                   (newcontrol != 0) ? 0 : 1, 9);
                 }
             }
             uifw_trace("ico_uxf_window_control: Leave(EOK) control=%x(%d) visible=%d",
@@ -638,11 +684,8 @@ ico_uxf_window_show(const int window)
     winmng->attr.visible = 1;
 
     if (winmng->attr.control == 0)  {
-        /* request to display to Weston(Window Manager)     */
-        uifw_trace("ico_uxf_window_show: ico_window_mgr_set_visible(%08x,%d,%d)",
-                   window, 1, 9);
-        ico_window_mgr_set_visible(gIco_Uxf_Api_Mng.Wayland_WindowMgr, window, 1, 9);
-        wl_display_flush(gIco_Uxf_Api_Mng.Wayland_Display);
+        /* request to display to Weston(Multi Window Manager)   */
+        ico_uxf_window_visible_control(winmng, 1, 9);
     }
     uifw_trace("ico_uxf_window_show: Leave(EOK) control=%x", winmng->attr.control);
     return ICO_UXF_EOK;
@@ -679,10 +722,8 @@ ico_uxf_window_hide(const int window)
     }
     winmng->attr.visible = 0;
 
-    /* request to hide to Weston(Window Manager)    */
-    uifw_trace("ico_uxf_window_hide: ico_window_mgr_set_visible(%08x,%d,%d)", window, 0, 9);
-    ico_window_mgr_set_visible(gIco_Uxf_Api_Mng.Wayland_WindowMgr, window, 0, 9);
-    wl_display_flush(gIco_Uxf_Api_Mng.Wayland_Display);
+    /* request to hide to Weston(Multi Window Manager)  */
+    ico_uxf_window_visible_control(winmng, 0, 9);
 
     uifw_trace("ico_uxf_window_hide: Leave(EOK)");
     return ICO_UXF_EOK;
@@ -726,21 +767,75 @@ ico_uxf_window_visible_raise(const int window, const int visible, const int rais
     }
     else if (vis == 1)  {
         winmng->attr.visible = 1;
-        if ((winmng->attr.control != 0) && (gIco_Uxf_Api_Mng.AppsCtlVisible == 0))  {
-            uifw_trace("ico_uxf_window_visible_raise: change to hide(control=%x menu=%d",
-                       winmng->attr.control, gIco_Uxf_Api_Mng.AppsCtlVisible);
-            vis = 0;
+        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;
+            }
+        }
+        else    {
+            /* HomeScreen menu screen   */
+            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;
+            }
         }
     }
 
     if ((vis != 9) || (raise != 9)) {
-        /* request to visible status and order status to Weston(Window Manager)     */
-        uifw_trace("ico_uxf_window_visible_raise: ico_window_mgr_set_visible(%08x,%d,%d)",
-                   window, vis, raise);
-        ico_window_mgr_set_visible(gIco_Uxf_Api_Mng.Wayland_WindowMgr, window, vis, raise);
-        wl_display_flush(gIco_Uxf_Api_Mng.Wayland_Display);
+        /* request to visible status and order status to Weston(Multi Window Manager)   */
+        ico_uxf_window_visible_control(winmng, vis, raise);
     }
     uifw_trace("ico_uxf_window_visible_raise: Leave(EOK)");
     return ICO_UXF_EOK;
 }
 
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   ico_uxf_window_animation: set window animation
+ *
+ * @param[in]   window      Window identity
+ * @param[in]   animation   Animation name
+ * @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_animation(const int window, const char *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");
+
+    if (gIco_Uxf_Api_Mng.Initialized <= 0) {
+        uifw_warn("ico_uxf_window_animation: Leave(ESRCH)");
+        return ICO_UXF_ESRCH;
+    }
+
+    winmng = ico_uxf_mng_window(window, 0);
+    if ((! winmng) || (! winmng->mng_display)) {
+        uifw_warn("ico_uxf_window_animation: Leave(ENOENT)");
+        return ICO_UXF_ENOENT;
+    }
+
+    if (animation)  {
+        ico_window_mgr_set_animation(gIco_Uxf_Api_Mng.Wayland_WindowMgr,
+                                     winmng->attr.window, animation);
+    }
+    else    {
+        nullname[0] = ' ';
+        nullname[1] = 0;
+        ico_window_mgr_set_animation(gIco_Uxf_Api_Mng.Wayland_WindowMgr,
+                                     winmng->attr.window, nullname);
+    }
+    uifw_trace("ico_uxf_window_animation: Leave(EOK)");
+    return ICO_UXF_EOK;
+}
+
index f7b8511..8788309 100644 (file)
 #define ICO_HS_TOUCH_IN_HIDE    (3)
 #define ICO_HS_TOUCH_IN_SHOW    (4)
 
+#define ICO_HS_TILE_NOCHANGE    (1)
+#define ICO_HS_TILE_APPLIST     (2)
+#define ICO_HS_TILE_OTHERS      (5)
 #define ICO_HS_TILE_SMALL       (11)
 #define ICO_HS_TILE_HWIDE       (21)
 #define ICO_HS_TILE_VWIDE       (12)
 #define ICO_HS_TILE_LARGE       (22)
-#define ICO_HS_TILE_OTHERS      (0)
 
 #define ICO_HS_TILE_CHAN        (18)
 #define ICO_HS_TILE_SIZE_S      (170)
@@ -78,6 +80,7 @@
 #define ICO_HS_WINDOW_NUM_MAX       (10)
 #define ICO_HS_MSG_SIZE             (1024)
 #define ICO_HS_TEMP_BUF_SIZE        (256)
+#define ICO_HS_NOTILE_APP_MAX       (20)
 
 #define ICO_HS_PROTOCOL_CM          "gui-protocol"
                   /* protocol to communicate external tools */
@@ -96,6 +99,9 @@
 #define ICO_HS_SIZE_LAYOUT_WIDTH     (768)
 #define ICO_HS_SIZE_LAYOUT_HEIGHT    (1024)
 
+/* define for statusbar configuration */
+#define ICO_SB_CONFIG_SHTCT_APP      "shortcut_app"
+
 /* define for sound configuration */
 #define ICO_HS_SND_TYPE_DEFAULT      (1)
 
@@ -132,6 +138,7 @@ extern void hs_tile_show_screen(void);
 extern int hs_get_index_appscreendata(const char *appid);
 extern void hs_req_ctlr_tile(void);
 extern void hs_click_escutcheon(void);
+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);
index 043ebc9..6784e6f 100644 (file)
 #ifndef __ICO_APF_RESOURCE_CONTROL_H__
 #define __ICO_APF_RESOURCE_CONTROL_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /*
  *  id of resource
  */
index 621b6e7..7e64c72 100644 (file)
@@ -25,6 +25,9 @@
 extern "C" {
 #endif
 
+/* Maximum values                           */
+#define ICO_SYC_APC_REGULATION_LISTENERS    4   /* number of regulation listeners   */
+
 /* Vehicle information values               */
 #define ICO_SYC_APC_REGULATION_SPEED_RUNNING    (4.0)
 #define ICO_SYC_APC_REGULATION_SHIFT_NEUTRALS   (0)
@@ -34,12 +37,13 @@ extern "C" {
 #define ICO_SYC_APC_REGULATION_SHIFT_DRIVE      (4)
 #define ICO_SYC_APC_REGULATION_SHIFT_REVERSES   (128)
 #define ICO_SYC_APC_REGULATION_SHIFT_PARKING    (255)
-#define ICO_SYC_APC_REGULATION_BLINKER_LEFT     (2)
+#define ICO_SYC_APC_REGULATION_BLINKER_NONE     (0)
 #define ICO_SYC_APC_REGULATION_BLINKER_RIGHT    (1)
+#define ICO_SYC_APC_REGULATION_BLINKER_LEFT     (2)
 
-#define ICO_SYC_APC_REGULATION_NOCHANGE         (9)
-#define ICO_SYC_APC_REGULATION_NOREGULATION     (1)
 #define ICO_SYC_APC_REGULATION_REGULATION       (0)
+#define ICO_SYC_APC_REGULATION_NOREGULATION     (1)
+#define ICO_SYC_APC_REGULATION_NOCHANGE         (9)
 
 typedef struct _ico_apc_reguration_control  {
     unsigned char   display;                /* display(1=visible/0=invisible)   */
index 6a39c06..d8405ae 100644 (file)
@@ -35,6 +35,8 @@ enum    _ico_syc_regulation_vehicleinfo_id  {
     ICO_SYC_VEHICLEINFO_VEHICLE_SPEED = 1,  /* vehicle speed                        */
     ICO_SYC_VEHICLEINFO_SHIFT_POSITION,     /* shift position                       */
     ICO_SYC_VEHICLEINFO_TURN_SIGNAL,        /* blinker signal                       */
+    ICO_SYC_VEHICLEINFO_LIGHT_LEFT,         /* left turn light status               */
+    ICO_SYC_VEHICLEINFO_LIGHT_RIGHT,        /* right turn light status              */
 
     ICO_SYC_VEHICLEINFO_MAX                 /* maximum number of type               */
 };
diff --git a/include/ico_syc_error.h b/include/ico_syc_error.h
deleted file mode 100644 (file)
index 1b1f2c9..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
- *
- * This program is licensed under the terms and conditions of the
- * Apache License, version 2.0.  The full text of the Apache License is at
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- */
-/**
- * @brief   System Controller public header for permanent value
- *
- * @date    Feb-28-2013
- */
-
-#ifndef _ICO_SYC_DEF_H_
-#define _ICO_SYC_DEF_H_
-
-#include "ico_apf_error.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* common API error code        */
-#define ICO_SYC_EOK     ICO_APF_RESOURCE_E_NONE             /* OK                   */
-#define ICO_SYC_ENOENT  ICO_APF_RESOURCE_E_UNKOWN           /* No such object       */
-#define ICO_SYC_ESRCH   ICO_APF_RESOURCE_E_NOT_INITIALIZED  /* Not initialized      */
-#define ICO_SYC_EIO     ICO_APF_RESOURCE_E_COMMUNICATION    /* I/O error            */
-#define ICO_SYC_ENOMEM  ICO_APF_RESOURCE_E_NOT_IMPLEMENTED  /* Out of memory        */
-#define ICO_SYC_EINVAL  ICO_APF_RESOURCE_E_INVAL            /* Invalid argument     */
-#define ICO_SYC_ENOSYS  (-99)                               /* System error         */
-
-/* Vehicle information internal key */
-enum    _ico_syc_regulation_vehicleinfo_id  {
-    ICO_SYC_VEHICLEINFO_VEHICLE_SPEED = 1,  /* vehicle speed                        */
-    ICO_SYC_VEHICLEINFO_SHIFT_POSITION,     /* shift position                       */
-    ICO_SYC_VEHICLEINFO_BLINKER,            /* blinker(not inpliment in AMB)        */
-
-    ICO_SYC_VEHICLEINFO_MAX                 /* maximum number of type               */
-};
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* _ICO_SYC_DEF_H_ */
-
index b1cf0d6..8a80590 100644 (file)
@@ -101,16 +101,17 @@ typedef struct _ico_uxf_conf_application {
     char *exec;
     char *type;
     int hostId;
-    char noicon;
-    char res[3];                    /* (unused)     */
     char *location;
     char *icon_key_name;
+    char autostart;
+    char noicon;
+    unsigned short invisiblecpu;
     short kindId;
     short categoryId;
-    short autostart;
     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];
@@ -206,11 +207,14 @@ typedef struct _ico_uxf_sys_config {
 
 typedef struct _ico_uxf_app_config {
     int applicationNum;
+       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];
 } Ico_Uxf_App_Config;
 
+typedef void (*Ico_Uxf_AppUpdata_Cb)(const char *appid, int type);
+
 const Ico_Uxf_Sys_Config* ico_uxf_getSysConfig(void);
 const Ico_Uxf_Sys_Config* ico_uxf_ifGetSysConfig(void);
 const Ico_Uxf_App_Config* ico_uxf_getAppConfig(void);
@@ -241,6 +245,8 @@ const Ico_Uxf_conf_category* ico_uxf_getAppCategoryById(const int categoryId);
 const Ico_Uxf_conf_display* ico_uxf_getSysDisplayById(const int displayId);
 const char *ico_uxf_get_SysLocation( const int hostId );
 
+int ico_uxf_conf_setAppUpdateCb(Ico_Uxf_AppUpdata_Cb func);
+
 /* define log macros    */
 #ifndef uifw_trace
 #define uifw_debug      ICO_UXF_DEBUG
@@ -254,16 +260,8 @@ const char *ico_uxf_get_SysLocation( const int hostId );
 
 void ico_uxf_closeSysConfig(void);
 
-#define ICO_UXF_EVENT_WAIT_DEFAULT      (0)
-#define ICO_UXF_EVENT_WAIT_WAYLAND      (1)
-#define ICO_UXF_EVENT_WAIT_WEBSOCKET    (2)
-#define ICO_UXF_EVENT_WAIT_JULIUS       (3)
-
-#define ICO_UXF_EFFECT_NONE             (0)
-#define ICO_UXF_EFFECT_GRAYOUT          (1)
-#define ICO_UXF_EFFECT_BLACKOUT         (2)
-#define ICO_UXF_EFFECT_INVISIBLE        (3)
-#define ICO_UXF_EFFECT_TERMINATE        (4)
+#define ICO_UXF_CONF_EVENT_INSTALL      (0)
+#define ICO_UXF_CONF_EVENT_UNINSTALL    (1)
 
 #ifdef __cplusplus
 }
diff --git a/include/ico_uxf_conf_ecore.h b/include/ico_uxf_conf_ecore.h
new file mode 100644 (file)
index 0000000..1997da4
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
+ *
+ * This program is licensed under the terms and conditions of the
+ * Apache License, version 2.0.  The full text of the Apache License is at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ */
+/**
+ * @brief   user experiance library public header file(configuration)
+ *
+ * @date    Feb-28-2013
+ */
+
+#ifndef _ICO_UXF_CONF_ECORE_H_
+#define _ICO_UXF_CONF_ECORE_H_
+
+#include <glib.h>
+#include "ico_uxf_conf_def.h"
+#include "ico_uxf_sysdef.h"
+#include "ico_uxf_def.h"
+#include "ico_uxf_typedef.h"
+#include "ico_apf_log.h"
+#include "ico_uxf_conf.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int ico_uxf_econf_setAppUpdateCb(Ico_Uxf_AppUpdata_Cb func);
+
+/* define log macros    */
+#ifndef uifw_trace
+#define uifw_debug      ICO_UXF_DEBUG
+#define uifw_trace      ICO_UXF_DEBUG
+#define uifw_critical   ICO_UXF_CRITICAL
+#define uifw_info       ICO_UXF_INFO
+#define uifw_warn       ICO_UXF_WARN
+#define uifw_error      ICO_UXF_ERROR
+#define uifw_logflush   ico_uxf_log_flush
+#endif  /*uifw_trace*/
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* _ICO_UXF_CONF_ECORE_H_ */
+
index c676006..79e33f5 100644 (file)
@@ -33,6 +33,8 @@ int ico_uxf_callback_set(const unsigned int mask,
 int ico_uxf_callback_remove(const unsigned int mask,
                             Ico_Uxf_Event_Cb func, const int arg);
                                         /* Remove event callback function       */
+void ico_uxf_timer_wake(const int msec);
+                                        /* UX-FW timer                          */
 
 /* Control window                               */
 int ico_uxf_window_event_mask(const int window, const unsigned int mask);
@@ -75,6 +77,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);
+                                        /* Set window animation                 */
 int ico_uxf_window_control(const char *appid, const int winidx,
                            const int control, const int onoff);
                                         /* Window visible control from AppsController*/
@@ -109,6 +113,10 @@ int ico_uxf_process_window_get_one(const char *process,
                                         /* Get one windows of one application   */
 int ico_uxf_process_query_processes(Ico_Uxf_ProcessAttr attr[], const int num);
                                         /* Get all aplications attribute        */
+void ico_uxf_set_lastapp(const char *appid);
+                                        /* Set/Reset last application           */
+char *ico_uxf_getchild_appid(const char *appid);
+                                        /* Get child applicationId              */
 
 /* Wayland depend function                      */
 int ico_uxf_wl_display_fd(void);
index 9eeac7b..c218c89 100644 (file)
@@ -29,7 +29,7 @@ extern "C" {
 #define ICO_UXF_HOST_MAX            16      /* Maximum number of ECUs               */
 #define ICO_UXF_DISPLAY_LAYER_MAX   16      /* Maximum number of Layers             */
 #define ICO_UXF_CATEGORY_MAX        20      /* Maximum number of application categorys*/
-#define ICO_UXF_DISPLAY_ZONE_MAX    10      /* Maximum zone on display in car       */
+#define ICO_UXF_DISPLAY_ZONE_MAX    30      /* Maximum zone on display in car       */
 #define ICO_UXF_SOUND_ZONE_MAX      10      /* Maximum zone on sound in car         */
 #define ICO_UXF_INPUT_SW_MAX        50      /* Maximum input sw in car              */
 #define ICO_UXF_REGULATION_VIC_MAX  20      /* Maxumum vehicle info for regulation  */
@@ -61,6 +61,10 @@ extern "C" {
 /* maximum value        */
 #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)              */
+
 #ifdef __cplusplus
 }
 #endif
index e527a77..68d5a22 100644 (file)
@@ -133,6 +133,10 @@ typedef struct  _Ico_Uxf_ProcessAttr    {
     short               status;         /* Running status                       */
     char                active;         /* Active/Inactive                      */
     char                child;          /* Child process                        */
+    char                noicon;         /* No icon flag                         */
+    char                autostart;      /* Autostart flag                       */
+    char                suspend;        /* application susupend flag            */
+    unsigned char       invisiblecpu;   /* cpu % at invisible                   */
 }   Ico_Uxf_ProcessAttr;
 
 /* Detail of event                          */
index 4c8f895..5805c1a 100755 (executable)
@@ -54,6 +54,8 @@ cp -rf data/apps/$PKGNAME /opt/apps/
 mkdir -p /opt/apps/$PKGNAME/bin/
 cp src/StatusBar /opt/apps/$PKGNAME/bin/
 cp res/images/time*.png /opt/apps/$PKGNAME/res/images
+cp res/images/applist_*.png /opt/apps/$PKGNAME/res/images
+cp res/images/home*.png /opt/apps/$PKGNAME/res/images
 chmod 666 /opt/apps/$PKGNAME/res/images/time*.png
 cp data/share/applications/$PKGNAME.desktop /opt/share/applications/
 cp res/apps/$PKGNAME/* /opt/apps/$PKGNAME/res/config
@@ -70,7 +72,7 @@ cp src/OnScreen /opt/apps/$PKGNAME/bin/
 cp src/appli_list.edj /opt/apps/$PKGNAME/res/edj
 cp src/appli_kill.edj /opt/apps/$PKGNAME/res/edj
 chmod 666 /opt/apps/$PKGNAME/res/edj/*.edj
-chmod 666 /opt/apps/$PKGNAME/res/images/*.png
+chmod 666 /opt/apps/$PKGNAME/res/images/*.png > /dev/null 2>&1
 cp data/share/applications/$PKGNAME.desktop /opt/share/applications/
 cp res/apps/$PKGNAME/* /opt/apps/$PKGNAME/res/config
 
index 7333fb1..ab9612e 100644 (file)
@@ -1,3 +1,20 @@
+* Fri May 24 2013 Shibata Makoto <shibata@mac.tec.toyota.co.jp> 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.
+  Homescreen reload the application informations when receive the package update messages from the package manager.
+  (use pkgcmd to install or uninstall application)
+- Work around TIVI-832 - [WLD]Video player Segfault when playing video from gallery.
+  Gave child process the screen right of the process that worked just before that.
+- Changed the image of application change button on the statubar.
+- Added the application list button to the statusbar.
+- Removed the application list button from the homescreen tile.
+- Added the application list button to the statusbar.
+- Added the shortcut button to the statusbar.
+- Tile menu indication and the application choice prevent them from being able to do it during a run.
+- Support of the mirror camera indication by the blinker operation.
+- Permit the operation of the music player while driving.
+- Appoint that more than ico-uxf-weston-plugin-0.5.03 are necessary for spec file.
+
 * Wed May 22 2013 Shibata Makoto <shibata@mac.tec.toyota.co.jp> accepted/2.0alpha-wayland/20130520.093309@23824f8
 - Fix for TIVI-803 - Enable new UI in wayland build.
 - Fix for TIVI-826 - weston-plugin should NOT create /root/
index 580e536..fba465b 100644 (file)
@@ -1,6 +1,6 @@
 Name:       ico-uxf-HomeScreen
 Summary:    sample homescreen
-Version:    0.3.02
+Version:    0.3.04
 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.0
+BuildRequires: ico-uxf-weston-plugin-devel >= 0.5.03
 BuildRequires: pkgconfig(eina)
 BuildRequires: pkgconfig(evas)
 BuildRequires: pkgconfig(eina)
@@ -22,11 +22,12 @@ BuildRequires: pkgconfig(json-glib-1.0)
 BuildRequires: pkgconfig(aul)
 BuildRequires: pkgconfig(bundle)
 BuildRequires: pkgconfig(ail)
+BuildRequires: pkgconfig(pkgmgr)
 BuildRequires: libwebsockets-devel
 BuildRequires: capi-base-common-devel
 BuildRequires: edje-tools
 Requires: weston >= 1.0
-Requires: ico-uxf-weston-plugin >= 0.5.0
+Requires: ico-uxf-weston-plugin >= 0.5.03
 
 %description
 Sample homescreen application.
@@ -106,6 +107,8 @@ cp -rf data/apps/%{APP} %{buildroot}/%{PREFIX}/
 cp -rf res/apps/%{APP}/* %{buildroot}%{APPSDIR}/res/config/
 install -m 0755 src/StatusBar %{buildroot}%{APPSDIR}/bin/
 install -m 0644 res/images/time*.png %{buildroot}%{APPSDIR}/res/images/
+install -m 0644 res/images/applist_*.png %{buildroot}%{APPSDIR}/res/images/
+install -m 0644 res/images/home*.png %{buildroot}%{APPSDIR}/res/images/
 install -m 0644 data/share/applications/%{APP}.desktop %{buildroot}/opt/share/applications/
 
 #onscreen
index c7b6125..0f62a78 100644 (file)
@@ -1,8 +1,8 @@
 [homescreen]
 tileinfo_rowcnt=3
 tileinfo_colcnt=5
-tileinfo_valid=1;0;1;1;0;0;0;1;1;1;1;1;0;1;1
-tileinfo_type=22;0;11;12;0;0;0;21;11;11;11;11;0;11;0
+tileinfo_valid=1;0;1;1;0;0;0;1;1;1;1;1;0;1;0
+tileinfo_type=22;0;11;12;0;0;0;21;11;11;11;11;0;12;0
 tileinfo_app0=org.tizen.browser
 tileinfo_app3=org.tizen.music-player
 tileinfo_app2=org.tizen.gallery
@@ -12,6 +12,7 @@ tileinfo_app9=org.tizen.dialer
 tileinfo_app10=org.tizen.calculator
 tileinfo_app11=org.tizen.memo
 tileinfo_app13=org.tizen.smartsearch
+tileinfo_app14=none
 
 statusbar=org.tizen.ico.statusbar
 onscreen=org.tizen.ico.onscreen
index 1314c9c..5a7d6df 100644 (file)
@@ -1,9 +1,12 @@
 ## statusbar private configration
 [statusbar]
 wsport=10001
-#orientaion(1:VERTICAL, 2:HORIZONTAL)
+##orientaion(1:VERTICAL, 2:HORIZONTAL)
 #orientaion=2
 
+shortcut_app0=org.tizen.ico.app-samplenavi
+shortcut_app1=org.tizen.music-player
+
 [sound]
 #configuration for sounds
 sound_default=/usr/share/sounds/mm-camcorder/af_succeed.wav
index 792c3e8..fdc7084 100644 (file)
@@ -7,9 +7,12 @@
 [app-attributes]
 # attrinutes of native applictions
 org.tizen.soft-keyboard=Menu;SysApp;dispzone=SysApp;layer=SoftKeyboard
-org.tizen.setting=Message;kind=SysApp.audio
+org.tizen.setting=CarSetting;kind=SysApp.audio
+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
 #
 
index 3638e8b..012b7ed 100644 (file)
@@ -55,6 +55,8 @@
 0.zone.6=LowerLeft;0;heigh-64/2+64;dispw/2;disph-64/2;Full;Lower
 0.zone.7=LowerRight;dispw/2;heigh-64/2+64;dispw/2;disph-64/2;Full;Lower
 0.zone.8=SysApp;0;64;dispw;disph-64
+0.zone.9=SysApp.Left;0;64;dispw/2-181;disph-64
+0.zone.10=SysApp.Right;dispw/2+181;64;dispw/2-181;disph-64
 #
 ## Sound
 [sound]
diff --git a/res/images/applist_off.png b/res/images/applist_off.png
new file mode 100755 (executable)
index 0000000..5399236
Binary files /dev/null and b/res/images/applist_off.png differ
diff --git a/res/images/applist_on.png b/res/images/applist_on.png
new file mode 100755 (executable)
index 0000000..c2b6210
Binary files /dev/null and b/res/images/applist_on.png differ
diff --git a/res/images/home_off.png b/res/images/home_off.png
new file mode 100755 (executable)
index 0000000..885123b
Binary files /dev/null and b/res/images/home_off.png differ
diff --git a/res/images/home_on.png b/res/images/home_on.png
new file mode 100755 (executable)
index 0000000..6d303b6
Binary files /dev/null and b/res/images/home_on.png differ
diff --git a/settings/S99zz_ico_weston b/settings/S99zz_ico_weston
deleted file mode 100755 (executable)
index 47a946c..0000000
+++ /dev/null
@@ -1,248 +0,0 @@
-#! /bin/sh
-# Provides:          weston
-# Default-Start:     2 3 4 5
-# Default-Stop:      0 1 6
-# Short-Description: Weston compositor boot script for ico-ivi
-# Description:       This script starts the Weston compositor and ico-uxf-HomeScreen at boot.
-
-# Do NOT "set -e"
-
-backend=
-
-# Use the Weston DRM backend if $DISPLAY is set and X isn't running
-#since Weston won't be able use the X11 backend.
-#
-# This allows this script to start Weston with either the X11 or DRM
-#backends.
-if [ -z `pidof Xorg` ] && [ -n "$DISPLAY" ]; then
-    backend="--backend=drm-backend.so"
-fi
-
-# PATH should only include /usr/* if it runs after the mountnfs.sh script
-PATH=/sbin:/usr/sbin:/bin:/usr/bin
-DESC="Weston compositor"
-NAME=weston
-DAEMON=/usr/bin/weston
-DAEMON_ARGS="$backend --idle-time=0 --log=/var/log/weston.log"
-PIDFILE=/var/run/$NAME.pid
-SCRIPTNAME=/etc/init.d/$NAME
-export HOME="/opt/home/root"
-
-# Exit if the package is not installed
-[ -x "$DAEMON" ] || exit 0
-
-# Read configuration variable file if it is present
-[ -r /etc/default/$NAME ] && . /etc/default/$NAME
-
-# Load the VERBOSE setting and other rcS variables
-. /lib/init/vars.sh
-
-# Define LSB log_* functions.
-# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
-# and status_of_proc is working.
-. /lib/lsb/init-functions
-
-#
-# Function that starts the daemon/service
-#
-do_start()
-{
-       # Make sure we have a sane XDG_RUNTIME_DIR environment
-       # variable set.
-       if [ -z "${XDG_RUNTIME_DIR}" ]; then
-           . /etc/profile.d/weston.sh
-       fi
-
-       # Return
-       #   0 if daemon has been started
-       #   1 if daemon was already running
-       #   2 if daemon could not be started
-       start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
-               || return 1
-       
-       # kill pulseaudio and weston, and start pulseaudio
-       /usr/bin/killall pulseaudio > /dev/null 2>&1
-       /usr/bin/killall weston > /dev/null 2>&1
-       /bin/sleep 0.2
-       /usr/bin/killall -9 pulseaudio > /dev/null 2>&1
-       /usr/bin/killall -9 weston > /dev/null 2>&1
-       /bin/sleep 0.2
-       /usr/bin/pulseaudio --system &
-       /bin/sleep 0.2
-       
-       # Start Device Input Controller for eGalax TouchPanel
-       #/usr/bin/ico_ictl-touch_egalax -t
-       /usr/bin/ico_ictl-touch_egalax
-       # Remove weston log
-       /bin/rm -f /var/log/weston.log
-       /bin/ps ax | /bin/grep launchpad_preloading | /bin/grep -v grep > /dev/null
-       if [ "$?" = "0" ] ; then
-               /usr/bin/killall launchpad_preloading_preinitializing_daemon
-               /bin/sleep 0.3
-       fi
-       /usr/bin/launchpad_preloading_preinitializing_daemon &
-
-       # start-stop-daemon --start --background --quiet --pidfile $PIDFILE --exec $DAEMON -- \
-       #       $DAEMON_ARGS \
-       #       || return 2
-       $DAEMON $DAEMON_ARGS &
-       weston_pid=$!
-       /bin/sleep 0.2
-
-       if [ $weston_pid = 0 ]; then
-           return 2
-       else
-           echo $weston_pid > $PIDFILE
-       fi
-
-       # Add code here, if necessary, that waits for the process to be ready
-       # to handle requests from services started subsequently which depend
-       # on this one.  As a last resort, sleep for some time.
-
-       # ************************************************************
-       # HACK TO WORK AROUND INSUFFICIENT ACCESS PERMISSIONS FOR
-       # UNPRIVILEGED USERS.
-       #
-       # Ideally we should launch weston with weston-launch with the
-       # appropriate --user flag.  Unfortunately, weston-launch isn't
-       # available due to missing package dependencies.
-       # ************************************************************
-       wayland_socket="$XDG_RUNTIME_DIR/wayland-0"
-       MAX_ATTEMPTS=8
-       attempt=0
-       while [ ! -f $wayland_socket ] && [ $attempt -lt $MAX_ATTEMPTS ]
-       do
-               /bin/sleep 0.5
-               attempt=$[$attempt + 1]
-       done
-       /bin/chmod 777 $wayland_socket
-
-       # Start wayland-client for display mouse cursor
-       #/usr/bin/nice -19 /usr/bin/wayland-smoke &
-
-       ## if pulseaudio dose not start ... kick pulseaudio
-       /bin/ps ax | /bin/grep pulseaudio | /bin/grep -v grep > /dev/null
-       if [ "$?" = "1" ] ; then
-               /usr/bin/pulseaudio --system &
-               /bin/sleep 1
-       fi
-
-       # Start HomeScreen
-       /bin/sleep 1
-       /bin/mkdir /tmp/log/
-       /bin/chmod -R 0777 /tmp/log
-       /bin/rm -f /tmp/log/*
-       /usr/bin/killall menu-screen
-       /usr/bin/killall menu-daemon
-       /usr/bin/killall power_manager
-       /usr/bin/launch_app org.tizen.ico.homescreen &
-
-       # ***********************************************************
-       # HACK TO WORK AROUND BROKEN INFINITE LOOPS IN BOOT ANIMATION
-       # VIRTUAL KEYBOARD BOOT SCRIPTS.
-       # ***********************************************************
-       touch /tmp/.X0-lock
-       touch /tmp/.wm_ready
-       # ***********************************************************
-}
-
-#
-# Function that stops the daemon/service
-#
-do_stop()
-{
-       # Return
-       #   0 if daemon has been stopped
-       #   1 if daemon was already stopped
-       #   2 if daemon could not be stopped
-       #   other if a failure occurred
-       #start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
-       start-stop-daemon --stop --quiet --pidfile $PIDFILE --name $NAME
-       RETVAL="$?"
-       [ "$RETVAL" = 2 ] && return 2
-       # Wait for children to finish too if this is a daemon that forks
-       # and if the daemon is only ever run from this initscript.
-       # If the above conditions are not satisfied then add some other code
-       # that waits for the process to drop all resources that could be
-       # needed by services started subsequently.  A last resort is to
-       # sleep for some time.
-       #start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
-       start-stop-daemon --stop --quiet --oknodo --exec $DAEMON
-       [ "$?" = 2 ] && return 2
-       # Many daemons don't delete their pidfiles when they exit.
-       rm -f $PIDFILE
-       return "$RETVAL"
-}
-
-#
-# Function that sends a SIGHUP to the daemon/service
-#
-do_reload() {
-       #
-       # If the daemon can reload its configuration without
-       # restarting (for example, when it is sent a SIGHUP),
-       # then implement that here.
-       #
-       start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
-       return 0
-}
-
-case "$1" in
-  start)
-       [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
-       do_start
-       case "$?" in
-               0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
-               2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
-       esac
-       ;;
-  stop)
-       [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
-       do_stop
-       case "$?" in
-               0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
-               2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
-       esac
-       ;;
-  status)
-       status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
-       ;;
-  #reload|force-reload)
-       #
-       # If do_reload() is not implemented then leave this commented out
-       # and leave 'force-reload' as an alias for 'restart'.
-       #
-       #log_daemon_msg "Reloading $DESC" "$NAME"
-       #do_reload
-       #log_end_msg $?
-       #;;
-  restart|force-reload)
-       #
-       # If the "reload" option is implemented then remove the
-       # 'force-reload' alias
-       #
-       log_daemon_msg "Restarting $DESC" "$NAME"
-       do_stop
-       case "$?" in
-         0|1)
-               do_start
-               case "$?" in
-                       0) log_end_msg 0 ;;
-                       1) log_end_msg 1 ;; # Old process is still running
-                       *) log_end_msg 1 ;; # Failed to start
-               esac
-               ;;
-         *)
-               # Failed to stop
-               log_end_msg 1
-               ;;
-       esac
-       ;;
-  *)
-       #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
-       echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
-       exit 3
-       ;;
-esac
-
-:
index c0b40db..3daae98 100644 (file)
@@ -17,7 +17,7 @@ HomeScreen_SOURCES = \
        home_screen_sound.c             \
        resource_conf.c
 HomeScreen_CFLAGS = -I../include $(EFL_CFLAGS) $(OPT_CFLAGS) $(WL_CFLAGS) $(AUL_CFLAGS)
-HomeScreen_LDADD = $(EFL_LIBS) $(OPT_LIBS) $(WL_LIBS) $(COMMON_LIBS) ../apps_controller/libico_syc-apc.a ../ico-app-framework/.libs/libico-app-fw-efl.so ../ico-app-framework/.libs/libico-app-fw.so $(AUL_LIBS)
+HomeScreen_LDADD = $(EFL_LIBS) $(OPT_LIBS) $(WL_LIBS) $(COMMON_LIBS) ../apps_controller/libico_syc-apc.a ../ico-app-framework/.libs/libico-app-fw-efl.so ../ico-app-framework/.libs/libico-app-fw.so 
 
 OnScreen_SOURCES = \
        on_screen.c             \
@@ -25,15 +25,15 @@ OnScreen_SOURCES = \
        home_screen_sound.c             \
        resource_conf.c
 OnScreen_CFLAGS = -I../include $(EFL_CFLAGS) $(OPT_CFLAGS) $(WL_CFLAGS) $(AUL_CFLAGS)
-OnScreen_LDADD = $(EFL_LIBS) $(OPT_LIBS) $(WL_LIBS) $(COMMON_LIBS) ../apps_controller/libico_syc-apc.a ../ico-app-framework/.libs/libico-app-fw-efl.so ../ico-app-framework/.libs/libico-app-fw.so $(AUL_LIBS)
+OnScreen_LDADD = $(EFL_LIBS) $(OPT_LIBS) $(WL_LIBS) $(COMMON_LIBS) ../apps_controller/libico_syc-apc.a ../ico-app-framework/.libs/libico-app-fw-efl.so ../ico-app-framework/.libs/libico-app-fw.so
 
 StatusBar_SOURCES = \
        status_bar.c    \
        home_screen_conf.c      \
        home_screen_sound.c             \
        resource_conf.c
-StatusBar_CFLAGS = -I../include $(EFL_CFLAGS) $(OPT_CFLAGS) $(WL_CFLAGS) $(AUL_CFLAGS)
-StatusBar_LDADD = $(EFL_LIBS) $(OPT_LIBS) $(WL_LIBS) $(COMMON_LIBS) ../apps_controller/libico_syc-apc.a ../ico-app-framework/.libs/libico-app-fw-efl.so ../ico-app-framework/.libs/libico-app-fw.so $(AUL_LIBS)
+StatusBar_CFLAGS = -I../include $(EFL_CFLAGS) $(OPT_CFLAGS) $(WL_CFLAGS) $(AUL_CFLAGS) 
+StatusBar_LDADD = $(EFL_LIBS) $(OPT_LIBS) $(WL_LIBS) $(COMMON_LIBS) ../apps_controller/libico_syc-apc.a ../ico-app-framework/.libs/libico-app-fw-efl.so ../ico-app-framework/.libs/libico-app-fw.so
 
 SUFFIXES = .edc .edj
 
index 11d932b..2ed2ac8 100644 (file)
@@ -136,35 +136,35 @@ static int hs_lib_callback_app(struct libwebsocket_context *context,
 /*============================================================================*/
 /* table                                                                      */
 /*============================================================================*/
-static struct libwebsocket_protocols protocols[] = { 
+static struct libwebsocket_protocols protocols[] = {
     {
-        "http-only", 
-        hs_lib_callback_http, 
+        "http-only",
+        hs_lib_callback_http,
         0
-    }, 
+    },
     { /* HomeScreen - command */
-        ICO_HS_PROTOCOL_CM, 
-        hs_lib_callback_command, 
+        ICO_HS_PROTOCOL_CM,
+        hs_lib_callback_command,
         0
-    }, 
+    },
     { /* HomeScreen - StatusBar */
-        ICO_HS_PROTOCOL_SB, 
-        hs_lib_callback_statusbar, 
+        ICO_HS_PROTOCOL_SB,
+        hs_lib_callback_statusbar,
         0
-    }, 
+    },
     { /* HomeScreen - OnScreen */
-        ICO_HS_PROTOCOL_OS, 
-        hs_lib_callback_onscreen, 
+        ICO_HS_PROTOCOL_OS,
+        hs_lib_callback_onscreen,
         0
-    }, 
+    },
     { /* HomeScreen - OtherNatiiveApps */
-        ICO_HS_PROTOCOL_APP, 
-        hs_lib_callback_app, 
+        ICO_HS_PROTOCOL_APP,
+        hs_lib_callback_app,
         0
-    }, 
+    },
     {
-        NULL, 
-        NULL, 
+        NULL,
+        NULL,
         0
     }
 };
@@ -175,7 +175,7 @@ static struct libwebsocket_protocols protocols[] = {
 /*--------------------------------------------------------------------------*/
 /**
  * @brief   hs_lib_handle_command
- *          callback at received message from external command tools, 
+ *          callback at received message from external command tools,
  *          and handle the message.
  *
  * @param[in]   msg                 received message
@@ -247,7 +247,7 @@ hs_lib_handle_command(hs_lib_msg_t *msg)
 /*--------------------------------------------------------------------------*/
 /**
  * @brief   hs_lib_handle_application
- *          callback at received message from a application, and handle the 
+ *          callback at received message from a application, and handle the
  *          message.
  *
  * @param[in]   msg                 received message
@@ -300,7 +300,7 @@ hs_lib_handle_application(hs_lib_msg_t *msg)
 /*--------------------------------------------------------------------------*/
 /**
  * @brief   hs_lib_handle_onscreen
- *          callback at received message from onscreen, and handle the 
+ *          callback at received message from onscreen, and handle the
  *          message.
  *
  * @param[in]   msg                 received message
@@ -375,7 +375,7 @@ hs_lib_handle_onscreen(hs_lib_msg_t *msg)
             /* do nothing */
         }
         else if (strcmp(hs_active_onscreen, ICO_UXF_PROC_DEFAULT_HOMESCREEN)
-                == 0) {
+                 == 0)  {
             /* get 2nd phrase */
             ptr = get_parsed_str(p_msg_data, tmp_buf, sizeof(tmp_buf), 1);
             if (strncmp(getFileName(ptr, strlen(ptr)),
@@ -436,6 +436,11 @@ hs_lib_handle_onscreen(hs_lib_msg_t *msg)
                         memset(hs_active_onscreen, 0,
                                sizeof(hs_active_onscreen));
                     }
+                    else {
+                        hs_hide_onscreen();
+                        memset(hs_active_onscreen, 0,
+                               sizeof(hs_active_onscreen));
+                    }
                 }
             }
             else if (strncmp(getFileName(ptr, strlen(ptr)),
@@ -500,7 +505,7 @@ hs_lib_handle_onscreen(hs_lib_msg_t *msg)
 /*--------------------------------------------------------------------------*/
 /**
  * @brief   hs_lib_handle_statusbar
- *          callback at received message from statusbar, and handle the 
+ *          callback at received message from statusbar, and handle the
  *          message.
  *
  * @param[in]   msg                 received message
@@ -510,10 +515,94 @@ hs_lib_handle_onscreen(hs_lib_msg_t *msg)
 static void
 hs_lib_handle_statusbar(hs_lib_msg_t *msg)
 {
-    uifw_trace("hs_lib_handle_statusbar: Enter");
-    /* clicked escutcheon button and send a command to outer commander */
+    hs_lib_msg_t *send;
+    char tmp_buf[ICO_HS_MSG_SIZE];
+    char *cmd;
+    Ico_Uxf_ProcessWin wins[1];
+    Ico_Uxf_ProcessAttr attr;
+    int ret;
+    int idx;
+    int cnt = 0;
+
+    uifw_trace("hs_lib_handle_statusbar: Enter(%s)", msg->data);
+
     if (strncmp("CLICK ESCUTCHEON", msg->data, 16) == 0) {
+        /* clicked escutcheon button and send a command to outer commander */
         hs_click_escutcheon();
+        /* send "Receive OK" message to statusbar */
+        send = hs_lib_alloc_msg("RECEIVE OK", strlen("RECEIVE OK"));
+        if (send) {
+            send->type = ICO_HS_PROTOCOL_TYPE_SB;
+            hs_lib_put_sendmsg(send);
+        }
+    }
+    else if (strncmp("OPEN", msg->data, 4) == 0) {
+        /* forward the message to onscreen */
+        if (hs_click_applist()) {
+            send = hs_lib_alloc_msg(msg->data, msg->len);
+            if (send) {
+                strncpy(hs_active_onscreen, ICO_UXF_PROC_DEFAULT_HOMESCREEN,
+                        sizeof(hs_active_onscreen));
+                send->type = ICO_HS_PROTOCOL_TYPE_OS;
+                hs_lib_put_sendmsg(send);
+            }
+        }
+        /* send "Receive OK" message to statusbar */
+        send = hs_lib_alloc_msg("RECEIVE OK", strlen("RECEIVE OK"));
+        if (send) {
+            send->type = ICO_HS_PROTOCOL_TYPE_SB;
+            hs_lib_put_sendmsg(send);
+        }
+    }
+    else if (strncmp("SHOW", msg->data, 4) == 0) {
+        /* show the application on the application screen */
+        cmd = get_parsed_str(msg->data, tmp_buf, sizeof(tmp_buf), 1);
+        if (cmd) {
+            /* wait for creating the application's window */
+            memset(wins, 0, sizeof(wins));
+            while (wins[0].window <= 0) {
+                ret = ico_uxf_process_window_get(cmd, wins, 1);
+                if (ret > 0) {
+                    ret = ico_uxf_process_attribute_get(cmd, &attr);
+                    if (wins[0].window > 0) {
+                        break;
+                    }
+                    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 {
+                    /* unknown application */
+                    break;
+                }
+                usleep(10000);
+                ecore_main_loop_iterate();
+
+                if (cnt > 100) {
+                    break;
+                }
+                else {
+                    cnt++;
+                }
+            }
+
+            /* show the application screen*/
+            hs_show_appscreen(cmd);
+        }
+        /* send "Receive OK" message to statusbar */
+        send = hs_lib_alloc_msg("RECEIVE OK", strlen("RECEIVE OK"));
+        if (send) {
+            send->type = ICO_HS_PROTOCOL_TYPE_SB;
+            hs_lib_put_sendmsg(send);
+        }
     }
     uifw_trace("hs_lib_handle_statusbar: Leave");
 }
@@ -523,7 +612,7 @@ hs_lib_handle_statusbar(hs_lib_msg_t *msg)
  * @brief   hs_lib_alloc_msg
  *          Allocate a msg structure
  *
- * @param[in]   data                data 
+ * @param[in]   data                data
  * @param[in]   len                 data length
  * @return      address
  * @retval      > 0                 success
@@ -560,9 +649,9 @@ hs_lib_alloc_msg(char *data, int len)
 /*--------------------------------------------------------------------------*/
 /**
  * @brief   hs_lib_free_msg
- *          free the msg 
+ *          free the msg
  *
- * @param[in]   data                data 
+ * @param[in]   data                data
  * @param[in]   free                data lenght
  * @return      none
  */
@@ -589,7 +678,7 @@ hs_lib_free_msg(hs_lib_msg_t *msg)
 /*--------------------------------------------------------------------------*/
 /**
  * @brief   hs_lib_free_handle
- *          free the indecated handle. 
+ *          free the indecated handle.
  *
  * @param       handle              handle to free
  * @return      none
@@ -624,7 +713,7 @@ hs_lib_free_handle(hs_lib_handle_t *handle)
 /*--------------------------------------------------------------------------*/
 /**
  * @brief   hs_lib_alloc_handle
- *          Allocate handle. 
+ *          Allocate handle.
  *
  * @param       none
  * @return      address
@@ -676,7 +765,7 @@ hs_lib_realsend(hs_lib_msg_t *msg)
 
     strcpy((char*)pt, msg->data);
 
-    uifw_trace("hs_lib_realsend: send(wsi=%x, type=h:%d(m:%d), len=%d, msg=%s)", 
+    uifw_trace("hs_lib_realsend: send(wsi=%x, type=h:%d(m:%d), len=%d, msg=%s)",
                msg->handle->wsi, msg->handle->type, msg->type, msg->len, msg->data);
     n = libwebsocket_write(msg->handle->wsi, pt, strlen((char *)pt),
                            LWS_WRITE_TEXT);
@@ -738,7 +827,7 @@ hs_lib_get_sendmsg(int type)
  * @brief   hs_lib_put_sendmsg
  *          put the send message to the send queue end.
  *
- * @param[in]   data                send message 
+ * @param[in]   data                send message
  * @return      result
  * @retval      ICO_HS_OK           success
  * @retval      ICO_HS_ERR          error
@@ -798,7 +887,7 @@ hs_lib_put_sendmsg(hs_lib_msg_t *send)
  * @brief   hs_lib_get_recvmsg
  *          get the receive message from the receive queue end.
  *
- * @param       none                
+ * @param       none
  * @return      recv message address
  * @retval      > 0                 success
  * @retval      NULL                error
@@ -823,7 +912,7 @@ hs_lib_get_recvmsg(void)
  * @brief   hs_lib_put_recvmsg
  *          put the receive message to the receive queue end.
  *
- * @param[in]   data                receive message 
+ * @param[in]   data                receive message
  * @return      none
  */
 /*--------------------------------------------------------------------------*/
@@ -852,7 +941,7 @@ hs_lib_put_recvmsg(hs_lib_msg_t *recv)
  * @brief   hs_lib_com_dispatch
  *          The accumulated data that transmitted or received is procecssed
  *
- * @param[in]   _handle             connect handle, 
+ * @param[in]   _handle             connect handle,
  *                                  if NULL target is all connection
  * @param[in]   timeoutms           maximum wait time on miri-sec.
  *                                  0 is no wait, -1 is wait forever.
@@ -939,7 +1028,7 @@ hs_lib_poll_fd_event(hs_lib_poll_t *poll, int flags)
 /*--------------------------------------------------------------------------*/
 /**
  * @brief   hs_lib_ecore_fdevent
- *          callback function called by Ecore when the websocket's file 
+ *          callback function called by Ecore when the websocket's file
  *          descriptor had change
  *
  * @param[in]   data                user data(ico_apf_com_poll_t)
@@ -1343,7 +1432,7 @@ hs_lib_callback_http(struct libwebsocket_context *context,
 /*--------------------------------------------------------------------------*/
 /*
  * @brief   hs_lib_callback_command
- *          this callback function is notified from libwebsockets 
+ *          this callback function is notified from libwebsockets
  *          command protocol
  *
  * @param[in]   context             libwebsockets context
@@ -1471,7 +1560,7 @@ hs_lib_callback_command(struct libwebsocket_context *context,
 /*--------------------------------------------------------------------------*/
 /*
  * @brief   hs_lib_callback_statusbar
- *          this callback function is notified from libwebsockets 
+ *          this callback function is notified from libwebsockets
  *          statusbar protocol
  *
  * @param[in]   context             libwebsockets context
@@ -1588,7 +1677,7 @@ hs_lib_callback_statusbar(struct libwebsocket_context *context,
 /*--------------------------------------------------------------------------*/
 /*
  * @brief   hs_lib_callback_onscreen
- *          this callback function is notified from libwebsockets 
+ *          this callback function is notified from libwebsockets
  *          statusbar protocol
  *
  * @param[in]   context             libwebsockets context
@@ -1707,7 +1796,7 @@ hs_lib_callback_onscreen(struct libwebsocket_context *context,
 /*--------------------------------------------------------------------------*/
 /*
  * @brief   hs_lib_callback_app
- *          this callback function is notified from libwebsockets 
+ *          this callback function is notified from libwebsockets
  *          application protocol
  *
  * @param[in]   context             libwebsockets context
index 436c5ae..d66b17d 100644 (file)
 #include <pthread.h>
 #include <libwebsockets.h>
 
+#include "ico_apf.h"
 #include "ico_uxf.h"
 #include "ico_uxf_conf.h"
+#include "ico_syc_apc.h"
+#include "ico_uxf_conf_ecore.h"
 
-#include "ico_apf_log.h"
 #include "home_screen_lib.h"
 #include "home_screen_res.h"
 #include "home_screen_conf.h"
 #include "home_screen_parser.h"
-#include "ico_uxf_conf_common.h"
-#include "ico_syc_apc.h"
 
 /*============================================================================*/
 /* definition                                                                 */
@@ -57,6 +57,7 @@ struct _hs_tile_info {
 };
 
 #define HS_DISPLAY_HOMESCREEN   0           /* HomeScreen target display Id     */
+#define NUM_ONSCREEN_WINDOWS    10          /* max number of windows in OnScreen*/
 
 #define HS_LAYER_BACKGROUND     0           /* layer of BackGround              */
 #define HS_LAYER_HOMESCREEN     1           /* layer of HomeScreen menu         */
@@ -70,6 +71,7 @@ struct _hs_tile_info {
 /* static(internal) functions prototype                                       */
 /*============================================================================*/
 static int hs_is_special_app(const char *appid);
+static int hs_is_noicon_app(const char *appid);
 static void hs_set_invisible_all(void);
 static void hs_set_appscreen(const char *appid);
 static void hs_tile_start_apps(void);
@@ -83,15 +85,18 @@ static void hs_sound_control(const Ico_Uxf_conf_application *conf, const int adj
 static void hs_input_control(const Ico_Uxf_conf_application *conf, const int inputsw);
 static void *hs_create_window(int type);
 static void hs_touch_up_api_list(void *data, Evas *evas, Evas_Object *obj,
-                             void *event_info);
+                                 void *event_info);
 static void hs_touch_down_api_list(void *data, Evas *evas, Evas_Object *obj,
-                       void *event_info);
+                                   void *event_info);
 static Eina_Bool hs_ecore_timer_event(void *data);
 static void hs_touch_up_tile(void *data, Evas *evas, Evas_Object *obj, void *event_info);
 static void hs_touch_down_tile(void *data, Evas *evas, Evas_Object *obj, void *event_info);
 static void hs_add_touch_listener(Evas *canvas_fg);
 static void hs_add_bg_image(Evas *canvas_bg);
 static void hs_terminate_all_app(void);
+static void hs_regulation_listener(const int appcategory,
+                                   const ico_apc_reguration_control_t control,
+                                   void *user_data);
 
 /*============================================================================*/
 /* variables and tables                                                       */
@@ -107,6 +112,9 @@ static char gStatusbarName[ICO_UXF_MAX_PROCESS_NAME + 1];
 static char gOnscreenName[ICO_UXF_MAX_PROCESS_NAME + 1];
 static hs_tile_info_t *hs_tile_info;
 static int hs_tile_cnt = 0;
+static int hs_notile_cnt = 0;
+static int hs_regulation_category = 0;
+static int hs_regulation_visible = 1;
 
 /*============================================================================*/
 /* functions                                                                  */
@@ -180,12 +188,18 @@ hs_uxf_event(int ev, Ico_Uxf_EventDetail dd, int arg)
             else {
                 /* other normal application */
                 if (hs_is_special_app(winAttr.process) == FALSE) {
-                    if (hs_stat_touch == ICO_HS_TOUCH_IN_SHOW) {
+                    if (hs_is_noicon_app(winAttr.process) != FALSE) {
+                        hs_set_appscreen(winAttr.process);
+                        if (hs_stat_touch == ICO_HS_TOUCH_IN_SHOW) {
+                            hs_tile_show_screen();
+                        }
+                    }
+                    else if (hs_stat_touch == ICO_HS_TOUCH_IN_SHOW) {
                         /* set layer of Application in HomeScreen menu  */
                         ico_uxf_window_layer(dd.window.window, HS_LAYER_HOMESCREEN);
                         hs_tile_show_screen();
                     }
-                    if (hs_stat_touch == ICO_HS_TOUCH_IN_HIDE) {
+                    else if (hs_stat_touch == ICO_HS_TOUCH_IN_HIDE) {
                         hs_set_appscreen(winAttr.process);
                     }
                 }
@@ -342,6 +356,8 @@ hs_set_appscreen(const char *appid)
     int ret;
     Ico_Uxf_ProcessWin window;
     const Ico_Uxf_conf_application *appConf;
+    const Ico_Uxf_Sys_Config       *sysConf;
+    Ico_Uxf_conf_display_zone      *zone;
 
     idx = hs_get_index_appscreendata(appid);
 
@@ -352,27 +368,10 @@ hs_set_appscreen(const char *appid)
     /* visible raise */
     ret = ico_uxf_process_window_get(hs_app_screen_window[idx].appid, &window, 1);
     if ((ret > 0) || (ret == ICO_UXF_E2BIG))    {
-        uifw_trace(
-                   "hs_set_appscreen: app[%d]:visible=%d raise=%d %dx%d(%d,%d)",
-                   idx, hs_app_screen_window[idx].visible,
-                   hs_app_screen_window[idx].raise,
-                   hs_app_screen_window[idx].resize_w,
-                   hs_app_screen_window[idx].resize_h,
-                   hs_app_screen_window[idx].move_x,
-                   hs_app_screen_window[idx].move_y);
-#if 0
-#if 1   /* 05/15 TEST TEST TEST */
-        if ((hs_app_screen_window[idx].move_x < 0) &&
-            (hs_app_screen_window[idx].move_y < 0)) {
-            hs_app_screen_window[idx].visible = 1;
-            hs_app_screen_window[idx].raise = 1;
-            hs_app_screen_window[idx].resize_w = 1920;
-            hs_app_screen_window[idx].resize_h = 1016;
-            hs_app_screen_window[idx].move_x = 0;
-            hs_app_screen_window[idx].move_y = 64;
-        }
-#endif
-#endif
+        uifw_trace("hs_set_appscreen: app[%d]:visible=%d raise=%d %dx%d(%d,%d)",
+                   idx, hs_app_screen_window[idx].visible, hs_app_screen_window[idx].raise,
+                   hs_app_screen_window[idx].resize_w, hs_app_screen_window[idx].resize_h,
+                   hs_app_screen_window[idx].move_x, hs_app_screen_window[idx].move_y);
         /* move application window to application layer */
         appConf = ico_uxf_getAppByAppid(hs_app_screen_window[idx].appid);
         if (! appConf)  {
@@ -384,6 +383,23 @@ hs_set_appscreen(const char *appid)
             ico_uxf_window_layer(window.window, appConf->display[0].layerId);
             /* show application layer                       */
             ico_uxf_layer_visible(HS_DISPLAY_HOMESCREEN, appConf->display[0].layerId, 1);
+
+            if ((hs_app_screen_window[idx].resize_w <= 0) &&
+                (hs_app_screen_window[idx].resize_h <= 0) &&
+                (hs_app_screen_window[idx].move_x <= 0) &&
+                (hs_app_screen_window[idx].move_y <= 0))    {
+                /* not set size and position, set default(zone size)    */
+                sysConf = ico_uxf_getSysConfig();
+                zone = (Ico_Uxf_conf_display_zone *)&sysConf->
+                           display[appConf->display[0].displayId].
+                               zone[appConf->display[0].zoneId];
+                hs_app_screen_window[idx].resize_w = zone->width;
+                hs_app_screen_window[idx].resize_h = zone->height;
+                hs_app_screen_window[idx].move_x = zone->x;
+                hs_app_screen_window[idx].move_y = zone->y;
+                hs_app_screen_window[idx].visible = 1;
+                hs_app_screen_window[idx].raise = 1;
+            }
         }
         ico_uxf_window_move(window.window, hs_app_screen_window[idx].move_x,
                             hs_app_screen_window[idx].move_y);
@@ -480,8 +496,7 @@ hs_show_appscreen(const char *appid)
                 uifw_trace("hs_show_appscreen: move %d=%dx%d(%d,%d)", ii,
                            hs_app_screen_window[ii].resize_w,
                            hs_app_screen_window[ii].resize_h,
-                           hs_app_screen_window[ii].move_x,
-                           hs_app_screen_window[ii].move_y);
+                           hs_app_screen_window[ii].move_x, hs_app_screen_window[ii].move_y);
                 /* move application window to application layer */
                 ico_uxf_window_resize(window.window,
                                       hs_app_screen_window[ii].resize_w,
@@ -506,6 +521,10 @@ hs_show_appscreen(const char *appid)
     }
     /* hide HomeScreen layer menu                   */
     ico_uxf_layer_visible(HS_DISPLAY_HOMESCREEN, HS_LAYER_HOMESCREEN, 0);
+    /* hide Touch layer                             */
+    ico_uxf_layer_visible(HS_DISPLAY_HOMESCREEN, HS_LAYER_TOUCH, 0);
+    /* hide OnScreen windows                        */
+    hs_hide_onscreen();
 
     /* show own apps */
     if (appid != NULL) {
@@ -584,7 +603,6 @@ hs_show_appscreen(const char *appid)
             ico_uxf_layer_visible(HS_DISPLAY_HOMESCREEN, HS_LAYER_HOMESCREEN, 0);
         }
     }
-
     hs_stat_touch = ICO_HS_TOUCH_IN_HIDE;
     ico_uxf_main_loop_iterate();
 
@@ -606,25 +624,49 @@ hs_tile_start_apps(void)
 {
     char cName[ICO_UXF_MAX_PROCESS_NAME + 1];
     int idx, ret;
+    int idx1, idx2;
     const char *appName;
+    const Ico_Uxf_App_Config *appConf;
     hs_tile_info_t *tinfo;
 
-    /* excute */
+    /* excute applications in tile menu */
     for (idx = 0; idx < hs_tile_cnt; idx++) {
         tinfo = &hs_tile_info[idx];
-        if (tinfo->valid == 0)
-            continue; sprintf(cName, ICO_HS_CONFIG_TILE_APP"%d", idx);
+        if (tinfo->valid == 0) continue;
+        sprintf(cName, ICO_HS_CONFIG_TILE_APP"%d", idx);
         appName = hs_conf_get_string(ICO_HS_CONFIG_HOMESCREEN, cName, NULL);
         if ((appName != NULL) && (strcmp(appName, "none") != 0)) {
             ret = ico_uxf_process_execute(appName);
             if (ret >= 0) {
-                uifw_trace("hs_tile_start_apps: execute tile[%d]=%s", idx,
-                           appName);
+                uifw_trace("hs_tile_start_apps: execute tile[%d]=%s", idx, appName);
                 memset(tinfo->appid, 0, ICO_UXF_MAX_PROCESS_NAME + 1);
                 strncpy(tinfo->appid, appName, ICO_UXF_MAX_PROCESS_NAME);
             }
         }
     }
+
+    /* excute no menu applications      */
+    appConf = ico_uxf_getAppConfig();
+    idx = hs_tile_cnt;
+    for (idx1 = 0; idx1 < appConf->applicationNum; idx1++)  {
+        if (appConf->application[idx1].autostart == 0)  continue;
+        for (idx2 = 0; idx2 < hs_tile_cnt; idx2++)  {
+            if (! strcmp(hs_tile_info[idx2].appid, appConf->application[idx1].appid)) break;
+        }
+        if (idx2 >= hs_tile_cnt)    {
+            ret = ico_uxf_process_execute(appConf->application[idx1].appid);
+            if (ret >= 0) {
+                uifw_trace("hs_tile_start_apps: execute no tile[%d]=%s",
+                           idx, appConf->application[idx1].appid);
+                memset(hs_tile_info[idx].appid, 0, ICO_UXF_MAX_PROCESS_NAME + 1);
+                strncpy(hs_tile_info[idx].appid,
+                        appConf->application[idx1].appid, ICO_UXF_MAX_PROCESS_NAME);
+                idx ++;
+                if ((idx - hs_tile_cnt) >= ICO_HS_NOTILE_APP_MAX)   break;
+            }
+        }
+    }
+    hs_notile_cnt = idx - hs_tile_cnt;
 }
 
 /*--------------------------------------------------------------------------*/
@@ -663,9 +705,9 @@ hs_tile_init_info(void)
     tilecnt = colcnt * rowcnt;
 
     /* allocate tile info structure */
-    hs_tile_info = malloc(sizeof(hs_tile_info_t) * tilecnt);
-    valid = (int *)malloc(sizeof(int) * tilecnt);
-    type = (int *)malloc(sizeof(int) * tilecnt);
+    hs_tile_info = malloc(sizeof(hs_tile_info_t) * (tilecnt + ICO_HS_NOTILE_APP_MAX));
+    valid = (int *)malloc(sizeof(int) * (tilecnt + ICO_HS_NOTILE_APP_MAX));
+    type = (int *)malloc(sizeof(int) * (tilecnt + ICO_HS_NOTILE_APP_MAX));
     if (!hs_tile_info || !valid || !type) {
         uifw_warn("hs_tile_init_info: Leave(err malloc tile str failed)");
         return ICO_HS_ERR;
@@ -802,6 +844,11 @@ hs_tile_show_screen(void)
     int idx, sid;
     hs_tile_info_t *tinfo;
 
+    if (hs_regulation_visible == 0) {
+        uifw_trace("hs_regulation_visible: regulation, no menu display");
+        return;
+    }
+
     /* all apps invisible */
     /* hide HomeScreen layer menu                   */
     ico_uxf_layer_visible(HS_DISPLAY_HOMESCREEN, HS_LAYER_HOMESCREEN, 0);
@@ -834,10 +881,12 @@ hs_tile_show_screen(void)
     }
     /* show HomeScreen layer menu                   */
     ico_uxf_layer_visible(HS_DISPLAY_HOMESCREEN, HS_LAYER_HOMESCREEN, 1);
+    /* show Touch layer                             */
+    ico_uxf_layer_visible(HS_DISPLAY_HOMESCREEN, HS_LAYER_TOUCH, 1);
     /* hide application layer                       */
     ico_uxf_layer_visible(HS_DISPLAY_HOMESCREEN, HS_LAYER_APPLICATION, 0);
 
-    /* chnage to noraml mode for AppsControler  */
+    /* chnage to menu mode for AppsControler        */
     ico_uxf_window_control(NULL, -1, ICO_UXF_APPSCTL_TEMPVISIBLE, 1);
 
     ico_uxf_main_loop_iterate();
@@ -892,12 +941,12 @@ hs_tile_get_minchange(void)
 
     for (ii = 0; ii < hs_tile_cnt; ii++) {
         tinfo = &hs_tile_info[ii];
-        if ((tinfo->type != ICO_HS_TILE_OTHERS) && ((tinfo->change <= min)
+        if ((tinfo->type > ICO_HS_TILE_OTHERS) && ((tinfo->change <= min)
                 || (min == -1))) {
             idx = ii;
             min = tinfo->change;
         }
-        if ((tinfo->type != ICO_HS_TILE_OTHERS) && (strlen(tinfo->appid) == 0)) {
+        if ((tinfo->type > ICO_HS_TILE_OTHERS) && (strlen(tinfo->appid) == 0)) {
             return ii;
         }
     }
@@ -1044,10 +1093,6 @@ hs_show_onscreen(void)
     if ((ret > 0) || (ret == ICO_UXF_E2BIG))    {
         ico_uxf_window_layer(window.window, HS_LAYER_ONSCREEN);
     }
-
-    usleep(10000);
-
-    ico_uxf_main_loop_iterate();
 }
 
 /*--------------------------------------------------------------------------*/
@@ -1071,10 +1116,6 @@ hs_hide_onscreen(void)
         ico_uxf_window_layer(window.window, HS_LAYER_BACKGROUND);
         ico_uxf_window_lower(window.window);
     }
-
-    usleep(10000);
-
-    ico_uxf_main_loop_iterate();
 }
 
 /*--------------------------------------------------------------------------*/
@@ -1089,47 +1130,118 @@ hs_hide_onscreen(void)
 void
 hs_click_escutcheon(void)
 {
-    uifw_trace("hs_click_escutcheon: Enter");
+    uifw_trace("hs_click_escutcheon: Enter(regulation=%d)", hs_regulation_visible);
 
     if (strlen(hs_active_onscreen) > 0) {
-        uifw_trace("hs_click_escutcheon: do nothing(active=%s)", hs_active_onscreen);
+        uifw_trace("hs_click_escutcheon: Leave(active=%s)", hs_active_onscreen);
+        return;
+    }
+    if (hs_regulation_visible == 0) {
+        uifw_trace("hs_click_escutcheon: Leave(regulation)");
         return;
     }
 
     if (hs_stat_touch == ICO_HS_TOUCH_IN_SHOW) {
+        hs_snd_play(hs_snd_get_filename(ICO_HS_SND_TYPE_DEFAULT));
         uifw_trace("hs_click_escutcheon: hs_show_appscreen");
         hs_show_appscreen(NULL);
     }
     else if (hs_stat_touch == ICO_HS_TOUCH_IN_HIDE) {
+        hs_snd_play(hs_snd_get_filename(ICO_HS_SND_TYPE_DEFAULT));
         uifw_trace("hs_click_escutcheon: hs_tile_show_screen");
         hs_tile_show_screen();
     }
     uifw_trace("hs_click_escutcheon: Leave");
 }
 
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   hs_click_applist
+ *          processing when application list button is clicked.
+ *
+ * @param       none
+ * @return      regulation
+ * @retval      =0      regulation controlled(no display)
+ * @retval      =1      no regulation
+ */
+/*--------------------------------------------------------------------------*/
+int
+hs_click_applist(void)
+{
+    uifw_trace("hs_click_applist: Enter(regulation=%d)", hs_regulation_visible);
+
+    if (hs_regulation_visible == 0) {
+        uifw_trace("hs_click_applist: Leave(regulation)");
+        return 0;
+    }
+
+    /* operation sound */
+    hs_snd_play(hs_snd_get_filename(ICO_HS_SND_TYPE_DEFAULT));
+    uifw_trace("hs_click_applist: Leave");
+
+    /* show Touch layer                             */
+    ico_uxf_layer_visible(HS_DISPLAY_HOMESCREEN, HS_LAYER_TOUCH, 1);
+    /* show OnScreen windows                        */
+    hs_show_onscreen();
+
+    return 1;
+}
+
 /*--------------------------------------------------------------------------*/
 /**
  * @brief   hs_is_special_app
  *          return 1 if the application is special one(homescreen)
  *          /statusbar/onscreen).
  *
- * @param       none
- * @return      none
+ * @param[in]   appid       applicationId
+ * @return      special application
+ * @retval      1           special application(HomeScreen/StatusBar ... etc)
+ * @retval      0           normal application
  */
 /*--------------------------------------------------------------------------*/
 static int
 hs_is_special_app(const char *appid)
 {
-    uifw_trace("hs_is_special_app: Enter(%s)", appid);
     if ((strncmp(appid, hs_name_homescreen, ICO_UXF_MAX_PROCESS_NAME) == 0)
             || (strncmp(appid, gStatusbarName, ICO_UXF_MAX_PROCESS_NAME) == 0)
             || (strncmp(appid, gOnscreenName, ICO_UXF_MAX_PROCESS_NAME) == 0)
             || (strncmp(appid, ICO_HS_APPID_DEFAULT_TOUCH,
                         ICO_UXF_MAX_PROCESS_NAME) == 0)) {
-        uifw_trace("hs_is_special_app: Leave(TURE)");
+        uifw_trace("hs_is_special_app: app(%s) is special", appid);
+        return 1;
+    }
+    uifw_trace("hs_is_special_app: app(%s) is normal", appid);
+    return 0;
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   hs_is_noicon_app
+ *          return 1 if the application has no menu icon
+ *
+ * @param[in]   appid       applicationId
+ * @return      no need menu
+ * @retval      1           no need menu
+ * @retval      0           need menu
+ */
+/*--------------------------------------------------------------------------*/
+static int
+hs_is_noicon_app(const char *appid)
+{
+    const Ico_Uxf_conf_application  *appConf;
+
+    appConf = ico_uxf_getAppByAppid(appid);
+    if (! appConf)  {
+        uifw_trace("hs_is_noicon_app: appid(%s) dose not exist", appid);
+        return 0;
+    }
+
+    if (appConf->noicon)    {
+        uifw_trace("hs_is_noicon_app: appid(%s) has no icon", appid);
         return 1;
     }
-    uifw_trace("hs_is_special_app: Leave(FALSE)");
+    uifw_trace("hs_is_noicon_app: appid(%s) has icon", appid);
     return 0;
 }
 
@@ -1382,8 +1494,11 @@ hs_touch_down_tile(void *data, Evas *evas, Evas_Object *obj, void *event_info)
     tinfo->l_press = 1;
     if (strlen(tinfo->appid) != 0) {
     }
-    /* add timer to detect long push */
-    ecore_timer_add(ICO_HS_TOUCH_TIME_OUT, hs_ecore_timer_event, &tinfo->idx);
+
+    if (tinfo->type > ICO_HS_TILE_OTHERS) {
+        /* add timer to detect long push */
+        ecore_timer_add(ICO_HS_TOUCH_TIME_OUT, hs_ecore_timer_event, &tinfo->idx);
+    }
 }
 
 /*--------------------------------------------------------------------------*/
@@ -1460,7 +1575,7 @@ hs_add_touch_listener(Evas *canvas_fg)
     sprintf(img, "%s"fname_api_all_off, path);
 
     /* setup tile */
-    for (idx = 0; idx < hs_tile_cnt - 1; idx++) {
+    for (idx = 0; idx < hs_tile_cnt; idx++) {
         tinfo = &hs_tile_info[idx];
         if (tinfo->valid == 0)
             continue;
@@ -1481,15 +1596,17 @@ hs_add_touch_listener(Evas *canvas_fg)
     }
     /* application menu icon */
     tinfo = &hs_tile_info[hs_tile_cnt - 1];
-    canvas = evas_object_image_filled_add(canvas_fg);
-    evas_object_image_file_set(canvas, img, NULL);
-    evas_object_move(canvas, tinfo->coord_x, tinfo->coord_y - ICO_HS_SIZE_SB_HEIGHT);
-    evas_object_resize(canvas, tinfo->size_x, tinfo->size_y);
-    evas_object_event_callback_add(canvas, EVAS_CALLBACK_MOUSE_UP,
-                                   hs_touch_up_api_list, &tinfo->idx);
-    evas_object_event_callback_add(canvas, EVAS_CALLBACK_MOUSE_DOWN,
-                                   hs_touch_down_api_list, &tinfo->idx);
-    evas_object_show(canvas);
+    if ((tinfo->valid == 0) && (tinfo->type == ICO_HS_TILE_APPLIST)) {
+        canvas = evas_object_image_filled_add(canvas_fg);
+        evas_object_image_file_set(canvas, img, NULL);
+        evas_object_move(canvas, tinfo->coord_x, tinfo->coord_y - ICO_HS_SIZE_SB_HEIGHT);
+        evas_object_resize(canvas, tinfo->size_x, tinfo->size_y);
+        evas_object_event_callback_add(canvas, EVAS_CALLBACK_MOUSE_UP,
+                                       hs_touch_up_api_list, &tinfo->idx);
+        evas_object_event_callback_add(canvas, EVAS_CALLBACK_MOUSE_DOWN,
+                                       hs_touch_down_api_list, &tinfo->idx);
+        evas_object_show(canvas);
+    }
 }
 
 /*--------------------------------------------------------------------------*/
@@ -1636,6 +1753,45 @@ hs_input_control(const Ico_Uxf_conf_application *conf, const int inputsw)
 
 /*--------------------------------------------------------------------------*/
 /**
+ * @brief   hs_regulation_listener: change regulation callback(static function)
+ *
+ * @param[in]   appcategory     category Id
+ * @param[in]   control         control(display/sound/input active/inactive)
+ * @param[in]   user_data       user data(unused)
+ * @return      none
+ */
+/*--------------------------------------------------------------------------*/
+static void
+hs_regulation_listener(const int appcategory,
+                       const ico_apc_reguration_control_t control, void *user_data)
+{
+    if ((appcategory == hs_regulation_category) &&
+        (control.display != ICO_SYC_APC_REGULATION_NOCHANGE))   {
+        uifw_trace("hs_regulation_listener: Enter(category=%d disp=%d)",
+                   appcategory, control.display);
+
+        if (control.display == ICO_SYC_APC_REGULATION_REGULATION)   {
+            /* Invisible by reguration      */
+            if (hs_regulation_visible)  {
+                hs_regulation_visible = 0;
+                if (hs_stat_touch == ICO_HS_TOUCH_IN_SHOW) {
+                    uifw_trace("hs_regulation_listener: Change to App screen");
+                    hs_show_appscreen(NULL);
+                }
+                hs_hide_onscreen();
+                       memset(hs_active_onscreen, 0, sizeof(hs_active_onscreen));
+            }
+        }
+        else    {
+            /* Visible                      */
+            uifw_trace("hs_regulation_listener: Change to ALl screen");
+            hs_regulation_visible = 1;
+        }
+    }
+}
+
+/*--------------------------------------------------------------------------*/
+/**
  * @brief   main
  *          homescreen main. initialize UXF, app manager, and ecore.
  *
@@ -1742,6 +1898,22 @@ main(int argc, char *argv[])
     /* HomeScreen Menu(touch) */
     hs_create_window(ICO_HS_WINDOW_TYPE_TOUCH);
 
+    /* initiailze regulation control    */
+    hs_regulation_category = ico_uxf_getSysCategoryByName("CarSetting");
+    ico_syc_apc_regulation_listener(hs_regulation_listener, NULL);
+
+    if (hs_regulation_visible)  {
+        uifw_trace("main: no regulation");
+        hs_tile_show_screen();
+    }
+    else    {
+        uifw_trace("main: regulation");
+        hs_show_appscreen(NULL);
+    }
+
+    /* add callback to app configuration */
+    ico_uxf_econf_setAppUpdateCb(NULL);
+
     /* wait events */
     ecore_main_loop_begin();
 
index 8c65d4a..07a0573 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "ico_uxf.h"
 #include "ico_uxf_conf.h"
+#include "ico_uxf_conf_ecore.h"
 
 #include "home_screen.h"
 #include "home_screen_res.h"
@@ -72,14 +73,16 @@ static int ons_callback_onscreen(
 static void ons_create_context(void);
 static Eina_Bool ons_ecore_event(void *data);
 static void ons_on_destroy(Ecore_Evas *ee);
-static void ons_touch_up_edje(void *data, Evas *evas, 
+static void ons_touch_up_edje(void *data, Evas *evas,
                               Evas_Object *obj, void *event_info);
-static void ons_touch_up_next(void *data, Evas *evas, Evas_Object *obj, 
+static void ons_touch_up_next(void *data, Evas *evas, Evas_Object *obj,
                               void *event_info);
 static const char *ons_get_fname(const char *filepath);
 static int ons_get_appindex(int idx);
 static void ons_set_appicon(Evas *evas, Evas_Object *edje, Evas_Object* part,
                             const char *partname);
+static void ons_load_config(void);
+static void ons_config_event(const char *appid, int type);
 
 /*============================================================================*/
 /* variabe & table                                                            */
@@ -89,7 +92,6 @@ static int ons_ws_connected = 0;
 static struct libwebsocket_context *ons_ws_context = NULL;
 static struct libwebsocket *ons_wsi_mirror = NULL;
 static char ons_edje_str[ICO_ONS_BUF_SIZE];
-static char ons_respath[ICO_ONS_BUF_SIZE];
 
 static Ecore_Evas *ons_window; /* ecore-evas object */
 static Evas *ons_evas = NULL; /* evas object */
@@ -104,21 +106,21 @@ static ons_msg_t *ons_send_msg = NULL;
 
 static int ons_command_wait = ICO_ONS_NO_WAIT;
 
-static struct libwebsocket_protocols ws_protocols[] = { 
+static struct libwebsocket_protocols ws_protocols[] = {
     {
-        "http-only", 
-        ons_callback_http, 
+        "http-only",
+        ons_callback_http,
         0
-    }, 
+    },
     {
-        "onscreen-protocol", 
-        ons_callback_onscreen, 
-        0, 
-    }, 
+        "onscreen-protocol",
+        ons_callback_onscreen,
+        0,
+    },
     {
         /* end of list */
-        NULL, 
-        NULL, 
+        NULL,
+        NULL,
         0
     }
 };
@@ -148,7 +150,7 @@ ons_event_message(char *format, ...)
     va_end(list);
 
     uifw_trace("OnScreen: ons_event_message %s", message);
-    
+
     send = ons_alloc_seendmsg(message, strlen(message));
     if (!send) {
         uifw_warn("ons_event_message: ERROR(allocate send msg)");
@@ -190,7 +192,7 @@ ons_get_sendmsg(void)
  * @brief   ons_put_sendmsg
  *          put the send message to the send queue end.
  *
- * @param[in]   data                send message 
+ * @param[in]   data                send message
  * @return      result
  * @retval      ICO_HS_OK           success
  * @retval      ICO_HS_ERR          error
@@ -237,7 +239,7 @@ ons_put_sendmsg(ons_msg_t *send)
  * @brief   ons_alloc_seendmsg
  *          Allocate a send message buffer.
  *
- * @param[in]   data                data 
+ * @param[in]   data                data
  * @param[in]   len                 data length
  * @return      address
  * @retval      > 0                 success
@@ -316,7 +318,7 @@ ons_callback_http(struct libwebsocket_context *context, struct libwebsocket *wsi
 /*--------------------------------------------------------------------------*/
 /*
  * @brief   ons_callback_onscreen
- *          this callback function is notified from libwebsockets 
+ *          this callback function is notified from libwebsockets
  *          onscreen protocol
  *
  * @param[in]   context             libwebsockets context
@@ -808,6 +810,80 @@ ons_loadinons_edje_file(const char *edje_file)
 }
 
 /*--------------------------------------------------------------------------*/
+/**
+ * @brief   ons_load_config
+ *          load/reload configuration.
+ *
+ * @param       none
+ * @return      none
+ */
+/*--------------------------------------------------------------------------*/
+static void
+ons_load_config(void)
+{
+    Ico_Uxf_App_Config *appconf;
+    int appcnt;
+    int appidx, idx, cnt;
+
+    uifw_trace("ons_load_config: Enter");
+
+    appconf = (Ico_Uxf_App_Config *)ico_uxf_getAppConfig();
+    appcnt = appconf->applicationNum;
+    for (appidx = 0; appidx < appconf->applicationNum; appidx++) {
+        if ((appconf->application[appidx].noicon) ||
+            (strcmp(appconf->application[appidx].type, ICO_HS_GROUP_SPECIAL) == 0)) {
+            appcnt--;
+            uifw_trace("ons_load_config: No Need appid=%s noicon=%d type=%s",
+                       appconf->application[appidx].appid,
+                       appconf->application[appidx].noicon,
+                       appconf->application[appidx].type);
+        }
+    }
+    cnt = 0;
+    for (idx = 0; idx < appcnt; idx++) {
+        appidx = ons_get_appindex(idx);
+        if (appidx > 0) {
+            uifw_trace("ons_load_config: appid=%s seat=%d idx=%d seatcnt=%d",
+                       appconf->application[appidx].appid, cnt
+                               / ICO_ONS_APPLI_NUM, idx - ICO_ONS_APPLI_NUM
+                               * (cnt / ICO_ONS_APPLI_NUM), ((appcnt - 1)
+                               / ICO_ONS_APPLI_NUM) + 1);
+            cnt++;
+        }
+    }
+
+    ons_app_cnt = appcnt;
+    ons_applist_idx = 0;
+
+    uifw_trace("ons_load_config: Leave(appcnt=%d)", appcnt);
+
+    return;
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   ons_config_event
+ *          This is a callback function called when the configurations
+ *          is updata.
+ *
+ * @param[in]   appid               application id
+ * @param[in]   type                event type(install/uninstall)
+ * @return      none
+ */
+/*--------------------------------------------------------------------------*/
+static void
+ons_config_event(const char *appid, int type)
+{
+    uifw_trace("ons_config_event: Enter(appid=%s, type=%d)", appid, type);
+
+    ons_load_config();
+
+    uifw_trace("ons_config_event: Leave");
+
+    return;
+}
+
+/*--------------------------------------------------------------------------*/
 /*
  * @brief   onscreen application
  *          main routine
@@ -822,8 +898,6 @@ int
 main(int argc, char *argv[])
 {
     int width, height;
-    Ico_Uxf_App_Config *appconf;
-    int appidx, idx, cnt;
     int orientation = ICO_ONS_HORIZONTAL;
     int ii;
     int ret;
@@ -861,34 +935,9 @@ main(int argc, char *argv[])
                                           ICO_HS_CONFIG_ORIENTAION,
                                           orientation);
     }
+    ons_load_config();
     hs_snd_init();
 
-    hs_get_image_path(ons_respath, ICO_ONS_BUF_SIZE);
-    appconf = (Ico_Uxf_App_Config *)ico_uxf_getAppConfig();
-    ons_app_cnt = appconf->applicationNum;
-    for (appidx = 0; appidx < appconf->applicationNum; appidx++) {
-        if ((appconf->application[appidx].noicon) ||
-            (strcmp(appconf->application[appidx].type, ICO_HS_GROUP_SPECIAL) == 0)) {
-            ons_app_cnt--;
-            uifw_trace("Application list: No Need appid=%s noicon=%d type=%s",
-                       appconf->application[appidx].appid,
-                       appconf->application[appidx].noicon,
-                       appconf->application[appidx].type);
-        }
-    }
-    cnt = 0;
-    for (idx = 0; idx < ons_app_cnt; idx++) {
-        appidx = ons_get_appindex(idx);
-        if (appidx > 0) {
-            uifw_trace("Application list: appid=%s seat=%d idx=%d seatcnt=%d",
-                       appconf->application[appidx].appid, cnt
-                               / ICO_ONS_APPLI_NUM, idx - ICO_ONS_APPLI_NUM
-                               * (cnt / ICO_ONS_APPLI_NUM), ((ons_app_cnt - 1)
-                               / ICO_ONS_APPLI_NUM) + 1);
-            cnt++;
-        }
-    }
-
     /* Reset a ecore_evas */
     ecore_evas_init();
 
@@ -927,6 +976,9 @@ main(int argc, char *argv[])
     ons_create_context();
     ecore_timer_add(ICO_ONS_WS_TIMEOUT, ons_ecore_event, NULL);
 
+    /* add callback to app configuration */
+    ico_uxf_econf_setAppUpdateCb(ons_config_event);
+
     /* Start main loop */
     ecore_main_loop_begin();
 
index 654b7a5..6b43eeb 100644 (file)
 #include <Ecore.h>
 #include <Ecore_Wayland.h>
 #include <Ecore_Evas.h>
-#include <Elementary.h>
 
 #include "ico_uxf.h"
 #include "ico_uxf_conf.h"
+#include "ico_uxf_conf_ecore.h"
 
 #include "home_screen.h"
 #include "home_screen_res.h"
 #define ICO_SB_POS_MIN2_X     (725)
 #define ICO_SB_POS_MIN2_Y     (18)
 
+#define ICO_SB_SIZE_SHTCT_W   (ICO_HS_SIZE_SB_HEIGHT)
+
+#define ICO_SB_POS_LIST_X     (ICO_HS_SIZE_SB_HEIGHT * 5)
+#define ICO_SB_POS_SHTCT1_X   (ICO_SB_POS_LIST_X + ICO_HS_SIZE_SB_HEIGHT + ICO_HS_SIZE_SB_HEIGHT * 2 / 2)
+#define ICO_SB_POS_SHTCT2_X   (ICO_SB_POS_SHTCT1_X + ICO_HS_SIZE_SB_HEIGHT + ICO_HS_SIZE_SB_HEIGHT * 1 / 2)
+
 #define ICO_SB_SIZE_COLON_W   (6)
 #define ICO_SB_SIZE_COLON_H   (17)
 #define ICO_SB_SIZE_NUM_W     (20)
 #define ICO_SB_SIZE_AMPM_W    (47)
 #define ICO_SB_SIZE_AMPM_H    (27)
 
+#define ICO_SB_CHTCT_MAX      (5)
+
+#define ICO_SB_NO_WAIT        (1)
+#define ICO_SB_WAIT_REPLY     (2)
+
+#define ICO_SB_APPLIST_OFFICON "applist_off.png"
+#define ICO_SB_APPLIST_ONICON "applist_on.png"
+#define ICO_SB_HOME_OFFICON "home_off.png"
+#define ICO_SB_HOME_ONICON "home_on.png"
+
 /*============================================================================*/
 /* static(internal) functions prototype                                       */
 /*============================================================================*/
 static void sb_on_destroy(Ecore_Evas *ee);
-static int sb_callback_http(struct libwebsocket_context *context, 
+static int sb_callback_http(struct libwebsocket_context *context,
               struct libwebsocket *wsi,
               enum libwebsocket_callback_reasons reason, void *user, void *in,
               size_t len);
@@ -82,12 +98,21 @@ static void sb_create_ws_context(void);
 static void sb_time_hour(struct tm *t_st);
 static void sb_time_min(struct tm *t_st);
 static Eina_Bool sb_time_show(void* thread_data);
-static void sb_touch_up_escathion(void *data, Evas_Object *obj, void *event_info);
+static void sb_touch_up_escathion(void *data, Evas *evas, Evas_Object *obj, void *event_info);
+static void sb_touch_down_escathion(void *data, Evas *evas, Evas_Object *obj, void *event_info);
+static void sb_touch_up_applist(void *data, Evas *evas, Evas_Object *obj, void *event_info);
+static void sb_touch_down_applist(void *data, Evas *evas, Evas_Object *obj, void *event_info);
 static void sb_clock_display_fixation(Evas *canvas);
+static void sb_touch_up_shortcut(void *data, Evas *evas, Evas_Object *obj, void *event_info);
+static void sb_config_event(const char *appid, int type);
+static void sb_add_shortcut(Evas *canvas);
 
 /*============================================================================*/
 /* variabe & table                                                            */
 /*============================================================================*/
+static Evas *sb_canvas;
+static Eina_List *sb_shtct_list = NULL;
+static int sb_wait_reply = ICO_SB_NO_WAIT;
 static int sb_ws_port = ICO_HS_WS_PORT;
 static int sb_ws_connected = 0;
 static struct libwebsocket_context *sb_ws_context;
@@ -118,19 +143,19 @@ struct _sb_time_data sb_time_data[ICO_SB_TIME_IMG_PARTS] = {
 
 static struct libwebsocket_protocols ws_protocols[] = {
     {
-        "http-only", 
-        sb_callback_http, 
+        "http-only",
+        sb_callback_http,
         0
-    }, 
+    },
     {
-        "statusbar-protocol", 
-        sb_callback_statusbar, 
-        0, 
-    }, 
+        "statusbar-protocol",
+        sb_callback_statusbar,
+        0,
+    },
     {
         /* end of list */
-        NULL, 
-        NULL, 
+        NULL,
+        NULL,
         0
     }
 };
@@ -184,7 +209,7 @@ sb_callback_http(struct libwebsocket_context *context, struct libwebsocket *wsi,
 /*--------------------------------------------------------------------------*/
 /*
  * @brief   sb_callback_statusbar
- *          this callback function is notified from libwebsockets 
+ *          this callback function is notified from libwebsockets
  *          statusbar protocol
  *
  * @param[in]   context             libwebsockets context
@@ -220,7 +245,12 @@ sb_callback_statusbar(struct libwebsocket_context *context,
     case LWS_CALLBACK_CLIENT_RECEIVE:
         uifw_trace("SB-RECEIVE[%d] %s", len, in);
         sb_wsi_mirror = wsi;
-        n = sprintf((char *)p, "ANS %s OK", (char *)in);
+        if (strncmp("RECEIVE OK", in, 10) == 0) {
+            sb_wait_reply = ICO_SB_NO_WAIT;
+        }
+        else {
+            n = sprintf((char *)p, "ANS %s OK", (char *)in);
+        }
         break;
     case LWS_CALLBACK_CLOSED:
         uifw_trace("SB-CLOSE");
@@ -418,32 +448,166 @@ sb_time_show(void *thread_data)
 
 /*--------------------------------------------------------------------------*/
 /**
+ * @brief   sb_touch_up_shortcut
+ *          processing when application button touch up.
+ *
+ * @param[in]   data                user data
+ * @param[in]   evas                evas of the button
+ * @param[in]   obj                 evas object of the button
+ * @param[in]   event_info          evas event infomation
+ * @return      none
+ */
+/*--------------------------------------------------------------------------*/
+static void
+sb_touch_up_shortcut(void *data, Evas *evas, Evas_Object *obj, void *event_info)
+{
+    int n = 0;
+    unsigned char buf[LWS_SEND_BUFFER_PRE_PADDING + 512
+            + LWS_SEND_BUFFER_POST_PADDING];
+    unsigned char *p = &buf[LWS_SEND_BUFFER_PRE_PADDING];
+    char *appid = (char *)data;
+
+    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"));
+            libwebsocket_write(sb_wsi_mirror, p, n,
+                               LWS_WRITE_CLIENT_IGNORE_XOR_MASK | LWS_WRITE_TEXT);
+            uifw_trace("SB: SHOW %s", appid);
+            sb_wait_reply = ICO_SB_WAIT_REPLY;
+        }
+        /* operation sound */
+        hs_snd_play(hs_snd_get_filename(ICO_HS_SND_TYPE_DEFAULT));
+    }
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   sb_touch_down_applist
+ *          processing when application button touch down.
+ *
+ * @param[in]   data                user data
+ * @param[in]   evas                evas of the button
+ * @param[in]   obj                 evas object of the button
+ * @param[in]   event_info          evas event infomation
+ * @return      none
+ */
+/*--------------------------------------------------------------------------*/
+static void
+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];
+
+    hs_get_image_path(path, sizeof(path));
+    sprintf(img, "%s"ICO_SB_APPLIST_ONICON, path);
+
+    evas_object_image_file_set(obj, img, NULL);
+    evas_object_show(obj);
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   sb_touch_up_applist
+ *          processing when application button touch up.
+ *
+ * @param[in]   data                user data
+ * @param[in]   evas                evas of the button
+ * @param[in]   obj                 evas object of the button
+ * @param[in]   event_info          evas event infomation
+ * @return      none
+ */
+/*--------------------------------------------------------------------------*/
+static void
+sb_touch_up_applist(void *data, Evas *evas, Evas_Object *obj, void *event_info)
+{
+    int n = 0;
+    unsigned char buf[LWS_SEND_BUFFER_PRE_PADDING + 512
+            + LWS_SEND_BUFFER_POST_PADDING];
+    unsigned char *p = &buf[LWS_SEND_BUFFER_PRE_PADDING];
+    char path[ICO_HS_TEMP_BUF_SIZE];
+    char img[ICO_HS_TEMP_BUF_SIZE];
+
+    hs_get_image_path(path, sizeof(path));
+    sprintf(img, "%s"ICO_SB_APPLIST_OFFICON, path);
+
+    evas_object_image_file_set(obj, img, NULL);
+    evas_object_show(obj);
+
+    if (sb_wait_reply == ICO_SB_NO_WAIT) {
+        if (sb_wsi_mirror != NULL) {
+            hs_get_ons_edj_path(path, sizeof(path));
+            n = sprintf((char *)p, "OPEN %s%s %s", path,
+                    ICO_HS_ONS_APPLI_LIST_NAME, getenv("PKG_NAME"));
+            libwebsocket_write(sb_wsi_mirror, p, n,
+                               LWS_WRITE_CLIENT_IGNORE_XOR_MASK | LWS_WRITE_TEXT);
+            uifw_trace("SB: CLICK APPLIST");
+            sb_wait_reply = ICO_SB_WAIT_REPLY;
+        }
+    }
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   sb_touch_down_escathion
+ *          processing when escathion button touch down.
+ *
+ * @param[in]   data                user data
+ * @param[in]   evas                evas of the button
+ * @param[in]   obj                 evas object of the button
+ * @param[in]   event_info          evas event infomation
+ * @return      none
+ */
+/*--------------------------------------------------------------------------*/
+static void
+sb_touch_down_escathion(void *data, Evas *evas, Evas_Object *obj, void *event_info)
+{
+    char img[ICO_HS_TEMP_BUF_SIZE];
+    char path[ICO_HS_TEMP_BUF_SIZE];
+
+    hs_get_image_path(path, sizeof(path));
+    sprintf(img, "%s"ICO_SB_HOME_ONICON, path);
+
+    evas_object_image_file_set(obj, img, NULL);
+    evas_object_show(obj);
+}
+
+/*--------------------------------------------------------------------------*/
+/**
  * @brief   sb_touch_up_escathion
  *          processing when change button touch up.
  *
  * @param[in]   data                user data
+ * @param[in]   evas                evas of the button
  * @param[in]   obj                 evas object of the button
  * @param[in]   event_info          evas event infomation
  * @return      none
  */
 /*--------------------------------------------------------------------------*/
 static void
-sb_touch_up_escathion(void *data, Evas_Object *obj, void *event_info)
+sb_touch_up_escathion(void *data, Evas *evas, Evas_Object *obj, void *event_info)
 {
     int n = 0;
     unsigned char buf[LWS_SEND_BUFFER_PRE_PADDING + 512
             + LWS_SEND_BUFFER_POST_PADDING];
     unsigned char *p = &buf[LWS_SEND_BUFFER_PRE_PADDING];
+    char path[ICO_HS_TEMP_BUF_SIZE];
+    char img[ICO_HS_TEMP_BUF_SIZE];
 
-    if (sb_wsi_mirror != NULL) {
-        n = sprintf((char *)p, "%s", "CLICK ESCUTCHEON 1");
-        libwebsocket_write(sb_wsi_mirror, p, n,
-                           LWS_WRITE_CLIENT_IGNORE_XOR_MASK | LWS_WRITE_TEXT);
-        uifw_trace("SB: CLICK ESCUTCHEON 1");
-    }
+    hs_get_image_path(path, sizeof(path));
+    sprintf(img, "%s"ICO_SB_HOME_OFFICON, path);
 
-    /* operation sound */
-    hs_snd_play(hs_snd_get_filename(ICO_HS_SND_TYPE_DEFAULT));
+    evas_object_image_file_set(obj, img, NULL);
+    evas_object_show(obj);
+
+    if (sb_wait_reply == ICO_SB_NO_WAIT) {
+        if (sb_wsi_mirror != NULL) {
+            n = sprintf((char *)p, "%s", "CLICK ESCUTCHEON 1");
+            libwebsocket_write(sb_wsi_mirror, p, n,
+                               LWS_WRITE_CLIENT_IGNORE_XOR_MASK | LWS_WRITE_TEXT);
+            uifw_trace("SB: CLICK ESCUTCHEON 1");
+            sb_wait_reply = ICO_SB_WAIT_REPLY;
+        }
+    }
 }
 
 /*--------------------------------------------------------------------------*/
@@ -458,30 +622,44 @@ sb_touch_up_escathion(void *data, Evas_Object *obj, void *event_info)
 static void
 sb_clock_display_fixation(Evas *canvas)
 {
-    Evas_Object *title, *colon;
+    Evas_Object *tile, *colon;
     int moveH;
     int escPosX;
     char file[ICO_SB_BUF_SIZE];
+    char img[ICO_HS_TEMP_BUF_SIZE];
+    char path[ICO_HS_TEMP_BUF_SIZE];
 
     moveH = sb_width - ICO_HS_SIZE_LAYOUT_WIDTH;
     escPosX = sb_width / 2 - ICO_HS_SIZE_SB_HEIGHT / 2;
 
     /* show escutcheon */
-    Evas_Object *icon, *btn;
-    title = evas_object_rectangle_add(canvas);
-    evas_object_move(title, escPosX, ICO_SB_POS_Y);
-    evas_object_resize(title, ICO_HS_SIZE_SB_HEIGHT, ICO_HS_SIZE_SB_HEIGHT);
-    evas_object_show(title);
-
-    icon = elm_icon_add(title);
-    elm_icon_standard_set(icon, "refresh");
-
-    btn = elm_button_add(title);
-    elm_object_part_content_set(btn, "icon", icon);
-    evas_object_move(btn, escPosX, ICO_SB_POS_Y);
-    evas_object_resize(btn, ICO_HS_SIZE_SB_HEIGHT, ICO_HS_SIZE_SB_HEIGHT);
-    evas_object_smart_callback_add(btn, "clicked", sb_touch_up_escathion, NULL );
-    evas_object_show(btn);
+    hs_get_image_path(path, sizeof(path));
+    sprintf(img, "%s"ICO_SB_HOME_OFFICON, path);
+    tile = evas_object_image_filled_add(canvas);
+    evas_object_image_file_set(tile, img, NULL);
+    evas_object_move(tile, escPosX, ICO_SB_POS_Y);
+    evas_object_resize(tile, ICO_HS_SIZE_SB_HEIGHT, ICO_HS_SIZE_SB_HEIGHT);
+    evas_object_event_callback_add(tile, EVAS_CALLBACK_MOUSE_UP,
+                                  sb_touch_up_escathion, NULL);
+    evas_object_event_callback_add(tile, EVAS_CALLBACK_MOUSE_DOWN,
+                                  sb_touch_down_escathion, NULL);
+    evas_object_show(tile);
+
+    /* show app list */
+    hs_get_image_path(path, sizeof(path));
+    sprintf(img, "%s"ICO_SB_APPLIST_OFFICON, path);
+    tile = evas_object_image_filled_add(canvas);
+    evas_object_image_file_set(tile, img, NULL);
+    evas_object_move(tile, ICO_SB_POS_LIST_X, ICO_SB_POS_Y);
+    evas_object_resize(tile, ICO_HS_SIZE_SB_HEIGHT * 3 / 2, ICO_HS_SIZE_SB_HEIGHT);
+    evas_object_event_callback_add(tile, EVAS_CALLBACK_MOUSE_UP,
+                                  sb_touch_up_applist, NULL);
+    evas_object_event_callback_add(tile, EVAS_CALLBACK_MOUSE_DOWN,
+                                  sb_touch_down_applist, NULL);
+    evas_object_show(tile);
+
+    /* shortcut bottun */
+    sb_add_shortcut(canvas);
 
     /* show clock's colon */
     /*Creates a new image object*/
@@ -495,6 +673,86 @@ sb_clock_display_fixation(Evas *canvas)
     evas_object_resize(colon, ICO_SB_SIZE_COLON_W, ICO_SB_SIZE_COLON_H);
     /*Makes the given Evas object visible*/
     evas_object_show(colon);
+
+    return;
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   sb_add_shortcut
+ *          add shurtcut bottun
+ *
+ * @param[in]   canvas              evas to draw
+ * @return      none
+ */
+/*--------------------------------------------------------------------------*/
+static void
+sb_add_shortcut(Evas *canvas)
+{
+    Evas_Object *tile;
+    int escPosX;
+    int x, idx;
+    char config[ICO_UXF_MAX_PROCESS_NAME];
+    const char *appid;
+    const Ico_Uxf_conf_application *appconf;
+    Eina_List *l, *l_next;
+
+    escPosX = sb_width / 2 - ICO_HS_SIZE_SB_HEIGHT / 2;
+
+    /* delete shortcut */
+    EINA_LIST_FOREACH_SAFE(sb_shtct_list, l, l_next, tile) {
+        evas_object_del(tile);
+        sb_shtct_list = eina_list_remove_list(sb_shtct_list, l);
+    }
+
+    /* add shortcut */
+    for (idx = 0; idx < ICO_SB_CHTCT_MAX; idx++) {
+        sprintf(config, ICO_SB_CONFIG_SHTCT_APP"%d", idx);
+        x = ICO_SB_POS_SHTCT1_X + (ICO_SB_SIZE_SHTCT_W + ICO_HS_SIZE_SB_HEIGHT * 1 / 2) * idx;
+        if (x > escPosX) {
+            break;
+        }
+        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) {
+                tile = evas_object_image_filled_add(canvas);
+                evas_object_image_file_set(tile,
+                        appconf->icon_key_name, NULL);
+                evas_object_move(tile, x, ICO_SB_POS_Y);
+                evas_object_resize(tile, ICO_HS_SIZE_SB_HEIGHT, ICO_HS_SIZE_SB_HEIGHT);
+                evas_object_event_callback_add(tile, EVAS_CALLBACK_MOUSE_UP,
+                                   sb_touch_up_shortcut, appid);
+                evas_object_show(tile);
+                sb_shtct_list = eina_list_append(sb_shtct_list, tile);
+            }
+        }
+    }
+
+    return;
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   sb_config_event
+ *          This is a callback function called when the configurations
+ *          is updata.
+ *
+ * @param[in]   appid               application id
+ * @param[in]   type                event type(install/uninstall)
+ * @return      none
+ */
+/*--------------------------------------------------------------------------*/
+static void
+sb_config_event(const char *appid, int type)
+{
+    uifw_trace("sb_config_event: Enter(appid=%s, type=%d)", appid, type);
+
+    sb_add_shortcut(sb_canvas);
+
+    uifw_trace("sb_config_event: Leave");
+
+    return;
 }
 
 /*--------------------------------------------------------------------------*/
@@ -511,7 +769,6 @@ sb_clock_display_fixation(Evas *canvas)
 int
 main(int argc, char *argv[])
 {
-    Evas * canvas;
     time_t timer;
     struct tm *t_st;
     Evas_Object *bg;
@@ -597,25 +854,24 @@ main(int argc, char *argv[])
     ecore_evas_show(ee);
 
     /* Wrapper of Evas */
-    canvas = ecore_evas_get(ee);
+    sb_canvas = ecore_evas_get(ee);
 
     /* BG color set */
-    bg = evas_object_rectangle_add(canvas);
+    bg = evas_object_rectangle_add(sb_canvas);
     evas_object_color_set(bg, 0, 0, 0, 255);
     evas_object_move(bg, 0, 0);
     evas_object_resize(bg, sb_width, ICO_HS_SIZE_SB_HEIGHT);
     evas_object_show(bg);
 
     /* Call the function */
-    elm_init(argc, argv);
-    sb_clock_display_fixation(canvas);
+    sb_clock_display_fixation(sb_canvas);
 
     /* ... */
-    sb_ampm = evas_object_image_filled_add(canvas);
-    sb_hour1 = evas_object_image_filled_add(canvas);
-    sb_hour2 = evas_object_image_filled_add(canvas);
-    sb_min1 = evas_object_image_filled_add(canvas);
-    sb_min2 = evas_object_image_filled_add(canvas);
+    sb_ampm = evas_object_image_filled_add(sb_canvas);
+    sb_hour1 = evas_object_image_filled_add(sb_canvas);
+    sb_hour2 = evas_object_image_filled_add(sb_canvas);
+    sb_min1 = evas_object_image_filled_add(sb_canvas);
+    sb_min2 = evas_object_image_filled_add(sb_canvas);
 
     /* This function will make layout change */
     evas_object_move(sb_ampm, moveH + ICO_SB_POS_AMPM_X, ICO_SB_POS_AMPM_Y);
@@ -651,7 +907,7 @@ main(int argc, char *argv[])
 
     /* Set the image file */
     for (ii = 0; ii < ICO_SB_TIME_IMG_PARTS; ii++) {
-        sb_time_data[ii].time_img = evas_object_image_filled_add(canvas);
+        sb_time_data[ii].time_img = evas_object_image_filled_add(sb_canvas);
         sprintf(file, "%s%s", sb_respath, sb_time_data[ii].f_name);
         evas_object_image_file_set(sb_time_data[ii].time_img, file, NULL);
     }
@@ -661,6 +917,9 @@ main(int argc, char *argv[])
     sb_create_ws_context();
     ecore_timer_add(ICO_SB_WS_TIMEOUT, sb_ecore_event, NULL);
 
+    /* add callback to app configuration */
+    ico_uxf_econf_setAppUpdateCb(sb_config_event);
+
     /* Runs the application main loop */
     ecore_main_loop_begin();
     /* Free an Ecore_Evas */
index 1560ba7..50d1b9f 100755 (executable)
@@ -10,7 +10,7 @@
 # 2. Delete log file
 /bin/mkdir /var/log/ico > /dev/null 2>&1
 /bin/chmod -R 0777 /var/log/ico > /dev/null 2>&1
-/bin/rm -f /var/log/ico/* > /dev/null 2>&1
+/bin/rm -f /var/log/ico/* /var/log/weston.log > /dev/null 2>&1
 
 # 3. Weston/Wayland Envionment
 export XDG_RUNTIME_DIR=/tmp/run-root
index b1762d8..d58dfaf 100644 (file)
@@ -78,7 +78,7 @@ static struct libwebsocket_protocols ws_protocols[] = {
 /*============================================================================*/
 /* functions                                                                  */
 /*============================================================================*/
-static int 
+static int
 hscmd_callback_http(struct libwebsocket_context *context,
                          struct libwebsocket *wsi,
                          enum libwebsocket_callback_reasons reason, void *user,
@@ -103,7 +103,7 @@ hscmd_callback_http(struct libwebsocket_context *context,
  * @retval      =1                  error
  */
 /*--------------------------------------------------------------------------*/
-static int 
+static int
 hscmd_callback_command(struct libwebsocket_context *context,
                               struct libwebsocket *wsi,
                               enum libwebsocket_callback_reasons reason,
@@ -149,10 +149,10 @@ hscmd_callback_command(struct libwebsocket_context *context,
  * @return      none
  */
 /*--------------------------------------------------------------------------*/
-static void 
+static void
 hscmd_create_ws_context(void)
 {
-    hscmd_ws_context 
+    hscmd_ws_context
         = libwebsocket_create_context(CONTEXT_PORT_NO_LISTEN, NULL, ws_protocols,
                                       libwebsocket_internal_extensions,
                                       NULL, NULL, -1, -1, 0);
@@ -161,10 +161,10 @@ hscmd_create_ws_context(void)
     if (hscmd_ws_context == NULL) {
         fprintf(stderr, "libwebsocket_create_context failed.\n");
     } else {
-        hscmd_wsi_mirror 
+        hscmd_wsi_mirror
             = libwebsocket_client_connect(
                     hscmd_ws_context, ICO_HSCMD_WS_ADDRESS, hscmd_ws_port,
-                    0, "/", ICO_HSCMD_WS_ADDRESS, NULL, 
+                    0, "/", ICO_HSCMD_WS_ADDRESS, NULL,
                     ICO_HSCMD_WS_PROTOCOL_NAME, -1);
         if(hscmd_wsi_mirror != NULL) {
             hscmd_ws_connected = 1;
@@ -181,7 +181,7 @@ hscmd_create_ws_context(void)
  * @return      none
  */
 /*--------------------------------------------------------------------------*/
-static void 
+static void
 hscmd_destroy_ws_context(void)
 {
     if (hscmd_ws_context) {
@@ -191,7 +191,7 @@ hscmd_destroy_ws_context(void)
     }
 }
 
-static void 
+static void
 hscmd_ws_service_loop(void)
 {
     while (hscmd_ws_connected) {
@@ -209,7 +209,7 @@ hscmd_usage(const char *prog)
 /*--------------------------------------------------------------------------*/
 /*
  * @brief   test command tools
- *          send json format command to 
+ *          send json format command to
  *          main routine
  *
  * @param   main() finction's standard parameter (argc,argv)
@@ -218,7 +218,7 @@ hscmd_usage(const char *prog)
  * @retval  1       failed
  */
 /*--------------------------------------------------------------------------*/
-int 
+int
 main(int argc, char *argv[])
 {
 
index eea3d5a..f55fda5 100644 (file)
@@ -67,6 +67,9 @@ static const struct {
     { "Blinker", "TURN_SIGNAL", {TYPE_INT32, TYPE_NULL, 0, 0} },
     { "Winker", "TURN_SIGNAL", {TYPE_INT32, TYPE_NULL, 0, 0} },
     { "TurnSignal", "TURN_SIGNAL", {TYPE_INT32, TYPE_NULL, 0, 0} },
+    { "Turn", "TURN_SIGNAL", {TYPE_INT32, TYPE_NULL, 0, 0} },
+    { "lightStatus", "LIGHTSTATUS", {TYPE_BOOL, TYPE_BOOL, TYPE_BOOL, TYPE_BOOL} },
+    { "light", "LIGHTSTATUS", {TYPE_BOOL, TYPE_BOOL, TYPE_BOOL, TYPE_BOOL} },
     { "WATER_TEMP", "WATER_TEMP", {TYPE_INT32, TYPE_NULL, 0, 0} },
     { "\0", "\0", {TYPE_NULL, 0,0,0} } };