mso_choice.h

来自「ZORAN 962/966 SOURCE CODE,DVD chip」· C头文件 代码 · 共 240 行

H
240
字号
/***************************************************************************************
*  Copyright (c) 2004 ZORAN Corporation, All Rights Reserved
*  THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ZORAN CORPORATION
*
*  File: $Workfile: o_choice.h $
*
* Description:
* ============
* Project definition of the MSO_CHOICE object.
*
****************************************************************************************/
#ifndef _O_CHOICE_H_
#define _O_CHOICE_H_


/***************************************************************************************
* Include files
****************************************************************************************/
#include "GUI\Menu_system\ms_object.h"
#include "GUI\Menu_system\ms_container.h"
#include "GUI\Object_class\Vlist\mso_vlist.h"

/***************************************************************************************
* 	Public Named Constants
****************************************************************************************/
#define CHOICE_OVERLAP_VALUELIST_W	8

#define mpfMutatorNull					NULL
#define mpDataNull						NULL

#define INVALID_VALUE					0xFFFF

/***************************************************************************************
* 	Public Macros
****************************************************************************************/
// This attribute means that the choice is displayed as a tab.
#define MS_ATTR_CHOICE_DISPLAY_AS_TAB			MS_ATTR_GENERAL_PURPOSE_1
#define MS_SET_CHOICE_DISPLAY_AS_TAB			MS_SetGeneralPurpose1
#define MS_CHOICE_DISPLAY_NORMAL				MS_ClearGeneralPurpose1
#define MS_CHOICE_IS_DISPLAY_AS_TAB			MS_IsGeneralPurpose1

// This attribute controls display of the background of the choice.
#define MS_ATTR_CHOICE_DISPLAY_BG_BMP			MS_ATTR_GENERAL_PURPOSE_2
#define MS_SET_CHOICE_DISPLAY_BG_BMP			MS_SetGeneralPurpose2
#define MS_CLEAR_CHOICE_DISPLAY_BG_BMP		MS_ClearGeneralPurpose2
#define MS_IS_CHOICE_DISPLAY_BG_BMP			MS_IsGeneralPurpose2

// Set this attribute to display the choice as a button. A choice can
// be both a button and a tab.
#define MS_ATTR_CHOICE_DISPLAY_AS_BUTTON		MS_ATTR_GENERAL_PURPOSE_3
#define MS_SET_CHOICE_DISPLAY_AS_BUTTON		MS_SetGeneralPurpose3
#define MS_CLEAR_CHOICE_DISPLAY_AS_BUTTON		MS_ClearGeneralPurpose3
#define MS_IS_CHOICE_DISPLAY_AS_BUTTON		MS_IsGeneralPurpose3

// If you do not want the choice name (+ colon) to be displayed,
// set this attribute.
#define MS_ATTR_CHOICE_NO_NAME_DISPLAY		MS_ATTR_GENERAL_PURPOSE_4
#define MS_SET_CHOICE_NO_NAME_DISPLAY		MS_SetGeneralPurpose4
#define MS_CLEAR_CHOICE_NO_NAME_DISPLAY		MS_ClearGeneralPurpose4
// James: Apologies for the negative in this one:
#define MS_IS_CHOICE_NO_NAME_REQUIRED		MS_IsGeneralPurpose4

// If you want the choice to open when right is pressed (as well as enter),
// set this attribute.
#define MS_ATTR_CHOICE_OPEN_ON_RIGHT_PRESS	MS_ATTR_GENERAL_PURPOSE_5
#define MS_SET_CHOICE_OPEN_ON_RIGHT_PRESS	MS_SetGeneralPurpose5
#define MS_CLEAR_CHOICE_OPEN_ON_RIGHT_PRESS	MS_ClearGeneralPurpose5
#define MS_IS_CHOICE_OPEN_ON_RIGHT_PRESS		MS_IsGeneralPurpose5

#define MS_ATTR_CHOICE_DISABLE				MS_ATTR_GENERAL_PURPOSE_6
#define MS_SET_CHOICE_DISABLE					MS_SetGeneralPurpose6
#define MS_CLEAR_CHOICE_DISABLE				MS_ClearGeneralPurpose6
#define MS_IS_CHOICE_DISABLED					MS_IsGeneralPurpose6

// MSO_LISTITEM specific macros.
#define MS_ATTR_LISTITEM_DISABLE				MS_ATTR_GENERAL_PURPOSE_1
#define MS_SET_LISTITEM_DISABLE				MS_SetGeneralPurpose1
#define MS_CLEAR_LISTITEM_DISABLE				MS_ClearGeneralPurpose1
#define MS_IS_LISTITEM_DISABLED				MS_IsGeneralPurpose1

/***************************************************************************************
* 	Public typdef definitions.
****************************************************************************************/

/***************************************************************************************
*	Structure 	: 	MS_CHOICE_DATA
*
*	Members	: 	1. mwValue 		=	Current value stored in this choice object.
*
*				2. mwOsdMsgIndex	=	Display string of this object.
*
*	Desc 	:	Contains current value, and display name of the MSO_CHOICE object.
****************************************************************************************/
typedef struct ms_choice_data {
	UINT16 			mwValue;			// Actual value.
	OSD_MESSAGES 	mwOsdMsgIndex;	// Index in the table of OSD_MESSAGES
}MS_CHOICE_DATA;

/***************************************************************************************
*	Function	:	pfChoiceMutator
*
*	In		:	pThis	: Pointer to the MSO_CHOICE object.
*
*				eType	: Performs get/set action if the value is eMutatorGet/eMutatorSet respectively.
*
*				wValue 	: For action type eMutatorSet, wValue contains the 
*						  ACTUAL value to be set.
*
*	Out		:	None.
*
*	Return	:	None.
*
*	Desc		: 	Get/Sets value depending on the specified action type.
****************************************************************************************/
typedef enum {
	eMutatorGet,
	eMutatorSet
} enMutatorType;

typedef void (*pfChoiceMutator)(MSO_OBJECT __NEAR* pThis, enMutatorType eType, UINT16 wValue);

/***************************************************************************************
*	Structure 	: 	MS_PARAM_LISTITEM
*
*	Members	: 	See MS_CHOICE_DATA.
*
*	Desc 	:	The MSO_LISTITEM parameters.
****************************************************************************************/
typedef MS_CHOICE_DATA	MS_PARAM_LISTITEM;

/***************************************************************************************
*	Structure 	: 	MS_DESCRIPTOR_LISTITEM
*
*	Members	: 	1. moDescriptor	=	The base of all descriptors.
*
*	Desc 	:	The list item desriptor structure.
****************************************************************************************/
typedef struct ms_descriptor_listitem {
	MS_DESCRIPTOR moDescriptor;
} MS_DESCRIPTOR_LISTITEM;

/***************************************************************************************
*	Structure 	: 	MSO_LISTITEM
*
*	Members	: 	1. moObject 	=	Base of all objects.
*
*				2. moParam	=	List item parameters.
*
*	Desc 	:	The list item structure.
****************************************************************************************/
typedef struct mso_listitem {
	MSO_OBJECT 			moObject;
	MS_PARAM_LISTITEM 	moParam;
} MSO_LISTITEM;

/***************************************************************************************
*	Structure 	: 	MS_PARAM_CHOICE
*
*	Members	: 	1. mwCurrValIndex 	=	Index of the current value. The actual value is strored in a table.
*
*	Desc 	:	The choice parameters.
*
*	Caution 	: 	Please note that this member stores index of the current value and NOT the actual value.
 ****************************************************************************************/
typedef struct ms_param_choice {
	UINT16 		mwCurrValIndex; 
}MS_PARAM_CHOICE;

/***************************************************************************************
*	Structure 	: 	MS_DESCRIPTOR_CHOICE
*
*	Members	: 	1. moDescriptor		=	The base of all descriptors.
*
*				2. mpDescriptorValue	=	Descriptor of objects that represent value for this choice.
*
*				3. mName				= 	Title of this choice.
*
*				4. mcTotalValues		=	Number of items contained in mpData.
*
*				5. mpData			=	List of values.
*
*				6. mwNameTextColor	= 	Color of the name text.
*
*				7. mwValueTextColor	= 	Color of the value text.
*
*				8. mwBgColor			= 	Background color.
*
*				9. mpBgBmp			=	Background bitmap.
*
*				10. mpfMutator		=	The Get / Set function.
*
*	Desc 	:	The choice descriptor.
****************************************************************************************/
typedef struct ms_descriptor_choice {
	MS_DESCRIPTOR 				moDescriptor;
	MS_DESCRIPTOR_LISTITEM*	mpDescriptorValue;		 
	OSD_MESSAGES 				mName;				 
	UINT8 						mcTotalValues;			 
	MS_CHOICE_DATA*			mpData;	
	UINT16						mwNameTextColor;
	UINT16						mwValueTextColor;
	UINT16						mwBgColor;			 
	CONST UINT8* 				mpBgBmp;			 
	pfChoiceMutator				mpfMutator;			 
} MS_DESCRIPTOR_CHOICE;

/***************************************************************************************
*	Structure 	: 	MSO_CHOICE
*
*	Members	: 	1. moObject 	=	Base of all objects.
*
*				2. moParam	=	List item parameters.
*
*	Desc 	:	The choice object.
****************************************************************************************/
typedef struct mso_choice {
	MSO_OBJECT 			moObject;
	MS_PARAM_CHOICE 	moParam;
} MSO_CHOICE;

/***************************************************************************************
* 	Operation functions
****************************************************************************************/

MS_OP ListItemOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
MS_OP ChoiceOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
MS_OP ChoiceNoExpandingOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);

/***************************************************************************************
* 	Display functions
****************************************************************************************/

BOOL ListItemFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea);
BOOL ChoiceFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea);
BOOL OCHOICE_AddItemsToVList(MSO_CHOICE __NEAR* pChoice, MSO_VLIST __NEAR* pList);
UINT8 OCHOICE_GetIndexFromValue(MSO_OBJECT __NEAR* pThis, UINT16 wValue);
UINT16 OCHOICE_GetValueFromIndex(MSO_OBJECT __NEAR* pThis, UINT16 wIndex);

#endif // _O_CHOICE_H_

⌨️ 快捷键说明

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