📄 mmiicons.c
字号:
static void iconsBattEvent( MfwEvt e, MfwIcn *i )
{
}
/*******************************************************************************
$Function: iconsSignEvent
$Description: handle a signal icon event, empty handler
$Returns: None.
$Arguments: e, event, i, icon
*******************************************************************************/
static void iconsSignEvent( MfwEvt e, MfwIcn *i )
{
}
/*******************************************************************************
$Function: iconsScreenDelete
$Description: Clears the icon area of all currently displayed icons
$Returns: None.
$Arguments: None.
*******************************************************************************/
static void iconsScreenDelete( void )
{
MfwIcnAttr * icnAttr ;
MfwIcnAttr * icn;
U8 bgindex;
UINT32 oldcolor;
oldcolor=dspl_GetBkgColor();
dspl_SetBkgColor( GetGameColor(AZURE));//显示菜单头颜色
//dspl_Clear( 0, 0, 104, 16 ); xsf change 104 to 103 12.10
dspl_Clear( 0, 0, 103, 16 );
dspl_SetBkgColor(oldcolor);
/* 2003/10/30,talcon add */
/*
bgindex=FlashSettingData.BGI;
icnAttr = get_bkgicnAttr(bgindex);
if(icnAttr == NULL)return;
icn = &icnAttr[bgindex];
dspl_BitBlt (icn->area.px,icn->area.py,
icn->area.sx,16,
0,(void *)icn->icons, 0);
*/
/*end talcon */
}//zy change 09/18
/*******************************************************************************
$Function: iconsShowIcon
$Description: display a single icon if it is currently visible
$Returns: None
$Arguments: Icon, pointer to the icon in question
*******************************************************************************/
static void iconsShowIcon( IconState *Icon )
{
if( Icon->state == ICON_VISIBLE )
icnShow( Icon->h );
}
/*******************************************************************************
Public Methods
*******************************************************************************/
/*******************************************************************************
$Function: iconsInit
$Description: Initialise the MMI Icon handling
$Returns: None
$Arguments: None
*******************************************************************************/
void iconsInit()
{
int i;
/* Create and initialise each of the icon state tables, to provide
invisible (initially) icons
*/
for( i = 0; i < idlIdMax; i++ )
{
state[i].state = ICON_INVISIBLE;
/* 2004/06 sunsj modify for picture manage */
state[i].h = icnCreate( 0, GET_ICONATTR(ICON_IDLESTATE, i)/*&idl_Attr[i]*/, E_ICN_VISIBLE, (MfwCb) iconsEvent );
}
/* Battery icons
*/
for( i = 0; i < iconBattMax; i++ )
{
battstate[i].state = ICON_INVISIBLE;
/* 2004/06 sunsj modify for picture manage */
battstate[i].h = icnCreate( 0, GET_ICONATTR(ICON_IDLEBATTERY, i)/*&batt_Attr[i]*/, E_ICN_VISIBLE, (MfwCb) iconsBattEvent );
}
/* 2004/06/21 yhf remove */
//hxl add for power-off charging icon 2002-12-6-------------------------------
/*for (i = 0; i < iconBattMax; i++)
{
Bigbattstate[i].state = ICON_INVISIBLE;
Bigbattstate[i].h = icnCreate( 0, (MfwIcnAttr *)&Bigbatt_Attr[i], E_ICN_VISIBLE, (MfwCb) iconsBattEvent );
}*/
//end of hxl add for power-off charging icon 2002-12-6----------------------------------------
/* end yhf remove */
/* Signal icons
*/
for( i = 0; i < iconSignalMax; i++ )
{
signalstate[i].state = ICON_INVISIBLE;
/* 2004/06 sunsj modify for picture manage */
signalstate[i].h = icnCreate( 0, GET_ICONATTR(ICON_IDLESIGNAL, i)/*&sign_Attr[i]*/, E_ICN_VISIBLE, (MfwCb) iconsSignEvent );
}
/* Scene mode icons //xsf add 2002.08.15 about scene mode
*/
for( i = 0; i < iconSceneMax; i++ )
{
scenestate[i].state = ICON_INVISIBLE;
/* 2004/06 sunsj modify for picture manage */
scenestate[i].h = icnCreate( 0, GET_ICONATTR(ICON_SCENE, i)/*(MfwIcnAttr *)&scene_Attr[i]*/, E_ICN_VISIBLE, (MfwCb) iconsSignEvent );
}
// VolumeIconInit();//zy 2003-04-01
/* Input icons
*/
// for (i = 0; i < inputIdMax; i++)
// {
// inputstate[i].state = ICON_INVISIBLE;
// inputstate[i].h = icnCreate( 0, (MfwIcnAttr *) &inp_Attr[i], E_ICN_VISIBLE, (MfwCb) iconsEvent);
// }
}
/*******************************************************************************
$Function: iconsExit
$Description: Exit the MMI icons handling
$Returns: None.
$Arguments: None.
*******************************************************************************/
void iconsExit( void )
{
int i;
/* Delete all of the icons created during the iconsInit routine
*/
for( i = 0; i < idlIdMax; i++ )
icnDelete( state[i].h );
for( i = 0; i < iconBattMax; i++ )
icnDelete( battstate[i].h );
//hxl add for power-off charging icon 2002-12-6
for( i = 0; i < iconBattMax; i++ )
icnDelete( Bigbattstate[i].h );
//end of hxl add for power-off charging icon 2002-12-6
for( i = 0; i < iconSignalMax; i++ )
icnDelete( signalstate[i].h );
//xsf add 2002.08.15 about scene mode
for( i = 0; i < iconSceneMax; i++ )
icnDelete( scenestate[i].h );
// VolumeIconDel();//zy 2003-04-01
// for ( i = 0; i < inputIdMax; i++ )
// icnDelete( inputstate[i].h );
}
/*******************************************************************************
$Function: iconsChargeDisplayOnOff
$Description: This switches the display on if it is currently off
and the battery is charging
$Returns: None
$Arguments: on, state to set the display, 0 == off, other == on
*******************************************************************************/
void iconsChargeDisplayOnOff( int on )
{
int i;
/* Deal with switching the phone off when the "on" flag is cleared
otherwise we will set the phone on
*/
if( ! on )
{
/* request to turn the display off
*/
TRACE_FUNCTION("Switch Display off");
/* delete the icons and clear the display
*/
for( i = 0; i < iconBattMax; i++ )
icnDelete(battstate[i].h);
dspl_ClearAll();
/* deal with the hardware bits
*/
#if ! defined(WIN32)
scrOnOff( on );
#endif
}
else
{
TRACE_FUNCTION("Switch Display on ");
/* deal with the hardware bits
*/
#if ! defined(WIN32)
scrOnOff( on );
#endif
/* Update the charging icons
*/
for( i = 0; i < iconBattMax; i++ )
{
battstate[i].state = ICON_INVISIBLE;
battstate[i].h = icnCreate(0, GET_ICONATTR(ICON_IDLESTATE, i)/*(batt_Attr+i)*/,
E_ICN_VISIBLE,(MfwCb)iconsBattEvent);
}
/* Show the current status
*/
// iconsStateOfCharge();
}
}
/*******************************************************************************
$Function: iconsStateOfCharge
$Description: Display the text "Charging.." or if battery full the text
"Charging complete". This function is only called when the
mobile switch off
$Returns: None
$Arguments: None
*******************************************************************************/
void iconsStateOfCharge( void )
{
if( globalMobileMode & GlobalCharging )
{
if( globalBatteryMode == GlobalBatteryFull )
PROMPT(16,Mmi_layout_second_line(),0, TxtChargComplete);
else
PROMPT(16,Mmi_layout_second_line(),0, TxtCharging);
}
}
/*******************************************************************************
$Function: iconsGetState
$Description: Get the state of an icon ICON_VISIBLE/ICON_INVISIBLE
$Returns: Return state of icon.
$Arguments: iconId, the id of the icon to be set
*******************************************************************************/
U8 iconsGetState( int iconId )
{
TRACE_FUNCTION("iconsGetState() ");
/* Only set the state if the iconId is valid, ie in range
*/
if( ( iconId >= 0 ) && ( iconId < idlIdMax ) )
return state[iconId].state;
}
/*******************************************************************************
$Function: iconsGetState_Outer
$Description: Get the state of an icon ICON_VISIBLE/ICON_INVISIBLE
$Returns: Return state of icon.
$Arguments: iconId, the id of the icon to be set
$Author: Sunny.
$Date: 2003/03/11
*******************************************************************************/
U8 iconsGetState_Outer( int iconId )
{
TRACE_FUNCTION("iconsGetState() ");
/* Only set the state if the iconId is valid, ie in range
*/
if( ( iconId >= 0 ) && ( iconId < idlIdMax ) )
return state_Outer[iconId].state;
}
/*******************************************************************************
$Function: iconsSetState
$Description: Sets the state of an icon to be visible
$Returns: None
$Arguments: iconId, the id of the icon to be set
*******************************************************************************/
void iconsSetState( int iconId )
{
TRACE_FUNCTION("iconsSetState() ");
/* Only set the state if the iconId is valid, ie in range
*/
if( ( iconId >= 0 ) && ( iconId < idlIdMax ) )
{
state[iconId].state = ICON_VISIBLE;
//2004/03/11 Sunny add
state_Outer[iconId].state = ICON_VISIBLE;
//2004/03/11 Sunny add end
}
}
/*******************************************************************************
$Function: iconsDeleteState
$Description: Sets the state of an icon to be invisible
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -