/*--------------------------------------------------------------------------*/
/**
- * @brief CicoHSMenuTile::MovePosition
- * move tile base position
- *
- * @param[in] page page
- * @param[in] position position of tile
- * @return none
- */
-/*--------------------------------------------------------------------------*/
-void
-CicoHSMenuTile::MovePosition(int page, int position)
-{
- this->page = page;
- this->position= position;
- pos_x = GetPositionX();
- pos_y = GetPositionY();
-
- ICO_DBG("CicoHSMenuTile::MovePosition(appid=%p<%s> tile=(%d,%d))",
- this->appid, appid, pos_x, pos_y);
-
- evas_object_move(tile, pos_x, pos_y);
- if (thumb_tile) {
- evas_object_move(thumb_tile, pos_x + thumb_reduce_x, pos_y + thumb_reduce_y);
- }
- if (small_icon) {
- evas_object_move(small_icon,
- pos_x + thumb_reduce_x - ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX2,
- pos_y + height - thumb_reduce_y - height
- / ICO_HS_MENUTILE_THUMBNAIL_REDUCTION
- + ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX2);
- }
- evas_object_move(term_icon, pos_x + width - ICO_HS_MENUTILE_TERM_ICON_WIDTH, pos_y);
-}
-
-/*--------------------------------------------------------------------------*/
-/**
* @brief CicoHSMenuTile::OffsetMove
* move from base position
*
void
CicoHSMenuTile::SetOrgThumbnail(CicoHSMenuTile *orgTile)
{
-
- ICO_DBG("CicoHSMenuTile::SetOrgThumbnail Enter(appid=%p<%s>) run=%d surf=%08x",
- this->appid, this->appid, app_running, orgTile->thumb.surface );
+ ICO_DBG("CicoHSMenuTile::SetOrgThumbnail appid=%s run=%d surf=%08x",
+ this->appid, app_running, orgTile->thumb.surface);
/* check surface of orgTile */
- if ( orgTile == NULL || orgTile->thumb.surface == 0 ) {
+ if (orgTile == NULL) {
return;
}
- /* set surface */
- this->ValidThumbnail( orgTile->thumb.surface );
-
- /* set new thumbnail */
- ico_syc_thumb_info_t info;
-
- info.surface = orgTile->thumb.surface;
- info.type = orgTile->thumb.type;
- info.width = orgTile->thumb.width;
- info.height = orgTile->thumb.height;
- info.stride = orgTile->thumb.stride;
- info.format = orgTile->thumb.format;
-
- SetThumbnail( &info );
-
- ICO_DBG("CicoHSMenuTile::SetOrgThumbnail Leave(appid=%p<%s>) run=%d surf=%08x",
- this->appid, this->appid, app_running, orgTile->thumb.surface );
+ thumb_reduce_x = orgTile->thumb_reduce_x;
+ thumb_reduce_y = orgTile->thumb_reduce_y;
+ app_running = orgTile->app_running;
+ menu_show = orgTile->menu_show;
+ if (orgTile->thumb_tile) {
+ if (thumb_tile) {
+ evas_object_del(thumb_tile);
+ }
+ thumb_tile = orgTile->thumb_tile;
+ orgTile->thumb_tile = NULL;
+ evas_object_event_callback_del(thumb_tile, EVAS_CALLBACK_MOUSE_DOWN,
+ CicoHSMenuTouch::TouchDownMenu);
+ evas_object_event_callback_del(thumb_tile, EVAS_CALLBACK_MOUSE_UP,
+ CicoHSMenuTouch::TouchUpMenu);
+ evas_object_event_callback_add(thumb_tile, EVAS_CALLBACK_MOUSE_DOWN,
+ CicoHSMenuTouch::TouchDownMenu, appid);
+ evas_object_event_callback_add(thumb_tile, EVAS_CALLBACK_MOUSE_UP,
+ CicoHSMenuTouch::TouchUpMenu, appid);
+ if ((orgTile->icon == thumb_tile) && (icon != thumb_tile)) {
+ evas_object_hide(icon);
+ icon = thumb_tile;
+ evas_object_show(icon);
+ }
+ }
+ if ((small_icon == NULL) && (orgTile->small_icon != NULL)) {
+ small_icon = orgTile->small_icon;
+ orgTile->small_icon = NULL;
+ evas_object_event_callback_del(small_icon, EVAS_CALLBACK_MOUSE_DOWN,
+ CicoHSMenuTouch::TouchDownMenu);
+ evas_object_event_callback_del(small_icon, EVAS_CALLBACK_MOUSE_UP,
+ CicoHSMenuTouch::TouchUpMenu);
+ evas_object_event_callback_add(small_icon, EVAS_CALLBACK_MOUSE_DOWN,
+ CicoHSMenuTouch::TouchDownMenu, appid);
+ evas_object_event_callback_add(small_icon, EVAS_CALLBACK_MOUSE_UP,
+ CicoHSMenuTouch::TouchUpMenu, appid);
+ }
+ if (orgTile->thumb.thumb_timer) {
+ ecore_timer_del(orgTile->thumb.thumb_timer);
+ }
+ thumb = orgTile->thumb;
+ orgTile->thumb.surface = 0;
+ orgTile->thumb.fbcount = 0;
+ orgTile->thumb.pixel_data = NULL;
+ orgTile->thumb.orgsurface = 0;
+ if (thumb.thumb_timer) {
+ thumb.thumb_timer = ecore_timer_add(ICO_HS_MENUTILE_THUMBNAIL_RETRYTIME,
+ CicoHSMenuTile::TimerThumbnail, (void *)this);
+ orgTile->thumb.thumb_timer = NULL;
+ }
}
// vim: set expandtab ts=4 sw=4:
* create object and show (tiles)
*
* @param[in] none
- * @return ERROR or OK
+ * @return none
*/
/*--------------------------------------------------------------------------*/
-int
+void
CicoHSMenuWindow::SetAppTiles(void)
{
int tile_num = 0;
menu_tile[ii]->OffsetMove(height,0);
}
}
- return ICO_OK;
}
/*--------------------------------------------------------------------------*/
ICO_TRA("CicoHSMenuWindow::RenewAppTiles Enter");
int cnt, cnt2;
- int ret;
+
+ /* save current page */
+ int current_page_org = current_page;
+ int subcurrent_page_org = subcurrent_page;
/* backup old data */
int all_tile_num_org = all_tile_num;
CicoHSMenuTile *menu_tile_org[ICO_HS_MENU_MAX_TILE_NUM];
- for (cnt=0; cnt < all_tile_num_org; cnt++) {
- menu_tile_org[cnt]=menu_tile[cnt];
+ for (cnt = 0; cnt < all_tile_num_org; cnt++) {
+ menu_tile_org[cnt] = menu_tile[cnt];
}
/* initialization */
InitAppTiles();
/* set app tiles */
- ret = SetAppTiles();
- if(ret != ICO_OK){
- ICO_ERR("CicoHSMenuWindow::RenewAppTiles: could not make tiles.");
- }
+ SetAppTiles();
/* update app info list */
CicoHomeScreen::RenewAppInfoList();
if (menu_tile[cnt] == NULL) {
continue;
}
- for (cnt2=0; cnt2 < all_tile_num_org; cnt2++) {
+ for (cnt2 = 0; cnt2 < all_tile_num_org; cnt2++) {
if (menu_tile_org[cnt2] == NULL) {
continue;
}
if (strncmp(menu_tile[cnt]->GetAppId(),
menu_tile_org[cnt2]->GetAppId(), ICO_HS_MAX_PROCESS_NAME) == 0) {
- menu_tile[cnt]->SetOrgThumbnail( menu_tile_org[cnt2] );
+ // if same appid, a tile object is changed to an original thing
+ menu_tile[cnt]->SetOrgThumbnail(menu_tile_org[cnt2]);
break;
}
}
}
- /* free org app tiles */
- for (cnt2=0; cnt2 < all_tile_num_org; cnt2++) {
+ /* free original app tiles */
+ for (cnt2 = 0; cnt2 < all_tile_num_org; cnt2++) {
if (menu_tile_org[cnt2] == NULL) {
continue;
}
delete menu_tile_org[cnt2];
}
+ // restore current page
+ if (current_page_org < all_page_num) {
+ for (cnt = 0; cnt < all_category_num; cnt++) {
+ if (current_page_org == category_info[cnt].page) {
+ break;
+ }
+ }
+ if (cnt < all_category_num) {
+ if (subcurrent_page_org >= category_info[cnt].subpage_max) {
+ subcurrent_page_org = 0;
+ }
+ }
+ else {
+ current_page_org = 0;
+ subcurrent_page_org = 0;
+ }
+ }
+ else {
+ current_page_org = 0;
+ subcurrent_page_org = 0;
+ }
+ ICO_TRA("CicoHSMenuWindow::RenewAppTiles page change %d/%d->%d/%d",
+ current_page, subcurrent_page, current_page_org, subcurrent_page_org);
+
+ // update the menu currently displayed
+ /* page pointer */
+ char img_path[ICO_HS_MAX_PATH_BUFF_LEN];
+ snprintf(img_path, sizeof(img_path), "%s%s",
+ img_dir_path, ICO_HS_IMAGE_FILE_MENU_PAGEPOINTER_N);
+ evas_object_image_file_set(page_pointer[current_page], img_path, NULL);
+
+ current_page = current_page_org;
+ subcurrent_page = subcurrent_page_org;
+ snprintf(img_path, sizeof(img_path), "%s%s",
+ img_dir_path, ICO_HS_IMAGE_FILE_MENU_PAGEPOINTER_P);
+ evas_object_image_file_set(page_pointer[current_page_org], img_path, NULL);
+
+ current_page = current_page_org;
+ subcurrent_page = subcurrent_page_org;
+
+ /* display cursor */
+ DspCtrlPageCursor();
+
+ /*tile*/
+ for (cnt = 0;cnt < menu_window_instance->all_tile_num; cnt++) {
+ if (menu_window_instance->menu_tile[cnt] == NULL) {
+ continue;
+ }
+ if ((menu_window_instance->menu_tile[cnt]->GetPage() != current_page) ||
+ (menu_window_instance->menu_tile[cnt]->GetSubPage() != subcurrent_page)) {
+ menu_window_instance->menu_tile[cnt]->
+ OffsetMove(-menu_window_instance->width, 0);
+ }
+ else {
+ menu_window_instance->menu_tile[cnt]->OffsetMove(0, 0);
+ }
+ }
ICO_TRA("CicoHSMenuWindow::RenewAppTiles Leave");
}
return ICO_ERROR;
}
/* App tiles*/
- ret = SetAppTiles();
- if(ret != ICO_OK){
- ICO_ERR("CicoHSMenuWindow::CreateMenuWindow: could not make tiles.");
- FreeMenuBack();
- FreeWindow();
- return ICO_ERROR;
- }
+ SetAppTiles();
/* Page Pointer */
ret = SetPagePointer();