📄 o_tvguardian.c
字号:
break;
default:
break;
}
return MsOp;
}
/***************************************************************************************
* Operation functions of TV Guardian Activation Component.
****************************************************************************************/
/***************************************************************************************
* Function : _TVGuardianActivationOperation
*
* In :
*
* Out :
*
* Desc : MSO_TVGUARDIAN_ACTIVATION user operation function.
****************************************************************************************/
#pragma argsused
static MS_OP _TVGuardianActivationOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
// Pre-processing
switch(MsOp)
{
case MS_OP_OPEN:
{
MSO_OBJECT __NEAR* pButton= MS_CreateAndAddObject((MS_DESCRIPTOR *)&oBackButtonDescriptor,
(MSO_CONTAINER __NEAR *) pThis);
MS_ObjectMove(pButton, (UINT16) AREA_BACK_BUTTON_IN_ACTIVATION_X, (UINT16) AREA_BACK_BUTTON_IN_ACTIVATION_Y);
}
break;
case MS_OP_INIT:
{
MS_ComponentInitFocus((MSO_COMPONENT __NEAR*)pThis);
}
break;
default:
break;
}
return MS_ComponentBasicOperation(pThis, MsOp, lParam);
}
/***************************************************************************************
* Function : _ActivationCodeOperation
*
* In :
*
* Out :
*
* Desc : MSO_ACTIVATION_CODE user operation function.
****************************************************************************************/
#pragma argsused
static MS_OP _ActivationCodeEditOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
switch(MsOp)
{
case MS_OP_0: // Fall Through
case MS_OP_1: // Fall Through
case MS_OP_2: // Fall Through
case MS_OP_3: // Fall Through
case MS_OP_4: // Fall Through
case MS_OP_5: // Fall Through
case MS_OP_6: // Fall Through
case MS_OP_7: // Fall Through
case MS_OP_8: // Fall Through
case MS_OP_9:
case MS_OP_ENTER:
{
MSO_EDIT __NEAR *pEditObject = (MSO_EDIT __NEAR*)pThis;
FORMATED_UNICODE_STRING sFormattedString;
OSDR_GetFormUniStr_ScFormatted((FORMATED_UNICODE_STRING __NEAR*)&sFormattedString,(UINT32)pEditObject->moParam.ScPtr);
if((sFormattedString.mcStrLength >= NBR_ACTIVATION_CODE) && (MS_OP_ENTER != MsOp))
return MS_OP_NONE;
if(MS_OP_ENTER == MsOp)
{
if(NBR_ACTIVATION_CODE== sFormattedString.mcStrLength)
{
UINT8 cIndex;
// lParam is not being used at this point - use it to hold the numeric value of the password
lParam = 0;
for(cIndex = 0; cIndex < sFormattedString.mcStrLength; cIndex++)
{
lParam = (lParam * 10);
lParam += (sFormattedString.mszUniStr[cIndex] - L'0');
}
//check the password
if(!CoreAPI_TVGActivateUnite(lParam))
{
MSO_OBJECT __NEAR* pInvalidCodeTextObject = MS_FindDescendant(MS_GetParentPtr(pThis), &oInvalidCodeTextDescriptor);
MS_SendOperation(pInvalidCodeTextObject, MS_OP_REFRESH, 0);
return MS_OP_NONE;
}
else{
//MS_SEND_OP_OBJECT((MSO_OBJECT __NEAR*)MS_GetParentPtr(MS_GetParentPtr(pThis)), MS_OP_MENU_TVG_SETUP,0);
//return MS_OP_CLOSE_PARENT;
return MS_OP_MENU_TVG_SETUP;
}
}
}
}
break;
}
return EditOperation( pThis, MsOp, lParam);
}
/***************************************************************************************
* Function : _InvalidCodeTextOperation
*
* In :
*
* Out :
*
* Desc : The Invalid code text object user operation function.
****************************************************************************************/
static MS_OP _InvalidCodeTextOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
switch(MsOp)
{
case MS_OP_INIT:
{
MSO_INVALID_CODE __NEAR* pInvalidCodeText = (MSO_INVALID_CODE __NEAR*)pThis;
pInvalidCodeText->moParam.mwTimeOut = INVALID_CODE_TIMEOUT;
}
break;
case MS_OP_REFRESH:
{
MSO_INVALID_CODE __NEAR* pInvalidCodeText = (MSO_INVALID_CODE __NEAR*)pThis;
pInvalidCodeText->moParam.mwTimeOut = INVALID_CODE_TIMEOUT;
MS_ClearInvisible(pThis);
MS_DisplayAddObject(pThis);
}
return MS_OP_NONE;
case MS_OP_TICK:
{
if(!MS_IsInvisible(pThis))
{
MSO_INVALID_CODE __NEAR* pInvalidCodeText = (MSO_INVALID_CODE __NEAR*)pThis;
if(0 == pInvalidCodeText->moParam.mwTimeOut)
{
MSO_OBJECT __NEAR* pObject = MS_FindDescendant(MS_GetParentPtr(pThis), &oTVGActivationCodeEditDescriptor);
MS_SetInvisible(pThis);
MS_DisplayAddObject(pThis);
MS_SendOperation(pObject, MS_OP_CLEAR, 0);
MS_ScreenSetFocusObject(pObject);
}
else
pInvalidCodeText->moParam.mwTimeOut--;
}
}
break;
default:
break;
}
return OTEXT_Operation(pThis, MsOp, lParam);
}
/***************************************************************************************
* Operation functions of TV Guardian Advertisement Component.
****************************************************************************************/
/***************************************************************************************
* Function : _TVGuardianAdvertisementOperation
*
* In :
*
* Out :
*
* Desc : The MSO_TVGUARDIAN_ADVERTISEMENT user operation function.
****************************************************************************************/
static MS_OP _TVGuardianAdvertisementOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
// Pre-processing
switch(MsOp)
{
case MS_OP_INIT:
{
MSO_TVGUARDIAN_ADVERTISEMENT __NEAR* pTVGuardianAdvertisement= (MSO_TVGUARDIAN_ADVERTISEMENT __NEAR*)pThis;
pTVGuardianAdvertisement->mwTimeout= DEFAULT_TIMEOUT;
//the Advertisement component has no focusable objects,set the focus to the component so that it can handle with the user operations
MS_ScreenSetFocusObject(pThis);
}
break;
case MS_OP_TICK:
{
if(!MS_IsInvisible(pThis))
{
MSO_TVGUARDIAN_ADVERTISEMENT __NEAR* pTVGuardianAdvertisement= (MSO_TVGUARDIAN_ADVERTISEMENT __NEAR*)pThis;
if(! pTVGuardianAdvertisement->mwTimeout)
{
MS_SEND_OP_OBJECT(pThis, MS_OP_CLOSE_PARENT, NULL);
return MS_OP_NONE;
}
else
pTVGuardianAdvertisement->mwTimeout--;
}
}
break;
case MS_OP_ENTER:
MsOp=MS_OP_CLOSE_PARENT;
break;
case MS_OP_EJECT:
case MS_OP_SETUP:
MS_SEND_OP_OBJECT(pThis, MS_OP_CLOSE_PARENT, NULL);
break;
default:
break;
}
return MS_ComponentBasicOperation(pThis, MsOp, lParam);
}
/***************************************************************************************
* Function : _TVGuardianAdvertisementTextOperation
*
* In :
*
* Out :
*
* Desc :
****************************************************************************************/
static MS_OP _TVGuardianMultiLineTextOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
MsOp = OMULTILINETEXT_Operation(pThis, MsOp, lParam);
// Post-processing
switch(MsOp)
{
case MS_OP_INIT:
case MS_OP_ON_DEFROST:
{
MS_SendOperation(pThis, MS_OP_BUILD_TEXT_TABLE, 0);
}
break;
default:
break;
}
return MsOp;
}
/***************************************************************************************
* Operation functions of TV Guardian Setup Help Component.
****************************************************************************************/
/***************************************************************************************
* Function : _TVGuardianSetupHelpOperation
*
* In :
*
* Out :
*
* Desc : The MSO_TVGUARDIAN_SETUP_HELP user operation function.
****************************************************************************************/
static MS_OP _TVGuardianSetupHelpOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
// Pre-processing
switch(MsOp)
{
case MS_OP_INIT:
{
MS_ComponentInitFocus((MSO_COMPONENT __NEAR*)pThis);
}
break;
case MS_OP_EJECT:
MS_SEND_OP_OBJECT(pThis, MS_OP_CLOSE_PARENT, NULL);
break;
default:
break;
}
return MS_ComponentBasicOperation(pThis, MsOp, lParam);
}
/***************************************************************************************
* Display functions
****************************************************************************************/
/***************************************************************************************
* Function : _TVGuardianComponentFillOSDSeg
*
* In :
*
* Out :
*
* Desc : MSO_TVGUARDIAN_ADVERTISEMENT display function.
****************************************************************************************/
#pragma argsused
static BOOL _TVGuardianComponentFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea)
{
MS_DESCRIPTOR_TVGUARDIAN_SETUP* pDescriptor = (MS_DESCRIPTOR_TVGUARDIAN_SETUP*)pThis->mpDescriptor;
OSDR_FillOsdSegBitmapFitArea(pDescriptor->mpBgBmp, pAbsArea);
return FALSE;
}
/***************************************************************************************
* Display functions of TV Guardian Setup Component
****************************************************************************************/
/***************************************************************************************
* Display functions of TV Guardian Activation Component
****************************************************************************************/
/***************************************************************************************
* Function : _ActivationCodeFillOSDSeg
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -