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

📄 wgui_status_icons.c

📁 MTK6226修改平台UI的文件介绍
💻 C
📖 第 1 页 / 共 5 页
字号:
        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 20050707 */
        #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
            /* to handle horizontal alignment of status bar. */
            if ((x + MMI_status_icons[k].width + STATUS_ICON_X_GAP) > x2)
        #else /* __MMI_UI_DALMATIAN_STATUSBAR__ */ 
            /* 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 */
        #endif /* __MMI_UI_DALMATIAN_STATUSBAR__ */ 
                /* PMT VIKAS END 20050707 */
            {                                               /* i--; */
                i = old_i;
                break;
            }
            /* PMT VIKAS START 20050707 */
        #ifndef __MMI_UI_DALMATIAN_STATUSBAR__
            x = cx - (MMI_status_icons[k].width >> 1);
        #endif 
            /* 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 20050707 */
        #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
            x += MMI_status_icons[k].width + STATUS_ICON_X_GAP;
        #else /* __MMI_UI_DALMATIAN_STATUSBAR__ */ 
            /* 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 */
        #endif /* __MMI_UI_DALMATIAN_STATUSBAR__ */ 
            /* PMT VIKAS END 20050707 */
            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                                                      */
    /*----------------------------------------------------------------*/
    /* PMT VIKAS START 20050707 */
#ifdef __MMI_UI_DALMATIAN_STATUSBAR__
    // for refreshing the signal and battery icon on idle screen.
    //PMT VIKAS START 20051202
    if ((is_on_idlescreen()) ||
        ((status_icon_display_ON) && (MMI_status_icon_bars[bar_id].flags & STATUS_ICON_BAR_DISPLAY)))
        /* PMT VIKAS END 20051202 */
#else /* __MMI_UI_DALMATIAN_STATUSBAR__ */ 
    if ((status_icon_display_ON) && (MMI_status_icon_bars[bar_id].flags & STATUS_ICON_BAR_DISPLAY))
#endif /* __MMI_UI_DALMATIAN_STATUSBAR__ */ 
        /* PMT VIKAS END 20050707 */
    {
        S32 x1, x2, y1, y2;

        /* backup active lcd */
        bitmap *saved_graphics_context = current_LCD_device_bitmap;
        color c;

        /* PMT VIKAS START 20050707 */
    #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
        /* filler is not required for sub-LCD. */
        if (bar_id != 2)
            /* c = MMI_status_icon_bars[bar_id].normal_bar_filler->c; */
        {
            c = current_MMI_theme->LSK_up_filler->c;
        }
        /* PMT VIKAS START 20051202 */
        if (is_on_idlescreen() == 1)
            /* PMT VIKAS END 20051202 */
        {
            x1 = MMI_status_icons[icon_id].x;
            y1 = MMI_status_icons[icon_id].y;
        }
        else
        {
            x1 = MMI_status_icon_bars[bar_id].x + MMI_status_icons[icon_id].x;  /* x start position of icon */
            y1 = MMI_status_icon_bars[bar_id].y + MMI_status_icons[icon_id].y;  /* y start poition of icon */
        }
    #else /* __MMI_UI_DALMATIAN_STATUSBAR__ */ 
        if (current_MMI_theme != NULL)
        {
            c = *current_MMI_theme->statusbar0_background_color;        /*  Color is currently hardcoded: must be calling hide function instead  */
        }
        else
        {
            c = gui_color(216, 212, 212);
        }

        /* set drawing region */
        x1 = MMI_status_icons[icon_id].x;   /* x start position of icon */
        y1 = MMI_status_icons[icon_id].y;   /* y start poition of icon */
    #endif /* __MMI_UI_DALMATIAN_STATUSBAR__ */ 
        /* PMT VIKAS END 20050707 */

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

        /* set active lcd */
        if (bar_id == 2)
        {
            UI_set_sub_LCD_graphics_context();  /* if barid is equal to 2 then switch the graphic context to sub lcd. */
        }
        else
        {
            UI_set_main_LCD_graphics_context(); /* switch graphic context to main lcd if bar id is eqaul to 0 or 1 */
        }

        if (wgui_status_icon_display_layer != GDI_LAYER_EMP

⌨️ 快捷键说明

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