📄 mmiidle.c
字号:
typedef struct
{
T_MMI_CONTROL mmi_control;
T_MFW_HND win; // window handle
T_MFW_HND kbd;
T_MFW_HND kbd_long;
T_MFW_HND menu;
} T_idle_dialling_options;
/*********************************************************************
**********************************************************************
KEYPADLOCKED WINDOW. DECLARATION
*********************************************************************
**********************************************************************/
T_MFW_HND idle_key_pad_locked_create(MfwHnd parent);
void idle_key_pad_locked_destroy (T_MFW_HND own_window);
static int idle_key_pad_locked_kbd_cb (MfwEvt e, MfwKbd *k);
static int idle_key_pad_locked_kbd_long_cb (MfwEvt e, MfwKbd *k);
static int idle_key_pad_locked_win_cb (MfwEvt e, MfwWin *w);
typedef struct
{
T_MMI_CONTROL mmi_control;
T_MFW_HND win; // window handle
T_MFW_HND kbd;
T_MFW_HND kbd_long;
T_MFW_HND edt;
T_MFW_HND win_info; // window handle
UBYTE menuPressed;
UBYTE keyPadLockBuf[KEYPADLOCK_BUF_SIZE];
} T_idle_key_pad_locked;
void idle_key_pad_locked (T_MFW_HND win, USHORT event, SHORT value, void * parameter);
static void (*showKeyPadLocked) (void);
static void showSOSCallKeyPadLocked(void);
void idle_info_destroy_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason);
static void DrawSceneselect_rect(void); //xsf add 11.28
/*********************************************************************
**********************************************************************
Information WINDOW. DECLARATION
*********************************************************************
**********************************************************************/
static int lockTimerEvent(MfwEvt e, MfwTim *t);
static void showPressMenuStar(void);
static void showNothing(void);
T_MFW_HND idle_information_create(MfwHnd parent);
void idle_information_destroy (T_MFW_HND own_window);
static int idle_information_kbd_cb (MfwEvt e, MfwKbd *k);
static int idle_information_kbd_long_cb (MfwEvt e, MfwKbd *k);
static int idle_information_win_cb (MfwEvt e, MfwWin *w);
typedef struct
{
T_MMI_CONTROL mmi_control;
T_MFW_HND win; // window handle
T_MFW_HND parent_win;
T_MFW_HND timer;
T_VOID_FUNC info_cb;
T_MFW_HND kbd;
} T_idle_information;
void idle_information (T_MFW_HND win, USHORT event, SHORT value, void * parameter);
T_MFW_HND idle_information_start(MfwHnd win_parent,S32 time,void (*show)(void),T_VOID_FUNC info_cb);
static void (*showInformation)(void);
static int idle_information_tim_cb(MfwEvt e, MfwTim *t);
static int idle_imei_info_cb(T_MFW_HND win, USHORT identifier, UBYTE reason);
extern UBYTE IsShowGoodbye; //2004-04-23 Sunny add
#if 0
//T_MFW_HND ShowVersion(T_MFW_HND parent_window);
static T_MFW_HND ShowVersion_create(MfwHnd parent_window);
static void ShowVersion_DialogCB(T_MFW_HND win, USHORT e, SHORT identifier, void *parameter);
void ShowVersionSetEditor(T_MFW_HND win);
static void ShowVerionCB (MfwEvt e, MfwKbd *k);
void showVersion_destroy(MfwHnd own_window);
const char * date = "2003.01.27";
const char * ver = "Ver1.88";
const char * label = "Toolbox_gdy_0127";
const char * purpose = "";
#endif
extern U8 LockBand; //xsf add 2002.08.05
extern T_call call_data; //xsf add 11.19
extern UBYTE anim_real_complete; //xsf add 2002.11.26 for idle update when PIN or HOSTKEY is open
extern char CBmid[5];//windy added
//hxl add for charger 29/08/02--------------------------------
#define TIME_BLINK 2000
UBYTE CurrentBatPicNum=0;
UBYTE OlderCurrentBatPicNum=0;
UBYTE BlinkBatPicnum=0;
static MfwHnd gtimeBlink=0;
static UBYTE IsBlinktimerRun=0;//是否在charge
static UBYTE idleisshown=0;
static MfwHnd gtimeMissedCall; //xsf add 2002.09.16 2 lines
#define TIME_MISSEDCALLS 5000 // 60*5s = 5 minute
static UBYTE tim_missedcalls=0; //xsf add 11.14
static UBYTE SceneSelect_mode=0; //xsf add 11.27 for secne mode in idle
static int missedCallEvent (MfwEvt e, MfwTim *t);
static int blinkEvent (MfwEvt e, MfwTim *t);
extern int read_sim_phb_cb(void);
static void batEvent(void);
void GetBatPicnum(void);
static int xpos,ypos;//zy
//end of hxl add for charger 29/08/02--------------------------
//begin of xzy add for test special mode 2002/12/30
#if 0
static T_MFW_HND LayeronePara_create(MfwHnd parent_window);
static void LayeronePara_DialogCB(T_MFW_HND win, USHORT e, SHORT identifier,void *parameter);
//void LayeroneParaSetEditor(T_MFW_HND win);
//static void LayeroneParaCB( T_MFW_HND win, USHORT Identifier,UBYTE reason);
//static int LayeronePara_winCB (T_MFW_EVENT event, T_MFW_WIN * win);
static int LayeronePara_kbd_cb(T_MFW_EVENT event, T_MFW_KBD *keyboard);
static T_MFW_CB showRssi_timercb (T_MFW_EVENT event, T_MFW_TIM *tc);
void LayeronePara_destroy(MfwHnd own_window);
extern void layer1_em_get_rxlevqual(WORD32 *l1_rxlev_scell,WORD32 *l1_rxlev_dedic_sub,WORD32 *l1_rxqual_dedic,WORD32 *l1_rxqual_dedic_sub); //xzy add for test mode 2002/12/30
extern void layer1_em_get_mode(WORD32 *l1_mode);
static T_MFW_HND show_timer; //the timer for show_rssi
static unsigned char refresh_flag; //the flag for need refresh or not
#endif
//end of xzy add for test special mode 2002/12/30
uint8 SimCFReadFlag=0; //hu binhao 2002-12-23 for bug 5110
UBYTE IsMissedCallAndSms = 0; //2004-04-01 Sunny add
//extern int new_sms_index;
extern SHORT g_sms_list_counter;
//Bob added
//indicate ledblink reason
extern MfwHnd ledblink;
extern UBYTE ledblinkflag;
//Bob added to indicate Hall state 01/23
extern driver_Parameter drvpara;
//Bob added to indicate if incoming call or not 01/23
extern BOOL IncallLedisRun;
extern pwr_Status_Type pwr_Status;
/*********************************************************************
**********************************************************************
IDLE WINDOW. IMPLEMENTATION
*********************************************************************
/*******************************************************************************
$Function: idleInit
$Description: init MMI idle handling
$Returns:
$Arguments:
*******************************************************************************/
void idleInit (MfwHnd parent)
{
T_MFW_HND hnd;
winAutoFocus(TRUE);
hnd = idle_create (parent);
}
/*******************************************************************************
$Function: idleExit
$Description: exit MMI idle handling
$Returns:
$Arguments:
*******************************************************************************/
void idleExit (void)
{
idle_destroy (idle_data.win);
}
/*******************************************************************************
$Function: idle_create
$Description: Creation of an instance for the Idle dialog.
$Returns:
$Arguments:
*******************************************************************************/
T_MFW_HND idle_create (T_MFW_HND parent_window)
{
T_idle * data = &idle_data;
T_MFW_WIN * win;
UBYTE result;
TRACE_FUNCTION ("idle_create");
memset(&idle_data,0,sizeof(idle_data));
/*
* Create window handler
*/
data->win = win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)idle_win_cb);
if( data->win EQ 0 )
return 0;
VOS_Idle_Win = data->win;
/*
* These assignments are necessary to attach the data to the window, and to handle the mmi event communication.
*/
data->mmi_control.dialog = (T_DIALOG_FUNC)idle;
data->mmi_control.data = data;
win = ((T_MFW_HDR *)data->win)->data;
win->user = (void *) data;
/*
* Create any other handler
*/
data->kbd = kbd_create (data->win,KEY_ALL|KEY_MAKE,(T_MFW_CB)idle_kbd_cb);
data->kbd_long = kbd_create (data->win,KEY_ALL|KEY_LONG,(T_MFW_CB)idle_kbd_long_cb);
data->edt = 0;
data->edt_sat = 0; /* SPR759 - SH*/
gtimeBlink = timCreate(0,TIME_BLINK,(MfwCb)blinkEvent);//hxl add for charger 29/08/02
gtimeMissedCall = timCreate(0,TIME_MISSEDCALLS,(MfwCb)missedCallEvent); //begin of xsf add timer for missed calls 2002.09.16
//Bob added 01/23
ledblink_begin();
/* 2004/03/30 sunsj modify */
if( Mmi_getCurrentLanguage() == CHINESE_LANGUAGE )
{
/* 2004/01/04 sunsj modify but i don't know the purpose of the editor */
// memset (CBmid, '\0', 5);
editor_attr_init_only(&data->edt_attr2,1, 0, SCREEN_SIZE_X-1, SCREEN_SIZE_Y-dspl_GetFontHeight()-2,2,TxtBroadcast,0,
MAX_CBMSG_LEN+3, edtCurNone,CBmid);
//bookSetEditAttributes(WIN_DIALLING_ORG_X,Mmi_layout_first_line_icons(),120,128,
// 0,0,edtCurNone,0,(char*)data->incoming_cb_msg,MAX_CBMSG_LEN,&data->edt_attr2);
/*NM, p019*/
/* 2004/01/04 sunsj modify but i don't know the purpose of the editor */
editor_attr_init_only(&data->edt_attr3,1, 0, SCREEN_SIZE_X-1, SCREEN_SIZE_Y-dspl_GetFontHeight()-2,2,TxtSRR,(char*)data->incoming_sms_msg,
MAX_MSG_LEN, edtCurNone,0);
//bookSetEditAttributes(WIN_DIALLING_ORG_X,Mmi_layout_first_line_icons(),84,24,
// 0,0,edtCurNone,0,(char*)data->incoming_sms_msg,MAX_MSG_LEN,&data->edt_attr3);
/* SPR759 - SH. Create attributes for SAT editor. */
bookSetEditAttributes(WIN_DIALLING_ORG_X,Mmi_layout_first_line_icons(),84,24,
0,0,edtCurNone,0,(char*)data->incoming_sat_msg,MAX_CBMSG_LEN,&data->edt_attr_sat);
}
else
{
// memset (CBmid, '\0', 5);
editor_attr_init_only(&data->edt_attr2,1, 0, SCREEN_SIZE_X-1, STANDARD_MENU_VERTICAL_SIZE,2,TxtBroadcast,0,
MAX_CBMSG_LEN+3, edtCurNone,CBmid);
//bookSetEditAttributes(WIN_DIALLING_ORG_X,Mmi_layout_second_line_icons(),120,128,
// 0,0,edtCurNone,0,(char*)data->incoming_cb_msg,MAX_CBMSG_LEN,&data->edt_attr2);
/*NM, p019*/
editor_attr_init_only(&data->edt_attr3,1, 0, SCREEN_SIZE_X-1, STANDARD_MENU_VERTICAL_SIZE,2,TxtSRR,(char*)data->incoming_sms_msg,
MAX_MSG_LEN, edtCurNone,0);
//bookSetEditAttributes(WIN_DIALLING_ORG_X,Mmi_layout_second_line_icons(),84,24,
// 0,0,edtCurNone,0,(char*)data->incoming_sms_msg,MAX_MSG_LEN,&data->edt_attr3);
/* SPR759 - SH. Create attributes for SAT editor. */
bookSetEditAttributes(WIN_DIALLING_ORG_X,Mmi_layout_second_line_icons(),84,24,
0,0,edtCurNone,0,(char*)data->incoming_sat_msg,MAX_CBMSG_LEN,&data->edt_attr_sat);
}
/*
* In the new design the are created and automatically shown.
*/
//winShow(data->win); //hxl delete for charger 29/08/02
data->search=FALSE;
data->missedCalls = FlashDCTbData.MissedCallNum; //hu binhao 2002-11-29
data->flagIdle=FALSE;
data->right_key_pressed = FALSE;
addCBCH(NULL, IdleNewCBImmediateMessage);
data->new_cbch= FALSE;
data->clean_screen = FALSE; //for clean the DISPLAY ZONE 3
data->ciphering = DONT_SHOW_CPRS; //use as a default
// data->starting_up = TRUE; /*SPR#1083 JVJ New flag for the start up procedure */
//init the Ciphering indication
result = sim_init_CPRS ((CallbackCPRI) idle_Ciphering, MFW_SIM_CPRI_SHOW );
if( result == FALSE )
TRACE_EVENT("Cant show Ciphering")
/*2003/10/30,talcon add for idle bkg anim timer */
data->idxbkganim = 0;
#ifndef FOR_FTA_CTA
data->idleanimtimer = timCreate ( data->win, idleanim_timeout, (MfwCb)idlebkganim_timer_cb);
#endif
/*end talcon */
/*
* return window handle
*/
return data->win;
}
/*******************************************************************************
$Function: idle_destroy
$Description: Destroy the idle dialog.
$Returns:
$Arguments:
*******************************************************************************/
void idle_destroy (T_MFW_HND own_window)
{
T_MFW_WIN * win;
T_idle * data;
/*
* The destruction of this dialog is trivial, because the information contained is not dynamic. A better example
* of dialog destruction can be found in dialling_destroy
*/
TRACE_FUNCTION ("idle_destroy");
if( own_window )
{
win = ((T_MFW_HDR *)own_window)->data;
data = (T_idle *)win->user;
if( data )
{
/* 2003/10/30,talcon */
timStop(data->idleanimtimer);
timDelete(data->idleanimtimer);
/* end talcon */
//hxl add for charger 29/08/02-----------------
timStop(gtimeBlink);
IsBlinktimerRun=0;
timDelete(gtimeBlink);
//hxl add for charger 29/08/02--------------------
//xsf add for missed calls 2002.09.16
timStop(gtimeMissedCall);
timDelete(gtimeMissedCall);
/*
* Exit Keyboard Handler
*/
/*
* Delete WIN Handler
*/
win_delete (data->win);
data->win=0;
}
}
}
/*******************************************************************************
$Function: idle
$Description: Dialog function for idle top window.
$Returns:
$Arguments:
*******************************************************************************/
void idle (T_MFW_HND win, USHORT event, SHORT value, void * parameter)
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -