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

📄 o_digest.c

📁 Zoran V966 DVD 解码 Soc芯片的源程序
💻 C
📖 第 1 页 / 共 2 页
字号:
				MS_ClearFocusable(pThis);
				MS_ClearInvisible(pThis);
				break;
			}
			return MsOp; // can not return MS_OP_NONE. need to give clips menu to handle.
		
		case MS_OP_MENU_GET_ITEM_INDEX:
			(*(UINT16 *)lParam) = pDigestItem ->moParam.wIndex;
			return MS_OP_NONE;

		case MS_OP_FOCUS_CHANGE:
			MS_DisplayAddObject(pThis); //change focus refresh focuse changed digest item
            		break;
					
		case MS_OP_UP:  // Because the digest item is invisible so these case no need  enter into MS_BasicContainerOperation
		case MS_OP_DOWN:
			return MsOp;
			
		default :
			break;
	}
	return  MS_BasicContainerOperation(pThis, MsOp, lParam);

}
/***************************************************************************************
*	Function	: 	_DigestItemOperation
*
*	In		:			
*	Out 	:
*	Return	:
*	Desc	: 	This funtion handle unsupport file text operation
****************************************************************************************/
MS_OP _DigestTexTOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
	switch (MsOp)
	{	
		case MS_OP_INIT:
			// Init width and height
			pThis->moArea.mwH = ((MSO_OBJECT __NEAR*)MS_GetParentPtr(pThis)) ->moArea.mwH;
			pThis->moArea.mwW = ((MSO_OBJECT __NEAR*)MS_GetParentPtr(pThis)) ->moArea.mwW;
			MS_SetInvisible(pThis);
			if (lParam != INVALID_PARAM_VALUE)
				break;
			else
				return MS_OP_NONE;
			
		case MS_OP_CORE_UNSUPPORTED_FORMAT:
			MS_ClearInvisible(pThis);
			MS_DisplayAddObject(pThis);
			return MsOp; //Let clips or run time menu to handle this message.

			
		default :
			break;
	}
	return OTEXT_Operation(pThis, MsOp, lParam);
}
/***************************************************************************************
* 	Utility functions
****************************************************************************************/
/***************************************************************************************
*	Function	:	_AddDigestItem
*
*	In		:
*
*	Out 		:
*
*	Desc	:	Add nine digest item to digest component and init their position.
*
*
****************************************************************************************/
void _AddDigestItem(MSO_OBJECT __NEAR*  pThis)
{
	UINT16 wItemIndex;
	MSO_OBJECT __NEAR* pObjectItem; 
	
	for(wItemIndex = 0; wItemIndex < TOTAL_DIGEST_NUM; wItemIndex++) 
	{
		pObjectItem = MS_CreateAndAddObject((MS_DESCRIPTOR*)&oDescriptorDigestItem, (MSO_CONTAINER __NEAR *)pThis);
		((MSO_DIGEST_ITEM __NEAR*)pObjectItem)->moParam.wIndex = wItemIndex;
		//Allocate digest item position.
		MS_ObjectResize(pObjectItem, 
			(pThis ->moArea.mwW - (DIGEST_ITEM_XOFFSET *2) - DIGEST_ITEM_X_DISTANCE * (MAX_DIGEST_COLUMN -1)) /MAX_DIGEST_COLUMN,
			(pThis ->moArea.mwH - (DIGEST_ITEM_YOFFSET*2) - DIGEST_ITEM_Y_DISTANCE * (MAX_DIGEST_ROW -1)) /MAX_DIGEST_ROW);
		MS_ObjectMove(pObjectItem, 
			_GetColumFromIndex(wItemIndex) * (pObjectItem->moArea.mwW + DIGEST_ITEM_X_DISTANCE) + DIGEST_ITEM_XOFFSET,
			_GetRowFromIndex(wItemIndex) * 	(pObjectItem->moArea.mwH + DIGEST_ITEM_Y_DISTANCE) + DIGEST_ITEM_YOFFSET);
	}
}
/***************************************************************************************
*	Function	:	_DigestNavigation
*
*	In		:
*
*	Out 		:
*
*	Desc	:	Handle navgation in digest component when press up/down/left/right button.
*
*
****************************************************************************************/
#pragma argsused
MS_OP _DigestNavigation(MSO_CONTAINER __NEAR* pThis, MS_OP MsOp , UINT32 lParam)
{
	UINT16 wPreFocusIndex;
	UINT16 wNewFocusIndex;
	UINT16 wColumn;
	UINT16 wRow;
	MSO_OBJECT __NEAR* pDigestItem;
	
	MS_SendOperation(MS_GetFocusInContainer(pThis), MS_OP_MENU_GET_ITEM_INDEX, (UINT32)&wPreFocusIndex);
	wRow = _GetRowFromIndex(wPreFocusIndex);
	wColumn  = _GetColumFromIndex(wPreFocusIndex);
	do
	{
		switch (MsOp)
		{
			case MS_OP_RIGHT:
				if (wColumn == (MAX_DIGEST_COLUMN - 1))
				{
					if (wRow == (MAX_DIGEST_ROW - 1))
						return MS_OP_NONE; 
					else
					{
						wRow++;
						wColumn = 0;
					}
				}
				else 
					wColumn++;
				
				break;			
				
			case MS_OP_LEFT:
				if (wColumn == 0)
				{
					if (wRow == 0)
						return MS_OP_NONE;
					else
					{
						wRow--;
						wColumn = MAX_DIGEST_COLUMN -1;
					}	
				}
				else
					wColumn--;
				
				break;
				
			default :
				MS_BREAK_POINT();
				return MS_OP_NONE;
		}
		
		wNewFocusIndex = wRow * MAX_DIGEST_COLUMN + wColumn;
		pDigestItem = _GetObjectFromIndex((MSO_CONTAINER __NEAR*)pThis, wNewFocusIndex);
		if (NULL == pDigestItem)
			break;
		else if (MS_IsFocusable(pDigestItem) && !MS_IsInvisible(pDigestItem))
		{
			//Set Focus to Next Available Digest Item.
			MS_ScreenSetFocusObject(_GetObjectFromIndex((MSO_CONTAINER __NEAR*)pThis, wNewFocusIndex));
			return MS_OP_NONE;
		}
	}
	while (wNewFocusIndex != 0 && wNewFocusIndex != ( TOTAL_DIGEST_NUM -1));
	
	return MS_OP_NONE;	
}
/***************************************************************************************
*	Function	:	_GetObjectFromIndex
*
*	In		:
*
*	Out 		:
*
*	Desc	:	Get digest item pointer according index.
*
*
****************************************************************************************/
MSO_OBJECT __NEAR* _GetObjectFromIndex(MSO_CONTAINER __NEAR* pThis,  UINT16 wIndex)
{
	MSO_DIGEST_ITEM  __NEAR* pObject;

	pObject = (MSO_DIGEST_ITEM  __NEAR*)MS_GetObjectListPtr(pThis);
	while (pObject != NULL)
	{
		if (pObject->moParam.wIndex == wIndex)
			break;
		pObject =  (MSO_DIGEST_ITEM  __NEAR*)(((MSO_OBJECT __NEAR*)pObject)->mpNext);
	}
	return (MSO_OBJECT __NEAR*)pObject;
}

/***************************************************************************************
*	Function	:	_DigestComponentInitFocus
*
*	In		:
*
*	Out 		:
*
*	Desc	:	Set focus to first digest item in digest component.
*
*
****************************************************************************************/
BOOL _DigestComponentInitFocus(MSO_CONTAINER __NEAR* pThis)
{
	MSO_DIGEST_COMPONENT __NEAR*  pDigestComponent =  (MSO_DIGEST_COMPONENT __NEAR*)pThis;
	MSO_OBJECT __NEAR*  pObjectFocus;
	UINT cIndex;
	
	for (cIndex = 0; cIndex < TOTAL_DIGEST_NUM; cIndex ++)
	{
		pObjectFocus = _GetObjectFromIndex(pThis, cIndex);
		if (MS_IsFocusable(pObjectFocus))
			break;
	}
	// If all digest file are unsupported file
	if (TOTAL_DIGEST_NUM != cIndex && pDigestComponent->moParam.mwTotalItems != cIndex)
		MS_ScreenSetFocusObject(pObjectFocus);
	return (NULL != pObjectFocus);	
	
}

/***************************************************************************************
* 	Display functions
****************************************************************************************/
BOOL _DigesetItemFillOsdSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea)
{
	if(MS_IsFocused(pThis))
		OSDR_FillOsdSegBitmapFitArea(BMP_FG_FOCUS, pAbsArea);
   return FALSE;
}

#endif//D_JPEG_DIGEST_SUPPORT

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -