⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wgui_status_icons.c

📁 MTK6226修改平台UI的文件介绍
💻 C
📖 第 1 页 / 共 5 页
字号:
/* This is the customizable list of status icon bars        */

MMI_status_icon_bar MMI_status_icon_bars[MAX_STATUS_ICON_BARS];
static S32 status_icon_display_area = DEFAULT_BOTH;

/* Globals  */
/* Hide functions need to take x1,y1,x2,y2 as parameters */
void (*MMI_hide_status_icon_bars[MAX_STATUS_ICON_BARS]) (void);
U8 status_icon_display_ON = 0;
U8 status_icon_blink_animate_ON = 0;
U8 MMI_status_icons_blink_animate_ON_state = 0;

//S32 status_icon_display_locked=0; 030705 Calvin removed
//PMT VIKAS START 20050707
#ifdef __MMI_UI_DALMATIAN_STATUSBAR__
/* UI_status_bar_theme *current_status_bar_theme = NULL; */
U8 is_status_bar_shuffled = 0;
static S32 background_fill = 1;
#endif /* __MMI_UI_DALMATIAN_STATUSBAR__ */ 
/* PMT VIKAS END 20050707 */
#define SUBLCD_ALPHA_VALUE 30

#ifdef __MMI_TOUCH_SCREEN__
FuncPtr MMI_status_icon_pen_event_hdlr[MAX_STATUS_ICONS][WGUI_STATUS_ICON_BAR_PEN_EVENT_MAX];
S16 pen_down_status_icon_id = -1;
#endif /* __MMI_TOUCH_SCREEN__ */ 
/* START VIJAY PMT 20060105 */
#ifdef __MMI_UI_STATUS_BAR_AT_BOTTOM__
pBOOL g_status_bar_at_bottom = FALSE;


/*****************************************************************************
 * FUNCTION
 *  whether_status_bar_at_bottom
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  
 *****************************************************************************/
pBOOL whether_status_bar_at_bottom(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    return g_status_bar_at_bottom;
}


/*****************************************************************************
 * FUNCTION
 *  set_status_bar_at_bottom
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void set_status_bar_at_bottom(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* 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  */

    /* 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 */
#elif defined(__MMI_UI_DALMATIAN_STATUSBAR__)
    /* PMT VIKAS START 20051202 */
    if (is_on_idlescreen() == 1)
        /* PMT VIKAS END 20051202 */
    {
        MMI_status_icon_bars[0].n_icons = 0;    /* signal icon is now placed on title bar on idle screen. */
    }
    else
    {
        MMI_status_icons_list1[0] = STATUS_ICON_SIGNAL_STRENGTH;
        MMI_status_icon_bars[0].n_icons = 1;
    }
    /* PMT VIKAS END 20050707 */
#else 
   // wangbei modify start  20071010
    #ifndef __NEW_IDLE_SCREEN_UI_STYLE__
    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;
    #else
    if (is_on_idlescreen() == 1)
    {
        MMI_status_icon_bars[0].n_icons = 0;    /* signal icon is now placed on title bar on idle screen. */
    }
    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
    // wangbei modify end
#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 */
#elif defined(__MMI_UI_DALMATIAN_STATUSBAR__)
    /* PMT VIKAS START 20051202 */
    if (is_on_idlescreen() == 0)
        /* PMT VIKAS END 20051202 */
    {
        x1 += MMI_status_icons[MMI_status_icons_list1[0]].width - 1 + STATUS_ICON_X_GAP;
    }
    if (is_status_bar_shuffled == 0)
    {
        x2 = UI_device_width - MMI_STATUS_BAR_WIDTH;
    }
    else
    {
        x2 -= 6;
    }
    /* PMT VIKAS END 20050707 */
#else 
    /* Shift x1,x2 assuming signal strength and battery strength icons are at either ends  */
   // wangbei add start  20071010
    #ifdef __NEW_IDLE_SCREEN_UI_STYLE__
   if (is_on_idlescreen() == 1)
   {
       x1 +=1;
       x2 -= 1;
   }
   else
   {
   #endif
   // wangbei add end
       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;
    // wangbei add start  20071010
    #ifdef __NEW_IDLE_SCREEN_UI_STYLE__
   } 
   #endif
   // wangbei add end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -