From: Masayuki Sasaki Date: Thu, 6 Mar 2014 07:26:53 +0000 (+0900) Subject: bug fix: HomeScreen sometimes fails in connection with SystemController at the time... X-Git-Tag: accepted/tizen/ivi/panda/20140326.234210~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dc6a68dcf26f1a3165372c14b8c0df56fc258b47;p=profile%2Fivi%2Fico-uxf-homescreen.git bug fix: HomeScreen sometimes fails in connection with SystemController at the time of starting. bug fix: Local time is supported in the clock display of StatusBar. improve: A multiplex notice is supported in OnScreen. bug fix:LiveThumbnail of HomeScreen not works when APP installed.Homescreen take over the SURFACE of the old menu to the new menu, when that regenerate the menu. Change-Id: I5ec88f76256018e03b45cd1b854d4125799a1764 Signed-off-by: Masayuki Sasaki --- diff --git a/include/ico_syc_common.h b/include/ico_syc_common.h index bc2f581..5c39171 100644 --- a/include/ico_syc_common.h +++ b/include/ico_syc_common.h @@ -56,6 +56,19 @@ void ico_syc_disconnect(void); /*--------------------------------------------------------------------------*/ /** + * @brief ico_syc_isconnect + * Check connect of System Controller. + * + * @param none + * @return result + * @retval 1 connected to System Controller + * @retval 0 not connect + */ +/*--------------------------------------------------------------------------*/ +int ico_syc_isconnect(void); + +/*--------------------------------------------------------------------------*/ +/** * @brief ico_syc_service * Service for communication to System Controller. * diff --git a/include/ico_syc_inputctl.h b/include/ico_syc_inputctl.h index ddb073d..0d4af98 100644 --- a/include/ico_syc_inputctl.h +++ b/include/ico_syc_inputctl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014, TOYOTA MOTOR CORPORATION. + * 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 diff --git a/include/ico_syc_msg_cmd_def.h b/include/ico_syc_msg_cmd_def.h index c735eee..cf6ce00 100644 --- a/include/ico_syc_msg_cmd_def.h +++ b/include/ico_syc_msg_cmd_def.h @@ -45,6 +45,7 @@ extern "C" { #define MSG_PRMKEY_LAYER (char *)"layer" #define MSG_PRMKEY_NODE (char *)"node" #define MSG_PRMKEY_ZONE (char *)"zone" +#define MSG_PRMKEY_ANIM_TYPE (char *)"anim_type" #define MSG_PRMKEY_ANIM_NAME (char *)"anim_name" #define MSG_PRMKEY_ANIM_TIME (char *)"anim_time" #define MSG_PRMKEY_ATTR (char *)"attr" @@ -136,16 +137,17 @@ extern "C" { #define MSG_CMD_SHOW 0x00010003 #define MSG_CMD_HIDE 0x00010004 #define MSG_CMD_MOVE 0x00010005 -#define MSG_CMD_CHANGE_ACTIVE 0x00010006 -#define MSG_CMD_CHANGE_LAYER 0x00010007 -#define MSG_CMD_CHANGE_ATTR 0x00010008 -#define MSG_CMD_NAME 0x00010009 -#define MSG_CMD_MAP_THUMB 0x00010011 -#define MSG_CMD_UNMAP_THUMB 0x00010012 -#define MSG_CMD_MAP_GET 0x00010013 -#define MSG_CMD_SHOW_LAYER 0x00010020 -#define MSG_CMD_HIDE_LAYER 0x00010021 -#define MSG_CMD_CHANGE_LAYER_ATTR 0x00010022 +#define MSG_CMD_ANIMATION 0x00010006 +#define MSG_CMD_CHANGE_ACTIVE 0x00010007 +#define MSG_CMD_CHANGE_LAYER 0x00010008 +#define MSG_CMD_CHANGE_ATTR 0x00010009 +#define MSG_CMD_NAME 0x00010010 +#define MSG_CMD_MAP_THUMB 0x00010020 +#define MSG_CMD_UNMAP_THUMB 0x00010021 +#define MSG_CMD_MAP_GET 0x00010022 +#define MSG_CMD_SHOW_LAYER 0x00010030 +#define MSG_CMD_HIDE_LAYER 0x00010031 +#define MSG_CMD_CHANGE_LAYER_ATTR 0x00010032 /* input controller */ #define MSG_CMD_ADD_INPUT 0x00020001 #define MSG_CMD_DEL_INPUT 0x00020002 diff --git a/include/ico_syc_sysdef.h b/include/ico_syc_sysdef.h index 0600ded..f08dbc7 100644 --- a/include/ico_syc_sysdef.h +++ b/include/ico_syc_sysdef.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014, TOYOTA MOTOR CORPORATION. + * 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 diff --git a/include/ico_syc_type.h b/include/ico_syc_type.h index 2f8db30..5beda15 100644 --- a/include/ico_syc_type.h +++ b/include/ico_syc_type.h @@ -147,6 +147,22 @@ typedef enum _surface_animation { } ico_syc_surface_animation; /* + * surface animation target + * @ICO_SYC_ANIMATION_TYPE_HIDE: + * @ICO_SYC_ANIMATION_TYPE_SHOW: + * @ICO_SYC_ANIMATION_TYPE_MOVE: + * @ICO_SYC_ANIMATION_TYPE_RESIZE: + * @ICO_SYC_ANIMATION_TYPE_ALL: + */ +typedef enum _surface_animation_type { + ICO_SYC_ANIMATION_TYPE_HIDE = 1, + ICO_SYC_ANIMATION_TYPE_SHOW = 2, + ICO_SYC_ANIMATION_TYPE_MOVE = 4, + ICO_SYC_ANIMATION_TYPE_RESIZE = 8, + ICO_SYC_ANIMATION_TYPE_ALL = 0xff +} ico_syc_surface_animation_type; + +/* * type of window aspect * @ICO_SYC_WIN_ASPECT_FIXED: fixed aspect * @ICO_SYC_WIN_ASPECT_ALIGN_LEFT: left align diff --git a/include/ico_syc_winctl.h b/include/ico_syc_winctl.h index 4edd057..fb5fbd6 100644 --- a/include/ico_syc_winctl.h +++ b/include/ico_syc_winctl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014, TOYOTA MOTOR CORPORATION. + * 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 @@ -107,6 +107,23 @@ int ico_syc_move(const char *appid, int surface, /*--------------------------------------------------------------------------*/ /** + * @brief ico_syc_set_animation + * Set the application window animation. + * + * @param[in] appid application id + * @param[in] surface window's surface id + * @param[in] type set animation target + * @param[in] animation animation information + * @return result + * @retval 0 success + * @retval not 0 error + */ +/*--------------------------------------------------------------------------*/ +int ico_syc_set_animation(const char *appid, int surface, int type, + const ico_syc_animation_t *animation); + +/*--------------------------------------------------------------------------*/ +/** * @brief ico_syc_change_active * Change the active window which receives the input-event notification * from System Controller. diff --git a/lib/apps-framework/ico_syc_common.c b/lib/apps-framework/ico_syc_common.c index 618b520..df1db9d 100644 --- a/lib/apps-framework/ico_syc_common.c +++ b/lib/apps-framework/ico_syc_common.c @@ -541,7 +541,7 @@ _connect_client(ico_syc_callback_t callback, void *user_data) * @return none */ /*--------------------------------------------------------------------------*/ -static void +static void _disconnect_client(void) { /* unset callback */ @@ -721,6 +721,26 @@ ico_syc_disconnect(void) /*--------------------------------------------------------------------------*/ /** + * @brief ico_syc_isconnect + * Check connect of System Controller. + * + * @param none + * @return result + * @retval 1 connected to System Controller + * @retval 0 not connect + */ +/*--------------------------------------------------------------------------*/ +ICO_API int +ico_syc_isconnect(void) +{ + if ((uws_context != NULL) && (uws_id != NULL)) { + return 1; + } + return 0; +} + +/*--------------------------------------------------------------------------*/ +/** * @brief ico_syc_service * Service for communication to System Controller. * diff --git a/lib/apps-framework/ico_syc_inputctl.c b/lib/apps-framework/ico_syc_inputctl.c index 8a4cc92..4b81d41 100644 --- a/lib/apps-framework/ico_syc_inputctl.c +++ b/lib/apps-framework/ico_syc_inputctl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014, TOYOTA MOTOR CORPORATION. + * 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 diff --git a/lib/apps-framework/ico_syc_winctl.c b/lib/apps-framework/ico_syc_winctl.c index 668b7fb..a8b03d8 100644 --- a/lib/apps-framework/ico_syc_winctl.c +++ b/lib/apps-framework/ico_syc_winctl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014, TOYOTA MOTOR CORPORATION. + * 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 @@ -38,6 +38,8 @@ static msg_t _create_win_msg(const char *appid, int surface, static msg_t _create_win_move_msg(const char *appid, int surface, const ico_syc_win_move_t *move, const ico_syc_animation_t *animation); +static msg_t _create_win_animation_msg(const char *appid, int surface, + int type, const char *animation, int time); static msg_t _create_active_win_msg(const char *appid, int surface); static msg_t _create_change_layer_msg(const char *appid, int surface, int layer); static msg_t _create_map_get_msg(const char *appid, int surface, const char *filepath); @@ -187,6 +189,61 @@ _create_win_move_msg(const char *appid, int surface, /*--------------------------------------------------------------------------*/ /** + * @brief _create_win_animation_msg + * Create the message to set animation the application window. + * + * @param[in] appid application id + * @param[in] surface window's surface id + * @param[in] type set animation target + * @param[in] animation animation information + * @param[in] time animation time + * @return json generator + * @retval json generator success + * @retval NULL error + */ +/*--------------------------------------------------------------------------*/ +static msg_t +_create_win_animation_msg(const char *appid, int surface, + int type, const char *animation, int time) +{ + JsonObject *obj = NULL; + JsonObject *argobj = NULL; + JsonGenerator *gen = NULL; + JsonNode *root = NULL; + + /* create json object */ + obj = json_object_new(); + argobj = json_object_new(); + if (obj == NULL || argobj == NULL) { + _ERR("json_object_new failed"); + return NULL; + } + + /* set message */ + json_object_set_int_member(obj, MSG_PRMKEY_CMD, MSG_CMD_ANIMATION); + json_object_set_string_member(obj, MSG_PRMKEY_APPID, appid); + json_object_set_int_member(obj, MSG_PRMKEY_PID, getpid()); + + json_object_set_int_member(argobj, MSG_PRMKEY_SURFACE, surface); + json_object_set_int_member(argobj, MSG_PRMKEY_ANIM_TYPE, type); + json_object_set_string_member(argobj, MSG_PRMKEY_ANIM_NAME, animation); + json_object_set_int_member(argobj, MSG_PRMKEY_ANIM_TIME, time); + + json_object_set_object_member(obj, MSG_PRMKEY_ARG, argobj); + + /* create root object */ + root = json_node_new(JSON_NODE_OBJECT); + json_node_take_object(root, obj); + + /* create generator object */ + gen = json_generator_new(); + json_generator_set_root(gen, root); + + return gen; +} + +/*--------------------------------------------------------------------------*/ +/** * @brief _create_active_win_msg * Create the message to change active window. * @@ -955,6 +1012,43 @@ ico_syc_move(const char *appid, int surface, /*--------------------------------------------------------------------------*/ /** + * @brief ico_syc_set_animation + * Set the application window animation. + * + * @param[in] appid application id + * @param[in] surface window's surface id + * @param[in] type set animation target + * @param[in] animation animation information + * @return result + * @retval 0 success + * @retval not 0 error + */ +/*--------------------------------------------------------------------------*/ +ICO_API int +ico_syc_set_animation(const char *appid, int surface, int type, + const ico_syc_animation_t *animation) +{ + int ret = ICO_SYC_ERR_NONE; + msg_t msg; + + /* check argument */ + if (appid == NULL) { + _ERR("invalid parameter (appid is NULL)"); + return ICO_SYC_ERR_INVALID_PARAM; + } + + /* make message */ + msg = _create_win_animation_msg(appid, surface, type, animation->name, animation->time); + /* send message */ + ret = ico_syc_send_msg(msg); + /* free send message */ + ico_syc_free_msg(msg); + + return ret; +} + +/*--------------------------------------------------------------------------*/ +/** * @brief ico_syc_change_active * Change the active window which receives the win-event notification * from System Controller. diff --git a/lib/common/CicoSystemConfig.cpp b/lib/common/CicoSystemConfig.cpp index 460c91b..1b45b5f 100644 --- a/lib/common/CicoSystemConfig.cpp +++ b/lib/common/CicoSystemConfig.cpp @@ -293,6 +293,7 @@ CicoSystemConfig::createDisplayConfList(const ptree & root) // return; // } + numDisplay = 0; ptree displays = root.get_child("systemconfig.displays"); BOOST_FOREACH (const ptree::value_type& child, displays) { optional id = optional(-1); @@ -354,6 +355,7 @@ CicoSystemConfig::createDisplayConfList(const ptree & root) createDisplayZoneConf(child, displayConf); m_displayConfList.push_back(displayConf); + numDisplay ++; } } @@ -1927,6 +1929,19 @@ CicoSystemConfig::getDisplayIdbyNo(int no) */ //-------------------------------------------------------------------------- int +CicoSystemConfig::getNumberofDisplay(void) +{ + return numDisplay; +} + +//-------------------------------------------------------------------------- +/** + * @brief + * + * @param [in] + */ +//-------------------------------------------------------------------------- +int CicoSystemConfig::getLayerIdfbyName(const string & displayName, const string & layerName) { diff --git a/lib/common/CicoSystemConfig.h b/lib/common/CicoSystemConfig.h index 892358a..1b53b7d 100644 --- a/lib/common/CicoSystemConfig.h +++ b/lib/common/CicoSystemConfig.h @@ -108,6 +108,7 @@ public: int getNodeIdbyName(const string & name); int getDisplayIdbyName(const string & name); int getDisplayIdbyNo(int no); + int getNumberofDisplay(void); int getLayerIdfbyName(const string & displayName, const string & layerName); int getLayerIdfbyName(const string& ECU, @@ -218,6 +219,7 @@ private: CicoSCVehicleInfoConf *m_vehicleInfoConf; CicoSCRoleConf *m_roleConf; CicoSCPositionOSConf *m_positionOSConf; + int numDisplay; }; #endif // __CICO_SYSTEM_CONFIG_H__ // vim:set expandtab ts=4 sw=4: diff --git a/lib/system-controller/CicoSCCommand.cpp b/lib/system-controller/CicoSCCommand.cpp index 7191cad..358e88b 100644 --- a/lib/system-controller/CicoSCCommand.cpp +++ b/lib/system-controller/CicoSCCommand.cpp @@ -256,6 +256,10 @@ CicoSCCommand::parseWinCtrlOpt(const ptree & root) options->nodeid = getIntValue(root, "arg.node"); options->zone = getStrValue(root, "arg.zone"); options->animation = getStrValue(root, "arg.anim_name"); + options->animationType = getIntValue(root, "arg.anim_type"); + if (-1 == options->animationType) { + options->animationType = 0xff; + } options->animationTime = getIntValue(root, "arg.anim_time"); if (-1 == options->animationTime) { options->animationTime = 0; diff --git a/lib/system-controller/CicoSCCommand.h b/lib/system-controller/CicoSCCommand.h index f504f91..4ac0073 100644 --- a/lib/system-controller/CicoSCCommand.h +++ b/lib/system-controller/CicoSCCommand.h @@ -52,7 +52,7 @@ public: /// default constructor CicoSCCmdWinCtrlOpt() : nodeid(0), displayid(0), layerid(0), - zone(""), surfaceid(-1), animation(""), animationTime(0), + zone(""), surfaceid(-1), animationType(0), animation(""), animationTime(0), x(-1), y(-1), width(-1), height(-1), raise(-1), visible(-1), active(-1), framerate(0), stride(-1), format(-1) {} @@ -63,12 +63,12 @@ public: void dump(void) { ICO_DBG("WinCtrlOpt: " - "surfaceid=0x%08X layerid=%d nodeid=%d zone=%s " - "animation=%s animationTime=%d " + "surfaceid=%08X layerid=%d nodeid=%d zone=%s " + "animation=%s animaType=%x animaTime=%d " "x=%d y=%d w=%d h=%d raise=%d " "visible=%d active=%d framerate=%d stride=%d format=%d", surfaceid, layerid, nodeid, zone.c_str(), - animation.c_str(), animationTime, + animation.c_str(), animationType, animationTime, x, y, width, height, raise, visible, active, framerate, stride, format); } @@ -78,6 +78,7 @@ public: int layerid; //!< id of layer std::string zone; //!< name of display zone int surfaceid; //!< id of surface + int animationType; //!< type of animation std::string animation; //!< name of animation int animationTime; //!< time of animation int x; //!< x position of window diff --git a/lib/system-controller/CicoSCInputController.cpp b/lib/system-controller/CicoSCInputController.cpp index a897bc1..46d1527 100644 --- a/lib/system-controller/CicoSCInputController.cpp +++ b/lib/system-controller/CicoSCInputController.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014, TOYOTA MOTOR CORPORATION. + * 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 diff --git a/lib/system-controller/CicoSCInputController.h b/lib/system-controller/CicoSCInputController.h index 3d3a307..41999f7 100644 --- a/lib/system-controller/CicoSCInputController.h +++ b/lib/system-controller/CicoSCInputController.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014, TOYOTA MOTOR CORPORATION. + * 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 diff --git a/lib/system-controller/CicoSCWayland.cpp b/lib/system-controller/CicoSCWayland.cpp index fea1e01..ea95bf4 100644 --- a/lib/system-controller/CicoSCWayland.cpp +++ b/lib/system-controller/CicoSCWayland.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014, TOYOTA MOTOR CORPORATION. + * 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 diff --git a/lib/system-controller/CicoSCWaylandIF.cpp b/lib/system-controller/CicoSCWaylandIF.cpp index 08b326b..694250d 100644 --- a/lib/system-controller/CicoSCWaylandIF.cpp +++ b/lib/system-controller/CicoSCWaylandIF.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014, TOYOTA MOTOR CORPORATION. + * 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 diff --git a/lib/system-controller/CicoSCWaylandIF.h b/lib/system-controller/CicoSCWaylandIF.h index f647d83..2e4a938 100644 --- a/lib/system-controller/CicoSCWaylandIF.h +++ b/lib/system-controller/CicoSCWaylandIF.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014, TOYOTA MOTOR CORPORATION. + * 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 diff --git a/lib/system-controller/CicoSCWindowController.cpp b/lib/system-controller/CicoSCWindowController.cpp index 835e9d2..f8f370a 100644 --- a/lib/system-controller/CicoSCWindowController.cpp +++ b/lib/system-controller/CicoSCWindowController.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014, TOYOTA MOTOR CORPORATION. + * 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 @@ -454,7 +454,13 @@ CicoSCWindowController::move(int surfaceid, // find window information in window list CicoSCWindow *window = findWindow(surfaceid); if (NULL == window) { - ICO_WRN("not found window information"); + ICO_WRN("CicoSCWindowController::move not found window(%08x)", surfaceid); + ICO_TRA("CicoSCWindowController::move Leave(ENOENT)"); + return ICO_SYC_ENOENT; + } + // check nodeid + if (nodeid >= (int)m_physicalDisplayTotal) { + ICO_WRN("CicoSCWindowController::move not found node(%d)", nodeid); ICO_TRA("CicoSCWindowController::move Leave(ENOENT)"); return ICO_SYC_ENOENT; } @@ -581,7 +587,13 @@ CicoSCWindowController::setGeometry(int surfaceid, // find window information in window list CicoSCWindow *window = findWindow(surfaceid); if (NULL == window) { - ICO_WRN("not found window information"); + ICO_WRN("CicoSCWindowController::setGeometry not found window(%08x)", surfaceid); + ICO_TRA("CicoSCWindowController::setGeometry Leave(ENOENT)"); + return ICO_SYC_ENOENT; + } + // check nodeid + if (nodeid >= (int)m_physicalDisplayTotal) { + ICO_WRN("CicoSCWindowController::setGeometry not found node(%d)", nodeid); ICO_TRA("CicoSCWindowController::setGeometry Leave(ENOENT)"); return ICO_SYC_ENOENT; } @@ -700,11 +712,12 @@ CicoSCWindowController::setGeometry(int surfaceid, // find window information in window list CicoSCWindow *window = findWindow(surfaceid); if (NULL == window) { - ICO_WRN("not found window information"); + ICO_WRN("CicoSCWindowController::setGeometry not found window(%08x)", surfaceid); ICO_TRA("CicoSCWindowController::setGeometry Leave(ENOENT)"); return ICO_SYC_ENOENT; } + // find zone information if ((NULL == zone) || ('\0' == zone[0])) { ICO_WRN("zone value is invalid"); ICO_TRA("CicoSCWindowController::setGeometry Leave(EINVAL)"); @@ -722,13 +735,11 @@ CicoSCWindowController::setGeometry(int surfaceid, break; } } - if (NULL == dispzone) { ICO_WRN("display zone name(%s) is invalid.", zone); ICO_TRA("CicoSCWindowController::setGeometry Leave(EINVAL)"); return ICO_SYC_EINVAL; } - if (m_physicalDisplayTotal <= (unsigned int)displayno) { ICO_WRN("nodeid(%d) is over physical display total(%d)", m_physicalDisplayTotal, displayno); @@ -829,6 +840,50 @@ CicoSCWindowController::lower(int surfaceid, //-------------------------------------------------------------------------- /** + * @brief set window(surface) animation + * + * @param [in] surfaceid wayland surface id + * @param [in] target target(pointer and/or keyboard) + * @param [in] type set animation target + * @param [in] animation animation information + * @param [in] time animation time + * + * @return ICO_SYC_EOK on success, other on error + * @retval ICO_SYC_EOK success + * @retval ICO_SYC_ESRCH error(not initialized) + * @retval ICO_SYC_ENOENT error(layer dose not exist) + */ +//-------------------------------------------------------------------------- +int +CicoSCWindowController::setWindowAnimation(int surfaceid, int type, + const char *animation, int time) +{ + CicoSCWindow *window = NULL; + + ICO_TRA("CicoSCWindowController::setWindowAnimation Enter" + "(surfaceid=%08X, type=%x, animation=<%s>, time=%d)", + surfaceid, type, animation ? animation : "(null)", time); + + // find window information in window list + window = findWindow(surfaceid); + if (NULL == window) { + ICO_WRN("not found window information"); + ICO_TRA("CicoSCWindowController::setWindowAnimation Leave(ENOENT)"); + return ICO_SYC_ENOENT; + } + + // set animation request to Multi Window Manager + CicoSCWlWinMgrIF::setAnimation(surfaceid, type, animation, time); + + // flush display + CicoSCWayland::getInstance()->flushDisplay(); + + ICO_TRA("CicoSCWindowController::setWindowAnimation Leave(EOK)"); + return ICO_SYC_EOK; +} + +//-------------------------------------------------------------------------- +/** * @brief set window layer * * @param [in] surfaceid wayland surface id @@ -873,6 +928,11 @@ CicoSCWindowController::setWindowLayer(int surfaceid, int layerid) ICO_ERR("CicoSCWindowController::setWindowLayer ilm_layerRemoveSurface(%d,%08x)" " Error", window->layerid, window->surfaceid); } + // must need ilm_commitChanges() after ilm_layerRemoveSurface() + if (ilm_commitChanges() != ILM_SUCCESS) { + ICO_ERR("CicoSCWindowController::setWindowLayer ilm_commitChanges Error"); + } + oldlayer->removeSurface(window->surfaceid); int noldsurf; const int *oldsurfs = oldlayer->getSurfaces(&noldsurf); @@ -881,7 +941,6 @@ CicoSCWindowController::setWindowLayer(int surfaceid, int layerid) ICO_ERR("CicoSCWindowController::setWindowLayer " "ilm_layerSetRenderOrder(%d,,%d) Error", window->layerid, noldsurf); } - // must need ilm_commitChanges() after ilm_layerRemoveSurface() if (ilm_commitChanges() != ILM_SUCCESS) { ICO_ERR("CicoSCWindowController::setWindowLayer ilm_commitChanges Error"); } @@ -895,6 +954,9 @@ CicoSCWindowController::setWindowLayer(int surfaceid, int layerid) ICO_ERR("CicoSCWindowController::setWindowLayer ilm_layerAddSurface(%d,%08x) Error", window->layerid, window->surfaceid); } + if (ilm_commitChanges() != ILM_SUCCESS) { + ICO_ERR("CicoSCWindowController::setWindowLayer ilm_commitChanges() Error"); + } // add surface to new layer layer->addSurface(window->surfaceid, true); @@ -1392,7 +1454,7 @@ CicoSCWindowController::updateSurfaceCB(void *data, window->y = y; window->width = width; window->height = height; - window->nodeid = window->layerid / 1000; + window->nodeid = window->layerid / ICO_SC_LAYERID_SCREENBASE; // notify to homescreen CicoSCMessage *message = new CicoSCMessage(); @@ -1725,33 +1787,23 @@ CicoSCWindowController::createSurfaceCB(void *data, return; } - t_ilm_uint Dimansion[2]; - Dimansion[0] = window->srcwidth; - Dimansion[1] = window->srcheight; - t_ilm_uint Position[2]; - Position[0] = window->x; - Position[1] = window->y; - if (ilm_surfaceSetOpacity(window->surfaceid , (t_ilm_float)1.0f) != ILM_SUCCESS) { - ICO_ERR("CicoSCWindowController::createSurfaceCB " - "ilm_surfaceSetOpacity(%08x) Error", window->surfaceid); - } - else if (ilm_surfaceSetDimension(window->surfaceid, Dimansion) != ILM_SUCCESS) { - ICO_ERR("CicoSCWindowController::createSurfaceCB " - "ilm_surfaceSetDimension(%08x) Error", window->surfaceid); - } - else if (ilm_surfaceSetDestinationRectangle(window->surfaceid, window->x, window->y, + if (ilm_surfaceSetDestinationRectangle(window->surfaceid, window->x, window->y, window->width, window->height) != ILM_SUCCESS) { ICO_ERR("CicoSCWindowController::createSurfaceCB " "ilm_surfaceSetDestinationRectangle(%08x) Error", window->surfaceid); } - else if (ilm_surfaceSetPosition(window->surfaceid, Position) != ILM_SUCCESS) { + else if (ilm_surfaceSetSourceRectangle(window->surfaceid, 0, 0, + window->width, window->height) != ILM_SUCCESS) { ICO_ERR("CicoSCWindowController::createSurfaceCB " - "ilm_surfaceSetPosition(%08x) Error", window->surfaceid); + "ilm_surfaceSetSourceRectangle(%08x) Error", window->surfaceid); } else if (ilm_surfaceSetOrientation(window->surfaceid, ILM_ZERO) != ILM_SUCCESS) { ICO_ERR("CicoSCWindowController::createSurfaceCB " "ilm_surfaceSetOrientation(%08x) Error", window->surfaceid); } + else if (ilm_commitChanges() != ILM_SUCCESS) { + ICO_ERR("CicoSCWindowController::createSurfaceCB ilm_commitChanges() Error"); + } CicoSCLayer *layer = findLayer(window->displayid, window->layerid); if (layer) { @@ -1759,6 +1811,9 @@ CicoSCWindowController::createSurfaceCB(void *data, ICO_ERR("CicoSCWindowController::createSurfaceCB ilm_layerAddSurface(%d,%08x) " "Error", window->layerid, window->surfaceid); } + if (ilm_commitChanges() != ILM_SUCCESS) { + ICO_ERR("CicoSCWindowController::createSurfaceCB ilm_commitChanges() Error"); + } layer->addSurface(window->surfaceid, true); int nsurf; @@ -1768,8 +1823,16 @@ CicoSCWindowController::createSurfaceCB(void *data, ICO_ERR("CicoSCWindowController::createSurfaceCB: " "ilm_layerSetRenderOrder(%d,,%d) Error", window->layerid, nsurf); } + if (ilm_commitChanges() != ILM_SUCCESS) { + ICO_ERR("CicoSCWindowController::createSurfaceCB ilm_commitChanges() Error"); + } } - if (ilm_commitChanges() != ILM_SUCCESS) { + // must set surfaceOpacity after surfcaeAddLayer + if (ilm_surfaceSetOpacity(window->surfaceid , (t_ilm_float)1.0f) != ILM_SUCCESS) { + ICO_ERR("CicoSCWindowController::createSurfaceCB " + "ilm_surfaceSetOpacity(%08x) Error", window->surfaceid); + } + else if (ilm_commitChanges() != ILM_SUCCESS) { ICO_ERR("CicoSCWindowController::createSurfaceCB ilm_commitChanges() Error"); } @@ -1909,6 +1972,9 @@ CicoSCWindowController::initializeGeniviLMS(void) } ICO_TRA("initializeGeniviLMS: Screens=%d.%x %x %x %x", NumberOfScreens, ScreenIds[0], ScreenIds[1], ScreenIds[2], ScreenIds[3]); + if ((int)NumberOfScreens > CicoSystemConfig::getInstance()->getNumberofDisplay()) { + NumberOfScreens = (t_ilm_uint)CicoSystemConfig::getInstance()->getNumberofDisplay(); + } for (idx = 0; idx < (int)NumberOfScreens; idx++) { ICO_TRA("CicoSCWindowController::initializeGeniviLMS: " "call ilm_getPropertiesOfScreen(%x)", ScreenIds[idx]); @@ -1946,7 +2012,7 @@ CicoSCWindowController::initializeGeniviLMS(void) findLayerConfbyIdx(DisplayId, idx); if (! LayerConf) break; - LayerId = LayerConf->id + DisplayId * 1000; + LayerId = LayerConf->id + DisplayId * ICO_SC_LAYERID_SCREENBASE; for (idx2 = 0; idx2 < LayerNumber; idx2++) { if (LayerId == (int)pLayerId[idx2]) break; } @@ -1984,20 +2050,17 @@ CicoSCWindowController::initializeGeniviLMS(void) ICO_ERR("CicoSCWindowController::initializeGeniviLMS " "ilm_layerSetOrientation(%d) Error", LayerId); } - else if (ilm_layerSetOrientation(LayerId, ILM_ZERO) != ILM_SUCCESS) { - ICO_ERR("CicoSCWindowController::initializeGeniviLMS " - "ilm_layerSetOrientation(%d) Error", LayerId); - } - else if (ilm_layerAddNotification(LayerId, wlGeniviLayerNotification) - != ILM_SUCCESS) { - ICO_ERR("CicoSCWindowController::initializeGeniviLMS " - "ilm_layerAddNotification(%d) Error", LayerId); - } else { if (ilm_commitChanges() != ILM_SUCCESS) { ICO_ERR("CicoSCWindowController::initializeGeniviLMS " "ilm_commitChanges() Error"); } + // SystemController default is layer visible + if ((ilm_layerSetVisibility(LayerId, 1) != ILM_SUCCESS) || + (ilm_commitChanges() != ILM_SUCCESS)) { + ICO_ERR("CicoSCWindowController::initializeGeniviLMS " + "ilm_layerSetVisibility() Error"); + } ICO_TRA("initializeGeniviLMS: layer=%d created(%d,%d)", LayerId, DisplayConf->width, DisplayConf->height); *ppLayerId = LayerId; @@ -2164,6 +2227,11 @@ CicoSCWindowController::handleCommand(const CicoSCCommand * cmd) } break; } + case MSG_CMD_ANIMATION: + ICO_DBG("command: MSG_CMD_ANIMATION"); + (void)setWindowAnimation(opt->surfaceid, opt->animationType, + opt->animation.c_str(), opt->animationTime); + break; case MSG_CMD_CHANGE_ACTIVE: ICO_DBG("command: MSG_CMD_CHANGE_ACTIVE"); (void)active(opt->surfaceid, opt->active); diff --git a/lib/system-controller/CicoSCWindowController.h b/lib/system-controller/CicoSCWindowController.h index 7ac6eca..e92f8b6 100644 --- a/lib/system-controller/CicoSCWindowController.h +++ b/lib/system-controller/CicoSCWindowController.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014, TOYOTA MOTOR CORPORATION. + * 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 @@ -25,6 +25,7 @@ using namespace std; #include "CicoSCWlWinMgrIF.h" #define ICO_SC_APPID_DEFAULT_ONS "org.tizen.ico.onscreen" +#define ICO_SC_LAYERID_SCREENBASE 1000 //========================================================================== // Forward declaration @@ -107,6 +108,8 @@ public: int lower(int surfaceid, const char *animation, int animationTime); + int setWindowAnimation(int surfaceid, int type, const char *animation, int time); + int setWindowLayer(int surfaceid, int layerid); int showLayer(int displayid, int layerid); diff --git a/lib/system-controller/CicoSCWlInputMgrIF.cpp b/lib/system-controller/CicoSCWlInputMgrIF.cpp index 6032665..5ade0a4 100644 --- a/lib/system-controller/CicoSCWlInputMgrIF.cpp +++ b/lib/system-controller/CicoSCWlInputMgrIF.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014, TOYOTA MOTOR CORPORATION. + * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. * * This program is licensed under the terms and conditions of the * Apache License, version 2.0. The full tWlExt of the Apache License is at diff --git a/lib/system-controller/CicoSCWlInputMgrIF.h b/lib/system-controller/CicoSCWlInputMgrIF.h index 42924e3..41328c3 100644 --- a/lib/system-controller/CicoSCWlInputMgrIF.h +++ b/lib/system-controller/CicoSCWlInputMgrIF.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014, TOYOTA MOTOR CORPORATION. + * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. * * This program is licensed under the terms and conditions of the * Apache License, version 2.0. The full tWlExt of the Apache License is at diff --git a/lib/system-controller/CicoSCWlWinMgrIF.cpp b/lib/system-controller/CicoSCWlWinMgrIF.cpp index 342a510..6b86ff1 100644 --- a/lib/system-controller/CicoSCWlWinMgrIF.cpp +++ b/lib/system-controller/CicoSCWlWinMgrIF.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014, TOYOTA MOTOR CORPORATION. + * 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 @@ -258,26 +258,16 @@ CicoSCWlWinMgrIF::setPositionsize(uint32_t surfaceid, uint32_t node, "(surfaceid=0x%08X node=%d x=%d y=%d w=%d h=%d)", surfaceid, node, x, y, width, height); - t_ilm_uint Dimansion[2]; - Dimansion[0] = width; - Dimansion[1] = height; - t_ilm_uint Position[2]; - Position[0] = x; - Position[1] = y; - - if (ilm_surfaceSetDimension(surfaceid, Dimansion) != ILM_SUCCESS) { - ICO_ERR("CicoSCWlWinMgrIF::setPositionsize " - "ilm_surfaceSetDimension(%08x) Error", surfaceid); - } - else if (ilm_surfaceSetPosition(surfaceid, Position) != ILM_SUCCESS) { - ICO_ERR("CicoSCWlWinMgrIF::setPositionsize " - "ilm_surfaceSetPosition(%08x) Error", surfaceid); - } - else if (ilm_surfaceSetDestinationRectangle(surfaceid, x, y, width, height) + if (ilm_surfaceSetDestinationRectangle(surfaceid, x, y, width, height) != ILM_SUCCESS) { ICO_ERR("CicoSCWlWinMgrIF::setPositionsize ilm_surfaceSetDestinationRectangle" "(%08x,%d,%d,%d,%d) Error", surfaceid, x, y, width, height); } + else if (ilm_surfaceSetSourceRectangle(surfaceid, 0, 0, width, height) + != ILM_SUCCESS) { + ICO_ERR("CicoSCWlWinMgrIF::setPositionsize ilm_surfaceSetSourceRectangle" + "(%08x,0,0,%d,%d) Error", surfaceid, width, height); + } else if (ilm_commitChanges() != ILM_SUCCESS) { ICO_ERR("CicoSCWlWinMgrIF::setPositionsize ilm_commitChanges() Error"); } @@ -921,72 +911,49 @@ CicoSCWlWinMgrIF::wlIviAppNativeShellInfoCB(void *data, int32_t pid, const char *title) { struct creation_surface_wait *tp; - struct creation_surface_wait *bp; - uint32_t nowtime; + struct creation_surface_wait *tp2; ICO_TRA("CicoSCWlWinMgrIF::wlIviAppNativeShellInfoCB: Enter(%d,<%s>)", pid, title ? title : "(null)"); if (NULL == data) { - ICO_WRN("CicoSCWlWinMgrIF::wlIviAppNativeShellInfoCB: data is null"); + ICO_WRN("CicoSCWlWinMgrIF::wlIviAppNativeShellInfoCB: Leave(data is null)"); + return; + } + if (title == NULL) { + ICO_TRA("CicoSCWlWinMgrIF::wlIviAppNativeShellInfoCB: Leave(no title)"); return; } // bind wl_surface to ivi_surface - ivi_controller_get_native_handle(m_ivi_ctrl, pid, title ? title : ""); - - // save pid and title(window name) - nowtime = (time(NULL) >> 2) & 0x3fffffff; - tp = m_wait_surface_creation; - while (tp) { - if ((tp->pid == pid) && (tp->title[0] == 0)) break; - tp = tp->next; + tp = m_free_surface_creation; + if (tp) { + m_free_surface_creation = tp->next; } - if (! tp) { - tp = m_free_surface_creation; - if (tp) { - m_free_surface_creation = tp->next; - } - else { - tp = m_wait_surface_creation; - bp = NULL; - while (tp) { - if (((nowtime >= tp->create_time) - && ((nowtime - tp->create_time) > 15)) || - ((nowtime < tp->create_time) - && ((nowtime + 0x40000000 - tp->create_time) > 15))) { - if (bp) { - bp->next = tp->next; - } - else { - m_wait_surface_creation = tp->next; - } - break; - } - bp = tp; - tp = tp->next; - } - if (! tp) { - tp = (struct creation_surface_wait *) - malloc(sizeof(struct creation_surface_wait)); - if (! tp) { - ICO_ERR("CicoSCWlWinMgrIF::wlIviAppNativeShellInfoCB: out of memory"); - return; - } - } + else { + tp = (struct creation_surface_wait *)malloc(sizeof(struct creation_surface_wait)); + if (! tp) { + ICO_ERR("CicoSCWlWinMgrIF::wlIviAppNativeShellInfoCB: out of memory"); + return; } memset(tp, 0, sizeof(struct creation_surface_wait)); - tp->next = m_wait_surface_creation; - m_wait_surface_creation = tp; } + tp2 = m_wait_surface_creation; + tp->next = tp2; + m_wait_surface_creation = tp; tp->pid = pid; strncpy(tp->title, title, ICO_SYC_MAX_WINNAME_LEN-1); - tp->create_time = nowtime; - - if (tp->id_surface) { - static_cast(data)->updateWinnameCB(tp->id_surface, tp->title); + tp->busy = SCWINMGR_GENIVI_BUSY_WAIT; + while (tp2) { + if (tp2->busy != SCWINMGR_GENIVI_BUSY_NONE) break; + tp2 = tp2->next; + } + if (! tp2) { + tp->busy = SCWINMGR_GENIVI_BUSY_REQSURF; + ICO_TRA("CicoSCWlWinMgrIF::wlIviAppNativeShellInfoCB: " + "call ivi_controller_get_native_handle(%d,<%s>)", pid, title); + ivi_controller_get_native_handle(m_ivi_ctrl, pid, title); } - ICO_TRA("CicoSCWlWinMgrIF::wlIviAppNativeShellInfoCB: Leave"); } @@ -1080,6 +1047,9 @@ CicoSCWlWinMgrIF::wlIviCtrlErrorCB(void *data, int32_t object_id, int32_t object_type, int32_t error_code, const char *error_text) { + struct creation_surface_wait *tp; + struct creation_surface_wait *tp2; + ICO_TRA("CicoSCWlWinMgrIF::wlIviCtrlErrorCB: Enter(%d[%d],%d,<%s>)", object_id, object_type, error_code, error_text ? error_text : "(null)"); @@ -1087,6 +1057,25 @@ CicoSCWlWinMgrIF::wlIviCtrlErrorCB(void *data, ICO_WRN("CicoSCWlWinMgrIF::wlIviCtrlErrorCB: data is null"); return; } + + // search request wait + tp = m_wait_surface_creation; + tp2 = NULL; + while (tp) { + if (tp->busy == SCWINMGR_GENIVI_BUSY_WAIT) { + tp2 = tp; + } + else if (tp->busy != SCWINMGR_GENIVI_BUSY_NONE) { + tp->busy = SCWINMGR_GENIVI_BUSY_NONE; + } + tp = tp->next; + } + if (tp2 != NULL) { + tp2->busy = SCWINMGR_GENIVI_BUSY_REQSURF; + ICO_TRA("CicoSCWlWinMgrIF::wlIviCtrlErrorCB: " + "call ivi_controller_get_native_handle(%d,<%s>)", tp2->pid, tp2->title); + ivi_controller_get_native_handle(m_ivi_ctrl, tp2->pid, tp2->title); + } ICO_TRA("CicoSCWlWinMgrIF::wlIviCtrlErrorCB: Leave"); } @@ -1107,53 +1096,103 @@ CicoSCWlWinMgrIF::wlIviCtrlNativeHandleCB(void *data, { uint32_t id_surface; struct creation_surface_wait *tp; + struct creation_surface_wait *tp2; + struct creation_surface_wait *bp; - ICO_TRA("CicoSCWlWinMgrIF::wlIviCtrlNativeHandleCB: Enter(surface=%08x)", (int)surface); + ICO_TRA("CicoSCWlWinMgrIF::wlIviCtrlNativeHandleCB: Enter(surf=%08x)", (int)surface); if (NULL == data) { - ICO_WRN("CicoSCWlWinMgrIF::wlIviCtrlNativeHandleCB: data is null"); + ICO_WRN("CicoSCWlWinMgrIF::wlIviCtrlNativeHandleCB: Leave(data is null)"); return; } // check same surface tp = m_wait_surface_creation; + bp = NULL; while (tp) { - if (tp->surface == surface) { - ICO_TRA("CicoSCWlWinMgrIF::wlIviCtrlNativeHandleCB: Leave(same surface)"); - return; - } + if (tp->busy == SCWINMGR_GENIVI_BUSY_REQSURF) break; + bp = tp; tp = tp->next; } - - // create ivi-surface and bind to wl_surface - m_id_surface ++; - if (m_id_surface >= 0x00ffffff) m_id_surface = 1; - id_surface = m_id_surface | 0x40000000; - - if (ivi_application_surface_create(m_ivi_app, id_surface, surface) == NULL) { - ICO_ERR("CicoSCWlWinMgrIF::wlIviCtrlNativeHandleCB: " - "ivi_application_surface_create(%x) Error", id_surface); - if (m_wait_surface_creation) { - tp = m_wait_surface_creation; - m_wait_surface_creation = tp->next; - tp->next = m_free_surface_creation; - m_free_surface_creation = tp; + if (! tp) { + ICO_WRN("CicoSCWlWinMgrIF::wlIviCtrlNativeHandleCB: Leave(no request)"); + return; + } + if (tp->surface == surface) { + tp->busy = SCWINMGR_GENIVI_BUSY_NONE; + ICO_TRA("CicoSCWlWinMgrIF::wlIviCtrlNativeHandleCB: winname change(%08x,<%s>)", + tp->id_surface, tp->title); + id_surface = tp->id_surface; + static_cast(data)->updateWinnameCB(id_surface, tp->title); + + // title change, delete old table + tp2 = m_wait_surface_creation; + bp = NULL; + while (tp2) { + if (tp2 != tp) { + if (tp2->surface == surface) { + if (bp) { + bp->next = tp2->next; + } + else { + m_wait_surface_creation = tp2->next; + } + tp2->next = m_free_surface_creation; + m_free_surface_creation = tp2; + tp2 = m_wait_surface_creation; + bp = NULL; + continue; + } + } + bp = tp2; + tp2 = tp2->next; } } else { - tp = m_wait_surface_creation; - while (tp) { - if (tp->id_surface == 0) { - tp->id_surface = id_surface; - tp->surface = surface; - break; + // create ivi-surface and bind to wl_surface + m_id_surface ++; + if (m_id_surface >= 0x00ffffff) m_id_surface = 1; + id_surface = m_id_surface | 0x40000000; + + ICO_TRA("CicoSCWlWinMgrIF::wlIviCtrlNativeHandleCB: " + "call ivi_application_surface_create(%08x)", id_surface); + if (ivi_application_surface_create(m_ivi_app, id_surface, surface) == NULL) { + ICO_ERR("CicoSCWlWinMgrIF::wlIviCtrlNativeHandleCB: " + "ivi_application_surface_create(%08x) Error", id_surface); + if (bp) { + bp->next = tp->next; } - tp = tp->next; + else { + m_wait_surface_creation = tp->next; + } + tp->next = m_free_surface_creation; + m_free_surface_creation = tp; } - if (! tp) { - ICO_ERR("CicoSCWlWinMgrIF::wlIviCtrlNativeHandleCB: waiting surface dose not exist"); + else { + tp->surface = surface; + tp->id_surface = id_surface; + tp->busy = SCWINMGR_GENIVI_BUSY_REQBIND; } } + + // search request wait + tp = m_wait_surface_creation; + tp2 = NULL; + while (tp) { + if (tp->busy == SCWINMGR_GENIVI_BUSY_WAIT) { + tp2 = tp; + } + else if (tp->busy != SCWINMGR_GENIVI_BUSY_NONE) { + break; + } + tp = tp->next; + } + if ((tp == NULL) && (tp2 != NULL)) { + tp2->busy = SCWINMGR_GENIVI_BUSY_REQSURF; + ICO_TRA("CicoSCWlWinMgrIF::wlIviCtrlNativeHandleCB: " + "call ivi_controller_get_native_handle(%d,<%s>)", tp2->pid, tp2->title); + ivi_controller_get_native_handle(m_ivi_ctrl, tp2->pid, tp2->title); + } ICO_TRA("CicoSCWlWinMgrIF::wlIviCtrlNativeHandleCB: Leave(id_surface=%08x)", id_surface); } // vim:set expandtab ts=4 sw=4: diff --git a/lib/system-controller/CicoSCWlWinMgrIF.h b/lib/system-controller/CicoSCWlWinMgrIF.h index 252afc8..89bbcda 100644 --- a/lib/system-controller/CicoSCWlWinMgrIF.h +++ b/lib/system-controller/CicoSCWlWinMgrIF.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014, TOYOTA MOTOR CORPORATION. + * 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 @@ -38,9 +38,13 @@ struct creation_surface_wait { int32_t pid; uint32_t id_surface; struct wl_surface *surface; - uint32_t create_time; + int32_t busy; char title[ICO_SYC_MAX_WINNAME_LEN]; }; +#define SCWINMGR_GENIVI_BUSY_NONE 0 +#define SCWINMGR_GENIVI_BUSY_REQSURF 1 +#define SCWINMGR_GENIVI_BUSY_REQBIND 2 +#define SCWINMGR_GENIVI_BUSY_WAIT 3 class CicoSCWlWinMgrIF : public CicoSCWaylandIF { public: diff --git a/src/homescreen/CicoHSAppInfo.cpp b/src/homescreen/CicoHSAppInfo.cpp index 3fe9be8..7c0c6d8 100644 --- a/src/homescreen/CicoHSAppInfo.cpp +++ b/src/homescreen/CicoHSAppInfo.cpp @@ -63,7 +63,7 @@ CicoHSAppInfo::AddWindowInfo(ico_syc_win_info_t *wininfo) return ICO_ERROR; } - ICO_TRA("CicoHSAppInfo::AddWindowInfo Enter(appid=%s surface=%d", + ICO_TRA("CicoHSAppInfo::AddWindowInfo Enter(appid=%s surface=%x", wininfo->appid, wininfo->surface); // if exist window information, update current window information @@ -108,7 +108,7 @@ CicoHSAppInfo::AddWindowAttr(ico_syc_win_attr_t *winattr) return ICO_ERROR; } - ICO_TRA("CicoHSAppInfo::AddWindowAttr Enter(appid=%s surface=%d", + ICO_TRA("CicoHSAppInfo::AddWindowAttr Enter(appid=%s surface=%x", winattr->appid, winattr->surface); // if exist window information, update current window information @@ -410,7 +410,7 @@ CicoHSAppInfo::SetWindowInfo(ico_hs_window_info *hs_wininfo, ico_syc_win_info_t *wininfo) { ICO_TRA("CicoHSAppInfo::SetWindowInfo Enter" - "(winifo=%p appid=%s winname=%s surface=%d)", + "(winifo=%p appid=%s winname=%s surface=%x)", hs_wininfo, wininfo->appid, wininfo->name, wininfo->surface); @@ -443,7 +443,7 @@ CicoHSAppInfo::SetWindowAttr(ico_hs_window_info *hs_wininfo, { ICO_TRA("CicoHSAppInfo::SetWindowAttr Enter" "(winifo=%p " - "appid=%s winname=%s zone=%s surface=%d nodeid=%d layer=%d " + "appid=%s winname=%s zone=%s surface=%x nodeid=%d layer=%d " "x/y=%d/%d w/h=%d/%d raise=%d visible=%d active=%d)", hs_wininfo, winattr->appid, winattr->name, winattr->zone, diff --git a/src/homescreen/CicoHSMenuTile.cpp b/src/homescreen/CicoHSMenuTile.cpp index b08ddbb..792f905 100644 --- a/src/homescreen/CicoHSMenuTile.cpp +++ b/src/homescreen/CicoHSMenuTile.cpp @@ -18,7 +18,6 @@ #include #include #include -#include /*============================================================================*/ /* functions */ @@ -601,7 +600,6 @@ void CicoHSMenuTile::SetThumbnail(ico_syc_thumb_info_t *info) { Evas_Object *old_icon = icon; - struct ico_uifw_image_buffer *pixelbuf = NULL; int svx, svy; int unmap; int fd; @@ -775,10 +773,6 @@ CicoHSMenuTile::SetThumbnail(ico_syc_thumb_info_t *info) } } } - if (pixelbuf != NULL) { - // free shared memory pixel buffer - pixelbuf->reftime = pixelbuf->settime; - } } /*--------------------------------------------------------------------------*/ @@ -804,4 +798,45 @@ CicoHSMenuTile::ShowMenu(bool show) ICO_HS_MENUTILE_THUMBNAIL_FPS_HIDE, sWork); } } + +/*--------------------------------------------------------------------------*/ +/** + * @brief CicoHSMenuTile::SetOrgThumbnail + * set thumbnail form org tile + * + * @param[in] info org tile + * @return none + */ +/*--------------------------------------------------------------------------*/ +void +CicoHSMenuTile::SetOrgThumbnail(CicoHSMenuTile *orgTile) +{ + + ICO_DBG("CicoHSMenuTile::SetOrgThumbnail Enter(appid=%08x<%s>) run=%d surf=%08x", + (int)this->appid, this->appid, app_running, orgTile->thumb.surface ); + + /* check surface of orgTile */ + if ( orgTile == NULL || orgTile->thumb.surface == 0 ) { + return; + } + + /* set surface */ + this->ValidThumbnail( orgTile->thumb.surface ); + + /* set new thumbnail */ + ico_syc_thumb_info_t info; + + info.surface = orgTile->thumb.surface; + info.type = orgTile->thumb.type; + info.width = orgTile->thumb.width; + info.height = orgTile->thumb.height; + info.stride = orgTile->thumb.stride; + info.format = orgTile->thumb.format; + + SetThumbnail( &info ); + + ICO_DBG("CicoHSMenuTile::SetOrgThumbnail Leave(appid=%08x<%s>) run=%d surf=%08x", + (int)this->appid, this->appid, app_running, orgTile->thumb.surface ); + +} // vim: set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHSMenuTile.h b/src/homescreen/CicoHSMenuTile.h index 99e340f..a795534 100644 --- a/src/homescreen/CicoHSMenuTile.h +++ b/src/homescreen/CicoHSMenuTile.h @@ -26,7 +26,6 @@ #include "ico_syc_common.h" #include "ico_syc_winctl.h" -#include "ico_window_mgr.h" #include "CicoHomeScreenCommon.h" @@ -126,6 +125,7 @@ class CicoHSMenuTile void ValidThumbnail(int surface); void SetThumbnail(ico_syc_thumb_info_t *info); void ShowMenu(bool show); + void SetOrgThumbnail(CicoHSMenuTile *orgTile); private: char appid[ICO_HS_MAX_PROCESS_NAME]; diff --git a/src/homescreen/CicoHSMenuWindow.cpp b/src/homescreen/CicoHSMenuWindow.cpp index 1d4e109..4839005 100644 --- a/src/homescreen/CicoHSMenuWindow.cpp +++ b/src/homescreen/CicoHSMenuWindow.cpp @@ -436,10 +436,15 @@ CicoHSMenuWindow::RenewAppTiles(void) { ICO_TRA("CicoHSMenuWindow::RenewAppTiles Enter"); + int cnt, cnt2; int ret; - /* free app tiles */ - FreeAppTiles(); + /* backup old data */ + int all_tile_num_org = all_tile_num; + CicoHSMenuTile *menu_tile_org[ICO_HS_MENU_MAX_TILE_NUM]; + for (cnt=0; cnt < all_tile_num_org; cnt++) { + menu_tile_org[cnt]=menu_tile[cnt]; + } /* initialization */ InitAppTiles(); @@ -453,6 +458,32 @@ CicoHSMenuWindow::RenewAppTiles(void) /* update app info list */ CicoHomeScreen::RenewAppInfoList(); + /* set thumbnail from org */ + for (cnt=0; cnt < all_tile_num; cnt++) { + if (menu_tile[cnt] == NULL) { + continue; + } + for (cnt2=0; cnt2 < all_tile_num_org; cnt2++) { + if (menu_tile_org[cnt2] == NULL) { + continue; + } + if (strncmp(menu_tile[cnt]->GetAppId(), + menu_tile_org[cnt2]->GetAppId(), ICO_HS_MAX_PROCESS_NAME) == 0) { + menu_tile[cnt]->SetOrgThumbnail( menu_tile_org[cnt2] ); + break; + } + } + } + + /* free org app tiles */ + for (cnt2=0; cnt2 < all_tile_num_org; cnt2++) { + if (menu_tile_org[cnt2] == NULL) { + continue; + } + menu_tile_org[cnt2]->FreeObject(); + delete menu_tile_org[cnt2]; + } + ICO_TRA("CicoHSMenuWindow::RenewAppTiles Leave"); } diff --git a/src/homescreen/CicoHSSwipeInputWindow.cpp b/src/homescreen/CicoHSSwipeInputWindow.cpp index f1aa167..2edcd1e 100644 --- a/src/homescreen/CicoHSSwipeInputWindow.cpp +++ b/src/homescreen/CicoHSSwipeInputWindow.cpp @@ -98,6 +98,9 @@ CicoHSSwipeInputWindow::CreateSwipeInputWindow(int pos_x, int pos_y, /* background object(transparent) */ background = evas_object_image_filled_add(evas); +#if 0 /* TEST TEST: no need? */ + evas_object_color_set(background, 0, 0, 0, 0); +#endif /* set mouse/touch callback */ evas_object_event_callback_add(background, EVAS_CALLBACK_MOUSE_DOWN, @@ -106,7 +109,6 @@ CicoHSSwipeInputWindow::CreateSwipeInputWindow(int pos_x, int pos_y, CicoHSSwipeTouch::TouchUpSwipe, this); evas_object_event_callback_add(background, EVAS_CALLBACK_MOUSE_MOVE, CicoHSSwipeTouch::TouchMoveSwipe, this); - /* move and show window */ evas_object_move(background, 0, 0); evas_object_resize(background, width, height); @@ -156,13 +158,16 @@ CicoHSSwipeInputWindow::SetupSwipeWindow(void) move.width = width; move.height = height; memset(&show, 0, sizeof(show)); - show.time = ICO_SYC_WIN_SURF_RAISE; + show.name = (char *)"none"; + /* set default animation */ + ico_syc_set_animation(appid, surface, ICO_SYC_ANIMATION_TYPE_ALL, &show); /* 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 */ + show.time = ICO_SYC_WIN_SURF_RAISE; ico_syc_show(appid, surface, &show); /* show touch layer */ diff --git a/src/homescreen/CicoHSSwipeTouch.h b/src/homescreen/CicoHSSwipeTouch.h index 9afec56..e1665ef 100644 --- a/src/homescreen/CicoHSSwipeTouch.h +++ b/src/homescreen/CicoHSSwipeTouch.h @@ -23,9 +23,10 @@ #include "CicoHSControlBarWindow.h" #include "CicoHSAppHistoryExt.h" -#define ICO_HS_SWIPE_TOUCH_SWIPE_WIDTH 60 -#define ICO_HS_SWIPE_TOUCH_SWIPE_HEIGHT 60 -#define ICO_HS_SWIPE_TOUCH_DISTANCE_XY 100 +#define ICO_HS_SWIPE_TOUCH_SWIPE_WIDTH 80 +#define ICO_HS_SWIPE_TOUCH_SWIPE_HEIGHT 80 +#define ICO_HS_SWIPE_TOUCH_DISTANCE_XY1 80 +#define ICO_HS_SWIPE_TOUCH_DISTANCE_XY2 100 #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.0d diff --git a/src/homescreen/CicoHSWindow.cpp b/src/homescreen/CicoHSWindow.cpp index 5e5726a..1532716 100644 --- a/src/homescreen/CicoHSWindow.cpp +++ b/src/homescreen/CicoHSWindow.cpp @@ -70,8 +70,8 @@ CicoHSWindow::CreateWindow(const char *title,int pos_x,int pos_y,int width,int h EINA_LOG_CRIT("CicoHSWindow::Initialize: could not create new_window."); return ICO_ERROR; } - strncpy(this->title,title,ICO_MAX_TITLE_NAME_LEN); - ecore_evas_title_set(window,this->title); + strncpy(this->title, title, ICO_MAX_TITLE_NAME_LEN); + ecore_evas_title_set(window, this->title); /* alpha channel is enable*/ ecore_evas_alpha_set(window, alpha); diff --git a/src/homescreen/CicoHomeScreen.cpp b/src/homescreen/CicoHomeScreen.cpp index 5ce5b46..e748321 100644 --- a/src/homescreen/CicoHomeScreen.cpp +++ b/src/homescreen/CicoHomeScreen.cpp @@ -313,7 +313,7 @@ void CicoHomeScreen::requestChangeZone(CicoHSAppInfo* appinfo) { int surface = appinfo->GetLastSurface(); - ICO_TRA("Enter appid=%s, lastsurface=%d", appinfo->GetAppId(), surface); + ICO_TRA("Enter appid=%s, lastsurface=%x", appinfo->GetAppId(), surface); ico_hs_window_info* wininfo = appinfo->GetWindowInfobySurface(surface); if (NULL == wininfo) { ICO_TRA("Leave(not found wininfo)"); @@ -1541,9 +1541,9 @@ CicoHomeScreen::CreateSwipeInputWindow(void) swipe_input_windows[0] = new CicoHSSwipeInputWindow(); swipe_input_windows[0]-> CreateSwipeInputWindow(ICO_HS_WINDOW_POS_X, - full_height / 2 + ICO_HS_SWIPE_TOUCH_DISTANCE_XY, + full_height / 2 + ICO_HS_SWIPE_TOUCH_DISTANCE_XY1, ICO_HS_SWIPE_TOUCH_SWIPE_WIDTH, - full_height / 2 - (ICO_HS_SWIPE_TOUCH_DISTANCE_XY*2), + full_height / 2 - (ICO_HS_SWIPE_TOUCH_DISTANCE_XY2*2), "left"); swipe_input_windows[0]->ShowWindow(); @@ -1551,9 +1551,9 @@ CicoHomeScreen::CreateSwipeInputWindow(void) swipe_input_windows[1] = new CicoHSSwipeInputWindow(); swipe_input_windows[1]-> CreateSwipeInputWindow(full_width - ICO_HS_SWIPE_TOUCH_SWIPE_WIDTH, - full_height / 2 + ICO_HS_SWIPE_TOUCH_DISTANCE_XY, + full_height / 2 + ICO_HS_SWIPE_TOUCH_DISTANCE_XY1, ICO_HS_SWIPE_TOUCH_SWIPE_WIDTH, - full_height / 2 - (ICO_HS_SWIPE_TOUCH_DISTANCE_XY*2), + full_height / 2 - (ICO_HS_SWIPE_TOUCH_DISTANCE_XY2*2), "right"); swipe_input_windows[1]->ShowWindow(); @@ -1648,6 +1648,8 @@ static Eina_Bool launchApps(void* data) int CicoHomeScreen::StartHomeScreen(int orientation) { + int retry; + ICO_TRA("CicoHomeScreen::StartHomeScreen Enter"); /*save instance pointer */ @@ -1691,6 +1693,11 @@ CicoHomeScreen::StartHomeScreen(int orientation) ICO_DBG("CicoHomeScreen::StartHomeScreen: start connect to systemcontroller"); ico_syc_connect(EventCallBack,NULL); + for (retry = 0; retry < (2000/10); retry++) { + ico_syc_service(); + if (ico_syc_isconnect()) break; + usleep(10*1000); + } ICO_DBG("CicoHomeScreen::StartHomeScreen: end connect to systemcontroller"); /*initialize system controller*/ diff --git a/src/onscreen/CicoOSPopWindow.cpp b/src/onscreen/CicoOSPopWindow.cpp index 724f1f6..104fda2 100644 --- a/src/onscreen/CicoOSPopWindow.cpp +++ b/src/onscreen/CicoOSPopWindow.cpp @@ -70,7 +70,7 @@ CicoOSPopWindow::CicoOSPopWindow(notification_h noti) : CicoNotification(noti) //-------------------------------------------------------------------------- CicoOSPopWindow::~CicoOSPopWindow(void) { -// ICO_TRA("Enter"); + ICO_TRA("Enter sur:%d, priv_id:%d", m_resourceId, GetPrivId()); if (NULL != m_window) { ecore_evas_free(m_window); m_window = NULL; @@ -84,7 +84,7 @@ CicoOSPopWindow::~CicoOSPopWindow(void) ICO_DBG("_____ %d = ico_syc_release_res", r); } -// ICO_TRA("Leave"); + ICO_TRA("Leave"); } //-------------------------------------------------------------------------- @@ -252,14 +252,10 @@ bool CicoOSPopWindow::InitializeWindow(void) { ICO_TRA("Enter"); - // Window setup - m_window = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, "frame=0"); - if (NULL == m_window) { - ICO_ERR("ecore_evas_new() error"); + if (false == createMainWindow()) { ICO_TRA("Leave(ERR)"); return false; } - ecore_evas_show(m_window); m_theme = edje_object_add(ecore_evas_get(m_window)); if (NULL == m_theme) { ICO_ERR("could not create edje object!"); @@ -307,6 +303,22 @@ CicoOSPopWindow::InitializeWindow(void) return true; } +bool +CicoOSPopWindow::createMainWindow() +{ + ICO_TRA("Enter"); + // Window setup + m_window = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, "frame=0"); + if (NULL == m_window) { + ICO_ERR("ecore_evas_new() error"); + ICO_TRA("Leave(ERR)"); + return false; + } + ecore_evas_show(m_window); + ICO_TRA("Leave"); + return true; +} + //-------------------------------------------------------------------------- /** * @brief callback function of evas mouse up event diff --git a/src/onscreen/CicoOSPopWindow.h b/src/onscreen/CicoOSPopWindow.h index c6eed98..5c27360 100644 --- a/src/onscreen/CicoOSPopWindow.h +++ b/src/onscreen/CicoOSPopWindow.h @@ -125,6 +125,7 @@ public: const CicoNotification& getNotif() const { return (const CicoNotification&)*this; } + bool createMainWindow(); private: bool InitializeWindow(void); static void evasMouseUpCB(void *data, Evas *e, Evas_Object *obj, diff --git a/src/onscreen/CicoOnScreen.cpp b/src/onscreen/CicoOnScreen.cpp index 270d07f..69b64e0 100644 --- a/src/onscreen/CicoOnScreen.cpp +++ b/src/onscreen/CicoOnScreen.cpp @@ -102,6 +102,7 @@ CicoOnScreen::StartOnScreen(void) if (NULL == m_reserve) { m_reserve = new CicoOSPopWindow(NOTIFICATION_TYPE_NONE); + m_reserve->createMainWindow(); } // set notification callback function diff --git a/src/statusbar/CicoComponentImplementation.cpp b/src/statusbar/CicoComponentImplementation.cpp index 3adbccc..8f7a15a 100644 --- a/src/statusbar/CicoComponentImplementation.cpp +++ b/src/statusbar/CicoComponentImplementation.cpp @@ -95,7 +95,7 @@ const int CicoStatusBarClockComponent::CLOCK_COMPONENT_HEIGHT = HOUR10_HEIGHT; */ /*--------------------------------------------------------------------------*/ CicoStatusBarClockComponent::CicoStatusBarClockComponent() - : rate_(1.0) + : rate_(1.0) { } @@ -189,7 +189,7 @@ CicoStatusBarClockComponent::Initialize(Evas_Object *windowobj, int posx, int po PackModule(min1_module); SetPos(posx, posy); - SetSize(AMPM_WIDTH + HOUR10_WIDTH + HOUR1_WIDTH + COLON_WIDTH + + SetSize(AMPM_WIDTH + HOUR10_WIDTH + HOUR1_WIDTH + COLON_WIDTH + MIN10_WIDTH + MIN1_WIDTH, AMPM_HEIGHT); SetRate(1.5); @@ -216,13 +216,9 @@ CicoStatusBarClockComponent::Update() time_t nowtime; nowtime = std::time(NULL); - // Add 9 hour because std::time is JST. - nowtime += 9 * 60 * 60; - time_t sec = nowtime % 60; - nowtime -= sec; - time_t min = (nowtime % (60 * 60)) / 60; - nowtime -= min * 60; - time_t hour = (nowtime % (60 * 60 * 60)) / (60 * 60); + std::tm *tm = std::localtime(&nowtime); + int min = tm->tm_min; + int hour = tm->tm_hour; std::shared_ptr imagemodule; assert(!modulelist_.empty()); @@ -240,7 +236,7 @@ CicoStatusBarClockComponent::Update() else { if (!imagemodule->SetFilePath(imgfilepath_am)) { ICO_TRA("CicoStatusBarClockComponent::Update Leave(false)"); - return false; + return false; } } imagemodule->SetSize(rate_ * AMPM_WIDTH, rate_ * AMPM_HEIGHT); @@ -256,7 +252,7 @@ CicoStatusBarClockComponent::Update() return false; } imagemodule->SetSize(rate_ * HOUR10_WIDTH, rate_ * HOUR10_HEIGHT); - imagemodule->SetPos(posx_ + rate_ * RELATIVE_HOUR10_POSX, + imagemodule->SetPos(posx_ + rate_ * RELATIVE_HOUR10_POSX, posy_ + rate_ * RELATIVE_HOUR10_POSY); imagemodule->Show(); @@ -314,7 +310,7 @@ CicoStatusBarClockComponent::Update() /*--------------------------------------------------------------------------*/ /** - * @brief set rate of clock component + * @brief set rate of clock component * * @param[in] rate * @return true: success false: failed @@ -352,7 +348,7 @@ const int CicoNotificationPanelComponent::FONT_SIZE = 50; * @brief default constructor * * @param[in] none - * @return none + * @return none */ /*--------------------------------------------------------------------------*/ CicoNotificationPanelComponent::CicoNotificationPanelComponent()