📄 wgui_status_icons.c
字号:
/* Code Body */
/*----------------------------------------------------------------*/
g_status_bar_at_bottom = TRUE;
}
/*****************************************************************************
* FUNCTION
* reset_status_bar_at_bottom
* DESCRIPTION
*
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void reset_status_bar_at_bottom(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
g_status_bar_at_bottom = FALSE;
}
#endif /* __MMI_UI_STATUS_BAR_AT_BOTTOM__ */
/* END VIJAY PMT 20060105 */
/*****************************************************************************
* FUNCTION
* register_hide_status_icon_bar
* DESCRIPTION
* register hide function of status bar
* PARAMETERS
* status_bar_ID [IN] Bar id
* f [IN] )(void) :- function pointer
* horizontal(?) [IN] Bar :- sublcd
* vertical(?) [IN] Bar main lcd
* RETURNS
* void
*****************************************************************************/
void register_hide_status_icon_bar(U8 status_bar_ID, void (*f) (void))
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
/* register the hide function of status bar */
MMI_hide_status_icon_bars[status_bar_ID] = f;
}
/*****************************************************************************
* FUNCTION
* clear_hide_status_icon_bars
* DESCRIPTION
* clear hide function of status bar
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void clear_hide_status_icon_bars(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
S32 i;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
/* set the hide function to dummy function */
for (i = 0; i < MAX_STATUS_ICON_BARS; i++)
{
if (MMI_status_icon_bars[i].graphics_context == current_LCD_device_bitmap)
{
MMI_hide_status_icon_bars[i] = UI_dummy_function;
}
}
}
#define TEST_STATUS_ICON_DISPLAY_ON(flags) (flags & (STATUS_ICON_ANIMATE|STATUS_ICON_REVERSE_ANIMATE|STATUS_ICON_FORWARD_ANIMATE|STATUS_ICON_BLINK|STATUS_ICON_DISABLED|STATUS_ICON_DISPLAY))
/* PMT HIMANSHU START 20050625 */
#if defined(__MMI_UI_TECHNO_STATUS_ICON__)
extern void set_vertical_signal_status_icons(void);
extern void set_horizontal_signal_status_icons(void);
#endif /* defined(__MMI_UI_TECHNO_STATUS_ICON__) */
/* PMT HIMANSHU END */
/*****************************************************************************
* FUNCTION
* arrange_status_icons
* DESCRIPTION
* calulate the position of status icon of both main lcd (horizontal/vertical)
* and sub lcd
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void arrange_status_icons(void)
{
#if(0) /* Original implementation: Temporarily disabled for worse performance */
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
s32 i,j,x,y,width,height;
UI_image_type img;
byte d=0;
byte group_flag;
for(j=0;j<MAX_STATUS_ICON_BARS;j++)
{ if(MMI_status_icon_bars[j].group_ID>0) group_flag=1;
else group_flag=0;
if(MMI_status_icon_bars[j].flags & STATUS_ICON_BAR_ARRANGE_DESCENDING) d=1;
x=y=0;
if(MMI_status_icon_bars[j].flags & STATUS_ICON_BAR_ARRANGE_HORIZONTAL)
{ if(d) /* Descending direction */
{ for(i=0;i<MMI_status_icon_bars[j].n_icons;i++)
{ if(MMI_status_icons[i].flags & (STATUS_ICON_DISPLAY|STATUS_ICON_BLINK|STATUS_ICON_ANIMATE))
{ img=MMI_status_icons[i].icon_data;
pixtel_UI_measure_image(img,&width,&height);
x-=(width+STATUS_ICON_X_GAP);
MMI_status_icons[i].x=x;
MMI_status_icons[i].y=y;
}
}
}
else /* Ascending direction */
{ for(i=0;i<MMI_status_icon_bars[j].n_icons;i++)
{ if(MMI_status_icons[i].flags & (STATUS_ICON_DISPLAY|STATUS_ICON_BLINK|STATUS_ICON_ANIMATE))
{ img=MMI_status_icons[i].icon_data;
pixtel_UI_measure_image(img,&width,&height);
MMI_status_icons[i].x=x;
MMI_status_icons[i].y=y;
x+=(width+STATUS_ICON_X_GAP);
}
}
}
}
else if(MMI_status_icon_bars[j].flags & STATUS_ICON_BAR_ARRANGE_VERTICAL)
{ if(d) /* Descending direction */
{ for(i=0;i<MMI_status_icon_bars[j].n_icons;i++)
{ if(MMI_status_icons[i].flags & (STATUS_ICON_DISPLAY|STATUS_ICON_BLINK|STATUS_ICON_ANIMATE))
{ img=MMI_status_icons[i].icon_data;
pixtel_UI_measure_image(img,&width,&height);
y-=(height+STATUS_ICON_Y_GAP);
MMI_status_icons[i].x=x;
MMI_status_icons[i].y=y;
}
}
}
else /* Ascending direction */
{ for(i=0;i<MMI_status_icon_bars[j].n_icons;i++)
{ if(MMI_status_icons[i].flags & (STATUS_ICON_DISPLAY|STATUS_ICON_BLINK|STATUS_ICON_ANIMATE))
{ img=MMI_status_icons[i].icon_data;
pixtel_UI_measure_image(img,&width,&height);
MMI_status_icons[i].x=x;
MMI_status_icons[i].y=y;
y+=(height+STATUS_ICON_Y_GAP);
}
}
}
}
}
#else /* (0) */ /* Hardcoded implementation for better performance */
S32 x1, y1, x2, y2, x, y, cx, 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 */
#ifdef __MMI_NONBLOCKING_DECODE__
if(wgui_status_icon_blocking == MMI_TRUE)
{
return;
}
#endif
/* PMT HIMANSHU START 20050625 */
#if defined(__MMI_UI_TECHNO_STATUS_ICON__)
/* PMT VIKAS START 20051202 */
if ((is_on_idlescreen() == 1) || (GetActiveScreenId() == MAIN_MENU_SCREENID))
/* PMT VIKAS END 20051202 */
{
set_vertical_signal_status_icons();
ChangeStatusIconImageWithoutReArrange(STATUS_ICON_BATTERY_STRENGTH, IMG_SI_BATTERY_STRENGTH_IDLE);
MMI_status_icon_bars[0].n_icons = 0;
}
else
{
set_horizontal_signal_status_icons();
ChangeStatusIconImageWithoutReArrange(STATUS_ICON_BATTERY_STRENGTH, IMG_SI_BATTERY_STRENGTH);
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;
}
/* PMT VIKAS START 20050707 */
#else
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;
#endif
/* PMT HIMANSHU END */
x1 = MMI_status_icon_bars[0].x1; /* start x position of horizontal status bar main lcd */
y1 = MMI_status_icon_bars[0].y1; /* start y position of horizontal status bar main lcd */
x2 = MMI_status_icon_bars[0].x2; /* end x position of horizontal status bar main lcd */
y2 = MMI_status_icon_bars[0].y2; /* end y position of horizontal status bar main lcd */
/* PMT HIMANSHU START 20050625 */
#if defined(__MMI_UI_TECHNO_STATUS_ICON__)
/* PMT VIKAS START 20051202 */
if (is_on_idlescreen() == 0 && (!(GetActiveScreenId() == MAIN_MENU_SCREENID)))
/* PMT VIKAS END 20051202 */
{
/* 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;
}
/* PMT VIKAS START 20050707 */
#else
/* 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 + MMI_UI_STATUSBAR_GAP;
x2 = MMI_status_icons[MMI_status_icons_list1[1]].x - STATUS_ICON_X_GAP;
#endif
/* PMT HIMANSHU END */
#if(STATUS_ICONS_DRAW_FROM_BOTTOM_BASELINE)
cy = y2 - y1 + 1;
#else
cy = (y2 - y1 + 1) >> 1;
#endif
/* PMT HIMANSHU START 20050625 */
#if defined(__MMI_UI_TECHNO_STATUS_ICON__)
/* PMT VIKAS START 20051202 */
if (is_on_idlescreen() == 1)
/* PMT VIKAS END 20051202 */
{
MMI_status_icons[STATUS_ICON_SIGNAL_STRENGTH].x = 1;
MMI_status_icons[STATUS_ICON_SIGNAL_STRENGTH].y = MMI_status_bar_height
+ MMI_IDLESCREEN_BAR_HEIGHT - 2 - MMI_status_icons[STATUS_ICON_SIGNAL_STRENGTH].height;
MMI_status_icons[STATUS_ICON_BATTERY_STRENGTH].x = MAIN_LCD_device_width
- 1 - MMI_status_icons[STATUS_ICON_BATTERY_STRENGTH].width;
MMI_status_icons[STATUS_ICON_BATTERY_STRENGTH].y = MMI_status_bar_height
+ MMI_IDLESCREEN_BAR_HEIGHT - 2 - MMI_status_icons[STATUS_ICON_BATTERY_STRENGTH].height;
}
else if (GetActiveScreenId() == MAIN_MENU_SCREENID)
{
MMI_status_icons[STATUS_ICON_SIGNAL_STRENGTH].x = 1;
MMI_status_icons[STATUS_ICON_SIGNAL_STRENGTH].y = MMI_status_bar_height
+ MMI_title_height - MMI_status_icons[STATUS_ICON_SIGNAL_STRENGTH].height - 1;
MMI_status_icons[STATUS_ICON_BATTERY_STRENGTH].x = MAIN_LCD_device_width
- 1 - MMI_status_icons[STATUS_ICON_BATTERY_STRENGTH].width;
MMI_status_icons[STATUS_ICON_BATTERY_STRENGTH].y = MMI_status_bar_height
+ MMI_title_height - MMI_status_icons[STATUS_ICON_BATTERY_STRENGTH].height - 1;
}
else
{
#if(STATUS_ICONS_DRAW_FROM_BOTTOM_BASELINE)
MMI_status_icons[STATUS_ICON_SIGNAL_STRENGTH].x = 1;
MMI_status_icons[0].y = cy - MMI_status_icons[0].height;
MMI_status_icons[STATUS_ICON_BATTERY_STRENGTH].x = MAIN_LCD_device_width
- 1 - MMI_status_icons[STATUS_ICON_BATTERY_STRENGTH].width;
MMI_status_icons[1].y = cy + 1 - MMI_status_icons[1].height;
x2 = MMI_status_icons[MMI_status_icons_list1[1]].x - STATUS_ICON_X_GAP;
#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) */
}
#else
#if(STATUS_ICONS_DRAW_FROM_BOTTOM_BASELINE)
/* PMT VIKAS START 20051010 */
#ifdef __MMI_UI_STATUS_BAR_AT_BOTTOM__
/* START VIJAY PMT 20060105 */
if (whether_status_bar_at_bottom())
/* END VIJAY PMT 20060105 */
{
MMI_status_icons[0].y =
UI_device_height - MMI_button_bar_height - 1 - (MMI_status_icons[STATUS_ICON_SIGNAL_STRENGTH].height + 2);
MMI_status_icons[1].y =
UI_device_height - MMI_button_bar_height - 1 - (MMI_status_icons[STATUS_ICON_BATTERY_STRENGTH].height + 2);
}
else
#endif /* __MMI_UI_STATUS_BAR_AT_BOTTOM__ */
{
MMI_status_icons[0].y = cy - MMI_status_icons[0].height - 1;//080206 status icon
MMI_status_icons[1].y = cy - MMI_status_icons[1].height - 1;
}
/* PMT VIKAS END 20051010 */
#else /* (STATUS_ICONS_DRAW_FROM_BOTTOM_BASELINE) */
/* PMT VIKAS START 20051010 */
#ifdef __MMI_UI_STATUS_BAR_AT_BOTTOM__
/* START VIJAY PMT 20060105 */
if (whether_status_bar_at_bottom())
/* END VIJAY PMT 20060105 */
{
MMI_status_icons[0].y =
UI_device_height - MMI_button_bar_height - 1 - MMI_status_bar_height - 2 +
((MMI_status_bar_height - MMI_status_icons[STATUS_ICON_SIGNAL_STRENGTH].height) >> 1);
MMI_status_icons[1].y =
UI_device_height - MMI_button_bar_height - 1 - MMI_status_bar_height - 2 +
((MMI_status_bar_height - MMI_status_icons[STATUS_ICON_SIGNAL_STRENGTH].height) >> 1);
}
else
#endif /* __MMI_UI_STATUS_BAR_AT_BOTTOM__ */
{
MMI_status_icons[0].y = cy - (MMI_status_icons[0].height >> 1);
MMI_status_icons[1].y = cy - (MMI_status_icons[1].height >> 1);
}
/* PMT VIKAS END 20051010 */
#endif /* (STATUS_ICONS_DRAW_FROM_BOTTOM_BASELINE) */
#endif
/* PMT HIMANSHU END */
i = 2;
/* PMT HIMANSHU START 20050625 */
#if defined(__MMI_UI_TECHNO_STATUS_ICON__)
/* PMT VIKAS START 20051202 */
if ((is_on_idlescreen() == 1) || (GetActiveScreenId() == MAIN_MENU_SCREENID))
/* PMT VIKAS END 20051202 */
{
x = (MAIN_LCD_device_width >> 1) - ((NumberOfDisplayedIcons()
* (MMI_status_icons[2].width + STATUS_ICON_X_GAP)) >> 1)
/*- STATUS_ICON_X_GAP */ ;
if (x < (x1 + 2))
{
x = x1 + 2;
}
}
else
#endif /* defined(__MMI_UI_TECHNO_STATUS_ICON__) */
/* PMT HIMANSHU END */
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 flagis set to display */
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -