📄 wgui_status_icons.c
字号:
/* if((x+MMI_status_icons[k].width+STATUS_ICON_X_GAP)>x2) */
if ((x + MMI_status_icons[k].width) > x2) /* 022205 Calvin modfied */
{ /* i--; */
i = old_i; /* 122004 Calvin changed */
break;
}
#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 */
{
y = UI_device_height - MMI_button_bar_height - 1 - MMI_status_icons[k].height - 2;
}
else
#endif /* __MMI_UI_STATUS_BAR_AT_BOTTOM__ */
/* PMT VIKAS END 20051010 */
y = cy - MMI_status_icons[k].height - 1;//080206 status icon
#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 */
{
y = UI_device_height - MMI_button_bar_height - 1 - MMI_status_bar_height +
((MMI_status_bar_height - MMI_status_icons[STATUS_ICON_SIGNAL_STRENGTH].height) >> 1);
}
else
#endif /* __MMI_UI_STATUS_BAR_AT_BOTTOM__ */
/* PMT VIKAS END 20051010 */
y = cy - (MMI_status_icons[k].height >> 1);
#endif /* (STATUS_ICONS_DRAW_FROM_BOTTOM_BASELINE) */
MMI_status_icons[k].x = x;
MMI_status_icons[k].y = y;
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++;
if (MMI_status_icon_bars[0].n_icons >= MMI_N_STATUS_ICONS_LIST1)
{
done = 1;
}
}
}
/* Status bar 2: Vertical bar */
MMI_status_icon_bars[1].n_icons = 0;
x1 = MMI_status_icon_bars[1].x1; /* start x position of vertical status bar main lcd */
y1 = MMI_status_icon_bars[1].y1; /* start y position of vertical status bar main lcd */
x2 = MMI_status_icon_bars[1].x2; /* end x position of vertical status bar main lcd */
y2 = MMI_status_icon_bars[1].y2; /* end y position of horizontal status bar main lcd */
/* PMT VIKAS START 20050707 */
/* x2 = UI_device_width - MMI_status_icons[MMI_status_icons_list2[0]].width;//090605 StatusIcon Calvin moved */
cx = (x2 - x1 + 1) >> 1;
/* 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 */
{
/* START VIJAY PMT 20060105 */
#ifdef __MMI_MAINLCD_128X160__
y = UI_device_height - MMI_button_bar_height - MMI_status_bar_height -
((MMI_status_icons[1].height + (STATUS_ICON_Y_GAP) << 1) + STATUS_ICON_Y_GAP + 2) - 1;
#else /* __MMI_MAINLCD_128X160__ */
y = UI_device_height - MMI_button_bar_height - MMI_status_bar_height -
((MMI_status_icons[1].height + (STATUS_ICON_Y_GAP) << 1) + STATUS_ICON_Y_GAP) - 1;
#endif /* __MMI_MAINLCD_128X160__ */
/* END VIJAY PMT 20060105 */
}
else
#endif /* __MMI_UI_STATUS_BAR_AT_BOTTOM__ */
{
y = STATUS_ICON_Y_GAP;
}
/* PMT VIKAS END 20051010 */
done = 0;
while (!done)
{
display_flag = 0;
j = MMI_status_icons_pool1[i];
old_i = i;
i++;
if (i > MMI_N_STATUS_ICONS_POOL1)
{
break;
}
if (TEST_STATUS_ICON_DISPLAY_ON(MMI_status_icons[j].flags)) /* check if the flag is on /off */
{
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)
{
/* PMT VIKAS START 20051217 */
#ifdef __MMI_UI_STATUS_BAR_AT_BOTTOM__
if ((y - MMI_status_icons[k].height) < y1)
#else /* __MMI_UI_STATUS_BAR_AT_BOTTOM__ */
/* if((y1+y+MMI_status_icons[k].height+STATUS_ICON_Y_GAP)>y2) */
if ((y1 + y + MMI_status_icons[k].height) > y2) /* 022205 Calvin modified */
#endif /* __MMI_UI_STATUS_BAR_AT_BOTTOM__ */
/* PMT VIKAS END 20051217 */
{ /* i--; */
i = old_i;
break;
}
/* PMT VIKAS START 20050707 */
x = cx - (MMI_status_icons[k].width >> 1);
/* PMT VIKAS END 20050707 */
MMI_status_icons[k].x = x; /* set the x and y position of icon */
MMI_status_icons[k].y = y;
/* 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 */
{
y = MMI_status_icons[k].y - (MMI_status_icons[k].height + STATUS_ICON_Y_GAP);
}
#else /* __MMI_UI_STATUS_BAR_AT_BOTTOM__ */
y += MMI_status_icons[k].height + STATUS_ICON_Y_GAP;
#endif /* __MMI_UI_STATUS_BAR_AT_BOTTOM__ */
/* PMT VIKAS END 20051010 */
MMI_status_icons_list2[MMI_status_icon_bars[1].n_icons] = (S16) k;
MMI_status_icon_bars[1].n_icons++;
if (MMI_status_icon_bars[1].n_icons >= MMI_N_STATUS_ICONS_LIST2)
{
done = 1;
}
}
}
/* Status bar 3: Sub LCD status bar */
/* MTK Leo add 20040415, arrange status icons in sublcd by priority */
MMI_status_icons_list3[0] = STATUS_ICON_SUBLCD_SIGNAL_STRENGTH;
MMI_status_icons_list3[1] = STATUS_ICON_SUBLCD_BATTERY_STRENGTH;
MMI_status_icon_bars[2].n_icons = 2;
x1 = MMI_status_icon_bars[2].x1; /* start x position of status bar sub lcd */
y1 = MMI_status_icon_bars[2].y1; /* start y position of status bar sub lcd */
x2 = MMI_status_icon_bars[2].x2; /* end x position of status bar sub lcd */
y2 = MMI_status_icon_bars[2].y2; /* end y position of status bar sub lcd */
/* Shift x1,x2 assuming signal strength and battery strength icons are at either ends */
x1 += MMI_status_icons[MMI_status_icons_list3[0]].width - 1 + SUBLCD_STATUS_ICON_X_GAP;
x2 = MMI_status_icons[MMI_status_icons_list3[1]].x - SUBLCD_STATUS_ICON_X_GAP;
/* MTK Leo end */
#if(STATUS_ICONS_DRAW_FROM_BOTTOM_BASELINE)
cy = y2 - y1 - 1;
#else
cy = (y2 - y1 + 1) >> 1;
#endif
x = x1 + SUBLCD_STATUS_ICON_X_GAP;
#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 = 2;
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)
{
//MTK Leo add 20040415, arrange status icons in sublcd by priority
//if ( x + MMI_status_icons[k].width+SUBLCD_STATUS_ICON_X_GAP > x2 )
if (x + MMI_status_icons[k].width > x2) /* 022205 Calvin modified */
{
break;
}
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)
y = cy - MMI_status_icons[k].height;
#else
y = cy - (MMI_status_icons[k].height >> 1);
#endif
MMI_status_icons[k].x = x;
MMI_status_icons[k].y = y;
x += MMI_status_icons[k].width + SUBLCD_STATUS_ICON_X_GAP;
/* MTK Leo end */
}
}
#ifdef __MMI_LCD_PARTIAL_ON__
/* Extra status bar: Used in LCD partial display */
MMI_status_icons_partial_display_n_icons = 0;
done = 0;
i = 0;
while (!done)
{
display_flag = 0;
j = MMI_status_icons_pool_partial_display[i];
i++;
if (i > MMI_N_STATUS_ICONS_POOL_PARTIAL_DISPLAY)
{
break;
}
if (TEST_STATUS_ICON_DISPLAY_ON(MMI_status_icons[j].flags))
{
k = j;
display_flag = 1;
}
if (display_flag)
{
MMI_status_icons_list_partial_display[MMI_status_icons_partial_display_n_icons] = (S16) k;
MMI_status_icons_partial_display_n_icons++;
if (MMI_status_icons_partial_display_n_icons >= MMI_N_STATUS_ICONS_PARTIAL_DISPLAY)
{
done = 1;
}
}
}
#endif /* __MMI_LCD_PARTIAL_ON__ */
#endif /* (0) */
}
/*****************************************************************************
* FUNCTION
* hide_status_icon_bars
* DESCRIPTION
* call hide function of status bar (horizontal/vertical status bar of main
* lcd and horizontal status bar of sub lcd
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void hide_status_icon_bars(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
S32 i;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
for (i = 0; i < MAX_STATUS_ICON_BARS; i++)
{
/* if ( MMI_status_icon_bars[i].flags & STATUS_ICON_BAR_DISPLAY && MMI_status_icon_bars[i].n_icons>0 ) */
if (MMI_status_icon_bars[i].flags & STATUS_ICON_BAR_DISPLAY) /* 101805 stopwatch icon Calvin changed because re-arragne earlier */
{
if (MMI_status_icon_bars[i].graphics_context == &main_LCD_device_bitmap)
{
if (status_icon_display_area != SUBLCD_ONLY)
{
MMI_hide_status_icon_bars[i] (); /* execute the hide function of status bar */
}
}
else if (MMI_status_icon_bars[i].graphics_context == &sub_LCD_device_bitmap)
{
if (status_icon_display_area != MAINLCD_ONLY)
{
MMI_hide_status_icon_bars[i] (); /* execute the hide function of status bar */
}
}
}
}
}
/*****************************************************************************
* FUNCTION
* refresh_fixed_status_icon
* DESCRIPTION
* refrsh particulr icon of status bar
* PARAMETERS
* icon_id [IN]
* bar_id [IN]
* RETURNS
* void
*****************************************************************************/
#ifdef __MMI_IDLE_FULL_SCREEN__
extern U16 on_idle_screen;
#endif
extern void draw_wallpaper(void);
extern U16 GetActiveScreenId(void);
/* extern color wgui_transparent_color;//112205 transparent color Calvin */
#ifdef __MMI_SUB_WALLPAPER__
/* extern color wgui_transparent_color;//112205 transparent color Calvin */
extern int is_sub_idle_screen;
extern void cat312_hide_status_icon_bar(void);
#endif /* __MMI_SUB_WALLPAPER__ */
GDI_HANDLE wgui_status_icon_display_layer = GDI_LAYER_EMPTY_HANDLE;
void refresh_fixed_status_icon(S16 icon_id, S16 bar_id)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
#ifdef __MMI_NONBLOCKING_DECODE__
if(wgui_status_icon_blocking == MMI_TRUE)
{
return;
}
#endif
if ((status_icon_display_ON) && (MMI_status_icon_bars[bar_id].flags & STATUS_ICON_BAR_DISPLAY))
{
S32 x1, x2, y1, y2, cx1, cx2, cy1, cy2;
/* backup active lcd */
bitmap *saved_graphics_context = current_LCD_device_bitmap;
/* set drawing region */
x1 = MMI_status_icons[icon_id].x; /* x start position of icon */
#ifdef __MMI_UI_STATUS_BAR_AT_BOTTOM__
y1 = MMI_status_icons[icon_id].y; /* y start poition of icon */
#else
y1 = MMI_status_icon_bars[bar_id].y + MMI_status_icons[icon_id].y; /* y start poition of icon */
#endif
x2 = x1 + MMI_status_icons[icon_id].width - 1; /* x end position of icon */
y2 = y1 + MMI_status_icons[icon_id].height - 1; /* y end position of icon */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -