TC-127 - No notification pop up while incoming call comes on.
It is a phenomenon in which pop-up of OnScreen is not displayed by
notification.Since OnScreen will generate and show Surface if notification
comes, but SystemController does not assume that one application makes two
or more Surfaces.
Repair displayed all the norifications by one surface at OnScreen.
Change-Id: I503a5a9a23eb18ec19b4874afc067ff5e5e314ea
Bug-Tizen: TC-127
Signed-off-by: Ryota Okubi <ryota.okubi@mail.toyota-td.jp>
ICO_SYC_WIN_ASPECT_ALIGN_LEFT = 1,
ICO_SYC_WIN_ASPECT_ALIGN_RIGHT = 2,
ICO_SYC_WIN_ASPECT_ALIGN_TOP = 4,
- ICO_SYC_WIN_ASPECT_ALIGN_BOTTOM = 8,
+ ICO_SYC_WIN_ASPECT_ALIGN_BOTTOM = 8
} ico_syc_win_aspect_e;
/**
* window move information (zone/position/size)
*/
typedef struct _win_move {
- char *zone; /* area of showing application window */
- int layer; /* layer of showing application window */
- int pos_x; /* window's display position (x) */
- int pos_y; /* window's display position (y) */
- int width; /* window width */
- int height; /* window height */
+ const char *zone; /* area of showing application window */
+ int layer; /* layer of showing application window */
+ int pos_x; /* window's display position (x) */
+ int pos_y; /* window's display position (y) */
+ int width; /* window width */
+ int height; /* window height */
} ico_syc_win_move_t;
/*
* window information
*/
typedef struct _win_info {
- char *appid; /* application id */
- char *name; /* window's surface name */
- int surface; /* window's surface id */
+ const char *appid; /* application id */
+ const char *name; /* window's surface name */
+ int surface; /* window's surface id */
} ico_syc_win_info_t;
/*
* window attributes
*/
typedef struct _win_attr {
- char *appid; /* application id */
- char *name; /* window's surface name */
- char *zone; /* window's current zone name */
- int surface; /* window's surface id */
- int nodeid; /* ecu number and display number in the ecu */
- int layer; /* id of layer that the application's window is on */
- int pos_x; /* window's display position (x) */
- int pos_y; /* window's display position (y) */
- int width; /* window width */
- int height; /* window height */
- int raise; /* changed order showing surface in the layer */
- int visible; /* visible status */
- int active; /* window active status */
+ const char *appid; /* application id */
+ const char *name; /* window's surface name */
+ const char *zone; /* window's current zone name */
+ int surface; /* window's surface id */
+ int nodeid; /* ecu number and display number in the ecu */
+ int layer; /* id of layer that the application's window is on */
+ int pos_x; /* window's display position (x) */
+ int pos_y; /* window's display position (y) */
+ int width; /* window width */
+ int height; /* window height */
+ int raise; /* changed order showing surface in the layer */
+ int visible; /* visible status */
+ int active; /* window active status */
} ico_syc_win_attr_t;
/*
* (notify from callback function)
*/
typedef struct _thumb_info {
- char *appid; /* application id */
- int surface; /* window's surface id */
- int type; /* buffer type(ICO_WINDOW_MGR_MAP_TYPE_EGL/SHM/PIXEL)*/
- int width; /* window width */
- int height; /* window height */
- int stride; /* byte par line of frame buffer */
- int format; /* format of buffer */
+ const char *appid; /* application id */
+ int surface; /* window's surface id */
+ int type; /* buffer type(ICO_WINDOW_MGR_MAP_TYPE_EGL/SHM/PIXEL)*/
+ int width; /* window width */
+ int height; /* window height */
+ int stride; /* byte par line of frame buffer */
+ int format; /* format of buffer */
} ico_syc_thumb_info_t;
/*
* user list
*/
typedef struct _user_list {
- int user_num; /* number of user */
- char **userlist; /* address of user list */
- char *user_login; /* name of login user */
+ int user_num; /* number of user */
+ char **userlist; /* address of user list */
+ const char *user_login; /* name of login user */
} ico_syc_userlist_t;
/*
* window resource information
*/
typedef struct _res_win {
- char *ECU; /* name to identify ECU */
- char *display; /* name to identify Display in ECU */
- char *layer; /* name to identify Layer in Display */
- char *layout; /* name to identify Layout in Layer */
- char *area; /* name to Output position in Layout */
- char *dispatchApp; /* dispatch of application */
- char *role; /* role of notice */
- uint32_t resourceId;/* ID number of resource(surface id) */
+ const char *ECU; /* name to identify ECU */
+ const char *display; /* name to identify Display in ECU */
+ const char *layer; /* name to identify Layer in Display */
+ const char *layout; /* name to identify Layout in Layer */
+ const char *area; /* name to Output position in Layout */
+ const char *dispatchApp;/* dispatch of application */
+ const char *role; /* role of notice */
+ uint32_t resourceId; /* ID number of resource(surface id) */
} ico_syc_res_window_t;
/*
* sound resource information
*/
typedef struct _res_sound {
- char *zone; /* area of playing sound */
- char *name; /* sound stream name */
- char *id; /* sound id */
- int adjust; /* adjust action */
+ const char *zone; /* area of playing sound */
+ const char *name; /* sound stream name */
+ const char *id; /* sound id */
+ int adjust; /* adjust action */
} ico_syc_res_sound_t;
/*
* input resource information
*/
typedef struct _res_input {
- char *name; /* input device name */
- int event; /* input event id */
+ const char *name; /* input device name */
+ int event; /* input event id */
} ico_syc_res_input_t;
/*
* resource(window/sound/input) information
*/
typedef struct _res_info {
- ico_syc_res_window_t *window; /* window resource information */
- ico_syc_res_sound_t *sound; /* sound resource information */
- ico_syc_res_input_t *input; /* input resource information */
+ ico_syc_res_window_t *window; /* window resource information */
+ ico_syc_res_sound_t *sound; /* sound resource information */
+ ico_syc_res_input_t *input; /* input resource information */
} ico_syc_res_info_t;
/*
#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..) */
- int time; /* millisecond time to show the transition's animation */
+ const char *name; /* name of animation (ex. fade,slide,zoom etc..) */
+ int time; /* millisecond time to show the transition's animation */
} ico_syc_animation_t;
/*============================================================================*/
const char *dispatchApp,
const char *role,
uint32_t resourceId);
-static ico_syc_res_sound_t *_create_res_sound(char *zone, char *name, char *id,
- int adjust);
-static ico_syc_res_input_t *_create_res_input(char *name, int event);
+static ico_syc_res_sound_t *_create_res_sound(const char *zone, const char *name,
+ const char *id, int adjust);
+static ico_syc_res_input_t *_create_res_input(const char *name, int event);
static void _free_res_window(ico_syc_res_window_t *window);
static void _free_res_sound(ico_syc_res_sound_t *sound);
static void _free_res_input(ico_syc_res_input_t *input);
*/
/*--------------------------------------------------------------------------*/
static ico_syc_res_sound_t *
-_create_res_sound(char *zone, char *name, char *id, int adjust)
+_create_res_sound(const char *zone, const char *name, const char *id, int adjust)
{
ico_syc_res_sound_t *info = NULL;
*/
/*--------------------------------------------------------------------------*/
static ico_syc_res_input_t *
-_create_res_input(char *name, int event)
+_create_res_input(const char *name, int event)
{
ico_syc_res_input_t *info = NULL;
}
/* free element */
- free(w->ECU);
- free(w->display);
- free(w->layer);
- free(w->layout);
- free(w->area);
- free(w->dispatchApp);
- free(w->role);
+ free((void *)w->ECU);
+ free((void *)w->display);
+ free((void *)w->layer);
+ free((void *)w->layout);
+ free((void *)w->area);
+ free((void *)w->dispatchApp);
+ free((void *)w->role);
/* free */
free(w);
}
/* free element */
- free(sound->zone);
- free(sound->name);
- free(sound->id);
+ free((void *)sound->zone);
+ free((void *)sound->name);
+ free((void *)sound->id);
/* free */
free(sound);
}
/* free element */
- free(input->name);
+ free((void *)input->name);
/* free */
free(input);
}
free(list);
}
- free(userlist->user_login);
+ free((void *)userlist->user_login);
free(userlist);
return;
/* free memory */
g_object_unref(parser);
- free(win_info->appid);
- free(win_info->name);
- free(win_info);
+ free((void *)win_info->appid);
+ free((void *)win_info->name);
+ free((void *)win_info);
return;
}
/* free memory */
g_object_unref(parser);
- free(win_attr->appid);
- free(win_attr->name);
- free(win_attr->zone);
+ free((void *)win_attr->appid);
+ free((void *)win_attr->name);
+ free((void *)win_attr->zone);
free(win_attr);
return;
/* free memory */
g_object_unref(parser);
- free(thumb_info->appid);
+ free((void *)thumb_info->appid);
free(thumb_info);
return;
}
ICO_DBG("change zone: \"%s\"->\"%s\"", wininfo->zone, dispzone);
- ico_syc_win_move_t move = {
- .zone = (char*)dispzone,
- .layer = layer,
- .pos_x = 0,
- .pos_y = 0,
- .width = 0,
- .height = 0
- };
+ ico_syc_win_move_t move;
+ move.zone = dispzone;
+ move.layer = layer;
+ move.pos_x = 0;
+ move.pos_y = 0;
+ move.width = 0;
+ move.height = 0;
ico_syc_move(wininfo->appid, wininfo->surface, &move,
&hs_instance->moveZoneAnimation);
ico_syc_win_move_t move;
- move.zone = (char*)dispZoneConf->fullname.c_str();
+ move.zone = dispZoneConf->fullname.c_str();
move.layer = HS_LAYER_APPLICATION;
if (ailItem->m_display != 0) {
move.layer = HS_LAYER_2NDDISP_APP;
ico_syc_move(win_info->appid,win_info->surface,&move,NULL);
ico_syc_animation_t animation;
- animation.name = (char*)ICO_HS_MENU_HIDE_ANIMATION_FADE;
+ animation.name = ICO_HS_MENU_HIDE_ANIMATION_FADE;
animation.time = ICO_HS_MENU_ANIMATION_DURATION;
const string& lastStartupApp = m_appHis->getLastStartupAppid();
if (true == lastStartupApp.empty()) {
move.width = oPOSC->m_w;
move.height = oPOSC->m_h;
ico_syc_animation_t animation;
- animation.name = (char*)ICO_HS_MENU_SHOW_ANIMATION_SLIDE;
+ animation.name = ICO_HS_MENU_SHOW_ANIMATION_SLIDE;
animation.time = ICO_HS_MENU_ANIMATION_DURATION;
ico_syc_move(win_info->appid, win_info->surface, &move, &animation);
{
int ret;
strncpy(sb_package_name,
- (char *)config->ConfigGetString(ICO_HS_CONFIG_HOMESCREEN,
- ICO_HS_CONFIG_SB,
- ICO_HS_APPID_DEFAULT_SB),
+ config->ConfigGetString(ICO_HS_CONFIG_HOMESCREEN,
+ ICO_HS_CONFIG_SB,
+ ICO_HS_APPID_DEFAULT_SB),
ICO_HS_MAX_PROCESS_NAME);
strncpy(os_package_name,
- (char *)config->ConfigGetString(ICO_HS_CONFIG_HOMESCREEN,
- ICO_HS_CONFIG_ONS,
- ICO_HS_APPID_DEFAULT_ONS),
+ config->ConfigGetString(ICO_HS_CONFIG_HOMESCREEN,
+ ICO_HS_CONFIG_ONS,
+ ICO_HS_APPID_DEFAULT_ONS),
ICO_HS_MAX_PROCESS_NAME);
// TODO
#if 1 /* ToDo */
// load switch display zone config
moveZoneName = config->ConfigGetString("switchzone", "movezone", NULL);
- moveZoneAnimation.name = (char*)config->ConfigGetString("switchzone",
- "animation",
- ICO_HS_ANIMATION_FADE);
+ moveZoneAnimation.name = config->ConfigGetString("switchzone",
+ "animation",
+ ICO_HS_ANIMATION_FADE);
moveZoneAnimation.time = config->ConfigGetInteger("switchzone",
"animatime", 400);
/* create server instance */
CicoHSServer *server = CicoHSServer::getInstance();
server->setAppCtrl(m_appctrl);
- server->startup(10001, (const char*)"ico_hs_protocol");
+ server->startup(10001, "ico_hs_protocol");
/* Initialize WindowController */
CicoHSWindowController::Initialize();
// load switch display zone config
moveZoneName = config->ConfigGetString("switchzone", "movezone", NULL);
- moveZoneAnimation.name = (char*)config->ConfigGetString("switchzone",
- "animation",
- ICO_HS_ANIMATION_FADE);
+ moveZoneAnimation.name = config->ConfigGetString("switchzone",
+ "animation",
+ ICO_HS_ANIMATION_FADE);
moveZoneAnimation.time = config->ConfigGetInteger("switchzone",
"animatime", 400);
// debug log
ico_syc_animation_t animation;
ICO_DBG("CicoHomeScreen::ChangeMode: MENU->APP");
if (pattern == ICO_HS_SHOW_HIDE_PATTERN_SLIDE) {
- animation.name = (char*)ICO_HS_MENU_HIDE_ANIMATION_SLIDE;
+ animation.name = ICO_HS_MENU_HIDE_ANIMATION_SLIDE;
}
else {
- animation.name = (char*)ICO_HS_MENU_HIDE_ANIMATION_FADE;
+ animation.name = ICO_HS_MENU_HIDE_ANIMATION_FADE;
}
animation.time = ICO_HS_MENU_ANIMATION_DURATION;
hs_instance->menu_window->Hide(&animation);
ico_syc_animation_t animation;
ICO_DBG("CicoHomeScreen::ChangeMode: APP->MENU");
if (pattern == ICO_HS_SHOW_HIDE_PATTERN_SLIDE) {
- animation.name = (char*)ICO_HS_MENU_SHOW_ANIMATION_SLIDE;
+ animation.name = ICO_HS_MENU_SHOW_ANIMATION_SLIDE;
}
else {
- animation.name = (char*)ICO_HS_MENU_SHOW_ANIMATION_FADE;
+ animation.name = ICO_HS_MENU_SHOW_ANIMATION_FADE;
}
animation.time = ICO_HS_MENU_ANIMATION_DURATION;
hs_instance->menu_window->Show(&animation);
// regulation action
hs_instance->ctl_bar_window->SetRegulation();
ico_syc_animation_t animation;
- animation.name = (char*)ICO_HS_MENU_HIDE_ANIMATION_SLIDE;
+ animation.name = ICO_HS_MENU_HIDE_ANIMATION_SLIDE;
animation.time = ICO_HS_MENU_ANIMATION_DURATION;
hs_instance->menu_window->Hide(&animation);
}
ico_syc_animation_t animation;
- animation.name = (char*)ICO_HS_MENU_HIDE_ANIMATION_FADE;
+ animation.name = ICO_HS_MENU_HIDE_ANIMATION_FADE;
animation.time = ICO_HS_MENU_ANIMATION_DURATION;
ico_syc_show(appinfo->GetAppId(), appinfo->GetLastSurface(), &animation);
}
ico_syc_animation_t animation;
- animation.name = (char*)ICO_HS_MENU_HIDE_ANIMATION_FADE;
+ animation.name = ICO_HS_MENU_HIDE_ANIMATION_FADE;
animation.time = ICO_HS_MENU_ANIMATION_DURATION;
int surface = ai->GetLastSurface();
void
CicoHomeScreen::MoveApp(const std::string& app, const std::string& zone)
{
- CicoHSAppInfo *appinfo = GetAppInfo((const char*)app.c_str());
+ CicoHSAppInfo *appinfo = GetAppInfo(app.c_str());
if ((CicoHSAppInfo*)0 == appinfo) {
ICO_DBG("GetAppInfo(%s) is NULL" , app.c_str());
return;
int surface = appinfo->GetLastSurface();
ico_hs_window_info* wininfo = appinfo->GetWindowInfobySurface(surface);
- int layer = HS_LAYER_APPLICATION;
- const char *dispzone = (const char*)zone.c_str();
- ico_syc_win_move_t move = {
- .zone = (char*)dispzone,
- .layer = layer,
- .pos_x = 0,
- .pos_y = 0,
- .width = 0,
- .height = 0
- };
-
- ico_syc_move(wininfo->appid, wininfo->surface, &move,
- &hs_instance->moveZoneAnimation);
+ if (wininfo) {
+ int layer = HS_LAYER_APPLICATION;
+ const char *dispzone = zone.c_str();
+ ico_syc_win_move_t move;
+ move.zone = dispzone;
+ move.layer = layer;
+ move.pos_x = 0;
+ move.pos_y = 0;
+ move.width = 0;
+ move.height = 0;
+
+ ico_syc_move(wininfo->appid, wininfo->surface, &move,
+ &hs_instance->moveZoneAnimation);
+ }
}
// vim: set expandtab ts=4 sw=4:
//==========================================================================
// static members
//==========================================================================
+Ecore_Evas* CicoOSPopWindow::m_window = NULL;
//==========================================================================
// functions
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_resourceId = CicoOnScreen::GetResourceId();
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_resourceId = CicoOnScreen::GetResourceId();
m_context = NULL;
m_buttonTouch = false;
ICO_TRA("Leave");
}
+
//--------------------------------------------------------------------------
/**
* @brief CicoOnScreen::~CicoOnScreen
//--------------------------------------------------------------------------
CicoOSPopWindow::~CicoOSPopWindow(void)
{
- ICO_TRA("Enter sur:%d, priv_id:%d", m_resourceId, GetPrivId());
- if (NULL != m_window) {
- ecore_evas_free(m_window);
- m_window = NULL;
- }
- // if (NULL != m_icon) /* import m_window */
- m_icon = NULL;
- // if (NULL != m_theme) /* import m_window */
- m_theme = NULL;
+ ICO_TRA("Enter sur:%08x, priv_id:%d", m_resourceId, GetPrivId());
+
if (NULL != m_context) {
int r = ico_syc_release_res(m_context);
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())) {
}
}
+ if (m_theme) {
+ usleep(POPUP_DELETE_WAIT*1000);
+ evas_object_hide(m_theme);
+ evas_object_del(m_theme);
+ m_theme = NULL;
+ }
+ if (m_icon) {
+ evas_object_hide(m_icon);
+ evas_object_del(m_icon);
+ m_icon = NULL;
+ }
ICO_TRA("Leave");
}
CicoOSPopWindow::showPopup()
{
ICO_TRA("Enter");
- if (NULL == m_window) {
+
+ if (NULL == m_theme) {
if (false == InitializeWindow()) {
ICO_TRA("Leave false");
return false;
// Get icon path
const char *icon = GetIconPath();
ICO_DBG("Received: %s : %i : %s : %s : %s : %p",
- pkgname, priv_id, title, content,
- text, (void *)service_handle);
+ pkgname, priv_id, title, content, text, (void *)service_handle);
if (NULL != service_handle) {
const char* pn = appsvc_get_pkgname(service_handle);
return true;
}
-bool
+bool
CicoOSPopWindow::acquireRes()
{
ICO_TRA("Enter");
}
ico_syc_res_window_t w;
makeResWindowT(w);
- m_context = ico_syc_acquire_res( &w, NULL, NULL, ICO_SYC_RES_ONSCREEN);
+ m_context = ico_syc_acquire_res(&w, NULL, NULL, ICO_SYC_RES_ONSCREEN);
if (NULL == m_context) {
ICO_TRA("Leave false");
return false;
ICO_TRA("Leave");
}
-bool
+bool
CicoOSPopWindow::releaseRes()
{
ICO_TRA("Enter");
return false;
}
-
//--------------------------------------------------------------------------
/**
- * @brief CicoOnScreen::InitializePopup
+ * @brief CicoOnScreen::InitializeWindow
* Initialize popup window
*
* @param[in] none
CicoOSPopWindow::InitializeWindow(void)
{
ICO_TRA("Enter");
- if (false == createMainWindow()) {
- ICO_TRA("Leave(ERR)");
- return false;
+
+ if (NULL == m_window) {
+ if (false == createMainWindow()) {
+ ICO_TRA("Leave(ERR)");
+ return false;
+ }
}
m_theme = edje_object_add(ecore_evas_get(m_window));
if (NULL == m_theme) {
ICO_TRA("Leave(ERR)");
return false;
}
- if (!edje_object_file_set(m_theme, ICO_OS_THEMES_EDJ_FILEPATH, "main")) {
+ if (! edje_object_file_set(m_theme, ICO_OS_THEMES_EDJ_FILEPATH, "main")) {
Edje_Load_Error err = edje_object_load_error_get(m_theme);
const char *errmsg = edje_load_error_str(err);
ICO_ERR("could not load 'main' from onscreen.edj: %s", errmsg);
m_icon = evas_object_image_filled_add(ecore_evas_get(m_window));
evas_object_pointer_mode_set(m_icon, EVAS_OBJECT_POINTER_MODE_NOGRAB);
edje_object_part_swallow(m_theme, "icon", m_icon);
+
/* getting size of screen */
- /* home screen size is full of display*/
+ /* home screen size is full of display */
int display_width = 0;
int display_height = 0;
ecore_wl_screen_size_get(&display_width, &display_height);
CicoOSPopWindow::createMainWindow()
{
ICO_TRA("Enter");
+
// Window setup
m_window = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, "frame=0");
if (NULL == m_window) {
ICO_TRA("Leave(ERR)");
return false;
}
+
+ ecore_evas_title_set(m_window, POPUP_WINDOW_TITLE);
ecore_evas_alpha_set(m_window, EINA_TRUE);
ecore_evas_show(m_window);
+
ICO_TRA("Leave");
return true;
}
+void
+CicoOSPopWindow::removeMainWindow()
+{
+ ICO_TRA("Enter");
+
+ if (NULL != m_window) {
+ ecore_evas_free(m_window);
+ m_window = NULL;
+ }
+ ICO_TRA("Leave");
+}
+
//--------------------------------------------------------------------------
/**
* @brief callback function of evas mouse up event
}
-static char id0_ECU[] = "Center";
-
-static char id00_display[] = "Center";
-// static char id01_display[] = "Mid";
-
-// static char id001_layer[] = "Application";
-// static char id002_layer[] = "SoftKeyboard";
-// static char id003_layer[] = "HomeScreen";
-// static char id004_layer[] = "ControlBar";
-// static char id005_layer[] = "InterruptApp";
-static char id006_layer[] = "OnScreen";
-// static char id007_layer[] = "Touch";
-// static char id008_layer[] = "Cursor";
-// static char id011_layer[] = "MainApp";
-// static char id012_layer[] = "SubDispMainApp";
-// static char id013_layer[] = "SubDispSubApp";
+static const char id0_ECU[] = "Center";
-static char id00611_layout[] = "Whole";
-// static char id00612_layout[] = "Half";
+static const char id00_display[] = "Center";
+static const char id006_layer[] = "OnScreen";
+static const char id00611_layout[] = "Whole";
+static const char id006111_area[] = "Full";
-static char id006111_area[] = "Full";
-// static char id006121_area[] = "Upper";
-// static char id006122_area[] = "Lower";
+static const char role_incoming[] = "incoming";
+static const char role_message[] = "message";
-static char role_incoming[] = "incoming";
-static char role_message[] = "message";
void
CicoOSPopWindow::makeResWindowT(ico_syc_res_window_t& w)
{
#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
#define POPUP_FRAME_WIDTH (POPUP_WIDTH+POPUP_FRAME_THICK)
#define POPUP_FRAME_HEIGHT (POPUP_HEIGHT+POPUP_FRAME_THICK)
-#if 0
-#define POPUP_ST_X ((WIDTH-POPUP_WIDTH)/2)
-#define POPUP_ST_Y ((HEIGHT-POPUP_HEIGHT)/2)
+/* OnScreen window name(title) */
+#define POPUP_WINDOW_TITLE "OnScreen"
-/* Popup Frame Size */
-#define POPUP_FRAME_THICK 10
-#define POPUP_FRAME_WIDTH (POPUP_WIDTH+POPUP_FRAME_THICK)
-#define POPUP_FRAME_HEIGHT (POPUP_HEIGHT+POPUP_FRAME_THICK)
-#define POPUP_FRAME_ST_X (POPUP_ST_X-POPUP_FRAME_THICK/2)
-#define POPUP_FRAME_ST_Y (POPUP_ST_Y-POPUP_FRAME_THICK/2)
-
-/* Popup Icon Size */
-#define POPUP_ICON_WIDTH 50
-#define POPUP_ICON_HEIGHT 50
-#define POPUP_ICON_ST_X POPUP_ST_X
-#define POPUP_ICON_ST_Y POPUP_ST_Y
-
-/* Popup Title Size */
-#define POPUP_TITLE_WIDTH (POPUP_WIDTH-POPUP_ICON_WIDTH)
-#define POPUP_TITLE_HEIGHT POPUP_ICON_HEIGHT
-#define POPUP_TITLE_ST_X (POPUP_ST_X+POPUP_ICON_WIDTH)
-#define POPUP_TITLE_ST_Y POPUP_ST_Y
-
-/* Popup Content BG Size */
-#define POPUP_CONTENT_BG_WIDTH POPUP_WIDTH
-#define POPUP_CONTENT_BG_HEIGHT (POPUP_HEIGHT-POPUP_TITLE_HEIGHT)
-#define POPUP_CONTENT_BG_ST_X POPUP_ST_X
-#define POPUP_CONTENT_BG_ST_Y (POPUP_ST_Y+POPUP_TITLE_HEIGHT)
-
-/* Popup Content Size */
-#define POPUP_CONTENT_WIDTH POPUP_WIDTH
-#define POPUP_CONTENT_HEIGHT POPUP_TITLE_HEIGHT
-#define POPUP_CONTENT_ST_X POPUP_ST_X
-#define POPUP_CONTENT_ST_Y (POPUP_ST_Y+POPUP_TITLE_HEIGHT+(POPUP_HEIGHT-POPUP_CONTENT_HEIGHT)/2)
-
-#define ICO_ORIENTATION_VERTICAL (1)
-#define ICO_ORIENTATION_HORIZONTAL (2)
-
-#define LEMOLO_PKGNAME "org.tizen.dialer"
-#endif
+/* Wait time for delete popup(ms) */
+#define POPUP_DELETE_WAIT 100
#define FALSE 0
#define TRUE 1
-#if 0
-#define ICON_PATH (char *)"/usr/share/icons/default/small/org.tizen.dialer.png"
-#endif
#define ICO_OS_THEMES_EDJ_FILEPATH "/usr/apps/org.tizen.ico.onscreen/res/themes/onscreen.edj"
/*============================================================================*/
/* Define data types */
return (const CicoNotification&)*this;
}
bool createMainWindow();
+ void removeMainWindow();
+
private:
bool InitializeWindow(void);
static void evasMouseUpCB(void *data, Evas *e, Evas_Object *obj,
void *event_info);
void makeResWindowT(ico_syc_res_window_t& w);
+ static Ecore_Evas* m_window;
public:
- Ecore_Evas* m_window;
Evas_Object* m_icon;
Evas_Object* m_theme;
uint32_t m_resourceId;
std::string m_appsvc_pkgname;
bool m_buttonTouch;
};
-
#endif // __CICO_ONSCREEN_POP_WINDOW_H__
// vim:set expandtab ts=4 sw=4:
// static members
//==========================================================================
CicoOnScreen * CicoOnScreen::os_instance=NULL;
+uint32_t CicoOnScreen::surfaceid = 0;
//==========================================================================
// functions
//--------------------------------------------------------------------------
CicoOnScreen::~CicoOnScreen(void)
{
-// ICO_TRA("CicoOnScreen::~CicoOnScreen Enter");
+// ICO_TRA("CicoOnScreen::~CicoOnScreen Enter");
list<CicoOSPopWindow*>::iterator p = m_mngWin.begin();
while (p != m_mngWin.end()) {
CicoOSPopWindow* pt = *p;
+ pt->removeMainWindow();
delete pt;
}
m_mngWin.clear();
p = m_waitMngWin.begin();
while (p != m_waitMngWin.end()) {
CicoOSPopWindow* pt = *p;
+ pt->removeMainWindow();
delete pt;
}
m_waitMngWin.clear();
delete m_request;
m_request = NULL;
-// ICO_TRA("CicoOnScreen::~CicoOnScreen Leave");
+ m_del = false;
+// ICO_TRA("CicoOnScreen::~CicoOnScreen Leave");
}
//--------------------------------------------------------------------------
CicoOSClient* cosc = CicoOSClient::getInstance();
cosc->connect();
+ // create surface
if (NULL == m_reserve) {
m_reserve = new CicoOSPopWindow(NOTIFICATION_TYPE_NONE);
m_reserve->createMainWindow();
ICO_TRA("Leave (false)");
return false;
}
- if (!w->Empty()) {
+ if (! w->Empty()) {
if (NOTIFICATION_TYPE_NOTI == w->GetType()) {
m_waitMngWin.push_back(w);
w = NULL;
ICO_TRA("Leave (true)");
return true;
}
+
bool CicoOnScreen::deleteNoti(int priv_id)
{
ICO_TRA("Enter");
ICO_TRA("Leave");
}
+//--------------------------------------------------------------------------
+/**
+ * @brief CicoOnScreen::GetResourceId
+ * Get resource id (sourface id)
+ *
+ * @param nothing
+ * @return resource id
+ */
+//--------------------------------------------------------------------------
+uint32_t
+CicoOnScreen::GetResourceId(void)
+{
+ return CicoOnScreen::surfaceid;
+}
+
bool CicoOnScreen::requestShowSC()
{
ICO_TRA("Enter");
return false;
}
- list<CicoOSPopWindow*>::iterator p = m_waitMngWin.begin();
- m_del = false;
- m_request = *p;
- m_waitMngWin.remove(m_request);
- bool r = m_request->showPopup();
- while (false == r) { // fail showPop request
- ICO_ERR("_____ Fail SHOW POP REQUEST(%d)",
- m_request->GetPrivId());
- delete m_request;
- m_request = NULL;
- if (m_waitMngWin.empty()) {
- break;
- }
- p = m_waitMngWin.begin();
+ list<CicoOSPopWindow*>::iterator p;
+ bool r;
+ while (1) {
m_del = false;
+ p = m_waitMngWin.begin();
m_request = *p;
m_waitMngWin.remove(m_request);
r = m_request->showPopup();
+ if (true == r) {
+ r = m_request->acquireRes();
+ if (true == r) {
+ if (true == m_del) {
+ m_request->hidePopup();
+ m_del = false;
+ }
+ }
+ else {
+ ICO_ERR("_____ Fail Acquire Resource(%d)", m_request->GetPrivId());
+ }
+ }
+ else {
+ ICO_ERR("_____ Fail SHOW POP REQUEST(%d)", m_request->GetPrivId());
+ }
+ if (true == r) break;
+ delete m_request;
+ m_request = NULL;
+ if (m_waitMngWin.empty()) break;
}
- ICO_TRA("Leave %s", r? "true": "false");
+ ICO_TRA("Leave %s", r ? "true": "false");
return r;
}
const void *detail, void *user_data)
{
ICO_TRA("Enter(event %d, %x, %x)", (int)event, detail, user_data);
+
ico_syc_res_info_t *ri = (ico_syc_res_info_t*) detail;
if (NULL == ri) {
ICO_ERR("____ CALLBACK NG PARAM");
ICO_TRA("_____ no WINDOW");
break; // break of switch event
}
- os_instance->entryWindowId(ri->window->resourceId);
+ CicoOnScreen::surfaceid = ri->window->resourceId;
+ ICO_TRA("_____ surfaceid=%08x", CicoOnScreen::surfaceid);
break; // break of switch event
}
default:
ICO_TRA("_____ UNKNOWN event(%d)", (int)event);
break; // break of switch event
}
-
ICO_TRA("Leave");
}
bool
CicoOnScreen::releaseWindow(uint32_t resourceId)
{
- ICO_TRA("Enter(%d)", resourceId);
+ ICO_TRA("Enter(%08x)", resourceId);
+
bool bR = false;
list<CicoOSPopWindow*> tmp;
p = tmp.begin();
for (; p != tmp.end(); ++p) {
CicoOSPopWindow* w = *p;
+ if (w == m_request) {
+ m_request = NULL;
+ }
m_mngWin.remove(w);
delete w;
bR = true;
}
tmp.clear();
- ICO_TRA("Leave %s", bR? "true": "false");
- return bR;
-}
-
-bool
-CicoOnScreen::entryWindowId(uint32_t resourceId)
-{
- ICO_TRA("Enter(%d)", resourceId);
- bool bR = false;
- if (NULL != m_request) {
- m_request->m_resourceId = resourceId;
- if (true == m_request->acquireRes()) {
- m_mngWin.push_back(m_request);
- if (true == m_del) {
- ICO_TRA("____ HIDE REQUEST");
- m_request->hidePopup();
- }
- }
- else {
- delete m_request;
- }
- m_del = false;
+ if (m_request) {
+ delete m_request;
m_request = NULL;
- bR = requestShowSC();
+ m_del = false;
+
+ (void) requestShowSC();
}
ICO_TRA("Leave %s", bR? "true": "false");
return bR;
notification_type_e type,
notification_op *op_list,
int num_op);
+
+ static uint32_t GetResourceId(void);
+
protected:
bool requestShowSC();
static void EventCallBack(const ico_syc_ev_e event,
const void *detail,
void *user_data);
- bool entryWindowId(uint32_t resourceId);
bool releaseWindow(uint32_t resourceId);
bool insertNoti(notification_h noti_h);
bool deleteNoti(int priv_id);
static CicoOnScreen *os_instance;
+ static uint32_t surfaceid;
protected:
CicoNotificationService notiservice_;
errorToString(noti_err));
return -1;
}
-
- //set Title
+
+ //set Title
if (NULL == title) {
return -1;
}
cout << "Failed to set notification title <error code>:"<< noti_err<<endl;
return -1;
}
-
+
//set Content
if (NULL == content) {
return -1;
cout << "Failed to set notification content <error code>:"<< noti_err<<endl;
return -1;
}
-
- //set Icon_path
+
+ //set Icon_path
if (NULL == icon) {
return -1;
}
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")) {
}
cout << "Notification TestProgram Start("<<msgTyp<<")=========" <<endl;
-
+
insert_notification(nType,
NOTIFICATION_GROUP_ID_DEFAULT,
NOTIFICATION_PRIV_ID_NONE,
"org.tizen.dialer",
- "test_title",
+ "test_title1",
"0123456789012345678901234",
"/usr/share/icons/default/small/org.tizen.dialer.png");
insert_notification(nType,
NOTIFICATION_GROUP_ID_NONE,
NOTIFICATION_PRIV_ID_NONE,
- "GV3ySIINq7.GhostCluster",
- "test_title",
- "test_content",
- "/opt/share/icons/default/small/GV3ySIINq7.GhostCluster.png");
+ "terminal",
+ "test_title2",
+ "test_content2",
+ "/usr/share/icons/default/small/terminal.png");
insert_notification(nType,
NOTIFICATION_GROUP_ID_NONE,
NOTIFICATION_PRIV_ID_NONE,
- "ODBQpKvkS1.Settings",
- "test_title",
- "test_content",
- "/opt/share/icons/default/small/ODBQpKvkS1.Settings.png");
+ "navigator",
+ "test_title3",
+ "test_content3",
+ "/usr/share/icons/default/small/navigator.png");
insert_notification(nType,
NOTIFICATION_GROUP_ID_NONE,
NOTIFICATION_PRIV_ID_NONE,
- "lYjFlj49Q4.saythis",
- "test_title",
- "test_content",
- "/opt/share/icons/default/small/lYjFlj49Q4.saythis.png");
+ "smartdevicelink",
+ "test_title4",
+ "test_content4",
+ "/usr/share/icons/default/small/devices.png");
insert_notification(nType,
NOTIFICATION_GROUP_ID_NONE,
NOTIFICATION_PRIV_ID_NONE,
- "t8j6HTRpuz.MediaPlayer",
- "test_title",
- "test_content",
- "/opt/share/icons/default/small/t8j6HTRpuz.MediaPlayer.png");
+ "org.tizen.ico.app-soundsample",
+ "test_title5",
+ "test_content5",
+ "/usr/share/icons/default/small/org.tizen.ico.app-soundsample.png");
cout << "Notification_TestProgram End!=========" <<endl;
return 0;