📄 mmiidle.c
字号:
U8 * key_code;
T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
T_idle * data = (T_idle *)win_data->user;
/*
* This function is called by the SEND_EVENT macro, when the parameter win is the idle window. the different events
* come from another mmi modules.
*/
TRACE_FUNCTION ("idle()");
switch( event )
{
/*
glowing: add the following statement for processing
the NETWORK_LIMITED_SERVICE
*/
case NETWORK_LIMITED_SERVICE:
GetSignalPicNumber();
data->search=TRUE;
data->nm_status = event;
if( (ledblinkflag==0)&&(drvpara.hallstatusflag == 0)&&(IncallLedisRun==FALSE)&&(pwr_Status.charging_state==0) )
{
MmiTrace("Network is no service");
ledblinkflag=2;
Green_Off();
timStart(ledblink);
MmiTraceInt(ledblinkflag);
}
ledblinkflag=2;
if( idleIsFocussed() && anim_real_complete )
windowsUpdate();
break;
case NETWORK_NO_SERVICE:
case NETWORK_SEARCH_NETWORK:
//Bob added for ledblink 01/23
//Hall is off and no incoming call and no charging and Hall is off
if( (ledblinkflag==0)&&(drvpara.hallstatusflag == 0)&&(IncallLedisRun==FALSE)&&(pwr_Status.charging_state==0) )
{
MmiTrace("Network is no service");
ledblinkflag=2;
Green_Off();
timStart(ledblink);
MmiTraceInt(ledblinkflag);
}
//Bob 02/19
// if((ledblinkflag!=2)&&(ledblinkflag!=0))
ledblinkflag=2;
case NETWORK_NO_PLMN_XXX_AVAIL:
/*
* Network management indicates no or limited service
*/
if( anim_real_complete )
timStart(gtimeMissedCall); //xsf add 11.14
data->nm_status = event;
data->search=TRUE;
//GetSignalPicNumber(); //xzy add for search net work signal pic number update
SetSignalPicNumberZero(); //xzy add for no network update signal pic number
if( idleIsFocussed() && anim_real_complete )
windowsUpdate();
break;
case NETWORK_FULL_SERVICE:
/*
* Network will be searched or is available
*/
//Bob added for led blink 01/23
//Hall is off and no incoming call and no charging and Hall is off
GetSignalPicNumber(); //xzy add for search net work signal pic number update
if( (ledblinkflag==0)&&(drvpara.hallstatusflag == 0)&&(IncallLedisRun==FALSE)&&(pwr_Status.charging_state==0) )
{
MmiTrace("Network is full service");
ledblinkflag=1;
/* 2004/03/15 sunsj remove */
//Red_Off();
timStart(ledblink);
MmiTraceInt(ledblinkflag);
}
//Bob 02/19
// if((ledblinkflag!=1)&&(ledblinkflag!=0))
ledblinkflag=1;
#ifdef MMI_HOMEZONE_ENABLED
if( event==NETWORK_FULL_SERVICE )
homezoneReadSim(HZ_READ_ONCE_ONLY); // Read in homezone data. Will do nothing on repeated calls.
#endif
data->search=FALSE;
data->nm_status = event;
if( (!(FlashEnvironmentData.EnviroProfile[FlashEnvironmentData.CurrentEnv].MissedcallTone) ||
(FlashEnvironmentData.EnviroProfile[FlashEnvironmentData.CurrentEnv].MissedcallTone && (!idle_data.missedCalls)))
&&(!(FlashEnvironmentData.EnviroProfile[FlashEnvironmentData.CurrentEnv].UnreadSMSTone)||
(FlashEnvironmentData.EnviroProfile[FlashEnvironmentData.CurrentEnv].UnreadSMSTone&&(! idle_data.new_sms))) )
timStop(gtimeMissedCall); //xsf add 11.14
if( idleIsFocussed() && anim_real_complete )
windowsUpdate();
//xsf 2002.07.31 for lock band
if( LockBand&&(g_nmService==NM_FULL_SERVICE) )
{
LockBand=0;
nm_restrict_bands(FFS_flashData.Band_restriction);
}
break;
case IDLE_UPDATE:
if( idleIsFocussed() && anim_real_complete )
windowsUpdate();
break;
case IDLE_NEW_SMS:
setOuterState(OUTERIDLESTATE_SMS,1,0);//2004-03-23 Sunny modify
// show the info about incoming sms on the idle screen
idle_data.clean_screen = FALSE;
timStart(gtimeMissedCall); //xsf add 2002.09.17
/*NM, p020*/
if( idleIsFocussed() && anim_real_complete )
windowsUpdate();
break;
#ifdef QQFUNC//hxl add for qq func switch,2003-3-24
case IDLE_NEW_QQ://hxl add for qq info 2003-1-5
// show the info about incoming sms on the idle screen
idle_data.clean_screen = FALSE;
if( idleIsFocussed() && anim_real_complete )
windowsUpdate();
break;
#endif
case IDLE_ACTIVE_KEY_PAD_LOCKED:
/* idle_key_pad_locked_create(win);
windowsUpdate();*/
break;
case IDLE_DETAILS_NUMBER:
idle_dialling_create(win);
windowsUpdate();
break;
case IDLE_START_DIALLING_NUMBER:
key_code = (U8*)parameter;
memset(idle_data.dialshow_buf,'\0',sizeof(idle_data.dialshow_buf));
idle_data.dialshow_buf[0]=editControls[*key_code];
idle_dialling_start(idle_data.win,NULL);
break;
default:
return;
}
}
/*******************************************************************************
$Function: idleExec
$Description:
$Returns:
$Arguments:
*******************************************************************************/
void idleExec (int reason, MmiState next)
{
MmiModuleSet (ModuleIdle); /* Set the global status of Idle */
switch( reason )
{
case IdleNormal: /* enter normal idle mode */
winShow(idle_data.win);
if( FFS_flashData.PLMN_selection_mode == NM_MANUAL ) //xsf add 2003.01.17
network_start_full_service ();
Set_regflag(TRUE);//yq modified 2003/3/17.init finished now we start set flag to record memory
break;
default:
break;
}
}
/*******************************************************************************
$Function: idleEvent
$Description:
$Returns:
$Arguments:
*******************************************************************************/
void idleEvent (int reason)
{
// sprintf(stringTrace,"IDLE event reason: %d",reason);
// TRACE_FUNCTION(stringTrace);
switch( reason )
{
case IdleSearchNetwork:
if( idle_data.win )
SEND_EVENT(idle_data.win,IDLE_NO_NETWORK,0,0);
break;
case IdleUpdate:
if( idle_data.win )
SEND_EVENT(idle_data.win,IDLE_UPDATE,0,0);
break;
case IdleNewSmsMessage:
if( idle_data.win )
SEND_EVENT(idle_data.win,IDLE_NEW_SMS,0,0);
break;
#ifdef QQFUNC//hxl add for qq func switch,2003-3-24
case IdleNewQQMessage://hxl add for qq 2003-1-5
if( idle_data.win )
SEND_EVENT(idle_data.win,IDLE_NEW_QQ,0,0);
break;
#endif
case IdleActiveKeyPadLocked:
if( idle_data.win )
SEND_EVENT(idle_data.win,IDLE_ACTIVE_KEY_PAD_LOCKED,0,0);
break;
case PhbkDetailListToIdle:
if( idle_data.win )
SEND_EVENT(idle_data.win,IDLE_DETAILS_NUMBER,0,0);
break;
default:
break;
}
}
/*******************************************************************************
$Function: winEvent
$Description: window event handler
$Returns:
$Arguments:
$History
GW 03/10/01 - Rewrote to correctly display chinese strings
*******************************************************************************/
extern int gPlayKeytoneFlag;
static int idle_win_cb (MfwEvt e, MfwWin *w)
{
T_CURRENT_NETWORK current_network;
char text[20];
int txtStrId; //Id of text string to be displayed
int txtNo; //Numeric value to be displayed (0=no value)
int xOfs; //used to offset text id when a number is to be displayed
UINT32 oldcolor;//zy add 09/18
UINT32 oldfontcolor;
int8 bgindex;
unsigned char uMode;
//int greetxpos;
TRACE_FUNCTION("idle_win_cb");
MmiTrace("idle_win_cb");
TRACE_EVENT("zy:mfw_IMSI=");
TRACE_EVENT((char *) mfw_IMSI);
if( gPlayKeytoneFlag == 0 ) //2004.2.11 WYJ
gPlayKeytoneFlag = 1;
switch( e )
{
case MfwWinVisible:
/*2003/11/13,talcon modify it */
timStop(idle_data.idleanimtimer);
if( idle_data.isLCDCover!=1 )
{
UBYTE idxbkganimOld = idle_data.idxbkganim;
uMode = dspl_Enable(0);
if( !IsShowGoodbye )
{
drawIdle();
}
dspl_Enable(uMode);
if( idle_data.isLCDCover == 2 )
idle_data.isLCDCover -- ;
if( idxbkganimOld !=idle_data.idxbkganim )
timStart(idle_data.idleanimtimer);
}
break;
case MfwWinFocussed: /* input focus / selected */
case MfwWinDelete: /* window will be deleted */
default:
return MFW_EVENT_REJECTED;
}
return MFW_EVENT_CONSUMED;
}
/*******************************************************************************
$Function: keyEvent
$Description: keyboard event handler
$Returns:
$Arguments:
*******************************************************************************/
static int idle_kbd_cb (MfwEvt e, MfwKbd *k)
{
extern PCCMDSTATUS PcCmdStatus;//chenjun hxl 2003/01/27
extern const char picIndex[];//chenjun add for user defined pic 2003-01-15
static UBYTE right_key_pressed=FALSE;
UBYTE currentRinger = getCurrentRingerSettings();
T_MFW_SMS_STAT sms_idle_list_type = MFW_SMS_MT;
#ifdef QQFUNC//hxl add for qq func switch,2003-3-24
int txtNo; //hxl add for qq 2003-1-5
#endif
char debug[50];
uint8 scenenum = FlashEnvironmentData.CurrentEnv; //xsf add 2002.08.15
uint8 CurrentVol; //xsf add 2002.09.04 2 lines
CurrentVol = FlashEnvironmentData.EnviroProfile[FlashEnvironmentData.CurrentEnv].ringvolume;
TRACE_FUNCTION("idle_kbd_cb");
TRACE_EVENT_P1("Key: %d", k->code);
if( idle_data.starting_up ) /*JVJ Do nothing when starting up */
return 1;
//hxl add to stop the blink timer 0905-------------------
/*timStop(gtimeBlink);
IsBlinktimerRun=0;
GlobalIconStatus = GlobalNothingIconFlag;*/
if( k->code!=KCD_ABC )
{//for dealed the flag when return to idle_win_cb
pwr_Status.ChargingVirtualKeyFlag=1;
//ChargeOffset=0;
MmiTrace("other key");
}
//end of hxl add 0905--------------------------------
if( !animation_complete||!anim_real_complete )
return;
if( !(e & KEY_MAKE) )
{
switch( k->code )
{
case KCD_RIGHT:
break;
// sbh - power key pressed in idle screen, we can shut down
case KCD_POWER:
HUPKeyOrigin = 1;
break;
default:
break;
}
idle_data.right_key_pressed = FALSE;
return MFW_EVENT_CONSUMED;
}
idle_data.right_key_pressed = FALSE;
/*2004/04/09,talcon comment*/
#if 0
if( SceneSelect_mode )
{
switch( k->code )
{
case KCD_VOLUP:
case KCD_VOLDOWN:
case KCD_F3:
case KCD_CALL:
//case KCD_ABC://hxl changed for charging icon show 2002-12-24
return MFW_EVENT_CONSUMED;
case KCD_MNUUP:
case KCD_MNULEFT:
if( idle_data.preSelect_num>0 )
idle_data.preSelect_num--;
else
idle_data.preSelect_num =4;
if( idleIsFocussed() )
{/*2003/11/04,talcon add timer handle */
timStop(idle_data.idleanimtimer);
DrawSceneselect_rect();
//timStart(idle_data.idleanimtimer);
}
return MFW_EVENT_CONSUMED;
case KCD_MNUDOWN:
case KCD_MNURIGHT:
if( idle_data.preSelect_num<4 )
idle_data.preSelect_num++;
else
idle_data.preSelect_num =0;
if( idleIsFocussed() )
{/*2003/11/04,talcon add timer handle */
timStop(idle_data.idleanimtimer);
DrawSceneselect_rect();
//timStart(idle_data.idleanimtimer);
}
return MFW_EVENT_CONSUMED;
case KCD_LEFT:
case KCD_OK:
FlashEnvironmentData.CurrentEnv= idle_data.preSelect_num;
flash_environmentwrite();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -