mmiouteridle.c

来自「是一个手机功能的模拟程序」· C语言 代码 · 共 1,532 行 · 第 1/3 页

C
1,532
字号
            outerIdledata.curIcnAttr = (MfwIcnAttr*)AlarmIcns;
            outerIdledata.curIcnAttr_mask = (MfwIcnAttr*)AlarmIcns_mask;
            timStart(outerIdledata.outeridletimer); 
            break;
        case OUTERIDLESTATE_SMS:		
            outerIdledata.nAnimTimes = 9;
            outerIdledata.nIdxAnim = 0;
            outerIdledata.nTotalAnim = sizeof(SmsIcns) / sizeof(MfwIcnAttr);
            outerIdledata.curIcnAttr = (MfwIcnAttr*)SmsIcns;
            outerIdledata.curIcnAttr_mask = (MfwIcnAttr*)SmsIcns_mask;
            timStart(outerIdledata.outeridletimer); 
            break;		
    }*/
    //2004-04-07 Sunny remove
#if 0	
    //get state of highest prior level 
    outerIdledata.nIdleCurState = 0x80000000;
    while( outerIdledata.nIdleCurState )
    {
        if( outerIdledata.nIdleCurState & outerIdledata.nIdleState )
        {
            break;
        }
        outerIdledata.nIdleCurState  >>= 1;
    }

    //MMI_TRACE_EVENT( ("<<<<<<<<<<<talcon,setOuterState:outerIdledata.nIdleCurState:%d",outerIdledata.nIdleCurState) );



    if( flags < outerIdledata.nIdleCurState )//更改位低于当前的优先级,则维持现状,返回
    {
        MMI_TRACE_EVENT( ("<<<<<<<<<<<talcon,setOuterState:flags:%d",flags) );
        return;
    }

    switch( outerIdledata.nIdleCurState )
    {
    case OUTERIDLESTATE_LCDOFF://lcd off
        outerIdledata.nIdleState |= OUTERIDLESTATE_NORMAL;
        outerIdledata.nAnimTimes = 10;
        outerIdledata.nIdxAnim = 0;
        outerIdledata.curIcnAttr = (MfwIcnAttr*)OTLcdOfficns;
        //timStart(outerIdledata.outeridletimer); //2004/03/11 Sunny removed
        break;
        //2004-03-23 Sunny add
    case OUTERIDLESTATE_INCOMING:       
        outerIdledata.nAnimTimes = 10;
        outerIdledata.nIdxAnim = 0;
        outerIdledata.curIcnAttr = (MfwIcnAttr*)OTLcdOfficns;
        //timStart(outerIdledata.outeridletimer); 		
        break;
        //2004-03-23 Sunny add end

        //2004-04-01 Sunny add
    case OUTERIDLESTATE_LOWVOLTAGE:
        outerIdledata.nAnimTimes = 10;
        outerIdledata.nIdxAnim = 0;
        outerIdledata.curIcnAttr = (MfwIcnAttr*)OTLcdOfficns;
        //timStart(outerIdledata.outeridletimer); 		
        break;
    case OUTERIDLESTATE_LOWVOLTAGESWITCHOFF:
        outerIdledata.nAnimTimes = 10;
        outerIdledata.nIdxAnim = 0;
        outerIdledata.curIcnAttr = (MfwIcnAttr*)OTLcdOfficns;
        //timStart(outerIdledata.outeridletimer); 		
        break;      
        //2004-04-01 Sunny add end
    case OUTERIDLESTATE_CALL:       
        outerIdledata.nAnimTimes = -1;
        outerIdledata.nIdxAnim = 0;
        outerIdledata.curIcnAttr = (MfwIcnAttr*)OTCallicns;
        //timStart(outerIdledata.outeridletimer); //2004/03/11 Sunny removed
        break;
    case OUTERIDLESTATE_MISSCALL:       
        outerIdledata.nAnimTimes = 20;
        outerIdledata.nIdxAnim = 0;
        outerIdledata.curIcnAttr = (MfwIcnAttr*)OTMissCallicns;
        //timStart(outerIdledata.outeridletimer); //2004/03/11 Sunny removed
        break;
    case OUTERIDLESTATE_SMS:        
        outerIdledata.nAnimTimes = 20;
        outerIdledata.nIdxAnim = 0;
        outerIdledata.curIcnAttr = (MfwIcnAttr*)OTsmsicns;
        //timStart(outerIdledata.outeridletimer); //2004/03/11 Sunny removed
        break;
    case OUTERIDLESTATE_ALERT:      
        outerIdledata.nAnimTimes = -1;
        outerIdledata.nIdxAnim = 0;
        outerIdledata.curIcnAttr = (MfwIcnAttr*)OTcolckicns;
        //timStart(outerIdledata.outeridletimer); //2004/03/11 Sunny removed
        break;
    case OUTERIDLESTATE_NONE:
        timStop(outerIdledata.outeridletimer);
        break;
    case OUTERIDLESTATE_NORMAL:
        drawOuterIdle();
        break;  
    case OUTERIDLESTATE_LCDON:
        //2004-04-06 Sunny removed.
        //outerIdledata.nIdleState  = OUTERIDLESTATE_NONE;
        //outerIdledata.nIdleCurState = OUTERIDLESTATE_NONE;

        timStop(outerIdledata.outeridletimer);
        break;
    default:
        timStop(outerIdledata.outeridletimer);
        break;
    } 

    drawOuterIdle();//2004/03/11 Sunny add.
    MMI_TRACE_EVENT( ("<<<<<<<<<<<talcon,setOuterState:outerIdledata.nIdleCurState:%d",outerIdledata.nIdleCurState) );
#endif
}

/*********************************************************
$Function:drawOuterIdleZone1
$Description:画icon
$History:
********2003/12/20,talcon add
**********************************************************/
void drawOuterIdleZone1()
{
    int nNewSms=0;

    /* 2004/07/15 sunsj modify */
    if( NotCharingMode == FALSE )
    {
        return;
    }
    //draw signal icon
    iconsShowSignal_Sub(globalSignalPicNumber); 

    //2004-03-10 Sunny add

    //draw missed call icon
    if( FlashDCTbData.MissedCallNum )
    {
        iconsSetState(iconIdMissedCall);    
    }
    else
    {
        iconsDeleteState(iconIdMissedCall); 
    }

    //draw new sms
    smsidle_display_sms_status(&nNewSms); //2004-04-22 Sunny modify	

    //draw other notify icon
    DrawOuterNotifyIcon();

    //draw scene mode
    DrawOuterSeceneMode( FlashEnvironmentData.CurrentEnv );

    //draw charge
    if( (pwr_Status.charger_plugged==0) ||(pwr_Status.charging_state == 0) )
    {
        GetBatPicnum();
        SetChargingIcon_Sub(CurrentBatPicNum);
    }
    else
    {
        SetChargingIcon_Sub( OlderCurrentBatPicNum );
    }

    //2004-03-10 Sunny add end.
}//end drawOuterIdleZone1

/*********************************************************
$Function:drawOuterIdleZone2
$Description:draw text
$History:
********2003/12/23,talcon add
**********************************************************/
void drawOuterIdleZone2()
{
	extern getStringWidth();
    char strDebug[100];
    int startX = 0;
    int hour;
    int week;
    char line[15];  
    char *AmPm; //2004-04-06 Sunny add
	TIMEDATE today;   
	UINT8 weekpositionX;
	UINT8 weekpositionY;
	T_CURRENT_NETWORK current_network;
	int txtStrId;



	/* 2004/06/30 sunsj  remove */
#if 1 //shiheng 0809 modify
    if( outerIdledata.nIdleCurState & OUTERIDLESTATE_INCOMING )
    {
        if( GlobalStatusNeedAnimation & OUTERIDLESTATE_INCOMING )
        {
#if (SUB_LCD_SIZE==5)
			pdspl_colorTextOut((96-get_StringWidth(GlobalPar_Outer))/2,18,DSPL_TXTATTR_WHITE_EDGE,(char *)GlobalPar_Outer,0);
#elif ((SUB_LCD_SIZE==1) || (SUB_LCD_SIZE==6))
			pdspl_colorTextOut((96-get_StringWidth(GlobalPar_Outer))/2,SECOND_LINE,DSPL_TXTATTR_WHITE_EDGE,(char *)GlobalPar_Outer,0);
#endif
		}
        else
        {
            DisplayIncomingCall(GlobalPar_Outer);
        }

        return;
    }

    if( outerIdledata.nIdleCurState & OUTERIDLESTATE_ALERT )
    {
        if( GlobalStatusNeedAnimation & OUTERIDLESTATE_ALERT )
        {
            GetTimeString(line);
            MMI_TRACE_EVENT((line));
            pdspl_colorTextOut((96-get_StringWidth(line))/2,45,DSPL_TXTATTR_WHITE_EDGE,(char *)line,0);         
        }
        else
        {
        }
        return;
    }

    if( outerIdledata.nIdleCurState & OUTERIDLESTATE_SMS )
    {
		 
	//shiheng 0813 remove for outer display	
	//	return;     
    }

    if( outerIdledata.nIdleCurState & OUTERIDLESTATE_LOWVOLTAGESWITCHOFF )
    {
        if( GlobalStatusNeedAnimation & OUTERIDLESTATE_LOWVOLTAGESWITCHOFF )
        {
        }
        else
        {
            draw_popup_background_sub();
            startX = (96-get_StringWidth(MmiRsrcGetText(TxtNoPower)))/2;
            dspl_sub_TextOut(startX,32 +2,DSPL_TXTATTR_TRANSPARENT,MmiRsrcGetText(TxtNoPower));
            startX = (96-get_StringWidth(MmiRsrcGetText(TxtSwitchOff)))/2;
            dspl_sub_TextOut(startX,47 +2,DSPL_TXTATTR_TRANSPARENT,MmiRsrcGetText(TxtSwitchOff));
            //dialog_drawPopIcon_sub(POP_ICONINDICATE);
        }
        return;
    }

    if( outerIdledata.nIdleCurState & OUTERIDLESTATE_LOWVOLTAGE )
    {
        if( GlobalStatusNeedAnimation & OUTERIDLESTATE_LOWVOLTAGE )
        {
        }
        else
        {
            draw_popup_background_sub();
            startX = (96-get_StringWidth(MmiRsrcGetText(TxtNeedCharging)))/2;
            dspl_sub_TextOut(startX,30 +2,DSPL_TXTATTR_TRANSPARENT,MmiRsrcGetText(TxtNeedCharging));        
            //dialog_drawPopIcon_sub(POP_ICONINDICATE);
        }
        return;
    }

    drawOuterIdleMissedCallAndSms(); 

#endif
    /*memset(line,0,sizeof(line) );
    sprintf(line,"%02d/%02d/%04d", currdate.day,currdate.month,currdate.year);
    DisplayOuterDate(line);

    memset(line,0,sizeof(line) );
    GetTimeString(line);
    if( FFS_flashData.time_format == TWELVE_HOUR )
    {
        DisplayOuterTime(line, 0);
    }
    else
    {
        DisplayOuterTime(line, 1);
    }*/

    /* 2004/07/14 sunsj modify */
    if( NotCharingMode == FALSE )
    {
        if( pwr_Status.charger_plugged == 1 )
        {
            if( pwr_Status.charging_state == 0 )
            {
#if (SUB_LCD_SIZE==6)
				
				dspl_sub_TextOut((96-get_StringWidth(MmiRsrcGetText(TxtChargComplete)))/2,30,DSPL_TXTATTR_WHITE_EDGE,MmiRsrcGetText(TxtChargComplete),0);
#endif 
#if (SUB_LCD_SIZE==1)
				
				dspl_sub_TextOut((96-get_StringWidth(MmiRsrcGetText(TxtChargComplete)))/2,30,DSPL_TXTATTR_WHITE_EDGE,MmiRsrcGetText(TxtChargComplete),0);
#endif 
#if (SUB_LCD_SIZE==5)
                dspl_sub_TextOut((96-get_StringWidth(MmiRsrcGetText(TxtChargComplete)))/2,15,DSPL_TXTATTR_WHITE_EDGE,MmiRsrcGetText(TxtChargComplete),0);
#endif            
			}
            else
            {
#if (SUB_LCD_SIZE==6)
                dspl_sub_TextOut((96-get_StringWidth(MmiRsrcGetText(TxtCharging)))/2,30,DSPL_TXTATTR_WHITE_EDGE,MmiRsrcGetText(TxtCharging),0);
#endif 
#if (SUB_LCD_SIZE==1)
                dspl_sub_TextOut((96-get_StringWidth(MmiRsrcGetText(TxtCharging)))/2,30,DSPL_TXTATTR_WHITE_EDGE,MmiRsrcGetText(TxtCharging),0);
#endif
#if (SUB_LCD_SIZE==5)   
				dspl_sub_TextOut((96-get_StringWidth(MmiRsrcGetText(TxtCharging)))/2,15,DSPL_TXTATTR_WHITE_EDGE,MmiRsrcGetText(TxtCharging),0);
#endif	            
			}
            return;
        }
    }
	if(IsMissedCallAndSms == 0)//shiheng 0810 add
	{		
/* 2004/07/12 yhf modify*/
#ifndef _INNOVATION_EMULATOR_
    switch( idle_data.nm_status )
    {
    case NETWORK_FULL_SERVICE : 
        /*NM p032
         set the flag when the TEST SIM is inserted*/
        network_get_name (&current_network);
        if( ( !strcmp((char *)current_network.network_name,"46000") )
            || ( !strcmp((char *)current_network.network_name,"46001") )
            || ( !strcmp((char *)current_network.plmn_name,"CHINA  MOBILE")) 
            || ( !strcmp((char *)current_network.plmn_name,"CHN-CUGSM") )
            || ( !strcmp((char*)current_network.plmn_name, "CMCC"))
            || ( !strcmp((char*)current_network.plmn_name, "CU-GSM")) )
        {
            if( (!strcmp((char *)current_network.network_name,"46000"))||(!strcmp((char *)current_network.plmn_name,"CHINA  MOBILE"))||(!strcmp((char*)current_network.plmn_name, "CMCC")) )
            {
                txtStrId   = T_China_Telecomm;
            }
            else if( (!strcmp((char *)current_network.network_name,"46001"))||(!strcmp((char *)current_network.plmn_name,"CHN-CUGSM"))||(!strcmp((char*)current_network.plmn_name, "CU-GSM")) )
            {
                txtStrId   = T_China_Unicomm;
            }
#if (SUB_LCD_SIZE==6)
			
			dspl_sub_TextOut((100-get_StringWidth((char*)MmiRsrcGetText(txtStrId)))/2,16,DSPL_TXTATTR_WHITE_EDGE,(char*)MmiRsrcGetText(txtStrId));
#endif
#if (SUB_LCD_SIZE==1)
			
			dspl_sub_TextOut((100-get_StringWidth((char*)MmiRsrcGetText(txtStrId)))/2,16,DSPL_TXTATTR_WHITE_EDGE,(char*)MmiRsrcGetText(txtStrId));
#endif
#if (SUB_LCD_SIZE==5)
#endif        
		}
        else
        {
            if( current_network.plmn_name[0]!= NULL )   //xsf add for avoid display plmn_name "0000" 12.18
            {
#if (SUB_LCD_SIZE==6)
				dspl_sub_TextOut((100-get_StringWidth((char*)current_network.plmn_name))/2,16,DSPL_TXTATTR_WHITE_EDGE,(char*)current_network.plmn_name);
#endif  
#if (SUB_LCD_SIZE==1)
				dspl_sub_TextOut((100-get_StringWidth((char*)current_network.plmn_name))/2,16,DSPL_TXTATTR_WHITE_EDGE,(char*)current_network.plmn_name);
#endif 
#if (SUB_LCD_SIZE==5)
#endif           
			}
            else
            {
#if (SUB_LCD_SIZE==6)
				dspl_sub_TextOut((100-get_StringWidth(MmiRsrcGetText(TxtNoNetwork)))/2,16,DSPL_TXTATTR_WHITE_EDGE,MmiRsrcGetText(TxtNoNetwork));		
#endif  
#if (SUB_LCD_SIZE==1)
				dspl_sub_TextOut((100-get_StringWidth(MmiRsrcGetText(TxtNoNetwork)))/2,16,DSPL_TXTATTR_WHITE_EDGE,MmiRsrcGetText(TxtNoNetwork));		
#endif 
#if (SUB_LCD_SIZE==5)
#endif            
			}
	}
        break;
    case NETWORK_LIMITED_SERVICE :
    case NETWORK_SEARCH_NETWORK :
    case NETWORK_NO_SERVICE :
    case NETWORK_NO_PLMN_XXX_AVAIL:
	case 0:
        break;		
    default:
        break;	/* 2004/07/15 sunsj modify */
    }
#endif 
/* end of yhf modify */     

	GetTimeDate(currdate.year, currdate.month, currdate.day, &today);  //xsf add for get weekday 12.06
	sprintf(line,"%02d/%02d",today.day,today.month);//,(today.year%100)/10,today.year%1000); //zgz, 2002.8.23 
	set_sub_font_type(UNI12X12_FONT);//yhf	add
#if (SUB_LCD_SIZE==6)
	
	dspl_sub_TextOut(0,50,DSPL_TXTATTR_WHITE_EDGE,(char *)line);
#endif
#if (SUB_LCD_SIZE==1)
	
	dspl_sub_TextOut(0,50,DSPL_TXTATTR_WHITE_EDGE,(char *)line);
#endif
	set_sub_font_type(UNI12X12_FONT);//yhf	

	if( FFS_flashData.time_format == TWELVE_HOUR )
	{
		if( currclock.hour / 12 )
		{
			if( FFS_flashData.language==0 )
				AmPm = "PM";
			else
				AmPm = "PM";	/* 2004/04/10 sunsj modify */
		}
		else
		{
			if( FFS_flashData.language==0 )
				AmPm = "AM";
			else
				AmPm = "AM";	/* 2004/04/10 sunsj modify */
		}
		if( currclock.hour>12 )
		{
			hour=currclock.hour-12;
		}
		else if( currclock.hour==0 )
		{
			hour=12;
		}
		else
		{
			hour=currclock.hour;
		}   
		sprintf(line,"%02d:%02d%s",hour,currclock.min, AmPm); //zgz, 2002.8.23  	   
	}
	else
		sprintf(line,"%02d:%02d",currclock.hour,currclock.min);

	if(FFS_flashData.time_format == TWELVE_HOUR)
	{
		DisplayOuterTime(line, 0);
	}
	else
	{
		DisplayOuterTime(line, 1);
	}
	//dspl_sub_TextOut(30,25,DSPL_TXTATTR_WHITE_EDGE,(char *)line);
	set_sub_font_type(UNI12X12_FONT);//yhf	
	if( FFS_flashData.language==0 )
	{
		switch( today.week ) //xsf add for get weekday 12.06
		{
#if ((SUB_LCD_SIZE==6) || (SUB_LCD_SIZE==1) )
			
		case 0:
			dspl_sub_TextOut(57,50,DSPL_TXTATTR_WHITE_EDGE,(char*)GET_TEXT(TxtSunday));
			break;
		case 1:
			dspl_sub_TextOut(57,50,DSPL_TXTATTR_WHITE_EDGE,(char*)GET_TEXT(TxtMonday));
			break;
		case 2:
			dspl_sub_TextOut(57,50,DSPL_TXTATTR_WHITE_EDGE,(char*)GET_TEXT(TxtTuesday));
			break;
		case 3:
			dspl_sub_TextOut(57,50,DSPL_TXTATTR_WHITE_EDGE,(char*)GET_TEXT(TxtWednesday));
			break;
		case 4:
			dspl_sub_TextOut(57,50,DSPL_TXTATTR_WHITE_EDGE,(char*)GET_TEXT(TxtThursday));
			break;
		case 5:
			dspl_sub_TextOut(57,50,DSPL_TXTATTR_WHITE_EDGE,(char*)GET_TEXT(TxtFriday));
			break;
		case 6:
			dspl_sub_TextOut(57,50,DSPL_TXTATTR_WHITE_EDGE,(char*)GET_TEXT(TxtSaturday));
			break;

#endif
#if (SUB_LCD_SIZE==5)
#endif
		default:
			break;
		}	
	}
	else
	{
		switch( today.week ) //xsf add for get weekday 12.06
		{
		case 0:
			sprintf(line,"%s","Sunday");
			break;
		case 1:
			sprintf(line,"%s","Monday");
			break;
		case 2:
			sprintf(line,"%s","Tuesday");
			break;
		case 3:
			sprintf(line,"%s","Wednesday");
			break;
		case 4:
			sprintf(line,"%s","Thursday");
			break;
		case 5:
			sprintf(line,"%s","Friday");
			break;
		case 6:
			sprintf(line,"%s","Saturday");
			break;
		default:
			break;
		}
#if (SUB_LCD_SIZE==6)
		dspl_sub_TextOut(96 - get_StringWidth(line),50,DSPL_TXTATTR_WHITE_EDGE,(char *)line);

⌨️ 快捷键说明

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