Bug fix: TIVI-1996. 61/11861/1 accepted/tizen/20131107.180848 accepted/tizen/20131111.231327 accepted/tizen_ivi_stable/20131119.040218 submit/tizen/20131107.013353 submit/tizen_ivi_stable/20131119.040131
authorHayato Nakamura <hayato.nakamura@mail.toyota-td.jp>
Wed, 6 Nov 2013 09:31:15 +0000 (18:31 +0900)
committerHayato Nakamura <hayato.nakamura@mail.toyota-td.jp>
Wed, 6 Nov 2013 09:34:47 +0000 (18:34 +0900)
Change-Id: Ibe0f529de5857ef4a9451fd62182b125ea322267
Signed-off-by: Hayato Nakamura <hayato.nakamura@mail.toyota-td.jp>
81 files changed:
configure.ac
include/ico_syc_application.h
include/ico_syc_msg_cmd_def.h
lib/apps-framework/ico_syc_common.c
lib/apps-framework/ico_syc_userctl.c
lib/apps-framework/ico_syc_winctl.c
lib/system-controller/CicoSCAulItems.cpp
lib/system-controller/CicoSCCommonDef.h [new file with mode: 0644]
lib/system-controller/CicoSCConf.h
lib/system-controller/CicoSCDisplay.cpp
lib/system-controller/CicoSCDisplay.h
lib/system-controller/CicoSCDisplayZone.cpp
lib/system-controller/CicoSCDisplayZone.h
lib/system-controller/CicoSCInputController.cpp
lib/system-controller/CicoSCLayer.h
lib/system-controller/CicoSCLifeCycleController.cpp
lib/system-controller/CicoSCPolicyDef.h
lib/system-controller/CicoSCPolicyManager.cpp
lib/system-controller/CicoSCPolicyManager.h
lib/system-controller/CicoSCResourceManager.cpp
lib/system-controller/CicoSCResourceManager.h
lib/system-controller/CicoSCServer.cpp
lib/system-controller/CicoSCServer.h
lib/system-controller/CicoSCSystemConfig.cpp
lib/system-controller/CicoSCUserManager.cpp
lib/system-controller/CicoSCUserManager.h
lib/system-controller/CicoSCWindow.cpp
lib/system-controller/CicoSCWindow.h
lib/system-controller/CicoSCWindowController.cpp
lib/system-controller/CicoSCWindowController.h
lib/system-controller/CicoSCWlWinMgrIF.cpp
lib/system-controller/CicoSCWlWinMgrIF.h
lib/system-controller/Cico_aul_listen_app.cpp [new file with mode: 0644]
lib/system-controller/Cico_aul_listen_app.h [new file with mode: 0644]
lib/system-controller/Makefile.am
packaging/ico-uxf-homescreen.changes
packaging/ico-uxf-homescreen.spec
res/org.tizen.ico.homescreen/res/config/homescreen.conf
res/org.tizen.ico.homescreen/res/images/bg.png
res/org.tizen.ico.homescreen/res/images/termIcon.png [changed mode: 0644->0755]
res/org.tizen.ico.homescreen/res/sound/failure.wav [new file with mode: 0644]
res/org.tizen.ico.homescreen/res/sound/operation.wav [new file with mode: 0644]
res/org.tizen.ico.homescreen/res/sound/success.wav [new file with mode: 0644]
res/org.tizen.ico.system-controller/res/config/policy.json
res/org.tizen.ico.system-controller/res/config/system.xml
src/homescreen/CicoHSAppHistoryExt.cpp
src/homescreen/CicoHSAppHistoryExt.h
src/homescreen/CicoHSAppInfo.cpp
src/homescreen/CicoHSAppInfo.h
src/homescreen/CicoHSControlBarTouch.cpp
src/homescreen/CicoHSControlBarWindow.cpp
src/homescreen/CicoHSControlBarWindow.h
src/homescreen/CicoHSFlickTouch.cpp [deleted file]
src/homescreen/CicoHSMenuTile.cpp
src/homescreen/CicoHSMenuTile.h
src/homescreen/CicoHSMenuTouch.cpp
src/homescreen/CicoHSMenuWindow.cpp
src/homescreen/CicoHSMenuWindow.h
src/homescreen/CicoHSSwipeInputWindow.cpp [moved from src/homescreen/CicoHSFlickInputWindow.cpp with 68% similarity]
src/homescreen/CicoHSSwipeInputWindow.h [moved from src/homescreen/CicoHSFlickInputWindow.h with 71% similarity]
src/homescreen/CicoHSSwipeTouch.cpp [new file with mode: 0644]
src/homescreen/CicoHSSwipeTouch.h [moved from src/homescreen/CicoHSFlickTouch.h with 57% similarity]
src/homescreen/CicoHSWindowController.cpp
src/homescreen/CicoHomeScreen.cpp
src/homescreen/CicoHomeScreen.h
src/homescreen/CicoHomeScreenCommon.h
src/homescreen/CicoSCAulItems.cpp
src/homescreen/CicoSCCommonDef.h [new file with mode: 0644]
src/homescreen/CicoSCConf.h
src/homescreen/CicoSCLifeCycleController.cpp
src/homescreen/CicoSCSystemConfig.cpp
src/homescreen/CicoSound.cpp [new file with mode: 0644]
src/homescreen/CicoSound.h [new file with mode: 0644]
src/homescreen/Makefile.am
src/homescreen/home_screen_main.cpp
src/syscond/CicoSysConDaemon.cpp
src/syscond/Makefile.am
tool/ico_change_loginuser.c
tool/kill_syscond.sh
tool/rm_autogen-file.sh
tool/start_syscond.sh

index 3539de0..10a5027 100644 (file)
@@ -2,7 +2,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ([2.68])
-AC_INIT([org.tizen.ico.homescreen], [0.9.05], [])
+AC_INIT([org.tizen.ico.homescreen], [0.9.06], [])
 AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz])
 AC_CONFIG_SRCDIR([configure.ac])
 AC_CONFIG_HEADERS([config.h])
@@ -55,10 +55,11 @@ PKG_CHECK_MODULES([MURPHYECORE], [murphy-ecore]);
 PKG_CHECK_MODULES([MURPHYRESOURCE], [murphy-resource]);
 PKG_CHECK_MODULES([LIBWEBSOCKETS], [libwebsockets]);
 PKG_CHECK_MODULES([ECOREEVAS], [ecore-evas])
+PKG_CHECK_MODULES([EDBUS], [edbus])
 
 # Set flags
-EFL_CFLAGS="$EINA_CFLAGS $EVAS_CFLAGS $ECORE_CFLAGS $EDJE_CFLAGS $ELEM_CFLAGS $ECOREWAYLAND_CFLAGS"
-EFL_LIBS="$EINA_LIBS $EVAS_LIBS $ECORE_LIBS $EDJE_LIBS $ELEM_LIBS $ECOREWAYLAND_LIBS $ECOREX_LIBS"
+EFL_CFLAGS="$EINA_CFLAGS $EVAS_CFLAGS $ECORE_CFLAGS $EDJE_CFLAGS $ELEM_CFLAGS $ECOREWAYLAND_CFLAGS $EDBUS_CFLAGS"
+EFL_LIBS="$EINA_LIBS $EVAS_LIBS $ECORE_LIBS $EDJE_LIBS $ELEM_LIBS $ECOREWAYLAND_LIBS $ECOREX_LIBS $EDBUS_LIBS"
 AC_SUBST(EFL_CFLAGS)
 AC_SUBST(EFL_LIBS)
 
index 233d2b4..4c37d4e 100644 (file)
@@ -28,5 +28,8 @@ extern "C" {
 
 #include "ico_syc_appresctl.h"
 
+#ifdef __cplusplus
+}
+#endif
 #endif /*_ICO_SYC_APPLICATION_H_*/
 /* vim:set expandtab ts=4 sw=4: */
index ee0f1d7..7ee9404 100644 (file)
@@ -64,6 +64,7 @@ extern "C" {
 #define MSG_PRMKEY_RAISE        (char *)"raise"
 #define MSG_PRMKEY_VISIBLE      (char *)"visible"
 #define MSG_PRMKEY_ACTIVE       (char *)"active"
+#define MSG_PRMKEY_NAME         (char *)"name"
 #define MSG_PRMKEY_STRIDE       (char *)"stride"
 #define MSG_PRMKEY_FORMAT       (char *)"format"
 #define MSG_PRMKEY_RATE         (char *)"framerate"
index 4632b49..5aa16eb 100644 (file)
@@ -272,6 +272,9 @@ static int _get_event_from_cmd(int command)
     case MSG_CMD_GET_USERLIST:
         event = ICO_SYC_EV_USERLIST;
         break;
+    case MSG_CMD_GET_LASTINFO:
+        event = ICO_SYC_EV_LASTINFO;
+        break;
     case MSG_CMD_ACQUIRE_RES:
         event = ICO_SYC_EV_RES_ACQUIRE;
         break;
index 625cf36..8fa5155 100644 (file)
@@ -195,7 +195,7 @@ _create_set_lastinfo_msg(const char *appid, const char *lastinfo)
     }
 
     /* set message */
-    json_object_set_int_member(obj, MSG_PRMKEY_CMD, MSG_CMD_GET_LASTINFO);
+    json_object_set_int_member(obj, MSG_PRMKEY_CMD, MSG_CMD_SET_LASTINFO);
     json_object_set_string_member(obj, MSG_PRMKEY_APPID, appid);
     json_object_set_int_member(obj, MSG_PRMKEY_PID, getpid());
 
index ed6bd5c..7872ebf 100644 (file)
@@ -685,6 +685,7 @@ ico_syc_cb_thumb(ico_syc_callback_t callback, void *user_data,
 
     thumb_info->surface = ico_syc_get_int_member(argobj,
                                                  MSG_PRMKEY_SURFACE);
+    thumb_info->name = ico_syc_get_int_member(argobj, MSG_PRMKEY_NAME);
     thumb_info->width = ico_syc_get_int_member(argobj, MSG_PRMKEY_WIDTH);
     thumb_info->height = ico_syc_get_int_member(argobj, MSG_PRMKEY_HEIGHT);
     thumb_info->stride = ico_syc_get_int_member(argobj, MSG_PRMKEY_STRIDE);
index 661f7ff..331bc4c 100644 (file)
@@ -206,7 +206,7 @@ bool CicoSCAulItems::getPidCgroupInfo(int pid, string& m, string& c)
 }
 
 /**
- * @breif appid update
+ * @brief appid update
  */
 void CicoSCAulItems::update_appid()
 {
diff --git a/lib/system-controller/CicoSCCommonDef.h b/lib/system-controller/CicoSCCommonDef.h
new file mode 100644 (file)
index 0000000..5b019f5
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * 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
+ *
+ */
+
+//==========================================================================
+/**
+ *  @file   CicoSCCommonDef.h
+ *
+ *  @brief  This file is definition of common value
+ */
+//==========================================================================
+#ifndef __CICO_SC_COMMON_DEF_H__
+#define __CICO_SC_COMMON_DEF_H__
+
+//--------------------------------------------------------------------------
+//  definition of layer type
+//--------------------------------------------------------------------------
+#define ICO_LAYER_TYPE_BACKGROUND   (1) ///! layer type of background
+#define ICO_LAYER_TYPE_APPLICATION  (2) ///! layer type of application
+#define ICO_LAYER_TYPE_HOMESCREEN   (3) ///! layer type of homescreen
+#define ICO_LAYER_TYPE_INTERRPUTAPP (4) ///! layer type of homescreen
+#define ICO_LAYER_TYPE_ONSCREEN     (5) ///! layer type of homescreen
+#define ICO_LAYER_TYPE_INPUT        (101) ///! layer type of input panel(soft keyboard)
+#define ICO_LAYER_TYPE_TOUCH        (102) ///! layer type of touch panel input
+#define ICO_LAYER_TYPE_CURSOR       (103) ///! layer type of cursor
+
+//--------------------------------------------------------------------------
+//  range of zone id 
+//--------------------------------------------------------------------------
+// center display
+#define ICO_DISPLAY0_ZONEID_MIN       (1)   ///! display0 zone id min
+#define ICO_DISPLAY0_ZONEID_MAX       (20)  ///! display0 zone id max
+
+// second display
+#define ICO_DISPLAY1_ZONEID_MIN       (21)  ///! display1 zone id min
+#define ICO_DISPLAY1_ZONEID_MAX       (40)  ///! display1 zone id max
+
+#endif  // __CICO_SC_COMMON_DEF_H__
+// vim:set expandtab ts=4 sw=4:
index b822500..92af9e7 100644 (file)
@@ -21,7 +21,8 @@
 #include <vector>
 #include <sstream>
 
-#include "CicoLog.h"
+#include <ico_log.h>
+#include "CicoSCCommonDef.h"
    
 //==========================================================================
 /**
@@ -153,7 +154,10 @@ class CicoSCDisplayZoneConf
 public:
     /// default constructor
     CicoSCDisplayZoneConf()
-        : id(-1), name(""), fullname(""), x(-1), y(-1), w(-1), h(-1) {}
+        : id(-1), name(""), fullname(""), x(-1), y(-1), w(-1), h(-1),
+          aspectFixed(false), aspectAlignLeft(false),
+          aspectAlignRight(false), aspectAlignTop(false),
+          aspectAlignBottom(false) {}
 
     /// destructor
     virtual ~CicoSCDisplayZoneConf() {}
@@ -161,23 +165,35 @@ public:
     /// dump log this class member variables
     void dumpConf(void)
     {
-        ICO_DBG("  zone: id=%d name=%s fullname=%s x=%d y=%d "
-                 "w=%d h=%d overlap=%s",
-                 id, name.c_str(), fullname.c_str(),
-                 x, y, w, h, overlapStr.c_str());
+        ICO_DBG("  zone: id=%d name=%s fullname=%s x/y=%d/%d "
+                "w/h=%d/%d aspect(fixed=%s l/r=%s/%s t/b=%s/%s",
+                id, name.c_str(), fullname.c_str(), x, y, w, h,
+                aspectFixed       ? "true" : "false",
+                aspectAlignLeft   ? "true" : "false",
+                aspectAlignRight  ? "true" : "false",
+                aspectAlignTop    ? "true" : "false",
+                aspectAlignBottom ? "true" : "false");
     }
 
 public:
-    int    id;              ///< display zone id
-    std::string name;       ///< display zone name
-    std::string fullname;   ///< display zone name
-    int    x;               ///< display zone x position
-    int    y;               ///< display zone y position
-    int    w;               ///< display zone width
-    int    h;               ///< display zone height
-    std::string overlapStr; ///< display overlap
-    std::vector<bool> overlap;  ///< display enable table
-
+    int               id;         ///< display zone id
+    std::string       name;       ///< display zone name
+    std::string       fullname;   ///< display zone fullname
+    int               x;          ///< display zone x position
+    int               y;          ///< display zone y position
+    int               w;          ///< display zone width
+    int               h;          ///< display zone height
+
+    /// fixed asppect ratio flag
+    bool aspectFixed;
+    /// horizontal direction to aligned at the left
+    bool aspectAlignLeft;   
+    /// horizontal direction to aligned at the right
+    bool aspectAlignRight;
+    /// vertical direction is aligned at the top
+    bool aspectAlignTop;
+    /// vertical direction is aligned at the bottom
+    bool aspectAlignBottom;
 };
 
 //==========================================================================
index 694c289..21f8584 100644 (file)
@@ -36,7 +36,6 @@ CicoSCDisplay::CicoSCDisplay()
       displayno(-1),
       width(-1),
       height(-1),
-      inch(-1),
       pWidth(-1),
       pHeight(-1),
       orientation(ORIENTATION_HORIZONTAL),
@@ -62,15 +61,25 @@ void
 CicoSCDisplay::dump(void)
 {
     ICO_DBG("CicoSCDisplay: displayid=%d type=%d nodeid=%d displayno=%d "
-            "width=%d height=%d inch=%d pWidth=%d pHeight=%d "
+            "width=%d height=%d pWidth=%d pHeight=%d "
             "orientation =%d name=%s",
-            displayid, type, nodeid, displayno, width, height, inch,
+            displayid, type, nodeid, displayno, width, height,
             pWidth, pHeight, orientation, name.c_str());
  
-    vector<CicoSCLayer*>::iterator itr;
-    itr = layerList.begin();
-    for (; itr != layerList.end(); ++itr) {
-        const_cast<CicoSCLayer*>(*itr)->dump();
+    {
+        vector<CicoSCLayer*>::iterator itr;
+        itr = layerList.begin();
+        for (; itr != layerList.end(); ++itr) {
+            (*itr)->dump();
+        }
+    }
+
+    {
+        std::map<unsigned int, CicoSCDisplayZone*>::iterator itr;
+        itr = zoneList.begin();
+        for (; itr != zoneList.end(); ++itr) {
+            itr->second->dump();
+        }
     }
 }
 
index 35ab4a4..185158b 100644 (file)
@@ -66,7 +66,6 @@ public:
     int         displayno;   ///< consecutive numbers
     int         width;       ///< the number of the lateral pixels
     int         height;      ///< the number of vertical pixels
-    int         inch;        ///< ccreen physical size(0.1 inches of units)
     int         pWidth;      ///< compositor width
     int         pHeight;     ///< compositor height
     int         orientation; ///< screen orientation
index 8a4cb1c..483ecc4 100644 (file)
@@ -24,7 +24,9 @@
  */
 //--------------------------------------------------------------------------
 CicoSCDisplayZone::CicoSCDisplayZone()
-    : zoneid(-1), x(-1), y(-1), width(-1), height(-1), fullname("")
+    : zoneid(-1), x(-1), y(-1), width(-1), height(-1), fullname(""),
+      displayedWindow(NULL), aspectFixed(false), aspectAlignLeft(false), 
+      aspectAlignRight(false), aspectAlignTop(false), aspectAlignBottom(false)
 {
 }
 
@@ -46,7 +48,13 @@ void
 CicoSCDisplayZone::dump(void)
 {
     ICO_DBG("CicoSCDisplayZone: zoneid=%d "
-            "x=%d y=%d width=%d height=%d fullname=%s",
-            zoneid, x, y, width, height, fullname.c_str());
+            "x/y=%d/%d w/h=%d/%d fullname=%s window=0x%08x "
+            "aspect(fixed=%s l/r=%s/%s t/b=%s/%s",
+            zoneid, x, y, width, height, fullname.c_str(), displayedWindow,
+            aspectFixed       ? "true" : "false",
+            aspectAlignLeft   ? "true" : "false",
+            aspectAlignRight  ? "true" : "false",
+            aspectAlignTop    ? "true" : "false",
+            aspectAlignBottom ? "true" : "false");
 }
 // vim:set expandtab ts=4 sw=4:
index 7947b2f..35a9429 100644 (file)
 #include <string>
 
 //==========================================================================
+//  Forward declaration
+//==========================================================================
+class CicoSCWindow;
+
+//==========================================================================
 /**
  *  @brief  This class hold display zone information
  */
@@ -44,12 +49,24 @@ private:
     CicoSCDisplayZone(const CicoSCDisplayZone &object);
 
 public:
-    int zoneid;           //!< display zone id
-    int x;                //!< display zone x position
-    int y;                //!< display zone y position
-    int width;            //!< display zone width
-    int height;           //!< display zone height
-    std::string fullname; //!< full name of layer
+    int zoneid;                     ///< display zone id
+    int x;                          ///< display zone x position
+    int y;                          ///< display zone y position
+    int width;                      ///< display zone width
+    int height;                     ///< display zone height
+    std::string fullname;           ///< full name of layer
+    CicoSCWindow *displayedWindow;  ///< current displayed window
+
+    /// fixed asppect ratio flag
+    bool aspectFixed;
+    /// horizontal direction to aligned at the left
+    bool aspectAlignLeft;
+    /// horizontal direction to aligned at the right
+    bool aspectAlignRight;
+    /// vertical direction is aligned at the top
+    bool aspectAlignTop;
+    /// vertical direction is aligned at the bottom
+    bool aspectAlignBottom;
 };
 #endif  // __CICO_SC_DISPLAYZONE_H__
 // vim:set expandtab ts=4 sw=4:
index b16f678..7460d09 100644 (file)
@@ -91,7 +91,7 @@ initDB(void)
 
 //--------------------------------------------------------------------------
 /**
- *  @brief\81@executes an input control process corresponding to the command
+ *  @brief executes an input control process corresponding to the command
  *
  *  @param  cmd     command
  */
index c2edeee..50b2541 100644 (file)
@@ -17,6 +17,8 @@
 #ifndef __CICO_SC_LAYER_H__
 #define __CICO_SC_LAYER_H__
 
+#include "CicoSCCommonDef.h"
+
 //--------------------------------------------------------------------------
 /**
  *  @brief  This class hold layer information
index a3db10e..0b9dd31 100644 (file)
@@ -25,6 +25,7 @@
 #include "CicoSCConf.h"
 #include "CicoSCSystemConfig.h"
 #include "CicoSCSysResourceController.h"
+#include "Cico_aul_listen_app.h"
 
 using namespace std;
 
@@ -840,7 +841,7 @@ void CicoSCLifeCycleController::getCategory(const char* sPkg, const char* sNm,
         addCtgry[sizeof(addCtgry)-1] = 0;
     }
     if (addCtgry[0]) {
-         category.assign(addCtgry);
+        category.assign(addCtgry);
         ICO_DBG("category=%s", category.c_str());
     }
     ICO_TRA("end");
@@ -852,8 +853,8 @@ void CicoSCLifeCycleController::getCategory(const char* sPkg, const char* sNm,
 void CicoSCLifeCycleController::initAUL()
 {
     ICO_TRA("start");
-    aul_listen_app_launch_signal(CSCLCCapp_launch_handler, (void*)this);
-    aul_listen_app_dead_signal(CSCLCCapp_dead_handler, (void*)this);
+    aul_listen_app_launch_signal_add(CSCLCCapp_launch_handler, (void*)this);
+    aul_listen_app_dead_signal_add(CSCLCCapp_dead_handler, (void*)this);
     ICO_TRA("end");
 }
 
index 4bd2973..e6bb30b 100644 (file)
 #define STID_DISPLAY0_ZONE1             10001
 #define STID_DISPLAY0_ZONE2             10002
 #define STID_DISPLAY0_ZONE3             10003
+#define STID_DISPLAY0_ZONE4             10004
+#define STID_DISPLAY0_ZONE5             10005
+#define STID_DISPLAY0_ZONE6             10006
+#define STID_DISPLAY0_ZONE7             10007
+#define STID_DISPLAY0_ZONE8             10008
+#define STID_DISPLAY0_ZONE9             10009
+#define STID_DISPLAY0_ZONE10            10010
+#define STID_DISPLAY0_ZONE11            10011
+#define STID_DISPLAY0_ZONE12            10012
+#define STID_DISPLAY0_ZONE13            10013
+#define STID_DISPLAY0_ZONE14            10014
+#define STID_DISPLAY0_ZONE15            10015
+#define STID_DISPLAY0_ZONE16            10016
+#define STID_DISPLAY0_ZONE17            10017
+#define STID_DISPLAY0_ZONE18            10018
+#define STID_DISPLAY0_ZONE19            10019
+#define STID_DISPLAY0_ZONE20            10020
+#define STID_DISPLAY0_NOOWER            10999
 
 // display1 zone state id
 #define STID_DISPLAY1_ZONE              11000
 #define STID_DISPLAY1_ZONE1             11001
 #define STID_DISPLAY1_ZONE2             11002
 #define STID_DISPLAY1_ZONE3             11003
+#define STID_DISPLAY1_ZONE4             11004
+#define STID_DISPLAY1_ZONE5             11005
+#define STID_DISPLAY1_ZONE6             11006
+#define STID_DISPLAY1_ZONE7             11007
+#define STID_DISPLAY1_ZONE8             11008
+#define STID_DISPLAY1_ZONE9             11009
+#define STID_DISPLAY1_ZONE10            11010
+#define STID_DISPLAY1_ZONE11            11011
+#define STID_DISPLAY1_ZONE12            11012
+#define STID_DISPLAY1_ZONE13            11013
+#define STID_DISPLAY1_ZONE14            11014
+#define STID_DISPLAY1_ZONE15            11015
+#define STID_DISPLAY1_ZONE16            11016
+#define STID_DISPLAY1_ZONE17            11017
+#define STID_DISPLAY1_ZONE18            11018
+#define STID_DISPLAY1_ZONE19            11019
+#define STID_DISPLAY1_ZONE20            11020
+#define STID_DISPLAY1_NOOWER            11999
 
 // display0 category state id
 #define STID_DISPLAY0_CATEGORY          12000
 #define EVID_NIGHTMODE                 5000
 #define EVID_DRVREGULATION             9000
 
-#define EVID_DISPLAY0_ZONE             10000
-#define EVID_DISPLAY1_ZONE             11000
+#define EVID_DISPLAY_ZONE_ACQUIRE      10000
+#define EVID_DISPLAY_ZONE_RELEASE      10999
 
 #define EVID_DISPLAY0_CATEGORY         12000
 #define EVID_DISPLAY1_CATEGORY         13000
index ea57127..529d073 100644 (file)
@@ -31,6 +31,7 @@ using namespace std;
 #include "CicoSCMessage.h"
 #include "ico_syc_msg_cmd_def.h"
 #include "ico_syc_type.h"
+#include "CicoSCCommonDef.h"
 
 //==========================================================================
 //  define
@@ -66,6 +67,7 @@ typedef struct _vehicle_info_property_t {
 typedef struct _vehicle_info_data {
     int             key;    /* Vehicle Information key */
     DBusPendingCall *pending;
+    E_DBus_Signal_Handler *handler;
     int             request;
     double          val;
 } _vhcldata_t;
@@ -176,7 +178,17 @@ CicoSCPolicyManager::initialize(void)
 void
 CicoSCPolicyManager::terminate(void)
 {
+    int idx = 0;
+
     ICO_DBG("CicoSCPolicyManager::terminate Enter");
+
+    for (idx = 0; vhcl_data[idx].key; idx++) {
+        if (vhcl_data[idx].handler != NULL) {
+            e_dbus_signal_handler_del(m_dbusConnection, 
+                                      vhcl_data[idx].handler);
+        }
+    }
+
     ICO_DBG("CicoSCPolicyManager::terminate Leave");
 }
 
@@ -191,7 +203,8 @@ CicoSCPolicyManager::initAMB(void)
     ICO_DBG("CicoSCPolicyManager::initAMB Enter");
 
     int ret = 0;
-    DBusError dbus_error;
+    int idx;
+    char signalname[64];
 
     if (true == m_initialized) {
         ICO_DBG("CicoSCPolicyManager::initAMB Leave(EOK)");
@@ -201,19 +214,37 @@ CicoSCPolicyManager::initAMB(void)
     /* Zero clear vhcl_data */
     memset(vhcl_data, 0, sizeof(vhcl_data));
 
-    /* Reset D-Bus error */
-    dbus_error_init(&dbus_error);
+    e_dbus_init();
 
     /* Get D-Bus connection */
-    m_dbusConnection = dbus_bus_get(DBUS_BUS_SYSTEM, &dbus_error);
+    m_dbusConnection = e_dbus_bus_get(DBUS_BUS_SYSTEM);
     if (! m_dbusConnection) {
         ICO_ERR("dbus_bus_get failed.");
         ICO_ERR("CicoSCPolicyManager::initAMB Leave(EIO)");
         return ICO_SYC_EIO;
     }
 
-    /* send request to AMB */
-    sendAMBRequest();
+    /* receive propertychanged request to AMB */
+    for (idx = 0; apf_vhcl_info[idx].key; idx++) {
+        memset(signalname, 0, sizeof(signalname));
+        /* set vehicleinfo set key */
+        vhcl_data[idx].key = apf_vhcl_info[idx].key;
+
+        if (apf_vhcl_info[idx].path[0] == 0) {
+            /* currently not support this vehicle information */
+            continue;
+        }
+
+        strcpy(signalname, apf_vhcl_info[idx].property);
+        strcat(signalname, "Changed");
+        vhcl_data[idx].handler = e_dbus_signal_handler_add(m_dbusConnection, 
+                                                           DBUS_SERVICE, NULL,
+                                                           apf_vhcl_info[idx].interface,
+                                                           signalname, 
+                                                           AMBpropertyChanged, 
+                                                           (void*)&vhcl_data[idx].key);
+
+    }
 
     /* recv response from AMB timer start */
     ret = ecore_init();
@@ -245,6 +276,7 @@ CicoSCPolicyManager::initAMB(void)
 int
 CicoSCPolicyManager::sendAMBRequest(void)
 {
+#if 0
 //    ICO_DBG("CicoSCPolicyManager::sendAMBRequest Enter");
 
     DBusMessage *dbus_message = NULL;
@@ -318,6 +350,8 @@ CicoSCPolicyManager::sendAMBRequest(void)
 
     //ICO_DBG("CicoSCPolicyManager::sendAMBRequest Leave");
     return ret;
+#endif
+    return 0;
 }
 
 //--------------------------------------------------------------------------
@@ -328,6 +362,7 @@ CicoSCPolicyManager::sendAMBRequest(void)
 int
 CicoSCPolicyManager::getVehicleInfo(void)
 {
+    #if 0
     DBusMessage *dbus_message = NULL;
     DBusMessageIter iter_head;
     DBusMessageIter iter;
@@ -419,6 +454,8 @@ CicoSCPolicyManager::getVehicleInfo(void)
     };
 
     return ICO_SYC_EOK;
+#endif
+    return ICO_SYC_EOK;
 }
 
 //--------------------------------------------------------------------------
@@ -435,6 +472,79 @@ CicoSCPolicyManager::ecoreTimerCB(void *user_data)
 
     return ECORE_CALLBACK_RENEW;
 }
+//--------------------------------------------------------------------------
+/**
+ *  @brief  receive AMB vehicle information
+ */
+//--------------------------------------------------------------------------
+void
+CicoSCPolicyManager::AMBpropertyChanged(void *data, DBusMessage *msg) 
+{
+    DBusMessageIter iter, variant;
+    int idx;
+    char        type;
+    int32_t     i32;
+    int16_t     i16;
+    uint32_t    u32;
+    uint16_t    u16;
+    dbus_bool_t b;
+    uint8_t     u8;
+    double      d64;
+
+    int key;
+    key = *((int *)data);
+
+    if (!msg || !dbus_message_iter_init(msg, &iter)) {
+        ICO_ERR("received illegal message.");
+        return;
+    }
+
+    for (idx = 0; vhcl_data[idx].key; idx++) {
+        if (vhcl_data[idx].key == key) {
+            break;
+        }
+    }
+    if (idx == AMB_MAX_INFO) {
+        return;
+    }
+
+    dbus_message_iter_recurse(&iter, &variant);
+    type = dbus_message_iter_get_arg_type(&variant);
+    switch (type)   {
+    case DBUS_TYPE_INT32:
+        dbus_message_iter_get_basic(&variant, &i32);
+        vhcl_data[idx].val = (double)i32;
+        break;
+    case DBUS_TYPE_INT16:
+        dbus_message_iter_get_basic(&variant, &i16);
+        vhcl_data[idx].val = (double)i16;
+        break;
+    case DBUS_TYPE_UINT32:
+        dbus_message_iter_get_basic(&variant, &u32);
+        break;
+    case DBUS_TYPE_UINT16:
+        dbus_message_iter_get_basic(&variant, &u16);
+        vhcl_data[idx].val = (double)u16;
+        break;
+    case DBUS_TYPE_BOOLEAN:
+        dbus_message_iter_get_basic(&variant, &b);
+        if (b)      vhcl_data[idx].val = (double)1.0;
+        else        vhcl_data[idx].val = (double)0.0;
+        break;
+    case DBUS_TYPE_BYTE:
+        dbus_message_iter_get_basic(&variant, &u8);
+        vhcl_data[idx].val = (double)u8;
+        break;
+    case DBUS_TYPE_DOUBLE:
+        dbus_message_iter_get_basic(&variant, &d64);
+        vhcl_data[idx].val = (double)d64;
+        break;
+    default:
+        ICO_ERR("(%s) illegal data type(0x%02x)",
+                apf_vhcl_info[idx].property, ((int)type) & 0x0ff);
+        break;
+    }
+}
 
 //--------------------------------------------------------------------------
 /**
@@ -452,7 +562,7 @@ CicoSCPolicyManager::recvAMBVehicleInfo(void)
     bool chgRegulation = false;
     bool chgNightMode  = false;
 
-    getVehicleInfo();
+    //getVehicleInfo();
 
     /* get vehicle info values  */
     for (idx = 0; idx < AMB_MAX_VHCLINFO; idx++)   {
@@ -559,7 +669,7 @@ CicoSCPolicyManager::recvAMBVehicleInfo(void)
     }
         
     /* send request to AMB */
-    sendAMBRequest();
+    //sendAMBRequest();
 
 //    ICO_DBG("CicoSCPolicyManager::recvAMBVehicleInfo Leave");
 }
@@ -615,10 +725,90 @@ CicoSCPolicyManager::initStateMachine(void)
 #endif  //-- } debug dump
     }
 
-    m_dispZoneStates.push_back(NULL);
-    m_dispZoneStates.push_back(m_policyStates[STID_DISPLAY0_ZONE1]);
-    m_dispZoneStates.push_back(m_policyStates[STID_DISPLAY0_ZONE2]);
-    m_dispZoneStates.push_back(m_policyStates[STID_DISPLAY0_ZONE3]);
+    {
+        std::map<int, const CicoState*>::iterator itr;
+        itr = m_policyStates.find(STID_DISPLAY0_ZONE1);
+        m_dispZoneStates[1] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY0_ZONE2);
+        m_dispZoneStates[2] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY0_ZONE3);
+        m_dispZoneStates[3] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY0_ZONE4);
+        m_dispZoneStates[4] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY0_ZONE5);
+        m_dispZoneStates[5] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY0_ZONE6);
+        m_dispZoneStates[6] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY0_ZONE7);
+        m_dispZoneStates[7] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY0_ZONE8);
+        m_dispZoneStates[8] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY0_ZONE9);
+        m_dispZoneStates[9] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY0_ZONE10);
+        m_dispZoneStates[10] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY0_ZONE11);
+        m_dispZoneStates[11] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY0_ZONE12);
+        m_dispZoneStates[12] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY0_ZONE13);
+        m_dispZoneStates[13] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY0_ZONE14);
+        m_dispZoneStates[14] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY0_ZONE15);
+        m_dispZoneStates[15] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY0_ZONE16);
+        m_dispZoneStates[16] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY0_ZONE17);
+        m_dispZoneStates[17] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY0_ZONE18);
+        m_dispZoneStates[18] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY0_ZONE19);
+        m_dispZoneStates[19] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY0_ZONE20);
+        m_dispZoneStates[20] = itr != m_policyStates.end() ? itr->second : NULL;
+
+        itr = m_policyStates.find(STID_DISPLAY1_ZONE1);
+        m_dispZoneStates[21] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY1_ZONE2);
+        m_dispZoneStates[22] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY1_ZONE3);
+        m_dispZoneStates[23] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY1_ZONE4);
+        m_dispZoneStates[24] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY1_ZONE5);
+        m_dispZoneStates[25] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY1_ZONE6);
+        m_dispZoneStates[26] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY1_ZONE7);
+        m_dispZoneStates[27] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY1_ZONE8);
+        m_dispZoneStates[28] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY1_ZONE9);
+        m_dispZoneStates[29] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY1_ZONE10);
+        m_dispZoneStates[30] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY1_ZONE11);
+        m_dispZoneStates[31] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY1_ZONE12);
+        m_dispZoneStates[32] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY1_ZONE13);
+        m_dispZoneStates[33] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY1_ZONE14);
+        m_dispZoneStates[34] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY1_ZONE15);
+        m_dispZoneStates[35] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY1_ZONE16);
+        m_dispZoneStates[36] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY1_ZONE17);
+        m_dispZoneStates[37] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY1_ZONE18);
+        m_dispZoneStates[38] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY1_ZONE19);
+        m_dispZoneStates[39] = itr != m_policyStates.end() ? itr->second : NULL;
+        itr = m_policyStates.find(STID_DISPLAY1_ZONE20);
+        m_dispZoneStates[40] = itr != m_policyStates.end() ? itr->second : NULL;
+    }
 
     m_soundZoneStates.push_back(NULL);
     m_soundZoneStates.push_back(m_policyStates[STID_SOUND_ZONE1]);
@@ -708,14 +898,25 @@ CicoSCPolicyManager::acquireDisplayResource(int type, int zoneid, int priority)
     bool chg = false;
 
     if (RESID_TYPE_BASIC == type) {
-        bool zoneChg = testSMEvent(EVID_DISPLAY0_ZONE, zoneid);
+        bool zoneChg = testSMEvent(EVID_DISPLAY_ZONE_ACQUIRE, zoneid);
         bool cateChg = testSMEvent(EVID_DISPLAY0_CATEGORY, priority);
         ICO_DBG("zoneChg=%d cateChg=%d", zoneChg, cateChg);
         if ((true == zoneChg) && (true == cateChg)) {
-            sendSMEvent(EVID_DISPLAY0_ZONE, zoneid);
+            sendSMEvent(EVID_DISPLAY_ZONE_ACQUIRE, zoneid);
             sendSMEvent(EVID_DISPLAY0_CATEGORY, priority);
             chg = true;
         }
+#if 0   //-- { debug dump
+        else {
+            std::map<int, const CicoState*>::iterator itr;
+            itr = m_policyStates.begin();
+            for (; itr != m_policyStates.end(); ++itr) {
+                ICO_DBG("State=[%-45s] Active=%s",
+                        itr->second->getName().c_str(),
+                        itr->second->isActive() ? "true" : "false");
+            }
+        }
+#endif  //-- } debug dump
     }
     else if (RESID_TYPE_INTERRUPT == type) {
         if (1 == zoneid) {
@@ -739,7 +940,7 @@ CicoSCPolicyManager::acquireDisplayResource(int type, int zoneid, int priority)
 bool
 CicoSCPolicyManager::releaseDisplayResource(int zoneid, int priority)
 {
-    return true;
+    return sendSMEvent(EVID_DISPLAY_ZONE_RELEASE, zoneid);
 }
 
 bool
@@ -845,12 +1046,25 @@ CicoSCPolicyManager::notifyChangedState(int state)
 }
 
 bool
-CicoSCPolicyManager::getDispZoneState(int zoneid) const
+CicoSCPolicyManager::getDispZoneState(int zoneid)
 {
-    if ((0 < zoneid) && ((int)m_dispZoneStates.size()-1 > zoneid)) {
-        return m_dispZoneStates[zoneid]->isActive();
+    if (0 >= zoneid) {
+        return false;
     }
-    return false;
+
+    // find state instance
+    std::map<int, const CicoState*>::iterator itr;
+    itr = m_dispZoneStates.find(zoneid);
+    if (itr == m_dispZoneStates.end()) {
+        return false;
+    }
+
+    // if state instance is null
+    if (NULL == itr->second) {
+        return false;
+    }
+        
+    return itr->second->isActive();
 }
 
 bool
@@ -871,6 +1085,26 @@ CicoSCPolicyManager::getInputState(int input) const
     return false;
 }
 
+bool
+CicoSCPolicyManager::getRegulation(void)
+{
+    return m_policyStates[STID_DRVREGULATION_ON]->isActive();
+}
+
+bool
+CicoSCPolicyManager::isExistDisplayZoneOwer(int zoneid)
+{
+    if ((zoneid >= ICO_DISPLAY0_ZONEID_MIN) &&
+        (zoneid <= ICO_DISPLAY0_ZONEID_MAX)) {
+        return !m_policyStates[STID_DISPLAY0_NOOWER]->isActive();
+    }
+    if ((zoneid >= ICO_DISPLAY1_ZONEID_MIN) &&
+        (zoneid <= ICO_DISPLAY1_ZONEID_MAX)) {
+        return !m_policyStates[STID_DISPLAY1_NOOWER]->isActive();
+    }
+    return true;
+}
+
 //--------------------------------------------------------------------------
 /**
  *  @brief  notify connected
index 5007d37..7d5677a 100644 (file)
@@ -20,6 +20,7 @@
 #include <Ecore.h>
 #include <Eina.h>
 #include <dbus/dbus.h>
+#include <E_DBus.h>
 
 #include <map>
 #include <vector>
@@ -75,13 +76,18 @@ public:
     // get states
     const std::map<int, const CicoState*>& getPolicyStates(void);
 
-    bool getDispZoneState(int zoneid) const;
+    bool getDispZoneState(int zoneid);
     bool getSoundZoneState(int zoneid) const;
     bool getInputState(int input) const;
+    bool getRegulation(void);
+
+    bool isExistDisplayZoneOwer(int zoneid);
 
     // notify connected process
     void notifyConnected(const std::string & appid);
 
+    static void AMBpropertyChanged(void *data, DBusMessage *msg);
+
 private:
     // default constructor
     CicoSCPolicyManager();
@@ -109,14 +115,14 @@ private:
 
 private:
     bool                  m_initialized;
-    DBusConnection        *m_dbusConnection;
+    E_DBus_Connection     *m_dbusConnection;
     Ecore_Timer           *m_ecoreTimer;
 
     CicoStateMachine      *m_stateMachine;
     CicoSCResourceManager *m_resourceMgr;
 
-    std::map<int, const CicoState*>  m_policyStates;
-    std::vector<const CicoState*> m_dispZoneStates;
+    std::map<int, const CicoState*> m_policyStates;
+    std::map<int, const CicoState*> m_dispZoneStates;
     std::vector<const CicoState*> m_soundZoneStates;
     std::vector<const CicoState*> m_inputStates;
 };
index fe4aaab..26e38d6 100644 (file)
@@ -107,7 +107,8 @@ struct CompInputResourceRequest
 
 
 CicoSCResourceManager::CicoSCResourceManager()
-    : m_winCtrl(NULL), m_inputCtrl(NULL)
+    : m_policyMgr(NULL), m_winCtrl(NULL), m_inputCtrl(NULL),
+      m_animaName("Fade"), m_animaTime(400)
 {
     m_policyMgr = new CicoSCPolicyManager(this);
 
@@ -221,7 +222,14 @@ CicoSCResourceManager::handleCommand(const CicoSCCommand &cmd,
                 acquireDisplayResource(req, false);
             }
             else {
-                acquireDisplayResource(req);
+                if ((true == m_policyMgr->getRegulation()) &&
+                    (false == isMatchDisplayed())) {
+                    updateDispResRegulationPreProc(req);
+                    updateDisplayResourceRegulation(STID_DRVREGULATION_ON);
+                }
+                else {
+                    acquireDisplayResource(req);
+                }
             }
 
         }
@@ -229,13 +237,28 @@ CicoSCResourceManager::handleCommand(const CicoSCCommand &cmd,
             resource_request_t *req = newResourceRequest(RESID_KIND_SOUND,
                                                          reqtype,
                                                          cmd);
-            acquireSoundResource(req);
+            if ((true == m_policyMgr->getRegulation()) &&
+                (false == isMatchDisplayed())) {
+                updateSoundResRegulationPreProc(req);
+                updateSoundResourceRegulation(STID_DRVREGULATION_ON);
+            }
+            else {
+                acquireSoundResource(req);
+            }
+
         }
         if (true == opt->inputres) {
             resource_request_t *req = newResourceRequest(RESID_KIND_INPUT,
                                                          reqtype,
                                                          cmd);
-            acquireInputResource(req);
+            if ((true == m_policyMgr->getRegulation()) &&
+                (false == isMatchDisplayed())) {
+                updateInputResRegulationPreProc(req);
+                updateInputResourceRegulation(STID_DRVREGULATION_ON);
+            }
+            else {
+                acquireInputResource(req);
+            }
         }
     }
     else if ((MSG_CMD_RELEASE_RES == cmd.cmdid) ||
@@ -396,6 +419,7 @@ CicoSCResourceManager::acquireDisplayResource(resource_request_t *newreq,
                 req->dispzone, newreq->dispzone);
         if (req->dispzoneid != newreq->dispzoneid) {
             req = popCurDispResOwerReq(req);
+            m_policyMgr->releaseDisplayResource(req->dispzoneid, req->prio);
             chgzone = newreq->dispzoneid;
         }
     }
@@ -448,15 +472,27 @@ CicoSCResourceManager::acquireDisplayResource(resource_request_t *newreq,
         updateDisplayResource(req, chgzone);
     }
     else {
+        if (-1 != chgzone) {
+            // move request window
+            m_winCtrl->setGeometry(req->surfaceid, req->dispzone,
+                                   req->animation, req->animationTime,
+                                   req->animation, req->animationTime);
+        }
+        else {
+            // just in case, hide window
+            if (NULL != m_winCtrl) {
+                // hide request window
+                m_winCtrl->hide(req->surfaceid, NULL, 0);
+            }
+        }
         ICO_DBG("Enqueue waiting display resource request"
-                "(req=0x%08x appid=%s)", req, req->appid);
+                    "(req=0x%08x appid=%s)", req, req->appid);
         m_waitingDispResReq.push_front(req);
 #if 1   //DEBUG
         dumpWaitingDispResReq();
 #endif  //DEBUG
     }
 
-
     ICO_DBG("CicoSCResourceManager::acquireDisplayResource Leave");
     return true;
 }
@@ -479,6 +515,7 @@ CicoSCResourceManager::releaseDisplayResource(resource_request_t *newreq)
     // if exist current ower request, pop request
     req = popCurDispResOwerReq(newreq);
     if (NULL != req) {
+        m_policyMgr->releaseDisplayResource(req->dispzoneid, req->prio);
         delResourceRequest(req);
     }
     delResourceRequest(newreq);
@@ -486,6 +523,9 @@ CicoSCResourceManager::releaseDisplayResource(resource_request_t *newreq)
     list<resource_request_t*>::iterator itr;
     itr = m_waitingDispResReq.begin();
     for (; itr != m_waitingDispResReq.end(); ++itr) {
+        if (NULL != m_curDispResOwerReq[(*itr)->dispzoneid]) {
+            continue;
+        }
         int type = (*itr)->resid & RESID_TYPE_MASK;
         bool active = m_policyMgr->acquireDisplayResource(type,
                                                          (*itr)->dispzoneid,
@@ -493,7 +533,7 @@ CicoSCResourceManager::releaseDisplayResource(resource_request_t *newreq)
         if (true == active) {
             resource_request_t* popreq = popWaitingDispResReq(*itr);
             updateDisplayResource(popreq);
-            m_winCtrl->active(popreq->surfaceid, -1);
+            m_winCtrl->activeCB(NULL, NULL, popreq->surfaceid, -1);
             break;
         }
     }
@@ -601,6 +641,10 @@ CicoSCResourceManager::releaseSoundResource(resource_request_t *newreq)
         list<resource_request_t*>::iterator itr2;
         itr2 = itr->second.begin();
         for (; itr2 !=  itr->second.end(); ++itr2) {
+            if (NULL != m_curSoundResReq[(*itr2)->soundzoneid]) {
+                continue;
+            }
+
             int type = (*itr2)->resid & RESID_TYPE_MASK;
             bool active = m_policyMgr->acquireSoundResource(type,
                                                             (*itr2)->soundzoneid,
@@ -697,6 +741,9 @@ CicoSCResourceManager::releaseInputResource(resource_request_t *newreq)
         list<resource_request_t*>::iterator itr2;
         itr2 = itr->second.begin();
         for (; itr2 !=  itr->second.end(); ++itr2) {
+            if (NULL != m_curInputResReq[(*itr2)->input]) {
+                continue;
+            }
             bool active = m_policyMgr->acquireInputResource((*itr2)->input,
                                                             (*itr2)->prio);
             if (true == active) {
@@ -816,9 +863,14 @@ CicoSCResourceManager::receiveChangedState(int state)
     ICO_DBG("CicoSCResourceManager::receiveChangedState Enter"
             "(state=%d)", state);
 
-    if ((STID_DRVREGULATION_ON == state)||
-        (STID_DRVREGULATION_OFF == state)) {
-
+    if (STID_DRVREGULATION_ON == state) { 
+        if (true == isMatchDisplayed()) {
+            updateDisplayResourceRegulation(state);
+            updateSoundResourceRegulation(state);
+            updateInputResourceRegulation(state);
+        }
+    }
+    else {
         updateDisplayResourceRegulation(state);
         updateSoundResourceRegulation(state);
         updateInputResourceRegulation(state);
@@ -846,6 +898,7 @@ CicoSCResourceManager::updateDisplayResource(resource_request_t *req,
 {
     ICO_DBG("CicoSCResourceManager::updateDisplayResource Enter"
             "(req=0x%08x)", req);
+
     std::map<unsigned int, resource_request_t*>::iterator itr;
     itr = m_curDispResOwerReq.find(req->dispzoneid);
     if ((m_curDispResOwerReq.end() != itr) && (NULL != itr->second)) {
@@ -855,7 +908,7 @@ CicoSCResourceManager::updateDisplayResource(resource_request_t *req,
                     req->appid, req->pid, req->surfaceid);
             // show request window
             m_winCtrl->show(req->surfaceid, req->animation, req->animationTime);
-            m_winCtrl->active(req->surfaceid, -1);
+            m_winCtrl->activeCB(NULL, NULL, req->surfaceid, -1);
             return;
         }
         resource_request_t *popreq = popCurDispResOwerReq(itr->second);
@@ -876,7 +929,33 @@ CicoSCResourceManager::updateDisplayResource(resource_request_t *req,
 #endif  //DEBUG
         }
     }
+
+    std::map<unsigned int, resource_request_t*>::iterator itr2;
+    itr2 = m_curDispResOwerReq.begin();
+    for (; itr2 != m_curDispResOwerReq.end(); ++itr2) {
+        resource_request_t *tmpreq = itr2->second;
         
+        if (true == m_policyMgr->getDispZoneState(itr2->first)) {
+            continue;
+        }
+
+        if (NULL == itr2->second) {
+            continue;
+        }
+
+        ICO_DBG("Dequeue current display resource ower request"
+                "(req=0x%08x zoneid=%d appid=%s)",
+                tmpreq, tmpreq->dispzoneid, tmpreq->appid);
+        itr2->second = NULL;
+
+        // hide current window
+        m_winCtrl->hide(tmpreq->surfaceid, NULL, 0);
+
+        ICO_DBG("Enqueue waiting display resource request"
+                "(req=0x%08x appid=%s", tmpreq, tmpreq->appid);
+        m_waitingDispResReq.push_front(tmpreq);
+    }
+
     if (NULL != m_winCtrl) {
         if (-1 != chgzoneid) {
             // move request window
@@ -906,6 +985,11 @@ CicoSCResourceManager::updateDisplayResource(resource_request_t *req,
             if (m_curDispResOwerReq[(*itr)->dispzoneid] != NULL) {
                 continue;
             }
+
+            if (true == m_policyMgr->isExistDisplayZoneOwer((*itr)->dispzoneid)) {
+                continue;
+            }
+
             int type = (*itr)->resid & RESID_TYPE_MASK;
             bool active = false;
             active = m_policyMgr->acquireDisplayResource(type,
@@ -1035,8 +1119,8 @@ CicoSCResourceManager::updateDisplayResourceRegulation(int state)
             if (false == active) {
                 if (NULL != m_winCtrl) {
                     // hide current window
-                    // TODO animation?
-                    m_winCtrl->hide(current->surfaceid, NULL, 0);
+                    m_winCtrl->hide(current->surfaceid,
+                                    m_animaName.c_str(), m_animaTime);
                 }
                 curchg = true;
             }
@@ -1059,9 +1143,8 @@ CicoSCResourceManager::updateDisplayResourceRegulation(int state)
             if (true == active) {
                 if (NULL != m_winCtrl) {
                     // show current window
-                    // TODO animation?
-                    m_winCtrl->show((*itr2)->surfaceid, NULL, 0);
-                    m_winCtrl->active((*itr2)->surfaceid, -1);
+                    m_winCtrl->show((*itr2)->surfaceid,
+                                    m_animaName.c_str(), m_animaTime);
                 }
                 break;
             }
@@ -1073,22 +1156,84 @@ CicoSCResourceManager::updateDisplayResourceRegulation(int state)
         for (; itr != m_curDispResOwerReq.end(); ++itr) {
             resource_request_t *current = itr->second;
             if (NULL == current) {
-                continue;
-            }
+                if (true == m_policyMgr->isExistDisplayZoneOwer(itr->first)) {
+                    if (NULL != m_winCtrl) {
+                        int surfaceid = m_winCtrl->getDisplayedWindow(itr->first);
 
-            int type = current->resid & RESID_TYPE_MASK;
-            bool active = false;
-            active = m_policyMgr->acquireDisplayResource(type,
-                                                         current->dispzoneid,
-                                                         current->prio);
-            if (true == active) {
-                if (NULL != m_winCtrl) {
-                    // show current window
-                    // TODO animation?
-                    m_winCtrl->show(current->surfaceid, NULL, 0);
-                    m_winCtrl->active(current->surfaceid, -1);
+#if 0
+                        if ((surfaceid > 0) && (NULL != itr->second) &&
+                            (itr->second->surfaceid != surfaceid)) {
+                            m_winCtrl->hide(surfaceid,
+                                            m_animaName.c_str(),
+                                            m_animaTime);
+                        }
+#else
+                        if (surfaceid > 0) {
+                            m_winCtrl->hide(surfaceid,
+                                            m_animaName.c_str(),
+                                            m_animaTime);
+                        }
+
+#endif
+                    }
+                    continue;
+                }
+                list<resource_request_t*>::iterator itr2;
+                itr2 = m_waitingDispResReq.begin();
+                for (; itr2 != m_waitingDispResReq.end(); ++itr2) {
+                    resource_request_t *req = *itr2;
+                    if (itr->first != (unsigned int)req->dispzoneid) {
+                        continue;
+                    }
+                    int type = req->resid & RESID_TYPE_MASK;
+                    bool active = false;
+                    active = m_policyMgr->acquireDisplayResource(type,
+                                                                 req->dispzoneid,
+                                                                 req->prio);
+                    if (true == active) {
+                        ICO_DBG("Dequeue waiting display resource request"
+                                "(req=0x%08x appid=%s)", req, req->appid);
+                        m_waitingDispResReq.erase(itr2);
+                        ICO_DBG("Enqueue current display resource request"
+                                "(req=0x%08x appid=%s)", req, req->appid);
+                        m_curDispResOwerReq[req->dispzoneid] = req;
+#if 1   //DEBUG
+                        dumpCurDispResOwerReq();
+                        dumpWaitingDispResReq();
+#endif  //DEBUG
+                        m_winCtrl->show(req->surfaceid,
+                                        m_animaName.c_str(), m_animaTime);
+                        m_winCtrl->active(req->surfaceid, -1);
+                        break;
+                    }
                 }
             }
+            else {
+                int type = current->resid & RESID_TYPE_MASK;
+                bool active = false;
+                active = m_policyMgr->acquireDisplayResource(type,
+                                                             current->dispzoneid,
+                                                             current->prio);
+                if (true == active) {
+                    if (NULL != m_winCtrl) {
+                        int surfaceid = m_winCtrl->getDisplayedWindow(
+                                                    itr->second->dispzoneid);
+                        if ((itr->second->surfaceid != surfaceid) &&
+                            (surfaceid > 0)) {
+                            m_winCtrl->hide(surfaceid,
+                                            m_animaName.c_str(), m_animaTime);
+                        }
+                        // show current window
+                        m_winCtrl->show(current->surfaceid,
+                                        m_animaName.c_str(), m_animaTime);
+                    }
+                }
+#if 1   //DEBUG
+                        dumpCurDispResOwerReq();
+                        dumpWaitingDispResReq();
+#endif  //DEBUG
+            }
         }
     }
 
@@ -1224,7 +1369,7 @@ CicoSCResourceManager::updateInputResourceRegulation(int state)
         }
     }
 
-    ICO_DBG("CicoSCResourceManager::updateDisplayResourceRegulation Leave");
+    ICO_DBG("CicoSCResourceManager::updateInputResourceRegulation Leave");
 }
 
 //--------------------------------------------------------------------------
@@ -1275,7 +1420,7 @@ CicoSCResourceManager::popCurDispResOwerReq(resource_request_t *req)
     for (; itr != m_curDispResOwerReq.end(); ++itr) {
         CompDisplayResourceRequest comp(req);
         if (true == comp(itr->second)) {
-            ICO_DBG("Dequeue current display reoursce ower request"
+            ICO_DBG("Dequeue current display resource ower request"
                     "(req=0x%08x zoneid=%d appid=%s)",
                     itr->second, itr->first, itr->second->appid);
             resource_request_t *findreq = itr->second;
@@ -1390,4 +1535,307 @@ CicoSCResourceManager::dumpWaitingDispResReq(void)
         }
     }
 }
+
+//--------------------------------------------------------------------------
+/**
+ *  @brief  update display request for regulation pre-process
+ */
+//--------------------------------------------------------------------------
+void
+CicoSCResourceManager::updateDispResRegulationPreProc(resource_request_t *req)
+{
+    ICO_DBG("CicoSCResourceManager::updateDispResRegulationPreProc Enter");
+#if 1   //DEBUG
+    dumpCurDispResOwerReq();
+    dumpWaitingDispResReq();
+#endif  //DEBUG
+
+    if (NULL == req) {
+        ICO_DBG("CicoSCResourceManager::updateDispResRegulationPreProc Leave");
+        return;
+    }
+
+    if (false == m_policyMgr->getRegulation()) {
+        ICO_DBG("CicoSCResourceManager::updateDispResRegulationPreProc Leave");
+        return;
+    }
+
+    CicoSCSystemConfig *sysConf = CicoSCSystemConfig::getInstance();
+    const CicoSCAppKindConf *appKindConf = NULL;
+    appKindConf = sysConf->findAppKindConfbyId(req->appkind);
+    if (NULL == appKindConf) {
+        ICO_ERR("not found CicoSCAppKindConf instance");
+        ICO_DBG("CicoSCResourceManager::updateDispResRegulationPreProc Leave");
+        return;
+    }
+
+    if ((appKindConf->privilege == CicoSCAppKindConf::PRIVILEGE_ALMIGHTY) ||
+        (appKindConf->privilege == CicoSCAppKindConf::PRIVILEGE_SYSTEM)   ||
+        (appKindConf->privilege == CicoSCAppKindConf::PRIVILEGE_SYSTEM_VISIBLE)) {
+
+        if (NULL != m_winCtrl) {
+            m_winCtrl->show(req->surfaceid,
+                            req->animation,
+                            req->animationTime);
+        }
+        delResourceRequest(req);
+
+        ICO_DBG("kind of system application");
+        ICO_DBG("CicoSCResourceManager::updateDispResRegulationPreProc Leave");
+        return;
+    }
+
+    int surfaceid = req->surfaceid;
+    if (NULL != m_winCtrl) {
+        surfaceid = m_winCtrl->getDisplayedWindow(req->dispzoneid);
+        if (-1 == surfaceid) {
+            ICO_WRN("displayed surface id is invalid.");
+            surfaceid = req->surfaceid;
+        }
+    }
+
+    if (req->surfaceid != surfaceid) {
+        ICO_WRN("req->surfaceid(0x%08X) != displayedsurfaceid(0x%08X)",
+                req->surfaceid, surfaceid);
+    }
+
+    resource_request_t *curreq = NULL;
+    int min = ICO_DISPLAY0_ZONEID_MIN;
+    int max = ICO_DISPLAY0_ZONEID_MAX;
+    if ((req->dispzoneid >= min) && (req->dispzoneid <= max)) {
+        for (int i = min; i <= max; ++i) {
+            std::map<unsigned int, resource_request_t*>::iterator itr;
+            itr = m_curDispResOwerReq.find(i);
+            if (itr != m_curDispResOwerReq.end()) {
+                if (NULL != itr->second) {
+                    curreq = itr->second;
+                    break;
+                }
+            }
+        }
+    }
+    
+    min = ICO_DISPLAY1_ZONEID_MIN;
+    max = ICO_DISPLAY1_ZONEID_MAX;
+    if ((NULL == curreq) && 
+        (req->dispzoneid >= min) && (req->dispzoneid <= max)) {
+        for (int i = min; i <= max; ++i) {
+            std::map<unsigned int, resource_request_t*>::iterator itr;
+            itr = m_curDispResOwerReq.find(i);
+            if (itr != m_curDispResOwerReq.end()) {
+                if (NULL != itr->second) {
+                    curreq = itr->second;
+                    break;
+                }
+            }
+        }
+    }
+
+#if 0
+    resource_request_t *curreq = NULL;
+    std::map<unsigned int, resource_request_t*>::iterator itr;
+    itr = m_curDispResOwerReq.find(req->dispzoneid);
+    if (itr != m_curDispResOwerReq.end()) {
+        curreq = itr->second;
+    }
+#endif
+
+    if (NULL != curreq) {
+        ICO_DBG("Dequeue current display resource request"
+                "(req=0x%08x zone:%02d:%s appid=%s)",
+                curreq, curreq->dispzoneid, curreq->dispzone, curreq->appid);
+        m_curDispResOwerReq[curreq->dispzoneid] = NULL;
+
+        if (curreq->surfaceid != req->surfaceid) {
+            resource_request_t *waitreq = popWaitingDispResReq(req);
+            ICO_DBG("Enqueue waiting display resource request"
+                    "(req=0x%08x zone:%02d:%s appid=%s)",
+                    curreq, curreq->dispzoneid,
+                    curreq->dispzone, curreq->appid);
+            m_waitingDispResReq.push_front(curreq);
+
+            if (NULL != waitreq) {
+                ICO_DBG("Enqueue current display resource request"
+                        "(req=0x%08x zone:%02d:%s appid=%s)",
+                        waitreq, waitreq->dispzoneid,
+                        waitreq->dispzone, waitreq->appid);
+                m_curDispResOwerReq[waitreq->dispzoneid] = waitreq;
+            }
+        }
+        else {
+            ICO_DBG("Enqueue current display resource request"
+                    "(req=0x%08x zone:%02d:%s appid=%s)",
+                    curreq, curreq->dispzoneid,
+                    curreq->dispzone, curreq->appid);
+            m_curDispResOwerReq[curreq->dispzoneid] = curreq;
+        }
+    }
+    delResourceRequest(req);
+
+#if 1   //DEBUG
+    dumpCurDispResOwerReq();
+    dumpWaitingDispResReq();
+#endif  //DEBUG
+    ICO_DBG("CicoSCResourceManager::updateDispResRegulationPreProc Leave");
+}
+
+//--------------------------------------------------------------------------
+/**
+ *  @brief  update sound request for regulation pre-process
+ */
+//--------------------------------------------------------------------------
+void
+CicoSCResourceManager::updateSoundResRegulationPreProc(resource_request_t *req)
+{
+    if (NULL == req) {
+        return;
+    }
+
+    if (false == m_policyMgr->getRegulation()) {
+        return;
+    }
+
+    CicoSCSystemConfig *sysConf = CicoSCSystemConfig::getInstance();
+    const CicoSCAppKindConf *appKindConf = NULL;
+    appKindConf = sysConf->findAppKindConfbyId(req->appkind);
+    if (NULL == appKindConf) {
+        ICO_ERR("not found CicoSCAppKindConf instance");
+        ICO_DBG("CicoSCResourceManager::acquireSoundResource Leave(false)");
+        return;
+    }
+
+    if ((appKindConf->privilege == CicoSCAppKindConf::PRIVILEGE_ALMIGHTY) ||
+        (appKindConf->privilege == CicoSCAppKindConf::PRIVILEGE_SYSTEM)   ||
+        (appKindConf->privilege == CicoSCAppKindConf::PRIVILEGE_SYSTEM_AUDIO)) {
+
+        delResourceRequest(req);
+
+        ICO_DBG("kind of system application");
+        ICO_DBG("CicoSCResourceManager::acquireSoundResource Leave(true)");
+        return;
+    }
+
+    resource_request_t *curreq = NULL;
+    std::map<int, resource_request_t*>::iterator itr;
+    itr = m_curSoundResReq.find(req->soundzoneid);
+    if (itr != m_curSoundResReq.end()) {
+        curreq = itr->second;
+    }
+
+    if (NULL != curreq) {
+        ICO_DBG("Dequeue current sound resource request"
+                "(req=0x%08x zone:%02d appid=%s)",
+                curreq, curreq->soundzoneid, curreq->appid);
+        m_curSoundResReq[curreq->soundzoneid] = NULL;
+
+        if (0 != strcmp(curreq->appid, req->appid)) {
+            resource_request_t *waitreq = popSoundResReq(req);
+            ICO_DBG("Enqueue waiting sound resource request"
+                    "(req=0x%08x zone:%02d appid=%s)",
+                    curreq, curreq->soundzoneid, curreq->appid);
+            m_soundReqQueue[curreq->soundzoneid].push_front(curreq);
+
+            if (NULL != waitreq) {
+                ICO_DBG("Enqueue current sound resource request"
+                        "(req=0x%08x zone:%02d appid=%s)",
+                        waitreq, waitreq->soundzoneid, waitreq->appid);
+                m_curSoundResReq[curreq->soundzoneid] = waitreq;
+            }
+        }
+        else {
+            ICO_DBG("Enqueue current sound resource request"
+                    "(req=0x%08x zone:%02d appid=%s)",
+                    curreq, curreq->soundzoneid, curreq->appid);
+            m_curSoundResReq[curreq->soundzoneid] = curreq;
+        }
+    }
+    delResourceRequest(req);
+}
+
+//--------------------------------------------------------------------------
+/**
+ *  @brief  update input request for regulation pre-process
+ */
+//--------------------------------------------------------------------------
+void
+CicoSCResourceManager::updateInputResRegulationPreProc(resource_request_t *req)
+{
+    if (NULL == req) {
+        return;
+    }
+
+    if (false == m_policyMgr->getRegulation()) {
+        return;
+    }
+
+    resource_request_t *curreq = NULL;
+    std::map<int, resource_request_t*>::iterator itr;
+    itr = m_curInputResReq.find(req->input);
+    if (itr != m_curInputResReq.end()) {
+        curreq = itr->second;
+    }
+
+    if (NULL != curreq) {
+        ICO_DBG("Dequeue current input resource request"
+                "(req=0x%08x zone:%02d appid=%s)",
+                curreq, curreq->input, curreq->appid);
+        m_curInputResReq[curreq->input] = NULL;
+
+        if (0 != strcmp(curreq->appid, req->appid)) {
+            resource_request_t *waitreq = popInputResReq(req);
+            ICO_DBG("Enqueue waiting input resource request"
+                    "(req=0x%08x zone:%02d appid=%s)",
+                    curreq, curreq->input, curreq->appid);
+            m_inputReqQueue[curreq->input].push_front(curreq);
+
+            if (NULL != waitreq) {
+                ICO_DBG("Enqueue current input resource request"
+                        "(req=0x%08x zone:%02d appid=%s)",
+                        waitreq, waitreq->input, waitreq->appid);
+                m_curInputResReq[curreq->input] = waitreq;
+            }
+        }
+        else {
+            ICO_DBG("Enqueue current input resource request"
+                    "(req=0x%08x zone:%02d appid=%s)",
+                    curreq, curreq->input, curreq->appid);
+            m_curInputResReq[curreq->input] = curreq;
+        }
+    }
+    delResourceRequest(req);
+}
+
+//--------------------------------------------------------------------------
+/**
+ *  @brief  compare displayed surface and ower surface
+ */
+//--------------------------------------------------------------------------
+bool
+CicoSCResourceManager::isMatchDisplayed(void)
+{
+    bool ret = false;
+    std::map<unsigned int, resource_request_t*>::iterator itr;
+    itr = m_curDispResOwerReq.begin();
+    for (; itr != m_curDispResOwerReq.end(); ++itr) {
+        if (NULL == itr->second) {
+            continue;
+        }
+        if (NULL != m_winCtrl) {
+            int surfaceid = m_winCtrl->getDisplayedWindow(
+                                        itr->second->dispzoneid);
+            std::map<unsigned int, resource_request_t*>::iterator itr2;
+            itr2 = m_curDispResOwerReq.begin();
+            for (; itr2 != m_curDispResOwerReq.end(); ++itr2) {
+                if (NULL == itr2->second) {
+                    continue;
+                }
+                if ((itr2->second->surfaceid == surfaceid)) {
+                    ret = true;
+                    break;
+                }
+            }
+        }
+    }
+    return ret;
+}
 // vim:set expandtab ts=4 sw=4:
index 42dc7c5..b3d13d9 100644 (file)
@@ -108,6 +108,10 @@ private:
     void updateSoundResourceRegulation(int state);
     void updateInputResourceRegulation(int state);
 
+    void updateDispResRegulationPreProc(resource_request_t *req);
+    void updateSoundResRegulationPreProc(resource_request_t *req);
+    void updateInputResRegulationPreProc(resource_request_t *req);
+
     resource_request_t * findCurDispResOwerReq(resource_request_t *req);
     resource_request_t * popCurDispResOwerReq(resource_request_t *req);
     void dumpCurDispResOwerReq(void);
@@ -116,6 +120,8 @@ private:
     resource_request_t * popWaitingDispResReq(resource_request_t *req);
     void dumpWaitingDispResReq(void);
 
+    bool isMatchDisplayed(void);
+
 private:
     CicoSCPolicyManager       *m_policyMgr;
     CicoSCWindowController    *m_winCtrl;
@@ -129,6 +135,12 @@ private:
     std::list<resource_request_t*> m_waitingDispResReq;
     map<int, list<resource_request_t*> > m_soundReqQueue;
     map<int, list<resource_request_t*> > m_inputReqQueue;
+
+    // show/hide animation name at regulation on or off
+    const std::string m_animaName;
+
+    // show/hide animation time at regulation on or off
+    int m_animaTime;
 };
 #endif  // __CICO_SC_RESOURCE_MANAGER_H__
 // vim:set expandtab ts=4 sw=4:
index 438e09a..d958f1b 100644 (file)
@@ -63,7 +63,8 @@ CicoSCServer* CicoSCServer::ms_myInstance = NULL;
 //--------------------------------------------------------------------------
 CicoSCServer::CicoSCServer()
     : m_uwsContext(NULL), m_windowCtrl(NULL),
-      m_inputCtrl(NULL) , m_userMgr(NULL), m_resourceMgr(NULL)
+      m_inputCtrl(NULL) , m_userMgr(NULL), m_resourceMgr(NULL),
+      m_policyMgr(NULL), m_dispatchProcessing(false)
 {
 }
 
@@ -282,6 +283,12 @@ CicoSCServer::dispatch(const CicoSCUwsHandler *handler)
         return;
     }
 
+    if (true == m_dispatchProcessing) {
+        ICO_DBG("CicoSCServer::dispatch Leave(disptch processing)");
+        return;
+    }
+
+    m_dispatchProcessing = true;
     list<CicoSCCommand*>::iterator itr;
     itr = m_recvCmdQueue.begin();
     while(itr != m_recvCmdQueue.end()) {
@@ -315,6 +322,7 @@ CicoSCServer::dispatch(const CicoSCUwsHandler *handler)
         }
         delete cmd;
     }
+    m_dispatchProcessing = false;
 
     if (NULL == handler->ecoreFdHandler) {
         ICO_ERR("ecoreFdHandler is null");
index ac5253f..5288b0f 100644 (file)
@@ -139,6 +139,8 @@ private:
     CicoSCResourceManager   *m_resourceMgr;  ///< resource manager instance
     CicoSCPolicyManager     *m_policyMgr;    ///< policy manager instance
 
+    bool m_dispatchProcessing;
+
     /// websocket handler list
     std::list<CicoSCUwsHandler*> m_uwsHandlerList;
 
index 7f15752..f23b912 100644 (file)
@@ -285,11 +285,9 @@ CicoSCSystemConfig::createDisplayConfList(const ptree & root)
         optional<string> name;
         optional<string> node;
         optional<int> no = optional<int>(-1);
-        optional<string> wayland;
         optional<string> type;
         optional<int> width = optional<int>(-1);
         optional<int> height = optional<int>(-1);
-        optional<int> inch = optional<int>(-1);
 
         id = child.second.get_optional<int>("<xmlattr>.id");
         if (false == id.is_initialized()) {
@@ -311,11 +309,6 @@ CicoSCSystemConfig::createDisplayConfList(const ptree & root)
             ICO_ERR("display.no element not found");
             continue;
         }
-        wayland = child.second.get_optional<string>("wayland");
-        if (false == wayland.is_initialized()) {
-            ICO_ERR("display.wayland element not found");
-            continue;
-        }
         type = child.second.get_optional<string>("type");
         if (false == type.is_initialized()) {
             ICO_ERR("display.type element not found");
@@ -331,11 +324,6 @@ CicoSCSystemConfig::createDisplayConfList(const ptree & root)
             ICO_ERR("display.height element not found");
             continue;
         }
-        inch = child.second.get_optional<int>("inch");
-        if (false == inch.is_initialized()) {
-            ICO_ERR("display.inch element not found");
-            continue;
-        }
 
         CicoSCDisplayConf* displayConf = new CicoSCDisplayConf();
         displayConf->id     = id.get();
@@ -345,19 +333,12 @@ CicoSCSystemConfig::createDisplayConfList(const ptree & root)
         displayConf->type   = m_displayTypeTable[type.get()];
         displayConf->width  = width.get();
         displayConf->height = height.get();
-        displayConf->inch   = inch.get();
 
         displayConf->dumpConf();
 
         createLayerConf(child, displayConf);
         createDisplayZoneConf(child, displayConf);
 
-        // TODO overlap to zoneid
-        vector<CicoSCDisplayZoneConf*>::iterator itr;
-        itr = displayConf->zoneConfList.begin();
-        for (; itr != displayConf->zoneConfList.end(); ++itr) {
-        }
-
         m_displayConfList.push_back(displayConf);
     }
 }
@@ -432,7 +413,11 @@ CicoSCSystemConfig::createDisplayZoneConf(const ptree::value_type & child,
         optional<string> y;
         optional<string> w;
         optional<string> h;
-        optional<string> overlap;
+        optional<bool>   fixed;
+        optional<bool>   l;
+        optional<bool>   r;
+        optional<bool>   t;
+        optional<bool>   b;
 
         id = zone.second.get_optional<int>("<xmlattr>.id");
         if (false == id.is_initialized()) {
@@ -464,10 +449,25 @@ CicoSCSystemConfig::createDisplayZoneConf(const ptree::value_type & child,
             ICO_WRN("zone.geometry.h attr not found");
             continue;
         }
-        overlap = zone.second.get_optional<string>("overlap");
-        if (false == overlap.is_initialized()) {
-            ICO_WRN("zone.overlap element not found");
-            overlap = optional<string>("");
+        fixed = zone.second.get_optional<bool>("aspect.<xmlattr>.Fixed");
+        if (false == fixed.is_initialized()) {
+            fixed = optional<bool>(false);
+        }
+        l = zone.second.get_optional<bool>("aspect.<xmlattr>.AlignLeft");
+        if (false == l.is_initialized()) {
+            l = optional<bool>(false);
+        }
+        r = zone.second.get_optional<bool>("aspect.<xmlattr>.AlignRight");
+        if (false == r.is_initialized()) {
+            r = optional<bool>(false);
+        }
+        t = zone.second.get_optional<bool>("aspect.<xmlattr>.AlignTop");
+        if (false == t.is_initialized()) {
+            t = optional<bool>(false);
+        }
+        b = zone.second.get_optional<bool>("aspect.<xmlattr>.AlignBottom");
+        if (false == b.is_initialized()) {
+            b = optional<bool>(false);
         }
 
         CicoSCDisplayZoneConf* zoneConf = new CicoSCDisplayZoneConf();
@@ -478,7 +478,11 @@ CicoSCSystemConfig::createDisplayZoneConf(const ptree::value_type & child,
         zoneConf->y          = calcGeometryExpr(y.get(), displayConf);
         zoneConf->w          = calcGeometryExpr(w.get(), displayConf);
         zoneConf->h          = calcGeometryExpr(h.get(), displayConf);
-        zoneConf->overlapStr = overlap.get();
+        zoneConf->aspectFixed       = fixed.get();
+        zoneConf->aspectAlignLeft   = l.get();
+        zoneConf->aspectAlignRight  = r.get();
+        zoneConf->aspectAlignTop    = t.get();
+        zoneConf->aspectAlignBottom = b.get();
         displayConf->zoneConfList.push_back(zoneConf);
 
         zoneConf->dumpConf();
index 597a4bb..ce478a6 100644 (file)
@@ -42,6 +42,7 @@ using namespace boost::property_tree;
 #include "CicoSCUser.h"
 #include "CicoSCConf.h"
 #include "CicoSCSystemConfig.h"
+#include "Cico_aul_listen_app.h"
 
 using namespace std;
 
@@ -60,6 +61,23 @@ using namespace std;
 
 void chkAndAddSlash(string& s);
 
+/**
+ * @brief applications die. callback function
+ * @param pid
+ * @param data user data
+ * @return int
+ * @retval -1: parameter error
+ * @retval 0: handler execute
+ */
+static int CSCUMapp_dead_handler(int pid, void *data)
+{
+    CicoSCUserManager* x = (CicoSCUserManager*)data;
+    if ((NULL == x) || (0 == x)) {
+        return -1;
+    }
+    x->appDeadHandler(pid);
+    return 0;
+}
 
 //==========================================================================
 //
@@ -76,6 +94,12 @@ CicoSCUserManager* CicoSCUserManager::ms_myInstance = NULL;
 CicoSCUserManager::CicoSCUserManager()
     : m_login("")
 {
+    ICO_TRA("start");
+    aul_listen_app_dead_signal_add(CSCUMapp_dead_handler, (void*)this);
+    m_vppa.clear();
+    m_waitName.clear();
+    m_waitHS.clear();
+    m_wait = false;
     // login-user application information file
     m_uConfig = CicoSCSystemConfig::getInstance()->getUserConf();
     if ((NULL == m_uConfig) || (true == m_uConfig->m_parent_dir.empty())) {
@@ -95,7 +119,7 @@ CicoSCUserManager::CicoSCUserManager()
     }
     chkAndAddSlash(m_flagPath);
     m_flagPath += ICO_SYC_CHGUSR_FLAG_FIL;
-
+    ICO_TRA("end");
 }
 
 //--------------------------------------------------------------------------
@@ -126,6 +150,7 @@ CicoSCUserManager::~CicoSCUserManager()
         delete *itr;
     }
     m_userList.clear();
+    m_vppa.clear();
 
     ICO_DBG("CicoSCUserManager::~CicoSCUserManager() Leave(EOK)");
 }
@@ -171,7 +196,7 @@ CicoSCUserManager::handleCommand(const CicoSCCommand * cmd)
         userlistCB(cmd->appid);
         break;
     case MSG_CMD_GET_LASTINFO:
-        // get last information 
+        // get last information
         lastinfoCB(cmd->appid);
         break;
     case MSG_CMD_SET_LASTINFO:
@@ -328,6 +353,13 @@ CicoSCUserManager::changeUser(const string & name, const string & passwd)
 
     string oldUsr = m_login; /* get before login user */
     const CicoSCUser *conf = NULL;
+    // check all user logoff
+    if ((name.empty()) || (name[0] == ' ')) {
+        ICO_DBG("CicoSCUserManager::changeUser Leave(all user logoff)");
+        flagFileOn();
+        killingAppsAndHS(oldUsr);
+        return;
+    }
 
     // get user config
     conf = findUserConfbyName(name);
@@ -345,7 +377,7 @@ CicoSCUserManager::changeUser(const string & name, const string & passwd)
     flagFileOn();
 
 #if 0
-    // Imprinting to file, that file is application's running information 
+    // Imprinting to file, that file is application's running information
     string usr_dir_old;
     getWorkingDir(oldUsr, usr_dir_old);
     string outfilename = usr_dir_old + ICO_SYC_APP_INFO;
@@ -371,21 +403,33 @@ CicoSCUserManager::changeUser(const string & name, const string & passwd)
         mkdir(dir, S_IRWXU | S_IRWXG | S_IRWXO);
     }
 
+    if (0 != m_vppa.size()) {
+        // wait dead signal recieve
+        m_waitName = conf->name;
+        m_waitHS = conf->homescreen;
+        m_wait = true;
+        // run call launchHomescreenReq is appDeadHandler !
+        ICO_DBG("CicoSCUserManager::changeUser Leave(WAIT:%s)", m_waitName.c_str());
+        return;
+    }
     // change homescreen application
+    sleep(2);                   // wait 2 sec for dead all applications
     launchHomescreenReq(conf->name, conf->homescreen);
-
     // change login user
     m_login = conf->name;
     saveLastUser();
     ICO_DBG("login user changed (user=%s)", m_login.c_str());
     ICO_INF("%s", tmpText);
     flagFileOff();
+    m_waitName.clear();
+    m_waitHS.clear();
+    m_wait = false;
     ICO_DBG("CicoSCUserManager::changeUser Leave(EOK)");
 }
 
 //--------------------------------------------------------------------------
 /**
- *  @brief  imprinting to file, that file is application's running information 
+ *  @brief  imprinting to file, that file is application's running information
  *  @param  usrnam target user name
  *  @return bool
  *  @retval true success
@@ -461,6 +505,7 @@ bool CicoSCUserManager::killingAppsAndHS(const string&)
         return false;
     }
 */
+    m_vppa.clear();
     CicoSCLifeCycleController* oCSCLCC;
     oCSCLCC = CicoSCLifeCycleController::getInstance();
     if ((NULL == oCSCLCC) || (0 == oCSCLCC)) {
@@ -478,6 +523,7 @@ bool CicoSCUserManager::killingAppsAndHS(const string&)
         ICO_DBG("CicoSCUserManager::killingAppsAndHS Tgt:%d(%s)", pObj->m_pid,
                 pObj->m_appid.c_str());
         pids.push_back(pObj->m_pid);
+        m_vppa.push_back(pairPidAppid(pObj->m_pid, pObj->m_appid));
         r = true;
     }
     int sz = pids.size();
@@ -513,7 +559,7 @@ void CicoSCUserManager::getWorkingDir(const string& usr, string& dir)
  *  @retval false fail
  */
 //--------------------------------------------------------------------------
-bool CicoSCUserManager::launchHomescreenReq(const string& usr, 
+bool CicoSCUserManager::launchHomescreenReq(const string& usr,
                                             const string& appid_hs)
 {
     string usr_dir;
@@ -1105,4 +1151,67 @@ void chkAndAddSlash(string& s)
     }
 }
 
+
+/**
+ * @brief app dead Handler
+ * @param pid dead pid
+ * @return bool
+ * @retval true pid is target
+ * @retval false pid is no target
+ */
+bool CicoSCUserManager::appDeadHandler(int pid)
+{
+    ICO_TRA("start (%d)", pid);
+    if (false == m_wait) {
+        ICO_TRA("end");
+        return false;
+    }
+    ICO_DBG("dead app(%d)", pid);
+    bool bBINGO = false;
+    string appid;
+    vector<pairPidAppid>::iterator it = m_vppa.begin(); // iterator set begin
+    while(it != m_vppa.end()) {  // loop to the last data
+        if ((*it).first == pid) {
+            appid = (*it).second;
+            m_vppa.erase(it);
+            bBINGO = true;
+            break;  // break of while it
+        }
+        ++it;   // next data
+    }
+    if (false == bBINGO) {
+        ICO_TRA("end FAIL pid(%d)", pid);
+        return false;
+    }
+#if 1
+    int sz = m_vppa.size();
+    if (0 != sz) {
+        ICO_TRA("end contenue wait(%d)", sz);
+        return true;
+    }
+#else
+    if (0 != appid.compare(m_waitHS)) {
+        ICO_TRA("end contenue wait(%s)", appid.c_str());
+        return true;
+    }
+#endif
+    char tmpText[128];
+    sprintf(tmpText, "CHG USER[%s]->[%s]", m_login.c_str(), m_waitName.c_str());
+
+    // change homescreen application
+    sleep(2);                   // wait 2 sec for dead all applications
+    launchHomescreenReq(m_waitName, m_waitHS);
+    // change login user
+    m_login = m_waitName;
+    saveLastUser();
+    ICO_DBG("login user changed (user=%s)", m_login.c_str());
+    ICO_INF("%s", tmpText);
+    flagFileOff();
+    m_waitName.clear();
+    m_waitHS.clear();
+    m_wait = false;
+    ICO_DBG("end homescreen start req.(%s)", appid.c_str());
+    return true;
+}
+
 // vim:set expandtab ts=4 sw=4:
index 907ee6d..3a3276a 100644 (file)
@@ -27,6 +27,8 @@ class CicoSCCommand;
 class CicoSCUser;
 class CicoSCUserConf;
 
+typedef std::pair<int, std::string> pairPidAppid;
+
 //==========================================================================
 /*
  *  @brief  This class manages control of user and access to user information
@@ -58,6 +60,8 @@ public:
     void dumpUserList(void);
     void dumpHomeScreenList(void);
 
+    // application daed watcher
+    bool appDeadHandler(int pid);
 private:
     // default constructor
     CicoSCUserManager();
@@ -120,6 +124,10 @@ private:
     std::string                 m_parentDir;       ///  login-user use directory
     const CicoSCUserConf*       m_uConfig;
     std::string                 m_flagPath;        ///  history save control flag file
+    std::vector<pairPidAppid>   m_vppa;            ///  app dead watcher
+    bool                        m_wait;            ///  app dead wait flag
+    std::string                 m_waitName;        ///  wait backup login name
+    std::string                 m_waitHS;          ///  wait backup homescreen appid
 };
 #endif  // __CICO_SC_USER_MANAGER_H__
 // vim:set expandtab ts=4 sw=4:
index 2c6da18..5a0019a 100644 (file)
@@ -27,11 +27,10 @@ using namespace std;
  */
 //--------------------------------------------------------------------------
 CicoSCWindow::CicoSCWindow()
-    : surfaceid(-1), name(""), appid(""), pid(-1),
+    : surfaceid(-1), name(""), appid(""), pid(-1), layertype(-1),
       nodeid(-1), displayid(-1), layerid(-1), zone(""), zoneid(-1),
       subwindow(0), eventmask(0), x(-1), y(-1), width(-1), height(-1),
       visible(false), raise(false), active(false)
-
 {
     ICO_DBG("CicoSCWindow::CicoSCWindow Enter");
     ICO_DBG("CicoSCWindow::CicoSCWindow Leave");
@@ -59,11 +58,11 @@ CicoSCWindow::dump(void)
     ICO_DBG("CicoSCWindow: surfaceid=0x%08X name=%s appid=%s pid=%d "
             "nodeid=%d displayid=%d layerid=%d zone=%s zoneid=%d "
             "subwindow=%d eventmask=%d x=%d y=%d width=%d height=%d "
-            "visible=%s raise=%s active=%s",
+            "visible=%s raise=%s active=%s layertype=%x",
             surfaceid, name.c_str(), appid.c_str(), pid, nodeid, displayid,
             layerid, zone.c_str(), zoneid, subwindow, eventmask,
             x, y, width, height,
             visible ? "true" : "false", raise ? "true" : "false",
-            active ? "true" : "false");
+            active ? "true" : "false", layertype);
 }
 // vim:set expandtab ts=4 sw=4:
index 0122685..287ea59 100644 (file)
@@ -56,6 +56,7 @@ public:
     std::string       name;         ///< window name
     std::string       appid;        ///< application id
     int               pid;          ///< process id
+    int               layertype;    ///< layer type
 
     int               nodeid;       ///< node id
     int               displayid;    ///< display id
index 2a50f10..430eb55 100644 (file)
@@ -92,7 +92,6 @@ CicoSCWindowController::initDB(void)
         display->displayno = (*itr)->no;
         display->width     = (*itr)->width;
         display->height    = (*itr)->height;
-        display->inch      = (*itr)->inch;
         display->name      = (*itr)->name;
 
         vector<CicoSCLayerConf*>::const_iterator itr2;
@@ -118,6 +117,11 @@ CicoSCWindowController::initDB(void)
             zone->width    = (*itr3)->w;
             zone->height   = (*itr3)->h;
             zone->fullname = (*itr3)->fullname;
+            zone->aspectFixed       = (*itr3)->aspectFixed;
+            zone->aspectAlignLeft   = (*itr3)->aspectAlignLeft;
+            zone->aspectAlignRight  = (*itr3)->aspectAlignRight;
+            zone->aspectAlignTop    = (*itr3)->aspectAlignTop;
+            zone->aspectAlignBottom = (*itr3)->aspectAlignBottom;
             display->zoneList[zone->zoneid] = zone;
         }
         display->dump();
@@ -174,6 +178,18 @@ CicoSCWindowController::show(int        surfaceid,
     // update visible attr
     window->visible = true;
 
+    // update current displayed window at display zone
+    CicoSCDisplayZone* zone = (CicoSCDisplayZone*)findDisplayZone(window->zoneid);
+    if (NULL != zone) {
+        CicoSCLayer *layer = findLayer(window->displayid, window->layerid);
+        if ((NULL != layer) && (layer->type == ICO_LAYER_TYPE_APPLICATION)) {
+            ICO_DBG("Entry display zone[%d] current displayed window"
+                    "(0x%08X:\"%s\")",
+                    zone->zoneid, window->surfaceid, window->appid.c_str());
+            zone->displayedWindow = window;
+        }
+    }
+
     // set animation request to Multi Window Manager
     int animaFlag = ICO_WINDOW_MGR_FLAGS_NO_CONFIGURE;
     int raiseFlag = ICO_WINDOW_MGR_V_NOCHANGE;
@@ -240,9 +256,28 @@ CicoSCWindowController::hide(int        surfaceid,
         return ICO_SYC_ENOENT;
     }
 
+    if (false == window->visible) {
+        ICO_DBG("already hide state");
+        ICO_DBG("CicoSCWindowController::hide Leave(EOK)");
+        return ICO_SYC_EOK;
+    }
+
     // update window attr
     window->visible = false;
 
+    // update current displayed window at display zone
+    CicoSCDisplayZone* zone = (CicoSCDisplayZone*)findDisplayZone(window->zoneid);
+    if (NULL != zone) {
+        CicoSCLayer *layer = findLayer(window->displayid, window->layerid);
+        if ((NULL != layer) && (layer->type == ICO_LAYER_TYPE_APPLICATION) &&
+            (getDisplayedWindow(zone->zoneid) == surfaceid)) {
+            ICO_DBG("Exit  display zone[%d] current displayed window"
+                    "(0x%08X:\"%s\")",
+                    zone->zoneid, window->surfaceid, window->appid.c_str());
+            zone->displayedWindow = NULL;
+        }
+    }
+
     // set animation request to Multi Window Manager
     int animaFlag = ICO_WINDOW_MGR_FLAGS_NO_CONFIGURE;
     if ((NULL != animation) && (animation[0] != '\0')) {
@@ -367,7 +402,7 @@ CicoSCWindowController::move(int        surfaceid,
     }
 
     int moveNodeId = ICO_WINDOW_MGR_V_NOCHANGE;
-    if ((nodeid >= 0) && (nodeid != INT_MAX)) {
+    if (nodeid >= 0) {
         moveNodeId = nodeid;
     }
 
@@ -622,9 +657,35 @@ CicoSCWindowController::setGeometry(int        surfaceid,
         return ICO_SYC_EINVAL;
     }
 
+    if (window->zoneid != dispzone->zoneid) {
+        // update current displayed window at display zone
+        CicoSCDisplayZone* olddispzone = (CicoSCDisplayZone*)findDisplayZone(window->zoneid);
+        if (NULL != olddispzone) {
+            CicoSCLayer *layer = findLayer(window->displayid, window->layerid);
+            if ((NULL != layer) &&
+                (layer->type == ICO_LAYER_TYPE_APPLICATION) &&
+                (getDisplayedWindow(olddispzone->zoneid) == surfaceid)) {
+                ICO_DBG("Exit display zone[%d] current displayed window"
+                        "(0x%08X:\"%s\")",
+                        olddispzone->zoneid, window->surfaceid,
+                        window->appid.c_str());
+                olddispzone->displayedWindow = NULL;
+            }
+        }
+
+        CicoSCLayer *layer = findLayer(displayno, window->layerid);
+        if ((NULL != layer) && (layer->type == ICO_LAYER_TYPE_APPLICATION)) {
+            ICO_DBG("Entry display zone[%d] current displayed window"
+                    "(0x%08X:\"%s\")",
+                    dispzone->zoneid, window->surfaceid, window->appid.c_str());
+            dispzone->displayedWindow = window;
+        }
+    }
+
     // update window attr
     window->zoneid = dispzone->zoneid;
     window->zone = dispzone->fullname;
+    setAttributes(window->surfaceid);
 
     int ret = setGeometry(surfaceid, displayno,
                           dispzone->x, dispzone->y,
@@ -719,8 +780,8 @@ CicoSCWindowController::setWindowLayer(int surfaceid, int layerid)
     CicoSCLayer* layer = findLayer(window->displayid, layerid);
     if (NULL == layer) {
         // check special layer
-        if ((layerid != ICO_WINDOW_MGR_V_LAYER_INPUT) &&
-            (layerid != ICO_WINDOW_MGR_V_LAYER_CURSOR)) {
+        if ((layerid != ICO_WINDOW_MGR_LAYERTYPE_TOUCH) &&
+            (layerid != ICO_WINDOW_MGR_LAYERTYPE_CURSOR)) {
             ICO_WRN("CicoSCWindowController::setWindowLayer Leave(ENOENT[disp=%d,layer=%d])",
                     window->displayid, layerid);
             return ICO_SYC_ENOENT;
@@ -827,14 +888,18 @@ CicoSCWindowController::hideLayer(int displayid, int layerid)
 int
 CicoSCWindowController::active(int surfaceid, int target)
 {
+    CicoSCWindow *window = NULL;
+
     ICO_DBG("CicoSCWindowController::active Enter"
             "(surfaceid=0x%08X, target=%08X)", surfaceid, target);
 
     // find window information in window list
-    CicoSCWindow *window = findWindow(surfaceid);
-    if (NULL == window) {
-        ICO_WRN("CicoSCWindowController::active Leave(ENOENT)");
-        return ICO_SYC_ENOENT;
+    if (surfaceid) {
+        window = findWindow(surfaceid);
+        if (NULL == window) {
+            ICO_WRN("CicoSCWindowController::active Leave(ENOENT)");
+            return ICO_SYC_ENOENT;
+        }
     }
 
     if (target < 0) {
@@ -843,20 +908,22 @@ CicoSCWindowController::active(int surfaceid, int target)
     }
 
     // set active request to Multi Window Manager
-    CicoSCWlWinMgrIF::setActive(window->surfaceid, target);
+    CicoSCWlWinMgrIF::setActive(surfaceid, target);
 
     // flush display
     CicoSCWayland::getInstance()->flushDisplay();
 
     // update visible attr
-    window->raise = true;
+    if (window) {
+        window->raise = true;
+    }
 
     // update active window
     map<unsigned int, CicoSCWindow*>::iterator itr;
     itr = m_windowList.begin();
     for (; itr != m_windowList.end(); ++itr) {
         CicoSCWindow* window = itr->second;
-        if (window->surfaceid == surfaceid) {
+        if ((surfaceid != 0) && (window->surfaceid == surfaceid)) {
             window->active = target;
         }
         else {
@@ -903,6 +970,7 @@ CicoSCWindowController::mapSurface(int surfaceid, int framerate)
     }
 
     CicoSCWlWinMgrIF::mapSurface(surfaceid, framerate);
+    CicoSCWayland::getInstance()->flushDisplay();
 
     ICO_DBG("CicoSCWindowController::mapSurface Leave(EOK)");
     return ICO_SYC_EOK;
@@ -933,6 +1001,7 @@ CicoSCWindowController::unmapSurface(int surfaceid)
     }
 
     CicoSCWlWinMgrIF::unmapSurface(surfaceid);
+    CicoSCWayland::getInstance()->flushDisplay();
 
     ICO_DBG("CicoSCWindowController::unmapSurface Leave(EOK)");
     return ICO_SYC_EOK;
@@ -940,6 +1009,85 @@ CicoSCWindowController::unmapSurface(int surfaceid)
 
 //--------------------------------------------------------------------------
 /**
+ *  @brief   get displayed window by display zone id
+ *
+ *  @param [in] zoneid  display zone id
+ *
+ *  @return surface id on success, -1 on not displayed
+ */
+//--------------------------------------------------------------------------
+int
+CicoSCWindowController::getDisplayedWindow(int zoneid)
+{
+    const CicoSCDisplayZone* zone = findDisplayZone(zoneid);
+    if (NULL == zone) {
+        return -1;
+    }
+
+    if (NULL == zone->displayedWindow) {
+        return -1;
+    }
+
+    return zone->displayedWindow->surfaceid;
+}
+
+//--------------------------------------------------------------------------
+/**
+ *  @brief  set surface attributes
+ *
+ *  @param [in] surfaceid   surface id
+ *
+ *  @retval ICO_SYC_EOK     success
+ *  @retval ICO_SYC_ESRCH   error(not initialized)
+ *  @retval ICO_SYC_ENOENT  error(layer dose not exist)
+ */
+//--------------------------------------------------------------------------
+int
+CicoSCWindowController::setAttributes(int surfaceid)
+{
+    ICO_DBG("CicoSCWindowController::setAttributes Enter"
+            "(surfaceid=0x%08X)", surfaceid);
+
+    // find window information in window list
+    CicoSCWindow *window = findWindow(surfaceid);
+    if (NULL == window) {
+        ICO_WRN("CicoSCWindowController::setAttributes Leave(ENOENT)");
+        return ICO_SYC_ENOENT;
+    }
+
+    // find zone
+    const CicoSCDisplayZone* zone = findDisplayZone(window->zoneid);
+    if (NULL == zone) {
+        ICO_WRN("CicoSCWindowController::setAttributes Leave(ENOENT)");
+        return ICO_SYC_ENOENT;
+    }
+
+    uint32_t attributes = 0;
+    if (true == zone->aspectFixed) {
+        attributes |= ICO_WINDOW_MGR_ATTR_FIXED_ASPECT;
+        if (true == zone->aspectAlignLeft) {
+            attributes |= ICO_WINDOW_MGR_ATTR_ALIGN_LEFT;
+        }
+        if (true == zone->aspectAlignRight) {
+            attributes |= ICO_WINDOW_MGR_ATTR_ALIGN_RIGHT;
+        }
+        if (true == zone->aspectAlignTop) {
+            attributes |= ICO_WINDOW_MGR_ATTR_ALIGN_TOP;
+        }
+        if (true == zone->aspectAlignBottom) {
+            attributes |= ICO_WINDOW_MGR_ATTR_ALIGN_BOTTOM;
+        }
+    }
+
+    CicoSCWlWinMgrIF::setAttributes(surfaceid, attributes);
+    CicoSCWayland::getInstance()->flushDisplay();
+
+    ICO_DBG("CicoSCWindowController::setAttributes Leave(EOK)");
+    return ICO_SYC_EOK;
+}
+
+//--------------------------------------------------------------------------
+/**
  *  @brief   wayland surface create callback
  *
  *  @param [in] data            user data(unused)
@@ -948,6 +1096,7 @@ CicoSCWindowController::unmapSurface(int surfaceid)
  *  @param [in] winname         surface window name(title)
  *  @param [in] pid             wayland client process Id
  *  @param [in] appid           wayland client application Id
+ *  @param [in] layertype       surface layer type
  */
 //--------------------------------------------------------------------------
 void
@@ -956,17 +1105,26 @@ CicoSCWindowController::createdCB(void                  *data,
                                   uint32_t              surfaceid,
                                   const char            *winname,
                                   int32_t               pid,
-                                  const char            *appid)
+                                  const char            *appid,
+                                  int32_t               layertype)
 {
     ICO_DBG("CicoSCWindowController::createdCB Enter"
-            "(surfaceid=0x%08X winname=%s pid=%d appid=%s)",
-            surfaceid, winname, pid, appid);
+            "(surfaceid=0x%08X winname=%s pid=%d appid=%s layer=%x)",
+            surfaceid, winname, pid, appid, layertype);
+
+    if (layertype == ICO_WINDOW_MGR_LAYERTYPE_INPUTPANEL)   {
+        // So far, SystemController ignores this event
+        // because it does not support InputPanel(Software Keyboard).
+        ICO_DBG("CicoSCWindowController::createdCB Leave(Input Panel)");
+        return;
+    }
 
     CicoSCWindow* window = new CicoSCWindow();
 
     window->surfaceid = surfaceid;
     window->name      = winname;
     window->appid     = appid;
+    window->layertype = layertype;
     window->pid       = pid;
     window->displayid = ICO_SURFACEID_2_NODEID(surfaceid);
 
@@ -1014,6 +1172,9 @@ CicoSCWindowController::createdCB(void                  *data,
 
     m_windowList[surfaceid] = window;
 
+    // set surface attributes
+    setAttributes(surfaceid);
+
     // send message
     CicoSCMessage *message = new CicoSCMessage();
     message->addRootObject("command", MSG_CMD_CREATE);
@@ -1058,7 +1219,6 @@ CicoSCWindowController::createdCB(void                  *data,
         }
 #endif
 
-
         m_resMgr->handleCommand((const CicoSCCommand&)cmd, true);
     }
     else {
@@ -1274,6 +1434,8 @@ CicoSCWindowController::visibleCB(void                  *data,
  *  @param [in] ico_window_mgr  wayland ico_window_mgr plugin interface
  *  @param [in] surfaceid       ico_window_mgr surface Id
  *  @param [in] node            surface node Id
+ *  @param [in] layertype       surface layer type
+ *  @param [in] layer           surface layer Id
  *  @param [in] x               surface upper-left X coordinate
  *  @param [in] y               surface upper-left Y coordinate
  *  @param [in] width           surface width
@@ -1287,6 +1449,7 @@ CicoSCWindowController::configureCB(void                  *data,
                                     struct ico_window_mgr *ico_window_mgr,
                                     uint32_t              surfaceid,
                                     uint32_t              node,
+                                    int32_t               layertype,
                                     uint32_t              layer,
                                     int32_t               x,
                                     int32_t               y,
@@ -1295,10 +1458,16 @@ CicoSCWindowController::configureCB(void                  *data,
                                     int32_t               hint)
 {
     ICO_DBG("CicoSCWindowController::configureCB Enter"
-            "(surfaceid=0x%08X node=%d layer=%d x=%d y=%d "
+            "(surfaceid=0x%08X node=%d layer=%x.%x x=%d y=%d "
             "width=%d height=%d hint=%d)",
-            surfaceid, node, layer, x, y, width, height, hint);
+            surfaceid, node, layertype, layer, x, y, width, height, hint);
 
+    if (layertype == ICO_WINDOW_MGR_LAYERTYPE_INPUTPANEL)   {
+        // So far, SystemController ignores this event
+        // because it does not support InputPanel(Software Keyboard).
+        ICO_DBG("CicoSCWindowController::configureCB Leave(Input Panel)");
+        return;
+    }
     CicoSCWindow *window = findWindow(surfaceid);
     if (NULL == window) {
         ICO_DBG("CicoSCWindowController::visibleCB Leave"
@@ -1311,6 +1480,7 @@ CicoSCWindowController::configureCB(void                  *data,
         window->y      = y;
         window->width  = width;
         window->height = height;
+        window->layertype = layertype;
 #if 0
         if (window->layerid != layer) {
             window->layerid = layer;
@@ -1333,6 +1503,7 @@ CicoSCWindowController::configureCB(void                  *data,
     message->addArgObject("surface", window->surfaceid);
     message->addArgObject("winname", window->name);
     message->addArgObject("node", window->nodeid);
+    message->addArgObject("layertype", window->layertype);
     message->addArgObject("layer", window->layerid);
     message->addArgObject("pos_x", window->x);
     message->addArgObject("pos_y", window->y);
@@ -1391,10 +1562,6 @@ CicoSCWindowController::activeCB(void                  *data,
     message->addArgObject("winname", window->name);
     CicoSCServer::getInstance()->sendMessageToHomeScreen(message);
 
-    if (true == window->visible) {
-        (void)notifyResourceManager(window->surfaceid, NULL, NULL, 0);
-    }
-
     ICO_DBG("CicoSCWindowController::activeCB Leave");
 }
 
@@ -1470,6 +1637,8 @@ CicoSCWindowController::appSurfacesCB(void                  *data,
  *  @param [in] ico_window_mgr  wayland ico_window_mgr plugin interface
  *  @param [in] event           event
  *  @param [in] surfaceid       surface Id
+ *  @param [in] type            surface type (EGL buffer/Shared memory)
+ *  @param [in] target          surface buffer target(EGL buffer name)
  *  @param [in] width           surface width
  *  @param [in] height          surface height
  *  @param [in] stride          surface buffer(frame buffer) stride
@@ -1488,22 +1657,39 @@ CicoSCWindowController::mapSurfaceCB(void                  *data,
                                      int32_t               stride,
                                      uint32_t               format)
 {
-    ICO_DBG("CicoSCWindowController::mapSurfaceCB Enter"
-            "(event=%d surface=%d type=%d target=%d "
-            "width=%d height=%d stride=%d format=%d)",
-            event, surfaceid, type, target,
-            width, height, stride, format);
+    int command;
+
+    ICO_DBG("CicoSCWindowController::mapSurfaceCB Enter(ev=%d surf=%x "
+            "type=%d target=%d w/h=%d/%d stride=%d form=%x)",
+            event, surfaceid, type, target, width, height, stride, format);
 
     CicoSCWindow *window = findWindow(surfaceid);
     if (NULL == window) {
         return;
     }
 
+    // convert event to command
+    switch (event)  {
+    case ICO_WINDOW_MGR_MAP_SURFACE_EVENT_CONTENTS:
+    case ICO_WINDOW_MGR_MAP_SURFACE_EVENT_RESIZE:
+    case ICO_WINDOW_MGR_MAP_SURFACE_EVENT_MAP:
+        command = MSG_CMD_MAP_THUMB;
+        break;
+    case ICO_WINDOW_MGR_MAP_SURFACE_EVENT_UNMAP:
+    case ICO_WINDOW_MGR_MAP_SURFACE_EVENT_ERROR:
+        command = MSG_CMD_UNMAP_THUMB;
+        break;
+    default:
+        ICO_DBG("CicoSCWindowController::mapSurfaceCB Leave(Unknown event(%d))", event);
+        return;
+    }
+
     // send message
     CicoSCMessage *message = new CicoSCMessage();
-    message->addRootObject("command", MSG_CMD_MAP_THUMB);
+    message->addRootObject("command", command);
     message->addRootObject("appid", window->appid);
     message->addArgObject("surface", window->surfaceid);
+    message->addArgObject("name", target);
     message->addArgObject("width", width);
     message->addArgObject("height", height);
     message->addArgObject("stride", stride);
@@ -1718,7 +1904,9 @@ CicoSCWindowController::handleCommand(const CicoSCCommand * cmd)
         ICO_DBG("command: MSG_CMD_SHOW");
         if (opt->animationTime & ICO_SYC_WIN_SURF_NORESCTL) {
             /* show command but not resource control (for HomeScreen)   */
-            (void)show(opt->surfaceid, opt->animation.c_str(), opt->animationTime);
+            (void)show(opt->surfaceid,
+                       opt->animation.c_str(),
+                       opt->animationTime);
         }
         else {
             /* show command (normal)    */
@@ -1854,5 +2042,4 @@ CicoSCWindowController::notifyResourceManager(int        surfaceid,
     ICO_DBG("CicoSCWindowController::notifyResourceManager Leave(EOK)");
     return ICO_SYC_EOK;
 }
-
 // vim:set expandtab ts=4 sw=4:
index 391a6e7..2ee2321 100644 (file)
@@ -112,13 +112,18 @@ public:
 
     int unmapSurface(int surfaceid);
 
+    int getDisplayedWindow(int zoneid);
+
+    int setAttributes(int surfaceid);
+
     //
     virtual void createdCB(void *data,
                            struct ico_window_mgr *ico_window_mgr,
                            uint32_t surfaceid,
                            const char *winname,
                            int32_t pid,
-                           const char *appid);
+                           const char *appid,
+                           int32_t layertype);
 
     virtual void nameCB(void *data,
                         struct ico_window_mgr *ico_window_mgr,
@@ -140,6 +145,7 @@ public:
                              struct ico_window_mgr *ico_window_mgr,
                              uint32_t surfaceid,
                              uint32_t node,
+                             int32_t layertype,
                              uint32_t layer,
                              int32_t x,
                              int32_t y,
@@ -213,15 +219,16 @@ private:
                               int        animationTime);
 
 private:
+    // resource manager instance
     CicoSCResourceManager *m_resMgr;
 
     // window object list
     map<unsigned int, CicoSCWindow*> m_windowList;
 
     // display object list
-    vector<CicoSCDisplay*>   m_displayList;
+    vector<CicoSCDisplay*> m_displayList;
 
-    //
+    // total of physical display 
     unsigned int m_physicalDisplayTotal;
 
 };
index 8288317..75ddb25 100644 (file)
@@ -318,13 +318,15 @@ CicoSCWlWinMgrIF::setLayerVisible(uint32_t layer, int32_t visible)
  *  @brief   wrapper function of ico_window_mgr_get_surfaces
  *  
  *  @param [in] appid           id of application
+ *  @param [in] pid             id of process
  */
 //--------------------------------------------------------------------------
 void
-CicoSCWlWinMgrIF::getSurfaces(const char *appid)
+CicoSCWlWinMgrIF::getSurfaces(const char *appid, int pid)
 {
-    ICO_DBG("called: ico_window_mgr_get_surfaces(appid=%d)", appid);
-    ico_window_mgr_get_surfaces(m_winmgr, appid);
+    ICO_DBG("called: ico_window_mgr_get_surfaces(appid=%d,pid=%d)",
+            appid ? appid : " ", pid);
+    ico_window_mgr_get_surfaces(m_winmgr, appid ? appid : " ", pid);
 }
 
 //--------------------------------------------------------------------------
@@ -368,6 +370,7 @@ CicoSCWlWinMgrIF::unmapSurface(uint32_t surfaceid)
  *  @param [in] winname         surface window name(title)
  *  @param [in] pid             wayland client process Id
  *  @param [in] appid           wayland client application Id
+ *  @param [in] layertype       surface layer type
  */
 //--------------------------------------------------------------------------
 void
@@ -376,7 +379,8 @@ CicoSCWlWinMgrIF::createdCB(void                  *data,
                             uint32_t              surfaceid,
                             const char            *winname,
                             int32_t               pid,
-                            const char            *appid)
+                            const char            *appid,
+                            int32_t               layertype)
 {
     ICO_DBG("CicoSCWlWinMgrIF::createdCB called.");
 }
@@ -450,6 +454,8 @@ CicoSCWlWinMgrIF::visibleCB(void                  *data,
  *  @param [in] ico_window_mgr  wayland ico_window_mgr plugin interface
  *  @param [in] surfaceid       ico_window_mgr surface Id
  *  @param [in] node            surface node Id
+ *  @param [in] layertype       surface layer type
+ *  @param [in] layer           surface layer Id
  *  @param [in] x               surface upper-left X coordinate
  *  @param [in] y               surface upper-left Y coordinate
  *  @param [in] width           surface width
@@ -463,6 +469,7 @@ CicoSCWlWinMgrIF::configureCB(void                  *data,
                               struct ico_window_mgr *ico_window_mgr,
                               uint32_t              surfaceid,
                               uint32_t              node,
+                              int32_t               layertype,
                               uint32_t              layer,
                               int32_t               x,
                               int32_t               y,
@@ -520,6 +527,7 @@ CicoSCWlWinMgrIF::layerVisibleCB(void                  *data,
  *  @param [in] data            user data(unused)
  *  @param [in] ico_window_mgr  wayland ico_window_mgr plugin interface
  *  @param [in] appid           application Id
+ *  @param [in] pid             process Id
  *  @param [in] surface         surface Id array
  */
 //--------------------------------------------------------------------------
@@ -527,6 +535,7 @@ void
 CicoSCWlWinMgrIF::appSurfacesCB(void                  *data,
                                 struct ico_window_mgr *ico_window_mgr,
                                 const char            *appid,
+                                int32_t               pid,
                                 struct wl_array       *surfaces)
 {
     ICO_WRN("CicoSCWlWinMgrIF::appSurfacesCB called.");
@@ -540,6 +549,8 @@ CicoSCWlWinMgrIF::appSurfacesCB(void                  *data,
  *  @param [in] ico_window_mgr  wayland ico_window_mgr plugin interface
  *  @param [in] event           event
  *  @param [in] surfaceid       surface Id
+ *  @param [in] type            surface buffer type(EGL buffer/Shared memory)
+ *  @param [in] target          surface buffer target(EGL buffer name)
  *  @param [in] width           surface width
  *  @param [in] height          surface height
  *  @param [in] stride          surface buffer(frame buffer) stride
@@ -629,6 +640,7 @@ CicoSCWlWinMgrIF::outputModeCB(void             *data,
  *  @param [in] winname         surface window name(title)
  *  @param [in] pid             wayland client process Id
  *  @param [in] appid           wayland client application Id
+ *  @param [in] layertype       surface layer type
  */
 //--------------------------------------------------------------------------
 void
@@ -637,7 +649,8 @@ CicoSCWlWinMgrIF::wlCreatedCB(void                  *data,
                               uint32_t              surfaceid,
                               const char            *winname,
                               int32_t               pid,
-                              const char            *appid)
+                              const char            *appid,
+                              int32_t               layertype)
 {
 //    ICO_DBG("CicoSCWlWinMgrIF::wlCreatedCB Enter");
     if (NULL == data) {
@@ -646,7 +659,7 @@ CicoSCWlWinMgrIF::wlCreatedCB(void                  *data,
     }
     static_cast<CicoSCWlWinMgrIF*>(data)->createdCB(data, ico_window_mgr,
                                                     surfaceid, winname,
-                                                    pid, appid);
+                                                    pid, appid, layertype);
 //    ICO_DBG("CicoSCWlWinMgrIF::wlCreatedCB Leave");
 }
 
@@ -745,6 +758,8 @@ CicoSCWlWinMgrIF::wlVisibleCB(void                  *data,
  *  @param [in] ico_window_mgr  wayland ico_window_mgr plugin interface
  *  @param [in] surfaceid       ico_window_mgr surface Id
  *  @param [in] node            surface node Id
+ *  @param [in] layertype       surface layer type
+ *  @param [in] layer           surface layer Id
  *  @param [in] x               surface upper-left X coordinate
  *  @param [in] y               surface upper-left Y coordinate
  *  @param [in] width           surface width
@@ -758,6 +773,7 @@ CicoSCWlWinMgrIF::wlConfigureCB(void                  *data,
                                 struct ico_window_mgr *ico_window_mgr,
                                 uint32_t              surfaceid,
                                 uint32_t              node,
+                                int32_t               layertype,
                                 uint32_t              layer,
                                 int32_t               x,
                                 int32_t               y,
@@ -772,8 +788,8 @@ CicoSCWlWinMgrIF::wlConfigureCB(void                  *data,
         return;
     }
     static_cast<CicoSCWlWinMgrIF*>(data)->configureCB(data, ico_window_mgr,
-                                                      surfaceid, node, layer,
-                                                      x, y, width, height,
+                                                      surfaceid, node, layertype,
+                                                      layer, x, y, width, height,
                                                       hint);
 //    ICO_DBG("CicoSCWlWinMgrIF::wlConfigureCB Leave");
 }
@@ -840,6 +856,7 @@ CicoSCWlWinMgrIF::wlLayerVisibleCB(void                  *data,
  *  @param [in] data            user data(unused)
  *  @param [in] ico_window_mgr  wayland ico_window_mgr plugin interface
  *  @param [in] appid           application Id
+ *  @param [in] pid             process Id
  *  @param [in] surface         surface Id array
  */
 //--------------------------------------------------------------------------
@@ -847,6 +864,7 @@ void
 CicoSCWlWinMgrIF::wlAppSurfacesCB(void                  *data,
                                   struct ico_window_mgr *ico_window_mgr,
                                   const char            *appid,
+                                  int32_t               pid,
                                   struct wl_array       *surfaces)
 {
 //    ICO_DBG("CicoSCWlWinMgrIF::wlAppSurfacesCB Enter");
@@ -856,7 +874,7 @@ CicoSCWlWinMgrIF::wlAppSurfacesCB(void                  *data,
         return;
     }
     static_cast<CicoSCWlWinMgrIF*>(data)->appSurfacesCB(data, ico_window_mgr,
-                                                        appid, surfaces);
+                                                        appid, pid, surfaces);
 //    ICO_DBG("CicoSCWlWinMgrIF::wlAppSurfacesCB Leave");
 }
 
index cffde14..c8bcf1f 100644 (file)
@@ -40,7 +40,8 @@ public:
                            uint32_t surfaceid,
                            const char *winname,
                            int32_t pid,
-                           const char *appid);
+                           const char *appid,
+                           int32_t layertype);
 
     virtual void nameCB(void *data,
                         struct ico_window_mgr *ico_window_mgr,
@@ -62,6 +63,7 @@ public:
                              struct ico_window_mgr *ico_window_mgr,
                              uint32_t surfaceid,
                              uint32_t node,
+                             int32_t layertype,
                              uint32_t layer,
                              int32_t x,
                              int32_t y,
@@ -82,6 +84,7 @@ public:
     virtual void appSurfacesCB(void *data,
                                struct ico_window_mgr *ico_window_mgr,
                                const char *appid,
+                               int32_t    pid,
                                struct wl_array *surfaces);
 
     virtual void mapSurfaceCB(void *data,
@@ -161,7 +164,7 @@ protected:
     void setLayerVisible(uint32_t layer, int32_t visible);
 
     // wrapper function of ico_window_mgr_get_surfaces
-    void getSurfaces(const char *appid);
+    void getSurfaces(const char *appid, int32_t pid);
 
     // wrapper function of ico_window_mgr_map_surface
     void mapSurface(uint32_t surfaceid, int32_t framerate);
@@ -176,7 +179,8 @@ private:
                             uint32_t              surfaceid,
                             const char            *winname,
                             int32_t               pid,
-                            const char            *appid);
+                            const char            *appid,
+                            int32_t               layertype);
 
     static void wlNameCB(void *data,
                          struct ico_window_mgr *ico_window_mgr,
@@ -198,6 +202,7 @@ private:
                               struct ico_window_mgr *ico_window_mgr,
                               uint32_t surfaceid,
                               uint32_t node,
+                              int32_t layertype,
                               uint32_t layer,
                               int32_t x,
                               int32_t y,
@@ -218,6 +223,7 @@ private:
     static void wlAppSurfacesCB(void *data,
                                 struct ico_window_mgr *ico_window_mgr,
                                 const char *appid,
+                                int32_t    pid,
                                 struct wl_array *surfaces);
 
     static void wlMapSurfaceCB(void *data,
@@ -251,7 +257,7 @@ private:
                                int32_t          refresh);
 
 protected:
-    // ico_window_mgr listener 
+    // ico_window_mgr listener
     struct ico_window_mgr_listener m_listener;
 
     // wayland output listener
diff --git a/lib/system-controller/Cico_aul_listen_app.cpp b/lib/system-controller/Cico_aul_listen_app.cpp
new file mode 100644 (file)
index 0000000..6e14ed5
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+ * 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   Homescreen application aul handler multi support
+ *
+ * @date    Sep-23-2013
+ */
+#include <iostream>
+#include <string>
+#include <vector>
+#include <aul/aul.h>
+
+using namespace std;
+
+
+//bool aul_listen_app_launch_signal_del(int (*func) (int, void *));
+//bool aul_listen_app_dead_signal_del(int (*func) (int, void *));
+
+static vector<void*> launch_f;
+static vector<void*> launch_p;
+static vector<void*> dead_f;
+static vector<void*> dead_p;
+
+/**
+ * @brief aul launch handler
+ * @param pid
+ * @param data user data
+ */
+static int app_launch_handler(int pid, void *data)
+{
+    vector<void*>::iterator itf = launch_f.begin();
+    vector<void*>::iterator itp = launch_p.begin();
+    while(itf != launch_f.end()) {
+        void* f = *itf;
+        void* p = *itp;
+        int (*fnc)(int, void*) = (int (*)(int, void*))f;
+        fnc(pid, p);
+        ++itf;
+        ++itp;
+    }
+    return 0;
+}
+
+/**
+ * @brief aul dead handler
+ * @param pid
+ * @param data user data
+ */
+static int app_dead_handler(int pid, void *data)
+{
+    vector<void*>::iterator itf = dead_f.begin();
+    vector<void*>::iterator itp = dead_p.begin();
+    while(itf != dead_f.end()) {
+        void* f = *itf;
+        void* p = *itp;
+        int (*fnc)(int, void*) = (int (*)(int, void*))f;
+        fnc(pid, p);
+        ++itf;
+        ++itp;
+    }
+    return 0;
+}
+
+/**
+ * @ init. aul callback
+ */
+void initAulListenXSignal()
+{
+    aul_listen_app_launch_signal(app_launch_handler, NULL);
+    aul_listen_app_dead_signal(app_dead_handler, NULL);
+}
+
+/**
+ * @brief aul_listien_app_launch_signal multi
+ * @param func callback function
+ * @param data user data
+ */
+bool aul_listen_app_launch_signal_add(int (*func) (int, void *), void *data)
+{
+    launch_f.push_back((void*)func);
+    launch_p.push_back(data);
+    return true;
+}
+
+/**
+ * @brief aul_listien_app_dead_signal multi
+ * @param func callback function
+ * @param data user data
+ */
+bool aul_listen_app_dead_signal_add(int (*func) (int, void *), void *data)
+{
+    dead_f.push_back((void*)func);
+    dead_p.push_back(data);
+    return true;
+}
diff --git a/lib/system-controller/Cico_aul_listen_app.h b/lib/system-controller/Cico_aul_listen_app.h
new file mode 100644 (file)
index 0000000..f650e3b
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * 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   Homescreen application aul handler multi support
+ *
+ * @date    Sep-23-2013
+ */
+#ifndef CICO_AUL_LISTEN_APP_H
+#define CICO_AUL_LISTEN_APP_H
+
+int aul_listen_app_launch_signal_add(int (*func) (int, void *), void *data);
+int aul_listen_app_dead_signal_add(int (*func) (int, void *), void *data);
+void initAulListenXSignal();
+
+#endif
index 561eb84..f736a19 100644 (file)
@@ -33,7 +33,8 @@ libico_system_controller_la_SOURCES = \
        CicoSCSysResourceMonitor.cpp            \
        CicoSCResourceManager.cpp                       \
        ico_syc_mrp_resource.c                          \
-       CicoSCPolicyManager.cpp
+       CicoSCPolicyManager.cpp                         \
+       Cico_aul_listen_app.cpp
 
 libico_system_controller_la_CPPFLAGS = \
        $(GCC_CXXFLAGS)                                         \
@@ -51,6 +52,7 @@ libico_system_controller_la_CPPFLAGS =        \
        @MURPHYDOMAINCONTROLLER_CFLAGS@         \
        @MURPHYECORE_CFLAGS@                            \
        @MURPHYRESOURCE_CFLAGS@                         \
+       @EDBUS_CFLAGS@                                          \
        $(UWS_CFLAGS)                                           \
        $(WESTONPLUGIN_CFLAGS)                          \
        -I../../include                                         \
@@ -71,6 +73,7 @@ libico_system_controller_la_LIBADD =  \
        @MURPHYDOMAINCONTROLLER_LIBS@           \
        @MURPHYECORE_LIBS@                                      \
        @MURPHYRESOURCE_LIBS@                           \
+       @EDBUS_LIBS@                                            \
        $(UWS_LIBS)                                                     \
        $(WESTONPLUGIN_LIBS)
 
index 24c4346..4f2bf9f 100644 (file)
@@ -1,3 +1,16 @@
+* Wed Nov 06 2013 Shibata Makoto <shibata@mac.tec.toyota.co.jp> accepted/tizen/20131029.175553@d661402
+- 0.9.07 release.
+-- bugfix: Last information cannot set up / acquire.(Native app)
+-- bugfix: A grab is abandoned in the case that there is not a history by application history operation(next history operation in the latest / oldest)
+-- change: The history of application gesture function name was changed into Swipe by Flick.
+           So changed Flick of a source file name and the class name to Swipe
+-- change: ico-uxf-weston-plugin interface change of get_surfaces request and create/configure event
+-- change: Improve system controller and homescreen startup
+-- merged: Fix build to link against the security-server-client
+-- addition: Add a "logoff function of all users" to a user change
+-- addition: Addition of the live thumbnail of the running application to a menu
+-- bugfix: TIVI-1996
+
 * Tue Oct 08 2013 Shibata Makoto <shibata@mac.tec.toyota.co.jp> accepted/tizen/20131003.220120@49e6831
 - 0.9.05 release.
 -- bugfix: The page which does not exist by scrolling downward in a menu screen is displayed.
index 96b23cf..495a82e 100644 (file)
@@ -1,14 +1,14 @@
 Name:       ico-uxf-homescreen
 Summary:    Sample homescreen and system controller
-Version:    0.9.05
-Release:    1.3
+Version:    0.9.07
+Release:    1.1
 Group:         Graphics & UI Framework/Automotive UI
 License:    Apache-2.0
 URL:        ""
 Source0:    %{name}-%{version}.tar.bz2
 
 BuildRequires: pkgconfig(wayland-client) >= 1.2
-BuildRequires: ico-uxf-weston-plugin-devel >= 0.9.06
+BuildRequires: ico-uxf-weston-plugin-devel >= 0.9.07
 BuildRequires: pkgconfig(glib-2.0)
 BuildRequires: pkgconfig(ecore)
 BuildRequires: pkgconfig(ecore-wayland)
@@ -17,6 +17,7 @@ BuildRequires: pkgconfig(evas)
 BuildRequires: pkgconfig(eina)
 BuildRequires: pkgconfig(edje)
 BuildRequires: pkgconfig(elementary)
+BuildRequires: pkgconfig(edbus)
 BuildRequires: pkgconfig(dbus-1)
 BuildRequires: pkgconfig(json-glib-1.0)
 BuildRequires: pkgconfig(aul)
@@ -33,7 +34,7 @@ BuildRequires: boost-devel
 BuildRequires: mesa-devel
 BuildRequires: ico-uxf-utilities-devel
 Requires: weston >= 1.2
-Requires: ico-uxf-weston-plugin >= 0.9.06
+Requires: ico-uxf-weston-plugin >= 0.9.07
 Requires: ico-uxf-utilities
 
 %description
index fda527c..cfb22dc 100644 (file)
@@ -19,9 +19,20 @@ onscreen=org.tizen.ico.onscreen
 
 bgimage=/opt/share/settings/Wallpapers/Home_default.jpg
 
+### configuration for sounds
 [sound]
-#configuration for sounds
-sound_default=/usr/share/sounds/mm-camcorder/af_succeed.wav
+# command
+#      volume  0...65536
+command=paplay --device=0 --volume=30000 --stream-name=HOMESCREEN_BEEP
+
+# operation sound file path
+operation=/usr/apps/org.tizen.ico.homescreen/res/sound/operation.wav
+
+# success sound file path
+success=/usr/apps/org.tizen.ico.homescreen/res/sound/success.wav
+
+# failure sound file path
+failure=/usr/apps/org.tizen.ico.homescreen/res/sound/failure.wav
 
 [app_history]
 timer=10
index 78b6431..c7912fc 100644 (file)
Binary files a/res/org.tizen.ico.homescreen/res/images/bg.png and b/res/org.tizen.ico.homescreen/res/images/bg.png differ
old mode 100644 (file)
new mode 100755 (executable)
index 0de7f07..254b4bb
Binary files a/res/org.tizen.ico.homescreen/res/images/termIcon.png and b/res/org.tizen.ico.homescreen/res/images/termIcon.png differ
diff --git a/res/org.tizen.ico.homescreen/res/sound/failure.wav b/res/org.tizen.ico.homescreen/res/sound/failure.wav
new file mode 100644 (file)
index 0000000..ab94bcc
Binary files /dev/null and b/res/org.tizen.ico.homescreen/res/sound/failure.wav differ
diff --git a/res/org.tizen.ico.homescreen/res/sound/operation.wav b/res/org.tizen.ico.homescreen/res/sound/operation.wav
new file mode 100644 (file)
index 0000000..0618933
Binary files /dev/null and b/res/org.tizen.ico.homescreen/res/sound/operation.wav differ
diff --git a/res/org.tizen.ico.homescreen/res/sound/success.wav b/res/org.tizen.ico.homescreen/res/sound/success.wav
new file mode 100644 (file)
index 0000000..0618933
Binary files /dev/null and b/res/org.tizen.ico.homescreen/res/sound/success.wav differ
index f2bc077..0ff99c5 100644 (file)
@@ -1,7 +1,7 @@
 "stateMachine":{
   "name":"Policy",
   "value":1,
-  "initial":[1001,2001,3001,3101,4001,5001,9001,10001,11999,12003,13009,14999,15999,16999,17999,20999,22999,30001,30101],
+  "initial":[1001,2001,3001,3101,4001,5001,9001,10999,11999,12003,13009,14999,15999,16999,17999,20999,22999,30001,30101],
   "state":{
     "name":"Driving",
     "value":1000,
       "value":10001,
       "event":{ "name":"EV10000","value":10000, "transition":10001, "guardCondition":[{"operator":"=","value":1}]},
       "event":{ "name":"EV10000","value":10000, "transition":10002, "guardCondition":[{"operator":"=","value":2}]},
-      "event":{ "name":"EV10000","value":10000, "transition":10003, "guardCondition":[{"operator":"=","value":3}]}
+      "event":{ "name":"EV10000","value":10000, "transition":10003, "guardCondition":[{"operator":"=","value":3}]},
+      "event":{ "name":"EV10000","value":10000, "transition":10011, "guardCondition":[{"operator":"=","value":11}]},
+      "event":{ "name":"EV10000","value":10000, "transition":10012, "guardCondition":[{"operator":"=","value":12}]},
+      "event":{ "name":"EV10000","value":10000, "transition":10013, "guardCondition":[{"operator":"=","value":13}]},
+      "event":{ "name":"EV10999","value":10999, "transition":10999, "guardCondition":[{             "operator":">=","value":1},
+                                                                                      {"join":"and","operator":"<=","value":20}]}
     },
     "state":{
       "name":"Display0Zone2",
       "value":10002,
       "event":{ "name":"EV10000","value":10000, "transition":10001, "guardCondition":[{"operator":"=","value":1}]},
       "event":{ "name":"EV10000","value":10000, "transition":10002, "guardCondition":[{"operator":"=","value":2}]},
-      "event":{ "name":"EV10000","value":10000, "transition":10003, "guardCondition":[{"operator":"=","value":3}]}
+      "event":{ "name":"EV10000","value":10000, "transition":10003, "guardCondition":[{"operator":"=","value":3}]},
+      "event":{ "name":"EV10000","value":10000, "transition":10011, "guardCondition":[{"operator":"=","value":11}]},
+      "event":{ "name":"EV10000","value":10000, "transition":10012, "guardCondition":[{"operator":"=","value":12}]},
+      "event":{ "name":"EV10000","value":10000, "transition":10013, "guardCondition":[{"operator":"=","value":13}]},
+      "event":{ "name":"EV10999","value":10999, "transition":10999, "guardCondition":[{             "operator":">=","value":1},
+                                                                                      {"join":"and","operator":"<=","value":20}]}
     },
     "state":{
       "name":"Display0Zone3",
       "value":10003,
       "event":{ "name":"EV10000","value":10000, "transition":10001, "guardCondition":[{"operator":"=","value":1}]},
       "event":{ "name":"EV10000","value":10000, "transition":10002, "guardCondition":[{"operator":"=","value":2}]},
-      "event":{ "name":"EV10000","value":10000, "transition":10003, "guardCondition":[{"operator":"=","value":3}]}
+      "event":{ "name":"EV10000","value":10000, "transition":10003, "guardCondition":[{"operator":"=","value":3}]},
+      "event":{ "name":"EV10000","value":10000, "transition":10011, "guardCondition":[{"operator":"=","value":11}]},
+      "event":{ "name":"EV10000","value":10000, "transition":10012, "guardCondition":[{"operator":"=","value":12}]},
+      "event":{ "name":"EV10000","value":10000, "transition":10013, "guardCondition":[{"operator":"=","value":13}]},
+      "event":{ "name":"EV10999","value":10999, "transition":10999, "guardCondition":[{             "operator":">=","value":1},
+                                                                                      {"join":"and","operator":"<=","value":20}]}
+    },
+    "state":{
+      "name":"Display0Zone11",
+      "value":10011,
+      "event":{ "name":"EV10000","value":10000, "transition":10001, "guardCondition":[{"operator":"=","value":1}]},
+      "event":{ "name":"EV10000","value":10000, "transition":10002, "guardCondition":[{"operator":"=","value":2}]},
+      "event":{ "name":"EV10000","value":10000, "transition":10003, "guardCondition":[{"operator":"=","value":3}]},
+      "event":{ "name":"EV10000","value":10000, "transition":10011, "guardCondition":[{"operator":"=","value":11}]},
+      "event":{ "name":"EV10000","value":10000, "transition":10012, "guardCondition":[{"operator":"=","value":12}]},
+      "event":{ "name":"EV10000","value":10000, "transition":10013, "guardCondition":[{"operator":"=","value":13}]},
+      "event":{ "name":"EV10999","value":10999, "transition":10999, "guardCondition":[{             "operator":">=","value":1},
+                                                                                      {"join":"and","operator":"<=","value":20}]}
+    },
+    "state":{
+      "name":"Display0Zone12",
+      "value":10012,
+      "event":{ "name":"EV10000","value":10000, "transition":10001, "guardCondition":[{"operator":"=","value":1}]},
+      "event":{ "name":"EV10000","value":10000, "transition":10002, "guardCondition":[{"operator":"=","value":2}]},
+      "event":{ "name":"EV10000","value":10000, "transition":10003, "guardCondition":[{"operator":"=","value":3}]},
+      "event":{ "name":"EV10000","value":10000, "transition":10011, "guardCondition":[{"operator":"=","value":11}]},
+      "event":{ "name":"EV10000","value":10000, "transition":10012, "guardCondition":[{"operator":"=","value":12}]},
+      "event":{ "name":"EV10000","value":10000, "transition":10013, "guardCondition":[{"operator":"=","value":13}]},
+      "event":{ "name":"EV10999","value":10999, "transition":10999, "guardCondition":[{             "operator":">=","value":1},
+                                                                                      {"join":"and","operator":"<=","value":20}]}
+    },
+    "state":{
+      "name":"Display0Zone13",
+      "value":10013,
+      "event":{ "name":"EV10000","value":10000, "transition":10001, "guardCondition":[{"operator":"=","value":1}]},
+      "event":{ "name":"EV10000","value":10000, "transition":10002, "guardCondition":[{"operator":"=","value":2}]},
+      "event":{ "name":"EV10000","value":10000, "transition":10003, "guardCondition":[{"operator":"=","value":3}]},
+      "event":{ "name":"EV10000","value":10000, "transition":10011, "guardCondition":[{"operator":"=","value":11}]},
+      "event":{ "name":"EV10000","value":10000, "transition":10012, "guardCondition":[{"operator":"=","value":12}]},
+      "event":{ "name":"EV10000","value":10000, "transition":10013, "guardCondition":[{"operator":"=","value":13}]},
+      "event":{ "name":"EV10999","value":10999, "transition":10999, "guardCondition":[{             "operator":">=","value":1},
+                                                                                      {"join":"and","operator":"<=","value":20}]}
     },
     "state":{
       "name":"Display0NoOwer",
       "value":10999,
-      "event":{ "name":"EV10000","value":10000, "transition":11001, "guardCondition":[{"operator":"=","value":1}]},
-      "event":{ "name":"EV10000","value":10000, "transition":11002, "guardCondition":[{"operator":"=","value":2}]},
-      "event":{ "name":"EV10000","value":10000, "transition":11003, "guardCondition":[{"operator":"=","value":3}]}
+      "event":{ "name":"EV10000","value":10000, "transition":10001, "guardCondition":[{"operator":"=","value":1}]},
+      "event":{ "name":"EV10000","value":10000, "transition":10002, "guardCondition":[{"operator":"=","value":2}]},
+      "event":{ "name":"EV10000","value":10000, "transition":10003, "guardCondition":[{"operator":"=","value":3}]},
+      "event":{ "name":"EV10000","value":10000, "transition":10011, "guardCondition":[{"operator":"=","value":11}]},
+      "event":{ "name":"EV10000","value":10000, "transition":10012, "guardCondition":[{"operator":"=","value":12}]},
+      "event":{ "name":"EV10000","value":10000, "transition":10013, "guardCondition":[{"operator":"=","value":13}]}
     }
   },
 
     "state":{
       "name":"Display1Zone1",
       "value":11001,
-      "event":{ "name":"EV10000","value":10000, "transition":11001, "guardCondition":[{"operator":"=","value":20}]},
-      "event":{ "name":"EV10000","value":10000, "transition":11002, "guardCondition":[{"operator":"=","value":21}]},
-      "event":{ "name":"EV10000","value":10000, "transition":11003, "guardCondition":[{"operator":"=","value":22}]},
-      "event":{ "name":"EV11999","value":11999, "transition":11999}
+      "event":{ "name":"EV10000","value":10000, "transition":11001, "guardCondition":[{"operator":"=","value":21}]},
+      "event":{ "name":"EV10000","value":10000, "transition":11002, "guardCondition":[{"operator":"=","value":22}]},
+      "event":{ "name":"EV10000","value":10000, "transition":11003, "guardCondition":[{"operator":"=","value":23}]},
+      "event":{ "name":"EV10999","value":10999, "transition":11999, "guardCondition":[{             "operator":">=","value":21},
+                                                                                      {"join":"and","operator":"<=","value":40}]}
     },
     "state":{
       "name":"Display1Zone2",
       "value":11002,
-      "event":{ "name":"EV10000","value":10000, "transition":11001, "guardCondition":[{"operator":"=","value":20}]},
-      "event":{ "name":"EV10000","value":10000, "transition":11002, "guardCondition":[{"operator":"=","value":21}]},
-      "event":{ "name":"EV10000","value":10000, "transition":11003, "guardCondition":[{"operator":"=","value":22}]},
-      "event":{ "name":"EV11999","value":11999, "transition":11999}
+      "event":{ "name":"EV10000","value":10000, "transition":11001, "guardCondition":[{"operator":"=","value":21}]},
+      "event":{ "name":"EV10000","value":10000, "transition":11002, "guardCondition":[{"operator":"=","value":22}]},
+      "event":{ "name":"EV10000","value":10000, "transition":11003, "guardCondition":[{"operator":"=","value":23}]},
+      "event":{ "name":"EV10999","value":10999, "transition":11999, "guardCondition":[{             "operator":">=","value":21},
+                                                                                      {"join":"and","operator":"<=","value":40}]}
     },
     "state":{
       "name":"Display1Zone3",
       "value":11003,
-      "event":{ "name":"EV10000","value":10000, "transition":11001, "guardCondition":[{"operator":"=","value":20}]},
-      "event":{ "name":"EV10000","value":10000, "transition":11002, "guardCondition":[{"operator":"=","value":21}]},
-      "event":{ "name":"EV10000","value":10000, "transition":11003, "guardCondition":[{"operator":"=","value":22}]},
-      "event":{ "name":"EV11999","value":11999, "transition":11999}
+      "event":{ "name":"EV10000","value":10000, "transition":11001, "guardCondition":[{"operator":"=","value":21}]},
+      "event":{ "name":"EV10000","value":10000, "transition":11002, "guardCondition":[{"operator":"=","value":22}]},
+      "event":{ "name":"EV10000","value":10000, "transition":11003, "guardCondition":[{"operator":"=","value":23}]},
+      "event":{ "name":"EV10999","value":10999, "transition":11999, "guardCondition":[{             "operator":">=","value":21},
+                                                                                      {"join":"and","operator":"<=","value":40}]}
     },
     "state":{
       "name":"Display1NoOwer",
       "value":11999,
-      "event":{ "name":"EV10000","value":10000, "transition":11001, "guardCondition":[{"operator":"=","value":20}]},
-      "event":{ "name":"EV10000","value":10000, "transition":11002, "guardCondition":[{"operator":"=","value":21}]},
-      "event":{ "name":"EV10000","value":10000, "transition":11003, "guardCondition":[{"operator":"=","value":22}]}
+      "event":{ "name":"EV10000","value":10000, "transition":11001, "guardCondition":[{"operator":"=","value":21}]},
+      "event":{ "name":"EV10000","value":10000, "transition":11002, "guardCondition":[{"operator":"=","value":22}]},
+      "event":{ "name":"EV10000","value":10000, "transition":11003, "guardCondition":[{"operator":"=","value":23}]}
     }
   },
 
index 0d92acb..0eb0907 100644 (file)
     <display id="0" name="Center">
         <node>Center</node>
         <no>0</no>
-        <wayland>waylnad-0</wayland>
         <type>center</type>
         <width>1080</width>
         <height>1920</height>
-        <inch>101</inch>
         <layers>
             <layer id="0" name="BackGround">
-                <!-- type 1: background 2:normal 4:cursor 8:input -->
+                <!-- layer type -->
+                <!-- 1:background 2:application 3:homescreen 4:interrput application 5:onscreen 101:input 102:touch 103:cursor -->
                 <type>1</type>
                 <menuoverlap>false</menuoverlap>
             </layer>
-            <layer id="1" name="HomeScreen">
+            <layer id="1" name="Application">
                 <type>2</type>
                 <menuoverlap>false</menuoverlap>
             </layer>
-            <layer id="2" name="Application">
-                <type>2</type>
+            <layer id="2" name="SoftKeyboard">
+                <type>101</type>
                 <menuoverlap>false</menuoverlap>
             </layer>
-            <layer id="3" name="SoftKeyboard">
-                <type>8</type>
+            <layer id="3" name="HomeScreen">
+                <type>3</type>
                 <menuoverlap>false</menuoverlap>
             </layer>
-            <layer id="4" name="InterruptApp">
-                <type>2</type>
+            <layer id="4" name="ControlBar">
+                <type>3</type>
                 <menuoverlap>false</menuoverlap>
             </layer>
-            <layer id="5" name="Touch">
-                <type>8</type>
+            <layer id="5" name="InterruptApp">
+                <type>4</type>
                 <menuoverlap>false</menuoverlap>
             </layer>
             <layer id="6" name="OnScreen">
-                <type>2</type>
+                <type>5</type>
                 <menuoverlap>true</menuoverlap>
             </layer>
-            <layer id="7" name="Cursor">
-                <type>4</type>
+            <layer id="7" name="Touch">
+                <type>102</type>
+                <menuoverlap>false</menuoverlap>
+            </layer>
+            <layer id="8" name="Cursor">
+                <type>103</type>
                 <menuoverlap>false</menuoverlap>
             </layer>
         </layers>
         <zones>
-            <zone id="0" name="Base">
-                <geometry x="-1" y="-1" w="-1" h="-1"/>
-                <overlap/>
-            </zone>
+            <!-- * zone is mandatory element
+                   attribute of "id" is zone id. range of first display zone id is 1...20
+                   attribute of "name" is the zone name of any.
+                 * geometry is mmandatory element. This geometry values represents the position and size of the zone aria.
+                   attribute of "x" represets x position of zone.
+                   attribute of "y" represets y position of zone.
+                   attribute of "w" represets width of zone.
+                   attribute of "h" represets hieght of zone.
+                   Special string "dispw" is a value equal the width of the display.
+                   Special string "disph" is a value equal the height of the display.
+                 * aspect is optional element
+                   If attribute of "Fixed" is true, the surface of this zone is fixed aspect ratio.
+                   If attribute of "Fixed" is true, attribute of "AlignLeft"/"AlignRight"/"AlignTop"/"AlignBottom" is valid.
+                   If attribute of "AlignLeft" is ture, horizontal direction to aligned at the left when maintaining the aspect ratio.
+                   If attribute of "AlignRight" is true, horizontal direction to aligned at the right when maintaining the aspect ratio.
+                   IF attribute of both "AlignLeft" and "AlignRight" is true, located in the center.
+                   If attribute of "AlignTop" is true, vertical direction is aligned at the top when you maintain the aspect ratio.
+                   If attribute of "AlignBottom" is true, vertical direction is aligned at the bottom when you maintain the aspect ratio.
+                   IF attribute of both "AlignTop" and "AlignBottom" is true, located in the center.
+            -->
             <zone id="1" name="Full">
                 <geometry x="0" y="64" w="dispw" h="disph-64-128"/>
-                <overlap>Upper;Lower;UpperLeft;UpperRight;LowerLeft;LowerRight</overlap>
             </zone>
             <zone id="2" name="Upper">
                 <geometry x="0" y="64" w="dispw" h="disph-64-128/2"/>
-                <overlap>Full;UpperLeft;UpperRight</overlap>
             </zone>
             <zone id="3" name="Lower">
                 <geometry x="0" y="heigh-64-128/2+64" w="dispw" h="disph-64-128/2"/>
-                <overlap>Full;LowerLeft;LowerRight</overlap>
             </zone>
             <zone id="4" name="UpperLeft">
                 <geometry x="0" y="64" w="dispw/2" h="disph-64-128/2"/>
-                <overlap>Full;Upper</overlap>
             </zone>
             <zone id="5" name="UpperRight">
                 <geometry x="dispw/2" y="64" w="dispw/2" h="disph-64-128/2"/>
-                <overlap>Full;Upper</overlap>
             </zone>
             <zone id="6" name="LowerLeft">
                 <geometry x="0" y="heigh-64-128/2+64" w="dispw/2" h="disph-64-128/2"/>
-                <overlap>Full;Lower</overlap>
             </zone>
             <zone id="7" name="LowerRight">
                 <geometry x="dispw/2" y="heigh-64-128/2+64" w="dispw/2" h="disph-64-128/2"/>
-                <overlap>Full;Lower</overlap>
             </zone>
             <zone id="8" name="SysApp">
                 <geometry x="0" y="64" w="dispw" h="disph-64-128"/>
-                <overlap/>
             </zone>
             <zone id="9" name="SysApp.Left">
                 <geometry x="0" y="64" w="dispw/2-181" h="disph-64-128"/>
-                <overlap/>
             </zone>
             <zone id="10" name="SysApp.Right">
                 <geometry x="dispw/2+181" y="64" w="dispw/2-181" h="disph-64-128"/>
-                <overlap/>
+            </zone>
+            <zone id="11" name="MobileFull">
+                <geometry x="0" y="64" w="dispw" h="disph-64-128"/>
+
+                <aspect Fixed="true" AlignLeft="false" AlignRight="false" AlignTop="flase" AlignBottom="false"/>
+            </zone>
+            <zone id="12" name="MobileUpper">
+                <geometry x="0" y="64" w="dispw" h="disph-64-128/2"/>
+                <aspect Fixed="true" AlignLeft="false" AlignRight="false" AlignTop="flase" AlignBottom="false"/>
+            </zone>
+            <zone id="13" name="MobileLower">
+                <geometry x="0" y="heigh-64-128/2+64" w="dispw" h="disph-64-128/2"/>
+                <aspect Fixed="true" AlignLeft="false" AlignRight="false" AlignTop="flase" AlignBottom="false"/>
             </zone>
         </zones>
     </display>
     <display id="1" name="Mid">
         <node>Center</node>
         <no>1</no>
-        <wayland>waylnad-0</wayland>
         <type>center</type>
         <width>1280</width>
         <height>480</height>
-        <inch>101</inch>
         <layers>
-            <layer id="2" name="Application">
+            <layer id="1" name="MainApp">
+                <type>2</type>
+                <menuoverlap>false</menuoverlap>
+            </layer>
+            <layer id="2" name="SubDispMainApp">
+                <type>2</type>
+                <menuoverlap>false</menuoverlap>
+            </layer>
+            <layer id="3" name="SubDispSubApp">
                 <type>2</type>
                 <menuoverlap>false</menuoverlap>
             </layer>
         </layers>
         <zones>
-            <zone id="20" name="Full">
+            <zone id="21" name="Full">
                 <geometry x="0" y="0" w="dispw" h="disph"/>
                 <overlap>Left;Right</overlap>
             </zone>
-            <zone id="21" name="Left">
+            <zone id="22" name="Left">
                 <geometry x="0" y="0" w="320" h="disph"/>
                 <overlap>Full</overlap>
             </zone>
-            <zone id="22" name="Right">
+            <zone id="23" name="Right">
                 <geometry x="960" y="0" w="320" h="disph"/>
                 <overlap>Full</overlap>
             </zone>
index d6767ff..3f4418b 100644 (file)
@@ -336,7 +336,7 @@ void CicoHSAppHistoryExt::determined(CHSAHE_data_t* data)
         moveHistoryHead(m_waitSelApp);
         m_waitSelApp.clear();
         if (m_hs) {
-            m_hs->requestWaitActivation(appid);
+            m_hs->requestActivationAppid(appid);
         }
     }
     ICO_DBG("end");
@@ -617,7 +617,7 @@ const string& CicoHSAppHistoryExt::getNearHistory()
     list<string>::iterator p = m_appHistoryList.begin();
     if (p == m_appHistoryList.end()) {
         // NO history
-        ICO_TRA("end no history");
+        ICO_TRA("end no history I");
         return m_empty;
     }
     const char* pAppidSubD = getAppidSubDispBySystem();
@@ -629,7 +629,7 @@ const string& CicoHSAppHistoryExt::getNearHistory()
     ++p;
     if (p == m_appHistoryList.end()) {
         // NO history
-        ICO_TRA("end no history");
+        ICO_TRA("end no history II");
         return m_empty;
     }
     ICO_TRA("end near history is %s", (*p).c_str());
@@ -654,7 +654,7 @@ const string& CicoHSAppHistoryExt::getSwipeCurrentAppid()
 }
 
 /**
- * @breif update appid by vector<pairPidAppid>
+ * @brief update appid by vector<pairPidAppid>
  * @param appid target appid and update appide store
  * @ret bool
  * @retval true update appid
index 6fc453b..9cd30e6 100644 (file)
@@ -62,11 +62,12 @@ public:
     // pid to appid converter
     bool getAppid(int pid, std::string& appid);
 
-    // flick operation I/F
+    // swipe operation I/F
     void selectApp(int pid);
     void selectApp(const std::string& appid);
     void selectApp(const char* appid);
     const std::string& getSelectApp() const;
+    void clearSelectApp();
 
     // time out selected app
     void determined(CHSAHE_data_t* data);
@@ -207,5 +208,13 @@ inline const std::string& CicoHSAppHistoryExt::getSelectApp() const
     return m_waitSelApp;
 }
 
+/**
+ * @brief select appid clear
+ */
+inline void CicoHSAppHistoryExt::clearSelectApp()
+{
+    m_waitSelApp.clear();
+}
+
 #endif // CICOHSAPPHISTORYEXT_H
 
index 036f8f5..7718863 100644 (file)
@@ -82,7 +82,7 @@ CicoHSAppInfo::AddWindowInfo(ico_syc_win_info_t *wininfo)
     if (tmp_win_info == NULL) {
         ICO_ERR("CicoHSAppInfo::AddWindowInfo Leave(ERR)");
         return ICO_ERROR;
-    }   
+    }
     SetWindowInfo(tmp_win_info, wininfo);
     this->m_window_info.push_back(tmp_win_info);
     ++m_window_num;
@@ -127,12 +127,12 @@ CicoHSAppInfo::AddWindowAttr(ico_syc_win_attr_t *winattr)
     if (tmp_win_info == NULL){
         ICO_TRA("CicoHSAppInfo::AddWindowAttr Leave(ERR)");
         return ICO_ERROR;
-    }   
+    }
+
     SetWindowAttr(tmp_win_info, winattr);
     m_window_info.push_back(tmp_win_info);
     ++m_window_num;
-  
+
     ICO_TRA("CicoHSAppInfo::AddWindowAttr Leave(OK)");
     return ICO_OK;
 }
@@ -150,10 +150,41 @@ CicoHSAppInfo::FreeWindowInfo(const char *name)
     std::vector<ico_hs_window_info*>::iterator itr;
     itr = m_window_info.begin();
     for (; itr != m_window_info.end(); ++itr) {
-        if (0 == strncmp(name,(*itr)->name, ICO_HS_MAX_WINDOW_NAME)) {
+        if ((0 == strncmp(name,(*itr)->name, ICO_HS_MAX_WINDOW_NAME)) &&
+            ((*itr)->valid))    {
+            ICO_DBG("CicoHSAppInfo::FreeWindowInfo(name=%s)", name ? name : "(NULL)");
+            if ((*itr)->surface == m_last_surface)  {
+                m_last_surface = 0;
+            }
+            (*itr)->valid = false;
+            m_window_info.erase(itr);
+            -- m_window_num;
+            break;
+        }
+    }
+}
+
+//--------------------------------------------------------------------------
+/**
+ *  @brief  free window information
+ *
+ *  @param [in] surface surface id
+ */
+//--------------------------------------------------------------------------
+void
+CicoHSAppInfo::FreeWindowInfo(int surface)
+{
+    std::vector<ico_hs_window_info*>::iterator itr;
+    itr = m_window_info.begin();
+    for (; itr != m_window_info.end(); ++itr) {
+        if (((*itr)->surface == surface) && ((*itr)->valid))    {
+            ICO_DBG("CicoHSAppInfo::FreeWindowInfo(surface=%08x)", surface);
+            if ((*itr)->surface == m_last_surface)  {
+                m_last_surface = 0;
+            }
             (*itr)->valid = false;
             m_window_info.erase(itr);
-            --m_window_num;
+            -- m_window_num;
             break;
         }
     }
@@ -174,12 +205,12 @@ CicoHSAppInfo::GetAppId(void)
 
 //--------------------------------------------------------------------------
 /**
- *  @brief  get number of window 
+ *  @brief  get number of window
  *
  *  @return number of window
  */
 //--------------------------------------------------------------------------
-int 
+int
 CicoHSAppInfo::GetWindowNum(void)
 {
     return m_window_num;
@@ -187,7 +218,7 @@ CicoHSAppInfo::GetWindowNum(void)
 
 //--------------------------------------------------------------------------
 /**
- *  @brief  get window information 
+ *  @brief  get window information
  *
  *  @param[in]   name   window name
  *  @return window information
@@ -199,7 +230,8 @@ CicoHSAppInfo::GetWindowInfo(const char* name)
     std::vector<ico_hs_window_info*>::iterator itr;
     itr = m_window_info.begin();
     for (; itr != m_window_info.end(); ++itr) {
-        if(0 == strncmp(name,(*itr)->name, ICO_HS_MAX_WINDOW_NAME)) {
+        if((0 == strncmp(name,(*itr)->name, ICO_HS_MAX_WINDOW_NAME)) &&
+           ((*itr)->valid)) {
             return *itr;
         }
     }
@@ -222,8 +254,9 @@ CicoHSAppInfo::GetWindowInfo(int idx)
 
     for (std::vector<ico_hs_window_info*>::iterator it_window_info
                 = m_window_info.begin();
-        it_window_info != m_window_info.end();
-        it_window_info++){
+         it_window_info != m_window_info.end();
+         it_window_info++) {
+        if (! (*it_window_info)->valid) continue;
         if (i >= idx)   {
             return *it_window_info;
         }
@@ -234,7 +267,7 @@ CicoHSAppInfo::GetWindowInfo(int idx)
 
 //--------------------------------------------------------------------------
 /**
- *  @brief  get window information 
+ *  @brief  get window information
  *
  *  @param[in]   surface    surface id
  *  @return window information
@@ -246,16 +279,17 @@ CicoHSAppInfo::GetWindowInfobySurface(int surface)
     std::vector<ico_hs_window_info*>::iterator itr;
     itr = m_window_info.begin();
     for (; itr != m_window_info.end(); ++itr) {
-        if ((*itr)->surface == surface) {
+        if (((*itr)->surface == surface) &&
+            ((*itr)->valid))    {
             return *itr;
         }
     }
-    return NULL;  
+    return NULL;
 }
 
 //--------------------------------------------------------------------------
 /**
- *  @brief   launch application 
+ *  @brief   launch application
  *
  *  @return 0 on success, other on error
  */
@@ -264,17 +298,16 @@ int
 CicoHSAppInfo::Execute(void)
 {
     // call launch api
-    int ret = m_life_cycle_controller->launch(m_appid);    
-    if(ret < 0){
+    int ret = m_life_cycle_controller->launch(m_appid);
+    if (ret < 0) {
         return ret;
     }
-
     return ret;
 }
 
 //--------------------------------------------------------------------------
 /*
- *  @brief  terminate application 
+ *  @brief  terminate application
  *
  *  @return 0 on success, other on error
  */
@@ -283,24 +316,23 @@ int
 CicoHSAppInfo::Terminate(void)
 {
     // call terminate api
-    int ret = m_life_cycle_controller->terminate(m_appid);    
+    int ret = m_life_cycle_controller->terminate(m_appid);
     if(ret < 0){
         return ret;
     }
-
-   return ret;
+    return ret;
 }
 
 //--------------------------------------------------------------------------
 /**
- *  @brief  get status 
+ *  @brief  get status
  *
  *  @return application running status
  *  @retval true    running
  *  @retval false   not running
  */
 //--------------------------------------------------------------------------
-bool 
+bool
 CicoHSAppInfo::GetStatus(void)
 {
     return m_life_cycle_controller->isRunning(m_appid);
@@ -313,7 +345,7 @@ CicoHSAppInfo::GetStatus(void)
  *  @param [in] last surface id
  */
 //--------------------------------------------------------------------------
-void 
+void
 CicoHSAppInfo::SetLastSurface(int last_surface)
 {
     m_last_surface = last_surface;
@@ -326,7 +358,7 @@ CicoHSAppInfo::SetLastSurface(int last_surface)
  *  @return surface id
  */
 //--------------------------------------------------------------------------
-int 
+int
 CicoHSAppInfo::GetLastSurface(void)
 {
     return m_last_surface;
@@ -354,11 +386,10 @@ CicoHSAppInfo::GetDefaultZone(void)
         const CicoSCDefaultConf* defConf = sysConf->getDefaultConf();
         zoneConf = sysConf->findDisplayZoneConfbyId(defConf->displayzone);
     }
-        
+
     if (NULL == zoneConf) {
         return NULL;
     }
-
     return zoneConf->fullname.c_str();
 }
 
@@ -373,7 +404,7 @@ CicoHSAppInfo::GetDefaultZone(void)
  *  @param [in] wininfo     window information from system-controller
  */
 //--------------------------------------------------------------------------
-void 
+void
 CicoHSAppInfo::SetWindowInfo(ico_hs_window_info *hs_wininfo,
                              ico_syc_win_info_t *wininfo)
 {
@@ -405,7 +436,7 @@ CicoHSAppInfo::SetWindowInfo(ico_hs_window_info *hs_wininfo,
  *  @param [in] winattr     window attribute
  */
 //--------------------------------------------------------------------------
-void 
+void
 CicoHSAppInfo::SetWindowAttr(ico_hs_window_info *hs_wininfo,
                              ico_syc_win_attr_t *winattr)
 {
@@ -423,11 +454,11 @@ CicoHSAppInfo::SetWindowAttr(ico_hs_window_info *hs_wininfo,
         strncpy(hs_wininfo->appid, winattr->appid, ICO_HS_MAX_PROCESS_NAME);
     }
 
-    if (winattr->name != NULL) { 
+    if (winattr->name != NULL) {
         strncpy(hs_wininfo->name, winattr->name, ICO_HS_MAX_WINDOW_NAME);
     }
 
-    if (winattr->zone != NULL) { 
+    if (winattr->zone != NULL) {
         strncpy(hs_wininfo->zone, winattr->zone, ICO_HS_MAX_ZONE_NAME);
     }
 
index eaf8bdf..b925107 100644 (file)
 
 #define ICO_HS_APPLICATION_FULL_SCREEN_POS_X 0
 #define ICO_HS_APPLICATION_FULL_SCREEN_POS_Y 64
-#define ICO_HS_APPLICATION_FULL_SCREEN_WIDTH 1080
-#define ICO_HS_APPLICATION_FULL_SCREEN_HEIGHT 1728
 
 #define ICO_HS_MAX_WINDOW_NAME 64
 #define ICO_HS_MAX_ZONE_NAME 64
 
-typedef struct _ico_hs_window_info{
+typedef struct _ico_hs_window_info {
     bool valid;
     char appid[ICO_HS_MAX_PROCESS_NAME];
     char name[ICO_HS_MAX_WINDOW_NAME];
@@ -52,11 +50,11 @@ typedef struct _ico_hs_window_info{
     int  raise;
     int  visible;
     int  active;
-}ico_hs_window_info;
+} ico_hs_window_info;
 
 //--------------------------------------------------------------------------
 /**
- *  @brief  
+ *  @brief
  */
 //--------------------------------------------------------------------------
 class CicoHSAppInfo
@@ -77,6 +75,9 @@ public:
     // free window information
     void FreeWindowInfo(const char *name);
 
+    // free window information
+    void FreeWindowInfo(int surface);
+
     // get application id
     const char * GetAppId(void);
 
@@ -100,7 +101,7 @@ public:
 
     // get application running status
     bool GetStatus(void);
-   
+
     // set last surface id
     void SetLastSurface(int last_surface);
 
index 08e4e12..a884275 100644 (file)
@@ -64,11 +64,9 @@ CicoHSControlBarTouch::Finalize(void)
  */
 /*--------------------------------------------------------------------------*/
 void
-CicoHSControlBarTouch::TouchDownControlBar(void *data, Evas *evas, Evas_Object *obj, void *event_info)
+CicoHSControlBarTouch::TouchDownControlBar(void *data, Evas *evas,
+                                           Evas_Object *obj, void *event_info)
 {
-//   Evas_Event_Mouse_Down *info;
-//   int button_id;
-
 }
 
 /*--------------------------------------------------------------------------*/
@@ -84,16 +82,19 @@ CicoHSControlBarTouch::TouchDownControlBar(void *data, Evas *evas, Evas_Object *
  */
 /*--------------------------------------------------------------------------*/
 void
-CicoHSControlBarTouch::TouchUpControlBar(void *data, Evas *evas, Evas_Object *obj, void *event_info)
+CicoHSControlBarTouch::TouchUpControlBar(void *data, Evas *evas,
+                                         Evas_Object *obj, void *event_info)
 {
 //   Evas_Event_Mouse_Up *info;
 //   int sub = 0;
-   ICO_DBG("CicoHSControlBarTouch::TouchUpControlBar start");  
-   if(data == NULL){
+    ICO_DBG("CicoHSControlBarTouch::TouchUpControlBar start");  
+    if(data == NULL) {
         ctl_bar_window->TouchHome();
-   }else{
-        ICO_DBG("CicoHSControlBarTouch::TouchUpControlBar appid = [%s]",(const char *)data);  
+    }
+    else {
+        ICO_DBG("CicoHSControlBarTouch::TouchUpControlBar appid = [%s]",
+                (const char *)data);  
         ctl_bar_window->TouchShortcut((const char *)data); 
-   }
-   ICO_DBG("CicoHSControlBarTouch::TouchUpControlBar end");  
+    }
+    ICO_DBG("CicoHSControlBarTouch::TouchUpControlBar end");  
 }
index 5a68658..d372e12 100644 (file)
@@ -17,6 +17,7 @@
 #include "CicoHomeScreenResourceConfig.h"
 #include "CicoHomeScreen.h"
 #include "CicoHSSystemState.h"
+#include "CicoSound.h"
 
 /*============================================================================*/
 /* functions                                                                  */
@@ -340,6 +341,14 @@ CicoHSControlBarWindow::FreeControlBarWindow(void)
 void 
 CicoHSControlBarWindow::TouchHome(void)
 {
+    ActivationUpdate();
+    if (true == CicoHSSystemState::getInstance()->getRegulation()) {
+        CicoSound::GetInstance()->PlayFailureSound();
+    }
+    else {
+        CicoSound::GetInstance()->PlayOperationSound();
+    }
+        
     CicoHomeScreen::ChangeMode(ICO_HS_SHOW_HIDE_PATTERN_SLIDE);
 }
 
@@ -442,7 +451,7 @@ CicoHSControlBarWindow::SetRegulation(void)
 
 /*--------------------------------------------------------------------------*/
 /**
- * @brief   CicoHSControlBarWindow::SetMenuWindowID
+ * @brief   CicoHSControlBarWindow::SetWindowID
  *          set appid and surface
  *
  * @param[in]   none
@@ -458,6 +467,34 @@ CicoHSControlBarWindow::SetWindowID(const char *appid,int surface)
 
 /*--------------------------------------------------------------------------*/
 /**
+ * @brief   CicoHSControlBarWindow::GetSurfaceId
+ *          get surface id of control bar window
+ *
+ * @return  surface id
+ */
+/*--------------------------------------------------------------------------*/
+int
+CicoHSControlBarWindow::GetSurfaceId(void)
+{
+    return this->surface;
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   CicoHSControlBarWindow::GetAppId
+ *          get application id of control bar
+ *
+ * @return  application id
+ */
+/*--------------------------------------------------------------------------*/
+const char *
+CicoHSControlBarWindow::GetAppId(void)
+{
+    return this->appid;
+}
+
+/*--------------------------------------------------------------------------*/
+/**
  * @brief   CicoHSControlBarWindow::TouchShortcut
  *          touch shortcut button
  *
@@ -469,6 +506,9 @@ void
 CicoHSControlBarWindow::TouchShortcut(const char *appid)
 {
     ICO_DBG("CicoHSControlBarWindow::TouchShortcut Enter");
+    ActivationUpdate();
+
+    CicoSound::GetInstance()->PlayOperationSound();
 
     if (appid != NULL) {
         ICO_DBG("CicoHSControlBarWindow::TouchShortcut appid = [%s]", appid);
@@ -495,6 +535,8 @@ CicoHSControlBarWindow::onKeyDown(void *data, Evas *evas,
     Evas_Event_Key_Down *evinfo = NULL;
     evinfo = (Evas_Event_Key_Down*)info;
 
+    CicoSound::GetInstance()->PlayOperationSound();
+
     ICO_DBG("onKeyDown: keyname=%s, key=%d",
             evinfo->keyname, (char)*evinfo->key);
 
@@ -529,4 +571,20 @@ CicoHSControlBarWindow::evasKeyDownCB(void *data, Evas *evas,
     CicoHSControlBarWindow *ctrlbarwin = (CicoHSControlBarWindow*)(data);
     ctrlbarwin->onKeyDown(data, evas, obj, info);
 }
+
+//--------------------------------------------------------------------------
+/**
+ *  @brief  Activation update swipe app
+ *
+ *  @return bool
+ *  @retval true update
+ *  @retval false no update
+ */
+//--------------------------------------------------------------------------
+bool
+CicoHSControlBarWindow::ActivationUpdate(void)
+{
+    return CicoHomeScreen::ActivationUpdate();
+}
+
 // vim: set expandtab ts=4 sw=4:
index 127982d..42fcc5d 100644 (file)
@@ -55,6 +55,8 @@ class CicoHSControlBarWindow :public CicoHSWindow
     void TouchHome(void);
 
     void SetWindowID(const char *appid,int surface);
+    int GetSurfaceId(void);
+    const char * GetAppId(void);
 
     void SetNightMode(void);
     void SetRegulation(void);
@@ -63,6 +65,7 @@ class CicoHSControlBarWindow :public CicoHSWindow
 
     void onKeyDown(void *data, Evas *evas, Evas_Object *obj, void *info);
 
+    bool ActivationUpdate(void);
 protected:
     // assignment operator
     CicoHSControlBarWindow operator=(const CicoHSControlBarWindow&);
diff --git a/src/homescreen/CicoHSFlickTouch.cpp b/src/homescreen/CicoHSFlickTouch.cpp
deleted file mode 100644 (file)
index d6e9c3d..0000000
+++ /dev/null
@@ -1,517 +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   touch action of menu
- *
- * @date    Sep^2--2013
- */
-#include "CicoHSFlickTouch.h"
-#include "CicoHSAppInfo.h"
-#include "CicoHomeScreen.h"
-#include "CicoHSSystemState.h"
-#include "ico_syc_inputctl.h"
-#include <linux/input.h>
-
-/*============================================================================*/
-/* static members                                                             */
-/*============================================================================*/
-CicoHSControlBarWindow* CicoHSFlickTouch::ctl_bar_window;
-CicoHSAppHistoryExt*    CicoHSFlickTouch::app_history;
-int CicoHSFlickTouch::full_width;
-int CicoHSFlickTouch::full_height;
-int CicoHSFlickTouch::touch_state_b_x;
-int CicoHSFlickTouch::touch_state_b_y;
-int CicoHSFlickTouch::touch_state_a_x;
-int CicoHSFlickTouch::touch_state_a_y;
-int CicoHSFlickTouch::touch_lasttime;
-
-Ecore_Timer *CicoHSFlickTouch::timer;
-bool CicoHSFlickTouch::touch_down;
-bool CicoHSFlickTouch::long_act;
-bool CicoHSFlickTouch::set_xy_pos;
-
-int CicoHSFlickTouch::num_windows;
-CicoHSFlickInputWindow* CicoHSFlickTouch::flick_windows[ICO_HS_MAX_FLICKWINDOWS];
-
-/*============================================================================*/
-/* functions                                                                  */
-/*============================================================================*/
-/*--------------------------------------------------------------------------*/
-/**
- * @brief   CicoHSFlickTouch::Initialize
- *          Initialize
- *
- * @param[in]   ctl_bar     instance of control bar window
- * @param[in]   apphist     instance of application history control
- * @param[in]   width       screen full width
- * @param[in]   height      screen full height
- * @return      none
- */
-/*--------------------------------------------------------------------------*/
-void
-CicoHSFlickTouch::Initialize(CicoHSControlBarWindow* ctl_bar, CicoHSAppHistoryExt* apphist,
-                             int width, int height)
-{
-    timer = NULL;
-    num_windows = 0;
-    touch_down = false;
-    long_act = false;
-    set_xy_pos = false;
-
-    ctl_bar_window = ctl_bar;
-    app_history = apphist;
-    full_width = width;
-    full_height = height;
-    touch_lasttime = 0;
-    ICO_DBG("Initialize: ctlbar=%08x apphist=%08x width=%d height=%d",
-            (int)ctl_bar, (int)apphist, width, height);
-}
-
-/*--------------------------------------------------------------------------*/
-/**
- * @brief   CicoHSFlickTouch::Finalize
- *          Finalize
- *
- * @param[in]   none
- * @return      none
- */
-/*--------------------------------------------------------------------------*/
-void
-CicoHSFlickTouch::Finalize(void)
-{
-  /*nothing to do*/
-}
-
-/*--------------------------------------------------------------------------*/
-/**
- * @brief   CicoHSFlickTouch::TouchFlick
- *          touch down action at flick input window
- *
- * @param[in]   data    CicoHSFlickInputWindow object
- * @param[in]   evas    evas
- * @param[in]   obj     object
- * @param[in]   event_info    event information
- * @return      none
- */
-/*--------------------------------------------------------------------------*/
-void
-CicoHSFlickTouch::TouchDownFlick(void *data, Evas *evas, Evas_Object *obj, void *event_info)
-{
-    Evas_Event_Mouse_Down   *info;
-    CicoHSFlickInputWindow  *window;
-    struct timeval ctime;
-
-    info = reinterpret_cast<Evas_Event_Mouse_Down*>(event_info);
-    window = (CicoHSFlickInputWindow *)data;
-
-    if ((info->output.x < 0) || (info->output.y < 0) ||
-        (info->output.x >= 4096) || (info->output.y >= 4096))   {
-        ICO_DBG("TouchDownFlick: illegal position(%d/%d)", info->output.x, info->output.y);
-    }
-    else if (set_xy_pos == false)   {
-        set_xy_pos = true;
-        touch_state_b_x = info->output.x + window->GetPosX();
-        touch_state_b_y = info->output.y + window->GetPosY();
-    }
-    if (touch_down) {
-        ICO_DBG("TouchDownFlick: dual touch down, Skip");
-        return;
-    }
-
-    gettimeofday(&ctime, NULL);
-    touch_lasttime = (ctime.tv_sec * 1000 + ctime.tv_usec/1000);
-
-    ICO_DBG("TouchDownFlick: x/y=%d/%d->%d/%d", info->output.x, info->output.y,
-            touch_state_b_x, touch_state_b_y);
-
-    touch_down = true;
-    long_act = false;
-    timer = ecore_timer_add(ICO_HS_FLICK_TOUCH_LONG_PUSH_THREASHOLD_TIME_SECONDS,
-                            LongPushed,NULL);
-}
-
-/*--------------------------------------------------------------------------*/
-/**
- * @brief   LongPushed::Touch timeout
- *          touch down timeout called from ecore
- *
- * @param[in]   data    user data(unused)
- * @return      fixed EINA_TRUE
- */
-/*--------------------------------------------------------------------------*/
-Eina_Bool
-CicoHSFlickTouch::LongPushed(void *data)
-{
-    ICO_DBG("LongPushed: timedout");
-    long_act = true;
-    timer = NULL;
-
-    /* send ABS_X/Y     */
-    ICO_DBG("LongPushed: Not Flick, send Touch Down event to application");
-    ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 2,
-                       ABS_Z, (touch_state_b_x << 16) | touch_state_b_y);
-    /* send TOUCH Down  */
-    ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 1,
-                       BTN_TOUCH, 1);
-    /* send ABS_X/Y     */
-    ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime,
-                       ABS_Z, ((touch_state_b_x+1) << 16) | (touch_state_b_y+1));
-
-    return ECORE_CALLBACK_CANCEL;
-}
-
-/*--------------------------------------------------------------------------*/
-/**
- * @brief   CicoHSFlickTouch::TouchUpFlick
- *          touch up action at flick input window
- *
- * @param[in]   data    CicoHSFlickInputWindow object
- * @param[in]   evas    evas
- * @param[in]   obj     object
- * @param[in]   event_info    event information
- * @return      none
- */
-/*--------------------------------------------------------------------------*/
-void
-CicoHSFlickTouch::TouchUpFlick(void *data, Evas *evas, Evas_Object *obj, void *event_info)
-{
-    Evas_Event_Mouse_Up     *info;
-    CicoHSFlickInputWindow  *window;
-    CicoHSAppInfo           *appinfo;
-    ico_hs_window_info      *wininfo;
-    ico_syc_animation_t     animation;
-    struct timeval ctime;
-    int sub;
-    int idx;
-    int flick = 0;
-    std::string histapp;
-    std::string curapp;
-
-    info = reinterpret_cast<Evas_Event_Mouse_Up*>(event_info);
-    window = (CicoHSFlickInputWindow *)data;
-    touch_state_a_x = info->output.x + window->GetPosX();
-    touch_state_a_y = info->output.y + window->GetPosY();
-    set_xy_pos = false;
-
-    ICO_DBG("TouchUpFlick: x/y=%d/%d->%d/%d (before %d/%d)",
-            info->output.x, info->output.y,
-            touch_state_b_x, touch_state_b_y, touch_state_a_x, touch_state_a_y);
-
-    if(timer != NULL){
-        ecore_timer_del(timer);
-        timer = NULL;
-    }
-    /* long push    */
-    if((touch_down == false) || (long_act == true)) {
-        ICO_DBG("TouchUpFlick: timedout");
-        touch_down = false;
-
-        /* send touch release event */
-        gettimeofday(&ctime, NULL);
-        touch_lasttime = (ctime.tv_sec * 1000 + ctime.tv_usec/1000);
-
-        /* send ABS_X/Y     */
-        ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 2,
-                           ABS_Z, (touch_state_a_x << 16) | touch_state_a_y);
-        /* send TOUCH Up    */
-        ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 1,
-                           BTN_TOUCH, 0);
-        /* send ABS_X/Y     */
-        ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime,
-                           ABS_Z, ((touch_state_a_x+1) << 16) | (touch_state_a_y+1));
-        return;
-    }
-    touch_down = false;
-    sub = touch_state_a_x - touch_state_b_x;
-
-    /* check slide left to right or right to left   */
-    if (sub > ICO_HS_FLICK_TOUCH_FLICK_THREASHOLD_DISTANCE) {
-        if (touch_state_b_x < ICO_HS_FLICK_TOUCH_FLICK_THREASHOLD_DISTANCE) {
-            if (CicoHSSystemState::getInstance()->getRegulation() == true)  {
-                ICO_DBG("TouchUpFlick: Flick left side to right, but Regulation=ON");
-            }
-            else    {
-                /* flick at left side to right = back before application*/
-                ICO_DBG("TouchUpFlick: Flick left side to right");
-
-                /* get before application   */
-                curapp = app_history->getSwipeCurrentAppid();
-                histapp = app_history->prevSwipe();
-                ICO_DBG("TouchUpFlick: Flick left to right(cur/prev=%s/%s)",
-                        curapp.c_str(), histapp.c_str());
-                if (histapp.empty())    {
-                    ICO_DBG("TouchUpFlick: Flick left to right(prev not exist)");
-                }
-                else    {
-                    animation.time = ICO_HS_FLICK_TOUCH_FLICK_ANIMA_TIME |
-                                     ICO_SYC_WIN_SURF_RAISE | ICO_SYC_WIN_SURF_NORESCTL;
-
-                    /* show before application with slide to right  */
-                    appinfo = CicoHomeScreen::GetAppInfo(histapp.c_str());
-                    if (appinfo)    {
-                        animation.name = (char *)"slide.toright";
-                        for (idx = 0; ; idx++)  {
-                            wininfo = appinfo->GetWindowInfo(idx);
-                            if (! wininfo)  break;
-                            ICO_DBG("TouchUpFlick: %s.%d surface=%08x",
-                                    wininfo->appid, idx, wininfo->surface);
-                            ico_syc_show(wininfo->appid, wininfo->surface, &animation);
-                        }
-                    }
-                    else    {
-                        ICO_DBG("TouchUpFlick: prev app(%s) dose not exist", histapp.c_str());
-                    }
-
-                    /* hide current applicaiton with slide to right */
-                    if (curapp.empty()) {
-                        ICO_DBG("TouchUpFlick: Flick left to right(current not exist)");
-                    }
-                    else    {
-                        animation.time = ICO_HS_FLICK_TOUCH_FLICK_ANIMA_TIME |
-                                         ICO_SYC_WIN_SURF_NORESCTL;
-                        appinfo = CicoHomeScreen::GetAppInfo(curapp.c_str());
-                        if (appinfo)    {
-                            animation.name = (char *)"slide.toleft";
-                            for (idx = 0; ; idx++)  {
-                                wininfo = appinfo->GetWindowInfo(idx);
-                                if (! wininfo)  break;
-                                ICO_DBG("TouchUpFlick: %s.%d surface=%08x",
-                                        wininfo->appid, idx, wininfo->surface);
-                                ico_syc_hide(wininfo->appid, wininfo->surface, &animation);
-                            }
-                        }
-                        else    {
-                            ICO_DBG("TouchUpFlick: current app(%s) dose not exist",
-                                    curapp.c_str());
-                        }
-                    }
-                    /* set history timer                            */
-                    app_history->selectApp(histapp.c_str());
-                }
-            }
-            flick = 1;
-        }
-        else    {
-            ICO_DBG("TouchUpFlick: Flick left to right, but nop");
-            flick = -1;
-        }
-    }
-    else if (sub < (-1 * ICO_HS_FLICK_TOUCH_FLICK_THREASHOLD_DISTANCE)) {
-        if (touch_state_b_x >
-            (full_width - ICO_HS_FLICK_TOUCH_FLICK_THREASHOLD_DISTANCE))    {
-            if (CicoHSSystemState::getInstance()->getRegulation() == true)  {
-                ICO_DBG("TouchUpFlick: Flick right side to left, but Regulation=ON");
-            }
-            else    {
-                /* flick at right side to left = go next applicaton     */
-
-                /* get next application     */
-                curapp = app_history->getSwipeCurrentAppid();
-                histapp = app_history->nextSwipe();
-                ICO_DBG("TouchUpFlick: Flick right to left(cur/next=%s/%s)",
-                        curapp.c_str(), histapp.c_str());
-                if (histapp.empty())    {
-                    ICO_DBG("TouchUpFlick: Flick right to left(next not exist)");
-                }
-                else    {
-                    animation.time = ICO_HS_FLICK_TOUCH_FLICK_ANIMA_TIME |
-                                     ICO_SYC_WIN_SURF_RAISE | ICO_SYC_WIN_SURF_NORESCTL;
-
-                    /* show next application with slide to left     */
-                    appinfo = CicoHomeScreen::GetAppInfo(histapp.c_str());
-                    if (appinfo)    {
-                        animation.name = (char *)"slide.toleft";
-                        for (idx = 0; ; idx++)  {
-                            wininfo = appinfo->GetWindowInfo(idx);
-                            if (! wininfo)  break;
-                            ICO_DBG("TouchUpFlick: %s.%d surface=%08x",
-                                    wininfo->appid, idx, wininfo->surface);
-                            ico_syc_show(wininfo->appid, wininfo->surface, &animation);
-                        }
-                    }
-                    else    {
-                        ICO_DBG("TouchUpFlick: next app(%s) dose not exist", histapp.c_str());
-                    }
-
-                    /* hide current applicaiton with slide to left  */
-                    if (curapp.empty()) {
-                        ICO_DBG("TouchUpFlick: Flick right to left(current not exist)");
-                    }
-                    else    {
-                        animation.time = ICO_HS_FLICK_TOUCH_FLICK_ANIMA_TIME |
-                                         ICO_SYC_WIN_SURF_NORESCTL;
-                        appinfo = CicoHomeScreen::GetAppInfo(curapp.c_str());
-                        if (appinfo)    {
-                        animation.name = (char *)"slide.toright";
-                            for (idx = 0; ; idx++)  {
-                                wininfo = appinfo->GetWindowInfo(idx);
-                                if (! wininfo)  break;
-                                ICO_DBG("TouchUpFlick: %s.%d surface=%08x",
-                                        wininfo->appid, idx, wininfo->surface);
-                                ico_syc_hide(wininfo->appid, wininfo->surface, &animation);
-                            }
-                        }
-                        else    {
-                            ICO_DBG("TouchUpFlick: current app(%s) dose not exist",
-                                    curapp.c_str());
-                        }
-                    }
-                    /* set history timer                            */
-                    app_history->selectApp(histapp.c_str());
-                }
-            }
-            flick = 1;
-        }
-        else    {
-            ICO_DBG("TouchUpFlick: Flick right side to left, but nop");
-            flick = -1;
-        }
-    }
-
-#if 0       /* currently not support    */
-    /* check slide buttom to top or top to buttom   */
-    sub = touch_state_a_y - touch_state_b_y;
-    if (sub > ICO_HS_FLICK_TOUCH_FLICK_THREASHOLD_DISTANCE) {
-        if (touch_state_b_y < ICO_HS_FLICK_TOUCH_FLICK_THREASHOLD_DISTANCE) {
-            /* flick at top side to buttom = unknown    */
-            ICO_DBG("TouchUpFlick: Flick top side to buttom");
-            flick = 1;
-        }
-        else    {
-            ICO_DBG("TouchUpFlick: Flick top side to buttom, but nop");
-            flick = -1;
-        }
-    }
-    else if (sub < (-1 * ICO_HS_FLICK_TOUCH_FLICK_THREASHOLD_DISTANCE)) {
-        if (touch_state_b_y >
-            (full_width - ICO_HS_FLICK_TOUCH_FLICK_THREASHOLD_DISTANCE))    {
-            /* flick at buttom side to top = show home menu screen  */
-            ICO_DBG("TouchUpFlick: Flick buttom side to top");
-            flick = 1;
-            if (ctl_bar_window) {
-                ctl_bar_window->TouchHome();
-            }
-        }
-        else    {
-            ICO_DBG("TouchUpFlick: Flick buttom side to top, but nop");
-            flick = -1;
-        }
-    }
-#endif
-    if (flick <= 0) {
-        /* send touch press event   */
-        ICO_DBG("TouchUpFlick: Not Flick, send event to application");
-        /* send ABS_X/Y     */
-        ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 2,
-                           ABS_Z, (touch_state_b_x << 16) | touch_state_b_y);
-        /* send TOUCH Down  */
-        ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 1,
-                           BTN_TOUCH, 1);
-        /* send ABS_X/Y     */
-        ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime,
-                           ABS_Z, ((touch_state_b_x+1) << 16) | (touch_state_b_y+1));
-
-        /* send touch release event */
-        gettimeofday(&ctime, NULL);
-        touch_lasttime = (ctime.tv_sec * 1000 + ctime.tv_usec/1000);
-
-        /* send ABS_X/Y     */
-        ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 2,
-                           ABS_Z, (touch_state_a_x << 16) | touch_state_a_y);
-        /* send TOUCH Up    */
-        ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 1,
-                           BTN_TOUCH, 0);
-        /* send ABS_X/Y     */
-        ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime,
-                           ABS_Z, ((touch_state_a_x+1) << 16) | (touch_state_a_y+1));
-    }
-}
-
-/*--------------------------------------------------------------------------*/
-/**
- * @brief   CicoHSFlickTouch::TouchMoveFlick
- *          touch move action at flick input window
- *
- * @param[in]   data    CicoHSFlickInputWindow object
- * @param[in]   evas    evas
- * @param[in]   obj     object
- * @param[in]   event_info    event information
- * @return      none
- */
-/*--------------------------------------------------------------------------*/
-void
-CicoHSFlickTouch::TouchMoveFlick(void *data, Evas *evas, Evas_Object *obj, void *event_info)
-{
-    Evas_Event_Mouse_Move   *info;
-    CicoHSFlickInputWindow  *window;
-    struct timeval ctime;
-
-    info = reinterpret_cast<Evas_Event_Mouse_Move*>(event_info);
-
-    ICO_DBG("TouchMoveFlick: button=%x cur.x/y=%d/%d prv.x/y=%d/%d",
-            info->buttons, info->cur.output.x, info->cur.output.y,
-            info->prev.output.x, info->prev.output.y);
-
-    window = (CicoHSFlickInputWindow *)data;
-    if ((info->cur.output.x < 0) || (info->cur.output.y < 0) ||
-        (info->cur.output.x >= 4096) || (info->cur.output.y >= 4096))   {
-        ICO_DBG("TouchMoveFlick: Illegal position(x/y=%d/%d), Skip",
-                info->cur.output.x, info->cur.output.y);
-        return;
-    }
-    if (set_xy_pos == false)    {
-        set_xy_pos = true;
-        touch_state_b_x = info->cur.output.x + window->GetPosX();
-        touch_state_b_y = info->cur.output.y + window->GetPosY();
-    }
-    touch_state_a_x = info->cur.output.x + window->GetPosX();
-    touch_state_a_y = info->cur.output.y + window->GetPosY();
-
-    /* long push    */
-    if((touch_down == false) || (long_act == true)) {
-        ICO_DBG("TouchMoveFlick: not down(%d) or timedout(%d)",
-                (int)touch_down, (int)long_act);
-
-        if(timer != NULL){
-            ecore_timer_del(timer);
-            timer = NULL;
-        }
-
-        /* send ABS_X/Y     */
-        gettimeofday(&ctime, NULL);
-        touch_lasttime = (ctime.tv_sec * 1000 + ctime.tv_usec/1000);
-
-        ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime,
-                           ABS_Z, (touch_state_a_x << 16) | touch_state_a_y);
-        return;
-    }
-
-    if (abs(touch_state_b_y - touch_state_a_y)
-        > ICO_HS_FLICK_TOUCH_FLICK_THREASHOLD_MOVE_Y)  {
-        /* slide to top or buttom over threashold, flick cancel */
-        ICO_DBG("TouchMoveFlick: over Y direction");
-        if(timer != NULL){
-            ecore_timer_del(timer);
-            timer = NULL;
-        }
-        long_act = true;
-
-        /* send ABS_X/Y     */
-        ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 2,
-                           ABS_Z, (touch_state_b_x << 16) | touch_state_b_y);
-        /* send TOUCH Down  */
-        ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 1,
-                               BTN_TOUCH, 1);
-        /* send ABS_X/Y     */
-        gettimeofday(&ctime, NULL);
-        touch_lasttime = (ctime.tv_sec * 1000 + ctime.tv_usec/1000);
-        ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime,
-                           ABS_Z, (touch_state_a_x << 16) | touch_state_a_y);
-    }
-}
index 6b27292..763ea79 100644 (file)
 #include "CicoHSMenuTouch.h"
 
 /*============================================================================*/
+/* static members                                                             */
+/*============================================================================*/
+static int _CicoHSMenuTile_initialized = 0;
+struct _CicoHSMenuTile_glfunc CicoHSMenuTile::glfunc;
+
+static void SetYinvert(Evas_Object *obj);
+
+/*============================================================================*/
 /* functions                                                                  */
 /*============================================================================*/
 /*--------------------------------------------------------------------------*/
  */
 /*--------------------------------------------------------------------------*/
 CicoHSMenuTile::CicoHSMenuTile(const char *appid,
-      const char *icon_image_path,int page,int subpage, int position,int width,int height)
+                               const char *icon_image_path, int page, int subpage,
+                               int position, int width, int height)
 {
-    thumbnail = NULL;
-    if(appid != NULL){
-        strncpy(this->appid,appid,ICO_HS_MAX_PROCESS_NAME);
+    if (_CicoHSMenuTile_initialized == 0)  {
+        // Initialize and setting OpenGL/EGL functions
+        ICO_DBG("CicoHSMenuTile::CicoHSMenuTile: initialize OpenGL/EGL functions");
+        _CicoHSMenuTile_initialized = 1;
+
+        CicoHSMenuTile::glfunc.egl_display
+            = eglGetDisplay((EGLNativeDisplayType)ecore_wl_display_get());
+        if (CicoHSMenuTile::glfunc.egl_display) {
+            CicoHSMenuTile::glfunc.create_image
+                = (PFNEGLCREATEIMAGEKHRPROC)eglGetProcAddress("eglCreateImageKHR");
+            CicoHSMenuTile::glfunc.image_target_texture_2d
+                = (PFNGLEGLIMAGETARGETTEXTURE2DOESPROC)
+                                        eglGetProcAddress("glEGLImageTargetTexture2DOES");
+            CicoHSMenuTile::glfunc.destroy_image
+                = (PFNEGLDESTROYIMAGEKHRPROC)eglGetProcAddress("eglDestroyImageKHR");
+            if ((! CicoHSMenuTile::glfunc.create_image) ||
+                (! CicoHSMenuTile::glfunc.image_target_texture_2d) ||
+                (! CicoHSMenuTile::glfunc.destroy_image))   {
+                ICO_ERR("CicoHSMenuTile::CicoHSMenuTile: can not get EGL functions");
+                _CicoHSMenuTile_initialized = -1;
+            }
+        }
+        else    {
+            _CicoHSMenuTile_initialized = -1;
+            ICO_ERR("CicoHSMenuTile::CicoHSMenuTile: can not initialize OpenGL/EGL");
+        }
+    }
+
+    if (appid != NULL) {
+        strncpy(this->appid, appid, ICO_HS_MAX_PROCESS_NAME);
     }
-    if((icon_image_path != NULL) && (strlen(icon_image_path) != 0) ){
+    if ((icon_image_path != NULL) && (strlen(icon_image_path) != 0)) {
         strncpy(this->icon_image_path,icon_image_path,ICO_HS_MAX_PATH_BUFF_LEN);
-    }else{
-        strncpy(this->icon_image_path,ICO_HS_MENUTILE_DEFAULT_ICON_PATH
-               ,ICO_HS_MAX_PATH_BUFF_LEN);
     }
-    ICO_DBG("CicoHSMEnutTile::CicoHSMenuTile:image_path %s:%s",appid,this->icon_image_path);
+    else {
+        strncpy(this->icon_image_path,ICO_HS_MENUTILE_DEFAULT_ICON_PATH,
+                ICO_HS_MAX_PATH_BUFF_LEN);
+    }
+    ICO_DBG("CicoHSMenuTile::CicoHSMenuTile:image_path %s:%s",appid,this->icon_image_path);
+    thumb.surface = 0;
+    thumb.fbcount = 0;
     this->page = page;
     this->subpage = subpage;
     this->position = position;
@@ -65,7 +104,6 @@ CicoHSMenuTile::CicoHSMenuTile(const char *appid,
 /*--------------------------------------------------------------------------*/
 CicoHSMenuTile::~CicoHSMenuTile(void)
 {
-
 }
 
 /*--------------------------------------------------------------------------*/
@@ -80,28 +118,38 @@ CicoHSMenuTile::~CicoHSMenuTile(void)
 void
 CicoHSMenuTile::CreateObject(Evas *evas)
 {
+    /*initial vaule*/
+    menu_evas = evas;
+    menu_show = false;
+    app_running = false;
+    thumb_tile = NULL;
+    small_icon = NULL;
+    thumb_reduce_x = ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX;
+    thumb_reduce_y = ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX;
+
     /*tile*/
     tile = evas_object_image_filled_add(evas);
-    evas_object_image_file_set(tile,icon_image_path, NULL);
-    evas_object_move(tile,pos_x,pos_y);
+    evas_object_image_file_set(tile, icon_image_path, NULL);
+    evas_object_move(tile, pos_x, pos_y);
     evas_object_resize(tile, width, height);
     evas_object_event_callback_add(tile, EVAS_CALLBACK_MOUSE_DOWN,
-                                       CicoHSMenuTouch::TouchDownMenu,appid);
+                                   CicoHSMenuTouch::TouchDownMenu, appid);
     evas_object_event_callback_add(tile, EVAS_CALLBACK_MOUSE_UP,
-                                       CicoHSMenuTouch::TouchUpMenu,appid);
-    evas_object_show(tile);
+                                   CicoHSMenuTouch::TouchUpMenu, appid);
+
+    icon = tile;
+    evas_object_show(icon);
 
     /*term Icon*/
     term_icon = evas_object_image_filled_add(evas);
-    evas_object_image_file_set(term_icon,ICO_HS_MENUTILE_TERM_ICON_PATH, NULL);
-    evas_object_move(term_icon,pos_x + width - ICO_HS_MENUTILE_TERM_ICON_WIDTH
-                     ,pos_y);
+    evas_object_image_file_set(term_icon, ICO_HS_MENUTILE_TERM_ICON_PATH, NULL);
+    evas_object_move(term_icon, pos_x + width - ICO_HS_MENUTILE_TERM_ICON_WIDTH, pos_y);
     evas_object_resize(term_icon, ICO_HS_MENUTILE_TERM_ICON_WIDTH,
                        ICO_HS_MENUTILE_TERM_ICON_HEIGHT);
     evas_object_event_callback_add(term_icon, EVAS_CALLBACK_MOUSE_UP,
-                                       CicoHSMenuTouch::TouchUpTerm,appid);
-
+                                   CicoHSMenuTouch::TouchUpTerm, appid);
 }
+
 /*--------------------------------------------------------------------------*/
 /**
  * @brief   CicoHSMenuTile::ShowTermIcon
@@ -114,6 +162,7 @@ CicoHSMenuTile::CreateObject(Evas *evas)
 void
 CicoHSMenuTile::ShowTermIcon()
 {
+    evas_object_raise(term_icon);
     evas_object_show(term_icon);
 }
 
@@ -144,19 +193,41 @@ CicoHSMenuTile::HideTermIcon(void)
 void
 CicoHSMenuTile::FreeObject(void)
 {
-    if(tile != NULL){
-       evas_object_del(tile);
+    if (thumb.surface)  {
+        ico_syc_unmap_thumb(thumb.surface);
+        thumb.surface = 0;
+    }
+    if (thumb.image)    {
+        CicoHSMenuTile::glfunc.destroy_image(
+                            CicoHSMenuTile::glfunc.egl_display, thumb.image);
+        thumb.image = NULL;
+    }
+    if (thumb.texture)  {
+        glDeleteTextures(1, &thumb.texture);
+        thumb.texture = 0;
     }
-    if(term_icon != NULL){
-       evas_object_del(term_icon);
+    if (tile != NULL){
+        evas_object_del(tile);
+        tile = NULL;
+    }
+    if (small_icon != NULL){
+        evas_object_del(small_icon);
+        small_icon = NULL;
+    }
+    if (thumb_tile != NULL)  {
+        evas_object_del(thumb_tile);
+        thumb_tile = NULL;
+    }
+    if (term_icon != NULL)  {
+        evas_object_del(term_icon);
+        term_icon = NULL;
     }
-    
 }
 
 /*--------------------------------------------------------------------------*/
 /**
  * @brief   CicoHSMenuTile::Resize
- *          resize tile 
+ *          resize tile(currently unused)
  *
  * @param[in]   width         width
  * @param[in]   height        height
@@ -164,11 +235,10 @@ CicoHSMenuTile::FreeObject(void)
  */
 /*--------------------------------------------------------------------------*/
 void
-CicoHSMenuTile::Resize(int width,int height)
+CicoHSMenuTile::Resize(int width, int height)
 {
-    this->width = width;
-    this->height = height;
-    evas_object_resize(tile, width, height);
+    ICO_DBG("CicoHSMenuTile::Resize (%d,%d)-(%d,%d) Unused",
+            this->width, this->height, width, height);
 }
 
 /*--------------------------------------------------------------------------*/
@@ -181,16 +251,26 @@ CicoHSMenuTile::Resize(int width,int height)
  * @return      none
  */
 /*--------------------------------------------------------------------------*/
-void 
-CicoHSMenuTile::MovePosition(int page,int position)
+void
+CicoHSMenuTile::MovePosition(int page, int position)
 {
     this->page = page;
     this->position= position;
     pos_x = GetPositionX();
     pos_y = GetPositionY();
 
-    evas_object_move(tile,pos_x,pos_y);
-    evas_object_move(term_icon,pos_x + width - ICO_HS_MENUTILE_TERM_ICON_WIDTH,pos_y);
+     evas_object_move(tile, pos_x, pos_y);
+    if (thumb_tile) {
+        evas_object_move(thumb_tile, pos_x + thumb_reduce_x, pos_y + thumb_reduce_y);
+    }
+    if (small_icon) {
+        evas_object_move(small_icon,
+                         pos_x + thumb_reduce_x - ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX2,
+                         pos_y + height - thumb_reduce_y - height
+                             / ICO_HS_MENUTILE_THUMBNAIL_REDUCTION
+                             + ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX2);
+    }
+    evas_object_move(term_icon, pos_x + width - ICO_HS_MENUTILE_TERM_ICON_WIDTH, pos_y);
 }
 
 /*--------------------------------------------------------------------------*/
@@ -203,17 +283,26 @@ CicoHSMenuTile::MovePosition(int page,int position)
  * @return      none
  */
 /*--------------------------------------------------------------------------*/
-void 
-CicoHSMenuTile::OffsetMove(int offset_x,int offset_y)
+void
+CicoHSMenuTile::OffsetMove(int offset_x, int offset_y)
 {
     pos_x = GetPositionX() + offset_x;
     pos_y = GetPositionY() + offset_y;
 
-    evas_object_move(tile,pos_x,pos_y);
-    evas_object_move(term_icon,pos_x + width - ICO_HS_MENUTILE_TERM_ICON_WIDTH,pos_y);
+    evas_object_move(tile, pos_x, pos_y);
+    if (thumb_tile) {
+        evas_object_move(thumb_tile, pos_x + thumb_reduce_x, pos_y + thumb_reduce_y);
+    }
+    if (small_icon) {
+        evas_object_move(small_icon,
+                         pos_x + thumb_reduce_x - ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX2,
+                         pos_y + height - thumb_reduce_y - height
+                             / ICO_HS_MENUTILE_THUMBNAIL_REDUCTION
+                             + ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX2);
+    }
+    evas_object_move(term_icon, pos_x + width - ICO_HS_MENUTILE_TERM_ICON_WIDTH, pos_y);
 }
 
-
 /*--------------------------------------------------------------------------*/
 /**
  * @brief   CicoHSMenuTile::GetImagePath
@@ -253,7 +342,7 @@ CicoHSMenuTile::GetAppId(void)
  * @return      width
  */
 /*--------------------------------------------------------------------------*/
-int 
+int
 CicoHSMenuTile::GetWidth(void)
 {
     return width;
@@ -268,11 +357,12 @@ CicoHSMenuTile::GetWidth(void)
  * @return      height
  */
 /*--------------------------------------------------------------------------*/
-int 
+int
 CicoHSMenuTile::GetHeight(void)
 {
     return height;
 }
+
 /*--------------------------------------------------------------------------*/
 /**
  * @brief   CicoHSMenuTile::GetPosition
@@ -332,25 +422,25 @@ CicoHSMenuTile::GetPositionX(void)
 {
     int ret = 0;
 
-    if((position == ICO_HS_MENUTILE_POSITION_0) ||
-       (position == ICO_HS_MENUTILE_POSITION_3) ||
-       (position == ICO_HS_MENUTILE_POSITION_6) ||
-       (position == ICO_HS_MENUTILE_POSITION_9)){
+    if ((position == ICO_HS_MENUTILE_POSITION_0) ||
+        (position == ICO_HS_MENUTILE_POSITION_3) ||
+        (position == ICO_HS_MENUTILE_POSITION_6) ||
+        (position == ICO_HS_MENUTILE_POSITION_9))   {
         ret = ICO_HS_MENUTILE_START_POS_X;
     }
-    else if((position == ICO_HS_MENUTILE_POSITION_1) ||
-       (position == ICO_HS_MENUTILE_POSITION_4) ||
-       (position == ICO_HS_MENUTILE_POSITION_7) ||
-       (position == ICO_HS_MENUTILE_POSITION_10)){
-        ret = ICO_HS_MENUTILE_START_POS_X + 
-            (ICO_HS_MENUTILE_WIDTH + ICO_HS_MENUTILE_SPACE_TILE_AND_TILE);
+    else if ((position == ICO_HS_MENUTILE_POSITION_1) ||
+             (position == ICO_HS_MENUTILE_POSITION_4) ||
+             (position == ICO_HS_MENUTILE_POSITION_7) ||
+             (position == ICO_HS_MENUTILE_POSITION_10)) {
+        ret = ICO_HS_MENUTILE_START_POS_X +
+              (CicoHSMenuWindow::Tile_Width() + ICO_HS_MENUTILE_SPACE_TILE_AND_TILE);
     }
-    else if((position == ICO_HS_MENUTILE_POSITION_2) ||
-       (position == ICO_HS_MENUTILE_POSITION_5) ||
-       (position == ICO_HS_MENUTILE_POSITION_8) ||
-       (position == ICO_HS_MENUTILE_POSITION_11)){
-        ret = ICO_HS_MENUTILE_START_POS_X + 
-            ((ICO_HS_MENUTILE_WIDTH + ICO_HS_MENUTILE_SPACE_TILE_AND_TILE) * 2);
+    else if ((position == ICO_HS_MENUTILE_POSITION_2) ||
+             (position == ICO_HS_MENUTILE_POSITION_5) ||
+             (position == ICO_HS_MENUTILE_POSITION_8) ||
+             (position == ICO_HS_MENUTILE_POSITION_11)) {
+        ret = ICO_HS_MENUTILE_START_POS_X +
+              ((CicoHSMenuWindow::Tile_Width() + ICO_HS_MENUTILE_SPACE_TILE_AND_TILE) * 2);
     }
     return ret;
 }
@@ -369,36 +459,36 @@ CicoHSMenuTile::GetPositionY(void)
 {
     int ret = 0;
 
-    if((position == ICO_HS_MENUTILE_POSITION_0) ||
-       (position == ICO_HS_MENUTILE_POSITION_1) ||
-       (position == ICO_HS_MENUTILE_POSITION_2)){
+    if ((position == ICO_HS_MENUTILE_POSITION_0) ||
+        (position == ICO_HS_MENUTILE_POSITION_1) ||
+        (position == ICO_HS_MENUTILE_POSITION_2))   {
         ret = ICO_HS_MENUTILE_START_POS_Y;
     }
-    else if((position == ICO_HS_MENUTILE_POSITION_3) ||
-       (position == ICO_HS_MENUTILE_POSITION_4) ||
-       (position == ICO_HS_MENUTILE_POSITION_5)){
-        ret = ICO_HS_MENUTILE_START_POS_Y + 
-              (ICO_HS_MENUTILE_HEIGHT + ICO_HS_MENUTILE_SPACE_TILE_AND_TILE);
+    else if ((position == ICO_HS_MENUTILE_POSITION_3) ||
+             (position == ICO_HS_MENUTILE_POSITION_4) ||
+             (position == ICO_HS_MENUTILE_POSITION_5))  {
+        ret = ICO_HS_MENUTILE_START_POS_Y +
+              (CicoHSMenuWindow::Tile_Height() + ICO_HS_MENUTILE_SPACE_TILE_AND_TILE);
     }
-    else if((position == ICO_HS_MENUTILE_POSITION_6) ||
-       (position == ICO_HS_MENUTILE_POSITION_7) ||
-       (position == ICO_HS_MENUTILE_POSITION_8)){
-        ret = ICO_HS_MENUTILE_START_POS_Y + 
-              ((ICO_HS_MENUTILE_HEIGHT + ICO_HS_MENUTILE_SPACE_TILE_AND_TILE) * 2);
+    else if ((position == ICO_HS_MENUTILE_POSITION_6) ||
+             (position == ICO_HS_MENUTILE_POSITION_7) ||
+             (position == ICO_HS_MENUTILE_POSITION_8))  {
+        ret = ICO_HS_MENUTILE_START_POS_Y +
+              ((CicoHSMenuWindow::Tile_Height() + ICO_HS_MENUTILE_SPACE_TILE_AND_TILE) * 2);
     }
-    else if((position == ICO_HS_MENUTILE_POSITION_9) ||
-       (position == ICO_HS_MENUTILE_POSITION_10) ||
-       (position == ICO_HS_MENUTILE_POSITION_11)){
-        ret = ICO_HS_MENUTILE_START_POS_Y + 
-              ((ICO_HS_MENUTILE_HEIGHT + ICO_HS_MENUTILE_SPACE_TILE_AND_TILE) * 3);
+    else if ((position == ICO_HS_MENUTILE_POSITION_9) ||
+             (position == ICO_HS_MENUTILE_POSITION_10) ||
+             (position == ICO_HS_MENUTILE_POSITION_11)) {
+        ret = ICO_HS_MENUTILE_START_POS_Y +
+              ((CicoHSMenuWindow::Tile_Height() + ICO_HS_MENUTILE_SPACE_TILE_AND_TILE) * 3);
     }
     return ret;
 }
 
 /*--------------------------------------------------------------------------*/
 /**
- * @brief   CicoHSMenuTile::ValidMenuIcon(
- *          tile is icon
+ * @brief   CicoHSMenuTile::ValidMenuIcon
+ *          tile is icon(app terminated)
  *
  * @param[in]   none
  * @return      none
@@ -407,13 +497,24 @@ CicoHSMenuTile::GetPositionY(void)
 void
 CicoHSMenuTile::ValidMenuIcon(void)
 {
-    evas_object_image_file_set(tile,icon_image_path, NULL);
+    if (app_running)    {
+        ICO_DBG("CicoHSMenuTile::ValidMenuIcon: %s show icon", appid);
+        app_running = false;
+        if (icon == thumb_tile) {
+            icon = tile;
+            evas_object_hide(thumb_tile);
+            evas_object_show(tile);
+        }
+        if (small_icon) {
+            evas_object_hide(small_icon);
+        }
+    }
 }
 
 /*--------------------------------------------------------------------------*/
 /**
- * @brief   CicoHSMenuTile::ValidThumbnail(
- *          tile is thumbnail
+ * @brief   CicoHSMenuTile::ValidThumbnail
+ *          tile is thumbnail(app started)
  *
  * @param[in]   surface   surface
  * @return      none
@@ -422,14 +523,61 @@ CicoHSMenuTile::ValidMenuIcon(void)
 void
 CicoHSMenuTile::ValidThumbnail(int surface)
 {
-    if(thumbnail != NULL){
-        ico_syc_unmap_thumb(thumb_surface);
-        thumbnail = NULL;
+    if ((! app_running) || (surface == 0))  {
+        if (thumb.surface != 0) {
+            ico_syc_unmap_thumb(thumb.surface);
+            // delete image and texture
+            if (thumb.image)    {
+                CicoHSMenuTile::glfunc.destroy_image(
+                                    CicoHSMenuTile::glfunc.egl_display, thumb.image);
+                thumb.image = NULL;
+            }
+            if (thumb.texture)  {
+                glDeleteTextures(1, &thumb.texture);
+                thumb.texture = 0;
+            }
+        }
+        thumb.surface = surface;
+        if (surface)    {
+            app_running = true;
+            ico_syc_map_thumb(thumb.surface, menu_show ? ICO_HS_MENUTILE_THUMBNAIL_FPS_SHOW :
+                                                         ICO_HS_MENUTILE_THUMBNAIL_FPS_HIDE);
+            if (! small_icon)   {
+                small_icon = evas_object_image_filled_add(menu_evas);
+                evas_object_image_file_set(small_icon, icon_image_path, NULL);
+                evas_object_move(small_icon,
+                                 pos_x + thumb_reduce_x
+                                     - ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX2,
+                                 pos_y + height - thumb_reduce_y - height
+                                     / ICO_HS_MENUTILE_THUMBNAIL_REDUCTION
+                                     + ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX2);
+                evas_object_resize(small_icon, width / ICO_HS_MENUTILE_THUMBNAIL_REDUCTION,
+                                   height / ICO_HS_MENUTILE_THUMBNAIL_REDUCTION);
+                evas_object_event_callback_add(small_icon, EVAS_CALLBACK_MOUSE_DOWN,
+                                               CicoHSMenuTouch::TouchDownMenu, appid);
+                evas_object_event_callback_add(small_icon, EVAS_CALLBACK_MOUSE_UP,
+                                               CicoHSMenuTouch::TouchUpMenu, appid);
+                evas_object_raise(small_icon);
+                evas_object_raise(term_icon);
+            }
+            evas_object_show(small_icon);
+            ICO_DBG("CicoHSMenuTile::ValidThumbnail: %s show thumbnail %08x",
+                    appid, surface);
+        }
+        else    {
+            app_running = false;
+            if (icon == thumb_tile) {
+                icon = tile;
+                evas_object_hide(thumb_tile);
+                evas_object_show(tile);
+            }
+            if (small_icon) {
+                evas_object_hide(small_icon);
+            }
+            ICO_DBG("CicoHSMenuTile::ValidThumbnail: %s hide thumbnail %08x",
+                    appid, surface);
+        }
     }
-    ico_syc_map_thumb(surface, 5);
-    thumb_surface = surface;
-
-    ICO_DBG("CicoHSMenuTile::ValidThumbnail: prepare thumbnail 0x%d",surface);
 }
 
 /*--------------------------------------------------------------------------*/
@@ -437,20 +585,522 @@ CicoHSMenuTile::ValidThumbnail(int surface)
  * @brief   CicoHSMenuTile::SetThumbnail
  *          tile is thumbnail
  *
- * @param[in]   surface   surface
+ * @param[in]   info      thumbnail information, if NULL reset thumbnail
  * @return      none
  */
 /*--------------------------------------------------------------------------*/
 void
-CicoHSMenuTile::SetThumbnail(int surface)
+CicoHSMenuTile::SetThumbnail(ico_syc_thumb_info_t *info)
+{
+    EGLint              attribs[9];
+    Evas_Object         *old_icon = icon;
+    Evas_Native_Surface nsurf;
+    int                 svx, svy;
+
+    if ((info == NULL) ||
+        (thumb.surface != info->surface)) {
+        ICO_DBG("CicoHSMenuTile::SetThumbnail: unmap thumbnail %x", thumb.surface);
+        if (thumb.surface)  {
+            ico_syc_unmap_thumb(thumb.surface);
+            // delete image and texture
+            if (thumb.image)    {
+                CicoHSMenuTile::glfunc.destroy_image(
+                                CicoHSMenuTile::glfunc.egl_display, thumb.image);
+                thumb.image = NULL;
+            }
+            if (thumb.texture)  {
+                glDeleteTextures(1, &thumb.texture);
+                thumb.texture = 0;
+            }
+        }
+        if (info != NULL)   {
+            thumb.surface = info->surface;
+            ico_syc_map_thumb(thumb.surface,
+                              menu_show ? ICO_HS_MENUTILE_THUMBNAIL_FPS_SHOW :
+                                          ICO_HS_MENUTILE_THUMBNAIL_FPS_HIDE);
+        }
+    }
+    if ((info != NULL) && (info->name != 0) && (info->width > 1) && (info->height > 1)) {
+        thumb.surface = info->surface;
+        thumb.name = info->name;
+        thumb.width = info->width;
+        thumb.height = info->height;
+        thumb.stride = info->stride;
+        thumb.format = info->format;
+        ICO_DBG("CicoHSMenuTile::SetThumbnail: create %s(%08x) "
+                "name=%d w/h/s=%d/%d/%d tile w/h=%d/%d",
+                appid, thumb.surface, thumb.name,
+                thumb.width, thumb.height, thumb.stride, width, height);
+
+        // delete image and texture
+        if (thumb.image)    {
+            CicoHSMenuTile::glfunc.destroy_image(
+                            CicoHSMenuTile::glfunc.egl_display, thumb.image);
+            thumb.image = NULL;
+        }
+        if (thumb.texture)  {
+            glDeleteTextures(1, &thumb.texture);
+            thumb.texture = 0;
+        }
+
+        // create image and texture
+        if (_CicoHSMenuTile_initialized > 0)  {
+            svx = thumb_reduce_x;
+            svy = thumb_reduce_y;
+            if (thumb.width > (thumb.height + 64))  {
+                thumb_reduce_x = ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX;
+                thumb_reduce_y = height / ICO_HS_MENUTILE_THUMBNAIL_REDUCE_RATE;
+            }
+            else if (thumb.width < (thumb.height - 64)) {
+                thumb_reduce_y = ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX;
+                thumb_reduce_x = width / ICO_HS_MENUTILE_THUMBNAIL_REDUCE_RATE;
+            }
+            else    {
+                thumb_reduce_x = ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX;
+                thumb_reduce_y = ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX;
+            }
+            if (! thumb_tile)   {
+                thumb_tile = evas_object_image_filled_add(menu_evas);
+                evas_object_resize(thumb_tile, width - thumb_reduce_x * 2,
+                                               height - thumb_reduce_y * 2);
+                evas_object_move(thumb_tile, pos_x + thumb_reduce_x,
+                                 pos_y + thumb_reduce_y);
+                evas_object_event_callback_add(thumb_tile, EVAS_CALLBACK_MOUSE_DOWN,
+                                               CicoHSMenuTouch::TouchDownMenu, appid);
+                evas_object_event_callback_add(thumb_tile, EVAS_CALLBACK_MOUSE_UP,
+                                               CicoHSMenuTouch::TouchUpMenu, appid);
+                if (small_icon) {
+                    evas_object_move(small_icon,
+                                     pos_x + thumb_reduce_x
+                                         - ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX2,
+                                     pos_y + height - thumb_reduce_y - height
+                                         / ICO_HS_MENUTILE_THUMBNAIL_REDUCTION
+                                         + ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX2);
+                    evas_object_raise(small_icon);
+                }
+                evas_object_raise(term_icon);
+            }
+            else if ((svx != thumb_reduce_x) || (svy != thumb_reduce_y))    {
+                evas_object_resize(thumb_tile, width - thumb_reduce_x * 2,
+                                               height - thumb_reduce_y * 2);
+                evas_object_move(thumb_tile, pos_x + thumb_reduce_x,
+                                 pos_y + thumb_reduce_y);
+                if (small_icon) {
+                    evas_object_move(small_icon,
+                                     pos_x + thumb_reduce_x
+                                         - ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX2,
+                                     pos_y + height - thumb_reduce_y - height
+                                         / ICO_HS_MENUTILE_THUMBNAIL_REDUCTION
+                                         + ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX2);
+                }
+            }
+            attribs[0] = EGL_WIDTH;
+            attribs[1] = thumb.width;
+            attribs[2] = EGL_HEIGHT;
+            attribs[3] = thumb.height;
+            attribs[4] = EGL_DRM_BUFFER_FORMAT_MESA;
+            attribs[5] = EGL_DRM_BUFFER_FORMAT_ARGB32_MESA;     /* support only ARGB    */
+            attribs[6] = EGL_DRM_BUFFER_STRIDE_MESA;
+            attribs[7] = thumb.stride / 4;
+            attribs[8] = EGL_NONE;
+
+            thumb.image = CicoHSMenuTile::glfunc.create_image(
+                              CicoHSMenuTile::glfunc.egl_display, EGL_NO_CONTEXT,
+                              EGL_DRM_BUFFER_MESA, (EGLClientBuffer)thumb.name, attribs);
+            if (thumb.image)    {
+#if 0           /* too many logs    */
+                ICO_DBG("CicoHSMenuTile::SetThumbnail: create image = %08x",
+                        (int)thumb.image);
+#endif
+                /* create texture from image    */
+                thumb.texture = 0;
+                glGenTextures(1, &thumb.texture);
+                glBindTexture(GL_TEXTURE_2D, thumb.texture);
+                glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+                glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+                glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+                glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+                CicoHSMenuTile::glfunc.image_target_texture_2d(GL_TEXTURE_2D, thumb.image);
+#if 0           /* too many logs    */
+                ICO_DBG("CicoHSMenuTile::SetThumbnail: create texture = %08x",
+                        (int)thumb.texture);
+#endif
+                /* draw texture to screen       */
+                memset(&nsurf, 0, sizeof(nsurf));
+                nsurf.version = EVAS_NATIVE_SURFACE_VERSION;
+                nsurf.type = EVAS_NATIVE_SURFACE_OPENGL;
+                nsurf.data.opengl.texture_id = thumb.texture;
+
+                thumb.fbcount ++;
+                if (thumb.fbcount <= 0) thumb.fbcount = 1;
+                nsurf.data.opengl.framebuffer_id = thumb.fbcount;
+
+                nsurf.data.opengl.internal_format = GL_BGRA_EXT;
+                nsurf.data.opengl.format = GL_BGRA_EXT;
+                nsurf.data.opengl.x = 0;
+                nsurf.data.opengl.y = 0;
+                nsurf.data.opengl.w = thumb.width;
+                nsurf.data.opengl.h = thumb.height / 4;
+
+                evas_object_image_native_surface_set(thumb_tile, &nsurf);
+
+                // set Y invert to native OpenGL object (Evas bug fix)
+                SetYinvert(thumb_tile);
+
+                evas_object_image_data_update_add(thumb_tile,
+                                                  0, 0, thumb.width, thumb.height);
+                icon = thumb_tile;
+
+                evas_object_image_size_set(thumb_tile, thumb.width, thumb.height);
+                evas_object_resize(thumb_tile, width - thumb_reduce_x * 2,
+                                               height - thumb_reduce_y * 2);
+                evas_object_move(thumb_tile, pos_x + thumb_reduce_x, pos_y + thumb_reduce_y);
+            }
+            else    {
+                ICO_ERR("CicoHSMenuTile::SetThumbnail: can not create image");
+                icon = tile;
+            }
+        }
+        else    {
+            ICO_DBG("CicoHSMenuTile::SetThumbnail: OpenGL/EGL initialize error");
+            icon = tile;
+        }
+    }
+    else    {
+        ICO_DBG("CicoHSMenuTile::SetThumbnail: no info(%08x) or name(%08x)",
+                (int)info, info ? (int)info->name : 0);
+        icon = tile;
+    }
+    if (icon != old_icon)   {
+        if (old_icon)   {
+            evas_object_hide(old_icon);
+        }
+        evas_object_show(icon);
+        if (small_icon) {
+            if (icon == thumb_tile) {
+                evas_object_show(small_icon);
+                // remake thumbnail for first build image
+                CicoHSMenuTile::SetThumbnail(info);
+            }
+        }
+    }
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   CicoHSMenuTile::ShowMenu
+ *          change menu show/hide for live thumbnail update cycle
+ *
+ * @param[in]   show    surface
+ * @return      nonmenu show(true)/fide(false)
+ */
+/*--------------------------------------------------------------------------*/
+void
+CicoHSMenuTile::ShowMenu(bool show)
 {
-    if(thumb_surface != surface){
-        ICO_DBG("CicoHSMenuTile::SetThumbnail: unmap thumbnail %d", thumb_surface);
-        ico_syc_unmap_thumb(thumb_surface);
-        thumbnail = NULL;
+    menu_show = show;
+    if ((thumb_tile) && (thumb.surface != 0)) {
+        ico_syc_map_thumb(thumb.surface,
+                          menu_show ? ICO_HS_MENUTILE_THUMBNAIL_FPS_SHOW :
+                                      ICO_HS_MENUTILE_THUMBNAIL_FPS_HIDE);
+    }
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   SetYinvert (static function)
+*           set Y invert of OpenGL native object
+ *
+ * @param[in]   obj         target OpenGL native object
+ * @return      none
+ */
+/*--------------------------------------------------------------------------*/
+static void
+SetYinvert(Evas_Object *obj)
+{
+    // inport from evas-1.7.8/src/lib/canvas/evas_object_image.c _Evas_Object_Image
+    struct local_Evas_Object_Image
+    {
+       uint32_t         magic;
+
+       struct {
+          int                  spread;
+          Evas_Coord_Rectangle fill;
+          struct {
+             short         w, h, stride;
+          } image;
+          struct {
+             short         l, r, t, b;
+             unsigned char fill;
+             double        scale;
+          } border;
+
+          Evas_Object   *source;
+          Evas_Map      *defmap;
+          const char    *file;
+          const char    *key;
+          int           frame;
+          Evas_Colorspace cspace;
+
+          unsigned char smooth_scale : 1;
+          unsigned char has_alpha :1;
+          unsigned char opaque :1;
+          unsigned char opaque_valid :1;
+       } cur, prev;
+
+       int              pixels_checked_out;
+       int              load_error;
+       Eina_List        *pixel_updates;
+
+       struct {
+          unsigned char scale_down_by;
+          double        dpi;
+          short         w, h;
+          struct {
+             short      x, y, w, h;
+          } region;
+          Eina_Bool  orientation : 1;
+       } load_opts;
+
+       struct {
+          Evas_Object_Image_Pixels_Get_Cb get_pixels;
+          void                            *get_pixels_data;
+       } func;
+
+       Evas_Video_Surface video;
+       unsigned int video_caps;
+
+       const char       *tmpf;
+       int              tmpf_fd;
+
+       Evas_Image_Scale_Hint   scale_hint;
+       Evas_Image_Content_Hint content_hint;
+
+       void             *engine_data;
+
+       unsigned char    changed : 1;
+       unsigned char    dirty_pixels : 1;
+       unsigned char    filled : 1;
+       unsigned char    proxyrendering : 1;
+       unsigned char    preloading : 1;
+       unsigned char    video_rendering : 1;
+       unsigned char    video_surface : 1;
+       unsigned char    video_visible : 1;
+       unsigned char    created : 1;
+       unsigned char    proxyerror : 1;
+    };
+
+    // inport from evas-1.7.8/src/lib/include/evas_common.h  _RGBA_Image_Loadopts
+    struct local_RGBA_Image_Loadopts
+    {
+       int              scale_down_by; // if > 1 then use this
+       double           dpi; // if > 0.0 use this
+       unsigned int     w, h; // if > 0 use this
+       unsigned int     degree;//if>0 there is some info related with rotation
+       struct {
+          unsigned int  x, y, w, h;
+       } region;
+
+       Eina_Bool        orientation;
+    };
+    // inport from evas-1.7.8/src/modules/engines/gl_common/evas_gl_common.h  _Evas_GL_Image
+    struct local_Evas_GL_Image
+    {
+       void *gc;
+       void *im;
+       void *tex;
+       struct local_RGBA_Image_Loadopts load_opts;
+       int              references;
+       // if im->im == NULL, it's a render-surface so these here are used
+       int              w, h;
+       struct {
+          int           space;
+          void          *data;
+          unsigned char no_free : 1;
+       } cs;
+
+       struct {
+          void          *data;
+          struct {
+             void (*bind)   (void *data, void *image);
+             void (*unbind) (void *data, void *image);
+             void (*free)   (void *data, void *image);
+             void *data;
+          } func;
+          int           yinvert;
+          int           target;
+          int           mipmap;
+          unsigned char loose : 1;
+       } native;
+
+       int scale_hint, content_hint;
+       int csize;
+
+       Eina_List        *filtered;
+
+       unsigned char    dirty : 1;
+       unsigned char    cached : 1;
+       unsigned char    alpha : 1;
+       unsigned char    tex_only : 1;
+    };
+    // inport evas-1.7.8/src/lib/include/evas_private.h  _Evas_Object
+    struct local_Evas_Object
+    {
+       EINA_INLIST;
+
+       uint32_t                 magic;
+
+       const char               *type;
+       void                     *layer;
+
+       struct {
+          Evas_Map              *map;
+          Evas_Object           *clipper;
+          Evas_Object           *mask;
+          Evas_Object           *map_parent;
+          double                scale;
+          Evas_Coord_Rectangle  geometry;
+          Evas_Coord_Rectangle  bounding_box;
+          struct {
+             struct {
+                Evas_Coord      x, y, w, h;
+                unsigned char   r, g, b, a;
+                Eina_Bool       visible : 1;
+                Eina_Bool       dirty : 1;
+             } clip;
+          } cache;
+          short                 layer;
+          struct {
+             unsigned char      r, g, b, a;
+          } color;
+          Eina_Bool             usemap : 1;
+          Eina_Bool             valid_map : 1;
+          Eina_Bool             visible : 1;
+          Eina_Bool             have_clipees : 1;
+          Eina_Bool             anti_alias : 1;
+          Evas_Render_Op        render_op : 4;
+
+          Eina_Bool             valid_bounding_box : 1;
+          Eina_Bool             cached_surface : 1;
+          Eina_Bool             parent_cached_surface : 1;
+       } cur, prev;
+
+       struct {
+          void                  *surface; // surface holding map if needed
+          int                   surface_w, surface_h; // current surface w & h alloc
+       } map;
+
+       Evas_Map                 *cache_map;
+       char                     *name;
+
+       void                     *interceptors;
+
+       struct {
+          Eina_List             *elements;
+       } data;
+
+       Eina_List                *grabs;
+
+       void                     *callbacks;
+
+       struct {
+          Eina_List             *clipees;
+          Eina_List             *changes;
+       } clip;
+
+       void *func;
+
+       void                     *object_data;
+       struct {
+          Evas_Smart            *smart;
+          Evas_Object           *parent;
+       } smart;
+
+       struct {
+          Eina_List             *proxies;
+          void                  *surface;
+          int                   w,h;
+          Eina_Bool             redraw;
+       } proxy;
+
+    #if 0 // filtering disabled
+       Evas_Filter_Info           *filter;
+    #endif
+
+       void                     *size_hints;
+
+       void                     *spans;
+
+       int                      last_mouse_down_counter;
+       int                      last_mouse_up_counter;
+       int                      mouse_grabbed;
+
+       int                      last_event;
+       Evas_Callback_Type       last_event_type;
+
+       struct {
+            int                 in_move, in_resize;
+       } doing;
+
+      /* ptr array + data blob holding all interfaces private data for
+       * this object */
+       void                     **interface_privates;
+
+       unsigned int             ref;
+
+       unsigned char            delete_me;
+
+       unsigned char            recalculate_cycle;
+       Eina_Clist               calc_entry;
+
+       Evas_Object_Pointer_Mode pointer_mode : 2;
+       Eina_Bool                store : 1;
+       Eina_Bool                pass_events : 1;
+       Eina_Bool                freeze_events : 1;
+       Eina_Bool                repeat_events : 1;
+       struct  {
+          Eina_Bool             pass_events : 1;
+          Eina_Bool             pass_events_valid : 1;
+          Eina_Bool             freeze_events : 1;
+          Eina_Bool             freeze_events_valid : 1;
+       } parent_cache;
+       Eina_Bool                restack : 1;
+       Eina_Bool                is_active : 1;
+       Eina_Bool                precise_is_inside : 1;
+       Eina_Bool                is_static_clip : 1;
+
+       Eina_Bool                render_pre : 1;
+       Eina_Bool                rect_del : 1;
+       Eina_Bool                mouse_in : 1;
+       Eina_Bool                pre_render_done : 1;
+       Eina_Bool                intercepted : 1;
+       Eina_Bool                focused : 1;
+       Eina_Bool                in_layer : 1;
+       Eina_Bool                no_propagate : 1;
+       Eina_Bool                changed : 1;
+       Eina_Bool                changed_move : 1;
+       Eina_Bool                changed_color : 1;
+       Eina_Bool                changed_map : 1;
+       Eina_Bool                changed_pchange : 1;
+       Eina_Bool                del_ref : 1;
+
+       Eina_Bool                is_frame : 1;
+       Eina_Bool                child_has_map : 1;
+    };
+
+    struct local_Evas_Object_Image  *image_obj;
+    struct local_Evas_GL_Image      *im;
+
+    image_obj = (struct local_Evas_Object_Image *)
+                (((struct local_Evas_Object *)obj)->object_data);
+
+    im = (struct local_Evas_GL_Image *)image_obj->engine_data;
+
+    // Evas old version check and revise
+    if (((int)im & 0xffff0000) == 0)    {
+        // Evas old version
+        image_obj = (struct local_Evas_Object_Image *)(((int *)image_obj) - 1);
+        im = (struct local_Evas_GL_Image *)image_obj->engine_data;
     }
-  
-    ICO_DBG("CicoHSMenuTile::SetThumbnail: create thumbnail image %d", thumb_surface);
-    // create EFL not support image composit,/ so composit myself.
-    // evas_object_image_data_set(tile,thumbnail->data);
+    im->native.yinvert = 1;
 }
index ecde752..7bb62bf 100644 (file)
 #include <Ecore_Evas.h>
 #include <Edje.h>
 
+#include <EGL/egl.h>
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+#include <EGL/eglext.h>
+
 #include "ico_syc_common.h"
 #include "ico_syc_winctl.h"
 
@@ -47,7 +52,7 @@
 /***+---+---+---+******/
 
 #define ICO_HS_MENUTILE_ROW 3
-#define ICO_HS_MENUTILE_COLUMN 4 
+#define ICO_HS_MENUTILE_COLUMN 4
 #define ICO_HS_MENUTILE_NUM (ICO_HS_MENUTILE_COLUMN * ICO_HS_MENUTILE_ROW)
 #define ICO_HS_MENUTILE_POSITION_0 0
 #define ICO_HS_MENUTILE_POSITION_1 1
 #define ICO_HS_MENUTILE_START_POS_X 80
 #define ICO_HS_MENUTILE_START_POS_Y 210
 
-#define ICO_HS_MENUTILE_WIDTH_DOUBLE (ICO_HS_MENUTILE_WIDTH * 2) + ICO_HS_MENUTILE_SPACE_TILE_AND_TILE
-#define ICO_HS_MENUTILE_HEIGHT_DOUBLE (ICO_HS_MENUTILE_HEIGHT * 2) + ICO_HS_MENUTILE_SPACE_TILE_AND_TILE
-
 #define ICO_HS_MENUTILE_TERM_ICON_PATH "/usr/apps/org.tizen.ico.homescreen/res/images/termIcon.png"
 #define ICO_HS_MENUTILE_DEFAULT_ICON_PATH "/usr/apps/org.tizen.ico.homescreen/res/images/tizen_32.png"
 #define ICO_HS_MENUTILE_TERM_ICON_WIDTH 64
 #define ICO_HS_MENUTILE_TERM_ICON_HEIGHT 64
 
+#define ICO_HS_MENUTILE_THUMBNAIL_FPS_SHOW  10
+#define ICO_HS_MENUTILE_THUMBNAIL_FPS_HIDE   1
+#define ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX    4
+#define ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX2   6
+#define ICO_HS_MENUTILE_THUMBNAIL_REDUCE_RATE  10
+#define ICO_HS_MENUTILE_THUMBNAIL_REDUCTION     4
+
+struct _CicoHSMenuTile_glfunc {
+    EGLDisplay  egl_display;            // EGL display
+    PFNEGLCREATEIMAGEKHRPROC            create_image;               // create image
+    PFNGLEGLIMAGETARGETTEXTURE2DOESPROC image_target_texture_2d;    // set image target
+    PFNEGLDESTROYIMAGEKHRPROC           destroy_image;              // destroy image
+};
+struct _CicoHSMenuTile_thumb {
+    int         surface;                // surface id
+    int         name;                   // EGL buffer name
+    int         width;                  // frame buffer width
+    int         height;                 // frame buff height
+    int         stride;                 // frame buffer stride
+    int         format;                 // frame buffer format(only EGL_TEXTURE_RGBA)
+    int         fbcount;                // frame buffer change counter
+    EGLImageKHR image;                  // frame buffer image
+    GLuint      texture;                // texture id
+};
+
 class CicoHSMenuTile
 {
   public:
@@ -101,11 +128,14 @@ class CicoHSMenuTile
     const char* GetAppId(void);
     void ShowTermIcon(void);
     void HideTermIcon(void);
-    void ValidMenuIcon(void);   
+    void ValidMenuIcon(void);
     void ValidThumbnail(int surface);
-    void SetThumbnail(int surface);
+    void SetThumbnail(ico_syc_thumb_info_t *info);
+    void ShowMenu(bool show);
 
   private:
+    static struct _CicoHSMenuTile_glfunc glfunc;
+
     char appid[ICO_HS_MAX_PROCESS_NAME];
     char icon_image_path[ICO_HS_MAX_PATH_BUFF_LEN];
     int page;
@@ -115,14 +145,20 @@ class CicoHSMenuTile
     int height;
     int pos_x;
     int pos_y;
+    int thumb_reduce_x;
+    int thumb_reduce_y;
+    bool app_running;
+    bool menu_show;
+    Evas        *menu_evas;
     Evas_Object *tile;
+    Evas_Object *thumb_tile;
+    Evas_Object *icon;
+    Evas_Object *small_icon;
     Evas_Object *term_icon;
-    int                   thumb_surface;
-    ico_syc_thumb_info_t *thumbnail;
+    struct _CicoHSMenuTile_thumb thumb;
 
   protected:
     CicoHSMenuTile operator=(const CicoHSMenuTile&);
     CicoHSMenuTile(const CicoHSMenuTile&);
 };
-
 #endif
index e217f72..7cb139f 100644 (file)
@@ -12,6 +12,7 @@
  * @date    Aug-08-2013
  */
 #include "CicoHSMenuTouch.h"
+#include "CicoSound.h"
 
 /*============================================================================*/
 /* static members                                                             */
@@ -174,6 +175,9 @@ CicoHSMenuTouch::TouchUpMenu(void *data, Evas *evas, Evas_Object *obj, void *eve
 
     /*execute application*/
     if(appid != NULL){
+        // play operation sound
+        CicoSound::GetInstance()->PlayOperationSound();
+
         menu_window->ExecuteApp(appid);
     }
 }
@@ -193,19 +197,14 @@ CicoHSMenuTouch::TouchUpMenu(void *data, Evas *evas, Evas_Object *obj, void *eve
 void
 CicoHSMenuTouch::TouchUpTerm(void *data, Evas *evas, Evas_Object *obj, void *event_info)
 {
-    Evas_Event_Mouse_Up *info;
-    int sub = 0;
+    // play opration sound
+    CicoSound::GetInstance()->PlayOperationSound();
 
     char *appid = reinterpret_cast<char*>(data);
 
-    strncpy(terminate_appid,appid,ICO_HS_MAX_PROCESS_NAME);
+    strncpy(terminate_appid, appid, ICO_HS_MAX_PROCESS_NAME);
 
     menu_window->ShowTerminateButton();
-#if 0
-    if(appid != NULL){
-        menu_window->TerminateApp(appid);
-    }
-#endif
 }
 
 /*--------------------------------------------------------------------------*/
@@ -223,6 +222,9 @@ CicoHSMenuTouch::TouchUpTerm(void *data, Evas *evas, Evas_Object *obj, void *eve
 void
 CicoHSMenuTouch::TouchUpTerminateYes(void *data, Evas *evas, Evas_Object *obj, void *event_info)
 {
+    // play opration sound
+    CicoSound::GetInstance()->PlayOperationSound();
+
     menu_window->TerminateApp(terminate_appid);
 }
 /*--------------------------------------------------------------------------*/
@@ -240,5 +242,9 @@ CicoHSMenuTouch::TouchUpTerminateYes(void *data, Evas *evas, Evas_Object *obj, v
 void
 CicoHSMenuTouch::TouchUpTerminateNo(void *data, Evas *evas, Evas_Object *obj, void *event_info)
 {
+    // play opration sound
+    CicoSound::GetInstance()->PlayOperationSound();
+
     menu_window->TerminateApp(NULL);
 }
+// vim: set expandtab ts=4 sw=4:
index ed5c42f..d92714d 100644 (file)
@@ -22,6 +22,8 @@
 /* static members                                                             */
 /*============================================================================*/
 CicoHSMenuWindow *CicoHSMenuWindow::menu_window_instance;
+int  CicoHSMenuWindow::menu_tile_width = 290;
+int  CicoHSMenuWindow::menu_tile_height = 290;
 
 /*============================================================================*/
 /* functions                                                                  */
@@ -46,14 +48,14 @@ CicoHSMenuWindow::CicoHSMenuWindow(void)
     canvas = NULL;
     rectangle = NULL;
 
-    for(int ii = 0;ii < ICO_HS_MENU_MAX_TILE_NUM;ii++){
+    for (int ii = 0;ii < ICO_HS_MENU_MAX_TILE_NUM;ii++) {
         menu_tile[ii] = NULL;
     }
-    for(int ii = 0;ii < ICO_HS_MENU_MAX_MENU_PAGE_NUM;ii++){
+    for (int ii = 0;ii < ICO_HS_MENU_MAX_MENU_PAGE_NUM;ii++) {
         page_pointer[ii] = NULL;
     }
 
-    surface = 0;   
+    surface = 0;
 
     menu_window_instance = this;
 
@@ -94,18 +96,19 @@ CicoHSMenuWindow::SetMenuBack(void)
     char img_path[ICO_HS_MAX_PATH_BUFF_LEN];
     /* set menu back */
     /* image file name*/
-    snprintf(img_path,sizeof(img_path),"%s%s",img_dir_path,ICO_HS_IMAGE_FILE_MENU_BACK_GROUND);
+    snprintf(img_path, sizeof(img_path), "%s%s",
+             img_dir_path, ICO_HS_IMAGE_FILE_MENU_BACK_GROUND);
 
-    /* set object*/ 
+    /* set object*/
     rectangle = evas_object_rectangle_add(evas);
     if (true == CicoHSSystemState::getInstance()->getNightMode()) {
-        evas_object_color_set(rectangle,0,0,0,178); 
+        evas_object_color_set(rectangle,0,0,0,178);
     }
     else {
-        evas_object_color_set(rectangle,120,120,120,178); 
+        evas_object_color_set(rectangle,120,120,120,178);
     }
     evas_object_move(rectangle, 0, 0);
-    evas_object_resize(rectangle, width,height);
+    evas_object_resize(rectangle, width, height);
     evas_object_show(rectangle);
 
     /* set object*/
@@ -122,7 +125,7 @@ CicoHSMenuWindow::SetMenuBack(void)
     evas_object_event_callback_add(canvas, EVAS_CALLBACK_MOUSE_UP,
                                        CicoHSMenuTouch::TouchUpMenu,NULL);
     evas_object_move(canvas, 0, 0);
-    evas_object_resize(canvas, width,height);
+    evas_object_resize(canvas, width, height);
     evas_object_show(canvas);
 
     return ICO_OK;
@@ -155,7 +158,7 @@ CicoHSMenuWindow::FreeMenuBack(void)
  * @return      none
  */
 /*--------------------------------------------------------------------------*/
-void 
+void
 CicoHSMenuWindow::GetLayout(const char *filename,CicoLayoutInfo *layout,int *num)
 {
     int ret;
@@ -166,14 +169,14 @@ CicoHSMenuWindow::GetLayout(const char *filename,CicoLayoutInfo *layout,int *num
         return;
     }
     int idx =0;
-    while( ( ret = fscanf( fp, "%d,%d,%d,%d,%d", 
+    while( ( ret = fscanf( fp, "%d,%d,%d,%d,%d",
         &layout[idx].appidx, &layout[idx].page, &layout[idx].position,
         &layout[idx].tile_width, &layout[idx].tile_height ) ) != EOF ){
         idx++;
     }
     *num = idx;
     fclose(fp);
-   
+
 }
 
 /*--------------------------------------------------------------------------*/
@@ -187,7 +190,7 @@ CicoHSMenuWindow::GetLayout(const char *filename,CicoLayoutInfo *layout,int *num
  * @return      none
  */
 /*--------------------------------------------------------------------------*/
-void 
+void
 CicoHSMenuWindow::GetCategory(const char *filename, int *category, int *num)
 {
     int ret;
@@ -198,13 +201,13 @@ CicoHSMenuWindow::GetCategory(const char *filename, int *category, int *num)
         return;
     }
     int idx =0;
-    while( ( ret = fscanf( fp, "%d", &category[idx] 
+    while( ( ret = fscanf( fp, "%d", &category[idx]
         ) ) != EOF ){
         idx++;
     }
     *num = idx;
     fclose(fp);
-} 
+}
 
 /*--------------------------------------------------------------------------*/
 /**
@@ -222,16 +225,16 @@ CicoHSMenuWindow::SetLayout(const char *filename,CicoLayoutInfo *layout,int num)
 {
     int ret;
     FILE *fp;
-    
+
     fp = fopen(filename,"w+");
-    if(fp == NULL){
+    if (fp == NULL) {
         return;
     }
-    for(int ii = 0;ii < num;ii++){
-       ret = fprintf(fp,"%d,%d,%d,%d,%d\n",
-                layout[ii].appidx,layout[ii].page,layout[ii].position,
-                layout[ii].tile_width,layout[ii].tile_height);
-       if(ret < 0){
+    for (int ii = 0;ii < num;ii++) {
+       ret = fprintf(fp, "%d,%d,%d,%d,%d\n",
+                     layout[ii].appidx,layout[ii].page,layout[ii].position,
+                     layout[ii].tile_width,layout[ii].tile_height);
+       if (ret < 0) {
            break;
        }
     }
@@ -287,18 +290,17 @@ CicoHSMenuWindow::SetAppTiles(void)
     int position = 0;
     int page = 0;
     int subpage = 0;
-    int page_num = 0;
     current_page = 0;
-   
+
     /* get APP information */
-    std::vector<CicoSCAilItems> aillist = 
+    std::vector<CicoSCAilItems> aillist =
         life_cycle_controller->getAilList();
 
     /* get category infomation */
     GetCategory(ICO_HS_MENU_CATEGORY_FILE_PATH, category, &category_num);
     ICO_DBG("CicoHSMenuWindow::SetAppTiles :category_num %d", category_num);
 
-    for (unsigned int ii = 0; ii < category_num ; ii++) {
+    for (int ii = 0; ii < category_num ; ii++) {
        ICO_DBG("CicoHSMenuWindow::SetAppTiles :category[%d] %d", ii, category[ii]);
     }
 
@@ -306,7 +308,7 @@ CicoHSMenuWindow::SetAppTiles(void)
     all_category_num = category_num + 1;
 
     /* page set */
-    for (unsigned int ii = 0; ii < all_category_num ; ii++) {
+    for (int ii = 0; ii < all_category_num ; ii++) {
         if(ii == 0) {
             /* other category */
             category_info[ii].id = ICO_HS_MENU_OTHER_CATEGORY_ID;
@@ -320,16 +322,16 @@ CicoHSMenuWindow::SetAppTiles(void)
     }
 
     /*first time layout*/
-    for(unsigned int ii = 0; ii < aillist.size(); ii++) {
+    for (unsigned int ii = 0; ii < aillist.size(); ii++) {
 
         /*all application num*/
         if((aillist[ii].m_noIcon) ||
-                (strcmp(aillist[ii].m_group.c_str(), 
+                (strcmp(aillist[ii].m_group.c_str(),
                 ICO_HS_GROUP_SPECIAL) == 0)) {
             ICO_DBG("CicoHSMenuWindow::SetAppTiles :ignore app appid = [%s] noIcon = [%d]",
                     aillist[ii].m_appid.c_str(),aillist[ii].m_noIcon);
             continue;
-        }         
+        }
         ICO_DBG("CicoHSMenuWindow::SetAppTiles :SetApp appid = [%s] noIcon =[%d]",
                 aillist[ii].m_appid.c_str(),aillist[ii].m_noIcon);
         ICO_DBG("CicoHSMenuWindow::SetAppTile :aillist[%d].m_categoryID = [%d]",
@@ -352,19 +354,19 @@ CicoHSMenuWindow::SetAppTiles(void)
         }
 
         /* put tile */
-        menu_tile[tile_num] = 
+        menu_tile[tile_num] =
             new CicoHSMenuTile(aillist[ii].m_appid.c_str(),
             aillist[ii].m_icon.c_str(),page, subpage, position,
-            ICO_HS_MENUTILE_WIDTH,ICO_HS_MENUTILE_HEIGHT);
+            CicoHSMenuWindow::Tile_Width(), CicoHSMenuWindow::Tile_Height());
 
         tile_num++;
-
     }
+
     /*menu num*/
-    all_tile_num = tile_num;    
+    all_tile_num = tile_num;
     all_page_num = all_category_num;
 
-    for(unsigned int ii = 0; ii < all_category_num ; ii++){
+    for (int ii = 0; ii < all_category_num ; ii++) {
         ICO_DBG("CicoHSMenuWindow::SetAppTile :category_info[%d].id = [%d]",
                 ii, category_info[ii].id);
         ICO_DBG("CicoHSMenuWindow::SetAppTile :category_info[%d].subpage_max = [%d]",
@@ -374,29 +376,30 @@ CicoHSMenuWindow::SetAppTiles(void)
         ICO_DBG("CicoHSMenuWindow::SetAppTile :category_info[%d].tile_num = [%d]",
                 ii , category_info[ii].tile_num);
     }
-   
+
     /*in case of over max num*/
-    if(all_page_num > ICO_HS_MENU_MAX_MENU_PAGE_NUM){
+    if (all_page_num > ICO_HS_MENU_MAX_MENU_PAGE_NUM) {
        all_page_num = ICO_HS_MENU_MAX_MENU_PAGE_NUM;
     }
+
     /*make tiles*/
     for (int ii = 0; ii < tile_num; ii++) {
-        if(menu_tile[ii] == NULL){
+        if (menu_tile[ii] == NULL) {
             continue;
         }
         menu_tile[ii]->CreateObject(evas);
-        if(menu_tile[ii]->GetPage() != 0){
+        if (menu_tile[ii]->GetPage() != 0) {
             /*out of window*/
             menu_tile[ii]->OffsetMove(width,0);
         }
-        if(menu_tile[ii]->GetSubPage() != 0){
+        if (menu_tile[ii]->GetSubPage() != 0) {
             /*out of window*/
             menu_tile[ii]->OffsetMove(height,0);
         }
     }
     return ICO_OK;
 }
+
 /*--------------------------------------------------------------------------*/
 /**
  * @brief   CicoHSMenuWindow::FreeAppTiles
@@ -409,8 +412,8 @@ CicoHSMenuWindow::SetAppTiles(void)
 void
 CicoHSMenuWindow::FreeAppTiles(void)
 {
-    for(int ii = 0; ii < all_tile_num;ii++){
-        if(menu_tile[ii] == NULL){
+    for (int ii = 0; ii < all_tile_num; ii++) {
+        if (menu_tile[ii] == NULL) {
             continue;
         }
         menu_tile[ii]->FreeObject();
@@ -421,7 +424,7 @@ CicoHSMenuWindow::FreeAppTiles(void)
 /*--------------------------------------------------------------------------*/
 /**
  * @brief   CicoHSMenuWindow::RenewAppTiles
- *          renewal of a menu 
+ *          renewal of a menu
  *
  * @param   none
  * @return  none
@@ -432,8 +435,8 @@ CicoHSMenuWindow::RenewAppTiles(void)
 {
     ICO_DBG("CicoHSMenuWindow::RenewAppTiles Enter");
 
-    int ret; 
-   
+    int ret;
+
     /* free app tiles */
     FreeAppTiles();
 
@@ -486,19 +489,19 @@ CicoHSMenuWindow::SetPagePointer(void)
             evas_object_del(page_pointer[ii]);
             return ICO_ERROR;
         }
-        evas_object_event_callback_add(page_pointer[ii], 
+        evas_object_event_callback_add(page_pointer[ii],
                                        EVAS_CALLBACK_MOUSE_DOWN,
                                        CicoHSMenuTouch::TouchDownMenu,NULL);
         evas_object_event_callback_add(page_pointer[ii],
                                        EVAS_CALLBACK_MOUSE_UP,
                                        CicoHSMenuTouch::TouchUpMenu,NULL);
 
-        int pos_x = ICO_HS_MENU_PAGE_POINTER_START_POS_X + 
-                    (((width - ICO_HS_MENU_PAGE_POINTER_START_POS_X * 2) / 
-                    all_page_num ) * ii) +       
-                    (((width - ICO_HS_MENU_PAGE_POINTER_START_POS_X * 2) / 
-                    all_page_num ) / 2)  -      
-                    (ICO_HS_MENU_PAGE_POINTER_WIDTH / 2);        
+        int pos_x = ICO_HS_MENU_PAGE_POINTER_START_POS_X +
+                    (((width - ICO_HS_MENU_PAGE_POINTER_START_POS_X * 2) /
+                    all_page_num ) * ii) +
+                    (((width - ICO_HS_MENU_PAGE_POINTER_START_POS_X * 2) /
+                    all_page_num ) / 2)  -
+                    (ICO_HS_MENU_PAGE_POINTER_WIDTH / 2);
         evas_object_move(page_pointer[ii], pos_x,
                          ICO_HS_MENU_PAGE_POINTER_START_POS_Y);
         evas_object_resize(page_pointer[ii],
@@ -506,9 +509,9 @@ CicoHSMenuWindow::SetPagePointer(void)
                          ICO_HS_MENU_PAGE_POINTER_HEIGHT);
         evas_object_show(page_pointer[ii]);
     }
-     
     return ICO_OK;
 }
+
 /*--------------------------------------------------------------------------*/
 /**
  * @brief   CicoHSMenuWindow::FreePagePointer
@@ -543,11 +546,11 @@ CicoHSMenuWindow::SetTerminateButton(void)
     /* set menu back */
     /* image file name*/
 
-    /* set object*/ 
+    /* set object*/
     terminate_back = evas_object_rectangle_add(evas);
-    evas_object_color_set(terminate_back,0,0,0,178); 
+    evas_object_color_set(terminate_back,0,0,0,178);
     evas_object_move(terminate_back, 0, 0);
-    evas_object_resize(terminate_back, width,height);
+    evas_object_resize(terminate_back, width, height);
     evas_object_layer_set(terminate_back, ICO_HS_MENU_TERMINATE_BUTTON_LAYER);
     /* set object*/
     snprintf(img_path,sizeof(img_path),"%s%s",
@@ -602,7 +605,7 @@ CicoHSMenuWindow::SetTerminateButton(void)
                                           height / 2 - 100);
     evas_object_resize(terminate_really,200,64);
     evas_object_layer_set(terminate_really, ICO_HS_MENU_TERMINATE_BUTTON_LAYER);
-    
+
     return ICO_OK;
 }
 
@@ -627,7 +630,7 @@ CicoHSMenuWindow::FreeTerminateButton(void)
 /*--------------------------------------------------------------------------*/
 /**
  * @brief   CicoHSMenuWindow::ShowTerminateButton
- *          show terminate button 
+ *          show terminate button
  *
  * @param[in]   none
  * @return      ERROR or OK
@@ -645,7 +648,7 @@ CicoHSMenuWindow::ShowTerminateButton(void)
 /*--------------------------------------------------------------------------*/
 /**
  * @brief   CicoHSMenuWindow::HideTerminateButton
- *          show terminate button 
+ *          show terminate button
  *
  * @param[in]   none
  * @return      none
@@ -715,7 +718,7 @@ CicoHSMenuWindow::SetPageCursor(void)
                      ICO_HS_MENU_PAGE_DOWN_CURSOR_HEIGHT);
 
     DspCtrlPageCursor();
-     
+
     return ICO_OK;
 }
 
@@ -747,19 +750,45 @@ CicoHSMenuWindow::FreePageCursor(void)
  * @return      none
  */
 /*--------------------------------------------------------------------------*/
-int 
-CicoHSMenuWindow::CreateMenuWindow(int pos_x,int pos_y,int width,int height)
+int
+CicoHSMenuWindow::CreateMenuWindow(int pos_x, int pos_y, int width, int height)
 {
     int ret;
-    
+
     /*create window*/
     ret = CreateWindow(ICO_HS_MENU_WINDOW_TITLE,
-                       pos_x,pos_y,width,height,EINA_TRUE);
+                       pos_x, pos_y, width, height, EINA_TRUE);
     if(ret != ICO_OK){
        return ret;
     }
-  
-    /*get evas*/     
+
+    /* set tile size    */
+    CicoHSMenuWindow::menu_tile_width = (width - (ICO_HS_MENUTILE_START_POS_X * 2)
+                                         - (ICO_HS_MENUTILE_SPACE_TILE_AND_TILE
+                                             * (ICO_HS_MENUTILE_ROW-1)))
+                                        / ICO_HS_MENUTILE_ROW;
+    if (CicoHSMenuWindow::menu_tile_width < 150)    {
+        CicoHSMenuWindow::menu_tile_width = 150;
+    }
+    CicoHSMenuWindow::menu_tile_height = (height - (ICO_HS_STATUSBAR_WINDOW_HEIGHT
+                                                    + ICO_HS_CONTROLBAR_WINDOW_HEIGHT
+                                                    + ICO_HS_MENUTILE_HEIGHT + 8)
+                                          - (ICO_HS_MENUTILE_SPACE_TILE_AND_TILE
+                                             * (ICO_HS_MENUTILE_COLUMN-1)))
+                                         / ICO_HS_MENUTILE_COLUMN;
+    if (CicoHSMenuWindow::menu_tile_height < 150)   {
+        CicoHSMenuWindow::menu_tile_height = 150;
+    }
+    ICO_DBG("CicoHSMenuWindow::CreateMenuWindow: tile size(w/h)=%d/%d",
+            CicoHSMenuWindow::menu_tile_width, CicoHSMenuWindow::menu_tile_height);
+    if (CicoHSMenuWindow::menu_tile_width > CicoHSMenuWindow::menu_tile_height) {
+        CicoHSMenuWindow::menu_tile_width = CicoHSMenuWindow::menu_tile_height;
+    }
+    else    {
+        CicoHSMenuWindow::menu_tile_height = CicoHSMenuWindow::menu_tile_width;
+    }
+
+    /*get evas*/
     evas = ecore_evas_get(window);
     if (!evas) {
         ICO_ERR("CicoHSMenuWindow::CreateMenuWindow: could not get evas.");
@@ -815,7 +844,7 @@ CicoHSMenuWindow::CreateMenuWindow(int pos_x,int pos_y,int width,int height)
         return ICO_ERROR;
     }
 
-    /* Initialize Action*/ 
+    /* Initialize Action*/
     CicoHSMenuTouch::Initialize(this);
 
     return ICO_OK;
@@ -846,7 +875,7 @@ CicoHSMenuWindow::FreeMenuWindow(void)
  * @brief   CicoHSMenuWindow::MoveToNextAnimation
  *          animation parts (move to next)
  *
- * @param[in]   data    
+ * @param[in]   data
  * @param[in]   pos
  * @return      EINA_TRUE
  */
@@ -857,33 +886,31 @@ CicoHSMenuWindow::MoveToNextAnimation(void *data,double pos)
     int current_page;
     double frame = ecore_animator_pos_map(pos, ECORE_POS_MAP_LINEAR, 0.5, 1);
     current_page = reinterpret_cast<int>(data);
-    
-    for(int ii = 0;ii < menu_window_instance->all_tile_num;ii++){
-        if(menu_window_instance->menu_tile[ii] == NULL){
+
+    for (int ii = 0;ii < menu_window_instance->all_tile_num;ii++) {
+        if (menu_window_instance->menu_tile[ii] == NULL) {
             continue;
         }
-        if((menu_window_instance->menu_tile[ii]->GetPage() != current_page -1) || 
-           (menu_window_instance->menu_tile[ii]->GetSubPage() != 0)) {
+        if ((menu_window_instance->menu_tile[ii]->GetPage() != current_page -1) ||
+            (menu_window_instance->menu_tile[ii]->GetSubPage() != 0)) {
             continue;
         }
-
-        menu_window_instance->menu_tile[ii]->OffsetMove(-1 * 
+        menu_window_instance->menu_tile[ii]->OffsetMove(-1 *
                               (menu_window_instance->width * frame),0);
-    } 
+    }
 
-    for(int ii = 0;ii < menu_window_instance->all_tile_num;ii++){
-        if(menu_window_instance->menu_tile[ii] == NULL){
+    for (int ii = 0;ii < menu_window_instance->all_tile_num;ii++) {
+        if (menu_window_instance->menu_tile[ii] == NULL) {
             continue;
         }
-        if((menu_window_instance->menu_tile[ii]->GetPage() != current_page) ||
-          (menu_window_instance->menu_tile[ii]->GetSubPage() != 0)){
+        if ((menu_window_instance->menu_tile[ii]->GetPage() != current_page) ||
+            (menu_window_instance->menu_tile[ii]->GetSubPage() != 0)) {
             continue;
         }
-
-        menu_window_instance->menu_tile[ii]->OffsetMove(menu_window_instance->width -
-                                   (menu_window_instance->width * frame),0);
+        menu_window_instance->menu_tile[ii]->
+            OffsetMove(menu_window_instance->width
+                       - (menu_window_instance->width * frame),0);
     }
-    
     return EINA_TRUE;
 }
 
@@ -892,7 +919,7 @@ CicoHSMenuWindow::MoveToNextAnimation(void *data,double pos)
  * @brief   CicoHSMenuWindow::MoveToBackAnimation
  *          animation parts (move to back)
  *
- * @param[in]   data    
+ * @param[in]   data
  * @param[in]   pos
  * @return      EINA_TRUE
  */
@@ -900,36 +927,33 @@ CicoHSMenuWindow::MoveToNextAnimation(void *data,double pos)
 Eina_Bool
 CicoHSMenuWindow::MoveToBackAnimation(void *data,double pos)
 {
-
     int current_page;
     double frame = ecore_animator_pos_map(pos, ECORE_POS_MAP_LINEAR, 0.5, 1);
     current_page = reinterpret_cast<int>(data);
 
-    for(int ii = 0;ii < menu_window_instance->all_tile_num;ii++){
-        if(menu_window_instance->menu_tile[ii] == NULL){
+    for (int ii = 0;ii < menu_window_instance->all_tile_num;ii++) {
+        if (menu_window_instance->menu_tile[ii] == NULL) {
             continue;
         }
-        if((menu_window_instance->menu_tile[ii]->GetPage() != current_page) ||
-          (menu_window_instance->menu_tile[ii]->GetSubPage() != 0)){
+        if ((menu_window_instance->menu_tile[ii]->GetPage() != current_page) ||
+            (menu_window_instance->menu_tile[ii]->GetSubPage() != 0)) {
             continue;
         }
-
-        menu_window_instance->menu_tile[ii]->OffsetMove(-1 * 
-                                 menu_window_instance->width + 
+        menu_window_instance->menu_tile[ii]->OffsetMove(-1 *
+                                 menu_window_instance->width +
                                  (menu_window_instance->width * frame),0);
     }
-    for(int ii = 0;ii < menu_window_instance->all_tile_num;ii++){
-        if(menu_window_instance->menu_tile[ii] == NULL){
+    for (int ii = 0;ii < menu_window_instance->all_tile_num;ii++) {
+        if (menu_window_instance->menu_tile[ii] == NULL) {
             continue;
         }
-        if((menu_window_instance->menu_tile[ii]->GetPage()  != current_page + 1) ||
-          (menu_window_instance->menu_tile[ii]->GetSubPage()  != 0)){
+        if ((menu_window_instance->menu_tile[ii]->GetPage() != current_page + 1) ||
+            (menu_window_instance->menu_tile[ii]->GetSubPage() != 0)) {
             continue;
         }
-
-        menu_window_instance->menu_tile[ii]->OffsetMove(menu_window_instance->width * frame,0);
+        menu_window_instance->menu_tile[ii]->
+            OffsetMove(menu_window_instance->width * frame,0);
     }
-
     return EINA_TRUE;
 }
 
@@ -938,7 +962,7 @@ CicoHSMenuWindow::MoveToBackAnimation(void *data,double pos)
  * @brief   CicoHSMenuWindow::MoveToNextSubAnimation
  *          animation parts (move to next)
  *
- * @param[in]   data    
+ * @param[in]   data
  * @param[in]   pos
  * @return      EINA_TRUE
  */
@@ -949,38 +973,37 @@ CicoHSMenuWindow::MoveToNextSubAnimation(void *data,double pos)
     CicoCurrentPage *current_info;
     double frame = ecore_animator_pos_map(pos, ECORE_POS_MAP_LINEAR, 0.5, 1);
     current_info = (CicoCurrentPage *)(data);
-    
-    for(int ii = 0;ii < menu_window_instance->all_tile_num;ii++){
-        if(menu_window_instance->menu_tile[ii] == NULL){
+
+    for (int ii = 0;ii < menu_window_instance->all_tile_num;ii++) {
+        if (menu_window_instance->menu_tile[ii] == NULL) {
             continue;
         }
-        if(menu_window_instance->menu_tile[ii]->GetSubPage() != current_info->subcurrent_page -1){
+        if (menu_window_instance->menu_tile[ii]->GetSubPage()
+            != current_info->subcurrent_page -1) {
             continue;
         }
-        if(menu_window_instance->menu_tile[ii]->GetPage() != current_info->current_page){
+        if (menu_window_instance->menu_tile[ii]->GetPage() != current_info->current_page) {
             continue;
         }
+        menu_window_instance->menu_tile[ii]->
+            OffsetMove(0, -1 * (menu_window_instance->height * frame));
+    }
 
-        menu_window_instance->menu_tile[ii]->OffsetMove(0, -1 * 
-                              (menu_window_instance->height * frame));
-    } 
-
-    for(int ii = 0;ii < menu_window_instance->all_tile_num;ii++){
-        if(menu_window_instance->menu_tile[ii] == NULL){
+    for (int ii = 0;ii < menu_window_instance->all_tile_num;ii++) {
+        if (menu_window_instance->menu_tile[ii] == NULL) {
             continue;
         }
-        if(menu_window_instance->menu_tile[ii]->GetSubPage() != current_info->subcurrent_page){
+        if (menu_window_instance->menu_tile[ii]->GetSubPage()
+            != current_info->subcurrent_page) {
             continue;
         }
 
-        if(menu_window_instance->menu_tile[ii]->GetPage() != current_info->current_page){
+        if (menu_window_instance->menu_tile[ii]->GetPage() != current_info->current_page) {
             continue;
         }
-
         menu_window_instance->menu_tile[ii]->OffsetMove(0, menu_window_instance->height -
                                    (menu_window_instance->height * frame));
     }
-    
     return EINA_TRUE;
 }
 
@@ -989,7 +1012,7 @@ CicoHSMenuWindow::MoveToNextSubAnimation(void *data,double pos)
  * @brief   CicoHSMenuWindow::MoveToBackAnimation
  *          animation parts (move to back)
  *
- * @param[in]   data    
+ * @param[in]   data
  * @param[in]   pos
  * @return      EINA_TRUE
  */
@@ -1002,35 +1025,35 @@ CicoHSMenuWindow::MoveToBackSubAnimation(void *data,double pos)
     double frame = ecore_animator_pos_map(pos, ECORE_POS_MAP_LINEAR, 0.5, 1);
     current_info = (CicoCurrentPage *)(data);
 
-    for(int ii = 0;ii < menu_window_instance->all_tile_num;ii++){
-        if(menu_window_instance->menu_tile[ii] == NULL){
+    for (int ii = 0;ii < menu_window_instance->all_tile_num;ii++) {
+        if (menu_window_instance->menu_tile[ii] == NULL) {
             continue;
         }
-        if(menu_window_instance->menu_tile[ii]->GetSubPage() != current_info->subcurrent_page){
+        if (menu_window_instance->menu_tile[ii]->GetSubPage()
+            != current_info->subcurrent_page) {
             continue;
         }
-        if(menu_window_instance->menu_tile[ii]->GetPage() != current_info->current_page){
+        if (menu_window_instance->menu_tile[ii]->GetPage() != current_info->current_page) {
             continue;
         }
-
-        menu_window_instance->menu_tile[ii]->OffsetMove(0, -1 * 
-                                 menu_window_instance->height + 
-                                 (menu_window_instance->height * frame));
+        menu_window_instance->menu_tile[ii]->
+            OffsetMove(0, -1 * menu_window_instance->height +
+                       (menu_window_instance->height * frame));
     }
-    for(int ii = 0;ii < menu_window_instance->all_tile_num;ii++){
-        if(menu_window_instance->menu_tile[ii] == NULL){
+    for (int ii = 0;ii < menu_window_instance->all_tile_num;ii++) {
+        if (menu_window_instance->menu_tile[ii] == NULL) {
             continue;
         }
-        if(menu_window_instance->menu_tile[ii]->GetSubPage() != current_info->subcurrent_page + 1){
+        if (menu_window_instance->menu_tile[ii]->GetSubPage()
+            != current_info->subcurrent_page + 1) {
             continue;
         }
-        if(menu_window_instance->menu_tile[ii]->GetPage() != current_info->current_page){
+        if (menu_window_instance->menu_tile[ii]->GetPage() != current_info->current_page) {
             continue;
         }
-
-        menu_window_instance->menu_tile[ii]->OffsetMove(0, menu_window_instance->height * frame);
+        menu_window_instance->menu_tile[ii]->
+            OffsetMove(0, menu_window_instance->height * frame);
     }
-
     return EINA_TRUE;
 }
 
@@ -1048,12 +1071,13 @@ CicoHSMenuWindow::GoNextMenu(void)
 {
     char img_path[ICO_HS_MAX_PATH_BUFF_LEN];
 
-    if((current_page >= all_page_num -1) || (subcurrent_page > 0)){
+    if ((current_page >= all_page_num -1) || (subcurrent_page > 0)) {
         return;
     }
 
     /*page pointer*/
-    snprintf(img_path,sizeof(img_path),"%s%s",img_dir_path,ICO_HS_IMAGE_FILE_MENU_PAGEPOINTER_N);
+    snprintf(img_path, sizeof(img_path), "%s%s",
+             img_dir_path, ICO_HS_IMAGE_FILE_MENU_PAGEPOINTER_N);
     evas_object_image_file_set(page_pointer[current_page], img_path, NULL);
 
     /* increment*/
@@ -1063,14 +1087,14 @@ CicoHSMenuWindow::GoNextMenu(void)
     DspCtrlPageCursor();
 
     /*page pointer*/
-    snprintf(img_path,sizeof(img_path),"%s%s",img_dir_path,ICO_HS_IMAGE_FILE_MENU_PAGEPOINTER_P);
+    snprintf(img_path, sizeof(img_path), "%s%s",
+             img_dir_path, ICO_HS_IMAGE_FILE_MENU_PAGEPOINTER_P);
     evas_object_image_file_set(page_pointer[current_page], img_path, NULL);
 
-    /*tile*/    
+    /*tile*/
     ecore_animator_frametime_set(1.0f / 30);
     ecore_animator_timeline_add(0.4, MoveToNextAnimation,
                                 reinterpret_cast<void*>(current_page));
-
 }
 
 /*--------------------------------------------------------------------------*/
@@ -1096,7 +1120,7 @@ CicoHSMenuWindow::GoBackMenu(void)
     evas_object_image_file_set(page_pointer[current_page], img_path, NULL);
 
     /*decrement*/
-    --current_page; 
+    --current_page;
 
     /* display cursor */
     DspCtrlPageCursor();
@@ -1105,7 +1129,7 @@ CicoHSMenuWindow::GoBackMenu(void)
     snprintf(img_path,sizeof(img_path),"%s%s",img_dir_path,ICO_HS_IMAGE_FILE_MENU_PAGEPOINTER_P);
     evas_object_image_file_set(page_pointer[current_page], img_path, NULL);
 
-    /*tile*/    
+    /*tile*/
     ecore_animator_frametime_set(1.0f / 30);
     ecore_animator_timeline_add(0.4, MoveToBackAnimation,
                                 reinterpret_cast<void*>(current_page));
@@ -1142,7 +1166,7 @@ CicoHSMenuWindow::DownNextMenu(void)
     current_info.current_page = current_page;
     current_info.subcurrent_page = subcurrent_page;
 
-    /*tile*/    
+    /*tile*/
     ecore_animator_frametime_set(1.0f / 30);
     ecore_animator_timeline_add(0.4, MoveToNextSubAnimation,
                                 (void*)(&current_info));
@@ -1199,7 +1223,7 @@ CicoHSMenuWindow::DspCtrlPageCursor(void)
             break;
         }
     }
-    
+
     if (subcurrent_page > 0) {
         evas_object_show(page_up_cursor);
     }
@@ -1230,7 +1254,7 @@ CicoHSMenuWindow::SetCategoryInfo(int id)
     for (int i = 0; i < all_category_num ; i++) {
         if (category_info[i].id == id) {
             /* sub page max */
-            category_info[i].subpage_max = 
+            category_info[i].subpage_max =
                 category_info[i].tile_num / ICO_HS_MENUTILE_NUM;
 
             /* tile num */
@@ -1263,8 +1287,8 @@ CicoHSMenuWindow::GetTileInfo(int id, int *page, int *subpage, int *position)
 
             /* page */
             *page = category_info[i].page;
-            /* sub page */      
-            *subpage = (category_info[i].tile_num -1) / ICO_HS_MENUTILE_NUM; 
+            /* sub page */
+            *subpage = (category_info[i].tile_num -1) / ICO_HS_MENUTILE_NUM;
             /* pasition */
             *position = (category_info[i].tile_num -1) % ICO_HS_MENUTILE_NUM;
         }
@@ -1313,7 +1337,14 @@ CicoHSMenuWindow::Show(ico_syc_animation_t *animation)
         life_cycle_controller->ailRenewFlagOff();
     }
 
-    ico_syc_show(appid,surface,animation);
+    // Show menu tiles
+    for (int ii = 0; ii < all_tile_num; ii++) {
+        if (menu_tile[ii])  {
+            menu_tile[ii]->ShowMenu(true);
+        }
+    }
+
+    ico_syc_show(appid, surface, animation);
 
     ICO_DBG("CicoHSMenuWindow::Show Leave");
 }
@@ -1329,13 +1360,25 @@ CicoHSMenuWindow::Show(ico_syc_animation_t *animation)
 /*--------------------------------------------------------------------------*/
 void
 CicoHSMenuWindow::Hide(ico_syc_animation_t *animation)
-{ 
+{
+    ICO_DBG("CicoHSMenuWindow::Hide Enter");
+
     if(terminate_mode == true){
         ChangeNormalMode();
     }
     m_showState = false;
     ico_syc_hide(appid,surface,animation);
+
+    // Hide menu tiles
+    for (int ii = 0; ii < all_tile_num; ii++) {
+        if (menu_tile[ii])  {
+            menu_tile[ii]->ShowMenu(false);
+        }
+    }
+
+    ICO_DBG("CicoHSMenuWindow::Hide Leave");
 }
+
 /*--------------------------------------------------------------------------*/
 /**
  * @brief   CicoHSMenuWindow::ExecuteApp
@@ -1367,7 +1410,7 @@ void
 CicoHSMenuWindow::TerminateApp(const char *appid)
 {
     CicoHomeScreen::TerminateApp(appid);
-    
+
     HideTerminateButton();
     ChangeNormalMode();
 }
@@ -1436,22 +1479,23 @@ CicoHSMenuWindow::ChangeNormalMode(void)
 /*--------------------------------------------------------------------------*/
 /**
  * @brief   CicoHSMenuWindow::ValidMenuIcon
- *          tile is icon 
+ *          tile is icon
  *
  * @param[in]   appid    application ID
  * @return      none
  */
 /*--------------------------------------------------------------------------*/
-void 
+void
 CicoHSMenuWindow::ValidMenuIcon(const char *appid)
 {
-    for(int ii = 0; ii < all_tile_num; ii++) {
-        if(strncmp(menu_tile[ii]->GetAppId(),appid,ICO_HS_MAX_PROCESS_NAME)==0){
+ICO_DBG("CicoHSMenuWindow::ValidMenuIcon(%s)", appid ? appid : "(NULL)" );
+    for (int ii = 0; ii < all_tile_num; ii++) {
+        if (strncmp(menu_tile[ii]->GetAppId(), appid, ICO_HS_MAX_PROCESS_NAME) == 0) {
             menu_tile[ii]->ValidMenuIcon();
             break;
         }
     }
-}   
+}
 
 /*--------------------------------------------------------------------------*/
 /**
@@ -1459,15 +1503,15 @@ CicoHSMenuWindow::ValidMenuIcon(const char *appid)
  *          tile is thumbnail
  *
  * @param[in]   appid    application ID
- * @param[in]   surface  surface 
+ * @param[in]   surface  surface
  * @return      none
  */
 /*--------------------------------------------------------------------------*/
-void 
-CicoHSMenuWindow::ValidThumbnail(const char *appid,int surface)
+void
+CicoHSMenuWindow::ValidThumbnail(const char *appid, int surface)
 {
-    for(int ii = 0; ii < all_tile_num; ii++) {
-        if(strncmp(menu_tile[ii]->GetAppId(),appid,ICO_HS_MAX_PROCESS_NAME)==0){
+    for (int ii = 0; ii < all_tile_num; ii++) {
+        if (strncmp(menu_tile[ii]->GetAppId(), appid, ICO_HS_MAX_PROCESS_NAME) == 0) {
             menu_tile[ii]->ValidThumbnail(surface);
             break;
         }
@@ -1480,16 +1524,16 @@ CicoHSMenuWindow::ValidThumbnail(const char *appid,int surface)
  *          tile is thumbnail
  *
  * @param[in]   appid    application ID
- * @param[in]   surface  surface 
+ * @param[in]   info     thumbnail information
  * @return      none
  */
 /*--------------------------------------------------------------------------*/
-void 
-CicoHSMenuWindow::SetThumbnail(const char *appid,int surface)
+void
+CicoHSMenuWindow::SetThumbnail(const char *appid, ico_syc_thumb_info_t *info)
 {
-    for(int ii = 0; ii < all_tile_num; ii++) {
-        if(strncmp(menu_tile[ii]->GetAppId(),appid,ICO_HS_MAX_PROCESS_NAME)==0){
-            menu_tile[ii]->SetThumbnail(surface);
+    for (int ii = 0; ii < all_tile_num; ii++) {
+        if (strncmp(menu_tile[ii]->GetAppId(), appid, ICO_HS_MAX_PROCESS_NAME) == 0) {
+            menu_tile[ii]->SetThumbnail(info);
             break;
         }
     }
@@ -1509,11 +1553,40 @@ CicoHSMenuWindow::SetNightMode(void)
 {
     ICO_DBG("CicoHSMenuWindow::SetNightMode Enter");
     if (true == CicoHSSystemState::getInstance()->getNightMode()) {
-        evas_object_color_set(rectangle,0,0,0,178); 
+        evas_object_color_set(rectangle,0,0,0,178);
     }
     else {
-        evas_object_color_set(rectangle,120,120,120,178); 
+        evas_object_color_set(rectangle,120,120,120,178);
     }
     ICO_DBG("CicoHSMenuWindow::SetNightMode Leave");
 }
 
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   CicoHSMenuWindow::Tile_Width
+ *          menu tile width
+ *
+ * @param   none
+ * @return  tile width
+ */
+/*--------------------------------------------------------------------------*/
+int
+CicoHSMenuWindow::Tile_Width(void)
+{
+    return CicoHSMenuWindow::menu_tile_width;
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   CicoHSMenuWindow::Tile_Height
+ *          menu tile height
+ *
+ * @param   none
+ * @return  tile height
+ */
+/*--------------------------------------------------------------------------*/
+int
+CicoHSMenuWindow::Tile_Height(void)
+{
+    return CicoHSMenuWindow::menu_tile_height;
+}
index e013d49..46782d2 100644 (file)
@@ -72,19 +72,21 @@ typedef struct _CicoLayoutInfo{
    int position;
    int tile_width;
    int tile_height;
-}CicoLayoutInfo;
+} CicoLayoutInfo;
 
 typedef struct _CicoCurrentPage{
     int current_page;
     int subcurrent_page;
-}CicoCurrentPage;
+} CicoCurrentPage;
 
 typedef struct _CicoCategoryInfo {
     int id;
     int page;
     int subpage_max;
     int tile_num;
-}CicoCategoryInfo;
+} CicoCategoryInfo;
+
+/*  tile size   */
 
 class CicoHSMenuWindow :public CicoHSWindow
 {
@@ -109,13 +111,13 @@ class CicoHSMenuWindow :public CicoHSWindow
     void ChangeNormalMode(void);
     void ShowTerminateButton(void);
     void HideTerminateButton(void);
-    void ValidMenuIcon(const char *appid);   
-    void ValidThumbnail(const char *appid,int surface);   
-    void SetThumbnail(const char *appid,int surface);   
+    void ValidMenuIcon(const char *appid);
+    void ValidThumbnail(const char *appid, int surface);
+    void SetThumbnail(const char *appid, ico_syc_thumb_info_t *info);
 
     static Eina_Bool MoveDownAnimation(void *data,double pos);
     static Eina_Bool MoveUpAnimation(void *data,double pos);
-    
+
     void SetNightMode(void);
 
     void DspCtrlPageCursor(void);
@@ -124,6 +126,9 @@ class CicoHSMenuWindow :public CicoHSWindow
     static Eina_Bool MoveToNextSubAnimation(void *data,double pos);
     static Eina_Bool MoveToBackSubAnimation(void *data,double pos);
 
+    static int Tile_Width(void);
+    static int Tile_Height(void);
+
   private:
     int SetMenuBack(void);
     void FreeMenuBack(void);
@@ -155,30 +160,33 @@ class CicoHSMenuWindow :public CicoHSWindow
     /* image directory path */
     char img_dir_path[ICO_HS_MAX_PATH_BUFF_LEN];
     /* evas object */
-    Evas *evas;         
+    Evas *evas;
     /* menu back */
-    Evas_Object *canvas; 
-    Evas_Object *rectangle; 
+    Evas_Object *canvas;
+    Evas_Object *rectangle;
     /* tiles */
     CicoHSMenuTile *menu_tile[ICO_HS_MENU_MAX_TILE_NUM];
     /* Page pointer */
-    Evas_Object *page_pointer[ICO_HS_MENU_MAX_MENU_PAGE_NUM]; 
+    Evas_Object *page_pointer[ICO_HS_MENU_MAX_MENU_PAGE_NUM];
     /* Page cursor */
-    Evas_Object *page_up_cursor; 
-    Evas_Object *page_down_cursor; 
+    Evas_Object *page_up_cursor;
+    Evas_Object *page_down_cursor;
     /* for window control */
     char appid[ICO_HS_MAX_PROCESS_NAME];
     int surface;
     /*terminate button*/
-    Evas_Object *terminate_back; 
-    Evas_Object *terminate_really; 
-    Evas_Object *terminate_button_yes; 
-    Evas_Object *terminate_button_no; 
-   
+    Evas_Object *terminate_back;
+    Evas_Object *terminate_really;
+    Evas_Object *terminate_button_yes;
+    Evas_Object *terminate_button_no;
+
     CicoSCLifeCycleController *life_cycle_controller;
     /* my instance (for callback) */
     static CicoHSMenuWindow *menu_window_instance;
     bool m_showState;
+    /* tile size    */
+    static int  menu_tile_width;
+    static int  menu_tile_height;
 
   protected:
     CicoHSMenuWindow operator=(const CicoHSMenuWindow&);
similarity index 68%
rename from src/homescreen/CicoHSFlickInputWindow.cpp
rename to src/homescreen/CicoHSSwipeInputWindow.cpp
index 9f6177e..f1aa167 100644 (file)
@@ -7,12 +7,12 @@
  *
  */
 /**
- * @brief   flick input window
+ * @brief   swipe input window
  *
  * @date    Sep-20-2013
  */
-#include "CicoHSFlickInputWindow.h"
-#include "CicoHSFlickTouch.h"
+#include "CicoHSSwipeInputWindow.h"
+#include "CicoHSSwipeTouch.h"
 #include "CicoHomeScreen.h"
 #include "CicoHSSystemState.h"
 
 /*============================================================================*/
 /*--------------------------------------------------------------------------*/
 /**
- * @brief   CicoHSFlickInputWindow::CicoHSFlickInputWindow
+ * @brief   CicoHSSwipeInputWindow::CicoHSSwipeInputWindow
  *          Constractor
  *
  * @param[in]   none
  * @return      none
  */
 /*--------------------------------------------------------------------------*/
-CicoHSFlickInputWindow::CicoHSFlickInputWindow(void)
+CicoHSSwipeInputWindow::CicoHSSwipeInputWindow(void)
 {
-    ICO_DBG("CicoHSFlickInputWindow::CicoHSFlickInputWindow: constractor");
+    ICO_DBG("CicoHSSwipeInputWindow::CicoHSSwipeInputWindow: constractor");
     evas = NULL;
     background = NULL;
     setuped = false;
@@ -38,61 +38,61 @@ CicoHSFlickInputWindow::CicoHSFlickInputWindow(void)
 
 /*--------------------------------------------------------------------------*/
 /**
- * @brief   CicoHSFlickInputWindow::~CicoHSFlickInputWindow
+ * @brief   CicoHSSwipeInputWindow::~CicoHSSwipeInputWindow
  *          Destractor
  *
  * @param[in]   none
  * @return      none
  */
 /*--------------------------------------------------------------------------*/
-CicoHSFlickInputWindow::~CicoHSFlickInputWindow(void)
+CicoHSSwipeInputWindow::~CicoHSSwipeInputWindow(void)
 {
-    ICO_DBG("CicoHSFlickInputWindow::CicoHSFlickInputWindow: destractor");
+    ICO_DBG("CicoHSSwipeInputWindow::CicoHSSwipeInputWindow: destractor");
     /* not somthing to do */
 }
 
 /*--------------------------------------------------------------------------*/
 /**
- * @brief   CicoHSFlickInputWindow::CreateFlickInputWindow
- *          crate window (flick input window)
+ * @brief   CicoHSSwipeInputWindow::CreateSwipeInputWindow
+ *          crate window (swipe input window)
  *
  * @param[in]   pos_x    position x
  * @param[in]   pos_y    position y
  * @param[in]   width    width
  * @param[in]   height   height
- * @param[in]   subname  flick input window sub name
+ * @param[in]   subname  swipe input window sub name
  * @return      OK or ERRROR
  */
 /*--------------------------------------------------------------------------*/
 int
-CicoHSFlickInputWindow::CreateFlickInputWindow(int pos_x, int pos_y,
+CicoHSSwipeInputWindow::CreateSwipeInputWindow(int pos_x, int pos_y,
                                                int width, int height, const char *subname)
 {
     int ret;
 
-    ICO_DBG("CreateFlickInputWindow: start(%s,x/y=%d/%d,w/h=%d/%d)",
+    ICO_DBG("CreateSwipeInputWindow: start(%s,x/y=%d/%d,w/h=%d/%d)",
             subname ? subname : "(null)", pos_x, pos_y, width, height);
 
     /*create window*/
     if (subname)    {
         snprintf(winname, sizeof(winname), "%s_%s",
-                 ICO_HS_FLICK_INPUT_WINDOW_TITLE, subname);
+                 ICO_HS_SWIPE_INPUT_WINDOW_TITLE, subname);
     }
     else    {
-        strncpy(winname, ICO_HS_FLICK_INPUT_WINDOW_TITLE, ICO_SYC_MAX_WINNAME_LEN);
+        strncpy(winname, ICO_HS_SWIPE_INPUT_WINDOW_TITLE, ICO_SYC_MAX_WINNAME_LEN);
     }
     winname[ICO_SYC_MAX_WINNAME_LEN-1] = 0;
-    ICO_DBG("CreateFlickInputWindow: winname=%s", winname);
+    ICO_DBG("CreateSwipeInputWindow: winname=%s", winname);
     ret = CreateWindow(winname, pos_x, pos_y, width, height, EINA_TRUE);
     if(ret != ICO_OK){
-        ICO_CRI("CicoHSFlickInputWindow::CreateFlickInputWindow: can not create window");
+        ICO_CRI("CicoHSSwipeInputWindow::CreateSwipeInputWindow: can not create window");
         return ret;
     }
 
     /* get evas */
     evas = ecore_evas_get(window);
     if (!evas) {
-        ICO_CRI("CicoHSFlickInputWindow::CreateFlickInputWindow: could not get evas.");
+        ICO_CRI("CicoHSSwipeInputWindow::CreateSwipeInputWindow: could not get evas.");
         return ICO_ERROR;
     }
 
@@ -101,32 +101,32 @@ CicoHSFlickInputWindow::CreateFlickInputWindow(int pos_x, int pos_y,
 
     /* set mouse/touch callback */
     evas_object_event_callback_add(background, EVAS_CALLBACK_MOUSE_DOWN,
-                                       CicoHSFlickTouch::TouchDownFlick, this);
+                                       CicoHSSwipeTouch::TouchDownSwipe, this);
     evas_object_event_callback_add(background, EVAS_CALLBACK_MOUSE_UP,
-                                       CicoHSFlickTouch::TouchUpFlick, this);
+                                       CicoHSSwipeTouch::TouchUpSwipe, this);
     evas_object_event_callback_add(background, EVAS_CALLBACK_MOUSE_MOVE,
-                                       CicoHSFlickTouch::TouchMoveFlick, this);
+                                       CicoHSSwipeTouch::TouchMoveSwipe, this);
 
     /* move and show window     */
     evas_object_move(background, 0, 0);
     evas_object_resize(background, width, height);
     evas_object_show(background);
 
-    ICO_DBG("CreateFlickInputWindow: end");
+    ICO_DBG("CreateSwipeInputWindow: end");
     return ICO_OK;
 }
 
 /*--------------------------------------------------------------------------*/
 /**
- * @brief   CicoHSFlickInputWindow::FreeFlickInputWindow
- *          free window (flick input window)
+ * @brief   CicoHSSwipeInputWindow::FreeSwipeInputWindow
+ *          free window (swipe input window)
  *
  * @param[in]   none
  * @return      none
  */
 /*--------------------------------------------------------------------------*/
 void
-CicoHSFlickInputWindow::FreeFlickInputWindow(void)
+CicoHSSwipeInputWindow::FreeSwipeInputWindow(void)
 {
     evas_object_del(background);
     FreeWindow();
@@ -134,21 +134,21 @@ CicoHSFlickInputWindow::FreeFlickInputWindow(void)
 
 /*--------------------------------------------------------------------------*/
 /**
- * @brief   CicoHSFlickInputWindow::SetupFlickWindow
- *          initiale setup flick input window
+ * @brief   CicoHSSwipeInputWindow::SetupSwipeWindow
+ *          initiale setup swipe input window
  *
  * @param       none
  * @return      none
  */
 /*--------------------------------------------------------------------------*/
 void
-CicoHSFlickInputWindow::SetupFlickWindow(void)
+CicoHSSwipeInputWindow::SetupSwipeWindow(void)
 {
     ico_syc_win_move_t move;
     ico_syc_animation_t show;
 
     if (! setuped)  {
-        ICO_DBG("SetupFlickWindow: start");
+        ICO_DBG("SetupSwipeWindow: start");
         setuped = true;
         move.zone = NULL;
         move.pos_x = pos_x;
@@ -158,23 +158,23 @@ CicoHSFlickInputWindow::SetupFlickWindow(void)
         memset(&show, 0, sizeof(show));
         show.time = ICO_SYC_WIN_SURF_RAISE;
 
-        /* move flick input window to TouchLayer    */
-        ico_syc_change_layer(appid, surface, HS_LAYER_TOUCH);
+        /* move swipe input window to TouchLayer    */
+        ico_syc_change_layer(appid, surface, HS_LAYER_TOUCHPANEL);
         /* move window position and size            */
         ico_syc_move(appid, surface, &move, NULL);
         /* show and raise window                    */
         ico_syc_show(appid, surface, &show);
 
         /* show touch layer                         */
-        ico_syc_show_layer(HS_LAYER_TOUCH);
+        ico_syc_show_layer(HS_LAYER_TOUCHPANEL);
 
-        ICO_DBG("SetupFlickWindow: end");
+        ICO_DBG("SetupSwipeWindow: end");
     }
 }
 
 /*--------------------------------------------------------------------------*/
 /**
- * @brief   CicoHSFlickInputWindow::Show
+ * @brief   CicoHSSwipeInputWindow::Show
  *          show my window
  *
  * @param       none
@@ -182,14 +182,15 @@ CicoHSFlickInputWindow::SetupFlickWindow(void)
  */
 /*--------------------------------------------------------------------------*/
 void
-CicoHSFlickInputWindow::Show(void)
+CicoHSSwipeInputWindow::Show(void)
 {
+    ICO_DBG("CicoHSSwipeInputWindow::Show: %08x.%s", surface, this->winname);
     ico_syc_show(appid, surface, NULL);
 }
 
 /*--------------------------------------------------------------------------*/
 /**
- * @brief   CicoHSFlickInputWindow::Hide
+ * @brief   CicoHSSwipeInputWindow::Hide
  *          hide my window
  *
  * @param       none
@@ -197,14 +198,15 @@ CicoHSFlickInputWindow::Show(void)
  */
 /*--------------------------------------------------------------------------*/
 void
-CicoHSFlickInputWindow::Hide(void)
+CicoHSSwipeInputWindow::Hide(void)
 {
+    ICO_DBG("CicoHSSwipeInputWindow::Hide: %08x.%s", surface, this->winname);
     ico_syc_hide(appid, surface, NULL);
 }
 
 /*--------------------------------------------------------------------------*/
 /**
- * @brief   CicoHSFlickInputWindow::isMyWindowName
+ * @brief   CicoHSSwipeInputWindow::isMyWindowName
  *          check window name
  *
  * @param[in]   winname     target window name
@@ -214,7 +216,7 @@ CicoHSFlickInputWindow::Hide(void)
  */
 /*--------------------------------------------------------------------------*/
 bool
-CicoHSFlickInputWindow::isMyWindowName(const char *winname)
+CicoHSSwipeInputWindow::isMyWindowName(const char *winname)
 {
     bool    ret;
 
@@ -224,32 +226,32 @@ CicoHSFlickInputWindow::isMyWindowName(const char *winname)
 }
 
 int
-CicoHSFlickInputWindow::GetPosX(void)
+CicoHSSwipeInputWindow::GetPosX(void)
 {
     return pos_x;
 }
 
 int
-CicoHSFlickInputWindow::GetPosY(void)
+CicoHSSwipeInputWindow::GetPosY(void)
 {
     return pos_y;
 }
 
 int
-CicoHSFlickInputWindow::GetWidth(void)
+CicoHSSwipeInputWindow::GetWidth(void)
 {
     return width;
 }
 
 int
-CicoHSFlickInputWindow::GetHeight(void)
+CicoHSSwipeInputWindow::GetHeight(void)
 {
     return height;
 }
 
 /*--------------------------------------------------------------------------*/
 /**
- * @brief   CicoHSFlickInputWindow::SetWindowID
+ * @brief   CicoHSSwipeInputWindow::SetWindowID
  *          set appid and surface
  *
  * @param[in]   none
@@ -257,7 +259,7 @@ CicoHSFlickInputWindow::GetHeight(void)
  */
 /*--------------------------------------------------------------------------*/
 void
-CicoHSFlickInputWindow::SetWindowID(const char *appid, int surface)
+CicoHSSwipeInputWindow::SetWindowID(const char *appid, int surface)
 {
     ICO_DBG("SetWindowID: appid=%s surface=%08x", appid, surface);
     strncpy(this->appid, appid, ICO_HS_MAX_PROCESS_NAME);
similarity index 71%
rename from src/homescreen/CicoHSFlickInputWindow.h
rename to src/homescreen/CicoHSSwipeInputWindow.h
index f5c7b9c..b8012dd 100644 (file)
@@ -7,12 +7,12 @@
  *
  */
 /**
- * @brief   flick input window
+ * @brief   swipe input window
  *
  * @date    Sep-20-2013
  */
-#ifndef __CICO_HS_FLICKINPUT_WINDOW_H__
-#define __CICO_HS_FLICKINPUT_WINDOW_H__
+#ifndef __CICO_HS_SWIPEINPUT_WINDOW_H__
+#define __CICO_HS_SWIPEINPUT_WINDOW_H__
 #include <stdio.h>
 #include <pthread.h>
 #include <libwebsockets.h>
 #include "CicoHomeScreenConfig.h"
 #include "CicoHSWindow.h"
 
-class CicoHSFlickInputWindow :public CicoHSWindow
+class CicoHSSwipeInputWindow :public CicoHSWindow
 {
   public:
-    CicoHSFlickInputWindow(void);
-    ~CicoHSFlickInputWindow(void);
-    int CreateFlickInputWindow(int pos_x, int pos_y,
+    CicoHSSwipeInputWindow(void);
+    ~CicoHSSwipeInputWindow(void);
+    int CreateSwipeInputWindow(int pos_x, int pos_y,
                                int width, int height, const char *subname = NULL);
-    void FreeFlickInputWindow(void);
-    void SetupFlickWindow(void);
+    void FreeSwipeInputWindow(void);
+    void SetupSwipeWindow(void);
     void Show(void);
     void Hide(void);
     bool isMyWindowName(const char *winname);
@@ -60,8 +60,8 @@ class CicoHSFlickInputWindow :public CicoHSWindow
     Evas_Object *background;            /* background object    */
 
   protected:
-    CicoHSFlickInputWindow operator=(const CicoHSFlickInputWindow&);
-    CicoHSFlickInputWindow(const CicoHSFlickInputWindow&);
+    CicoHSSwipeInputWindow operator=(const CicoHSSwipeInputWindow&);
+    CicoHSSwipeInputWindow(const CicoHSSwipeInputWindow&);
 };
-#endif  /*__CICO_HS_FLICKINPUT_WINDOW_H__*/
+#endif  /*__CICO_HS_SWIPEINPUT_WINDOW_H__*/
 // vim: set expandtab ts=4 sw=4:
diff --git a/src/homescreen/CicoHSSwipeTouch.cpp b/src/homescreen/CicoHSSwipeTouch.cpp
new file mode 100644 (file)
index 0000000..e829a7a
--- /dev/null
@@ -0,0 +1,605 @@
+/*
+ * 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   touch action of menu
+ *
+ * @date    Sep^2--2013
+ */
+#include "CicoHSSwipeTouch.h"
+#include "CicoHSAppInfo.h"
+#include "CicoHomeScreen.h"
+#include "CicoHSSystemState.h"
+#include "ico_syc_inputctl.h"
+#include <linux/input.h>
+
+/*============================================================================*/
+/* static members                                                             */
+/*============================================================================*/
+CicoHSControlBarWindow* CicoHSSwipeTouch::ctl_bar_window;
+CicoHSAppHistoryExt*    CicoHSSwipeTouch::app_history;
+int CicoHSSwipeTouch::full_width;
+int CicoHSSwipeTouch::full_height;
+int CicoHSSwipeTouch::touch_state_b_x;
+int CicoHSSwipeTouch::touch_state_b_y;
+int CicoHSSwipeTouch::touch_state_a_x;
+int CicoHSSwipeTouch::touch_state_a_y;
+int CicoHSSwipeTouch::touch_lasttime;
+
+Ecore_Timer *CicoHSSwipeTouch::timer;
+bool CicoHSSwipeTouch::touch_down;
+bool CicoHSSwipeTouch::long_act;
+bool CicoHSSwipeTouch::set_xy_pos;
+
+int CicoHSSwipeTouch::num_windows;
+CicoHSSwipeInputWindow* CicoHSSwipeTouch::swipe_windows[ICO_HS_MAX_SWIPEWINDOWS];
+
+/*============================================================================*/
+/* functions                                                                  */
+/*============================================================================*/
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   CicoHSSwipeTouch::Initialize
+ *          Initialize
+ *
+ * @param[in]   ctl_bar     instance of control bar window
+ * @param[in]   apphist     instance of application history control
+ * @param[in]   width       screen full width
+ * @param[in]   height      screen full height
+ * @return      none
+ */
+/*--------------------------------------------------------------------------*/
+void
+CicoHSSwipeTouch::Initialize(CicoHSControlBarWindow* ctl_bar, CicoHSAppHistoryExt* apphist,
+                             int width, int height)
+{
+    timer = NULL;
+    num_windows = 0;
+    touch_down = false;
+    long_act = false;
+    set_xy_pos = false;
+
+    ctl_bar_window = ctl_bar;
+    app_history = apphist;
+    full_width = width;
+    full_height = height;
+    touch_lasttime = 0;
+    ICO_DBG("Initialize: ctlbar=%08x apphist=%08x width=%d height=%d",
+            (int)ctl_bar, (int)apphist, width, height);
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   CicoHSSwipeTouch::Finalize
+ *          Finalize
+ *
+ * @param[in]   none
+ * @return      none
+ */
+/*--------------------------------------------------------------------------*/
+void
+CicoHSSwipeTouch::Finalize(void)
+{
+  /*nothing to do*/
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   CicoHSSwipeTouch::TouchSwipe
+ *          touch down action at swipe input window
+ *
+ * @param[in]   data    CicoHSSwipeInputWindow object
+ * @param[in]   evas    evas
+ * @param[in]   obj     object
+ * @param[in]   event_info    event information
+ * @return      none
+ */
+/*--------------------------------------------------------------------------*/
+void
+CicoHSSwipeTouch::TouchDownSwipe(void *data, Evas *evas, Evas_Object *obj, void *event_info)
+{
+    Evas_Event_Mouse_Down   *info;
+    CicoHSSwipeInputWindow  *window;
+    struct timeval ctime;
+    int     x, y;
+
+    touch_down = true;
+    gettimeofday(&ctime, NULL);
+    touch_lasttime = (ctime.tv_sec * 1000 + ctime.tv_usec/1000);
+    info = reinterpret_cast<Evas_Event_Mouse_Down*>(event_info);
+    window = (CicoHSSwipeInputWindow *)data;
+
+    x = info->output.x + window->GetPosX();
+    y = info->output.y + window->GetPosY();
+    ICO_DBG("TouchDownSwipe: x/y=%d/%d->%d/%d", info->output.x, info->output.y, x, y);
+
+    if ((x >= 0) && (x < 4096) && (y >= 0) && (y < 4096))   {
+        if (set_xy_pos == false)    {
+            set_xy_pos = true;
+            touch_state_b_x = x;
+            touch_state_b_y = y;
+        }
+        touch_state_a_x = x;
+        touch_state_a_y = y;
+    }
+
+    long_act = false;
+    timer = ecore_timer_add(ICO_HS_SWIPE_TOUCH_LONG_PUSH_THREASHOLD_TIME_SECONDS,
+                            LongPushed, NULL);
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   LongPushed::Touch timeout
+ *          touch down timeout called from ecore
+ *
+ * @param[in]   data    user data(unused)
+ * @return      fixed EINA_TRUE
+ */
+/*--------------------------------------------------------------------------*/
+Eina_Bool
+CicoHSSwipeTouch::LongPushed(void *data)
+{
+    ICO_DBG("LongPushed: timedout");
+
+    long_act = true;
+    timer = NULL;
+
+    if (set_xy_pos == false)    {
+        ICO_DBG("LongPushed: unknown coordinate, Skip");
+
+        /* release my grab  */
+        if (touch_down) {
+            ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime,
+                               BTN_TOUCH, 9);
+            touch_down = false;
+        }
+        long_act = false;
+        return ECORE_CALLBACK_CANCEL;
+    }
+    ICO_DBG("LongPushed: Not Swipe, send Touch Down event to application");
+
+    /* send touch down event to lower application   */
+    /* send ABS_X/Y     */
+    ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 2,
+                       ABS_Z, (touch_state_b_x << 16) | touch_state_b_y);
+    /* send TOUCH Down  */
+    ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 1,
+                       BTN_TOUCH, touch_down ? 8 : 1);
+    touch_down = false;
+    /* send ABS_X/Y     */
+    ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime,
+                       ABS_Z, ((touch_state_a_x) << 16) | (touch_state_a_y));
+    set_xy_pos = false;
+
+    return ECORE_CALLBACK_CANCEL;
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   CicoHSSwipeTouch::TouchUpSwipe
+ *          touch up action at swipe input window
+ *
+ * @param[in]   data    CicoHSSwipeInputWindow object
+ * @param[in]   evas    evas
+ * @param[in]   obj     object
+ * @param[in]   event_info    event information
+ * @return      none
+ */
+/*--------------------------------------------------------------------------*/
+void
+CicoHSSwipeTouch::TouchUpSwipe(void *data, Evas *evas, Evas_Object *obj, void *event_info)
+{
+    Evas_Event_Mouse_Up     *info;
+    CicoHSSwipeInputWindow  *window;
+    CicoHSAppInfo           *appinfo;
+    ico_hs_window_info      *wininfo;
+    ico_syc_animation_t     animation;
+    struct timeval ctime;
+    int sub;
+    int idx;
+    int swipe = 0;
+    std::string histapp;
+    std::string curapp;
+    int x, y;
+
+    info = reinterpret_cast<Evas_Event_Mouse_Up*>(event_info);
+    window = (CicoHSSwipeInputWindow *)data;
+    x = info->output.x + window->GetPosX();
+    y = info->output.y + window->GetPosY();
+    if ((x >= 0) && (x < 4096) && (y >= 0) && (y < 4096))   {
+        touch_state_a_x = x;
+        touch_state_a_y = y;
+    }
+
+    ICO_DBG("TouchUpSwipe: x/y=%d/%d->%d/%d (before %d/%d)",
+            info->output.x, info->output.y,
+            touch_state_a_x, touch_state_a_y, touch_state_b_x, touch_state_b_y);
+
+    if(timer != NULL){
+        ecore_timer_del(timer);
+        timer = NULL;
+    }
+
+    gettimeofday(&ctime, NULL);
+    touch_lasttime = (ctime.tv_sec * 1000 + ctime.tv_usec/1000);
+
+    if (set_xy_pos == false)    {
+        ICO_DBG("TouchUpSwipe: unknown coordinate, Skip");
+
+        /* send touch release event */
+        /* send ABS_X/Y     */
+        ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 2,
+                           ABS_Z, (touch_state_a_x << 16) | touch_state_a_y);
+        /* send TOUCH Up    */
+        if ((touch_down == false) && (long_act == true))    {
+            /* Probably it is an internal event of Ecore    */
+            ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 1,
+                               BTN_TOUCH, 7);
+        }
+        else    {
+            ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 1,
+                               BTN_TOUCH, 0);
+        }
+        touch_down = false;
+        long_act = false;
+        return;
+    }
+    set_xy_pos = false;
+
+    /* long push    */
+    if((touch_down == false) || (long_act == true)) {
+        ICO_DBG("TouchUpSwipe: not down(%d) or timedout(%d)", touch_down, long_act);
+        touch_down = false;
+        set_xy_pos = false;
+
+        /* send touch release event */
+        /* send ABS_X/Y     */
+        ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 2,
+                           ABS_Z, (touch_state_a_x << 16) | touch_state_a_y);
+        /* send TOUCH Up    */
+        ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 1,
+                           BTN_TOUCH, 0);
+        return;
+    }
+    sub = touch_state_a_x - touch_state_b_x;
+
+    /* check slide left to right or right to left   */
+    if (sub > ICO_HS_SWIPE_TOUCH_SWIPE_THREASHOLD_DISTANCE) {
+        if (touch_state_b_x < ICO_HS_SWIPE_TOUCH_SWIPE_THREASHOLD_DISTANCE) {
+            /* get current application  */
+            curapp = app_history->getSwipeCurrentAppid();
+
+            if (CicoHSSystemState::getInstance()->getRegulation() == true)  {
+                ICO_DBG("TouchUpSwipe: Swipe left side to right, but Regulation=ON");
+                appinfo = CicoHomeScreen::GetAppInfo(curapp.c_str());
+                if (appinfo)    {
+                    ico_syc_change_active(appinfo->GetAppId(), appinfo->GetLastSurface());
+                }
+            }
+            else    {
+                /* swipe at left side to right = back before application*/
+                ICO_DBG("TouchUpSwipe: Swipe left side to right");
+
+                /* get before application   */
+                histapp = app_history->prevSwipe();
+                ICO_DBG("TouchUpSwipe: Swipe left to right(cur/prev=%s/%s)",
+                        curapp.c_str(), histapp.c_str());
+                if (histapp.empty())    {
+                    ICO_DBG("TouchUpSwipe: Swipe left to right(prev not exist)");
+                    appinfo = CicoHomeScreen::GetAppInfo(curapp.c_str());
+                    if (appinfo)    {
+                        ico_syc_change_active(appinfo->GetAppId(), appinfo->GetLastSurface());
+                    }
+                }
+                else    {
+                    animation.time = ICO_HS_SWIPE_TOUCH_SWIPE_ANIMA_TIME |
+                                     ICO_SYC_WIN_SURF_RAISE | ICO_SYC_WIN_SURF_NORESCTL;
+
+                    /* show before application with slide to right  */
+                    appinfo = CicoHomeScreen::GetAppInfo(histapp.c_str());
+                    if (appinfo)    {
+                        animation.name = (char *)"slide.toright";
+                        for (idx = 0; ; idx++)  {
+                            wininfo = appinfo->GetWindowInfo(idx);
+                            if (! wininfo)  break;
+
+                            /* reset avtive surface         */
+                            if (idx == 0)   {
+                                ico_syc_change_active(wininfo->appid, 0);
+                            }
+                            ICO_DBG("TouchUpSwipe: %s.%d surface=%08x",
+                                    wininfo->appid, idx, wininfo->surface);
+                            ico_syc_show(wininfo->appid, wininfo->surface, &animation);
+                        }
+
+                        /* hide current applicaiton with slide to right */
+                        if (curapp.empty()) {
+                            ICO_DBG("TouchUpSwipe: Swipe left to right(current not exist)");
+                        }
+                        else    {
+                            animation.time = ICO_HS_SWIPE_TOUCH_SWIPE_ANIMA_TIME |
+                                             ICO_SYC_WIN_SURF_NORESCTL;
+                            appinfo = CicoHomeScreen::GetAppInfo(curapp.c_str());
+                            if (appinfo)    {
+                                animation.name = (char *)"slide.toleft";
+                                for (idx = 0; ; idx++)  {
+                                    wininfo = appinfo->GetWindowInfo(idx);
+                                    if (! wininfo)  break;
+                                    ICO_DBG("TouchUpSwipe: %s.%d surface=%08x",
+                                            wininfo->appid, idx, wininfo->surface);
+                                    ico_syc_hide(wininfo->appid,
+                                                 wininfo->surface, &animation);
+                                }
+                            }
+                            else    {
+                                ICO_DBG("TouchUpSwipe: current app(%s) dose not exist",
+                                        curapp.c_str());
+                            }
+                        }
+                        /* set history timer                        */
+                        app_history->selectApp(histapp.c_str());
+                    }
+                    else    {
+                        ICO_DBG("TouchUpSwipe: prev app(%s) dose not exist", histapp.c_str());
+                        appinfo = CicoHomeScreen::GetAppInfo(curapp.c_str());
+                        if (appinfo)    {
+                            ico_syc_change_active(appinfo->GetAppId(), appinfo->GetLastSurface());
+                        }
+                    }
+                }
+            }
+            swipe = 1;
+        }
+        else    {
+            ICO_DBG("TouchUpSwipe: Swipe left to right, but nop");
+            swipe = -1;
+        }
+    }
+    else if (sub < (-1 * ICO_HS_SWIPE_TOUCH_SWIPE_THREASHOLD_DISTANCE)) {
+        if (touch_state_b_x >
+            (full_width - ICO_HS_SWIPE_TOUCH_SWIPE_THREASHOLD_DISTANCE))    {
+            /* get current application  */
+            curapp = app_history->getSwipeCurrentAppid();
+
+            if (CicoHSSystemState::getInstance()->getRegulation() == true)  {
+                ICO_DBG("TouchUpSwipe: Swipe right side to left, but Regulation=ON");
+                appinfo = CicoHomeScreen::GetAppInfo(curapp.c_str());
+                if (appinfo)    {
+                    ico_syc_change_active(appinfo->GetAppId(), appinfo->GetLastSurface());
+                }
+            }
+            else    {
+                /* swipe at right side to left = go next applicaton     */
+
+                /* get next application     */
+                histapp = app_history->nextSwipe();
+                ICO_DBG("TouchUpSwipe: Swipe right to left(cur/next=%s/%s)",
+                        curapp.c_str(), histapp.c_str());
+                if (histapp.empty())    {
+                    ICO_DBG("TouchUpSwipe: Swipe right to left(next not exist)");
+                    appinfo = CicoHomeScreen::GetAppInfo(curapp.c_str());
+                    if (appinfo)    {
+                        ico_syc_change_active(appinfo->GetAppId(), appinfo->GetLastSurface());
+                    }
+                }
+                else    {
+                    animation.time = ICO_HS_SWIPE_TOUCH_SWIPE_ANIMA_TIME |
+                                     ICO_SYC_WIN_SURF_RAISE | ICO_SYC_WIN_SURF_NORESCTL;
+
+                    /* show next application with slide to left     */
+                    appinfo = CicoHomeScreen::GetAppInfo(histapp.c_str());
+                    if (appinfo)    {
+                        animation.name = (char *)"slide.toleft";
+                        for (idx = 0; ; idx++)  {
+                            wininfo = appinfo->GetWindowInfo(idx);
+                            if (! wininfo)  break;
+
+                            /* reset avtive surface         */
+                            if (idx == 0)   {
+                                ico_syc_change_active(wininfo->appid, 0);
+                            }
+                            ICO_DBG("TouchUpSwipe: %s.%d surface=%08x",
+                                    wininfo->appid, idx, wininfo->surface);
+                            ico_syc_show(wininfo->appid, wininfo->surface, &animation);
+                        }
+
+                        /* hide current applicaiton with slide to left  */
+                        if (curapp.empty()) {
+                            ICO_DBG("TouchUpSwipe: Swipe right to left(current not exist)");
+                        }
+                        else    {
+                            animation.time = ICO_HS_SWIPE_TOUCH_SWIPE_ANIMA_TIME |
+                                             ICO_SYC_WIN_SURF_NORESCTL;
+                            appinfo = CicoHomeScreen::GetAppInfo(curapp.c_str());
+                            if (appinfo)    {
+                            animation.name = (char *)"slide.toright";
+                                for (idx = 0; ; idx++)  {
+                                    wininfo = appinfo->GetWindowInfo(idx);
+                                    if (! wininfo)  break;
+                                    ICO_DBG("TouchUpSwipe: %s.%d surface=%08x",
+                                            wininfo->appid, idx, wininfo->surface);
+                                    ico_syc_hide(wininfo->appid,
+                                                 wininfo->surface, &animation);
+                                }
+                            }
+                            else    {
+                                ICO_DBG("TouchUpSwipe: current app(%s) dose not exist",
+                                        curapp.c_str());
+                            }
+                        }
+                        /* set history timer                            */
+                        app_history->selectApp(histapp.c_str());
+                    }
+                    else    {
+                        ICO_DBG("TouchUpSwipe: next app(%s) dose not exist", histapp.c_str());
+                        appinfo = CicoHomeScreen::GetAppInfo(curapp.c_str());
+                        if (appinfo)    {
+                            ico_syc_change_active(appinfo->GetAppId(), appinfo->GetLastSurface());
+                        }
+                    }
+                }
+            }
+            swipe = 1;
+        }
+        else    {
+            ICO_DBG("TouchUpSwipe: Swipe right side to left, but nop");
+            swipe = -1;
+        }
+    }
+
+#if 0       /* currently not support    */
+    /* check slide buttom to top or top to buttom   */
+    sub = touch_state_a_y - touch_state_b_y;
+    if (sub > ICO_HS_SWIPE_TOUCH_SWIPE_THREASHOLD_DISTANCE) {
+        if (touch_state_b_y < ICO_HS_SWIPE_TOUCH_SWIPE_THREASHOLD_DISTANCE) {
+            /* swipe at top side to buttom = unknown    */
+            ICO_DBG("TouchUpSwipe: Swipe top side to buttom");
+            swipe = 1;
+        }
+        else    {
+            ICO_DBG("TouchUpSwipe: Swipe top side to buttom, but nop");
+            swipe = -1;
+        }
+    }
+    else if (sub < (-1 * ICO_HS_SWIPE_TOUCH_SWIPE_THREASHOLD_DISTANCE)) {
+        if (touch_state_b_y >
+            (full_width - ICO_HS_SWIPE_TOUCH_SWIPE_THREASHOLD_DISTANCE))    {
+            /* swipe at buttom side to top = show home menu screen  */
+            ICO_DBG("TouchUpSwipe: Swipe buttom side to top");
+            swipe = 1;
+            if (ctl_bar_window) {
+                ctl_bar_window->TouchHome();
+            }
+        }
+        else    {
+            ICO_DBG("TouchUpSwipe: Swipe buttom side to top, but nop");
+            swipe = -1;
+        }
+    }
+#endif
+    if (swipe <= 0) {
+        /* send touch press event   */
+        ICO_DBG("TouchUpSwipe: Not Swipe, send event to application");
+        /* send ABS_X/Y     */
+        ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 2,
+                           ABS_Z, (touch_state_b_x << 16) | touch_state_b_y);
+        /* send TOUCH Down  */
+        ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 1,
+                           BTN_TOUCH, touch_down ? 8 : 1);
+        /* send ABS_X/Y     */
+        ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime,
+                           ABS_Z, ((touch_state_b_x+1) << 16) | (touch_state_b_y+1));
+
+        /* send touch release event */
+        gettimeofday(&ctime, NULL);
+        touch_lasttime = (ctime.tv_sec * 1000 + ctime.tv_usec/1000);
+
+        /* send ABS_X/Y     */
+        ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 1,
+                           ABS_Z, (touch_state_a_x << 16) | touch_state_a_y);
+        /* send TOUCH Up    */
+        ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime,
+                           BTN_TOUCH, 0);
+        set_xy_pos = false;
+    }
+    touch_down = false;
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   CicoHSSwipeTouch::TouchMoveSwipe
+ *          touch move action at swipe input window
+ *
+ * @param[in]   data    CicoHSSwipeInputWindow object
+ * @param[in]   evas    evas
+ * @param[in]   obj     object
+ * @param[in]   event_info    event information
+ * @return      none
+ */
+/*--------------------------------------------------------------------------*/
+void
+CicoHSSwipeTouch::TouchMoveSwipe(void *data, Evas *evas, Evas_Object *obj, void *event_info)
+{
+    Evas_Event_Mouse_Move   *info;
+    CicoHSSwipeInputWindow  *window;
+    struct timeval ctime;
+    int x, y;
+
+    info = reinterpret_cast<Evas_Event_Mouse_Move*>(event_info);
+
+    window = (CicoHSSwipeInputWindow *)data;
+    x = info->cur.output.x + window->GetPosX();
+    y = info->cur.output.y + window->GetPosY();
+    if ((x < 0) || (x >= 4096) || (y < 0) || (y >= 4096))   {
+        ICO_DBG("TouchMoveSwipe: Illegal position(x/y=%d/%d->%d/%d), Skip",
+                info->cur.output.x, info->cur.output.y, touch_state_a_x, touch_state_a_y);
+        return;
+    }
+    touch_state_a_x = x;
+    touch_state_a_y = y;
+
+    if ((set_xy_pos == false) || (touch_down == false)) {
+        set_xy_pos = true;
+        touch_state_b_x = touch_state_a_x;
+        touch_state_b_y = touch_state_a_y;
+        ICO_DBG("TouchMoveSwipe: save x/y=%d/%d", touch_state_b_x, touch_state_b_y);
+    }
+
+    ICO_DBG("TouchMoveSwipe: button=%x cur.x/y=%d/%d->%d/%d",
+            info->buttons, info->cur.output.x, info->cur.output.y,
+            touch_state_a_x, touch_state_a_y);
+
+    /* long push    */
+    if(touch_down == false) {
+        ICO_DBG("TouchMoveSwipe: no TouchDown, Skip");
+        return;
+    }
+
+    if (long_act == true)   {
+        ICO_DBG("TouchMoveSwipe: timedout");
+
+        if(timer != NULL){
+            ecore_timer_del(timer);
+            timer = NULL;
+        }
+
+        /* send ABS_X/Y     */
+        gettimeofday(&ctime, NULL);
+        touch_lasttime = (ctime.tv_sec * 1000 + ctime.tv_usec/1000);
+
+        ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime,
+                           ABS_Z, (touch_state_a_x << 16) | touch_state_a_y);
+        return;
+    }
+
+    if (abs(touch_state_b_y - touch_state_a_y)
+        > ICO_HS_SWIPE_TOUCH_SWIPE_THREASHOLD_MOVE_Y)  {
+        /* slide to top or buttom over threashold, swipe cancel */
+        ICO_DBG("TouchMoveSwipe: over Y direction");
+        if(timer != NULL){
+            ecore_timer_del(timer);
+            timer = NULL;
+        }
+        long_act = true;
+
+        /* send ABS_X/Y     */
+        ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 2,
+                           ABS_Z, (touch_state_b_x << 16) | touch_state_b_y);
+        /* send TOUCH Down  */
+        ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 1,
+                               BTN_TOUCH, touch_down ? 8 : 1);
+        touch_down = false;
+        /* send ABS_X/Y     */
+        gettimeofday(&ctime, NULL);
+        touch_lasttime = (ctime.tv_sec * 1000 + ctime.tv_usec/1000);
+        ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime,
+                           ABS_Z, (touch_state_a_x << 16) | touch_state_a_y);
+        set_xy_pos = false;
+    }
+}
similarity index 57%
rename from src/homescreen/CicoHSFlickTouch.h
rename to src/homescreen/CicoHSSwipeTouch.h
index 8835646..4827b56 100644 (file)
  *
  * @date    Aug-08-2013
  */
-#ifndef __CICO_HS_FLICK_TOUCH_H__
-#define __CICO_HS_FLICK_TOUCH_H__
+#ifndef __CICO_HS_SWIPE_TOUCH_H__
+#define __CICO_HS_SWIPE_TOUCH_H__
 #include <stdio.h>
 #include <pthread.h>
 #include <libwebsockets.h>
 
 
 #include <unistd.h>
-#include "CicoHSFlickInputWindow.h"
+#include "CicoHSSwipeInputWindow.h"
 #include "CicoHSControlBarWindow.h"
 #include "CicoHSAppHistoryExt.h"
 
-#define ICO_HS_FLICK_TOUCH_FLICK_WIDTH 80
-#define ICO_HS_FLICK_TOUCH_FLICK_HEIGHT 80
-#define ICO_HS_FLICK_TOUCH_DISTANCE_XY 200
-#define ICO_HS_FLICK_TOUCH_FLICK_THREASHOLD_DISTANCE 100
-#define ICO_HS_FLICK_TOUCH_FLICK_THREASHOLD_MOVE_Y 80
-#define ICO_HS_FLICK_TOUCH_LONG_PUSH_THREASHOLD_TIME_SECONDS 2.5d
-#define ICO_HS_FLICK_TOUCH_FLICK_ANIMA_TIME 300
+#define ICO_HS_SWIPE_TOUCH_SWIPE_WIDTH 80
+#define ICO_HS_SWIPE_TOUCH_SWIPE_HEIGHT 80
+#define ICO_HS_SWIPE_TOUCH_DISTANCE_XY 200
+#define ICO_HS_SWIPE_TOUCH_SWIPE_THREASHOLD_DISTANCE 80
+#define ICO_HS_SWIPE_TOUCH_SWIPE_THREASHOLD_MOVE_Y 80
+#define ICO_HS_SWIPE_TOUCH_LONG_PUSH_THREASHOLD_TIME_SECONDS 2.5d
+#define ICO_HS_SWIPE_TOUCH_SWIPE_ANIMA_TIME 300
 
-#define ICO_HS_MAX_FLICKWINDOWS 4
+#define ICO_HS_MAX_SWIPEWINDOWS 4
 
-class CicoHSFlickTouch
+class CicoHSSwipeTouch
 {
   public:
     static void Initialize(CicoHSControlBarWindow* ctl_bar, CicoHSAppHistoryExt *apphist,
                            int width, int height);
     static void Finalize(void);
-    static void TouchDownFlick(void *data, Evas *evas, Evas_Object *obj, void *event_info); 
-    static void TouchUpFlick(void *data, Evas *evas, Evas_Object *obj, void *event_info);
-    static void TouchMoveFlick(void *data, Evas *evas, Evas_Object *obj, void *event_info);
+    static void TouchDownSwipe(void *data, Evas *evas, Evas_Object *obj, void *event_info);
+    static void TouchUpSwipe(void *data, Evas *evas, Evas_Object *obj, void *event_info);
+    static void TouchMoveSwipe(void *data, Evas *evas, Evas_Object *obj, void *event_info);
     static Eina_Bool LongPushed(void *data);
 
   private:
     static CicoHSControlBarWindow* ctl_bar_window;
-    
+
     static int full_width;
     static int full_height;
     static int touch_state_b_x;
@@ -60,11 +60,11 @@ class CicoHSFlickTouch
     static bool long_act;
     static bool set_xy_pos;
     static int num_windows;
-    static CicoHSFlickInputWindow* flick_windows[ICO_HS_MAX_FLICKWINDOWS];
+    static CicoHSSwipeInputWindow* swipe_windows[ICO_HS_MAX_SWIPEWINDOWS];
     static CicoHSAppHistoryExt*    app_history;
 
   protected:
-    CicoHSFlickTouch operator=(const CicoHSFlickTouch&);
-    CicoHSFlickTouch(const CicoHSFlickTouch&);
+    CicoHSSwipeTouch operator=(const CicoHSSwipeTouch&);
+    CicoHSSwipeTouch(const CicoHSSwipeTouch&);
 };
 #endif
index 57e42e6..0501880 100644 (file)
@@ -66,7 +66,7 @@ CicoHSWindowController::Initialize(void)
  * @return      none
  */
 /*--------------------------------------------------------------------------*/
-void 
+void
 CicoHSWindowController::Finalize(void)
 {
     /* end the ecore_evas */
@@ -79,8 +79,8 @@ CicoHSWindowController::Finalize(void)
  *          get size of full screen
  *
  * @param[in]   orientation    vertial or horizontal
- * @param[out]   width          width of window
- * @param[out]   height         heigth of window
+ * @param[out]  width          width of window
+ * @param[out]  height         heigth of window
  * @return      none
  */
 /*--------------------------------------------------------------------------*/
@@ -102,6 +102,10 @@ CicoHSWindowController::GetFullScreenSize(int orientation,
     ICO_DBG("ecore_wl_screen_size_get => w/h=%d/%d",
             display_width, display_height);
 
+#if 1           /* TizenIVI 3.0 ecore return correct display size   */
+    *width = display_width;
+    *height = display_height;
+#else           /* TizenIVI 3.0 ecore return correct display size   */
     if (orientation == ICO_ORIENTATION_VERTICAL) {
         *width = display_width > display_height ?
                                  display_height : display_width;
@@ -114,9 +118,8 @@ CicoHSWindowController::GetFullScreenSize(int orientation,
         *height = (display_width < display_height ?
                                    display_width : display_height);
     }
-
-    ICO_DBG("CicoHSWindowController::GetFullScreenSize Leave(w/h=%d/%d)",
-            *width, *height);
+#endif          /* TizenIVI 3.0 ecore return correct display size   */
+    ICO_DBG("CicoHSWindowController::GetFullScreenSize Leave(w/h=%d/%d)", *width, *height);
 }
 
 /*--------------------------------------------------------------------------*/
index 91ab376..6a08ca2 100644 (file)
@@ -80,7 +80,7 @@ CicoHomeScreen::CicoHomeScreen(void)
     bg_height = 1;
     ctl_bar_width = 1;
     ctl_bar_height = 1;
-    num_flick_input_windows = 0;
+    num_swipe_input_windows = 0;
 
     menu_window = NULL;
     back_window = NULL;
@@ -130,7 +130,8 @@ CicoHomeScreen::ShowHomeScreenLayer(void)
     /*show home screen layers*/
     ico_syc_show_layer(HS_LAYER_APPLICATION);
     ico_syc_show_layer(HS_LAYER_HOMESCREEN);
-    ico_syc_show_layer(HS_LAYER_TOUCH);
+    ico_syc_show_layer(HS_LAYER_CONTROLBAR);
+    ico_syc_show_layer(HS_LAYER_TOUCHPANEL);
 }
 
 /*--------------------------------------------------------------------------*/
@@ -272,13 +273,14 @@ CicoHomeScreen::ChangeActive(const char * appid, int surface)
     if (0 != wininfo->visible) {
         hs_instance->SetActiveAppInfo(appid);
         hs_instance->setActiveApp(appid);
+        ico_syc_show(appid, surface, NULL);
         ico_syc_change_active(appid, surface);
     }
 }
 
 /*--------------------------------------------------------------------------*/
 /**
- * @brief   change application display zone for active window 
+ * @brief   change application display zone for active window
  */
 /*--------------------------------------------------------------------------*/
 void
@@ -286,6 +288,8 @@ CicoHomeScreen::ChangeZone(void)
 {
     ICO_TRA("CicoHomeScreen::ChangeZone Enter");
 
+    hs_instance->controlRegulation();
+
     CicoHSAppInfo* appinfo = hs_instance->GetSubDisplayAppInfo();
     // if sub display not exist showed appliction,
     // get main display showed application informaiton
@@ -340,7 +344,7 @@ CicoHomeScreen::requestChangeZone(CicoHSAppInfo* appinfo)
     if (NULL == hs_instance->GetSubDisplayAppInfo()) {
         layer = HS_LAYER_2NDDISP_APP;
     }
-    
+
     ico_syc_change_layer(wininfo->appid, wininfo->surface, layer);
     ico_syc_move(wininfo->appid, wininfo->surface, &move,
                  &hs_instance->moveZoneAnimation);
@@ -351,7 +355,9 @@ CicoHomeScreen::requestChangeZone(CicoHSAppInfo* appinfo)
             ICO_DBG("\"%s\"->\"%s\"", wapp.c_str(), wininfo->appid);
             if ((false == wapp.empty()) &&
                 (0 != wapp.compare(wininfo->appid))) {
-                cancelWaitActivation(wapp);
+                requestHideAppid(wapp);
+                m_appHis->clearSelectApp();
+                m_appHis->homeSwipe();
             }
         }
         ICO_TRA("reset sub display");
@@ -369,7 +375,7 @@ CicoHomeScreen::requestChangeZone(CicoHSAppInfo* appinfo)
         }
         m_appHis->homeSwipe();
     }
+
     ICO_TRA("Leave");
 }
 
@@ -392,7 +398,7 @@ CicoHomeScreen::GetWindowInfo(CicoHSAppInfo *appinfo,const char *window)
 /*--------------------------------------------------------------------------*/
 /**
  * @brief   CicoHomeScreen::GetWindowInfo
- *          get window info 
+ *          get window info
  *
  * @param[in]   appinfo    application info
  * @param[in]   surface    surface id
@@ -423,13 +429,13 @@ CicoHomeScreen::UpdateTile(const char *appid)
     }
     if (appinfo->GetStatus() == false)  {
         //show icon
+        ICO_DBG("CicoHomeScreen::UpdateTile: show menuIcon(%s)", appid);
         menu_window->ValidMenuIcon(appid);
-        ICO_DBG("CicoHomeScreen::UpdateTile: show menuIcon %s",appid);
     }
     else    {
         //show thumbnail
-        menu_window->ValidThumbnail(appid,appinfo->GetLastSurface());
-        ICO_DBG("CicoHomeScreen::UpdateTile: raise app %s",appid);
+        ICO_DBG("CicoHomeScreen::UpdateTile: show app thumbnail(%s)", appid);
+        menu_window->ValidThumbnail(appid, appinfo->GetLastSurface());
     }
 }
 
@@ -457,10 +463,10 @@ CicoHomeScreen::SetActiveAppInfo(const char *appid)
             return;
         }
     }
-
     ICO_DBG("active application changed. \"%s\"->\"%s\"",
             active_appinfo ? active_appinfo->GetAppId() : "unknown",
             appinfo ? appinfo->GetAppId() : "unknown");
+
     active_appinfo = appinfo;
 }
 
@@ -546,7 +552,7 @@ CicoHomeScreen::GetSubDisplayAppInfo(void)
  *  @retval not NULL : appid
  */
 /*--------------------------------------------------------------------------*/
-const char* 
+const char*
 CicoHomeScreen::GetSubDisplayAppid(void)
 {
     if (NULL == sub_display_appinfo) {
@@ -584,12 +590,6 @@ CicoHomeScreen::ExecuteApp_i(const char *appid)
         }
         else {
             //raise
-            if (m_appHis) {
-                const string& wapp = m_appHis->getSelectApp();
-                if (false == wapp.empty()) {
-                    cancelWaitActivation(wapp);
-                }
-            }
             RaiseApplicationWindow(appinfo->GetAppId(),
                                    appinfo->GetLastSurface());
             ICO_DBG("raise app %s", appid);
@@ -648,19 +648,21 @@ CicoHomeScreen::ShowHomeScreenWindow(ico_syc_win_info_t *win_info)
     move.pos_x = 0;
     move.width = full_width;
 
-    if(strncmp(win_info->name,ICO_HS_BACK_WINDOW_TITLE,
-               ICO_MAX_TITLE_NAME_LEN) == 0){
+    if (strncmp(win_info->name,ICO_HS_BACK_WINDOW_TITLE,
+                ICO_MAX_TITLE_NAME_LEN) == 0) {
         move.pos_y = ICO_HS_STATUSBAR_WINDOW_HEIGHT;
         move.height = full_height - ICO_HS_STATUSBAR_WINDOW_HEIGHT -
                       ICO_HS_CONTROLBAR_WINDOW_HEIGHT;
         layer = HS_LAYER_BACKGROUND;
-    }else if(strncmp(win_info->name,ICO_HS_CONTROL_BAR_WINDOW_TITLE,
-             ICO_MAX_TITLE_NAME_LEN) == 0){
+    }
+    else if (strncmp(win_info->name,ICO_HS_CONTROL_BAR_WINDOW_TITLE,
+                     ICO_MAX_TITLE_NAME_LEN) == 0) {
         move.pos_y = full_height - ICO_HS_CONTROLBAR_WINDOW_HEIGHT;
         move.height = ICO_HS_CONTROLBAR_WINDOW_HEIGHT;
-        layer = HS_LAYER_TOUCH;
-    }else if(strncmp(win_info->name,ICO_HS_MENU_WINDOW_TITLE,
-             ICO_MAX_TITLE_NAME_LEN) == 0){
+        layer = HS_LAYER_CONTROLBAR;
+    }
+    else if (strncmp(win_info->name,ICO_HS_MENU_WINDOW_TITLE,
+                     ICO_MAX_TITLE_NAME_LEN) == 0) {
         move.pos_y = ICO_HS_STATUSBAR_WINDOW_HEIGHT;
         move.height = full_height - ICO_HS_STATUSBAR_WINDOW_HEIGHT -
                       ICO_HS_CONTROLBAR_WINDOW_HEIGHT;
@@ -672,18 +674,18 @@ CicoHomeScreen::ShowHomeScreenWindow(ico_syc_win_info_t *win_info)
     }
 
     ico_syc_change_layer(win_info->appid,win_info->surface,layer);
-    ICO_DBG("CicoHomeScreen::ShowHomeScreenWindow: id(%s) name(%s) surface(%d) pos(%d,%d) size(%d,%d)",win_info->appid,
-            win_info->name,win_info->surface,move.pos_x,move.pos_y,
-            move.width,move.height);
-    ico_syc_move(win_info->appid,win_info->surface,&move,NULL);
-    
+    ICO_DBG("CicoHomeScreen::ShowHomeScreenWindow: id(%s) name(%s) surface(%d) "
+            "pos(%d,%d) size(%d,%d)", win_info->appid,
+            win_info->name, win_info->surface, move. pos_x, move.pos_y,
+            move.width, move.height);
+    ico_syc_move(win_info->appid, win_info->surface, &move, NULL);
+
     /*first time menu is unvisible*/
-    if((strncmp(win_info->name,ICO_HS_MENU_WINDOW_TITLE,
-             ICO_MAX_TITLE_NAME_LEN) == 0) && 
-       (GetMode() == ICO_HS_MODE_APPLICATION)){
+    if ((strncmp(win_info->name,ICO_HS_MENU_WINDOW_TITLE,
+                 ICO_MAX_TITLE_NAME_LEN) == 0) &&
+        (GetMode() == ICO_HS_MODE_APPLICATION)) {
         return;
     }
-
     ico_syc_show(win_info->appid, win_info->surface,NULL);
 }
 
@@ -706,7 +708,7 @@ CicoHomeScreen::ShowStatusBarWindow(ico_syc_win_info_t *win_info)
     move.pos_y = 0;
     move.width = full_width;
     move.height = ICO_HS_STATUSBAR_WINDOW_HEIGHT;
-    layer = HS_LAYER_HOMESCREEN;
+    layer = HS_LAYER_CONTROLBAR;
 
     ico_syc_change_layer(win_info->appid,win_info->surface,layer);
     ICO_DBG("CicoHomeScreen::ShowStatusBarWindow: id(%s) name(%s) surface(%d) "
@@ -762,7 +764,7 @@ CicoHomeScreen::ShowApplicationWindow(ico_syc_win_info_t *win_info)
     move.height = full_height - ICO_HS_STATUSBAR_WINDOW_HEIGHT -
                   ICO_HS_CONTROLBAR_WINDOW_HEIGHT;
     layer = HS_LAYER_APPLICATION;
-    
+
     ico_syc_change_layer(win_info->appid,win_info->surface,layer);
     ico_syc_move(win_info->appid,win_info->surface,&move,NULL);
     ico_syc_animation_t animation;
@@ -837,13 +839,13 @@ CicoHomeScreen::EventCallBack(const ico_syc_ev_e event,
 {
     int     idx;
 
-    ICO_DBG("CicoHomeScreen::EventCallBack: start (event %d)",event);
+//    ICO_DBG("CicoHomeScreen::EventCallBack: start (event %d)",event);
 
     if (event == ICO_SYC_EV_WIN_CREATE) {
         ico_syc_win_info_t *win_info =
             reinterpret_cast<ico_syc_win_info_t*>(const_cast<void*>(detail));
-        ICO_DBG("CicoHomeScreen::EventCallBack : win create %s %i",
-                win_info->appid,win_info->surface);
+        ICO_DBG("Event:ICO_SYC_EV_WIN_CREATE(appid=%s surface=0x%08x)",
+                win_info->appid, win_info->surface);
         /*only save information*/
         if (strncmp(win_info->appid, hs_instance->GetHsPackageName(),
                     ICO_HS_MAX_PROCESS_NAME) == 0)  {
@@ -851,13 +853,13 @@ CicoHomeScreen::EventCallBack(const ico_syc_ev_e event,
             hs_instance->hs_app_info->AddWindowInfo(win_info);
 
             /*when Menu window*/
-            if(strncmp(win_info->name,ICO_HS_MENU_WINDOW_TITLE,
-                       ICO_MAX_TITLE_NAME_LEN) == 0){
+            if (strncmp(win_info->name,ICO_HS_MENU_WINDOW_TITLE,
+                        ICO_MAX_TITLE_NAME_LEN) == 0) {
                 hs_instance->menu_window->SetMenuWindowID(win_info->appid,
                                                           win_info->surface);
             }
-            else if(strncmp(win_info->name,ICO_HS_CONTROL_BAR_WINDOW_TITLE,
-                            ICO_MAX_TITLE_NAME_LEN) == 0){
+            else if (strncmp(win_info->name,ICO_HS_CONTROL_BAR_WINDOW_TITLE,
+                             ICO_MAX_TITLE_NAME_LEN) == 0) {
                 hs_instance->ctl_bar_window->SetWindowID(win_info->appid,
                                                          win_info->surface);
             }
@@ -866,20 +868,20 @@ CicoHomeScreen::EventCallBack(const ico_syc_ev_e event,
                   /* null name, nothing to do */
                     return;
                 }
-                for (idx = 0; idx < hs_instance->num_flick_input_windows; idx++)    {
-                    if (hs_instance->flick_input_windows[idx]->
+                for (idx = 0; idx < hs_instance->num_swipe_input_windows; idx++)    {
+                    if (hs_instance->swipe_input_windows[idx]->
                                          isMyWindowName(win_info->name)) {
-                        hs_instance->flick_input_windows[idx]->
+                        hs_instance->swipe_input_windows[idx]->
                                          SetWindowID(win_info->appid, win_info->surface);
-                        hs_instance->flick_input_windows[idx]->SetupFlickWindow();
+                        hs_instance->swipe_input_windows[idx]->SetupSwipeWindow();
                         break;
                     }
                 }
             }
-
             /*show window*/
             hs_instance->ShowHomeScreenWindow(win_info);
-        }else if(strncmp(win_info->appid, 
+        }
+        else if (strncmp(win_info->appid,
                          hs_instance->GetSbPackageName(),
                          ICO_HS_MAX_PROCESS_NAME) == 0) {
             /*Status Bar*/
@@ -887,7 +889,8 @@ CicoHomeScreen::EventCallBack(const ico_syc_ev_e event,
 
             /*show window*/
             hs_instance->ShowStatusBarWindow(win_info);
-        }else if(strncmp(win_info->appid, 
+        }
+        else if (strncmp(win_info->appid,
                          hs_instance->GetOsPackageName(),
                          ICO_HS_MAX_PROCESS_NAME) == 0) {
             /*On Screen*/
@@ -896,7 +899,7 @@ CicoHomeScreen::EventCallBack(const ico_syc_ev_e event,
         else    {
             /*Application*/
             CicoHSAppInfo *appinfo = hs_instance->GetAppInfo(win_info->appid);
-            if(appinfo == NULL){
+            if (appinfo == NULL) {
                 return;
             }
             appinfo->AddWindowInfo(win_info);
@@ -908,37 +911,37 @@ CicoHomeScreen::EventCallBack(const ico_syc_ev_e event,
             hs_instance->UpdateTile(win_info->appid);
 
             hs_instance->startupCheck(win_info->appid);
-
         }
-    }else if(event == ICO_SYC_EV_WIN_NAME){
-        ico_syc_win_info_t *win_info = 
+    }
+    else if (event == ICO_SYC_EV_WIN_NAME) {
+        ico_syc_win_info_t *win_info =
             reinterpret_cast<ico_syc_win_info_t*>(const_cast<void*>(detail));
-        ICO_DBG("CicoHomeScreen::EventCallBack : win info %s %s %d",
-                win_info->appid,win_info->name,win_info->surface); 
+        ICO_DBG("Event:ICO_SYC_EV_WIN_NAME(appid=%s surface=0x%08x name=%s)",
+                win_info->appid, win_info->surface, win_info->name);
 
-        if(strncmp(win_info->appid, hs_instance->GetHsPackageName(),
-                   ICO_HS_MAX_PROCESS_NAME) == 0){
+        if (strncmp(win_info->appid, hs_instance->GetHsPackageName(),
+                    ICO_HS_MAX_PROCESS_NAME) == 0) {
             /*Home Screen*/
             hs_instance->hs_app_info->AddWindowInfo(win_info);
 
             /*when Menu window*/
-            if(strncmp(win_info->name,ICO_HS_MENU_WINDOW_TITLE,
-                       ICO_MAX_TITLE_NAME_LEN) == 0){
+            if (strncmp(win_info->name,ICO_HS_MENU_WINDOW_TITLE,
+                        ICO_MAX_TITLE_NAME_LEN) == 0) {
                 hs_instance->menu_window->SetMenuWindowID(win_info->appid,
                                                           win_info->surface);
             }
-            else if(strncmp(win_info->name,ICO_HS_CONTROL_BAR_WINDOW_TITLE,
-                            ICO_MAX_TITLE_NAME_LEN) == 0){
+            else if (strncmp(win_info->name,ICO_HS_CONTROL_BAR_WINDOW_TITLE,
+                             ICO_MAX_TITLE_NAME_LEN) == 0) {
                 hs_instance->ctl_bar_window->SetWindowID(win_info->appid,
                                                          win_info->surface);
             }
             else    {
-                for (idx = 0; idx < hs_instance->num_flick_input_windows; idx++)    {
-                    if (hs_instance->flick_input_windows[idx]->
+                for (idx = 0; idx < hs_instance->num_swipe_input_windows; idx++)    {
+                    if (hs_instance->swipe_input_windows[idx]->
                                          isMyWindowName(win_info->name)) {
-                        hs_instance->flick_input_windows[idx]->
+                        hs_instance->swipe_input_windows[idx]->
                                          SetWindowID(win_info->appid, win_info->surface);
-                        hs_instance->flick_input_windows[idx]->SetupFlickWindow();
+                        hs_instance->swipe_input_windows[idx]->SetupSwipeWindow();
                         break;
                     }
                 }
@@ -946,27 +949,31 @@ CicoHomeScreen::EventCallBack(const ico_syc_ev_e event,
 
             /*show window*/
             hs_instance->ShowHomeScreenWindow(win_info);
-        }else if(strncmp(win_info->appid, hs_instance->GetSbPackageName(),
-                         ICO_HS_MAX_PROCESS_NAME) == 0){
+        }
+        else if (strncmp(win_info->appid, hs_instance->GetSbPackageName(),
+                         ICO_HS_MAX_PROCESS_NAME) == 0) {
             /*Status Bar*/
             hs_instance->sb_app_info->AddWindowInfo(win_info);
-        }else if(strncmp(win_info->appid, hs_instance->GetOsPackageName(),
-                         ICO_HS_MAX_PROCESS_NAME) == 0){
+        }
+        else if (strncmp(win_info->appid, hs_instance->GetOsPackageName(),
+                         ICO_HS_MAX_PROCESS_NAME) == 0) {
             /*On Screen*/
             hs_instance->os_app_info->AddWindowInfo(win_info);
-        }else{
+        }
+        else {
             /*Application*/
             CicoHSAppInfo *appinfo = hs_instance->GetAppInfo(win_info->appid);
-            if(appinfo == NULL){
+            if (appinfo == NULL) {
                 return;
             }
             appinfo->AddWindowInfo(win_info);
         }
-    }else if(event == ICO_SYC_EV_WIN_DESTROY){
-        ico_syc_win_info_t *win_info = 
+    }
+    else if (event == ICO_SYC_EV_WIN_DESTROY) {
+        ico_syc_win_info_t *win_info =
             reinterpret_cast<ico_syc_win_info_t*>(const_cast<void*>(detail));
-        ICO_DBG("CicoHomeScreen::EventCallBack : win delete %s %i",
-                win_info->appid,win_info->surface);
+        ICO_DBG("Event:ICO_SYC_EV_WIN_DESTROY(appid=%s surface=0x%08x)",
+                win_info->appid, win_info->surface);
         /*only save information*/
         if (strncmp(win_info->appid, hs_instance->GetHsPackageName(),
                     ICO_HS_MAX_PROCESS_NAME) == 0)  {
@@ -986,64 +993,103 @@ CicoHomeScreen::EventCallBack(const ico_syc_ev_e event,
             /*Application*/
             CicoHSAppInfo *appinfo =
                        hs_instance->GetAppInfo(win_info->appid);
-            if (appinfo == NULL)    {
+            if (appinfo == NULL) {
                 return;
             }
+            appinfo->FreeWindowInfo(win_info->surface);
             hs_instance->UpdateTile(win_info->appid);
-            appinfo->FreeWindowInfo(win_info->name);
 
-            // udate active application information
+            // update active application information
             CicoHSAppInfo *active_appinfo = hs_instance->GetActiveAppInfo();
             if (appinfo == active_appinfo) {
                 hs_instance->SetActiveAppInfo(NULL);
             }
+
+            // update sub displayed application information
+            CicoHSAppInfo *subdisp_appinfo = hs_instance->GetSubDisplayAppInfo();
+            if (appinfo == subdisp_appinfo) {
+                hs_instance->SetSubDisplayAppInfo(NULL);
+            }
         }
     }
-    else if (event == ICO_SYC_EV_WIN_ACTIVE)    {
+    else if (event == ICO_SYC_EV_WIN_ACTIVE) {
         ico_syc_win_info_t *win_info =
             reinterpret_cast<ico_syc_win_info_t*>(const_cast<void*>(detail));
+        ICO_DBG("Event:ICO_SYC_EV_WIN_ACTIVE(appid=%s surface=0x%08x)",
+                win_info->appid, win_info->surface);
         hs_instance->ChangeActive(win_info->appid, win_info->surface);
     }
     else if (event == ICO_SYC_EV_WIN_ATTR_CHANGE)   {
         ico_syc_win_attr_t *win_attr =
             reinterpret_cast<ico_syc_win_attr_t*>(const_cast<void*>(detail));
-        ICO_DBG("CicoHomeScreen::EventCallBack : win attr %s %s %d",
-                win_attr->appid,win_attr->name,win_attr->surface);
+        ICO_DBG("Event:ICO_SYC_EV_WIN_ATTR_CHANGE(appid=%s surface=0x%08x)",
+                win_attr->appid, win_attr->surface);
         if (strncmp(win_attr->appid, hs_instance->GetHsPackageName(),
                     ICO_HS_MAX_PROCESS_NAME) == 0)  {
             /*Home Screen*/
             hs_instance->hs_app_info->AddWindowAttr(win_attr);
-        }else if(strncmp(win_attr->appid, hs_instance->GetSbPackageName(),
-                         ICO_HS_MAX_PROCESS_NAME) == 0){
+        }
+        else if (strncmp(win_attr->appid, hs_instance->GetSbPackageName(),
+                         ICO_HS_MAX_PROCESS_NAME) == 0) {
             /*Status Bar*/
             hs_instance->sb_app_info->AddWindowAttr(win_attr);
-        }else if(strncmp(win_attr->appid, hs_instance->GetOsPackageName(),
-                         ICO_HS_MAX_PROCESS_NAME) == 0){
+        }
+        else if (strncmp(win_attr->appid, hs_instance->GetOsPackageName(),
+                         ICO_HS_MAX_PROCESS_NAME) == 0) {
             /*On Screen*/
             hs_instance->os_app_info->AddWindowAttr(win_attr);
         }
-        else    {
+        else {
             ICO_DBG("CicoHomeScreen::EventCallBack : application window %s %s",
                     win_attr->appid,win_attr->name);
             /*Application*/
             CicoHSAppInfo *appinfo = hs_instance->GetAppInfo(win_attr->appid);
-            if (appinfo == NULL)    {
+            if (appinfo == NULL) {
                 return;
             }
             appinfo->AddWindowAttr(win_attr);
+            hs_instance->UpdateTile(win_attr->appid);
         }
     }
     else if (event == ICO_SYC_EV_THUMB_CHANGE)  {
         ico_syc_thumb_info_t *thumb_info =
             reinterpret_cast<ico_syc_thumb_info_t*>(const_cast<void*>(detail));
         CicoHSAppInfo *appinfo = hs_instance->GetAppInfo(thumb_info->appid);
-        ICO_DBG("CicoHomeScreen::EventCallBack : ICO_SYC_EV_THUMB_CHANGE %s",
-                thumb_info->appid);
         if (appinfo == NULL)    {
+            ICO_DBG("CicoHomeScreen::EventCallBack : ICO_SYC_EV_THUMB_CHANGE %s(%02x) "
+                    "no appinfo", thumb_info->appid, thumb_info->surface);
             return;
         }
-        //show icon
-        hs_instance->menu_window->SetThumbnail(thumb_info->appid,thumb_info->surface);
+//      ICO_DBG("CicoHomeScreen::EventCallBack : ICO_SYC_EV_THUMB_CHANGE %s(%02x)",
+//              thumb_info->appid, thumb_info->surface);
+        // show thumbnail icon
+        hs_instance->menu_window->SetThumbnail(thumb_info->appid, thumb_info);
+    }
+    else if (event == ICO_SYC_EV_THUMB_UNMAP)  {
+        ico_syc_thumb_info_t *thumb_info =
+            reinterpret_cast<ico_syc_thumb_info_t*>(const_cast<void*>(detail));
+        CicoHSAppInfo *appinfo = hs_instance->GetAppInfo(thumb_info->appid);
+        if (appinfo == NULL)    {
+            ICO_DBG("CicoHomeScreen::EventCallBack : ICO_SYC_EV_THUMB_UNMAP %s(%02x) "
+                    "no appinfo", thumb_info->appid, thumb_info->surface);
+            return;
+        }
+        ICO_DBG("CicoHomeScreen::EventCallBack : ICO_SYC_EV_THUMB_UNMAP %s(%02x)",
+                thumb_info->appid, thumb_info->surface);
+        hs_instance->menu_window->SetThumbnail(thumb_info->appid, NULL);
+    }
+    else if (event == ICO_SYC_EV_THUMB_ERROR)  {
+        ico_syc_thumb_info_t *thumb_info =
+            reinterpret_cast<ico_syc_thumb_info_t*>(const_cast<void*>(detail));
+        CicoHSAppInfo *appinfo = hs_instance->GetAppInfo(thumb_info->appid);
+        if (appinfo == NULL)    {
+            ICO_DBG("CicoHomeScreen::EventCallBack : ICO_SYC_EV_THUMB_ERROR %s(%02x) "
+                    "no appinfo", thumb_info->appid, thumb_info->surface);
+            return;
+        }
+        ICO_DBG("CicoHomeScreen::EventCallBack : ICO_SYC_EV_THUMB_ERROR %s(%02x)",
+                thumb_info->appid, thumb_info->surface);
+        hs_instance->menu_window->SetThumbnail(thumb_info->appid, NULL);
     }
     else if (event == ICO_SYC_EV_LAYER_ATTR_CHANGE) {
 
@@ -1078,8 +1124,7 @@ CicoHomeScreen::EventCallBack(const ico_syc_ev_e event,
     else if (event == ICO_SYC_EV_STATE_CHANGE)  {
         ico_syc_state_info_t *state_info =
             reinterpret_cast<ico_syc_state_info_t*>(const_cast<void*>(detail));
-
-        ICO_DBG("RECV: ICO_SYC_EV_STATE_CHANGE(id=%d state=%d)",
+        ICO_DBG("EVENT:ICO_SYC_EV_STATE_CHANGE(id=%d state=%d)",
                 state_info->id, state_info->state);
         if (ICO_SYC_STATE_REGULATION == state_info->id) {
             // set regulation state
@@ -1094,7 +1139,7 @@ CicoHomeScreen::EventCallBack(const ico_syc_ev_e event,
             ecore_main_loop_thread_safe_call_async(CicoHomeScreen::SetNightMode, NULL);
         }
     }
-    ICO_DBG("CicoHomeScreen::EventCallBack: end");
+//    ICO_DBG("CicoHomeScreen::EventCallBack: end");
 }
 
 /*--------------------------------------------------------------------------*/
@@ -1121,16 +1166,16 @@ CicoHomeScreen::StartRelations(void)
                                              ICO_HS_APPID_DEFAULT_ONS),
             ICO_HS_MAX_PROCESS_NAME);
 // TODO
-#if 0 
+#if 0
     /* start onscreen & statusbar apps */
     os_app_info = GetAppInfo(os_package_name);
     ret = os_app_info->Execute();
     if (ret < 0) {
         ICO_WRN("execute failed(%s) err=%d", os_package_name, ret);
-    } 
+    }
 #endif
 
-    sb_app_info = GetAppInfo(sb_package_name); 
+    sb_app_info = GetAppInfo(sb_package_name);
     ret = sb_app_info->Execute();
     if (ret < 0) {
         ICO_WRN("execute failed(%s) err=%d", sb_package_name, ret);
@@ -1221,12 +1266,12 @@ CicoHomeScreen::Initialize(int orientation,CicoHomeScreenConfig *config)
 
     moveZoneAnimation.time = config->ConfigGetInteger("switchzone",
                                                       "animatime", 400);
-    
+
     // debug log
     ICO_DBG("moveZoneName=%s animation=%s time=%d",
             moveZoneName, moveZoneAnimation.name, moveZoneAnimation.time);
 
-    ICO_DBG("CicoHomeScreen::Initialize: end"); 
+    ICO_DBG("CicoHomeScreen::Initialize: end");
 
     return ICO_OK;
 }
@@ -1464,74 +1509,74 @@ CicoHomeScreen::DeleteControlBarWindow(void)
 
 /*--------------------------------------------------------------------------*/
 /**
- * @brief   CicoHomeScreen::CreateFlickInputWindow
- *          create flick input windows
+ * @brief   CicoHomeScreen::CreateSwipeInputWindow
+ *          create swipe input windows
  *
  * @param[in]   none
  * @return      none
  */
 /*--------------------------------------------------------------------------*/
 void
-CicoHomeScreen::CreateFlickInputWindow(void)
+CicoHomeScreen::CreateSwipeInputWindow(void)
 {
-    ICO_DBG("CicoHomeScreen::CreateFlickInputWindow: start");
-    /* TODO: cullentry FlickInput windows is fixed size, need configuration ?   */
+    ICO_DBG("CicoHomeScreen::CreateSwipeInputWindow: start");
+    /* TODO: cullentry SwipeInput windows is fixed size, need configuration ?   */
     /* left side window     */
-    flick_input_windows[0] = new CicoHSFlickInputWindow();
-    flick_input_windows[0]->
-            CreateFlickInputWindow(ICO_HS_WINDOW_POS_X,
-                                   ICO_HS_WINDOW_POS_Y + ICO_HS_FLICK_TOUCH_DISTANCE_XY,
-                                   ICO_HS_FLICK_TOUCH_FLICK_WIDTH,
-                                   full_height - (ICO_HS_FLICK_TOUCH_DISTANCE_XY*2), "left");
-    flick_input_windows[0]->ShowWindow();
+    swipe_input_windows[0] = new CicoHSSwipeInputWindow();
+    swipe_input_windows[0]->
+            CreateSwipeInputWindow(ICO_HS_WINDOW_POS_X,
+                                   ICO_HS_WINDOW_POS_Y + ICO_HS_SWIPE_TOUCH_DISTANCE_XY,
+                                   ICO_HS_SWIPE_TOUCH_SWIPE_WIDTH,
+                                   full_height - (ICO_HS_SWIPE_TOUCH_DISTANCE_XY*2), "left");
+    swipe_input_windows[0]->ShowWindow();
 
     /* right side window    */
-    flick_input_windows[1] = new CicoHSFlickInputWindow();
-    flick_input_windows[1]->
-            CreateFlickInputWindow(full_width - ICO_HS_FLICK_TOUCH_FLICK_WIDTH,
-                                   ICO_HS_WINDOW_POS_Y + ICO_HS_FLICK_TOUCH_DISTANCE_XY,
-                                   ICO_HS_FLICK_TOUCH_FLICK_WIDTH,
-                                   full_height - (ICO_HS_FLICK_TOUCH_DISTANCE_XY*2), "right");
-    flick_input_windows[1]->ShowWindow();
+    swipe_input_windows[1] = new CicoHSSwipeInputWindow();
+    swipe_input_windows[1]->
+            CreateSwipeInputWindow(full_width - ICO_HS_SWIPE_TOUCH_SWIPE_WIDTH,
+                                   ICO_HS_WINDOW_POS_Y + ICO_HS_SWIPE_TOUCH_DISTANCE_XY,
+                                   ICO_HS_SWIPE_TOUCH_SWIPE_WIDTH,
+                                   full_height - (ICO_HS_SWIPE_TOUCH_DISTANCE_XY*2), "right");
+    swipe_input_windows[1]->ShowWindow();
 
 #if 0       /* currently not support(not fix specification) */
     /* buttom side window   */
-    flick_input_windows[2] = new CicoHSFlickInputWindow();
-    flick_input_windows[2]->
-            CreateFlickInputWindow(ICO_HS_WINDOW_POS_X,
-                                   full_height - ICO_HS_FLICK_TOUCH_FLICK_HEIGHT,
-                                   full_width, ICO_HS_FLICK_TOUCH_FLICK_WIDTH, "buttom");
-
-    flick_input_windows[2]->ShowWindow();
-    num_flick_input_windows = 3;
+    swipe_input_windows[2] = new CicoHSSwipeInputWindow();
+    swipe_input_windows[2]->
+            CreateSwipeInputWindow(ICO_HS_WINDOW_POS_X,
+                                   full_height - ICO_HS_SWIPE_TOUCH_SWIPE_HEIGHT,
+                                   full_width, ICO_HS_SWIPE_TOUCH_SWIPE_WIDTH, "buttom");
+
+    swipe_input_windows[2]->ShowWindow();
+    num_swipe_input_windows = 3;
 #else
-    num_flick_input_windows = 2;
+    num_swipe_input_windows = 2;
 #endif
-    ICO_DBG("CicoHomeScreen::CreateFlickInputWindow: end");
+    ICO_DBG("CicoHomeScreen::CreateSwipeInputWindow: end");
 }
 
 /*--------------------------------------------------------------------------*/
 /**
- * @brief   CicoHomeScreen::DeleteFlickInputWindow
- *          delete flick input windows
+ * @brief   CicoHomeScreen::DeleteSwipeInputWindow
+ *          delete swipe input windows
  *
  * @param[in]   none
  * @return      none
  */
 /*--------------------------------------------------------------------------*/
 void
-CicoHomeScreen::DeleteFlickInputWindow(void)
+CicoHomeScreen::DeleteSwipeInputWindow(void)
 {
     int idx;
 
-    for (idx = 0; idx < num_flick_input_windows; idx++) {
-        if (flick_input_windows[idx])   {
-            flick_input_windows[idx]->FreeFlickInputWindow();
-            delete flick_input_windows[idx];
-            flick_input_windows[idx] = NULL;
+    for (idx = 0; idx < num_swipe_input_windows; idx++) {
+        if (swipe_input_windows[idx])   {
+            swipe_input_windows[idx]->FreeSwipeInputWindow();
+            delete swipe_input_windows[idx];
+            swipe_input_windows[idx] = NULL;
         }
     }
-    num_flick_input_windows = 0;
+    num_swipe_input_windows = 0;
 }
 
 /*--------------------------------------------------------------------------*/
@@ -1570,10 +1615,10 @@ CicoHomeScreen::StartHomeScreen()
     /*Create window*/
     CreateMenuWindow();
 
-    /*Create FlickInput window*/
-    CicoHSFlickTouch::Initialize(hs_instance->ctl_bar_window, hs_instance->m_appHis,
+    /*Create SwipeInput window*/
+    CicoHSSwipeTouch::Initialize(hs_instance->ctl_bar_window, hs_instance->m_appHis,
                                  full_width, full_height);
-    CreateFlickInputWindow();
+    CreateSwipeInputWindow();
 
     /*Show Home Screen*/
     ShowHomeScreenLayer();
@@ -1632,6 +1677,7 @@ CicoHomeScreen::ChangeMode(int pattern)
 
     if (hs_instance->GetMode() == ICO_HS_MODE_MENU) {
         ico_syc_animation_t animation;
+        ICO_DBG("CicoHomeScreen::ChangeMode: MENU->APP");
         if (pattern == ICO_HS_SHOW_HIDE_PATTERN_SLIDE)  {
             animation.name = (char*)ICO_HS_MENU_HIDE_ANIMATION_SLIDE;
         }
@@ -1640,8 +1686,8 @@ CicoHomeScreen::ChangeMode(int pattern)
         }
         animation.time = ICO_HS_MENU_ANIMATION_DURATION;
         hs_instance->menu_window->Hide(&animation);
-        for (idx = 0; idx < hs_instance->num_flick_input_windows; idx++)    {
-            hs_instance->flick_input_windows[idx]->Show();
+        for (idx = 0; idx < hs_instance->num_swipe_input_windows; idx++)    {
+            hs_instance->swipe_input_windows[idx]->Show();
         }
         hs_instance->SetMode(ICO_HS_MODE_APPLICATION);
         CicoHSAppInfo *appinfo = hs_instance->GetActiveAppInfo();
@@ -1651,6 +1697,7 @@ CicoHomeScreen::ChangeMode(int pattern)
     }
     else if (hs_instance->GetMode() ==ICO_HS_MODE_APPLICATION)  {
         ico_syc_animation_t animation;
+        ICO_DBG("CicoHomeScreen::ChangeMode: APP->MENU");
         if (pattern == ICO_HS_SHOW_HIDE_PATTERN_SLIDE)  {
             animation.name = (char*)ICO_HS_MENU_SHOW_ANIMATION_SLIDE;
         }
@@ -1659,8 +1706,8 @@ CicoHomeScreen::ChangeMode(int pattern)
         }
         animation.time = ICO_HS_MENU_ANIMATION_DURATION;
         hs_instance->menu_window->Show(&animation);
-        for (idx = 0; idx < hs_instance->num_flick_input_windows; idx++)    {
-            hs_instance->flick_input_windows[idx]->Hide();
+        for (idx = 0; idx < hs_instance->num_swipe_input_windows; idx++)    {
+            hs_instance->swipe_input_windows[idx]->Hide();
         }
         hs_instance->SetMode(ICO_HS_MODE_MENU);
     }
@@ -1746,12 +1793,33 @@ void
 CicoHomeScreen::SetRegulation(void* data)
 {
     ICO_DBG("CicoHomeScreen::SetRegulation Enter");
+    // window control
+    hs_instance->controlRegulation();
     // regulation action
     hs_instance->ctl_bar_window->SetRegulation();
     ico_syc_animation_t animation;
     animation.name = (char*)ICO_HS_MENU_HIDE_ANIMATION_SLIDE;
     animation.time = ICO_HS_MENU_ANIMATION_DURATION;
     hs_instance->menu_window->Hide(&animation);
+
+    // force focus change
+    if (false == CicoHSSystemState::getInstance()->getRegulation()) {
+        CicoHSAppInfo *active_appinfo = hs_instance->GetActiveAppInfo();
+        if (NULL != active_appinfo) {
+            ico_syc_change_active(active_appinfo->GetAppId(),
+                                  active_appinfo->GetLastSurface());
+            ico_syc_change_active(active_appinfo->GetAppId(), 0);
+        }
+    }
+    else {
+        if (NULL != hs_instance->ctl_bar_window) {
+            const char *ctl_bar_appid = hs_instance->ctl_bar_window->GetAppId();
+            int ctl_bar_surface = hs_instance->ctl_bar_window->GetSurfaceId();
+            ico_syc_change_active(ctl_bar_appid, ctl_bar_surface);
+            ico_syc_change_active(ctl_bar_appid, 0);
+        }
+    }
+
     ICO_DBG("CicoHomeScreen::SetRegulation Leave");
 }
 
@@ -1785,7 +1853,7 @@ CicoHomeScreen::RenewAppInfoList_i(void)
          (ii < (int)aillist.size()) && (ii < ICO_HS_MAX_APP_NUM);
          ii++)  {
         ICO_DBG("aillist[%d].m_appid.c_str() = %s",
-                 ii, aillist[ii].m_appid.c_str()); 
+                 ii, aillist[ii].m_appid.c_str());
 
         for (kk = 0; kk < ICO_HS_MAX_APP_NUM; kk++) {
             if (apps_info[kk] == NULL) {
@@ -1816,7 +1884,7 @@ CicoHomeScreen::RenewAppInfoList_i(void)
         }
         appid_p = apps_info[ii]->GetAppId();
         for ( kk = 0; kk < tmp_application_num; kk++) {
-            if (strcmp(appid_p, tmp_apps_info[kk]->GetAppId()) == 0) { 
+            if (strcmp(appid_p, tmp_apps_info[kk]->GetAppId()) == 0) {
                 break;
             }
         }
@@ -1894,17 +1962,7 @@ void CicoHomeScreen::startupCheck(const char* appid)
         return;
     }
     m_appHis->update_appid();
-    vector<int> pids;
-    life_cycle_controller->getPIDs(appid, pids);
-    if (0 == pids.size()) {
-        ICO_TRA("end");
-        return;
-    }
-    vector<int>::iterator it = pids.begin();
-    while (it != pids.end()) {
-        m_appHis->startupEntryFinish(*it);
-        ++it;
-    }
+    m_appHis->startupEntryFinish(appid);
     if (false == m_appHis->isFinish()) {
         ICO_TRA("end");
         return;
@@ -1940,7 +1998,7 @@ void CicoHomeScreen::finishStartup(void)
             ++it_h;
         }
     }
-    
+
     list<string>::reverse_iterator rit_h = h.rbegin();
     while(rit_h != h.rend()) {
         CicoHSAppInfo *ai = GetAppInfo((*rit_h).c_str());
@@ -1973,7 +2031,7 @@ void CicoHomeScreen::finishStartup(void)
         ico_syc_change_active(appid, surface);
         hs_instance->SetActiveAppInfo(appid);
     }
-        
+
     m_appHis->stopStartupCheck();
     ICO_TRA("end");
 }
@@ -2001,14 +2059,13 @@ void CicoHomeScreen::readStartupApp(std::vector<pairAppidSubd>& apps)
 
 /*--------------------------------------------------------------------------*/
 /**
- * @brief   CicoHomeScreen::cancelWaitActivation
- *          cancel wait Activation time out(Swipe move operate)
+ * @brief   CicoHomeScreen::requestHideAppid
+ *          request Hide appid
  *
  * @param  app appid
- * @param  bOldShow  true is home appid show / false is no show
  */
 /*--------------------------------------------------------------------------*/
-void CicoHomeScreen::cancelWaitActivation(const std::string& app)
+void CicoHomeScreen::requestHideAppid(const std::string& app)
 {
     const char* appid = app.c_str();
     ICO_TRA("start %s", appid);
@@ -2024,13 +2081,13 @@ void CicoHomeScreen::cancelWaitActivation(const std::string& app)
 
 /*--------------------------------------------------------------------------*/
 /**
- * @brief   CicoHomeScreen::requestWaitActivation
- *          request wait Activation time out(Swipe move operate)
+ * @brief   CicoHomeScreen::requestShowAppid
+ *          request Show appid
  *
  * @param  app appid
  */
 /*--------------------------------------------------------------------------*/
-void CicoHomeScreen::requestWaitActivation(const std::string& app)
+void CicoHomeScreen::requestShowAppid(const std::string& app)
 {
     const char* appid = app.c_str();
     ICO_TRA("start %s", appid);
@@ -2040,8 +2097,110 @@ void CicoHomeScreen::requestWaitActivation(const std::string& app)
         return;
     }
     int surface = ai->GetLastSurface();
+    ico_syc_show(appid, surface, NULL);
+    ICO_TRA("end");
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   CicoHomeScreen::requestActivationAppid
+ *          request Activation
+ *
+ * @param  app appid
+ */
+/*--------------------------------------------------------------------------*/
+void CicoHomeScreen::requestActivationAppid(const std::string& app)
+{
+    const char* appid = app.c_str();
+    ICO_TRA("start %s", appid);
+    CicoHSAppInfo *ai = GetAppInfo(appid);
+    if (NULL == ai) {
+        ICO_DBG("end %d", appid);
+        return;
+    }
+    int surface = ai->GetLastSurface();
+    hs_instance->SetActiveAppInfo(app.c_str());
+    ico_syc_show(appid, surface, NULL);
     ico_syc_change_active(appid, surface);
     ICO_TRA("end");
 }
 
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   CicoHomeScreen::controlRegulation
+ *          controlRegulation
+ *
+ * @param  reqStt true / false
+ */
+/*--------------------------------------------------------------------------*/
+void CicoHomeScreen::controlRegulation(bool regStt)
+{
+    ICO_TRA("start %s", regStt? "true": "false");
+    if (NULL == m_appHis) {
+        ICO_TRA("end");
+        return;
+    }
+    const string& wapp = m_appHis->getSelectApp(); // select appid get
+    if (false == wapp.empty()) { // select appid nothing
+        const string& napp = m_appHis->getNearHistory(); // history top appid get
+        if (0 != wapp.compare(napp)) { // history top, wait app is Eqale
+            requestHideAppid(napp);
+            requestActivationAppid(wapp);
+            m_appHis->moveHistoryHead(wapp);
+        }
+        m_appHis->clearSelectApp(); // select appid clear
+        m_appHis->homeSwipe();
+    }
+    ICO_TRA("end");
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   CicoHomeScreen::ActivationUpdate
+ *          history update by swipe app
+ *
+ * @return bool
+ * @retval true history update
+ * @retval false no history updath
+ */
+/*--------------------------------------------------------------------------*/
+bool
+CicoHomeScreen::ActivationUpdate(void)
+{
+    return hs_instance->ActivationUpdate_i();
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   CicoHomeScreen::ActivationUpdate_i
+ *          history update by swipe app
+ *
+ * @return bool
+ * @retval true history update
+ * @retval false no history updath
+ */
+/*--------------------------------------------------------------------------*/
+bool
+CicoHomeScreen::ActivationUpdate_i(void)
+{
+    if (NULL == m_appHis) {
+        ICO_DBG("false");
+        return false;
+    }
+    bool bR = false;
+    const string& wapp = m_appHis->getSelectApp(); // select appid get
+    if (false == wapp.empty()) { // select appid nothing
+        const string& napp = m_appHis->getNearHistory(); // history top appid get
+        if (0 != wapp.compare(napp)) { // history top, wait app is Eqale
+            requestActivationAppid(wapp);
+            m_appHis->moveHistoryHead(wapp);
+            bR = true;
+        }
+        m_appHis->clearSelectApp(); // select appid clear
+        m_appHis->homeSwipe();
+    }
+    ICO_DBG("%s", bR? "true": "false");
+    return bR;
+}
+
 // vim: set expandtab ts=4 sw=4:
index 9dc1fe1..6d672ce 100644 (file)
@@ -30,7 +30,7 @@
 #include "CicoHSMenuWindow.h"
 #include "CicoHSBackWindow.h"
 #include "CicoHSControlBarWindow.h"
-#include "CicoHSFlickTouch.h"
+#include "CicoHSSwipeTouch.h"
 #include "CicoHSWindowController.h"
 #include "CicoHSAppInfo.h"
 
@@ -90,8 +90,8 @@ class CicoHomeScreen
     void UpDateBackWindow(void);
     void CreateControlBarWindow(void);
     void DeleteControlBarWindow(void);
-    void CreateFlickInputWindow(void);
-    void DeleteFlickInputWindow(void);
+    void CreateSwipeInputWindow(void);
+    void DeleteSwipeInputWindow(void);
     void StartLoop(void);
     char *GetHsPackageName(void);
     char *GetSbPackageName(void);
@@ -130,8 +130,12 @@ class CicoHomeScreen
     void startupCheck(const char* appid);
     void finishStartup(void);
     void readStartupApp(std::vector<pairAppidSubd>& apps);
-    void cancelWaitActivation(const std::string& app);
-    void requestWaitActivation(const std::string& app);
+    void requestHideAppid(const std::string& app);
+    void requestShowAppid(const std::string& app);
+    void requestActivationAppid(const std::string& app);
+    void controlRegulation(bool regStt=true);
+    static bool ActivationUpdate(void);
+    bool ActivationUpdate_i(void);
   private:
     int GetProcessWindow(const char *appid);
     static void EventCallBack(ico_syc_ev_e event,const void* detail,void* user_data);
@@ -168,8 +172,8 @@ class CicoHomeScreen
     CicoHSMenuWindow* menu_window;
     CicoHSBackWindow* back_window;
     CicoHSControlBarWindow* ctl_bar_window;
-    int num_flick_input_windows;
-    CicoHSFlickInputWindow* flick_input_windows[ICO_HS_MAX_FLICKWINDOWS];
+    int num_swipe_input_windows;
+    CicoHSSwipeInputWindow* swipe_input_windows[ICO_HS_MAX_SWIPEWINDOWS];
     /*mode*/
     int mode;
     /*configuration*/
index b810734..f9c1cec 100644 (file)
 #define ICO_HS_MAX_APP_NUM 512
 
 /* Maximum length of application name   */
-#define ICO_HS_MAX_PROCESS_NAME 64     
+#define ICO_HS_MAX_PROCESS_NAME 64
 
 /* HomeScreen default process name   */
-#define ICO_HS_PROC_DEFAULT_HOMESCREEN "org.tizen.ico.homescreen"    
+#define ICO_HS_PROC_DEFAULT_HOMESCREEN "org.tizen.ico.homescreen"
 
 /*app name*/
 #define ICO_HS_APPID_DEFAULT_SB     "org.tizen.ico.statusbar"
@@ -54,7 +54,7 @@
 #define ICO_HS_MENU_WINDOW_TITLE "ico_hs_menuwindow"
 #define ICO_HS_BACK_WINDOW_TITLE "ico_hs_backwindow"
 #define ICO_HS_CONTROL_BAR_WINDOW_TITLE "ico_hs_controlbarwindow"
-#define ICO_HS_FLICK_INPUT_WINDOW_TITLE "ico_hs_flickinputwindow"
+#define ICO_HS_SWIPE_INPUT_WINDOW_TITLE "ico_hs_swipeinputwindow"
 
 /*path of layaout file*/
 #define ICO_HS_MENU_LAYOUT_FILE_PATH "/home/app/layout.txt"
 /*Layer dicralation*/
 #define HS_LAYER_BACKGROUND     0         /* layer of BackGround */
 #define HS_LAYER_APPLICATION    1         /* layer of Application */
-#define HS_LAYER_HOMESCREEN     2         /* layer of HomeScreen menu */
-#define HS_LAYER_SOFTKEYBOARD   3         /* layer of Software Keyboard  */
-#define HS_LAYER_INTERRUPTAPP   4         /* layer of Interrupted Application */
+#define HS_LAYER_METERAPP       2         /* layer of Meter Display Application */
+#define HS_LAYER_HOMESCREEN     3         /* layer of HomeScreen menu */
+#define HS_LAYER_CONTROLBAR     4         /* layer of Control/Status bar */
+#define HS_LAYER_FULLSCREEN     5         /* layer of FullScreen Application */
 #define HS_LAYER_ONSCREEN       6         /* layer of OnScreen   */
-#define HS_LAYER_TOUCH          ICO_WINDOW_MGR_V_LAYER_INPUT
+#define HS_LAYER_TOUCHPANEL     ICO_WINDOW_MGR_LAYERTYPE_TOUCH
                                           /* layer of TouchPanel input */
-#define HS_LAYER_CURSOR         ICO_WINDOW_MGR_V_LAYER_CURSOR
+#define HS_LAYER_CURSOR         ICO_WINDOW_MGR_LAYERTYPE_CURSOR
                                             /* layer of Cursor   */
 
 #define HS_LAYER_2NDDISP_APP    3         // second display application layer
 #define ICO_HS_ANIMATION_DURATION   (400)
 
 #endif
-
index b8ccee1..6cf015c 100644 (file)
@@ -187,7 +187,7 @@ bool CicoSCAulItems::getPidCgroupInfo(int pid, string& m, string& c)
 }
 
 /**
- * @breif appid update
+ * @brief appid update
  */
 void CicoSCAulItems::update_appid()
 {
diff --git a/src/homescreen/CicoSCCommonDef.h b/src/homescreen/CicoSCCommonDef.h
new file mode 100644 (file)
index 0000000..5b019f5
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * 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
+ *
+ */
+
+//==========================================================================
+/**
+ *  @file   CicoSCCommonDef.h
+ *
+ *  @brief  This file is definition of common value
+ */
+//==========================================================================
+#ifndef __CICO_SC_COMMON_DEF_H__
+#define __CICO_SC_COMMON_DEF_H__
+
+//--------------------------------------------------------------------------
+//  definition of layer type
+//--------------------------------------------------------------------------
+#define ICO_LAYER_TYPE_BACKGROUND   (1) ///! layer type of background
+#define ICO_LAYER_TYPE_APPLICATION  (2) ///! layer type of application
+#define ICO_LAYER_TYPE_HOMESCREEN   (3) ///! layer type of homescreen
+#define ICO_LAYER_TYPE_INTERRPUTAPP (4) ///! layer type of homescreen
+#define ICO_LAYER_TYPE_ONSCREEN     (5) ///! layer type of homescreen
+#define ICO_LAYER_TYPE_INPUT        (101) ///! layer type of input panel(soft keyboard)
+#define ICO_LAYER_TYPE_TOUCH        (102) ///! layer type of touch panel input
+#define ICO_LAYER_TYPE_CURSOR       (103) ///! layer type of cursor
+
+//--------------------------------------------------------------------------
+//  range of zone id 
+//--------------------------------------------------------------------------
+// center display
+#define ICO_DISPLAY0_ZONEID_MIN       (1)   ///! display0 zone id min
+#define ICO_DISPLAY0_ZONEID_MAX       (20)  ///! display0 zone id max
+
+// second display
+#define ICO_DISPLAY1_ZONEID_MIN       (21)  ///! display1 zone id min
+#define ICO_DISPLAY1_ZONEID_MAX       (40)  ///! display1 zone id max
+
+#endif  // __CICO_SC_COMMON_DEF_H__
+// vim:set expandtab ts=4 sw=4:
index 7dc56a5..92af9e7 100644 (file)
@@ -22,6 +22,7 @@
 #include <sstream>
 
 #include <ico_log.h>
+#include "CicoSCCommonDef.h"
    
 //==========================================================================
 /**
@@ -153,7 +154,10 @@ class CicoSCDisplayZoneConf
 public:
     /// default constructor
     CicoSCDisplayZoneConf()
-        : id(-1), name(""), fullname(""), x(-1), y(-1), w(-1), h(-1) {}
+        : id(-1), name(""), fullname(""), x(-1), y(-1), w(-1), h(-1),
+          aspectFixed(false), aspectAlignLeft(false),
+          aspectAlignRight(false), aspectAlignTop(false),
+          aspectAlignBottom(false) {}
 
     /// destructor
     virtual ~CicoSCDisplayZoneConf() {}
@@ -161,23 +165,35 @@ public:
     /// dump log this class member variables
     void dumpConf(void)
     {
-        ICO_DBG("  zone: id=%d name=%s fullname=%s x=%d y=%d "
-                 "w=%d h=%d overlap=%s",
-                 id, name.c_str(), fullname.c_str(),
-                 x, y, w, h, overlapStr.c_str());
+        ICO_DBG("  zone: id=%d name=%s fullname=%s x/y=%d/%d "
+                "w/h=%d/%d aspect(fixed=%s l/r=%s/%s t/b=%s/%s",
+                id, name.c_str(), fullname.c_str(), x, y, w, h,
+                aspectFixed       ? "true" : "false",
+                aspectAlignLeft   ? "true" : "false",
+                aspectAlignRight  ? "true" : "false",
+                aspectAlignTop    ? "true" : "false",
+                aspectAlignBottom ? "true" : "false");
     }
 
 public:
-    int    id;              ///< display zone id
-    std::string name;       ///< display zone name
-    std::string fullname;   ///< display zone name
-    int    x;               ///< display zone x position
-    int    y;               ///< display zone y position
-    int    w;               ///< display zone width
-    int    h;               ///< display zone height
-    std::string overlapStr; ///< display overlap
-    std::vector<bool> overlap;  ///< display enable table
-
+    int               id;         ///< display zone id
+    std::string       name;       ///< display zone name
+    std::string       fullname;   ///< display zone fullname
+    int               x;          ///< display zone x position
+    int               y;          ///< display zone y position
+    int               w;          ///< display zone width
+    int               h;          ///< display zone height
+
+    /// fixed asppect ratio flag
+    bool aspectFixed;
+    /// horizontal direction to aligned at the left
+    bool aspectAlignLeft;   
+    /// horizontal direction to aligned at the right
+    bool aspectAlignRight;
+    /// vertical direction is aligned at the top
+    bool aspectAlignTop;
+    /// vertical direction is aligned at the bottom
+    bool aspectAlignBottom;
 };
 
 //==========================================================================
@@ -213,8 +229,12 @@ public:
     int         width;   ///< display width resolution
     int         height;  ///< display height resolution
     int         inch;    ///< display inch size
-    std::vector<CicoSCLayerConf*>        layerConfList;  // layer config list
-    std::vector<CicoSCDisplayZoneConf*>  zoneConfList;   // zone config list
+
+    // layer config list
+    std::vector<CicoSCLayerConf*> layerConfList;
+
+    // zone config list
+    std::vector<CicoSCDisplayZoneConf*> zoneConfList;
 };
 
 //==========================================================================
index e00f9ca..353eabc 100644 (file)
@@ -62,7 +62,7 @@ const char* DNull = "(null)";
  * @param pkg_name package name
  * @param key "start"/"end"/"install_percent"/"command" strings
  * @param val "ok"/"error"/"0.000000"-"100.000000" strings
- * @param pmsg pkgmgr message 
+ * @param pmsg pkgmgr message
  * @param data user data
  */
 static int CSCLCCpkgmgr_handler(int req_id, const char *pkg_type,
@@ -365,7 +365,6 @@ int CicoSCLifeCycleController::suspend(int pid)
  */
 bool CicoSCLifeCycleController::isRunning(const char* appid)
 {
-    ICO_TRA("start %s", appid);
     bool r = false;
 #if 0 // TODO mk_k
     vector<CicoSCAulItems>::iterator it = m_aul.begin();
@@ -382,14 +381,14 @@ bool CicoSCLifeCycleController::isRunning(const char* appid)
     int sz = m_aul.size();
     for (int i = 0; i < sz; i++) {
         m_aul[i].update_appid();
-        ICO_DBG("%s == %s", m_aul[i].m_appid.c_str(), appid);
+//      ICO_DBG("%s == %s", m_aul[i].m_appid.c_str(), appid);
         if (m_aul[i].m_appid == appid) {
             r = true;
             break;
         }
     }
 #endif
-    ICO_TRA("end %s", r? "true": "false");
+    ICO_TRA("CicoSCLifeCycleController::isRunning %s=%s", appid, r ? "true" : "false");
     return r;
 }
 
@@ -532,7 +531,7 @@ void CicoSCLifeCycleController::initAIL()
 /**
  * @brief
  */
-int CSCLCCpkgmgr_handlerX(int req_id, const char *pkg_type, const char *pkg_name, 
+int CSCLCCpkgmgr_handlerX(int req_id, const char *pkg_type, const char *pkg_name,
                          const char *key, const char *val, const void *pmsg,
                          CicoSCLifeCycleController* x)
 {
@@ -922,7 +921,7 @@ bool CicoSCLifeCycleController::removeAUL(int pid)
 }
 
 /**
- * @brief 
+ * @brief
  * @param x CicoSCLifeCycleController class pointer
  */
 int CSCLCCapp_launch_handlerX(int pid, CicoSCLifeCycleController* x)
@@ -941,7 +940,6 @@ int CSCLCCapp_launch_handlerX(int pid, CicoSCLifeCycleController* x)
     return 0;
 }
 
-
 /**
  * @brief applications die. callback function
  * @param pid
index 00e7c62..f23b912 100644 (file)
@@ -285,11 +285,9 @@ CicoSCSystemConfig::createDisplayConfList(const ptree & root)
         optional<string> name;
         optional<string> node;
         optional<int> no = optional<int>(-1);
-        optional<string> wayland;
         optional<string> type;
         optional<int> width = optional<int>(-1);
         optional<int> height = optional<int>(-1);
-        optional<int> inch = optional<int>(-1);
 
         id = child.second.get_optional<int>("<xmlattr>.id");
         if (false == id.is_initialized()) {
@@ -311,11 +309,6 @@ CicoSCSystemConfig::createDisplayConfList(const ptree & root)
             ICO_ERR("display.no element not found");
             continue;
         }
-        wayland = child.second.get_optional<string>("wayland");
-        if (false == wayland.is_initialized()) {
-            ICO_ERR("display.wayland element not found");
-            continue;
-        }
         type = child.second.get_optional<string>("type");
         if (false == type.is_initialized()) {
             ICO_ERR("display.type element not found");
@@ -331,11 +324,6 @@ CicoSCSystemConfig::createDisplayConfList(const ptree & root)
             ICO_ERR("display.height element not found");
             continue;
         }
-        inch = child.second.get_optional<int>("inch");
-        if (false == inch.is_initialized()) {
-            ICO_ERR("display.inch element not found");
-            continue;
-        }
 
         CicoSCDisplayConf* displayConf = new CicoSCDisplayConf();
         displayConf->id     = id.get();
@@ -345,19 +333,12 @@ CicoSCSystemConfig::createDisplayConfList(const ptree & root)
         displayConf->type   = m_displayTypeTable[type.get()];
         displayConf->width  = width.get();
         displayConf->height = height.get();
-        displayConf->inch   = inch.get();
 
         displayConf->dumpConf();
 
         createLayerConf(child, displayConf);
         createDisplayZoneConf(child, displayConf);
 
-        // TODO overlap to zoneid
-        vector<CicoSCDisplayZoneConf*>::iterator itr;
-        itr = displayConf->zoneConfList.begin();
-        for (; itr != displayConf->zoneConfList.end(); ++itr) {
-        }
-
         m_displayConfList.push_back(displayConf);
     }
 }
@@ -432,7 +413,11 @@ CicoSCSystemConfig::createDisplayZoneConf(const ptree::value_type & child,
         optional<string> y;
         optional<string> w;
         optional<string> h;
-        optional<string> overlap;
+        optional<bool>   fixed;
+        optional<bool>   l;
+        optional<bool>   r;
+        optional<bool>   t;
+        optional<bool>   b;
 
         id = zone.second.get_optional<int>("<xmlattr>.id");
         if (false == id.is_initialized()) {
@@ -464,10 +449,25 @@ CicoSCSystemConfig::createDisplayZoneConf(const ptree::value_type & child,
             ICO_WRN("zone.geometry.h attr not found");
             continue;
         }
-        overlap = zone.second.get_optional<string>("overlap");
-        if (false == overlap.is_initialized()) {
-            ICO_WRN("zone.overlap element not found");
-            overlap = optional<string>("");
+        fixed = zone.second.get_optional<bool>("aspect.<xmlattr>.Fixed");
+        if (false == fixed.is_initialized()) {
+            fixed = optional<bool>(false);
+        }
+        l = zone.second.get_optional<bool>("aspect.<xmlattr>.AlignLeft");
+        if (false == l.is_initialized()) {
+            l = optional<bool>(false);
+        }
+        r = zone.second.get_optional<bool>("aspect.<xmlattr>.AlignRight");
+        if (false == r.is_initialized()) {
+            r = optional<bool>(false);
+        }
+        t = zone.second.get_optional<bool>("aspect.<xmlattr>.AlignTop");
+        if (false == t.is_initialized()) {
+            t = optional<bool>(false);
+        }
+        b = zone.second.get_optional<bool>("aspect.<xmlattr>.AlignBottom");
+        if (false == b.is_initialized()) {
+            b = optional<bool>(false);
         }
 
         CicoSCDisplayZoneConf* zoneConf = new CicoSCDisplayZoneConf();
@@ -478,7 +478,11 @@ CicoSCSystemConfig::createDisplayZoneConf(const ptree::value_type & child,
         zoneConf->y          = calcGeometryExpr(y.get(), displayConf);
         zoneConf->w          = calcGeometryExpr(w.get(), displayConf);
         zoneConf->h          = calcGeometryExpr(h.get(), displayConf);
-        zoneConf->overlapStr = overlap.get();
+        zoneConf->aspectFixed       = fixed.get();
+        zoneConf->aspectAlignLeft   = l.get();
+        zoneConf->aspectAlignRight  = r.get();
+        zoneConf->aspectAlignTop    = t.get();
+        zoneConf->aspectAlignBottom = b.get();
         displayConf->zoneConfList.push_back(zoneConf);
 
         zoneConf->dumpConf();
@@ -1225,14 +1229,14 @@ const CicoSCDisplayZoneConf*
 CicoSCSystemConfig::findDisplayZoneConfbyName(const string & displayName,
                                               const string & zoneName)
 {
-    ICO_DBG("CicoSCSystemConfig::findDisplayZoneConfbyName Enter"
-            "(displayName=%s zoneNmae=%s)",
-            displayName.c_str(), zoneName.c_str());
+//    ICO_DBG("CicoSCSystemConfig::findDisplayZoneConfbyName Enter"
+//            "(displayName=%s zoneNmae=%s)",
+//            displayName.c_str(), zoneName.c_str());
 
     const CicoSCDisplayConf* displayConf = NULL;
     displayConf = findDisplayConfbyName(displayName);
     if (NULL == displayConf) {
-        ICO_DBG("CicoSCSystemConfig::findDisplayZoneConfbyName Leave(NULL)");
+//        ICO_DBG("CicoSCSystemConfig::findDisplayZoneConfbyName Leave(NULL)");
         return NULL;
     }
 
@@ -1242,13 +1246,13 @@ CicoSCSystemConfig::findDisplayZoneConfbyName(const string & displayName,
         const CicoSCDisplayZoneConf* conf = NULL;
         conf = const_cast<CicoSCDisplayZoneConf*>(*itr);
         if (zoneName == conf->name) {
-            ICO_DBG("CicoSCSystemConfig::findDisplayZoneConfbyName Leave"
-                    "(0x%08x)", conf);
+//            ICO_DBG("CicoSCSystemConfig::findDisplayZoneConfbyName Leave"
+//                    "(0x%08x)", conf);
             return conf;
         }
     }
 
-    ICO_DBG("CicoSCSystemConfig::findDisplayZoneConfbyName Leave(NULL)");
+//    ICO_DBG("CicoSCSystemConfig::findDisplayZoneConfbyName Leave(NULL)");
     return NULL;
 }
 
@@ -1286,9 +1290,9 @@ const CicoSCSoundZoneConf*
 CicoSCSystemConfig::findSoundZoneConfbyName(const string & soundName,
                                             const string & zoneName)
 {
-    ICO_DBG("CicoSCSystemConfig::findSoundZoneConfbyName Enter"
-            "(soundName=%s zoneNmae=%s)",
-            soundName.c_str(), zoneName.c_str());
+//    ICO_DBG("CicoSCSystemConfig::findSoundZoneConfbyName Enter"
+//            "(soundName=%s zoneNmae=%s)",
+//            soundName.c_str(), zoneName.c_str());
 
     const CicoSCSoundConf* soundConf = NULL;
     soundConf = findSoundConfbyName(soundName);
diff --git a/src/homescreen/CicoSound.cpp b/src/homescreen/CicoSound.cpp
new file mode 100644 (file)
index 0000000..4aa9343
--- /dev/null
@@ -0,0 +1,208 @@
+/*
+ * 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
+ *
+ */
+
+//==========================================================================
+/**
+ *  @file   CicoSound.h
+ *
+ *  @brief  This file is implimention of CicoSound class
+ */
+//==========================================================================
+#include <string>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "CicoHomeScreenCommon.h"
+#include "CicoHomeScreenResourceConfig.h"
+#include "CicoHomeScreenConfig.h"
+
+#include "CicoSound.h"
+
+
+CicoSound *CicoSound::m_myInstance = NULL;
+
+/*--------------------------------------------------------------------------*/
+/**
+ *  @brief  default constructor
+ */
+/*--------------------------------------------------------------------------*/
+CicoSound::CicoSound()
+    : m_initialized(false),
+      m_command(ICO_SOUND_DEFAULT_COMMAND),
+      m_operationSFile(ICO_SOUND_DEFAULT_OPERATION),
+      m_successSFile(ICO_SOUND_DEFAULT_SUCCESS),
+      m_failureSFile(ICO_SOUND_DEFAULT_FAILURE)
+{
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ *  @brief  destructor
+ */
+/*--------------------------------------------------------------------------*/
+CicoSound::~CicoSound()
+{
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ *  @brief  get instance
+ *
+ *  @return CicoSound instance
+ */
+/*--------------------------------------------------------------------------*/
+CicoSound *
+CicoSound::GetInstance(void)
+{
+    if (NULL == m_myInstance) {
+        m_myInstance = new CicoSound();
+    }
+
+    return m_myInstance;
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief   Initialize
+ *          initialize to sound a operation
+ *
+ * @param[in]   homescreen_config   configuration instance
+ * @return      result
+ * @retval      ICO_HS_OK           success
+ * @retval      ICO_HS_ERR          err
+ */
+//--------------------------------------------------------------------------
+int
+CicoSound::Initialize(CicoHomeScreenConfig *hsConfig)
+{
+    if (true == m_initialized) {
+        return ICO_HS_OK;
+    }
+
+    m_command = hsConfig->ConfigGetString(ICO_CONFIG_SOUND,
+                                          ICO_CONFIG_COMMAND,
+                                          ICO_SOUND_DEFAULT_COMMAND);
+
+    m_operationSFile = hsConfig->ConfigGetString(ICO_CONFIG_SOUND,
+                                                 ICO_CONFIG_OPERATION,
+                                                 ICO_SOUND_DEFAULT_OPERATION);
+
+    m_successSFile = hsConfig->ConfigGetString(ICO_CONFIG_SOUND,
+                                               ICO_CONFIG_SUCCESS,
+                                               ICO_SOUND_DEFAULT_SUCCESS);
+
+    m_failureSFile = hsConfig->ConfigGetString(ICO_CONFIG_SOUND,
+                                               ICO_CONFIG_FAILURE,
+                                               ICO_SOUND_DEFAULT_FAILURE);
+
+    ICO_DBG("CicoSound(command=%s operation=%s success=%s failure=%s",
+            m_command.c_str(), m_operationSFile.c_str(),
+            m_successSFile.c_str(), m_failureSFile.c_str())
+
+    m_initialized = true;
+
+    return ICO_HS_OK;
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   CicoSound::PlayOperationSound
+ *          play the given sound file(.wav).
+ *
+ * @return      result
+ * @retval      ICO_HS_OK           success
+ * @retval      ICO_HS_ERR          err
+ */
+/*--------------------------------------------------------------------------*/
+int
+CicoSound::PlayOperationSound(void)
+{
+    return PlaySound(m_operationSFile);
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   CicoSound::PlaySuccessSound
+ *
+ * @return      result
+ * @retval      ICO_HS_OK           success
+ * @retval      ICO_HS_ERR          err
+ */
+/*--------------------------------------------------------------------------*/
+int
+CicoSound::PlaySuccessSound(void)
+{
+    return PlaySound(m_successSFile);
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   CicoSound::PlaySuccessSound
+ *
+ * @return      result
+ * @retval      ICO_HS_OK           success
+ * @retval      ICO_HS_ERR          err
+ */
+/*--------------------------------------------------------------------------*/
+int
+CicoSound::PlayFailureSound(void)
+{
+    return PlaySound(m_failureSFile);
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief   CicoSound::PlaySound
+ *          play the given sound file(.wav).
+ *
+ * @return      result
+ * @retval      ICO_HS_OK           success
+ * @retval      ICO_HS_ERR          err
+ */
+/*--------------------------------------------------------------------------*/
+int
+CicoSound::PlaySound(std::string & soundFile)
+{
+    int pid;
+    char command[ICO_HS_TEMP_BUF_SIZE];
+    if (false == m_initialized) {
+        return ICO_HS_ERR;
+    }
+
+    if (true == m_operationSFile.empty()) {
+        ICO_WRN("CicoSound::PlaySound: Leave(error file name is empty)");
+        return ICO_HS_ERR;
+    }
+
+    if (m_operationSFile.at(0) != '/') {
+        ICO_WRN("CicoSound::PlaySound: Leave(file name not absolute path");
+        return ICO_HS_ERR;
+    }
+
+    /* given by full file path */
+    snprintf(command, sizeof(command), "%s %s",
+             m_command.c_str(), soundFile.c_str());
+
+    ICO_DBG("PlaySound:system(%s)", command);
+    pid = fork();
+    if (!pid) {
+        system(command);
+        exit(0);
+    }
+
+    return ICO_HS_OK;
+}
+// vim: set expandtab ts=4 sw=4:
diff --git a/src/homescreen/CicoSound.h b/src/homescreen/CicoSound.h
new file mode 100644 (file)
index 0000000..98c5bb7
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * 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
+ *
+ */
+
+//==========================================================================
+/**
+ *  @file   CicoSound.h
+ *
+ *  @brief  This file is definition of CicoSound class
+ */
+//==========================================================================
+#ifndef __CICO_SOUND_H__
+#define __CICO_SOUND_H__
+
+#include <string>
+
+#define ICO_CONFIG_SOUND            "sound"
+#define ICO_CONFIG_COMMAND          "command"
+#define ICO_CONFIG_OPERATION        "operation"
+#define ICO_CONFIG_SUCCESS          "success"
+#define ICO_CONFIG_FAILURE          "failure"
+
+#define ICO_SOUND_DEFAULT_COMMAND   "paplay --stream-name=HOMESCREEN_BEEP"
+#define ICO_SOUND_DEFAULT_OPERATION "/usr/apps/org.tizen.ico.homescreen/res/sound/operation.wav"
+#define ICO_SOUND_DEFAULT_SUCCESS   "/usr/apps/org.tizen.ico.homescreen/res/sound/success.wav"
+#define ICO_SOUND_DEFAULT_FAILURE   "/usr/apps/org.tizen.ico.homescreen/res/sound/failure.wav"
+
+//--------------------------------------------------------------------------
+/**
+ *  @brief  sound of operation function
+ */
+//--------------------------------------------------------------------------
+class CicoSound
+{
+public:
+    // get singleton instance
+    static CicoSound* GetInstance(void);
+
+    // initialized
+    int Initialize(CicoHomeScreenConfig *hs_config);
+
+    // play sound
+    int PlaySound(std::string & soundFile);
+
+    // play opreration sound
+    int PlayOperationSound(void);
+
+    // play success sound
+    int PlaySuccessSound(void);
+
+    // play failure sound
+    int PlayFailureSound(void);
+
+protected:
+    // default constructor
+    CicoSound();
+
+    // destructor
+    ~CicoSound();
+
+    // assignment operator
+    CicoSound operator=(const CicoSound&);
+
+    // copy constructor
+    CicoSound(const CicoSound&);
+
+private:
+    // my instance
+    static CicoSound *m_myInstance;
+
+    // initialiezed flag
+    bool m_initialized;
+
+    // play sound command
+    std::string m_command;
+
+    // operation sound file
+    std::string m_operationSFile;
+
+    // success sound file
+    std::string m_successSFile;
+
+    // failure sound file
+    std::string m_failureSFile;
+};
+#endif  //__CICO_SOUND_H__
+// vim: set expandtab ts=4 sw=4:
index aefbceb..0486b36 100644 (file)
@@ -29,11 +29,12 @@ HomeScreen_SOURCES = \
        CicoHomeScreenSound.cpp \
        CicoHomeScreenSoundConfig.cpp   \
        CicoHSSystemState.cpp   \
-       CicoHSFlickTouch.cpp    \
-       CicoHSFlickInputWindow.cpp \
+       CicoHSSwipeTouch.cpp    \
+       CicoHSSwipeInputWindow.cpp \
        CicoHSAppHistory.cpp    \
        CicoHSAppHistoryExt.cpp \
-       Cico_aul_listen_app.cpp
+       Cico_aul_listen_app.cpp \
+       CicoSound.cpp
 
 HomeScreen_CFLAGS= \
     $(EFL_CFLAGS) \
@@ -67,7 +68,8 @@ HomeScreen_LDADD = \
     -lico-util \
     -lico-uxf-weston-plugin \
     /usr/lib/libpkgmgr-client.so \
-       ../../lib/apps-framework/.libs/libico-appfw.so
+       ../../lib/apps-framework/.libs/libico-appfw.so \
+       -lwayland-egl -lEGL -lGLESv2
 
 #OnScreen_SOURCES = \
 #      on_screen.cpp        \
@@ -132,6 +134,7 @@ install-exec-hook:
        mkdir -p $(INSTALL_ROOT)/usr/apps/org.tizen.ico.homescreen/var
        mkdir -p $(INSTALL_ROOT)/usr/apps/org.tizen.ico.homescreen/res/config
        mkdir -p $(INSTALL_ROOT)/usr/apps/org.tizen.ico.homescreen/res/images
+       mkdir -p $(INSTALL_ROOT)/usr/apps/org.tizen.ico.homescreen/res/sound
        mkdir -p $(INSTALL_ROOT)/usr/apps/org.tizen.ico.homescreen/res/edj
        mkdir -p $(INSTALL_ROOT)/usr/share/packages
        install -m 0755 HomeScreen $(INSTALL_ROOT)/usr/apps/org.tizen.ico.homescreen/bin
@@ -156,6 +159,7 @@ install-exec-hook:
        install -m 0644 $(top_srcdir)/res/org.tizen.ico.homescreen/res/images/tizen_32.png $(INSTALL_ROOT)/usr/apps/org.tizen.ico.homescreen/res/images
        install -m 0644 $(top_srcdir)/data/share/packages/org.tizen.ico.homescreen.xml $(INSTALL_ROOT)/usr/share/packages
        install -m 0644 $(top_srcdir)/res/org.tizen.ico.homescreen/res/config/* $(INSTALL_ROOT)/usr/apps/org.tizen.ico.homescreen/res/config
+       install -m 0644 $(top_srcdir)/res/org.tizen.ico.homescreen/res/sound/* $(INSTALL_ROOT)/usr/apps/org.tizen.ico.homescreen/res/sound
        cp -r $(top_srcdir)/data/apps/org.tizen.ico.homescreen $(INSTALL_ROOT)/usr/apps/
 
 uninstall:
index b9ec27c..70bfc5f 100644 (file)
@@ -27,6 +27,7 @@
 #include "CicoSCSystemConfig.h"
 #include "Cico_aul_listen_app.h"
 #include "CicoHomeScreen.h"
+#include "CicoSound.h"
 
 using namespace std;
 
@@ -120,6 +121,8 @@ main(int argc, char *argv[])
     sound->Initialize(config);
     ICO_DBG("main: sound initialize end");
 
+    CicoSound::GetInstance()->Initialize(config);
+
     /*AUL Listen Signal set(launch/dead)*/
     initAulListenXSignal();
 
@@ -127,7 +130,7 @@ main(int argc, char *argv[])
     ICO_DBG("main: homescreen initialize start");
     CicoHomeScreen *home_screen = new CicoHomeScreen();
 
-    ret = home_screen->Initialize(ICO_ORIENTATION_VERTICAL,config);
+    ret = home_screen->Initialize(ICO_ORIENTATION_VERTICAL, config);
     if(ret != ICO_OK){
         ICO_ERR("main: homescreen initialize failed");
         /*clear all classes*/
index e19d6a3..9b8d81b 100644 (file)
@@ -30,6 +30,7 @@
 #include "CicoSCLifeCycleController.h"
 #include "CicoSCUserManager.h"
 #include "CicoSCResourceManager.h"
+#include "Cico_aul_listen_app.h"
 
 /**
  *  Default Constructor
@@ -58,6 +59,8 @@ CicoSysConDaemon::onCreate(void *user_data)
         int ret = ICO_SYC_EOK;
         CicoSCSystemConfig::getInstance()->load("/usr/apps/org.tizen.ico.system-controller/res/config/system.xml");
 
+        initAulListenXSignal();
+
         CicoSCLifeCycleController *lifecycle =
             CicoSCLifeCycleController::getInstance();
         CicoSCWindowController *winctrl     = new CicoSCWindowController();
index 73c7040..bf32ac9 100644 (file)
@@ -26,6 +26,7 @@ IcoSysconDaemon_CPPFLAGS =    \
        @MURPHYDOMAINCONTROLLER_CFLAGS@         \
        @MURPHYECORE_CFLAGS@                            \
        @MURPHYRESOURCE_CFLAGS@                         \
+       @EDBUS_CFLAGS@                                          \
        $(UWS_CFLAGS)                                           \
        $(WESTONPLUGIN_CFLAGS)                          \
        -I../../include                                         \
@@ -49,6 +50,7 @@ IcoSysconDaemon_LDADD = \
        @MURPHYDOMAINCONTROLLER_LIBS@   \
        @MURPHYECORE_LIBS@                              \
        @MURPHYRESOURCE_LIBS@                   \
+       @EDBUS_LIBS@                                    \
        $(UWS_LIBS)                                             \
        $(WESTONPLUGIN_LIBS)                    \
        ../../lib/misc/state-machine/.libs/libico-state-machine.so
index f2de2c2..15b5b67 100644 (file)
@@ -126,6 +126,9 @@ main(int argc, char *argv[])
     }
     else    {
         /* change login user        */
+        if (strcasecmp(newuser, "logoff") == 0) {
+            strcpy(newuser, " ");
+        }
         (void)ico_syc_change_user(newuser, "\0");
     }
 
index 91224b6..79f0f0e 100755 (executable)
@@ -1,7 +1,9 @@
 #!/bin/sh
 killall ico_dic-gtforce 2> /dev/null
 killall ico-vic-carsim 2> /dev/null
+killall weekeyboard 2> /dev/null
 killall weston 2> /dev/null
+killall pulseaudio 2> /dev/null
 killall IcoSysconDaemon 2> /dev/null
 killall MeterApp 2> /dev/null
 
@@ -14,13 +16,24 @@ killall ODBQpKvkS1.Settings 2> /dev/null
 killall ico-app-samplepkgins 2> /dev/null
 killall ico-app-vicsample 2> /dev/null
 killall ico-app-soundsample 2> /dev/null
+killall net.zmap.navi 2> /dev/null
+killall WebProcess 2> /dev/null
+killall WebProcess 2> /dev/null
+PIDS=`/usr/bin/ps ax | /usr/bin/fgrep -v fgrep | /usr/bin/fgrep wrt_launchpad_daemon_candidate | /usr/bin/fgrep /usr/bin | /usr/bin/cut -c1-6`
+if [ "$PIDS" != "" ] ; then
+       /usr/bin/kill -9 $PIDS 2> /dev/null
+fi
+
+killall  2> /dev/null
 
 sleep 1
 
 killall -9 HomeScreen 2> /dev/null
 killall -9 IcoSysconDaemon 2> /dev/null
 killall -9 MeterApp 2> /dev/null
+killall -9 weekeyboard 2> /dev/null
 killall -9 weston 2> /dev/null
+killall -9 pulseaudio 2> /dev/null
 killall -9 ico_dic-gtforce 2> /dev/null
 killall -9 ico-vic-carsim 2> /dev/null
 
@@ -44,6 +57,7 @@ killall -9 ODBQpKvkS1.Settings 2> /dev/null
 killall -9 ico-app-samplepkgins 2> /dev/null
 killall -9 ico-app-soundsample 2> /dev/null
 killall -9 ico-app-vicsample 2> /dev/null
+killall -9 net.zmap.navi 2> /dev/null
 
 killall -9 WebProcess 2> /dev/null
 killall -9 WebProcess 2> /dev/null
@@ -55,3 +69,4 @@ killall -9 WebProcess 2> /dev/null
 kill -9 `ps ax | grep wrt_launchpad_daemon_candidate | grep -v grep | cut -c1-6` 2> /dev/null
 killall -9 WebProcess 2> /dev/null
 kill -9 `ps ax | grep wrt_launchpad_daemon_candidate | grep -v grep | cut -c1-6` 2> /dev/null
+systemctl restart murphyd.service
index 76cdb55..85b8910 100755 (executable)
@@ -58,4 +58,7 @@ stamp-h1 \
 ./tests/system-controller/system-controller/Makefile.in \
 ./tests/system-controller/test-dummy-hs/.deps \
 ./tests/system-controller/test-dummy-hs/Makefile \
-./tests/system-controller/test-dummy-hs/Makefile.in
+./tests/system-controller/test-dummy-hs/Makefile.in \
+./tool/.deps \
+./tool/Makefile \
+./tool/Makefile.in
index de48d59..1dc755a 100755 (executable)
@@ -27,7 +27,7 @@ echo "export XDG_RUNTIME_DIR=/run/user/5000" > /etc/profile.d/start_syscond.sh
 /usr/bin/sleep 0.3
 
 # 5. Start System Controller
-/usr/bin/launch_app org.tizen.ico.system-controller &
+/usr/apps/org.tizen.ico.system-controller/bin/IcoSysconDaemon &
 
 # 6. End of shell
 /usr/bin/sleep 2