A spec file is changed corresponding to the packages of GENIVI layer management.
Live thumbnail not updated at the time of menu un-displaying.
Correction of the review indication from a Tizen team.
Change-Id: I46e2edfeb2d6d908bd01f69a93a8ecbcf6504f69
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"
GENIVI_LIBS="-lilmCommon -lilmControl -lilmClient"
-AC_SUBST(GENIVI_CFLAGS)
AC_SUBST(GENIVI_LIBS)
SLPPKGMGR_CFLAGS="$SLPPKGMGR_CFLAGS"
AC_SUBST(WL_CFLAGS)
AC_SUBST(WL_LIBS)
-WESTONPLUGIN_CFLAGS="-I/usr/include/ico-uxf-weston-plugin"
WESTONPLUGIN_LIBS="-lico-uxf-weston-plugin"
-AC_SUBST(WESTONPLUGIN_CFLAGS)
AC_SUBST(WESTONPLUGIN_LIBS)
if test "x$GCC" = "xyes"; then
#ifndef _ICO_SYC_INPUTCTL_H_
#define _ICO_SYC_INPUTCTL_H_
-#include <ico_input_mgr-client-protocol.h>
+#include <ico-uxf-weston-plugin/ico_input_mgr-client-protocol.h>
#ifdef __cplusplus
extern "C" {
/* notify state changed to homescreen */
#define MSG_CMD_NOTIFY_CHANGED_STATE 0x00060001
+#define DEF_WS_CLI_HS_PORT "ws://127.0.0.1:10001"
+#define DEF_WS_CLI_HS_PROTOCOL "ico_hs_protocol"
/* application operation */
#define MSG_CMD_APP_START 1000
#define MSG_CMD_APP_STOP 1001
/*
- * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
+ * Copyright (c) 2013-2014, 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 Aug-6-2013
+ * @date Feb-21-2014
*/
#ifndef _ICO_SYC_TYPE_H_
#define _ICO_SYC_TYPE_H_
-#include <ico_window_mgr-client-protocol.h>
+#include <ico-uxf-weston-plugin/ico_window_mgr-client-protocol.h>
#ifdef __cplusplus
extern "C" {
* 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 *ECU; /* name to identify ECU */
char *display; /* name to identify Display in ECU */
char *layer; /* name to identify Layer in Display */
#ifndef _ICO_SYC_WINCTL_H_
#define _ICO_SYC_WINCTL_H_
-#include <ico_window_mgr-client-protocol.h>
+#include <ico-uxf-weston-plugin/ico_window_mgr-client-protocol.h>
#ifdef __cplusplus
extern "C" {
#define ICO_SYC_WIN_SURF_LOWER 0x02000000
#define ICO_SYC_WIN_SURF_NOCHANGE 0x04000000
#define ICO_SYC_WIN_SURF_NORESCTL 0x40000000
+#define ICO_SYC_WIN_SURF_ONESHOT 0x10000000
#define ICO_SYC_WIN_SURF_FLAGS 0xff000000
typedef struct _animation_info {
char *name; /* name of animation (ex. fade,slide,zoom etc..) */
}
/* free element */
- 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(w->ECU);
+ free(w->display);
+ free(w->layer);
+ free(w->layout);
+ free(w->area);
+ free(w->dispatchApp);
+ free(w->role);
/* free */
free(w);
}
/* free element */
- if (sound->zone != NULL) free(sound->zone);
- if (sound->name != NULL) free(sound->name);
- if (sound->id != NULL) free(sound->id);
+ free(sound->zone);
+ free(sound->name);
+ free(sound->id);
/* free */
free(sound);
}
/* free element */
- if (input->name != NULL) free(input->name);
+ free(input->name);
/* free */
free(input);
/* free memory */
g_object_unref(parser);
- if (lastinfo != NULL) free(lastinfo);
+ free(lastinfo);
return;
}
/* free memory */
g_object_unref(parser);
- if (win_info->appid != NULL) free(win_info->appid);
- if (win_info->name != NULL) free(win_info->name);
+ free(win_info->appid);
+ free(win_info->name);
free(win_info);
return;
/* free memory */
g_object_unref(parser);
- if (win_attr->appid != NULL) free(win_attr->appid);
- if (win_attr->name != NULL) free(win_attr->name);
- if (win_attr->zone != NULL) free(win_attr->zone);
+ free(win_attr->appid);
+ free(win_attr->name);
+ free(win_attr->zone);
free(win_attr);
return;
#define ICO_SYC_ROLE_CONF_RST 14999
#define ICO_SYC_ROLE_CONF_RST_STR "RESET"
+#define ICO_SYC_ONSCREEN_WINDOW_START_X 0
+#define ICO_SYC_ONSCREEN_WINDOW_START_Y 0
+#define ICO_SYC_ONSCREEN_WINDOW_WIDTH 1080
+#define ICO_SYC_ONSCREEN_WINDOW_HEIGHT 1920
//==========================================================================
/**
* @brief This class holds display information of system config
public:
/// default constructor
CicoSCNodeConf()
- : id(-1), name(""), address(""), type(-1) {}
+ : id(-1), type(-1) {}
/// destructor
- virtual ~CicoSCNodeConf() {}
+ ~CicoSCNodeConf() {}
/// dump log this class member variables
- void dumpConf(void)
+ void dumpConf()
{
ICO_DBG("node: id=%d name=%s address=%s type=%d",
id, name.c_str(), address.c_str(), type);
public:
/// default constructor
CicoSCLayerConf()
- : id(-1), name(""), type(-1), menuoverlap(false),
- layout_id(-1), layout_name(""), area_id(-1), area_name("") {}
+ : id(-1), type(-1), menuoverlap(false), layout_id(-1), area_id(-1) {}
/// destructor
- virtual ~CicoSCLayerConf() {}
+ ~CicoSCLayerConf() {}
/// dump log this class member variables
- void dumpConf(void)
+ void dumpConf()
{
if(-1 != layout_id) {
ICO_DBG(" layer: %d, \"%s\" type=%d menuoverlap=%s layout: %d, \"%s\" area: %d, \"%s\"",
public:
/// default constructor
CicoSCDisplayZoneConf()
- : id(-1), name(""), fullname(""), x(-1), y(-1), w(-1), h(-1),
+ : id(-1), x(-1), y(-1), w(-1), h(-1),
aspectFixed(false), aspectAlignLeft(false),
aspectAlignRight(false), aspectAlignTop(false),
aspectAlignBottom(false) {}
/// destructor
- virtual ~CicoSCDisplayZoneConf() {}
+ ~CicoSCDisplayZoneConf() {}
/// dump log this class member variables
- void dumpConf(void)
+ void dumpConf()
{
ICO_DBG(" zone: id=%d name=%s fullname=%s x/y=%d/%d "
"w/h=%d/%d aspect(fixed=%s l/r=%s/%s t/b=%s/%s",
public:
/// default constructor
CicoSCDisplayConf()
- : id(-1), name(""), node(-1), no(-1),
+ : id(-1), node(-1), no(-1),
type(-1), width(-1), height(-1), inch(-1) {}
/// destructor
- virtual ~CicoSCDisplayConf() {}
+ ~CicoSCDisplayConf() {}
/// dump log this class member variables
- void dumpConf(void)
+ void dumpConf()
{
ICO_DBG("display: id=%d name=%s node=%d no=%d "
"type=%d width=%d height=%d inch=%d",
public:
/// default constructor
CicoSCSoundZoneConf()
- : id(-1), name(""), fullname("") {}
+ : id(-1) {}
/// destructor
- virtual ~CicoSCSoundZoneConf() {}
+ ~CicoSCSoundZoneConf() {}
/// dump log this class member variables
- void dumpConf(void)
+ void dumpConf()
{
ICO_DBG(" zone: id=%d name=%s fullname=%s",
id, name.c_str(), fullname.c_str());
public:
/// default constructor
CicoSCSoundConf()
- : id(-1), name(""), no(-1) {}
+ : id(-1), no(-1) {}
/// destructor
- virtual ~CicoSCSoundConf() {}
+ ~CicoSCSoundConf() {}
/// dump log this class member variables
- void dumpConf(void)
+ void dumpConf()
{
ICO_DBG("sound: id=%d name=%s no=%d", id, name.c_str(), no);
}
public:
/// default constructor
CicoSCCategoryConf()
- : id(-1), name(""), type(""),
- view(-1), sound(-1), input(-1), priority(0), rctrl(-1) {}
+ : id(-1), view(-1), sound(-1), input(-1), priority(0), rctrl(-1) {}
/// destructor
- virtual ~CicoSCCategoryConf() {}
+ ~CicoSCCategoryConf() {}
/// dump log this class member variables
- void dumpConf(void)
+ void dumpConf()
{
ICO_DBG("category: id=%d name=%s type=%s "
"view=%d sound=%d input=%d priority=%d",
/// default constructor
CicoSCAppKindConf()
- : id(-1), name(""), privilege(-1), priority(0){}
+ : id(-1), privilege(-1), priority(0){}
/// destructor
- virtual ~CicoSCAppKindConf() {}
+ ~CicoSCAppKindConf() {}
/// dump log this class member variables
- void dumpConf(void)
+ void dumpConf()
{
ICO_DBG("appkind: id=%d name=%s priority=%d priority=%d",
id, name.c_str(), privilege, priority);
public:
/// default constructor
CicoSCSwitchConf()
- : id(-1), name(""), appid(""), keycode(0){}
+ : id(-1), keycode(0){}
/// destructor
- virtual ~CicoSCSwitchConf() {}
+ ~CicoSCSwitchConf() {}
/// dump log this class member variables
- void dumpConf(void)
+ void dumpConf()
{
ICO_DBG(" switch: id=%d name=%s appid=%s",
id, name.c_str(), appid.c_str());
public:
/// default constructor
CicoSCInputDevConf()
- : id(-1), name("") {}
+ : id(-1) {}
/// destructor
- virtual ~CicoSCInputDevConf() {}
+ ~CicoSCInputDevConf() {}
/// dump log this class member variables
- void dumpConf(void)
+ void dumpConf()
{
ICO_DBG("inputdev: id=%d name=%s", id, name.c_str());
}
public:
/// default constructor
CicoSCDefaultConf()
- : topdir(""), confdir(""),
- node(-1), appkind(-1), category(-1), display(-1),
+ : node(-1), appkind(-1), category(-1), display(-1),
layer(-1), displayzone(-1), sound(-1), soundzone(-1),
inputdev(-1), inputsw(-1) {};
/// destructor
- virtual ~CicoSCDefaultConf() {}
+ ~CicoSCDefaultConf() {}
/// dump log this class member variables
- void dumpConf(void)
+ void dumpConf()
{
ICO_DBG("default: topdir=%s confdir=%s "
"node=%d appkind=%d category=%d "
public:
/// default constructor
CicoSCCpuResourceGrp()
- :m_id(-1), m_bDoIt(false), m_grpNm("") {}
+ :m_id(-1), m_bDoIt(false) {}
/// destructor
- virtual ~CicoSCCpuResourceGrp() {}
+ ~CicoSCCpuResourceGrp() {}
/// dump log this class member variables
- void dumpConf(void)
+ void dumpConf()
{
std::stringstream hightlist;
{
public:
/// default constructor
CicoSCResourceConf()
- :m_bDoIt(false), m_bDoItApp(false), m_bLog(false), m_cpuCGRPPath(""),
+ :m_bDoIt(false), m_bDoItApp(false), m_bLog(false),
m_sampling(-1), m_retryCnt(5), m_lowLimitVal(25),
m_highLimitVal(90) {}
/// destructor
- virtual ~CicoSCResourceConf() {}
+ ~CicoSCResourceConf() {}
/// dump log this class member variables
- void dumpConf(void)
+ void dumpConf()
{
ICO_DBG("do:%s,%s log:%s, dir:%s, smpl:%d r:%d l:%d h:%d sz:%d",
m_bDoIt? "true": "false", m_bDoItApp? "true": "false",
/// default constructor
CicoSCUserConf() :m_parent_dir("/home/app/ico") {}
/// destructor
- virtual ~CicoSCUserConf() {}
+ ~CicoSCUserConf() {}
/// dump log this class member variables
- void dumpConf(void)
+ void dumpConf()
{
ICO_DBG("parent dir:%s", m_parent_dir.c_str());
}
public:
/// default constructor
CicoSCVIPropertyConf()
- : name(""), objname(""), property(""), typestr(""),
- type(ICO_TYPE_UNKNOW) {}
+ : type(ICO_TYPE_UNKNOW) {}
/// destructor
- virtual ~CicoSCVIPropertyConf() {}
+ ~CicoSCVIPropertyConf() {}
/// dump log this class member variables
- void dumpConf(void)
+ void dumpConf()
{
ICO_DBG("vehicle_info: id=%02d name=%s objname=%s property=%s "
"zone=%d typestr=%s type=%d",
CicoSCVehicleInfoConf() : retryCnt(0), waitTime(0) {}
/// destructor
- virtual ~CicoSCVehicleInfoConf() {}
+ ~CicoSCVehicleInfoConf() {}
/// dump log this class member variables
- void dumpConf(void)
+ void dumpConf()
{
ICO_DBG("vehicle info: retry=%d waitTime=%d", retryCnt, waitTime);
std::map<int, CicoSCVIPropertyConf*>::iterator itr;
CicoSCRoleConf()
: m_def(ICO_SYC_ROLE_CONF_DEF), m_rst(ICO_SYC_ROLE_CONF_RST) {}
/// destructor
- virtual ~CicoSCRoleConf() {}
+ ~CicoSCRoleConf() {}
/// dump log this class member variables
- void dumpConf(void)
+ void dumpConf()
{
ICO_DBG("Role info: default=%d, reset=%d, size=%d",
(int)m_def, (int)m_rst, (int)m_stt.size());
{
public:
/// constructor
- CicoSCPositionOSConf()
- : m_x(0), m_y(0), m_w(1080), m_h(1920) {}
+ CicoSCPositionOSConf(int x, int y, int w, int h)
+ : m_x(x), m_y(y), m_w(w), m_h(h) {}
/// destructor
- virtual ~CicoSCPositionOSConf() {}
+ ~CicoSCPositionOSConf() {}
/// dump log this class member variables
- void dumpConf(void)
+ void dumpConf()
{
ICO_DBG("OnScreen Window position : x:%d, y:%d, w:%d, h:%d", m_x, m_y, m_w, m_h);
}
const CicoSCNodeConf*
CicoSystemConfig::findNodeConfbyName(const string & name)
{
- vector<CicoSCNodeConf*>::iterator itr;
+ vector<CicoSCNodeConf*>::const_iterator itr;
itr = m_nodeConfList.begin();
for (; itr != m_nodeConfList.end(); ++itr) {
- const CicoSCNodeConf* conf = const_cast<CicoSCNodeConf*>(*itr);
+ const CicoSCNodeConf* conf = (*itr);
if (name == conf->name) {
return conf;
}
const CicoSCDisplayConf*
CicoSystemConfig::findDisplayConfbyName(const string & name)
{
- vector<CicoSCDisplayConf*>::iterator itr;
+ vector<CicoSCDisplayConf*>::const_iterator itr;
itr = m_displayConfList.begin();
for (; itr != m_displayConfList.end(); ++itr) {
- const CicoSCDisplayConf* conf = NULL;
- conf = const_cast<CicoSCDisplayConf*>(*itr);
+ const CicoSCDisplayConf* conf = (*itr);
if (name == conf->name) {
return conf;
}
CicoSystemConfig::findDisplayConfbyName(const string& ECU, const string& name)
{
int nodeId = getNodeIdbyName(ECU);
- vector<CicoSCDisplayConf*>::iterator itr;
+ vector<CicoSCDisplayConf*>::const_iterator itr;
itr = m_displayConfList.begin();
for (; itr != m_displayConfList.end(); ++itr) {
- const CicoSCDisplayConf* conf = NULL;
- conf = const_cast<CicoSCDisplayConf*>(*itr);
+ const CicoSCDisplayConf* conf = (*itr);
if ((name == conf->name)&&(nodeId == conf->node)) {
return conf;
}
const CicoSCDisplayConf*
CicoSystemConfig::findDisplayConfbyId(int id)
{
- vector<CicoSCDisplayConf*>::iterator itr;
+ vector<CicoSCDisplayConf*>::const_iterator itr;
itr = m_displayConfList.begin();
for (; itr != m_displayConfList.end(); ++itr) {
- const CicoSCDisplayConf* conf = NULL;
- conf = const_cast<CicoSCDisplayConf*>(*itr);
+ const CicoSCDisplayConf* conf = (*itr);
if (id == conf->id) {
return conf;
}
vector<CicoSCLayerConf*>::const_iterator itr;
itr = displayConf->layerConfList.begin();
for (; itr != displayConf->layerConfList.end(); ++itr) {
- const CicoSCLayerConf* conf = NULL;
- conf = const_cast<CicoSCLayerConf*>(*itr);
+ const CicoSCLayerConf* conf = (*itr);
// if (layerName == conf->name) {
if ((layerName == conf->name) && (-1 == conf->layout_id)) {
return conf;
vector<CicoSCLayerConf*>::const_iterator itr;
itr = displayConf->layerConfList.begin();
for (; itr != displayConf->layerConfList.end(); ++itr) {
- const CicoSCLayerConf* conf = NULL;
- conf = const_cast<CicoSCLayerConf*>(*itr);
+ const CicoSCLayerConf* conf = (*itr);
if ((layer == conf->name)&&(layout == conf->layout_name)&&
(area == conf->area_name)) {
return conf;
vector<CicoSCLayerConf*>::const_iterator itr;
itr = displayConf->layerConfList.begin();
for (; itr != displayConf->layerConfList.end(); ++itr) {
- const CicoSCLayerConf* conf = NULL;
- conf = const_cast<CicoSCLayerConf*>(*itr);
+ const CicoSCLayerConf* conf = (*itr);
if (idx <= 0) {
return conf;
}
vector<CicoSCDisplayZoneConf*>::const_iterator itr;
itr = displayConf->zoneConfList.begin();
for (; itr != displayConf->zoneConfList.end(); ++itr) {
- const CicoSCDisplayZoneConf* conf = NULL;
- conf = const_cast<CicoSCDisplayZoneConf*>(*itr);
+ const CicoSCDisplayZoneConf* conf = (*itr);
if (zoneName == conf->name) {
// ICO_TRA("CicoSystemConfig::findDisplayZoneConfbyName Leave"
// "(0x%08x)", conf);
const CicoSCSoundConf*
CicoSystemConfig::findSoundConfbyName(const string & name)
{
- vector<CicoSCSoundConf*>::iterator itr;
+ vector<CicoSCSoundConf*>::const_iterator itr;
itr = m_soundConfList.begin();
for (; itr != m_soundConfList.end(); ++itr) {
- const CicoSCSoundConf* conf = NULL;
- conf = const_cast<CicoSCSoundConf*>(*itr);
+ const CicoSCSoundConf* conf = (*itr);
if (name == conf->name) {
return conf;
}
vector<CicoSCSoundZoneConf*>::const_iterator itr;
itr = soundConf->zoneConfList.begin();
for (; itr != soundConf->zoneConfList.end(); ++itr) {
- const CicoSCSoundZoneConf* conf = NULL;
- conf = const_cast<CicoSCSoundZoneConf*>(*itr);
+ const CicoSCSoundZoneConf* conf = (*itr);
if (zoneName == conf->name) {
return conf;
}
const CicoSCInputDevConf*
CicoSystemConfig::findInputDevConfbyName(const string & name)
{
- vector<CicoSCInputDevConf*>::iterator itr;
+ vector<CicoSCInputDevConf*>::const_iterator itr;
itr = m_inputDevConfList.begin();
for (; itr != m_inputDevConfList.end(); ++itr) {
- const CicoSCInputDevConf* conf = NULL;
- conf = const_cast<CicoSCInputDevConf*>(*itr);
+ const CicoSCInputDevConf* conf = (*itr);
if (name == conf->name) {
return conf;
}
vector<CicoSCSwitchConf*>::const_iterator itr;
itr = inputDevConf->switchConfList.begin();
for (; itr != inputDevConf->switchConfList.end(); ++itr) {
- const CicoSCSwitchConf* conf = NULL;
- conf = const_cast<CicoSCSwitchConf*>(*itr);
+ const CicoSCSwitchConf* conf = (*itr);
if (switchName == conf->name) {
return conf;
}
const CicoSCAppKindConf*
CicoSystemConfig::findAppKindConfbyName(const string & name)
{
- vector<CicoSCAppKindConf*>::iterator itr;
+ vector<CicoSCAppKindConf*>::const_iterator itr;
itr = m_appKindConfList.begin();
for (; itr != m_appKindConfList.end(); ++itr) {
- const CicoSCAppKindConf* conf = NULL;
- conf = const_cast<CicoSCAppKindConf*>(*itr);
+ const CicoSCAppKindConf* conf = (*itr);
if (name == conf->name) {
return conf;
}
const CicoSCDisplayZoneConf*
CicoSystemConfig::findDisplayZoneConfbyId(int id)
{
- vector<CicoSCDisplayConf*>::iterator itr;
+ vector<CicoSCDisplayConf*>::const_iterator itr;
itr = m_displayConfList.begin();
for (; itr != m_displayConfList.end(); ++itr) {
- vector<CicoSCDisplayZoneConf*>::iterator itr2;
+ vector<CicoSCDisplayZoneConf*>::const_iterator itr2;
itr2 = (*itr)->zoneConfList.begin();
for (; itr2 != (*itr)->zoneConfList.end(); ++itr2) {
if (id == (*itr2)->id) {
const CicoSCSoundZoneConf*
CicoSystemConfig::findSoundZoneConfbyId(int id)
{
- vector<CicoSCSoundConf*>::iterator itr;
+ vector<CicoSCSoundConf*>::const_iterator itr;
itr = m_soundConfList.begin();
for (; itr != m_soundConfList.end(); ++itr) {
- vector<CicoSCSoundZoneConf*>::iterator itr2;
+ vector<CicoSCSoundZoneConf*>::const_iterator itr2;
itr2 = (*itr)->zoneConfList.begin();
for (; itr2 != (*itr)->zoneConfList.end(); ++itr2) {
if (id == (*itr2)->id) {
const CicoSCCategoryConf*
CicoSystemConfig::findCategoryConfbyName(const string & name)
{
- vector<CicoSCCategoryConf*>::iterator itr;
+ vector<CicoSCCategoryConf*>::const_iterator itr;
itr = m_categoryConfList.begin();
for (; itr != m_categoryConfList.end(); ++itr) {
- const CicoSCCategoryConf* conf = NULL;
- conf = const_cast<CicoSCCategoryConf*>(*itr);
+ const CicoSCCategoryConf* conf = (*itr);
if (name == conf->name) {
//return const_cast<CicoSCCategoryConf*>(itr->pointer);
return conf;
const CicoSCCategoryConf*
CicoSystemConfig::findCategoryConfbyId(int id)
{
- vector<CicoSCCategoryConf*>::iterator itr;
+ vector<CicoSCCategoryConf*>::const_iterator itr;
itr = m_categoryConfList.begin();
for (; itr != m_categoryConfList.end(); ++itr) {
- const CicoSCCategoryConf* conf = NULL;
- conf = const_cast<CicoSCCategoryConf*>(*itr);
+ const CicoSCCategoryConf* conf = (*itr);
if (id == conf->id) {
return conf;
}
const CicoSCAppKindConf *
CicoSystemConfig::findAppKindConfbyId(int id)
{
- vector<CicoSCAppKindConf*>::iterator itr;
+ vector<CicoSCAppKindConf*>::const_iterator itr;
itr = m_appKindConfList.begin();
for (; itr != m_appKindConfList.end(); ++itr) {
if (id == (*itr)->id) {
int
CicoSystemConfig::getDisplayIdbyNo(int no)
{
- vector<CicoSCDisplayConf*>::iterator itr;
+ vector<CicoSCDisplayConf*>::const_iterator itr;
itr = m_displayConfList.begin();
for (; itr != m_displayConfList.end(); ++itr) {
- const CicoSCDisplayConf* conf = NULL;
- conf = const_cast<CicoSCDisplayConf*>(*itr);
+ const CicoSCDisplayConf* conf = (*itr);
if (no == conf->no) {
return conf->id;
}
if (-1 == id) {
return NULL;
}
- vector<CicoSCCategoryConf*>::iterator itr;
+ vector<CicoSCCategoryConf*>::const_iterator itr;
itr = m_categoryConfList.begin();
for (; itr != m_categoryConfList.end(); ++itr) {
- const CicoSCCategoryConf* conf = NULL;
- conf = const_cast<CicoSCCategoryConf*>(*itr);
+ const CicoSCCategoryConf* conf = (*itr);
if (id == conf->id) {
//return const_cast<CicoSCCategoryConf*>(itr->pointer);
return conf;
//--------------------------------------------------------------------------
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;
- }
+ int x = ICO_SYC_ONSCREEN_WINDOW_START_X;
+ int y = ICO_SYC_ONSCREEN_WINDOW_START_Y;
+ int w = ICO_SYC_ONSCREEN_WINDOW_WIDTH;
+ int h = ICO_SYC_ONSCREEN_WINDOW_HEIGHT;
- 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;
+ optional<string> optsx = posc.get_optional<string>("x");
+ if (true == optsx.is_initialized()) {
+ x = atoi(optsx.get().c_str());
}
- 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;
+ optional<string> optsy = posc.get_optional<string>("y");
+ if (true == optsy.is_initialized()) {
+ y = atoi(optsy.get().c_str());
}
- try {
- optional<string> opts = posc.get_optional<string>("h");
- if (true == opts.is_initialized()) {
- m_positionOSConf->m_h = atoi(opts.get().c_str());
- }
+ optional<string> optsw = posc.get_optional<string>("w");
+ if (true == optsw.is_initialized()) {
+ w = atoi(optsw.get().c_str());
}
- catch (...) {
- ICO_WRN("NG h");
- m_positionOSConf->m_h = 1920;
+
+ optional<string> optsh = posc.get_optional<string>("h");
+ if (true == optsh.is_initialized()) {
+ h = atoi(optsh.get().c_str());
}
+
+ m_positionOSConf = new CicoSCPositionOSConf(x, y, w, h);
m_positionOSConf->dumpConf();
}
bool
CicoSCLayer::is_topSurface(int surfaceid)
{
- if ((numsurfaces > 0) && (surfaceids[numsurfaces-1] == surfaceid)) {
- return true;
- }
- return false;
+ return (numsurfaces > 0) && (surfaceids[numsurfaces-1] == surfaceid);
}
//--------------------------------------------------------------------------
bool
CicoSCLayer::is_buttomSurface(int surfaceid)
{
- if ((numsurfaces > 0) && (surfaceids[0-1] == surfaceid)) {
- return true;
- }
- return false;
+ return (numsurfaces > 0) && (surfaceids[0] == surfaceid);
}
//--------------------------------------------------------------------------
ICO_TRA("CicoSCResourceManager::initialize Leave");
return ret;
}
-
+
void
CicoSCResourceManager::terminate(void)
{
int reqtype = internal ? REQTYPE_AUTO : REQTYPE_APP;
if ((MSG_CMD_CREATE_RES == cmd.cmdid) ||
(MSG_CMD_ACQUIRE_RES == cmd.cmdid)) {
-
+
if (true == opt->dispres) {
resource_request_t *req = newResourceRequest(RESID_KIND_DISPLAY,
reqtype,
if (true == isTypeOnScreen(*req)) {
acquireOnScreenDisplayResource(req);
}
- else
+ else
if ((true == m_policyMgr->getRegulation()) &&
(false == isMatchDisplayed())) {
updateDispResRegulationPreProc(req);
}
#if 0
-resource_request_t *
+resource_request_t *
CicoSCResourceManager::popDispResReq(resource_request_t *req)
{
ICO_TRA("CicoSCResourceManager::popDispResReq Enter");
return NULL;
}
-resource_request_t *
+resource_request_t *
CicoSCResourceManager::popInputResReq(resource_request_t *req)
{
ICO_TRA("CicoSCResourceManager::popInputResReq Enter");
}
bool displayMatch = false;
- //
+ //
if (req != newreq) {
char zoneO[128],zoneN[128];
zoneO[0] = zoneN[0] = '\0';
}
// update request data
req->dispzoneid = newreq->dispzoneid;
- if (NULL != req->dispzone) free(req->dispzone);
+ free(req->dispzone);
req->dispzone = strdup(newreq->dispzone);
req->layerid = newreq->layerid;
- if (NULL != req->animation) free(req->animation);
+ free(req->animation);
req->animation = strdup(newreq->animation);
req->animationTime = newreq->animationTime;
// delete new request
delResourceRequest(newreq);
}
-
+
if (false == control) {
ICO_TRA("Enqueue waiting display resource request"
"(req=0x%08x appid=%s)", req, req->appid);
}
}
- // If current request is not changed,
+ // If current request is not changed,
// remove the request from the waiting queue.
if (false == curchg) {
resource_request_t *req = popSoundResReq(newreq);
}
}
- // If current request is not changed,
+ // If current request is not changed,
// remove the request from the waiting queue.
if (false == curchg) {
resource_request_t *req = popInputResReq(newreq);
}
req->prio = req->category;
-
+
req->released = 0;
/* set resource id */
{
if (NULL == req) return;
- if (NULL != req->appid) free(req->appid);
- if (NULL != req->dispzone) free(req->dispzone);
- if (NULL != req->winname) free(req->winname);
- if (NULL != req->animation) free(req->animation);
- 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->appid);
+ free(req->dispzone);
+ free(req->winname);
+ free(req->animation);
+ free(req->soundzone);
+ free(req->soundname);
+ free(req->device);
+ free(req->ECU); // name to identify ECU
+ free(req->display); // name to identify Display in ECU
+ free(req->layer); // name to identify Layer in Display
+ free(req->layout); // name to identify layout in Layer
+ free(req->area); // name to Output position in Layout
+ free(req->dispatchApp); // origin of application
+ free(req->role); // role of notice
free(req);
}
/* NOP */
ICO_TRA("CicoSCResourceManager::enforceSound Leave");
}
-
+
// receive changed state
void
CicoSCResourceManager::receiveChangedState(int state)
ICO_TRA("CicoSCResourceManager::receiveChangedState Enter"
"(state=%d)", state);
- if (STID_DRVREGULATION_ON == state) {
+ if (STID_DRVREGULATION_ON == state) {
if (true == isMatchDisplayed()) {
updateDisplayResourceRegulation(state);
updateSoundResourceRegulation(state);
itr2 = m_curDispResOwerReq.begin();
for (; itr2 != m_curDispResOwerReq.end(); ++itr2) {
resource_request_t *tmpreq = itr2->second;
-
+
if (true == m_policyMgr->getDispZoneState(itr2->first)) {
continue;
}
// initialize current zone request
ICO_DBG("Dequeue current input request queue "
"(req=0x%08x input:%d appid=%s)",
- m_curInputResReq[i],
+ m_curInputResReq[i],
m_curInputResReq[i]->input, m_curInputResReq[i]->appid);
ICO_PRF("CHG_GUI_RES input deprived input=%d appid=%s",
m_curInputResReq[i]->input,
m_waitingDispResReq.erase(itr2);
ICO_DBG("Enqueue current display resource request"
"(req=0x%08x zone=%02d:%s appid=%s)",
- req, req->dispzoneid,
+ req, req->dispzoneid,
req->dispzone, req->appid);
ICO_PRF("CHG_GUI_RES display acquired zone=%02d:%s "
"appid=%s",
m_winCtrl->hide(surfaceid,
m_animaName.c_str(), m_animaTime);
}
-
+
// show current window
m_winCtrl->show(current->surfaceid,
m_animaName.c_str(), m_animaTime);
* @brief find currnet dipalay resource ower request
*
* @param [in] request compare requset
- *
+ *
* @return request object on same requeset found, NULL on not found
*/
//--------------------------------------------------------------------------
* @brief pop currnet dipalay resource ower request from list
*
* @param [in] request compare requset
- *
+ *
* @return request object on same requeset found, NULL on not found
*/
//--------------------------------------------------------------------------
* @brief find waiting dipalay resource request
*
* @param [in] request compare requset
- *
+ *
* @return request object on same requeset found, NULL on not found
*/
//--------------------------------------------------------------------------
* @brief pop waiting dipalay resource request from waiting list
*
* @param [in] request compare requset
- *
+ *
* @return request object on same requeset found, NULL on not found
*/
//--------------------------------------------------------------------------
}
}
}
-
+
min = ICO_DISPLAY1_ZONEID_MIN;
max = ICO_DISPLAY1_ZONEID_MAX;
- if ((NULL == curreq) &&
+ if ((NULL == curreq) &&
(req->dispzoneid >= min) && (req->dispzoneid <= max)) {
for (int i = min; i <= max; ++i) {
std::map<unsigned int, resource_request_t*>::iterator itr;
if (NULL != bwo) {
m_winCtrl->hide(bwo->surfaceid, NULL, 0);
if (m_rrtHO != tgt) {
- ICO_DBG("_____ NG Control OnScreen Resource %x(%d, %d), %x",
+ 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);
}
if ((ICO_SYC_ROLE_CONF_DEF == hEv) || (0 == hEv)) {
continue; // continue of for itr
}
+ bool test = m_policyMgr->testSMEvent(hEv);
if (true == m_policyMgr->sendSMEvent(hEv)) {
r = (*itr);
}
+ else if (true == test) {
+ r = (*itr);
+ }
}
ICO_TRA("Leave %x", r);
return r;
using namespace std;
#include <wayland-client.h>
-#include <ico_window_mgr-client-protocol.h>
-#include <ilm_control.h>
+#include <ico-uxf-weston-plugin/ico_window_mgr-client-protocol.h>
+#include <ilm/ilm_control.h>
#include "CicoSCWayland.h"
#include "CicoSCWlWinMgrIF.h"
const char *animation,
int animationTime)
{
+ int type = animationTime & ICO_SYC_WIN_SURF_FLAGS;
+ animationTime &= ~ICO_SYC_WIN_SURF_FLAGS;
+
ICO_TRA("CicoSCWindowController::show Enter"
- "(surfaceid=0x%08X animation=%s animationTime=%d)",
- surfaceid, animation, animationTime);
+ "(surfaceid=%08x animation=%s type=%x animationTime=%d)",
+ surfaceid, animation, type, animationTime);
// find window information in window list
CicoSCWindow *window = findWindow(surfaceid);
// set animation request to Multi Window Manager
int raiseFlag = ICO_SYC_WIN_RAISE_NOCHANGE;
- if (animationTime & ICO_SYC_WIN_SURF_RAISE) {
+ if (type & ICO_SYC_WIN_SURF_RAISE) {
raiseFlag = ICO_SYC_WIN_RAISE_RAISE;
}
- else if (animationTime & ICO_SYC_WIN_SURF_LOWER) {
+ else if (type & ICO_SYC_WIN_SURF_LOWER) {
raiseFlag = ICO_SYC_WIN_RAISE_LOWER;
}
- else if (((animationTime & ICO_SYC_WIN_SURF_NOCHANGE) == 0) &&
+ else if (((type & ICO_SYC_WIN_SURF_NOCHANGE) == 0) &&
(false == window->raise)) {
raiseFlag = ICO_SYC_WIN_RAISE_RAISE;
}
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);
+ (type & ICO_SYC_WIN_SURF_ONESHOT) ?
+ ICO_WINDOW_MGR_ANIMATION_TYPE_SHOW |
+ ICO_WINDOW_MGR_ANIMATION_TYPE_ONESHOT :
+ ICO_WINDOW_MGR_ANIMATION_TYPE_SHOW,
+ animation, animationTime);
}
// set raise/lower request (if need)
const char *animation,
int animationTime)
{
+ int type = animationTime & ICO_SYC_WIN_SURF_FLAGS;
+ animationTime &= ~ICO_SYC_WIN_SURF_FLAGS;
+
ICO_TRA("CicoSCWindowController::hide Enter"
- "(surfaceid=0x%08X animation=%s animationTime=%d)",
- surfaceid, animation, animationTime);
+ "(surfaceid=%08x animation=%s type=%x animationTime=%d)",
+ surfaceid, animation, type, animationTime);
// find window information in window list
CicoSCWindow *window = findWindow(surfaceid);
// set animation request to Multi Window Manager
if ((NULL != animation) && (animation[0] != '\0')) {
CicoSCWlWinMgrIF::setAnimation(window->surfaceid,
- ICO_WINDOW_MGR_ANIMATION_TYPE_HIDE,
- animation, animationTime & ~ICO_SYC_WIN_SURF_FLAGS);
+ (type & ICO_SYC_WIN_SURF_ONESHOT) ?
+ ICO_WINDOW_MGR_ANIMATION_TYPE_HIDE |
+ ICO_WINDOW_MGR_ANIMATION_TYPE_ONESHOT :
+ ICO_WINDOW_MGR_ANIMATION_TYPE_HIDE,
+ animation, animationTime);
}
// set visible request to Multi Window Manager
const char *animation,
int animationTime)
{
+ int type = animationTime & ICO_SYC_WIN_SURF_FLAGS;
+ animationTime &= ~ICO_SYC_WIN_SURF_FLAGS;
+
ICO_TRA("CicoSCWindowController::resize Enter"
- "(surfaceid=0x%08X h=%d w=%d animation=%s animationTime=%d)",
- surfaceid, w, h, animation, animationTime);
+ "(surfaceid=%08x h=%d w=%d animation=%s type=%x animationTime=%d)",
+ surfaceid, w, h, animation, type, animationTime);
// find window information in window list
CicoSCWindow *window = findWindow(surfaceid);
// set animation request to Multi Window Manager
if ((NULL != animation) && (animation[0] != '\0')) {
CicoSCWlWinMgrIF::setAnimation(window->surfaceid,
- ICO_WINDOW_MGR_ANIMATION_TYPE_RESIZE,
+ (type & ICO_SYC_WIN_SURF_ONESHOT) ?
+ ICO_WINDOW_MGR_ANIMATION_TYPE_RESIZE |
+ ICO_WINDOW_MGR_ANIMATION_TYPE_ONESHOT :
+ ICO_WINDOW_MGR_ANIMATION_TYPE_RESIZE,
animation, animationTime);
}
const char *animation,
int animationTime)
{
+ int type = animationTime & ICO_SYC_WIN_SURF_FLAGS;
+ animationTime &= ~ICO_SYC_WIN_SURF_FLAGS;
+
ICO_TRA("CicoSCWindowController::move Enter"
- "(surfaceid=0x%08X nodeid=%d x=%d y=%d "
- "animation=%s animationTime=%d)",
- surfaceid, nodeid, x, y, animation, animationTime);
+ "(surfaceid=%08x nodeid=%d x=%d y=%d "
+ "animation=%s type=%x animationTime=%d)",
+ surfaceid, nodeid, x, y, animation, type, animationTime);
// find window information in window list
CicoSCWindow *window = findWindow(surfaceid);
// set animation request to Multi Window Manager
if ((NULL != animation) && (animation[0] != '\0')) {
CicoSCWlWinMgrIF::setAnimation(window->surfaceid,
- ICO_WINDOW_MGR_ANIMATION_TYPE_MOVE,
+ (type & ICO_SYC_WIN_SURF_ONESHOT) ?
+ ICO_WINDOW_MGR_ANIMATION_TYPE_MOVE |
+ ICO_WINDOW_MGR_ANIMATION_TYPE_ONESHOT :
+ ICO_WINDOW_MGR_ANIMATION_TYPE_MOVE,
animation, animationTime);
}
const char *animation,
int animationTime)
{
+ int type = animationTime & ICO_SYC_WIN_SURF_FLAGS;
+ animationTime &= ~ICO_SYC_WIN_SURF_FLAGS;
+
ICO_TRA("CicoSCWindowController::raise Enter"
- "(surfaceid=0x%08X animation=%s animationTime=%d)",
- surfaceid, animation, animationTime);
+ "(surfaceid=%08x animation=%s type=%x animationTime=%d)",
+ surfaceid, animation, type, animationTime);
// find window information in window list
CicoSCWindow *window = findWindow(surfaceid);
// set animation request to Multi Window Manager
if ((NULL != animation) && (animation[0] != '\0')) {
CicoSCWindowController::setAnimation(window->surfaceid,
- ICO_WINDOW_MGR_ANIMATION_TYPE_SHOW,
+ (type & ICO_SYC_WIN_SURF_ONESHOT) ?
+ ICO_WINDOW_MGR_ANIMATION_TYPE_SHOW |
+ ICO_WINDOW_MGR_ANIMATION_TYPE_ONESHOT :
+ ICO_WINDOW_MGR_ANIMATION_TYPE_SHOW,
animation, animationTime);
}
// set raise request to Multi Window Manager
int moveAnimationTime)
{
ICO_TRA("CicoSCWindowController::setGeometry Enter"
- "(surfaceid=0x%08X nodeid=%d layerid=%d x=%d y=%d w=%d h=%d "
+ "(surfaceid=%08x nodeid=%d layerid=%d x=%d y=%d w=%d h=%d "
"resizeAnimation=%s resizeAnimationTime=%d "
"moveAnimation=%s moveAnimationTime=%d)",
surfaceid, nodeid, layerid, x, y, w, h,
const char *animation,
int animationTime)
{
+ int type = animationTime & ICO_SYC_WIN_SURF_FLAGS;
+ animationTime &= ~ICO_SYC_WIN_SURF_FLAGS;
+
ICO_TRA("CicoSCWindowController::lower Enter"
- "(surfaceid=0x%08X animation=%s animationTime=%d)",
- surfaceid, animation, animationTime);
+ "(surfaceid=08x animation=%s type=%x animationTime=%d)",
+ surfaceid, animation, type, animationTime);
// find window information in window list
CicoSCWindow *window = findWindow(surfaceid);
// set animation request to Multi Window Manager
if ((NULL != animation) && (animation[0] != '\0')) {
CicoSCWlWinMgrIF::setAnimation(window->surfaceid,
- ICO_WINDOW_MGR_ANIMATION_TYPE_HIDE,
+ (type & ICO_SYC_WIN_SURF_ONESHOT) ?
+ ICO_WINDOW_MGR_ANIMATION_TYPE_SHOW |
+ ICO_WINDOW_MGR_ANIMATION_TYPE_ONESHOT :
+ ICO_WINDOW_MGR_ANIMATION_TYPE_SHOW,
animation, animationTime);
}
return ICO_SYC_ENOENT;
}
- if (framerate < 0) {
- framerate = 0;
- }
-
CicoSCWlWinMgrIF::mapSurface(surfaceid, framerate, filepath);
CicoSCWayland::getInstance()->flushDisplay();
#define __CICO_SC_WL_INPUT_MGR_IF_H__
#include <string>
-#include <ico_input_mgr-client-protocol.h>
+#include <ico-uxf-weston-plugin/ico_input_mgr-client-protocol.h>
#include "CicoSCWaylandIF.h"
//--------------------------------------------------------------------------
m_listener.destroy_surface = wlDestroySurfaceCB;
// genivi ivi_application listener
- m_ivi_app_listener.error = wlIviAppErrorCB;
m_ivi_app_listener.wl_shell_info = wlIviAppNativeShellInfoCB;
// genivi ivi_controller listener
ICO_TRA("CicoSCWlWinMgrIF::wlIviCtrlRemoveSurface(%x) removed", id_surface);
return;
}
+ bp = tp;
+ tp = tp->next;
}
ICO_TRA("CicoSCWlWinMgrIF::wlIviCtrlRemoveSurface(%x) dose not exist", id_surface);
}
//--------------------------------------------------------------------------
/**
- * @brief wayland ivi-shell ivi-application protocol error callback
- *
- * @param [in] data user data(unused)
- * @param [in] ivi_application wayland ivi-application interface
- * @param [in] error_code error code
- * @param [in] error_text error message
- */
-//--------------------------------------------------------------------------
-void
-CicoSCWlWinMgrIF::wlIviAppErrorCB(void *data,
- struct ivi_application *ivi_application,
- int32_t error_code, const char *error_text)
-{
- ICO_TRA("CicoSCWlWinMgrIF::wlIviAppErrorCB: Enter(%d,%s)",
- error_code, error_text ? error_text : "(null)");
-
- if (NULL == data) {
- ICO_WRN("CicoSCWlWinMgrIF::wlIviAppErrorCB: data is null");
- return;
- }
- ICO_TRA("CicoSCWlWinMgrIF::wlIviAppErrorCB: Leave");
-}
-
-//--------------------------------------------------------------------------
-/**
* @brief wayland ivi-shell ivi-application protocol create wl_surface callback
*
* @param [in] data user data(unused)
#define __CICO_SC_WL_WINMGR_IF_H__
#include <wayland-client.h>
-#include <ilm_client.h>
-#include <ilm_control.h>
-#include <ico_window_mgr-client-protocol.h>
-#include <ivi-controller-client-protocol.h>
-#include <ivi-application-client-protocol.h>
+#include <ilm/ilm_client.h>
+#include <ilm/ilm_control.h>
+#include <ico-uxf-weston-plugin/ico_window_mgr-client-protocol.h>
+#include <weston/ivi-controller-client-protocol.h>
+#include <weston/ivi-application-client-protocol.h>
#include "ico_syc_type.h"
#include "CicoSCWaylandIF.h"
int32_t height,
int32_t refresh);
- static void wlIviAppErrorCB(void *data,
- struct ivi_application *ivi_application,
- int32_t error_code,
- const char *error_text);
-
static void wlIviAppNativeShellInfoCB(void *data,
struct ivi_application *ivi_application,
int32_t pid,
@MURPHYRESOURCE_CFLAGS@ \
@EDBUS_CFLAGS@ \
$(UWS_CFLAGS) \
- $(GENIVI_CFLAGS) \
- $(WESTONPLUGIN_CFLAGS) \
-I../../include \
-I../common \
-I../misc/state-machine
+* Wed Mar 26 2014 Shibata Makoto <shibata@mac.tec.toyota.co.jp> accepted/tizen/ivi/release/20140312.115201@3fee487
+- bug fix: Notification launch support. (TIVI-2926/1892)
+- bug fix: HomeScreen sometimes fails in connection with SystemController at the time of starting.
+- bug fix: Local time is supported in the clock display of StatusBar.
+- improve: A multiplex notice is supported in OnScreen.
+- bug fix: LiveThumbnail of HomeScreen not works when APP installed.
+- Homescreen take over the SURFACE of the old menu to the new menu, when that regenerate the menu.
+- Delete as named ico_send_inputevent tool (It is contained in weston-plugin).
+- bug fix: Swipe operation cannot be performed.
+- Live thumbnail not updated at the time of menu un-displaying.
+- Correction of the review indication from a Tizen team.
+
* 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.
if (app_running) {
ICO_DBG("CicoHSMenuTile::ValidMenuIcon: %s show icon", appid);
app_running = false;
- if (thumb.pixel_data) {
- free(thumb.pixel_data);
- thumb.pixel_data = NULL;
- }
+ free(thumb.pixel_data);
+ thumb.pixel_data = NULL;
if (icon == thumb_tile) {
icon = tile;
if (thumb_tile) {
ICO_HS_THUMB_FILEEXT, thumb.surface);
(void) unlink(sWork);
ico_syc_unmap_thumb(thumb.surface);
- // delete image and texture
- if ((surface == 0) && (thumb.pixel_data)) {
+ if (surface == 0) {
free(thumb.pixel_data);
thumb.pixel_data = NULL;
}
/* read surface image pixel */
int bufsize = ((thumb.width * thumb.height * 4 + 4095) / 4096) * 4096;
if ((! thumb.pixel_data) || (bufsize > thumb.pixel_bufsize)) {
- if (thumb.pixel_data) free(thumb.pixel_data);
+ free(thumb.pixel_data);
thumb.pixel_data = (char *)malloc(bufsize);
thumb.pixel_bufsize = bufsize;
if (thumb.pixel_data) {
ico_syc_unmap_thumb(thumb.surface);
thumb.surface = 0;
}
- if (thumb.pixel_data) {
- free(thumb.pixel_data);
- thumb.pixel_data = NULL;
- }
+ free(thumb.pixel_data);
+ thumb.pixel_data = NULL;
icon = tile;
}
#define ICO_HS_MENUTILE_TERM_ICON_WIDTH 64
#define ICO_HS_MENUTILE_TERM_ICON_HEIGHT 64
-#define ICO_HS_MENUTILE_THUMBNAIL_FPS_SHOW 10
-#define ICO_HS_MENUTILE_THUMBNAIL_FPS_HIDE 1
+#define ICO_HS_MENUTILE_THUMBNAIL_FPS_SHOW 15 /* 15 frames/sec */
+#define ICO_HS_MENUTILE_THUMBNAIL_FPS_HIDE -1 /* meanse 'not update' */
#define ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX 4
#define ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX2 6
#define ICO_HS_MENUTILE_THUMBNAIL_REDUCE_RATE 10
}
else {
animation.time = ICO_HS_SWIPE_TOUCH_SWIPE_ANIMA_TIME |
- ICO_SYC_WIN_SURF_RAISE | ICO_SYC_WIN_SURF_NORESCTL;
+ ICO_SYC_WIN_SURF_RAISE | ICO_SYC_WIN_SURF_NORESCTL |
+ ICO_SYC_WIN_SURF_ONESHOT;
/* show before application with slide to right */
appinfo = CicoHomeScreen::GetAppInfo(histapp.c_str());
}
else {
animation.time = ICO_HS_SWIPE_TOUCH_SWIPE_ANIMA_TIME |
- ICO_SYC_WIN_SURF_NORESCTL;
+ ICO_SYC_WIN_SURF_NORESCTL |
+ ICO_SYC_WIN_SURF_ONESHOT;
appinfo = CicoHomeScreen::GetAppInfo(curapp.c_str());
if (appinfo) {
animation.name = (char *)"slide.toleft";
}
else {
animation.time = ICO_HS_SWIPE_TOUCH_SWIPE_ANIMA_TIME |
- ICO_SYC_WIN_SURF_RAISE | ICO_SYC_WIN_SURF_NORESCTL;
+ ICO_SYC_WIN_SURF_RAISE | ICO_SYC_WIN_SURF_NORESCTL |
+ ICO_SYC_WIN_SURF_ONESHOT;
/* show next application with slide to left */
appinfo = CicoHomeScreen::GetAppInfo(histapp.c_str());
}
else {
animation.time = ICO_HS_SWIPE_TOUCH_SWIPE_ANIMA_TIME |
- ICO_SYC_WIN_SURF_NORESCTL;
+ ICO_SYC_WIN_SURF_NORESCTL |
+ ICO_SYC_WIN_SURF_ONESHOT;
appinfo = CicoHomeScreen::GetAppInfo(curapp.c_str());
if (appinfo) {
animation.name = (char *)"slide.toright";
#define __CICO_HOMESCREEN_COMMON_H__
#include <ico_log.h>
-#include <ico_window_mgr-client-protocol.h>
+#include <ico-uxf-weston-plugin/ico_window_mgr-client-protocol.h>
#include "ico_syc_sysdef.h"
#define ICO_OK 0
$(UWS_CFLAGS) \
$(PKGMGR_CFLAGS) \
$(UWS_CFLAGS) \
- $(WESTONPLUGIN_CFLAGS) \
-I../../include \
-I../../lib/common
$(UWS_CFLAGS) \
$(PKGMGR_CFLAGS) \
$(UWS_CFLAGS) \
- $(WESTONPLUGIN_CFLAGS) \
-I../../include \
-I../../lib/common
--- /dev/null
+/*
+ * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
+ *
+ * This program is licensed under the terms and conditions of the
+ * Apache License, version 2.0. The full text of the Apache License is at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ */
+
+//==========================================================================
+/**
+ * @file CicoOSClient.cpp
+ *
+ * @brief This file implementation of CicoOSClient class
+ */
+//==========================================================================
+
+#include <iostream>
+#include <sstream>
+#include <string>
+#include <boost/property_tree/ptree.hpp>
+#include <boost/property_tree/json_parser.hpp>
+#include <boost/foreach.hpp>
+#include <boost/optional.hpp>
+#include <sys/types.h>
+#include <unistd.h>
+
+using namespace boost::property_tree;
+using namespace std;
+
+#include "CicoOSClient.h"
+
+#include <ico_log.h>
+#include "ico_syc_error.h"
+#include "ico_syc_msg_cmd_def.h"
+
+//==========================================================================
+// private static variable
+//==========================================================================
+CicoOSClient* CicoOSClient::ms_myInstance = NULL;
+
+//--------------------------------------------------------------------------
+/**
+ * @brief default constructor
+ */
+//--------------------------------------------------------------------------
+CicoOSClient::CicoOSClient()
+ :m_uwsContext(NULL), m_id(NULL), m_seqNum(seqMin)
+{
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief destructor
+ */
+//--------------------------------------------------------------------------
+CicoOSClient::~CicoOSClient()
+{
+ if (NULL != m_uwsContext) {
+ ico_uws_close(m_uwsContext);
+ }
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief get CicoOSClient instance
+ *
+ * @return CicoOSClient instance
+ */
+//--------------------------------------------------------------------------
+CicoOSClient*
+CicoOSClient::getInstance()
+{
+ if (NULL == ms_myInstance) {
+ ms_myInstance = new CicoOSClient();
+ }
+
+ return ms_myInstance;
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief connect
+ *
+ * @param [in] port websocket port
+ * @param [in] protocol websocket protocol name
+ *
+ * @return ICO_SYC_EOK on success, other on error
+ * @retval ICO_SYC_EOK success
+ * @retval ICO_SYC_ENOSYS error(connection fail)
+ */
+//--------------------------------------------------------------------------
+bool
+CicoOSClient::connect()
+{
+ ICO_TRA("CicoOSClient::connect Enter");
+
+ /* create context */
+ m_uwsContext = ico_uws_create_context(DEF_WS_CLI_HS_PORT,
+ DEF_WS_CLI_HS_PROTOCOL);
+ if (NULL == m_uwsContext) {
+ ICO_ERR("ico_uws_create_context() failed.");
+ ICO_TRA("CicoOSClient::connect Leave false");
+ return false;
+ }
+
+ /* set callback */
+ int ret = ico_uws_set_event_cb(m_uwsContext, uwsReceiveEventCB,
+ (void *)this);
+ if (ret != ICO_UWS_ERR_NONE) {
+ ICO_ERR("ico_uws_set_event_cb() failed(%d).", ret);
+ ICO_TRA("CicoOSClient::connect Leave false");
+ return false;
+ }
+
+ ecore_timer_add(timerCount, CicoOSClient::ecoreTimerCB, this);
+
+ ICO_TRA("CicoOSClient::connect Leave ture");
+
+ return true;
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief control sequence number
+ */
+//--------------------------------------------------------------------------
+void CicoOSClient::updateSeqNum()
+{
+ m_seqNum++;
+ if (seqMax < m_seqNum) {
+ m_seqNum = seqMin;
+ }
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief get sequence number
+ */
+//--------------------------------------------------------------------------
+int CicoOSClient::getSeqNum() const
+{
+ return m_seqNum;
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief send message to application client
+ *
+ * @param [in] appid application id of destination
+ * @param [in] msg message
+ *
+ * @return ICO_SYC_EOK on success, other on error
+ */
+//--------------------------------------------------------------------------
+bool
+CicoOSClient::sendLaunchMessage(const string& op_app)
+{
+ ICO_TRA("CicoOSClient::sendMessage Enter(%s)", op_app.c_str());
+ if ((NULL == m_uwsContext) && (NULL == m_id)) {
+ ICO_TRA("CicoOSClient::sendMessage Leave(false)");
+ return false;
+ }
+ ico_uws_service(m_uwsContext);
+
+ ptree pt;
+ pt.put("command", MSG_CMD_WIN_CHANGE);
+#if 0
+ pt.put("source.appid", "org.tizen.onscreen");
+#else
+ pt.put("source.pid", (int)getpid());
+#endif
+ pt.put("source.seq_no", getSeqNum());
+ updateSeqNum();
+ pt.put("arg.appid", op_app);
+ pt.put("arg.zone", "Center");
+ pt.put("arg.visible", 1);
+ stringstream ss;
+ write_json(ss, pt, false);
+ string m = ss.str();
+
+ size_t l = m.length();
+ char b[l+1];
+ strcpy(b, m.c_str());
+ ICO_DBG("msg:%d, %s", l, b);
+ ico_uws_send(m_uwsContext, (void*)m_id, (unsigned char*)b, l);
+ ico_uws_service(m_uwsContext);
+#if 0
+ usleep(200);
+#endif
+
+ ICO_TRA("CicoOSClient::sendMessage Leave(true)");
+ return true;
+}
+
+//--------------------------------------------------------------------------
+/*
+ * @brief websocket utility callback function
+ *
+ * @param [in] context context
+ * @param [in] event event kinds
+ * @param [in] id client id
+ * @param [in] detail event detail
+ * @param [in] data user data
+ */
+//--------------------------------------------------------------------------
+void
+CicoOSClient::uwsReceiveEventCB(const struct ico_uws_context* context,
+ const ico_uws_evt_e event,
+ const void* id,
+ const ico_uws_detail* detail,
+ void* user_data)
+{
+ if (NULL == user_data) {
+ ICO_ERR("user_data is NULL");
+ return;
+ }
+
+ CicoOSClient* cosc = static_cast<CicoOSClient*>(user_data);
+ cosc->receiveEventCB(context, event, id, detail, user_data);
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief websocket callback function
+ *
+ * @param [in] context websocket context
+ * @param [in] event changed event
+ * @param [in] id source applicatin id
+ * @param [in] detail event detail information
+ * @param [in] user_data user data
+ */
+//--------------------------------------------------------------------------
+void
+CicoOSClient::receiveEventCB(const struct ico_uws_context* context,
+ const ico_uws_evt_e event,
+ const void* id,
+ const ico_uws_detail* detail,
+ void* user_data)
+{
+// ICO_TRA("CicoOSClient::receiveEventCB Enter");
+
+ switch (event) {
+ case ICO_UWS_EVT_CLOSE:
+ ICO_DBG(">>>RECV ICO_UWS_EVT_CLOSE(id=0x%08x)", (int)id);
+// ICO_TRA("CicoOSClient::receiveEventCB Leave");
+ return;
+ case ICO_UWS_EVT_ERROR:
+ ICO_DBG(">>>RECV ICO_UWS_EVT_ERROR(id=0x%08x, err=%d)",
+ (int)id, detail->_ico_uws_error.code);
+// ICO_TRA("CicoOSClient::receiveEventCB Leave");
+ return;
+ default:
+ break;
+ }
+
+ if (id != m_id) {
+ ICO_DBG(">>>CHANGE id %x -> %x", m_id, id);
+ m_id = id;
+ }
+
+ switch (event) {
+ case ICO_UWS_EVT_OPEN:
+ ICO_DBG(">>>RECV ICO_UWS_EVT_OPEN(id=0x%08x)", (int)id);
+ break;
+ case ICO_UWS_EVT_CLOSE:
+ ICO_DBG(">>>RECV ICO_UWS_EVT_CLOSE(id=0x%08x)", (int)id);
+ break;
+ case ICO_UWS_EVT_RECEIVE:
+ {
+ 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);
+ break;
+ }
+ 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);
+ break;
+ case ICO_UWS_EVT_DEL_FD:
+ ICO_DBG(">>>RECV ICO_UWS_EVT_DEL_FD(id=0x%08x, fd=%d)",
+ (int)id, detail->_ico_uws_fd.fd);
+ break;
+ default:
+ break;
+ }
+// ICO_TRA("CicoOSClient::receiveEventCB Leave");
+}
+
+Eina_Bool
+CicoOSClient::ecoreTimerCB(void *data)
+{
+ CicoOSClient* cosc = (CicoOSClient*)data;
+ cosc->refresh();
+ return ECORE_CALLBACK_RENEW;
+}
+
+bool
+CicoOSClient::refresh()
+{
+ if (NULL == m_uwsContext) {
+ ICO_TRA("NG refresh");
+ return false;
+ }
+ ico_uws_service(m_uwsContext);
+ return true;
+}
+
+// vim:set expandtab ts=4 sw=4:
--- /dev/null
+/*
+ * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
+ *
+ * This program is licensed under the terms and conditions of the
+ * Apache License, version 2.0. The full text of the Apache License is at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ */
+
+//==========================================================================
+/**
+ * @file CicoOSClient.h
+ *
+ * @brief This file is definition of CicoOSClient class
+ */
+//==========================================================================
+#ifndef __CICO_OS_CLIENT_H__
+#define __CICO_OS_CLIENT_H__
+
+#include <list>
+#include <string>
+
+#include <Ecore.h>
+#include <Eina.h>
+
+#include <ico_uws.h>
+
+//==========================================================================
+// forward declaration
+//==========================================================================
+const int seqMax = 10000;
+const int seqMin = 1;
+const double timerCount = 0.1;
+
+//==========================================================================
+/**
+ * @brief This class has function of interprocess message server
+ */
+//==========================================================================
+class CicoOSClient
+{
+public:
+ // get CicoOSClient instance
+ static CicoOSClient* getInstance();
+
+ // startup server
+ bool connect();
+
+ // send message to application client
+ bool sendLaunchMessage(const std::string& appid);
+
+ // websocket callback function
+ void receiveEventCB(const struct ico_uws_context* context,
+ const ico_uws_evt_e event,
+ const void* id,
+ const ico_uws_detail* detail,
+ void* user_data);
+private:
+ // default constructor
+ CicoOSClient();
+
+ // destructor
+ ~CicoOSClient();
+
+ // copy constructor
+ CicoOSClient(const CicoOSClient &object);
+
+ // websocket utility callback function
+ static void uwsReceiveEventCB(const struct ico_uws_context* context,
+ const ico_uws_evt_e event,
+ const void* id,
+ const ico_uws_detail* detail,
+ void* user_data);
+
+ static Eina_Bool ecoreTimerCB(void *data);
+
+ void updateSeqNum();
+ int getSeqNum() const;
+ bool refresh();
+
+private:
+ static CicoOSClient* ms_myInstance; ///< this class instance
+
+ struct ico_uws_context* m_uwsContext; ///< websocket utility context
+ const void* m_id;
+
+ int m_seqNum;
+};
+#endif // __CICO_OS_CLIENT_H__
+// vim:set expandtab ts=4 sw=4:
*/
#include <Ecore.h>
#include <Ecore_Wayland.h>
+#include <appsvc/appsvc.h>
#include "CicoOnScreen.h"
#include "CicoNotification.h"
#include "CicoOSPopWindow.h"
#include "ico_syc_type.h"
#include "ico_syc_appresctl.h"
+#include "CicoOSClient.h"
using namespace std;
CicoOSPopWindow::CicoOSPopWindow(notification_type_e type) : CicoNotification(type)
{
ICO_TRA("Enter type(%d)", (int)type);
- m_window = NULL;
- m_icon = NULL;
- m_theme = NULL;
- m_resourceId = 0;
- m_context = NULL;
+ m_window = NULL;
+ m_icon = NULL;
+ m_theme = NULL;
+ m_resourceId = 0;
+ m_context = NULL;
+ m_buttonTouch = false;
ICO_TRA("Leave");
}
CicoOSPopWindow::CicoOSPopWindow(notification_h noti) : CicoNotification(noti)
{
ICO_TRA("Enter");
- m_window = NULL;
- m_icon = NULL;
- m_theme = NULL;
- m_resourceId = 0;
- m_context = NULL;
+ m_window = NULL;
+ m_icon = NULL;
+ m_theme = NULL;
+ m_resourceId = 0;
+ m_context = NULL;
+ m_buttonTouch = false;
ICO_TRA("Leave");
}
//--------------------------------------------------------------------------
ICO_DBG("_____ %d = ico_syc_release_res", r);
}
+ ICO_DBG("_____ %d, %d", (int)m_buttonTouch, (int)m_appsvc_pkgname.empty());
+
+ if ((true == m_buttonTouch) && (false == m_appsvc_pkgname.empty())) {
+ CicoOSClient* cosc = CicoOSClient::getInstance();
+ if (NULL != cosc) {
+ int r = cosc->sendLaunchMessage(m_appsvc_pkgname);
+ ICO_DBG("_____ SendMsg:%d, %s", r, m_appsvc_pkgname.c_str());
+ }
+ }
+
ICO_TRA("Leave");
}
pkgname, priv_id, title, content,
text, (int)service_handle);
+ if (NULL != service_handle) {
+ const char* pn = appsvc_get_pkgname(service_handle);
+ if (NULL != pn) {
+ ICO_DBG("Received: appsvc_get_pkgname:%s", pn);
+ m_appsvc_pkgname = pn;
+ m_buttonTouch = false;
+ }
+ }
+
if (icon) {
if (NULL != m_icon) {
evas_object_image_file_set(m_icon, icon, NULL);
*/
//--------------------------------------------------------------------------
void
-CicoOSPopWindow::hidePopup(void)
+CicoOSPopWindow::hidePopup(bool buttonTouch)
{
- ICO_TRA("Enter");
+ ICO_TRA("Enter %s", buttonTouch? "true": "false");
+ m_buttonTouch = buttonTouch;
releaseRes();
-
ICO_TRA("Leave");
}
ICO_TRA("Leave(ERR)");
return false;
}
+ ecore_evas_alpha_set(m_window, EINA_TRUE);
ecore_evas_show(m_window);
ICO_TRA("Leave");
return true;
if (NULL != obj) {
ICO_DBG("_____ obj name=%s", evas_object_name_get(obj));
}
- static_cast<CicoOSPopWindow*>(data)->hidePopup();
+ static_cast<CicoOSPopWindow*>(data)->hidePopup(true);
ICO_TRA("Leave");
}
#include <stdio.h>
#include <unistd.h>
-#include <string.h>
+#include <string>
+#include <cstring>
#include <app.h>
#include <aul.h>
#define STATUS_BAR_HEIGHT 64
#define CTRL_BAR_HEIGHT 128
#define WIDTH 1080
+#if 1
+#define HEIGHT 1920
+#else
#define HEIGHT (1920 - STATUS_BAR_HEIGHT - CTRL_BAR_HEIGHT)
+#endif
/* Popup Size */
#define POPUP_WIDTH 640
CicoOSPopWindow(notification_h noti);
virtual ~CicoOSPopWindow();
bool showPopup();
- void hidePopup();
+ void hidePopup(bool buttonTouch = false);
bool acquireRes();
bool releaseRes();
const CicoNotification& getNotif() const {
Evas_Object* m_theme;
uint32_t m_resourceId;
struct ico_syc_res_context* m_context;
+ std::string m_appsvc_pkgname;
+ bool m_buttonTouch;
};
#endif // __CICO_ONSCREEN_POP_WINDOW_H__
#include "CicoOSPopWindow.h"
#include <Ecore.h>
#include <Ecore_Wayland.h>
+#include "CicoOSClient.h"
using namespace std;
}
m_waitMngWin.clear();
- if (NULL != m_request) {
- delete m_request;
- m_request = NULL;
- }
+ delete m_request;
+ m_request = NULL;
// ICO_TRA("CicoOnScreen::~CicoOnScreen Leave");
}
ICO_TRA("Enter");
ico_syc_connect(EventCallBack, NULL);
-
// save instance pointer
os_instance = this;
// Initialize
ecore_evas_init();
+ CicoOSClient* cosc = CicoOSClient::getInstance();
+ cosc->connect();
+
if (NULL == m_reserve) {
m_reserve = new CicoOSPopWindow(NOTIFICATION_TYPE_NONE);
m_reserve->createMainWindow();
}
if (NULL != w) {
delete w;
- w = NULL;
ICO_TRA("Leave (false)");
return false;
}
ICO_TRA("Leave %s", r? "true": "false");
return r;
}
-
+
//--------------------------------------------------------------------------
/**
* @brief callback for system controller
on_screen_main.cpp \
CicoOSEFLApp.cpp \
CicoOnScreen.cpp \
- CicoOSPopWindow.cpp
+ CicoOSPopWindow.cpp \
+ CicoOSClient.cpp
OnScreen_CFLAGS= \
@CAPIAPPFWAPPLICATION_CFLAGS@ \
$(AUL_CFLAGS) \
$(UWS_CFLAGS) \
$(NOTIFICATION_CFLAGS) \
- $(WESTONPLUGIN_CFLAGS) \
-I../../include \
-I../../lib/common \
-I../../lib/notification
$(AUL_CFLAGS) \
$(UWS_CFLAGS) \
$(NOTIFICATION_CFLAGS) \
- $(WESTONPLUGIN_CFLAGS) \
-I../../include \
-I../../lib/common \
-I../../lib/notification
$(OPT_LIBS) \
$(AUL_LIBS) \
$(UWS_LIBS) \
- $(NOTIFICATION_LIBS) \
+ $(NOTIFICATION_LIBS) \
+ -lappsvc \
../../lib/apps-framework/.libs/libico-appfw.so
SUFFIXES = .edc .edj
+++ /dev/null
-/*
- * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
- *
- * This program is licensed under the terms and conditions of the
- * Apache License, version 2.0. The full text of the Apache License is at
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- */
-
-//==========================================================================
-/**
- * @file CicoCommonComponent.cpp
- *
- * @brief This file is definition of CicoCommonComponent class
- */
-//==========================================================================
-
-#include <algorithm>
-#include <cassert>
-
-#include <ico_log.h>
-#include "CicoCommonComponent.h"
-
-//--------------------------------------------------------------------------
-/**
- * @brief default constructor
- *
- * @param[in] none
- * @return none
- */
-//--------------------------------------------------------------------------
-CicoCommonComponent::CicoCommonComponent()
- : posx_(0), posy_(0), width_(0), height_(0)
-{
- ICO_TRA("CicoCommonComponent::CicoCommonComponent Enter");
- ICO_TRA("CicoCommonComponent::CicoCommonComponent Leave");
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief destructor
- *
- * param[in] none
- * return none
- */
-//--------------------------------------------------------------------------
-CicoCommonComponent::~CicoCommonComponent()
-{
- ICO_TRA("CicoCommonComponent::~CicoCommonComponent Enter");
- ICO_TRA("CicoCommonComponent::~CicoCommonComponent Leave");
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief terminate component
- *
- * @param[in] none
- * @return bool
- * @retval true: success
- */
-//--------------------------------------------------------------------------
-bool
-CicoCommonComponent::Terminate(void)
-{
- ICO_TRA("CicoCommonComponent::Terminate Enter");
- std::list<std::shared_ptr<CicoCommonModule>>::iterator itr;
- std::list<std::shared_ptr<CicoCommonModule>>::iterator itr_end;
- for (itr = modulelist_.begin(); itr != itr_end; itr++) {
- (*itr)->Terminate();
- }
-
- modulelist_.clear();
- ICO_TRA("CicoCommonComponent::Terminate Leave");
- return true;
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief show component
- *
- * @param[in] none
- * @return none
- */
-//--------------------------------------------------------------------------
-void
-CicoCommonComponent::Show(void)
-{
- ICO_TRA("CicoCommonComponent::Show Enter");
-
- std::list<std::shared_ptr<CicoCommonModule>>::iterator itr;
- std::list<std::shared_ptr<CicoCommonModule>>::iterator itr_end;
- itr_end = modulelist_.end();
- for (itr = modulelist_.begin(); itr != itr_end; itr++) {
- (*itr)->Show();
- }
-
- ICO_TRA("CicoCommonComponent::Show Leave");
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief hide component
- * @param[in] none
- * @return none
- */
-//--------------------------------------------------------------------------
-void
-CicoCommonComponent::Hide(void)
-{
- ICO_TRA("CicoCommonComponent::Hide Enter");
- std::list<std::shared_ptr<CicoCommonModule>>::iterator itr;
- std::list<std::shared_ptr<CicoCommonModule>>::iterator itr_end;
- itr_end = modulelist_.end();
- for (itr = modulelist_.begin(); itr != itr_end; itr++) {
- (*itr)->Hide();
- }
- ICO_TRA("CicoCommonComponent::Hide Leave");
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief set position of component
- *
- * @param [in] x position of x
- * @param [in] y position of y
- * @return none
- */
-//--------------------------------------------------------------------------
-void
-CicoCommonComponent::SetPos(int x, int y)
-{
- ICO_TRA("CicoCommonComponent::SetPos Enter(x/y=%d/%d)", x, y);
- int diffx = x - posx_;
- int diffy = y - posy_;
- posx_ = x;
- posy_ = y;
- std::list<std::shared_ptr<CicoCommonModule>>::iterator itr;
- std::list<std::shared_ptr<CicoCommonModule>>::iterator itr_end;
- itr_end = modulelist_.end();
- for (itr = modulelist_.begin(); itr != itr_end; itr++) {
- (*itr)->Move(diffx, diffy);
- }
- ICO_TRA("CicoCommonComponent::SetPos Leave");
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief set size of component
- *
- * @param [in] w width of component
- * @param [in] h height of component
- * @return none
-*/
-//--------------------------------------------------------------------------
-void
-CicoCommonComponent::SetSize(int w, int h)
-{
- ICO_TRA("CicoCommonComponent::SetSize Enter(w/h=%d/%d)", w, h);
- double rate_w = width_ / w;
- double rate_h = height_ / h;
- width_ = w;
- height_ = h;
- std::list<std::shared_ptr<CicoCommonModule>>::iterator itr;
- std::list<std::shared_ptr<CicoCommonModule>>::iterator itr_end;
- itr_end = modulelist_.end();
- for (itr = modulelist_.begin(); itr != itr_end; itr++) {
- (*itr)->Reallocate(posx_, posy_, rate_w, rate_h);
-}
- ICO_TRA("CicoCommonComponent::SetSize Leave");
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief pack module
- *
- * @param [in] module add module object
- * @return none
-*/
-//--------------------------------------------------------------------------
-void
-CicoCommonComponent::PackModule(std::shared_ptr<CicoCommonModule> module)
-{
- modulelist_.push_back(module);
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief unpack module
- *
- * @param [in] module remove module object
- * @return none
- */
-//--------------------------------------------------------------------------
-void
-CicoCommonComponent::UnpackModule(std::shared_ptr<CicoCommonModule> module)
-{
- modulelist_.remove(module);
-}
-// vim: set expandtab ts=4 sw=4:
+++ /dev/null
-/*
- * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
- *
- * This program is licensed under the terms and conditions of the
- * Apache License, version 2.0. The full text of the Apache License is at
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- */
-
-//==========================================================================
-/**
- * @file CicoCommonComponent.h
- *
- * @brief This file is definition of CicoCommonComponent class
- */
-//==========================================================================
-#ifndef __CICO_COMMON_COMPONENT_H__
-#define __CICO_COMMON_COMPONENT_H__
-
-#include <Elementary.h>
-#include <ctime>
-#include <list>
-#include <memory>
-#include <vector>
-#include "CicoComponentInterface.h"
-#include "CicoModuleImplementation.h"
-
-//==========================================================================
-/**
- * @brief This class provide the common component interfaces
- */
-//==========================================================================
-class CicoCommonComponent : public CicoComponentInterface
-{
-public:
- // default constructor
- CicoCommonComponent();
-
- // destructor
- virtual ~CicoCommonComponent();
-
- // terminate component
- virtual bool Terminate(void);
-
- // show component
- virtual void Show(void);
-
- // hide component
- virtual void Hide(void);
-
- // set position of component
- virtual void SetPos(int x, int y);
-
- // set size of component
- virtual void SetSize(int w, int h);
-
-protected:
- // pack module
- void PackModule(std::shared_ptr<CicoCommonModule> module);
-
- // unpack module
- void UnpackModule(std::shared_ptr<CicoCommonModule> module);
-
-protected:
- int posx_; /// position x
- int posy_; /// position y
- int width_; /// componet width
- int height_; /// componet height
- std::list<std::shared_ptr<CicoCommonModule> > modulelist_; ///module list
-};
-#endif // __CICO_COMMON_COMPONENT_H__
-// vim: set expandtab ts=4 sw=4:
#include <cassert>
#include <ico_log.h>
-#include "CicoModuleInterface.h"
-#include "CicoModuleImplementation.h"
+#include "CicoComponentImplementation.h"
//--------------------------------------------------------------------------
/**
* @return none
*/
//--------------------------------------------------------------------------
-CicoCommonModule::CicoCommonModule()
+CicoCommonModule::CicoCommonModule()
: evasobj_(NULL), posx_(0), posy_(0), width_(0), height_(0)
{
ICO_TRA("CicoCommonModule::CicoCommonModule Enter");
CicoCommonModule::~CicoCommonModule()
{
ICO_TRA("CicoCommonModule::~CicoCommonModule Enter");
+ Terminate();
ICO_TRA("CicoCommonModule::~CicoCommonModule Leave");
}
CicoCommonModule::Terminate(void)
{
ICO_TRA("CicoCommonModule::Terminate Enter");
- if (evas_object_ref_get(evasobj_) > 1) {
- evas_object_unref(evasobj_);
- }
- else {
- evas_object_del(evasobj_);
+ if (evasobj_ != NULL) {
+ if (evas_object_ref_get(evasobj_) > 1) {
+ evas_object_unref(evasobj_);
+ }
+ else {
+ evas_object_del(evasobj_);
+ }
+ evasobj_ = NULL;
}
ICO_TRA("CicoCommonModule::Terminate Leave");
return true;
//--------------------------------------------------------------------------
/**
- * @brief show module
+ * @brief show module
*
* @param[in] none
* @return none
void
CicoCommonModule::Show(void)
{
- // ICO_TRA("CicoCommonModule::Show Enter");
+ //ICO_TRA("CicoCommonModule::Show Enter");
assert(evasobj_!=NULL);
evas_object_show(evasobj_);
assert (evas_object_visible_get(evasobj_) == EINA_TRUE);
- // ICO_TRA("CicoCommonModule::Show Leave");
+ //ICO_TRA("CicoCommonModule::Show Leave");
}
//--------------------------------------------------------------------------
CicoCommonWindow::Terminate(void)
{
ICO_TRA("CicoCommonWindow::Terminate Enter");
- std::list<CicoCommonComponent*>::iterator itr, itr_end;
- itr_end = componentlist_.end();
- for (itr = componentlist_.begin(); itr != itr_end; itr++) {
- delete (*itr);
- }
- componentlist_.clear();
ICO_TRA("CicoCommonWindow::Terminate Leave");
return true;
}
ecore_evas_show(window_);
if (windowobj_ != NULL) {
evas_object_show(windowobj_);
- std::list<CicoCommonComponent*>::iterator itr, itr_end;
- itr_end = componentlist_.end();
- for (itr = componentlist_.begin(); itr != itr_end; itr++) {
- (*itr)->Show();
- }
}
ICO_TRA("CicoCommonWindow::Show Leave");
}
ecore_evas_hide(window_);
if (windowobj_ != NULL) {
evas_object_hide(windowobj_);
- std::list<CicoCommonComponent*>::iterator itr, itr_end;
- itr_end = componentlist_.end();
- for (itr = componentlist_.begin(); itr != itr_end; itr++) {
- (*itr)->Hide();
- }
}
ICO_TRA("CicoCommonWindow::Show Enter");
}
ecore_evas_move(window_, posx_, posy_);
if (windowobj_ != NULL) {
evas_object_move(windowobj_, posx_, posy_);
- std::list<CicoCommonComponent*>::iterator itr, itr_end;
- itr_end = componentlist_.end();
- for (itr = componentlist_.begin(); itr != itr_end; itr++) {
- (*itr)->SetPos(posx_, posy_);
- }
}
}
ecore_evas_resize(window_, width_, height_);
if (windowobj_ != NULL) {
evas_object_resize(windowobj_, width_, height_);
- std::list<CicoCommonComponent*>::iterator itr, itr_end;
- itr_end = componentlist_.end();
- for (itr = componentlist_.begin(); itr != itr_end; itr++) {
- (*itr)->SetSize(width_, height_);
- }
}
}
+#if 0
//--------------------------------------------------------------------------
/**
* @brief set component
{
componentlist_.remove(component);
}
+#endif
// vim: set expandtab ts=4 sw=4:
#ifndef __CICO_COMMON_WINDOW_H__
#define __CICO_COMMON_WINDOW_H__
+#include <Elementary.h>
#include <Ecore.h>
#include <Evas.h>
#include <list>
-#include "CicoWindowInterface.h"
-#include "CicoCommonComponent.h"
//==========================================================================
/**
* @brief This class provide the common window interfaces
*/
//==========================================================================
-class CicoCommonWindow : public CicoWindowInterface
+class CicoCommonWindow
{
public:
// default constructor
CicoCommonWindow();
// destructor
- ~CicoCommonWindow();
+ virtual ~CicoCommonWindow();
// terminate the window
virtual bool Terminate(void);
virtual void SetSize(int w, int h);
protected:
- // set component
- void SetComponent(CicoCommonComponent *component);
-
- // unset component
- void UnsetComponent(CicoCommonComponent *component);
Ecore_Evas *window_; /// main window
Evas_Object *windowobj_; /// background
int posy_; /// position y
int width_; /// window width
int height_; /// window height
- std::list<CicoCommonComponent*> componentlist_; /// componet list
};
#endif // __CICO_COMMON_WINDOW_H__
// vim: set expandtab ts=4 sw=4:
#include <ico_log.h>
#include "CicoComponentImplementation.h"
+/* define of path */
#define IMG_DIR "/usr/apps/org.tizen.ico.statusbar/res/images/"
+#define THEME_PATH "/usr/apps/org.tizen.ico.statusbar/res/themes/statusbar.edj"
-// set image size of clock
-const int CicoStatusBarClockComponent::AMPM_WIDTH = 47;
-const int CicoStatusBarClockComponent::AMPM_HEIGHT = 30;
-const int CicoStatusBarClockComponent::HOUR10_WIDTH = 20;
-const int CicoStatusBarClockComponent::HOUR10_HEIGHT = 30;
-const int CicoStatusBarClockComponent::HOUR1_WIDTH = 20;
-const int CicoStatusBarClockComponent::HOUR1_HEIGHT = 30;
-const int CicoStatusBarClockComponent::COLON_WIDTH = 8;
-const int CicoStatusBarClockComponent::COLON_HEIGHT = 20;
-const int CicoStatusBarClockComponent::MIN10_WIDTH = 20;
-const int CicoStatusBarClockComponent::MIN10_HEIGHT = 30;
-const int CicoStatusBarClockComponent::MIN1_WIDTH = 20;
-const int CicoStatusBarClockComponent::MIN1_HEIGHT = 30;
-
-// set blank size
-const int CicoStatusBarClockComponent::COLON_BLANK = 7;
-const int CicoStatusBarClockComponent::AMPM_BLANK = 7;
-const int CicoStatusBarClockComponent::LAST_BLANK = 20;
-
-// set image position of clock
-const int CicoStatusBarClockComponent::AMPM_POSX = 0;
-const int CicoStatusBarClockComponent::AMPM_POSY = 8;
-const int CicoStatusBarClockComponent::RELATIVE_HOUR10_POSX = AMPM_WIDTH + AMPM_BLANK;
-const int CicoStatusBarClockComponent::RELATIVE_HOUR10_POSY = -8;
-const int CicoStatusBarClockComponent::RELATIVE_HOUR1_POSX = RELATIVE_HOUR10_POSX + HOUR10_WIDTH;
-const int CicoStatusBarClockComponent::RELATIVE_HOUR1_POSY = -8;
-const int CicoStatusBarClockComponent::RELATIVE_COLON_POSX = RELATIVE_HOUR1_POSX + HOUR1_WIDTH + COLON_BLANK;
-const int CicoStatusBarClockComponent::RELATIVE_COLON_POSY = -3;
-const int CicoStatusBarClockComponent::RELATIVE_MIN10_POSX = RELATIVE_COLON_POSX + COLON_WIDTH + COLON_BLANK;
-const int CicoStatusBarClockComponent::RELATIVE_MIN10_POSY = -8;
-const int CicoStatusBarClockComponent::RELATIVE_MIN1_POSX = RELATIVE_MIN10_POSX + MIN10_WIDTH;
-const int CicoStatusBarClockComponent::RELATIVE_MIN1_POSY = -8;
+/* Theme group name */
+#define THEME_CLOCK_NAME "ClockImage"
+#define THEME_NOTIFICATION_NAME "Notification"
// set image file path of clock
-const char *CicoStatusBarClockComponent::imgfilepath_am = IMG_DIR"time_am.png";
-const char *CicoStatusBarClockComponent::imgfilepath_pm = IMG_DIR"time_pm.png";
-const char *CicoStatusBarClockComponent::imgfilepath_0 = IMG_DIR"time_0.png";
-const char *CicoStatusBarClockComponent::imgfilepath_1 = IMG_DIR"time_1.png";
-const char *CicoStatusBarClockComponent::imgfilepath_2 = IMG_DIR"time_2.png";
-const char *CicoStatusBarClockComponent::imgfilepath_3 = IMG_DIR"time_3.png";
-const char *CicoStatusBarClockComponent::imgfilepath_4 = IMG_DIR"time_4.png";
-const char *CicoStatusBarClockComponent::imgfilepath_5 = IMG_DIR"time_5.png";
-const char *CicoStatusBarClockComponent::imgfilepath_6 = IMG_DIR"time_6.png";
-const char *CicoStatusBarClockComponent::imgfilepath_7 = IMG_DIR"time_7.png";
-const char *CicoStatusBarClockComponent::imgfilepath_8 = IMG_DIR"time_8.png";
-const char *CicoStatusBarClockComponent::imgfilepath_9 = IMG_DIR"time_9.png";
-const char *CicoStatusBarClockComponent::imgfilepath_colon = IMG_DIR"time_ten.png";
-
-// set clock component size
-const int CicoStatusBarClockComponent::CLOCK_COMPONENT_WIDTH = AMPM_WIDTH +
- AMPM_BLANK +
- HOUR10_WIDTH +
- HOUR1_WIDTH +
- COLON_BLANK +
- COLON_WIDTH +
- COLON_BLANK +
- MIN10_WIDTH +
- MIN1_WIDTH;
-
-const int CicoStatusBarClockComponent::CLOCK_COMPONENT_HEIGHT = HOUR10_HEIGHT;
+static const char *clock_image_path[] = {
+ IMG_DIR"time_0.png",
+ IMG_DIR"time_1.png",
+ IMG_DIR"time_2.png",
+ IMG_DIR"time_3.png",
+ IMG_DIR"time_4.png",
+ IMG_DIR"time_5.png",
+ IMG_DIR"time_6.png",
+ IMG_DIR"time_7.png",
+ IMG_DIR"time_8.png",
+ IMG_DIR"time_9.png",
+ IMG_DIR"time_am.png",
+ IMG_DIR"time_pm.png",
+ IMG_DIR"time_ten.png",
+ NULL
+};
+
+/* define of special image index */
+#define TIME_IMAGE_AM (10)
+#define TIME_IMAGE_PM (11)
+#define TIME_IMAGE_SP (12)
+
+/* array of clock object name */
+static const char *clock_image_object[] = {
+ "AM_PM_img",
+ "HOUR10_img",
+ "HOUR1_img",
+ "TIME_SP_img",
+ "MIN10_img",
+ "MIN1_img",
+ NULL
+};
/*--------------------------------------------------------------------------*/
/**
*/
/*--------------------------------------------------------------------------*/
CicoStatusBarClockComponent::CicoStatusBarClockComponent()
- : rate_(1.0)
{
}
/*--------------------------------------------------------------------------*/
CicoStatusBarClockComponent::~CicoStatusBarClockComponent()
{
- imgfilelist_number.clear();
}
/*--------------------------------------------------------------------------*/
*/
/*--------------------------------------------------------------------------*/
bool
-CicoStatusBarClockComponent::Initialize(Evas_Object *windowobj, int posx, int posy)
+CicoStatusBarClockComponent::Initialize(Evas_Object *windowobj, Evas *evas)
{
ICO_TRA("CicoStatusBarClockComponent::Initialize Enter");
- if (imgfilelist_number.empty()) {
- imgfilelist_number.push_back(imgfilepath_0);
- imgfilelist_number.push_back(imgfilepath_1);
- imgfilelist_number.push_back(imgfilepath_2);
- imgfilelist_number.push_back(imgfilepath_3);
- imgfilelist_number.push_back(imgfilepath_4);
- imgfilelist_number.push_back(imgfilepath_5);
- imgfilelist_number.push_back(imgfilepath_6);
- imgfilelist_number.push_back(imgfilepath_7);
- imgfilelist_number.push_back(imgfilepath_8);
- imgfilelist_number.push_back(imgfilepath_9);
- }
-
- std::shared_ptr<CicoImageModule> ampm_module;
- ampm_module = std::make_shared<CicoImageModule>(CicoImageModule());
- if (!ampm_module->Initialize(windowobj)) {
- ICO_TRA("CicoStatusBarClockComponent::Initialize Leave(false)");
- return false;
- }
-
- std::shared_ptr<CicoImageModule> hour10_module;
- hour10_module = std::make_shared<CicoImageModule>(CicoImageModule());
- if (!hour10_module->Initialize(windowobj)) {
- ICO_TRA("CicoStatusBarClockComponent::Initialize Leave(false)");
- return false;
- }
- std::shared_ptr<CicoImageModule> hour1_module;
- hour1_module = std::make_shared<CicoImageModule>(CicoImageModule());
- if (!hour1_module->Initialize(windowobj)) {
- ICO_TRA("CicoStatusBarClockComponent::Initialize Leave(false)");
- return false;
+ /* initialize display clock image */
+ int i;
+ for(i=0; i<CLOCK_OBJECT_COUNT; i++ ){
+ last_clock_image[i] = -1;
}
- std::shared_ptr<CicoImageModule> colon_module;
- colon_module = std::make_shared<CicoImageModule>(CicoImageModule());
- if (!colon_module->Initialize(windowobj)) {
- ICO_TRA("CicoStatusBarClockComponent::Initialize Leave(false)");
+ /* make TimeImage object */
+ evasobj_=edje_object_add(evas);
+ if (!edje_object_file_set(evasobj_, THEME_PATH, THEME_CLOCK_NAME )) {
+ Edje_Load_Error err = edje_object_load_error_get(evasobj_);
+ const char *errmsg = edje_load_error_str(err);
+ ICO_ERR("could not load 'main' from statusbar.edj: %s",
+ errmsg);
return false;
}
- std::shared_ptr<CicoImageModule> min10_module;
- min10_module = std::make_shared<CicoImageModule>(CicoImageModule());
- if (!min10_module->Initialize(windowobj)) {
- ICO_TRA("CicoStatusBarClockComponent::Initialize Leave(false)");
- return false;
- }
-
- std::shared_ptr<CicoImageModule> min1_module;
- min1_module = std::make_shared<CicoImageModule>(CicoImageModule());
- if (!min1_module->Initialize(windowobj)) {
- ICO_TRA("CicoStatusBarClockComponent::Initialize Leave(false)");
- return false;
+ /* move TimeImage to UpRight of window */
+ /* Do not need this process , if positiong of UpRight enabled with .EDC file */
+ Evas_Coord x,y,w,h;
+ Evas_Coord w_width=0;
+ Evas_Object* obj = NULL;
+ evas_object_geometry_get( windowobj, &x, &y, &w_width, &h );
+ evas_object_resize( evasobj_, w_width, h );
+ obj = (Evas_Object*)edje_object_part_object_get(evasobj_,"MIN1_img" );
+ evas_object_geometry_get( obj, &x, &y, &w, &h );
+ Evas_Coord offset = w_width - x - w;
+
+ for ( i=0; i<CLOCK_OBJECT_COUNT; i++ ) {
+ obj = (Evas_Object*)edje_object_part_object_get(
+ evasobj_, clock_image_object[i] );
+ if ( obj != NULL ) {
+ evas_object_geometry_get( obj, &x, &y, &w, &h );
+ evas_object_move( obj, x+offset , y);
+ }
}
- PackModule(ampm_module);
- PackModule(hour10_module);
- PackModule(hour1_module);
- PackModule(colon_module);
- PackModule(min10_module);
- PackModule(min1_module);
-
- SetPos(posx, posy);
- SetSize(AMPM_WIDTH + HOUR10_WIDTH + HOUR1_WIDTH + COLON_WIDTH +
- MIN10_WIDTH + MIN1_WIDTH,
- AMPM_HEIGHT);
- SetRate(1.5);
+ /* initial display */
+ Update();
+ Show();
ICO_TRA("CicoStatusBarClockComponent::Initialize Leave");
return Update();
CicoStatusBarClockComponent::Update()
{
//ICO_TRA("CicoStatusBarClockComponent::Update Enter");
- if (modulelist_.empty()) {
+ if (evasobj_ == NULL) {
return false;
}
int min = tm->tm_min;
int hour = tm->tm_hour;
- std::shared_ptr<CicoImageModule> imagemodule;
- assert(!modulelist_.empty());
- std::list<std::shared_ptr<CicoCommonModule>>::iterator itr;
- itr = modulelist_.begin();
- imagemodule = std::static_pointer_cast<CicoImageModule>((*itr));
- assert(imagemodule != NULL);
-
+ /* Make now clock image tabel */
+ int now_clock_image[CLOCK_OBJECT_COUNT];
if (hour > 11) {
- if (!imagemodule->SetFilePath(imgfilepath_pm)) {
- ICO_TRA("CicoStatusBarClockComponent::Update Leave(false)");
- return false;
- }
+ now_clock_image[0]=TIME_IMAGE_PM;
}
else {
- if (!imagemodule->SetFilePath(imgfilepath_am)) {
- ICO_TRA("CicoStatusBarClockComponent::Update Leave(false)");
- return false;
- }
+ now_clock_image[0]=TIME_IMAGE_AM;
}
- imagemodule->SetSize(rate_ * AMPM_WIDTH, rate_ * AMPM_HEIGHT);
- imagemodule->SetPos(posx_, posy_);
- imagemodule->Show();
-
time_t hour_m = hour % 12;
- itr++;
- imagemodule = std::static_pointer_cast<CicoImageModule>((*itr));
- assert(imagemodule != NULL);
- if (!imagemodule->SetFilePath(imgfilelist_number[hour_m / 10])) {
- ICO_TRA("CicoStatusBarClockComponent::Update Leave(false)");
- return false;
- }
- imagemodule->SetSize(rate_ * HOUR10_WIDTH, rate_ * HOUR10_HEIGHT);
- imagemodule->SetPos(posx_ + rate_ * RELATIVE_HOUR10_POSX,
- posy_ + rate_ * RELATIVE_HOUR10_POSY);
- imagemodule->Show();
-
- itr++;
- imagemodule = std::static_pointer_cast<CicoImageModule>((*itr));
- assert(imagemodule != NULL);
- if (!imagemodule->SetFilePath(imgfilelist_number[hour_m % 10])) {
- ICO_TRA("CicoStatusBarClockComponent::Update Leave(false)");
- return false;
- }
- imagemodule->SetSize(rate_ * HOUR1_WIDTH, rate_ * HOUR1_HEIGHT);
- imagemodule->SetPos(posx_ + rate_ * RELATIVE_HOUR1_POSX,
- posy_ + rate_ * RELATIVE_HOUR1_POSY);
- imagemodule->Show();
-
- itr++;
- imagemodule = std::static_pointer_cast<CicoImageModule>((*itr));
- assert(imagemodule != NULL);
- if (!imagemodule->SetFilePath(imgfilepath_colon)) {
- ICO_TRA("CicoStatusBarClockComponent::Update Leave(false)");
- return false;
- }
- imagemodule->SetSize(rate_ * COLON_WIDTH, rate_ * COLON_HEIGHT);
- imagemodule->SetPos(posx_ + rate_ * RELATIVE_COLON_POSX,
- posy_ + rate_ * RELATIVE_COLON_POSY);
- imagemodule->Show();
-
- itr++;
- imagemodule = std::static_pointer_cast<CicoImageModule>((*itr));
- assert(imagemodule != NULL);
- if (!imagemodule->SetFilePath(imgfilelist_number[min / 10])) {
- ICO_TRA("CicoStatusBarClockComponent::Update Leave(false)");
- return false;
- }
- imagemodule->SetSize(rate_ * MIN10_WIDTH, rate_ * MIN10_HEIGHT);
- imagemodule->SetPos(posx_ + rate_ * RELATIVE_MIN10_POSX,
- posy_ + rate_ * RELATIVE_MIN10_POSY);
- imagemodule->Show();
-
- itr++;
- imagemodule = std::static_pointer_cast<CicoImageModule>((*itr));
- assert(imagemodule != NULL);
- if (!imagemodule->SetFilePath(imgfilelist_number[min % 10])) {
- ICO_TRA("CicoStatusBarClockComponent::Update Leave(false)");
- return false;
+ now_clock_image[1]=hour_m / 10;
+ now_clock_image[2]=hour_m % 10;
+ now_clock_image[3]=TIME_IMAGE_SP;
+ now_clock_image[4]=min / 10;
+ now_clock_image[5]=min % 10;
+
+ /* Set now clock image */
+ int i;
+ for ( i=0; i<CLOCK_OBJECT_COUNT; i++ ) {
+
+ /* if now clock image different last clock */
+ if ( now_clock_image[i] != last_clock_image[i] ) {
+
+ Evas_Object* obj = NULL;
+ obj = (Evas_Object*)edje_object_part_object_get(
+ evasobj_,clock_image_object[i] );
+ if ( obj != NULL ) {
+ ICO_DBG("SetNotification image set[%s][%s]",clock_image_object[i],clock_image_path[i]);
+ evas_object_image_file_set(obj, clock_image_path[now_clock_image[i]], NULL);
+ }
+ else {
+ ICO_DBG("SetNotification image set error[object not found]" );
+ }
+ last_clock_image[i] = now_clock_image[i];
+ }
}
- imagemodule->SetSize(rate_ * MIN1_WIDTH, rate_ * MIN1_HEIGHT);
- imagemodule->SetPos(posx_ + rate_ * RELATIVE_MIN1_POSX,
- posy_ + rate_ * RELATIVE_MIN1_POSY);
- imagemodule->Show();
//ICO_TRA("CicoStatusBarClockComponent::Update Leave(true)");
return true;
/*--------------------------------------------------------------------------*/
/**
- * @brief set rate of clock component
+ * @brief get clock start position
*
- * @param[in] rate
+ * @param[out] x X axis
+ * @param[out] y Y axis
* @return true: success false: failed
*/
/*--------------------------------------------------------------------------*/
bool
-CicoStatusBarClockComponent::SetRate(double rate)
+CicoStatusBarClockComponent::GetClockStart( Evas_Coord *x_ret, Evas_Coord *y_ret)
{
- if (modulelist_.empty()) {
+ ICO_TRA("CicoStatusBarClockComponent::GetClockStart Enter");
+ if (evasobj_ == NULL) {
+ ICO_TRA("CicoStatusBarClockComponent::GetClockStart Leave(false)");
return false;
}
- rate_ = rate;
- width_ *= rate_;
- height_ *= rate_;
- SetPos(posx_, posy_);
- SetSize(width_, height_);
+ Evas_Object* obj = NULL;
+ obj = (Evas_Object*)edje_object_part_object_get(
+ evasobj_, clock_image_object[0] );
+ if ( obj == NULL ) {
+ ICO_TRA("CicoStatusBarClockComponent::GetClockStart Leave(false)");
+ return false;
+ }
+
+ Evas_Coord x,y,w,h;
+ evas_object_geometry_get( obj, &x, &y, &w, &h );
+ *x_ret = x;
+ *y_ret = y;
+
+ ICO_TRA("CicoStatusBarClockComponent::GetClockStart Leave(true)");
return true;
}
-// set notification(icon-image, text) position and font
-const int CicoNotificationPanelComponent::ICON_POSX = 0;
-const int CicoNotificationPanelComponent::ICON_POSY = 0;
-const int CicoNotificationPanelComponent::ICON_WIDTH = 48;
-const int CicoNotificationPanelComponent::ICON_HEIGHT = 48;
-const int CicoNotificationPanelComponent::RELATIVE_TEXT_POSX = 70;
-const int CicoNotificationPanelComponent::RELATIVE_TEXT_POSY = 10;
-const int CicoNotificationPanelComponent::TEXT_WIDTH = 450;
-const int CicoNotificationPanelComponent::TEXT_HEIGHT = 50;
-const char *CicoNotificationPanelComponent::FONT_STYLE = "Sans";
-const int CicoNotificationPanelComponent::FONT_SIZE = 50;
-
/*--------------------------------------------------------------------------*/
/**
* @brief default constructor
*/
/*--------------------------------------------------------------------------*/
CicoNotificationPanelComponent::CicoNotificationPanelComponent()
- : CicoCommonComponent(), rate_(1.0)
+ : CicoCommonModule()
{
}
/*--------------------------------------------------------------------------*/
/**
- * @brief destructor
+ * @brief destructor
*
* @param[in] none
* @return none
/*--------------------------------------------------------------------------*/
/**
- * @brief initialize of notification component
+ * @brief initialize of notification component
*
* @param[in] window
* @return true: success false: failed
*/
/*--------------------------------------------------------------------------*/
bool
-CicoNotificationPanelComponent::Initialize(Evas_Object *window)
+CicoNotificationPanelComponent::Initialize(Evas_Object *window, Evas *evas)
{
ICO_TRA("CicoNotificationPanelComponent::Initialize Enter");
- if (!modulelist_.empty()) {
+ if (evasobj_ != NULL) {
ICO_TRA("CicoNotificationPanelComponent::Initialize Levae(false)");
return false;
}
return false;
}
- posx_= ICON_POSX;
- posy_ = ICON_POSY;
- width_ = RELATIVE_TEXT_POSX + TEXT_WIDTH;
- height_ = ICON_HEIGHT - ICON_POSY;
-
- imgmod_ = std::make_shared<CicoImageModule>(CicoImageModule());
- if (imgmod_ == NULL) {
- ICO_TRA("CicoNotificationPanelComponent::Initialize Levae(false)");
- return false;
- }
-
- if (!imgmod_->Initialize(window)) {
- ICO_TRA("CicoNotificationPanelComponent::Initialize Levae(false)");
- return false;
- }
-
- imgmod_->SetPos(posx_,7);
-
- imgmod_->SetSize(ICON_WIDTH, ICON_HEIGHT);
- imgmod_->Show();
-
- ICO_DBG("Create Text Module start");
- textmod_ = std::make_shared<CicoTextModule>(CicoTextModule());
- if (textmod_ == NULL) {
- ICO_TRA("CicoNotificationPanelComponent::Initialize Levae(false)");
- return false;
- }
+ /* create Notification object */
ICO_DBG("Create Text Module end");
- if (!textmod_->Initialize(window)) {
- ICO_TRA("CicoNotificationPanelComponent::Initialize Levae(false)");
+ evasobj_=edje_object_add(evas);
+ if (!edje_object_file_set(evasobj_, THEME_PATH, THEME_NOTIFICATION_NAME)) {
+ Edje_Load_Error err = edje_object_load_error_get(evasobj_);
+ const char *errmsg = edje_load_error_str(err);
+ ICO_ERR("could not load 'main' from statusbar.edj: %s",
+ errmsg);
return false;
}
+ Evas_Coord x,y,w,h;
+ evas_object_geometry_get( window, &x, &y, &w, &h );
+ evas_object_resize( evasobj_, w, h );
- textmod_->SetPos(posx_ + RELATIVE_TEXT_POSX, posy_ + RELATIVE_TEXT_POSY);
- textmod_->SetSize(TEXT_WIDTH, TEXT_HEIGHT);
- textmod_->SetFont(FONT_STYLE, FONT_SIZE);
- textmod_->Show();
-
- PackModule(imgmod_);
- PackModule(textmod_);
+ /* initial display */
+ SetText("");
+ Hide();
ICO_TRA("CicoNotificationPanelComponent::Initialize Levae(true)");
return true;
/*--------------------------------------------------------------------------*/
/**
- * @brief set notification panel
+ * @brief set notification panel
*
* @param[in] text
* @param[in] iconpaht
ICO_TRA("CicoNotificationPanelComponent::SetNotification Enter"
"(text=%s icon=%s sound=%s)", text, iconpath, soundpath);
+ /* set image file */
if (iconpath != NULL) {
- imgmod_->SetFilePath(iconpath);
+ Evas_Object* obj = NULL;
+ obj = (Evas_Object*)edje_object_part_object_get(
+ evasobj_, "noti_image");
+ if ( obj != NULL ) {
+ ICO_DBG("SetNotification image set[%s]",iconpath);
+ evas_object_image_file_set(obj, iconpath, NULL);
+ }
+ else {
+ ICO_DBG("SetNotification image set error[object not found]" );
+ }
}
+ /* set text */
if (text != NULL) {
- textmod_->SetText(text);
+ SetText(text);
}
- textmod_->SetFont(NULL,50);
- textmod_->SetColor(0, 255, 255, 255);
Show();
ICO_TRA("CicoNotificationPanelComponent::SetNotification Leave");
}
-/*--------------------------------------------------------------------------*/
+//--------------------------------------------------------------------------
/**
- * @brief set rate of notification component
- *
- * @param[in] rate
- * @return true: success false: failed
+ * @brief set text to Content_text
+ * @param[in] text
+ * @return true: success
*/
-/*--------------------------------------------------------------------------*/
+//--------------------------------------------------------------------------
bool
-CicoNotificationPanelComponent::SetRate(double rate)
+CicoNotificationPanelComponent::SetText(const char *text)
{
- if (modulelist_.empty()) {
- return false;
+ ICO_TRA("CicoNotificationPanelComponent::SetText Enter(text=%s)", text? text:"NULL");
+ if ( text == NULL ) {
+ edje_object_part_text_set(evasobj_, "content_text", "");
+ return true;
}
- rate_ = rate;
- width_ *= rate;
- height_ *= rate;
- SetPos(posx_, posy_);
- SetSize(width_, height_);
+ edje_object_part_text_set(evasobj_, "content_text", text);
+
+ ICO_TRA("CicoNotificationPanelComponent::SetText Leave");
return true;
}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief set text to Content_text
+ * @param[in] text
+ * @return true: success
+ */
+//--------------------------------------------------------------------------
+void
+CicoNotificationPanelComponent::SetTextEndPosition( Evas_Coord x_end, Evas_Coord y_end)
+{
+ ICO_TRA("CicoNotificationPanelComponent::SetTextEndPosition Enter(%d,%d)",x_end,y_end);
+
+ if (evasobj_ == NULL) {
+ ICO_TRA("CicoNotificationPanelComponent::SetTextEndPosition Leave(false)");
+ return;
+ }
+
+ Evas_Object* obj = NULL;
+ obj = (Evas_Object*)edje_object_part_object_get(
+ evasobj_, "content_text" );
+ if ( obj == NULL ) {
+ ICO_TRA("CicoNotificationPanelComponent::SetTextEndPosition Leave(false)");
+ return;
+ }
+
+ Evas_Coord x,y,w,h;
+ evas_object_geometry_get( obj, &x, &y, &w, &h );
+ evas_object_resize( evasobj_, x_end, h );
+ ICO_TRA("CicoNotificationPanelComponent::text width %d -> %d",w, x_end - x -1);
+ evas_object_resize( obj, x_end - x -1, h );
+ edje_object_calc_force( obj );
+
+ ICO_TRA("CicoNotificationPanelComponent::SetTextEndPosition Leave" );
+}
+
// vim: set expandtab ts=4 sw=4:
#include <ctime>
#include <list>
#include <vector>
-#include "CicoComponentInterface.h"
-#include "CicoCommonComponent.h"
-#include "CicoModuleImplementation.h"
+
+#define CLOCK_OBJECT_COUNT (6)
+
+//==========================================================================
+/**
+ * @brief This class provide the common module component interfaces
+ */
+//==========================================================================
+class CicoCommonModule
+{
+public:
+ // default constructor
+ CicoCommonModule();
+
+ // destructor
+ virtual ~CicoCommonModule();
+
+ // terminate module
+ virtual bool Terminate(void);
+
+ // show module
+ virtual void Show(void);
+
+ // hide module
+ virtual void Hide(void);
+
+ // set position of module
+ virtual void SetPos(int x, int y);
+
+ // set size of module
+ virtual void SetSize(int w, int h);
+
+ // move module
+ virtual void Move(int diffx, int diffy);
+
+ // resize module
+ virtual void Resize(double ratew, double rateh);
+
+ // reset position and size of module
+ virtual void Reallocate(int standardx, int standardy,
+ double ratew, double rateh);
+
+ // get raw data
+ Evas_Object *GetRawData(void) const;
+ bool operator==(const CicoCommonModule& moduleb) {
+ return (this->evasobj_ == moduleb.evasobj_);
+ }
+
+protected:
+ Evas_Object *evasobj_; /// module object
+ int posx_; /// module position x
+ int posy_; /// module position y
+ int width_; /// module width
+ int height_; /// module height
+};
//==========================================================================
/**
* @brief This class provide the clock component
*/
//==========================================================================
-class CicoStatusBarClockComponent : public CicoCommonComponent
+class CicoStatusBarClockComponent : public CicoCommonModule
{
public:
// default constructor
~CicoStatusBarClockComponent();
// initialize of clock component
- bool Initialize(Evas_Object *window, int posx, int posy);
+ bool Initialize(Evas_Object *window, Evas *evas);
// update of clock component
bool Update(void);
- // set rate of clock component
+ // set rate of clock component
bool SetRate(double rate);
- static const int CLOCK_COMPONENT_WIDTH; /// clock component width
- static const int CLOCK_COMPONENT_HEIGHT;/// clock component height
+ // get clock start position
+ bool GetClockStart( Evas_Coord *x, Evas_Coord *y);
private:
- static const int AMPM_WIDTH; /// ampm image width
- static const int AMPM_HEIGHT; /// ampm image height
- static const int HOUR10_WIDTH; /// hour10 image width
- static const int HOUR10_HEIGHT; /// hour10 image height
- static const int HOUR1_WIDTH; /// hour1 image width
- static const int HOUR1_HEIGHT; /// hour1 image height
- static const int COLON_WIDTH; /// colon image width
- static const int COLON_HEIGHT; /// colon image height
- static const int MIN10_WIDTH; /// min10 image width
- static const int MIN10_HEIGHT; /// min10 image height
- static const int MIN1_WIDTH; /// min1 image width
- static const int MIN1_HEIGHT; /// min1 image height
-
- static const int COLON_BLANK; /// colon blank size
- static const int AMPM_BLANK; /// ampm blank size
- static const int LAST_BLANK; /// last blank size
-
- static const int AMPM_POSX; /// ampm image position x
- static const int AMPM_POSY; /// ampm image position y
- static const int RELATIVE_HOUR10_POSX; /// hour10 image position x
- static const int RELATIVE_HOUR10_POSY; /// hour10 image position y
- static const int RELATIVE_HOUR1_POSX; /// hour1 image position x
- static const int RELATIVE_HOUR1_POSY; /// hour1 image position y
- static const int RELATIVE_COLON_POSX; /// colon image position x
- static const int RELATIVE_COLON_POSY; /// colon image position y
- static const int RELATIVE_MIN10_POSX; /// min10 image position x
- static const int RELATIVE_MIN10_POSY; /// min10 image position y
- static const int RELATIVE_MIN1_POSX; /// min1 image position x
- static const int RELATIVE_MIN1_POSY; /// min1 image position y
-
- static const char *imgfilepath_am; /// am image filepath
- static const char *imgfilepath_pm; /// pm image filepath
- static const char *imgfilepath_0; /// 0 image filepath
- static const char *imgfilepath_1; /// 1 image filepath
- static const char *imgfilepath_2; /// 2 image filepath
- static const char *imgfilepath_3; /// 3 image filepath
- static const char *imgfilepath_4; /// 4 image filepath
- static const char *imgfilepath_5; /// 5 image filepath
- static const char *imgfilepath_6; /// 6 image filepath
- static const char *imgfilepath_7; /// 7 image filepath
- static const char *imgfilepath_8; /// 8 image filepath
- static const char *imgfilepath_9; /// 9 image filepath
- static const char *imgfilepath_colon; /// colon image filepath
-
- std::vector<const char*> imgfilelist_number; /// image filepath list
- double rate_;
+ int last_clock_image[6];
+
};
//==========================================================================
* @brief This class provide the notification panel component
*/
//==========================================================================
-class CicoNotificationPanelComponent : public CicoCommonComponent
+class CicoNotificationPanelComponent : public CicoCommonModule
{
public:
// default constructor
~CicoNotificationPanelComponent();
// initialize of notification component
- bool Initialize(Evas_Object *window);
+ bool Initialize(Evas_Object *window,Evas *evas);
// set notification panel
void SetNotification(const char *text,
const char *iconpath,
const char *soundpath);
- // set rate of notification component
- bool SetRate(double rate);
+ // set text end position
+ void SetTextEndPosition( Evas_Coord x, Evas_Coord y);
+
+private:
+ // set text to content_text
+ bool SetText(const char *text);
-protected:
- static const int ICON_POSX; /// notification icon position x
- static const int ICON_POSY; /// notification icon position y
- static const int ICON_WIDTH; /// notification icon width
- static const int ICON_HEIGHT; /// notification icon height
- static const int RELATIVE_TEXT_POSX; /// notification text position x
- static const int RELATIVE_TEXT_POSY; /// notification text position y
- static const int TEXT_WIDTH; /// notification text width
- static const int TEXT_HEIGHT; /// notification text height
- static const char *FONT_STYLE; /// notification text font-style
- static const int FONT_SIZE; /// notification text font-size
-
- std::shared_ptr<CicoTextModule> textmod_; /// notification text module
- std::shared_ptr<CicoImageModule> imgmod_; /// notification icon module
- double rate_; /// view rate of notification component
};
#endif // __CICO_COMPONENT_IMPLEMENTATION_H__
// vim: set expandtab ts=4 sw=4:
+++ /dev/null
-/*
- * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
- *
- * This program is licensed under the terms and conditions of the
- * Apache License, version 2.0. The full text of the Apache License is at
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- */
-
-//==========================================================================
-/**
- * @file CicoComponentInterface.h
- *
- * @brief This file is definition of CicoComponentInterface class
- */
-//==========================================================================
-#ifndef __CICO_COMPONENT_INTERFACE_H__
-#define __CICO_COMPONENT_INTERFACE_H__
-
-//==========================================================================
-/**
- * @brief This class provide the component interfaces
- */
-//==========================================================================
-class CicoComponentInterface
-{
-public:
- virtual bool Terminate(void) = 0;
- virtual void Show(void) = 0;
- virtual void Hide(void) = 0;
- virtual void SetPos(int x, int y) = 0;
- virtual void SetSize(int w, int h) = 0;
-
-protected:
- CicoComponentInterface() {};
- virtual ~CicoComponentInterface() {};
-};
-#endif // __CICO_COMPONENT_INTERFACE_H__
-// vim: set expandtab ts=4 sw=4:
+++ /dev/null
-/*
- * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
- *
- * This program is licensed under the terms and conditions of the
- * Apache License, version 2.0. The full text of the Apache License is at
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- */
-
-//==========================================================================
-/**
- * @file CicoModuleImplementation.cpp
- *
- * @brief This file is implimention of CicoTextModule class
- */
-//==========================================================================
-
-#include <Evas.h>
-#include <Elementary.h>
-#include <cstring>
-#include <cassert>
-
-#include <ico_log.h>
-#include "CicoModuleImplementation.h"
-
-//--------------------------------------------------------------------------
-/**
- * @brief default constructor
- * @param[in] none
- * @return none
- */
-//--------------------------------------------------------------------------
-CicoImageModule::CicoImageModule()
- : CicoCommonModule()
-{
- memset(filepath_, 0, sizeof(filepath_));
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief destructor
- * @param[in] none
- * @return none
- */
-//--------------------------------------------------------------------------
-CicoImageModule::~CicoImageModule()
-{
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief initialize of image module
- * @param[in] windowobj
- * @return true: success false: failed
- */
-//--------------------------------------------------------------------------
-bool
-CicoImageModule::Initialize(Evas_Object *windowobj)
-{
- ICO_TRA("CicoImageModule::Initialize Enter");
- if (windowobj == NULL) {
- return false;
- }
- evasobj_ = elm_image_add(windowobj);
- if (evasobj_ == NULL) {
- ICO_ERR("elm_image_add() failed.");
- ICO_TRA("CicoImageModule::Initialize Leave(false)");
- return false;
- }
- if (strcmp("elm_image", evas_object_type_get(evasobj_)) != 0) {
- ICO_TRA("CicoImageModule::Initialize Leave(false)");
- return false;
- }
- ICO_DBG("object name=%s", evas_object_name_get(evasobj_));
- ICO_TRA("CicoImageModule::Initialize Leave(true)");
- return true;
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief set filepaht of image module
- * @param[in] path image file path
- * @return none
- */
-//--------------------------------------------------------------------------
-bool
-CicoImageModule::SetFilePath(const char *path)
-{
- //ICO_TRA("CicoImageModule::SetFilePath Enter");
- assert(evasobj_ != NULL);
- memset(filepath_, 0, sizeof(filepath_));
- strcpy(filepath_, path);
- //ICO_TRA("CicoImageModule::SetFilePath Leave");
- return (elm_image_file_set(evasobj_, filepath_, NULL) == EINA_TRUE) ? true : false;
-}
-
-const double CicoTextModule::FONT_SIZE_RATE = 0.7;
-
-//--------------------------------------------------------------------------
-/**
- * @brief default constructor
- * @param[in] none
- * @return none
- */
-//--------------------------------------------------------------------------
-CicoTextModule::CicoTextModule()
- : CicoCommonModule(), fontsize_(50)
-{
- ICO_TRA("CicoTextModule::CicoTextModule Enter");
- memset(text_, 0, sizeof(text_));
- memset(fontstyle_, 0, sizeof(fontstyle_));
- strcpy(fontstyle_, "Sans");
- ICO_TRA("CicoTextModule::CicoTextModule Leave");
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief destructor
- * @param[in] none
- * @return none
- */
-//--------------------------------------------------------------------------
-CicoTextModule::~CicoTextModule()
-{
- ICO_TRA("CicoTextModule::~CicoTextModule Enter");
- ICO_TRA("CicoTextModule::~CicoTextModule Leave");
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief initialize of text module
- * @param[in] windowobj
- * @return none
- */
-//--------------------------------------------------------------------------
-bool
-CicoTextModule::Initialize(Evas_Object *windowobj)
-{
- ICO_TRA("CicoTextModule::Initialize Enter");
- evasobj_ = elm_label_add(windowobj);
- elm_label_line_wrap_set(evasobj_, ELM_WRAP_NONE);
- elm_object_style_set(evasobj_, "default");
-
- strcpy(fontstyle_, "Sans");
- SetFont(fontstyle_, fontsize_);
-
- ICO_DBG("object name=%s", evas_object_name_get(evasobj_));
- ICO_TRA("CicoTextModule::Initialize Leave");
- return (evasobj_ != NULL);
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief set text of text module
- * @param[in] text
- * @return true: success
- */
-//--------------------------------------------------------------------------
-bool
-CicoTextModule::SetText(const char *text)
-{
- ICO_TRA("CicoTextModule::SetText Enter(text=%s)", text);
- memset(text_, 0, sizeof(text_));
- strncpy(text_, text, (sizeof(text_)-1));
- ICO_DBG("text_=%s", text_);
-
- elm_object_part_text_set(evasobj_, NULL, text_);
- SetFont(fontstyle_, fontsize_);
- SetSize(FONT_SIZE_RATE * fontsize_ * strlen(text), height_);
-
- ICO_TRA("CicoTextModule::SetText Leave");
- return true;
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief set font of text module
- * @param[in] style font style
- * @param[in] size font size
- * @return none
- */
-//--------------------------------------------------------------------------
-void
-CicoTextModule::SetFont(const char *style, const int size)
-{
- ICO_TRA("CicoTextModule::SetFont Enter"
- "(style=%s size=%d)", style, size);
-
- if (style != NULL) {
- strcpy(fontstyle_, style);
- }
- if (size > 0) {
- fontsize_ = size;
- }
-
- const char *textclassname = evas_object_type_get(evasobj_);
- char textclassname2[strlen(textclassname) + 1];
- if (strncmp(textclassname, "elm_", 4) == 0) {
- memset(textclassname2, 0, sizeof(textclassname2));
- for (int i = 0; textclassname[i + 4] != '\0'; i++) {
- textclassname2[i] = textclassname[i + 4];
- }
- textclassname = textclassname2;
- }
- elm_config_font_overlay_set(textclassname, fontstyle_, fontsize_);
- elm_config_font_overlay_apply();
- ICO_TRA("CicoTextModule::SetFont Leave");
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief set color of text module
- * @param[in] r Red color
- * @param[in] g Green color
- * @param[in] b Blue color
- * @param[in] a alpha color
- * @return none
- */
-//--------------------------------------------------------------------------
-void CicoTextModule::SetColor(const int r, const int g,
- const int b, const int a)
-{
- ICO_TRA("CicoTextModule::SetColor Enter"
- "(r/g/b/a=%d/%d/%d/%d)", r, g, b, a);
- elm_object_style_set(evasobj_, "marker");
- evas_object_color_set(evasobj_, r, g, b, a);
- ICO_TRA("CicoTextModule::SetColor Leave");
-}
-// vim: set expandtab ts=4 sw=4:
+++ /dev/null
-/*
- * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
- *
- * This program is licensed under the terms and conditions of the
- * Apache License, version 2.0. The full text of the Apache License is at
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- */
-
-//==========================================================================
-/**
- * @file CicoModuleInterface.h
- *
- * @brief This file is definition of CicoModuleInterface class
- */
-//==========================================================================
-#ifndef __CICO_MODULE_IMPLEMENTATION_H__
-#define __CICO_MODULE_IMPLEMENTATION_H__
-
-#include <Evas.h>
-#include "CicoModuleInterface.h"
-
-//==========================================================================
-/**
- * @brief This class provide the common module component interfaces
- */
-//==========================================================================
-class CicoCommonModule : public CicoModuleInterface
-{
-public:
- // default constructor
- CicoCommonModule();
-
- // destructor
- virtual ~CicoCommonModule();
-
- // terminate module
- virtual bool Terminate(void);
-
- // show module
- virtual void Show(void);
-
- // hide module
- virtual void Hide(void);
-
- // set position of module
- virtual void SetPos(int x, int y);
-
- // set size of module
- virtual void SetSize(int w, int h);
-
- // move module
- virtual void Move(int diffx, int diffy);
-
- // resize module
- virtual void Resize(double ratew, double rateh);
-
- // reset position and size of module
- virtual void Reallocate(int standardx, int standardy,
- double ratew, double rateh);
-
- // get raw data
- Evas_Object *GetRawData(void) const;
- bool operator==(const CicoCommonModule& moduleb) {
- return (this->evasobj_ == moduleb.evasobj_);
- }
-
-protected:
- Evas_Object *evasobj_; /// module object
- int posx_; /// module position x
- int posy_; /// module position y
- int width_; /// module width
- int height_; /// module height
-};
-
-//==========================================================================
-/**
- * @brief This class provide the image module
- */
-//==========================================================================
-class CicoImageModule : public CicoCommonModule
-{
-public:
- // default constructor
- CicoImageModule();
-
- // destructor
- virtual ~CicoImageModule();
-
- // initialize of image module
- bool Initialize(Evas_Object *windowobj);
-
- // set filepath of image module
- bool SetFilePath(const char *path);
-protected:
- char filepath_[256]; ///image file path
-};
-
-//==========================================================================
-/**
- * @brief This class provide the text module
- */
-//==========================================================================
-class CicoTextModule : public CicoCommonModule
-{
-public:
- // default contructor
- CicoTextModule();
-
- // destructor
- ~CicoTextModule();
-
- // initialize of text module
- bool Initialize(Evas_Object *windowobj);
-
- // set text of text module
- bool SetText(const char *text);
-
- // set font of text module
- void SetFont(const char *style, const int size);
-
- // set color of text module
- void SetColor(const int r, const int g, const int b, const int a);
-protected:
- static const double FONT_SIZE_RATE; /// rate of font size
- char text_[256]; /// text of textmodule
- char fontstyle_[256]; /// font style of textmodule
- int fontsize_; /// font size of textmodule
-};
-#endif // __CICO_MODULE_IMPLEMENTATION_H__
-// vim: set expandtab ts=4 sw=4:
+++ /dev/null
-/*
- * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
- *
- * This program is licensed under the terms and conditions of the
- * Apache License, version 2.0. The full text of the Apache License is at
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- */
-
-//==========================================================================
-/**
- * @file CicoModuleInterface.h
- *
- * @brief This file is definition of CicoModuleInterface class
- */
-//==========================================================================
-#ifndef __CICO_MODULE_INTERFACE_H__
-#define __CICO_MODULE_INTERFACE_H__
-
-//==========================================================================
-/**
- * @brief This class provide the module interfaces
- */
-//==========================================================================
-class CicoModuleInterface
-{
-public:
- virtual bool Terminate(void) = 0;
- virtual void Show(void) = 0;
- virtual void Hide(void) = 0;
- virtual void SetPos(int x, int y) = 0;
- virtual void SetSize(int w, int h) = 0;
- virtual void Move(int diffx, int diffy) = 0;
- virtual void Resize(double ratew, double rateh) = 0;
- virtual void Reallocate(int standardx, int standardy,
- double ratew, double rateh) = 0;
-};
-#endif // __CICO_MODULE_INTERFACE_H__
-// vim: set expandtab ts=4 sw=4:
CicoSBEFLApp::CicoSBEFLApp()
{
ICO_TRA("CicoSBEFLApp::CicoSBEFLApp Enter");
+ m_statusbar = NULL;
ICO_TRA("CicoSBEFLApp::CicoSBEFLApp Leave");
}
CicoSBEFLApp::onTerminate(void *user_data)
{
ICO_TRA("CicoSBEFLApp::onTerminate Enter");
+ delete m_statusbar;
ICO_TRA("CicoSBEFLApp::onTerminate Leave");
}
using namespace std;
-const int CicoStatusBar::STATUSBAR_POSX = 0;
-const int CicoStatusBar::STATUSBAR_POSY = 0;
+const int CicoStatusBar::STATUSBAR_POSX = 0;
+const int CicoStatusBar::STATUSBAR_POSY = 0;
const int CicoStatusBar::STATUSBAR_HEIGHT = 64;
-const int CicoStatusBar::CLOCK_WIDTH =
- CicoStatusBarClockComponent::CLOCK_COMPONENT_WIDTH;
-const int CicoStatusBar::CLOCK_HEIGHT =
- CicoStatusBarClockComponent::CLOCK_COMPONENT_HEIGHT;
-
//--------------------------------------------------------------------------
/**
* @brief default constructor
CicoStatusBar::CicoStatusBar()
: CicoCommonWindow()
{
+ notitimer_ = NULL;
+ clockcomp_ = NULL;
+ noticomp_ = NULL;
}
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
CicoStatusBar::~CicoStatusBar()
{
+ ICO_TRA("CicoStatusBar::~CicoStatusBar() Enter");
+ if (notitimer_ != NULL) {
+ ecore_timer_del(notitimer_);
+ }
+
while( !noti_list.empty() ) {
- DeleteNotification( this );
+ DeleteNotification();
}
+
+ delete clockcomp_;
+ delete noticomp_;
+ ICO_TRA("CicoStatusBar::~CicoStatusBar() Leave");
}
//--------------------------------------------------------------------------
ICO_TRA("CicoStatusBar::Initialize() Enter");
ICO_DBG("Initialize start window_.");
+ ecore_evas_init();
+ edje_init();
+
window_ = ecore_evas_new(NULL, 0, 0, 1, 1, "frame=0");
if (window_ == NULL) {
return false;
ICO_DBG("Initialize start windowobj_.");
windowobj_ = evas_object_rectangle_add(ecore_evas_get(window_));
- //statusbar RGBcolor setting
+ // statusbar RGBcolor setting
evas_object_color_set(windowobj_, 0, 0, 0, 255);
ICO_DBG("Initialize setpos windowobj_.");
ICO_DBG("Initialize end windowobj_.");
ICO_DBG("Initialize start Clock_Component.");
- clockcomp_ = std::make_shared<CicoStatusBarClockComponent>(CicoStatusBarClockComponent());
- if (!clockcomp_->Initialize(windowobj_,
- (width_ - CLOCK_WIDTH - 100),
- ((STATUSBAR_HEIGHT - CLOCK_HEIGHT) / 2))){
+ clockcomp_ = new CicoStatusBarClockComponent();
+ if (!clockcomp_->Initialize(windowobj_, ecore_evas_get(window_) )){
ICO_ERR("Failed to initialize Clock_Componet.");
return false;
}
ICO_DBG("Initialize end Clock_Component.");
ICO_DBG("Initialize start Notification_Component.");
- noticomp_ = std::make_shared<CicoNotificationPanelComponent>(CicoNotificationPanelComponent());
- if (!noticomp_->Initialize(windowobj_)) {
+ noticomp_ = new CicoNotificationPanelComponent();
+ if (!noticomp_->Initialize(windowobj_,ecore_evas_get(window_))) {
ICO_ERR("Failed to initialize Notification_Component.");
return false;
}
notiservice_.SetCallback(NotificationCallback, this);
ICO_DBG("Initialize end Notification_Component.");
+ // set notification text end
+ Evas_Coord x, y;
+ if ( clockcomp_-> GetClockStart( &x, &y ) ) {
+ noticomp_->SetTextEndPosition( x, y );
+ }
+
Show();
// add timer callback function of time update
/*--------------------------------------------------------------------------*/
/**
- * @brief update notification panel
+ * @brief update notification panel
* @param[in] msg message
* @param[in] iconpaht icon image path
* @param[in] soundpath sound data path
*/
/*--------------------------------------------------------------------------*/
bool
-CicoStatusBar::UpdateNotificationPanel( CicoStatusBar *sb )
+CicoStatusBar::UpdateNotificationPanel()
{
/* if timer is active then wait timeout */
}
/* get Notification , if it is empty then return */
- CicoNotification* noti = sb->GetNotification(sb);
- if ( noti == NULL ) {
+ CicoNotification* noti = GetNotification();
+ if (noti == NULL) {
ICO_TRA("CicoStatusBar::UpdateNotificationPanel empty" );
return false;
}
- //const char *msg = noti->GetTitle();
const char *msg = noti->GetContent();
const char *iconpath = noti->GetIconPath();
const char *soundpath = NULL;
"(msg=%s icon=%s sound=%s)", msg, iconpath, soundpath);
if (msg == NULL && iconpath == NULL && soundpath == NULL) {
ICO_ERR("notification info is NULL.");
- sb->DeleteNotification(sb);
+ DeleteNotification();
return false;
}
noticomp_->SetNotification(msg, iconpath, soundpath);
noticomp_->Show();
/* delete Notification and set disp timer */
- sb->DeleteNotification(sb);
+ DeleteNotification();
notitimer_ = ecore_timer_add(3.0, HideNotification, this);
ICO_TRA("CicoStatusBar::UpdateNotificationPanel Leave");
ICO_DBG("NOTIFICATION_OP_INSERT/NOTIFICATION_OP_UPDATE");
/* add notification and update SB */
- sb->AddNotification( sb, op_list[i].noti );
- sb->UpdateNotificationPanel( sb );
+ sb->AddNotification( op_list[i].noti );
+ sb->UpdateNotificationPanel();
break;
case NOTIFICATION_OP_DELETE:
ICO_DBG("NOTIFICATION_OP_DELETE");
- sb->DeleteNotification( sb, op_list[i].priv_id );
+ sb->DeleteNotification( op_list[i].priv_id );
break;
case NOTIFICATION_OP_DELETE_ALL:
ICO_DBG("NOTIFICATION_OP_DELETE_ALL");
/*--------------------------------------------------------------------------*/
/**
- * @brief hide notification panel
+ * @brief hide notification panel
*
* @param[in] data StatusBar object
* @return ECORE_CALLBACK_CANCEL
sb->notitimer_ = NULL;
/* update notification ,if Notification exist in the queue */
- sb->UpdateNotificationPanel( sb );
+ sb->UpdateNotificationPanel();
ICO_TRA("CicoStatusBar::HideNotification Leave");
return ECORE_CALLBACK_CANCEL;
* @return non
*/
/*--------------------------------------------------------------------------*/
-void
-CicoStatusBar::AddNotification(CicoStatusBar* sb, notification_h noti_h)
+void
+CicoStatusBar::AddNotification(notification_h noti_h)
{
ICO_TRA("CicoStatusBar::AddNotification() Enter");
delete noti;
return;
}
- sb->noti_list.push_back(noti);
+ noti_list.push_back(noti);
ICO_TRA("CicoStatusBar::AddNotification Leave");
}
* @return CicoNotification class pointer
*/
/*--------------------------------------------------------------------------*/
-CicoNotification*
-CicoStatusBar::GetNotification(CicoStatusBar* sb)
+CicoNotification*
+CicoStatusBar::GetNotification()
{
ICO_TRA("CicoStatusBar::GetNotification() Enter");
- if ( ! sb->noti_list.empty() ) {
- CicoNotification *noti = sb->noti_list.front();
+ if ( ! noti_list.empty() ) {
+ CicoNotification *noti = noti_list.front();
if ( noti ) {
return noti;
}
else {
- DeleteNotification(sb);
+ DeleteNotification();
}
}
ICO_TRA("CicoStatusBar::GetNotification Leave");
}
/*--------------------------------------------------------------------------*/
-/**
+/*
* @brief delete first notification
*
* @param[in] sb StatusBar object
*/
/*--------------------------------------------------------------------------*/
void
-CicoStatusBar::DeleteNotification(CicoStatusBar *sb)
+CicoStatusBar::DeleteNotification()
{
ICO_TRA("CicoStatusBar::DeleteNotification() Enter");
- if ( ! sb->noti_list.empty() ) {
- CicoNotification *noti = sb->noti_list.front();
- if ( noti ) {
- delete noti;
- }
- sb->noti_list.pop_front();
+ if ( ! noti_list.empty() ) {
+ CicoNotification *noti = noti_list.front();
+ delete noti;
+ noti_list.pop_front();
}
ICO_TRA("CicoStatusBar::DeleteNotification Leave");
*/
/*--------------------------------------------------------------------------*/
void
-CicoStatusBar::DeleteNotification(CicoStatusBar *sb, int priv_id)
+CicoStatusBar::DeleteNotification(int priv_id)
{
ICO_TRA("CicoStatusBar::DeleteNotification() Enter");
}
-
//==========================================================================
// public functions
//==========================================================================
//--------------------------------------------------------------------------
/**
- * @brief callback function of time update
+ * @brief callback function of time update
*
* @param [in] data user date
*/
// destructor
~CicoStatusBar();
- // initialize status bar
+ // initialize status bar
bool Initialize(void);
// update clock
bool UpdateTime(void);
// add last Notification queue
- void AddNotification(CicoStatusBar *sb, notification_h noti_h);
+ void AddNotification( notification_h noti_h);
// get first Notification queue
- CicoNotification* GetNotification(CicoStatusBar *sb);
+ CicoNotification* GetNotification();
// delete first Notification queue
- void DeleteNotification(CicoStatusBar *sb);
+ void DeleteNotification();
// delete Notification queue
- void DeleteNotification(CicoStatusBar *sb, int priv_id);
+ void DeleteNotification(int priv_id);
// update notification panel
- //bool UpdateNotificationPanel(const char *msg, const char *icopath,
- // const char *soundpath);
- bool UpdateNotificationPanel(CicoStatusBar *sb);
+ bool UpdateNotificationPanel();
// notification callback
static void NotificationCallback(void *data, notification_type_e type,
Ecore_Timer *notitimer_; /// notification timer
List_CicoNoti noti_list; /// notification Queue
- std::shared_ptr<CicoStatusBarClockComponent> clockcomp_; /// clock component
- std::shared_ptr<CicoNotificationPanelComponent> noticomp_; /// notification component
+ CicoStatusBarClockComponent *clockcomp_; /// clock component
+ CicoNotificationPanelComponent *noticomp_; /// notification component
+
CicoNotificationService notiservice_; /// notification service
};
#endif // __CICO_STATUSBAR_H__
+++ /dev/null
-/*
- * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
- *
- * This program is licensed under the terms and conditions of the
- * Apache License, version 2.0. The full text of the Apache License is at
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- */
-
-//==========================================================================
-/**
- * @file CicoWindowInterface.h
- *
- * @brief This file is definition of CicoWindowInterface class
- */
-//==========================================================================
-#ifndef CICO_WINDOW_INTERFACE_H_
-#define CICO_WINDOW_INTERFACE_H_
-
-//==========================================================================
-/**
- * @brief This class provide the window interfaces
- */
-//==========================================================================
-class CicoWindowInterface
-{
-public:
- virtual bool Terminate(void) = 0;
- virtual void Show(void) = 0;
- virtual void Hide(void) = 0;
- virtual void SetPos(int x, int y) = 0;
- virtual void SetSize(int w, int h) = 0;
-};
-#endif // __CICO_WINDOW_INTERFACE_H__
-// vim: set expandtab ts=4 sw=4:
StatusBar
StatusBar_SOURCES = \
- CicoCommonComponent.cpp \
CicoCommonModule.cpp \
CicoCommonWindow.cpp \
- CicoModuleImplementation.cpp \
CicoComponentImplementation.cpp \
CicoStatusBar.cpp \
CicoSBEFLApp.cpp \
$(UWS_LIBS) \
$(NOTIFICATION_LIBS)
+SUFFIXES = .edc .edj
+
+BUILT_SOURCES = \
+ statusbar.edj
+
+.edc.edj:
+ edje_cc $< -id ../../res/org.tizen.ico.statusbar/res/images \
+ -fd ../../res/org.tizen.ico.statusbar/res/images \
+ -sd ../../res/org.tizen.ico.statusbar/res/sounds -o $@
+
CLEANFILES = $(BUILT_SOURCES)
install-exec-hook:
mkdir -p $(INSTALL_ROOT)/usr/apps/org.tizen.ico.statusbar/bin
mkdir -p $(INSTALL_ROOT)/usr/apps/org.tizen.ico.statusbar/res/config
mkdir -p $(INSTALL_ROOT)/usr/apps/org.tizen.ico.statusbar/res/images
+ mkdir -p $(INSTALL_ROOT)/usr/apps/org.tizen.ico.statusbar/res/themes
mkdir -p $(INSTALL_ROOT)/usr/share/packages
install -m 0755 StatusBar $(INSTALL_ROOT)/usr/apps/org.tizen.ico.statusbar/bin
install -m 0644 $(top_srcdir)/res/org.tizen.ico.statusbar/res/images/time*.png $(INSTALL_ROOT)/usr/apps/org.tizen.ico.statusbar/res/images
install -m 0644 $(top_srcdir)/data/share/packages/org.tizen.ico.statusbar.xml $(INSTALL_ROOT)/usr/share/packages
install -m 0644 $(top_srcdir)/res/org.tizen.ico.statusbar/res/config/* $(INSTALL_ROOT)/usr/apps/org.tizen.ico.statusbar/res/config
+ install -m 0644 *.edj $(INSTALL_ROOT)/usr/apps/org.tizen.ico.statusbar/res/themes
uninstall:
rm -rf $(INSTALL_ROOT)/usr/apps/org.tizen.ico.statusbar
//--------------------------------------------------------------------------
/**
* @brief setup log
- * @param[in] void
+ * @param[in] void
* @return none
*/
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
/**
- * @brief status bar main
+ * @brief status bar main
*
* @param [in] argc counts of argment
* @param [in] argv argment
{
try {
printf("=== start Status Bar main entry\n");
-
+
// setupLog
setupLog();
ICO_INF( "START_MODULE StatusBar");
--- /dev/null
+/*
+ * Copyright (c) 2014, TOYOTA MOTOR CORPORATION.
+ *
+ * This program is licensed under the terms and conditions of the
+ * Apache License, version 2.0. The full text of the Apache License is at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ */
+
+collections {
+ group {
+ name: "Notification";
+
+ styles {
+ style {
+ name: "content_style_left";
+ base: "font="Sans" font_size=22 color=#00FFFFFF shadow_color=#80808032 style=shadow wrap=mixed";
+ }
+ style {
+ name: "content_style_center";
+ base: "font="Sans" font_size=25 color=#00FFFFFF shadow_color=#80808032 align=center style=shadow wrap=mixed";
+ }
+ }
+
+ parts {
+ part {
+ name: "noti_image";
+ type: IMAGE;
+ description {
+ min: 50 50;
+ max: 50 50;
+ align: 0.0 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 7;
+ }
+/*
+ image{
+ normal: "time_0.png";
+ }
+*/
+ }
+ }
+
+
+ part {
+ name: "content_text";
+ type: TEXTBLOCK;
+ scale: 1;
+ effect: FAR_SOFT_SHADOW;
+ description {
+ min: 300 50;
+ max: 1500 50;
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ rel1.relative: 0.0 0.0;
+ rel1.offset: 70 5;
+ color: 0 255 255 255;
+ text {
+ style: "content_style_left";
+ text: "text";
+ align: 0.0 0.5;
+ }
+ }
+ }
+ }
+ }
+ group {
+ name: "ClockImage";
+
+ images{
+ image:"time_am.png" COMP;
+ image:"time_ten.png" COMP;
+ image:"time_0.png" COMP;
+ }
+
+
+ parts {
+ part {
+ name: "MIN1_img";
+ type: IMAGE;
+ description {
+ min: 30 45;
+ max: 30 45;
+ align: 0.0 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 500 3;
+ }
+ image{
+ normal: "time_0.png";
+ }
+ }
+ }
+ part {
+ name: "MIN10_img";
+ type: IMAGE;
+ description {
+ min: 30 45;
+ max: 30 45;
+ align: 0.0 0.0;
+ rel1 {
+ to: "MIN1_img";
+ relative: 0.0 0.0;
+ offset: -31 0;
+ }
+ image{
+ normal: "time_0.png";
+ }
+ }
+ }
+ part {
+ name: "TIME_SP_img";
+ type: IMAGE;
+ description {
+ min: 12 30;
+ max: 12 30;
+ align: 0.0 0.0;
+ rel1 {
+ to: "MIN10_img";
+ relative: 0.0 0.0;
+ offset: -13 8;
+ }
+ image{
+ normal: "time_ten.png";
+ }
+ }
+ }
+ part {
+ name: "HOUR1_img";
+ type: IMAGE;
+ description {
+ min: 30 45;
+ max: 30 45;
+ align: 0.0 0.0;
+ rel1 {
+ to: "TIME_SP_img";
+ relative: 0.0 0.0;
+ offset: -31 -8;
+ }
+ image{
+ normal: "time_0.png";
+ }
+ }
+ }
+ part {
+ name: "HOUR10_img";
+ type: IMAGE;
+ description {
+ min: 30 45;
+ max: 30 45;
+ align: 0.0 0.0;
+ rel1 {
+ to: "HOUR1_img";
+ relative: 0.0 0.0;
+ offset: -31 0;
+ }
+ image{
+ normal: "time_0.png";
+ }
+ }
+ }
+ part {
+ name: "AM_PM_img";
+ type: IMAGE;
+ description {
+ min: 60 45;
+ max: 60 45;
+ align: 0.0 0.0;
+ rel1 {
+ to: "HOUR10_img";
+ relative: 0.0 0.0;
+ offset: -61 12;
+ }
+ image{
+ normal: "time_am.png";
+ }
+ }
+ }
+ }
+ }
+}
@MURPHYRESOURCE_CFLAGS@ \
@EDBUS_CFLAGS@ \
$(UWS_CFLAGS) \
- $(GENIVI_CFLAGS) \
- $(WESTONPLUGIN_CFLAGS) \
-I../../include \
-I../../lib/system-controller \
-I../../lib/common
{
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);
+ ico_window_mgr_layout_surface(_display->ico_window_mgr, -1, -1,
+ -1, -1, -1, -1, 0);
}
-#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_set_animation(display->ico_window_mgr, 0,
ICO_WINDOW_MGR_ANIMATION_TYPE_HIDE|
ICO_WINDOW_MGR_ANIMATION_TYPE_SHOW,
display->animation, display->animatime);
- ico_window_mgr_set_positionsize(display->ico_window_mgr, ICO_WINDOW_MGR_V_MAINSURFACE,
- displayno, posx, posy,
- ICO_WINDOW_MGR_V_NOCHANGE, ICO_WINDOW_MGR_V_NOCHANGE,
- ICO_WINDOW_MGR_FLAGS_NO_CONFIGURE);
- ico_window_mgr_set_window_layer(display->ico_window_mgr, ICO_WINDOW_MGR_V_MAINSURFACE,
- display->init_layer);
- ico_window_mgr_set_layer_visible(display->ico_window_mgr, display->init_layer, 1);
- ico_window_mgr_set_visible(display->ico_window_mgr, ICO_WINDOW_MGR_V_MAINSURFACE,
- ICO_WINDOW_MGR_VISIBLE_SHOW, ICO_WINDOW_MGR_RAISE_RAISE,
- ICO_WINDOW_MGR_FLAGS_ANIMATION |
- ICO_WINDOW_MGR_FLAGS_NO_CONFIGURE);
-#endif
+ ico_window_mgr_layout_surface(display->ico_window_mgr, 0, display->init_layer,
+ posx, posy, width, height, 1);
return(egl_surface);
}
noinst_PROGRAMS = \
ico_send_notification \
+ ico_send_notification2 \
ico_dump_notification \
ico_del_notification
check_PROGRAMS = \
ico_send_notification \
+ ico_send_notification2 \
ico_dump_notification \
ico_dump_notification
ico_send_notification_LDADD = \
$(NOTIFICATION_LIBS)
+ico_send_notification2_SOURCES = \
+ send_notification2.cpp
+
+ico_send_notification2_CXXFLAGS = \
+ $(NOTIFICATION_CFLAGS)
+
+ico_send_notification2_LDADD = \
+ $(NOTIFICATION_LIBS) -lappsvc
+
#
#
#
--- /dev/null
+#include <cstdio>
+#include <iostream>
+#include <string>
+#include <functional>
+#include <algorithm>
+#include <appsvc/appsvc.h>
+#include "notification.h"
+using namespace std;
+
+const char *
+errorToString(notification_error_e error)
+{
+ const char *strerr = NULL;
+
+ switch (error) {
+ case NOTIFICATION_ERROR_NONE:
+ strerr = "NOTIFICATION_ERROR_NONE";
+ break;
+ case NOTIFICATION_ERROR_INVALID_DATA:
+ strerr = "NOTIFICATION_ERROR_INVALID_DATA";
+ break;
+ case NOTIFICATION_ERROR_NO_MEMORY:
+ strerr = "NOTIFICATION_ERROR_NO_MEMORY";
+ break;
+ case NOTIFICATION_ERROR_FROM_DB:
+ strerr = "NOTIFICATION_ERROR_FROM_DB";
+ break;
+ case NOTIFICATION_ERROR_ALREADY_EXIST_ID:
+ strerr = "NOTIFICATION_ERROR_ALREADY_EXIST_ID";
+ break;
+ case NOTIFICATION_ERROR_FROM_DBUS:
+ strerr = "NOTIFICATION_ERROR_FROM_DBUS";
+ break;
+ case NOTIFICATION_ERROR_NOT_EXIST_ID:
+ strerr = "NOTIFICATION_ERROR_NOT_EXIST_ID";
+ break;
+ case NOTIFICATION_ERROR_IO:
+ strerr = "NOTIFICATION_ERROR_IO";
+ break;
+ case NOTIFICATION_ERROR_SERVICE_NOT_READY:
+ strerr = "NOTIFICATION_ERROR_SERVICE_NOT_READY";
+ break;
+ case NOTIFICATION_ERROR_PERMISSION_DENIED:
+ strerr = "NOTIFICATION_ERROR_PERMISSION_DENIED";
+ break;
+ default:
+ strerr = "UNKOWN";
+ break;
+ }
+
+ return strerr;
+}
+
+int
+insert_notification(notification_type_e type,
+ int group_id,
+ int priv_id,
+ const char *pkgname,
+ const char *title,
+ const char *content,
+ const char *icon)
+{
+ notification_h noti = notification_new(type,
+ group_id,
+ priv_id);
+ if (NULL == noti) {
+ cout << "notification_new() failed." << endl;
+ return -1;
+ }
+
+ //set Pkgname
+ if (NULL == pkgname) {
+ return -1;
+ }
+
+ notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
+
+ noti_err = notification_set_pkgname(noti, pkgname);
+ if (noti_err != NOTIFICATION_ERROR_NONE) {
+ printf("notification_set_pkgname failed(%s).\n",
+ errorToString(noti_err));
+ return -1;
+ }
+
+ //set Title
+ if (NULL == title) {
+ return -1;
+ }
+ noti_err = notification_set_text(noti,
+ NOTIFICATION_TEXT_TYPE_TITLE,
+ title,
+ NULL,
+ NOTIFICATION_VARIABLE_TYPE_NONE);
+ if (noti_err != NOTIFICATION_ERROR_NONE) {
+ cout << "Failed to set notification title <error code>:"<< noti_err<<endl;
+ return -1;
+ }
+
+ //set Content
+ if (NULL == content) {
+ return -1;
+ }
+ noti_err = notification_set_text(noti,
+ NOTIFICATION_TEXT_TYPE_CONTENT,
+ content,
+ NULL,
+ NOTIFICATION_VARIABLE_TYPE_NONE);
+ if (noti_err != NOTIFICATION_ERROR_NONE) {
+ cout << "Failed to set notification content <error code>:"<< noti_err<<endl;
+ return -1;
+ }
+
+ //set Icon_path
+ if (NULL == icon) {
+ return -1;
+ }
+ noti_err = notification_set_icon(noti, icon);
+ if (noti_err != NOTIFICATION_ERROR_NONE) {
+ cout <<"Failed to set icon_path <error code>:"<< noti_err <<endl;
+ return -1;
+ }
+
+ bundle *b = NULL;
+ b = bundle_create();
+ appsvc_set_pkgname(b, "org.tizen.dialer");
+ noti_err = notification_set_execute_option(noti, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, "Launch", NULL, b);
+ if (noti_err != NOTIFICATION_ERROR_NONE) {
+ printf("Failed to set notification execute option: %d", noti_err);
+ return -1;
+ }
+
+
+ //insert to DB and appear on the notification_area
+ //noti_err = notification_update(noti);
+ int private_id = 0;
+ noti_err = notification_insert(noti, &private_id);
+ if (noti_err != NOTIFICATION_ERROR_NONE) {
+ printf("notification_insert failed(%s).\n",
+ errorToString(noti_err));
+ return -1;
+ }
+
+ //free to notification
+ noti_err = notification_free(noti);
+ if (noti_err != NOTIFICATION_ERROR_NONE) {
+ cout <<"Failed to free notification <error code>:"<< noti_err <<endl;
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+main(int argc, char **argv)
+{
+ const char* msgTyp = "TYPE_NOTI";
+ notification_type_e nType = 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",
+ "Incoming call",
+ "888-8888",
+ "/usr/share/icons/default/small/org.tizen.dialer.png");
+
+ cout << "Notification_TestProgram End!=========" <<endl;
+ return 0;
+}