corresponding to GENIVI layer management.
Bug-Tizen: TIVI-1412
Change-Id: I2b28b6b5f01b8512ab20617bba4b72d9c3919a92
Signed-off-by: Masayuki Sasaki <masayuki.sasaki@mail.toyota-td.jp>
AC_SUBST(UWS_CFLAGS)
AC_SUBST(UWS_LIBS)
-GENIVI_CFLAGS="-I/usr/include/ilm -I/usr/include/layermanager"
+GENIVI_CFLAGS="-I/usr/include/ilm"
GENIVI_LIBS="-lilmCommon -lilmControl -lilmClient"
AC_SUBST(GENIVI_CFLAGS)
AC_SUBST(GENIVI_LIBS)
*/
typedef enum _resource_type {
ICO_SYC_RES_BASIC = 0,
- ICO_SYC_RES_INTERRUPT = 1
+ ICO_SYC_RES_INTERRUPT = 1,
+ ICO_SYC_RES_ONSCREEN = 2
} ico_syc_res_type_e;
/*
/*
- * 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
#define MSG_PRMKEY_STRIDE (char *)"stride"
#define MSG_PRMKEY_FORMAT (char *)"format"
#define MSG_PRMKEY_RATE (char *)"framerate"
+
+#define MSG_PRMKEY_ECU (char *)"ECU"
+#define MSG_PRMKEY_DISPLAY (char *)"display"
+/* #define MSG_PRMKEY_LAYER (char *)"layer" */
+#define MSG_PRMKEY_LAYOUT (char *)"layout"
+#define MSG_PRMKEY_AREA (char *)"area"
+#define MSG_PRMKEY_DISPATCHAPP (char *)"dispatchApp"
+#define MSG_PRMKEY_ROLE (char *)"role"
+#define MSG_PRMKEY_RESOURCEID (char *)"resourceId"
+
/* user controller */
#define MSG_PRMKEY_USER (char *)"user"
#define MSG_PRMKEY_PASSWD (char *)"password"
#define MSG_CMD_DEPRIVE_RES 0x00040003
#define MSG_CMD_WAITING_RES 0x00040004
#define MSG_CMD_REVERT_RES 0x00040005
+#define MSG_CMD_WINDOW_ID_RES 0x00040006
/* input device setting */
#define MSG_CMD_SET_REGION 0x00050001
#define MSG_CMD_UNSET_REGION 0x00050002
#define ICO_SYC_LAYER_APPLICATION 1 /* layer of Application */
#define ICO_SYC_LAYER_HOMESCREEN 2 /* layer of HomeScreen menu */
#define ICO_SYC_LAYER_CONTROLBAR 3 /* layer of Control/Status bar */
-#define ICO_SYC_LAYER_FULLSCREEN 4 /* layer of FullScreen Application */
-#define ICO_SYC_LAYER_ONSCREEN 5 /* layer of OnScreen */
+#define ICO_SYC_LAYER_INTERRUPTAPP 4 /* layer of Interrupt Application */
+#define ICO_SYC_LAYER_ONSCREEN 5 /* lay er of OnScreen */
#define ICO_SYC_LAYER_TOUCHPANEL 6 /* layer of TouchPanel input */
#define ICO_SYC_LAYER_CURSOR 7 /* layer of Cursor */
-#define ICO_SYC_LAYER_MATERAPP 3 /* layer of Meter application */
+#define ICO_SYC_LAYER_MATERMAIN 1001 /* layer of Meter Main display Application */
+#define ICO_SYC_LAYER_MATERSUB 1002 /* layer of Meter Sub display Application */
+#define ICO_SYC_LAYER_MATERSUBSUB 1003 /* layer of Meter Sub display SubApplication */
#ifdef __cplusplus
}
/*
- * 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
* @brief header file of System Controller
* for privilege and general applications
*
- * @date Feb-21-2014
+ * @date Aug-6-2013
*/
#ifndef _ICO_SYC_TYPE_H_
ICO_SYC_EV_RES_WAITING = 13, /* waiting resource */
ICO_SYC_EV_RES_REVERT = 14, /* reverted resource */
ICO_SYC_EV_RES_RELEASE = 15, /* released resource */
- ICO_SYC_EV_INPUT_SET = 16, /* set input region */
- ICO_SYC_EV_INPUT_UNSET = 17, /* unset input region */
- ICO_SYC_EV_LASTINFO = 18, /* notify the last information */
- ICO_SYC_EV_STATE_CHANGE = 19, /* notify changed state */
- ICO_SYC_EV_WIN_NAME = 20 /* notify window name */
+ ICO_SYC_EV_RES_WINDOW_ID = 16, /* notice window id resource */
+ ICO_SYC_EV_INPUT_SET = 17, /* set input region */
+ ICO_SYC_EV_INPUT_UNSET = 18, /* unset input region */
+ ICO_SYC_EV_LASTINFO = 19, /* notify the last information */
+ ICO_SYC_EV_STATE_CHANGE = 20, /* notify changed state */
+ ICO_SYC_EV_WIN_NAME = 21 /* notify window name */
} ico_syc_ev_e;
/*
* @ICO_SYC_WIN_VISIBLE_NOCHANGE: show/hide status is not change
*/
typedef enum _window_visible {
- ICO_SYC_WIN_VISIBLE_SHOW = 1,
- ICO_SYC_WIN_VISIBLE_HIDE = 0,
- ICO_SYC_WIN_VISIBLE_NOCHANGE = 9
+ ICO_SYC_WIN_VISIBLE_SHOW = 1,
+ ICO_SYC_WIN_VISIBLE_HIDE = 0,
+ ICO_SYC_WIN_VISIBLE_NOCHANGE = 9
} ico_syc_win_visible_e;
/*
* window resource information
*/
typedef struct _res_win {
- char *zone; /* area of showing application window */
- char *name; /* window's surface name */
- char *id; /* window id */
+/*- char *zone; */ /* area of showing application window */
+/*- char *name; */ /* window's surface name */
+/*- char *id; */ /* window id */
+ char *ECU; /* name to identify ECU */
+ char *display; /* name to identify Display in ECU */
+ char *layer; /* name to identify Layer in Display */
+ char *layout; /* name to identify Layout in Layer */
+ char *area; /* name to Output position in Layout */
+ char *dispatchApp; /* dispatch of application */
+ char *role; /* role of notice */
+ uint32_t resourceId;/* ID number of resource(surface id) */
} ico_syc_res_window_t;
/*
typedef void (*ico_syc_callback_t) (const ico_syc_ev_e event,
const void *detail,
void *user_data);
+
#ifdef __cplusplus
}
#endif
/*============================================================================*/
/* define static function prototype */
/*============================================================================*/
-static ico_syc_res_window_t *_create_res_window(char *zone,
- char *name, char *id);
+static ico_syc_res_window_t *_create_res_window(const char *ECU,
+ const char *display,
+ const char *layer,
+ const char *layout,
+ const char *area,
+ const char *dispatchApp,
+ const char *role,
+ uint32_t resourceId);
static ico_syc_res_sound_t *_create_res_sound(char *zone, char *name, char *id,
int adjust);
static ico_syc_res_input_t *_create_res_input(char *name, int event);
*/
/*--------------------------------------------------------------------------*/
static ico_syc_res_window_t *
-_create_res_window(char *zone, char *name, char *id)
+ _create_res_window(const char *ECU, const char *display, const char *layer,
+ const char *layout, const char *area,
+ const char *dispatchApp, const char *role,
+ uint32_t resourceId)
{
ico_syc_res_window_t *info = NULL;
- if (zone == NULL || name == NULL) {
+ if ((NULL == ECU) || (NULL == display) || (NULL == layer) ||
+ (NULL == layout) || (NULL == area) || (NULL == dispatchApp) ||
+ (NULL == role)) {
_ERR("invalid parameter (zone, name is NULL)");
return NULL;
}
}
/* set element */
- info->zone = strdup(zone);
- info->name = strdup(name);
- if (id != NULL) {
- info->id = strdup(id);
- }
+ info->ECU = strdup(ECU);
+ info->display = strdup(display);
+ info->layer = strdup(layer);
+ info->layout = strdup(layout);
+ info->area = strdup(area);
+ info->dispatchApp = strdup(dispatchApp);
+ info->role = strdup(role);
+ info->resourceId = resourceId;
return info;
}
*/
/*--------------------------------------------------------------------------*/
static void
-_free_res_window(ico_syc_res_window_t *window)
+_free_res_window(ico_syc_res_window_t *w)
{
- if (window == NULL) {
+ if (w == NULL) {
return;
}
/* free element */
- if (window->zone != NULL) free(window->zone);
- if (window->name != NULL) free(window->name);
- if (window->id != NULL) free(window->id);
+ if (NULL != w->ECU) free(w->ECU);
+ if (NULL != w->display) free(w->display);
+ if (NULL != w->layer) free(w->layer);
+ if (NULL != w->layout) free(w->layout);
+ if (NULL != w->area) free(w->area);
+ if (NULL != w->dispatchApp) free(w->dispatchApp);
+ if (NULL != w->role) free(w->role);
/* free */
- free(window);
+ free(w);
return;
}
*/
/*--------------------------------------------------------------------------*/
static struct ico_syc_res_context *
-_create_context(char *appid, const ico_syc_res_window_t *window,
+_create_context(char *appid, const ico_syc_res_window_t *w,
const ico_syc_res_sound_t *sound,
const ico_syc_res_input_t *input,
int type)
strcpy(context->appid, appid);
/* set window info */
- if (window != NULL) {
- context->window = _create_res_window(window->zone, window->name,
- window->id);
+ if (w != NULL) {
+ context->window = _create_res_window(w->ECU, w->display, w->layer,
+ w->layout, w->area,
+ w->dispatchApp, w->role,
+ w->resourceId);
}
/* set sound info */
if (sound != NULL) {
}
/* set resource type */
- if (window != NULL || sound != NULL) {
+ if (w != NULL || sound != NULL) {
context->type = type;
}
*/
/*--------------------------------------------------------------------------*/
static JsonObject *
-_create_window_msg(ico_syc_res_window_t *window)
+_create_window_msg(ico_syc_res_window_t *w)
{
JsonObject *info = NULL;
- if (window == NULL) {
+ if (w == NULL) {
_ERR("invalid parameter (window is NULL)");
return NULL;
}
}
/* set member */
- json_object_set_string_member(info, MSG_PRMKEY_RES_ZONE, window->zone);
- json_object_set_string_member(info, MSG_PRMKEY_RES_NAME, window->name);
- json_object_set_string_member(info, MSG_PRMKEY_RES_ID, window->id);
+ json_object_set_string_member(info, MSG_PRMKEY_ECU, w->ECU);
+ json_object_set_string_member(info, MSG_PRMKEY_DISPLAY, w->display);
+ json_object_set_string_member(info, MSG_PRMKEY_LAYER, w->layer);
+ json_object_set_string_member(info, MSG_PRMKEY_LAYOUT, w->layout);
+ json_object_set_string_member(info, MSG_PRMKEY_AREA, w->area);
+ json_object_set_string_member(info, MSG_PRMKEY_DISPATCHAPP, w->dispatchApp);
+ json_object_set_string_member(info, MSG_PRMKEY_ROLE, w->role);
+ json_object_set_int_member(info, MSG_PRMKEY_RESOURCEID, w->resourceId);
return info;
}
ico_syc_res_info_t *res_info = NULL;
char *zone, *name, *id;
int adjust, input_ev;
+ char *ECU, *display, *layer, *layout, *area, *dispatchApp, *role;
+ uint32_t resourceId;
+
/* alloc memory */
res_info = calloc(1, sizeof(ico_syc_res_info_t));
/* window resource */
if (json_object_has_member(resobj, MSG_PRMKEY_RES_WINDOW) == TRUE) {
info = json_object_get_object_member(resobj, MSG_PRMKEY_RES_WINDOW);
- zone = ico_syc_get_str_member(info, MSG_PRMKEY_RES_ZONE);
- name = ico_syc_get_str_member(info, MSG_PRMKEY_RES_NAME);
- id = ico_syc_get_str_member(info, MSG_PRMKEY_RES_ID);
-
- res_info->window = _create_res_window(zone, name, id);
+ ECU = ico_syc_get_str_member(info, MSG_PRMKEY_ECU);
+ display = ico_syc_get_str_member(info, MSG_PRMKEY_DISPLAY);
+ layer = ico_syc_get_str_member(info, MSG_PRMKEY_LAYER);
+ layout = ico_syc_get_str_member(info, MSG_PRMKEY_LAYOUT);
+ area = ico_syc_get_str_member(info, MSG_PRMKEY_AREA);
+ dispatchApp = ico_syc_get_str_member(info, MSG_PRMKEY_DISPATCHAPP);
+ role = ico_syc_get_str_member(info, MSG_PRMKEY_ROLE);
+ resourceId = (uint32_t)
+ ico_syc_get_int_member(info, MSG_PRMKEY_RESOURCEID);
+ res_info->window = _create_res_window(ECU, display, layer, layout,
+ area, dispatchApp, role,
+ resourceId);
}
/* sound resource */
case MSG_CMD_RELEASE_RES:
event = ICO_SYC_EV_RES_RELEASE;
break;
+ case MSG_CMD_WINDOW_ID_RES:
+ event = ICO_SYC_EV_RES_WINDOW_ID;
+ break;
case MSG_CMD_SET_REGION:
event = ICO_SYC_EV_INPUT_SET;
break;
case ICO_SYC_EV_RES_WAITING:
case ICO_SYC_EV_RES_REVERT:
case ICO_SYC_EV_RES_RELEASE:
+ case ICO_SYC_EV_RES_WINDOW_ID:
ico_syc_cb_res(syc_callback, user_data, event,
recv_data->data, recv_data->len);
break;
* ICO_SYC_EV_RES_DEPRIVE
* ICO_SYC_EV_RES_WAITING
* ICO_SYC_EV_RES_REVERT
- * ICO_SYC_EV_RES_RELEASE)
+ * ICO_SYC_EV_RES_RELEASE
+ * ICO_SYC_EV_RES_WINDOW_ID)
*
* @param[in] callback callback function
* @param[in] user_data pased data on called callback function
#define ICO_SYC_CONFIG_APPATTR "app_attr.conf" //TODO
+#define ICO_SYC_ROLE_CONF_DEF -1
+#define ICO_SYC_ROLE_CONF_DEF_STR "DEFAULT"
+#define ICO_SYC_ROLE_CONF_RST 14999
+#define ICO_SYC_ROLE_CONF_RST_STR "RESET"
+
//==========================================================================
/**
* @brief This class holds display information of system config
public:
/// default constructor
CicoSCLayerConf()
- : id(-1), name(""), type(-1), menuoverlap(false) {}
+ : id(-1), name(""), type(-1), menuoverlap(false),
+ layout_id(-1), layout_name(""), area_id(-1), area_name("") {}
/// destructor
virtual ~CicoSCLayerConf() {}
/// dump log this class member variables
void dumpConf(void)
{
- ICO_DBG(" layer: id=%d name=%s type=%d menuoverlap=%s",
- id, name.c_str(), type, menuoverlap ? "true" : "false");
+ if(-1 != layout_id) {
+ ICO_DBG(" layer: %d, \"%s\" type=%d menuoverlap=%s layout: %d, \"%s\" area: %d, \"%s\"",
+ id, name.c_str(), type, menuoverlap ? "true" : "false",
+ layout_id, layout_name.c_str(), area_id, area_name.c_str());
+ }
+ else{
+ ICO_DBG(" layer: %d, \"%s\" type=%d menuoverlap=%s",
+ id, name.c_str(), type, menuoverlap ? "true" : "false");
+ }
}
public:
std::string name; ///< layer name
int type; ///< layer type
bool menuoverlap; ///< menu overlap flag
+ int layout_id; ///< layoyt id
+ std::string layout_name; ///< layout name
+ int area_id; ///< area id
+ std::string area_name; ///< area name
};
//==========================================================================
std::map<int, CicoSCVIPropertyConf*> properties;
};
+//==========================================================================
+/**
+ * @brief This class Role of system config
+ */
+//==========================================================================
+class CicoSCRoleConf
+{
+public:
+ /// constructor
+ CicoSCRoleConf()
+ : m_def(ICO_SYC_ROLE_CONF_DEF), m_rst(ICO_SYC_ROLE_CONF_RST) {}
+ /// destructor
+ virtual ~CicoSCRoleConf() {}
+ /// dump log this class member variables
+ void dumpConf(void)
+ {
+ ICO_DBG("Role info: default=%d, reset=%d, size=%d",
+ (int)m_def, (int)m_rst, (int)m_stt.size());
+ std::map<std::string, short>::iterator itr;
+ itr = m_stt.begin();
+ for(; itr != m_stt.end(); ++itr) {
+ ICO_DBG(" key=\"%s\", stt=%d", itr->first.c_str(),
+ (int)itr->second);
+ }
+ }
+
+
+public:
+ short m_def;
+ short m_rst;
+ std::map<std::string, short> m_stt;
+};
+
+//==========================================================================
+/**
+ * @brief This class position onscreen window x,y
+ */
+//==========================================================================
+class CicoSCPositionOSConf
+{
+public:
+ /// constructor
+ CicoSCPositionOSConf()
+ : m_x(0), m_y(0), m_w(1080), m_h(1920) {}
+ /// destructor
+ virtual ~CicoSCPositionOSConf() {}
+ /// dump log this class member variables
+ void dumpConf(void)
+ {
+ ICO_DBG("OnScreen Window position : x:%d, y:%d, w:%d, h:%d", m_x, m_y, m_w, m_h);
+ }
+public:
+ int m_x;
+ int m_y;
+ int m_w;
+ int m_h;
+};
#endif // __CICO_CONF_H__
// vim:set expandtab ts=4 sw=4:
*
*/
-/*========================================================================*/
+/*========================================================================*/
/**
* @file CicoSystemConfig.cpp
*
* @brief This file implementation of CicoSystemConfig class
*/
-/*========================================================================*/
+/*========================================================================*/
#include <ico_log.h>
#include <boost/property_tree/ptree.hpp>
#include "CicoConf.h"
using namespace boost::property_tree;
-//==========================================================================
+//==========================================================================
// private static variable
-//==========================================================================
+//==========================================================================
CicoSystemConfig* CicoSystemConfig::ms_myInstance = NULL;
//--------------------------------------------------------------------------
m_displayTypeTable["rearleft"] = ICO_DISPLAYTYPE_REARLEFT;
m_displayTypeTable["rearright"] = ICO_DISPLAYTYPE_REARRIGHT;
- //
+ //
m_categoryTalbe[""] = ICO_POLICY_ALWAYS;
m_categoryTalbe["always"] = ICO_POLICY_ALWAYS;
m_categoryTalbe["run"] = ICO_POLICY_RUNNING;
createResourceConf(root);
createUserConf(root);
createVehicleInfoConf(root);
+ createRoleConf(root);
+ createPositionOSConf(root);
}
catch (...) {
ICO_ERR("catch exception!");
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
+ *
+ * @param [in]
+ */
+//--------------------------------------------------------------------------
+void
+CicoSystemConfig::createLayoutConfContainedArea(
+ const ptree::value_type& layout,
+ const optional<int>& layer_id, const optional<string>& layer_name,
+ const optional<int>& layout_id, const optional<string>& layout_name,
+ CicoSCDisplayConf* displayConf)
+{
+ ptree areas = layout.second.get_child("areas");
+ BOOST_FOREACH (const ptree::value_type& area, areas) {
+ optional<int> id = optional<int>(-1);
+ optional<string> name;
+ optional<int> type = optional<int>(-1);
+ optional<bool> overlap = optional<bool>(false);
+
+ id = area.second.get_optional<int>("<xmlattr>.id");
+ if (false == id.is_initialized()) {
+ ICO_ERR("disply.layer.layout.area.id attr not found");
+ continue;
+ }
+ name = area.second.get_optional<string>("<xmlattr>.name");
+ if (false == name.is_initialized()) {
+ ICO_ERR("disply.layer.layout.area.name attr not found");
+ continue;
+ }
+ type = area.second.get_optional<int>("type");
+ if (false == type.is_initialized()) {
+ ICO_ERR("disply.layer.layout.area.type element not found");
+ continue;
+ }
+ overlap = area.second.get_optional<bool>("menuoverlap");
+ if (false == overlap.is_initialized()) {
+ ICO_ERR("disply.layer.layout.area.overlap element not found");
+ continue;
+ }
+
+ CicoSCLayerConf* layerConf = new CicoSCLayerConf();
+ layerConf->id = layer_id.get();
+ layerConf->name = layer_name.get();
+ layerConf->type = type.get();
+ layerConf->menuoverlap = overlap.get();
+ layerConf->layout_id = layout_id.get();
+ layerConf->layout_name = layout_name.get();
+ layerConf->area_id = id.get();
+ layerConf->area_name = name.get();
+
+ displayConf->layerConfList.push_back(layerConf);
+
+ layerConf->dumpConf();
+ }
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief
+ *
+ * @param [in]
+ */
+//--------------------------------------------------------------------------
+void
+CicoSystemConfig::createLayerConfContainedLayout(
+ const ptree::value_type& layer,
+ const optional<int>& layer_id, const optional<string>& layer_name,
+ CicoSCDisplayConf* displayConf)
+{
+ ptree layouts = layer.second.get_child("layouts");
+ BOOST_FOREACH (const ptree::value_type& layout, layouts) {
+ optional<int> id = optional<int>(-1);
+ optional<string> name;
+
+ id = layout.second.get_optional<int>("<xmlattr>.id");
+ if (false == id.is_initialized()) {
+ ICO_ERR("disply.layer.layout.id attr not found");
+ continue;
+ }
+ name = layer.second.get_optional<string>("<xmlattr>.name");
+ if (false == name.is_initialized()) {
+ ICO_ERR("disply.layer.layout.name attr not found");
+ continue;
+ }
+ createLayoutConfContainedArea(layout, layer_id, layer_name, id, name,
+ displayConf);
+ }
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief
*
* @param [in]
*/
}
type = layer.second.get_optional<int>("type");
if (false == type.is_initialized()) {
- ICO_ERR("disply.layer.type element not found");
+// ICO_ERR("disply.layer.type element not found");
+ createLayerConfContainedLayout(layer, id, name, displayConf);
continue;
}
overlap = layer.second.get_optional<bool>("menuoverlap");
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
optional<string> input;
optional<int> priority = optional<int>(-1);
optional<int> r_ctrl = optional<int>(-1);
-
+
id = child.second.get_optional<int>("<xmlattr>.id");
if (false == id.is_initialized()) {
continue;
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
if (false == name.is_initialized()) {
continue;
}
-
+
CicoSCInputDevConf* inputDevConf = new CicoSCInputDevConf();
inputDevConf->id = id.get();
inputDevConf->name = name.get();
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
topdir = ICO_SYC_TOP_DIR;
}
m_defaultConf->topdir = topdir;
-
+
//TODO
#define ICO_SYC_CONFIG_ENV (char*)"SYSCON_CONFDIR"
#define ICO_SYC_CONFIG_DIR (char*)"res/config"
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
+ *
+ * @param [in]
+ */
+//--------------------------------------------------------------------------
+const CicoSCDisplayConf*
+CicoSystemConfig::findDisplayConfbyName(const string& ECU, const string& name)
+{
+ int nodeId = getNodeIdbyName(ECU);
+ vector<CicoSCDisplayConf*>::iterator itr;
+ itr = m_displayConfList.begin();
+ for (; itr != m_displayConfList.end(); ++itr) {
+ const CicoSCDisplayConf* conf = NULL;
+ conf = const_cast<CicoSCDisplayConf*>(*itr);
+ if ((name == conf->name)&&(nodeId == conf->node)) {
+ return conf;
+ }
+ }
+
+ return NULL;
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
for (; itr != displayConf->layerConfList.end(); ++itr) {
const CicoSCLayerConf* conf = NULL;
conf = const_cast<CicoSCLayerConf*>(*itr);
- if (layerName == conf->name) {
+// if (layerName == conf->name) {
+ if ((layerName == conf->name) && (-1 == conf->layout_id)) {
+ return conf;
+ }
+ }
+
+ return NULL;
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief
+ *
+ * @param [in]
+ */
+//--------------------------------------------------------------------------
+const CicoSCLayerConf*
+CicoSystemConfig::findLayerConfbyName(const string& ECU,
+ const string& display,
+ const string& layer,
+ const string& layout,
+ const string& area)
+{
+ const CicoSCDisplayConf* displayConf = NULL;
+ displayConf = findDisplayConfbyName(ECU, display);
+ if (NULL == displayConf) {
+ return NULL;
+ }
+
+ vector<CicoSCLayerConf*>::const_iterator itr;
+ itr = displayConf->layerConfList.begin();
+ for (; itr != displayConf->layerConfList.end(); ++itr) {
+ const CicoSCLayerConf* conf = NULL;
+ conf = const_cast<CicoSCLayerConf*>(*itr);
+ if ((layer == conf->name)&&(layout == conf->layout_name)&&
+ (area == conf->area_name)) {
return conf;
}
}
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
for (; itr != displayConf->layerConfList.end(); ++itr) {
const CicoSCLayerConf* conf = NULL;
conf = const_cast<CicoSCLayerConf*>(*itr);
- if (idx <= 0) {
+ if (idx <= 0) {
return conf;
}
- idx --;
+ idx --;
}
return NULL;
}
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
-void
-CicoSystemConfig::setDisplaySize(int id, int width, int height)
+int
+CicoSystemConfig::getLayerIdfbyName(const string & displayName,
+ const string & layerName)
{
- vector<CicoSCDisplayConf*>::iterator itr;
- itr = m_displayConfList.begin();
- for (; itr != m_displayConfList.end(); ++itr) {
- CicoSCDisplayConf* conf = NULL;
- conf = const_cast<CicoSCDisplayConf*>(*itr);
- if (id == conf->id) {
- ICO_TRA("CicoSystemConfig::setDisplaySize(%d,%d,%d) change size from %d,%d",
- id, width, height, conf->width, conf->height);
- conf->width = width;
- conf->height = height;
- return;
- }
+ const CicoSCLayerConf* conf = NULL;
+ conf = findLayerConfbyName(displayName, layerName);
+ if (NULL == conf) {
+ return -1;
}
- ICO_ERR("CicoSystemConfig::setDisplaySize(%d,%d,%d) Error", id, width, height);
+
+ return conf->id;
}
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
int
-CicoSystemConfig::getLayerIdfbyName(const string & displayName,
- const string & layerName)
+CicoSystemConfig::getLayerIdfbyName(const string& ECU,
+ const string& display,
+ const string& layer,
+ const string& layout,
+ const string& area)
{
const CicoSCLayerConf* conf = NULL;
- conf = findLayerConfbyName(displayName, layerName);
+ conf = findLayerConfbyName(ECU, display, layer, layout, area);
if (NULL == conf) {
return -1;
}
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
//--------------------------------------------------------------------------
/**
- * @brief
+ * @brief
*
* @param [in]
*/
vec.push_back(value);
}
}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief get state number from id key
+ *
+ * @param [in]
+ */
+//--------------------------------------------------------------------------
+short CicoSystemConfig::getRoleStt(const string& key)
+{
+ if ((CicoSCRoleConf*)NULL == m_roleConf) {
+ return ICO_SYC_ROLE_CONF_DEF;
+ }
+ short r;
+ map<string, short>::iterator p;
+ p = m_roleConf->m_stt.find(key);
+ if (p == m_roleConf->m_stt.end()) {
+ r = m_roleConf->m_def;
+ }
+ else {
+ r = p->second;
+ }
+ return r;
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief array xml tree to vector<int>
+ *
+ * @param [in]
+ */
+//--------------------------------------------------------------------------
+void CicoSystemConfig::createRoleConf(const ptree& root)
+{
+ m_roleConf = new CicoSCRoleConf();
+
+ ptree roles = root.get_child("systemconfig.on_screen_roles");
+ BOOST_FOREACH (const ptree::value_type& role, roles) {
+ optional<string> id;
+ optional<int> stt;
+ id = role.second.get_optional<string>("<xmlattr>.id");
+ if (false == id.is_initialized()) {
+ continue;
+ }
+ stt = role.second.get_optional<int>("<xmlattr>.state");
+ if (false == stt.is_initialized()) {
+ continue;
+ }
+ string v_key = id.get();
+ int v_stt = stt.get();
+ if (0 == v_key.compare(ICO_SYC_ROLE_CONF_DEF_STR)) { // default define
+ m_roleConf->m_def = (short)v_stt;
+ }
+ else if (0 == v_key.compare(ICO_SYC_ROLE_CONF_RST_STR)) { // reset event number
+ m_roleConf->m_rst = (short)v_stt;
+ }
+ else {
+ m_roleConf->m_stt.insert(pair<string, short>(v_key, (short)v_stt));
+ }
+ }
+ m_roleConf->dumpConf();
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief position OnScreen Config
+ *
+ * @param [in]
+ */
+//--------------------------------------------------------------------------
+void CicoSystemConfig::createPositionOSConf(const ptree& root)
+{
+ m_positionOSConf = new CicoSCPositionOSConf();
+ ptree posc = root.get_child("systemconfig.on_screen_position");
+
+ try {
+ optional<string> opts = posc.get_optional<string>("x");
+ if (true == opts.is_initialized()) {
+ m_positionOSConf->m_x = atoi(opts.get().c_str());
+ }
+ }
+ catch (...) {
+ ICO_WRN("NG x");
+ m_positionOSConf->m_x = 0;
+ }
+
+ try {
+ optional<string> opts = posc.get_optional<string>("y");
+ if (true == opts.is_initialized()) {
+ m_positionOSConf->m_y = atoi(opts.get().c_str());
+ }
+ }
+ catch (...) {
+ ICO_WRN("NG y");
+ m_positionOSConf->m_y = 0;
+ }
+
+ try {
+ optional<string> opts = posc.get_optional<string>("w");
+ if (true == opts.is_initialized()) {
+ m_positionOSConf->m_w = atoi(opts.get().c_str());
+ }
+ }
+ catch (...) {
+ ICO_WRN("NG w");
+ m_positionOSConf->m_w = 1080;
+ }
+
+ try {
+ optional<string> opts = posc.get_optional<string>("h");
+ if (true == opts.is_initialized()) {
+ m_positionOSConf->m_h = atoi(opts.get().c_str());
+ }
+ }
+ catch (...) {
+ ICO_WRN("NG h");
+ m_positionOSConf->m_h = 1920;
+ }
+ m_positionOSConf->dumpConf();
+}
+
// vim:set expandtab ts=4 sw=4:
using namespace std;
using namespace boost;
using namespace boost::property_tree;
-
+
//==========================================================================
// Forward declaration
//==========================================================================
class CicoSCResourceConf;
class CicoSCUserConf;
class CicoSCVehicleInfoConf;
+class CicoSCRoleConf;
+class CicoSCPositionOSConf;
#endif
//==========================================================================
* @brief This class has function of access to system config information
*/
//==========================================================================
-class CicoSystemConfig
+class CicoSystemConfig
{
public:
static CicoSystemConfig* getInstance(void);
const CicoSCNodeConf* findNodeConfbyName(const string & name);
const CicoSCDisplayConf* findDisplayConfbyName(const string & name);
+ const CicoSCDisplayConf* findDisplayConfbyName(const string& ECU,
+ const string& name);
const CicoSCDisplayConf* findDisplayConfbyId(int id);
+
const CicoSCLayerConf* findLayerConfbyName(const string & displayName,
const string & layerName);
- const CicoSCLayerConf* findLayerConfbyIdx(int displayid, int idx);
+ const CicoSCLayerConf* findLayerConfbyName(const string& ECU,
+ const string& display,
+ const string& layer,
+ const string& layout,
+ const string& area);
+ const CicoSCLayerConf* findLayerConfbyIdx(int displayid, int idx);
+
const CicoSCDisplayZoneConf* findDisplayZoneConfbyName(const string & displayName,
const string & zoneName);
const CicoSCSoundConf* findSoundConfbyName(const string & name);
const CicoSCDefaultConf* getDefaultConf(void);
-
int getNodeIdbyName(const string & name);
int getDisplayIdbyName(const string & name);
+ int getDisplayIdbyNo(int no);
int getLayerIdfbyName(const string & displayName,
const string & layerName);
+ int getLayerIdfbyName(const string& ECU,
+ const string& display,
+ const string& layer,
+ const string& layout,
+ const string& area);
int getDizplayZoneIdbyName(const string & displayName,
const string & zoneName);
int getDizplayZoneIdbyFullName(const string & zoneFullName);
const string & switchName);
int getAppKindIdbyName(const string & name);
int getCategoryIdbyName(const string & name);
- int getDisplayIdbyNo(int no);
- void setDisplaySize(int id, int width, int height);
-
const CicoSCResourceConf* getResourceConf() const
{
return m_resourceConf;
};
const CicoSCCategoryConf* getCategoryObjbyCaategoryID(int id);
- const CicoSCUserConf* getUserConf() const
+ const CicoSCUserConf* getUserConf() const
{
return m_userConf;
};
CicoSCVehicleInfoConf* getVehicleInfoConf(void);
-
+ short getRoleStt(const string& key);
+ const CicoSCRoleConf* getRoleConf() const
+ {
+ return m_roleConf;
+ };
+ const CicoSCPositionOSConf* positionOSConf() const
+ {
+ return m_positionOSConf;
+ };
private:
// default constructor
CicoSystemConfig();
void createNodeConfList(const ptree & root);
void createDisplayConfList(const ptree & root);
+ void createLayoutConfContainedArea(const ptree::value_type& layout,
+ const optional<int>& layer_id,
+ const optional<string>& layer_name,
+ const optional<int>& layout_id,
+ const optional<string>& layout_name,
+ CicoSCDisplayConf* displayConf);
+ void createLayerConfContainedLayout(const ptree::value_type& layer,
+ const optional<int>& layer_id,
+ const optional<string>& layer_name,
+ CicoSCDisplayConf* displayConf);
void createLayerConf(const ptree::value_type & child,
CicoSCDisplayConf* displayConf);
void createDisplayZoneConf(const ptree::value_type & child,
void createVehicleInfoConf(const ptree & root);
int calcGeometryExpr(const string & expr, CicoSCDisplayConf* conf);
+ void createRoleConf(const ptree& root);
+ void createPositionOSConf(const ptree& root);
private:
static CicoSystemConfig* ms_myInstance;
CicoSCResourceConf *m_resourceConf;
CicoSCUserConf *m_userConf;
CicoSCVehicleInfoConf *m_vehicleInfoConf;
+ CicoSCRoleConf *m_roleConf;
+ CicoSCPositionOSConf *m_positionOSConf;
};
#endif // __CICO_SYSTEM_CONFIG_H__
// vim:set expandtab ts=4 sw=4:
#include "CicoLog.h"
#include "ico_syc_error.h"
#include "ico_syc_msg_cmd_def.h"
+#include "ico_syc_mrp_resource_private.h"
//--------------------------------------------------------------------------
/**
* "zone": (string) window zone,
* "name": (string) window's surface name,
* "id": (string) window id
+ * "ECU":
+ * "display":
+ * "layer":
+ * "layout":
+ * "area":
+ * "dispatchApp":
+ * "role":
+ * "resourceId":
* },
* "sound": {
* "zone": (string) sound zone,
options->dispzone = getStrValue(root, "res.window.zone");
options->winname = getStrValue(root, "res.window.name");
options->surfaceid = getIntValue(root, "res.window.id");
+ bool bEx = true;
+ options->ECU = getStrValue(root, "res.window.ECU");
+ if (true == options->ECU.empty()) {
+ bEx = false;
+ }
+ options->display = getStrValue(root, "res.window.display");
+ if (true == options->display.empty()) {
+ bEx = false;
+ }
+ options->layer = getStrValue(root, "res.window.layer");
+ if (true == options->layer.empty()) {
+ bEx = false;
+ }
+ options->layout = getStrValue(root, "res.window.layout");
+ if (true == options->layout.empty()) {
+ bEx = false;
+ }
+ options->area = getStrValue(root, "res.window.area");
+ if (true == options->area.empty()) {
+ bEx = false;
+ }
+ options->dispatchApp= getStrValue(root, "res.window.dispatchApp");
+ options->role = getStrValue(root, "res.window.role");
+ options->resourceID= getIntValue(root, "res.window.resourceId");
+ options->dispresEx = bEx;
}
if (true == isExistObject(root, "res.sound")) {
options->input = getIntValue(root, "res.input.event");
}
- options->type = getIntValue(root, "type");
+ options->type = getIntValue(root, "res.type");
}
//--------------------------------------------------------------------------
CicoSCCmdResCtrlOpt()
: dispres(false), dispzone(""), layerid(-1), winname(""), surfaceid(-1),
animation(""), animationTime(0),
+ ECU(""), display(""), layer(""), layout(""), area(""), dispatchApp(""),
+ role(""), resourceID(-1),
soundres(false), soundzone(""), soundname(""), adjust(0),
inputres(false), device(""), input(0), type(0) {}
soundzone.c_str(), soundname.c_str(),
soundid, adjust, inputres ? "true" : "false",
device.c_str(), input, type);
+ ICO_DBG("ResCtrlOptEx: "
+ "dispresEx=%s ECU=%s display=%s layer=%s layout=%s area=%s "
+ "dispatchApp=%s role=%s resourceID=%d",
+ dispresEx? "true": "false", ECU.c_str(), display.c_str(),
+ layer.c_str(), layout.c_str(), area.c_str(), dispatchApp.c_str(),
+ role.c_str(), resourceID);
}
bool dispres; //!< flag of display resource
int surfaceid; //!< id of surface
std::string animation; //!< name of animation
int animationTime; //!< time of animation[ms]
+ bool dispresEx; //!< Expansion flag
+ std::string ECU; //!< name to identify ECU
+ std::string display; //!< name to identify Display in ECU
+ std::string layer; //!< name to identify Layer in Display
+ std::string layout; //!< name to identify Layout in Layer
+ std::string area; //!< name to Output position in Layout
+ std::string dispatchApp; //!< dispatch of application
+ std::string role; //!< role of notice
+ int resourceID; //!< ID number of resource
bool soundres; //!< flag of sound resource
std::string soundzone; //!< name of sound zone
{
int idx, idx2;
int *wksurfaceids;
- ICO_DBG("CicoSCLayer::addSurface(%d,%d)", surfaceid, top);
+ ICO_DBG("CicoSCLayer::addSurface(%08x,%d)", surfaceid, top);
idx2 = 0;
for (idx = 0; idx < numsurfaces; idx++, idx2++) {
CicoSCLayer::removeSurface(int surfaceid)
{
int idx, idx2;
- ICO_DBG("CicoSCLayer::removeSurface(%d)", surfaceid);
+ ICO_DBG("CicoSCLayer::removeSurface(%08x)", surfaceid);
idx2 = 0;
for (idx = 0; idx < numsurfaces; idx++, idx2++) {
//--------------------------------------------------------------------------
/**
+ * @brief is_topSurface
+ */
+//--------------------------------------------------------------------------
+bool
+CicoSCLayer::is_topSurface(int surfaceid)
+{
+ if ((numsurfaces > 0) && (surfaceids[numsurfaces-1] == surfaceid)) {
+ return true;
+ }
+ return false;
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief is_buttomSurface
+ */
+//--------------------------------------------------------------------------
+bool
+CicoSCLayer::is_buttomSurface(int surfaceid)
+{
+ if ((numsurfaces > 0) && (surfaceids[0-1] == surfaceid)) {
+ return true;
+ }
+ return false;
+}
+
+//--------------------------------------------------------------------------
+/**
* @brief getSurfaces
*/
//--------------------------------------------------------------------------
void addSurface(int surfaceid, bool top);
void removeSurface(int surfaceid);
const int *getSurfaces(int *retsurfaces);
+ bool is_topSurface(int surfaceid);
+ bool is_buttomSurface(int surfaceid);
// dump log this class member variables
void dump(void);
CicoSCMessage();
// destructor
- ~CicoSCMessage();
+ virtual ~CicoSCMessage();
// get message id
unsigned int getId(void);
void setHandle(CicoSCUwsHandle* handle);
// get message data
- const char* getData(void);
+ virtual const char* getData(void);
// set application id of destination
void setSendToAppid(const std::string & appid);
// copy constructor
CicoSCMessage(const CicoSCMessage &object);
-private:
+protected:
static unsigned int ms_counter; //!< message id counter
int m_id; //!< message id
CicoSCUwsHandle *m_uwsHandle; //!< communication handler
#define STID_DISPLAY0_CATEGORY9 12009
#define STID_DISPLAY0_CATEGORY10 12010
#define STID_DISPLAY0_CATEGORY11 12011
-#if 1 // MK21031223 _MK_MK_
+#if 1
#define STID_DISP0_ZONE2_CATEGORY 12100
#define STID_DISP0_ZONE2_CATEGORY1 12101
#define STID_DISP0_ZONE2_CATEGORY2 12102
#define STID_DISP0_ZONE3_CATEGORY9 12209
#define STID_DISP0_ZONE3_CATEGORY10 12210
#define STID_DISP0_ZONE3_CATEGORY11 12211
-#endif // MK20131223 _MK_MK_
+#endif
// display1 category state id
#define STID_DISPLAY1_CATEGORY 13000
#define EVID_DISPLAY_ZONE_ACQUIRE 10000
#define EVID_DISPLAY_ZONE_RELEASE 10999
-#if 1 // MK20131223 _MK_MK_
+#if 1
#define ZONEID_CENTER_FULL 1
#define ZONEID_CENTER_UPPER 2
#define ZONEID_CENTER_LOWER 3
-#endif // MK20131223 _MK_MK_
+#endif
#define EVID_DISPLAY0_CATEGORY 12000
-#if 1 // MK20131223 _MK_MK_
+#if 1
#define EVID_DISP0_ZONE2_CATEGORY 12100
#define EVID_DISP0_ZONE3_CATEGORY 12200
-#endif // MK20131223 _MK_MK_
+#endif
#define EVID_DISPLAY1_CATEGORY 13000
#define EVID_ONSCREEN 14000
bool chg = false;
if (RESID_TYPE_BASIC == type) {
-#if 1 // MK20131223 _MK_MK_
+#if 1
unsigned short category_ev = EVID_DISPLAY0_CATEGORY;
if (ZONEID_CENTER_UPPER == zoneid) {
category_ev = EVID_DISP0_ZONE2_CATEGORY;
sendSMEvent(category_ev, priority);
chg = true;
}
-#else // MK20131223 _MK_MK_
+#else
bool zoneChg = testSMEvent(EVID_DISPLAY_ZONE_ACQUIRE, zoneid);
bool cateChg = testSMEvent(EVID_DISPLAY0_CATEGORY, priority);
ICO_DBG("zoneChg=%d cateChg=%d", zoneChg, cateChg);
sendSMEvent(EVID_DISPLAY0_CATEGORY, priority);
chg = true;
}
-#endif // MK20131223 _MK_MK_
+#endif
#if 0 //-- { debug dump
else {
std::map<int, const CicoState*>::iterator itr;
#include "CicoSCPolicyManager.h"
#include "CicoSCLifeCycleController.h"
#include "CicoAilItems.h"
+#include "CicoSCWindow.h"
#include "CicoSCWindowController.h"
#include "CicoSCInputController.h"
#include "CicoSCPolicyDef.h"
+#include "CicoSCMessage.h"
+#include "CicoSCMessageRes.h"
+#include "CicoSCServer.h"
struct CompDisplayResourceRequest
{
}
}
}
+ m_rrtHO = (resource_request_t*)NULL;
}
CicoSCResourceManager::~CicoSCResourceManager()
// request command from application or internal
int reqtype = internal ? REQTYPE_AUTO : REQTYPE_APP;
-
if ((MSG_CMD_CREATE_RES == cmd.cmdid) ||
(MSG_CMD_ACQUIRE_RES == cmd.cmdid)) {
acquireDisplayResource(req, false);
}
else {
+ // cmdid is MSG_CMD_ACQUIRE_RES
+ if (true == isTypeOnScreen(*req)) {
+ acquireOnScreenDisplayResource(req);
+ }
+ else
if ((true == m_policyMgr->getRegulation()) &&
(false == isMatchDisplayed())) {
updateDispResRegulationPreProc(req);
resource_request_t *req = newResourceRequest(RESID_KIND_DISPLAY,
reqtype,
cmd);
- releaseDisplayResource(req);
+ if (true == isTypeOnScreen(*req)) {
+ releaseOnScreenDisplayResource(req);
+ }
+ else {
+ releaseDisplayResource(req);
+ }
}
if (true == opt->soundres) {
resource_request_t *req = newResourceRequest(RESID_KIND_SOUND,
req->released = 0;
/* set resource id */
- req->resid = RESID_TYPE_BASIC;
- if (1 == opt->type) {
+ switch (opt->type) {
+ case ICO_SYC_RES_INTERRUPT:
req->resid = RESID_TYPE_INTERRUPT;
+ break;
+ case ICO_SYC_RES_ONSCREEN:
+ req->resid = RESID_TYPE_ONSCREEN;
+ break;
+ default: // include case ICO_SYC_RES_BASIC:
+ req->resid = RESID_TYPE_BASIC;
+ break;
}
req->resid |= resid;
req->layerid = opt->layerid;
req->winname = strdup(opt->winname.c_str());
req->surfaceid = opt->surfaceid;
- req->id = opt->surfaceid;;
+ req->id = opt->surfaceid;
req->animation = strdup(opt->animation.c_str());
req->animationTime = opt->animationTime;
+ req->bEx = opt->dispresEx;
+ req->ECU = strdup(opt->ECU.c_str()); // name to identify ECU
+ req->display = strdup(opt->display.c_str()); // name to identify Display in ECU
+ req->layer = strdup(opt->layer.c_str()); // name to identify Layer in Display
+ req->layout = strdup(opt->layout.c_str()); // name to identify layout in Layer
+ req->area = strdup(opt->area.c_str()); // name to Output position in Layout
+ req->dispatchApp= strdup(opt->dispatchApp.c_str()); // dispatch of application
+ req->role = strdup(opt->role.c_str()); // role of notice
+ req->resourceId = opt->resourceID; // ID number of resource
}
else if (resid == RESID_KIND_SOUND) {
req->soundzone = strdup(opt->soundzone.c_str());
if (NULL != req->soundzone) free(req->soundzone);
if (NULL != req->soundname) free(req->soundname);
if (NULL != req->device) free(req->device);
-
+ if (NULL != req->ECU) free(req->ECU); // name to identify ECU
+ if (NULL != req->display) free(req->display); // name to identify Display in ECU
+ if (NULL != req->layer) free(req->layer); // name to identify Layer in Display
+ if (NULL != req->layout) free(req->layout); // name to identify layout in Layer
+ if (NULL != req->area) free(req->area); // name to Output position in Layout
+ if (NULL != req->dispatchApp) free(req->dispatchApp); // origin of application
+ if (NULL != req->role) free(req->role); // role of notice
free(req);
}
req->appid, req->pid, req->surfaceid);
// show request window
m_winCtrl->show(req->surfaceid, req->animation, req->animationTime);
-#if 0 // MKMK
+#if 0
m_winCtrl->activeCB(NULL, NULL, req->surfaceid, -1);
#endif
ICO_TRA("CicoSCResourceManager::updateDisplayResource Leave");
}
if ((itr2->second->surfaceid == surfaceid)) {
ret = true;
- break;
+ break; // break of for itr2
}
}
}
+ if (true == ret) {
+ break; // break of for itr
+ }
}
return ret;
}
+
+bool
+CicoSCResourceManager::acquireOnScreenDisplayResource(resource_request_t *newreq)
+{
+ ICO_TRA("Enter (%08x)", newreq);
+ if (NULL == newreq) {
+ ICO_TRA("Leave param is NULL pointer");
+ return false;
+ }
+ CicoSystemConfig *sysConf = CicoSystemConfig::getInstance();
+
+ if (0 == newreq->role_stt) {
+ newreq->role_stt = sysConf->getRoleStt(newreq->role);
+ }
+ m_OnScreenItems.push_back(newreq);
+
+ const resource_request_t* rrtHO = getNoticeOfHighOder();
+ if (NULL == rrtHO) {
+ ICO_TRA("Leave %s, %d is not notice", newreq->role, newreq->resourceId);
+ return false;
+ }
+#if 1
+ const CicoSCWindow* nwo = m_winCtrl->findWindowObj(newreq->pid,
+ newreq->resourceId);
+#endif
+ const CicoSCWindow* bwo = NULL; // before window oject
+ const CicoSCWindow* awo = NULL; // after window object
+
+ if (NULL != m_rrtHO) {
+ bwo = m_winCtrl->findWindowObj(m_rrtHO->pid, m_rrtHO->resourceId);
+ }
+ if (NULL != rrtHO) {
+ awo = m_winCtrl->findWindowObj(rrtHO->pid, rrtHO->resourceId);
+ }
+ if ((NULL == m_rrtHO) && (NULL != rrtHO)) { // none -> on notice
+ ICO_TRA("_____ OPEN Layer \"%s\":%d", rrtHO->role, rrtHO->resourceId);
+ if (NULL != awo) {
+ m_winCtrl->showLayer(awo->displayid, awo->layerid);
+ }
+ else {
+ ICO_WRN("ON SCREEN none layer");
+ }
+ }
+#if 1
+ if ((NULL != nwo) && (awo != nwo) && (bwo != nwo)) {
+ ICO_TRA("_____ HIDW new REQUEST %x:%s:%d", newreq, newreq->role,
+ newreq->resourceId);
+ m_winCtrl->hide(nwo->surfaceid, NULL, 0);
+ }
+#endif
+ if (rrtHO != m_rrtHO) { // change Hige Oder notice
+ if (NULL != m_rrtHO) {
+ ICO_TRA("_____ HIDE surface %x:%s:%d", m_rrtHO, m_rrtHO->role,
+ m_rrtHO->resourceId);
+ if (NULL != bwo) {
+ m_winCtrl->hide(bwo->surfaceid, NULL, 0);
+ }
+ else {
+ ICO_WRN("ON SCREEN none Hide control");
+ }
+ resCB(ICO_SYC_EV_RES_WAITING, *m_rrtHO);
+ }
+ ICO_TRA("_____ SHOW surface %x:%s:%d", rrtHO, rrtHO->role, rrtHO->resourceId);
+ if (NULL != awo) {
+ m_winCtrl->show(awo->surfaceid, NULL, 0);
+ }
+ else {
+ ICO_WRN("ON SCREEN none show control");
+ }
+ resCB(ICO_SYC_EV_RES_ACQUIRE, *rrtHO);
+ ICO_TRA("_____ change %x -> %x", m_rrtHO, rrtHO);
+ m_rrtHO = rrtHO;
+ }
+//- if (m_rrtHO != newreq) {
+//- resCB(ICO_SYC_EV_RES_WAITING, *newreq);
+//- }
+ else {
+ ICO_TRA("_____ no change %x", m_rrtHO);
+ if (NULL != awo) {
+ m_winCtrl->show(awo->surfaceid, NULL, 0);
+ m_winCtrl->raise(awo->surfaceid, NULL, 0);
+ }
+ if (m_rrtHO != newreq) {
+ resCB(ICO_SYC_EV_RES_WAITING, *newreq);
+ }
+ }
+ ICO_TRA("Leave");
+ return true;
+}
+
+bool
+CicoSCResourceManager::releaseOnScreenDisplayResource(resource_request_t *req)
+{
+ ICO_TRA("Enter %08x", req);
+ if (NULL == req) {
+ ICO_TRA("Leave param is NULL pointer");
+ return false;
+ }
+ resource_request_t* tgt = NULL;
+ list<resource_request_t*>::iterator itr = m_OnScreenItems.begin();
+ for (; itr != m_OnScreenItems.end(); ++itr) {
+ if ((req->pid == (*itr)->pid) &&
+ (req->resourceId == (*itr)->resourceId)) {
+ tgt = (*itr);
+ break; // break of for itr
+ }
+ }
+
+ if (NULL != tgt) {
+ ICO_TRA("_____ erase list %x", tgt);
+ m_OnScreenItems.erase(itr);
+ }
+
+ const resource_request_t* rrtHO = getNoticeOfHighOder();
+
+ const CicoSCWindow* bwo = NULL; // before window oject
+ const CicoSCWindow* awo = NULL; // after window object
+ if (NULL != m_rrtHO) {
+ bwo = m_winCtrl->findWindowObj(m_rrtHO->pid, m_rrtHO->resourceId);
+ }
+ if (NULL != rrtHO) {
+ awo = m_winCtrl->findWindowObj(rrtHO->pid, rrtHO->resourceId);
+ }
+
+ if ((NULL == rrtHO) && (NULL == m_rrtHO)) {
+ ICO_WRN("ON SCREEN Resource NG");
+ if (NULL != tgt) {
+ resCB(ICO_SYC_EV_RES_RELEASE, *tgt);
+ delResourceRequest(tgt);
+ }
+ delResourceRequest(req);
+ ICO_TRA("Leave ON SCREEN Resource NG");
+ return false;
+ }
+
+ if (rrtHO != m_rrtHO) {
+ if (NULL != m_rrtHO) {
+ if (NULL != bwo) {
+ m_winCtrl->hide(bwo->surfaceid, NULL, 0);
+ if (m_rrtHO != tgt) {
+ ICO_DBG("_____ NG Control OnScreen Resource %x(%d, %d), %x",
+ m_rrtHO, m_rrtHO->pid, m_rrtHO->resourceId, tgt);
+ resCB(ICO_SYC_EV_RES_WAITING, *m_rrtHO);
+ }
+ }
+ else {
+ ICO_WRN("ON SCREEN Hide control NG");
+ }
+ }
+ if (NULL != rrtHO) {
+ if (NULL != awo) {
+ m_winCtrl->show(awo->surfaceid, NULL, 0);
+ m_winCtrl->raise(awo->surfaceid, NULL, 0);
+ resCB(ICO_SYC_EV_RES_ACQUIRE, *rrtHO);
+ }
+ else {
+ ICO_WRN("ON SCREEN Hide control NG");
+ }
+ }
+ else {
+ if (NULL != bwo) {
+ m_winCtrl->hideLayer(bwo->displayid, bwo->layerid);
+ }
+ else {
+ ICO_WRN("ON SCREEN layer hide control NG");
+ }
+ }
+ m_rrtHO = rrtHO;
+ }
+ else {
+ ICO_TRA("_____ no change");
+ }
+ // memory free
+ if (NULL != tgt) {
+ resCB(ICO_SYC_EV_RES_RELEASE, *tgt);
+ delResourceRequest(tgt);
+ }
+ delResourceRequest(req);
+ ICO_TRA("Leave");
+ return true;
+}
+
+bool
+CicoSCResourceManager::resCB(const ico_syc_ev_e ev, const resource_request_t& p) const
+{
+ ICO_TRA("Enter %d", (int)ev);
+ if ((NULL == p.appid) || (0 == strlen(p.appid))) {
+ ICO_TRA("Leave false");
+ return false;
+ }
+ if (false == p.bEx) {
+ ICO_TRA("Leave false");
+ return false;
+ }
+ int nEv = -1;
+ if (ICO_SYC_EV_RES_ACQUIRE == ev) {
+ nEv = MSG_CMD_ACQUIRE_RES;
+ }
+ else if (ICO_SYC_EV_RES_DEPRIVE == ev) {
+ nEv = MSG_CMD_DEPRIVE_RES;
+ }
+ else if (ICO_SYC_EV_RES_WAITING == ev) {
+ nEv = MSG_CMD_WAITING_RES;
+ }
+ else if (ICO_SYC_EV_RES_REVERT == ev) {
+ nEv = MSG_CMD_REVERT_RES;
+ }
+ else if (ICO_SYC_EV_RES_RELEASE == ev) {
+ nEv = MSG_CMD_RELEASE_RES;
+ }
+ else if (ICO_SYC_EV_RES_WINDOW_ID == ev) {
+ nEv = MSG_CMD_WINDOW_ID_RES;
+ }
+ else {
+ ICO_TRA("Leave false ev(%d) is not supp.",(int)ev);
+ return false;
+ }
+
+ bool r;
+ r = resCB(p.appid, nEv, p.ECU, p.display, p.layer, p.layout, p.area,
+ p.dispatchApp, p.role, p.resourceId);
+ ICO_TRA("Leave %s", r? "true":"false");
+ return r;
+}
+
+bool
+CicoSCResourceManager::resCB(const char* sendToAppid, const int ev,
+ const char* ECU, const char* display,
+ const char* layer, const char* layout,
+ const char* area, const char* dispatchApp,
+ const char* role, uint32_t resourceId) const
+{
+ ICO_TRA("Enter");
+ if (NULL == sendToAppid) {
+ ICO_TRA("Leave false");
+ return false;
+ }
+ CicoSCMessageRes* msg = new CicoSCMessageRes();
+ msg->addRootObject("command", ev);
+ if (NULL != ECU) {
+ msg->addWinObject("ECU", ECU);
+ }
+ if (NULL != display) {
+ msg->addWinObject("display", display);
+ }
+ if (NULL != layer) {
+ msg->addWinObject("layer", layer);
+ }
+ if (NULL != layout) {
+ msg->addWinObject("layout", layout);
+ }
+ if (NULL != area) {
+ msg->addWinObject("area", area);
+ }
+ if (NULL != dispatchApp) {
+ msg->addWinObject("dispatchApp", dispatchApp);
+ }
+ if (NULL != role) {
+ msg->addWinObject("role", role);
+ }
+ msg->addWinObject("resourceId", resourceId);
+ CicoSCServer *cscs = CicoSCServer::getInstance();
+ int r = cscs->sendMessage(sendToAppid, (CicoSCMessage*)msg);
+ if (ICO_SYC_EOK != r) {
+ ICO_TRA("Leave false(%d)", r);
+ return false;
+ }
+ ICO_TRA("Leave true");
+ return true;
+}
+
+const resource_request_t* CicoSCResourceManager::getNoticeOfHighOder()
+{
+ ICO_TRA("Enter (%d)", (int)m_OnScreenItems.size());
+ const CicoSCRoleConf* rC = CicoSystemConfig::getInstance()->getRoleConf();
+ m_policyMgr->sendSMEvent(rC->m_rst); // RESET OnScreen State
+ const resource_request_t* r = NULL;
+ list<resource_request_t*>::iterator itr = m_OnScreenItems.begin();
+ for (; itr != m_OnScreenItems.end(); ++itr) {
+ short hEv = (*itr)->role_stt;
+ if ((ICO_SYC_ROLE_CONF_DEF == hEv) || (0 == hEv)) {
+ continue; // continue of for itr
+ }
+ if (true == m_policyMgr->sendSMEvent(hEv)) {
+ r = (*itr);
+ }
+ }
+ ICO_TRA("Leave %x", r);
+ return r;
+}
+
// vim:set expandtab ts=4 sw=4:
using namespace std;
#include "ico_syc_mrp_resource_private.h"
+#include "ico_syc_appresctl.h"
//==========================================================================
// Forward declaration
void dumpWaitingDispResReq(void);
bool isMatchDisplayed(void);
-
+ bool acquireOnScreenDisplayResource(resource_request_t *req);
+ bool releaseOnScreenDisplayResource(resource_request_t *req);
+ const resource_request_t* getNoticeOfHighOder();
+ bool resCB(const ico_syc_ev_e ev, const resource_request_t& p) const;
+ bool resCB(const char* sendToAppid, const int ev, const char* ECU,
+ const char* display, const char* layer, const char* layout,
+ const char* area, const char* dispatchApp, const char* role,
+ uint32_t resourceId) const;
+ bool isTypeBaseic(const resource_request_t& p);
+ bool isTypeInterrupt(const resource_request_t& p);
+ bool isTypeOnScreen(const resource_request_t& p);
private:
CicoSCPolicyManager *m_policyMgr;
CicoSCWindowController *m_winCtrl;
std::list<resource_request_t*> m_waitingDispResReq;
map<int, list<resource_request_t*> > m_soundReqQueue;
map<int, list<resource_request_t*> > m_inputReqQueue;
+ std::list<resource_request_t*> m_OnScreenItems;
+ const resource_request_t* m_rrtHO; // resource_request_t of High Oder
// show/hide animation name at regulation on or off
const std::string m_animaName;
// show/hide animation time at regulation on or off
int m_animaTime;
};
+
+//==========================================================================
+/**
+ * @brief check type is basic
+ * @param p resorce request info
+ * @ret bool
+ * @retval true: basic
+ * @retval false: not basic
+ */
+inline bool CicoSCResourceManager::isTypeBaseic(const resource_request_t& p)
+{
+ return (RESID_TYPE_BASIC == (p.resid & RESID_TYPE_MASK));
+}
+
+//==========================================================================
+/**
+ * @brief check type is interrupt
+ * @param p resorce request info
+ * @ret bool
+ * @retval true: interrupt
+ * @retval false: not interrupt
+ */
+inline bool CicoSCResourceManager::isTypeInterrupt(const resource_request_t& p)
+{
+ return (RESID_TYPE_INTERRUPT == (p.resid & RESID_TYPE_MASK));
+}
+
+//==========================================================================
+/**
+ * @brief check type is onscreen
+ * @param p resorce request info
+ * @ret bool
+ * @retval true: onscreen
+ * @retval false: not onscreen
+ */
+//==========================================================================
+inline bool CicoSCResourceManager::isTypeOnScreen(const resource_request_t& p)
+{
+ return (RESID_TYPE_ONSCREEN == (p.resid & RESID_TYPE_MASK));
+}
#endif // __CICO_SC_RESOURCE_MANAGER_H__
// vim:set expandtab ts=4 sw=4:
string appid;
};
-//==========================================================================
+//==========================================================================
// private static variable
-//==========================================================================
+//==========================================================================
CicoSCServer* CicoSCServer::ms_myInstance = NULL;
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
CicoSCServer::~CicoSCServer()
{
+ CicoSCServer::ms_myInstance = NULL;
if (NULL != m_uwsContext) {
ico_uws_close(m_uwsContext);
}
- CicoSCServer::ms_myInstance = NULL;
}
//--------------------------------------------------------------------------
}
m_sendMsgQueue.clear();
}
-
+
{
std::list<CicoSCCommand*>::iterator itr;
itr = m_recvCmdQueue.begin();
// if user change processing(homescree is not running)
if (true == m_userMgr->isStoppingNow()) {
ICO_DBG("homescreen not running");
+ delete msg;
return ICO_SYC_ENOENT;
}
const CicoSCUser *loginUser = m_userMgr->getLoginUser();
if (NULL == loginUser) {
ICO_WRN("homescreen unknown");
+ delete msg;
return ICO_SYC_ENOENT;
}
return sendMessage(loginUser->homescreen, msg);
// ICO_TRA("CicoSCServer::receiveEventCB Leave");
return;
case ICO_UWS_EVT_ERROR:
- ICO_DBG(">>>RECV ICO_UWS_EVT_ERROR(id=0x%08x, err=%d)",
+ ICO_DBG(">>>RECV ICO_UWS_EVT_ERROR(id=0x%08x, err=%d)",
(int)id, detail->_ico_uws_error.code);
// ICO_TRA("CicoSCServer::receiveEventCB Leave");
return;
switch (event) {
case ICO_UWS_EVT_OPEN:
- ICO_DBG(">>>RECV ICO_UWS_EVT_OPEN(id=0x%08x)", (int)id);
- break;
+ ICO_DBG(">>>RECV ICO_UWS_EVT_OPEN(id=0x%08x)", (int)id);
+ break; // break of switch event
case ICO_UWS_EVT_CLOSE:
ICO_DBG(">>>RECV ICO_UWS_EVT_CLOSE(id=0x%08x)", (int)id);
delete handler;
- break;
+ break; // break of switch event
case ICO_UWS_EVT_RECEIVE:
{
- ICO_DBG(">>>RECV ICO_UWS_EVT_RECEIVE(id=0x%08x, msg=%s, len=%d)",
+ ICO_DBG(">>>RECV ICO_UWS_EVT_RECEIVE(id=0x%08x, msg=%s, len=%d)",
(int)id, (char *)detail->_ico_uws_message.recv_data,
detail->_ico_uws_message.recv_len);
if (0 == cmd->appid.length()) {
ICO_WRN("command argument invalid appid null");
delete cmd;
- break;
+ break; // break of switch event
}
handler->appid = cmd->appid;
handler->serviceFlag = true;
notifyConnected(handler->appid);
delete cmd;
- break;
+ break; // break of switch event
}
-
+
// Enqueue command
ICO_DBG("Enqueue command(0x%08x)", cmd->cmdid);
m_recvCmdQueue.push_back(cmd);
- break;
+ break; // break of switch event
}
case ICO_UWS_EVT_ADD_FD:
ICO_DBG(">>>RECV ICO_UWS_EVT_ADD_FD(id=0x%08x, fd=%d)",
(int)id, detail->_ico_uws_fd.fd);
handler->fd = detail->_ico_uws_fd.fd;
addPollFd(handler);
- break;
+ break; // break of switch event
case ICO_UWS_EVT_DEL_FD:
ICO_DBG(">>>RECV ICO_UWS_EVT_DEL_FD(id=0x%08x, fd=%d, appid=%s)",
(int)id, detail->_ico_uws_fd.fd, handler->appid.c_str());
clearRecvCmdQueue(handler->appid);
clearSendMsgQueue(handler->appid);
delPollFd(handler);
- break;
+ break; // break of switch event
default:
- break;
+ break; // break of switch event
}
// ICO_TRA("CicoSCServer::receiveEventCB Leave");
}
//--------------------------------------------------------------------------
bool
CicoSCServer::isExistUwsHandler(const CicoSCUwsHandler *handler)
-{
+{
list<CicoSCUwsHandler*>::iterator itr;
itr = m_uwsHandlerList.begin();
for (; itr != m_uwsHandlerList.end(); ++itr) {
int ret = stat(dir.c_str(), &st);
if (0 != ret) {
// lastinfo directory does not exist
- ICO_ERR("lastinfo directory dose not exist)");
+ ICO_WRN("lastinfo directory dose not exist)");
ICO_TRA("CicoSCUserManager::loadLastInfo Leave(dir dose not exist)");
return;
}
ICO_DBG("CicoSCWayland::initialize: Wayland/Weston connect OK");
// initialize genivi callbacks
- CicoSCWindowController::initializeGeniviNotifications();
+ CicoSCWindowController::getInstance()->initializeGeniviLMS();
ICO_TRA("CicoSCWayland::initialize: Leave(EOK)");
return ICO_SYC_EOK;
#include "CicoSCWaylandIF.h"
#include "CicoLog.h"
-
const char * CicoSCWaylandIF::ICO_WL_WIN_MGR_IF = "ico_window_mgr";
const char * CicoSCWaylandIF::ICO_WL_INPUT_MGR_CTRL_IF = "ico_input_mgr_control";
const char * CicoSCWaylandIF::ICO_WL_EXINPUT_IF = "ico_exinput";
CicoSCWindow::CicoSCWindow()
: surfaceid(-1), name(""), appid(""), pid(-1),
nodeid(-1), displayid(-1), layerid(-1), zone(""), zoneid(-1),
- subwindow(0), eventmask(0), x(-1), y(-1), width(-1), height(-1),
- visible(false), raise(false), active(false)
+ subwindow(0), eventmask(0), srcwidth(0), srcheight(0), x(-1), y(-1),
+ width(-1), height(-1), visible(false), raise(false), active(false)
{
// ICO_TRA("CicoSCWindow::CicoSCWindow Enter");
// ICO_TRA("CicoSCWindow::CicoSCWindow Leave");
std::string zone; ///< display zone name
int zoneid; ///< display zone id
int subwindow; ///< main window(0) or sub window(!0)
- unsigned int eventmask; ///< Event to receive through this window
- int x; ///< Upper left X coord of the window
- int y; ///< Upper left Y coord of the window
+ unsigned int eventmask; ///< event to receive through this window
+ int srcwidth; ///< width of application frame buffer
+ int srcheight; ///< height of application frame buffer
+ int x; ///< upper left X coord of the window
+ int y; ///< upper left Y coord of the window
int width; ///< width of window
int height; ///< height of window
bool visible; ///< visibility
#include "ico_syc_msg_cmd_def.h"
#include "CicoSCServer.h"
#include "CicoSCMessage.h"
+#include "CicoSCMessageRes.h"
#include "CicoSCLifeCycleController.h"
#include "CicoSCResourceManager.h"
}
// set animation request to Multi Window Manager
- int animaFlag = ICO_SYC_ANIMATION_OFF;
int raiseFlag = ICO_SYC_WIN_RAISE_NOCHANGE;
if (animationTime & ICO_SYC_WIN_SURF_RAISE) {
raiseFlag = ICO_SYC_WIN_RAISE_RAISE;
- window->raise = true;
}
else if (animationTime & ICO_SYC_WIN_SURF_LOWER) {
raiseFlag = ICO_SYC_WIN_RAISE_LOWER;
- window->raise = false;
}
else if (((animationTime & ICO_SYC_WIN_SURF_NOCHANGE) == 0) &&
(false == window->raise)) {
raiseFlag = ICO_SYC_WIN_RAISE_RAISE;
- window->raise = true;
}
if ((NULL != animation) && (animation[0] != '\0')) {
// set animation request to Multi Window Manager
CicoSCWlWinMgrIF::setAnimation(window->surfaceid,
ICO_WINDOW_MGR_ANIMATION_TYPE_SHOW,
animation, animationTime & ~ICO_SYC_WIN_SURF_FLAGS);
- animaFlag = ICO_SYC_ANIMATION_ON;
+ }
+
+ // set raise/lower request (if need)
+ if (raiseFlag != ICO_SYC_WIN_RAISE_NOCHANGE) {
+ raiselower(window, (raiseFlag == ICO_SYC_WIN_RAISE_RAISE));
}
// set visible request to Multi Window Manager
- CicoSCWlWinMgrIF::setVisible(window->surfaceid,
- ICO_SYC_WIN_VISIBLE_SHOW,
- raiseFlag, animaFlag);
+ CicoSCWlWinMgrIF::setVisible(window->surfaceid, ICO_SYC_WIN_VISIBLE_SHOW);
// flush display
CicoSCWayland::getInstance()->flushDisplay();
//--------------------------------------------------------------------------
/**
+ * @brief raise/lower a target window
+ *
+ * @param [in] window target window
+ * @param [in] raise raise(true)/lower(false)
+ *
+ * @return nothing
+ */
+//--------------------------------------------------------------------------
+void
+CicoSCWindowController::raiselower(CicoSCWindow *window, bool raise)
+{
+ ICO_TRA("CicoSCWindowController::raiselower(%08x,%d)", window->surfaceid, raise);
+
+ window->raise = raise;
+
+ CicoSCLayer* layer = findLayer(window->displayid, window->layerid);
+ if (! layer) {
+ ICO_ERR("CicoSCWindowController::raiselower: surface.%08x has no layer(%d)",
+ window->surfaceid, window->layerid);
+ return;
+ }
+ if ((raise) && (layer->is_topSurface(window->surfaceid))) {
+ ICO_DBG("CicoSCWindowController::raiselower %08x raise but top",
+ window->surfaceid);
+ }
+ else if ((! raise) && (layer->is_buttomSurface(window->surfaceid))) {
+ ICO_DBG("CicoSCWindowController::raiselower %08x lower but buttom",
+ window->surfaceid);
+ }
+ else {
+ layer->addSurface(window->surfaceid, raise);
+
+ int nsurf;
+ const int *surfs = layer->getSurfaces(&nsurf);
+ if (ilm_layerSetRenderOrder(window->layerid, (t_ilm_layer *)surfs, nsurf)
+ != ILM_SUCCESS) {
+ ICO_ERR("CicoSCWindowController::raiselower "
+ "ilm_layerSetRenderOrder(%d,,%d) Error", window->layerid, nsurf);
+ }
+ }
+}
+
+//--------------------------------------------------------------------------
+/**
* @brief hide a target window
*
* @param [in] surfaceid wayland surface id
}
// set animation request to Multi Window Manager
- int animaFlag = ICO_SYC_ANIMATION_OFF;
if ((NULL != animation) && (animation[0] != '\0')) {
CicoSCWlWinMgrIF::setAnimation(window->surfaceid,
ICO_WINDOW_MGR_ANIMATION_TYPE_HIDE,
animation, animationTime & ~ICO_SYC_WIN_SURF_FLAGS);
- animaFlag = ICO_SYC_ANIMATION_ON;
}
// set visible request to Multi Window Manager
- CicoSCWlWinMgrIF::setVisible(window->surfaceid,
- ICO_SYC_LAYER_VISIBLE_HIDE,
- ICO_SYC_WIN_RAISE_NOCHANGE, animaFlag);
+ CicoSCWlWinMgrIF::setVisible(window->surfaceid, ICO_SYC_LAYER_VISIBLE_HIDE);
// flush display
CicoSCWayland::getInstance()->flushDisplay();
}
// set animation request to Multi Window Manager
- int animaFlag = ICO_SYC_ANIMATION_OFF;
if ((NULL != animation) && (animation[0] != '\0')) {
CicoSCWlWinMgrIF::setAnimation(window->surfaceid,
ICO_WINDOW_MGR_ANIMATION_TYPE_RESIZE,
animation, animationTime);
- animaFlag = ICO_SYC_ANIMATION_ON;
}
// set visible request to Multi Window Manager
window->width = w;
window->height = h;
CicoSCWlWinMgrIF::setPositionsize(window->surfaceid, window->nodeid,
- window->x, window->y,
- w, h, animaFlag);
+ window->x, window->y, w, h);
// flush display
CicoSCWayland::getInstance()->flushDisplay();
}
// set animation request to Multi Window Manager
- int animaFlag = ICO_SYC_ANIMATION_OFF;
if ((NULL != animation) && (animation[0] != '\0')) {
CicoSCWlWinMgrIF::setAnimation(window->surfaceid,
ICO_WINDOW_MGR_ANIMATION_TYPE_MOVE,
animation, animationTime);
- animaFlag = ICO_SYC_ANIMATION_ON;
}
int moveNodeId = ICO_SYC_WIN_NOCHANGE;
window->y = y;
CicoSCWlWinMgrIF::setPositionsize(window->surfaceid,
moveNodeId, x, y,
- window->width, window->height,
- animaFlag);
+ window->width, window->height);
// flush display
CicoSCWayland::getInstance()->flushDisplay();
return ICO_SYC_ENOENT;
}
- // update visible attr
- window->raise = true;
-
// set animation request to Multi Window Manager
- int animaFlag = ICO_SYC_ANIMATION_OFF;
if ((NULL != animation) && (animation[0] != '\0')) {
CicoSCWindowController::setAnimation(window->surfaceid,
ICO_WINDOW_MGR_ANIMATION_TYPE_SHOW,
animation, animationTime);
- animaFlag = ICO_SYC_ANIMATION_ON;
}
-
- // set visible request to Multi Window Manager
- CicoSCWlWinMgrIF::setVisible(window->surfaceid,
- ICO_SYC_WIN_VISIBLE_NOCHANGE,
- ICO_SYC_WIN_RAISE_RAISE, animaFlag);
+ // set raise request to Multi Window Manager
+ raiselower(window, true);
+ if (ilm_commitChanges() != ILM_SUCCESS) {
+ ICO_ERR("CicoSCWindowController::raise ilm_commitChanges() Error");
+ }
// flush display
CicoSCWayland::getInstance()->flushDisplay();
// set visible request to Multi Window Manager
CicoSCWlWinMgrIF::setPositionsize(window->surfaceid, moveNodeId,
- moveX, moveY, moveW, moveH,
- ICO_SYC_ANIMATION_ON);
+ moveX, moveY, moveW, moveH);
// flush display
CicoSCWayland::getInstance()->flushDisplay();
return ICO_SYC_ENOENT;
}
- // update visible attr
- window->raise = false;
-
// set animation request to Multi Window Manager
- int animaFlag = ICO_SYC_ANIMATION_OFF;
if ((NULL != animation) && (animation[0] != '\0')) {
CicoSCWlWinMgrIF::setAnimation(window->surfaceid,
ICO_WINDOW_MGR_ANIMATION_TYPE_HIDE,
animation, animationTime);
- animaFlag = ICO_SYC_ANIMATION_ON;
}
- // set visible request to Multi Window Manager
- CicoSCWlWinMgrIF::setVisible(window->surfaceid, ICO_SYC_WIN_VISIBLE_NOCHANGE,
- ICO_SYC_WIN_RAISE_LOWER, animaFlag);
+ // set lower request to Multi Window Manager
+ raiselower(window, false);
+ if (ilm_commitChanges() != ILM_SUCCESS) {
+ ICO_ERR("CicoSCWindowController::lower ilm_commitChanges() Error");
+ }
// flush display
CicoSCWayland::getInstance()->flushDisplay();
int
CicoSCWindowController::setWindowLayer(int surfaceid, int layerid)
{
- uint32_t oldlayerid;
-
ICO_TRA("CicoSCWindowController::setWindowLayer Enter"
"(surfaceid=0x%08X layerid=%x)", surfaceid, layerid);
ICO_TRA("CicoSCWindowController::setWindowLayer Leave(ENOENT)");
return ICO_SYC_ENOENT;
}
+ if (window->layerid == layerid) {
+ ICO_TRA("CicoSCWindowController::setWindowLayer Leave(same layer %d)", layerid);
+ return ICO_SYC_EOK;
+ }
- // find layer information in layer list
+ // find new layer information in layer list
CicoSCLayer* layer = findLayer(window->displayid, layerid);
if (NULL == layer) {
ICO_TRA("CicoSCWindowController::setWindowLayer Leave(ENOENT[disp=%d,layer=%d])",
return ICO_SYC_ENOENT;
}
+ // find old layer information and remove surface if need
+ CicoSCLayer* oldlayer = findLayer(window->displayid, window->layerid);
+ if (oldlayer) {
+ if (ilm_layerRemoveSurface(window->layerid, window->surfaceid) != ILM_SUCCESS) {
+ ICO_ERR("CicoSCWindowController::setWindowLayer ilm_layerRemoveSurface(%d,%08x)"
+ " Error", window->layerid, window->surfaceid);
+ }
+ oldlayer->removeSurface(window->surfaceid);
+ int noldsurf;
+ const int *oldsurfs = oldlayer->getSurfaces(&noldsurf);
+ if (ilm_layerSetRenderOrder(window->layerid, (t_ilm_layer *)oldsurfs, noldsurf)
+ != ILM_SUCCESS) {
+ 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");
+ }
+ }
+
// update window attr
- oldlayerid = window->layerid;
window->layerid = layerid;
- // set window layer request to Multi Window Manager
- CicoSCWlWinMgrIF::setWindowLayer(window->surfaceid,
- (uint32_t)window->layerid, oldlayerid);
+ // set window layer request
+ if (ilm_layerAddSurface(window->layerid, window->surfaceid) != ILM_SUCCESS) {
+ ICO_ERR("CicoSCWindowController::setWindowLayer ilm_layerAddSurface(%d,%08x) Error",
+ window->layerid, window->surfaceid);
+ }
+
+ // add surface to new layer
+ layer->addSurface(window->surfaceid, true);
+ int nsurf;
+ const int *surfs = layer->getSurfaces(&nsurf);
+ if (ilm_layerSetRenderOrder(window->layerid, (t_ilm_layer *)surfs, nsurf)
+ != ILM_SUCCESS) {
+ ICO_ERR("CicoSCWindowController::setWindowLayer "
+ "ilm_layerSetRenderOrder(%d,,%d) Error", window->layerid, nsurf);
+ }
+ if (ilm_commitChanges() != ILM_SUCCESS) {
+ ICO_ERR("CicoSCWindowController::setWindowLayer ilm_commitChanges() Error");
+ }
+
// flush display
CicoSCWayland::getInstance()->flushDisplay();
//--------------------------------------------------------------------------
/**
+ * @brief surface update event callback
+ *
+ * @param [in] data user data(unused)
+ * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
+ * @param [in] surfaceid surface Id
+ * @param [in] visible visibility
+ * @param [in] srcwidth application buffer width
+ * @param [in] srcheight application buffer height
+ * @param [in] x X
+ * @param [in] y Y
+ * @param [in] width width
+ * @param [in] height height
+ */
+//--------------------------------------------------------------------------
+void
+CicoSCWindowController::updateSurfaceCB(void *data,
+ struct ico_window_mgr *ico_window_mgr,
+ uint32_t surfaceid,
+ int visible,
+ int srcwidth,
+ int srcheight,
+ int x,
+ int y,
+ int width,
+ int height)
+{
+ ICO_TRA("CicoSCWindowController::updateSurfaceCB: Enter(%08x %d,%d,%d,%d,%d,%d,%d)",
+ surfaceid, visible, srcwidth, srcheight, x, y, width, height);
+
+ CicoSCWindow *window = findWindow(surfaceid);
+ if (NULL == window) {
+ ICO_WRN("CicoSCWindowController::updateSurfaceCB: not found window(%08x)",
+ surfaceid);
+ ICO_TRA("CicoSCWindowController::updateSurfaceCB: Leave");
+ return;
+ }
+
+ // update attr
+ window->visible = visible;
+ window->srcwidth = srcwidth;
+ window->srcheight = srcheight;
+ window->x = x;
+ window->y = y;
+ window->width = width;
+ window->height = height;
+ window->nodeid = window->layerid / 1000;
+
+ // notify to homescreen
+ CicoSCMessage *message = new CicoSCMessage();
+ message->addRootObject("command", MSG_CMD_CHANGE_ATTR);
+ message->addRootObject("appid", window->appid);
+ const CicoSCDisplayZone* zone = findDisplayZone(window->zoneid);
+ if (NULL != zone) {
+ message->addArgObject("zone", zone->fullname);
+ }
+ else {
+ message->addArgObject("zone", "");
+ }
+ message->addArgObject("surface", window->surfaceid);
+ message->addArgObject("winname", window->name);
+ message->addArgObject("node", window->nodeid);
+ message->addArgObject("layer", window->layerid);
+ message->addArgObject("pos_x", window->x);
+ message->addArgObject("pos_y", window->y);
+ message->addArgObject("width", window->width);
+ message->addArgObject("height", window->height);
+ message->addArgObject("raise", window->raise ? 1 : 0);
+ message->addArgObject("visible", window->visible ? 1 : 0);
+ message->addArgObject("active", window->active ? 1 : 0);
+ CicoSCServer::getInstance()->sendMessageToHomeScreen(message);
+
+ ICO_TRA("CicoSCWindowController::updateSurfaceCB: Leave");
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief wayland surface destroy callback
+ *
+ * @param [in] data user data(unused)
+ * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
+ * @param [in] surfaceid ico_window_mgr surface Id
+ */
+//--------------------------------------------------------------------------
+void
+CicoSCWindowController::destroySurfaceCB(void *data,
+ struct ico_window_mgr *ico_window_mgr,
+ uint32_t surfaceid)
+{
+ ICO_TRA("CicoSCWindowController::destroySurfaceCB: Enter(%08x)", surfaceid);
+
+ CicoSCWindow *window = findWindow(surfaceid);
+ if (NULL == window) {
+ ICO_WRN("not found window(%08x)", surfaceid);
+ ICO_TRA("CicoSCWindowController::destroySurfaceCB Leave");
+ return;
+ }
+
+ // send message
+ CicoSCMessage *message = new CicoSCMessage();
+ message->addRootObject("command", MSG_CMD_DESTROY);
+ message->addRootObject("appid", window->appid);
+ message->addRootObject("pid", window->pid);
+ message->addArgObject("surface", window->surfaceid);
+ message->addArgObject("winname", window->name);
+ CicoSCServer::getInstance()->sendMessageToHomeScreen(message);
+
+ // TODO delete window in application
+ if (NULL != m_resMgr) {
+ CicoSCCommand cmd;
+ CicoSCCmdResCtrlOpt *opt = new CicoSCCmdResCtrlOpt();
+
+ cmd.cmdid = MSG_CMD_DESTORY_RES;
+ cmd.appid = window->appid;
+ cmd.pid = window->pid;
+ cmd.opt = opt;
+
+ opt->dispres = true;
+ opt->winname = window->name;
+ opt->surfaceid = window->surfaceid;
+
+ string fullname;
+ const CicoSCDisplayZone* zone = findDisplayZone(window->zoneid);
+ if (NULL != zone) {
+ opt->dispzone = zone->fullname;
+ }
+
+ opt->soundres = true;
+ opt->soundname = window->appid;
+ opt->soundid = 0;
+ CicoSystemConfig *sysconf = CicoSystemConfig::getInstance();
+ const CicoSCDefaultConf *defconf = sysconf->getDefaultConf();
+ if (NULL != defconf) {
+ const CicoSCSoundZoneConf *zoneconf =
+ sysconf->findSoundZoneConfbyId(defconf->soundzone);
+ if (NULL != zoneconf) {
+ opt->soundzone = zoneconf->fullname;
+ }
+ }
+ m_resMgr->handleCommand((const CicoSCCommand&)cmd, true);
+ }
+ // delete window in list
+ m_windowList.erase(window->surfaceid);
+ delete(window);
+
+ ICO_TRA("CicoSCWindowController::destroySurfaceCB: Leave");
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief wayland update surface name callback
+ *
+ * @param [in] surfaceid surface Id
+ * @param [in] winname surface name (title)
+ */
+//--------------------------------------------------------------------------
+void
+CicoSCWindowController::updateWinnameCB(uint32_t surfaceid,
+ const char *winname)
+{
+ ICO_TRA("CicoSCWindowController::updateWinnameCB: Enter(%08x,<%s>)",
+ surfaceid, winname ? winname : "(null)");
+
+ CicoSCWindow *window = findWindow(surfaceid);
+ if (NULL == window) {
+ ICO_WRN("CicoSCWindowController::updateWinnameCB: not found window(%08x)",
+ surfaceid);
+ ICO_TRA("CicoSCWindowController::updateWinnameCB Leave");
+ return;
+ }
+
+ window->name = winname;
+
+ // send message
+ CicoSCMessage *message = new CicoSCMessage();
+ message->addRootObject("command", MSG_CMD_NAME);
+ message->addRootObject("appid", window->appid);
+ message->addRootObject("pid", window->pid);
+ message->addArgObject("surface", window->surfaceid);
+ message->addArgObject("winname", window->name);
+ CicoSCServer::getInstance()->sendMessageToHomeScreen(message);
+
+ ICO_TRA("CicoSCWindowController::updateWinnameCB: Leave");
+}
+
+//--------------------------------------------------------------------------
+/**
* @brief wayland display attribute callback
*
* @param [in] data user data(unused)
uint32_t id_surface)
{
int pid;
- int ret;
struct ilmSurfaceProperties SurfaceProperties;
ICO_TRA("CicoSCWindowController::createSurfaceCB Enter"
"(surfaceid=0x%08x)", id_surface);
- if ((ilm_getPropertiesOfSurface(id_surface, &SurfaceProperties) != ILM_SUCCESS) ||
- (ilm_commitChanges() != ILM_SUCCESS)) {
+ if (ilm_getPropertiesOfSurface(id_surface, &SurfaceProperties) != ILM_SUCCESS) {
ICO_ERR("CicoSCWindowController::createSurfaceCB: ilm_getPropertiesOfSurface(%x) Error",
id_surface);
return;
}
- ICO_TRA("createSurfaceCB: surface=%08x pid=%d w/h=%d/%d->%d/%d",
- id_surface, SurfaceProperties.creatorPid,
- SurfaceProperties.sourceWidth, SurfaceProperties.sourceHeight,
+ ICO_TRA("createSurfaceCB: surface=%08x w/h=%d/%d->%d/%d",
+ id_surface, SurfaceProperties.sourceWidth, SurfaceProperties.sourceHeight,
SurfaceProperties.destWidth, SurfaceProperties.destHeight);
CicoSCWindow* window = new CicoSCWindow();
window->pid = pid;
window->displayid = 0; // currently fixed 0
window->raise = 1; // created surface is top of layer
+ window->srcwidth = SurfaceProperties.sourceWidth;
+ window->srcheight = SurfaceProperties.sourceHeight;
+ window->width = SurfaceProperties.destWidth;
+ window->height = SurfaceProperties.destHeight;
+ window->layerid = 0;
CicoSCLifeCycleController* appctrl;
appctrl = CicoSCLifeCycleController::getInstance();
return;
}
- CicoSCLayer *blayer = findLayer(window->displayid, window->layerid);
- if (blayer) {
- blayer->addSurface(window->surfaceid, true);
+ 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,
+ 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) {
+ ICO_ERR("CicoSCWindowController::createSurfaceCB "
+ "ilm_surfaceSetPosition(%08x) Error", window->surfaceid);
+ }
+ else if (ilm_surfaceSetOrientation(window->surfaceid, ILM_ZERO) != ILM_SUCCESS) {
+ ICO_ERR("CicoSCWindowController::createSurfaceCB "
+ "ilm_surfaceSetOrientation(%08x) Error", window->surfaceid);
+ }
+
+ CicoSCLayer *layer = findLayer(window->displayid, window->layerid);
+ if (layer) {
+ if (ilm_layerAddSurface(window->layerid, window->surfaceid) != ILM_SUCCESS) {
+ ICO_ERR("CicoSCWindowController::createSurfaceCB ilm_layerAddSurface(%d,%08x) "
+ "Error", window->layerid, window->surfaceid);
+ }
+
+ layer->addSurface(window->surfaceid, true);
int nsurf;
- const int *surfs = blayer->getSurfaces(&nsurf);
+ const int *surfs = layer->getSurfaces(&nsurf);
if (ilm_layerSetRenderOrder(window->layerid, (t_ilm_layer *)surfs, nsurf)
!= ILM_SUCCESS) {
ICO_ERR("CicoSCWindowController::createSurfaceCB: "
"ilm_layerSetRenderOrder(%d,,%d) Error", window->layerid, nsurf);
}
- else if (ilm_commitChanges() != ILM_SUCCESS) {
- ICO_ERR("CicoSCWindowController::createSurfaceCB ilm_commitChanges() Error");
- }
+ }
+ if (ilm_commitChanges() != ILM_SUCCESS) {
+ ICO_ERR("CicoSCWindowController::createSurfaceCB ilm_commitChanges() Error");
}
appctrl->enterAUL(window->appid.c_str(), window->pid, window);
message->addArgObject("winname", window->name);
CicoSCServer::getInstance()->sendMessageToHomeScreen(message);
+ if (0 == window->appid.compare(ICO_SC_APPID_DEFAULT_ONS)) {
+ CicoSCMessageRes *msgOS = new CicoSCMessageRes();
+ msgOS->addRootObject("command", MSG_CMD_WINDOW_ID_RES);
+ msgOS->addRootObject("appid", window->appid);
+ msgOS->addRootObject("pid", window->pid);
+ msgOS->addWinObject(MSG_PRMKEY_ECU, "");
+ msgOS->addWinObject(MSG_PRMKEY_DISPLAY, "");
+ msgOS->addWinObject(MSG_PRMKEY_LAYER, "");
+ msgOS->addWinObject(MSG_PRMKEY_LAYOUT, "");
+ msgOS->addWinObject(MSG_PRMKEY_AREA, "");
+ msgOS->addWinObject(MSG_PRMKEY_DISPATCHAPP, "");
+ msgOS->addWinObject(MSG_PRMKEY_ROLE, window->name);
+ msgOS->addWinObject(MSG_PRMKEY_RESOURCEID, window->surfaceid);
+ CicoSCServer::getInstance()->sendMessage(window->appid,
+ (CicoSCMessage*)msgOS);
+ }
+
if (NULL != m_resMgr) {
CicoSCCommand cmd;
CicoSCCmdResCtrlOpt *opt = new CicoSCCmdResCtrlOpt();
else {
show(window->surfaceid, NULL, 0);
}
-
- // add notification
- if ((ret = ilm_surfaceAddNotification(window->surfaceid, wlGeniviSurfaceNotification))
- != ILM_SUCCESS) {
- ICO_ERR("CicoSCWindowController::createSurfaceCB ilm_surfaceAddNotification(%08x) "
- "Error.%d", window->surfaceid, ret);
- }
ICO_TRA("CicoSCWindowController::createSurfaceCB Leave");
}
//--------------------------------------------------------------------------
/**
- * @brief genivi ivi-shell surface propaty callback
- *
- * @param [in] surface surface id
- * @param [in] SurfaceProperties surface properties
- * @param [in] mask change properties
- */
-//--------------------------------------------------------------------------
-void
-CicoSCWindowController::wlGeniviSurfaceNotification(t_ilm_surface surface,
- struct ilmSurfaceProperties *SurfaceProperties,
- t_ilm_notification_mask mask)
-{
- int newVisible;
-
- ICO_TRA("CicoSCWindowController::wlGeniviSurfaceNotification Enter(%x,,%x)", surface, mask);
- newVisible = SurfaceProperties->visibility ? ICO_SYC_WIN_VISIBLE_SHOW
- : ICO_SYC_WIN_VISIBLE_HIDE;
- CicoSCWindow *window = CicoSCWindowController::getInstance()->findWindow(surface);
- if (NULL == window) {
- ICO_WRN("CicoSCWindowController::wlGeniviSurfaceNotification Leave(surface=%08x not exist)", surface);
- return;
- }
- if ((window->visible != newVisible) ||
- (window->x != (int)SurfaceProperties->destX) ||
- (window->y != (int)SurfaceProperties->destY) ||
- (window->width != (int)SurfaceProperties->destWidth) ||
- (window->height != (int)SurfaceProperties->destHeight)) {
- // change visibility
- window->visible = newVisible;
- window->x = (int)SurfaceProperties->destX;
- window->y = (int)SurfaceProperties->destY;
- window->width = (int)SurfaceProperties->destWidth;
- window->height = (int)SurfaceProperties->destHeight;
-
- // update attr
- window->visible = newVisible;
-
- // notify to homescreen
- CicoSCMessage *message = new CicoSCMessage();
- message->addRootObject("command", MSG_CMD_CHANGE_ATTR);
- message->addRootObject("appid", window->appid);
- const CicoSCDisplayZone* zone
- = CicoSCWindowController::getInstance()->findDisplayZone(window->zoneid);
- if (NULL != zone) {
- message->addArgObject("zone", zone->fullname);
- }
- else {
- message->addArgObject("zone", "");
- }
- message->addArgObject("surface", window->surfaceid);
- message->addArgObject("winname", window->name);
- message->addArgObject("node", window->nodeid);
- message->addArgObject("layer", window->layerid);
- message->addArgObject("pos_x", window->x);
- message->addArgObject("pos_y", window->y);
- message->addArgObject("width", window->width);
- message->addArgObject("height", window->height);
- message->addArgObject("raise", window->raise ? 1 : 0);
- message->addArgObject("visible", window->visible ? 1 : 0);
- message->addArgObject("active", window->active ? 1 : 0);
- CicoSCServer::getInstance()->sendMessageToHomeScreen(message);
- }
- else {
- ICO_TRA("CicoSCWindowController::wlGeniviSurfaceNotification Leave(no change)");
- }
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief setup Genivi ivi-shell notification(callback) finctions
+ * @brief setup Genivi ivi-shell layer managerment system finctions
*
* @param none
*/
//--------------------------------------------------------------------------
void
-CicoSCWindowController::initializeGeniviNotifications(void)
+CicoSCWindowController::initializeGeniviLMS(void)
{
t_ilm_uint NumberOfScreens = 16;
t_ilm_uint ScreenIds[16];
t_ilm_int LayerNumber;
t_ilm_uint *pScreenIds = ScreenIds;
struct ilmScreenProperties ScreenProperties;
- int idx, DisplayId;
+ int idx, idx2;
+ int DisplayId, LayerId;
const CicoSCDisplayConf *DisplayConf;
const CicoSCLayerConf *LayerConf;
- int LayerId;
// get all screen id
memset(ScreenIds, 0, sizeof(ScreenIds));
if ((ilm_getScreenIDs(&NumberOfScreens, &pScreenIds) != ILM_SUCCESS) ||
(ilm_commitChanges() != ILM_SUCCESS)) {
- ICO_ERR("CicoSCWindowController::initializeGeniviNotifications "
+ ICO_ERR("CicoSCWindowController::initializeGeniviLMS "
"ilm_getScreenIDs() Error");
return;
}
- ICO_TRA("initializeGeniviNotifications: Screens=%d.%x %x %x %x",
+ ICO_TRA("initializeGeniviLMS: Screens=%d.%x %x %x %x",
NumberOfScreens, ScreenIds[0], ScreenIds[1], ScreenIds[2], ScreenIds[3]);
for (idx = 0; idx < (int)NumberOfScreens; idx++) {
- ICO_TRA("CicoSCWindowController::initializeGeniviNotifications: call ilm_getPropertiesOfScreen(%x)", ScreenIds[idx]);
+ ICO_TRA("CicoSCWindowController::initializeGeniviLMS: "
+ "call ilm_getPropertiesOfScreen(%x)", ScreenIds[idx]);
if ((ilm_getPropertiesOfScreen(ScreenIds[idx], &ScreenProperties) != ILM_SUCCESS) ||
(ilm_commitChanges() != ILM_SUCCESS)) {
- ICO_ERR("CicoSCWindowController::initializeGeniviNotifications "
+ ICO_ERR("CicoSCWindowController::initializeGeniviLMS "
"ilm_getPropertiesOfScreen(%d.%x) Error", idx, ScreenIds[idx]);
continue;
}
- ICO_TRA("CicoSCWindowController::initializeGeniviNotifications: "
+ ICO_TRA("CicoSCWindowController::initializeGeniviLMS: "
"Screen[%d.%x] w/h=%d/%d layers=%d",
idx, ScreenIds[idx], ScreenProperties.screenWidth,
ScreenProperties.screenHeight, ScreenProperties.layerCount);
if ((DisplayId < 0) ||
((DisplayConf = CicoSystemConfig::getInstance()->findDisplayConfbyId(DisplayId))
== NULL)) {
- ICO_ERR("CicoSCWindowController::initializeGeniviNotifications "
+ ICO_ERR("CicoSCWindowController::initializeGeniviLMS "
"ScreenId.%x not found", ScreenIds[idx]);
}
else {
-#if 0 // TODO
- CicoSystemConfig::getInstance()->setDisplaySize(DisplayId,
- ScreenProperties.screenWidth,
- ScreenProperties.screenHeight);
-#endif
// set genivi layers
for (idx = 0; ; idx++) {
LayerConf = CicoSystemConfig::getInstance()->
findLayerConfbyIdx(DisplayId, idx);
if (! LayerConf) break;
- LayerId = (DisplayId << 16) | LayerConf->id;
+ LayerId = LayerConf->id + DisplayId * 1000;
+ for (idx2 = 0; idx2 < LayerNumber; idx2++) {
+ if (LayerId == (int)pLayerId[idx2]) break;
+ }
+ if (idx2 < LayerNumber) {
+ ICO_TRA("CicoSCWindowController::initializeGeniviLMS: "
+ "layer.%d exist, Skip", LayerId);
+ continue;
+ }
+
if (ilm_layerCreateWithDimension((t_ilm_layer *)&LayerId,
DisplayConf->width, DisplayConf->height) != ILM_SUCCESS) {
- ICO_ERR("CicoSCWindowController::initializeGeniviNotifications "
- "ilm_layerCreateWithDimension(%x,%d,%d) Error",
+ ICO_ERR("CicoSCWindowController::initializeGeniviLMS "
+ "ilm_layerCreateWithDimension(%d,%d,%d) Error",
LayerId, DisplayConf->width, DisplayConf->height);
}
else if (ilm_commitChanges() != ILM_SUCCESS) {
- ICO_ERR("CicoSCWindowController::initializeGeniviNotifications "
+ ICO_ERR("CicoSCWindowController::initializeGeniviLMS "
"ilm_commitChanges() Error");
}
else if (ilm_layerSetOpacity(LayerId, (t_ilm_float)1.0f) != ILM_SUCCESS) {
- ICO_ERR("CicoSCWindowController::initializeGeniviNotifications "
- "ilm_layerSetOpacity(%x) Error", LayerId);
+ ICO_ERR("CicoSCWindowController::initializeGeniviLMS "
+ "ilm_layerSetOpacity(%d) Error", LayerId);
}
else if (ilm_layerSetSourceRectangle(LayerId, 0, 0,
DisplayConf->width, DisplayConf->height) != ILM_SUCCESS) {
- ICO_ERR("CicoSCWindowController::initializeGeniviNotifications "
- "ilm_layerSetSourceRectangle(%x) Error", LayerId);
+ ICO_ERR("CicoSCWindowController::initializeGeniviLMS "
+ "ilm_layerSetSourceRectangle(%d) Error", LayerId);
}
else if (ilm_layerSetDestinationRectangle(LayerId, 0, 0,
DisplayConf->width, DisplayConf->height) != ILM_SUCCESS) {
- ICO_ERR("CicoSCWindowController::initializeGeniviNotifications "
- "ilm_layerSetDestinationRectangle(%x) Error", LayerId);
+ ICO_ERR("CicoSCWindowController::initializeGeniviLMS "
+ "ilm_layerSetDestinationRectangle(%d) Error", LayerId);
}
else if (ilm_layerSetOrientation(LayerId, ILM_ZERO) != ILM_SUCCESS) {
- ICO_ERR("CicoSCWindowController::initializeGeniviNotifications "
- "ilm_layerSetOrientation(%x) Error", LayerId);
+ ICO_ERR("CicoSCWindowController::initializeGeniviLMS "
+ "ilm_layerSetOrientation(%d) Error", LayerId);
}
else if (ilm_layerSetOrientation(LayerId, ILM_ZERO) != ILM_SUCCESS) {
- ICO_ERR("CicoSCWindowController::initializeGeniviNotifications "
- "ilm_layerSetOrientation(%x) Error", LayerId);
+ ICO_ERR("CicoSCWindowController::initializeGeniviLMS "
+ "ilm_layerSetOrientation(%d) Error", LayerId);
}
else if (ilm_layerAddNotification(LayerId, wlGeniviLayerNotification)
!= ILM_SUCCESS) {
- ICO_ERR("CicoSCWindowController::initializeGeniviNotifications "
- "ilm_layerAddNotification(%x) Error", LayerId);
+ ICO_ERR("CicoSCWindowController::initializeGeniviLMS "
+ "ilm_layerAddNotification(%d) Error", LayerId);
}
else {
if (ilm_commitChanges() != ILM_SUCCESS) {
- ICO_ERR("CicoSCWindowController::initializeGeniviNotifications "
+ ICO_ERR("CicoSCWindowController::initializeGeniviLMS "
"ilm_commitChanges() Error");
}
- ICO_TRA("initializeGeniviNotifications: layer=%x created(%d,%d)",
+ ICO_TRA("initializeGeniviLMS: layer=%d created(%d,%d)",
LayerId, DisplayConf->width, DisplayConf->height);
*ppLayerId = LayerId;
ppLayerId ++;
if (LayerNumber > 0) {
if (ilm_displaySetRenderOrder(ScreenIds[idx], pLayerId, LayerNumber)
!= ILM_SUCCESS) {
- ICO_ERR("CicoSCWindowController::initializeGeniviNotifications "
+ ICO_ERR("CicoSCWindowController::initializeGeniviLMS "
"ilm_displaySetRenderOrder(%d) Error", LayerNumber);
}
else if (ilm_commitChanges() != ILM_SUCCESS) {
- ICO_ERR("CicoSCWindowController::initializeGeniviNotifications "
+ ICO_ERR("CicoSCWindowController::initializeGeniviLMS "
"ilm_commitChanges() Error");
}
ppLayerId = pLayerId;
for (idx = 0; idx < LayerNumber; idx++) {
if (ilm_layerAddNotification(*ppLayerId, wlGeniviLayerNotification)
!= ILM_SUCCESS) {
- ICO_ERR("CicoSCWindowController::initializeGeniviNotifications "
- "ilm_layerAddNotification(%x) Error", *ppLayerId);
+ ICO_ERR("CicoSCWindowController::initializeGeniviLMS "
+ "ilm_layerAddNotification(%d) Error", *ppLayerId);
}
ppLayerId ++;
}
else {
opt->dispzone = zone;
}
-#if 1
+#if 1 //TODO
opt->soundres = true;
opt->soundname = window->appid;
opt->soundid = 0;
ICO_TRA("CicoSCWindowController::notifyResourceManager Leave(EOK)");
return ICO_SYC_EOK;
}
+
+const CicoSCWindow*
+CicoSCWindowController::findWindowObj(int32_t pid, uint32_t surfaceid) const
+{
+ const CicoSCWindow* r = NULL;
+ map<unsigned int, CicoSCWindow*>::const_iterator itr = m_windowList.begin();
+ for (; itr != m_windowList.end(); ++itr) {
+ const CicoSCWindow* tmp = itr->second;
+ if ((pid == tmp->pid) && (surfaceid == (uint32_t)tmp->surfaceid)) {
+ r = tmp;
+ break; // break of for itr
+ }
+ }
+ ICO_TRA("return %x", r);
+ return r;
+}
+
+const CicoSCResourceManager*
+CicoSCWindowController::getResourceManager(void) const
+{
+ return m_resMgr;
+}
// vim:set expandtab ts=4 sw=4:
#include "CicoSCWlWinMgrIF.h"
+#define ICO_SC_APPID_DEFAULT_ONS "org.tizen.ico.onscreen"
+
//==========================================================================
// Forward declaration
//==========================================================================
int setAttributes(int surfaceid);
- static void initializeGeniviNotifications(void);
+ void initializeGeniviLMS(void);
static void wlGeniviLayerNotification(t_ilm_layer layer,
struct ilmLayerProperties *LayerProperties,
t_ilm_notification_mask mask);
-
- static void wlGeniviSurfaceNotification(t_ilm_surface surface,
- struct ilmSurfaceProperties *SurfaceProperties,
- t_ilm_notification_mask mask);
//
virtual void activeCB(void *data,
struct ico_window_mgr *ico_window_mgr,
int32_t stride,
uint32_t format);
+ virtual void updateSurfaceCB(void *data,
+ struct ico_window_mgr *ico_window_mgr,
+ uint32_t surfaceid,
+ int visible,
+ int srcwidth,
+ int srcheight,
+ int x,
+ int y,
+ int width,
+ int height);
+
+ virtual void destroySurfaceCB(void *data,
+ struct ico_window_mgr *ico_window_mgr,
+ uint32_t surfaceid);
+
+ virtual void updateWinnameCB(uint32_t surfaceid,
+ const char *winname);
+//
virtual void outputGeometryCB(void *data,
struct wl_output *wl_output,
int32_t x,
struct ivi_controller *ivi_controller,
uint32_t id_surface);
+ const CicoSCWindow* findWindowObj(int32_t pid, uint32_t surfaceid) const;
+
+ const CicoSCResourceManager* getResourceManager(void) const;
+
private:
// assignment operator
CicoSCWindowController& operator=(const CicoSCWindowController &object);
// fine display zone by id
const CicoSCDisplayZone * findDisplayZone(int zoneid);
+ void raiselower(CicoSCWindow *window, bool raise);
+
int notifyResourceManager(int surfaceid,
const char *zone,
int layerid,
// ico_window_mgr listener
m_listener.window_active = wlActiveCB;
m_listener.map_surface = wlMapSurfaceCB;
+ m_listener.update_surface = wlUpdateSurfaceCB;
+ m_listener.destroy_surface = wlDestroySurfaceCB;
// genivi ivi_application listener
m_ivi_app_listener.error = wlIviAppErrorCB;
ICO_DBG("CicoSCWlWinMgrIF::setWindowLayer: "
"surfaceid=0x%08X layer=%d->%d", surfaceid, oldlayer, layer);
+ if (oldlayer == layer) {
+ ICO_DBG("CicoSCWlWinMgrIF::setWindowLayer: new layer same as old, NOP");
+ return;
+ }
+
// remove original layer
if (oldlayer <= 0x7fffffff) {
ICO_TRA("CicoSCWlWinMgrIF::setWindowLayer: remove surface %08x "
"from layer(%d)", surfaceid, oldlayer);
- (void) ilm_layerRemoveSurface(oldlayer, surfaceid);
+ if (ilm_layerRemoveSurface(oldlayer, surfaceid) != ILM_SUCCESS) {
+ ICO_ERR("CicoSCWlWinMgrIF::setWindowLayer ilm_layerRemoveSurface(%d,%08x) "
+ "Error", oldlayer, surfaceid);
+ }
+ // must need ilm_commitChanges() after ilm_layerRemoveSurface()
+ if (ilm_commitChanges() != ILM_SUCCESS) {
+ ICO_ERR("CicoSCWlWinMgrIF::setWindowLayer ilm_commitChanges Error");
+ }
}
else {
ICO_TRA("CicoSCWlWinMgrIF::setWindowLayer: surface %08x has no old layer(%d)",
* @param [in] y
* @param [in] width
* @param [in] height
- * @param [in] flags (unused)
*/
//--------------------------------------------------------------------------
void
CicoSCWlWinMgrIF::setPositionsize(uint32_t surfaceid, uint32_t node,
- int32_t x, int32_t y, int32_t width,
- int32_t height, int32_t flags)
+ int32_t x, int32_t y, int32_t width, int32_t height)
{
// set position size request to Multi Window Manager
ICO_DBG("called: ilm_surfaceSetDestinationRectangle"
- "(surfaceid=0x%08X node=%d x=%d y=%d w=%d h=%d flags=%d)",
- surfaceid, node, x, y, width, height, flags);
- if ((ilm_surfaceSetDestinationRectangle(surfaceid, x, y, width, height)
- != ILM_SUCCESS) ||
- (ilm_commitChanges() != ILM_SUCCESS)) {
+ "(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)
+ != ILM_SUCCESS) {
ICO_ERR("CicoSCWlWinMgrIF::setPositionsize ilm_surfaceSetDestinationRectangle"
- "(%08x,%d,%d,%d,%d) Error",
- surfaceid, x, y, width, height);
+ "(%08x,%d,%d,%d,%d) Error", surfaceid, x, y, width, height);
+ }
+ else if (ilm_commitChanges() != ILM_SUCCESS) {
+ ICO_ERR("CicoSCWlWinMgrIF::setPositionsize ilm_commitChanges() Error");
}
}
*
* @param [in] surfaceid wayland surface id
* @param [in] visible visible state
- * @param [in] raise raise state
- * @param [in] flags (unused)
*/
//--------------------------------------------------------------------------
void
-CicoSCWlWinMgrIF::setVisible(uint32_t surfaceid, int32_t visible,
- int32_t raise, int32_t flags)
+CicoSCWlWinMgrIF::setVisible(uint32_t surfaceid, int32_t visible)
{
// set visible request to Multi Window Manager
- ICO_DBG("called: ilm_surfaceSetVisibility"
- "(surfaceid=0x%08X visible=%d raise=%d anima=%d)",
- surfaceid, visible, raise, flags);
+ ICO_DBG("called: ilm_surfaceSetVisibility(surfaceid=0x%08X visible=%d)",
+ surfaceid, visible);
if ((visible == ICO_SYC_WIN_VISIBLE_SHOW) || (visible == ICO_SYC_WIN_VISIBLE_HIDE)) {
ilm_surfaceSetVisibility(surfaceid, visible);
- }
- if ((raise == ICO_SYC_WIN_RAISE_RAISE) || (raise == ICO_SYC_WIN_RAISE_LOWER)) {
- // TODO: need raise/lower control
- }
- if (ilm_commitChanges() != ILM_SUCCESS) {
- ICO_ERR("CicoSCWlWinMgrIF::setVisible: ilm_commitChanges() Error");
+ if (ilm_commitChanges() != ILM_SUCCESS) {
+ ICO_ERR("CicoSCWlWinMgrIF::setVisible: ilm_commitChanges() Error");
+ }
}
}
//--------------------------------------------------------------------------
/**
+ * @brief surface update event callback
+ *
+ * @param [in] data user data(unused)
+ * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
+ * @param [in] surfaceid surface Id
+ * @param [in] visible visibility
+ * @param [in] srcwidth application buffer width
+ * @param [in] srcheight application buffer height
+ * @param [in] x X
+ * @param [in] y Y
+ * @param [in] width width
+ * @param [in] height height
+ */
+//--------------------------------------------------------------------------
+void
+CicoSCWlWinMgrIF::updateSurfaceCB(void *data,
+ struct ico_window_mgr *ico_window_mgr,
+ uint32_t surfaceid,
+ int visible,
+ int srcwidth,
+ int srcheight,
+ int x,
+ int y,
+ int width,
+ int height)
+{
+ ICO_WRN("CicoSCWlWinMgrIF::updateSurfaceCB called.");
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief wayland surface destroy callback
+ *
+ * @param [in] data user data(unused)
+ * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
+ * @param [in] surfaceid surface Id
+ */
+//--------------------------------------------------------------------------
+void
+CicoSCWlWinMgrIF::destroySurfaceCB(void *data,
+ struct ico_window_mgr *ico_window_mgr,
+ uint32_t surfaceid)
+{
+ ICO_WRN("CicoSCWlWinMgrIF::destroySurfaceCB called.");
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief wayland update surface name callback
+ *
+ * @param [in] surfaceid surface Id
+ * @param [in] winname surface name (title)
+ */
+//--------------------------------------------------------------------------
+void
+CicoSCWlWinMgrIF::updateWinnameCB(uint32_t surfaceid,
+ const char *winname)
+{
+ ICO_WRN("CicoSCWlWinMgrIF::updateWinnameCB called.");
+}
+
+//--------------------------------------------------------------------------
+/**
* @brief wayland display attribute callback
*
* @param [in] data user data(unused)
//--------------------------------------------------------------------------
/**
+ * @brief surface update event callback
+ *
+ * @param [in] data user data
+ * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
+ * @param [in] surfaceid surface Id
+ * @param [in] visible visibility
+ * @param [in] srcwidth application buffer width
+ * @param [in] srcheight application buffer height
+ * @param [in] x X
+ * @param [in] y Y
+ * @param [in] width width
+ * @param [in] height height
+ */
+//--------------------------------------------------------------------------
+void
+CicoSCWlWinMgrIF::wlUpdateSurfaceCB(void *data,
+ struct ico_window_mgr *ico_window_mgr,
+ uint32_t surfaceid,
+ int visible,
+ int srcwidth,
+ int srcheight,
+ int x,
+ int y,
+ int width,
+ int height)
+{
+// ICO_TRA("CicoSCWlWinMgrIF::wlUpdateSurfaceCB Enter");
+
+ if (NULL == data) {
+ ICO_WRN("wlUpdateSurfaceCB: data is null");
+ return;
+ }
+ static_cast<CicoSCWlWinMgrIF*>(data)->updateSurfaceCB(data, ico_window_mgr,
+ surfaceid, visible,
+ srcwidth, srcheight,
+ x, y, width, height);
+// ICO_TRA("CicoSCWlWinMgrIF::wlUpdateSurfaceCB Leave");
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief surface destroy event callback
+ *
+ * @param [in] data user data
+ * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
+ * @param [in] surfaceid surface Id
+ */
+//--------------------------------------------------------------------------
+void
+CicoSCWlWinMgrIF::wlDestroySurfaceCB(void *data,
+ struct ico_window_mgr *ico_window_mgr,
+ uint32_t surfaceid)
+{
+// ICO_TRA("CicoSCWlWinMgrIF::wlDestroySurfaceCB Enter");
+
+ if (NULL == data) {
+ ICO_WRN("wlDestroySurfaceCB: data is null");
+ return;
+ }
+ wlIviCtrlRemoveSurface(surfaceid);
+
+ static_cast<CicoSCWlWinMgrIF*>(data)->destroySurfaceCB(data, ico_window_mgr,
+ surfaceid);
+// ICO_TRA("CicoSCWlWinMgrIF::wlDestroySurfaceCB Leave");
+}
+
+//--------------------------------------------------------------------------
+/**
* @brief wayland display attribute callback
*
* @param [in] data user data(unused)
strncpy(tp->title, title, ICO_SYC_MAX_WINNAME_LEN-1);
tp->create_time = nowtime;
+ if (tp->id_surface) {
+ static_cast<CicoSCWlWinMgrIF*>(data)->updateWinnameCB(tp->id_surface, tp->title);
+ }
+
ICO_TRA("CicoSCWlWinMgrIF::wlIviAppNativeShellInfoCB: Leave");
}
int32_t stride,
uint32_t format);
+ virtual void updateSurfaceCB(void *data,
+ struct ico_window_mgr *ico_window_mgr,
+ uint32_t surfaceid,
+ int visible,
+ int srcwidth,
+ int srcheight,
+ int x,
+ int y,
+ int width,
+ int height);
+
+ virtual void destroySurfaceCB(void *data,
+ struct ico_window_mgr *ico_window_mgr,
+ uint32_t surfaceid);
+
+ virtual void updateWinnameCB(uint32_t surfaceid,
+ const char *winname);
//
virtual void outputGeometryCB(void *data,
struct wl_output *wl_output,
// wrapper function ico_window_mgr_set_positionsize
void setPositionsize(uint32_t surfaceid, uint32_t node,
- int32_t x, int32_t y, int32_t width,
- int32_t height, int32_t flags);
+ int32_t x, int32_t y, int32_t width, int32_t height);
// wrapper function ico_window_mgr_set_visible
- void setVisible(uint32_t surfaceid, int32_t visible,
- int32_t raise, int32_t flags);
+ void setVisible(uint32_t surfaceid, int32_t visible);
// wrapper function of ico_window_mgr_set_animation
void setAnimation(uint32_t surfaceid, int32_t type,
int32_t stride,
uint32_t format);
+ static void wlUpdateSurfaceCB(void *data,
+ struct ico_window_mgr *ico_window_mgr,
+ uint32_t surfaceid,
+ int layer,
+ int srcwidth,
+ int srcheight,
+ int x,
+ int y,
+ int width,
+ int height);
+
+ static void wlDestroySurfaceCB(void *data,
+ struct ico_window_mgr *ico_window_mgr,
+ uint32_t surfaceid);
//
static void wlOutputGeometryCB(void *data,
struct wl_output *wl_output,
// Wayland's genivi ivi_controller instance
static struct ivi_controller *m_ivi_ctrl;
+ // Wayland's genivi ivi_controller_surface instance
+ static struct ivi_controller_surface *m_ivi_ctrl_surf;
+
// wayland output instance
static struct wl_output *m_wloutput;
CicoSCServer.cpp \
CicoSCCommand.cpp \
CicoSCMessage.cpp \
+ CicoSCMessageRes.cpp \
CicoSCUser.cpp \
CicoSCUserManager.cpp \
CicoSCSysResourceController.cpp \
int surfaceid; /* window id */
char *animation; /* name of animation */
int animationTime; /* time of animation[ms] */
+ bool bEx; /* Expansion flag */
+ char *ECU; /* name to identify ECU */
+ char *display; /* name to identify Display in ECU */
+ char *layer; /* name to identify Layer in Display */
+ char *layout; /* name to identify layout in Layer */
+ char *area; /* name to Output position in Layout */
+ char *dispatchApp; /* origin of application */
+ char *role; /* role of notice kind */
+ int role_stt; /* state number change from role */
+ int resourceId; /* ID number of resource */
char *soundzone; /* area of playing sound */
int soundzoneid; /* area of playing sound */
+* Fri Feb 28 2014 Shibata Makoto <shibata@mac.tec.toyota.co.jp> accepted/tizen/ivi/20140226.204656@99d1ebc
+- 0.9.21 release
+-- A spec file is changed corresponding to the packages of GENIVI layer management.
+-- Some interfaces were added for SystemController corresponding to GENIVI layer management.
+-- It changes so that the layer controlling function of GENIVI may be used for surface management and layer management.
+
* Fri Feb 14 2014 Shibata Makoto <shibata@mac.tec.toyota.co.jp> submit/tizen/20140214.023123@397e77f
- 0.9.14 release
-- add: TIVI-1751 Home Screen needs to use system notifications framework
BuildRequires: pkgconfig(notification)
BuildRequires: boost-devel
BuildRequires: mesa-devel
+BuildRequires: weston-ivi-shell
+BuildRequires: weston-ivi-shell-devel
BuildRequires: genivi-shell
+BuildRequires: genivi-shell-devel
BuildRequires: ico-uxf-utilities-devel >= 0.9.07
Requires: weston >= 1.4
+Requires: weston-ivi-shell
Requires: genivi-shell
Requires: ico-uxf-weston-plugin >= 0.9.21
Requires: ico-uxf-utilities >= 0.9.07
},
"state":{
- "name":"OnScreen",
+ "name":"OnScreen_Priority",
"value":14000,
"state":{
"name":"OnScreen_Invisible",
"value":14999,
- "event":{"name":"EV14000", "value":14000, "transition":14001, "guardCondition":[{"operator":"=", "value":1}]},
- "event":{"name":"EV14000", "value":14000, "transition":14002, "guardCondition":[{"operator":"=", "value":2}]},
- "event":{"name":"EV14000", "value":14000, "transition":14003, "guardCondition":[{"operator":"=", "value":3}]}
+ "event":{"name":"EV14001", "value":14001, "transition":14001},
+ "event":{"name":"EV14002", "value":14002, "transition":14002},
+ "event":{"name":"EV14003", "value":14003, "transition":14003}
},
"state":{
- "name":"OnScreen_Warning",
+ "name":"OnScreen_PriorityLevel1",
"value":14001,
- "event":{"name":"EV14001", "value":14001, "transition":14999}
+ "event":{"name":"EV14999", "value":14999, "transition":14999}
},
"state":{
- "name":"OnScreen_Attention",
+ "name":"OnScreen_PriorityLevel2",
"value":14002,
- "event":{"name":"EV14001", "value":14001, "transition":14999},
- "event":{"name":"EV14000", "value":14000, "transition":14001, "guardCondition":[{"operator":"=", "value":1}]}
+ "event":{"name":"EV14001", "value":14001, "transition":14001},
+ "event":{"name":"EV14999", "value":14999, "transition":14999}
},
"state":{
- "name":"OnScreen_Message",
+ "name":"OnScreen_PriorityLevel3",
"value":14003,
- "event":{"name":"EV14001", "value":14001, "transition":14999},
- "event":{"name":"EV14000", "value":14000, "transition":14001, "guardCondition":[{"operator":"=", "value":1}]},
- "event":{"name":"EV14000", "value":14000, "transition":14002, "guardCondition":[{"operator":"=", "value":2}]}
+ "event":{"name":"EV14001", "value":14001, "transition":14001},
+ "event":{"name":"EV14002", "value":14002, "transition":14002},
+ "event":{"name":"EV14999", "value":14999, "transition":14999}
}
},
<type>2</type>
<menuoverlap>false</menuoverlap>
</layer>
- <layer id="2" name="SoftKeyboard">
- <type>101</type>
- <menuoverlap>false</menuoverlap>
- </layer>
- <layer id="3" name="HomeScreen">
+ <layer id="2" name="HomeScreen">
<type>3</type>
<menuoverlap>false</menuoverlap>
</layer>
- <layer id="4" name="ControlBar">
+ <layer id="3" name="ControlBar">
<type>3</type>
<menuoverlap>false</menuoverlap>
</layer>
- <layer id="5" name="InterruptApp">
+ <layer id="4" name="InterruptApp">
<type>4</type>
<menuoverlap>false</menuoverlap>
</layer>
- <layer id="6" name="OnScreen">
- <type>5</type>
- <menuoverlap>true</menuoverlap>
+ <layer id="5" name="OnScreen">
+ <layouts>
+ <layout id="1" name="Whole">
+ <areas>
+ <area id="1" name="Full">
+ <type>5</type>
+ <menuoverlap>true</menuoverlap>
+ </area>
+ </areas>
+ </layout>
+ <layout id="2" name="Half">
+ <areas>
+ <area id="1" name="Upper">
+ <type>5</type>
+ <menuoverlap>true</menuoverlap>
+ </area>
+ <area id="2" name="Lower">
+ <type>5</type>
+ <menuoverlap>true</menuoverlap>
+ </area>
+ </areas>
+ </layout>
+ </layouts>
</layer>
- <layer id="7" name="Touch">
+ <layer id="6" name="Touch">
<type>102</type>
<menuoverlap>false</menuoverlap>
</layer>
- <layer id="8" name="Cursor">
+ <layer id="7" name="Cursor">
<type>103</type>
<menuoverlap>false</menuoverlap>
</layer>
</vinfo>
</vehicle_info>
+<on_screen_roles>
+ <role id="DEFAULT" state="14003"/>
+ <role id="alert" state="14001"/>
+ <role id="attention" state="14002"/>
+ <role id="guide" state="14003"/>
+ <role id="help" state="14003"/>
+ <role id="incoming" state="14002"/>
+ <role id="information" state="14002"/>
+ <role id="message" state="14003"/>
+ <role id="warning" state="14001"/>
+</on_screen_roles>
+
+<on_screen_position>
+ <x>0</x>
+ <y>0</y>
+ <w>1080</w>
+ <h>1920</h>
+</on_screen_position>
+
</systemconfig>
<!-- vim:set expandtab ts=4 sw=4: -->
// On Screen
hs_instance->os_app_info->AddWindowInfo(win_info);
- // show onscreen window
- ico_syc_show(win_info->appid, win_info->surface, NULL);
-
// change the layer of onscreen window
ico_syc_change_layer(win_info->appid, win_info->surface,
HS_LAYER_ONSCREEN);
- // hide onscreen layer
- ico_syc_hide_layer(HS_LAYER_ONSCREEN);
+ const CicoSCPositionOSConf* oPOSC =
+ CicoSystemConfig::getInstance()->positionOSConf();
+ ico_syc_win_move_t move;
+ move.zone = NULL;
+ move.layer = HS_LAYER_ONSCREEN;
+ move.pos_x = oPOSC->m_x;
+ move.pos_y = oPOSC->m_y;
+ move.width = oPOSC->m_w;
+ move.height = oPOSC->m_h;
+ ico_syc_animation_t animation;
+ animation.name = (char*)ICO_HS_MENU_SHOW_ANIMATION_SLIDE;
+ animation.time = ICO_HS_MENU_ANIMATION_DURATION;
+ ico_syc_move(win_info->appid, win_info->surface, &move, &animation);
}
else {
#define HS_LAYER_APPLICATION ICO_SYC_LAYER_APPLICATION /* layer of Application */
#define HS_LAYER_HOMESCREEN ICO_SYC_LAYER_HOMESCREEN /* layer of HomeScreen menu */
#define HS_LAYER_CONTROLBAR ICO_SYC_LAYER_CONTROLBAR /* layer of Control/Status bar */
-#define HS_LAYER_FULLSCREEN ICO_SYC_LAYER_FULLSCREEN /* layer of FullScreen Application */
+#define HS_LAYER_INTERRUPTAPP ICO_SYC_LAYER_INTERRUPTAPP /* layer of Interrupt Application */
#define HS_LAYER_ONSCREEN ICO_SYC_LAYER_ONSCREEN /* layer of OnScreen */
#define HS_LAYER_TOUCHPANEL ICO_SYC_LAYER_TOUCHPANEL /* layer of TouchPanel input */
#define HS_LAYER_CURSOR ICO_SYC_LAYER_CURSOR /* layer of Cursor */
-#define HS_LAYER_2NDDISP_APP ICO_SYC_LAYER_MATERAPP /* second display application layer */
+#define HS_LAYER_2NDDISP_APP ICO_SYC_LAYER_MATERMAIN /* second display application layer */
/* config history name */
#define ICO_HS_CONFIG_HSTRY_KEY1 "timer"
{
ICO_TRA("CicoOSEFLApp::onTerminate Enter");
- m_onscreen->Finalize();
delete m_onscreen;
ICO_TRA("CicoOSEFLApp::onTerminate Leave");
* @date Jan-07-2014
*/
#include "CicoOnScreen.h"
+#include "CicoOSPopWindow.h"
#include <Ecore.h>
#include <Ecore_Wayland.h>
// static members
//==========================================================================
CicoOnScreen * CicoOnScreen::os_instance=NULL;
-struct popup_data CicoOnScreen::ico_appdata;
//==========================================================================
// functions
CicoOnScreen::CicoOnScreen(void)
{
ICO_TRA("CicoOnScreen::CicoOnScreen Enter");
-
- InitializePopupData();
-
+ m_request = NULL;
+ m_del = false;
+ m_reserve = NULL;
ICO_TRA("CicoOnScreen::CicoOnScreen Leave");
}
CicoOnScreen::~CicoOnScreen(void)
{
// ICO_TRA("CicoOnScreen::~CicoOnScreen Enter");
-// ICO_TRA("CicoOnScreen::~CicoOnScreen Leave");
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief CicoOnScreen::InitializePopupData
- * Initialize popup struct data
- *
- * @param[in] none
- * @return none
- */
-//--------------------------------------------------------------------------
-void
-CicoOnScreen::InitializePopupData(void)
-{
- ICO_TRA("CicoOnScreen::InitializePopupData Enter");
-
- ico_appdata.window = NULL;
- ico_appdata.icon = NULL;
- ico_appdata.noti = NULL;
- ico_appdata.show_flag = FALSE;
- ico_appdata.noti = NULL;
+ list<CicoOSPopWindow*>::iterator p = m_mngWin.begin();
+ while (p != m_mngWin.end()) {
+ CicoOSPopWindow* pt = *p;
+ delete pt;
+ }
+ m_mngWin.clear();
+ p = m_waitMngWin.begin();
+ while (p != m_waitMngWin.end()) {
+ CicoOSPopWindow* pt = *p;
+ delete pt;
+ }
+ m_waitMngWin.clear();
- ICO_TRA("CicoOnScreen::InitializePopupData Leave");
+ if (NULL != m_request) {
+ delete m_request;
+ m_request = NULL;
+ }
+// ICO_TRA("CicoOnScreen::~CicoOnScreen Leave");
}
//--------------------------------------------------------------------------
bool
CicoOnScreen::StartOnScreen(void)
{
- ICO_TRA("CicoOnScreen::StartOnScreen Enter");
+ ICO_TRA("Enter");
ico_syc_connect(EventCallBack, NULL);
// Initialize
ecore_evas_init();
- InitializePopup();
+
+ if (NULL == m_reserve) {
+ m_reserve = new CicoOSPopWindow(NOTIFICATION_TYPE_NONE);
+ }
// set notification callback function
notiservice_.SetCallback(NotificationCallback, this);
- ICO_TRA("CicoOnScreen::StartOnScreen Leave(true)");
+ ICO_TRA("Leave(true)");
return true;
}
-//--------------------------------------------------------------------------
-/**
- * @brief CicoOnScreen::Finalize
- * Finalize
- *
- * @param[in] none
- * @return none
- */
-//--------------------------------------------------------------------------
-void
-CicoOnScreen::Finalize(void)
+bool CicoOnScreen::insertNoti(notification_h noti_h)
{
- ICO_TRA("CicoOnScreen::Finalize Enter");
-
- // Free window handle
- if (ico_appdata.window != NULL) {
- ecore_evas_free(ico_appdata.window);
+ ICO_TRA("Enter");
+ CicoOSPopWindow* w = new CicoOSPopWindow(noti_h);
+ if (NULL == w) {
+ ICO_ERR("FAIL new class");
+ ICO_TRA("Leave (false)");
+ return false;
}
-
- ICO_TRA("CicoOnScreen::Finalize Leave");
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief CicoOnScreen::ShowPopup
- * Show popup window
- *
- * @param[in] none
- * @return none
- */
-//--------------------------------------------------------------------------
-void
-CicoOnScreen::ShowPopup(CicoNotification ¬i)
-{
- ICO_TRA("CicoOnScreen::ShowPopup Enter");
-
- ico_appdata.noti = new CicoNotification(noti.GetNotiHandle());
-
- // get caller pachage name
- const char *pkgname = noti.GetPkgname();
-
- // get priv_id
- int priv_id = noti.GetPrivId();
-
- // Get title
- const char *title = noti.GetTitle();
-
- // Get content
- const char *content = noti.GetContent();
-
- // Get execute option
- const char *text = NULL;
- bundle *service_handle = NULL;
- (void)noti.GetExecuteOption(NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH,
- &text, &service_handle);
-
- // Get icon path
- const char *icon = noti.GetIconPath();
- ICO_DBG("Received: %s : %i : %s : %s : %s : %x",
- pkgname, priv_id, title, content,
- text, (int)service_handle);
-
- if (icon) {
- if (NULL != ico_appdata.icon) {
- evas_object_image_file_set(ico_appdata.icon, icon, NULL);
- evas_object_show(ico_appdata.icon);
- }
- }
-
- if (title) {
- if (!edje_object_part_text_set(ico_appdata.theme, "title_text", title)) {
- ICO_WRN("could not set the text. Maybe part 'text' does not exist?");
- }
- }
-
- if (content) {
- if (strlen(content) <= 25) {
- ICO_DBG("content text center");
- if (!edje_object_part_text_set(ico_appdata.theme, "content_text_center", content)) {
- ICO_WRN("could not set the text. Maybe part 'text' does not exist?");
- }
- if (!edje_object_part_text_set(ico_appdata.theme, "content_text_left", "")) {
- ICO_WRN("could not set the text. Maybe part 'text' does not exist?");
- }
- }
- else {
- ICO_DBG("content text left");
- if (!edje_object_part_text_set(ico_appdata.theme, "content_text_left", content)) {
- ICO_WRN("could not set the text. Maybe part 'text' does not exist?");
- }
- if (!edje_object_part_text_set(ico_appdata.theme, "content_text_center", "")) {
- ICO_WRN("could not set the text. Maybe part 'text' does not exist?");
- }
- }
- }
-
- if (text) {
- if (!edje_object_part_text_set(ico_appdata.theme, "button_text", text)) {
- ICO_WRN("could not set the text. Maybe part 'text' does not exist?");
+ if (!w->Empty()) {
+ if (NOTIFICATION_TYPE_NOTI == w->GetType()) {
+ m_waitMngWin.push_back(w);
+ w = NULL;
}
}
- else {
- if (!edje_object_part_text_set(ico_appdata.theme, "button_text", "OK")) {
- ICO_WRN("could not set the text. Maybe part 'text' does not exist?");
- }
+ if (NULL != w) {
+ delete w;
+ w = NULL;
+ ICO_TRA("Leave (false)");
+ return false;
}
-
- evas_object_show(ico_appdata.theme);
-
- // TODO show onscreen layer
- ico_syc_show_layer(6);
-
- ecore_evas_show(ico_appdata.window);
-
- ICO_TRA("CicoOnScreen::ShowPopup Leave");
+ ICO_TRA("Leave (true)");
+ return true;
}
-
-//--------------------------------------------------------------------------
-/**
- * @brief CicoOnScreen::HidePopup
- * Hide popup window
- *
- * @param[in] data The user data passed from the callback
- * registration function
- * @param[in] e The handle to the popup window
- * @param[in] obj The handle to the Evas object
- * @param[in] event_info Event information
- * @return none
- */
-//--------------------------------------------------------------------------
-void
-CicoOnScreen::HidePopup(void)
+bool CicoOnScreen::deleteNoti(int priv_id)
{
- ICO_TRA("CicoOnScreen::HidePopup Enter");
-
- // TODO hide onscreen layer
- ico_syc_hide_layer(6);
-
- // Background(popup frame) hide
- evas_object_hide(ico_appdata.theme);
-
- if (NULL != ico_appdata.noti) {
- notification_error_e err = NOTIFICATION_ERROR_NONE;
- err = notification_delete(ico_appdata.noti->GetNotiHandle());
- if (NOTIFICATION_ERROR_NONE != err) {
- ICO_ERR("notification_delete faile(%d).");
+ ICO_TRA("Enter");
+ list<CicoOSPopWindow*>::iterator p = m_mngWin.begin();
+ for (; p != m_mngWin.end(); ++p) {
+ CicoOSPopWindow* w = *p;
+ if (priv_id == w->GetPrivId()) {
+ w->hidePopup();
}
- delete ico_appdata.noti;
- ico_appdata.noti = NULL;
- }
-
- ico_appdata.show_flag = FALSE;
-
- ICO_TRA("CicoOnScreen::HidePopup Leave");
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief CicoOnScreen::InitializePopup
- * Initialize popup window
- *
- * @param[in] none
- * @return none
- */
-//--------------------------------------------------------------------------
-void
-CicoOnScreen::InitializePopup(void)
-{
- ICO_TRA("CicoOnScreen::InitializePopup Enter");
-
- // Window setup
- ico_appdata.window = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, "frame=0");
- if (ico_appdata.window == NULL) {
- ICO_ERR("ecore_evas_new() error");
- Finalize();
- ICO_TRA("CicoOnScreen::InitializePopup Leave(ERR)");
- return;
}
- ecore_evas_show(ico_appdata.window);
-
- ico_appdata.theme = edje_object_add(ecore_evas_get(ico_appdata.window));
- if (NULL == ico_appdata.theme) {
- ICO_ERR("could not create edje object!");
- return;
- }
-
- if (!edje_object_file_set(ico_appdata.theme, "/usr/apps/org.tizen.ico.onscreen/res/themes/onscreen.edj", "main")) {
- Edje_Load_Error err = edje_object_load_error_get(ico_appdata.theme);
- const char *errmsg = edje_load_error_str(err);
- ICO_ERR("could not load 'main' from onscreen.edj: %s",
- errmsg);
- evas_object_del(ico_appdata.theme);
- ico_appdata.theme = NULL;
- return;
+ list<CicoOSPopWindow*> tmp;
+ p = m_waitMngWin.begin();
+ for (; p != m_waitMngWin.end(); ++p) {
+ CicoOSPopWindow* w = *p;
+ if (priv_id == w->GetPrivId()) {
+ tmp.push_back(w);
+ }
}
-
- // icon setup
- ico_appdata.icon = evas_object_image_filled_add(ecore_evas_get(ico_appdata.window));
- edje_object_part_swallow(ico_appdata.theme, "icon", ico_appdata.icon);
-
- /* getting size of screen */
- /* home screen size is full of display*/
- int display_width = 0;
- int display_height = 0;
- ecore_wl_screen_size_get(&display_width, &display_height);
-
- ICO_DBG("display size w/h=%d/%d", display_width, display_height);
- int popup_x = (display_width / 2) - (POPUP_FRAME_WIDTH / 2);
- int popup_y = (display_height / 2) - (POPUP_FRAME_HEIGHT/ 2);
- ICO_DBG("popup postion x/y=%d/%d", popup_x, popup_y);
- evas_object_move(ico_appdata.theme, popup_x, popup_y);
- evas_object_resize(ico_appdata.theme, POPUP_FRAME_WIDTH, POPUP_FRAME_HEIGHT);
-
- Evas_Object* obj = NULL;
- obj = (Evas_Object*)edje_object_part_object_get(ico_appdata.theme,
- "button_text");
- if (NULL != obj) {
- evas_object_event_callback_add(obj,
- EVAS_CALLBACK_MOUSE_UP,
- evasMouseUpCB,
- this);
+ p = tmp.begin();
+ for (; p != tmp.end(); ++p) {
+ CicoOSPopWindow* w = *p;
+ m_waitMngWin.remove(w);
+ delete w;
}
-
- obj = (Evas_Object*)edje_object_part_object_get(ico_appdata.theme,
- "button");
- if (NULL != obj) {
- evas_object_event_callback_add(obj,
- EVAS_CALLBACK_MOUSE_UP,
- evasMouseUpCB,
- this);
+ if (NULL != m_request) {
+ if (priv_id == m_request->GetPrivId()) {
+ m_del = true;
+ }
}
-
- evas_object_show(ico_appdata.theme);
-
- ICO_TRA("CicoOnScreen::InitializePopup Leave(OK)");
+ ICO_TRA("Leave (true)");
+ return true;
}
//--------------------------------------------------------------------------
CicoOnScreen::NotificationCallback(void *data, notification_type_e type,
notification_op *op_list, int num_op)
{
- ICO_TRA("CicoOnScreen::NotificationCallback Enter");
-
+ ICO_TRA("Enter");
+ bool bInsFlag = false;
for (int i = 0; i < num_op; i++) {
notification_op_type_e op_type = op_list[i].type;
int priv_id = op_list[i].priv_id;
switch (op_type) {
case NOTIFICATION_OP_INSERT :
{
- ICO_DBG("NOTIFICATION_OP_INSERT(%d)", op_type);
-
- CicoNotification noti(noti_h);
- if (noti.Empty()) {
- break;
+ ICO_DBG("NOTIFICATION_OP_INSERT");
+ if (true == os_instance->insertNoti(noti_h)) {
+ bInsFlag = true;
}
-
- // check notification type
- // TODO config
- notification_type_e type = noti.GetType();
- if (NOTIFICATION_TYPE_NOTI != type) {
- break;
- }
-
- // Show popup window
- if (ico_appdata.show_flag == FALSE) {
- ico_appdata.show_flag = TRUE;
- os_instance->ShowPopup(noti);
- }
- break;
+ break; // break of switch op_type
}
case NOTIFICATION_OP_UPDATE :
- ICO_DBG("NOTIFICATION_OP_UPDATE(%d)", op_type);
- break;
+ ICO_DBG("NOTIFICATION_OP_UPDATE");
+ break; // break of switch op_type
case NOTIFICATION_OP_DELETE:
{
- ICO_DBG("NOTIFICATION_OP_DELETE(%d)", op_type);
-
- if (NULL == ico_appdata.noti) {
- break;
- }
-
- if (priv_id == ico_appdata.noti->GetPrivId()) {
- delete ico_appdata.noti;
- ico_appdata.noti = NULL;
- os_instance->HidePopup();
- }
- break;
+ ICO_DBG("NOTIFICATION_OP_DELETE");
+ os_instance->deleteNoti(priv_id);
+ break; // break of switch op_type
}
case NOTIFICATION_OP_DELETE_ALL:
- ICO_DBG("NOTIFICATION_OP_DELETE_ALL(%d)", op_type);
- break;
+ ICO_DBG("NOTIFICATION_OP_DELETE_ALL");
+ break; // break of switch op_type
case NOTIFICATION_OP_REFRESH:
- ICO_DBG("NOTIFICATION_OP_REFRESH(%d)", op_type);
- break;
+ ICO_DBG("NOTIFICATION_OP_REFRESH");
+ break; // break of switch op_type
case NOTIFICATION_OP_SERVICE_READY:
- ICO_DBG("NOTIFICATION_OP_SERVICE_READY(%d)", op_type);
- break;
+ ICO_DBG("NOTIFICATION_OP_SERVICE_READY");
+ break; // break of switch op_type
default :
- break;
+ ICO_DBG("UNKOWN OP_TYPE(%d)", (int)op_type);
+ break; // break of switch op_type
}
}
- ICO_TRA("CicoOnScreen::NotificationCallback Leave");
+ if (true == bInsFlag) {
+ os_instance->requestShowSC();
+ }
+
+ ICO_TRA("Leave");
}
-//--------------------------------------------------------------------------
-/**
- * @brief callback function of evas mouse up event
- *
- * @param [in] data The user data passed from the callback
- * registration function
- * @param [in] e The handle to the popup window
- * @param [in] obj The handle to the Evas object
- * @param [in] event_info Event information
- *
- */
-//--------------------------------------------------------------------------
-void
-CicoOnScreen::evasMouseUpCB(void *data, Evas *e,
- Evas_Object *obj, void *event_info)
+bool CicoOnScreen::requestShowSC()
{
- ICO_TRA("CicoOnScreen::evasMouseUpCB Enter");
- ICO_DBG("obj name=%s", evas_object_name_get(obj));
-
- static_cast<CicoOnScreen*>(data)->HidePopup();
+ ICO_TRA("Enter");
+ if (NULL != m_request) {
+ ICO_TRA("Leave false(request now)");
+ return false;
+ }
+ if (m_waitMngWin.empty()) {
+ ICO_TRA("Leave false(nothing window)");
+ return false;
+ }
- ICO_TRA("CicoOnScreen::evasMouseUpCB Leave");
+ list<CicoOSPopWindow*>::iterator p = m_waitMngWin.begin();
+ m_del = false;
+ m_request = *p;
+ m_waitMngWin.remove(m_request);
+ bool r = m_request->showPopup();
+ while (false == r) { // fail showPop request
+ ICO_ERR("_____ Fail SHOW POP REQUEST(%d)",
+ m_request->GetPrivId());
+ delete m_request;
+ m_request = NULL;
+ if (m_waitMngWin.empty()) {
+ break;
+ }
+ p = m_waitMngWin.begin();
+ m_del = false;
+ m_request = *p;
+ m_waitMngWin.remove(m_request);
+ r = m_request->showPopup();
+ }
+ ICO_TRA("Leave %s", r? "true": "false");
+ return r;
}
-
+
//--------------------------------------------------------------------------
/**
* @brief callback for system controller
CicoOnScreen::EventCallBack(const ico_syc_ev_e event,
const void *detail, void *user_data)
{
- ICO_TRA("CicoOnScreen::EventCallBack Enter(event %d)", event);
-
+ ICO_TRA("Enter(event %d, %x, %x)", (int)event, detail, user_data);
+ ico_syc_res_info_t *ri = (ico_syc_res_info_t*) detail;
+ if (NULL == ri) {
+ ICO_ERR("____ CALLBACK NG PARAM");
+ return;
+ }
switch (event) {
case ICO_SYC_EV_RES_ACQUIRE:
- ICO_TRA("Received: ico syc event(ICO_SYC_EV_RES_ACQUIRE)");
- break;
+ ICO_TRA("_____ ICO_SYC_EV_RES_ACQUIRE");
+ break; // break of switch event
case ICO_SYC_EV_RES_DEPRIVE:
- ICO_TRA("Received: ico syc event(ICO_SYC_EV_RES_DEPRIVE)");
- break;
+ ICO_TRA("_____ ICO_SYC_EV_RES_DEPRIVE");
+ break; // break of switch event
case ICO_SYC_EV_RES_WAITING:
- ICO_TRA("Received: ico syc event(ICO_SYC_EV_RES_WAITING)");
- break;
+ ICO_TRA("_____ ICO_SYC_EV_RES_WAITING");
+ break; // break of switch event
case ICO_SYC_EV_RES_REVERT:
- ICO_TRA("Received: ico syc event(ICO_SYC_EV_RES_REVERT)");
- break;
+ ICO_TRA("_____ ICO_SYC_EV_RES_REVERT");
+ break; // break of switch event
case ICO_SYC_EV_RES_RELEASE:
- ICO_TRA("Received: ico syc event(ICO_SYC_EV_RES_RELEASE)");
- break;
+ {
+ ICO_TRA("_____ ICO_SYC_EV_RES_RELEASE");
+ if (NULL == ri->window) {
+ ICO_TRA("_____ no WINDOW");
+ break; // break of switch event
+ }
+ os_instance->releaseWindow(ri->window->resourceId);
+ break; // break of switch event
+ }
+ case ICO_SYC_EV_RES_WINDOW_ID:
+ {
+ ICO_TRA("_____ ICO_SYC_EV_RES_WINDOW_ID");
+ if (NULL == ri->window) {
+ ICO_TRA("_____ no WINDOW");
+ break; // break of switch event
+ }
+ os_instance->entryWindowId(ri->window->resourceId);
+ break; // break of switch event
+ }
default:
- break;
+ ICO_TRA("_____ UNKNOWN event(%d)", (int)event);
+ break; // break of switch event
}
- ICO_TRA("CicoOnScreen::EventCallBack Leave");
+ ICO_TRA("Leave");
+}
+
+bool
+CicoOnScreen::releaseWindow(uint32_t resourceId)
+{
+ ICO_TRA("Enter(%d)", resourceId);
+ bool bR = false;
+ list<CicoOSPopWindow*> tmp;
+
+ list<CicoOSPopWindow*>::iterator p = m_mngWin.begin();
+ for (; p != m_mngWin.end(); ++p) {
+ CicoOSPopWindow* w = *p;
+ if (resourceId == w->m_resourceId) {
+ tmp.push_back(w);
+ }
+ }
+ p = tmp.begin();
+ for (; p != tmp.end(); ++p) {
+ CicoOSPopWindow* w = *p;
+ m_mngWin.remove(w);
+ delete w;
+ bR = true;
+ }
+ tmp.clear();
+
+ ICO_TRA("Leave %s", bR? "true": "false");
+ return bR;
+}
+
+bool
+CicoOnScreen::entryWindowId(uint32_t resourceId)
+{
+ ICO_TRA("Enter(%d)", resourceId);
+ bool bR = false;
+ if (NULL != m_request) {
+ m_request->m_resourceId = resourceId;
+ if (true == m_request->acquireRes()) {
+ m_mngWin.push_back(m_request);
+ if (true == m_del) {
+ ICO_TRA("____ HIDE REQUEST");
+ m_request->hidePopup();
+ }
+ }
+ else {
+ delete m_request;
+ }
+ m_del = false;
+ m_request = NULL;
+ bR = requestShowSC();
+ }
+ ICO_TRA("Leave %s", bR? "true": "false");
+ return bR;
}
// vim: set expandtab ts=4 sw=4:
#define __UNUSED__
#endif
-#include <stdio.h>
+#include <cstdio>
#include <unistd.h>
-#include <string.h>
+#include <cstring>
+#include <list>
#include <app.h>
#include <aul.h>
#include "ico_syc_privilege.h"
#include "ico_log.h"
+#include "CicoOSPopWindow.h"
/*============================================================================*/
/* Define fixed parameters */
/*============================================================================*/
-/* Window Size */
-#define STATUS_BAR_HEIGHT 64
-#define CTRL_BAR_HEIGHT 128
-#define WIDTH 1080
-#define HEIGHT (1920 - STATUS_BAR_HEIGHT - CTRL_BAR_HEIGHT)
-
-/* Popup Size */
-#define POPUP_WIDTH 640
-#define POPUP_HEIGHT 300
-
-/* Popup Frame Size */
-#define POPUP_FRAME_THICK 10
-#define POPUP_FRAME_WIDTH (POPUP_WIDTH+POPUP_FRAME_THICK)
-#define POPUP_FRAME_HEIGHT (POPUP_HEIGHT+POPUP_FRAME_THICK)
-
-#if 0
-#define POPUP_ST_X ((WIDTH-POPUP_WIDTH)/2)
-#define POPUP_ST_Y ((HEIGHT-POPUP_HEIGHT)/2)
-
-/* Popup Frame Size */
-#define POPUP_FRAME_THICK 10
-#define POPUP_FRAME_WIDTH (POPUP_WIDTH+POPUP_FRAME_THICK)
-#define POPUP_FRAME_HEIGHT (POPUP_HEIGHT+POPUP_FRAME_THICK)
-#define POPUP_FRAME_ST_X (POPUP_ST_X-POPUP_FRAME_THICK/2)
-#define POPUP_FRAME_ST_Y (POPUP_ST_Y-POPUP_FRAME_THICK/2)
-
-/* Popup Icon Size */
-#define POPUP_ICON_WIDTH 50
-#define POPUP_ICON_HEIGHT 50
-#define POPUP_ICON_ST_X POPUP_ST_X
-#define POPUP_ICON_ST_Y POPUP_ST_Y
-
-/* Popup Title Size */
-#define POPUP_TITLE_WIDTH (POPUP_WIDTH-POPUP_ICON_WIDTH)
-#define POPUP_TITLE_HEIGHT POPUP_ICON_HEIGHT
-#define POPUP_TITLE_ST_X (POPUP_ST_X+POPUP_ICON_WIDTH)
-#define POPUP_TITLE_ST_Y POPUP_ST_Y
-
-/* Popup Content BG Size */
-#define POPUP_CONTENT_BG_WIDTH POPUP_WIDTH
-#define POPUP_CONTENT_BG_HEIGHT (POPUP_HEIGHT-POPUP_TITLE_HEIGHT)
-#define POPUP_CONTENT_BG_ST_X POPUP_ST_X
-#define POPUP_CONTENT_BG_ST_Y (POPUP_ST_Y+POPUP_TITLE_HEIGHT)
-
-/* Popup Content Size */
-#define POPUP_CONTENT_WIDTH POPUP_WIDTH
-#define POPUP_CONTENT_HEIGHT POPUP_TITLE_HEIGHT
-#define POPUP_CONTENT_ST_X POPUP_ST_X
-#define POPUP_CONTENT_ST_Y (POPUP_ST_Y+POPUP_TITLE_HEIGHT+(POPUP_HEIGHT-POPUP_CONTENT_HEIGHT)/2)
-
-#define ICO_ORIENTATION_VERTICAL (1)
-#define ICO_ORIENTATION_HORIZONTAL (2)
-
-#define LEMOLO_PKGNAME "org.tizen.dialer"
-#endif
-
-#define FALSE 0
-#define TRUE 1
-
-#if 0
-#define ICON_PATH (char *)"/usr/share/icons/default/small/org.tizen.dialer.png"
-#endif
/*============================================================================*/
/* Define data types */
/*============================================================================*/
-struct popup_data
-{
- Ecore_Evas *window;
- Evas_Object *icon;
- Evas_Object *theme;
- int show_flag;
- CicoNotification *noti;
-};
/*============================================================================*/
/* Define class */
CicoOnScreen(void);
~CicoOnScreen(void);
bool StartOnScreen(void);
- void Finalize(void);
- void HidePopup(void);
static void NotificationCallback(void *data,
notification_type_e type,
notification_op *op_list,
int num_op);
-
-private:
- void ShowPopup(CicoNotification ¬i);
- void InitializePopup(void);
- void InitializePopupData(void);
-
- static void evasMouseUpCB(void *data,
- Evas *e,
- Evas_Object *obj,
- void *event_info);
+protected:
+ bool requestShowSC();
static void EventCallBack(const ico_syc_ev_e event,
const void *detail,
void *user_data);
+ bool entryWindowId(uint32_t resourceId);
+ bool releaseWindow(uint32_t resourceId);
+ bool insertNoti(notification_h noti_h);
+ bool deleteNoti(int priv_id);
static CicoOnScreen *os_instance;
- static struct popup_data ico_appdata;
protected:
CicoNotificationService notiservice_;
+ std::list<CicoOSPopWindow*> m_mngWin;
+ std::list<CicoOSPopWindow*> m_waitMngWin;
+ CicoOSPopWindow* m_request;
+ bool m_del;
+ CicoOSPopWindow* m_reserve;
};
#endif // __CICO_ON_SCREEN_H__
// vim:set expandtab ts=4 sw=4:
OnScreen_SOURCES = \
on_screen_main.cpp \
CicoOSEFLApp.cpp \
- CicoOnScreen.cpp
+ CicoOnScreen.cpp \
+ CicoOSPopWindow.cpp
OnScreen_CFLAGS= \
@CAPIAPPFWAPPLICATION_CFLAGS@ \
sound = info->sound;
input = info->input;
if (window != NULL) {
- printf("\t(window zone[%s], name[%s], id[%s]\n",
- window->zone, window->name, window->id);
- if (strcmp(window->zone, TST_ZONE_A) != 0
- || strcmp(window->name, TST_NAME_A) != 0
- || strcmp(window->id, TST_ID_A) != 0) {
+ ico_syc_res_window_t *w = window;
+ printf("\t(window ECU[%s].display[%s].layer[%s].layout[%s].area[%s], app[%s], role[%s], resId[%d]",
+ w->ECU, w->display, w->layer, w->layout, w->area,
+ w->dispatchApp, w->role, w->resourceId);
+
+ if ((0 != strcmp(w->ECU, TST_ECU)) ||
+ (0 != strcmp(w->display, TST_display)) ||
+ (0 != strcmp(w->layer, TST_layer)) ||
+ (0 != strcmp(w->layout, TST_layout)) ||
+ (0 != strcmp(w->area, TST_area)) ||
+ (0 != strcmp(w->dispatchApp, TST_dispatchApp)) ||
+ (0 != strcmp(w->role, TST_role)) ||
+ (w->resourceId != TST_resourceId)) {
check_flag = 1;
}
}
int attr = 1;
/* set window resource info */
- window.zone = "center";
- window.name = "window A";
- window.id = "id A";
+ window.ECU = "Center";
+ window.display = "Center";
+ window.layer = "OnScreen";
+ window.layout = "Full";
+ window.area = "Full";
+ window.dispatchApp = "zzzzzzzz";
+ window.role = "Message";
+ window.resourceId = 8888;
/* set sound resource info */
sound.zone = "all";
sound.name = "sound B";
#define TST_ID_A (char *)"id A"
#define TST_ID_B (char *)"id B"
+#define TST_ECU (char *)"ECU A"
+#define TST_display (char *)"display A"
+#define TST_layer (char *)"layer A"
+#define TST_layout (char *)"layout A"
+#define TST_area (char *)"area A"
+#define TST_dispatchApp (char *)"dispatchApp A"
+#define TST_role (char *)"role A"
+#define TST_resourceId 55555
+
+
#define TST_ADJUST 1
#define TST_INPUT_EV 2
#define TST_RES_TYPE 0
AM_LDFLAGS = -module -avoid-version -rpath $(libdir) $(GLIB_LIBS)
bin_PROGRAMS = \
- ico_change_loginuser
+ ico_change_loginuser \
+ ico_clear_screen
check_LTLIBRARIES = $(TESTS)
check_PROGRAMS = ico_clear_screen ico_login_user
{
signal_flag = 1;
+#if 0
if (_display->ico_window_mgr) {
ico_window_mgr_set_visible(_display->ico_window_mgr, ICO_WINDOW_MGR_V_MAINSURFACE,
ICO_WINDOW_MGR_VISIBLE_HIDE, ICO_WINDOW_MGR_V_NOCHANGE,
ICO_WINDOW_MGR_FLAGS_ANIMATION |
ICO_WINDOW_MGR_FLAGS_NO_CONFIGURE);
}
+#endif
}
void
opengl_swap_buffer(display->display, dpy, egl_surface);
+#if 0
ico_window_mgr_set_animation(display->ico_window_mgr, ICO_WINDOW_MGR_V_MAINSURFACE,
ICO_WINDOW_MGR_ANIMATION_TYPE_HIDE|
ICO_WINDOW_MGR_ANIMATION_TYPE_SHOW,
ICO_WINDOW_MGR_VISIBLE_SHOW, ICO_WINDOW_MGR_RAISE_RAISE,
ICO_WINDOW_MGR_FLAGS_ANIMATION |
ICO_WINDOW_MGR_FLAGS_NO_CONFIGURE);
+#endif
return(egl_surface);
}
-#include <stdio.h>
+#include <cstdio>
#include <iostream>
+#include <string>
+#include <functional>
+#include <algorithm>
#include "notification.h"
using namespace std;
int
main(int argc, char **argv)
{
- cout << "Notification TestProgram Start=========" <<endl;
+ const char* msgTyp = "TYPE_NOTI";
+ notification_type_e nType = NOTIFICATION_TYPE_NOTI;
- insert_notification(NOTIFICATION_TYPE_NOTI,
+ if (argc == 2) {
+ string sargv1(argv[1]);
+ if (0 == sargv1.compare("--ongoing")) {
+ msgTyp = "TYPE_ONGOING";
+ nType = NOTIFICATION_TYPE_ONGOING;
+ }
+ }
+
+ cout << "Notification TestProgram Start("<<msgTyp<<")=========" <<endl;
+
+ insert_notification(nType,
NOTIFICATION_GROUP_ID_DEFAULT,
NOTIFICATION_PRIV_ID_NONE,
"org.tizen.dialer",
"0123456789012345678901234",
"/usr/share/icons/default/small/org.tizen.dialer.png");
- insert_notification(NOTIFICATION_TYPE_NOTI,
+ insert_notification(nType,
NOTIFICATION_GROUP_ID_NONE,
NOTIFICATION_PRIV_ID_NONE,
"GV3ySIINq7.GhostCluster",
"test_content",
"/opt/share/icons/default/small/GV3ySIINq7.GhostCluster.png");
- insert_notification(NOTIFICATION_TYPE_NOTI,
+ insert_notification(nType,
NOTIFICATION_GROUP_ID_NONE,
NOTIFICATION_PRIV_ID_NONE,
"ODBQpKvkS1.Settings",
"test_content",
"/opt/share/icons/default/small/ODBQpKvkS1.Settings.png");
- insert_notification(NOTIFICATION_TYPE_NOTI,
+ insert_notification(nType,
NOTIFICATION_GROUP_ID_NONE,
NOTIFICATION_PRIV_ID_NONE,
"lYjFlj49Q4.saythis",
"test_content",
"/opt/share/icons/default/small/lYjFlj49Q4.saythis.png");
- insert_notification(NOTIFICATION_TYPE_NOTI,
+ insert_notification(nType,
NOTIFICATION_GROUP_ID_NONE,
NOTIFICATION_PRIV_ID_NONE,
"t8j6HTRpuz.MediaPlayer",
"test_content",
"/opt/share/icons/default/small/t8j6HTRpuz.MediaPlayer.png");
-
cout << "Notification_TestProgram End!=========" <<endl;
return 0;
}