?? o_message_battery_state.c
字號:
/****************************************************************************************************
* Copyright (c) 2005 ZORAN Corporation, All Rights Reserved
* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ZORAN CORPORATION
*
* File: o_message_battery_state.c
*
* Description:
* =========
* This is the basic message-handler object, from which the other (specific)
* message handlers are derived. It is unlikely that this object type would
****************************************************************************************************/
#ifdef D_GUI_MESSAGE_BATTERY_STATE
/****************************************************************************************************
* DECLARATION: Public functions
****************************************************************************************************/
MS_OP OMESSAGE_BATTERY_STATE_Operation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
/***************************************************************************************
* Include customization file.
****************************************************************************************/
// Include custom code file: customer specific code, over-writing common one.
#include "Components\Custom\Message\o_message_battery_state_custom.c"
/****************************************************************************************************
* DEFINITION: Private named constants
****************************************************************************************************/
/****************************************************************************************************
* DEFINITION: Private macros
****************************************************************************************************/
/****************************************************************************************************
* DEFINITION: Private typedefs
****************************************************************************************************/
/****************************************************************************************************
* DEFINITION: Public (global) variables
****************************************************************************************************/
/****************************************************************************************************
* DEFINITION: Private (static) variables
****************************************************************************************************/
/****************************************************************************************************
* DECLARATION: Private (static) functions
****************************************************************************************************/
//static CONST UINT8* _GetBatteryStateIcon(void);
/****************************************************************************************************
* DEFINITION: Public functions
****************************************************************************************************/
/****************************************************************************************************
* Function : OMESSAGE_Operation
*
* Input : Parameter_1 - description
* Parameter_2 - description
*
* Output : Parameter_3 - description
* Parameter_4 - description
*
* Return : Describe_possible_returned_values_and_their_meaning
*
* Description : Describe_what_the_function_does_in_English
*
****************************************************************************************************/
MS_OP OMESSAGE_BATTERY_STATE_Operation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
MSO_MESSAGE_BATTERY_STATE __NEAR* pObjectBS = (MSO_MESSAGE_BATTERY_STATE __NEAR*)pThis;
MS_DESCRIPTOR_MESSAGE_BATTERY_STATE *pDescriptorBS = (MS_DESCRIPTOR_MESSAGE_BATTERY_STATE*)pThis->mpDescriptor;
MSO_MESSAGE __NEAR* pMessage = (MSO_MESSAGE __NEAR*)pThis;
FORMATED_UNICODE_STRING oFormUniStr;
// Initialize oFormUniStr, if no font index, then OSDR_GetFormUniStr_OsdMessage will be wrong
oFormUniStr.mtFontIndex = FONT_MESSAGE;
oFormUniStr.mszUniStr[0] = 0;
switch(MsOp)
{
case MS_OP_ON_DEFROST:
case MS_OP_INIT:
pObjectBS->moParam.mwBlinkTimer = pDescriptorBS->mwBlinkTimer;
pMessage->moParam.mwTimer = 0;
break;
case MS_OP_TICK:
if(pMessage->moParam.mwCoreTimer)
break;
if (pMessage->moParam.mMsOpMsg == MS_OP_MSG_BATTERY_STATE)
{
// If displaying the message while battery is ok, then clear message
if (BATTERY_FULL == CoreAPI_GetBatteryState())
{
pMessage->moParam.mwTimer = 1;
}
else
{
// Blinking of the low battery message
if(pObjectBS->moParam.mwBlinkTimer)
{
pObjectBS->moParam.mwBlinkTimer--;
if (0 == pObjectBS->moParam.mwBlinkTimer)
{
if (MS_IsInvisible(pThis))
MS_ClearInvisible(pThis);
else
MS_SetInvisible(pThis);
MS_DisplayAddObject(pThis);
pObjectBS->moParam.mwBlinkTimer = pDescriptorBS->mwBlinkTimer;
}
}
}
}
// The meaage is not displayed yet, then if should be displayed, display it
else if (BATTERY_LOWER == CoreAPI_GetBatteryState())
{
_DisplayMessageOnTick(pThis, MS_OP_MSG_BATTERY_STATE, 0);
pObjectBS->moParam.mwBlinkTimer = pDescriptorBS->mwBlinkTimer;
}
break;
case MS_OP_MSG_BATTERY_STATE:
pMessage->moParam.mMsOpMsg = MsOp;
pMessage->moParam.mwTimer = OMESSAGE_INFINITE_TIMEOUT;
pMessage->moParam.mpIcon = BMP_MESSAGE_BATTERY_STATE;
OSDR_GetFormUniStr_OsdMessage((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, (UINT32) S_NULL);
MsOp = MS_OP_MSO_MESSAGE_BUILD;
lParam = (UINT32)&oFormUniStr;
break;
default:
break;
}
return OMESSAGE_Operation(pThis, MsOp, lParam);
}
/****************************************************************************************************
* DEFINITION: Private functions
****************************************************************************************************/
#endif//D_GUI_MESSAGE_BATTERY_STATE
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -