⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 o_message_battery_state.c

📁 Zoran V966 DVD 解码 Soc芯片的源程序
💻 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 + -