From: Ryota Okubi Date: Wed, 19 Nov 2014 01:54:36 +0000 (+0900) Subject: bug fix: TC-1152 X-Git-Tag: accepted/tizen/ivi/20141205.050907~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F78%2F30478%2F2;p=profile%2Fivi%2Fico-uxf-homescreen.git bug fix: TC-1152 compliant with multi-user architecture (except ICO-SystemController) Change-Id: I68105169a42c94f40fdeceae29c584f739d9d4b6 Bug-Tizen: TC-1152 Signed-off-by: Ryota Okubi --- diff --git a/include/ico_syc_private.h b/include/ico_syc_private.h index e58d67f..8bc7c6e 100644 --- a/include/ico_syc_private.h +++ b/include/ico_syc_private.h @@ -37,6 +37,28 @@ extern "C" { #define ICO_SYC_MAX_LEN 128 +/* + * package name + */ +#define ICO_SYC_PACKAGE_SYSTEMCONTROLLER "org.tizen.ico.system-controller" +#define ICO_SYC_PACKAGE_HOMESCREEN "org.tizen.ico.homescreen" +#define ICO_SYC_PACKAGE_STATUSBAR "org.tizen.ico.statusbar" +#define ICO_SYC_PACKAGE_ONSCREEN "org.tizen.ico.onscreen" +#define ICO_SYC_PACKAGE_LOGIN "org.tizen.ico.login" +#define ICO_SYC_PACKAGE_DIALER "org.tizen.dialer" + +/* + * configuration file path + */ +#define ICO_SYC_CONFIGPATH_HOME "ico" +#define ICO_SYC_CONFIGPATH_HOME_CONFIG ICO_SYC_CONFIGPATH_HOME "/config" +#define ICO_SYC_CONFIGPATH_HOME_IMAGE ICO_SYC_CONFIGPATH_HOME "/images" +#define ICO_SYC_CONFIGPATH_HOME_SOUND ICO_SYC_CONFIGPATH_HOME "/sound" +#define ICO_SYC_CONFIGPATH_PACKAGE "res" +#define ICO_SYC_CONFIGPATH_PACKAGE_CONFIG ICO_SYC_CONFIGPATH_PACKAGE "/config" +#define ICO_SYC_CONFIGPATH_PACKAGE_IMAGE ICO_SYC_CONFIGPATH_PACKAGE "/images" +#define ICO_SYC_CONFIGPATH_PACKAGE_SOUND ICO_SYC_CONFIGPATH_PACKAGE "/sound" + /*============================================================================*/ /* variable & table */ /*============================================================================*/ @@ -265,6 +287,15 @@ void ico_syc_cb_region(ico_syc_callback_t callback, void *user_data, /*============================================================================*/ +/* NodeId <-> DisplayId macro */ +/*============================================================================*/ +#define ICO_SYC_ECUBASE 100 +#define ICO_SYC_DISPLAYID(nodeid) (nodeid % ICO_SYC_ECUBASE) +#define ICO_SYC_ECUID(nodeid) (nodeid / ICO_SYC_ECUBASE) +#define ICO_SYC_NODEID(ecuid, displayid) (ecuid * ICO_SYC_ECUBASE + \ + (displayid % ICO_SYC_ECUBASE)) + +/*============================================================================*/ /* log macro */ /*============================================================================*/ #ifndef _NO_USE_DLOG diff --git a/lib/common/CicoConf.h b/lib/common/CicoConf.h index 8df71f0..94c8cfa 100644 --- a/lib/common/CicoConf.h +++ b/lib/common/CicoConf.h @@ -584,7 +584,7 @@ class CicoSCUserConf { public: /// default constructor - CicoSCUserConf() :m_parent_dir("/home/app/ico") {} + CicoSCUserConf() :m_parent_dir("") {} /// destructor ~CicoSCUserConf() {} diff --git a/lib/common/CicoGKeyFileConfig.cpp b/lib/common/CicoGKeyFileConfig.cpp index c522c8b..4b38e4d 100644 --- a/lib/common/CicoGKeyFileConfig.cpp +++ b/lib/common/CicoGKeyFileConfig.cpp @@ -16,6 +16,8 @@ //========================================================================== #include +#include +#include #include "CicoGKeyFileConfig.h" #include "CicoResourceConfig.h" @@ -51,17 +53,17 @@ CicoGKeyFileConfig::~CicoGKeyFileConfig() * @brief CicoGKeyFileConfig::Initialize * read and initialize for homescreen configuration * - * @param[in] conf configuration file name + * @param[in] conf configuration file name or path + * @param[in] pkgname package name for default config file * @return result * @retval true success * @retval false error */ //-------------------------------------------------------------------------- bool -CicoGKeyFileConfig::Initialize(const char *conf) +CicoGKeyFileConfig::Initialize(const char *conf, const char *pkgname) { GError *error = NULL; - char path[ICO_TEMP_BUF_SIZE]; GString *filepath; if (NULL != m_gKeyFile) { @@ -70,34 +72,66 @@ CicoGKeyFileConfig::Initialize(const char *conf) } m_gKeyFile = g_key_file_new(); - - filepath = g_string_new("test"); - CicoResourceConfig::GetConfPath(path, sizeof(path)); - g_string_printf(filepath, "%s/%s", path, conf); - if (!g_file_test(filepath->str, G_FILE_TEST_IS_REGULAR)) { - return false; + filepath = g_string_new("xx"); + + // if absolute path, fix file path + if (*conf == '/') { + g_string_assign(filepath, conf); + if (! g_file_test(filepath->str, G_FILE_TEST_IS_REGULAR)) { + g_string_free(filepath, TRUE); + return false; + } + } + else { + // search user dir ($HOME/ico/config) + const char *userpath = tzplatform_mkpath3(TZ_USER_HOME, + ICO_SYC_CONFIGPATH_HOME_CONFIG, conf); + if (g_file_test(userpath, G_FILE_TEST_IS_REGULAR)) { + // exist user config file + g_string_assign(filepath, userpath); + } + else { + if (! pkgname) { + pkgname = getenv("PKG_NAME"); + if (! pkgname) { + g_string_free(filepath, TRUE); + return false; + } + } + // search package dir ($TZ_SYS_RO_APP/pkgname/res/config) + const char *pkgpath = tzplatform_mkpath4(TZ_SYS_RO_APP, pkgname, + ICO_SYC_CONFIGPATH_PACKAGE_CONFIG, + conf); + if (g_file_test(pkgpath, G_FILE_TEST_IS_REGULAR)) { + // exist package config file + g_string_assign(filepath, pkgpath); + } + else { + g_string_free(filepath, TRUE); + return false; + } + } } // load config file + ICO_DBG("CicoGKeyFileConfig::Initialize load config file<%s>", filepath->str); g_key_file_load_from_file(m_gKeyFile, filepath->str, (GKeyFileFlags)(G_KEY_FILE_KEEP_COMMENTS | - G_KEY_FILE_KEEP_TRANSLATIONS), - &error); + G_KEY_FILE_KEEP_TRANSLATIONS), &error); + g_string_free(filepath, TRUE); + if (error != NULL) { ICO_WRN("%s: %s", filepath->str, error->message); g_error_free(error); return false; } - - g_string_free(filepath, TRUE); - return true; } /*--------------------------------------------------------------------------*/ /** * @brief CicoGKeyFileConfig::ConfigGetInteger - * Return integer value in homescreen configuration file. + * Return integer value in homescreen configuration file. * If not exist,return defaultvlaue in params. * * @param[in] group_name configuration group name @@ -127,7 +161,7 @@ CicoGKeyFileConfig::ConfigGetInteger(const char *group_name, const char *key, in /*--------------------------------------------------------------------------*/ /** * @brief CicoGKeyFileConfig::ConfigGetString - * Return string value in homescreen configuration file. + * Return string value in homescreen configuration file. * If not exist,return defaultvlaue in params. * * @param[in] group_name configuration group name @@ -149,10 +183,65 @@ CicoGKeyFileConfig::ConfigGetString(const char *group_name, const char *key, const char *value = g_key_file_get_string(m_gKeyFile, group_name, key, &error); if (error != NULL) { - ICO_WRN("%s", error->message); + ICO_WRN("%s:%s> %s", group_name, key, error->message); g_error_free(error); return default_value; } return value; } + +/*--------------------------------------------------------------------------*/ +/** + * @brief CicoGKeyFileConfig::ConfigGetFilePath + * Return string value of homescreen configuration file path. + * If not exist, return default vlaue in params. + * + * @param[in] group_name configuration group name + * @param[in] key configuration name + * @param[in] subdir $HOME sub directory + * @param[in] confdir package configuration sub directory + * @param[in] default_path default file path + * @return config file path + */ +/*--------------------------------------------------------------------------*/ +const char * +CicoGKeyFileConfig::ConfigGetFilePath(const char *group_name, const char *key, + const char *subdir, const char *confdir, + const char *default_path) +{ + GError *error = NULL; + + if (m_gKeyFile != NULL) { + const char *value = g_key_file_get_string(m_gKeyFile, group_name, key, &error); + if (error == NULL) { + if (*value == '/') { + // absolute path + return value; + } + + // check user home directory + const char *homepath = tzplatform_mkpath3(TZ_USER_HOME, subdir, value); + if (g_file_test(homepath, G_FILE_TEST_IS_REGULAR)) { + return homepath; + } + + // check default config path + const char *confpath = tzplatform_mkpath3(TZ_SYS_RO_APP, confdir, value); + if (g_file_test(confpath, G_FILE_TEST_IS_REGULAR)) { + return confpath; + } + } + else { + ICO_WRN("%s", error->message); + g_error_free(error); + } + } + if (! default_path) { + return NULL; + } + if (*default_path == '/') { + return default_path; + } + return tzplatform_mkpath(TZ_SYS_RO_APP, default_path); +} // vim:set expandtab ts=4 sw=4: diff --git a/lib/common/CicoGKeyFileConfig.h b/lib/common/CicoGKeyFileConfig.h index 66f344b..031a88a 100644 --- a/lib/common/CicoGKeyFileConfig.h +++ b/lib/common/CicoGKeyFileConfig.h @@ -30,7 +30,7 @@ //-------------------------------------------------------------------------- /** - * @brief + * @brief */ //-------------------------------------------------------------------------- class CicoGKeyFileConfig @@ -43,10 +43,10 @@ public: ~CicoGKeyFileConfig(); // intialize - bool Initialize(const char *conf); + bool Initialize(const char *conf, const char *pkgname = NULL); // get integer value - int ConfigGetInteger(const char *group_name, + int ConfigGetInteger(const char *group_name, const char *key, int default_value); @@ -54,6 +54,11 @@ public: const char* ConfigGetString(const char *group_name, const char *key, const char *default_value); + const char* ConfigGetFilePath(const char *group_name, + const char *key, + const char *subdir, + const char *confdir, + const char *default_path); private: // assignment operator diff --git a/lib/common/CicoResourceConfig.cpp b/lib/common/CicoResourceConfig.cpp index a9dea3b..10a1785 100644 --- a/lib/common/CicoResourceConfig.cpp +++ b/lib/common/CicoResourceConfig.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include "CicoResourceConfig.h" @@ -40,7 +41,7 @@ CicoResourceConfig::GetImagePath(char *buff, int len) memset(buff, 0, len); pkg = getenv("PKG_NAME"); if (pkg) { - snprintf(buff, len, ICO_IMAGE_PATH, pkg); + snprintf(buff, len, ICO_IMAGE_PATH, tzplatform_getenv(TZ_SYS_RO_APP), pkg); } else { pkg = getenv(ICO_HS_CONFIG_TOP_ENV); @@ -68,7 +69,7 @@ CicoResourceConfig::GetSoundPath(char *buff, int len) memset(buff, 0, len); pkg = getenv("PKG_NAME"); if (pkg) { - snprintf(buff, len, ICO_SOUND_PATH, pkg); + snprintf(buff, len, ICO_SOUND_PATH, tzplatform_getenv(TZ_SYS_RO_APP), pkg); } else { pkg = getenv(ICO_HS_CONFIG_TOP_ENV); @@ -95,7 +96,7 @@ CicoResourceConfig::GetEdjPath(char *buff, int len) memset(buff, 0, len); pkg = getenv("PKG_NAME"); if (pkg) { - snprintf(buff, len, ICO_EDJ_PATH, pkg); + snprintf(buff, len, ICO_EDJ_PATH, tzplatform_getenv(TZ_SYS_RO_APP), pkg); } else { pkg = getenv(ICO_HS_CONFIG_TOP_ENV); @@ -122,7 +123,8 @@ CicoResourceConfig::GetConfPath(char *buff, int len) memset(buff, 0, len); pkg = getenv("PKG_NAME"); if (pkg) { - snprintf(buff, len, ICO_MANIFEST_PATH, pkg); + snprintf(buff, len, ICO_MANIFEST_PATH, + tzplatform_getenv(TZ_SYS_RO_APP), pkg); } else { pkg = getenv(ICO_HS_CONFIG_TOP_ENV); diff --git a/lib/common/CicoResourceConfig.h b/lib/common/CicoResourceConfig.h index 8318275..d4d0163 100644 --- a/lib/common/CicoResourceConfig.h +++ b/lib/common/CicoResourceConfig.h @@ -14,42 +14,20 @@ * @date Feb-15-2013 */ -//#include -//#include -//#include +#include "ico_syc_private.h" -//#include "CicoHomeScreenCommon.h" -//#include "home_screen_res.h" - -#define ICO_EDJ_PATH "/usr/apps/%s/res/edj/" -#define ICO_IMAGE_PATH "/usr/apps/%s/res/images/" -#define ICO_SOUND_PATH "/usr/apps/%s/res/sounds/" -#define ICO_MANIFEST_PATH "/usr/apps/%s/res/config/" +#define ICO_EDJ_PATH "%s/%s/res/edj/" +#define ICO_IMAGE_PATH "%s/%s/res/images/" +#define ICO_SOUND_PATH "%s/%s/res/sounds/" +#define ICO_MANIFEST_PATH "%s/%s/res/config/" #define ICO_LOCAL_TOP_PATH "/home/tizen/HomeScreen" #define ICO_LOCAL_EDJ_PATH "%s/src/" #define ICO_LOCAL_IMAGE_PATH "%s/res/images/" #define ICO_LOCAL_SOUND_PATH "%s/res/sounds/" -#define ICO_LOCAL_MANIFEST_PATH "%s/res/apps/org.tizen.ico.homescreen/" +#define ICO_LOCAL_MANIFEST_PATH "%s/res/apps/" ICO_SYC_PACKAGE_HOMESCREEN "/" /* Environment variable for UI-FW top directory */ #define ICO_HS_CONFIG_TOP_ENV "UIFW_TOPDIR" -#if 0 -/* Default top directory of UI-FW */ -#define ICO_HS_CONFIG_TOP_TOPDIR "/usr/apps/org.tizen.ico.homescreen" -/* Environment variable for top directory of cconfiguration files */ -#define ICO_HS_CONFIG_CONFIG_ENV "UIFW_CONFDIR" -/* Default top directory of cconfiguration files */ -#define ICO_HS_CONFIG_CONFIG_DIR "res/config" -/* Configuration file names */ -#define ICO_HS_CONFIG_CONFIG_SYSTEM "system.conf" -#define ICO_HS_CONFIG_CONFIG_APPATTR "app_attr.conf" -/* Directory of application manifest */ -#define ICO_HS_CONFIG_CONFIG_APPSDIR "apps" -/* Maximum length of the configuration directory name */ -#define ICO_HS_CONFIG_CONF_DIR_MAX 63 -/* Maximum length of Wayland connection name */ -#define ICO_UXF_CONF_WAYLAND_NAME 39 -#endif /*============================================================================*/ /* Class Declaration (CicoResourceConfig) */ diff --git a/lib/common/CicoSound.cpp b/lib/common/CicoSound.cpp index b7241e1..894df56 100644 --- a/lib/common/CicoSound.cpp +++ b/lib/common/CicoSound.cpp @@ -38,9 +38,9 @@ CicoSound *CicoSound::m_myInstance = NULL; 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) + m_operationSFile(""), + m_successSFile(""), + m_failureSFile("") { } @@ -66,7 +66,6 @@ CicoSound::GetInstance(void) if (NULL == m_myInstance) { m_myInstance = new CicoSound(); } - return m_myInstance; } @@ -92,17 +91,26 @@ CicoSound::Initialize(CicoGKeyFileConfig *hsConfig) 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); + m_operationSFile = hsConfig->ConfigGetFilePath( + ICO_CONFIG_SOUND, ICO_CONFIG_OPERATION, + ICO_SYC_CONFIGPATH_HOME_SOUND, + ICO_SYC_PACKAGE_HOMESCREEN + "/" ICO_SYC_CONFIGPATH_PACKAGE_SOUND, + ICO_SOUND_DEFAULT_OPERATION); + + m_successSFile = hsConfig->ConfigGetFilePath( + ICO_CONFIG_SOUND, ICO_CONFIG_SUCCESS, + ICO_SYC_CONFIGPATH_HOME_SOUND, + ICO_SYC_PACKAGE_HOMESCREEN + "/" ICO_SYC_CONFIGPATH_PACKAGE_SOUND, + ICO_SOUND_DEFAULT_SUCCESS); + + m_failureSFile = hsConfig->ConfigGetFilePath( + ICO_CONFIG_SOUND, ICO_CONFIG_FAILURE, + ICO_SYC_CONFIGPATH_HOME_SOUND, + ICO_SYC_PACKAGE_HOMESCREEN + "/" ICO_SYC_CONFIGPATH_PACKAGE_SOUND, + ICO_SOUND_DEFAULT_FAILURE); ICO_DBG("CicoSound(command=%s operation=%s success=%s failure=%s", m_command.c_str(), m_operationSFile.c_str(), @@ -174,7 +182,7 @@ CicoSound::PlaySound(std::string & soundFile) { int pid; char command[256]; - + if (false == m_initialized) { return false; } diff --git a/lib/common/CicoSound.h b/lib/common/CicoSound.h index 547ee91..8c6746c 100644 --- a/lib/common/CicoSound.h +++ b/lib/common/CicoSound.h @@ -18,6 +18,7 @@ #define __CICO_SOUND_H__ #include +#include "ico_syc_private.h" #define ICO_CONFIG_SOUND "sound" #define ICO_CONFIG_COMMAND "command" @@ -26,9 +27,9 @@ #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" +#define ICO_SOUND_DEFAULT_OPERATION ICO_SYC_PACKAGE_HOMESCREEN "/res/sound/operation.wav" +#define ICO_SOUND_DEFAULT_SUCCESS ICO_SYC_PACKAGE_HOMESCREEN "/res/sound/success.wav" +#define ICO_SOUND_DEFAULT_FAILURE ICO_SYC_PACKAGE_HOMESCREEN "/res/sound/failure.wav" //-------------------------------------------------------------------------- /** diff --git a/lib/common/CicoSystemConfig.cpp b/lib/common/CicoSystemConfig.cpp index 7da8c63..48bd077 100644 --- a/lib/common/CicoSystemConfig.cpp +++ b/lib/common/CicoSystemConfig.cpp @@ -20,9 +20,12 @@ #include #include #include +#include +#include "ico_syc_private.h" #include "CicoSystemConfig.h" #include "CicoConf.h" +#include "CicoGKeyFileConfig.h" using namespace boost::property_tree; //========================================================================== @@ -1003,28 +1006,24 @@ CicoSystemConfig::createDefaultConf(const ptree & root) m_defaultConf->inputsw = getSwitchIdbyName(inputdev.get(), inputsw.get()); -//TODO -#define ICO_SYC_TOP_EVN (char*)"SYSCON_TOPDIR" -#define ICO_SYC_TOP_DIR (char*)"/usr/apps/org.tizen.ico.system-controller" +#define ICO_SYC_TOP_EVN "SYSCON_TOPDIR" /* decide top directory in all configurations */ - char *topdir = getenv(ICO_SYC_TOP_EVN); + const char *topdir = getenv(ICO_SYC_TOP_EVN); if (NULL == topdir) { - topdir = ICO_SYC_TOP_DIR; + topdir = tzplatform_mkpath(TZ_SYS_RO_APP, ICO_SYC_PACKAGE_SYSTEMCONTROLLER); } m_defaultConf->topdir = topdir; -//TODO -#define ICO_SYC_CONFIG_ENV (char*)"SYSCON_CONFDIR" -#define ICO_SYC_CONFIG_DIR (char*)"res/config" +#define ICO_SYC_CONFIG_ENV "SYSCON_CONFDIR" /* decide top directory in configuration file's */ - char *confdir = getenv(ICO_SYC_CONFIG_ENV); + const char *confdir = getenv(ICO_SYC_CONFIG_ENV); if (NULL != confdir) { m_defaultConf->confdir = confdir; } else { m_defaultConf->confdir = m_defaultConf->topdir; m_defaultConf->confdir.append("/"); - m_defaultConf->confdir.append(ICO_SYC_CONFIG_DIR); + m_defaultConf->confdir.append(ICO_SYC_CONFIGPATH_PACKAGE_CONFIG); } m_defaultConf->dumpConf(); @@ -1276,10 +1275,13 @@ CicoSystemConfig::createUserConf(const ptree & root) optional opts = rc.get_optional("parent_dir"); if (true == opts.is_initialized()) { string v = opts.get(); - if (v.empty()) { - m_userConf->m_parent_dir = v; + if (! v.empty()) { + m_userConf->m_parent_dir = tzplatform_mkpath(TZ_USER_HOME, v.c_str()); } } + if (m_userConf->m_parent_dir.empty()) { + m_userConf->m_parent_dir = tzplatform_mkpath(TZ_USER_HOME, ICO_SYC_CONFIGPATH_HOME); + } m_userConf->dumpConf(); } diff --git a/packaging/ico-uxf-homescreen.spec b/packaging/ico-uxf-homescreen.spec index 59c240c..412224e 100644 --- a/packaging/ico-uxf-homescreen.spec +++ b/packaging/ico-uxf-homescreen.spec @@ -138,8 +138,8 @@ ail_initdb %{_datadir}/icons/default/small/org.tizen.ico.homescreen.png %{_datadir}/icons/default/small/org.tizen.ico.statusbar.png %{_datadir}/icons/default/small/org.tizen.ico.onscreen.png -# retain the system control configuration inside homescreen at least for now -/usr/apps/org.tizen.ico.system-controller/res/config +# retain the system control configuration inside homescreen at least for now +%{TZ_SYS_RW_APP}/org.tizen.ico.system-controller/res/config %files system-controller-devel %defattr(-,root,root,-) diff --git a/res/org.tizen.ico.homescreen/res/config/homescreen.conf b/res/org.tizen.ico.homescreen/res/config/homescreen.conf index 6fd691c..b8be0f6 100644 --- a/res/org.tizen.ico.homescreen/res/config/homescreen.conf +++ b/res/org.tizen.ico.homescreen/res/config/homescreen.conf @@ -12,14 +12,18 @@ # -- onscreen # OnScreen application id # -- background -# picture : picture as background -# transparent: see under runing APP window -# +# HomeScreen background picture file path +# -- menu +# HomeScreen menu background +# picture file name: picture as menu background +# transparent: see under runing APP window #--------------------------------------------------------------------------- [homescreen] statusbar=org.tizen.ico.statusbar onscreen=org.tizen.ico.onscreen -background=picture +background=Home_default.jpg +menu=bg_bk.png +#menu=transparent #--------------------------------------------------------------------------- # HomeScreen application log setting @@ -47,7 +51,7 @@ background=picture filename=HomeScreen loglevel=all logflush=on -ecorelog=on +ecorelog=off #--------------------------------------------------------------------------- # HomeScreen operation sound setting @@ -64,9 +68,9 @@ ecorelog=on #--------------------------------------------------------------------------- [sound] command=paplay --device=0 --volume=30000 --stream-name=HOMESCREEN_BEEP -operation=/usr/apps/org.tizen.ico.homescreen/res/sound/operation.wav -success=/usr/apps/org.tizen.ico.homescreen/res/sound/success.wav -failure=/usr/apps/org.tizen.ico.homescreen/res/sound/failure.wav +operation=operation.wav +success=success.wav +failure=failure.wav #--------------------------------------------------------------------------- # HomeScreen application history setting diff --git a/res/org.tizen.ico.system-controller/res/config/system.xml b/res/org.tizen.ico.system-controller/res/config/system.xml index ee597a4..526edf2 100644 --- a/res/org.tizen.ico.system-controller/res/config/system.xml +++ b/res/org.tizen.ico.system-controller/res/config/system.xml @@ -1,7 +1,7 @@ @@ -397,7 +397,7 @@ none - /home/app/ico + ico diff --git a/src/homescreen/CicoHSBackWindow.cpp b/src/homescreen/CicoHSBackWindow.cpp index d1ac207..2250a1a 100644 --- a/src/homescreen/CicoHSBackWindow.cpp +++ b/src/homescreen/CicoHSBackWindow.cpp @@ -11,6 +11,7 @@ * * @date Aug-08-2013 */ +#include #include "CicoHSBackWindow.h" #include "CicoResourceConfig.h" @@ -60,18 +61,17 @@ CicoHSBackWindow::~CicoHSBackWindow(void) * @return OK or ERRROR */ /*--------------------------------------------------------------------------*/ -int +int CicoHSBackWindow::CreateBackWindow(int pos_x,int pos_y,int width,int height) { int ret; - char img_path[ICO_HS_MAX_PATH_BUFF_LEN]; /*create window*/ - ret = CreateWindow(ICO_HS_BACK_WINDOW_TITLE,pos_x,pos_y,width,height,EINA_TRUE); + ret = CreateWindow(ICO_HS_BACK_WINDOW_TITLE, pos_x, pos_y, width, height, EINA_TRUE); if(ret != ICO_OK){ return ret; } - + /* evas get */ evas = ecore_evas_get(window); if (!evas) { @@ -79,13 +79,36 @@ CicoHSBackWindow::CreateBackWindow(int pos_x,int pos_y,int width,int height) return ICO_ERROR; } - /* set back */ - /* image file name*/ - snprintf(img_path,sizeof(img_path),ICO_HS_BACK_WINDOW_IMAGE_FILE_PATH); - + /* get configuration */ + CicoGKeyFileConfig config; + config.Initialize(ICO_HOMESCREEN_CONFIG_FILE, ICO_SYC_PACKAGE_HOMESCREEN); + + const char *back_image = config.ConfigGetFilePath( + "homescreen", "background", + ICO_SYC_CONFIGPATH_HOME_IMAGE, + ICO_SYC_PACKAGE_HOMESCREEN + "/" ICO_SYC_CONFIGPATH_PACKAGE_IMAGE, + NULL); + if (! back_image) { + // if image file dos not exist, search system imahe files + const char *back_file = config.ConfigGetString( + "homescreen", "background", + ICO_HS_DEFAULT_BACK_WINDOW_IMAGE_FILE_FILE); + back_image = tzplatform_mkpath3(TZ_SYS_DATA, + ICO_HS_DEFAULT_BACK_WINDOW_IMAGE_FILE_DIR, + back_file); + if (access(back_image, R_OK) != 0) { + // not exist, set default back image file + back_image = tzplatform_mkpath3(TZ_SYS_DATA, + ICO_HS_DEFAULT_BACK_WINDOW_IMAGE_FILE_DIR, + ICO_HS_DEFAULT_BACK_WINDOW_IMAGE_FILE_FILE); + } + } + ICO_DBG("CicoHSBackWindow::CreateBackWindow: background(%s)", back_image); + /* set object*/ canvas = evas_object_image_filled_add(evas); - evas_object_image_file_set(canvas, img_path, NULL); + evas_object_image_file_set(canvas, back_image, NULL); int err = evas_object_image_load_error_get(canvas); if (err != EVAS_LOAD_ERROR_NONE) { ICO_ERR("CicoHSBackWindow::CreateBackWindow: backgound image is not exist"); @@ -112,7 +135,7 @@ CicoHSBackWindow::CreateBackWindow(int pos_x,int pos_y,int width,int height) void CicoHSBackWindow::FreeBackWindow(void) { - evas_object_del(canvas); + evas_object_del(canvas); FreeWindow(); } // vim: set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHSControlBarWindow.cpp b/src/homescreen/CicoHSControlBarWindow.cpp index 127e8f0..6646c5e 100644 --- a/src/homescreen/CicoHSControlBarWindow.cpp +++ b/src/homescreen/CicoHSControlBarWindow.cpp @@ -38,7 +38,8 @@ CicoHSControlBarWindow::CicoHSControlBarWindow(void) CicoResourceConfig::GetImagePath(img_dir_path, ICO_HS_MAX_PATH_BUFF_LEN); CicoGKeyFileConfig config; - config.Initialize(ICO_HOMESCREEN_CONFIG_FILE); + config.Initialize(ICO_HOMESCREEN_CONFIG_FILE, ICO_SYC_PACKAGE_HOMESCREEN); + const char *value = config.ConfigGetString("switchzone", "keyname", "m"); if (strlen(value) > (sizeof(changeZoneKeyName) - 1)) { ICO_WRN("[switchzone] keyname is strlen overflow. use default keyname(m)"); @@ -121,20 +122,20 @@ CicoHSControlBarWindow::~CicoHSControlBarWindow(void) * @return OK or ERRROR */ /*--------------------------------------------------------------------------*/ -int +int CicoHSControlBarWindow::CreateControlBarWindow(int pos_x, int pos_y, int width, int height) { int ret; char img_path[ICO_HS_MAX_PATH_BUFF_LEN]; - + /*create window*/ ret = CreateWindow(ICO_HS_CONTROL_BAR_WINDOW_TITLE, pos_x, pos_y, width, height, EINA_TRUE); if(ret != ICO_OK){ return ret; } - + /* get evas */ evas = ecore_evas_get(window); if (!evas) { @@ -147,11 +148,11 @@ CicoHSControlBarWindow::CreateControlBarWindow(int pos_x, int pos_y, background = evas_object_rectangle_add(evas); // add callback functions - evas_object_event_callback_add(background, EVAS_CALLBACK_KEY_DOWN, + evas_object_event_callback_add(background, EVAS_CALLBACK_KEY_DOWN, CicoHSControlBarWindow::evasKeyDownCB, this); // key grab - evas_object_focus_set(background, EINA_FALSE); + evas_object_focus_set(background, EINA_FALSE); Eina_Bool eret = evas_object_key_grab(background, (const char*)changeZoneKeyName, 0, 0, EINA_TRUE); if (EINA_FALSE == eret) { @@ -204,7 +205,7 @@ CicoHSControlBarWindow::CreateControlBarWindow(int pos_x, int pos_y, ICO_HS_IMAGE_FILE_CONTROL_BAR_BUTTON_NIHGT2); evas_object_image_file_set(menu_btn, img_path, NULL); - // load fisrt show icon image + // load fisrt show icon image snprintf(img_path,sizeof(img_path),"%s%s",img_dir_path, ICO_HS_IMAGE_FILE_CONTROL_BAR_BUTTON_DAY); evas_object_image_file_set(menu_btn, img_path, NULL); @@ -212,7 +213,7 @@ CicoHSControlBarWindow::CreateControlBarWindow(int pos_x, int pos_y, evas_object_move(menu_btn, (width/2) - (ICO_HS_CONTROL_BAR_MENU_BTN_WIDTH /2), ICO_HS_CONTROL_BAR_MENU_BTN_START_POS_Y); - evas_object_resize(menu_btn, ICO_HS_CONTROL_BAR_MENU_BTN_WIDTH, + evas_object_resize(menu_btn, ICO_HS_CONTROL_BAR_MENU_BTN_WIDTH, ICO_HS_CONTROL_BAR_MENU_BTN_HEIGHT); evas_object_event_callback_add(menu_btn, EVAS_CALLBACK_MOUSE_DOWN, CicoHSControlBarTouch::TouchDownControlBar, @@ -220,11 +221,11 @@ CicoHSControlBarWindow::CreateControlBarWindow(int pos_x, int pos_y, evas_object_event_callback_add(menu_btn, EVAS_CALLBACK_MOUSE_UP, CicoHSControlBarTouch::TouchUpControlBar, NULL); - evas_object_show(menu_btn); + evas_object_show(menu_btn); /* shortcut */ AddShortcut(evas, width); - + return ICO_OK; } @@ -337,7 +338,7 @@ CicoHSControlBarWindow::FreeControlBarWindow(void) * @return none */ /*--------------------------------------------------------------------------*/ -void +void CicoHSControlBarWindow::TouchHome(void) { ActivationUpdate(); @@ -347,7 +348,6 @@ CicoHSControlBarWindow::TouchHome(void) else { CicoSound::GetInstance()->PlayOperationSound(); } - CicoHomeScreen::ChangeMode(ICO_HS_SHOW_HIDE_PATTERN_SLIDE); } @@ -546,10 +546,10 @@ CicoHSControlBarWindow::onKeyDown(void *data, Evas *evas, TouchHome(); } else if (0 == strcmp(evinfo->keyname, backKeyName)) { - // TODO not assinded funciton + // TODO not assinded funciton } else if (0 == strcmp(evinfo->keyname, menuKeyName)) { - // TODO not assinded funciton + // TODO not assinded funciton } } diff --git a/src/homescreen/CicoHSEFLApp.cpp b/src/homescreen/CicoHSEFLApp.cpp index 120f517..86278c4 100644 --- a/src/homescreen/CicoHSEFLApp.cpp +++ b/src/homescreen/CicoHSEFLApp.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include "CicoHSEFLApp.h" #include "CicoHomeScreen.h" @@ -64,8 +65,8 @@ CicoHSEFLApp::onCreate(void *user_data) try { // load system config CicoSystemConfig::getInstance()->load( - ICO_HS_LIFECYCLE_CONTROLLER_SETTING_PATH); - + tzplatform_mkpath(TZ_SYS_RO_APP, + ICO_HS_LIFECYCLE_CONTROLLER_SETTING_PATH)); // start homescreen m_homescreen = new CicoHomeScreen(); int ret = m_homescreen->StartHomeScreen(ICO_ORIENTATION_VERTICAL); diff --git a/src/homescreen/CicoHSMenuTile.cpp b/src/homescreen/CicoHSMenuTile.cpp index 0f0d125..34ce03a 100644 --- a/src/homescreen/CicoHSMenuTile.cpp +++ b/src/homescreen/CicoHSMenuTile.cpp @@ -18,6 +18,7 @@ #include #include #include +#include /*============================================================================*/ /* functions */ @@ -50,7 +51,9 @@ CicoHSMenuTile::CicoHSMenuTile(const char *appid, 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, + strncpy(this->icon_image_path, + tzplatform_mkpath(TZ_SYS_RO_APP, + ICO_HS_MENUTILE_DEFAULT_ICON_PATH), ICO_HS_MAX_PATH_BUFF_LEN); } ICO_DBG("CicoHSMenuTile::CicoHSMenuTile:image_path %s:%s", @@ -133,7 +136,9 @@ CicoHSMenuTile::CreateObject(Evas *evas) /*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_image_file_set(term_icon, + tzplatform_mkpath(TZ_SYS_RO_APP, + 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); @@ -794,7 +799,7 @@ CicoHSMenuTile::SetThumbnail(ico_syc_thumb_info_t *info) } } else { - ICO_ERR("CicoHSMenuTile::SetThumbnail: can not open pixel file(%s)", + ICO_DBG("CicoHSMenuTile::SetThumbnail: can not open pixel file(%s)", sWork); } if (fd >= 0) { diff --git a/src/homescreen/CicoHSMenuTile.h b/src/homescreen/CicoHSMenuTile.h index e3dbb06..8b08eb6 100644 --- a/src/homescreen/CicoHSMenuTile.h +++ b/src/homescreen/CicoHSMenuTile.h @@ -26,6 +26,7 @@ #include "ico_syc_common.h" #include "ico_syc_winctl.h" +#include "ico_syc_private.h" #include "CicoHomeScreenCommon.h" @@ -70,8 +71,8 @@ #define ICO_HS_MENUTILE_START_POS_X 80 #define ICO_HS_MENUTILE_START_POS_Y 210 -#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_PATH ICO_SYC_PACKAGE_HOMESCREEN "/res/images/termIcon.png" +#define ICO_HS_MENUTILE_DEFAULT_ICON_PATH ICO_SYC_PACKAGE_HOMESCREEN "/res/images/tizen_32.png" #define ICO_HS_MENUTILE_TERM_ICON_WIDTH 64 #define ICO_HS_MENUTILE_TERM_ICON_HEIGHT 64 diff --git a/src/homescreen/CicoHSMenuWindow.cpp b/src/homescreen/CicoHSMenuWindow.cpp index 62b1f7b..808d69c 100644 --- a/src/homescreen/CicoHSMenuWindow.cpp +++ b/src/homescreen/CicoHSMenuWindow.cpp @@ -17,6 +17,8 @@ #include "CicoHomeScreen.h" #include "CicoHSSystemState.h" #include +#include +#include /*============================================================================*/ /* static members */ @@ -39,16 +41,25 @@ int CicoHSMenuWindow::menu_tile_height = 290; /*--------------------------------------------------------------------------*/ CicoHSMenuWindow::CicoHSMenuWindow(void) { - CicoGKeyFileConfig config; - config.Initialize(ICO_HOMESCREEN_CONFIG_FILE); - const char *value = config.ConfigGetString("homescreen", "background", "picture"); - transparent_background = false; - if (strcmp(value, "picture") != 0) - transparent_background = true; - /*initialzie values*/ terminate_mode = false; + /*get menu background image*/ + CicoGKeyFileConfig config; + config.Initialize(ICO_HOMESCREEN_CONFIG_FILE, ICO_SYC_PACKAGE_HOMESCREEN); + + transparent_background = true; + const char *menu_back = config.ConfigGetFilePath("homescreen", "menu", + ICO_SYC_CONFIGPATH_HOME_IMAGE, + ICO_SYC_PACKAGE_HOMESCREEN + "/" ICO_SYC_CONFIGPATH_PACKAGE_IMAGE, + NULL); + if (menu_back) { + strncpy(menu_img_path, menu_back, sizeof(menu_img_path)-1); + menu_img_path[sizeof(menu_img_path)-1] = 0; + transparent_background = false; + } + InitAppTiles(); evas = NULL; @@ -99,14 +110,12 @@ CicoHSMenuWindow::~CicoHSMenuWindow(void) int CicoHSMenuWindow::SetMenuBack(void) { - char img_path[ICO_HS_MAX_PATH_BUFF_LEN]; /* set menu back */ - /* set object*/ if (transparent_background) { /* image file name*/ - snprintf(img_path, sizeof(img_path), "%s%s", - img_dir_path, ICO_HS_IMAGE_FILE_MENU_BACK_GROUND_BLANK); + snprintf(menu_img_path, sizeof(menu_img_path), "%s%s", + img_dir_path, ICO_HS_IMAGE_FILE_MENU_BACK_GROUND); rectangle = evas_object_rectangle_add(evas); if (true == CicoHSSystemState::getInstance()->getNightMode()) { @@ -118,16 +127,15 @@ CicoHSMenuWindow::SetMenuBack(void) evas_object_move(rectangle, 0, 0); evas_object_resize(rectangle, width, height); evas_object_show(rectangle); - } else - snprintf(img_path, sizeof(img_path), "%s%s", - img_dir_path, ICO_HS_IMAGE_FILE_MENU_BACK_GROUND_PICTURE); + } /* set object*/ canvas = evas_object_image_filled_add(evas); - evas_object_image_file_set(canvas, img_path, NULL); + evas_object_image_file_set(canvas, menu_img_path, NULL); int err = evas_object_image_load_error_get(canvas); if (err != EVAS_LOAD_ERROR_NONE) { - ICO_ERR("CicoHSMenuWindow::SetMenuBack: backgound image is not exist"); + ICO_ERR("CicoHSMenuWindow::SetMenuBack: backgound image(%s) is not exist", + menu_img_path); ICO_TRA("CicoHSMenuWindow::SetMenuBack Leave(ERR)"); evas_object_del(canvas); return ICO_ERROR; @@ -313,7 +321,15 @@ CicoHSMenuWindow::SetAppTiles(void) life_cycle_controller->getAilList(); /* get category infomation */ - GetCategory(ICO_HS_MENU_CATEGORY_FILE_PATH, category, &category_num); + const char *category_path = tzplatform_mkpath3(TZ_USER_HOME, + ICO_SYC_CONFIGPATH_HOME_CONFIG, + ICO_HS_MENU_CATEGORY_FILE_NAME); + ICO_DBG("CicoHSMenuWindow::SetAppTiles category_path(%s)", category_path); + if (access(category_path, R_OK) != 0) { + category_path = tzplatform_mkpath(TZ_SYS_RO_APP, + ICO_HS_DEFAULT_MENU_CATEGORY_FILE_PATH); + } + GetCategory(category_path, category, &category_num); ICO_DBG("CicoHSMenuWindow::SetAppTiles :category_num %d", category_num); for (int ii = 0; ii < category_num ; ii++) { diff --git a/src/homescreen/CicoHSMenuWindow.h b/src/homescreen/CicoHSMenuWindow.h index ea96deb..830440e 100644 --- a/src/homescreen/CicoHSMenuWindow.h +++ b/src/homescreen/CicoHSMenuWindow.h @@ -159,6 +159,8 @@ class CicoHSMenuWindow :public CicoHSWindow int all_page_num; /* image directory path */ char img_dir_path[ICO_HS_MAX_PATH_BUFF_LEN]; + /* menu background picture path */ + char menu_img_path[ICO_HS_MAX_PATH_BUFF_LEN]; /* evas object */ Evas *evas; /* menu back */ diff --git a/src/homescreen/CicoHomeScreen.cpp b/src/homescreen/CicoHomeScreen.cpp index a7dedff..4de972a 100644 --- a/src/homescreen/CicoHomeScreen.cpp +++ b/src/homescreen/CicoHomeScreen.cpp @@ -655,19 +655,19 @@ 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_DBG("CicoHomeScreen::ShowHomeScreenWindow: id(%s) name(%s) surface(%08x) " + "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)) { + ico_syc_hide(win_info->appid, win_info->surface, NULL); return; } - ico_syc_show(win_info->appid, win_info->surface,NULL); + ico_syc_show(win_info->appid, win_info->surface, NULL); } /*--------------------------------------------------------------------------*/ @@ -1183,6 +1183,7 @@ int CicoHomeScreen::StartRelations(void) { int ret; + strncpy(sb_package_name, config->ConfigGetString(ICO_HS_CONFIG_HOMESCREEN, ICO_HS_CONFIG_SB, @@ -1193,15 +1194,13 @@ CicoHomeScreen::StartRelations(void) ICO_HS_CONFIG_ONS, ICO_HS_APPID_DEFAULT_ONS), ICO_HS_MAX_PROCESS_NAME); -// TODO -#if 1 /* ToDo */ + /* 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); ret = sb_app_info->Execute(); @@ -1231,7 +1230,7 @@ CicoHomeScreen::Initialize(int orientation, CicoGKeyFileConfig *config) /*config copy*/ this->config = new CicoGKeyFileConfig(); - this->config->Initialize(ICO_HOMESCREEN_CONFIG_FILE); + this->config->Initialize(ICO_HOMESCREEN_CONFIG_FILE, ICO_SYC_PACKAGE_HOMESCREEN); /*Get application info*/ CreateAppInfoList(); @@ -1669,7 +1668,7 @@ CicoHomeScreen::StartHomeScreen(int orientation) /*config copy*/ this->config = new CicoGKeyFileConfig(); - this->config->Initialize(ICO_HOMESCREEN_CONFIG_FILE); + this->config->Initialize(ICO_HOMESCREEN_CONFIG_FILE, ICO_SYC_PACKAGE_HOMESCREEN); /* init home screen soud */ CicoSound::GetInstance()->Initialize(this->config); diff --git a/src/homescreen/CicoHomeScreen.h b/src/homescreen/CicoHomeScreen.h index 32fc1c7..b10ab7d 100644 --- a/src/homescreen/CicoHomeScreen.h +++ b/src/homescreen/CicoHomeScreen.h @@ -21,6 +21,7 @@ #include "ico_syc_common.h" #include "ico_syc_winctl.h" +#include "ico_syc_private.h" #include @@ -61,8 +62,8 @@ #define ICO_HS_CONFIG_SOUND "sound" #define ICO_HS_CONFIG_SB "statusbar" #define ICO_HS_CONFIG_ONS "onscreen" -#define ICO_HS_APPID_DEFAULT_SB "org.tizen.ico.statusbar" /* default statusbar appid */ -#define ICO_HS_APPID_DEFAULT_ONS "org.tizen.ico.onscreen" /* default on screen appid */ +#define ICO_HS_APPID_DEFAULT_SB ICO_SYC_PACKAGE_STATUSBAR /* default statusbar appid */ +#define ICO_HS_APPID_DEFAULT_ONS ICO_SYC_PACKAGE_ONSCREEN /* default on screen appid */ #define ICO_HS_GROUP_SPECIAL "menu" diff --git a/src/homescreen/CicoHomeScreenCommon.h b/src/homescreen/CicoHomeScreenCommon.h index 53f2bf1..6a6bfd5 100644 --- a/src/homescreen/CicoHomeScreenCommon.h +++ b/src/homescreen/CicoHomeScreenCommon.h @@ -17,6 +17,7 @@ #include #include #include "ico_syc_sysdef.h" +#include "ico_syc_private.h" #define ICO_OK 0 #define ICO_ERROR -1 @@ -36,11 +37,11 @@ #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 ICO_SYC_PACKAGE_HOMESCREEN /*app name*/ -#define ICO_HS_APPID_DEFAULT_SB "org.tizen.ico.statusbar" -#define ICO_HS_APPID_DEFAULT_ONS "org.tizen.ico.onscreen" +#define ICO_HS_APPID_DEFAULT_SB ICO_SYC_PACKAGE_STATUSBAR +#define ICO_HS_APPID_DEFAULT_ONS ICO_SYC_PACKAGE_ONSCREEN /* path name max length */ #define ICO_HS_MAX_PATH_BUFF_LEN 256 @@ -57,21 +58,19 @@ #define ICO_HS_CONTROL_BAR_WINDOW_TITLE "ico_hs_controlbarwindow" #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" - /* max number of category in menu*/ #define ICO_HS_MENU_MAX_MENU_CATEGORY_NUM 64 /*path of category file*/ -#define ICO_HS_MENU_CATEGORY_FILE_PATH "/usr/apps/org.tizen.ico.homescreen/res/config/menu_categoryid.conf" +#define ICO_HS_MENU_CATEGORY_FILE_NAME "menu_categoryid.conf" +#define ICO_HS_DEFAULT_MENU_CATEGORY_FILE_PATH ICO_SYC_PACKAGE_HOMESCREEN "/" ICO_SYC_CONFIGPATH_PACKAGE_CONFIG "/" ICO_HS_MENU_CATEGORY_FILE_NAME -/*path of back window*/ -#define ICO_HS_BACK_WINDOW_IMAGE_FILE_PATH "/opt/usr/media/Images/Home_default.jpg" +/*path of default back window*/ +#define ICO_HS_DEFAULT_BACK_WINDOW_IMAGE_FILE_DIR "data-media/Images" +#define ICO_HS_DEFAULT_BACK_WINDOW_IMAGE_FILE_FILE "Home_default.jpg" /*name of image file (in config image directry)*/ -#define ICO_HS_IMAGE_FILE_MENU_BACK_GROUND_BLANK "bg.png" -#define ICO_HS_IMAGE_FILE_MENU_BACK_GROUND_PICTURE "bg_bk.png" +#define ICO_HS_IMAGE_FILE_MENU_BACK_GROUND "bg.png" #define ICO_HS_IMAGE_FILE_MENU_PAGEPOINTER_P "pagePointer_p.png" #define ICO_HS_IMAGE_FILE_MENU_PAGEPOINTER_N "pagePointer_n.png" @@ -88,7 +87,7 @@ #define ICO_HS_IMAGE_FILE_CONTROL_BAR_BUTTON_NIHGT "applist_on.png" #define ICO_HS_IMAGE_FILE_CONTROL_BAR_BUTTON_NIHGT2 "applist_on_2.png" -#define ICO_HS_LIFECYCLE_CONTROLLER_SETTING_PATH "/usr/apps/org.tizen.ico.system-controller/res/config/system.xml" +#define ICO_HS_LIFECYCLE_CONTROLLER_SETTING_PATH ICO_SYC_PACKAGE_SYSTEMCONTROLLER "/res/config/system.xml" /*config name*/ #define ICO_HS_CONFIG_HOMESCREEN "homescreen" @@ -116,9 +115,9 @@ #define ICO_HS_CONFIG_HSTRY_KEY1 "timer" #define ICO_HS_CONFIG_HSTRY_DEF1 "1" #define ICO_HS_CONFIG_HSTRY_KEY2 "manage_off_app" -#define ICO_HS_CONFIG_HSTRY_DEF2 "org.tizen.ico.homescreen;org.tizen.ico.statusbar" +#define ICO_HS_CONFIG_HSTRY_DEF2 ICO_SYC_PACKAGE_HOMESCREEN ":" ICO_SYC_PACKAGE_STATUSBAR #define ICO_HS_CONFIG_HSTRY_KEY3 "write_off_app" -#define ICO_HS_CONFIG_HSTRY_DEF3 "org.tizen.ico.login" +#define ICO_HS_CONFIG_HSTRY_DEF3 ICO_SYC_PACKAGE_LOGIN #define ICO_HS_CONFIG_HSTRY_SPL ';' #define ICO_HS_ANIMATION_SLIDE "Slide" diff --git a/src/onscreen/CicoOSClient.cpp b/src/onscreen/CicoOSClient.cpp index a623fe8..9fa4eaf 100644 --- a/src/onscreen/CicoOSClient.cpp +++ b/src/onscreen/CicoOSClient.cpp @@ -22,8 +22,8 @@ #include #include #include -#include -#include +#include +#include using namespace boost::property_tree; using namespace std; @@ -34,9 +34,9 @@ using namespace std; #include "ico_syc_error.h" #include "ico_syc_msg_cmd_def.h" -//========================================================================== +//========================================================================== // private static variable -//========================================================================== +//========================================================================== CicoOSClient* CicoOSClient::ms_myInstance = NULL; //-------------------------------------------------------------------------- @@ -165,11 +165,7 @@ CicoOSClient::sendLaunchMessage(const string& op_app) ptree pt; pt.put("command", MSG_CMD_WIN_CHANGE); -#if 0 - pt.put("source.appid", "org.tizen.onscreen"); -#else pt.put("source.pid", (int)getpid()); -#endif pt.put("source.seq_no", getSeqNum()); updateSeqNum(); pt.put("arg.appid", op_app); diff --git a/src/onscreen/CicoOSPopWindow.cpp b/src/onscreen/CicoOSPopWindow.cpp index 6fc7919..1d0ccf8 100644 --- a/src/onscreen/CicoOSPopWindow.cpp +++ b/src/onscreen/CicoOSPopWindow.cpp @@ -14,10 +14,12 @@ #include #include #include +#include #include "CicoOnScreen.h" #include "CicoNotification.h" #include "CicoOSPopWindow.h" #include "ico_syc_type.h" +#include "ico_syc_private.h" #include "ico_syc_appresctl.h" #include "CicoOSClient.h" @@ -290,7 +292,9 @@ CicoOSPopWindow::InitializeWindow(void) ICO_TRA("Leave(ERR)"); return false; } - if (! edje_object_file_set(m_theme, ICO_OS_THEMES_EDJ_FILEPATH, "main")) { + if (! edje_object_file_set(m_theme, + tzplatform_mkpath(TZ_SYS_RO_APP, + ICO_OS_THEMES_EDJ_FILEPATH), "main")) { Edje_Load_Error err = edje_object_load_error_get(m_theme); const char *errmsg = edje_load_error_str(err); ICO_ERR("could not load 'main' from onscreen.edj: %s", errmsg); @@ -410,7 +414,7 @@ CicoOSPopWindow::makeResWindowT(ico_syc_res_window_t& w) w.layout = id00611_layout; w.area = id006111_area; w.dispatchApp = (char*)GetPkgname(); - if (0 == strcmp(w.dispatchApp,"org.tizen.dialer")) { + if (0 == strcmp(w.dispatchApp, ICO_SYC_PACKAGE_DIALER)) { w.role = role_incoming; } else { diff --git a/src/onscreen/CicoOSPopWindow.h b/src/onscreen/CicoOSPopWindow.h index 087828a..99445f2 100644 --- a/src/onscreen/CicoOSPopWindow.h +++ b/src/onscreen/CicoOSPopWindow.h @@ -68,7 +68,8 @@ #define FALSE 0 #define TRUE 1 -#define ICO_OS_THEMES_EDJ_FILEPATH "/usr/apps/org.tizen.ico.onscreen/res/themes/onscreen.edj" +#define ICO_OS_THEMES_EDJ_FILEPATH ICO_SYC_PACKAGE_ONSCREEN "/res/themes/onscreen.edj" + /*============================================================================*/ /* Define data types */ /*============================================================================*/ diff --git a/src/statusbar/CicoComponentImplementation.cpp b/src/statusbar/CicoComponentImplementation.cpp index 574504c..8ee598d 100644 --- a/src/statusbar/CicoComponentImplementation.cpp +++ b/src/statusbar/CicoComponentImplementation.cpp @@ -20,33 +20,35 @@ #include #include #include +#include #include +#include "ico_syc_private.h" #include "CicoComponentImplementation.h" /* define of path */ -#define IMG_DIR "/usr/apps/org.tizen.ico.statusbar/res/images/" -#define THEME_PATH "/usr/apps/org.tizen.ico.statusbar/res/themes/statusbar.edj" +#define IMG_DIR ICO_SYC_PACKAGE_STATUSBAR "/res/images" +#define THEME_PATH ICO_SYC_PACKAGE_STATUSBAR "/res/themes/statusbar.edj" /* Theme group name */ -#define THEME_CLOCK_NAME "ClockImage" +#define THEME_CLOCK_NAME "ClockImage" #define THEME_NOTIFICATION_NAME "Notification" // set image file path of clock static const char *clock_image_path[] = { - IMG_DIR"time_0.png", - IMG_DIR"time_1.png", - IMG_DIR"time_2.png", - IMG_DIR"time_3.png", - IMG_DIR"time_4.png", - IMG_DIR"time_5.png", - IMG_DIR"time_6.png", - IMG_DIR"time_7.png", - IMG_DIR"time_8.png", - IMG_DIR"time_9.png", - IMG_DIR"time_am.png", - IMG_DIR"time_pm.png", - IMG_DIR"time_ten.png", + "time_0.png", + "time_1.png", + "time_2.png", + "time_3.png", + "time_4.png", + "time_5.png", + "time_6.png", + "time_7.png", + "time_8.png", + "time_9.png", + "time_am.png", + "time_pm.png", + "time_ten.png", NULL }; @@ -113,7 +115,10 @@ CicoStatusBarClockComponent::Initialize(Evas_Object *windowobj, Evas *evas) /* make TimeImage object */ evasobj_=edje_object_add(evas); - if (!edje_object_file_set(evasobj_, THEME_PATH, THEME_CLOCK_NAME )) { + char wrk_path[256]; + snprintf(wrk_path, sizeof(wrk_path), "%s/" THEME_PATH, + tzplatform_getenv(TZ_SYS_RO_APP)); + if (!edje_object_file_set(evasobj_, wrk_path, THEME_CLOCK_NAME )) { Edje_Load_Error err = edje_object_load_error_get(evasobj_); const char *errmsg = edje_load_error_str(err); ICO_ERR("could not load 'main' from statusbar.edj: %s", @@ -200,10 +205,13 @@ CicoStatusBarClockComponent::Update() evasobj_,clock_image_object[i] ); if ( obj != NULL ) { ICO_DBG("CicoStatusBarClockComponent image set[%s][%s]", - clock_image_object[i],clock_image_path[now_clock_image[i]]); - evas_object_image_file_set(obj, - clock_image_path[now_clock_image[i]], NULL); - // add update view area + clock_image_object[i], clock_image_path[now_clock_image[i]]); + char wrk_path[256]; + snprintf(wrk_path, sizeof(wrk_path), "%s/" IMG_DIR "/%s", + tzplatform_getenv(TZ_SYS_RO_APP), + clock_image_path[now_clock_image[i]]); + evas_object_image_file_set(obj, wrk_path, NULL); + // add update view area // (Omitted update area is set so that evas_object_image_file_set()) //Evas_Coord x,y,w,h; //evas_object_geometry_get( obj, &x, &y, &w, &h ); @@ -307,7 +315,10 @@ CicoNotificationPanelComponent::Initialize(Evas_Object *window, Evas *evas) /* create Notification object */ ICO_DBG("Create Text Module end"); evasobj_=edje_object_add(evas); - if (!edje_object_file_set(evasobj_, THEME_PATH, THEME_NOTIFICATION_NAME)) { + char wrk_path[256]; + snprintf(wrk_path, sizeof(wrk_path), "%s/" THEME_PATH, + tzplatform_getenv(TZ_SYS_RO_APP)); + if (!edje_object_file_set(evasobj_, wrk_path, THEME_NOTIFICATION_NAME)) { Edje_Load_Error err = edje_object_load_error_get(evasobj_); const char *errmsg = edje_load_error_str(err); ICO_ERR("could not load 'main' from statusbar.edj: %s", diff --git a/src/statusbar/Makefile.am b/src/statusbar/Makefile.am index 10c5da0..2a08b53 100644 --- a/src/statusbar/Makefile.am +++ b/src/statusbar/Makefile.am @@ -35,8 +35,7 @@ StatusBar_CXXFLAGS = \ -I/usr/include/ico-util \ -I../../include \ -I../../lib/common \ - -I../../lib/notification \ - -std=c++11 + -I../../lib/notification StatusBar_LDADD = \ ../../lib/common/.libs/libico-common.a \