📄 mmiidle.c
字号:
FlashEnvironmentData.CurrentEnv= scenenum;
//flash_environmentwrite();
}
winShow(idle_data.win);
}*/
SceneSelect_mode = 1; //xsf changed 11.27
idle_data.preSelect_num =0;
if( idleIsFocussed() )
winShow(idle_data.win);
if( idleIsFocussed() )
{/*2003/11/04,talcon add timer handle */
timStop(idle_data.idleanimtimer);
DrawSceneselect_rect();
//timStart(idle_data.idleanimtimer);
}
#endif
break;
case KCD_OK:
// AUI_homepageStart(idle_data.win); //zhaowm 2002.12.28
/*
if(MorethanMaxPressKeyNum(12))
break;
*/
break;
case KCD_0:
case KCD_1:
case KCD_2:
case KCD_3:
case KCD_4:
case KCD_5:
case KCD_6:
case KCD_7:
case KCD_8:
case KCD_9:
case KCD_STAR:
case KCD_HASH:
memset(idle_data.dialshow_buf,'\0',sizeof(idle_data.dialshow_buf));
idle_data.dialshow_buf[0]=editControls[k->code];
idle_dialling_start(idle_data.win,NULL);
break;
case KCD_ABC:
MmiTrace("zym:Charging Key");
//if ( pwr_Status.ChargingVirtualKeyFlag )
batEvent();
break;
case KCD_MNURIGHT:
phonebook_search_flag=FALSE;
ShortCutMnu_Start(idle_data.win);
break;
default:
break;
}
return MFW_EVENT_CONSUMED;
}
/*******************************************************************************
$Function: idle_kbd_long_cb
$Description: Creation of an instance for the Idle dialog.
$Returns:
$Arguments:
*******************************************************************************/
static int idle_kbd_long_cb(MfwEvt e, MfwKbd *k)
{
MMI_TRACE_EVENT(("sunsj-------------idle_kbd_long_cb"));
MMI_TRACE_EVENT(("sunsj-------------e %x", e));
//if ((e & KEY_RIGHT) && (e & KEY_LONG) && (idle_data.right_key_pressed == TRUE))
/* 2004/04/16 sunsj modify */
if( e & KEY_LONG )
{
switch( k->code )
{
case KCD_OK:
AUI_homepageStart(idle_data.win);
break;
case KCD_VOLUP:
MMI_TRACE_EVENT(("sunsj-------------long key of volup"));
if( !HallStatus() )
{
MMI_TRACE_EVENT(("sunsj-------------change outer wallpaper"));
if( FlashSettingData.OutBGI != 3 )
{
FlashSettingData.OutBGI++;
}
else
{
FlashSettingData.OutBGI = 0;
}
/* 2004/05/17 sunsj modify for can not save value of outer wallpaper */
flash_settingwrite();
LedLightnessAdjust(200);
timStart(gtVibator);
drawOuterIdle();
}
break;
case KCD_VOLDOWN:
MMI_TRACE_EVENT(("sunsj-------------long key of volup"));
if( !HallStatus() )
{
MMI_TRACE_EVENT(("sunsj-------------change outer wallpaper"));
if( FlashSettingData.OutBGI != 3 )
{
FlashSettingData.OutBGI++;
}
else
{
FlashSettingData.OutBGI = 0;
}
LedLightnessAdjust(200);
timStart(gtVibator);
drawOuterIdle();
}
break;
default:
MMI_TRACE_EVENT(("sunsj-------------long key of default"));
break;
}
}
return MFW_EVENT_CONSUMED;
}
/*******************************************************************************
$Function: idle_get_window
$Description:
$Returns:
$Arguments:
*******************************************************************************/
MfwHnd idle_get_window (void)
{
return idle_data.win;
}
/*******************************************************************************
$Function: idle_get_edt_window()
$Description:
$Author: Sunny
$Date and Time: 2004-04-12
*******************************************************************************/
MfwHnd idle_get_edt_window (void)
{
return idle_data.edt;
}
/*******************************************************************************
$Function: idle_set_starting_up
$Description: Sets a flag that indicates to Idle that the phone is starting up
$Returns:
$Arguments:
*******************************************************************************/
void idle_set_starting_up (UBYTE set)
{
idle_data.starting_up = set;
}
/*******************************************************************************
$Function: idleIsFocussed
$Description:
$Returns:
$Arguments:
*******************************************************************************/
int idleIsFocussed(void)
{
if( winIsFocussed(idle_data.win) )
{
TRACE_EVENT("idleIsFocussed");
MmiTrace("idleIsFocussed");
return 1;
}
else
return 0;
}
/*******************************************************************************
$Function: addMissedCall
$Description:
$Returns:
$Arguments:
*******************************************************************************/
void addMissedCall(char *num)
{
idle_data.missedCalls++;
//FlashDCTbData.MissedCallNum++; //change to saveNumCallRecord 2002-11-29
timStart(gtimeMissedCall); //xsf add 2002.09.16
// show the info about missed calls on the idle screen
idle_data.clean_screen = FALSE;
windowsUpdate();
}
/*******************************************************************************
$Function: addCBCH
$Description: this indicates the incoming cell-info cellbroadcast
or incoming sms class 0 message
The Status tells about to show or not on the Idle screen
$Returns:
$Arguments:
*******************************************************************************/
void addCBCH(char* cbch_string, UBYTE type)
{
switch( type )
{
case IdleNewCBImmediateMessage:
if( cbch_string NEQ NULL )
{
if( !idle_data.edt )
{
UBYTE old_flag;
old_flag=Set_regflag(0);
idle_data.edt = edtCreate (idle_data.win,&idle_data.edt_attr2,0,0);
Set_regflag(old_flag);
}
memset(idle_data.incoming_cb_msg, 0,sizeof(idle_data.incoming_cb_msg));
memcpy((char *)idle_data.incoming_cb_msg, (char *)cbch_string,MAX_CBMSG_LEN);
edtSetText (idle_data.edt, (char*)idle_data.incoming_cb_msg);
//windowsUpdate();
//this is centralize the cb message if it's a short one
//12 cos CB messages have some space character after the string
//it is just a estimate
/*if ((strlen(cbch_string)) < 12)
idle_data.edt_attr2.win.px = WIN_CENTRALIZE_ORG_X;
else
idle_data.edt_attr2.win.px = WIN_DIALLING_ORG_X;*/
}
else
{
if( idle_data.edt )
{
edtDelete(idle_data.edt);
}
//set the centralize for the cb message to default
idle_data.edt_attr2.win.px = WIN_DIALLING_ORG_X;
idle_data.edt = 0;
memset(idle_data.incoming_cb_msg, 0,sizeof(idle_data.incoming_cb_msg));
}
break;
case IdleNewCBNormalMessage:
//set back to default
idle_data.clean_screen = FALSE;
idle_data.new_cbch = TRUE;
break;
/*NM p019*/
case IdleNewSmsMessage:
if( cbch_string NEQ NULL )
{
if( !idle_data.edt )
{
UBYTE old_flag;
old_flag=Set_regflag(0);
idle_data.edt = edtCreate (idle_data.win,&idle_data.edt_attr3,0,0);
Set_regflag(old_flag);
}
memset(idle_data.incoming_sms_msg, '\0',MAX_MSG_LEN_ARRAY);
memcpy((char *)idle_data.incoming_sms_msg, (char *)cbch_string,MAX_MSG_LEN_ARRAY);
edtSetText (idle_data.edt, (char*)idle_data.incoming_sms_msg);
//strcpy((char *)idle_data.incoming_sms_msg, (char *)cbch_string,);
}
else
{
if( idle_data.edt )
{
edtDelete(idle_data.edt);
}
idle_data.edt = 0;
memset(idle_data.incoming_sms_msg, '\0',MAX_MSG_LEN_ARRAY);
}
break;
}
}
/*******************************************************************************
$Function: statusCBCH
$Description: if True -> keep it on the idle screen
if FALSE -> remove the message (CB or SMS)
and destroy the editor
$Returns:
$Arguments:
*******************************************************************************/
void statusCBCH(UBYTE status)
{
if( status )
{
idle_data.clean_screen = FALSE;
windowsUpdate();
}
else
{
//Dont show the CB on the Idle screen
idle_data.new_cbch = FALSE;
if( idle_data.edt )
edtDelete(idle_data.edt);
idle_data.edt = 0;
//set the centralize for the cb message to default
idle_data.edt_attr2.win.px = WIN_DIALLING_ORG_X;
}
}
/*******************************************************************************
$Function: addSatMessage
$Description: Store a SAT message to display on the idle screen.
$Returns:
$Arguments: satMessage - the text of the message
*******************************************************************************/
void addSatMessage(char *satMessage)
{
/* SPR759 - SH. Create a new sat message */
if( satMessage NEQ NULL )
{
if( !idle_data.edt_sat )
{
idle_data.edt_sat = edtCreate(idle_data.win,&idle_data.edt_attr_sat,0,0); // Create the editor to hold it
}
memset(idle_data.incoming_sat_msg, '\0',MAX_CBMSG_LEN);
strcpy((char *)idle_data.incoming_sat_msg, (char *)satMessage);
//Centralize sat message if below 12 characters (so it doesn't look odd on the screen)
if( (strlen(satMessage)) < 12 )
idle_data.edt_attr_sat.win.px = (SCREEN_SIZE_X-strlen(idle_data.edt_attr_sat.text)*6)/2;
else
idle_data.edt_attr_sat.win.px = WIN_DIALLING_ORG_X;
}
else // If a null string is passed, get rid of the message
{
if( idle_data.edt_sat )
{
edtDelete(idle_data.edt_sat);
}
//set the centralize for the cb message to default
idle_data.edt_attr_sat.win.px = WIN_DIALLING_ORG_X;
idle_data.edt_sat = NULL;
memset(idle
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -