wgui_status_icons.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:176k
源码类别:
MTK
开发平台:
C/C++
- * DESCRIPTION
- * set status icons display state (MAINLCD_ONLY, SUBLCD_ONLY, DEFAULT_BOTH)
- * PARAMETERS
- * state [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void set_status_icon_display(S32 state)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- status_icon_display_area = state;
- }
- /*****************************************************************************
- * FUNCTION
- * reset_status_icon_display
- * DESCRIPTION
- * reset status icons display to DEFAULT_BOTH
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void reset_status_icon_display(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- status_icon_display_area = DEFAULT_BOTH;
- }
- /*****************************************************************************
- * FUNCTION
- * show_status_icons
- * DESCRIPTION
- * show all three status bar
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- extern idle_context_struct g_idle_context;
- void show_status_icons(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i, j, id, sbx, sby;
- U8 blink_animate_flag = 0;
- S32 x1, y1, x2, y2;
- S32 ix1, iy1;
- /* backup active lcd */
- bitmap *saved_graphics_context = current_LCD_device_bitmap;
- /* 101804 MTK Calvin added to avoid to update signal level status icon during g_pwr_context.PowerOnTillIdleApp */
- U8 old_signal_state_main = 0; /* 111605 warning Calvin */
- #ifdef __MMI_SUBLCD__
- U8 old_signal_state_sub = 0;
- #endif
- /* PMT VIKAS START 20050707 */
- #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
- /* for handling the shuffling of status bar on idle screen. */
- S32 initial, increment;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (is_status_bar_shuffled == 1)
- {
- initial = MAX_STATUS_ICON_BARS - 1;
- increment = -1;
- }
- else
- {
- initial = 0;
- increment = 1;
- }
- #endif /* __MMI_UI_DALMATIAN_STATUSBAR__ */
- /* PMT VIKAS END 20050707 */
- if (mmi_bootup_is_in_security_check() == MMI_TRUE)
- {
- old_signal_state_main = MMI_status_icons[STATUS_ICON_SIGNAL_STRENGTH].state;
- MMI_status_icons[STATUS_ICON_SIGNAL_STRENGTH].state = 0;
- #ifdef __MMI_SUBLCD__
- old_signal_state_sub = MMI_status_icons[STATUS_ICON_SUBLCD_SIGNAL_STRENGTH].state;
- MMI_status_icons[STATUS_ICON_SUBLCD_SIGNAL_STRENGTH].state = 0;
- #endif /* __MMI_SUBLCD__ */
- }
- /* MTK Calvin end */
- /* 050205 Calvin added */
- if (IsReArrangeNeeded)
- {
- arrange_status_icons();
- IsReArrangeNeeded = 0;
- }
- /* Calvin end */
- /* MTK Leo add, change clip region when drawing layer is set */
- // gui_push_clip();
- // gui_reset_clip();
- /* MTK Leo end */
- /* PMT VIKAS START 20050707 */
- #if (defined __MMI_MAINLCD_176X220__) && (defined __MMI_UI_DALMATIAN_STATUSBAR__)
- if (background_fill == 1)
- {
- if ((MMI_status_icon_bars[0].flags & STATUS_ICON_BAR_DISPLAY)
- || (MMI_status_icon_bars[1].flags & STATUS_ICON_BAR_DISPLAY))
- if (GetActiveScreenId() != IDLE_SCREEN_ID)
- {
- show_mainlcd_status_bar_background(0, 0, UI_device_width - 1, MMI_STATUS_BAR_HEIGHT - 1);
- }
- }
- #endif /* (defined __MMI_MAINLCD_176X220__) && (defined __MMI_UI_DALMATIAN_STATUSBAR__) */
- #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
- for (j = initial; j >= 0 && j < MAX_STATUS_ICON_BARS; j += increment)
- #else
- for (j = 0; j < MAX_STATUS_ICON_BARS; j++)
- #endif
- /* PMT VIKAS END 20050707 */
- {
- if (MMI_status_icon_bars[j].flags & STATUS_ICON_BAR_DISPLAY)
- {
- if (MMI_status_icon_bars[j].graphics_context == &main_LCD_device_bitmap)
- {
- if (status_icon_display_area == SUBLCD_ONLY)
- {
- continue;
- }
- UI_set_main_LCD_graphics_context(); /* set graphic context to main lcd */
- //if (!g_idle_context.IsOnIdleScreen)//092206 network search
- if ((!mmi_idle_is_on_idle_screen()) || (mmi_idle_is_on_idle_screen() && (!mmi_bootup_is_idle_screen_reached())))
- {
- /* 061506 double buffer Start */
- if(get_status_icon_bar_layer((U8)j)!=GDI_ERROR_HANDLE)
- {
- gdi_layer_push_and_set_active(get_status_icon_bar_layer((U8)j));
- }
- /* 061506 double buffer End */
- MMI_hide_status_icon_bars[j] (); /* call hide function of status bar */
- /* 061506 double buffer Start */
- if(get_status_icon_bar_layer((U8)j)!=GDI_ERROR_HANDLE)
- {
- gdi_layer_pop_and_restore_active();
- }
- /* 061506 double buffer End */
- }
- }
- else if (MMI_status_icon_bars[j].graphics_context == &sub_LCD_device_bitmap)
- {
- if (status_icon_display_area == MAINLCD_ONLY)
- {
- continue;
- }
- /* if ( ! g_idle_context.IsOnIdleScreen ) */
- /* 061506 double buffer Start */
- if(get_status_icon_bar_layer((U8)j)!=GDI_ERROR_HANDLE)
- {
- gdi_layer_push_and_set_active(get_status_icon_bar_layer((U8)j));
- }
- /* 061506 double buffer End */
- MMI_hide_status_icon_bars[j] (); /* call hide function of sub lcd status bar */
- /* 061506 double buffer Start */
- if(get_status_icon_bar_layer((U8)j)!=GDI_ERROR_HANDLE)
- {
- gdi_layer_pop_and_restore_active();
- }
- /* 061506 double buffer End */
- UI_set_sub_LCD_graphics_context(); /* set grahic context to sub lcd */
- }
- /* 061506 double buffer Start */
- if(get_status_icon_bar_layer((U8)j)!=GDI_ERROR_HANDLE)
- {
- gdi_layer_push_and_set_active(get_status_icon_bar_layer((U8)j));
- }
- /* 061506 double buffer End */
- /* MTK Leo add, change clip region when drawing layer is set */
- gui_push_clip();
- gui_reset_clip();
- /* MTK Leo end */
- /* store coordinates of status icon bar */
- x1 = MMI_status_icon_bars[j].x1;
- y1 = MMI_status_icon_bars[j].y1;
- x2 = MMI_status_icon_bars[j].x2;
- y2 = MMI_status_icon_bars[j].y2;
- /* set clip region */
- gui_set_clip(x1, y1, x2, y2);
- /* PMT HIMANSHU START 20050625 */
- #if defined(__MMI_UI_TECHNO_STATUS_ICON__)
- if (j == 0)
- {
- //PMT HIMANSHU START 20050721
- //PMT VIKAS START 20051202
- if (is_on_idlescreen() == 1); /* do nothing */
- //PMT VIKAS END 20051202
- // gui_fill_rectangle(x1, y1, x2, y2,
- // (current_MMI_theme->formatted_inputbox_normal_filler->border_color));
- //PMT HIMANSHU END 20050721
- else if (GetActiveScreenId() == MAIN_MENU_SCREENID)
- {
- gui_fill_rectangle(
- x1,
- y1,
- x2,
- y2,
- /* PMT VIKAS START 20050718 */ current_UI_theme->window_title_theme->active_filler->c);
- }
- /* PMT VIKAS END 20050718 */
- else
- {
- gui_fill_rectangle(x1, y1, x2, y2, *(current_MMI_theme->statusbar0_background_color));
- }
- }
- #endif /* defined(__MMI_UI_TECHNO_STATUS_ICON__) */
- //PMT HIMANSHU END
- //PMT VIKAS START 20050707
- #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
- /* gui_draw_filled_area(x1, y1, x2, y2, MMI_status_icon_bars[j].normal_bar_filler); */
- if (j == 0)
- {
- UI_filled_area Dalmatiian_LSK_up;
- Dalmatiian_LSK_up = *current_MMI_theme->LSK_up_filler;
- Dalmatiian_LSK_up.flags |= UI_FILLED_AREA_RIGHT_ROUNDED_BORDER;
- gui_draw_filled_area(x1, y1, x2, y2, &Dalmatiian_LSK_up);
- }
- else if (j == 1)
- {
- UI_filled_area Dalmatiian_RSK_up;
- Dalmatiian_RSK_up = *current_MMI_theme->RSK_up_filler;
- Dalmatiian_RSK_up.flags |= UI_FILLED_AREA_LEFT_ROUNDED_BORDER;
- gui_draw_filled_area(x1, y1, x2, y2, &Dalmatiian_RSK_up);
- }
- #endif /* __MMI_UI_DALMATIAN_STATUSBAR__ */
- /* PMT VIKAS END 20050707 */
- /* store icon offset coordinates */
- sbx = MMI_status_icon_bars[j].x;
- sby = MMI_status_icon_bars[j].y;
- if (MMI_status_icon_bars[j].icon_list != NULL)
- {
- for (i = 0; i < MMI_status_icon_bars[j].n_icons; i++)
- {
- id = MMI_status_icon_bars[j].icon_list[i];
- if (MMI_status_icons[id].icon_ID != IMAGE_ID_NULL)
- {
- #ifdef __MMI_DOWNLOADABLE_THEMES_SUPPORT__
- if (mmi_tm_does_theme_have_alt_image())
- {
- if (mmi_tm_is_theme_dirty_bit_set(GetImageIndex(MMI_status_icons[id].icon_ID)))
- {
- MMI_status_icons[id].icon_data = get_image(MMI_status_icons[id].icon_ID);
- /* No need to calculate Image width, height and frames as they will not change */
- }
- }
- #endif /* __MMI_DOWNLOADABLE_THEMES_SUPPORT__ */
- if (MMI_status_icons[id].flags & STATUS_ICON_REVERSE_ANIMATE)
- {
- /* do nothing */
- }
- else if (MMI_status_icons[id].flags & STATUS_ICON_FORWARD_ANIMATE)
- {
- /* do nothing */
- }
- else if (MMI_status_icons[id].flags & STATUS_ICON_ANIMATE)
- {
- blink_animate_flag = 1;
- /* store position of the icon */
- ix1 = MMI_status_icons[id].x + sbx;
- iy1 = MMI_status_icons[id].y + sby;
- gui_show_transparent_animated_image_frame(
- ix1,
- iy1,
- MMI_status_icons[id].icon_data,
- 0,
- MMI_status_icons[id].current_frame);
- /* 091505 bettery Calvin removed to status_icon_timer_callback */
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif /* 0 */
- /* 091505 bettery Calvin end */
- }
- else if (MMI_status_icons[id].flags & STATUS_ICON_BLINK)
- {
- blink_animate_flag = 1;
- if (MMI_status_icons_blink_animate_ON_state)
- {
- /* store position of the icon */
- ix1 = MMI_status_icons[id].x + sbx;
- iy1 = MMI_status_icons[id].y + sby;
- gui_show_transparent_image(ix1, iy1, MMI_status_icons[id].icon_data, 0);
- }
- }
- else if (MMI_status_icons[id].flags & STATUS_ICON_DISPLAY)
- {
- /* store position of the icon */
- ix1 = MMI_status_icons[id].x + sbx;
- iy1 = MMI_status_icons[id].y + sby;
- if (MMI_status_icons[id].state > 0)
- {
- gui_show_transparent_animated_image_frame(
- ix1,
- iy1,
- MMI_status_icons[id].icon_data,
- 0,
- MMI_status_icons[id].state);
- }
- else
- {
- gui_show_transparent_image(ix1, iy1, MMI_status_icons[id].icon_data, 0);
- }
- }
- }
- }
- }
- /* MTK Leo add, change clip region when drawing layer is set */
- gui_pop_clip();
- /* MTK Leo end */
- /* 061506 double buffer Start */
- if(get_status_icon_bar_layer((U8)j)!=GDI_ERROR_HANDLE)
- {
- gdi_layer_pop_and_restore_active();
- }
- /* 061506 double buffer End */
- }
- }
- /* 101804 MTK Calvin added to avoid to update signal level status icon during g_pwr_context.PowerOnTillIdleApp */
- if (mmi_bootup_is_in_security_check() == MMI_TRUE)
- {
- MMI_status_icons[STATUS_ICON_SIGNAL_STRENGTH].state = old_signal_state_main;
- #ifdef __MMI_SUBLCD__
- MMI_status_icons[STATUS_ICON_SUBLCD_SIGNAL_STRENGTH].state = old_signal_state_sub;
- #endif
- }
- /* MTK Calvin end */
- status_icon_display_ON = 1;
- /* PMT VIKAS START 20050707 */
- #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
- /* PMT VIKAS START 20051202 */
- if (is_on_idlescreen() == 1)
- /* PMT VIKAS END 20051202 */
- {
- if ((MMI_status_icons[STATUS_ICON_SIGNAL_STRENGTH].flags & STATUS_ICON_ANIMATE)
- || (MMI_status_icons[STATUS_ICON_BATTERY_STRENGTH].flags & STATUS_ICON_ANIMATE))
- {
- blink_animate_flag = 1;
- }
- }
- #endif /* __MMI_UI_DALMATIAN_STATUSBAR__ */
- /* PMT VIKAS END 20050707 */
- if (blink_animate_flag) /* if icon is animated */
- {
- if (status_icon_blink_animate_ON == 0)
- {
- setup_status_icon_blink_animate();
- }
- status_icon_blink_animate_ON = 1;
- }
- else
- {
- if (status_icon_blink_animate_ON == 1)
- {
- setup_status_icon_blink_animate();
- }
- status_icon_blink_animate_ON = 0;
- }
- /* MTK Leo add, change clip region when drawing layer is set */
- /* gui_pop_clip(); */
- /* MTK Leo end */
- /* restore active lcd according to backuped lcd */
- if (saved_graphics_context == &main_LCD_device_bitmap)
- {
- UI_set_main_LCD_graphics_context();
- }
- else if (saved_graphics_context == &sub_LCD_device_bitmap)
- {
- UI_set_sub_LCD_graphics_context();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * hide_status_icons
- * DESCRIPTION
- * set the flag of all icons to hide
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void hide_status_icons(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- U8 flag = 1;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (i = 0; i < MAX_STATUS_ICON_BARS; i++)
- {
- if (MMI_status_icon_bars[i].flags & STATUS_ICON_BAR_DISPLAY)
- {
- if (MMI_status_icon_bars[i].graphics_context == current_LCD_device_bitmap)
- {
- /* call hide fuction of status bar */
- MMI_hide_status_icon_bars[i] ();
- /* set the flag of bar to disable */
- MMI_status_icon_bars[i].flags &= ~STATUS_ICON_BAR_DISPLAY;
- }
- else if (MMI_status_icon_bars[i].flags & STATUS_ICON_BAR_DISPLAY)
- {
- flag = 0;
- }
- }
- }
- if (flag)
- {
- status_icon_display_ON = 0;
- if (status_icon_blink_animate_ON)
- {
- status_icon_blink_animate_ON = 0;
- gui_cancel_timer(status_icon_timer_callback);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * close_status_icons
- * DESCRIPTION
- * set statu sicon bar flag to not to display,clear status bar hide function s
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void close_status_icons(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- U8 flag = 1;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #if defined(__MMI_MAINLCD_176X220__) || defined (__MMI_MAINLCD_240X320__) /* 041205 Calvin modieid */
- /* if ( if_full_screen_hide_status_icons()== MMI_FALSE ) */
- //KP Jerry add for KP-Style 12-Matrix mainmenu on 2007-3-19 start
- #ifdef __MMI_KP_STYLE_MAIN_MENU_MATRIX__
- if(GetActiveScreenId() != MAIN_MENU_SCREENID)
- #endif
- //KP Jerry add for KP-Style 12-Matrix mainmenu on 2007-3-19 end
- return;
- #endif /* defined(__MMI_MAINLCD_176X220__) || defined (__MMI_MAINLCD_240X320__) */
- for (i = 0; i < MAX_STATUS_ICON_BARS; i++)
- {
- if (MMI_status_icon_bars[i].graphics_context == current_LCD_device_bitmap)
- {
- MMI_status_icon_bars[i].flags &= ~STATUS_ICON_BAR_DISPLAY;
- }
- else if (MMI_status_icon_bars[i].flags & STATUS_ICON_BAR_DISPLAY)
- {
- flag = 0;
- }
- }
- if (flag)
- {
- status_icon_display_ON = 0;
- if (status_icon_blink_animate_ON)
- {
- status_icon_blink_animate_ON = 0;
- gui_cancel_timer(status_icon_timer_callback);
- }
- }
- clear_hide_status_icon_bars(); /* clear function handlers of hide function */
- gui_hide_animations(); /* stop animation of icons */
- //status_icon_display_locked=0;// set the valeu of lock variable of staus icon to zero //030705 Calvin removed
- //PMT VIKAS START 20050707
- #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
- gui_cancel_timer(shuffle_status_bars);
- #endif
- /* PMT VIKAS END 20050707 */
- }
- /*****************************************************************************
- * FUNCTION
- * status_icon_timer_callback
- * DESCRIPTION
- * timer call back of animated icon
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void status_icon_timer_callback(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* 091505 bettery Calvin moved here from show and refresh functions */
- for (i = 0; i < MAX_STATUS_ICONS; i++)
- {
- if (MMI_status_icons[i].flags & STATUS_ICON_ANIMATE)
- {
- MMI_status_icons[i].current_frame++;
- if (MMI_status_icons[i].current_frame >= MMI_status_icons[i].n_frames)
- {
- MMI_status_icons[i].current_frame = 0;
- }
- }
- }
- /* 091505 bettery Calvin end */
- /* PMT HIMANSHU START 20050625 */
- #if defined(__MMI_UI_TECHNO_STATUS_ICON__)
- if ((MMI_status_icons[STATUS_ICON_SIGNAL_STRENGTH].flags & STATUS_ICON_ANIMATE)
- || (MMI_status_icons[STATUS_ICON_BATTERY_STRENGTH].flags & STATUS_ICON_ANIMATE))
- {
- status_icon_blink_animate_ON = 1;
- /* PMT VIKAS START 20051202 */
- if (is_on_idlescreen() == 1 || GetActiveScreenId() == MAIN_MENU_SCREENID)
- /* PMT VIKAS END 20051202 */
- {
- refresh_fixed_status_icon(STATUS_ICON_BATTERY_STRENGTH, 0);
- }
- }
- #endif /* defined(__MMI_UI_TECHNO_STATUS_ICON__) */
- /* PMT HIMANSHU END */
- /* cancel the timaer call back of animated icon */
- if (!status_icon_blink_animate_ON)
- {
- gui_cancel_timer(status_icon_timer_callback);
- }
- if (!status_icon_display_ON)
- {
- return;
- }
- if (MMI_status_icons_blink_animate_ON_state)
- {
- MMI_status_icons_blink_animate_ON_state = 0;
- }
- else
- {
- MMI_status_icons_blink_animate_ON_state = 1;
- }
- /* PMT VIKAS START 20050707 */
- #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
- disable_statusbar_fill_background();
- #endif
- /* PMT VIKAS END 20050707 */
- /* redraw the status icons */
- refresh_status_icon_display();
- /* PMT VIKAS START 20050707 */
- #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
- /* PMT VIKAS START 20051202 */
- if (is_on_idlescreen() == 1)
- /* PMT VIKAS END 20051202 */
- {
- enable_statusbar_fill_background();
- if (MMI_status_icons[STATUS_ICON_BATTERY_STRENGTH].flags & STATUS_ICON_ANIMATE)
- {
- refresh_fixed_status_icon(STATUS_ICON_BATTERY_STRENGTH, 1);
- }
- }
- #endif /* __MMI_UI_DALMATIAN_STATUSBAR__ */
- /* PMT VIKAS END 20050707 */
- if (status_icon_blink_animate_ON)
- {
- gui_start_timer(STATUS_ICON_TIMER_RATE, status_icon_timer_callback);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * setup_status_icon_blink_animate
- * DESCRIPTION
- * timer call back of blinking icon
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void setup_status_icon_blink_animate(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- U8 blink_animate_flag = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* PMT HIMANSHU START 20050625 */
- #if(!defined(__MMI_UI_TECHNO_STATUS_ICON__))
- if (!status_icon_display_ON)
- {
- return;
- }
- #endif /* (!defined(__MMI_UI_TECHNO_STATUS_ICON__)) */
- /* PMT HIMANSHU END */
- for (i = 0; i < MAX_STATUS_ICONS; i++)
- {
- if ((MMI_status_icons[i].flags & STATUS_ICON_BLINK) || (MMI_status_icons[i].flags & STATUS_ICON_ANIMATE))
- {
- blink_animate_flag = 1;
- break;
- }
- }
- if (blink_animate_flag)
- /* start timer for blinking icon */
- {
- gui_start_timer(STATUS_ICON_TIMER_RATE, status_icon_timer_callback);
- }
- else
- /* stop timer for blinking icon */
- {
- gui_cancel_timer(status_icon_timer_callback);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * show_status_icon_bar
- * DESCRIPTION
- * set the display flag of status bar
- * PARAMETERS
- * status_bar_ID [IN] 0 -horizontal bar main lcd
- * horizontal(?) [IN] Bar sub lcd
- * vertical(?) [IN] Bar main lcd
- * RETURNS
- * void
- *****************************************************************************/
- void show_status_icon_bar(U8 status_bar_ID)
- {
- #ifdef __MMI_SUBLCD_SHOW_ANALOG_CLOCK__
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (status_bar_ID == 2)
- {
- return;
- }
- #endif /* __MMI_SUBLCD_SHOW_ANALOG_CLOCK__ */
- /* set teh flag of bar id to display */
- MMI_status_icon_bars[status_bar_ID].flags |= STATUS_ICON_BAR_DISPLAY;
- }
- /*****************************************************************************
- * FUNCTION
- * hide_status_icon_bar
- * DESCRIPTION
- * hide the status bar
- * PARAMETERS
- * status_bar_ID [IN] 0 -horizontal bar main lcd
- * horizontal(?) [IN] Bar sub lcd
- * vertical(?) [IN] Bar main lcd
- * RETURNS
- * void
- *****************************************************************************/
- void hide_status_icon_bar(U8 status_bar_ID)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_status_icon_bars[status_bar_ID].flags &= ~STATUS_ICON_BAR_DISPLAY;
- }
- /*****************************************************************************
- * FUNCTION
- * set_status_icon_bar_type
- * DESCRIPTION
- * hide the status bar
- * PARAMETERS
- * status_bar_ID [IN] 0 -horizontal bar main lcd
- * flags [IN]
- * horizontal(?) [IN] Bar sub lcd
- * vertical(?) [IN] Bar main lcd
- * RETURNS
- * void
- *****************************************************************************/
- void set_status_icon_bar_type(U8 status_bar_ID, U32 flags)
- {
- #ifdef __MMI_SUBLCD_SHOW_ANALOG_CLOCK__
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (status_bar_ID == 2)
- {
- return;
- }
- #endif /* __MMI_SUBLCD_SHOW_ANALOG_CLOCK__ */
- MMI_status_icon_bars[status_bar_ID].flags = flags;
- }
- /* 061306 dummy category Start */
- /*****************************************************************************
- * FUNCTION
- * get_status_icon_bar_type
- * DESCRIPTION
- * hide the status bar
- * PARAMETERS
- * status_bar_ID [IN] 0 -horizontal bar main lcd
- * RETURNS
- *
- *****************************************************************************/
- U32 get_status_icon_bar_type(U8 status_bar_ID)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return MMI_status_icon_bars[status_bar_ID].flags;
- }
- /* 061306 dummy category End */
- /*****************************************************************************
- * FUNCTION
- * get_status_icon_bar_clip
- * DESCRIPTION
- * get teh clipping valeu sof particaular status bar
- * PARAMETERS
- * status_bar_ID [IN] 0 -horizontal bar main lcd
- * x1 [IN] Start x position
- * y1 [IN] Start y position
- * x2 [IN] End x position
- * y2 [IN] End y position
- * horizontal(?) [IN] Bar sub lcd
- * vertical(?) [IN] Bar main lcd
- * RETURNS
- * void
- *****************************************************************************/
- void get_status_icon_bar_clip(U8 status_bar_ID, S32 *x1, S32 *y1, S32 *x2, S32 *y2)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- *x1 = MMI_status_icon_bars[status_bar_ID].x1;
- *y1 = MMI_status_icon_bars[status_bar_ID].y1;
- *x2 = MMI_status_icon_bars[status_bar_ID].x2;
- *y2 = MMI_status_icon_bars[status_bar_ID].y2;
- }
- /*****************************************************************************
- * FUNCTION
- * set_status_icon_bar_clip
- * DESCRIPTION
- * set teh clipping valeu sof particaular status bar
- * PARAMETERS
- * status_bar_ID [IN] 0 -horizontal bar main lcd
- * x1 [IN] Start x position
- * y1 [IN] Start y position
- * x2 [IN] End x position
- * y2 [IN] End y position
- * horizontal(?) [IN] Bar sub lcd
- * vertical(?) [IN] Bar main lcd
- * RETURNS
- * void
- *****************************************************************************/
- void set_status_icon_bar_clip(U8 status_bar_ID, S32 x1, S32 y1, S32 x2, S32 y2)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_status_icon_bars[status_bar_ID].x1 = x1;
- MMI_status_icon_bars[status_bar_ID].y1 = y1;
- MMI_status_icon_bars[status_bar_ID].x2 = x2;
- MMI_status_icon_bars[status_bar_ID].y2 = y2;
- /* PMT VIKAS START 20050707 */
- #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
- MMI_status_icon_bars[status_bar_ID].x = x1;
- MMI_status_icon_bars[status_bar_ID].y = y1;
- #endif /* __MMI_UI_DALMATIAN_STATUSBAR__ */
- /* PMT VIKAS END 20050707 */
- }
- /* 061506 double buffer Start */
- /*****************************************************************************
- * FUNCTION
- * set_status_icon_bar_layer
- * DESCRIPTION
- * set gdi layer handle
- * PARAMETERS
- * status_bar_ID [IN] 0 -horizontal bar main lcd
- * gdi_layer [IN]
- * horizontal(?) [IN] Bar sub lcd
- * vertical(?) [IN] Bar main lcd
- * RETURNS
- * void
- *****************************************************************************/
- void set_status_icon_bar_layer(U8 status_bar_ID, GDI_HANDLE gdi_layer)
- {
- #ifdef __MMI_SUBLCD_SHOW_ANALOG_CLOCK__
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (status_bar_ID == 2)
- {
- return;
- }
- #endif /* __MMI_SUBLCD_SHOW_ANALOG_CLOCK__ */
- MMI_status_icon_bars[status_bar_ID].layer_handle= gdi_layer;
- }
- /*****************************************************************************
- * FUNCTION
- * get_status_icon_bar_layer
- * DESCRIPTION
- * get gdi layer handle
- * PARAMETERS
- * status_bar_ID [IN] 0 -horizontal bar main lcd
- * RETURNS
- *
- *****************************************************************************/
- U32 get_status_icon_bar_layer(U8 status_bar_ID)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return MMI_status_icon_bars[status_bar_ID].layer_handle;
- }
- /* 061506 double buffer End */
- /*****************************************************************************
- * FUNCTION
- * reset_status_icons
- * DESCRIPTION
- * Function to be used by wgui_categories.
- * This must be called in the exit function of the category
- * screens that have displayed status icons and / or registered
- * functions for hiding them.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void reset_status_icons(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- hide_status_icons();
- clear_hide_status_icon_bars();
- }
- /*****************************************************************************
- * FUNCTION
- * initialize_status_icons
- * DESCRIPTION
- * Called once during bootup to initialize Status icons
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- //Moved up
- //extern S32 MAIN_LCD_device_width;
- //extern S32 MAIN_LCD_device_height;
- #ifdef __MMI_SUBLCD__
- extern S32 SUB_LCD_device_width;
- extern S32 SUB_LCD_device_height;
- #endif /* __MMI_SUBLCD__ */
- void initialize_status_icons(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* PMT HIMANSHU START 20050625 */
- #if defined(__MMI_UI_TECHNO_STATUS_ICON__)
- MMI_status_icon_bars[0].x = 0;
- MMI_status_icon_bars[0].y = 0;
- MMI_status_icon_bars[0].x1 = 0;
- MMI_status_icon_bars[0].y1 = 0;
- MMI_status_icon_bars[0].x2 = MAIN_LCD_device_width - 1;
- MMI_status_icon_bars[0].y2 = MMI_status_bar_height - 1;
- /* set the cliping values of vertical status bar of main lcd */
- MMI_status_icon_bars[1].x = 0;
- MMI_status_icon_bars[1].y = 0;
- MMI_status_icon_bars[1].x1 = 0;
- MMI_status_icon_bars[1].y1 = 0;
- MMI_status_icon_bars[1].x2 = 0;
- MMI_status_icon_bars[1].y2 = 0;
- /* PMT VIKAS START 20050707 */
- #elif defined( __MMI_UI_DALMATIAN_STATUSBAR__)
- MMI_status_icon_bars[0].x = 0;
- MMI_status_icon_bars[0].y = MMI_TITLE_HEIGHT + STATUS_TITLE_GAP;
- MMI_status_icon_bars[0].x1 = 0;
- MMI_status_icon_bars[0].y1 = MMI_TITLE_HEIGHT + STATUS_TITLE_GAP;
- MMI_status_icon_bars[0].x2 = MMI_STATUS_BAR_WIDTH - 1;
- MMI_status_icon_bars[0].y2 = MMI_status_icon_bars[0].y1 + MMI_SINGLE_STATUS_BAR_HEIGHT - 1;
- MMI_status_icon_bars[1].x = MAIN_LCD_device_width - MMI_STATUS_BAR_WIDTH;
- MMI_status_icon_bars[1].y = MMI_TITLE_HEIGHT + MMI_STATUS_BAR_HEIGHT
- - MMI_SINGLE_STATUS_BAR_HEIGHT + STATUS_TITLE_GAP;
- MMI_status_icon_bars[1].x1 = MAIN_LCD_device_width - MMI_STATUS_BAR_WIDTH;
- MMI_status_icon_bars[1].y1 = MMI_TITLE_HEIGHT + MMI_STATUS_BAR_HEIGHT
- - MMI_SINGLE_STATUS_BAR_HEIGHT + STATUS_TITLE_GAP;
- MMI_status_icon_bars[1].x2 = MAIN_LCD_device_width - 1;
- MMI_status_icon_bars[1].y2 = MMI_status_icon_bars[1].y1 + MMI_STATUS_BAR_HEIGHT - 1;
- /* PMT VIKAS END 20050707 */
- #else /* set the cliping values of horizontal status bar of main lcd */
- MMI_status_icon_bars[0].x = 0;
- MMI_status_icon_bars[0].y = 0;
- MMI_status_icon_bars[0].x1 = 0;
- MMI_status_icon_bars[0].y1 = 0;
- MMI_status_icon_bars[0].x2 = MAIN_LCD_device_width - 1;
- MMI_status_icon_bars[0].y2 = MMI_status_bar_height - 1;
- /* set the cliping values of vertical status bar of main lcd */
- MMI_status_icon_bars[1].x = MAIN_LCD_device_width - 17;
- MMI_status_icon_bars[1].y = MMI_status_bar_height;
- MMI_status_icon_bars[1].x1 = MAIN_LCD_device_width - 17;
- MMI_status_icon_bars[1].y1 = MMI_status_bar_height;
- MMI_status_icon_bars[1].x2 = MAIN_LCD_device_width - 1;
- /* 070905 Calvin Start */
- #ifdef __MMI_KLG__
- MMI_status_icon_bars[1].y2 = MAIN_LCD_device_height >> 1;
- #else
- MMI_status_icon_bars[1].y2 = MAIN_LCD_device_height - MMI_button_bar_height - 1;
- #endif
- /* 070905 Calvin End */
- #endif
- /* PMT HIMANSHU END */
- /* set the hide functions of statuas bar to dummy function */
- for (i = 0; i < MAX_STATUS_ICON_BARS; i++)
- {
- MMI_hide_status_icon_bars[i] = UI_dummy_function;
- /* PMT VIKAS START 20050707 */
- #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
- /* MMI_status_icon_bars[i].normal_bar_filler = NULL; */
- #endif
- /* PMT VIKAS END 20050707 */
- }
- for (i = 0; i < MAX_STATUS_ICONS; i++)
- {
- MMI_status_icons[i].icon_data = get_image(MMI_status_icons[i].icon_ID);
- MMI_status_icons[i].n_frames = (S16) gui_image_n_frames(MMI_status_icons[i].icon_data);
- gui_measure_image(MMI_status_icons[i].icon_data, &MMI_status_icons[i].width, &MMI_status_icons[i].height);
- }
- /* PMT VIKAS START 20050707 */
- #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
- MMI_status_icons[STATUS_ICON_BATTERY_STRENGTH].x = (MAIN_LCD_device_width - 1)
- - MMI_status_icons[STATUS_ICON_BATTERY_STRENGTH].width - MMI_status_icon_bars[1].x;
- #else /* __MMI_UI_DALMATIAN_STATUSBAR__ */
- /* set the start x position of battery icon of horizontal man lcd status bar */
- MMI_status_icons[STATUS_ICON_BATTERY_STRENGTH].x =
- MAIN_LCD_device_width - 1 - MMI_status_icons[STATUS_ICON_BATTERY_STRENGTH].width;
- #endif /* __MMI_UI_DALMATIAN_STATUSBAR__ */
- /* PMT VIKAS END 20050707 */
- #ifdef __MMI_SUBLCD__
- /* set the cliping values of horizontal status bar of sub lcd */
- MMI_status_icon_bars[2].x = 0;
- MMI_status_icon_bars[2].y = 0;
- MMI_status_icon_bars[2].x1 = 0;
- MMI_status_icon_bars[2].y1 = 0;
- MMI_status_icon_bars[2].x2 = SUB_LCD_device_width - 1;
- MMI_status_icon_bars[2].y2 = 14;
- MMI_status_icons[STATUS_ICON_SUBLCD_SIGNAL_STRENGTH].x = 1;
- MMI_status_icons[STATUS_ICON_SUBLCD_BATTERY_STRENGTH].x =
- SUB_LCD_device_width - 1 - MMI_status_icons[STATUS_ICON_SUBLCD_BATTERY_STRENGTH].width;
- #endif /* __MMI_SUBLCD__ */
- }
- /* 030705 Calvin removed */
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif /* 0 */
- /* Calvin end */
- /*****************************************************************************
- * FUNCTION
- * ShowStatusIcon
- * DESCRIPTION
- * show particular icon
- * PARAMETERS
- * icon_ID [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void ShowStatusIcon(S16 icon_ID)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((icon_ID < 0) || (icon_ID >= MAX_STATUS_ICONS))
- {
- return;
- }
- /* 2005/10/20 Hide status icon in flight mode */
- #ifdef __FLIGHT_MODE_SUPPORT__
- #ifdef __MMI_WLAN_FEATURES__
- if (mmi_bootup_get_active_flight_mode() == 1 || mmi_netset_get_active_preferred_mode() == 1 || mmi_bootup_is_sim_valid() == MMI_FALSE)
- #else
- if (mmi_bootup_get_active_flight_mode() == 1 || mmi_bootup_is_sim_valid() == MMI_FALSE)
- #endif
- {
- pBOOL rtn = PhnsetFlightModeHideButSaveStatusIcon(icon_ID, MMI_status_icons[icon_ID].flags | STATUS_ICON_DISPLAY);
- if (rtn == MMI_TRUE && (gPowerOnWithFlightMode == MMI_TRUE || mmi_bootup_is_sim_valid() == MMI_FALSE))
- {
- return;
- }
- }
- #else /* __FLIGHT_MODE_SUPPORT__ */
- if (mmi_bootup_is_sim_valid() == MMI_FALSE)
- {
- if (PhnsetFlightModeHideButSaveStatusIcon(icon_ID, MMI_status_icons[icon_ID].flags | STATUS_ICON_DISPLAY) ==
- MMI_TRUE)
- {
- return;
- }
- }
- #endif /* __FLIGHT_MODE_SUPPORT__ */
- /* set the flag of icon to display on */
- MMI_status_icons[icon_ID].flags |= STATUS_ICON_DISPLAY;
- /* set rearrange flag on */
- IsReArrangeNeeded = 1;
- }
- /*****************************************************************************
- * FUNCTION
- * HideStatusIcon
- * DESCRIPTION
- * hide particular icon
- * PARAMETERS
- * icon_ID [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HideStatusIcon(S16 icon_ID)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((icon_ID < 0) || (icon_ID >= MAX_STATUS_ICONS))
- {
- return;
- }
- /* set teh flag of icon to hide ...defualt value */
- MMI_status_icons[icon_ID].flags = 0;
- /* set rearrange flag on */
- IsReArrangeNeeded = 1;
- /* 2005/10/20 Hide status icon in flight mode */
- #ifdef __FLIGHT_MODE_SUPPORT__
- #ifdef __MMI_WLAN_FEATURES__
- if (mmi_bootup_get_active_flight_mode() == 1 || mmi_netset_get_active_preferred_mode() == 1)
- #else
- if (mmi_bootup_get_active_flight_mode() == 1)
- #endif
- {
- PhnsetFlightModeHideButSaveStatusIcon(icon_ID, 0);
- }
- #endif /* __FLIGHT_MODE_SUPPORT__ */
- }
- /*****************************************************************************
- * FUNCTION
- * UpdateStatusIcons
- * DESCRIPTION
- * rearrange and refresh status icons
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void UpdateStatusIcons(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (IsReArrangeNeeded)
- {
- arrange_status_icons();
- IsReArrangeNeeded = 0;
- }
- refresh_status_icon_display();
- }
- /*****************************************************************************
- * FUNCTION
- * UpdateSubLCDStatusIcons
- * DESCRIPTION
- * rearrange and refresh SubLCD status icons
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void UpdateSubLCDStatusIcons(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- set_status_icon_display(SUBLCD_ONLY);
- UpdateStatusIcons();
- reset_status_icon_display();
- }
- /*****************************************************************************
- * FUNCTION
- * ChangeStatusIconLevel
- * DESCRIPTION
- * change the level of status icon like battery icon ,signal icon
- * PARAMETERS
- * icon_ID [IN]
- * level_percentage [IN] Level of increase
- * RETURNS
- * void
- *****************************************************************************/
- void ChangeStatusIconLevel(S16 icon_ID, U8 level_percentage)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 n_frames = MMI_status_icons[icon_ID].n_frames;
- S32 frame_number;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (n_frames <= 1)
- {
- return;
- }
- frame_number = (level_percentage * (n_frames)) / 100;
- /* check frame number not bigger than frames of icons */
- if (frame_number > (n_frames - 1))
- {
- frame_number = n_frames - 1;
- }
- /* check frame number more than 0 */
- if (frame_number < 0)
- {
- frame_number = 0;
- }
- /* if level is the same, no need to refresh the icon */
- if (frame_number == MMI_status_icons[icon_ID].state)
- {
- return;
- }
- if (mmi_bootup_is_in_security_check() == MMI_TRUE)
- {
- /* 030705 Calvin removed */
- /* status_icon_display_locked=1; */
- if ((icon_ID == STATUS_ICON_BATTERY_STRENGTH) || (icon_ID == STATUS_ICON_SUBLCD_BATTERY_STRENGTH))
- {
- set_status_icon_state(icon_ID, (U8) frame_number);
- }
- /* Calvin end */
- }
- else
- {
- //set the state of icon when MMI in not in power on procedure.
- //status_icon_display_locked=0;//030705 Calvin removed
- set_status_icon_state(icon_ID, (U8) frame_number);
- }
- /* if(status_icon_display_locked<=0)//030705 Calvin modified */
- if (mmi_bootup_is_in_security_check() == MMI_FALSE)
- {
- /* PMT VIKAS START 20050707 */
- #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
- if (icon_ID == STATUS_ICON_SIGNAL_STRENGTH)
- {
- refresh_fixed_status_icon(icon_ID, 0);
- }
- else if (icon_ID == STATUS_ICON_BATTERY_STRENGTH)
- {
- refresh_fixed_status_icon(icon_ID, 1);
- }
- #else /* __MMI_UI_DALMATIAN_STATUSBAR__ */
- if ((icon_ID == STATUS_ICON_SIGNAL_STRENGTH) || (icon_ID == STATUS_ICON_BATTERY_STRENGTH))
- {
- refresh_fixed_status_icon(icon_ID, 0);
- }
- #endif /* __MMI_UI_DALMATIAN_STATUSBAR__ */
- /* PMT VIKAS END 20050707 */
- else if ((icon_ID == STATUS_ICON_SUBLCD_SIGNAL_STRENGTH) || (icon_ID == STATUS_ICON_SUBLCD_BATTERY_STRENGTH))
- {
- refresh_fixed_status_icon(icon_ID, 2);
- }
- else
- /* Before entry idlescreen, only signal and battery should be udpated. */
- #ifndef __MMI_SHOW_ALL_STATUS_ICONS_B4_IDLE___
- if (mmi_bootup_is_in_security_check() == MMI_FALSE)
- #endif
- refresh_status_icon_display();
- }
- }
- /* 022505 Calvin added */
- /*****************************************************************************
- * FUNCTION
- * ChangeStatusIconImage
- * DESCRIPTION
- * change the image of status icon like signal icon with line switch
- * PARAMETERS
- * icon_ID [IN]
- * image_ID [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void ChangeStatusIconImage(S16 icon_ID, U16 image_ID)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* HideStatusIcon(icon_ID); */
- MMI_status_icons[icon_ID].icon_data = get_image(image_ID);
- MMI_status_icons[icon_ID].n_frames = (S16) gui_image_n_frames(MMI_status_icons[icon_ID].icon_data);
- gui_measure_image(
- MMI_status_icons[icon_ID].icon_data,
- &MMI_status_icons[icon_ID].width,
- &MMI_status_icons[icon_ID].height);
- MMI_status_icons[icon_ID].icon_ID = image_ID;
- /* ShowStatusIcon(icon_ID); */
- /* set rearrange flag on */
- IsReArrangeNeeded = 1;
- /* update status icon */
- /* UpdateStatusIcons();//101805 ChangeStatusIconImage Calvin: status icon will always be shown if redrawcategory */
- }
- /* Calvin end */
- /* PMT HIMANSHU START 20050625 */
- #if defined(__MMI_UI_TECHNO_STATUS_ICON__)
- /*****************************************************************************
- * FUNCTION
- * ChangeStatusIconImageWithoutReArrange
- * DESCRIPTION
- *
- * PARAMETERS
- * icon_ID [IN]
- * image_ID [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void ChangeStatusIconImageWithoutReArrange(S16 icon_ID, U16 image_ID)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_status_icons[icon_ID].icon_data = get_image(image_ID);
- MMI_status_icons[icon_ID].n_frames = (S16) gui_image_n_frames(MMI_status_icons[icon_ID].icon_data);
- gui_measure_image(
- MMI_status_icons[icon_ID].icon_data,
- &MMI_status_icons[icon_ID].width,
- &MMI_status_icons[icon_ID].height);
- MMI_status_icons[icon_ID].icon_ID = image_ID;
- }
- #endif /* defined(__MMI_UI_TECHNO_STATUS_ICON__) */
- /* PMT HIMANSHU END */
- /*****************************************************************************
- * FUNCTION
- * AnimateStatusIcon
- * DESCRIPTION
- * animate particular icon
- * PARAMETERS
- * icon_ID [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void AnimateStatusIcon(S16 icon_ID)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ShowStatusIcon(icon_ID);
- /* animate the icon */
- animate_status_icon(icon_ID);
- }
- /*****************************************************************************
- * FUNCTION
- * BlinkStatusIcon
- * DESCRIPTION
- * blink particular icon
- * PARAMETERS
- * icon_ID [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void BlinkStatusIcon(S16 icon_ID)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ShowStatusIcon(icon_ID);
- /* blink the icon */
- blink_status_icon(icon_ID);
- }
- /*****************************************************************************
- * FUNCTION
- * arrange_status_icons_sublcd
- * DESCRIPTION
- * arrange status icon of sub lcd
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void arrange_status_icons_sublcd(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i, j, k = 0, group_ID;
- U8 done = 0, inner_done, display_flag;
- #if(STATUS_ICONS_DRAW_FROM_BOTTOM_BASELINE)
- S32 cy;
- #endif
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifdef __MMI_SUBLCD_SHOW_ANALOG_CLOCK__
- return;
- #endif
- GDI_LOCK;
- MMI_status_icon_bars[2].n_icons = 0;
- MMI_status_icons_list3[0] = STATUS_ICON_SUBLCD_SIGNAL_STRENGTH;
- MMI_status_icons_list3[1] = STATUS_ICON_SUBLCD_BATTERY_STRENGTH;
- #if(STATUS_ICONS_DRAW_FROM_BOTTOM_BASELINE)
- cy = MMI_status_icon_bars[2].y2 - MMI_status_icon_bars[2].y1 - 1;
- #endif
- done = 0;
- i = 0;
- while (!done)
- {
- display_flag = 0;
- j = MMI_status_icons_pool2[i];
- i++;
- if (i >= MMI_N_STATUS_ICONS_POOL2)
- {
- break;
- }
- if (TEST_STATUS_ICON_DISPLAY_ON(MMI_status_icons[j].flags))
- {
- k = j;
- display_flag = 1;
- }
- if ((MMI_status_icons[j].group_ID > 0))
- {
- group_ID = MMI_status_icons[j].group_ID;
- j++;
- inner_done = 0;
- while (!inner_done)
- {
- if (group_ID != MMI_status_icons[j].group_ID)
- {
- break;
- }
- if ((!display_flag) && TEST_STATUS_ICON_DISPLAY_ON(MMI_status_icons[j].flags))
- {
- display_flag = 1;
- k = j;
- }
- else
- {
- i++;
- j++;
- }
- }
- }
- if (display_flag)
- {
- MMI_status_icons_list3[MMI_status_icon_bars[2].n_icons] = (S16) k;
- MMI_status_icon_bars[2].n_icons++;
- #if(STATUS_ICONS_DRAW_FROM_BOTTOM_BASELINE)
- MMI_status_icons[k].y = cy - MMI_status_icons[k].height;
- #endif
- }
- }
- GDI_UNLOCK;
- }
- /*****************************************************************************
- * FUNCTION
- * arrange_status_icons1
- * DESCRIPTION
- * arrange status icon horizontal and vertical staus bar of main lcd
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void arrange_status_icons1(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 x1, y1, x2, y2, x, y, cy;
- S32 i, j, k = 0, group_ID;
- U8 done = 0, inner_done, display_flag;
- S32 old_i; /* 122004 Calvin added */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Status bar 1: Horizontal bar */
- MMI_status_icons_list1[0] = STATUS_ICON_SIGNAL_STRENGTH;
- MMI_status_icons_list1[1] = STATUS_ICON_BATTERY_STRENGTH;
- MMI_status_icon_bars[0].n_icons = 2;
- x1 = MMI_status_icon_bars[0].x1; /* store start x position of horizontal stats bar of main lcd */
- y1 = MMI_status_icon_bars[0].y1; /* store start y position of horizontal stats bar of main lcd */
- x2 = MMI_status_icon_bars[0].x2; /* store end x position of horizontal stats bar of main lcd */
- y2 = MMI_status_icon_bars[0].y2; /* store end y position of horizontal stats bar of main lcd */
- /* Shift x1,x2 assuming signal strength and battery strength icons are at either ends */
- x1 += MMI_status_icons[MMI_status_icons_list1[0]].width - 1 + STATUS_ICON_X_GAP;
- x2 = MMI_status_icons[MMI_status_icons_list1[1]].x - STATUS_ICON_X_GAP;
- #if(STATUS_ICONS_DRAW_FROM_BOTTOM_BASELINE)
- cy = y2 - y1 - 1;
- #else
- cy = (y2 - y1 + 1) >> 1;
- #endif
- #if(STATUS_ICONS_DRAW_FROM_BOTTOM_BASELINE)
- MMI_status_icons[0].y = cy - MMI_status_icons[0].height;
- MMI_status_icons[1].y = cy - MMI_status_icons[1].height;
- #else /* (STATUS_ICONS_DRAW_FROM_BOTTOM_BASELINE) */
- MMI_status_icons[0].y = cy - (MMI_status_icons[0].height >> 1);
- MMI_status_icons[1].y = cy - (MMI_status_icons[1].height >> 1);
- #endif /* (STATUS_ICONS_DRAW_FROM_BOTTOM_BASELINE) */
- i = 2;
- x = x1 + STATUS_ICON_X_GAP;
- while (!done)
- {
- display_flag = 0;
- j = MMI_status_icons_pool1[i];
- old_i = i; /* 122004 Calvin added */
- i++;
- if (i > MMI_N_STATUS_ICONS_POOL1)
- {
- break;
- }
- if (TEST_STATUS_ICON_DISPLAY_ON(MMI_status_icons[j].flags))
- {
- k = j;
- display_flag = 1;
- }
- if ((MMI_status_icons[j].group_ID > 0))
- {
- group_ID = MMI_status_icons[j].group_ID;
- j++;
- inner_done = 0;
- while (!inner_done)
- {
- if (group_ID != MMI_status_icons[j].group_ID)
- {
- break;
- }
- if ((!display_flag) && TEST_STATUS_ICON_DISPLAY_ON(MMI_status_icons[j].flags))
- {
- display_flag = 1;
- k = j;
- }
- else
- {
- i++;
- j++;
- }
- }
- }
- if (display_flag)
- {
- if ((x + MMI_status_icons[k].width + STATUS_ICON_X_GAP) > x2)
- { /* i--; */
- i = old_i; /* 122004 Calvin changed */
- break;
- }
- #if(STATUS_ICONS_DRAW_FROM_BOTTOM_BASELINE)
- y = cy - MMI_status_icons[k].height;
- #else
- y = cy - (MMI_status_icons[k].height >> 1);
- #endif
- MMI_status_icons[k].x = x; /* store x position of ion */
- MMI_status_icons[k].y = y; /* stor y position of icon */
- x += MMI_status_icons[k].width + STATUS_ICON_X_GAP;
- MMI_status_icons_list1[MMI_status_icon_bars[0].n_icons] = (S16) k;
- MMI_status_icon_bars[0].n_icons++;
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * show_status_icon1
- * DESCRIPTION
- * set teh flag of icon to show
- * PARAMETERS
- * icon_ID [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void show_status_icon1(S16 icon_ID)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((icon_ID < 0) || (icon_ID >= MAX_STATUS_ICONS))
- {
- return;
- }
- MMI_status_icons[icon_ID].flags |= STATUS_ICON_DISPLAY;
- arrange_status_icons1();
- }
- /* MTK added by JL 040302 for sublcd background display. */
- /*****************************************************************************
- * FUNCTION
- * show_sublcd_status_background
- * DESCRIPTION
- * Displays the SUBLCD background screen
- * PARAMETERS
- * start_x [IN] Left top position
- * start_y [IN] Left top position
- * end_x [IN] Right bottom position
- * end_y [IN] Right bottom position
- * is_status_bar [IN] Is status bar to draw or not.
- * RETURNS
- * void
- *****************************************************************************/
- extern S32 Sub_lcd_title_height;
- void show_sublcd_status_background(S32 start_x, S32 start_y, S32 end_x, S32 end_y, U8 is_status_bar)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* MTK added by JL to draw all screen of background display. */
- #if defined(__MMI_SUBLCD__)
- GDI_LOCK;
- #if (defined (__MMI_SUBLCD_COLOR__) || defined (__MMI_FULL_SUBLCD_COLOR__))
- if (!is_status_bar)
- {
- #ifdef __MMI_KLG__
- UI_filled_area f = *current_MMI_theme->list_selected_item_filler;
- f.c.r = f.c.g = f.c.b = 0;
- #else /* __MMI_KLG__ */
- UI_filled_area f = *current_MMI_theme->list_selected_item_filler;
- f.c.alpha = SUBLCD_ALPHA_VALUE;
- f.c.r = ((f.c.r * f.c.alpha) + (255 * (100 - f.c.alpha))) / 100;
- f.c.g = ((f.c.g * f.c.alpha) + (255 * (100 - f.c.alpha))) / 100;
- f.c.b = ((f.c.b * f.c.alpha) + (255 * (100 - f.c.alpha))) / 100;
- #endif /* __MMI_KLG__ */
- #if defined(__MMI_SUBLCD_COLOR__)
- start_y = (U16) Sub_lcd_title_height;
- #endif
- gui_push_clip();
- gui_set_clip(start_x, start_y, end_x, end_y);
- /* MTK Leo, always draw color, not draw filled area */
- /* gui_draw_filled_area(start_x, start_y, end_x, end_y, &f); */
- gui_fill_rectangle(start_x, start_y, end_x, end_y, f.c);
- gui_pop_clip();
- }
- else
- {
- /* No process for status basr */
- #ifdef __MMI_KLG__
- color c = gui_color(0, 0, 0);
- #else
- color c = gui_color(255, 255, 255);
- #endif
- gui_push_clip();
- gui_set_clip(start_x, start_y, end_x, end_y);
- gui_fill_rectangle(start_x, start_y, end_x, end_y, c);
- gui_pop_clip();
- }
- #else /* (defined (__MMI_SUBLCD_COLOR__) || defined (__MMI_FULL_SUBLCD_COLOR__)) */
- {
- color c = gui_color(255, 255, 255);
- gui_push_clip();
- gui_set_clip(start_x, start_y, end_x, end_y);
- gui_fill_rectangle(start_x, start_y, end_x, end_y, c);
- gui_pop_clip();
- }
- #endif /* (defined (__MMI_SUBLCD_COLOR__) || defined (__MMI_FULL_SUBLCD_COLOR__)) */
- GDI_UNLOCK;
- #endif /* defined(__MMI_SUBLCD__) */
- }
- /*****************************************************************************
- * FUNCTION
- * show_mainlcd_status_bar_background
- * DESCRIPTION
- *
- * PARAMETERS
- * start_x [IN]
- * start_y [IN]
- * end_x [IN]
- * end_y [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void show_mainlcd_status_bar_background(U16 start_x, U16 start_y, U16 end_x, U16 end_y)
- /* Only for status icon bar 0 */
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- color c = {255, 255, 255, 100};
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_push_clip();
- gui_set_clip_preset(start_x, start_y, end_x, end_y);
- gui_fill_rectangle(start_x, start_y, end_x, end_y, c);
- gdi_layer_pop_clip();
- }
- /*****************************************************************************
- * FUNCTION
- * set_status_icons_display
- * DESCRIPTION
- *
- * PARAMETERS
- * state [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void set_status_icons_display(MMI_BOOL state)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (state)
- {
- U8 blink_animate_flag = 0;
- S32 i;
- status_icon_display_ON = 1;
- for (i = 0; i < MAX_STATUS_ICONS; i++)
- {
- if ((MMI_status_icons[i].flags & STATUS_ICON_BLINK) || (MMI_status_icons[i].flags & STATUS_ICON_ANIMATE))
- {
- blink_animate_flag = 1;
- break;
- }
- }
- if (blink_animate_flag == 1)
- {
- gui_start_timer(STATUS_ICON_TIMER_RATE, status_icon_timer_callback); /* start timer for blinking icon */
- }
- }
- else
- {
- status_icon_display_ON = 0;
- gui_cancel_timer(status_icon_timer_callback);
- }
- }
- /* PMT VIKAS START 20050707 */
- #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
- /*****************************************************************************
- * FUNCTION
- * shuffle_status_bars
- * DESCRIPTION
- * sets the status bar filler to currently selected theme.
- * PARAMETERS
- * void
- * pointer(?) [IN] To a UI_status_bar_theme
- * RETURNS
- * void
- *****************************************************************************/
- /*
- * void gui_set_status_bar_theme(MMI_status_icon_bar *b, UI_status_bar_theme *t)
- * {
- * b->normal_bar_filler = t->normal_bar_filler;
- * }
- */
- /* function for shuffling the status bars on idle screen. */
- void shuffle_status_bars(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (is_status_bar_shuffled == 0)
- {
- is_status_bar_shuffled = 1;
- }
- else
- {
- is_status_bar_shuffled = 0;
- }
- swap_status_bar_positions(&MMI_status_icon_bars[0].y, &MMI_status_icon_bars[1].y);
- swap_status_bar_positions(&MMI_status_icon_bars[0].y1, &MMI_status_icon_bars[1].y1);
- swap_status_bar_positions(&MMI_status_icon_bars[0].y2, &MMI_status_icon_bars[1].y2);
- IsReArrangeNeeded = 1;
- gui_lock_double_buffer();
- gui_push_clip();
- gui_set_clip(
- 0,
- MMI_title_height + STATUS_TITLE_GAP,
- UI_device_width - 1,
- MMI_title_height + STATUS_TITLE_GAP + MMI_status_bar_height - 1);
- draw_wallpaper();
- UpdateStatusIcons();
- gui_pop_clip();
- gui_unlock_double_buffer();
- gui_BLT_double_buffer(
- 0,
- MMI_title_height + STATUS_TITLE_GAP,
- UI_device_width - 1,
- MMI_title_height + STATUS_TITLE_GAP + MMI_status_bar_height);
- // PMT VIKAS START 20050312
- //gui_start_timer(STATUS_BAR_SHUFFLE_TIMER, shuffle_status_bars);
- // PMT VIKAS END
- }
- /*****************************************************************************
- * FUNCTION
- * swap_status_bar_positions
- * DESCRIPTION
- *
- * PARAMETERS
- * x [?]
- * y [?]
- * RETURNS
- * void
- *****************************************************************************/
- void swap_status_bar_positions(S32 *x, S32 *y)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 temp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- temp = *x;
- *x = *y;
- *y = temp;
- }
- /*****************************************************************************
- * FUNCTION
- * enable_statusbar_fill_background
- * DESCRIPTION
- * enables the flag for showing the background of status bar.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void enable_statusbar_fill_background(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* PMT VIKAS START 20051202 */
- if (is_on_idlescreen() == 1)
- /* PMT VIKAS END 20051202 */
- {
- background_fill = 1;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * disable_statusbar_fill_background
- * DESCRIPTION
- * disables the flag for showing the background of status bar.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void disable_statusbar_fill_background(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* PMT VIKAS START 20051202 */
- if (is_on_idlescreen() == 1)
- /* PMT VIKAS END 20051202 */
- {
- background_fill = 0;
- }
- }
- #endif /* __MMI_UI_DALMATIAN_STATUSBAR__ */
- /* PMT VIKAS END 20050707 */
- /* PMT HIMANSHU START 20050625 */
- #if defined(__MMI_UI_TECHNO_STATUS_ICON__)
- /*****************************************************************************
- * FUNCTION
- * NumberOfDisplayedIcons
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- *
- *****************************************************************************/
- S32 NumberOfDisplayedIcons(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- S32 icondisplayed = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (i = 2; i < MAX_STATUS_ICONS - 10; i++)
- {
- if (TEST_STATUS_ICON_DISPLAY_ON(MMI_status_icons[i].flags))
- {
- icondisplayed++;
- }
- }
- return (icondisplayed);
- }
- #endif /* defined(__MMI_UI_TECHNO_STATUS_ICON__) */
- /* PMT HIMANSHU END */
- #ifdef __MMI_TOUCH_SCREEN__
- MMI_BOOL gIsHandleStatusIconPenEvent = MMI_FALSE;
- /*****************************************************************************
- * FUNCTION
- * wgui_register_status_icon_pen_event_hdlr
- * DESCRIPTION
- * register pen event handlers for status icons.
- * PARAMETERS
- * icon_id [IN] Id of icon
- * event_type [IN]
- * f [IN] Event handler
- * RETURNS
- * BOOL if any status icon is touched(?)
- *****************************************************************************/
- void wgui_register_status_icon_pen_event_hdlr(S16 icon_id, wgui_status_icon_bar_pen_enum event_type, FuncPtr f)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_status_icon_pen_event_hdlr[icon_id][event_type] = f;
- gIsHandleStatusIconPenEvent = MMI_TRUE;
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_execute_status_icon_pen_event_hdlr
- * DESCRIPTION
- * execute pen event handlers for status icons.
- * PARAMETERS
- * icon_id [IN] Id of icon
- * event_type [IN]
- * RETURNS
- * BOOL if event handler exists
- *****************************************************************************/
- MMI_BOOL wgui_execute_status_icon_pen_event_hdlr(S16 icon_id, wgui_status_icon_bar_pen_enum event_type)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (MMI_status_icon_pen_event_hdlr[icon_id][event_type] != NULL)
- {
- MMI_status_icon_pen_event_hdlr[icon_id][event_type] ();
- return MMI_TRUE;
- }
- else
- {
- return MMI_FALSE;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_reset_status_icon_pen_event_hdlr
- * DESCRIPTION
- * Reset pen event handlers for status icons.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_reset_status_icon_pen_event_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 icon_id = 0, event_type = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (event_type = 0; event_type < WGUI_STATUS_ICON_BAR_PEN_EVENT_MAX; event_type++)
- for (icon_id = 0; icon_id < MAX_STATUS_ICONS; icon_id++)
- {
- MMI_status_icon_pen_event_hdlr[icon_id][event_type] = NULL;
- }
- gIsHandleStatusIconPenEvent = MMI_FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_status_icon_translate_pen_position
- * DESCRIPTION
- * Translate pen position for status icons.
- * PARAMETERS
- * x [IN] Pen x-coordinate
- * y [IN] Pen y-coordinate
- * RETURNS
- * S16 icon_index
- *****************************************************************************/
- S16 wgui_status_icon_translate_pen_position(S16 x, S16 y)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 i = 0;
- S16 x1, y1, x2, y2;
- S16 icon_idx = -1, bar_idx = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (bar_idx = 0; bar_idx < MAX_STATUS_ICON_BARS; bar_idx++)
- {
- if (MMI_status_icon_bars[bar_idx].flags & STATUS_ICON_BAR_DISPLAY &&
- MMI_status_icon_bars[bar_idx].icon_list != NULL)
- {
- x1 = MMI_status_icon_bars[bar_idx].x1;
- y1 = MMI_status_icon_bars[bar_idx].y1;
- x2 = MMI_status_icon_bars[bar_idx].x2;
- y2 = MMI_status_icon_bars[bar_idx].y2;
- if (x >= x1 && x <= x2 && y >= y1 && y <= y2) /* inside status icon bar */
- {
- for (i = 0; i < MMI_status_icon_bars[bar_idx].n_icons; i++)
- {
- icon_idx = MMI_status_icon_bars[bar_idx].icon_list[i];
- if (MMI_status_icons[icon_idx].icon_ID != IMAGE_ID_NULL &&
- MMI_status_icons[icon_idx].flags & STATUS_ICON_DISPLAY)
- {
- x1 = MMI_status_icons[icon_idx].x;
- x2 = x1 + MMI_status_icons[icon_idx].width - 1;
- y1 = MMI_status_icons[icon_idx].y;
- y2 = y1 + MMI_status_icons[icon_idx].height - 1;
- if (x >= x1 && x <= x2 && y >= y1 && y <= y2) /* pen on status icon */
- {
- return icon_idx;
- }
- }
- }
- }
- }
- }
- return -1;
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_status_icon_translate_pen_event
- * DESCRIPTION
- * Translate pen events for status icons.
- * PARAMETERS
- * pen_event [IN] Type of pen event
- * x [IN] Pen x-coordinate
- * y [IN] Pen y-coordinate
- * icon_id [IN/OUT] Id of icon be touched
- * event_type [?]
- * RETURNS
- * BOOL if any status icon is touched
- *****************************************************************************/
- BOOL wgui_status_icon_translate_pen_event(
- mmi_pen_event_type_enum pen_event,
- S16 x,
- S16 y,
- S16 *icon_id,
- wgui_status_icon_bar_pen_enum *event_type)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- gui_wait_longpress_enum w;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- *event_type = WGUI_STATUS_ICON_BAR_PEN_NONE;
- *icon_id = -1;
- if (gIsHandleStatusIconPenEvent == MMI_FALSE)
- {
- return FALSE;
- }
- if (pen_down_status_icon_id < 0 && pen_event != MMI_PEN_EVENT_DOWN)
- {
- return FALSE;
- }
- if (pen_event == MMI_PEN_EVENT_DOWN)
- {
- pen_down_status_icon_id = wgui_status_icon_translate_pen_position(x, y);
- if (pen_down_status_icon_id < 0)
- {
- return FALSE;
- }
- }
- *icon_id = pen_down_status_icon_id;
- if (MMI_status_icon_pen_event_hdlr[pen_down_status_icon_id][WGUI_STATUS_ICON_BAR_PEN_LONG_PRESS_ICON] != NULL)
- {
- w = gui_pen_wait_longpress(pen_event, x, y);
- if (w == GUI_WAIT_LONGPRESS_READY)
- {
- *event_type = WGUI_STATUS_ICON_BAR_PEN_LONG_PRESS_ICON;
- }
- }
- if (pen_event == MMI_PEN_EVENT_UP && *event_type == WGUI_STATUS_ICON_BAR_PEN_NONE)
- {
- if (pen_down_status_icon_id == wgui_status_icon_translate_pen_position(x, y))
- {
- *event_type = WGUI_STATUS_ICON_BAR_PEN_SELECT_ICON;
- }
- }
- return TRUE;
- }
- #endif /* __MMI_TOUCH_SCREEN__ */
- /* diamond, 2005/09/20 get/set flag of a status icon */
- /*****************************************************************************
- * FUNCTION
- * get_status_icon_flag
- * DESCRIPTION
- *
- * PARAMETERS
- * icon_ID [IN]
- * RETURNS
- *
- *****************************************************************************/
- U32 get_status_icon_flag(S16 icon_ID)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return MMI_status_icons[icon_ID].flags;
- }
- /*****************************************************************************
- * FUNCTION
- * set_status_icon_flag
- * DESCRIPTION
- *
- * PARAMETERS
- * icon_ID [IN]
- * value [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void set_status_icon_flag(S16 icon_ID, U32 value)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((icon_ID < 0) || (icon_ID >= MAX_STATUS_ICONS))
- {
- return;
- }
- /* set the flag to the specific value */
- MMI_status_icons[icon_ID].flags = value;
- /* set rearrange flag on */
- IsReArrangeNeeded = 1;
- }
- /* end, diamond */
- /*****************************************************************************
- * FUNCTION
- * wgui_status_icon_set_display_layer
- * DESCRIPTION
- *
- * PARAMETERS
- * display_layer [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_status_icon_set_display_layer(GDI_HANDLE display_layer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_status_icon_display_layer = display_layer;
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_status_icon_get_display_layer
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- *
- *****************************************************************************/
- GDI_HANDLE wgui_status_icon_get_display_layer(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return wgui_status_icon_display_layer;
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_status_icon_reset_display_layer
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_status_icon_reset_display_layer(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_status_icon_display_layer = GDI_LAYER_EMPTY_HANDLE;
- }