wgui_datetime.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:498k
源码类别:
MTK
开发平台:
C/C++
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- // color c=gui_color(255,255,255);
- //PMT DLT_FIXES - TK 200603225 END
- gdi_layer_reset_clip();
- gui_fill_rectangle(x1, y1, x2, y2, c);
- }
- #ifdef __MMI_UI_TECHNO_IDLESCREEN_BAR__
- extern S32 MAIN_LCD_device_width;
- #endif
- #define DT_DISPLAY_GAP 1
- U8 enable_main_LCD_date_time_display = 1;
- U8 enable_sub_LCD_date_time_display = 1;
- //KP Jerry add on 2007-3-27 start
- #ifdef __MMI_IDLE_SHOW_TIME_WITH_IMAGE__
- S32 get_image_from_numberID(U8 number)
- {
- S32 imageID;
- switch (number)
- {
- case 0:
- imageID = IMG_TECHNO_DIGITAL_CLOCK_TIME_0;
- break;
- case 1:
- imageID = IMG_TECHNO_DIGITAL_CLOCK_TIME_1;
- break;
- case 2:
- imageID = IMG_TECHNO_DIGITAL_CLOCK_TIME_2;
- break;
- case 3:
- imageID = IMG_TECHNO_DIGITAL_CLOCK_TIME_3;
- break;
- case 4:
- imageID = IMG_TECHNO_DIGITAL_CLOCK_TIME_4;
- break;
- case 5:
- imageID = IMG_TECHNO_DIGITAL_CLOCK_TIME_5;
- break;
- case 6:
- imageID = IMG_TECHNO_DIGITAL_CLOCK_TIME_6;
- break;
- case 7:
- imageID = IMG_TECHNO_DIGITAL_CLOCK_TIME_7;
- break;
- case 8:
- imageID = IMG_TECHNO_DIGITAL_CLOCK_TIME_8;
- break;
- case 9:
- imageID = IMG_TECHNO_DIGITAL_CLOCK_TIME_9;
- break;
- default:
- break;
- }
- return imageID;
- }
- void show_main_LCD_idle_time_with_image(UI_time *t)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 hours, minutes;
- S32 h, w, x, y;
- S32 show_imageID;
- U8 numberID;
- gui_measure_image(get_image(IMG_TECHNO_DIGITAL_CLOCK_TIME_0), &w, &h);
- gui_push_clip();
- x = MMI_SIGNAL_WIDTH;
- y = MMI_status_bar_height + (MMI_IDLESCREEN_BAR_HEIGHT >> 1) - (h >> 1);
- gui_set_clip(x,y,x+w*6+18,y+h+5);
- wgui_hide_background_with_wallpaper(x, y, x+w*6+18, y+h+5);
- hours = get_hours(t);
- if (!PhnsetGetTimeFormat()) /* get current time format */
- {
- if(hours==0)
- hours = 12;
- if(hours>12)
- hours -= 12;
- }
- //显示小时的 十位数
- numberID = hours/10;
- show_imageID = get_image_from_numberID(numberID);
- gui_show_image(x,y , get_image(show_imageID));
- //显示小时的个位数
- numberID = hours%10;
- show_imageID = get_image_from_numberID(numberID);
- gui_show_image(x+w+2,y , get_image(show_imageID));
- //显示冒号
- gui_show_image(x+w*2+5,y , get_image(IMG_TECHNO_DIGITAL_CLOCK_TIME_FLAG));
- minutes = get_minutes(t);
- //显示分钟的十位数
- numberID = minutes/10;
- show_imageID = get_image_from_numberID(numberID);
- gui_show_image(x+w*3+2,y , get_image(show_imageID));
- //显示分钟的个位数
- numberID = minutes%10;
- show_imageID = get_image_from_numberID(numberID);
- gui_show_image(x+w*4+2,y , get_image(show_imageID));
- //当时间格式为12小时制时 显示AM 或PM
- if (!PhnsetGetTimeFormat()) /* get current time format */
- {
- hours = get_hours(t);
- if (hours == 12)
- {
- gui_show_image(x+w*5+4,y+h/2, get_image(IMG_TECHNO_DIGITAL_CLOCK_TIME_PM));
- }
- else if (hours == 0)
- {
- gui_show_image(x+w*5+2,y , get_image(IMG_TECHNO_DIGITAL_CLOCK_TIME_AM));
- }
- else if (hours > 12)
- {
- gui_show_image(x+w*5+4,y+h/2 , get_image(IMG_TECHNO_DIGITAL_CLOCK_TIME_PM));
- }
- else
- {
- gui_show_image(x+w*5+2,y, get_image(IMG_TECHNO_DIGITAL_CLOCK_TIME_AM));
- }
- }
- gui_pop_clip();
- }
- #endif/*__MMI_IDLE_SHOW_TIME_WITH_IMAGE__*/
- //KP Jerry add on 2007-3-27 end
- /*****************************************************************************
- * FUNCTION
- * show_main_LCD_date_time
- * DESCRIPTION
- * show upadte date time on main lcd /sub lcd depend on the
- * current date flag
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void show_main_LCD_date_time(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 h, w, x, y;
- UI_character_type s[64];
- S32 x1, y1, x2, y2;
- bitmap *saved_graphics_context = current_LCD_device_bitmap;
- S32 old_x1, old_y1, old_x2, old_y2;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (main_lcd_update_date_time == MMI_FALSE)
- {
- return;
- }
- UI_set_main_LCD_graphics_context();
- old_x1 =
- (main_LCD_dt_object.time.x < main_LCD_dt_object.date.x) ? main_LCD_dt_object.time.x : main_LCD_dt_object.date.x;
- old_y1 =
- (main_LCD_dt_object.time.y < main_LCD_dt_object.date.y) ? main_LCD_dt_object.time.y : main_LCD_dt_object.date.y;
- old_x2 =
- (main_LCD_dt_object.time.x + main_LCD_dt_object.time.width >
- main_LCD_dt_object.date.x + main_LCD_dt_object.date.width) ? main_LCD_dt_object.time.x +
- main_LCD_dt_object.time.width : main_LCD_dt_object.date.x + main_LCD_dt_object.date.width;
- old_y2 =
- (main_LCD_dt_object.time.y + main_LCD_dt_object.time.height >
- main_LCD_dt_object.date.y + main_LCD_dt_object.date.height) ? main_LCD_dt_object.time.y +
- main_LCD_dt_object.time.height : main_LCD_dt_object.date.y + main_LCD_dt_object.date.height;
- gdi_layer_push_clip();
- gdi_layer_reset_clip();
- #ifdef __MMI_UI_TECHNO_IDLESCREEN_BAR__ //jerson add 20070605
- //KP Jerry add for recovery time display when exiting from stop-watch on 2007-1-8 start
- if(g_clock_type>1)
- {
- PhnsetReadIdleClockType();
- }
- //KP Jerry add for recovery time display when exiting from stop-watch on 2007-1-8 end
- #endif
- switch (main_LCD_dt_object.flags & DT_FLAGS_TYPE)
- {
- case DT_IDLE_SCREEN:
- {
- #ifdef __MMI_UI_TECHNO_IDLESCREEN_BAR__
- switch (g_clock_type)
- {
- case ANALOG:
- if (enable_main_LCD_date_time_display)
- {
- show_analog_clock();
- }
- break;
- case DIGITAL:
- #endif /* __MMI_UI_TECHNO_IDLESCREEN_BAR__ */
- //KP Jerry modify on 2007-3-27 start
- #if defined(__MMI_IDLE_SHOW_TIME_WITH_IMAGE__)
- show_main_LCD_idle_time_with_image(&main_LCD_dt_object.time.t);
- #else
- gui_set_font(main_LCD_dt_object.time.font);
- /* get current time in string format */
- time_string(&main_LCD_dt_object.time.t, (UI_string_type) s, main_LCD_dt_object.flags);
- /* calculate string width of time string */
- gui_measure_string(s, &w, &h);
- #ifdef __MMI_UI_TECHNO_IDLESCREEN_BAR__
- x = MMI_SIGNAL_WIDTH; //Old:x = ANALOG_BACKGROUND_X + (ANALOG_BACKGROUND_WIDTH >> 1) - (w >> 1); //KP Jerry modify for use dialing-font on 2006-11-30
- y = MMI_status_bar_height + (MMI_IDLESCREEN_BAR_HEIGHT >> 1) - (h >> 1)-20;
- #elif defined(__MMI_TOUCH_IDLESCREEN_SHORTCUTS__)
- /* change in value of y, when the __MMI_UI_TECHNO_IDLESCREEN_BAR__
- is not enabled and idlescreen shortcuts are enabled. */
- x = (UI_device_width >> 1) - (w >> 1);
- y = UI_device_height - max_touch_idle_screen_shortcut_height() - (h + (DT_DISPLAY_GAP << 1)) - 4;
- #elif defined(__MMI_UI_DALMATIAN_SOFTKEYS__)
- x = (UI_device_width >> 1) - (w >> 1);
- y = UI_device_height - MMI_button_bar_height - (h + (DT_DISPLAY_GAP << 1)) - 4;
- #else
- /* calculate start x ,y and end x,y position of time display string */
- x = (UI_device_width >> 1) - (w >> 1);
- y = UI_device_height - MMI_softkey_height - (h + (DT_DISPLAY_GAP << 1)) - 4;
- #endif
- x1 = main_LCD_dt_object.time.x = x;
- y1 = main_LCD_dt_object.time.y = y;
- main_LCD_dt_object.time.width = w + (DT_DISPLAY_GAP << 1);
- main_LCD_dt_object.time.height = h + (DT_DISPLAY_GAP << 1);
- if (enable_main_LCD_date_time_display)
- {
- gui_set_text_color(main_LCD_dt_object.time.text_color);
- gui_set_text_border_color(main_LCD_dt_object.time.text_border_color);
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(x + main_LCD_dt_object.time.width - 1, y + 1);
- }
- else
- {
- gui_move_text_cursor(x, y + 1);
- }
- x2 = x1 + main_LCD_dt_object.time.width - 1;
- y2 = y1 + main_LCD_dt_object.time.height - 1;
- #ifdef __MMI_UI_TECHNO_IDLESCREEN_BAR__
- gui_push_clip();//070306 Alpha layer
- gui_set_clip(
- ANALOG_BACKGROUND_X,
- ANALOG_BACKGROUND_Y,
- ANALOG_BACKGROUND_X + ANALOG_BACKGROUND_WIDTH - 1,
- ANALOG_BACKGROUND_Y + MMI_IDLESCREEN_BAR_HEIGHT - 1);
- //gui_show_image(ANALOG_BACKGROUND_X, ANALOG_BACKGROUND_Y, get_image(IMG_TECHNO_DIGITAL_CLOCK));
- gui_show_image(ANALOG_BACKGROUND_X, ANALOG_BACKGROUND_Y, get_image(IMG_TECHNO_DIGITAL_CLOCK)); //Old:gui_show_image(0, ANALOG_BACKGROUND_Y, get_image(IMG_TECHNO_DIGITAL_CLOCK)); //KP Jerry modify on 2007-3-8
- gui_pop_clip();
- #endif
- #ifdef __MMI_UI_DALMATIAN_IDLESCREEN__
- gui_set_text_clip(x1 - 1, y1, x2, y2);
- #else
- gui_set_text_clip(x1, y1, x2, y2);
- #endif
- gui_print_bordered_text(s);
- if (x1 < old_x1)
- {
- old_x1 = x1;
- }
- if (y1 < old_y1)
- {
- old_y1 = y1;
- }
- if (x2 > old_x2)
- {
- old_x2 = x2;
- }
- if (y2 > old_y2)
- {
- old_y2 = y2;
- }
- }
- #endif/*__MMI_IDLE_SHOW_TIME_WITH_IMAGE__*/
- //KP Jerry modify on 2007-3-27 end
- #ifdef __MMI_UI_TECHNO_IDLESCREEN_BAR__
- break;
- }
- show_main_LCD_day_display();//此函数显示星期几
- #endif /* __MMI_UI_TECHNO_IDLESCREEN_BAR__ */
- gui_set_font(main_LCD_dt_object.date.font);
- /* get current date in string format */
- date_string(&main_LCD_dt_object.date.t, (UI_string_type) s, main_LCD_dt_object.flags);
- /* calculate date string width */
- gui_measure_string(s, &w, &h);
- /* calculate start x,y and end x,y position of date string display */
- #ifdef __MMI_UI_TECHNO_IDLESCREEN_BAR__
- x = ((MAIN_LCD_device_width - MMI_SIGNAL_WIDTH - 2) - w);
- y = MMI_status_bar_height + (MMI_IDLESCREEN_BAR_HEIGHT >> 2) - (h >> 1);
- #else /* __MMI_UI_TECHNO_IDLESCREEN_BAR__ */
- x = (UI_device_width >> 1) - (w >> 1);
- y = y - main_LCD_dt_object.time.height;
- #endif /* __MMI_UI_TECHNO_IDLESCREEN_BAR__ */
- #ifdef __N95__
- x-=45;
- y+=8;
- #endif
- x1 = main_LCD_dt_object.date.x = x;
- y1 = main_LCD_dt_object.date.y = y;
- main_LCD_dt_object.date.width = w + (DT_DISPLAY_GAP << 1);
- main_LCD_dt_object.date.height = h + (DT_DISPLAY_GAP << 1);
- if (enable_main_LCD_date_time_display)
- {
- gui_set_text_color(main_LCD_dt_object.date.text_color);
- gui_set_text_border_color(main_LCD_dt_object.date.text_border_color);
- #ifdef __MMI_UI_DALMATIAN_IDLESCREEN__
- /* To avoid passing y+1 to the curser move function */
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(x + main_LCD_dt_object.date.width - 1, y);
- }
- else
- {
- gui_move_text_cursor(x, y);
- }
- #else /* __MMI_UI_DALMATIAN_IDLESCREEN__ */
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(x + main_LCD_dt_object.date.width - 1, y + 1);
- }
- else
- {
- gui_move_text_cursor(x, y + 1);
- }
- #endif /* __MMI_UI_DALMATIAN_IDLESCREEN__ */
- x2 = x1 + main_LCD_dt_object.date.width - 1;
- y2 = y1 + main_LCD_dt_object.date.height - 1;
- #ifdef __MMI_UI_DALMATIAN_IDLESCREEN__
- gui_set_clip(x1 - 1, y1 - 1, x2, y2);
- #else
- gui_set_clip(x1 - 1, y1 - 1, x2 + 1, y2 + 1);
- #endif
- #ifdef __MMI_UI_TECHNO_IDLESCREEN_BAR__
- gui_print_bordered_text(s); //Old:gui_print_text(s); //KP Jerry modify for full-transparent TECHNO_IDLESCREEN_BAR background on 2006-11-15
- #else
- gui_print_bordered_text(s);
- #endif
- #ifdef __MMI_UI_TECHNO_IDLESCREEN_BAR__
- #ifndef __N95__
- gdi_layer_blt_previous(ANALOG_BACKGROUND_X,ANALOG_BACKGROUND_Y,UI_device_width - MMI_SIGNAL_WIDTH - 1,
- MMI_status_bar_height + MMI_IDLESCREEN_BAR_HEIGHT - 1);
- #endif
- /* 020305 Calvin modified */
- #else /* __MMI_UI_TECHNO_IDLESCREEN_BAR__ */
- gdi_layer_blt_previous(x1 < old_x1 ? x1 : old_x1, y1 < old_y1 ? y1 : old_y1, x2 > old_x2 ? x2 : old_x2, y2 > old_y2 ? y2 : old_y2); /* 020305 Calvin modified */
- #endif /* __MMI_UI_TECHNO_IDLESCREEN_BAR__ */
- }
- if (enable_main_LCD_date_time_display)
- {
- dm_coordinates coordinates;
- coordinates.s16X = main_LCD_dt_object.time.x;
- coordinates.s16Y = main_LCD_dt_object.time.y;
- coordinates.s16Width = main_LCD_dt_object.time.width;
- coordinates.s16Height = main_LCD_dt_object.time.height;
- setup_previous_control(&coordinates);
- }
- }
- break;
- case DT_IDLE_SCREEN_2:
- {
- #define DT_SOFTKEY_GAP 2
- gui_set_font(main_LCD_dt_object.time.font);
- /* get current time in string format */
- time_string(&main_LCD_dt_object.time.t, (UI_string_type) s, main_LCD_dt_object.flags);
- /* calculate string width of time string */
- gui_measure_string(s, &w, &h);
- /* calculate start x ,y and end x,y position of time display string */
- x = DT_SOFTKEY_GAP;
- #ifdef __MMI_UI_STATUS_BAR_AT_BOTTOM__
- y = DT_DISPLAY_OFFSET_IN_STATUS_BAR_AT_BOTTOM;
- #else
- y = UI_device_height - MMI_button_bar_height - h - DT_SOFTKEY_GAP - 1;
- #endif
- x1 = main_LCD_dt_object.time.x = x;
- y1 = main_LCD_dt_object.time.y = y;
- main_LCD_dt_object.time.width = w + (DT_DISPLAY_GAP << 1);
- main_LCD_dt_object.time.height = h + (DT_DISPLAY_GAP << 1);
- if (enable_main_LCD_date_time_display)
- {
- gui_set_text_color(main_LCD_dt_object.time.text_color);
- gui_set_text_border_color(main_LCD_dt_object.time.text_border_color);
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(x + main_LCD_dt_object.time.width - 1, y + 1);
- }
- else
- {
- gui_move_text_cursor(x, y + 1);
- }
- x2 = x1 + main_LCD_dt_object.time.width - 1;
- y2 = y1 + main_LCD_dt_object.time.height - 1;
- gui_print_bordered_text(s);
- if (x1 < old_x1)
- {
- old_x1 = x1;
- }
- if (y1 < old_y1)
- {
- old_y1 = y1;
- }
- if (x2 > old_x2)
- {
- old_x2 = x2;
- }
- if (y2 > old_y2)
- {
- old_y2 = y2;
- }
- }
- gui_set_font(main_LCD_dt_object.date.font);
- #ifdef __MMI_UI_STATUS_BAR_AT_BOTTOM__
- main_LCD_dt_object.flags &= ~DT_IDLE_SCREEN_2;
- main_LCD_dt_object.flags |= DT_IDLE_SCREEN;
- #endif /* __MMI_UI_STATUS_BAR_AT_BOTTOM__ */
- /* get current date in string format */
- date_string(&main_LCD_dt_object.date.t, (UI_string_type) s, main_LCD_dt_object.flags);
- #ifdef __MMI_UI_STATUS_BAR_AT_BOTTOM__
- main_LCD_dt_object.flags &= ~DT_IDLE_SCREEN;
- main_LCD_dt_object.flags |= DT_IDLE_SCREEN_2;
- #endif /* __MMI_UI_STATUS_BAR_AT_BOTTOM__ */
- /* calculate date string width */
- gui_measure_string(s, &w, &h);
- /* calculate start x,y and end x,y position of date string display */
- x = UI_device_width - 1 - w - DT_SOFTKEY_GAP;
- #ifdef __MMI_UI_STATUS_BAR_AT_BOTTOM__
- y = DT_DISPLAY_OFFSET_IN_STATUS_BAR_AT_BOTTOM;
- #else
- y = UI_device_height - MMI_button_bar_height - h - DT_SOFTKEY_GAP - 1;
- #endif
- x1 = main_LCD_dt_object.date.x = x;
- y1 = main_LCD_dt_object.date.y = y;
- main_LCD_dt_object.date.width = w + (DT_DISPLAY_GAP << 1);
- main_LCD_dt_object.date.height = h + (DT_DISPLAY_GAP << 1);
- if (enable_main_LCD_date_time_display)
- {
- gui_set_text_color(main_LCD_dt_object.date.text_color);
- gui_set_text_border_color(main_LCD_dt_object.date.text_border_color);
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(x + main_LCD_dt_object.date.width - 1, y + 1);
- }
- else
- {
- gui_move_text_cursor(x, y + 1);
- }
- x2 = x1 + main_LCD_dt_object.date.width - 1;
- y2 = y1 + main_LCD_dt_object.date.height - 1;
- gui_print_bordered_text(s);
- gdi_layer_blt_previous(x1 < old_x1 ? x1 : old_x1, y1 < old_y1 ? y1 : old_y1, x2 > old_x2 ? x2 : old_x2, y2 > old_y2 ? y2 : old_y2); /* 020305 Calvin modified */
- }
- }
- break;
- case DT_NETWORK_SEARCH:
- {
- gui_set_font(main_LCD_dt_object.time.font);
- /* get current time in string format */
- time_string(&main_LCD_dt_object.time.t, (UI_string_type) s, main_LCD_dt_object.flags);
- gui_measure_string(s, &w, &h);
- x = (UI_device_width >> 1) - (w >> 1);
- #if defined(__MMI_UI_DALMATIAN_SOFTKEYS__) || defined(__MMI_UI_DALMATIAN_IDLESCREEN__)
- y = UI_device_height - MMI_button_bar_height - (h + (BAR_CONTENT_GAP));
- #else
- y = UI_device_height - MMI_softkey_height - (h + (DT_DISPLAY_GAP << 1)) - 1;
- #endif
- x1 = main_LCD_dt_object.time.x = x;
- y1 = main_LCD_dt_object.time.y = y;
- main_LCD_dt_object.time.width = w + (DT_DISPLAY_GAP << 1);
- main_LCD_dt_object.time.height = h + (DT_DISPLAY_GAP << 1);
- if (enable_main_LCD_date_time_display)
- {
- gui_set_text_color(main_LCD_dt_object.time.text_color);
- gui_set_text_border_color(main_LCD_dt_object.time.text_border_color);
- #ifdef __MMI_UI_DALMATIAN_IDLESCREEN__
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(x + main_LCD_dt_object.time.width - 1, y);
- }
- else
- {
- gui_move_text_cursor(x, y);
- }
- #else /* __MMI_UI_DALMATIAN_IDLESCREEN__ */
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(x + main_LCD_dt_object.time.width - 1, y + 1);
- }
- else
- {
- gui_move_text_cursor(x, y + 1);
- }
- #endif /* __MMI_UI_DALMATIAN_IDLESCREEN__ */
- x2 = x1 + main_LCD_dt_object.time.width - 1;
- y2 = y1 + main_LCD_dt_object.time.height - 1;
- #ifdef __MMI_UI_DALMATIAN_IDLESCREEN__
- gui_set_text_clip(x1 - 1, y1, x2, y2); /* For proper clipping of the text */
- #else
- gui_set_text_clip(x1, y1, x2, y2);
- #endif
- gui_print_bordered_text(s);
- if (x1 < old_x1)
- {
- old_x1 = x1;
- }
- if (y1 < old_y1)
- {
- old_y1 = y1;
- }
- if (x2 > old_x2)
- {
- old_x2 = x2;
- }
- if (y2 > old_y2)
- {
- old_y2 = y2;
- }
- }
- gui_set_font(main_LCD_dt_object.date.font);
- /* get date in string format */
- date_string(&main_LCD_dt_object.date.t, (UI_string_type) s, main_LCD_dt_object.flags);
- gui_measure_string(s, &w, &h);
- x = (UI_device_width >> 1) - (w >> 1);
- #if defined(__MMI_UI_DALMATIAN_SOFTKEYS__) || defined(__MMI_UI_DALMATIAN_IDLESCREEN__) || defined(__MMI_MAINLCD_128X128__)//060606 network search Calvin
- y = y - h - 1; /* to handle the font height change on dalmatian */
- #else
- y = y - main_LCD_dt_object.time.height;
- #endif
- x1 = main_LCD_dt_object.date.x = x;
- y1 = main_LCD_dt_object.date.y = y;
- main_LCD_dt_object.date.width = w + (DT_DISPLAY_GAP << 1);
- main_LCD_dt_object.date.height = h + (DT_DISPLAY_GAP << 1);
- if (enable_main_LCD_date_time_display)
- {
- gui_set_text_color(main_LCD_dt_object.date.text_color);
- gui_set_text_border_color(main_LCD_dt_object.date.text_border_color);
- #ifdef __MMI_UI_DALMATIAN_IDLESCREEN__
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(x + main_LCD_dt_object.date.width - 1, y);
- }
- else
- {
- gui_move_text_cursor(x, y);
- }
- #else /* __MMI_UI_DALMATIAN_IDLESCREEN__ */
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(x + main_LCD_dt_object.date.width - 1, y + 1);
- }
- else
- {
- gui_move_text_cursor(x, y + 1);
- }
- #endif /* __MMI_UI_DALMATIAN_IDLESCREEN__ */
- x2 = x1 + main_LCD_dt_object.date.width - 1;
- y2 = y1 + main_LCD_dt_object.date.height - 1;
- #ifdef __MMI_UI_DALMATIAN_IDLESCREEN__
- gui_set_text_clip(x1 - 1, y1, x2, y2);
- #else
- gui_set_text_clip(x1, y1, x2, y2);
- #endif
- gui_print_bordered_text(s);
- gdi_layer_blt_previous(
- x1 < old_x1 ? x1 : old_x1,
- y1 < old_y1 ? y1 : old_y1,
- x2 > old_x2 ? x2 : old_x2,
- y2 > old_y2 ? y2 : old_y2);
- }
- if (enable_main_LCD_date_time_display)
- {
- dm_coordinates coordinates;
- coordinates.s16X = main_LCD_dt_object.time.x;
- coordinates.s16Y = main_LCD_dt_object.time.y;
- coordinates.s16Width = main_LCD_dt_object.time.width;
- coordinates.s16Height = main_LCD_dt_object.time.height;
- setup_previous_control(&coordinates);
- }
- }
- break;
- case DT_MO_CALL_SCREEN:
- case DT_MO_CALLING_SCREEN:
- {
- y = MMI_status_bar_height;
- gui_set_font(main_LCD_dt_object.date.font);
- /* get current date in string format */
- date_string(&main_LCD_dt_object.date.t, (UI_string_type) s, main_LCD_dt_object.flags);
- gui_measure_string(s, &w, &h);
- x = 2;
- x1 = main_LCD_dt_object.date.x = x;
- y1 = main_LCD_dt_object.date.y = y;
- main_LCD_dt_object.date.width = w;
- main_LCD_dt_object.date.height = h;
- if (enable_main_LCD_date_time_display)
- {
- gui_set_text_color(main_LCD_dt_object.date.text_color);
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(x + main_LCD_dt_object.date.width - 1, y);
- }
- else
- {
- gui_move_text_cursor(x, y);
- }
- x2 = x1 + main_LCD_dt_object.date.width - 1;
- y2 = y1 + main_LCD_dt_object.date.height - 1;
- /* print current date */
- gui_print_text(s);
- if (x1 < old_x1)
- {
- old_x1 = x1;
- }
- if (y1 < old_y1)
- {
- old_y1 = y1;
- }
- if (x2 > old_x2)
- {
- old_x2 = x2;
- }
- if (y2 > old_y2)
- {
- old_y2 = y2;
- }
- }
- gui_set_font(main_LCD_dt_object.time.font);
- x = 2;
- y = y + h;
- time_string(&main_LCD_dt_object.time.t, (UI_string_type) s, main_LCD_dt_object.flags);
- gui_measure_string(s, &w, &h);
- /* get current tiem in string format */
- x1 = main_LCD_dt_object.time.x = x;
- y1 = main_LCD_dt_object.time.y = y;
- main_LCD_dt_object.time.width = w;
- main_LCD_dt_object.time.height = h;
- if (enable_main_LCD_date_time_display)
- {
- gui_set_text_color(main_LCD_dt_object.time.text_color);
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(x + main_LCD_dt_object.time.width - 1, y);
- }
- else
- {
- gui_move_text_cursor(x, y);
- }
- x2 = x1 + main_LCD_dt_object.time.width - 1;
- y2 = y1 + main_LCD_dt_object.time.height - 1;
- gui_set_text_clip(x1, y1, x2, y2);
- /* print time */
- gui_print_text(s);
- gdi_layer_blt_previous(
- x1 < old_x1 ? x1 : old_x1,
- y1 < old_y1 ? y1 : old_y1,
- x2 > old_x2 ? x2 : old_x2,
- y2 > old_y2 ? y2 : old_y2);
- }
- if (enable_main_LCD_date_time_display)
- {
- dm_coordinates coordinates;
- coordinates.s16X = main_LCD_dt_object.time.x;
- coordinates.s16Y = main_LCD_dt_object.time.y;
- coordinates.s16Width = main_LCD_dt_object.time.width;
- coordinates.s16Height = main_LCD_dt_object.time.height;
- setup_previous_control(&coordinates);
- }
- }
- break;
- case DT_MT_CALL_SCREEN:
- {
- y = (MMI_title_y + MMI_title_height);
- #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
- y = MMI_status_bar_height;
- #endif
- gui_set_font(main_LCD_dt_object.date.font);
- /* get current date in string format */
- date_string(&main_LCD_dt_object.date.t, (UI_string_type) s, main_LCD_dt_object.flags);
- gui_measure_string(s, &w, &h);
- x = 2;
- x1 = main_LCD_dt_object.date.x = x;
- y1 = main_LCD_dt_object.date.y = y;
- main_LCD_dt_object.date.width = w;
- main_LCD_dt_object.date.height = h;
- if (enable_main_LCD_date_time_display)
- {
- gui_set_text_color(main_LCD_dt_object.date.text_color);
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(x + main_LCD_dt_object.date.width - 1, y);
- }
- else
- {
- gui_move_text_cursor(x, y);
- }
- x2 = x1 + main_LCD_dt_object.date.width - 1;
- y2 = y1 + main_LCD_dt_object.date.height - 1;
- /* print date */
- gui_print_text(s);
- if (x1 < old_x1)
- {
- old_x1 = x1;
- }
- if (y1 < old_y1)
- {
- old_y1 = y1;
- }
- if (x2 > old_x2)
- {
- old_x2 = x2;
- }
- if (y2 > old_y2)
- {
- old_y2 = y2;
- }
- }
- gui_set_font(main_LCD_dt_object.time.font);
- time_string(&main_LCD_dt_object.time.t, (UI_string_type) s, main_LCD_dt_object.flags);
- gui_measure_string(s, &w, &h);
- x = 2;
- y = y + h;
- /* get current time in string format */
- x1 = main_LCD_dt_object.time.x = x;
- y1 = main_LCD_dt_object.time.y = y;
- main_LCD_dt_object.time.width = w;
- main_LCD_dt_object.time.height = h;
- if (enable_main_LCD_date_time_display)
- {
- gui_set_text_color(main_LCD_dt_object.time.text_color);
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(x + main_LCD_dt_object.time.width - 1, y);
- }
- else
- {
- gui_move_text_cursor(x, y);
- }
- x2 = x1 + main_LCD_dt_object.time.width - 1;
- y2 = y1 + main_LCD_dt_object.time.height - 1;
- /* print time */
- gui_print_text(s);
- gdi_layer_blt_previous(
- x1 < old_x1 ? x1 : old_x1,
- y1 < old_y1 ? y1 : old_y1,
- x2 > old_x2 ? x2 : old_x2,
- y2 > old_y2 ? y2 : old_y2);
- }
- if (enable_main_LCD_date_time_display)
- {
- dm_coordinates coordinates;
- coordinates.s16X = main_LCD_dt_object.time.x;
- coordinates.s16Y = main_LCD_dt_object.time.y;
- coordinates.s16Width = main_LCD_dt_object.time.width;
- coordinates.s16Height = main_LCD_dt_object.time.height;
- setup_previous_control(&coordinates);
- }
- }
- break;
- case DT_TABBED_CALL_SCREEN:
- case DT_ACTIVE_CALL_SCREEN:
- {
- if ((main_LCD_dt_object.flags & DT_FLAGS_TYPE) == DT_ACTIVE_CALL_SCREEN)//080106 active call
- {
- y = MMI_status_bar_height;
- }
- else
- {
- y = MMI_CONTENT_Y + MMI_HORIZONTAL_TAB_BAR_TAB_AREA_HEIGHT + MMI_HORIZONTAL_TAB_BAR_HINT_AREA_HEIGHT -
- MMI_TITLE_HEIGHT;
- }
- gui_set_font(main_LCD_dt_object.date.font);
- /* get current date in string format */
- date_string(&main_LCD_dt_object.date.t, (UI_string_type) s, main_LCD_dt_object.flags);
- gui_measure_string(s, &w, &h);
- x = 2;
- x1 = main_LCD_dt_object.date.x = x;
- y1 = main_LCD_dt_object.date.y = y;
- main_LCD_dt_object.date.width = w;
- main_LCD_dt_object.date.height = h;
- if (enable_main_LCD_date_time_display)
- {
- gui_set_text_color(main_LCD_dt_object.date.text_color);
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(x + main_LCD_dt_object.date.width - 1, y);
- }
- else
- {
- gui_move_text_cursor(x, y);
- }
- x2 = UI_device_width - 1;
- y2 = y1 + main_LCD_dt_object.date.height - 1;
- /* print date */
- gui_print_text(s);
- if (x1 < old_x1)
- {
- old_x1 = x1;
- }
- if (y1 < old_y1)
- {
- old_y1 = y1;
- }
- if (x2 > old_x2)
- {
- old_x2 = x2;
- }
- if (y2 > old_y2)
- {
- old_y2 = y2;
- }
- }
- gui_set_font(main_LCD_dt_object.time.font);
- /* get current time in string format */
- time_string(&main_LCD_dt_object.time.t, (UI_string_type) s, main_LCD_dt_object.flags);
- gui_measure_string(s, &w, &h);
- x = 2;
- y = y + h;
- x1 = main_LCD_dt_object.time.x = x;
- y1 = main_LCD_dt_object.time.y = y;
- main_LCD_dt_object.time.width = w;
- main_LCD_dt_object.time.height = h;
- if (enable_main_LCD_date_time_display)
- {
- gui_set_text_color(main_LCD_dt_object.time.text_color);
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(x + main_LCD_dt_object.time.width - 1, y);
- }
- else
- {
- gui_move_text_cursor(x, y);
- }
- x2 = x1 + main_LCD_dt_object.time.width - 1;
- y2 = y1 + main_LCD_dt_object.time.height - 1;
- /* print time */
- gui_print_text(s);
- gdi_layer_blt_previous(
- x1 < old_x1 ? x1 : old_x1,
- y1 < old_y1 ? y1 : old_y1,
- x2 > old_x2 ? x2 : old_x2,
- y2 > old_y2 ? y2 : old_y2);
- }
- if (!(FALSE == GetCallTimeDisplay()))
- {
- gui_set_font(main_LCD_dt_object.duration.font);
- x = 2;
- y = y + h;
- /* get call duration in string format */
- duration_string(&main_LCD_dt_object.duration.t, (UI_string_type) s, main_LCD_dt_object.flags);
- gui_measure_string(s, &w, &h);
- x1 = main_LCD_dt_object.duration.x = x;
- y1 = main_LCD_dt_object.duration.y = y;
- main_LCD_dt_object.duration.width = (UI_device_width >> 1) + 16;
- main_LCD_dt_object.duration.height = h;
- if (enable_main_LCD_date_time_display)
- {
- gui_set_text_color(main_LCD_dt_object.duration.text_color);
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(x + w - 1, y);
- }
- else
- {
- gui_move_text_cursor(x, y);
- }
- x2 = x1 + main_LCD_dt_object.duration.width - 1;
- y2 = y1 + main_LCD_dt_object.duration.height - 1;
- /* display call duration in active acll screen */
- gui_print_text(s);
- gdi_layer_blt_previous(
- x1 < old_x1 ? x1 : old_x1,
- y1 < old_y1 ? y1 : old_y1,
- x2 > old_x2 ? x2 : old_x2,
- y2 > old_y2 ? y2 : old_y2);
- }
- }
- else
- {
- y = y + h;
- x1 = main_LCD_dt_object.duration.x = x;
- if (GetTotalActiveCallCount() + GetTotalHoldCallCount() != 1)
- {
- y1 = main_LCD_dt_object.duration.y = main_LCD_dt_object.date.y + main_LCD_dt_object.date.height;
- }
- else
- {
- y1 = main_LCD_dt_object.duration.y = y;
- }
- main_LCD_dt_object.duration.width = (UI_device_width >> 1) + 16;
- main_LCD_dt_object.duration.height = h;
- }
- if (enable_main_LCD_date_time_display)
- {
- dm_coordinates coordinates;
- coordinates.s16X = main_LCD_dt_object.duration.x;
- coordinates.s16Y = main_LCD_dt_object.duration.y;
- coordinates.s16Width = main_LCD_dt_object.duration.width;
- coordinates.s16Height = main_LCD_dt_object.duration.height;
- setup_previous_control(&coordinates);
- }
- }
- break;
- case DT_DIGITAL_CLOCK_SC1:
- {
- gui_set_font(main_LCD_dt_object.time.font);
- /* get current tiem in string format */
- time_string(&main_LCD_dt_object.time.t, (UI_string_type) s, main_LCD_dt_object.flags);
- gui_measure_string(s, &w, &h);
- x = (UI_device_width >> 1) - (w >> 1);
- y = (UI_device_height >> 1) - (h >> 1);
- x1 = main_LCD_dt_object.time.x = x;
- y1 = main_LCD_dt_object.time.y = y;
- main_LCD_dt_object.time.width = w + (DT_DISPLAY_GAP << 1);
- main_LCD_dt_object.time.height = h + (DT_DISPLAY_GAP << 1);
- if (enable_main_LCD_date_time_display)
- {
- gui_set_text_color(main_LCD_dt_object.time.text_color);
- gui_set_text_border_color(main_LCD_dt_object.time.text_border_color);
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(x + main_LCD_dt_object.time.width - 1, y + 1);
- }
- else
- {
- gui_move_text_cursor(x, y + 1);
- }
- x2 = x1 + main_LCD_dt_object.time.width - 1;
- y2 = y1 + main_LCD_dt_object.time.height - 1;
- #ifdef __MMI_UI_DALMATIAN_IDLESCREEN__
- gui_set_text_clip(x1 - 1, y1, x2, y2);
- #else
- gui_set_text_clip(x1, y1, x2, y2);
- #endif
- /* print time */
- gui_print_bordered_text(s);
- if (show_date == 0)
- {
- if (x1 < old_x1)
- {
- old_x1 = x1;
- }
- if (y1 < old_y1)
- {
- old_y1 = y1;
- }
- if (x2 > old_x2)
- {
- old_x2 = x2;
- }
- if (y2 > old_y2)
- {
- old_y2 = y2;
- }
- }
- else
- {
- gdi_layer_blt_previous(
- x1 < old_x1 ? x1 : old_x1,
- y1 < old_y1 ? y1 : old_y1,
- x2 > old_x2 ? x2 : old_x2,
- y2 > old_y2 ? y2 : old_y2);
- }
- }
- if (show_date == 0) /* if display date time is enable */
- {
- gui_set_font(main_LCD_dt_object.date.font);
- /* get current date in string format */
- date_string(&main_LCD_dt_object.date.t, (UI_string_type) s, main_LCD_dt_object.flags);
- gui_measure_string(s, &w, &h);
- x = (UI_device_width >> 1) - (w >> 1);
- #ifdef __MMI_UI_STATUS_BAR_AT_BOTTOM__
- if (is_on_idlescreen())
- {
- y = DT_DISPLAY_OFFSET_IN_STATUS_BAR_AT_BOTTOM;
- }
- else
- #endif /* __MMI_UI_STATUS_BAR_AT_BOTTOM__ */
- #if defined(__MMI_TOUCH_IDLESCREEN_SHORTCUTS__)
- /* change in value of y, when idlescreen shortcuts are enabled. */
- y = UI_device_height - max_touch_idle_screen_shortcut_height() - h - 4;
- #else /* defined(__MMI_TOUCH_IDLESCREEN_SHORTCUTS__) */
- y = UI_device_height - MMI_button_bar_height - h - 4;
- #endif /* defined(__MMI_TOUCH_IDLESCREEN_SHORTCUTS__) */
- x1 = main_LCD_dt_object.date.x = x;
- y1 = main_LCD_dt_object.date.y = y;
- main_LCD_dt_object.date.width = w + (DT_DISPLAY_GAP << 1);
- main_LCD_dt_object.date.height = h + (DT_DISPLAY_GAP << 1);
- if (enable_main_LCD_date_time_display)
- {
- gui_set_text_color(main_LCD_dt_object.date.text_color);
- gui_set_text_border_color(main_LCD_dt_object.date.text_border_color);
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(x + main_LCD_dt_object.date.width - 1, y + 1);
- }
- else
- {
- gui_move_text_cursor(x, y + 1);
- }
- x2 = x1 + main_LCD_dt_object.date.width - 1;
- y2 = y1 + main_LCD_dt_object.date.height - 1;
- #ifdef __MMI_UI_DALMATIAN_IDLESCREEN__
- gui_set_text_clip(x1 - 1, y1, x2, y2);
- #else
- gui_set_text_clip(x1, y1, x2, y2);
- #endif
- /* print date */
- gui_print_bordered_text(s);
- gdi_layer_blt_previous(
- x1 < old_x1 ? x1 : old_x1,
- y1 < old_y1 ? y1 : old_y1,
- x2 > old_x2 ? x2 : old_x2,
- y2 > old_y2 ? y2 : old_y2);
- }
- } /* show_date == 0 */
- #ifdef __MMI_UI_STATUS_BAR_AT_BOTTOM__
- if (is_on_idlescreen())
- {
- gdi_layer_push_clip();
- gui_set_clip(
- 0,
- 0,
- UI_device_width - 1,
- UI_device_height - 1 - MMI_button_bar_height - MMI_status_bar_height - 2 - 1);
- show_boundries_to_status_bar_at_bottom_idlescreen();
- gdi_layer_pop_clip();
- gdi_layer_blt_previous(
- 0,
- 0,
- (UI_device_width - 1),
- (UI_device_height - 1 - MMI_button_bar_height - MMI_status_bar_height - 1 - 2));
- }
- #endif /* __MMI_UI_STATUS_BAR_AT_BOTTOM__ */
- if (enable_main_LCD_date_time_display)
- {
- dm_coordinates coordinates;
- if (show_date == 0)
- {
- coordinates.s16X = main_LCD_dt_object.date.x;
- coordinates.s16Y = main_LCD_dt_object.date.y;
- coordinates.s16Width = main_LCD_dt_object.date.width;
- coordinates.s16Height = main_LCD_dt_object.date.height;
- setup_previous_control(&coordinates);
- }
- else
- {
- coordinates.s16X = main_LCD_dt_object.time.x;
- coordinates.s16Y = main_LCD_dt_object.time.y;
- coordinates.s16Width = main_LCD_dt_object.time.width;
- coordinates.s16Height = main_LCD_dt_object.time.height;
- setup_previous_control(&coordinates);
- }
- }
- }
- break;
- case DT_DIGITAL_CLOCK_SC2:
- {
- gui_set_font(main_LCD_dt_object.date.font);
- /* get current date in string format */
- date_string(&main_LCD_dt_object.date.t, (UI_string_type) s, main_LCD_dt_object.flags);
- gui_measure_string(s, &w, &h);
- x = (UI_device_width >> 1) - (w >> 1);
- #ifdef __MMI_UI_STATUS_BAR_AT_BOTTOM__
- if (is_on_idlescreen())
- {
- y = DT_DISPLAY_OFFSET_IN_STATUS_BAR_AT_BOTTOM;
- }
- else
- #endif /* __MMI_UI_STATUS_BAR_AT_BOTTOM__ */
- y = UI_device_height - MMI_button_bar_height - (h + (DT_DISPLAY_GAP << 1)) - 4;
- x1 = main_LCD_dt_object.date.x = x;
- y1 = main_LCD_dt_object.date.y = y;
- main_LCD_dt_object.date.width = w + (DT_DISPLAY_GAP << 1);
- main_LCD_dt_object.date.height = h + (DT_DISPLAY_GAP << 1);
- if (enable_main_LCD_date_time_display)
- {
- gui_set_text_color(main_LCD_dt_object.date.text_color);
- gui_set_text_border_color(main_LCD_dt_object.date.text_border_color);
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(x + main_LCD_dt_object.date.width - 1, y + 1);
- }
- else
- {
- gui_move_text_cursor(x, y + 1);
- }
- x2 = x1 + main_LCD_dt_object.date.width - 1;
- y2 = y1 + main_LCD_dt_object.date.height - 1;
- /* print date */
- gui_print_bordered_text(s);
- gdi_layer_blt_previous(
- x1 < old_x1 ? x1 : old_x1,
- y1 < old_y1 ? y1 : old_y1,
- x2 > old_x2 ? x2 : old_x2,
- y2 > old_y2 ? y2 : old_y2);
- }
- #ifdef __MMI_UI_STATUS_BAR_AT_BOTTOM__
- if (is_on_idlescreen())
- {
- gdi_layer_push_clip();
- gui_set_clip(
- 0,
- 0,
- UI_device_width - 1,
- UI_device_height - 1 - MMI_button_bar_height - MMI_status_bar_height - 2 - 1);
- show_boundries_to_status_bar_at_bottom_idlescreen();
- gdi_layer_pop_clip();
- gdi_layer_blt_previous(
- 0,
- 0,
- (UI_device_width - 1),
- (UI_device_height - 1 - MMI_button_bar_height - MMI_status_bar_height - 1 - 2));
- }
- #endif /* __MMI_UI_STATUS_BAR_AT_BOTTOM__ */
- if (enable_main_LCD_date_time_display)
- {
- dm_coordinates coordinates;
- coordinates.s16X = main_LCD_dt_object.date.x;
- coordinates.s16Y = main_LCD_dt_object.date.y;
- coordinates.s16Width = main_LCD_dt_object.date.width;
- coordinates.s16Height = main_LCD_dt_object.date.height;
- setup_previous_control(&coordinates);
- }
- }
- break;
- case DT_DIGITAL_CLOCK_SC3:
- {
- gui_set_font(main_LCD_dt_object.time.font);
- /* get time in string format */
- time_string(&main_LCD_dt_object.time.t, (UI_string_type) s, main_LCD_dt_object.flags);
- gui_measure_string(s, &w, &h);
- x = (UI_device_width >> 1) - (w >> 1);
- y = (UI_device_height >> 1) - (h >> 1);
- x1 = main_LCD_dt_object.time.x = x;
- y1 = main_LCD_dt_object.time.y = y;
- main_LCD_dt_object.time.width = w + (DT_DISPLAY_GAP << 1);
- main_LCD_dt_object.time.height = h + (DT_DISPLAY_GAP << 1);
- if (enable_main_LCD_date_time_display)
- {
- gui_set_text_color(main_LCD_dt_object.time.text_color);
- gui_set_text_border_color(main_LCD_dt_object.time.text_border_color);
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(x + main_LCD_dt_object.time.width - 1, y + 1);
- }
- else
- {
- gui_move_text_cursor(x, y + 1);
- }
- x2 = x1 + main_LCD_dt_object.time.width - 1;
- y2 = y1 + main_LCD_dt_object.time.height - 1;
- /* print time */
- gui_print_bordered_text(s);
- gdi_layer_blt_previous(
- x1 < old_x1 ? x1 : old_x1,
- y1 < old_y1 ? y1 : old_y1,
- x2 > old_x2 ? x2 : old_x2,
- y2 > old_y2 ? y2 : old_y2);
- }
- #ifdef __MMI_UI_STATUS_BAR_AT_BOTTOM__
- if (is_on_idlescreen())
- {
- gdi_layer_push_clip();
- gdi_layer_set_clip(
- 0,
- 0,
- UI_device_width - 1,
- UI_device_height - 1 - MMI_button_bar_height - MMI_status_bar_height - 2 - 1);
- show_boundries_to_status_bar_at_bottom_idlescreen();
- gdi_layer_pop_clip();
- gdi_layer_blt_previous(
- 0,
- 0,
- (UI_device_width - 1),
- (UI_device_height - 1 - MMI_button_bar_height - MMI_status_bar_height - 1 - 2));
- }
- #endif /* __MMI_UI_STATUS_BAR_AT_BOTTOM__ */
- if (enable_main_LCD_date_time_display)
- {
- dm_coordinates coordinates;
- coordinates.s16X = main_LCD_dt_object.time.x;
- coordinates.s16Y = main_LCD_dt_object.time.y;
- coordinates.s16Width = main_LCD_dt_object.time.width;
- coordinates.s16Height = main_LCD_dt_object.time.height;
- setup_previous_control(&coordinates);
- }
- }
- break;
- #ifdef __MMI_ANALOG_CLOCK__
- case DT_ANALOG_CLOCK_SC:
- {
- #ifdef __MMI_UI_STATUS_BAR_AT_BOTTOM__
- if (is_on_idlescreen())
- {
- gdi_layer_push_clip();
- gui_set_clip(
- 0,
- 0,
- UI_device_width - 1,
- UI_device_height - 1 - MMI_button_bar_height - MMI_status_bar_height - 2 - 1);
- }
- #endif /* __MMI_UI_STATUS_BAR_AT_BOTTOM__ */
- if (enable_main_LCD_date_time_display)
- {
- gdi_layer_lock_frame_buffer();
- show_analog_clock();
- }
- if (show_date == 0)
- {
- gui_set_font(&MMI_medium_font);
- /* get current date in string format */
- date_string(&main_LCD_dt_object.date.t, (UI_string_type) s, main_LCD_dt_object.flags);
- gui_measure_string(s, &w, &h);
- x = (UI_device_width >> 1) - (w >> 1);
- #ifdef __MMI_UI_STATUS_BAR_AT_BOTTOM__
- if (is_on_idlescreen())
- {
- y = DT_DISPLAY_OFFSET_IN_STATUS_BAR_AT_BOTTOM;
- }
- else
- #endif /* __MMI_UI_STATUS_BAR_AT_BOTTOM__ */
- #if defined(__MMI_TOUCH_IDLESCREEN_SHORTCUTS__)
- /* change in value of y, when idlescreen shortcuts are enabled. */
- y = UI_device_height - max_touch_idle_screen_shortcut_height() - (h + (DT_DISPLAY_GAP << 1));
- #else /* defined(__MMI_TOUCH_IDLESCREEN_SHORTCUTS__) */
- y = UI_device_height - MMI_button_bar_height - (h + (DT_DISPLAY_GAP << 1));
- #endif /* defined(__MMI_TOUCH_IDLESCREEN_SHORTCUTS__) */
- x1 = main_LCD_dt_object.date.x = x;
- y1 = main_LCD_dt_object.date.y = y;
- main_LCD_dt_object.date.width = w + (DT_DISPLAY_GAP << 1);
- main_LCD_dt_object.date.height = h + (DT_DISPLAY_GAP << 1);
- if (enable_main_LCD_date_time_display)
- {
- gui_set_text_color(main_LCD_dt_object.date.text_color);
- gui_set_text_border_color(main_LCD_dt_object.date.text_border_color);
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(x + main_LCD_dt_object.date.width - 1, y + 1);
- }
- else
- {
- gui_move_text_cursor(x, y + 1);
- }
- x2 = x1 + main_LCD_dt_object.date.width - 1;
- y2 = y1 + main_LCD_dt_object.date.height - 1;
- #ifdef __MMI_UI_DALMATIAN_IDLESCREEN__
- gui_set_text_clip(x1 - 1, y1, x2, y2);
- #else
- gui_set_text_clip(x1, y1, x2, y2);
- #endif
- /* print date */
- gui_print_bordered_text(s);
- }
- }
- #ifdef __MMI_UI_STATUS_BAR_AT_BOTTOM__
- if (is_on_idlescreen())
- {
- gdi_layer_pop_clip();
- show_boundries_to_status_bar_at_bottom_idlescreen();
- }
- #endif /* __MMI_UI_STATUS_BAR_AT_BOTTOM__ */
- if (enable_main_LCD_date_time_display)
- {
- gdi_layer_unlock_frame_buffer();
- #if defined(__MMI_TOUCH_IDLESCREEN_SHORTCUTS__)
- gdi_layer_blt_previous(
- 0,
- (MMI_title_y + MMI_title_height),
- (UI_device_width - 1),
- (UI_device_height - max_touch_idle_screen_shortcut_height() - 1));
- #else /* defined(__MMI_TOUCH_IDLESCREEN_SHORTCUTS__) */
- #ifdef __MMI_UI_STATUS_BAR_AT_BOTTOM__
- if (is_on_idlescreen())
- {
- gdi_layer_blt_previous(
- 0,
- 0,
- (UI_device_width - 1),
- (UI_device_height - 1 - MMI_button_bar_height - MMI_status_bar_height - 1 - 2));
- }
- else
- #endif /* __MMI_UI_STATUS_BAR_AT_BOTTOM__ */
- gdi_layer_blt_previous(
- 0,
- (MMI_title_y + MMI_title_height),
- (UI_device_width - 1),
- (UI_device_height - 1));
- #endif /* defined(__MMI_TOUCH_IDLESCREEN_SHORTCUTS__) */
- }
- if (enable_main_LCD_date_time_display)
- {
- dm_coordinates coordinates;
- if (show_date == 0)
- {
- coordinates.s16X = main_LCD_dt_object.date.x;
- coordinates.s16Y = main_LCD_dt_object.date.y;
- coordinates.s16Width = main_LCD_dt_object.date.width;
- coordinates.s16Height = main_LCD_dt_object.date.height;
- setup_previous_control(&coordinates);
- }
- else
- {
- coordinates.s16X = ANALOG_CLOCK_DIAL_X;
- coordinates.s16Y = ANALOG_CLOCK_DIAL_Y;
- coordinates.s16Width = ANALOG_CLOCK_DIAL_WIDTH;
- coordinates.s16Height = ANALOG_CLOCK_DIAL_HEIGHT;
- setup_previous_control(&coordinates);
- }
- }
- }
- break;
- #endif /* __MMI_ANALOG_CLOCK__ */
- }
- gdi_layer_pop_clip();
- if (saved_graphics_context == &main_LCD_device_bitmap)
- {
- UI_set_main_LCD_graphics_context();
- }
- else if (saved_graphics_context == &sub_LCD_device_bitmap)
- {
- UI_set_sub_LCD_graphics_context();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * hide_main_LCD_date_time
- * DESCRIPTION
- * hide function of main lcd date time
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void hide_main_LCD_date_time(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 x1, y1, x2, y2;
- bitmap *saved_graphics_context = current_LCD_device_bitmap;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (main_lcd_update_date_time == MMI_FALSE)
- {
- return;
- }
- UI_set_main_LCD_graphics_context();
- switch (main_LCD_dt_object.flags & DT_FLAGS_TYPE)
- {
- case DT_IDLE_SCREEN:
- case DT_IDLE_SCREEN_2:
- case DT_NETWORK_SEARCH:
- case DT_MO_CALL_SCREEN:
- case DT_MO_CALLING_SCREEN:
- case DT_MT_CALL_SCREEN:
- {
- /*
- * MTK Justin
- *
- * Note that we should hide "date" first, then hide "time".
- * The sequence should not be changed.
- *
- * This is for a hack for optimizing the speed of redraw background image.
- * Please refer to idle_screen_hide_date_display and
- * idle_screen_hide_time_display
- *
- * MTK Justin end
- */
- x1 = main_LCD_dt_object.date.x;
- y1 = main_LCD_dt_object.date.y;
- x2 = main_LCD_dt_object.date.width + x1 - 1;
- y2 = main_LCD_dt_object.date.height + y1 - 1;
- main_LCD_dt_object.date.hide_function(x1, y1, x2, y2);
- //KP Jerry modify for time display overlap between new and old time on 2006-11-16 start
- /*Old:
- if (x1 > main_LCD_dt_object.time.x)
- {
- x1 = main_LCD_dt_object.time.x;
- }
- y1 = main_LCD_dt_object.date.y - 1;
- if (x2 < main_LCD_dt_object.time.width + main_LCD_dt_object.time.x)
- {
- x2 = main_LCD_dt_object.time.width + main_LCD_dt_object.time.x - 1;
- }
- y2 = main_LCD_dt_object.time.y + main_LCD_dt_object.time.height - 1;
- main_LCD_dt_object.time.hide_function(x1, y1, x2, y2); // call hide function of idle,netwroksearch,call screen
- */
- x1=main_LCD_dt_object.time.x;
- y1=main_LCD_dt_object.time.y;
- x2=main_LCD_dt_object.time.width+x1-1;
- y2=main_LCD_dt_object.time.height+y1-1;
- main_LCD_dt_object.date.hide_function(x1,y1,x2,y2);
- //KP Jerry modify for time display overlap between new and old time on 2006-11-16 end
- #ifdef __MMI_UI_TECHNO_IDLESCREEN_BAR__
- if ((main_LCD_dt_object.flags & DT_FLAGS_TYPE) == DT_IDLE_SCREEN)
- {
- x1 = ANALOG_BACKGROUND_X + ANALOG_BACKGROUND_WIDTH;
- y1 = MMI_status_bar_height + (MMI_IDLESCREEN_BAR_HEIGHT >> 1);
- x2 = UI_device_width - MMI_SIGNAL_WIDTH;
- y2 = y1 + (MMI_IDLESCREEN_BAR_HEIGHT >> 1);
- MMI_main_LCD_dt_day_hide_function(x1, y1, x2, y2);
- }
- #endif /* __MMI_UI_TECHNO_IDLESCREEN_BAR__ */
- }
- break;
- case DT_TABBED_CALL_SCREEN:
- case DT_ACTIVE_CALL_SCREEN:
- {
- x1 = main_LCD_dt_object.date.x;
- y1 = main_LCD_dt_object.date.y;
- x2 = main_LCD_dt_object.date.width + x1 - 1;
- y2 = main_LCD_dt_object.date.height + y1 - 1;
- if (main_LCD_dt_object.flags & DT_FLAGS_TYPE == DT_ACTIVE_CALL_SCREEN)
- {
- main_LCD_dt_object.date.hide_function(x1, y1, x2, y2);
- }
- else
- {
- main_LCD_dt_object.date.hide_function(0, y1, UI_device_width - 1, y2);
- }
- x1 = main_LCD_dt_object.time.x;
- y1 = main_LCD_dt_object.time.y;
- x2 = main_LCD_dt_object.time.width + x1 - 1;
- y2 = main_LCD_dt_object.time.height + y1 - 1;
- if (main_LCD_dt_object.flags & DT_FLAGS_TYPE == DT_ACTIVE_CALL_SCREEN)
- {
- main_LCD_dt_object.time.hide_function(x1, y1, x2, y2);
- }
- else
- {
- main_LCD_dt_object.time.hide_function(0, y1, UI_device_width - 1, y2);
- }
- if (!(FALSE == GetCallTimeDisplay()))
- {
- x1 = main_LCD_dt_object.duration.x;
- y1 = main_LCD_dt_object.duration.y;
- x2 = main_LCD_dt_object.duration.width + x1 - 1;
- y2 = main_LCD_dt_object.duration.height + y1 - 1;
- if (main_LCD_dt_object.flags & DT_FLAGS_TYPE == DT_ACTIVE_CALL_SCREEN)
- {
- main_LCD_dt_object.duration.hide_function(x1, y1, x2, y2);
- }
- else
- {
- main_LCD_dt_object.duration.hide_function(0, y1, UI_device_width - 1, y2);
- }
- }
- }
- break;
- case DT_DIGITAL_CLOCK_SC1:
- case DT_DIGITAL_CLOCK_SC2:
- case DT_DIGITAL_CLOCK_SC3:
- {
- x1 = main_LCD_dt_object.date.x;
- y1 = main_LCD_dt_object.date.y;
- x2 = main_LCD_dt_object.date.width + x1 - 1;
- y2 = main_LCD_dt_object.date.height + y1 - 1;
- main_LCD_dt_object.date.hide_function(x1, y1, x2, y2);
- x1 = main_LCD_dt_object.time.x;
- y1 = main_LCD_dt_object.time.y;
- x2 = main_LCD_dt_object.time.width + x1 - 1;
- y2 = main_LCD_dt_object.time.height + y1 - 1;
- main_LCD_dt_object.time.hide_function(x1, y1, x2, y2);
- }
- break;
- #ifdef __MMI_ANALOG_CLOCK__
- case DT_ANALOG_CLOCK_SC:
- {
- x1 = main_LCD_dt_object.time.x;
- y1 = main_LCD_dt_object.time.y;
- x2 = main_LCD_dt_object.time.width + x1 - 1;
- y2 = main_LCD_dt_object.time.height + y1 - 1;
- main_LCD_dt_object.time.hide_function(x1, y1, x2, y2);
- }
- break;
- #endif /* __MMI_ANALOG_CLOCK__ */
- }
- if (saved_graphics_context == &main_LCD_device_bitmap)
- {
- UI_set_main_LCD_graphics_context();
- }
- else if (saved_graphics_context == &sub_LCD_device_bitmap)
- {
- UI_set_sub_LCD_graphics_context();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * update_main_LCD_date_time
- * DESCRIPTION
- * update main lcd date time
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void update_main_LCD_date_time(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- GetDateTime(&main_LCD_dt_object.date.t);
- main_LCD_dt_object.time.t = main_LCD_dt_object.date.t;
- #ifdef __MMI_UI_TECHNO_IDLESCREEN_BAR__
- set_day_display();
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * set_dt_duration
- * DESCRIPTION
- * set the call duration of category17
- * PARAMETERS
- * t [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void set_dt_duration(UI_time *t)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- main_LCD_dt_object.duration.t = *t; /* set the duration value */
- DTGetRTCTime(&last_duration_time);
- }
- #ifdef __MMI_SUBLCD__
- /*****************************************************************************
- * FUNCTION
- * show_sub_LCD_date_time1
- * DESCRIPTION
- * show sub lcd date time when ther is one city set
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void show_sub_LCD_date_time1(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- bitmap *saved_graphics_context = current_LCD_device_bitmap;
- dm_coordinates coordinates;
- #if defined(__MMI_SUBLCD_SHOW_DATE__) || defined(__MMI_SUBLCD_SHOW_TIME__)
- S32 h, w, x, y;
- UI_character_type s[64];
- S32 x1, y1, x2, y2;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- y = 16; /* magic number by Pixtel */
- #endif /* defined(__MMI_SUBLCD_SHOW_DATE__) || defined(__MMI_SUBLCD_SHOW_TIME__) */
- if (sub_lcd_update_date_time == MMI_FALSE)
- {
- return;
- }
- if (enable_sub_LCD_date_time_display)
- {
- GDI_LOCK;
- UI_set_sub_LCD_graphics_context(); /* change graphic context to sub lcd */
- #ifdef __MMI_SUB_WALLPAPER__
- if (sublcd_base_layer != GDI_ERROR_HANDLE)
- {
- gdi_layer_push_and_set_active(sublcd_base_layer);
- }
- #endif /* __MMI_SUB_WALLPAPER__ */
- }
- #ifdef __MMI_SUBLCD_SHOW_DATE__
- gui_set_font(sub_LCD_dt_object1.date.font);
- /* get current date in string format */
- date_string(&sub_LCD_dt_object1.date.t, (UI_string_type) s, sub_LCD_dt_object1.flags);
- gui_measure_string(s, &w, &h);
- x = (UI_device_width >> 1) - (w >> 1);
- x1 = sub_LCD_dt_object1.date.x = x;
- y1 = sub_LCD_dt_object1.date.y = y;
- sub_LCD_dt_object1.date.width = w;
- sub_LCD_dt_object1.date.height = h - 2;
- if (enable_sub_LCD_date_time_display)
- {
- gui_set_text_color(sub_LCD_dt_object1.date.text_color);
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(x + sub_LCD_dt_object1.date.width, y);
- }
- else
- {
- gui_move_text_cursor(x, y);
- }
- x2 = x1 + sub_LCD_dt_object1.date.width - 1;
- y2 = y1 + sub_LCD_dt_object1.date.height - 1;
- gui_set_text_clip(x1, y1, x2, y2);
- /* print date */
- gui_print_text(s);
- gdi_layer_blt_previous(x1, y1, x2, y2);
- }
- coordinates.s16X = sub_LCD_dt_object1.date.x;
- coordinates.s16Y = sub_LCD_dt_object1.date.y;
- coordinates.s16Width = sub_LCD_dt_object1.date.width;
- coordinates.s16Height = sub_LCD_dt_object1.date.height;
- y = y + h;
- #endif /* __MMI_SUBLCD_SHOW_DATE__ */
- #ifdef __MMI_SUBLCD_SHOW_TIME__
- gui_set_font(sub_LCD_dt_object1.time.font);
- /* get current time instring format */
- time_string(&sub_LCD_dt_object1.time.t, (UI_string_type) s, sub_LCD_dt_object1.flags);
- gui_measure_string(s, &w, &h);
- x = (UI_device_width >> 1) - (w >> 1);
- #ifdef __MMI_SUBLCD_SHOW_WORLD_CLOCK__
- y = y + 14;
- #endif
- x1 = sub_LCD_dt_object1.time.x = x;
- y1 = sub_LCD_dt_object1.time.y = y;
- sub_LCD_dt_object1.time.width = w;
- sub_LCD_dt_object1.time.height = h;
- if (enable_sub_LCD_date_time_display)
- {
- gui_set_text_color(sub_LCD_dt_object1.time.text_color);
- gui_set_text_border_color(sub_LCD_dt_object1.time.text_border_color);
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(x + sub_LCD_dt_object1.time.width, y);
- }
- else
- {
- gui_move_text_cursor(x, y);
- }
- x2 = x1 + sub_LCD_dt_object1.time.width - 1;
- y2 = y1 + sub_LCD_dt_object1.time.height - 1;
- gui_set_text_clip(x1, y1, x2, y2);
- /* print time */
- gui_print_text(s);
- gdi_layer_blt_previous(x1, y1, x2, y2);
- }
- coordinates.s16X = sub_LCD_dt_object1.time.x;
- coordinates.s16Y = sub_LCD_dt_object1.time.y;
- coordinates.s16Width = sub_LCD_dt_object1.time.width;
- coordinates.s16Height = sub_LCD_dt_object1.time.height;
- #ifndef __MMI_SUBLCD_SHOW_ONE_CITY__
- gui_set_font(sub_LCD_dt_object2.time.font);
- time_string(&sub_LCD_dt_object2.time.t, (UI_string_type) s, sub_LCD_dt_object2.flags);
- gui_measure_string(s, &w, &h);
- x = (UI_device_width >> 1) - (w >> 1);
- y = UI_device_height - h;
- x1 = sub_LCD_dt_object2.time.x = x;
- y1 = sub_LCD_dt_object2.time.y = y;
- sub_LCD_dt_object2.time.width = w;
- sub_LCD_dt_object2.time.height = h;
- if (enable_sub_LCD_date_time_display)
- {
- gui_set_text_color(sub_LCD_dt_object2.time.text_color);
- gui_set_text_border_color(sub_LCD_dt_object2.time.text_border_color);
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(x + sub_LCD_dt_object2.time.width, y);
- }
- else
- {
- gui_move_text_cursor(x, y);
- }
- x2 = x1 + sub_LCD_dt_object2.time.width - 1;
- y2 = y1 + sub_LCD_dt_object2.time.height - 1;
- gui_set_text_clip(x1, y1, x2, y2);
- gui_print_text(s);
- gdi_layer_blt_previous(x1, y1, x2, y2);
- }
- coordinates.s16X = sub_LCD_dt_object2.time.x;
- coordinates.s16Y = sub_LCD_dt_object2.time.y;
- coordinates.s16Width = sub_LCD_dt_object2.time.width;
- coordinates.s16Height = sub_LCD_dt_object2.time.height;
- #endif /* __MMI_SUBLCD_SHOW_ONE_CITY__ */
- #endif /* __MMI_SUBLCD_SHOW_TIME__ */
- setup_previous_control(&coordinates);
- if (enable_sub_LCD_date_time_display)
- {
- if (saved_graphics_context == &main_LCD_device_bitmap)
- {
- UI_set_main_LCD_graphics_context();
- }
- else if (saved_graphics_context == &sub_LCD_device_bitmap)
- {
- UI_set_sub_LCD_graphics_context();
- }
- GDI_UNLOCK;
- #ifdef __MMI_SUB_WALLPAPER__
- if (sublcd_base_layer != GDI_ERROR_HANDLE)
- {
- gdi_layer_pop_and_restore_active();
- }
- #endif /* __MMI_SUB_WALLPAPER__ */
- }
- }
- /*****************************************************************************
- * FUNCTION
- * hide_sub_LCD_date_time1
- * DESCRIPTION
- * hide function of date time of sub lcd when only 1 city is set
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void hide_sub_LCD_date_time1(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 x1, y1, x2, y2;
- bitmap *saved_graphics_context = current_LCD_device_bitmap;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (sub_lcd_update_date_time == MMI_FALSE)
- {
- return;
- }
- GDI_LOCK;
- UI_set_sub_LCD_graphics_context();
- #ifdef __MMI_SUBLCD_SHOW_DATE__
- x1 = sub_LCD_dt_object1.date.x;
- y1 = sub_LCD_dt_object1.date.y;
- x2 = sub_LCD_dt_object1.date.width + x1 - 1;
- y2 = sub_LCD_dt_object1.date.height + y1 - 1;
- sub_LCD_dt_object1.date.hide_function(x1, y1, x2, y2);
- #endif /* __MMI_SUBLCD_SHOW_DATE__ */
- x1 = sub_LCD_dt_object1.time.x;
- y1 = sub_LCD_dt_object1.time.y;
- x2 = sub_LCD_dt_object1.time.width + x1 - 1;
- y2 = sub_LCD_dt_object1.time.height + y1 - 1;
- sub_LCD_dt_object1.time.hide_function(x1, y1, x2, y2);
- #ifndef __MMI_SUBLCD_SHOW_ONE_CITY__
- x1 = sub_LCD_dt_object2.time.x;
- y1 = sub_LCD_dt_object2.time.y;
- x2 = sub_LCD_dt_object2.time.width + x1 - 1;
- y2 = sub_LCD_dt_object2.time.height + y1 - 1;
- sub_LCD_dt_object2.time.hide_function(x1, y1, x2, y2);
- #endif /* __MMI_SUBLCD_SHOW_ONE_CITY__ */
- if (saved_graphics_context == &main_LCD_device_bitmap)
- {
- UI_set_main_LCD_graphics_context();
- }
- else if (saved_graphics_context == &sub_LCD_device_bitmap)
- {
- UI_set_sub_LCD_graphics_context();
- }
- GDI_UNLOCK;
- }
- /*****************************************************************************
- * FUNCTION
- * update_sub_LCD_date_time1
- * DESCRIPTION
- * get current date time and update date time on sublcd
- * when one sub lcd city is set
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void update_sub_LCD_date_time1(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- GDI_LOCK;
- GetDateTime(&sub_LCD_dt_object1.date.t);
- sub_LCD_dt_object2.date.t = sub_LCD_dt_object1.date.t;
- get_time_difference(&sub_LCD_dt_object1.date.t, dt_difference1); /* get tiem diff of city1 with current time */
- sub_LCD_dt_object1.time.t = sub_LCD_dt_object1.date.t;
- #ifndef __MMI_SUBLCD_SHOW_ONE_CITY__
- get_time_difference(&sub_LCD_dt_object2.date.t, dt_difference2); /* get tiem diff of city2 with current time */
- sub_LCD_dt_object2.time.t = sub_LCD_dt_object2.date.t;
- #endif /* __MMI_SUBLCD_SHOW_ONE_CITY__ */
- GDI_UNLOCK;
- }
- /*****************************************************************************
- * FUNCTION
- * show_sub_LCD_date_time2
- * DESCRIPTION
- * show sub lcd date tiem of 2 cities
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void show_sub_LCD_date_time2(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- bitmap *saved_graphics_context = current_LCD_device_bitmap;
- dm_coordinates coordinates;
- #if defined(__MMI_SUBLCD_SHOW_DATE__) || defined(__MMI_SUBLCD_SHOW_TIME__)
- S32 x1, x2, y1, y2;
- S32 gap;
- #endif /* defined(__MMI_SUBLCD_SHOW_DATE__) || defined(__MMI_SUBLCD_SHOW_TIME__) */
- #if defined(__MMI_SUBLCD_SHOW_DATE__)
- S32 date_height, date_width;
- UI_character_type date[32];
- #endif /* defined(__MMI_SUBLCD_SHOW_DATE__) */
- #if defined(__MMI_SUBLCD_SHOW_TIME__)
- S32 time_height, time_width;
- UI_character_type time[32];
- #endif /* defined(__MMI_SUBLCD_SHOW_TIME__) */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (sub_lcd_update_date_time == MMI_FALSE)
- {
- return;
- }
- if (enable_sub_LCD_date_time_display)
- {
- GDI_LOCK;
- UI_set_sub_LCD_graphics_context();
- #ifdef __MMI_SUB_WALLPAPER__
- if (sublcd_base_layer != GDI_ERROR_HANDLE)
- {
- gdi_layer_push_and_set_active(sublcd_base_layer);
- }
- #endif /* __MMI_SUB_WALLPAPER__ */
- }
- #if defined (__MMI_SUBLCD_SHOW_DATE__) && defined (__MMI_SUBLCD_SHOW_TIME__)
- gui_set_font(sub_LCD_dt_object1.date.font);
- date_string(&sub_LCD_dt_object1.date.t, (UI_string_type) date, sub_LCD_dt_object1.flags);
- gui_measure_string((UI_string_type) date, &date_width, &date_height);
- #ifdef __MMI_SUB_WALLPAPER__
- date_width += 2; /* 2 is for border size. */
- date_height += 2; /* 2 is for border size. */
- #endif /* __MMI_SUB_WALLPAPER__ */
- gui_set_font(sub_LCD_dt_object1.time.font);
- time_string(&sub_LCD_dt_object1.time.t, (UI_string_type) time, sub_LCD_dt_object1.flags);
- gui_measure_string((UI_string_type) time, &time_width, &time_height);
- time_width += 2; /* 2 is for border size. */
- time_height += 2; /* 2 is for border size. */
- gap = (UI_device_height - Sub_lcd_title_height - date_height - time_height) / 3;
- if (sublcd_date_time_display_type == SUBLCD_DT_DATE_THEN_TIME_TYPE1)
- {
- sub_LCD_dt_object1.date.y = UI_device_height - (gap << 1) - date_height - time_height - 1;
- sub_LCD_dt_object1.time.y = UI_device_height - gap - time_height - 1;
- }
- else if (sublcd_date_time_display_type == SUBLCD_DT_TIME_THEN_DATE_TYPE1)
- {
- sub_LCD_dt_object1.time.y = UI_device_height - (gap << 1) - date_height - time_height - 1;
- sub_LCD_dt_object1.date.y = UI_device_height - gap - date_height - 1;
- }
- #elif defined (__MMI_SUBLCD_SHOW_DATE__)
- gui_set_font(sub_LCD_dt_object1.date.font);
- date_string(&sub_LCD_dt_object1.date.t, (UI_string_type) date, sub_LCD_dt_object1.flags);
- gui_measure_string((UI_string_type) date, &date_width, &date_height);
- #ifdef __MMI_SUB_WALLPAPER__
- date_width += 2; /* 2 is for border size. */
- date_height += 2; /* 2 is for border size. */
- #endif /* __MMI_SUB_WALLPAPER__ */
- gap = (UI_device_height - Sub_lcd_title_height - date_height) >> 1;
- sub_LCD_dt_object1.date.y = UI_device_height - gap - date_height - 1;
- #elif defined (__MMI_SUBLCD_SHOW_TIME__)
- gui_set_font(sub_LCD_dt_object1.time.font);
- time_string(&sub_LCD_dt_object1.time.t, (UI_string_type) time, sub_LCD_dt_object1.flags);
- gui_measure_string((UI_string_type) time, &time_width, &time_height);
- time_width += 2; /* 2 is for border size. */
- time_height += 2; /* 2 is for border size. */
- gap = (UI_device_height - Sub_lcd_title_height - time_height) >> 1;
- sub_LCD_dt_object1.time.y = UI_device_height - gap - time_height - 1;
- #endif
- #ifdef __MMI_SUBLCD_SHOW_DATE__
- x1 = sub_LCD_dt_object1.date.x = (UI_device_width - date_width) >> 1;
- y1 = sub_LCD_dt_object1.date.y;
- sub_LCD_dt_object1.date.width = date_width;
- sub_LCD_dt_object1.date.height = date_height;
- x2 = x1 + date_width - 1;
- y2 = y1 + date_height - 1;
- if (enable_sub_LCD_date_time_display)
- {
- gui_set_text_color(sub_LCD_dt_object1.date.text_color);
- gui_set_text_border_color(sub_LCD_dt_object1.date.text_border_color);
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(x1 + date_width, y1 + 1); /* for border */
- }
- else
- {
- gui_move_text_cursor(x1, y1 + 1); /* for border */
- }
- gui_set_text_clip(x1, y1, x2, y2);
- /* print date */
- gui_set_font(sub_LCD_dt_object1.date.font);
- #ifdef __MMI_SUB_WALLPAPER__
- gui_print_bordered_text(date);
- #else
- gui_print_text(date);
- #endif
- gdi_layer_blt_previous(0, y1, UI_device_width - 1, y2);
- }
- coordinates.s16X = sub_LCD_dt_object1.date.x;
- coordinates.s16Y = sub_LCD_dt_object1.date.y;
- coordinates.s16Width = sub_LCD_dt_object1.date.width;
- coordinates.s16Height = sub_LCD_dt_object1.date.height;
- #endif /* __MMI_SUBLCD_SHOW_DATE__ */
- #ifdef __MMI_SUBLCD_SHOW_TIME__
- x1 = sub_LCD_dt_object1.time.x = (UI_device_width - time_width) >> 1;
- y1 = sub_LCD_dt_object1.time.y;
- sub_LCD_dt_object1.time.width = time_width;
- sub_LCD_dt_object1.time.height = time_height;
- x2 = x1 + time_width - 1;
- y2 = y1 + time_height - 1;
- if (enable_sub_LCD_date_time_display)
- {
- gui_set_text_color(sub_LCD_dt_object1.time.text_color);
- gui_set_text_border_color(sub_LCD_dt_object1.time.text_border_color);
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(x1 + time_width, y1 + 1); /* for border */
- }
- else
- {
- gui_move_text_cursor(x1, y1 + 1); /* for border */
- }
- gui_set_text_clip(x1, y1, x2, y2);
- /* print time */
- gui_set_font(sub_LCD_dt_object1.time.font);
- #ifdef __MMI_SUB_WALLPAPER__
- gui_print_bordered_text(time);
- #else
- gui_print_text(time);
- #endif
- gdi_layer_blt_previous(0, y1, UI_device_width - 1, y2);
- }
- coordinates.s16X = sub_LCD_dt_object1.time.x;
- coordinates.s16Y = sub_LCD_dt_object1.time.y;
- coordinates.s16Width = sub_LCD_dt_object1.time.width;
- coordinates.s16Height = sub_LCD_dt_object1.time.height;
- #endif /* __MMI_SUBLCD_SHOW_TIME__ */
- setup_previous_control(&coordinates);
- if (enable_sub_LCD_date_time_display)
- {
- #ifdef __MMI_SUB_WALLPAPER__
- gdi_layer_pop_and_restore_active();
- #endif
- if (saved_graphics_context == &main_LCD_device_bitmap)
- {
- UI_set_main_LCD_graphics_context();
- }
- else if (saved_graphics_context == &sub_LCD_device_bitmap)
- {
- UI_set_sub_LCD_graphics_context();
- }
- GDI_UNLOCK;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * hide_sub_LCD_date_time2
- * DESCRIPTION
- * hide function of date tiem of sub lcd when 2 cities is set
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void hide_sub_LCD_date_time2(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 x1 = 0, y1 = 0, x2 = 0, y2 = 0;
- bitmap *saved_graphics_context = current_LCD_device_bitmap;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (sub_lcd_update_date_time == MMI_FALSE)
- {
- return;
- }
- GDI_LOCK;
- UI_set_sub_LCD_graphics_context();
- #if (defined __MMI_SUBLCD_SHOW_DATE__) && (defined __MMI_SUBLCD_SHOW_TIME__)
- x1 = sub_LCD_dt_object1.date.x;
- x2 = sub_LCD_dt_object1.date.width + x1 - 1;
- if (sublcd_date_time_display_type == SUBLCD_DT_DATE_THEN_TIME_TYPE1)
- {
- y1 = sub_LCD_dt_object1.date.y;
- y2 = sub_LCD_dt_object1.time.height + sub_LCD_dt_object1.time.y - 1;
- }
- else if (sublcd_date_time_display_type == SUBLCD_DT_TIME_THEN_DATE_TYPE1)
- {
- y1 = sub_LCD_dt_object1.time.y;
- y2 = sub_LCD_dt_object1.date.height + sub_LCD_dt_object1.date.y - 1;
- }
- if (x1 > sub_LCD_dt_object1.time.x)
- {
- x1 = sub_LCD_dt_object1.time.x;
- }
- if (x2 < sub_LCD_dt_object1.time.width + sub_LCD_dt_object1.time.x - 1)
- {
- x2 = sub_LCD_dt_object1.time.width + sub_LCD_dt_object1.time.x - 1;
- }
- sub_LCD_dt_object1.time.hide_function(x1, y1, x2, y2); /* call hide function of time sub lcd */
- #elif defined (__MMI_SUBLCD_SHOW_DATE__)
- x1 = sub_LCD_dt_object1.date.x;
- y1 = sub_LCD_dt_object1.date.y;
- x2 = sub_LCD_dt_object1.date.width + x1 - 1;
- y2 = sub_LCD_dt_object1.date.height + y1 - 1;
- sub_LCD_dt_object1.time.hide_function(x1, y1, x2, y2); /* call hide func of date sub lcd */
- #elif defined (__MMI_SUBLCD_SHOW_TIME__)
- x1 = sub_LCD_dt_object1.time.x;
- y1 = sub_LCD_dt_object1.time.y;
- x2 = sub_LCD_dt_object1.time.width + x1 - 1;
- y2 = sub_LCD_dt_object1.time.height + y1 - 1;
- sub_LCD_dt_object1.time.hide_function(x1, y1, x2, y2); /* call hide function of time sub lcd */
- #endif
- if (saved_graphics_context == &main_LCD_device_bitmap)
- {
- UI_set_main_LCD_graphics_context();
- }
- else if (saved_graphics_context == &sub_LCD_device_bitmap)
- {
- UI_set_sub_LCD_graphics_context();
- }
- GDI_UNLOCK;
- }
- /*****************************************************************************
- * FUNCTION
- * update_sub_LCD_date_time2
- * DESCRIPTION
- * upadet date tiem of sub lcd
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void update_sub_LCD_date_time2(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- GDI_LOCK;
- GetDateTime(&sub_LCD_dt_object1.date.t); /* get current date time */
- get_time_difference(&sub_LCD_dt_object1.date.t, dt_difference1); /* get time diff between city1 and and current time */
- sub_LCD_dt_object1.time.t = sub_LCD_dt_object1.date.t;
- GDI_UNLOCK;
- }
- #endif /* __MMI_SUBLCD__ */
- /*----------------------------------------------------------------------------
- Function: MMI_main_LCD_dt_date_hide_function
- Description: date hide funtion pointer of main lcd
- Input Parameters: S32 x1 start x position
- S32 y1 start y position
- S32 x2 end x position
- S32 y2 end y position
- Output Parameters: none
- Returns: none
- ----------------------------------------------------------------------------*/
- void (*MMI_main_LCD_dt_date_hide_function) (S32 x1, S32 y1, S32 x2, S32 y2) = UI_dummy_hide_function;
- /*----------------------------------------------------------------------------
- Function: MMI_main_LCD_dt_time_hide_function
- Description: time hide funtion pointer of main lcd
- Input Parameters: S32 x1 start x position
- S32 y1 start y position
- S32 x2 end x position
- S32 y2 end y position
- Output Parameters: none
- Returns: none
- ----------------------------------------------------------------------------*/
- void (*MMI_main_LCD_dt_time_hide_function) (S32 x1, S32 y1, S32 x2, S32 y2) = UI_dummy_hide_function;
- /*----------------------------------------------------------------------------
- Function: MMI_main_LCD_dt_duration_hide_function
- Description: call time duration hide funtion pointer of main lcd
- Input Parameters: S32 x1 start x position
- S32 y1 start y position
- S32 x2 end x position
- S32 y2 end y position
- Output Parameters: none
- Returns: none
- ----------------------------------------------------------------------------*/
- void (*MMI_main_LCD_dt_duration_hide_function) (S32 x1, S32 y1, S32 x2, S32 y2) = UI_dummy_hide_function;
- /*----------------------------------------------------------------------------
- Function: MMI_sub_LCD_dt_date_hide_function
- Description: date hide funtion pointer of sub lcd
- Input Parameters: S32 x1 start x position
- S32 y1 start y position
- S32 x2 end x position
- S32 y2 end y position
- Output Parameters: none
- Returns: none
- ----------------------------------------------------------------------------*/
- void (*MMI_sub_LCD_dt_date_hide_function) (S32 x1, S32 y1, S32 x2, S32 y2) = UI_dummy_hide_function;
- /*----------------------------------------------------------------------------
- Function: MMI_sub_LCD_dt_time_hide_function
- Description: time hide funtion pointer of sub lcd
- Input Parameters: S32 x1 start x position
- S32 y1 start y position
- S32 x2 end x position
- S32 y2 end y position
- Output Parameters: none
- Returns: none
- ----------------------------------------------------------------------------*/
- void (*MMI_sub_LCD_dt_time_hide_function) (S32 x1, S32 y1, S32 x2, S32 y2) = UI_dummy_hide_function;
- /*----------------------------------------------------------------------------
- Function: MMI_sub_LCD_dt_duration_hide_function
- Description: call time duration hide funtion pointer of sub lcd
- Input Parameters: S32 x1 start x position
- S32 y1 start y position
- S32 x2 end x position
- S32 y2 end y position
- Output Parameters: none
- Returns: none
- ----------------------------------------------------------------------------*/
- void (*MMI_sub_LCD_dt_duration_hide_function) (S32 x1, S32 y1, S32 x2, S32 y2) = UI_dummy_hide_function;
- /*****************************************************************************
- * FUNCTION
- * set_main_LCD_dt_date_hide_function
- * DESCRIPTION
- * register date hide function of main lcd
- * PARAMETERS
- * f [IN]
- * function(?) [IN] Pointer
- * RETURNS
- * void
- *****************************************************************************/
- void set_main_LCD_dt_date_hide_function(void (*f) (S32 x1, S32 y1, S32 x2, S32 y2))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_main_LCD_dt_date_hide_function = f;
- }
- /*****************************************************************************
- * FUNCTION
- * set_main_LCD_dt_time_hide_function
- * DESCRIPTION
- * register time hide function of main lcd
- * PARAMETERS
- * f [IN]
- * function(?) [IN] Pointer
- * RETURNS
- * void
- *****************************************************************************/
- void set_main_LCD_dt_time_hide_function(void (*f) (S32 x1, S32 y1, S32 x2, S32 y2))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_main_LCD_dt_time_hide_function = f;
- }
- /*****************************************************************************
- * FUNCTION
- * set_main_LCD_dt_duration_hide_function
- * DESCRIPTION
- * register call time duration hide function of main lcd
- * PARAMETERS
- * f [IN]
- * function(?) [IN] Pointer
- * RETURNS
- * void
- *****************************************************************************/
- void set_main_LCD_dt_duration_hide_function(void (*f) (S32 x1, S32 y1, S32 x2, S32 y2))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_main_LCD_dt_duration_hide_function = f;
- }
- /*****************************************************************************
- * FUNCTION
- * set_sub_LCD_dt_date_hide_function
- * DESCRIPTION
- * register date hide function of sub lcd
- * PARAMETERS
- * f [IN]
- * function(?) [IN] Pointer
- * RETURNS
- * void
- *****************************************************************************/
- void set_sub_LCD_dt_date_hide_function(void (*f) (S32 x1, S32 y1, S32 x2, S32 y2))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_sub_LCD_dt_date_hide_function = f;
- }
- /*****************************************************************************
- * FUNCTION
- * set_sub_LCD_dt_time_hide_function
- * DESCRIPTION
- * register time hide function of sub lcd
- * PARAMETERS
- * f [IN]
- * function(?) [IN] Pointer
- * RETURNS
- * void
- *****************************************************************************/
- void set_sub_LCD_dt_time_hide_function(void (*f) (S32 x1, S32 y1, S32 x2, S32 y2))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_sub_LCD_dt_time_hide_function = f;
- }
- /*****************************************************************************
- * FUNCTION
- * set_sub_LCD_dt_duration_hide_function
- * DESCRIPTION
- * register cal time duration hide function of sub lcd
- * PARAMETERS
- * f [IN]
- * function(?) [IN] Pointer
- * RETURNS
- * void
- *****************************************************************************/
- void set_sub_LCD_dt_duration_hide_function(void (*f) (S32 x1, S32 y1, S32 x2, S32 y2))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_sub_LCD_dt_duration_hide_function = f;
- }
- /* PMT HIMANSHU START 20050721 */
- #ifdef __MMI_UI_TECHNO_IDLESCREEN_BAR__
- /*****************************************************************************
- * FUNCTION
- * set_main_LCD_day_hide_function
- * DESCRIPTION
- * register day hide function of Main LCD
- * PARAMETERS
- * f [IN]
- * function(?) [IN] Pointer
- * RETURNS
- * void
- *****************************************************************************/
- void set_main_LCD_day_hide_function(void (*f) (S32 x1, S32 y1, S32 x2, S32 y2))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_main_LCD_dt_day_hide_function = f;
- }
- #endif /* __MMI_UI_TECHNO_IDLESCREEN_BAR__ */
- /* PMT HIMANSHU END 20050721 */
- /*****************************************************************************
- * FUNCTION
- * dt_show_duration
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void dt_show_duration(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- UI_character_type s[64];
- S32 x1, y1, x2, y2;
- S32 w;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_lock_frame_buffer();
- x1 = main_LCD_dt_object.duration.x;
- y1 = main_LCD_dt_object.duration.y;
- x2 = main_LCD_dt_object.duration.width + x1 - 1;
- y2 = main_LCD_dt_object.duration.height + y1 - 1;
- main_LCD_dt_object.duration.hide_function(x1, y1, x2, y2); /* call hide function of call duration */
- gui_set_font(main_LCD_dt_object.duration.font);
- /* get call duration in string fromat */
- duration_string(&main_LCD_dt_object.duration.t, (UI_string_type) s, main_LCD_dt_object.flags);
- gui_set_text_color(main_LCD_dt_object.duration.text_color);
- w = gui_get_string_width(s);
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(x1 + w - 1, y1);
- }
- else
- {
- gui_move_text_cursor(x1, y1);
- }
- gui_set_text_clip(x1, y1, x2, y2);
- /* print call duration */
- gui_print_text(s);
- gdi_layer_unlock_frame_buffer();
- gdi_layer_blt_previous(x1, y1, x2, y2);
- }
- /*****************************************************************************
- * FUNCTION
- * dt_update_duration_cat19
- * DESCRIPTION
- * update teh call time duration
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void dt_update_duration_cat19(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYTIME curr_time, duration;
- MYTIME *start_time;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset (&duration, 0, sizeof(MYTIME));
- DTGetRTCTime(&curr_time);
- start_time = GetCurrStartCallTime();
- if (start_time == NULL)
- {
- return;
- }
- /* overflow 2030/12/31/23:59:59 */
- if (start_time->nYear == 2030 &&
- curr_time.nYear < start_time->nYear)
- {
- curr_time.nYear = start_time->nYear;
- curr_time.nMonth = start_time->nMonth;
- curr_time.nDay = start_time->nDay+1;
- }
- GetTimeDifference(&curr_time, start_time, &duration);
- memcpy(&main_LCD_dt_object.duration.t, &duration, sizeof(MYTIME));
- if (!(FALSE == GetCallTimeDisplay()))
- {
- dt_show_duration();
- }
- gui_start_timer(1000, dt_update_duration_cat19);
- }
- /*****************************************************************************
- * FUNCTION
- * dt_update_duration
- * DESCRIPTION
- * update teh call time duration
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void dt_update_duration(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYTIME curr_time, duration;
- MYTIME *start_time;
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif /* 0 */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset (&duration, 0, sizeof(MYTIME));
- DTGetRTCTime(&curr_time);
- start_time = GetStartCallTime();
- if (start_time == NULL)
- {
- return;
- }
- /* overflow 2030/12/31/23:59:59 */
- if (start_time->nYear == 2030 &&
- curr_time.nYear < start_time->nYear)
- {
- curr_time.nYear = start_time->nYear;
- curr_time.nMonth = start_time->nMonth;
- curr_time.nDay = start_time->nDay+1;
- }
- GetTimeDifference(&curr_time, start_time, &duration);
- memcpy(&main_LCD_dt_object.duration.t, &duration, sizeof(MYTIME));
- if (!(FALSE == GetCallTimeDisplay()))
- {
- dt_show_duration();
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif /* 0 */
- }
- gui_start_timer(1000, dt_update_duration);
- }
- /*****************************************************************************
- * FUNCTION
- * dt_update_duration_gprs
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void dt_update_duration_gprs(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif /* 0 */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #if 0
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- /* under construction !*/
- #endif
- #endif /* 0 */
- increment_seconds(&main_LCD_dt_object.duration.t); /* increment secods by 1 */
- dt_show_duration();
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif /* 0 */
- gui_start_timer(1000, dt_update_duration_gprs);
- }
- /*****************************************************************************
- * FUNCTION
- * CategoryScreenUpdateDuration
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void Cat19UpdateDuration(MYTIME *t)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYTIME curr_time, duration;
- MYTIME *start_time;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset (&duration, 0, sizeof(MYTIME));
- DTGetRTCTime(&curr_time);
- start_time = GetCurrStartCallTime();
- if (start_time == NULL)
- {
- return;
- }
- /* overflow 2030/12/31/23:59:59 */
- if (start_time->nYear == 2030 &&
- curr_time.nYear < start_time->nYear)
- {
- curr_time.nYear = start_time->nYear;
- curr_time.nMonth = start_time->nMonth;
- curr_time.nDay = start_time->nDay+1;
- }
- GetTimeDifference(&curr_time, start_time, &duration);
- gui_cancel_timer(dt_update_duration);
- set_dt_duration(&duration);
- if (!(FALSE == GetCallTimeDisplay()))
- {
- dt_show_duration();
- }
- gui_start_timer(1000, dt_update_duration_cat19);
- }
- /*****************************************************************************
- * FUNCTION
- * reset_dt_display
- * DESCRIPTION
- * set dt_display object to initialized value:0
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void reset_dt_display(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- main_LCD_dt_object.date.x = main_LCD_dt_object.date.y = 0;
- main_LCD_dt_object.date.height = main_LCD_dt_object.date.width = 0;
- main_LCD_dt_object.time.x = main_LCD_dt_object.time.y = 0;
- main_LCD_dt_object.time.height = main_LCD_dt_object.time.width = 0;
- }
- /*****************************************************************************
- * FUNCTION
- * set_dt_display
- * DESCRIPTION
- * set teh hide/dispaly function od date time depend on the
- * date flag passed as parameter
- * PARAMETERS
- * flags [IN] Date type flag
- * RETURNS
- * void
- *****************************************************************************/
- extern stFontAttribute wgui_dialer_box_f1; //KP Jerry add on 2006-11-16
- void set_dt_display(U32 flags)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_lock_frame_buffer();
- switch (flags & DT_FLAGS_TYPE)
- {
- case DT_IDLE_SCREEN:
- {
- if (PhnsetGetShowDateTimeStatus() == MMI_FALSE)
- {
- break; /* check if dispaly tiem date on idel screen is enabel or not */
- }
- main_LCD_dt_object.flags = (flags & DT_FLAGS_TYPE);
- main_LCD_dt_object.date.hide_function = MMI_main_LCD_dt_date_hide_function;
- main_LCD_dt_object.time.hide_function = MMI_main_LCD_dt_time_hide_function;
- //PMT SUKRIT START 10112006
- #if defined(__MMI_UI_TECHNO_IDLESCREEN_BAR__) && defined(__MMI_MAINLCD_240X320__)
- main_LCD_dt_object.date.font=&MMI_medium_font; //Old:&MMI_large_font; //KP Jerry modify on 2006-11-15
- //main_LCD_dt_object.date.text_color = gui_color(255, 255, 255);
- //main_LCD_dt_object.date.text_border_color = gui_color(18, 114, 175);
- #elif defined(__MMI_UI_DALMATIAN_IDLESCREEN__)
- main_LCD_dt_object.date.font = &MMI_medium_font;
- //main_LCD_dt_object.date.text_color = *current_MMI_theme->title_text_color;
- //main_LCD_dt_object.date.text_border_color = gui_color(255, 255, 255);
- #else
- main_LCD_dt_object.date.font = &MMI_medium_font;
- #if 1
- //main_LCD_dt_object.date.text_color = *current_MMI_theme->idle_scr_date_color;
- #else
- /* under construction !*/
- #endif
- //main_LCD_dt_object.date.text_border_color = gui_color(0, 0, 0);
- #endif
- main_LCD_dt_object.date.text_color = *current_MMI_theme->idle_scr_date_color;
- main_LCD_dt_object.date.text_border_color = *current_MMI_theme->idle_scr_date_border_color;
- #ifdef __MMI_UI_DALMATIAN_IDLESCREEN__
- /* reset the display settings */
- main_LCD_dt_object.time.font = &MMI_medium_font;
- //main_LCD_dt_object.time.text_color = *current_MMI_theme->title_text_color;
- //main_LCD_dt_object.time.text_border_color = gui_color(255, 255, 255);
- #else /* __MMI_UI_DALMATIAN_IDLESCREEN__ */
- #if defined(__MMI_UI_TECHNO_IDLESCREEN_BAR__)
- main_LCD_dt_object.time.font=&wgui_dialer_box_f1; //Old:&MMI_medium_font; //KP Jerry modify on 2006-11-16
- #else
- main_LCD_dt_object.time.font = &MMI_large_font;
- #endif
- #if 1
- //main_LCD_dt_object.time.text_color = *current_MMI_theme->idle_scr_time_color; /* added by tk */
- #else
- /* under construction !*/
- #endif
- //main_LCD_dt_object.time.text_border_color = gui_color(0, 0, 0);
- //main_LCD_dt_object.time.text_border_color = *current_MMI_theme->idle_scr_time_border_color;
- #endif /* __MMI_UI_DALMATIAN_IDLESCREEN__ */
- main_LCD_dt_object.time.text_color = *current_MMI_theme->idle_scr_time_color;
- main_LCD_dt_object.time.text_border_color = *current_MMI_theme->idle_scr_time_border_color;
- //PMT SUKRIT END 10112006
- MMI_main_LCD_dt_hide_function = hide_main_LCD_date_time; /* set function pointer of hide func of date time of main lcd */
- MMI_main_LCD_dt_display_function = show_main_LCD_date_time; /* set func piinter of show date time of main lcd */
- #ifdef __MMI_UI_TECHNO_IDLESCREEN_BAR__
- MMI_main_LCD_dt_update_function = dt_update_analog_clock;
- #else
- MMI_main_LCD_dt_update_function = update_main_LCD_date_time; /* set function of upadet date time of main lcd */
- #endif
- MMI_main_LCD_dt_update_function(); /* upadet date tiem */
- enable_main_LCD_date_time_display = 0;
- MMI_main_LCD_dt_display_function(); /* display date tiem on main lcd */
- enable_main_LCD_date_time_display = 1;
- }
- break;
- /* Date/Time display is above softkeys */
- case DT_IDLE_SCREEN_2:
- {
- if (PhnsetGetShowDateTimeStatus() == MMI_FALSE)
- {
- break; /* check if dispaly tiem date on idel screen is enabel or not */
- }
- main_LCD_dt_object.flags = (flags & DT_FLAGS_TYPE);
- main_LCD_dt_object.date.hide_function = MMI_main_LCD_dt_date_hide_function;
- main_LCD_dt_object.time.hide_function = MMI_main_LCD_dt_time_hide_function;
- main_LCD_dt_object.date.font = &MMI_medium_font;
- //PMT SUKRIT START 10112006
- #if 1
- main_LCD_dt_object.date.text_color = *current_MMI_theme->idle_scr_date_color;
- #else
- /* under construction !*/
- #endif
- //main_LCD_dt_object.date.text_border_color = gui_color(0, 0, 0);
- main_LCD_dt_object.date.text_border_color = *current_MMI_theme->idle_scr_date_border_color;
- //PMT SUKRIT END 10112006
- main_LCD_dt_object.time.font = &MMI_medium_font;
- //PMT SUKRIT START 10112006
- #if 1
- main_LCD_dt_object.time.text_color = *current_MMI_theme->idle_scr_time_color;
- #else
- /* under construction !*/
- #endif
- //main_LCD_dt_object.time.text_border_color = gui_color(0, 0, 0);
- main_LCD_dt_object.time.text_border_color = *current_MMI_theme->idle_scr_time_border_color;
- //PMT SUKRIT END 10112006
- MMI_main_LCD_dt_hide_function = hide_main_LCD_date_time; /* set function pointer of hide func of date time of main lcd */
- MMI_main_LCD_dt_display_function = show_main_LCD_date_time; /* set func piinter of show date time of main lcd */
- MMI_main_LCD_dt_update_function = update_main_LCD_date_time; /* set function of upadet date time of main lcd */
- MMI_main_LCD_dt_update_function(); /* upadet date tiem */
- enable_main_LCD_date_time_display = 0;
- MMI_main_LCD_dt_display_function(); /* display date tiem on main lcd */
- enable_main_LCD_date_time_display = 1;
- }
- break;
- case DT_NETWORK_SEARCH:
- {
- main_LCD_dt_object.flags = (flags & DT_FLAGS_TYPE);
- main_LCD_dt_object.date.hide_function = MMI_main_LCD_dt_date_hide_function;
- main_LCD_dt_object.time.hide_function = MMI_main_LCD_dt_time_hide_function;
- main_LCD_dt_object.date.font = &MMI_small_font;
- #ifdef __MMI_UI_DALMATIAN_IDLESCREEN__
- main_LCD_dt_object.date.text_color = *current_MMI_theme->title_text_color;
- main_LCD_dt_object.date.text_border_color = gui_color(255, 255, 255);
- #else /* __MMI_UI_DALMATIAN_IDLESCREEN__ */
- main_LCD_dt_object.date.text_color = gui_color(0, 0, 0);
- main_LCD_dt_object.date.text_border_color = gui_color(255, 255, 255);
- #endif /* __MMI_UI_DALMATIAN_IDLESCREEN__ */
- main_LCD_dt_object.time.font = &MMI_medium_font;
- #ifdef __MMI_UI_DALMATIAN_IDLESCREEN__
- main_LCD_dt_object.time.text_color = *current_MMI_theme->title_text_color;
- main_LCD_dt_object.time.text_border_color = gui_color(255, 255, 255);
- #else /* __MMI_UI_DALMATIAN_IDLESCREEN__ */
- main_LCD_dt_object.time.text_color = gui_color(0, 0, 0);
- main_LCD_dt_object.time.text_border_color = gui_color(255, 255, 255);
- #endif /* __MMI_UI_DALMATIAN_IDLESCREEN__ */
- MMI_main_LCD_dt_hide_function = hide_main_LCD_date_time; /* set function pointer of hide func of main lcd */
- MMI_main_LCD_dt_display_function = show_main_LCD_date_time; /* set function pointer of show date/time of main lcd */
- MMI_main_LCD_dt_update_function = update_main_LCD_date_time; /* set function pointer of upadet date/time of main lcd */
- MMI_main_LCD_dt_update_function();
- enable_main_LCD_date_time_display = 0;
- MMI_main_LCD_dt_display_function();
- enable_main_LCD_date_time_display = 1;
- }
- break;
- #ifndef __MMI_CM_SCREEN_HIDE_DATE_TIME__
- case DT_MO_CALL_SCREEN:
- case DT_MO_CALLING_SCREEN:
- case DT_MT_CALL_SCREEN:
- {
- main_LCD_dt_object.flags = (flags & DT_FLAGS_TYPE);
- main_LCD_dt_object.date.hide_function = MMI_main_LCD_dt_date_hide_function;
- main_LCD_dt_object.time.hide_function = MMI_main_LCD_dt_time_hide_function;
- main_LCD_dt_object.date.font = &MMI_medium_font;
- main_LCD_dt_object.date.text_color = *current_MMI_theme->datetime_bar_date_text_color;
- main_LCD_dt_object.time.font = &MMI_medium_font;
- main_LCD_dt_object.time.text_color = *current_MMI_theme->datetime_bar_time_text_color;
- MMI_main_LCD_dt_hide_function = hide_main_LCD_date_time;
- MMI_main_LCD_dt_display_function = show_main_LCD_date_time;
- MMI_main_LCD_dt_update_function = update_main_LCD_date_time;
- MMI_main_LCD_dt_update_function();
- enable_main_LCD_date_time_display = 0;
- MMI_main_LCD_dt_display_function();
- enable_main_LCD_date_time_display = 1;
- }
- break;
- case DT_TABBED_CALL_SCREEN:
- case DT_ACTIVE_CALL_SCREEN:
- {
- main_LCD_dt_object.flags = (flags & DT_FLAGS_TYPE);
- main_LCD_dt_object.date.hide_function = MMI_main_LCD_dt_date_hide_function;
- main_LCD_dt_object.time.hide_function = MMI_main_LCD_dt_time_hide_function;
- main_LCD_dt_object.duration.hide_function = MMI_main_LCD_dt_duration_hide_function;
- main_LCD_dt_object.date.font = &MMI_medium_font;
- main_LCD_dt_object.date.text_color = *current_MMI_theme->datetime_bar_date_text_color;
- main_LCD_dt_object.time.font = &MMI_medium_font;
- main_LCD_dt_object.time.text_color = *current_MMI_theme->datetime_bar_time_text_color;
- main_LCD_dt_object.duration.font = &MMI_large_font;
- main_LCD_dt_object.duration.text_color = *current_MMI_theme->datetime_bar_duration_text_color;
- MMI_main_LCD_dt_hide_function = hide_main_LCD_date_time;
- MMI_main_LCD_dt_display_function = show_main_LCD_date_time;
- MMI_main_LCD_dt_update_function = update_main_LCD_date_time;
- if ((flags & DT_FLAGS_TYPE) == DT_TABBED_CALL_SCREEN)
- {
- gui_start_timer(1000, dt_update_duration_gprs);
- }
- else
- {
- gui_start_timer(1000, dt_update_duration);
- }
- MMI_main_LCD_dt_update_function();
- enable_main_LCD_date_time_display = 0;
- MMI_main_LCD_dt_display_function();
- enable_main_LCD_date_time_display = 1;
- }
- break;
- #endif /* __MMI_CM_SCREEN_HIDE_DATE_TIME__ */
- case DT_GPRS_ACTIVE_CALL:
- {
- main_LCD_dt_object.flags = (flags & DT_FLAGS_TYPE);
- main_LCD_dt_object.duration.hide_function = MMI_main_LCD_dt_duration_hide_function;
- main_LCD_dt_object.duration.font = &MMI_small_font;
- main_LCD_dt_object.duration.text_color = *current_MMI_theme->datetime_bar_duration_text_color;
- main_LCD_dt_object.duration.x = 0;
- main_LCD_dt_object.duration.y = MMI_status_bar_height;
- main_LCD_dt_object.duration.width = UI_device_width - 1;
- main_LCD_dt_object.duration.height = DURATION_CM_HEIGHT;
- MMI_main_LCD_dt_display_function = show_main_LCD_date_time; /* set func piinter of show date time of main lcd */
- MMI_main_LCD_dt_update_function = update_main_LCD_date_time;
- gui_start_timer(1000, dt_update_duration_gprs);
- enable_main_LCD_date_time_display = 0;
- MMI_main_LCD_dt_display_function();
- enable_main_LCD_date_time_display = 1;
- }
- break;
- case DT_GPRS_CONF_CALL:
- {
- main_LCD_dt_object.flags = (flags & DT_FLAGS_TYPE);
- main_LCD_dt_object.duration.hide_function = MMI_main_LCD_dt_duration_hide_function;
- main_LCD_dt_object.duration.font = &MMI_medium_font;
- main_LCD_dt_object.duration.text_color = *current_MMI_theme->datetime_bar_duration_text_color;
- main_LCD_dt_object.duration.x = 0;
- main_LCD_dt_object.duration.y = MMI_status_bar_height + 20;
- main_LCD_dt_object.duration.width = UI_device_width - 1;
- main_LCD_dt_object.duration.height = DURATION_CM_HEIGHT;
- MMI_main_LCD_dt_display_function = show_main_LCD_date_time; /* set func piinter of show date time of main lcd */
- MMI_main_LCD_dt_update_function = update_main_LCD_date_time;
- gui_start_timer(1000, dt_update_duration_gprs);
- enable_main_LCD_date_time_display = 0;
- MMI_main_LCD_dt_display_function();
- enable_main_LCD_date_time_display = 1;
- }
- #ifdef __MMI_SUBLCD__
- case DT_SUBLCD_IDLE_SCREEN1:
- {
- sub_LCD_dt_object1.flags = (flags & DT_FLAGS_TYPE);
- sub_LCD_dt_object1.date.hide_function = MMI_sub_LCD_dt_date_hide_function;
- sub_LCD_dt_object1.time.hide_function = MMI_sub_LCD_dt_time_hide_function;
- sub_LCD_dt_object1.date.font = &MMI_small_font;
- sub_LCD_dt_object1.date.text_color = gui_color(0, 0, 0);
- sub_LCD_dt_object1.time.font = &MMI_medium_font;
- sub_LCD_dt_object1.time.text_color = gui_color(0, 0, 0);
- sub_LCD_dt_object2.flags = (flags & DT_FLAGS_TYPE);
- sub_LCD_dt_object2.date.hide_function = MMI_sub_LCD_dt_date_hide_function;
- sub_LCD_dt_object2.time.hide_function = MMI_sub_LCD_dt_time_hide_function;
- sub_LCD_dt_object2.date.font = &MMI_small_font;
- sub_LCD_dt_object2.date.text_color = gui_color(0, 0, 0);
- sub_LCD_dt_object2.time.font = &MMI_medium_font;
- sub_LCD_dt_object2.time.text_color = gui_color(0, 0, 0);
- MMI_sub_LCD_dt_hide_function = hide_sub_LCD_date_time1;
- MMI_sub_LCD_dt_display_function = show_sub_LCD_date_time1;
- MMI_sub_LCD_dt_update_function = update_sub_LCD_date_time1;
- MMI_sub_LCD_dt_update_function();
- enable_sub_LCD_date_time_display = 0;
- MMI_sub_LCD_dt_display_function();
- enable_sub_LCD_date_time_display = 1;
- }
- break;
- case DT_SUBLCD_IDLE_SCREEN2:
- {
- sublcd_date_time_display_type = SUBLCD_DT_DATE_THEN_TIME_TYPE1;
- sub_LCD_dt_object1.flags = (flags & DT_FLAGS_TYPE);
- sub_LCD_dt_object1.date.hide_function = MMI_sub_LCD_dt_date_hide_function;
- sub_LCD_dt_object1.time.hide_function = MMI_sub_LCD_dt_time_hide_function;
- #ifdef __MMI_SUBLCD_DATE_LARGE_FONT__
- sub_LCD_dt_object1.date.font = &MMI_large_font;
- #else
- sub_LCD_dt_object1.date.font = &MMI_small_font;
- #endif
- #ifdef __MMI_SUB_WALLPAPER__
- sub_LCD_dt_object1.date.text_color = gui_color(255, 255, 255);
- sub_LCD_dt_object1.date.text_border_color = gui_color(0, 0, 0);
- #else /* __MMI_SUB_WALLPAPER__ */
- sub_LCD_dt_object1.date.text_color = gui_color(0, 0, 0);
- #endif /* __MMI_SUB_WALLPAPER__ */
- #ifdef __MMI_SUBLCD_TIME_LARGE_FONT__
- sub_LCD_dt_object1.time.font = &MMI_large_font;
- #else
- sub_LCD_dt_object1.time.font = &MMI_medium_font;
- #endif
- #ifdef __MMI_SUB_WALLPAPER__
- sub_LCD_dt_object1.time.text_color = gui_color(255, 255, 255);
- sub_LCD_dt_object1.time.text_border_color = gui_color(0, 0, 0);
- #else /* __MMI_SUB_WALLPAPER__ */
- sub_LCD_dt_object1.time.text_color = gui_color(0, 0, 0);
- #endif /* __MMI_SUB_WALLPAPER__ */
- MMI_sub_LCD_dt_hide_function = hide_sub_LCD_date_time2;
- MMI_sub_LCD_dt_display_function = show_sub_LCD_date_time2;
- MMI_sub_LCD_dt_update_function = update_sub_LCD_date_time2;
- MMI_sub_LCD_dt_update_function();
- enable_sub_LCD_date_time_display = 0;
- MMI_sub_LCD_dt_display_function();
- enable_sub_LCD_date_time_display = 1;
- }
- break;
- case DT_SUBLCD_IDLE_SCREEN3:
- {
- sublcd_date_time_display_type = SUBLCD_DT_TIME_THEN_DATE_TYPE1;
- sub_LCD_dt_object1.flags = (flags & DT_FLAGS_TYPE);
- sub_LCD_dt_object1.date.hide_function = MMI_sub_LCD_dt_date_hide_function;
- sub_LCD_dt_object1.time.hide_function = MMI_sub_LCD_dt_time_hide_function;
- #ifdef __MMI_SUBLCD_DATE_LARGE_FONT__
- sub_LCD_dt_object1.date.font = &MMI_large_font;
- #else
- sub_LCD_dt_object1.date.font = &MMI_small_font;
- #endif
- #ifdef __MMI_SUB_WALLPAPER__
- sub_LCD_dt_object1.date.text_color = gui_color(255, 255, 255);
- sub_LCD_dt_object1.date.text_border_color = gui_color(0, 0, 0);
- #else /* __MMI_SUB_WALLPAPER__ */
- sub_LCD_dt_object1.date.text_color = gui_color(0, 0, 0);
- #endif /* __MMI_SUB_WALLPAPER__ */
- #ifdef __MMI_SUBLCD_TIME_LARGE_FONT__
- sub_LCD_dt_object1.time.font = &MMI_sublcd_font;
- #else
- sub_LCD_dt_object1.time.font = &MMI_medium_font;
- #endif
- #ifdef __MMI_SUB_WALLPAPER__
- sub_LCD_dt_object1.time.text_color = gui_color(255, 255, 255);
- sub_LCD_dt_object1.time.text_border_color = gui_color(0, 0, 0);
- #else /* __MMI_SUB_WALLPAPER__ */
- sub_LCD_dt_object1.time.text_color = gui_color(0, 0, 0);
- #endif /* __MMI_SUB_WALLPAPER__ */
- MMI_sub_LCD_dt_hide_function = hide_sub_LCD_date_time2;
- MMI_sub_LCD_dt_display_function = show_sub_LCD_date_time2;
- MMI_sub_LCD_dt_update_function = update_sub_LCD_date_time2;
- MMI_sub_LCD_dt_update_function();
- enable_sub_LCD_date_time_display = 0;
- MMI_sub_LCD_dt_display_function();
- enable_sub_LCD_date_time_display = 1;
- }
- break;
- case DT_SUBLCD_IDLE_SCREEN4:
- {
- sublcd_date_time_display_type = SUBLCD_DT_TIME_THEN_DATE_TYPE1;
- sub_LCD_dt_object1.flags = (flags & DT_FLAGS_TYPE);
- sub_LCD_dt_object1.date.hide_function = MMI_sub_LCD_dt_date_hide_function;
- sub_LCD_dt_object1.time.hide_function = MMI_sub_LCD_dt_time_hide_function;
- sub_LCD_dt_object1.date.font = &MMI_medium_font;
- #ifdef __MMI_SUB_WALLPAPER__
- sub_LCD_dt_object1.date.text_color = gui_color(255, 255, 255);
- sub_LCD_dt_object1.date.text_border_color = gui_color(0, 0, 0);
- #else /* __MMI_SUB_WALLPAPER__ */
- sub_LCD_dt_object1.date.text_color = gui_color(130, 230, 220);
- #endif /* __MMI_SUB_WALLPAPER__ */
- sub_LCD_dt_object1.time.font = &MMI_sublcd_font;
- #ifdef __MMI_SUB_WALLPAPER__
- sub_LCD_dt_object1.time.text_color = gui_color(255, 255, 255);
- sub_LCD_dt_object1.time.text_border_color = gui_color(0, 0, 0);
- #else /* __MMI_SUB_WALLPAPER__ */
- sub_LCD_dt_object1.time.text_color = gui_color(255, 255, 0);
- #endif /* __MMI_SUB_WALLPAPER__ */
- MMI_sub_LCD_dt_hide_function = hide_sub_LCD_date_time2;
- MMI_sub_LCD_dt_display_function = show_sub_LCD_date_time2;
- MMI_sub_LCD_dt_update_function = update_sub_LCD_date_time2;
- MMI_sub_LCD_dt_update_function();
- enable_sub_LCD_date_time_display = 0;
- MMI_sub_LCD_dt_display_function();
- enable_sub_LCD_date_time_display = 1;
- }
- break;
- #endif /* __MMI_SUBLCD__ */
- case DT_DIGITAL_CLOCK_SC1:
- case DT_DIGITAL_CLOCK_SC2:
- case DT_DIGITAL_CLOCK_SC3:
- {
- if (PhnsetGetShowDateTimeStatus() == MMI_FALSE)
- {
- show_date = 1;
- }
- else
- {
- show_date = 0;
- }
- main_LCD_dt_object.flags = (flags & DT_FLAGS_TYPE);
- main_LCD_dt_object.date.hide_function = MMI_main_LCD_dt_date_hide_function;
- main_LCD_dt_object.time.hide_function = MMI_main_LCD_dt_time_hide_function;
- main_LCD_dt_object.date.font = &MMI_medium_font;
- #ifdef __MMI_UI_DALMATIAN_IDLESCREEN__
- main_LCD_dt_object.date.text_color = *current_MMI_theme->title_text_color;
- main_LCD_dt_object.date.text_border_color = gui_color(255, 255, 255);
- main_LCD_dt_object.time.font = &MMI_medium_font;
- main_LCD_dt_object.time.text_color = *current_MMI_theme->title_text_color;
- main_LCD_dt_object.time.text_border_color = gui_color(255, 255, 255);
- #else /* __MMI_UI_DALMATIAN_IDLESCREEN__ */
- main_LCD_dt_object.date.text_color = gui_color(0, 0, 0);
- main_LCD_dt_object.date.text_border_color = gui_color(255, 255, 255);
- main_LCD_dt_object.time.font = &MMI_large_font;
- main_LCD_dt_object.time.text_color = gui_color(0, 0, 0);
- main_LCD_dt_object.time.text_border_color = gui_color(255, 255, 255);
- #endif /* __MMI_UI_DALMATIAN_IDLESCREEN__ */
- MMI_main_LCD_dt_hide_function = hide_main_LCD_date_time;
- MMI_main_LCD_dt_display_function = show_main_LCD_date_time;
- MMI_main_LCD_dt_update_function = update_main_LCD_date_time;
- MMI_main_LCD_dt_update_function();
- enable_main_LCD_date_time_display = 0;
- MMI_main_LCD_dt_display_function();
- enable_main_LCD_date_time_display = 1;
- }
- break;
- #ifdef __MMI_ANALOG_CLOCK__
- case DT_ANALOG_CLOCK_SC:
- {
- if (PhnsetGetShowDateTimeStatus() == MMI_FALSE) /* check if display of date is enable on idle screen or not */
- {
- show_date = 1;
- }
- else
- {
- show_date = 0;
- }
- main_LCD_dt_object.flags = (flags & DT_FLAGS_TYPE);
- main_LCD_dt_object.date.hide_function = MMI_main_LCD_dt_date_hide_function;
- main_LCD_dt_object.time.hide_function = MMI_main_LCD_dt_time_hide_function;
- main_LCD_dt_object.date.font = &MMI_medium_font;
- #ifdef __MMI_UI_DALMATIAN_IDLESCREEN__
- main_LCD_dt_object.date.text_color = *current_MMI_theme->title_text_color;
- main_LCD_dt_object.date.text_border_color = gui_color(255, 255, 255);
- #else /* __MMI_UI_DALMATIAN_IDLESCREEN__ */
- main_LCD_dt_object.date.text_color = gui_color(0, 0, 0);
- main_LCD_dt_object.date.text_border_color = gui_color(255, 255, 255);
- #endif /* __MMI_UI_DALMATIAN_IDLESCREEN__ */
- MMI_main_LCD_dt_hide_function = hide_main_LCD_date_time;
- MMI_main_LCD_dt_display_function = show_main_LCD_date_time;
- MMI_main_LCD_dt_update_function = dt_update_analog_clock;
- MMI_main_LCD_dt_update_function();
- enable_main_LCD_date_time_display = 0;
- MMI_main_LCD_dt_display_function();
- enable_main_LCD_date_time_display = 1;
- }
- break;
- #endif /* __MMI_ANALOG_CLOCK__ */
- case DT_AUDIO_PLAY_DURATION:
- {
- main_LCD_dt_object.flags = (flags & DT_FLAGS_TYPE);
- main_LCD_dt_object.duration.x = 6;
- main_LCD_dt_object.duration.y = 30;
- main_LCD_dt_object.duration.width = 44;
- main_LCD_dt_object.duration.height = 19;
- main_LCD_dt_object.duration.hide_function = MMI_main_LCD_dt_duration_hide_function;
- #ifdef __MMI_UI_DALMATIAN_IDLESCREEN__
- main_LCD_dt_object.duration.font = &MMI_medium_font;
- main_LCD_dt_object.duration.text_color = *current_MMI_theme->title_text_color;
- #else /* __MMI_UI_DALMATIAN_IDLESCREEN__ */
- main_LCD_dt_object.duration.font = &MMI_large_font;
- main_LCD_dt_object.duration.text_color = gui_color(0, 255, 0);
- #endif /* __MMI_UI_DALMATIAN_IDLESCREEN__ */
- MMI_main_LCD_dt_display_function = show_main_LCD_date_time;
- MMI_main_LCD_dt_update_function = update_main_LCD_date_time;
- MMI_main_LCD_dt_update_function();
- enable_main_LCD_date_time_display = 0;
- MMI_main_LCD_dt_display_function();
- enable_main_LCD_date_time_display = 1;
- }
- break;
- #ifdef __MMI_SUBLCD_SHOW_ANALOG_CLOCK__
- case DT_SUBLCD_ANALOG_CLOCK:
- {
- MMI_sub_LCD_dt_hide_function = UI_dummy_function;
- MMI_sub_LCD_dt_display_function = RedrawSubLCDAnalogClockScreen;
- MMI_sub_LCD_dt_update_function = dt_update_analog_clock;
- }
- break;
- #endif /* __MMI_SUBLCD_SHOW_ANALOG_CLOCK__ */
- default:
- reset_dt_display();
- }
- gdi_layer_unlock_frame_buffer();
- }
- /*****************************************************************************
- * FUNCTION
- * close_main_LCD_dt_display
- * DESCRIPTION
- * set all function pointer of date tiem display ofmain lcd
- * to dummy functions
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void close_main_LCD_dt_display(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_main_LCD_dt_update_function = UI_dummy_function;
- MMI_main_LCD_dt_display_function = UI_dummy_function;
- MMI_main_LCD_dt_hide_function = UI_dummy_function;
- MMI_main_LCD_dt_close_function();
- MMI_main_LCD_dt_close_function = UI_dummy_function;
- MMI_main_LCD_dt_date_hide_function = UI_dummy_hide_function;
- MMI_main_LCD_dt_time_hide_function = UI_dummy_hide_function;
- MMI_main_LCD_dt_duration_hide_function = UI_dummy_hide_function;
- gui_cancel_timer(dt_update_duration);
- gui_cancel_timer(dt_update_duration_gprs);
- gui_cancel_timer(dt_update_duration_cat19);
- }
- /*****************************************************************************