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

MTK

开发平台:

C/C++

  1.  * DESCRIPTION
  2.  *  set status icons display state (MAINLCD_ONLY, SUBLCD_ONLY, DEFAULT_BOTH)
  3.  * PARAMETERS
  4.  *  state       [IN]        
  5.  * RETURNS
  6.  *  void
  7.  *****************************************************************************/
  8. void set_status_icon_display(S32 state)
  9. {
  10.     /*----------------------------------------------------------------*/
  11.     /* Local Variables                                                */
  12.     /*----------------------------------------------------------------*/
  13.     /*----------------------------------------------------------------*/
  14.     /* Code Body                                                      */
  15.     /*----------------------------------------------------------------*/
  16.     status_icon_display_area = state;
  17. }
  18. /*****************************************************************************
  19.  * FUNCTION
  20.  *  reset_status_icon_display
  21.  * DESCRIPTION
  22.  *  reset status icons display to DEFAULT_BOTH
  23.  * PARAMETERS
  24.  *  void
  25.  * RETURNS
  26.  *  void
  27.  *****************************************************************************/
  28. void reset_status_icon_display(void)
  29. {
  30.     /*----------------------------------------------------------------*/
  31.     /* Local Variables                                                */
  32.     /*----------------------------------------------------------------*/
  33.     /*----------------------------------------------------------------*/
  34.     /* Code Body                                                      */
  35.     /*----------------------------------------------------------------*/
  36.     status_icon_display_area = DEFAULT_BOTH;
  37. }
  38. /*****************************************************************************
  39.  * FUNCTION
  40.  *  show_status_icons
  41.  * DESCRIPTION
  42.  *  show all three status bar
  43.  * PARAMETERS
  44.  *  void
  45.  * RETURNS
  46.  *  void
  47.  *****************************************************************************/
  48. extern idle_context_struct g_idle_context;
  49. void show_status_icons(void)
  50. {
  51.     /*----------------------------------------------------------------*/
  52.     /* Local Variables                                                */
  53.     /*----------------------------------------------------------------*/
  54.     S32 i, j, id, sbx, sby;
  55.     U8 blink_animate_flag = 0;
  56.     S32 x1, y1, x2, y2;
  57.     S32 ix1, iy1;
  58.     /* backup active lcd */
  59.     bitmap *saved_graphics_context = current_LCD_device_bitmap;
  60.     /* 101804 MTK Calvin added to avoid to update signal level status icon during g_pwr_context.PowerOnTillIdleApp */
  61.     U8 old_signal_state_main = 0;   /* 111605 warning Calvin */
  62. #ifdef __MMI_SUBLCD__
  63.     U8 old_signal_state_sub = 0;
  64. #endif 
  65.     /* PMT VIKAS START 20050707 */
  66. #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
  67.     /* for handling the shuffling of status bar on idle screen. */
  68.     S32 initial, increment;
  69.     /*----------------------------------------------------------------*/
  70.     /* Code Body                                                      */
  71.     /*----------------------------------------------------------------*/
  72.     if (is_status_bar_shuffled == 1)
  73.     {
  74.         initial = MAX_STATUS_ICON_BARS - 1;
  75.         increment = -1;
  76.     }
  77.     else
  78.     {
  79.         initial = 0;
  80.         increment = 1;
  81.     }
  82. #endif /* __MMI_UI_DALMATIAN_STATUSBAR__ */ 
  83.     /* PMT VIKAS END 20050707 */
  84.     if (mmi_bootup_is_in_security_check() == MMI_TRUE)
  85.     {
  86.         old_signal_state_main = MMI_status_icons[STATUS_ICON_SIGNAL_STRENGTH].state;
  87.         MMI_status_icons[STATUS_ICON_SIGNAL_STRENGTH].state = 0;
  88.     #ifdef __MMI_SUBLCD__
  89.         old_signal_state_sub = MMI_status_icons[STATUS_ICON_SUBLCD_SIGNAL_STRENGTH].state;
  90.         MMI_status_icons[STATUS_ICON_SUBLCD_SIGNAL_STRENGTH].state = 0;
  91.     #endif /* __MMI_SUBLCD__ */ 
  92.     }
  93.     /* MTK Calvin end */
  94.     /* 050205 Calvin added */
  95.     if (IsReArrangeNeeded)
  96.     {
  97.         arrange_status_icons();
  98.         IsReArrangeNeeded = 0;
  99.     }
  100.     /* Calvin end */
  101.     /* MTK Leo add, change clip region when drawing layer is set */
  102.     //      gui_push_clip();
  103.     //      gui_reset_clip();
  104.     /* MTK Leo end */
  105.     /* PMT VIKAS START 20050707 */
  106. #if (defined __MMI_MAINLCD_176X220__) && (defined __MMI_UI_DALMATIAN_STATUSBAR__)
  107.     if (background_fill == 1)
  108.     {
  109.         if ((MMI_status_icon_bars[0].flags & STATUS_ICON_BAR_DISPLAY)
  110.             || (MMI_status_icon_bars[1].flags & STATUS_ICON_BAR_DISPLAY))
  111.             if (GetActiveScreenId() != IDLE_SCREEN_ID)
  112.             {
  113.                 show_mainlcd_status_bar_background(0, 0, UI_device_width - 1, MMI_STATUS_BAR_HEIGHT - 1);
  114.             }
  115.     }
  116. #endif /* (defined __MMI_MAINLCD_176X220__) && (defined __MMI_UI_DALMATIAN_STATUSBAR__) */ 
  117. #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
  118.     for (j = initial; j >= 0 && j < MAX_STATUS_ICON_BARS; j += increment)
  119. #else 
  120.     for (j = 0; j < MAX_STATUS_ICON_BARS; j++)
  121. #endif 
  122.         /* PMT VIKAS END 20050707 */
  123.     {
  124.         if (MMI_status_icon_bars[j].flags & STATUS_ICON_BAR_DISPLAY)
  125.         {
  126.             if (MMI_status_icon_bars[j].graphics_context == &main_LCD_device_bitmap)
  127.             {
  128.                 if (status_icon_display_area == SUBLCD_ONLY)
  129.                 {
  130.                     continue;
  131.                 }
  132.                 UI_set_main_LCD_graphics_context(); /* set graphic context to main lcd */
  133.                 //if (!g_idle_context.IsOnIdleScreen)//092206 network search
  134.                 if ((!mmi_idle_is_on_idle_screen()) || (mmi_idle_is_on_idle_screen() && (!mmi_bootup_is_idle_screen_reached())))
  135.                 {
  136.                     /* 061506 double buffer Start */
  137.                     if(get_status_icon_bar_layer((U8)j)!=GDI_ERROR_HANDLE)
  138.                     {
  139.                         gdi_layer_push_and_set_active(get_status_icon_bar_layer((U8)j));
  140.                     }
  141.                     /* 061506 double buffer End */
  142.                     MMI_hide_status_icon_bars[j] ();    /* call hide function of status bar */
  143.                     /* 061506 double buffer Start */
  144.                     if(get_status_icon_bar_layer((U8)j)!=GDI_ERROR_HANDLE)
  145.                     {
  146.                         gdi_layer_pop_and_restore_active();
  147.                     }
  148.                     /* 061506 double buffer End */
  149.                 }
  150.             }
  151.             else if (MMI_status_icon_bars[j].graphics_context == &sub_LCD_device_bitmap)
  152.             {
  153.                 if (status_icon_display_area == MAINLCD_ONLY)
  154.                 {
  155.                     continue;
  156.                 }
  157.                 /* if ( ! g_idle_context.IsOnIdleScreen ) */
  158.                 /* 061506 double buffer Start */
  159.                 if(get_status_icon_bar_layer((U8)j)!=GDI_ERROR_HANDLE)
  160.                 {
  161.                     gdi_layer_push_and_set_active(get_status_icon_bar_layer((U8)j));
  162.                 }
  163.                 /* 061506 double buffer End */
  164.                 MMI_hide_status_icon_bars[j] ();    /* call hide function of sub lcd status bar */
  165.                 /* 061506 double buffer Start */
  166.                 if(get_status_icon_bar_layer((U8)j)!=GDI_ERROR_HANDLE)
  167.                 {
  168.                     gdi_layer_pop_and_restore_active();
  169.                 }
  170.                 /* 061506 double buffer End */
  171.                 UI_set_sub_LCD_graphics_context();  /* set grahic context to sub lcd */
  172.             }
  173.             /* 061506 double buffer Start */
  174.             if(get_status_icon_bar_layer((U8)j)!=GDI_ERROR_HANDLE)
  175.             {
  176.                 gdi_layer_push_and_set_active(get_status_icon_bar_layer((U8)j));
  177.             }
  178.             /* 061506 double buffer End */
  179.             
  180.             /* MTK Leo add, change clip region when drawing layer is set */
  181.             gui_push_clip();
  182.             gui_reset_clip();
  183.             /* MTK Leo end */
  184.             /* store coordinates of status icon bar */
  185.             x1 = MMI_status_icon_bars[j].x1;
  186.             y1 = MMI_status_icon_bars[j].y1;
  187.             x2 = MMI_status_icon_bars[j].x2;
  188.             y2 = MMI_status_icon_bars[j].y2;
  189.             /* set clip region */
  190.             gui_set_clip(x1, y1, x2, y2);
  191.             /* PMT HIMANSHU START 20050625 */
  192.         #if defined(__MMI_UI_TECHNO_STATUS_ICON__)
  193.             if (j == 0)
  194.             {
  195.                 //PMT HIMANSHU START 20050721
  196.                 //PMT VIKAS START 20051202
  197.                 if (is_on_idlescreen() == 1);   /* do nothing */
  198.                 //PMT VIKAS END 20051202
  199.                 //                                      gui_fill_rectangle(x1, y1, x2, y2,
  200.                 //                                                      (current_MMI_theme->formatted_inputbox_normal_filler->border_color));
  201.                 //PMT HIMANSHU END 20050721
  202.                 else if (GetActiveScreenId() == MAIN_MENU_SCREENID)
  203.                 {
  204.                     gui_fill_rectangle(
  205.                         x1,
  206.                         y1,
  207.                         x2,
  208.                         y2,
  209.                         /* PMT VIKAS START 20050718 */ current_UI_theme->window_title_theme->active_filler->c);
  210.                 }
  211.                 /* PMT VIKAS END 20050718 */
  212.                 else
  213.                 {
  214.                     gui_fill_rectangle(x1, y1, x2, y2, *(current_MMI_theme->statusbar0_background_color));
  215.                 }
  216.             }
  217.         #endif /* defined(__MMI_UI_TECHNO_STATUS_ICON__) */ 
  218.             //PMT HIMANSHU END
  219.             //PMT VIKAS START 20050707
  220.         #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
  221.             /* gui_draw_filled_area(x1, y1, x2, y2, MMI_status_icon_bars[j].normal_bar_filler); */
  222.             if (j == 0)
  223.             {
  224.                 UI_filled_area Dalmatiian_LSK_up;
  225.                 Dalmatiian_LSK_up = *current_MMI_theme->LSK_up_filler;
  226.                 Dalmatiian_LSK_up.flags |= UI_FILLED_AREA_RIGHT_ROUNDED_BORDER;
  227.                 gui_draw_filled_area(x1, y1, x2, y2, &Dalmatiian_LSK_up);
  228.             }
  229.             else if (j == 1)
  230.             {
  231.                 UI_filled_area Dalmatiian_RSK_up;
  232.                 Dalmatiian_RSK_up = *current_MMI_theme->RSK_up_filler;
  233.                 Dalmatiian_RSK_up.flags |= UI_FILLED_AREA_LEFT_ROUNDED_BORDER;
  234.                 gui_draw_filled_area(x1, y1, x2, y2, &Dalmatiian_RSK_up);
  235.             }
  236.         #endif /* __MMI_UI_DALMATIAN_STATUSBAR__ */ 
  237.             /* PMT VIKAS END 20050707 */
  238.             /* store icon offset coordinates */
  239.             sbx = MMI_status_icon_bars[j].x;
  240.             sby = MMI_status_icon_bars[j].y;
  241.             if (MMI_status_icon_bars[j].icon_list != NULL)
  242.             {
  243.                 for (i = 0; i < MMI_status_icon_bars[j].n_icons; i++)
  244.                 {
  245.                     id = MMI_status_icon_bars[j].icon_list[i];
  246.                     if (MMI_status_icons[id].icon_ID != IMAGE_ID_NULL)
  247.                     {
  248.                     #ifdef __MMI_DOWNLOADABLE_THEMES_SUPPORT__
  249.                         if (mmi_tm_does_theme_have_alt_image())
  250.                         {
  251.                             if (mmi_tm_is_theme_dirty_bit_set(GetImageIndex(MMI_status_icons[id].icon_ID)))
  252.                             {
  253.                                 MMI_status_icons[id].icon_data = get_image(MMI_status_icons[id].icon_ID);
  254.                                 /* No need to calculate Image width, height and frames as they will not change */
  255.                             }
  256.                         }
  257.                     #endif /* __MMI_DOWNLOADABLE_THEMES_SUPPORT__ */ 
  258.                         if (MMI_status_icons[id].flags & STATUS_ICON_REVERSE_ANIMATE)
  259.                         {
  260.                             /* do nothing */
  261.                         }
  262.                         else if (MMI_status_icons[id].flags & STATUS_ICON_FORWARD_ANIMATE)
  263.                         {
  264.                             /* do nothing */
  265.                         }
  266.                         else if (MMI_status_icons[id].flags & STATUS_ICON_ANIMATE)
  267.                         {
  268.                             blink_animate_flag = 1;
  269.                             /* store position of the icon */
  270.                             ix1 = MMI_status_icons[id].x + sbx;
  271.                             iy1 = MMI_status_icons[id].y + sby;
  272.                             gui_show_transparent_animated_image_frame(
  273.                                 ix1,
  274.                                 iy1,
  275.                                 MMI_status_icons[id].icon_data,
  276.                                 0,
  277.                                 MMI_status_icons[id].current_frame);
  278.                             /* 091505 bettery Calvin removed to status_icon_timer_callback */
  279.                         #if 0
  280. /* under construction !*/
  281. /* under construction !*/
  282. /* under construction !*/
  283. /* under construction !*/
  284. /* under construction !*/
  285.                         #endif /* 0 */ 
  286.                             /* 091505 bettery Calvin end */
  287.                         }
  288.                         else if (MMI_status_icons[id].flags & STATUS_ICON_BLINK)
  289.                         {
  290.                             blink_animate_flag = 1;
  291.                             if (MMI_status_icons_blink_animate_ON_state)
  292.                             {
  293.                                 /* store position of the icon */
  294.                                 ix1 = MMI_status_icons[id].x + sbx;
  295.                                 iy1 = MMI_status_icons[id].y + sby;
  296.                                 gui_show_transparent_image(ix1, iy1, MMI_status_icons[id].icon_data, 0);
  297.                             }
  298.                         }
  299.                         else if (MMI_status_icons[id].flags & STATUS_ICON_DISPLAY)
  300.                         {
  301.                             /* store position of the icon */
  302.                             ix1 = MMI_status_icons[id].x + sbx;
  303.                             iy1 = MMI_status_icons[id].y + sby;
  304.                             if (MMI_status_icons[id].state > 0)
  305.                             {
  306.                                 gui_show_transparent_animated_image_frame(
  307.                                     ix1,
  308.                                     iy1,
  309.                                     MMI_status_icons[id].icon_data,
  310.                                     0,
  311.                                     MMI_status_icons[id].state);
  312.                             }
  313.                             else
  314.                             {
  315.                                 gui_show_transparent_image(ix1, iy1, MMI_status_icons[id].icon_data, 0);
  316.                             }
  317.                         }
  318.                     }
  319.                 }
  320.             }
  321.             /* MTK Leo add, change clip region when drawing layer is set */
  322.             gui_pop_clip();
  323.             /* MTK Leo end */
  324.             
  325.             /* 061506 double buffer Start */
  326.             if(get_status_icon_bar_layer((U8)j)!=GDI_ERROR_HANDLE)
  327.             {
  328.                 gdi_layer_pop_and_restore_active();
  329.             }
  330.             /* 061506 double buffer End */
  331.         }
  332.     }
  333.     /* 101804 MTK Calvin added to avoid to update signal level status icon during g_pwr_context.PowerOnTillIdleApp */
  334.     if (mmi_bootup_is_in_security_check() == MMI_TRUE)
  335.     {
  336.         MMI_status_icons[STATUS_ICON_SIGNAL_STRENGTH].state = old_signal_state_main;
  337.     #ifdef __MMI_SUBLCD__
  338.         MMI_status_icons[STATUS_ICON_SUBLCD_SIGNAL_STRENGTH].state = old_signal_state_sub;
  339.     #endif 
  340.     }
  341.     /* MTK Calvin end */
  342.     status_icon_display_ON = 1;
  343.     /* PMT VIKAS START 20050707 */
  344. #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
  345.     /* PMT VIKAS START 20051202 */
  346.     if (is_on_idlescreen() == 1)
  347.         /* PMT VIKAS END 20051202 */
  348.     {
  349.         if ((MMI_status_icons[STATUS_ICON_SIGNAL_STRENGTH].flags & STATUS_ICON_ANIMATE)
  350.             || (MMI_status_icons[STATUS_ICON_BATTERY_STRENGTH].flags & STATUS_ICON_ANIMATE))
  351.         {
  352.             blink_animate_flag = 1;
  353.         }
  354.     }
  355. #endif /* __MMI_UI_DALMATIAN_STATUSBAR__ */ 
  356.     /* PMT VIKAS END 20050707 */
  357.     if (blink_animate_flag) /* if icon is animated */
  358.     {
  359.         if (status_icon_blink_animate_ON == 0)
  360.         {
  361.             setup_status_icon_blink_animate();
  362.         }
  363.         status_icon_blink_animate_ON = 1;
  364.     }
  365.     else
  366.     {
  367.         if (status_icon_blink_animate_ON == 1)
  368.         {
  369.             setup_status_icon_blink_animate();
  370.         }
  371.         status_icon_blink_animate_ON = 0;
  372.     }
  373.     /* MTK Leo add, change clip region when drawing layer is set */
  374.     /* gui_pop_clip(); */
  375.     /* MTK Leo end */
  376.     /* restore active lcd according to backuped lcd */
  377.     if (saved_graphics_context == &main_LCD_device_bitmap)
  378.     {
  379.         UI_set_main_LCD_graphics_context();
  380.     }
  381.     else if (saved_graphics_context == &sub_LCD_device_bitmap)
  382.     {
  383.         UI_set_sub_LCD_graphics_context();
  384.     }
  385. }
  386. /*****************************************************************************
  387.  * FUNCTION
  388.  *  hide_status_icons
  389.  * DESCRIPTION
  390.  *  set the flag of all icons to hide
  391.  * PARAMETERS
  392.  *  void
  393.  * RETURNS
  394.  *  void
  395.  *****************************************************************************/
  396. void hide_status_icons(void)
  397. {
  398.     /*----------------------------------------------------------------*/
  399.     /* Local Variables                                                */
  400.     /*----------------------------------------------------------------*/
  401.     S32 i;
  402.     U8 flag = 1;
  403.     /*----------------------------------------------------------------*/
  404.     /* Code Body                                                      */
  405.     /*----------------------------------------------------------------*/
  406.     for (i = 0; i < MAX_STATUS_ICON_BARS; i++)
  407.     {
  408.         if (MMI_status_icon_bars[i].flags & STATUS_ICON_BAR_DISPLAY)
  409.         {
  410.             if (MMI_status_icon_bars[i].graphics_context == current_LCD_device_bitmap)
  411.             {
  412.                 /* call hide fuction of status bar */
  413.                 MMI_hide_status_icon_bars[i] ();
  414.                 /* set the flag of bar to disable */
  415.                 MMI_status_icon_bars[i].flags &= ~STATUS_ICON_BAR_DISPLAY;
  416.             }
  417.             else if (MMI_status_icon_bars[i].flags & STATUS_ICON_BAR_DISPLAY)
  418.             {
  419.                 flag = 0;
  420.             }
  421.         }
  422.     }
  423.     if (flag)
  424.     {
  425.         status_icon_display_ON = 0;
  426.         if (status_icon_blink_animate_ON)
  427.         {
  428.             status_icon_blink_animate_ON = 0;
  429.             gui_cancel_timer(status_icon_timer_callback);
  430.         }
  431.     }
  432. }
  433. /*****************************************************************************
  434.  * FUNCTION
  435.  *  close_status_icons
  436.  * DESCRIPTION
  437.  *  set statu sicon bar flag to not to display,clear status bar hide function s
  438.  * PARAMETERS
  439.  *  void
  440.  * RETURNS
  441.  *  void
  442.  *****************************************************************************/
  443. void close_status_icons(void)
  444. {
  445.     /*----------------------------------------------------------------*/
  446.     /* Local Variables                                                */
  447.     /*----------------------------------------------------------------*/
  448.     S32 i;
  449.     U8 flag = 1;
  450.     /*----------------------------------------------------------------*/
  451.     /* Code Body                                                      */
  452.     /*----------------------------------------------------------------*/
  453. #if defined(__MMI_MAINLCD_176X220__) || defined (__MMI_MAINLCD_240X320__)       /* 041205 Calvin modieid */
  454.     /* if ( if_full_screen_hide_status_icons()== MMI_FALSE ) */
  455. //KP Jerry add for KP-Style 12-Matrix mainmenu on 2007-3-19 start
  456. #ifdef  __MMI_KP_STYLE_MAIN_MENU_MATRIX__
  457.     if(GetActiveScreenId() != MAIN_MENU_SCREENID)
  458. #endif
  459. //KP Jerry add for KP-Style 12-Matrix mainmenu on 2007-3-19 end
  460.     return;
  461. #endif /* defined(__MMI_MAINLCD_176X220__) || defined (__MMI_MAINLCD_240X320__) */ 
  462.     for (i = 0; i < MAX_STATUS_ICON_BARS; i++)
  463.     {
  464.         if (MMI_status_icon_bars[i].graphics_context == current_LCD_device_bitmap)
  465.         {
  466.             MMI_status_icon_bars[i].flags &= ~STATUS_ICON_BAR_DISPLAY;
  467.         }
  468.         else if (MMI_status_icon_bars[i].flags & STATUS_ICON_BAR_DISPLAY)
  469.         {
  470.             flag = 0;
  471.         }
  472.     }
  473.     if (flag)
  474.     {
  475.         status_icon_display_ON = 0;
  476.         if (status_icon_blink_animate_ON)
  477.         {
  478.             status_icon_blink_animate_ON = 0;
  479.             gui_cancel_timer(status_icon_timer_callback);
  480.         }
  481.     }
  482.     clear_hide_status_icon_bars();  /* clear function handlers of hide function */
  483.     gui_hide_animations();          /* stop animation of icons */
  484.     //status_icon_display_locked=0;// set the valeu of lock variable of staus icon to zero //030705 Calvin removed
  485.     //PMT VIKAS START 20050707
  486. #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
  487.     gui_cancel_timer(shuffle_status_bars);
  488. #endif 
  489.     /* PMT VIKAS END 20050707 */
  490. }
  491. /*****************************************************************************
  492.  * FUNCTION
  493.  *  status_icon_timer_callback
  494.  * DESCRIPTION
  495.  *  timer call back of animated icon
  496.  * PARAMETERS
  497.  *  void
  498.  * RETURNS
  499.  *  void
  500.  *****************************************************************************/
  501. void status_icon_timer_callback(void)
  502. {
  503.     /*----------------------------------------------------------------*/
  504.     /* Local Variables                                                */
  505.     /*----------------------------------------------------------------*/
  506.     S32 i;
  507.     /*----------------------------------------------------------------*/
  508.     /* Code Body                                                      */
  509.     /*----------------------------------------------------------------*/
  510.     /* 091505 bettery Calvin moved here from show and refresh functions */
  511.     for (i = 0; i < MAX_STATUS_ICONS; i++)
  512.     {
  513.         if (MMI_status_icons[i].flags & STATUS_ICON_ANIMATE)
  514.         {
  515.             MMI_status_icons[i].current_frame++;
  516.             if (MMI_status_icons[i].current_frame >= MMI_status_icons[i].n_frames)
  517.             {
  518.                 MMI_status_icons[i].current_frame = 0;
  519.             }
  520.         }
  521.     }
  522.     /* 091505 bettery Calvin end */
  523.     /* PMT HIMANSHU START 20050625 */
  524. #if defined(__MMI_UI_TECHNO_STATUS_ICON__)
  525.     if ((MMI_status_icons[STATUS_ICON_SIGNAL_STRENGTH].flags & STATUS_ICON_ANIMATE)
  526.         || (MMI_status_icons[STATUS_ICON_BATTERY_STRENGTH].flags & STATUS_ICON_ANIMATE))
  527.     {
  528.         status_icon_blink_animate_ON = 1;
  529.         /* PMT VIKAS START 20051202 */
  530.         if (is_on_idlescreen() == 1 || GetActiveScreenId() == MAIN_MENU_SCREENID)
  531.             /* PMT VIKAS END 20051202 */
  532.         {
  533.             refresh_fixed_status_icon(STATUS_ICON_BATTERY_STRENGTH, 0);
  534.         }
  535.     }
  536. #endif /* defined(__MMI_UI_TECHNO_STATUS_ICON__) */ 
  537.     /* PMT HIMANSHU END */
  538.     /* cancel the timaer call back of animated icon */
  539.     if (!status_icon_blink_animate_ON)
  540.     {
  541.         gui_cancel_timer(status_icon_timer_callback);
  542.     }
  543.     if (!status_icon_display_ON)
  544.     {
  545.         return;
  546.     }
  547.     if (MMI_status_icons_blink_animate_ON_state)
  548.     {
  549.         MMI_status_icons_blink_animate_ON_state = 0;
  550.     }
  551.     else
  552.     {
  553.         MMI_status_icons_blink_animate_ON_state = 1;
  554.     }
  555.     /* PMT VIKAS START 20050707 */
  556. #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
  557.     disable_statusbar_fill_background();
  558. #endif 
  559.     /* PMT VIKAS END 20050707 */
  560.     /* redraw the status icons */
  561.     refresh_status_icon_display();
  562.     /* PMT VIKAS START 20050707 */
  563. #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
  564.     /* PMT VIKAS START 20051202 */
  565.     if (is_on_idlescreen() == 1)
  566.         /* PMT VIKAS END 20051202 */
  567.     {
  568.         enable_statusbar_fill_background();
  569.         if (MMI_status_icons[STATUS_ICON_BATTERY_STRENGTH].flags & STATUS_ICON_ANIMATE)
  570.         {
  571.             refresh_fixed_status_icon(STATUS_ICON_BATTERY_STRENGTH, 1);
  572.         }
  573.     }
  574. #endif /* __MMI_UI_DALMATIAN_STATUSBAR__ */ 
  575.     /* PMT VIKAS END 20050707 */
  576.     if (status_icon_blink_animate_ON)
  577.     {
  578.         gui_start_timer(STATUS_ICON_TIMER_RATE, status_icon_timer_callback);
  579.     }
  580. }
  581. /*****************************************************************************
  582.  * FUNCTION
  583.  *  setup_status_icon_blink_animate
  584.  * DESCRIPTION
  585.  *  timer call back of blinking icon
  586.  * PARAMETERS
  587.  *  void
  588.  * RETURNS
  589.  *  void
  590.  *****************************************************************************/
  591. void setup_status_icon_blink_animate(void)
  592. {
  593.     /*----------------------------------------------------------------*/
  594.     /* Local Variables                                                */
  595.     /*----------------------------------------------------------------*/
  596.     S32 i;
  597.     U8 blink_animate_flag = 0;
  598.     /*----------------------------------------------------------------*/
  599.     /* Code Body                                                      */
  600.     /*----------------------------------------------------------------*/
  601.     /* PMT HIMANSHU START 20050625 */
  602. #if(!defined(__MMI_UI_TECHNO_STATUS_ICON__))
  603.     if (!status_icon_display_ON)
  604.     {
  605.         return;
  606.     }
  607. #endif /* (!defined(__MMI_UI_TECHNO_STATUS_ICON__)) */ 
  608.     /* PMT HIMANSHU END */
  609.     for (i = 0; i < MAX_STATUS_ICONS; i++)
  610.     {
  611.         if ((MMI_status_icons[i].flags & STATUS_ICON_BLINK) || (MMI_status_icons[i].flags & STATUS_ICON_ANIMATE))
  612.         {
  613.             blink_animate_flag = 1;
  614.             break;
  615.         }
  616.     }
  617.     if (blink_animate_flag)
  618.         /* start timer for blinking icon */
  619.     {
  620.         gui_start_timer(STATUS_ICON_TIMER_RATE, status_icon_timer_callback);
  621.     }
  622.     else
  623.         /* stop timer for blinking icon */
  624.     {
  625.         gui_cancel_timer(status_icon_timer_callback);
  626.     }
  627. }
  628. /*****************************************************************************
  629.  * FUNCTION
  630.  *  show_status_icon_bar
  631.  * DESCRIPTION
  632.  *  set the display flag of status bar
  633.  * PARAMETERS
  634.  *  status_bar_ID       [IN]        0 -horizontal bar main lcd
  635.  *  horizontal(?)       [IN]        Bar sub lcd
  636.  *  vertical(?)         [IN]        Bar main lcd
  637.  * RETURNS
  638.  *  void
  639.  *****************************************************************************/
  640. void show_status_icon_bar(U8 status_bar_ID)
  641. {
  642. #ifdef __MMI_SUBLCD_SHOW_ANALOG_CLOCK__
  643.     /*----------------------------------------------------------------*/
  644.     /* Local Variables                                                */
  645.     /*----------------------------------------------------------------*/
  646.     /*----------------------------------------------------------------*/
  647.     /* Code Body                                                      */
  648.     /*----------------------------------------------------------------*/
  649.     if (status_bar_ID == 2)
  650.     {
  651.         return;
  652.     }
  653. #endif /* __MMI_SUBLCD_SHOW_ANALOG_CLOCK__ */ 
  654.     /* set teh flag of bar id to display */
  655.     MMI_status_icon_bars[status_bar_ID].flags |= STATUS_ICON_BAR_DISPLAY;
  656. }
  657. /*****************************************************************************
  658.  * FUNCTION
  659.  *  hide_status_icon_bar
  660.  * DESCRIPTION
  661.  *  hide the status bar
  662.  * PARAMETERS
  663.  *  status_bar_ID       [IN]        0 -horizontal bar main lcd
  664.  *  horizontal(?)       [IN]        Bar sub lcd
  665.  *  vertical(?)         [IN]        Bar main lcd
  666.  * RETURNS
  667.  *  void
  668.  *****************************************************************************/
  669. void hide_status_icon_bar(U8 status_bar_ID)
  670. {
  671.     /*----------------------------------------------------------------*/
  672.     /* Local Variables                                                */
  673.     /*----------------------------------------------------------------*/
  674.     /*----------------------------------------------------------------*/
  675.     /* Code Body                                                      */
  676.     /*----------------------------------------------------------------*/
  677.     MMI_status_icon_bars[status_bar_ID].flags &= ~STATUS_ICON_BAR_DISPLAY;
  678. }
  679. /*****************************************************************************
  680.  * FUNCTION
  681.  *  set_status_icon_bar_type
  682.  * DESCRIPTION
  683.  *  hide the status bar
  684.  * PARAMETERS
  685.  *  status_bar_ID       [IN]        0 -horizontal bar main lcd
  686.  *  flags               [IN]        
  687.  *  horizontal(?)       [IN]        Bar sub lcd
  688.  *  vertical(?)         [IN]        Bar main lcd
  689.  * RETURNS
  690.  *  void
  691.  *****************************************************************************/
  692. void set_status_icon_bar_type(U8 status_bar_ID, U32 flags)
  693. {
  694. #ifdef __MMI_SUBLCD_SHOW_ANALOG_CLOCK__
  695.     /*----------------------------------------------------------------*/
  696.     /* Local Variables                                                */
  697.     /*----------------------------------------------------------------*/
  698.     /*----------------------------------------------------------------*/
  699.     /* Code Body                                                      */
  700.     /*----------------------------------------------------------------*/
  701.     if (status_bar_ID == 2)
  702.     {
  703.         return;
  704.     }
  705. #endif /* __MMI_SUBLCD_SHOW_ANALOG_CLOCK__ */ 
  706.     MMI_status_icon_bars[status_bar_ID].flags = flags;
  707. }
  708. /* 061306 dummy category Start */
  709. /*****************************************************************************
  710.  * FUNCTION
  711.  *  get_status_icon_bar_type
  712.  * DESCRIPTION
  713.  *  hide the status bar
  714.  * PARAMETERS
  715.  *  status_bar_ID       [IN]        0 -horizontal bar main lcd
  716.  * RETURNS
  717.  *  
  718.  *****************************************************************************/
  719. U32 get_status_icon_bar_type(U8 status_bar_ID)
  720. {
  721.     /*----------------------------------------------------------------*/
  722.     /* Local Variables                                                */
  723.     /*----------------------------------------------------------------*/
  724.     /*----------------------------------------------------------------*/
  725.     /* Code Body                                                      */
  726.     /*----------------------------------------------------------------*/
  727.     return MMI_status_icon_bars[status_bar_ID].flags;
  728. }
  729. /* 061306 dummy category End */
  730. /*****************************************************************************
  731.  * FUNCTION
  732.  *  get_status_icon_bar_clip
  733.  * DESCRIPTION
  734.  *  get teh clipping valeu sof particaular status bar
  735.  * PARAMETERS
  736.  *  status_bar_ID       [IN]        0 -horizontal bar main lcd
  737.  *  x1                  [IN]        Start x position
  738.  *  y1                  [IN]        Start y position
  739.  *  x2                  [IN]        End x position
  740.  *  y2                  [IN]        End y position
  741.  *  horizontal(?)       [IN]        Bar sub lcd
  742.  *  vertical(?)         [IN]        Bar main lcd
  743.  * RETURNS
  744.  *  void
  745.  *****************************************************************************/
  746. void get_status_icon_bar_clip(U8 status_bar_ID, S32 *x1, S32 *y1, S32 *x2, S32 *y2)
  747. {
  748.     /*----------------------------------------------------------------*/
  749.     /* Local Variables                                                */
  750.     /*----------------------------------------------------------------*/
  751.     /*----------------------------------------------------------------*/
  752.     /* Code Body                                                      */
  753.     /*----------------------------------------------------------------*/
  754.     *x1 = MMI_status_icon_bars[status_bar_ID].x1;
  755.     *y1 = MMI_status_icon_bars[status_bar_ID].y1;
  756.     *x2 = MMI_status_icon_bars[status_bar_ID].x2;
  757.     *y2 = MMI_status_icon_bars[status_bar_ID].y2;
  758. }
  759. /*****************************************************************************
  760.  * FUNCTION
  761.  *  set_status_icon_bar_clip
  762.  * DESCRIPTION
  763.  *  set teh clipping valeu sof particaular status bar
  764.  * PARAMETERS
  765.  *  status_bar_ID       [IN]        0 -horizontal bar main lcd
  766.  *  x1                  [IN]        Start x position
  767.  *  y1                  [IN]        Start y position
  768.  *  x2                  [IN]        End x position
  769.  *  y2                  [IN]        End y position
  770.  *  horizontal(?)       [IN]        Bar sub lcd
  771.  *  vertical(?)         [IN]        Bar main lcd
  772.  * RETURNS
  773.  *  void
  774.  *****************************************************************************/
  775. void set_status_icon_bar_clip(U8 status_bar_ID, S32 x1, S32 y1, S32 x2, S32 y2)
  776. {
  777.     /*----------------------------------------------------------------*/
  778.     /* Local Variables                                                */
  779.     /*----------------------------------------------------------------*/
  780.     /*----------------------------------------------------------------*/
  781.     /* Code Body                                                      */
  782.     /*----------------------------------------------------------------*/
  783.     MMI_status_icon_bars[status_bar_ID].x1 = x1;
  784.     MMI_status_icon_bars[status_bar_ID].y1 = y1;
  785.     MMI_status_icon_bars[status_bar_ID].x2 = x2;
  786.     MMI_status_icon_bars[status_bar_ID].y2 = y2;
  787.     /* PMT VIKAS START 20050707 */
  788. #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
  789.     MMI_status_icon_bars[status_bar_ID].x = x1;
  790.     MMI_status_icon_bars[status_bar_ID].y = y1;
  791. #endif /* __MMI_UI_DALMATIAN_STATUSBAR__ */ 
  792.     /* PMT VIKAS END 20050707 */
  793. }
  794. /* 061506 double buffer Start */
  795. /*****************************************************************************
  796.  * FUNCTION
  797.  *  set_status_icon_bar_layer
  798.  * DESCRIPTION
  799.  *  set gdi layer handle
  800.  * PARAMETERS
  801.  *  status_bar_ID       [IN]        0 -horizontal bar main lcd
  802.  *  gdi_layer               [IN]        
  803.  *  horizontal(?)       [IN]        Bar sub lcd
  804.  *  vertical(?)         [IN]        Bar main lcd
  805.  * RETURNS
  806.  *  void
  807.  *****************************************************************************/
  808. void set_status_icon_bar_layer(U8 status_bar_ID, GDI_HANDLE gdi_layer)
  809. {
  810. #ifdef __MMI_SUBLCD_SHOW_ANALOG_CLOCK__
  811.     /*----------------------------------------------------------------*/
  812.     /* Local Variables                                                */
  813.     /*----------------------------------------------------------------*/
  814.     /*----------------------------------------------------------------*/
  815.     /* Code Body                                                      */
  816.     /*----------------------------------------------------------------*/
  817.     if (status_bar_ID == 2)
  818.     {
  819.         return;
  820.     }
  821. #endif /* __MMI_SUBLCD_SHOW_ANALOG_CLOCK__ */ 
  822.     MMI_status_icon_bars[status_bar_ID].layer_handle= gdi_layer;
  823. }
  824. /*****************************************************************************
  825.  * FUNCTION
  826.  *  get_status_icon_bar_layer
  827.  * DESCRIPTION
  828.  *  get gdi layer handle
  829.  * PARAMETERS
  830.  *  status_bar_ID       [IN]        0 -horizontal bar main lcd
  831.  * RETURNS
  832.  *  
  833.  *****************************************************************************/
  834. U32 get_status_icon_bar_layer(U8 status_bar_ID)
  835. {
  836.     /*----------------------------------------------------------------*/
  837.     /* Local Variables                                                */
  838.     /*----------------------------------------------------------------*/
  839.     /*----------------------------------------------------------------*/
  840.     /* Code Body                                                      */
  841.     /*----------------------------------------------------------------*/
  842.     return MMI_status_icon_bars[status_bar_ID].layer_handle;
  843. }
  844. /* 061506 double buffer End */
  845. /*****************************************************************************
  846.  * FUNCTION
  847.  *  reset_status_icons
  848.  * DESCRIPTION
  849.  *  Function to be used by wgui_categories.
  850.  *  This must be called in the exit function of the category
  851.  *  screens that have displayed status icons and / or registered
  852.  *  functions for hiding them.
  853.  * PARAMETERS
  854.  *  void
  855.  * RETURNS
  856.  *  void
  857.  *****************************************************************************/
  858. void reset_status_icons(void)
  859. {
  860.     /*----------------------------------------------------------------*/
  861.     /* Local Variables                                                */
  862.     /*----------------------------------------------------------------*/
  863.     /*----------------------------------------------------------------*/
  864.     /* Code Body                                                      */
  865.     /*----------------------------------------------------------------*/
  866.     hide_status_icons();
  867.     clear_hide_status_icon_bars();
  868. }
  869. /*****************************************************************************
  870.  * FUNCTION
  871.  *  initialize_status_icons
  872.  * DESCRIPTION
  873.  *  Called once during bootup to initialize Status icons
  874.  * PARAMETERS
  875.  *  void
  876.  * RETURNS
  877.  *  void
  878.  *****************************************************************************/
  879. //Moved up
  880. //extern S32 MAIN_LCD_device_width;
  881. //extern S32 MAIN_LCD_device_height;
  882. #ifdef __MMI_SUBLCD__
  883. extern S32 SUB_LCD_device_width;
  884. extern S32 SUB_LCD_device_height;
  885. #endif /* __MMI_SUBLCD__ */ 
  886. void initialize_status_icons(void)
  887. {
  888.     /*----------------------------------------------------------------*/
  889.     /* Local Variables                                                */
  890.     /*----------------------------------------------------------------*/
  891.     S32 i;
  892.     /*----------------------------------------------------------------*/
  893.     /* Code Body                                                      */
  894.     /*----------------------------------------------------------------*/
  895.     /* PMT HIMANSHU START 20050625 */
  896. #if defined(__MMI_UI_TECHNO_STATUS_ICON__)
  897.     MMI_status_icon_bars[0].x = 0;
  898.     MMI_status_icon_bars[0].y = 0;
  899.     MMI_status_icon_bars[0].x1 = 0;
  900.     MMI_status_icon_bars[0].y1 = 0;
  901.     MMI_status_icon_bars[0].x2 = MAIN_LCD_device_width - 1;
  902.     MMI_status_icon_bars[0].y2 = MMI_status_bar_height - 1;
  903.     /* set the cliping values of vertical status bar of main lcd */
  904.     MMI_status_icon_bars[1].x = 0;
  905.     MMI_status_icon_bars[1].y = 0;
  906.     MMI_status_icon_bars[1].x1 = 0;
  907.     MMI_status_icon_bars[1].y1 = 0;
  908.     MMI_status_icon_bars[1].x2 = 0;
  909.     MMI_status_icon_bars[1].y2 = 0;
  910.     /* PMT VIKAS START 20050707 */
  911. #elif defined( __MMI_UI_DALMATIAN_STATUSBAR__)
  912.     MMI_status_icon_bars[0].x = 0;
  913.     MMI_status_icon_bars[0].y = MMI_TITLE_HEIGHT + STATUS_TITLE_GAP;
  914.     MMI_status_icon_bars[0].x1 = 0;
  915.     MMI_status_icon_bars[0].y1 = MMI_TITLE_HEIGHT + STATUS_TITLE_GAP;
  916.     MMI_status_icon_bars[0].x2 = MMI_STATUS_BAR_WIDTH - 1;
  917.     MMI_status_icon_bars[0].y2 = MMI_status_icon_bars[0].y1 + MMI_SINGLE_STATUS_BAR_HEIGHT - 1;
  918.     MMI_status_icon_bars[1].x = MAIN_LCD_device_width - MMI_STATUS_BAR_WIDTH;
  919.     MMI_status_icon_bars[1].y = MMI_TITLE_HEIGHT + MMI_STATUS_BAR_HEIGHT
  920.         - MMI_SINGLE_STATUS_BAR_HEIGHT + STATUS_TITLE_GAP;
  921.     MMI_status_icon_bars[1].x1 = MAIN_LCD_device_width - MMI_STATUS_BAR_WIDTH;
  922.     MMI_status_icon_bars[1].y1 = MMI_TITLE_HEIGHT + MMI_STATUS_BAR_HEIGHT
  923.         - MMI_SINGLE_STATUS_BAR_HEIGHT + STATUS_TITLE_GAP;
  924.     MMI_status_icon_bars[1].x2 = MAIN_LCD_device_width - 1;
  925.     MMI_status_icon_bars[1].y2 = MMI_status_icon_bars[1].y1 + MMI_STATUS_BAR_HEIGHT - 1;
  926.     /* PMT VIKAS END 20050707 */
  927. #else /* set the cliping values of horizontal status bar of main lcd */
  928.     MMI_status_icon_bars[0].x = 0;
  929.     MMI_status_icon_bars[0].y = 0;
  930.     MMI_status_icon_bars[0].x1 = 0;
  931.     MMI_status_icon_bars[0].y1 = 0;
  932.     MMI_status_icon_bars[0].x2 = MAIN_LCD_device_width - 1;
  933.     MMI_status_icon_bars[0].y2 = MMI_status_bar_height - 1;
  934.     /* set the cliping values of vertical status bar of main lcd */
  935.     MMI_status_icon_bars[1].x = MAIN_LCD_device_width - 17;
  936.     MMI_status_icon_bars[1].y = MMI_status_bar_height;
  937.     MMI_status_icon_bars[1].x1 = MAIN_LCD_device_width - 17;
  938.     MMI_status_icon_bars[1].y1 = MMI_status_bar_height;
  939.     MMI_status_icon_bars[1].x2 = MAIN_LCD_device_width - 1;
  940.     /* 070905 Calvin Start */
  941. #ifdef __MMI_KLG__
  942.     MMI_status_icon_bars[1].y2 = MAIN_LCD_device_height >> 1;
  943. #else 
  944.     MMI_status_icon_bars[1].y2 = MAIN_LCD_device_height - MMI_button_bar_height - 1;
  945. #endif 
  946.     /* 070905 Calvin End */
  947. #endif 
  948.     /* PMT HIMANSHU END */
  949.     /* set the hide functions of statuas bar to dummy function  */
  950.     for (i = 0; i < MAX_STATUS_ICON_BARS; i++)
  951.     {
  952.         MMI_hide_status_icon_bars[i] = UI_dummy_function;
  953.         /* PMT VIKAS START 20050707 */
  954.     #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
  955.         /* MMI_status_icon_bars[i].normal_bar_filler = NULL; */
  956.     #endif 
  957.         /* PMT VIKAS END 20050707 */
  958.     }
  959.     for (i = 0; i < MAX_STATUS_ICONS; i++)
  960.     {
  961.         MMI_status_icons[i].icon_data = get_image(MMI_status_icons[i].icon_ID);
  962.         MMI_status_icons[i].n_frames = (S16) gui_image_n_frames(MMI_status_icons[i].icon_data);
  963.         gui_measure_image(MMI_status_icons[i].icon_data, &MMI_status_icons[i].width, &MMI_status_icons[i].height);
  964.     }
  965.     /* PMT VIKAS START 20050707 */
  966. #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
  967.     MMI_status_icons[STATUS_ICON_BATTERY_STRENGTH].x = (MAIN_LCD_device_width - 1)
  968.         - MMI_status_icons[STATUS_ICON_BATTERY_STRENGTH].width - MMI_status_icon_bars[1].x;
  969. #else /* __MMI_UI_DALMATIAN_STATUSBAR__ */ 
  970.     /* set the start x position of battery icon of horizontal man lcd status bar */
  971.     MMI_status_icons[STATUS_ICON_BATTERY_STRENGTH].x =
  972.         MAIN_LCD_device_width - 1 - MMI_status_icons[STATUS_ICON_BATTERY_STRENGTH].width;
  973. #endif /* __MMI_UI_DALMATIAN_STATUSBAR__ */ 
  974.     /* PMT VIKAS END 20050707 */
  975. #ifdef __MMI_SUBLCD__
  976.     /* set the cliping values of horizontal status bar of sub lcd */
  977.     MMI_status_icon_bars[2].x = 0;
  978.     MMI_status_icon_bars[2].y = 0;
  979.     MMI_status_icon_bars[2].x1 = 0;
  980.     MMI_status_icon_bars[2].y1 = 0;
  981.     MMI_status_icon_bars[2].x2 = SUB_LCD_device_width - 1;
  982.     MMI_status_icon_bars[2].y2 = 14;
  983.     MMI_status_icons[STATUS_ICON_SUBLCD_SIGNAL_STRENGTH].x = 1;
  984.     MMI_status_icons[STATUS_ICON_SUBLCD_BATTERY_STRENGTH].x =
  985.         SUB_LCD_device_width - 1 - MMI_status_icons[STATUS_ICON_SUBLCD_BATTERY_STRENGTH].width;
  986. #endif /* __MMI_SUBLCD__ */ 
  987. }
  988. /* 030705 Calvin removed */
  989. #if 0
  990. /* under construction !*/
  991. /* under construction !*/
  992. /* under construction !*/
  993. /* under construction !*/
  994. /* under construction !*/
  995. /* under construction !*/
  996. /* under construction !*/
  997. /* under construction !*/
  998. /* under construction !*/
  999. /* under construction !*/
  1000. /* under construction !*/
  1001. /* under construction !*/
  1002. /* under construction !*/
  1003. /* under construction !*/
  1004. /* under construction !*/
  1005. /* under construction !*/
  1006. /* under construction !*/
  1007. /* under construction !*/
  1008. /* under construction !*/
  1009. /* under construction !*/
  1010. /* under construction !*/
  1011. /* under construction !*/
  1012. #endif /* 0 */ 
  1013. /* Calvin end */
  1014. /*****************************************************************************
  1015.  * FUNCTION
  1016.  *  ShowStatusIcon
  1017.  * DESCRIPTION
  1018.  *  show particular icon
  1019.  * PARAMETERS
  1020.  *  icon_ID     [IN]        
  1021.  * RETURNS
  1022.  *  void
  1023.  *****************************************************************************/
  1024. void ShowStatusIcon(S16 icon_ID)
  1025. {
  1026.     /*----------------------------------------------------------------*/
  1027.     /* Local Variables                                                */
  1028.     /*----------------------------------------------------------------*/
  1029.     /*----------------------------------------------------------------*/
  1030.     /* Code Body                                                      */
  1031.     /*----------------------------------------------------------------*/
  1032.     if ((icon_ID < 0) || (icon_ID >= MAX_STATUS_ICONS))
  1033.     {
  1034.         return;
  1035.     }
  1036.     /* 2005/10/20 Hide status icon in flight mode */
  1037. #ifdef __FLIGHT_MODE_SUPPORT__
  1038. #ifdef __MMI_WLAN_FEATURES__
  1039.     if (mmi_bootup_get_active_flight_mode() == 1 || mmi_netset_get_active_preferred_mode() == 1 || mmi_bootup_is_sim_valid() == MMI_FALSE)
  1040. #else
  1041.     if (mmi_bootup_get_active_flight_mode() == 1 || mmi_bootup_is_sim_valid() == MMI_FALSE)
  1042. #endif
  1043.     {
  1044.         pBOOL rtn = PhnsetFlightModeHideButSaveStatusIcon(icon_ID, MMI_status_icons[icon_ID].flags | STATUS_ICON_DISPLAY);
  1045.         if (rtn == MMI_TRUE && (gPowerOnWithFlightMode == MMI_TRUE || mmi_bootup_is_sim_valid() == MMI_FALSE))
  1046.         {
  1047.             return;
  1048.         }
  1049.     }
  1050. #else /* __FLIGHT_MODE_SUPPORT__ */ 
  1051.     if (mmi_bootup_is_sim_valid() == MMI_FALSE)
  1052.     {
  1053.         if (PhnsetFlightModeHideButSaveStatusIcon(icon_ID, MMI_status_icons[icon_ID].flags | STATUS_ICON_DISPLAY) ==
  1054.             MMI_TRUE)
  1055.         {
  1056.             return;
  1057.         }
  1058.     }
  1059. #endif /* __FLIGHT_MODE_SUPPORT__ */ 
  1060.     /* set the flag of icon to display on */
  1061.     MMI_status_icons[icon_ID].flags |= STATUS_ICON_DISPLAY;
  1062.     /* set rearrange flag on */
  1063.     IsReArrangeNeeded = 1;
  1064. }
  1065. /*****************************************************************************
  1066.  * FUNCTION
  1067.  *  HideStatusIcon
  1068.  * DESCRIPTION
  1069.  *  hide particular icon
  1070.  * PARAMETERS
  1071.  *  icon_ID     [IN]        
  1072.  * RETURNS
  1073.  *  void
  1074.  *****************************************************************************/
  1075. void HideStatusIcon(S16 icon_ID)
  1076. {
  1077.     /*----------------------------------------------------------------*/
  1078.     /* Local Variables                                                */
  1079.     /*----------------------------------------------------------------*/
  1080.     /*----------------------------------------------------------------*/
  1081.     /* Code Body                                                      */
  1082.     /*----------------------------------------------------------------*/
  1083.     if ((icon_ID < 0) || (icon_ID >= MAX_STATUS_ICONS))
  1084.     {
  1085.         return;
  1086.     }
  1087.     /* set teh flag of icon to hide ...defualt value */
  1088.     MMI_status_icons[icon_ID].flags = 0;
  1089.     /* set rearrange flag on */
  1090.     IsReArrangeNeeded = 1;
  1091.     /* 2005/10/20 Hide status icon in flight mode */
  1092. #ifdef __FLIGHT_MODE_SUPPORT__
  1093. #ifdef __MMI_WLAN_FEATURES__
  1094.     if (mmi_bootup_get_active_flight_mode() == 1 || mmi_netset_get_active_preferred_mode() == 1)
  1095. #else
  1096.     if (mmi_bootup_get_active_flight_mode() == 1)
  1097. #endif
  1098.     {
  1099.         PhnsetFlightModeHideButSaveStatusIcon(icon_ID, 0);
  1100.     }
  1101. #endif /* __FLIGHT_MODE_SUPPORT__ */ 
  1102. }
  1103. /*****************************************************************************
  1104.  * FUNCTION
  1105.  *  UpdateStatusIcons
  1106.  * DESCRIPTION
  1107.  *  rearrange and refresh status icons
  1108.  * PARAMETERS
  1109.  *  void
  1110.  * RETURNS
  1111.  *  void
  1112.  *****************************************************************************/
  1113. void UpdateStatusIcons(void)
  1114. {
  1115.     /*----------------------------------------------------------------*/
  1116.     /* Local Variables                                                */
  1117.     /*----------------------------------------------------------------*/
  1118.     /*----------------------------------------------------------------*/
  1119.     /* Code Body                                                      */
  1120.     /*----------------------------------------------------------------*/
  1121.     if (IsReArrangeNeeded)
  1122.     {
  1123.         arrange_status_icons();
  1124.         IsReArrangeNeeded = 0;
  1125.     }
  1126.     refresh_status_icon_display();
  1127. }
  1128. /*****************************************************************************
  1129.  * FUNCTION
  1130.  *  UpdateSubLCDStatusIcons
  1131.  * DESCRIPTION
  1132.  *  rearrange and refresh SubLCD status icons
  1133.  * PARAMETERS
  1134.  *  void
  1135.  * RETURNS
  1136.  *  void
  1137.  *****************************************************************************/
  1138. void UpdateSubLCDStatusIcons(void)
  1139. {
  1140.     /*----------------------------------------------------------------*/
  1141.     /* Local Variables                                                */
  1142.     /*----------------------------------------------------------------*/
  1143.     /*----------------------------------------------------------------*/
  1144.     /* Code Body                                                      */
  1145.     /*----------------------------------------------------------------*/
  1146.     set_status_icon_display(SUBLCD_ONLY);
  1147.     UpdateStatusIcons();
  1148.     reset_status_icon_display();
  1149. }
  1150. /*****************************************************************************
  1151.  * FUNCTION
  1152.  *  ChangeStatusIconLevel
  1153.  * DESCRIPTION
  1154.  *  change the level of status icon like battery icon ,signal icon
  1155.  * PARAMETERS
  1156.  *  icon_ID                 [IN]        
  1157.  *  level_percentage        [IN]        Level of increase
  1158.  * RETURNS
  1159.  *  void
  1160.  *****************************************************************************/
  1161. void ChangeStatusIconLevel(S16 icon_ID, U8 level_percentage)
  1162. {
  1163.     /*----------------------------------------------------------------*/
  1164.     /* Local Variables                                                */
  1165.     /*----------------------------------------------------------------*/
  1166.     S32 n_frames = MMI_status_icons[icon_ID].n_frames;
  1167.     S32 frame_number;
  1168.     /*----------------------------------------------------------------*/
  1169.     /* Code Body                                                      */
  1170.     /*----------------------------------------------------------------*/
  1171.     if (n_frames <= 1)
  1172.     {
  1173.         return;
  1174.     }
  1175.     frame_number = (level_percentage * (n_frames)) / 100;
  1176.     /* check frame number not bigger than frames of icons */
  1177.     if (frame_number > (n_frames - 1))
  1178.     {
  1179.         frame_number = n_frames - 1;
  1180.     }
  1181.     /* check frame number more than 0 */
  1182.     if (frame_number < 0)
  1183.     {
  1184.         frame_number = 0;
  1185.     }
  1186.     /* if level is the same, no need to refresh the icon */
  1187.     if (frame_number == MMI_status_icons[icon_ID].state)
  1188.     {
  1189.         return;
  1190.     }
  1191.     if (mmi_bootup_is_in_security_check() == MMI_TRUE)
  1192.     {
  1193.         /* 030705 Calvin removed */
  1194.         /* status_icon_display_locked=1; */
  1195.         if ((icon_ID == STATUS_ICON_BATTERY_STRENGTH) || (icon_ID == STATUS_ICON_SUBLCD_BATTERY_STRENGTH))
  1196.         {
  1197.             set_status_icon_state(icon_ID, (U8) frame_number);
  1198.         }
  1199.         /* Calvin end */
  1200.     }
  1201.     else
  1202.     {
  1203.         //set the state of icon when MMI in not in power on procedure.
  1204.         //status_icon_display_locked=0;//030705 Calvin removed
  1205.         set_status_icon_state(icon_ID, (U8) frame_number);
  1206.     }
  1207.     /* if(status_icon_display_locked<=0)//030705 Calvin modified */
  1208.     if (mmi_bootup_is_in_security_check() == MMI_FALSE)
  1209.     {
  1210.         /* PMT VIKAS START 20050707 */
  1211.     #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
  1212.         if (icon_ID == STATUS_ICON_SIGNAL_STRENGTH)
  1213.         {
  1214.             refresh_fixed_status_icon(icon_ID, 0);
  1215.         }
  1216.         else if (icon_ID == STATUS_ICON_BATTERY_STRENGTH)
  1217.         {
  1218.             refresh_fixed_status_icon(icon_ID, 1);
  1219.         }
  1220.     #else /* __MMI_UI_DALMATIAN_STATUSBAR__ */ 
  1221.         if ((icon_ID == STATUS_ICON_SIGNAL_STRENGTH) || (icon_ID == STATUS_ICON_BATTERY_STRENGTH))
  1222.         {
  1223.             refresh_fixed_status_icon(icon_ID, 0);
  1224.         }
  1225.     #endif /* __MMI_UI_DALMATIAN_STATUSBAR__ */ 
  1226.         /* PMT VIKAS END 20050707 */
  1227.         else if ((icon_ID == STATUS_ICON_SUBLCD_SIGNAL_STRENGTH) || (icon_ID == STATUS_ICON_SUBLCD_BATTERY_STRENGTH))
  1228.         {
  1229.             refresh_fixed_status_icon(icon_ID, 2);
  1230.         }
  1231.         else
  1232.             /* Before entry idlescreen, only signal and battery should be udpated. */
  1233.     #ifndef __MMI_SHOW_ALL_STATUS_ICONS_B4_IDLE___
  1234.         if (mmi_bootup_is_in_security_check() == MMI_FALSE)
  1235.     #endif 
  1236.             refresh_status_icon_display();
  1237.     }
  1238. }
  1239. /* 022505 Calvin added */
  1240. /*****************************************************************************
  1241.  * FUNCTION
  1242.  *  ChangeStatusIconImage
  1243.  * DESCRIPTION
  1244.  *  change the image of status icon like signal icon with line switch
  1245.  * PARAMETERS
  1246.  *  icon_ID         [IN]        
  1247.  *  image_ID        [IN]        
  1248.  * RETURNS
  1249.  *  void
  1250.  *****************************************************************************/
  1251. void ChangeStatusIconImage(S16 icon_ID, U16 image_ID)
  1252. {
  1253.     /*----------------------------------------------------------------*/
  1254.     /* Local Variables                                                */
  1255.     /*----------------------------------------------------------------*/
  1256.     /*----------------------------------------------------------------*/
  1257.     /* Code Body                                                      */
  1258.     /*----------------------------------------------------------------*/
  1259.     /* HideStatusIcon(icon_ID); */
  1260.     MMI_status_icons[icon_ID].icon_data = get_image(image_ID);
  1261.     MMI_status_icons[icon_ID].n_frames = (S16) gui_image_n_frames(MMI_status_icons[icon_ID].icon_data);
  1262.     gui_measure_image(
  1263.         MMI_status_icons[icon_ID].icon_data,
  1264.         &MMI_status_icons[icon_ID].width,
  1265.         &MMI_status_icons[icon_ID].height);
  1266.     MMI_status_icons[icon_ID].icon_ID = image_ID;
  1267.     /* ShowStatusIcon(icon_ID); */
  1268.     /* set rearrange flag on */
  1269.     IsReArrangeNeeded = 1;
  1270.     /* update status icon */
  1271.     /* UpdateStatusIcons();//101805 ChangeStatusIconImage Calvin: status icon will always be shown if redrawcategory */
  1272. }
  1273. /* Calvin end */
  1274. /* PMT HIMANSHU START 20050625 */
  1275. #if defined(__MMI_UI_TECHNO_STATUS_ICON__)
  1276. /*****************************************************************************
  1277.  * FUNCTION
  1278.  *  ChangeStatusIconImageWithoutReArrange
  1279.  * DESCRIPTION
  1280.  *  
  1281.  * PARAMETERS
  1282.  *  icon_ID         [IN]        
  1283.  *  image_ID        [IN]        
  1284.  * RETURNS
  1285.  *  void
  1286.  *****************************************************************************/
  1287. void ChangeStatusIconImageWithoutReArrange(S16 icon_ID, U16 image_ID)
  1288. {
  1289.     /*----------------------------------------------------------------*/
  1290.     /* Local Variables                                                */
  1291.     /*----------------------------------------------------------------*/
  1292.     /*----------------------------------------------------------------*/
  1293.     /* Code Body                                                      */
  1294.     /*----------------------------------------------------------------*/
  1295.     MMI_status_icons[icon_ID].icon_data = get_image(image_ID);
  1296.     MMI_status_icons[icon_ID].n_frames = (S16) gui_image_n_frames(MMI_status_icons[icon_ID].icon_data);
  1297.     gui_measure_image(
  1298.         MMI_status_icons[icon_ID].icon_data,
  1299.         &MMI_status_icons[icon_ID].width,
  1300.         &MMI_status_icons[icon_ID].height);
  1301.     MMI_status_icons[icon_ID].icon_ID = image_ID;
  1302. }
  1303. #endif /* defined(__MMI_UI_TECHNO_STATUS_ICON__) */ 
  1304. /* PMT HIMANSHU END */
  1305. /*****************************************************************************
  1306.  * FUNCTION
  1307.  *  AnimateStatusIcon
  1308.  * DESCRIPTION
  1309.  *  animate particular icon
  1310.  * PARAMETERS
  1311.  *  icon_ID     [IN]        
  1312.  * RETURNS
  1313.  *  void
  1314.  *****************************************************************************/
  1315. void AnimateStatusIcon(S16 icon_ID)
  1316. {
  1317.     /*----------------------------------------------------------------*/
  1318.     /* Local Variables                                                */
  1319.     /*----------------------------------------------------------------*/
  1320.     /*----------------------------------------------------------------*/
  1321.     /* Code Body                                                      */
  1322.     /*----------------------------------------------------------------*/
  1323.     ShowStatusIcon(icon_ID);
  1324.     /* animate the icon */
  1325.     animate_status_icon(icon_ID);
  1326. }
  1327. /*****************************************************************************
  1328.  * FUNCTION
  1329.  *  BlinkStatusIcon
  1330.  * DESCRIPTION
  1331.  *  blink particular icon
  1332.  * PARAMETERS
  1333.  *  icon_ID     [IN]        
  1334.  * RETURNS
  1335.  *  void
  1336.  *****************************************************************************/
  1337. void BlinkStatusIcon(S16 icon_ID)
  1338. {
  1339.     /*----------------------------------------------------------------*/
  1340.     /* Local Variables                                                */
  1341.     /*----------------------------------------------------------------*/
  1342.     /*----------------------------------------------------------------*/
  1343.     /* Code Body                                                      */
  1344.     /*----------------------------------------------------------------*/
  1345.     ShowStatusIcon(icon_ID);
  1346.     /* blink the icon */
  1347.     blink_status_icon(icon_ID);
  1348. }
  1349. /*****************************************************************************
  1350.  * FUNCTION
  1351.  *  arrange_status_icons_sublcd
  1352.  * DESCRIPTION
  1353.  *  arrange status icon of sub lcd
  1354.  * PARAMETERS
  1355.  *  void
  1356.  * RETURNS
  1357.  *  void
  1358.  *****************************************************************************/
  1359. void arrange_status_icons_sublcd(void)
  1360. {
  1361.     /*----------------------------------------------------------------*/
  1362.     /* Local Variables                                                */
  1363.     /*----------------------------------------------------------------*/
  1364.     S32 i, j, k = 0, group_ID;
  1365.     U8 done = 0, inner_done, display_flag;
  1366. #if(STATUS_ICONS_DRAW_FROM_BOTTOM_BASELINE)
  1367.     S32 cy;
  1368. #endif 
  1369.     /*----------------------------------------------------------------*/
  1370.     /* Code Body                                                      */
  1371.     /*----------------------------------------------------------------*/
  1372. #ifdef __MMI_SUBLCD_SHOW_ANALOG_CLOCK__
  1373.     return;
  1374. #endif 
  1375.     GDI_LOCK;
  1376.     MMI_status_icon_bars[2].n_icons = 0;
  1377.     MMI_status_icons_list3[0] = STATUS_ICON_SUBLCD_SIGNAL_STRENGTH;
  1378.     MMI_status_icons_list3[1] = STATUS_ICON_SUBLCD_BATTERY_STRENGTH;
  1379. #if(STATUS_ICONS_DRAW_FROM_BOTTOM_BASELINE)
  1380.     cy = MMI_status_icon_bars[2].y2 - MMI_status_icon_bars[2].y1 - 1;
  1381. #endif 
  1382.     done = 0;
  1383.     i = 0;
  1384.     while (!done)
  1385.     {
  1386.         display_flag = 0;
  1387.         j = MMI_status_icons_pool2[i];
  1388.         i++;
  1389.         if (i >= MMI_N_STATUS_ICONS_POOL2)
  1390.         {
  1391.             break;
  1392.         }
  1393.         if (TEST_STATUS_ICON_DISPLAY_ON(MMI_status_icons[j].flags))
  1394.         {
  1395.             k = j;
  1396.             display_flag = 1;
  1397.         }
  1398.         if ((MMI_status_icons[j].group_ID > 0))
  1399.         {
  1400.             group_ID = MMI_status_icons[j].group_ID;
  1401.             j++;
  1402.             inner_done = 0;
  1403.             while (!inner_done)
  1404.             {
  1405.                 if (group_ID != MMI_status_icons[j].group_ID)
  1406.                 {
  1407.                     break;
  1408.                 }
  1409.                 if ((!display_flag) && TEST_STATUS_ICON_DISPLAY_ON(MMI_status_icons[j].flags))
  1410.                 {
  1411.                     display_flag = 1;
  1412.                     k = j;
  1413.                 }
  1414.                 else
  1415.                 {
  1416.                     i++;
  1417.                     j++;
  1418.                 }
  1419.             }
  1420.         }
  1421.         if (display_flag)
  1422.         {
  1423.             MMI_status_icons_list3[MMI_status_icon_bars[2].n_icons] = (S16) k;
  1424.             MMI_status_icon_bars[2].n_icons++;
  1425.         #if(STATUS_ICONS_DRAW_FROM_BOTTOM_BASELINE)
  1426.             MMI_status_icons[k].y = cy - MMI_status_icons[k].height;
  1427.         #endif 
  1428.         }
  1429.     }
  1430.     GDI_UNLOCK;
  1431. }
  1432. /*****************************************************************************
  1433.  * FUNCTION
  1434.  *  arrange_status_icons1
  1435.  * DESCRIPTION
  1436.  *  arrange status icon horizontal and vertical staus bar of main lcd
  1437.  * PARAMETERS
  1438.  *  void
  1439.  * RETURNS
  1440.  *  void
  1441.  *****************************************************************************/
  1442. void arrange_status_icons1(void)
  1443. {
  1444.     /*----------------------------------------------------------------*/
  1445.     /* Local Variables                                                */
  1446.     /*----------------------------------------------------------------*/
  1447.     S32 x1, y1, x2, y2, x, y, cy;
  1448.     S32 i, j, k = 0, group_ID;
  1449.     U8 done = 0, inner_done, display_flag;
  1450.     S32 old_i;  /* 122004 Calvin added */
  1451.     /*----------------------------------------------------------------*/
  1452.     /* Code Body                                                      */
  1453.     /*----------------------------------------------------------------*/
  1454.     /* Status bar 1: Horizontal bar  */
  1455.     MMI_status_icons_list1[0] = STATUS_ICON_SIGNAL_STRENGTH;
  1456.     MMI_status_icons_list1[1] = STATUS_ICON_BATTERY_STRENGTH;
  1457.     MMI_status_icon_bars[0].n_icons = 2;
  1458.     x1 = MMI_status_icon_bars[0].x1;    /* store start x position of horizontal stats bar of main lcd */
  1459.     y1 = MMI_status_icon_bars[0].y1;    /* store start y position of horizontal stats bar of main lcd */
  1460.     x2 = MMI_status_icon_bars[0].x2;    /* store end x position of horizontal stats bar of main lcd */
  1461.     y2 = MMI_status_icon_bars[0].y2;    /* store end y position of horizontal stats bar of main lcd */
  1462.     /* Shift x1,x2 assuming signal strength and battery strength icons are at either ends  */
  1463.     x1 += MMI_status_icons[MMI_status_icons_list1[0]].width - 1 + STATUS_ICON_X_GAP;
  1464.     x2 = MMI_status_icons[MMI_status_icons_list1[1]].x - STATUS_ICON_X_GAP;
  1465. #if(STATUS_ICONS_DRAW_FROM_BOTTOM_BASELINE)
  1466.     cy = y2 - y1 - 1;
  1467. #else 
  1468.     cy = (y2 - y1 + 1) >> 1;
  1469. #endif 
  1470. #if(STATUS_ICONS_DRAW_FROM_BOTTOM_BASELINE)
  1471.     MMI_status_icons[0].y = cy - MMI_status_icons[0].height;
  1472.     MMI_status_icons[1].y = cy - MMI_status_icons[1].height;
  1473. #else /* (STATUS_ICONS_DRAW_FROM_BOTTOM_BASELINE) */ 
  1474.     MMI_status_icons[0].y = cy - (MMI_status_icons[0].height >> 1);
  1475.     MMI_status_icons[1].y = cy - (MMI_status_icons[1].height >> 1);
  1476. #endif /* (STATUS_ICONS_DRAW_FROM_BOTTOM_BASELINE) */ 
  1477.     i = 2;
  1478.     x = x1 + STATUS_ICON_X_GAP;
  1479.     while (!done)
  1480.     {
  1481.         display_flag = 0;
  1482.         j = MMI_status_icons_pool1[i];
  1483.         old_i = i;  /* 122004 Calvin added */
  1484.         i++;
  1485.         if (i > MMI_N_STATUS_ICONS_POOL1)
  1486.         {
  1487.             break;
  1488.         }
  1489.         if (TEST_STATUS_ICON_DISPLAY_ON(MMI_status_icons[j].flags))
  1490.         {
  1491.             k = j;
  1492.             display_flag = 1;
  1493.         }
  1494.         if ((MMI_status_icons[j].group_ID > 0))
  1495.         {
  1496.             group_ID = MMI_status_icons[j].group_ID;
  1497.             j++;
  1498.             inner_done = 0;
  1499.             while (!inner_done)
  1500.             {
  1501.                 if (group_ID != MMI_status_icons[j].group_ID)
  1502.                 {
  1503.                     break;
  1504.                 }
  1505.                 if ((!display_flag) && TEST_STATUS_ICON_DISPLAY_ON(MMI_status_icons[j].flags))
  1506.                 {
  1507.                     display_flag = 1;
  1508.                     k = j;
  1509.                 }
  1510.                 else
  1511.                 {
  1512.                     i++;
  1513.                     j++;
  1514.                 }
  1515.             }
  1516.         }
  1517.         if (display_flag)
  1518.         {
  1519.             if ((x + MMI_status_icons[k].width + STATUS_ICON_X_GAP) > x2)
  1520.             {               /* i--; */
  1521.                 i = old_i;  /* 122004 Calvin changed */
  1522.                 break;
  1523.             }
  1524.         #if(STATUS_ICONS_DRAW_FROM_BOTTOM_BASELINE)
  1525.             y = cy - MMI_status_icons[k].height;
  1526.         #else 
  1527.             y = cy - (MMI_status_icons[k].height >> 1);
  1528.         #endif 
  1529.             MMI_status_icons[k].x = x;  /* store x position of ion */
  1530.             MMI_status_icons[k].y = y;  /* stor y position of icon */
  1531.             x += MMI_status_icons[k].width + STATUS_ICON_X_GAP;
  1532.             MMI_status_icons_list1[MMI_status_icon_bars[0].n_icons] = (S16) k;
  1533.             MMI_status_icon_bars[0].n_icons++;
  1534.         }
  1535.     }
  1536. }
  1537. /*****************************************************************************
  1538.  * FUNCTION
  1539.  *  show_status_icon1
  1540.  * DESCRIPTION
  1541.  *  set teh flag of icon to show
  1542.  * PARAMETERS
  1543.  *  icon_ID     [IN]        
  1544.  * RETURNS
  1545.  *  void
  1546.  *****************************************************************************/
  1547. void show_status_icon1(S16 icon_ID)
  1548. {
  1549.     /*----------------------------------------------------------------*/
  1550.     /* Local Variables                                                */
  1551.     /*----------------------------------------------------------------*/
  1552.     /*----------------------------------------------------------------*/
  1553.     /* Code Body                                                      */
  1554.     /*----------------------------------------------------------------*/
  1555.     if ((icon_ID < 0) || (icon_ID >= MAX_STATUS_ICONS))
  1556.     {
  1557.         return;
  1558.     }
  1559.     MMI_status_icons[icon_ID].flags |= STATUS_ICON_DISPLAY;
  1560.     arrange_status_icons1();
  1561. }
  1562. /* MTK added by JL 040302 for sublcd background display. */
  1563. /*****************************************************************************
  1564.  * FUNCTION
  1565.  *  show_sublcd_status_background
  1566.  * DESCRIPTION
  1567.  *  Displays the SUBLCD background screen
  1568.  * PARAMETERS
  1569.  *  start_x             [IN]        Left top position
  1570.  *  start_y             [IN]        Left top position
  1571.  *  end_x               [IN]        Right bottom position
  1572.  *  end_y               [IN]        Right bottom position
  1573.  *  is_status_bar       [IN]        Is status bar to draw or not.
  1574.  * RETURNS
  1575.  *  void
  1576.  *****************************************************************************/
  1577. extern S32 Sub_lcd_title_height;
  1578. void show_sublcd_status_background(S32 start_x, S32 start_y, S32 end_x, S32 end_y, U8 is_status_bar)
  1579. {
  1580.     /*----------------------------------------------------------------*/
  1581.     /* Local Variables                                                */
  1582.     /*----------------------------------------------------------------*/
  1583.     /*----------------------------------------------------------------*/
  1584.     /* Code Body                                                      */
  1585.     /*----------------------------------------------------------------*/
  1586.     /* MTK added by JL to draw all screen of background display. */
  1587. #if defined(__MMI_SUBLCD__)
  1588.     GDI_LOCK;
  1589. #if (defined (__MMI_SUBLCD_COLOR__) || defined (__MMI_FULL_SUBLCD_COLOR__))
  1590.     if (!is_status_bar)
  1591.     {
  1592.     #ifdef __MMI_KLG__
  1593.         UI_filled_area f = *current_MMI_theme->list_selected_item_filler;
  1594.         f.c.r = f.c.g = f.c.b = 0;
  1595.     #else /* __MMI_KLG__ */ 
  1596.         UI_filled_area f = *current_MMI_theme->list_selected_item_filler;
  1597.         f.c.alpha = SUBLCD_ALPHA_VALUE;
  1598.         f.c.r = ((f.c.r * f.c.alpha) + (255 * (100 - f.c.alpha))) / 100;
  1599.         f.c.g = ((f.c.g * f.c.alpha) + (255 * (100 - f.c.alpha))) / 100;
  1600.         f.c.b = ((f.c.b * f.c.alpha) + (255 * (100 - f.c.alpha))) / 100;
  1601.     #endif /* __MMI_KLG__ */ 
  1602.     #if defined(__MMI_SUBLCD_COLOR__)
  1603.         start_y = (U16) Sub_lcd_title_height;
  1604.     #endif 
  1605.         gui_push_clip();
  1606.         gui_set_clip(start_x, start_y, end_x, end_y);
  1607.         /* MTK Leo, always draw color, not draw filled area */
  1608.         /* gui_draw_filled_area(start_x, start_y, end_x, end_y, &f); */
  1609.         gui_fill_rectangle(start_x, start_y, end_x, end_y, f.c);
  1610.         gui_pop_clip();
  1611.     }
  1612.     else
  1613.     {
  1614.         /* No process for status basr */
  1615.     #ifdef __MMI_KLG__
  1616.         color c = gui_color(0, 0, 0);
  1617.     #else 
  1618.         color c = gui_color(255, 255, 255);
  1619.     #endif 
  1620.         gui_push_clip();
  1621.         gui_set_clip(start_x, start_y, end_x, end_y);
  1622.         gui_fill_rectangle(start_x, start_y, end_x, end_y, c);
  1623.         gui_pop_clip();
  1624.     }
  1625. #else /* (defined (__MMI_SUBLCD_COLOR__) || defined (__MMI_FULL_SUBLCD_COLOR__)) */ 
  1626.     {
  1627.         color c = gui_color(255, 255, 255);
  1628.         gui_push_clip();
  1629.         gui_set_clip(start_x, start_y, end_x, end_y);
  1630.         gui_fill_rectangle(start_x, start_y, end_x, end_y, c);
  1631.         gui_pop_clip();
  1632.     }
  1633. #endif /* (defined (__MMI_SUBLCD_COLOR__) || defined (__MMI_FULL_SUBLCD_COLOR__)) */ 
  1634.     GDI_UNLOCK;
  1635. #endif /* defined(__MMI_SUBLCD__) */ 
  1636. }
  1637. /*****************************************************************************
  1638.  * FUNCTION
  1639.  *  show_mainlcd_status_bar_background
  1640.  * DESCRIPTION
  1641.  *  
  1642.  * PARAMETERS
  1643.  *  start_x     [IN]        
  1644.  *  start_y     [IN]        
  1645.  *  end_x       [IN]        
  1646.  *  end_y       [IN]        
  1647.  * RETURNS
  1648.  *  void
  1649.  *****************************************************************************/
  1650. void show_mainlcd_status_bar_background(U16 start_x, U16 start_y, U16 end_x, U16 end_y)
  1651. /* Only for status icon bar 0 */
  1652. {
  1653.     /*----------------------------------------------------------------*/
  1654.     /* Local Variables                                                */
  1655.     /*----------------------------------------------------------------*/
  1656.     color c = {255, 255, 255, 100};
  1657.     /*----------------------------------------------------------------*/
  1658.     /* Code Body                                                      */
  1659.     /*----------------------------------------------------------------*/
  1660.     gdi_layer_push_clip();
  1661.     gui_set_clip_preset(start_x, start_y, end_x, end_y);
  1662.     gui_fill_rectangle(start_x, start_y, end_x, end_y, c);
  1663.     gdi_layer_pop_clip();
  1664. }
  1665. /*****************************************************************************
  1666.  * FUNCTION
  1667.  *  set_status_icons_display
  1668.  * DESCRIPTION
  1669.  *  
  1670.  * PARAMETERS
  1671.  *  state       [IN]        
  1672.  * RETURNS
  1673.  *  void
  1674.  *****************************************************************************/
  1675. void set_status_icons_display(MMI_BOOL state)
  1676. {
  1677.     /*----------------------------------------------------------------*/
  1678.     /* Local Variables                                                */
  1679.     /*----------------------------------------------------------------*/
  1680.     /*----------------------------------------------------------------*/
  1681.     /* Code Body                                                      */
  1682.     /*----------------------------------------------------------------*/
  1683.     if (state)
  1684.     {
  1685.         U8 blink_animate_flag = 0;
  1686.         S32 i;
  1687.         status_icon_display_ON = 1;
  1688.         for (i = 0; i < MAX_STATUS_ICONS; i++)
  1689.         {
  1690.             if ((MMI_status_icons[i].flags & STATUS_ICON_BLINK) || (MMI_status_icons[i].flags & STATUS_ICON_ANIMATE))
  1691.             {
  1692.                 blink_animate_flag = 1;
  1693.                 break;
  1694.             }
  1695.         }
  1696.         if (blink_animate_flag == 1)
  1697.         {
  1698.             gui_start_timer(STATUS_ICON_TIMER_RATE, status_icon_timer_callback);        /* start timer for blinking icon */
  1699.         }
  1700.     }
  1701.     else
  1702.     {
  1703.         status_icon_display_ON = 0;
  1704.         gui_cancel_timer(status_icon_timer_callback);
  1705.     }
  1706. }
  1707. /* PMT VIKAS START 20050707 */
  1708. #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
  1709. /*****************************************************************************
  1710.  * FUNCTION
  1711.  *  shuffle_status_bars
  1712.  * DESCRIPTION
  1713.  *  sets the status bar filler to currently selected theme.
  1714.  * PARAMETERS
  1715.  *  void
  1716.  *  pointer(?)      [IN]        To a UI_status_bar_theme
  1717.  * RETURNS
  1718.  *  void
  1719.  *****************************************************************************/
  1720. /*
  1721.  * void gui_set_status_bar_theme(MMI_status_icon_bar *b, UI_status_bar_theme *t)
  1722.  * {
  1723.  * b->normal_bar_filler = t->normal_bar_filler;
  1724.  * }
  1725.  */
  1726. /* function for shuffling the status bars on idle screen. */
  1727. void shuffle_status_bars(void)
  1728. {
  1729.     /*----------------------------------------------------------------*/
  1730.     /* Local Variables                                                */
  1731.     /*----------------------------------------------------------------*/
  1732.     /*----------------------------------------------------------------*/
  1733.     /* Code Body                                                      */
  1734.     /*----------------------------------------------------------------*/
  1735.     if (is_status_bar_shuffled == 0)
  1736.     {
  1737.         is_status_bar_shuffled = 1;
  1738.     }
  1739.     else
  1740.     {
  1741.         is_status_bar_shuffled = 0;
  1742.     }
  1743.     swap_status_bar_positions(&MMI_status_icon_bars[0].y, &MMI_status_icon_bars[1].y);
  1744.     swap_status_bar_positions(&MMI_status_icon_bars[0].y1, &MMI_status_icon_bars[1].y1);
  1745.     swap_status_bar_positions(&MMI_status_icon_bars[0].y2, &MMI_status_icon_bars[1].y2);
  1746.     IsReArrangeNeeded = 1;
  1747.     gui_lock_double_buffer();
  1748.     gui_push_clip();
  1749.     gui_set_clip(
  1750.         0,
  1751.         MMI_title_height + STATUS_TITLE_GAP,
  1752.         UI_device_width - 1,
  1753.         MMI_title_height + STATUS_TITLE_GAP + MMI_status_bar_height - 1);
  1754.     draw_wallpaper();
  1755.     UpdateStatusIcons();
  1756.     gui_pop_clip();
  1757.     gui_unlock_double_buffer();
  1758.     gui_BLT_double_buffer(
  1759.         0,
  1760.         MMI_title_height + STATUS_TITLE_GAP,
  1761.         UI_device_width - 1,
  1762.         MMI_title_height + STATUS_TITLE_GAP + MMI_status_bar_height);
  1763.     // PMT VIKAS START 20050312
  1764.     //gui_start_timer(STATUS_BAR_SHUFFLE_TIMER, shuffle_status_bars);
  1765.     //   PMT VIKAS END
  1766. }
  1767. /*****************************************************************************
  1768.  * FUNCTION
  1769.  *  swap_status_bar_positions
  1770.  * DESCRIPTION
  1771.  *  
  1772.  * PARAMETERS
  1773.  *  x       [?]     
  1774.  *  y       [?]     
  1775.  * RETURNS
  1776.  *  void
  1777.  *****************************************************************************/
  1778. void swap_status_bar_positions(S32 *x, S32 *y)
  1779. {
  1780.     /*----------------------------------------------------------------*/
  1781.     /* Local Variables                                                */
  1782.     /*----------------------------------------------------------------*/
  1783.     S32 temp;
  1784.     /*----------------------------------------------------------------*/
  1785.     /* Code Body                                                      */
  1786.     /*----------------------------------------------------------------*/
  1787.     temp = *x;
  1788.     *x = *y;
  1789.     *y = temp;
  1790. }
  1791. /*****************************************************************************
  1792.  * FUNCTION
  1793.  *  enable_statusbar_fill_background
  1794.  * DESCRIPTION
  1795.  *  enables the flag for showing the background of status bar.
  1796.  * PARAMETERS
  1797.  *  void
  1798.  * RETURNS
  1799.  *  void
  1800.  *****************************************************************************/
  1801. void enable_statusbar_fill_background(void)
  1802. {
  1803.     /*----------------------------------------------------------------*/
  1804.     /* Local Variables                                                */
  1805.     /*----------------------------------------------------------------*/
  1806.     /*----------------------------------------------------------------*/
  1807.     /* Code Body                                                      */
  1808.     /*----------------------------------------------------------------*/
  1809.     /* PMT VIKAS START 20051202 */
  1810.     if (is_on_idlescreen() == 1)
  1811.         /* PMT VIKAS END 20051202 */
  1812.     {
  1813.         background_fill = 1;
  1814.     }
  1815. }
  1816. /*****************************************************************************
  1817.  * FUNCTION
  1818.  *  disable_statusbar_fill_background
  1819.  * DESCRIPTION
  1820.  *  disables the flag for showing the background of status bar.
  1821.  * PARAMETERS
  1822.  *  void
  1823.  * RETURNS
  1824.  *  void
  1825.  *****************************************************************************/
  1826. void disable_statusbar_fill_background(void)
  1827. {
  1828.     /*----------------------------------------------------------------*/
  1829.     /* Local Variables                                                */
  1830.     /*----------------------------------------------------------------*/
  1831.     /*----------------------------------------------------------------*/
  1832.     /* Code Body                                                      */
  1833.     /*----------------------------------------------------------------*/
  1834.     /* PMT VIKAS START 20051202 */
  1835.     if (is_on_idlescreen() == 1)
  1836.         /* PMT VIKAS END 20051202 */
  1837.     {
  1838.         background_fill = 0;
  1839.     }
  1840. }
  1841. #endif /* __MMI_UI_DALMATIAN_STATUSBAR__ */ 
  1842. /* PMT VIKAS END 20050707 */
  1843. /* PMT HIMANSHU START 20050625 */
  1844. #if defined(__MMI_UI_TECHNO_STATUS_ICON__)
  1845. /*****************************************************************************
  1846.  * FUNCTION
  1847.  *  NumberOfDisplayedIcons
  1848.  * DESCRIPTION
  1849.  *  
  1850.  * PARAMETERS
  1851.  *  void
  1852.  * RETURNS
  1853.  *  
  1854.  *****************************************************************************/
  1855. S32 NumberOfDisplayedIcons(void)
  1856. {
  1857.     /*----------------------------------------------------------------*/
  1858.     /* Local Variables                                                */
  1859.     /*----------------------------------------------------------------*/
  1860.     S32 i;
  1861.     S32 icondisplayed = 0;
  1862.     /*----------------------------------------------------------------*/
  1863.     /* Code Body                                                      */
  1864.     /*----------------------------------------------------------------*/
  1865.     for (i = 2; i < MAX_STATUS_ICONS - 10; i++)
  1866.     {
  1867.         if (TEST_STATUS_ICON_DISPLAY_ON(MMI_status_icons[i].flags))
  1868.         {
  1869.             icondisplayed++;
  1870.         }
  1871.     }
  1872.     return (icondisplayed);
  1873. }
  1874. #endif /* defined(__MMI_UI_TECHNO_STATUS_ICON__) */ 
  1875. /* PMT HIMANSHU END */
  1876. #ifdef __MMI_TOUCH_SCREEN__
  1877. MMI_BOOL gIsHandleStatusIconPenEvent = MMI_FALSE;
  1878. /*****************************************************************************
  1879.  * FUNCTION
  1880.  *  wgui_register_status_icon_pen_event_hdlr
  1881.  * DESCRIPTION
  1882.  *  register pen event handlers for status icons.
  1883.  * PARAMETERS
  1884.  *  icon_id         [IN]        Id of icon
  1885.  *  event_type      [IN]        
  1886.  *  f               [IN]        Event handler
  1887.  * RETURNS
  1888.  *  BOOL        if any status icon is touched(?)
  1889.  *****************************************************************************/
  1890. void wgui_register_status_icon_pen_event_hdlr(S16 icon_id, wgui_status_icon_bar_pen_enum event_type, FuncPtr f)
  1891. {
  1892.     /*----------------------------------------------------------------*/
  1893.     /* Local Variables                                                */
  1894.     /*----------------------------------------------------------------*/
  1895.     /*----------------------------------------------------------------*/
  1896.     /* Code Body                                                      */
  1897.     /*----------------------------------------------------------------*/
  1898.     MMI_status_icon_pen_event_hdlr[icon_id][event_type] = f;
  1899.     gIsHandleStatusIconPenEvent = MMI_TRUE;
  1900. }
  1901. /*****************************************************************************
  1902.  * FUNCTION
  1903.  *  wgui_execute_status_icon_pen_event_hdlr
  1904.  * DESCRIPTION
  1905.  *  execute pen event handlers for status icons.
  1906.  * PARAMETERS
  1907.  *  icon_id         [IN]        Id of icon
  1908.  *  event_type      [IN]        
  1909.  * RETURNS
  1910.  *  BOOL        if event handler exists
  1911.  *****************************************************************************/
  1912. MMI_BOOL wgui_execute_status_icon_pen_event_hdlr(S16 icon_id, wgui_status_icon_bar_pen_enum event_type)
  1913. {
  1914.     /*----------------------------------------------------------------*/
  1915.     /* Local Variables                                                */
  1916.     /*----------------------------------------------------------------*/
  1917.     /*----------------------------------------------------------------*/
  1918.     /* Code Body                                                      */
  1919.     /*----------------------------------------------------------------*/
  1920.     if (MMI_status_icon_pen_event_hdlr[icon_id][event_type] != NULL)
  1921.     {
  1922.         MMI_status_icon_pen_event_hdlr[icon_id][event_type] ();
  1923.         return MMI_TRUE;
  1924.     }
  1925.     else
  1926.     {
  1927.         return MMI_FALSE;
  1928.     }
  1929. }
  1930. /*****************************************************************************
  1931.  * FUNCTION
  1932.  *  wgui_reset_status_icon_pen_event_hdlr
  1933.  * DESCRIPTION
  1934.  *  Reset pen event handlers for status icons.
  1935.  * PARAMETERS
  1936.  *  void
  1937.  * RETURNS
  1938.  *  void
  1939.  *****************************************************************************/
  1940. void wgui_reset_status_icon_pen_event_hdlr(void)
  1941. {
  1942.     /*----------------------------------------------------------------*/
  1943.     /* Local Variables                                                */
  1944.     /*----------------------------------------------------------------*/
  1945.     U8 icon_id = 0, event_type = 0;
  1946.     /*----------------------------------------------------------------*/
  1947.     /* Code Body                                                      */
  1948.     /*----------------------------------------------------------------*/
  1949.     for (event_type = 0; event_type < WGUI_STATUS_ICON_BAR_PEN_EVENT_MAX; event_type++)
  1950.         for (icon_id = 0; icon_id < MAX_STATUS_ICONS; icon_id++)
  1951.         {
  1952.             MMI_status_icon_pen_event_hdlr[icon_id][event_type] = NULL;
  1953.         }
  1954.     gIsHandleStatusIconPenEvent = MMI_FALSE;
  1955. }
  1956. /*****************************************************************************
  1957.  * FUNCTION
  1958.  *  wgui_status_icon_translate_pen_position
  1959.  * DESCRIPTION
  1960.  *  Translate pen position for status icons.
  1961.  * PARAMETERS
  1962.  *  x       [IN]        Pen x-coordinate
  1963.  *  y       [IN]        Pen y-coordinate
  1964.  * RETURNS
  1965.  *  S16         icon_index
  1966.  *****************************************************************************/
  1967. S16 wgui_status_icon_translate_pen_position(S16 x, S16 y)
  1968. {
  1969.     /*----------------------------------------------------------------*/
  1970.     /* Local Variables                                                */
  1971.     /*----------------------------------------------------------------*/
  1972.     U8 i = 0;
  1973.     S16 x1, y1, x2, y2;
  1974.     S16 icon_idx = -1, bar_idx = 0;
  1975.     /*----------------------------------------------------------------*/
  1976.     /* Code Body                                                      */
  1977.     /*----------------------------------------------------------------*/
  1978.     for (bar_idx = 0; bar_idx < MAX_STATUS_ICON_BARS; bar_idx++)
  1979.     {
  1980.         if (MMI_status_icon_bars[bar_idx].flags & STATUS_ICON_BAR_DISPLAY &&
  1981.             MMI_status_icon_bars[bar_idx].icon_list != NULL)
  1982.         {
  1983.             x1 = MMI_status_icon_bars[bar_idx].x1;
  1984.             y1 = MMI_status_icon_bars[bar_idx].y1;
  1985.             x2 = MMI_status_icon_bars[bar_idx].x2;
  1986.             y2 = MMI_status_icon_bars[bar_idx].y2;
  1987.             if (x >= x1 && x <= x2 && y >= y1 && y <= y2)   /* inside status icon bar */
  1988.             {
  1989.                 for (i = 0; i < MMI_status_icon_bars[bar_idx].n_icons; i++)
  1990.                 {
  1991.                     icon_idx = MMI_status_icon_bars[bar_idx].icon_list[i];
  1992.                     if (MMI_status_icons[icon_idx].icon_ID != IMAGE_ID_NULL &&
  1993.                         MMI_status_icons[icon_idx].flags & STATUS_ICON_DISPLAY)
  1994.                     {
  1995.                         x1 = MMI_status_icons[icon_idx].x;
  1996.                         x2 = x1 + MMI_status_icons[icon_idx].width - 1;
  1997.                         y1 = MMI_status_icons[icon_idx].y;
  1998.                         y2 = y1 + MMI_status_icons[icon_idx].height - 1;
  1999.                         if (x >= x1 && x <= x2 && y >= y1 && y <= y2)   /* pen on status icon */
  2000.                         {
  2001.                             return icon_idx;
  2002.                         }
  2003.                     }
  2004.                 }
  2005.             }
  2006.         }
  2007.     }
  2008.     return -1;
  2009. }
  2010. /*****************************************************************************
  2011.  * FUNCTION
  2012.  *  wgui_status_icon_translate_pen_event
  2013.  * DESCRIPTION
  2014.  *  Translate pen events for status icons.
  2015.  * PARAMETERS
  2016.  *  pen_event       [IN]            Type of pen event
  2017.  *  x               [IN]            Pen x-coordinate
  2018.  *  y               [IN]            Pen y-coordinate
  2019.  *  icon_id         [IN/OUT]        Id of icon be touched
  2020.  *  event_type      [?]             
  2021.  * RETURNS
  2022.  *  BOOL        if any status icon is touched
  2023.  *****************************************************************************/
  2024. BOOL wgui_status_icon_translate_pen_event(
  2025.         mmi_pen_event_type_enum pen_event,
  2026.         S16 x,
  2027.         S16 y,
  2028.         S16 *icon_id,
  2029.         wgui_status_icon_bar_pen_enum *event_type)
  2030. {
  2031.     /*----------------------------------------------------------------*/
  2032.     /* Local Variables                                                */
  2033.     /*----------------------------------------------------------------*/
  2034.     gui_wait_longpress_enum w;
  2035.     /*----------------------------------------------------------------*/
  2036.     /* Code Body                                                      */
  2037.     /*----------------------------------------------------------------*/
  2038.     *event_type = WGUI_STATUS_ICON_BAR_PEN_NONE;
  2039.     *icon_id = -1;
  2040.     if (gIsHandleStatusIconPenEvent == MMI_FALSE)
  2041.     {
  2042.         return FALSE;
  2043.     }
  2044.     if (pen_down_status_icon_id < 0 && pen_event != MMI_PEN_EVENT_DOWN)
  2045.     {
  2046.         return FALSE;
  2047.     }
  2048.     if (pen_event == MMI_PEN_EVENT_DOWN)
  2049.     {
  2050.         pen_down_status_icon_id = wgui_status_icon_translate_pen_position(x, y);
  2051.         if (pen_down_status_icon_id < 0)
  2052.         {
  2053.             return FALSE;
  2054.         }
  2055.     }
  2056.     *icon_id = pen_down_status_icon_id;
  2057.     if (MMI_status_icon_pen_event_hdlr[pen_down_status_icon_id][WGUI_STATUS_ICON_BAR_PEN_LONG_PRESS_ICON] != NULL)
  2058.     {
  2059.         w = gui_pen_wait_longpress(pen_event, x, y);
  2060.         if (w == GUI_WAIT_LONGPRESS_READY)
  2061.         {
  2062.             *event_type = WGUI_STATUS_ICON_BAR_PEN_LONG_PRESS_ICON;
  2063.         }
  2064.     }
  2065.     if (pen_event == MMI_PEN_EVENT_UP && *event_type == WGUI_STATUS_ICON_BAR_PEN_NONE)
  2066.     {
  2067.         if (pen_down_status_icon_id == wgui_status_icon_translate_pen_position(x, y))
  2068.         {
  2069.             *event_type = WGUI_STATUS_ICON_BAR_PEN_SELECT_ICON;
  2070.         }
  2071.     }
  2072.     return TRUE;
  2073. }
  2074. #endif /* __MMI_TOUCH_SCREEN__ */ 
  2075. /* diamond, 2005/09/20 get/set flag of a status icon */
  2076. /*****************************************************************************
  2077.  * FUNCTION
  2078.  *  get_status_icon_flag
  2079.  * DESCRIPTION
  2080.  *  
  2081.  * PARAMETERS
  2082.  *  icon_ID     [IN]        
  2083.  * RETURNS
  2084.  *  
  2085.  *****************************************************************************/
  2086. U32 get_status_icon_flag(S16 icon_ID)
  2087. {
  2088.     /*----------------------------------------------------------------*/
  2089.     /* Local Variables                                                */
  2090.     /*----------------------------------------------------------------*/
  2091.     /*----------------------------------------------------------------*/
  2092.     /* Code Body                                                      */
  2093.     /*----------------------------------------------------------------*/
  2094.     return MMI_status_icons[icon_ID].flags;
  2095. }
  2096. /*****************************************************************************
  2097.  * FUNCTION
  2098.  *  set_status_icon_flag
  2099.  * DESCRIPTION
  2100.  *  
  2101.  * PARAMETERS
  2102.  *  icon_ID     [IN]        
  2103.  *  value       [IN]        
  2104.  * RETURNS
  2105.  *  void
  2106.  *****************************************************************************/
  2107. void set_status_icon_flag(S16 icon_ID, U32 value)
  2108. {
  2109.     /*----------------------------------------------------------------*/
  2110.     /* Local Variables                                                */
  2111.     /*----------------------------------------------------------------*/
  2112.     /*----------------------------------------------------------------*/
  2113.     /* Code Body                                                      */
  2114.     /*----------------------------------------------------------------*/
  2115.     if ((icon_ID < 0) || (icon_ID >= MAX_STATUS_ICONS))
  2116.     {
  2117.         return;
  2118.     }
  2119.     /* set the flag to the specific value */
  2120.     MMI_status_icons[icon_ID].flags = value;
  2121.     /* set rearrange flag on */
  2122.     IsReArrangeNeeded = 1;
  2123. }
  2124. /* end, diamond */
  2125. /*****************************************************************************
  2126.  * FUNCTION
  2127.  *  wgui_status_icon_set_display_layer
  2128.  * DESCRIPTION
  2129.  *  
  2130.  * PARAMETERS
  2131.  *  display_layer       [IN]        
  2132.  * RETURNS
  2133.  *  void
  2134.  *****************************************************************************/
  2135. void wgui_status_icon_set_display_layer(GDI_HANDLE display_layer)
  2136. {
  2137.     /*----------------------------------------------------------------*/
  2138.     /* Local Variables                                                */
  2139.     /*----------------------------------------------------------------*/
  2140.     /*----------------------------------------------------------------*/
  2141.     /* Code Body                                                      */
  2142.     /*----------------------------------------------------------------*/
  2143.     wgui_status_icon_display_layer = display_layer;
  2144. }
  2145. /*****************************************************************************
  2146.  * FUNCTION
  2147.  *  wgui_status_icon_get_display_layer
  2148.  * DESCRIPTION
  2149.  *  
  2150.  * PARAMETERS
  2151.  *  void
  2152.  * RETURNS
  2153.  *  
  2154.  *****************************************************************************/
  2155. GDI_HANDLE wgui_status_icon_get_display_layer(void)
  2156. {
  2157.     /*----------------------------------------------------------------*/
  2158.     /* Local Variables                                                */
  2159.     /*----------------------------------------------------------------*/
  2160.     /*----------------------------------------------------------------*/
  2161.     /* Code Body                                                      */
  2162.     /*----------------------------------------------------------------*/
  2163.     return wgui_status_icon_display_layer;
  2164. }
  2165. /*****************************************************************************
  2166.  * FUNCTION
  2167.  *  wgui_status_icon_reset_display_layer
  2168.  * DESCRIPTION
  2169.  *  
  2170.  * PARAMETERS
  2171.  *  void
  2172.  * RETURNS
  2173.  *  void
  2174.  *****************************************************************************/
  2175. void wgui_status_icon_reset_display_layer(void)
  2176. {
  2177.     /*----------------------------------------------------------------*/
  2178.     /* Local Variables                                                */
  2179.     /*----------------------------------------------------------------*/
  2180.     /*----------------------------------------------------------------*/
  2181.     /* Code Body                                                      */
  2182.     /*----------------------------------------------------------------*/
  2183.     wgui_status_icon_display_layer = GDI_LAYER_EMPTY_HANDLE;
  2184. }