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

📄 mmiicons.c

📁 是一个手机功能的模拟程序
💻 C
📖 第 1 页 / 共 4 页
字号:
#if 0
void dspl_IdleBackBmp(int i)
{
    switch( i )
    {
    case 1:
        dspl_BitBlt  (0,16,128,126,0,(void *)iconMainIdle0, 0);//hxl changed for don't clear the first and last line 20020929
        break;
    case 2:
        dspl_BitBlt  (0,0,128,160,0,(void *)iconMainIdle1, 0);
        break;
    case 3:
        dspl_BitBlt  (0,16,120,126,0,(void *)iconMainIdle2, 0);
        break;
    case 4:
        dspl_BitBlt  (0,16,120,126,0,(void *)iconMainIdle3, 0);
        break;
    case 5:
        dspl_BitBlt  (0,16,120,126,0,(void *)iconMainIdle4, 0);
        break;
    case 6:
        dspl_BitBlt  (0,16,120,126,0,(void *)iconMainIdle5, 0);
        break;
    case 7:
        dspl_BitBlt  (0,16,120,126,0,(void *)iconMainIdle6, 0);
        break;
    case 8:
        dspl_BitBltUser(1);//chenjun 2002-12-30
        break;//chenjun add for user defined pic,2002-12-29, PCSync 
    default:
        break;
    }
}
#endif
/* 2004/01/04 sunsj modify coordinate */
void drawDownbmp(void)
{
    int softkey_y;

    softkey_y = SCREEN_SIZE_Y - dspl_GetFontHeight();
    //dspl_BitBlt(0, SCREEN_SIZE_Y - menudown[FlashSettingData.theme].area.sy, menudown[FlashSettingData.theme].area.sx, menudown[FlashSettingData.theme].area.sy, 0, (void*)menudown[FlashSettingData.theme].icons, 0);
}

/*********************************************************************************
$Function:		drawIconByIcnAttr
$Description:	draw Icon
$Author:		talcon 
$History:
*******2003/11/12,talcon create
*********************************************************************************/
void drawIconByIcnAttr(MfwIcnAttr* icn,MfwIcnAttr* icnMask)
{
    TRACE_EVENT("drawIconByIcnAttr");
    MmiTrace("drawIconByIcnAttr");

    if( icn == NULL || icn->icons == NULL )
    {
        MmiTrace("drawIconByIcnAttr:Invalid argument");
        return;
    }
    if( icnMask && icnMask-> icons )
    {
        pdspl_BitBlt(icn->area.px,icn->area.py, 
                     icn->area.sx,icn->area.sy, 0,
                     icn->icons,
                     DSPL_BMPXOR);

        pdspl_BitBlt(icn->area.px,icn->area.py, 
                     icn->area.sx,icn->area.sy, 0,
                     icnMask->icons,DSPL_BMPAND);
        pdspl_BitBlt(icn->area.px,icn->area.py, 
                     icn->area.sx,icn->area.sy, 0,
                     icn->icons,
                     DSPL_BMPXOR);
    }
    else
    {
        pdspl_BitBlt(icn->area.px,icn->area.py, 
                     icn->area.sx,icn->area.sy, 0,
                     icn->icons,
                     0);
    }

}
void drawIconByAttrRect(MfwRect *area,char* icn,char* icnMask)
{
    if( icn == NULL || area == NULL )return;
    if( icnMask )
    {
        pdspl_BitBlt(area->px,area->py, 
                     area->sx,area->sy, 0,
                     icn,
                     DSPL_BMPXOR);

        pdspl_BitBlt(area->px,area->py, 
                     area->sx,area->sy, 0,
                     icnMask,DSPL_BMPAND);
        pdspl_BitBlt(area->px,area->py, 
                     area->sx,area->sy, 0,
                     icn,
                     DSPL_BMPXOR);
    }
    else
    {
        pdspl_BitBlt(area->px,area->py, 
                     area->sx,area->sy, 0,
                     icn,
                     0);
    }
}
/*********************************************************************************
$Function:		drawIdelIcons
$Description:	draw Idle top icons
$Author:		talcon 
$History:
*******2003/11/12,talcon create
*********************************************************************************/
void drawIdelIcons()
{
    int flagsZoneBeDraw = 0x02 | 0x08;/*表示被画的区域
     *	0x01:(23,1,12,12)
     *  0x02:(23+12,1,12,12))
     ...
     */

    //#define ICNTEST
    TRACE_EVENT("drawIdelIcons");
    MmiTrace("drawIdelIcons");

    if( globalMobileMode == (GlobalCharging|GlobalDisplayFlag) )
    {
        TRACE_FUNCTION(" ! clear GlobalDisplayFlag !");
        globalMobileMode = globalMobileMode & (~GlobalDisplayFlag);

        //globalFlashBattery ();
    }

    //Invalid
    if( GlobalIconStatus & GlobalSMSIconFlag )
    {
        if( state[ iconIdSMS ].state == ICON_VISIBLE )
        {
            /* 2004/06 sunsj modify for picture manage */
            DRAW_ICON_SEL_MASK(ICON_IDLESTATE, iconIdSMS);
            //drawIconByIcnAttr((MfwIcnAttr*)&idl_Attr[iconIdSMS ],(MfwIcnAttr*)&idl_AttrMask[iconIdSMS ]);
        }
    }

    if( GlobalIconStatus & GlobalSignalIconFlag )
        iconsShowSignal( globalSignalPicNumber );

    //xsf add 2002.08.15
    if( GlobalIconStatus & GlobalRingerIconFlag )
    {
        iconsShowScenemode( FlashEnvironmentData.CurrentEnv );
    }
    //nm do it later, step by step
    //InValid		
    if( GlobalIconStatus & GlobalVoiceMailIconFlag )
    {
        if( state[ iconIdVoice ].state == ICON_VISIBLE )
        {
            /* 2004/06 sunsj modify for picture manage */
            DRAW_ICON_SEL_MASK(ICON_IDLESTATE, iconIdVoice);
            //drawIconByIcnAttr((MfwIcnAttr*)&idl_Attr[iconIdVoice],(MfwIcnAttr*)&idl_AttrMask[iconIdVoice]);
        }
    }
    //转接	
#ifndef ICNTEST
    if( GlobalIconStatus & GlobalCallForwardingIconFlag )
        if( state[ iconIdCallFor ].state == ICON_VISIBLE )
#endif
        {
            /* 2004/06 sunsj modify for picture manage */
            DRAW_ICON_SEL_MASK(ICON_IDLESTATE, iconIdCallFor);
            //drawIconByIcnAttr((MfwIcnAttr*)&idl_Attr[iconIdCallFor],(MfwIcnAttr*)&idl_AttrMask[iconIdCallFor]);
        }

        //InValid	
    if( GlobalIconStatus & GlobalKeyplockIconFlag )
    {
        if( state[ iconIdKeyplock ].state == ICON_VISIBLE )
        {
            /* 2004/06 sunsj modify for picture manage */
            DRAW_ICON_SEL_MASK(ICON_IDLESTATE, iconIdKeyplock);
            //drawIconByIcnAttr((MfwIcnAttr*)&idl_Attr[iconIdKeyplock],(MfwIcnAttr*)&idl_AttrMask[iconIdKeyplock]);
        }
    }
    //iconsShowIcon( &state[ iconIdKeyplock ] );
    //InValid	
    if( GlobalIconStatus & GlobalCipheringActivIconFlag )
    {
        if( state[ iconIdCipheringActiv ].state == ICON_VISIBLE )
        {
            /* 2004/06 sunsj modify for picture manage */
            DRAW_ICON_SEL_MASK(ICON_IDLESTATE, iconIdCipheringActiv);
            //drawIconByIcnAttr((MfwIcnAttr*)&idl_Attr[iconIdCipheringActiv],(MfwIcnAttr*)&idl_AttrMask[iconIdCipheringActiv]);
        }
    }

    //Invalid	
    if( GlobalIconStatus & GlobalCipheringDeactivIconFlag )
    {
        if( state[ iconIdCipheringDeActiv ].state == ICON_VISIBLE )
        {
            /* 2004/06 sunsj modify for picture manage */
            DRAW_ICON_SEL_MASK(ICON_IDLESTATE, iconIdCipheringDeActiv);
            //drawIconByIcnAttr((MfwIcnAttr*)&idl_Attr[iconIdCipheringDeActiv],(MfwIcnAttr*)&idl_AttrMask[iconIdCipheringDeActiv]);
        }
    }
    //Gprs		
#ifdef MMI_GPRS_ENABLED
#ifndef ICNTEST
    if( GlobalIconStatus & GlobalGPRSOnIconFlag )
    {
        if( state[ iconIdGPRSAttached ].state == ICON_VISIBLE )
#endif
        {
            /* 2004/06 sunsj modify for picture manage */
            DRAW_ICON_SEL_MASK(ICON_IDLESTATE, iconIdGPRSAttached);
            //drawIconByIcnAttr((MfwIcnAttr*)&idl_Attr[iconIdGPRSAttached],(MfwIcnAttr*)&idl_AttrMask[iconIdGPRSAttached]);
            flagsZoneBeDraw |= 0x01;
        }
#ifndef ICNTEST
    }
#endif

#endif
    /* SPR759 - SH - Show Homezone icon. */
#ifdef MMI_HOMEZONE_ENABLED
    if( GlobalIconStatus & GlobalHomezoneIconFlag )
    {
        if( state[ iconIdHomezone ].state == ICON_VISIBLE )
        {
            /* 2004/06 sunsj modify for picture manage */
            DRAW_ICON_SEL_MASK(ICON_IDLESTATE, iconIdHomezone);
            //drawIconByIcnAttr((MfwIcnAttr*)&idl_Attr[iconIdHomezone],NULL);
        }
    }
#endif


#ifndef ICNTEST	
    if( GlobalIconStatus & GlobalIconRoamFlag )
        if( state[ iconRoam ].state == ICON_VISIBLE )
#endif
        {
            /* 2004/06 sunsj modify for picture manage */
            DRAW_ICON_SEL_MASK(ICON_IDLESTATE, iconRoam);
            //drawIconByIcnAttr((MfwIcnAttr*)&idl_Attr[iconRoam],(MfwIcnAttr*)&idl_AttrMask[iconRoam]);
            flagsZoneBeDraw |= 0x04;
        }

    if( GlobalIconStatus & GlobalIconServiceFlag )      //xsf add for service line icon 12.09
    {
        if( state[ iconServices1 ].state == ICON_VISIBLE )
        {
            /* 2004/06 sunsj modify for picture manage */
            DRAW_ICON_SEL_MASK(ICON_IDLESTATE, iconServices1);
            //drawIconByIcnAttr((MfwIcnAttr*)&idl_Attr[iconServices1],(MfwIcnAttr*)&idl_AttrMask[iconServices1]);
        }
        else if( state[ iconServices2 ].state == ICON_VISIBLE )
        {
            /* 2004/06 sunsj modify for picture manage */
            DRAW_ICON_SEL_MASK(ICON_IDLESTATE, iconServices2);
            //drawIconByIcnAttr((MfwIcnAttr*)&idl_Attr[iconServices2],(MfwIcnAttr*)&idl_AttrMask[iconServices2]);
        }
    }
#ifndef ICNTEST	
    if( GlobalIconStatus & GlobalAlarmIconFlag )
        if( state[ iconIdAlarm ].state == ICON_VISIBLE )
#endif
        {
            /* 2004/06 sunsj modify for picture manage */
            DRAW_ICON_SEL_MASK(ICON_IDLESTATE, iconIdAlarm);
            //drawIconByIcnAttr((MfwIcnAttr*)&idl_Attr[iconIdAlarm],(MfwIcnAttr*)&idl_AttrMask[iconIdAlarm]);
            flagsZoneBeDraw |= 0x10;
        }

#ifndef ICNTEST
    if( GlobalIconStatus & GlobalIconTimerFlag )
        if( state[iconIdTimer].state == ICON_VISIBLE )
#endif
        {
            MfwRect area;
            int flag = 0x01;
            /* 2004/06 sunsj modify for picture manage */
            memcpy(&area,&icontable[ICON_IDLESTATE].icon[iconIdGPRSAttached].area/*&idl_Attr[iconIdGPRSAttached].area*/, sizeof(area));
            while( area.px <= icontable[ICON_IDLESTATE].icon[iconIdAlarm].area.px/*idl_Attr[iconIdAlarm].area.px*/ )
            {
                if( (flag & flagsZoneBeDraw) == 0 )
                {
                    break;
                }
                area.px += icontable[ICON_IDLESTATE].icon[iconIdGPRSAttached].area.sx;//idl_Attr[iconIdGPRSAttached].area.sx;
                flag <<= 1;
            }

            if( area.px <= icontable[ICON_IDLESTATE].icon[iconIdAlarm].area.px/*idl_Attr[iconIdAlarm].area.px*/ )
            {
                /* 2004/06 sunsj modify for picture manage */

                DRAW_ICON_ATTRIBUTE(ICON_IDLESTATE, area.px, area.py, iconIdTimer, ICON_MASK|ICON_LOCATION);

                //drawIconByAttrRect(&area,idl_Attr[iconIdTimer].icons,idl_AttrMask[iconIdTimer].icons);
            }
            else
            {
                /* 2004/06 sunsj modify for picture manage */
                DRAW_ICON_SEL_MASK(ICON_IDLESTATE, iconIdTimer);
                //drawIconByIcnAttr((MfwIcnAttr*)&idl_Attr[iconIdTimer],(MfwIcnAttr*)&idl_AttrMask[iconIdTimer]);
            }
        }
}

/*********************************************************************************
$Function:		drawAnimIcons
$Description:	draw Animation Icons
$Author:		talcon 
$History:
*******2003/11/18,talcon create
*********************************************************************************/
U8 drawAnimIcons(MfwIcnAttr *icnAttr,U8 nIndex)
{   
    U8 uNewIndex = nIndex + 1;
    MfwIcnAttr * icnBkg = 0;
    MfwIcnAttr * icnCurrent = 0;

    U8 uloop= 0 ;
    U8 uI;

    if( (icnBkg = icnAttr) == 0 )
    {
        return 0xff;
    }

    //draw bkg
    drawIconByIcnAttr(icnBkg,NULL);

    icnCurrent = icnAttr + 1;

    while( icnCurrent->nIcons && nIndex )
    {
        if( icnCurrent->icons == 0 )
        {
            icnCurrent +=  icnCurrent->nIcons + 1;
            nIndex -- ;
            if( nIndex == 0 )
                break;
        }
        else
            return 0xff;
    }


    if( nIndex || icnCurrent->nIcons == 0 )
    {
        return 0xff;
    }


    //draw anim
    uloop = icnCurrent->nIcons;
    for( uI = 0; uI < uloop ;uI++ )
    {
        drawIconByIcnAttr(++icnCurrent,NULL);
    }

    if( (icnCurrent+1)->nIcons == 0 )
        uNewIndex = 0;
    return uNewIndex;

}
/*******************************************************************************
                                                                              
                                End Of File
                                                                              
*******************************************************************************/

⌨️ 快捷键说明

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