wgui_categories_idlescreen.c
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:211k
源码类别:

MTK

开发平台:

C/C++

  1. #if defined(__MMI_TOUCH_IDLESCREEN_SHORTCUTS__)
  2.         gui_measure_image((PU8) GetImage((U16) (IMG_IDLE_MAINMENU_SHORCUT + i)), &image_width[i], &image_height[i]);
  3.         total_width += image_width[i];
  4.         touch_idle_shortcuts[i].height = image_height[i];
  5.         touch_idle_shortcuts[i].width = image_width[i];
  6. #elif defined(__MMI_TOUCH_IDLESCREEN_HW_SHORTCUTS__)
  7. touch_idle_shortcuts[i].height = TOUCHPANEL_HW_SHORTCUT_AREA_HEIGHT;
  8. touch_idle_shortcuts[i].width = (S32)(LCD_WIDTH/MAX_IDLE_SCREEN_SHORTCUTS);
  9. #endif
  10. //KP Jerry modify on 2007-3-7 end
  11.     }
  12. //KP Jerry modify on 2007-3-7 start
  13. #if defined(__MMI_TOUCH_IDLESCREEN_SHORTCUTS__)
  14.     MMI_DBG_ASSERT(total_width >= 0 && total_width <= UI_device_width);
  15. #endif
  16. //KP Jerry modify on 2007-3-7 end
  17. //KP Jerry modify on 2007-3-7 start
  18. #if defined(__MMI_TOUCH_IDLESCREEN_SHORTCUTS__) 
  19.     //PMT HIMANSHU START 20050721   
  20.     //      touch_idle_shortcuts[0].entryfn = NULL; /* Needs to be decided */
  21.     touch_idle_shortcuts[0].entryfn = EntryMainMenuFromIdleScreen;
  22.     /* PMT HIMANSHU END 20050721 */
  23.     touch_idle_shortcuts[1].entryfn = EntryScrMessagesMenuList;
  24.     touch_idle_shortcuts[2].entryfn = mmi_phb_entry_main_menu;
  25.     touch_idle_shortcuts[3].entryfn = IdleScreenDigitHandler;
  26. #elif defined(__MMI_TOUCH_IDLESCREEN_HW_SHORTCUTS__)
  27. touch_idle_shortcuts[0].entryfn = EntryMainMenuFromIdleScreen;
  28. touch_idle_shortcuts[1].entryfn = mmi_phb_entry_main_menu;
  29. touch_idle_shortcuts[2].entryfn = EntryScrMessagesMenuList;
  30. touch_idle_shortcuts[3].entryfn = mmi_camera_entry_app_screen;
  31. touch_idle_shortcuts[4].entryfn = mmi_vdoply_entry_app;
  32. #endif
  33. //KP Jerry modify on 2007-3-7 end
  34. //KP Jerry modify on 2007-3-7 start
  35. #ifdef __MMI_TOUCH_IDLESCREEN_SHORTCUTS__
  36.     x_margin = (UI_device_width - total_width) / ((MAX_IDLE_SCREEN_SHORTCUTS - 1) + 2); /* Margin between shortcut Images,Leave margin on front and back also */
  37.     x = x_margin;
  38. #endif
  39. //KP Jerry modify on 2007-3-7 end
  40.     for (i = 0; i < MAX_IDLE_SCREEN_SHORTCUTS; i++)
  41.     {
  42. //KP Jerry modify on 2007-3-7 start
  43. #if defined(__MMI_TOUCH_IDLESCREEN_SHORTCUTS__)
  44.         touch_idle_shortcuts[i].x = x;
  45.         touch_idle_shortcuts[i].y = UI_device_height - touch_idle_shortcuts[i].height;
  46.         x += touch_idle_shortcuts[i].width + x_margin;
  47. #elif defined(__MMI_TOUCH_IDLESCREEN_HW_SHORTCUTS__)
  48. touch_idle_shortcuts[i].x = (i * ((S32)(LCD_WIDTH/MAX_IDLE_SCREEN_SHORTCUTS)));
  49. touch_idle_shortcuts[i].y = LCD_HEIGHT;
  50. #endif
  51. //KP Jerry modify on 2007-3-7 end
  52.     }
  53. }
  54. #ifdef __MMI_TOUCH_IDLESCREEN_SHORTCUTS__     //KP Jerry add on 2007-3-7
  55. /*****************************************************************************
  56.  * FUNCTION
  57.  *  display_touch_idle_screen_shortcuts
  58.  * DESCRIPTION
  59.  *  This function is used to draw touch screen shortcuts
  60.  * PARAMETERS
  61.  *  void
  62.  * RETURNS
  63.  *  void
  64.  * REMARKS
  65.  *  This routine is dependent on Order of Image Id's of Shortcut Item Images.
  66.  *  DON'T CHANGE THE ORDER OF IMAGE ID's
  67.  *****************************************************************************/
  68. void display_touch_idle_screen_shortcuts(void)
  69. {
  70.     /*----------------------------------------------------------------*/
  71.     /* Local Variables                                                */
  72.     /*----------------------------------------------------------------*/
  73.     S32 i, max_height;
  74.     /*----------------------------------------------------------------*/
  75.     /* Code Body                                                      */
  76.     /*----------------------------------------------------------------*/
  77.     //PMT HIMANSHU START 20050809
  78.     //      function is added for calculating the maximum height of idlescreen shortcut
  79.     //      max_height = touch_idle_shortcuts[0].height;    /*In case Image's are of different height, Find the maximum height image*/
  80.     gui_lock_double_buffer();
  81.     for (i = 0; i < MAX_IDLE_SCREEN_SHORTCUTS; i++)
  82.     {
  83.         gui_show_image(
  84.             touch_idle_shortcuts[i].x,
  85.             touch_idle_shortcuts[i].y,
  86.             get_image((MMI_ID_TYPE) (IMG_IDLE_MAINMENU_SHORCUT + i)));
  87.         //              if(max_height < touch_idle_shortcuts[i].height)
  88.         //                      max_height = touch_idle_shortcuts[i].height;
  89.     }
  90.     max_height = max_touch_idle_screen_shortcut_height();
  91.     /* PMT HIMANSHU END 20050809 */
  92.     gui_unlock_double_buffer();
  93.     gui_BLT_double_buffer(0, UI_device_height - max_height, UI_device_width, UI_device_height);
  94. }
  95. /* PMT HIMANSHU START 20050809 */
  96. /*****************************************************************************
  97.  * FUNCTION
  98.  *  max_touch_idle_screen_shortcut_height
  99.  * DESCRIPTION
  100.  *  This function is used to find the maximum height of idlescreen shortcut
  101.  *  among them.
  102.  * PARAMETERS
  103.  *  void
  104.  * RETURNS
  105.  *  S32 max_height
  106.  * REMARKS
  107.  *  
  108.  *****************************************************************************/
  109. S32 max_touch_idle_screen_shortcut_height(void)
  110. {
  111.     /*----------------------------------------------------------------*/
  112.     /* Local Variables                                                */
  113.     /*----------------------------------------------------------------*/
  114.     S32 i, max_height;
  115.     /*----------------------------------------------------------------*/
  116.     /* Code Body                                                      */
  117.     /*----------------------------------------------------------------*/
  118.     /* In case Image's are of different height, Find the maximum height image */
  119.     max_height = touch_idle_shortcuts[0].height;
  120.     for (i = 0; i < MAX_IDLE_SCREEN_SHORTCUTS; i++)
  121.     {
  122.         if (max_height < touch_idle_shortcuts[i].height)
  123.         {
  124.             max_height = touch_idle_shortcuts[i].height;
  125.         }
  126.     }
  127.     return (max_height);
  128. }
  129. #endif /*(__MMI_TOUCH_IDLESCREEN_SHORTCUTS__)*/     //KP Jerry add on 2007-3-7
  130. /* PMT HIMANSHU END 20050809 */
  131. #endif /* (__MMI_TOUCH_IDLESCREEN_SHORTCUTS__) ||(__MMI_TOUCH_IDLESCREEN_HW_SHORTCUTS__)*/     //KP Jerry add "__MMI_TOUCH_IDLESCREEN_HW_SHORTCUTS__" on 2007-3-7
  132. /* ~] */
  133. /* PMT VIKAS START 20051010 */
  134. #ifdef __MMI_UI_STATUS_BAR_AT_BOTTOM__
  135. /*****************************************************************************
  136.  * FUNCTION
  137.  *  show_boundries_to_status_bar_at_bottom_idlescreen
  138.  * DESCRIPTION
  139.  *  
  140.  * PARAMETERS
  141.  *  void
  142.  * RETURNS
  143.  *  void
  144.  *****************************************************************************/
  145. void show_boundries_to_status_bar_at_bottom_idlescreen(void)
  146. {
  147.     /*----------------------------------------------------------------*/
  148.     /* Local Variables                                                */
  149.     /*----------------------------------------------------------------*/
  150.     color c;
  151.     /*----------------------------------------------------------------*/
  152.     /* Code Body                                                      */
  153.     /*----------------------------------------------------------------*/
  154.     c = gui_color(255, 255, 255);
  155.     gui_draw_horizontal_line(0, UI_device_width - 1, UI_device_height - 1 - MMI_button_bar_height, c);
  156.     gui_draw_horizontal_line(
  157.         0,
  158.         UI_device_width - 1,
  159.         UI_device_height - 1 - MMI_button_bar_height - MMI_status_bar_height - 2,
  160.         c);
  161.     gui_draw_horizontal_line(0, UI_device_width - 1, 0, c);
  162. #ifdef __MMI_MAINLCD_128X128__
  163.     gui_draw_horizontal_line(0, UI_device_width - 1, MMI_status_bar_height + 2, c);
  164. #else 
  165.     gui_draw_horizontal_line(0, UI_device_width - 1, MMI_status_bar_height, c);
  166. #endif 
  167. }
  168. #endif /* __MMI_UI_STATUS_BAR_AT_BOTTOM__ */ 
  169. /*****************************************************************************
  170.  * FUNCTION
  171.  *  RedrawCategory33Screen
  172.  * DESCRIPTION
  173.  *  
  174.  * PARAMETERS
  175.  *  void
  176.  * RETURNS
  177.  *  void
  178.  *****************************************************************************/
  179. void RedrawCategory33Screen(void)
  180. {
  181.     /*----------------------------------------------------------------*/
  182.     /* Local Variables                                                */
  183.     /*----------------------------------------------------------------*/
  184.     /*----------------------------------------------------------------*/
  185.     /* Code Body                                                      */
  186.     /*----------------------------------------------------------------*/
  187. #ifndef __GDI_MEMORY_PROFILE_2__
  188.     gui_cancel_timer(cat33_animation_processor);
  189. #endif 
  190. #ifdef __MMI_UI_TECHNO_IDLESCREEN_BAR__
  191.     gui_push_clip();
  192.     gui_set_clip(0, MMI_status_bar_height, UI_device_width - 1, MMI_status_bar_height + MMI_IDLESCREEN_BAR_HEIGHT - 1);
  193. #ifndef __MMI_UI_TECHNO_STATUS_ICON__
  194.     if (PhnsetGetShowDateTimeStatus() == MMI_TRUE)
  195. #endif 
  196. //KP Jerry modify on 2007-1-5 start
  197. #ifndef __MMI_UI_TECHNO_IDLESCREEN_BAR_HALF_TRANSPARENT_DISPLAY__
  198.         gui_show_image(0, MMI_status_bar_height, get_image(idlescreen_bar_id));//070306 Alpha layer
  199. #else
  200. gui_reset_clip();
  201. gui_lock_double_buffer();
  202. gdi_draw_solid_rect(0,MMI_status_bar_height,UI_device_width-1,MMI_status_bar_height+MMI_IDLESCREEN_BAR_HEIGHT-1,GDI_COLOR_HALF_TRANSPARENT);
  203. gui_unlock_double_buffer();
  204. gui_BLT_double_buffer(0,MMI_status_bar_height,UI_device_width-1,MMI_status_bar_height+MMI_IDLESCREEN_BAR_HEIGHT-1);
  205. #endif
  206. //KP Jerry modify on 2007-1-5 end
  207.     gui_pop_clip();
  208. #endif /* __MMI_UI_TECHNO_IDLESCREEN_BAR__ */ 
  209. #ifdef __GDI_MEMORY_PROFILE_2__
  210.     update_mainlcd_dt_display();
  211. #else 
  212.     show_main_LCD_dt_display();
  213. #endif 
  214. #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
  215.     MMI_title_string = NULL;
  216.     MMI_title_icon = NULL;
  217.     draw_title();
  218.     arrange_status_icons();
  219. #endif /* __MMI_UI_DALMATIAN_STATUSBAR__ */ 
  220. #ifndef __MMI_IDLE_FULL_SCREEN__
  221.     idle_screen_hide_status_icons_bar0();
  222. #endif 
  223.     in_idle_screen();
  224. #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
  225.     disable_statusbar_fill_background();
  226. #endif 
  227.     show_status_icons();
  228. #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
  229.     enable_statusbar_fill_background();
  230.     refresh_fixed_status_icon(STATUS_ICON_SIGNAL_STRENGTH, 0);
  231.     refresh_fixed_status_icon(STATUS_ICON_BATTERY_STRENGTH, 1);
  232. #endif /* __MMI_UI_DALMATIAN_STATUSBAR__ */ 
  233. #ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
  234.     is_button_bar_shuffled = 0;
  235. #endif 
  236. #ifdef __MMI_UI_TECHNO_STATUS_ICON__
  237.     refresh_fixed_status_icon(STATUS_ICON_SIGNAL_STRENGTH, 0);
  238.     refresh_fixed_status_icon(STATUS_ICON_BATTERY_STRENGTH, 0);
  239. #endif /* __MMI_UI_TECHNO_STATUS_ICON__ */ 
  240.     if (idle_screen_type == ANALOG_IDLE_SCREEN || idle_screen_type == DIGITAL_IDLE_SCREEN)
  241.     {
  242.         idle_screen_show_network_name();
  243.     }
  244.     else
  245.     {
  246.         idle_screen_show_network_details();
  247.     }
  248. #ifdef __MMI_IDLE_FULL_SCREEN__
  249.     on_idle_screen = 1;
  250. #endif 
  251.     set_on_idlescreen(1);
  252. #ifdef __MMI_UI_STATUS_BAR_AT_BOTTOM__
  253.     show_boundries_to_status_bar_at_bottom_idlescreen();
  254. #endif 
  255. #if defined(__MMI_TOUCH_IDLESCREEN_SHORTCUTS__)
  256.     if (mmi_bootup_get_active_flight_mode() == 0)
  257.     {
  258.         display_touch_idle_screen_shortcuts();
  259.     }
  260. #endif /* defined(__MMI_TOUCH_IDLESCREEN_SHORTCUTS__) */ 
  261.     register_hide_status_icon_bar(0, idle_screen_hide_status_icons_bar0);
  262.     register_hide_status_icon_bar(1, idle_screen_hide_status_icons_bar1);
  263. #if(ENABLE_ANIMATED_WALLPAPERS)
  264. #ifndef __GDI_MEMORY_PROFILE_2__
  265.     if (cat33_n_frames > 1 && idle_screen_wallpaper_ID != 0)
  266.     {
  267.         gui_start_timer(cat33_animation_delay, cat33_animation_processor);
  268.     }
  269. #endif /* __GDI_MEMORY_PROFILE_2__ */ 
  270. #endif /* (ENABLE_ANIMATED_WALLPAPERS) */ 
  271. show_fixed_matrix();
  272. gui_show_fixed_list_menu(&idle_list_menu);
  273. }
  274. /*****************************************************************************
  275.  * FUNCTION
  276.  *  dm_category_33_controlled_area
  277.  * DESCRIPTION
  278.  *  This function is used to draw the category controlled area of idle screen
  279.  * PARAMETERS
  280.  *  coordinate      [IN/OUT]        Coordinates of category controlled area.
  281.  * RETURNS
  282.  *  void
  283.  *****************************************************************************/
  284. void dm_category_33_controlled_area(dm_coordinates *coordinate)
  285. {
  286.     /*----------------------------------------------------------------*/
  287.     /* Local Variables                                                */
  288.     /*----------------------------------------------------------------*/
  289.     /*----------------------------------------------------------------*/
  290.     /* Code Body                                                      */
  291.     /*----------------------------------------------------------------*/
  292.     RedrawCategory33Screen();
  293. }
  294. #ifdef __MMI_TOUCH_SCREEN__
  295. /* [~PMT  MANISH   20050623 */
  296. #if ( defined(__MMI_TOUCH_IDLESCREEN_SHORTCUTS__) || defined(__MMI_TOUCH_IDLESCREEN_HW_SHORTCUTS__) )    //KP Jerry add "__MMI_TOUCH_IDLESCREEN_HW_SHORTCUTS__" on 2006-11-2
  297. #ifdef __MMI_TOUCH_IDLESCREEN_SHORTCUTS__     //KP Jerry add on 2007-3-7
  298. /*****************************************************************************
  299.  * FUNCTION
  300.  *  gui_idle_touch_screen_display_shorcut_item
  301.  * DESCRIPTION
  302.  *  This function is Display individual shorcut item on Touch idle screen
  303.  * PARAMETERS
  304.  *  index       [IN]        
  305.  * RETURNS
  306.  *  void
  307.  * REMARKS
  308.  *  
  309.  *****************************************************************************/
  310. void gui_idle_touch_screen_display_shorcut_item(S32 index)
  311. {
  312.     /*----------------------------------------------------------------*/
  313.     /* Local Variables                                                */
  314.     /*----------------------------------------------------------------*/
  315.     /* PMT HIMANSHU START 20050726 */
  316.     S32 x1, y1, x2, y2;
  317.     /*----------------------------------------------------------------*/
  318.     /* Code Body                                                      */
  319.     /*----------------------------------------------------------------*/
  320.     /* PMT HIMANSHU END 20050726 */
  321.     MMI_DBG_ASSERT(index >= 0 && index < MAX_IDLE_SCREEN_SHORTCUTS);
  322.     /* PMT HIMANSHU START 20050726 */
  323.     x1 = touch_idle_shortcuts[index].x;
  324.     y1 = touch_idle_shortcuts[index].y;
  325.     x2 = touch_idle_shortcuts[index].x + touch_idle_shortcuts[index].width - 1;
  326.     y2 = touch_idle_shortcuts[index].y + touch_idle_shortcuts[index].height - 1;
  327.     /* PMT HIMANSHU END 20050726 */
  328.     gui_lock_double_buffer();
  329.     /* PMT HIMANSHU START 20050726 */
  330.     gui_push_clip();
  331.     gui_set_clip(x1, y1, x2, y2);
  332. #ifdef __GDI_MEMORY_PROFILE_2__
  333.     /* gui_fill_rectangle(x1, y1, x2, y2, wgui_transparent_color); */
  334.     gdi_draw_solid_rect(x1, y1, x2, y2, GDI_COLOR_TRANSPARENT); /* 112205 transparent color Calvin */
  335. #else /* __GDI_MEMORY_PROFILE_2__ */ 
  336.     draw_wallpaper();
  337. #endif /* __GDI_MEMORY_PROFILE_2__ */ 
  338.     /* gui_show_image(touch_idle_shortcuts[index].x,touch_idle_shortcuts[index].y,GetImage((U16)(IMG_IDLE_MAINMENU_SHORCUT+index))); */
  339.     gui_show_image(x1, y1, (PU8) GetImage((U16) (IMG_IDLE_MAINMENU_SHORCUT + index)));
  340.     gui_pop_clip();
  341.     gui_unlock_double_buffer();
  342.     /* gui_BLT_double_buffer(touch_idle_shortcuts[index].x,touch_idle_shortcuts[index].y,touch_idle_shortcuts[index].x+touch_idle_shortcuts[index].width,touch_idle_shortcuts[index].y+touch_idle_shortcuts[index].height); */
  343.     gui_BLT_double_buffer(x1, y1, x2, y2);
  344.     /* PMT HIMANSHU END 20050726 */
  345. }
  346. /*****************************************************************************
  347.  * FUNCTION
  348.  *  gui_idle_touch_screen_display_pressed_shorcut_item
  349.  * DESCRIPTION
  350.  *  This function is Display individual pressed shorcut item on Touch idle screen
  351.  * PARAMETERS
  352.  *  index       [IN]        
  353.  * RETURNS
  354.  *  void
  355.  * REMARKS
  356.  *  
  357.  *****************************************************************************/
  358. void gui_idle_touch_screen_display_pressed_shorcut_item(S32 index)
  359. {
  360.     /*----------------------------------------------------------------*/
  361.     /* Local Variables                                                */
  362.     /*----------------------------------------------------------------*/
  363.     /* PMT HIMANSHU START 20050726 */
  364.     S32 x1, y1, x2, y2;
  365.     /*----------------------------------------------------------------*/
  366.     /* Code Body                                                      */
  367.     /*----------------------------------------------------------------*/
  368.     /* PMT HIMANSHU END 20050726 */
  369.     MMI_DBG_ASSERT(index >= 0 && index < MAX_IDLE_SCREEN_SHORTCUTS);
  370.     /* PMT HIMANSHU START 20050726 */
  371.     x1 = touch_idle_shortcuts[index].x;
  372.     y1 = touch_idle_shortcuts[index].y;
  373.     x2 = touch_idle_shortcuts[index].x + touch_idle_shortcuts[index].width - 1;
  374.     y2 = touch_idle_shortcuts[index].y + touch_idle_shortcuts[index].height - 1;
  375.     /* PMT HIMANSHU END 20050726 */
  376.     gui_lock_double_buffer();
  377.     /* PMT HIMANSHU START 20050726 */
  378.     gui_push_clip();
  379.     gui_set_clip(x1, y1, x2, y2);
  380. #ifdef __GDI_MEMORY_PROFILE_2__
  381.     /* gui_fill_rectangle(x1, y1, x2, y2, wgui_transparent_color); */
  382.     gdi_draw_solid_rect(x1, y1, x2, y2, GDI_COLOR_TRANSPARENT); /* 112205 transparent color Calvin */
  383. #else /* __GDI_MEMORY_PROFILE_2__ */ 
  384.     draw_wallpaper();
  385. #endif /* __GDI_MEMORY_PROFILE_2__ */ 
  386.     /* gui_show_image(touch_idle_shortcuts[index].x,touch_idle_shortcuts[index].y,GetImage((U16)(IMG_IDLE_MAINMENU_SHORCUT_PRESSED+index))); */
  387.     gui_show_image(x1, y1, (PU8) GetImage((U16) (IMG_IDLE_MAINMENU_SHORCUT_PRESSED + index)));
  388.     gui_pop_clip();
  389.     gui_unlock_double_buffer();
  390.     /* gui_BLT_double_buffer(touch_idle_shortcuts[index].x,touch_idle_shortcuts[index].y,touch_idle_shortcuts[index].x+touch_idle_shortcuts[index].width,touch_idle_shortcuts[index].y+touch_idle_shortcuts[index].height); */
  391.     gui_BLT_double_buffer(x1, y1, x2, y2);
  392.     /* PMT HIMANSHU END 20050726 */
  393. }
  394. #endif   /*(__MMI_TOUCH_IDLESCREEN_SHORTCUTS__)*/     //KP Jerry add on 2007-3-7
  395. /*****************************************************************************
  396.  * FUNCTION
  397.  *  gui_idle_touch_screen_shortcut_translate_pen_position
  398.  * DESCRIPTION
  399.  *  This function finds index of shorcut item on which pen event came
  400.  * PARAMETERS
  401.  *  x           [IN]        Pen's x position
  402.  *  y           [IN]        Pen's y position
  403.  *  index       [OUT]       Index of selected item
  404.  * RETURNS
  405.  *  void
  406.  * REMARKS
  407.  *  
  408.  *****************************************************************************/
  409. void gui_idle_touch_screen_shortcut_translate_pen_position(S32 x, S32 y, S32 *index)
  410. {
  411.     /*----------------------------------------------------------------*/
  412.     /* Local Variables                                                */
  413.     /*----------------------------------------------------------------*/
  414.     S32 i;
  415.     /*----------------------------------------------------------------*/
  416.     /* Code Body                                                      */
  417.     /*----------------------------------------------------------------*/
  418.     *index = -1;
  419.     for (i = 0; i < MAX_IDLE_SCREEN_SHORTCUTS; i++)
  420.     {
  421.         if (x >= touch_idle_shortcuts[i].x && x <= touch_idle_shortcuts[i].x + touch_idle_shortcuts[i].width &&
  422.             y >= touch_idle_shortcuts[i].y && y <= touch_idle_shortcuts[i].y + touch_idle_shortcuts[i].height)
  423.         {
  424.             *index = i;
  425.             break;
  426.         }
  427.     }
  428. }
  429. #endif /*(__MMI_TOUCH_IDLESCREEN_SHORTCUTS__) || (__MMI_TOUCH_IDLESCREEN_HW_SHORTCUTS__)*/     //KP Jerry add "__MMI_TOUCH_IDLESCREEN_HW_SHORTCUTS__" on 2007-3-7
  430. /* ~] */
  431. /*****************************************************************************
  432.  * FUNCTION
  433.  *  category33_pen_down_handler
  434.  * DESCRIPTION
  435.  *  
  436.  * PARAMETERS
  437.  *  point       [IN]        
  438.  * RETURNS
  439.  *  
  440.  *****************************************************************************/
  441. MMI_BOOL category33_pen_down_handler(mmi_pen_point_struct point)
  442. {
  443.     /*----------------------------------------------------------------*/
  444.     /* Local Variables                                                */
  445.     /*----------------------------------------------------------------*/
  446.     S32 pos_x = point.x, pos_y = point.y, y2;
  447.     MMI_BOOL ret = MMI_FALSE;;
  448.     /*----------------------------------------------------------------*/
  449.     /* Code Body                                                      */
  450.     /*----------------------------------------------------------------*/
  451.     mmi_idle_restart_screensaver_timer();
  452.     mmi_idle_restart_keypad_lock_timer();
  453.     /* [~PMT  MANISH   20050623 */
  454. #ifdef __MMI_TOUCH_IDLESCREEN_SHORTCUTS__
  455.     /* PMT HIMANSHU FLIGHT MODE START 20050926 */
  456.     if (mmi_bootup_get_active_flight_mode() == 1)
  457.     {
  458.         y2 = UI_device_height - 1 - MMI_button_bar_height;
  459.     }
  460.     else
  461.         /* PMT HIMANSHU FLIGHT MODE END 2005926 */
  462.     {
  463.         y2 = UI_device_height;  /* N CASE IDLE SCREEN SHORTCUTS ARE DISPLAYED, BUTTON BAR IS NOT DISPLAYED */
  464.     }
  465. #else /* __MMI_TOUCH_IDLESCREEN_SHORTCUTS__ */ 
  466.     y2 = UI_device_height - 1 - MMI_button_bar_height;
  467. #endif /* __MMI_TOUCH_IDLESCREEN_SHORTCUTS__ */ 
  468.     /* ~] */
  469. #ifdef __MMI_TOUCH_IDLESCREEN_SHORTCUTS__     //KP Jerry add on 2007-3-7
  470.     if (pos_x > 0 && pos_x < UI_device_width - 1 && pos_y > MMI_content_y && pos_y < y2)
  471. #endif      //KP Jerry add on 2007-3-7
  472.     {
  473.         ret = MMI_TRUE;
  474.         /* [~PMT  MANISH   20050623 */
  475. #if ( defined(__MMI_TOUCH_IDLESCREEN_SHORTCUTS__) || defined(__MMI_TOUCH_IDLESCREEN_HW_SHORTCUTS__) )     //KP Jerry add "__MMI_TOUCH_IDLESCREEN_HW_SHORTCUTS__" on 2007-3-7
  476.         {
  477.             S32 index;
  478.             gui_idle_touch_screen_shortcut_translate_pen_position(pos_x, pos_y, &index);
  479.             if (index >= 0 && index < MAX_IDLE_SCREEN_SHORTCUTS)
  480.             {
  481.                 touch_idle_screen_highlighted_shortcut = index;
  482.                 touch_idle_screen_highlight_changed = 0;
  483. #ifdef __MMI_TOUCH_IDLESCREEN_SHORTCUTS__     //KP Jerry add on 2007-3-7
  484.                 gui_idle_touch_screen_display_pressed_shorcut_item(index);
  485. #endif     //KP Jerry add on 2007-3-7
  486.             }
  487.         }
  488. #endif /*(__MMI_TOUCH_IDLESCREEN_SHORTCUTS__) || (__MMI_TOUCH_IDLESCREEN_HW_SHORTCUTS__)*/     //KP Jerry add "__MMI_TOUCH_IDLESCREEN_HW_SHORTCUTS__" on 2007-3-7
  489.         /* ~] */
  490.     }
  491.     return ret;
  492. }
  493. S32 cat33_scr_lock_repeat = -1;
  494. /*****************************************************************************
  495.  * FUNCTION
  496.  *  category33_pen_long_tap_handler
  497.  * DESCRIPTION
  498.  *  
  499.  * PARAMETERS
  500.  *  point       [IN]        
  501.  * RETURNS
  502.  *  
  503.  *****************************************************************************/
  504. MMI_BOOL category33_pen_long_tap_handler(mmi_pen_point_struct point)
  505. {
  506.     /*----------------------------------------------------------------*/
  507.     /* Local Variables                                                */
  508.     /*----------------------------------------------------------------*/
  509.     S32 pos_x = point.x, pos_y = point.y;
  510. S32 width_third=0, height_third=0;       //KP Jerry add on 2006-11-14
  511.     /*----------------------------------------------------------------*/
  512.     /* Code Body                                                      */
  513.     /*----------------------------------------------------------------*/
  514. //KP Jerry disable on 2006-11-14 start
  515. /*   
  516.     if (g_keylock_context.gKeyPadLockFlag == 0 && pos_x >= UI_device_width >> 2 &&
  517.         pos_x <= UI_device_width - (UI_device_width < 2) && pos_y >= UI_device_height >> 2 &&
  518.         pos_y <= UI_device_height - (MMI_button_bar_height >> 2))
  519.     {
  520.         cat33_scr_lock_repeat = 0;
  521.         return MMI_TRUE;
  522.     }
  523. */
  524. //KP Jerry disable on 2006-11-14 end
  525.     //KP Jerry add on 2006-11-14 start
  526.     //width_third=(S32)(LCD_WIDTH/3);
  527.     //height_third=(S32)((LCD_HEIGHT-MMI_STATUS_BAR_HEIGHT-MMI_BUTTON_BAR_HEIGHT)/3);
  528. //bottom-right area
  529. #if !defined(__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__) || defined(__MMI_SLIDE__)
  530. /*
  531. if ( g_keylock_context.gKeyPadLockFlag==0 
  532. && pos_x >= (LCD_WIDTH-width_third) && pos_x <= (LCD_WIDTH-1)
  533. && pos_y >= (LCD_HEIGHT-MMI_BUTTON_BAR_HEIGHT-height_third) && pos_y <= (LCD_HEIGHT-MMI_BUTTON_BAR_HEIGHT-1) )
  534. */
  535. {
  536. cat33_scr_lock_repeat=0;
  537.           if (g_idle_context.IsOnIdleScreen)
  538.         {
  539.             IdleSetKeyPadLockFlag();
  540.         }
  541.         if (g_idle_context.IsOnSimErrorScreen)  /* diamond, 2005/10/29, keypad lock in insert sim screen */
  542.         {
  543.             InsertSimSetKeyPadLockFlag();
  544.         }
  545. return MMI_TRUE;
  546. }
  547. /*KP Jerry disable on 2007-1-5
  548. //Center area   
  549. else if ( g_keylock_context.gKeyPadLockFlag==0 
  550. && pos_x >= width_third && pos_x <= (LCD_WIDTH-width_third)
  551. && pos_y >= (MMI_STATUS_BAR_HEIGHT+height_third) && pos_y <= (LCD_HEIGHT-MMI_BUTTON_BAR_HEIGHT-height_third) )
  552. {
  553. cat33_scr_lock_repeat=0;
  554. EntryCalibrationSettingScr();
  555. return MMI_TRUE;
  556. */
  557. #endif/*!__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__*/
  558. //KP Jerry add on 2006-11-14 end
  559.     return MMI_FALSE;
  560. }
  561. /*****************************************************************************
  562.  * FUNCTION
  563.  *  category33_pen_repeat_handler
  564.  * DESCRIPTION
  565.  *  
  566.  * PARAMETERS
  567.  *  point       [IN]        
  568.  * RETURNS
  569.  *  
  570.  *****************************************************************************/
  571. MMI_BOOL category33_pen_repeat_handler(mmi_pen_point_struct point)
  572. {
  573.     /*----------------------------------------------------------------*/
  574.     /* Local Variables                                                */
  575.     /*----------------------------------------------------------------*/
  576.     /*----------------------------------------------------------------*/
  577.     /* Code Body                                                      */
  578.     /*----------------------------------------------------------------*/
  579.     mmi_idle_restart_screensaver_timer();
  580.     mmi_idle_restart_keypad_lock_timer();
  581.     return MMI_TRUE;
  582. }
  583. /* [~PMT  MANISH   20050623 */
  584. #if ( defined(__MMI_TOUCH_IDLESCREEN_SHORTCUTS__) || defined(__MMI_TOUCH_IDLESCREEN_HW_SHORTCUTS__) )     //KP Jerry add "__MMI_TOUCH_IDLESCREEN_HW_SHORTCUTS__" on 2007-3-7
  585. /*****************************************************************************
  586.  * FUNCTION
  587.  *  category33_pen_up_handler
  588.  * DESCRIPTION
  589.  *  
  590.  * PARAMETERS
  591.  *  point       [IN]        
  592.  * RETURNS
  593.  *  
  594.  *****************************************************************************/
  595. MMI_BOOL category33_pen_up_handler(mmi_pen_point_struct point)
  596. {
  597.     /*----------------------------------------------------------------*/
  598.     /* Local Variables                                                */
  599.     /*----------------------------------------------------------------*/
  600.     S32 pos_x = point.x, pos_y = point.y, index;
  601.     MMI_BOOL ret = MMI_TRUE;
  602.     /*----------------------------------------------------------------*/
  603.     /* Code Body                                                      */
  604.     /*----------------------------------------------------------------*/
  605.     gui_idle_touch_screen_shortcut_translate_pen_position(pos_x, pos_y, &index);
  606.     if (index >= 0 && index < MAX_IDLE_SCREEN_SHORTCUTS)
  607.     {
  608. #ifdef __MMI_TOUCH_IDLESCREEN_SHORTCUTS__     //KP Jerry add on 2007-3-7
  609.         gui_idle_touch_screen_display_shorcut_item(index);
  610. #endif     //KP Jerry add on 2007-3-7   
  611.         if (!touch_idle_screen_highlight_changed)
  612.         {
  613.             if (touch_idle_shortcuts[index].entryfn)
  614.             {
  615.                 touch_idle_shortcuts[index].entryfn();
  616.             }
  617.         }
  618.     }
  619.     return ret;
  620. }
  621. /*****************************************************************************
  622.  * FUNCTION
  623.  *  category33_pen_move_handler
  624.  * DESCRIPTION
  625.  *  
  626.  * PARAMETERS
  627.  *  point       [IN]        
  628.  * RETURNS
  629.  *  
  630.  *****************************************************************************/
  631. MMI_BOOL category33_pen_move_handler(mmi_pen_point_struct point)
  632. {
  633.     /*----------------------------------------------------------------*/
  634.     /* Local Variables                                                */
  635.     /*----------------------------------------------------------------*/
  636.     S32 pos_x = point.x, pos_y = point.y, index;
  637.     MMI_BOOL ret = MMI_TRUE;
  638.     /*----------------------------------------------------------------*/
  639.     /* Code Body                                                      */
  640.     /*----------------------------------------------------------------*/
  641.     gui_idle_touch_screen_shortcut_translate_pen_position(pos_x, pos_y, &index);
  642.     if (index != touch_idle_screen_highlighted_shortcut)
  643.     {
  644.         touch_idle_screen_highlight_changed = 1;
  645. #ifdef __MMI_TOUCH_IDLESCREEN_SHORTCUTS__     //KP Jerry add on 2007-3-7
  646.         /* Unpressed Image */
  647.         gui_idle_touch_screen_display_shorcut_item(touch_idle_screen_highlighted_shortcut);
  648. #endif     //KP Jerry add on 2007-3-7   
  649.     }
  650.     if (index >= 0 && index < MAX_IDLE_SCREEN_SHORTCUTS)
  651.     {
  652.         touch_idle_screen_highlighted_shortcut = index;
  653. #ifdef __MMI_TOUCH_IDLESCREEN_SHORTCUTS__     //KP Jerry add on 2007-3-7
  654.         /* Pressed Image */
  655.         gui_idle_touch_screen_display_pressed_shorcut_item(index);
  656. #endif     //KP Jerry add on 2007-3-7   
  657.     }
  658.     return ret;
  659. }
  660. #endif /*(__MMI_TOUCH_IDLESCREEN_SHORTCUTS__) || (__MMI_TOUCH_IDLESCREEN_HW_SHORTCUTS__)*/      //KP Jerry add "__MMI_TOUCH_IDLESCREEN_HW_SHORTCUTS__" on 2007-3-7
  661. #endif /* __MMI_TOUCH_SCREEN__ */ 
  662. /*****************************************************************************
  663.  * FUNCTION
  664.  *  cat33_hide_lsk
  665.  * DESCRIPTION
  666.  *  
  667.  * PARAMETERS
  668.  *  void
  669.  * RETURNS
  670.  *  void
  671.  *****************************************************************************/
  672. void cat33_hide_lsk(void)
  673. {
  674.     /*----------------------------------------------------------------*/
  675.     /* Local Variables                                                */
  676.     /*----------------------------------------------------------------*/
  677.     /*----------------------------------------------------------------*/
  678.     /* Code Body                                                      */
  679.     /*----------------------------------------------------------------*/
  680.     gdi_layer_push_clip();
  681.     gdi_layer_set_clip(
  682.         MMI_softkeys[MMI_LEFT_SOFTKEY].x,
  683.         MMI_softkeys[MMI_LEFT_SOFTKEY].y,
  684.         MMI_softkeys[MMI_LEFT_SOFTKEY].x + MMI_softkeys[MMI_LEFT_SOFTKEY].width - 1,
  685.         MMI_softkeys[MMI_LEFT_SOFTKEY].y + MMI_softkeys[MMI_LEFT_SOFTKEY].height - 1);
  686. #ifdef __GDI_MEMORY_PROFILE_2__
  687.     gdi_draw_solid_rect(
  688.         MMI_softkeys[MMI_LEFT_SOFTKEY].x,
  689.         MMI_softkeys[MMI_LEFT_SOFTKEY].y,
  690.         MMI_softkeys[MMI_LEFT_SOFTKEY].x + MMI_softkeys[MMI_LEFT_SOFTKEY].width - 1,
  691.         MMI_softkeys[MMI_LEFT_SOFTKEY].y + MMI_softkeys[MMI_LEFT_SOFTKEY].height - 1,
  692.         GDI_COLOR_TRANSPARENT);
  693. #else /* __GDI_MEMORY_PROFILE_2__ */ 
  694.     draw_wallpaper();
  695. #endif /* __GDI_MEMORY_PROFILE_2__ */ 
  696.     gdi_layer_pop_clip();
  697. }
  698. /*****************************************************************************
  699.  * FUNCTION
  700.  *  cat33_hide_rsk
  701.  * DESCRIPTION
  702.  *  
  703.  * PARAMETERS
  704.  *  void
  705.  * RETURNS
  706.  *  void
  707.  *****************************************************************************/
  708. void cat33_hide_rsk(void)
  709. {
  710.     /*----------------------------------------------------------------*/
  711.     /* Local Variables                                                */
  712.     /*----------------------------------------------------------------*/
  713.     /*----------------------------------------------------------------*/
  714.     /* Code Body                                                      */
  715.     /*----------------------------------------------------------------*/
  716.     gdi_layer_push_clip();
  717.     gdi_layer_set_clip(
  718.         MMI_softkeys[MMI_RIGHT_SOFTKEY].x,
  719.         MMI_softkeys[MMI_RIGHT_SOFTKEY].y,
  720.         MMI_softkeys[MMI_RIGHT_SOFTKEY].x + MMI_softkeys[MMI_RIGHT_SOFTKEY].width - 1,
  721.         MMI_softkeys[MMI_RIGHT_SOFTKEY].y + MMI_softkeys[MMI_RIGHT_SOFTKEY].height - 1);
  722. #ifdef __GDI_MEMORY_PROFILE_2__
  723.     gdi_draw_solid_rect(
  724.         MMI_softkeys[MMI_RIGHT_SOFTKEY].x,
  725.         MMI_softkeys[MMI_RIGHT_SOFTKEY].y,
  726.         MMI_softkeys[MMI_RIGHT_SOFTKEY].x + MMI_softkeys[MMI_RIGHT_SOFTKEY].width - 1,
  727.         MMI_softkeys[MMI_RIGHT_SOFTKEY].y + MMI_softkeys[MMI_RIGHT_SOFTKEY].height - 1,
  728.         GDI_COLOR_TRANSPARENT);
  729. #else /* __GDI_MEMORY_PROFILE_2__ */ 
  730.     draw_wallpaper();
  731. #endif /* __GDI_MEMORY_PROFILE_2__ */ 
  732.     gdi_layer_pop_clip();
  733. }
  734. #ifdef __MMI_WGUI_CSK_ENABLE__
  735. /*****************************************************************************
  736.  * FUNCTION
  737.  *  cat33_hide_csk
  738.  * DESCRIPTION
  739.  *  
  740.  * PARAMETERS
  741.  *  void
  742.  * RETURNS
  743.  *  void
  744.  *****************************************************************************/
  745. void cat33_hide_csk(void)
  746. {
  747.     /*----------------------------------------------------------------*/
  748.     /* Local Variables                                                */
  749.     /*----------------------------------------------------------------*/
  750.     /*----------------------------------------------------------------*/
  751.     /* Code Body                                                      */
  752.     /*----------------------------------------------------------------*/
  753.     gdi_layer_push_clip();
  754.     gdi_layer_set_clip(
  755.         MMI_softkeys[MMI_CENTER_SOFTKEY].x,
  756.         MMI_softkeys[MMI_CENTER_SOFTKEY].y,
  757.         MMI_softkeys[MMI_CENTER_SOFTKEY].x + MMI_softkeys[MMI_CENTER_SOFTKEY].width - 1,
  758.         MMI_softkeys[MMI_CENTER_SOFTKEY].y + MMI_softkeys[MMI_CENTER_SOFTKEY].height - 1);
  759. #ifdef __GDI_MEMORY_PROFILE_2__
  760.     gdi_draw_solid_rect(
  761.         MMI_softkeys[MMI_CENTER_SOFTKEY].x,
  762.         MMI_softkeys[MMI_CENTER_SOFTKEY].y,
  763.         MMI_softkeys[MMI_CENTER_SOFTKEY].x + MMI_softkeys[MMI_CENTER_SOFTKEY].width - 1,
  764.         MMI_softkeys[MMI_CENTER_SOFTKEY].y + MMI_softkeys[MMI_CENTER_SOFTKEY].height - 1,
  765.         GDI_COLOR_TRANSPARENT);
  766. #else /* __GDI_MEMORY_PROFILE_2__ */ 
  767.     draw_wallpaper();
  768. #endif /* __GDI_MEMORY_PROFILE_2__ */ 
  769.     gdi_layer_pop_clip();
  770. }
  771. #endif /* __MMI_WGUI_CSK_ENABLE__ */ 
  772. /*****************************************************************************
  773.  * FUNCTION
  774.  *  ShowCategory33Screen
  775.  * DESCRIPTION
  776.  *  Displays the Idle screen
  777.  * PARAMETERS
  778.  *  left_softkey            [IN]        Left softkey label
  779.  *  left_softkey_icon       [IN]        Icon for the Left softkey
  780.  *  right_softkey           [IN]        Right softkey label
  781.  *  right_softkey_icon      [IN]        Icon for the right softkey
  782.  *  history_buffer          [IN]        History buffer
  783.  * RETURNS
  784.  *  void
  785.  *****************************************************************************/
  786. /*
  787.  * #ifdef MMI_ON_HARDWARE_P
  788.  * extern kal_int32 L1T_GetFN( void );
  789.  * #endif
  790.  */
  791. void ShowCategory33Screen_ext(
  792.         U16 left_softkey,
  793.         U16 left_softkey_icon,
  794.         U16 right_softkey,
  795.         U16 right_softkey_icon,
  796.         U8 *history_buffer)
  797. {
  798.     /*----------------------------------------------------------------*/
  799.     /* Local Variables                                                */
  800.     /*----------------------------------------------------------------*/
  801.     //dm_data_struct dm_data;//110606 compile warning
  802.     /* 110105 status bar1 Calvin Start */
  803. #ifndef __MMI_UI_DALMATIAN_STATUSBAR__
  804.     S32 status_bar1_y1;
  805.     S32 status_bar1_y2;
  806. #endif /* __MMI_UI_DALMATIAN_STATUSBAR__ */ 
  807.     /*----------------------------------------------------------------*/
  808.     /* Code Body                                                      */
  809.     /*----------------------------------------------------------------*/
  810.     /* 110105 status bar1 Calvin End */
  811.     GDI_LOCK;
  812.     gui_lock_double_buffer();
  813.     /* PMT VIKAS START 20051202 */
  814.     set_on_idlescreen(1);
  815.     //PMT VIKAS END 20051202
  816.     //START VIJAY PMT 20060105
  817. #ifdef __MMI_UI_STATUS_BAR_AT_BOTTOM__
  818.     set_status_bar_at_bottom();
  819. #endif 
  820.     /* END VIJAY PMT 20060105 */
  821. #ifdef __MMI_IDLE_FULL_SCREEN__
  822.     on_idle_screen = 1;
  823.     //PMT VIKAS START 20050913
  824.     //For implement dalmatian on style 1, 2 and 3.
  825. #if !(defined(__MMI_UI_DALMATIAN_SOFTKEYS__) && (defined(__MMI_MAINLCD_128X128__) || defined(__MMI_MAINLCD_128X160__)))
  826.     disable_softkey_background();
  827. #endif 
  828.     /* PMT VIKAS END 20050913 */
  829. #endif /* __MMI_IDLE_FULL_SCREEN__ */ 
  830.     cat33_frame_number = 0;
  831.     MMI_menu_shortcut_number = -1;
  832.     /* BUG SOFTKEYS START 20050902 */
  833.     /* No need to set the default handlers for Left and Right Softkeys in case of
  834.        Idlescreen Shortcuts. So passing the value 0 for string ID and icon ID. */
  835. #ifdef __MMI_TOUCH_IDLESCREEN_SHORTCUTS__
  836.     /* PMT HIMANSHU FLIGHT MODE START 20050926 */
  837.     if (mmi_bootup_get_active_flight_mode() == 1)
  838.     {
  839.         change_left_softkey(left_softkey, left_softkey_icon);
  840.         change_right_softkey(right_softkey, right_softkey_icon);
  841.     }
  842.     else
  843.     {
  844.         /* PMT HIMANSHU FLIGHT MODE END 2005926 */
  845.         change_left_softkey(0, 0);
  846.         change_right_softkey(0, 0);
  847.         /* PMT HIMANSHU FLIGHT MODE START 20050926 */
  848.     }
  849.     /* PMT HIMANSHU FLIGHT MODE END 2005926 */
  850. #else /* __MMI_TOUCH_IDLESCREEN_SHORTCUTS__ */ 
  851.     change_left_softkey(left_softkey, left_softkey_icon);
  852.     change_right_softkey(right_softkey, right_softkey_icon);
  853. #endif /* __MMI_TOUCH_IDLESCREEN_SHORTCUTS__ */ 
  854.     /* BUG SOFKEYS END 20050902 */
  855.     SetupCategoryKeyHandlers();
  856. #ifdef __MMI_WGUI_CSK_ENABLE__
  857.     //      set_softkey_label(L"Dial",MMI_CENTER_SOFTKEY);
  858.     //      set_softkey_icon(NULL, MMI_CENTER_SOFTKEY);
  859. #endif /* __MMI_WGUI_CSK_ENABLE__ */ 
  860.     /* No need to register the hide functions for Left and Right Sofkeys
  861.        when Idle Screen Shortcuts are present.   */
  862. #ifdef __MMI_TOUCH_IDLESCREEN_SHORTCUTS__
  863. if(mmi_bootup_get_active_flight_mode() == 1)
  864. #endif
  865.     {
  866.     #if !defined(MT6205B) && !defined(MT6208) 
  867.         {
  868.             register_hide_left_softkey(cat33_hide_lsk);
  869.             register_hide_right_softkey(cat33_hide_rsk);
  870.         #ifdef __MMI_WGUI_CSK_ENABLE__
  871.             register_hide_softkey(cat33_hide_csk, MMI_CENTER_SOFTKEY);
  872.         #endif 
  873.         }
  874.     #else /* !defined(MT6205B) && !defined(MT6208) */
  875.         {
  876.             /* Because MT6205B does not have LCD layer support, clearing 
  877.                softkey background requires redrawing wallpaper, which is 
  878.                very slow */
  879.             set_softkey_flags_on(UI_BUTTON_NO_SHIFT_BUTTON, MMI_LEFT_SOFTKEY);
  880.             set_softkey_flags_on(UI_BUTTON_NO_SHIFT_BUTTON, MMI_RIGHT_SOFTKEY);
  881.         #ifdef __MMI_WGUI_CSK_ENABLE__
  882.             set_softkey_flags_on(UI_BUTTON_NO_SHIFT_BUTTON, MMI_CENTER_SOFTKEY);        
  883.         #endif
  884.         }
  885.     #endif /* !defined(MT6205B) && !defined(MT6208) */
  886.     }
  887.     register_hide_status_icon_bar(0, UI_dummy_function);
  888.     register_hide_status_icon_bar(1, UI_dummy_function);
  889. #ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
  890.     gui_register_button_shuffle(shuffle_draw_wallpaper);    /* register the background drower */
  891. #endif /* __MMI_UI_DALMATIAN_SOFTKEYS__ */ 
  892. #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
  893.     set_status_icon_bar_clip(
  894.         0,
  895.         0,
  896.         MMI_title_height + STATUS_TITLE_GAP,
  897.         MMI_STATUS_BAR_WIDTH - 1,
  898.         MMI_title_height + STATUS_TITLE_GAP + MMI_SINGLE_STATUS_BAR_HEIGHT - 1);
  899.     set_status_icon_bar_clip(
  900.         1,
  901.         UI_device_width - MMI_STATUS_BAR_WIDTH,
  902.         MMI_title_height + STATUS_TITLE_GAP + MMI_status_bar_height - MMI_SINGLE_STATUS_BAR_HEIGHT,
  903.         UI_device_width - 1,
  904.         MMI_title_height + STATUS_TITLE_GAP + MMI_status_bar_height - 1);
  905. #else /* __MMI_UI_DALMATIAN_STATUSBAR__ */ 
  906.     /* PMT VIKAS START 20051010 */
  907. #ifdef __MMI_UI_STATUS_BAR_AT_BOTTOM__
  908.     set_status_icon_bar_clip(
  909.         0,
  910.         0,
  911.         UI_device_height - 1 - MMI_button_bar_height - MMI_status_bar_height,
  912.         UI_device_width - 1,
  913.         UI_device_height - 1 - MMI_button_bar_height - 1);
  914. #else /* __MMI_UI_STATUS_BAR_AT_BOTTOM__ */ 
  915.     set_status_icon_bar_clip(0, 0, 0, UI_device_width - 1, MMI_status_bar_height - 1);
  916. #endif /* __MMI_UI_STATUS_BAR_AT_BOTTOM__ */ 
  917.     /* PMT VIKAS END 20051010 */
  918.     /* 110105 status bar1 Start */
  919. #ifdef __MMI_UI_TECHNO_IDLESCREEN_BAR__
  920.     if (PhnsetGetShowDateTimeStatus() == MMI_TRUE)
  921.     {
  922.         status_bar1_y1 = MMI_status_bar_height + MMI_IDLESCREEN_BAR_HEIGHT;
  923.     }
  924.     else
  925.     {
  926.         status_bar1_y1 = MMI_status_bar_height;
  927.     }
  928. #else /* __MMI_UI_TECHNO_IDLESCREEN_BAR__ */ 
  929.     status_bar1_y1 = MMI_status_bar_height;
  930. #endif /* __MMI_UI_TECHNO_IDLESCREEN_BAR__ */ 
  931. #ifdef __MMI_TOUCH_IDLESCREEN_SHORTCUTS__
  932.     if (mmi_bootup_get_active_flight_mode() == 1)
  933.     {
  934.         status_bar1_y2 = UI_device_height - MMI_softkey_height - 2;
  935.     }
  936.     else
  937.     {
  938.         status_bar1_y2 = UI_device_height - WGUI_TOUCH_IDLESCREEN_SHORTCUTS_HEIGHT - 2;
  939.     }
  940. #else /* __MMI_TOUCH_IDLESCREEN_SHORTCUTS__ */ 
  941.     status_bar1_y2 = UI_device_height - MMI_softkey_height - 2;
  942. #endif /* __MMI_TOUCH_IDLESCREEN_SHORTCUTS__ */ 
  943.     /* 110105 status bar1 End */
  944. #ifdef __MMI_UI_TECHNO_STATUS_ICON__
  945.     set_status_icon_bar_clip(1, 0, 0, 0, 0);
  946.     arrange_status_icons();
  947. #else /* __MMI_UI_TECHNO_STATUS_ICON__ */ 
  948.     /* PMT VIKAS START 20051010 */
  949. #ifdef __MMI_UI_STATUS_BAR_AT_BOTTOM__
  950.     set_status_icon_bar_clip(
  951.         1,
  952.         UI_device_width - 16,
  953.         MMI_status_bar_height,
  954.         UI_device_width - 1,
  955.         UI_device_height - 1 - MMI_button_bar_height - MMI_status_bar_height - (STATUS_ICON_Y_GAP << 1) - 1);
  956.     arrange_status_icons();
  957. #else /* __MMI_UI_STATUS_BAR_AT_BOTTOM__ */ 
  958. #ifdef __MMI_KLG__
  959.     set_status_icon_bar_clip(1, UI_device_width - 16, status_bar1_y1, UI_device_width - 1, UI_device_height >> 1);      /* 110105 status bar1 Calvin modified */
  960. #else 
  961.     set_status_icon_bar_clip(1, UI_device_width - 16, status_bar1_y1, UI_device_width - 1, status_bar1_y2);     /* 110105 status bar1 Calvin modified */
  962. #endif 
  963. #endif /* __MMI_UI_STATUS_BAR_AT_BOTTOM__ */ 
  964.     /* PMT VIKAS END 20051010 */
  965. #endif /* __MMI_UI_TECHNO_STATUS_ICON__ */ 
  966.     /* PMT VIKAS END 20050707 */
  967. #endif /* __MMI_UI_DALMATIAN_STATUSBAR__ */ 
  968.     show_status_icon_bar(0);
  969.     show_status_icon_bar(1);
  970.     switch (idle_screen_type)
  971.     {
  972.         case NORMAL_IDLE_SCREEN:
  973.             /* PMT HIMANSHU START 20050625 */
  974.     #ifdef __MMI_UI_TECHNO_IDLESCREEN_BAR__
  975.             set_main_LCD_dt_date_hide_function(cat33_hide_date_display);
  976.             analog_clock_initialize();
  977.             set_main_LCD_dt_time_hide_function(dummy_dt_hide_function);
  978.             /* PMT HIMANSHU START 20050721 */
  979.             set_main_LCD_day_hide_function(cat33_hide_day_string_display);
  980.             /* PMT HIMANSHU END 20050721 */
  981.     #else /* __MMI_UI_TECHNO_IDLESCREEN_BAR__ */ 
  982.             set_main_LCD_dt_date_hide_function(dummy_dt_hide_function);
  983.             set_main_LCD_dt_time_hide_function(cat33_hide_time_display);
  984.     #endif /* __MMI_UI_TECHNO_IDLESCREEN_BAR__ */ 
  985.             //PMT HIMANSHU END
  986.             //PMT VIKAS START 20051010
  987.     #if defined(__MMI_KLG__) || defined(__MMI_UI_STATUS_BAR_AT_BOTTOM__)
  988.             /* PMT VIKAS END 20051010 */
  989.             set_dt_display(DT_IDLE_SCREEN_2);
  990.     #else /* defined(__MMI_KLG__) || defined(__MMI_UI_STATUS_BAR_AT_BOTTOM__) */ 
  991.             set_dt_display(DT_IDLE_SCREEN);
  992.     #endif /* defined(__MMI_KLG__) || defined(__MMI_UI_STATUS_BAR_AT_BOTTOM__) */ 
  993.             break;
  994.     #ifdef __MMI_ANALOG_CLOCK__
  995.         case ANALOG_IDLE_SCREEN:
  996.             analog_clock_initialize();
  997.             set_main_LCD_dt_date_hide_function(dummy_dt_hide_function);
  998.             set_main_LCD_dt_time_hide_function(cat33_analog_clock_hide_dt_display);
  999.             set_dt_display(DT_ANALOG_CLOCK_SC);
  1000.             break;
  1001.     #endif /* __MMI_ANALOG_CLOCK__ */ 
  1002.     #ifdef __MMI_DIGITAL_CLOCK__
  1003.         case DIGITAL_IDLE_SCREEN:
  1004.             set_main_LCD_dt_date_hide_function(dummy_dt_hide_function);
  1005.             set_main_LCD_dt_time_hide_function(cat33_digital_clock_hide_dt_display);
  1006.             set_dt_display(DT_DIGITAL_CLOCK_SC1);
  1007.             break;
  1008.     #endif /* __MMI_DIGITAL_CLOCK__ */ 
  1009.     }
  1010. gui_unlock_double_buffer();
  1011.     /* [~PMT  MANISH   20050624 */
  1012. #if ( defined(__MMI_TOUCH_IDLESCREEN_SHORTCUTS__) || defined(__MMI_TOUCH_IDLESCREEN_HW_SHORTCUTS__) )     //KP Jerry add "__MMI_TOUCH_IDLESCREEN_HW_SHORTCUTS__" on 2007-3-7
  1013.     /* PMT HIMANSHU FLIGHT MODE START 20051021 */
  1014.     /* clear the memory of touch_idle_shortcuts when the Flight Mode is ON. */
  1015.     if (mmi_bootup_get_active_flight_mode() == 0)
  1016.     {
  1017.         setup_touch_idle_screen_shortcuts();
  1018.     }
  1019.     else
  1020.         /* PMT HIMANSHU FLIGHT MODE END 20051021 */
  1021.     {
  1022.         memset(touch_idle_shortcuts, 0, sizeof(idle_touch_screen_shortcut) * MAX_IDLE_SCREEN_SHORTCUTS);
  1023.     }
  1024. #endif /*(__MMI_TOUCH_IDLESCREEN_SHORTCUTS__) || (__MMI_TOUCH_IDLESCREEN_HW_SHORTCUTS__)*/          //KP Jerry add "__MMI_TOUCH_IDLESCREEN_HW_SHORTCUTS__" on 2007-3-7
  1025.     /* ~] */
  1026. #if (defined __MMI_TOUCH_SCREEN__)
  1027.     wgui_register_category_screen_control_area_pen_handlers(category33_pen_down_handler, MMI_PEN_EVENT_DOWN);
  1028.     wgui_register_category_screen_control_area_pen_handlers(category33_pen_repeat_handler, MMI_PEN_EVENT_REPEAT);
  1029.     /* [~PMT  MANISH   20050623 In case of touch idle screen unlock creates problem TEMP ONLY, FIX LATER AFTER DISCUSSION WITH LEO */
  1030. #ifndef __MMI_TOUCH_IDLESCREEN_SHORTCUTS__
  1031.     wgui_register_category_screen_control_area_pen_handlers(category33_pen_long_tap_handler, MMI_PEN_EVENT_LONG_TAP);
  1032. #endif     //KP Jerry add on 2007-3-7
  1033. #if ( defined(__MMI_TOUCH_IDLESCREEN_SHORTCUTS__) || defined(__MMI_TOUCH_IDLESCREEN_HW_SHORTCUTS__) )     //KP Jerry add on 2007-3-7
  1034.     /* PMT HIMANSHU FLIGHT MODE START 20051021 */
  1035.     /* remove the pen handler registration for UP and MOVE event, when the Flight
  1036.        Mode is ON. */
  1037.     if (mmi_bootup_get_active_flight_mode() == 0)
  1038.     {
  1039.         wgui_register_category_screen_control_area_pen_handlers(category33_pen_up_handler, MMI_PEN_EVENT_UP);
  1040.         wgui_register_category_screen_control_area_pen_handlers(category33_pen_move_handler, MMI_PEN_EVENT_MOVE);
  1041.     }
  1042.     /* PMT HIMANSHU FLIGHT MODE END 20051021 */
  1043. #endif /* __MMI_TOUCH_IDLESCREEN_SHORTCUTS__ */ 
  1044.     /* ~] */
  1045. #endif /* (defined __MMI_TOUCH_SCREEN__) */ 
  1046.     gdi_layer_push_and_set_active(GDI_LAYER_MAIN_BASE_LAYER_HANDLE);
  1047.     gdi_layer_set_source_key(TRUE, GDI_COLOR_TRANSPARENT);
  1048.     gdi_layer_clear(GDI_COLOR_TRANSPARENT);
  1049.     gdi_layer_pop_and_restore_active();
  1050.     GDI_UNLOCK;
  1051. }
  1052. void ShowCategory33Screen(
  1053.         U16 left_softkey,
  1054.         U16 left_softkey_icon,
  1055.         U16 right_softkey,
  1056.         U16 right_softkey_icon,
  1057. S32 highlighted_item,
  1058.         U8 *history_buffer)
  1059. {
  1060.     /*----------------------------------------------------------------*/
  1061.     /* Local Variables                                                */
  1062.     /*----------------------------------------------------------------*/
  1063.     dm_data_struct dm_data;
  1064. U8 i,h_flag=0;
  1065.     /*----------------------------------------------------------------*/
  1066.     /* Code Body                                                      */
  1067.     /*----------------------------------------------------------------*/
  1068.     /* 110105 status bar1 Calvin End */
  1069. ShowCategory33Screen_ext(
  1070.         left_softkey,
  1071.         left_softkey_icon,
  1072.         right_softkey,
  1073.         right_softkey_icon,
  1074.         history_buffer);
  1075. create_fixed_icontext_menuitems();
  1076. associate_fixed_icontext_matrix();
  1077. for(i=0;i<6;i++)
  1078. add_fixed_icontext_item((unsigned short*)GetString(STR_GLOBAL_OK),(unsigned char*)GetImage(gIndexIconsImageList[i]));
  1079. MMI_current_menu_type = MATRIX_MENU;
  1080.     configure_fixed_matrix(34,34,6,1);
  1081. resize_fixed_matrix(240,36);
  1082. move_fixed_matrix(0,76);
  1083. register_fixed_matrix_highlight_handler(standard_matrix_highlight_handler);
  1084.     gui_set_fixed_matrix_menu_theme(&MMI_fixed_matrix_menu, current_UI_theme->fixed_matrix_menu_theme);
  1085.     gui_set_fixed_icontext_menuitem_theme(&MMI_fixed_icontext_menuitem,current_UI_theme->fixed_icontext_menuitem_theme);
  1086. MMI_fixed_matrix_menu.flags |= UI_MATRIX_MENU_DISABLE_PEN | UI_MATRIX_MENU_DISABLE_SCROLLBAR | UI_MATRIX_MENU_DISABLE_BACKGROUND|UI_MATRIX_MENU_LOOP;
  1087. gui_set_fixed_matrix_menu_theme(&MMI_fixed_matrix_menu, current_UI_theme->fixed_matrix_menu_theme);
  1088.     gui_set_fixed_icontext_menuitem_theme(&MMI_fixed_icontext_menuitem, current_UI_theme->fixed_icontext_menuitem_theme);
  1089. MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_DISABLE_TEXT_DISPLAY | UI_MENUITEM_CENTER_ICON_X | UI_MENUITEM_CENTER_ICON_Y;
  1090.   SetKeyHandler(fixed_matrix_goto_next_item, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1091. SetKeyHandler(fixed_matrix_goto_previous_item, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1092. h_flag = set_matrix_menu_category_history(MMI_CATEGORY33_ID, history_buffer);
  1093.     if (h_flag)
  1094.     {
  1095.         gui_fixed_matrix_menu_goto_item(&MMI_fixed_matrix_menu,MMI_fixed_matrix_menu.highlighted_item);
  1096.     }
  1097.     else
  1098.     {
  1099.        gui_fixed_matrix_menu_goto_item(&MMI_fixed_matrix_menu, highlighted_item);
  1100.     }
  1101. gui_create_fixed_icontext_menuitem(&idle_list_menu_common_item, 108,30);
  1102.     for( i=0; i<6; i++)
  1103. idle_list_menu_item_pointers[i]=(void*)&idle_list_menu_item_list[i];
  1104. for(i=0;i<6;i++)
  1105. idle_list_menu_item_list[i].item_text=get_string(STR_GLOBAL_OK);;
  1106. for(i=0;i<6;i++)
  1107. idle_list_menu_item_list[i].item_icon = (unsigned char*)GetImage(gIndexIconsImageList[i]);
  1108. /* Association with a fixed list menu */
  1109. gui_create_fixed_list_menu(&idle_list_menu,0,112,240,320);
  1110. idle_list_menu.n_items=6;
  1111. idle_list_menu.items=idle_list_menu_item_pointers;
  1112. idle_list_menu.common_item_data=&idle_list_menu_common_item;
  1113. idle_list_menu.flags |= UI_LIST_MENU_DISABLE_BACKGROUND | UI_LIST_MENU_DISABLE_BKGRND_IN_LAYER | UI_LIST_MENU_DISABLE_SCROLLBAR;
  1114. idle_list_menu_common_item.text_x = 36;
  1115. gui_set_fixed_list_menu_item_functions(
  1116. &idle_list_menu, 
  1117. gui_show_fixed_icontext_menuitem,  // Display function
  1118. gui_measure_fixed_icontext_menuitem, // Measure function
  1119. gui_highlight_fixed_icontext_menuitem, // Highlight function
  1120. gui_remove_highlight_fixed_icontext_menuitem, // Remove highlight function
  1121. UI_fixed_menuitem_dummy_hide_function,
  1122. resize_fixed_icontext_list_menuitems);
  1123.     GDI_LOCK;
  1124.     ExitCategoryFunction = ExitCategory33Screen;
  1125.     dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
  1126. dm_data.s32ScrId = IDLE_SCREEN_ID;
  1127.     dm_data.s32CatId = MMI_CATEGORY33_ID;
  1128.     dm_data.s32flags = 0;
  1129. #ifdef __MMI_TOUCH_IDLESCREEN_SHORTCUTS__
  1130.     if (mmi_bootup_get_active_flight_mode() == 0)
  1131.     {
  1132.         dm_data.s32flags |= DM_NO_SOFTKEY;
  1133.     }
  1134. #endif /* __MMI_TOUCH_IDLESCREEN_SHORTCUTS__ */ 
  1135.     dm_setup_data(&dm_data);
  1136.     dm_register_category_controlled_callback(dm_category_33_controlled_area);
  1137.     dm_redraw_category_screen();
  1138.     GDI_UNLOCK;
  1139. }
  1140. extern void leave_idle_screen(void);
  1141. /*****************************************************************************
  1142.  * FUNCTION
  1143.  *  ExitCategory33Screen
  1144.  * DESCRIPTION
  1145.  *  Exits the Idle screen
  1146.  * PARAMETERS
  1147.  *  void
  1148.  * RETURNS
  1149.  *  void
  1150.  *****************************************************************************/
  1151. void ExitCategory33Screen(void)
  1152. {
  1153.     /*----------------------------------------------------------------*/
  1154.     /* Local Variables                                                */
  1155.     /*----------------------------------------------------------------*/
  1156.     /*----------------------------------------------------------------*/
  1157.     /* Code Body                                                      */
  1158.     /*----------------------------------------------------------------*/
  1159.     leave_idle_screen();
  1160.     /* START VIJAY PMT 20060105 */
  1161. #ifdef __MMI_UI_STATUS_BAR_AT_BOTTOM__
  1162.     reset_status_bar_at_bottom();
  1163. #endif 
  1164.     //END VIJAY PMT 20060105
  1165.     //PMT VIKAS START 20050707
  1166. #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
  1167.     /* PMT VIKAS START 20050817 */
  1168.     MMI_title_y = MMI_TITLE_Y;
  1169.     /* PMT VIKAS END 20050817 */
  1170. #endif /* __MMI_UI_DALMATIAN_STATUSBAR__ */ 
  1171. #ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
  1172.     gui_register_button_shuffle(shuffle_draw_white);    /* register the background drower */
  1173. #endif 
  1174.     /* PMT VIKAS END 20050707 */
  1175. #ifdef __MMI_IDLE_FULL_SCREEN__
  1176.     on_idle_screen = 0;
  1177. #endif 
  1178.     //MTK Leo end
  1179.     //PMT VIKAS START 20051202
  1180.     set_on_idlescreen(0);
  1181.     /* PMT VIKAS END 20051202 */
  1182.     if (extra_scrolling_text)
  1183.     {
  1184.         gui_scrolling_text_stop(extra_scrolling_text);
  1185.         extra_scrolling_text = NULL;
  1186.     }
  1187.     /* 110206 digital clock Start */
  1188.     extra_text_x1 = -1;
  1189.     extra_text_y1 = -1;
  1190.     extra_text_x2 = -1;
  1191.     extra_text_y2 = -1;
  1192.     /* 110206 digital clock End */
  1193.     gui_cancel_timer(cat33_animation_processor);
  1194. #if defined(ENABLE_ANIMATED_WALLPAPERS) && defined(__GDI_MEMORY_PROFILE_2__)
  1195.     if (animation_handle != GDI_ERROR_HANDLE)
  1196.     {
  1197.         gdi_image_stop_animation(animation_handle);
  1198.         animation_handle = GDI_ERROR_HANDLE;
  1199.     }
  1200. #endif /* defined(ENABLE_ANIMATED_WALLPAPERS) && defined(__GDI_MEMORY_PROFILE_2__) */ 
  1201.     close_status_icons();
  1202.     /* PMT VIKAS START 20050707 */
  1203. #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
  1204.     close_shuffle();    /* to close the continous shuffling */
  1205. #endif 
  1206.     /* PMT VIKAS END 20050707 */
  1207.     /* PMT VIKAS START 20050707 */
  1208. #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
  1209.     register_hide_status_icon_bar(0, MMI_dummy_function);
  1210. #endif 
  1211.     /* PMT VIKAS END 20050707 */
  1212.     register_hide_status_icon_bar(1, MMI_dummy_function);
  1213.     close_main_LCD_dt_display();
  1214.     reset_softkeys();
  1215.     enable_softkey_background();
  1216.     /* PMT HIMANSHU START 20050625 */
  1217. #ifdef __MMI_UI_TECHNO_STATUS_ICON__
  1218.     arrange_status_icons();
  1219. #endif 
  1220.     //PMT HIMANSHU END
  1221.     //PMT VIKAS START 20051010
  1222. #ifdef __MMI_UI_STATUS_BAR_AT_BOTTOM__
  1223.     set_status_icon_bar_clip(0, 0, 0, UI_device_width - 1, MMI_status_bar_height - 1);
  1224. #if defined(__MMI_KLG__)
  1225.     set_status_icon_bar_clip(
  1226.         1,
  1227.         UI_device_width - 16,
  1228.         MMI_status_bar_height,
  1229.         UI_device_width - 1,
  1230.         UI_device_height >> 1);
  1231. #else /* defined(__MMI_KLG__) */ 
  1232.     set_status_icon_bar_clip(
  1233.         1,
  1234.         UI_device_width - 16,
  1235.         MMI_status_bar_height,
  1236.         UI_device_width - 1,
  1237.         UI_device_height - MMI_softkey_height - 2);
  1238. #endif /* defined(__MMI_KLG__) */ 
  1239.     arrange_status_icons();
  1240. #endif /* __MMI_UI_STATUS_BAR_AT_BOTTOM__ */ 
  1241.     /* PMT VIKAS END 20051010 */
  1242. MMI_fixed_matrix_menu.flags &= ~UI_MATRIX_MENU_DISABLE_PEN;
  1243. reset_fixed_matrix();
  1244.     ExitCategoryFunction = MMI_dummy_function;
  1245.     RedrawCategoryFunction = MMI_dummy_function;
  1246.     GetCategoryHistory = dummy_get_history;
  1247.     GetCategoryHistorySize = dummy_get_history_size;
  1248. }
  1249. /* PMT VIKAS START 20050707 */
  1250. #ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
  1251. /*****************************************************************************
  1252.  * FUNCTION
  1253.  *  shuffle_draw_wallpaper
  1254.  * DESCRIPTION
  1255.  *  Function for draw wallpaper background in shuffle at idle screen
  1256.  * PARAMETERS
  1257.  *  void
  1258.  * RETURNS
  1259.  *  void
  1260.  *****************************************************************************/
  1261. void shuffle_draw_wallpaper(void)
  1262. {
  1263.     /*----------------------------------------------------------------*/
  1264.     /* Local Variables                                                */
  1265.     /*----------------------------------------------------------------*/
  1266.     /*----------------------------------------------------------------*/
  1267.     /* Code Body                                                      */
  1268.     /*----------------------------------------------------------------*/
  1269.     draw_wallpaper();
  1270. #if defined(ENABLE_ANIMATED_WALLPAPERS) && defined(__GDI_MEMORY_PROFILE_2__)
  1271.     {
  1272.         U16 keyCode, keyType;
  1273.         GetkeyInfo(&keyCode, &keyType);
  1274.         if (keyType == KEY_EVENT_DOWN)
  1275.         {
  1276.             if (animation_handle != GDI_ERROR_HANDLE)
  1277.             {
  1278.                 gdi_image_stop_animation(animation_handle);
  1279.                 animation_handle = GDI_ERROR_HANDLE;
  1280.             }
  1281.         }
  1282.     }
  1283. #endif /* defined(ENABLE_ANIMATED_WALLPAPERS) && defined(__GDI_MEMORY_PROFILE_2__) */ 
  1284. }
  1285. #endif /* __MMI_UI_DALMATIAN_SOFTKEYS__ */ 
  1286. #if defined(__MMI_UI_DALMATIAN_STATUSBAR__) || defined(__MMI_UI_DALMATIAN_SOFTKEYS__)
  1287. /*****************************************************************************
  1288.  * FUNCTION
  1289.  *  start_shuffle
  1290.  * DESCRIPTION
  1291.  *  Function for start the shuffle of status & button bar at idle screen
  1292.  * PARAMETERS
  1293.  *  void
  1294.  * RETURNS
  1295.  *  void
  1296.  *****************************************************************************/
  1297. void start_shuffle(void)
  1298. {
  1299.     /*----------------------------------------------------------------*/
  1300.     /* Local Variables                                                */
  1301.     /*----------------------------------------------------------------*/
  1302.     /*----------------------------------------------------------------*/
  1303.     /* Code Body                                                      */
  1304.     /*----------------------------------------------------------------*/
  1305. #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
  1306.     shuffle_status_bars();
  1307. #endif 
  1308. #ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
  1309.     gui_register_button_shuffle(shuffle_draw_wallpaper);
  1310.     gui_call_shuffle();
  1311.     if (is_button_bar_shuffled == 1)
  1312.     {
  1313.         is_button_bar_shuffled = 0;
  1314.     }
  1315.     else
  1316.     {
  1317.         is_button_bar_shuffled = 1;
  1318.     }
  1319. #endif /* __MMI_UI_DALMATIAN_SOFTKEYS__ */ 
  1320.     gui_start_timer(BAR_SHUFFLE_TIMER, start_shuffle);
  1321. }
  1322. /*****************************************************************************
  1323.  * FUNCTION
  1324.  *  close_shuffle
  1325.  * DESCRIPTION
  1326.  *  Function for close down the shuffle of status & button bar at idle screen
  1327.  * PARAMETERS
  1328.  *  void
  1329.  * RETURNS
  1330.  *  void
  1331.  *****************************************************************************/
  1332. void close_shuffle(void)
  1333. {
  1334.     /*----------------------------------------------------------------*/
  1335.     /* Local Variables                                                */
  1336.     /*----------------------------------------------------------------*/
  1337.     /*----------------------------------------------------------------*/
  1338.     /* Code Body                                                      */
  1339.     /*----------------------------------------------------------------*/
  1340.     gui_cancel_timer(start_shuffle);
  1341. #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
  1342.     is_status_bar_shuffled = 0; /* To reset the shuffle indicator for status bar */
  1343. #endif 
  1344. #ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
  1345.     is_button_bar_shuffled = 0; /* for button bar */
  1346. #endif 
  1347. }
  1348. #endif /* defined(__MMI_UI_DALMATIAN_STATUSBAR__) || defined(__MMI_UI_DALMATIAN_SOFTKEYS__) */ 
  1349. /* PMT VIKAS END 20050707 */
  1350. #ifdef __MMI_ANALOG_CLOCK__
  1351. gdi_handle cat86_anim_handle;   /* 072605 Calvin added */
  1352. /*****************************************************************************
  1353.  * FUNCTION
  1354.  *  cat86_hide_analog_clock_display
  1355.  * DESCRIPTION
  1356.  *  hide function of analog clock of categor 86
  1357.  * PARAMETERS
  1358.  *  x1      [IN]        Start x position
  1359.  *  y1      [IN]        Start y position
  1360.  *  x2      [IN]        End x position
  1361.  *  y2      [IN]        End y position
  1362.  * RETURNS
  1363.  *  void
  1364.  *****************************************************************************/
  1365. void cat86_hide_analog_clock_display(S32 x1, S32 y1, S32 x2, S32 y2)
  1366. {
  1367.     /*----------------------------------------------------------------*/
  1368.     /* Local Variables                                                */
  1369.     /*----------------------------------------------------------------*/
  1370.     /*----------------------------------------------------------------*/
  1371.     /* Code Body                                                      */
  1372.     /*----------------------------------------------------------------*/
  1373.     x1 = 0;
  1374.     y1 = (MMI_title_y + MMI_title_height);
  1375.     x2 = UI_device_width - 1;
  1376.     y2 = UI_device_height - MMI_button_bar_height;
  1377.     gui_set_clip(x1, y1, x2, y2);
  1378.     /* 072605 Calvin modified */
  1379. #ifdef __GDI_MEMORY_PROFILE_2__
  1380.     gdi_draw_solid_rect(x1, y1, x2, y2, GDI_COLOR_TRANSPARENT);
  1381. #else 
  1382.     gui_show_image(cat86_image_x, cat86_image_y, cat86_image);
  1383. #endif 
  1384.     /* 072605 Calvin end */
  1385.     redraw_status_icon_bar(1);
  1386.     if (display_network_name)
  1387.     {
  1388.         idle_screen_show_network_name();
  1389.     }
  1390. }
  1391. /*****************************************************************************
  1392.  * FUNCTION
  1393.  *  DrawCate86CategoryControlArea
  1394.  * DESCRIPTION
  1395.  *  Draws the category86 category control area
  1396.  * PARAMETERS
  1397.  *  coordinate      [?]     
  1398.  * RETURNS
  1399.  *  void
  1400.  *****************************************************************************/
  1401. void DrawCate86CategoryControlArea(dm_coordinates *coordinate)
  1402. {
  1403.     /*----------------------------------------------------------------*/
  1404.     /* Local Variables                                                */
  1405.     /*----------------------------------------------------------------*/
  1406.     /*----------------------------------------------------------------*/
  1407.     /* Code Body                                                      */
  1408.     /*----------------------------------------------------------------*/
  1409.     RedrawCategory86Screen();
  1410. }
  1411. /*****************************************************************************
  1412.  * FUNCTION
  1413.  *  RedrawCategory86Screen
  1414.  * DESCRIPTION
  1415.  *  Redraws the category86 screen
  1416.  * PARAMETERS
  1417.  *  void
  1418.  * RETURNS
  1419.  *  void
  1420.  *****************************************************************************/
  1421. void RedrawCategory86Screen(void)
  1422. {
  1423.     /*----------------------------------------------------------------*/
  1424.     /* Local Variables                                                */
  1425.     /*----------------------------------------------------------------*/
  1426.     /*----------------------------------------------------------------*/
  1427.     /* Code Body                                                      */
  1428.     /*----------------------------------------------------------------*/
  1429.     // __CUSTPACK_MULTIBIN Calvin BEGIN
  1430.     //cat86_image=(PU8)GetImage(ANALOG_CLOCK); //051305 Calvin removed to showcategory86screen
  1431.     // __CUSTPACK_MULTIBIN Calvin END
  1432.     /* 072605 Calvin Start */
  1433.     /* 072605 Calvin End */
  1434.     /*
  1435.      * if(status_icon == 1) show_status_icons();
  1436.      * else if(status_icon==2)
  1437.      * {
  1438.      * draw_title();
  1439.      * show_title_status_icon();
  1440.      * }
  1441.      */
  1442.     show_main_LCD_dt_display();
  1443.     if (display_network_name)
  1444.     {
  1445.         idle_screen_show_network_name();
  1446.     }
  1447. }
  1448. /*****************************************************************************
  1449.  * FUNCTION
  1450.  *  ShowCategory86Screen
  1451.  * DESCRIPTION
  1452.  *  Displays the Idle screen
  1453.  * PARAMETERS
  1454.  *  title                   [IN]        Title for the screen
  1455.  *  title_icon              [IN]        Icon shown with the title
  1456.  *  left_softkey            [IN]        Left softkey label
  1457.  *  left_softkey_icon       [IN]        Icon for the left softkey
  1458.  *  right_softkey           [IN]        Right softkey label
  1459.  *  right_softkey_icon      [IN]        Icon for the right softkey
  1460.  *  img_id                  [IN]        
  1461.  *  network_string          [IN]        Service provider name
  1462.  *  history_buffer          [IN]        History buffer
  1463.  *  show_network_name       [IN]        If network name display on the screen
  1464.  * RETURNS
  1465.  *  void
  1466.  *****************************************************************************/
  1467. /* __CUSTPACK_MULTIBIN Calvin BEGIN */
  1468. void ShowCategory86Screen(U16 title, U16 title_icon, U16 left_softkey, U16 left_softkey_icon, U16 right_softkey, U16 right_softkey_icon, U16 img_id, U8 *network_string, U8 *history_buffer, U8 show_network_name)    /* 051305 Calvin modified */
  1469. /* __CUSTPACK_MULTIBIN Calvin END */
  1470. {
  1471.     /*----------------------------------------------------------------*/
  1472.     /* Local Variables                                                */
  1473.     /*----------------------------------------------------------------*/
  1474.     dm_data_struct dm_data;
  1475.     U16 btn_prev_item_id = 0, btn_next_item_id = 0; /* 010206 Calvin */
  1476.     /*----------------------------------------------------------------*/
  1477.     /* Code Body                                                      */
  1478.     /*----------------------------------------------------------------*/
  1479.     UI_UNUSED_PARAMETER(history_buffer);
  1480.     UI_UNUSED_PARAMETER(network_string);
  1481.     gui_lock_double_buffer();
  1482.     MMI_menu_shortcut_number = -1;
  1483.     change_left_softkey(left_softkey, left_softkey_icon);
  1484.     change_right_softkey(right_softkey, right_softkey_icon);
  1485.     SetupCategoryKeyHandlers();
  1486.     /* PMT VIKAS START 20050707 */
  1487. #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
  1488.     ShowStatusIconsTitle();
  1489. #endif 
  1490.     /* PMT VIKAS END 20050707 */
  1491.     /*
  1492.      * if((title==0) && (title_icon==0))
  1493.      * {  status_icon=1;
  1494.      * register_hide_status_icon_bar(0,idle_screen_hide_status_icons_bar0);
  1495.      * register_hide_status_icon_bar(1,idle_screen_hide_status_icons_bar1);
  1496.      * set_status_icon_bar_clip(0,0,0,UI_device_width-1,MMI_status_bar_height-1);
  1497.      * // 070905 Calvin Start 
  1498.      * #ifdef __MMI_KLG__
  1499.      * set_status_icon_bar_clip(1,UI_device_width-16,MMI_status_bar_height,UI_device_width-1,UI_device_height>>1);
  1500.      * #else
  1501.      * set_status_icon_bar_clip(1,UI_device_width-16,MMI_status_bar_height,UI_device_width-1,UI_device_height-MMI_softkey_height-2);
  1502.      * #endif
  1503.      * // 070905 Calvin End 
  1504.      * show_status_icon_bar(0);
  1505.      * show_status_icon_bar(1);
  1506.      * }
  1507.      * else if(!((title==0xffff) && (title_icon==0xffff)))
  1508.      * {
  1509.      * status_icon=2;
  1510.      * MMI_title_string=(UI_string_type)get_string(title);
  1511.      * MMI_title_icon=(PU8)get_image(title_icon);
  1512.      * }
  1513.      */
  1514.     MMI_title_string = (UI_string_type) get_string(title);
  1515.     MMI_title_icon = (PU8) get_image(title_icon);
  1516.     display_network_name = show_network_name;
  1517.     /* 080405 Calvin Start */
  1518. #ifdef __MMI_WALLPAPER_ON_BOTTOM__
  1519.     dm_get_scr_bg_image(&idle_scr_bg_ID, &idle_scr_bg_filename, &idle_scr_bg_x, &idle_scr_bg_y, &idle_scr_bg_opacity);
  1520.     dm_set_scr_bg_image(img_id, NULL, -1, -1, (U8)current_MMI_theme->bg_opacity_full);//120406 warning remove
  1521. #else /* __MMI_WALLPAPER_ON_BOTTOM__ */ 
  1522.     dm_add_image(get_image(img_id), NULL, NULL);
  1523.     wgui_set_wallpaper_on_bottom(MMI_TRUE);
  1524.     #ifndef __GDI_MEMORY_PROFILE_2__//062106 cat128
  1525.     cat86_image_x = cat86_image_y = 0;
  1526.     cat86_image = get_image(img_id);
  1527.     #endif 
  1528. #endif /* __MMI_WALLPAPER_ON_BOTTOM__ */ 
  1529.     /* 080405 Calvin End */
  1530.     //PMT HIMANSHU START 20050815
  1531.     //check if the title bar buttons are enabled for the particular screen.
  1532.     if (wgui_is_touch_title_bar_buttons())
  1533.     {
  1534.         btn_prev_item_id = dm_add_button(
  1535.                             NULL,
  1536.                             get_image(LEFT_RED_ARROW),
  1537.                             get_image(LEFT_RED_ARROW),
  1538.                             cat129_clear_icon_bg);
  1539.         btn_next_item_id = dm_add_button(
  1540.                             NULL,
  1541.                             get_image(RIGHT_RED_ARROW),
  1542.                             get_image(RIGHT_RED_ARROW),
  1543.                             cat129_clear_icon_bg);
  1544.         title_bg_id = IMAGE_VIEW_TITLEBAR_BG;
  1545.     }
  1546.     /* PMT HIMANSHU END 20050815 */
  1547.     analog_clock_initialize();
  1548.     set_main_LCD_dt_date_hide_function(dummy_dt_hide_function);
  1549.     set_main_LCD_dt_time_hide_function(cat86_hide_analog_clock_display);
  1550.     set_dt_display(DT_ANALOG_CLOCK_SC);
  1551.     gui_unlock_double_buffer();
  1552.     ExitCategoryFunction = ExitCategory86Screen;
  1553.     /* PMT HIMANSHU START 20050809 */
  1554. #if defined(__MMI_TOUCH_SCREEN__)
  1555.     if (wgui_is_touch_title_bar_buttons())
  1556.     {
  1557.         //BUG IMAGE VIEW START 20050917
  1558.         // register the handler for pen event down istead of pen event up.
  1559.         dm_register_button_functions(btn_prev_item_id, KEY_EVENT_UP, gMMI_touch_title_button1_down_handler);
  1560.         dm_register_button_functions(btn_next_item_id, KEY_EVENT_UP, gMMI_touch_title_button2_down_handler);
  1561.         /* BUG IMAGE VIEW END 20050917 */
  1562.     }
  1563. #endif /* defined(__MMI_TOUCH_SCREEN__) */ 
  1564.     /* PMT HIMANSHU END 20050809 */
  1565.     dm_setup_category_functions(dm_redraw_category_screen, dummy_get_history, dummy_get_history_size);
  1566.     dm_register_category_controlled_callback(DrawCate86CategoryControlArea);
  1567.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  1568.     dm_data.s32CatId = MMI_CATEGORY86_ID;
  1569.     dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
  1570.     dm_setup_data(&dm_data);
  1571.     dm_redraw_category_screen();
  1572. }
  1573. /*****************************************************************************
  1574.  * FUNCTION
  1575.  *  ExitCategory86Screen
  1576.  * DESCRIPTION
  1577.  *  Exits the Idle screen
  1578.  * PARAMETERS
  1579.  *  void
  1580.  * RETURNS
  1581.  *  void
  1582.  *****************************************************************************/
  1583. void ExitCategory86Screen(void)
  1584. {
  1585.     /*----------------------------------------------------------------*/
  1586.     /* Local Variables                                                */
  1587.     /*----------------------------------------------------------------*/
  1588.     /*----------------------------------------------------------------*/
  1589.     /* Code Body                                                      */
  1590.     /*----------------------------------------------------------------*/
  1591.     gui_hide_animations();
  1592.     register_hide_status_icon_bar(1, MMI_dummy_function);
  1593.     close_status_icons();
  1594.     close_main_LCD_dt_display();
  1595.     reset_softkeys();
  1596.     /* PMT HIMANSHU START 20050815 */
  1597.     title_bg_id = 0;
  1598.     wgui_reset_touch_title_bar_buttons();
  1599.     /* PMT HIMANSHU END 20050815 */
  1600.     /* 071205 Calvin Start */
  1601. #ifdef __MMI_WALLPAPER_ON_BOTTOM__
  1602.     /* 011206 wallpaper Calvin */
  1603.     if (wgui_is_wallpaper_change())
  1604.     {
  1605.         U8 dummy_opacity;
  1606.         dm_get_scr_bg_image(&idle_scr_bg_ID, &idle_scr_bg_filename, &idle_scr_bg_x, &idle_scr_bg_y, &dummy_opacity);
  1607.         dm_set_scr_bg_image(idle_scr_bg_ID, idle_scr_bg_filename, idle_scr_bg_x, idle_scr_bg_y, idle_scr_bg_opacity);
  1608.         wgui_reset_wallpaper_change();
  1609.     }
  1610.     else
  1611.     {
  1612.         dm_set_scr_bg_image_no_draw(
  1613.             idle_scr_bg_ID,
  1614.             idle_scr_bg_filename,
  1615.             idle_scr_bg_x,
  1616.             idle_scr_bg_y,
  1617.             idle_scr_bg_opacity);
  1618.     }
  1619. #endif /* __MMI_WALLPAPER_ON_BOTTOM__ */ 
  1620.     /* 071205 Calvin End */
  1621.     ExitCategoryFunction = MMI_dummy_function;
  1622.     RedrawCategoryFunction = MMI_dummy_function;
  1623.     GetCategoryHistory = dummy_get_history;
  1624.     GetCategoryHistorySize = dummy_get_history_size;
  1625. }
  1626. #endif /* __MMI_ANALOG_CLOCK__ */ 
  1627. extern gdi_handle animation_handle;
  1628. /*----------------------------------------------------------------------------/
  1629. Function:         RedrawCategory106Screen
  1630. Description:      redarw category 106
  1631. Input Parameters: noen
  1632. Output Parameters:   none
  1633. Returns:       none
  1634. -----------------------------------------------------------------------------*/
  1635. /*****************************************************************************
  1636.  * FUNCTION
  1637.  *  RedrawCategory106Screen
  1638.  * DESCRIPTION
  1639.  *  
  1640.  * PARAMETERS
  1641.  *  void
  1642.  * RETURNS
  1643.  *  void
  1644.  *****************************************************************************/
  1645. void RedrawCategory106Screen(void)
  1646. {
  1647.     /*----------------------------------------------------------------*/
  1648.     /* Local Variables                                                */
  1649.     /*----------------------------------------------------------------*/
  1650.     S32 SScallbackID;
  1651.     PU8 image;
  1652.     color c = gui_color(0, 0, 0);
  1653.     gdi_handle h;
  1654.     /*----------------------------------------------------------------*/
  1655.     /* Code Body                                                      */
  1656.     /*----------------------------------------------------------------*/
  1657.     c.alpha = 100;
  1658.     gui_lock_double_buffer();
  1659.     gui_reset_clip();
  1660.     clear_screen();
  1661.     gui_fill_rectangle(0, 0, UI_device_width - 1, UI_device_height - 1, c);
  1662.     if (ScreenSaverName == NULL)
  1663.     {
  1664.         wgui_show_animation();
  1665.     }
  1666.     else
  1667.     {
  1668.         S32 n_frames = 0;
  1669.         S32 width, height;
  1670.         GDI_RESULT ret;
  1671.         gdi_image_gif_get_frame_count_file((S8*) ScreenSaverName, &n_frames);
  1672.         gdi_image_get_dimension_file((S8*) ScreenSaverName, &width, &height);
  1673.         if (n_frames > 1)
  1674.         {
  1675.             ret = gdi_image_draw_animation_file(
  1676.                     (UI_device_width - width) >> 1,
  1677.                     (UI_device_height - height) >> 1,
  1678.                     (S8*) ScreenSaverName,
  1679.                     &h);
  1680.         }
  1681.         else
  1682.         {
  1683.             /* The orignal implementation seems just to fill whole screen */
  1684.             S32 disp_width = UI_device_width /* x2-x1 */ ;
  1685.             S32 disp_height = UI_device_height /* y2-y1 */ ;
  1686.             S32 offset_x = 0, offset_y = 0;
  1687.             S32 img_width = 0, img_heigth = 0;
  1688.             gdi_image_get_dimension_file((S8*) ScreenSaverName, &img_width, &img_heigth);
  1689.             if ((disp_width >= img_width) && (disp_height >= img_heigth))
  1690.             {
  1691.                 /* align preview window at the center of screen */
  1692.                 offset_x = (disp_width - img_width) >> 1;
  1693.                 offset_y = (disp_height - img_heigth) >> 1;
  1694.                 /* set clip region as content region */
  1695.                 /* gdi_layer_set_clip(0, (MMI_title_y+MMI_title_height), UI_device_width-1, (MMI_title_y+MMI_title_height)+MMI_content_height-1); */
  1696.                 ret = gdi_image_draw_file(offset_x, offset_y, (PS8) ScreenSaverName);
  1697.             }
  1698.             else
  1699.             {
  1700.                 S32 resized_offset_x;
  1701.                 S32 resized_offset_y;
  1702.                 S32 resized_width;
  1703.                 S32 resized_height;
  1704.                 U16 img_type;
  1705.                 gdi_image_util_fit_bbox(
  1706.                     disp_width,
  1707.                     disp_height,
  1708.                     img_width,
  1709.                     img_heigth,
  1710.                     &resized_offset_x,
  1711.                     &resized_offset_y,
  1712.                     &resized_width,
  1713.                     &resized_height);
  1714.                 img_type = gdi_image_get_type_from_file((PS8) ScreenSaverName);
  1715.                 if (img_type == GDI_IMAGE_TYPE_JPG_FILE)
  1716.                 {
  1717.                     ret = gdi_image_draw_resized_file(
  1718.                             resized_offset_x,
  1719.                             resized_offset_y,
  1720.                             resized_width,
  1721.                             resized_height,
  1722.                             (PS8) ScreenSaverName);
  1723.                 }
  1724.                 else
  1725.                 {
  1726.                     ret = gdi_image_draw_file(offset_x, offset_y, (PS8) ScreenSaverName);
  1727.                 }
  1728.             }
  1729.         }
  1730.         if (ret < 0 && ret != GDI_GIF_ERR_OUT_OF_CLIP_REGION && ret != GDI_BMP_ERR_OUT_OF_CLIP_REGION)
  1731.         {
  1732.             PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "RedrawCategory106Screen():[$$$]ret:%d [$$$]n", ret));
  1733.             SScallbackID = PhnsetScreenSaverBadFileCallBack();
  1734.             image = get_image((MMI_ID_TYPE) SScallbackID);
  1735.             gui_measure_image(image, &width, &height);
  1736.             gdi_image_draw_animation(
  1737.                 (UI_device_width - width) >> 1,
  1738.                 (UI_device_height - height) >> 1,
  1739.                 image,
  1740.                 &animation_handle);
  1741.             /* gui_show_animated_image((UI_device_width-width)>>1,(UI_device_height-height)>>1,image); */
  1742.         }
  1743.         /*
  1744.          * gdi_image_get_dimension_file((S8*)ScreenSaverName,&width,&height);
  1745.          * if ( gdi_image_draw_animation_file  ((UI_device_width-width)>>1,(UI_device_height-height)>>1,(S8*)ScreenSaverName,&h) <0 )
  1746.          * {
  1747.          * SScallbackID = PhnsetScreenSaverBadFileCallBack();
  1748.          * image = get_image((MMI_ID_TYPE)SScallbackID);
  1749.          * gui_measure_image(image,&width,&height);
  1750.          * gui_show_animated_image((UI_device_width-width)>>1,(UI_device_height-height)>>1,image);
  1751.          * }
  1752.          */
  1753.     }
  1754.     gui_unlock_double_buffer();
  1755.     gui_BLT_double_buffer(0, 0, UI_device_width - 1, UI_device_height - 1);
  1756. }
  1757. /*****************************************************************************
  1758.  * FUNCTION
  1759.  *  ShowCategory106Screen
  1760.  * DESCRIPTION
  1761.  *  Shows an animated icon
  1762.  * PARAMETERS
  1763.  *  icon_screensaver        [IN]        
  1764.  *  filename                [?]         
  1765.  *  history_buffer          [IN]        History buffer
  1766.  *  MMI_ID_TYPE(?)          [IN]        Animated/Non Animated Icon
  1767.  * RETURNS
  1768.  *  void
  1769.  *****************************************************************************/
  1770. void ShowCategory106Screen(U16 icon_screensaver, U8 *filename, U8 *history_buffer)
  1771. {
  1772.     /*----------------------------------------------------------------*/
  1773.     /* Local Variables                                                */
  1774.     /*----------------------------------------------------------------*/
  1775.     PU8 screensaver_icon;
  1776.     /*----------------------------------------------------------------*/
  1777.     /* Code Body                                                      */
  1778.     /*----------------------------------------------------------------*/
  1779.     UI_UNUSED_PARAMETER(history_buffer);
  1780.     entry_full_screen();
  1781.     gui_lock_double_buffer();
  1782.     clear_category_screen_key_handlers();
  1783.     screen_saver_type = NORMAL_SCREEN_SAVER;
  1784.     if (icon_screensaver != 0)
  1785.     {
  1786.         screensaver_icon = (PU8) get_image(icon_screensaver);
  1787.         wgui_set_animation((UI_device_width >> 1), (UI_device_height >> 1), icon_screensaver);
  1788.         ScreenSaverName = NULL;
  1789.     }
  1790.     else
  1791.     {
  1792.         ScreenSaverName = filename;
  1793.     }
  1794.     gui_unlock_double_buffer();
  1795.     ExitCategoryFunction = ExitCategory106Screen;
  1796.     RedrawCategoryFunction = RedrawCategory106Screen;
  1797.     GetCategoryHistory = dummy_get_history;
  1798.     GetCategoryHistorySize = dummy_get_history_size;
  1799.     RedrawCategory106Screen();
  1800. }
  1801. /* MTK Leo end */
  1802. /*****************************************************************************
  1803.  * FUNCTION
  1804.  *  ExitCategory106Screen
  1805.  * DESCRIPTION
  1806.  *  Exits the category106 screen
  1807.  * PARAMETERS
  1808.  *  void
  1809.  * RETURNS
  1810.  *  void
  1811.  *****************************************************************************/
  1812. void ExitCategory106Screen(void)
  1813. {
  1814.     /*----------------------------------------------------------------*/
  1815.     /* Local Variables                                                */
  1816.     /*----------------------------------------------------------------*/
  1817.     /*----------------------------------------------------------------*/
  1818.     /* Code Body                                                      */
  1819.     /*----------------------------------------------------------------*/
  1820.     if (animation_handle != GDI_ERROR_HANDLE)
  1821.     {
  1822.         gdi_image_stop_animation(animation_handle);
  1823.     }
  1824.     /* gui_hide_animations(); */
  1825.     ExitCategoryFunction = MMI_dummy_function;
  1826.     RedrawCategoryFunction = MMI_dummy_function;
  1827.     GetCategoryHistory = dummy_get_history;
  1828.     GetCategoryHistorySize = dummy_get_history_size;
  1829. }
  1830. gdi_handle cat128_anim_handle;  /* 072605 Calvin added */
  1831. /*****************************************************************************
  1832.  * FUNCTION
  1833.  *  category128_hide_dt_display
  1834.  * DESCRIPTION
  1835.  *  hide date function of category128
  1836.  * PARAMETERS
  1837.  *  x1      [IN]        Start x position
  1838.  *  y1      [IN]        Start y position
  1839.  *  x2      [IN]        End x position
  1840.  *  y2      [IN]        End y position
  1841.  * RETURNS
  1842.  *  void
  1843.  *****************************************************************************/
  1844. void category128_hide_dt_display(S32 x1, S32 y1, S32 x2, S32 y2)
  1845. {
  1846.     /*----------------------------------------------------------------*/
  1847.     /* Local Variables                                                */
  1848.     /*----------------------------------------------------------------*/
  1849.     /*----------------------------------------------------------------*/
  1850.     /* Code Body                                                      */
  1851.     /*----------------------------------------------------------------*/
  1852.     x1 = 0;
  1853.     x2 = UI_device_width - 1;
  1854. #if defined(__MMI_MAINLCD_176X220__) || defined (__MMI_MAINLCD_240X320__)       /* 041205 Calvin modieid */
  1855.     y1 = MMI_title_y + MMI_title_height;
  1856. #else 
  1857.     y1 = MMI_status_bar_height;
  1858. #endif 
  1859.     y2 = UI_device_height - MMI_button_bar_height;
  1860.     gui_set_clip(x1, y1, x2, y2);
  1861.     /* 072605 Calvin modified */
  1862. #ifdef __GDI_MEMORY_PROFILE_2__
  1863.     gdi_draw_solid_rect(x1, y1, x2, y2, GDI_COLOR_TRANSPARENT);
  1864. #else 
  1865.     gui_show_image(cat128_image_x, cat128_image_y, cat128_image);
  1866. #endif 
  1867.     /* 072605 Calvin end */
  1868.     if (status_icon)
  1869.     {
  1870.         redraw_status_icon_bar(1);
  1871.     }
  1872.     gui_reset_clip();
  1873.     if (display_network_name && (disp_network_screeen_saver == 1))
  1874.     {
  1875.         idle_screen_show_network_name();
  1876.     }
  1877. }
  1878. /*****************************************************************************
  1879.  * FUNCTION
  1880.  *  DrawCate128CategoryControlArea
  1881.  * DESCRIPTION
  1882.  *  Draws the category128 category control area
  1883.  * PARAMETERS
  1884.  *  coordinate      [IN/OUT]        Coordinates of category controlled area.
  1885.  * RETURNS
  1886.  *  void
  1887.  *****************************************************************************/
  1888. void DrawCate128CategoryControlArea(dm_coordinates *coordinate)
  1889. {
  1890.     /*----------------------------------------------------------------*/
  1891.     /* Local Variables                                                */
  1892.     /*----------------------------------------------------------------*/
  1893.     /*----------------------------------------------------------------*/
  1894.     /* Code Body                                                      */
  1895.     /*----------------------------------------------------------------*/
  1896.     RedrawCategory128Screen();
  1897. }
  1898. /*****************************************************************************
  1899.  * FUNCTION
  1900.  *  RedrawCategory128Screen
  1901.  * DESCRIPTION
  1902.  *  Redraws the category128 screen
  1903.  * PARAMETERS
  1904.  *  void
  1905.  * RETURNS
  1906.  *  void
  1907.  *****************************************************************************/
  1908. void RedrawCategory128Screen(void)
  1909. {
  1910.     /*----------------------------------------------------------------*/
  1911.     /* Local Variables                                                */
  1912.     /*----------------------------------------------------------------*/
  1913.     /*----------------------------------------------------------------*/
  1914.     /* Code Body                                                      */
  1915.     /*----------------------------------------------------------------*/
  1916.     /* gui_lock_double_buffer();//071205 Calvin removed */
  1917.     gui_set_clip(0, (MMI_title_y + MMI_title_height), UI_device_width - 1, UI_device_height - MMI_button_bar_height);
  1918.     if (display_network_name && (disp_network_screeen_saver == 1))
  1919.     {
  1920.         idle_screen_show_network_name();
  1921.     }
  1922.     show_main_LCD_dt_display();
  1923. }
  1924. /*****************************************************************************
  1925.  * FUNCTION
  1926.  *  ExitCategory128Screen
  1927.  * DESCRIPTION
  1928.  *  Exits the category128 screen
  1929.  * PARAMETERS
  1930.  *  void
  1931.  * RETURNS
  1932.  *  void
  1933.  *****************************************************************************/
  1934. void ExitCategory128Screen(void)
  1935. {
  1936.     /*----------------------------------------------------------------*/
  1937.     /* Local Variables                                                */
  1938.     /*----------------------------------------------------------------*/
  1939.     /*----------------------------------------------------------------*/
  1940.     /* Code Body                                                      */
  1941.     /*----------------------------------------------------------------*/
  1942.     gui_hide_animations();
  1943.     reset_softkeys();
  1944.     register_hide_status_icon_bar(1, MMI_dummy_function);
  1945.     close_status_icons();
  1946.     close_main_LCD_dt_display();
  1947.     reset_multiline_inputbox();
  1948.     /* PMT HIMANSHU START 20050815 */
  1949.     title_bg_id = 0;
  1950.     wgui_reset_touch_title_bar_buttons();
  1951.     /* PMT HIMANSHU END 20050815 */
  1952.     /* 071205 Calvin Start */
  1953. #ifdef __MMI_WALLPAPER_ON_BOTTOM__
  1954.     /* 011206 wallpaper Calvin */
  1955.     if (wgui_is_wallpaper_change())
  1956.     {
  1957.         U8 dummy_opacity;
  1958.         dm_get_scr_bg_image(&idle_scr_bg_ID, &idle_scr_bg_filename, &idle_scr_bg_x, &idle_scr_bg_y, &dummy_opacity);
  1959.         dm_set_scr_bg_image(idle_scr_bg_ID, idle_scr_bg_filename, idle_scr_bg_x, idle_scr_bg_y, idle_scr_bg_opacity);
  1960.         wgui_reset_wallpaper_change();
  1961.     }
  1962.     else
  1963.     {
  1964.         dm_set_scr_bg_image_no_draw(
  1965.             idle_scr_bg_ID,
  1966.             idle_scr_bg_filename,
  1967.             idle_scr_bg_x,
  1968.             idle_scr_bg_y,
  1969.             idle_scr_bg_opacity);
  1970.     }
  1971. #endif /* __MMI_WALLPAPER_ON_BOTTOM__ */ 
  1972.     /* 071205 Calvin End */
  1973. }
  1974. /*****************************************************************************
  1975.  * FUNCTION
  1976.  *  ShowCategory128Screen
  1977.  * DESCRIPTION
  1978.  *  Displays the Category128 screen
  1979.  * PARAMETERS
  1980.  *  title                   [IN]        Title for the screen
  1981.  *  title_icon              [IN]        Icon shown with the title
  1982.  *  left_softkey            [IN]        Left softkey label
  1983.  *  left_softkey_icon       [IN]        Icon for the left softkey
  1984.  *  right_softkey           [IN]        Right softkey label
  1985.  *  right_softkey_icon      [IN]        Icon for the right softkey
  1986.  *  screen_img              [IN]        Image id
  1987.  *  date_flag               [IN]        
  1988.  *  time_flag               [IN]        
  1989.  *  service_provider        [IN]        Service provider name id
  1990.  *  history_buffer          [IN]        History buffer
  1991.  *  show_network_name       [IN]        If network name display on the screen
  1992.  * RETURNS
  1993.  *  void
  1994.  *****************************************************************************/
  1995. void ShowCategory128Screen(
  1996.         U16 title,
  1997.         U16 title_icon,
  1998.         U16 left_softkey,
  1999.         U16 left_softkey_icon,
  2000.         U16 right_softkey,
  2001.         U16 right_softkey_icon,
  2002.         U16 screen_img,
  2003.         U8 date_flag,
  2004.         U8 time_flag,
  2005.         U8 service_provider,
  2006.         U8 *history_buffer,
  2007.         U8 show_network_name)
  2008. {
  2009.     /*----------------------------------------------------------------*/
  2010.     /* Local Variables                                                */
  2011.     /*----------------------------------------------------------------*/
  2012.     dm_data_struct dm_data;
  2013.     /* PMT HIMANSHU START 20050815 */
  2014.     U16 btn_prev_item_id = 0, btn_next_item_id = 0; /* 010206 Calvin */
  2015.     /* PMT HIMANSHU END 20050815 */
  2016.     /*----------------------------------------------------------------*/
  2017.     /* Code Body                                                      */
  2018.     /*----------------------------------------------------------------*/
  2019.     UI_UNUSED_PARAMETER(history_buffer);
  2020.     gui_lock_double_buffer();
  2021.     MMI_menu_shortcut_number = -1;
  2022.     change_left_softkey(left_softkey, left_softkey_icon);
  2023.     change_right_softkey(right_softkey, right_softkey_icon);
  2024.     SetupCategoryKeyHandlers();
  2025.     display_network_name = show_network_name;
  2026.     /* PMT VIKAS START 20050707 */
  2027. #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
  2028.     ShowStatusIconsTitle();
  2029. #endif 
  2030.     /* PMT VIKAS END 20050707 */
  2031.     /*
  2032.      * if((title==0) && (title_icon==0))
  2033.      * {  status_icon=1;
  2034.      * register_hide_status_icon_bar(0,idle_screen_hide_status_icons_bar0);
  2035.      * register_hide_status_icon_bar(1,idle_screen_hide_status_icons_bar1);
  2036.      * set_status_icon_bar_clip(0,0,0,UI_device_width-1,MMI_status_bar_height-1);
  2037.      * // 070905 Calvin Start 
  2038.      * #ifdef __MMI_KLG__
  2039.      * set_status_icon_bar_clip(1,UI_device_width-16,MMI_status_bar_height,UI_device_width-1,UI_device_height>>1);
  2040.      * #else
  2041.      * set_status_icon_bar_clip(1,UI_device_width-16,MMI_status_bar_height,UI_device_width-1,UI_device_height-MMI_softkey_height-2);
  2042.      * #endif
  2043.      * // 070905 Calvin End 
  2044.      * show_status_icon_bar(0);
  2045.      * show_status_icon_bar(1);
  2046.      * }
  2047.      * else if(!((title==0xffff) && (title_icon==0xffff)))
  2048.      * {
  2049.      * status_icon=2;
  2050.      * MMI_title_string=(UI_string_type)get_string(title);
  2051.      * MMI_title_icon=(PU8)get_image(title_icon);
  2052.      * }
  2053.      */
  2054.     MMI_title_string = (UI_string_type) get_string(title);
  2055.     MMI_title_icon = (PU8) get_image(title_icon);
  2056.     /* 080405 Calvin Start */
  2057. #ifdef __MMI_WALLPAPER_ON_BOTTOM__
  2058.     dm_get_scr_bg_image(&idle_scr_bg_ID, &idle_scr_bg_filename, &idle_scr_bg_x, &idle_scr_bg_y, &idle_scr_bg_opacity);
  2059.     dm_set_scr_bg_image(screen_img, NULL, -1, -1, (U8)current_MMI_theme->bg_opacity_full);//120406 warning remove
  2060. #else /* __MMI_WALLPAPER_ON_BOTTOM__ */ 
  2061.     dm_add_image(get_image(screen_img), NULL, NULL);
  2062.     wgui_set_wallpaper_on_bottom(MMI_TRUE);
  2063.     #ifndef __GDI_MEMORY_PROFILE_2__//062106 cat128
  2064.     cat128_image_x = cat128_image_y = 0;
  2065.     cat128_image = get_image(screen_img);
  2066.     #endif
  2067. #endif /* __MMI_WALLPAPER_ON_BOTTOM__ */ 
  2068.     /* 080405 Calvin End */
  2069.     //PMT HIMANSHU START 20050815
  2070.     //check if the title bar buttons are enabled for the particular screen.
  2071.     if (wgui_is_touch_title_bar_buttons())
  2072.     {
  2073.         btn_prev_item_id = dm_add_button(
  2074.                             NULL,
  2075.                             get_image(LEFT_RED_ARROW),
  2076.                             get_image(LEFT_RED_ARROW),
  2077.                             cat129_clear_icon_bg);
  2078.         btn_next_item_id = dm_add_button(
  2079.                             NULL,
  2080.                             get_image(RIGHT_RED_ARROW),
  2081.                             get_image(RIGHT_RED_ARROW),
  2082.                             cat129_clear_icon_bg);
  2083.         title_bg_id = IMAGE_VIEW_TITLEBAR_BG;
  2084.     }
  2085.     /* PMT HIMANSHU END 20050815 */
  2086.     set_main_LCD_dt_date_hide_function(dummy_dt_hide_function);
  2087.     set_main_LCD_dt_time_hide_function(category128_hide_dt_display);
  2088.     if (date_flag == 1 && time_flag == 1)
  2089.     {
  2090.         set_dt_display(DT_DIGITAL_CLOCK_SC1);
  2091.     }
  2092.     else if (date_flag == 1)
  2093.     {
  2094.         set_dt_display(DT_DIGITAL_CLOCK_SC2);
  2095.     }
  2096.     else if (time_flag == 1)
  2097.     {
  2098.         set_dt_display(DT_DIGITAL_CLOCK_SC3);
  2099.     }
  2100.     if (service_provider == 1)
  2101.     {
  2102.         disp_network_screeen_saver = 1;
  2103.     }
  2104.     else
  2105.     {
  2106.         disp_network_screeen_saver = 0;
  2107.     }
  2108.     gui_unlock_double_buffer();
  2109.     ExitCategoryFunction = ExitCategory128Screen;
  2110.     /* PMT HIMANSHU START 20050809 */
  2111. #if defined(__MMI_TOUCH_SCREEN__)
  2112.     if (wgui_is_touch_title_bar_buttons())
  2113.     {
  2114.         //BUG IMAGE VIEW START 20050917
  2115.         // register the handler for pen event down istead of pen event up.
  2116.         dm_register_button_functions(btn_prev_item_id, KEY_EVENT_UP, gMMI_touch_title_button1_down_handler);
  2117.         dm_register_button_functions(btn_next_item_id, KEY_EVENT_UP, gMMI_touch_title_button2_down_handler);
  2118.         /* BUG IMAGE VIEW END 20050917 */
  2119.     }
  2120. #endif /* defined(__MMI_TOUCH_SCREEN__) */ 
  2121.     /* PMT HIMANSHU END 20050809 */
  2122.     dm_setup_category_functions(dm_redraw_category_screen, dummy_get_history, dummy_get_history_size);
  2123.     dm_register_category_controlled_callback(DrawCate128CategoryControlArea);
  2124.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  2125.     dm_data.s32CatId = MMI_CATEGORY128_ID;
  2126.     dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
  2127.     dm_setup_data(&dm_data);
  2128.     dm_redraw_category_screen();
  2129. }
  2130. /*****************************************************************************
  2131.  * FUNCTION
  2132.  *  ExitCategory131Screen
  2133.  * DESCRIPTION
  2134.  *  Exits the category131 screen
  2135.  * PARAMETERS
  2136.  *  void
  2137.  * RETURNS
  2138.  *  void
  2139.  *****************************************************************************/
  2140. void ExitCategory131Screen(void)
  2141. {
  2142.     /*----------------------------------------------------------------*/
  2143.     /* Local Variables                                                */
  2144.     /*----------------------------------------------------------------*/
  2145.     /*----------------------------------------------------------------*/
  2146.     /* Code Body                                                      */
  2147.     /*----------------------------------------------------------------*/
  2148.     gui_hide_animations();
  2149.     close_main_LCD_dt_display();
  2150. }
  2151. /* store the strat x postition of category131 image,strat y postition of category131 image,image width,image height */
  2152. S32 cat131_image_x, cat131_image_y, cat131_image_width, cat131_image_height;
  2153. /* store image id of category131 image  */
  2154. PU8 cat131_image;
  2155. /*****************************************************************************
  2156.  * FUNCTION
  2157.  *  cat131_hide_analog_clock_display
  2158.  * DESCRIPTION
  2159.  *  hide function of category131 for analog clock
  2160.  * PARAMETERS
  2161.  *  x1      [IN]        Start x position
  2162.  *  y1      [IN]        Start y position
  2163.  *  x2      [IN]        End x position
  2164.  *  y2      [IN]        End y position
  2165.  * RETURNS
  2166.  *  void
  2167.  *****************************************************************************/
  2168. void cat131_hide_analog_clock_display(S32 x1, S32 y1, S32 x2, S32 y2)
  2169. {
  2170.     /*----------------------------------------------------------------*/
  2171.     /* Local Variables                                                */
  2172.     /*----------------------------------------------------------------*/
  2173.     /*----------------------------------------------------------------*/
  2174.     /* Code Body                                                      */
  2175.     /*----------------------------------------------------------------*/
  2176.     x1 = 16;
  2177.     y1 = (MMI_title_y + MMI_title_height);
  2178.     x2 = UI_device_width - 16;
  2179.     y2 = UI_device_height - MMI_button_bar_height;
  2180.     gui_set_clip(x1, y1, x2, y2);
  2181.     gdi_image_draw(cat131_image_x, cat131_image_y, (U8*) cat131_image);
  2182. }
  2183. /*****************************************************************************
  2184.  * FUNCTION
  2185.  *  cat131_hide_digital_clock_display
  2186.  * DESCRIPTION
  2187.  *  hide function of category131 for digital  clock
  2188.  * PARAMETERS
  2189.  *  x1      [IN]        Start x position
  2190.  *  y1      [IN]        Start y position
  2191.  *  x2      [IN]        End x position
  2192.  *  y2      [IN]        End y position
  2193.  * RETURNS
  2194.  *  void
  2195.  *****************************************************************************/
  2196. void cat131_hide_digital_clock_display(S32 x1, S32 y1, S32 x2, S32 y2)
  2197. {
  2198.     /*----------------------------------------------------------------*/
  2199.     /* Local Variables                                                */
  2200.     /*----------------------------------------------------------------*/
  2201.     /*----------------------------------------------------------------*/
  2202.     /* Code Body                                                      */
  2203.     /*----------------------------------------------------------------*/
  2204.     x1 = 0;
  2205.     y1 = 0;
  2206.     x2 = UI_device_width - 1;
  2207.     y2 = UI_device_height - 1;
  2208.     gui_set_clip(x1, y1, x2, y2);
  2209.     gdi_image_draw(cat131_image_x, cat131_image_y, (U8*) cat131_image);
  2210. }
  2211. /*****************************************************************************
  2212.  * FUNCTION
  2213.  *  DrawCate131CategoryControlArea
  2214.  * DESCRIPTION
  2215.  *  Draws the category131 category control area
  2216.  * PARAMETERS
  2217.  *  coordinate      [IN/OUT]        Coordinates of category controlled area.
  2218.  * RETURNS
  2219.  *  void
  2220.  *****************************************************************************/
  2221. void DrawCate131CategoryControlArea(dm_coordinates *coordinate)
  2222. {
  2223.     /*----------------------------------------------------------------*/
  2224.     /* Local Variables                                                */
  2225.     /*----------------------------------------------------------------*/
  2226.     /*----------------------------------------------------------------*/
  2227.     /* Code Body                                                      */
  2228.     /*----------------------------------------------------------------*/
  2229.     RedrawCategory131Screen();
  2230. }
  2231. /*****************************************************************************
  2232.  * FUNCTION
  2233.  *  RedrawCategory131Screen
  2234.  * DESCRIPTION
  2235.  *  Redraws the category131 screen
  2236.  * PARAMETERS
  2237.  *  void
  2238.  * RETURNS
  2239.  *  void
  2240.  *****************************************************************************/
  2241. void RedrawCategory131Screen(void)
  2242. {
  2243.     /*----------------------------------------------------------------*/
  2244.     /* Local Variables                                                */
  2245.     /*----------------------------------------------------------------*/
  2246.     /*----------------------------------------------------------------*/
  2247.     /* Code Body                                                      */
  2248.     /*----------------------------------------------------------------*/
  2249.     clear_screen_with_color(UI_COLOR_BLACK);
  2250. #ifndef __MMI_UI_TECHNO_IDLESCREEN_BAR__
  2251. #ifdef __MMI_ANALOG_CLOCK__
  2252.     if (screen_saver_type == ANALOG_SCREEN_SAVER)
  2253.     {
  2254.         cat131_image = get_image(IMG_ID_DISPCHAR_ANALOG_CLK);
  2255.     }
  2256. #endif /* __MMI_ANALOG_CLOCK__ */ 
  2257. #ifdef __MMI_DIGITAL_CLOCK__
  2258.     if (screen_saver_type == DIGITAL_SCREEN_SAVER)
  2259.     {
  2260.         cat131_image = get_image(IMG_ID_DISPCHAR_DIGITAL_CLK);
  2261.     }
  2262. #endif /* __MMI_DIGITAL_CLOCK__ */ 
  2263. #endif /* __MMI_UI_TECHNO_IDLESCREEN_BAR__ */
  2264.     gui_measure_image(cat131_image, &cat131_image_width, &cat131_image_height);
  2265.     cat131_image_x = (UI_device_width >> 1) - (cat131_image_width >> 1);
  2266.     cat131_image_y = (UI_device_height >> 1) - (cat131_image_height >> 1);
  2267.     gdi_image_draw(cat131_image_x, cat131_image_y, (U8*) cat131_image);
  2268.     show_main_LCD_dt_display();
  2269. }
  2270. /*****************************************************************************
  2271.  * FUNCTION
  2272.  *  ShowCategory131Screen
  2273.  * DESCRIPTION
  2274.  *  show analog or digital clock screen saver depends icon_screensaver value
  2275.  * PARAMETERS
  2276.  *  icon_screensaver        [IN]        Id of the image
  2277.  *  history_buffer          [IN]        History buffer
  2278.  * RETURNS
  2279.  *  void
  2280.  *****************************************************************************/
  2281. void ShowCategory131Screen(U16 icon_screensaver, U8 *history_buffer)
  2282. {
  2283.     /*----------------------------------------------------------------*/
  2284.     /* Local Variables                                                */
  2285.     /*----------------------------------------------------------------*/
  2286.     dm_data_struct dm_data;
  2287.     /*----------------------------------------------------------------*/
  2288.     /* Code Body                                                      */
  2289.     /*----------------------------------------------------------------*/
  2290.     UI_UNUSED_PARAMETER(history_buffer);
  2291.     entry_full_screen();
  2292.     gui_lock_double_buffer();
  2293.     clear_category_screen_key_handlers();
  2294.     if (screen_saver_type == ANALOG_SCREEN_SAVER)
  2295.     {
  2296.     #ifdef __MMI_ANALOG_CLOCK__
  2297.         analog_clock_initialize();
  2298.         set_main_LCD_dt_date_hide_function(dummy_dt_hide_function);
  2299.         set_main_LCD_dt_time_hide_function(cat131_hide_analog_clock_display);
  2300.         set_dt_display(DT_ANALOG_CLOCK_SC);
  2301.     #endif /* __MMI_ANALOG_CLOCK__ */ 
  2302.     }
  2303.     else if (screen_saver_type == DIGITAL_SCREEN_SAVER)
  2304.     {
  2305.     #ifdef __MMI_DIGITAL_CLOCK__
  2306.         set_main_LCD_dt_date_hide_function(dummy_dt_hide_function);
  2307.         set_main_LCD_dt_time_hide_function(cat131_hide_digital_clock_display);
  2308.         set_dt_display(DT_DIGITAL_CLOCK_SC1);
  2309.     #endif /* __MMI_DIGITAL_CLOCK__ */ 
  2310.     }
  2311.     gui_unlock_double_buffer();
  2312.     ExitCategoryFunction = ExitCategory131Screen;
  2313.     dm_setup_category_functions(dm_redraw_category_screen, dummy_get_history, dummy_get_history_size);
  2314.     dm_register_category_controlled_callback(DrawCate131CategoryControlArea);
  2315.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  2316.     dm_data.s32CatId = MMI_CATEGORY131_ID;
  2317.     dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
  2318.     dm_setup_data(&dm_data);
  2319.     dm_redraw_category_screen();
  2320. }
  2321. #ifdef __MMI_LCD_PARTIAL_ON__
  2322. /*****************************************************************************
  2323.  * FUNCTION
  2324.  *  Category161ChangeTime
  2325.  * DESCRIPTION
  2326.  *  change the time of category161
  2327.  * PARAMETERS
  2328.  *  t       [IN]        Time
  2329.  * RETURNS
  2330.  *  void
  2331.  *****************************************************************************/
  2332. void Category161ChangeTime(UI_time *t)
  2333. {
  2334.     /*----------------------------------------------------------------*/
  2335.     /* Local Variables                                                */
  2336.     /*----------------------------------------------------------------*/
  2337.     /*----------------------------------------------------------------*/
  2338.     /* Code Body                                                      */
  2339.     /*----------------------------------------------------------------*/
  2340.     cat161_time = *t;
  2341. }
  2342. #if defined(__MMI_MAINLCD_176X220__) || defined (__MMI_MAINLCD_240X320__)       /* 041205 Calvin modieid */
  2343. #define CAT161_ICON_GAP    (3)
  2344. #else 
  2345. #define CAT161_ICON_GAP    (2)
  2346. #endif 
  2347. extern stFontAttribute wgui_dialer_box_f1;
  2348. /*****************************************************************************
  2349.  * FUNCTION
  2350.  *  RedrawCategory161Screen
  2351.  * DESCRIPTION
  2352.  *  Redraws the category161 screen
  2353.  * PARAMETERS
  2354.  *  void
  2355.  * RETURNS
  2356.  *  void
  2357.  *****************************************************************************/
  2358. void RedrawCategory161Screen(void)
  2359. {
  2360.     /*----------------------------------------------------------------*/
  2361.     /* Local Variables                                                */
  2362.     /*----------------------------------------------------------------*/
  2363.     color c;
  2364.     S32 twidth, theight;
  2365.     S32 y_round, partial_on_height = UI_LCD_PARTIAL_ON_HEIGHT;
  2366.     S32 x1, x2, y1, y2, y2_last = 0;    /* 010206 Calvin */
  2367.     S32 text_x;
  2368.     S32 icon_width, icon_height;
  2369.     int icon_index, num_icon_displayed;
  2370.     U8 timestr[64];
  2371.     /*----------------------------------------------------------------*/
  2372.     /* Code Body                                                      */
  2373.     /*----------------------------------------------------------------*/
  2374.     gui_lock_double_buffer();
  2375. #if defined(BLACK_BACKLIGHT)
  2376.     c.r = c.g = c.b = 0;
  2377. #elif defined(BLUE_BACKLIGHT)
  2378.     c.r = c.g = 0;
  2379.     c.b = 255;
  2380. #elif defined(WHITE_BACKLIGHT)
  2381.     c.r = c.g = c.b = 255;
  2382. #else 
  2383.     c.r = c.g = c.b = 255;
  2384. #endif 
  2385.     c.alpha = 100;
  2386. #ifndef WIN32
  2387.     y_round = lcd_partial_display_align_line(MAIN_LCD);
  2388.     if (y_round > 1 && (partial_on_height % y_round) != 0)
  2389.     {
  2390.         partial_on_height += (y_round - (partial_on_height % y_round));
  2391.     }
  2392. #endif /* WIN32 */ 
  2393.     y_round = UI_device_height / partial_on_height;
  2394.     x1 = 0;
  2395.     y1 = (cat161_time.nMin % y_round) * partial_on_height;
  2396.     x2 = UI_device_width - 1;
  2397.     y2 = y1 + partial_on_height - 1;
  2398.     if (cat161_last_y_offset >= 0 && cat161_last_y_offset != y1)
  2399.     {
  2400.         y2_last = cat161_last_y_offset + partial_on_height - 1;
  2401.     }
  2402.     /* Dialing font has only english characters */
  2403.     time_string(&cat161_time, (UI_string_type) timestr, DT_IDLE_SCREEN_ENGLISH_ONLY);
  2404.     gui_push_clip();
  2405.     gui_push_text_clip();
  2406.     gui_set_clip(0, 0, UI_device_width - 1, UI_device_height - 1);
  2407.     gui_set_text_clip(0, 0, UI_device_width - 1, UI_device_height - 1);
  2408.     if (cat161_last_y_offset >= 0 && cat161_last_y_offset != y1)
  2409.     {
  2410.         gui_fill_rectangle(x1, cat161_last_y_offset, x2, y2_last, c);
  2411.     }
  2412.     gui_fill_rectangle(x1, y1, x2, y2, c);
  2413.     gui_set_font(&wgui_dialer_box_f1);
  2414.     gui_measure_string((UI_string_type) timestr, &twidth, &theight);
  2415.     text_x = (UI_device_width - twidth) >> 1;
  2416.     if (MMI_status_icons_partial_display_n_icons > 0)
  2417.     {
  2418.         gui_measure_image(MMI_status_icons[0].icon_data, &icon_width, &icon_height);
  2419.         if ((CAT161_ICON_GAP + (icon_width + CAT161_ICON_GAP) * MMI_status_icons_partial_display_n_icons)
  2420.             * 2 + twidth > UI_device_width)
  2421.         {
  2422.             /* Do not center the text */
  2423.             num_icon_displayed = (UI_device_width - twidth - (CAT161_ICON_GAP * 2)) / (icon_width + CAT161_ICON_GAP);
  2424.             if (num_icon_displayed > MMI_status_icons_partial_display_n_icons)
  2425.             {
  2426.                 num_icon_displayed = MMI_status_icons_partial_display_n_icons;
  2427.             }
  2428.             text_x = CAT161_ICON_GAP + (icon_width + CAT161_ICON_GAP) * num_icon_displayed;
  2429.         }
  2430.         else
  2431.         {
  2432.             text_x = (UI_device_width - twidth) >> 1;
  2433.             num_icon_displayed = MMI_status_icons_partial_display_n_icons;
  2434.         }
  2435.         for (icon_index = 0; icon_index < num_icon_displayed; icon_index++)
  2436.         {
  2437.             if (icon_height > partial_on_height)
  2438.             {
  2439.                 break;  /* Abnormal case */
  2440.             }
  2441.             gui_show_transparent_image(
  2442.                 CAT161_ICON_GAP + (CAT161_ICON_GAP + icon_width) * icon_index,
  2443.                 y1 + ((partial_on_height - icon_height) >> 1),
  2444.                 MMI_status_icons[MMI_status_icons_list_partial_display[icon_index]].icon_data,
  2445.                 0);
  2446.         }
  2447.     }
  2448. #if defined(BLACK_BACKLIGHT)
  2449.     gui_set_text_color(gui_color(255, 255, 255));
  2450. #else
  2451.     gui_set_text_color(gui_color(0, 0, 0));
  2452. #endif
  2453.     if (r2lMMIFlag)
  2454.     {
  2455.         gui_move_text_cursor((text_x + twidth - 1), y1 + ((partial_on_height - theight) >> 1));
  2456.     }
  2457.     else
  2458.     {
  2459.         gui_move_text_cursor(text_x, y1 + ((partial_on_height - theight) >> 1));
  2460.     }
  2461.     gui_print_text((UI_string_type) timestr);
  2462.     gui_set_font(&MMI_medium_font);
  2463.     gui_pop_text_clip();
  2464.     gui_pop_clip();
  2465.     gui_unlock_double_buffer();
  2466.     /* Try to reduce the BLT region in order to save computation power */
  2467.     if (cat161_last_y_offset == -1) /* First time */
  2468.     {
  2469.         gui_BLT_double_buffer(0, 0, UI_device_width - 1, UI_device_height - 1);
  2470.     }
  2471.     else
  2472.     {
  2473.         if (cat161_last_y_offset != y1)
  2474.         {
  2475.             gui_BLT_double_buffer(x1, cat161_last_y_offset, x2, y2_last);
  2476.         }
  2477.         gui_BLT_double_buffer(x1, y1, x2, y2);
  2478.     }
  2479.     cat161_last_y_offset = y1;
  2480. #ifndef WIN32
  2481.     lcd_partial_on(MAIN_LCD, y1, y2);
  2482. #endif 
  2483. }
  2484. /*****************************************************************************
  2485.  * FUNCTION
  2486.  *  ShowCategory161Screen
  2487.  * DESCRIPTION
  2488.  *  Displays the category161 screen
  2489.  * PARAMETERS
  2490.  *  t       [IN]        Time
  2491.  * RETURNS
  2492.  *  void
  2493.  *****************************************************************************/
  2494. void ShowCategory161Screen(UI_time *t)
  2495. {
  2496.     /*----------------------------------------------------------------*/
  2497.     /* Local Variables                                                */
  2498.     /*----------------------------------------------------------------*/
  2499.     color c;
  2500.     cat161_time = *t;
  2501.     cat161_last_y_offset = -1;
  2502.     /*----------------------------------------------------------------*/
  2503.     /* Code Body                                                      */
  2504.     /*----------------------------------------------------------------*/
  2505. #if defined(BLACK_BACKLIGHT)
  2506.     c.r = c.g = c.b = 0;
  2507. #elif defined(BLUE_BACKLIGHT)
  2508.     c.r = c.g = 0;
  2509.     c.b = 255;
  2510. #elif defined(WHITE_BACKLIGHT)
  2511.     c.r = c.g = c.b = 255;
  2512. #else 
  2513.     c.r = c.g = c.b = 255;
  2514. #endif 
  2515.     c.alpha = 100;
  2516.     entry_full_screen();
  2517.     gui_lock_double_buffer();
  2518.     gui_push_clip();
  2519.     gui_set_clip(0, 0, UI_device_width - 1, UI_device_height - 1);
  2520.     /* Delay filling white until RedrawCategory161Screen. We do not redraw the whole screen for each update. */
  2521.     gui_fill_rectangle(0, 0, UI_device_width - 1, UI_device_height - 1, c);
  2522.     gui_pop_clip();
  2523.     gui_unlock_double_buffer();
  2524.     ExitCategoryFunction = ExitCategory161Screen;
  2525.     RedrawCategoryFunction = RedrawCategory161Screen;
  2526.     GetCategoryHistory = dummy_get_history;
  2527.     GetCategoryHistorySize = dummy_get_history_size;
  2528.     RedrawCategory161Screen();
  2529. }
  2530. /*****************************************************************************
  2531.  * FUNCTION
  2532.  *  ExitCategory161Screen
  2533.  * DESCRIPTION
  2534.  *  Exits the category161 screen
  2535.  * PARAMETERS
  2536.  *  void
  2537.  * RETURNS
  2538.  *  void
  2539.  *****************************************************************************/
  2540. void ExitCategory161Screen(void)
  2541. {
  2542.     /*----------------------------------------------------------------*/
  2543.     /* Local Variables                                                */
  2544.     /*----------------------------------------------------------------*/
  2545.     /*----------------------------------------------------------------*/
  2546.     /* Code Body                                                      */
  2547.     /*----------------------------------------------------------------*/
  2548. #ifndef WIN32
  2549.     lcd_partial_off(MAIN_LCD);
  2550. #endif 
  2551.     /* Because partial display is text on white background,
  2552.        it looks weird if new popup comes and we don't clear background here. */
  2553. #if defined(BLACK_BACKLIGHT)
  2554.     gdi_layer_clear(GDI_COLOR_BLACK);
  2555. #elif defined(BLUE_BACKLIGHT)
  2556.     gdi_layer_clear(GDI_COLOR_BLUE);
  2557. #elif defined(WHITE_BACKLIGHT)
  2558.     gdi_layer_clear(GDI_COLOR_WHITE);
  2559. #else
  2560.     gdi_layer_clear(GDI_COLOR_WHITE);
  2561. #endif
  2562.     leave_full_screen();
  2563.     ExitCategoryFunction = MMI_dummy_function;
  2564.     RedrawCategoryFunction = MMI_dummy_function;
  2565.     GetCategoryHistory = dummy_get_history;
  2566.     GetCategoryHistorySize = dummy_get_history_size;
  2567. }
  2568. #endif /* __MMI_LCD_PARTIAL_ON__ */ 
  2569. /* PMT VIKAS START 20050720 */
  2570. #ifdef __MMI_UI_ANIMATED_TITLE_EFFECT__
  2571. /*****************************************************************************
  2572.  * FUNCTION
  2573.  *  show_network_detail_on_animated_highlighter_on_idlescreen
  2574.  * DESCRIPTION
  2575.  *  Handle title text on idlescreen
  2576.  * PARAMETERS
  2577.  *  void
  2578.  * RETURNS
  2579.  *  void
  2580.  *****************************************************************************/
  2581. void show_network_detail_on_animated_highlighter_on_idlescreen(void)
  2582. {
  2583.     /*----------------------------------------------------------------*/
  2584.     /* Local Variables                                                */
  2585.     /*----------------------------------------------------------------*/
  2586.     /*----------------------------------------------------------------*/
  2587.     /* Code Body                                                      */
  2588.     /*----------------------------------------------------------------*/
  2589.     if (idle_screen_type == ANALOG_IDLE_SCREEN || idle_screen_type == DIGITAL_IDLE_SCREEN)
  2590.     {
  2591.         idle_screen_show_network_name();
  2592.     }
  2593.     else
  2594.     {
  2595.         idle_screen_show_network_details();
  2596.     }
  2597. #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
  2598.     enable_statusbar_fill_background();
  2599.     refresh_fixed_status_icon(STATUS_ICON_SIGNAL_STRENGTH, 0);
  2600.     refresh_fixed_status_icon(STATUS_ICON_BATTERY_STRENGTH, 1);
  2601. #endif /* __MMI_UI_DALMATIAN_STATUSBAR__ */ 
  2602. }
  2603. #endif /* __MMI_UI_ANIMATED_TITLE_EFFECT__ */ 
  2604. /* PMT VIKAS END 20050720 */
  2605. void EntryPopupMatrix()
  2606. {
  2607. ChangeLeftSoftkey(STR_GLOBAL_YES, 0);
  2608. ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  2609. EntryNewScreen(6400, NULL, NULL, NULL);
  2610. clear_screen();
  2611. ShowCategoryPopupMatrixScreen();
  2612. //RedrawCategoryFunction = NULL
  2613. }
  2614. void ShowCategoryPopupMatrixScreen()
  2615. {
  2616. dm_data_struct dm_data;
  2617. S32 i;
  2618. gui_lock_double_buffer();
  2619. gdi_draw_round_rect(1,1,40,156,GDI_COLOR_WHITE,GDI_COLOR_BLACK,1);
  2620. create_fixed_icontext_menuitems();
  2621. associate_fixed_icontext_matrix();
  2622. for (i = 0; i < 6; i++)
  2623. {
  2624. add_fixed_icontext_item(get_string(IMG_GLOBAL_OK), get_image(gIndexIconsImageList[i]));
  2625. }
  2626. MMI_current_menu_type = MATRIX_MENU;
  2627. register_fixed_matrix_loop_keys();
  2628. configure_fixed_matrix(34, 34, 1, 6);
  2629. resize_fixed_matrix(34,152);
  2630. move_fixed_matrix(8,8);
  2631. register_fixed_matrix_highlight_handler(standard_matrix_highlight_handler);
  2632.     gui_set_fixed_matrix_menu_theme(&MMI_fixed_matrix_menu, current_UI_theme->fixed_matrix_menu_theme);
  2633.     gui_set_fixed_icontext_menuitem_theme(&MMI_fixed_icontext_menuitem,current_UI_theme->fixed_icontext_menuitem_theme);
  2634. MMI_fixed_matrix_menu.flags |= UI_MATRIX_MENU_DISABLE_PEN | UI_MATRIX_MENU_DISABLE_SCROLLBAR | UI_MATRIX_MENU_DISABLE_BACKGROUND|UI_MATRIX_MENU_LOOP;
  2635. gui_set_fixed_matrix_menu_theme(&MMI_fixed_matrix_menu, current_UI_theme->fixed_matrix_menu_theme);
  2636.     gui_set_fixed_icontext_menuitem_theme(&MMI_fixed_icontext_menuitem, current_UI_theme->fixed_icontext_menuitem_theme);
  2637. MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_DISABLE_TEXT_DISPLAY | UI_MENUITEM_CENTER_ICON_X | UI_MENUITEM_CENTER_ICON_Y;
  2638. gui_unlock_double_buffer();
  2639.     ExitCategoryFunction = ExitCategoryPopupMatrixScreen;
  2640.     dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
  2641.     dm_data.s32flags = 0;
  2642.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  2643.     dm_data.s32CatId = MMI_CATEGORY_POPUP_MATRIX;
  2644.     dm_setup_data(&dm_data);
  2645.     dm_redraw_category_screen();
  2646. }
  2647. void ExitCategoryPopupMatrixScreen()
  2648. {
  2649. MMI_fixed_matrix_menu.flags &= ~UI_MATRIX_MENU_DISABLE_PEN;
  2650. reset_fixed_matrix();
  2651. }
  2652. void EntryPopupList()
  2653. {
  2654. ChangeLeftSoftkey(STR_GLOBAL_YES, 0);
  2655. ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  2656. EntryNewScreen(6700, NULL, NULL, NULL);
  2657. ShowCategoryPopupListScreen();
  2658. show_fixed_list();
  2659. }
  2660. void ShowCategoryPopupListScreen()
  2661. {
  2662. dm_data_struct dm_data;
  2663. U8 i;
  2664. gui_lock_double_buffer();
  2665. create_fixed_icontext_menuitems();
  2666. resize_fixed_list(240, 150);    
  2667.     associate_fixed_icontext_list();
  2668. MMI_disable_title_shortcut_display = 1; 
  2669. for (i = 0; i < 6; i++)
  2670. {
  2671. add_fixed_icontext_item((unsigned short*)get_string(STR_GLOBAL_OK), (unsigned char*)get_image(gIndexIconsImageList[i]));
  2672. }
  2673. MMI_fixed_list_menu.flags |= UI_LIST_MENU_LOOP | UI_LIST_MENU_DISABLE_SCROLLBAR;
  2674. MMI_fixed_list_menu.highlighted_item = 0;
  2675. register_fixed_list_keys();
  2676. resize_fixed_icontext_menuitems(142, 30);
  2677. set_fixed_icontext_positions(36, 0, 1, 0);
  2678. resize_fixed_list(146,150);
  2679. move_fixed_list(1,140);
  2680. fixed_list_goto_item_no_redraw(0);
  2681. gui_unlock_double_buffer();
  2682.     ExitCategoryFunction = ExitCategoryPopupListScreen;
  2683.     dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
  2684.     dm_data.s32flags = 0;
  2685.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  2686.     dm_data.s32CatId = MMI_CATEGORY_POPUP_LIST;
  2687.     dm_setup_data(&dm_data);
  2688.     dm_redraw_category_screen();
  2689. }
  2690. void ExitCategoryPopupListScreen()
  2691. {
  2692. MMI_disable_title_shortcut_display = 0; 
  2693.     disable_menu_shortcut_box_display = 0;
  2694. reset_fixed_list();
  2695. }