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

📄 container_misc.c

📁 ZORAN 962/966 SOURCE CODE,DVD chip
💻 C
字号:
/* **************************************************************************************
*  Copyright (c) 2005 ZORAN Corporation, All Rights Reserved
*  THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ZORAN CORPORATION
*
*  File: $Workfile: Container_misc.c$
*
* Description:
* ========
*
****************************************************************************************/

#include "Config.h"				// Global Configuration - do not remove!
#include "include\sysdefs.h"

#include "Library\Container_misc.h"
#include "GUI\Resource\Bitmap\bitmap.h"

#include "GUI\Menu_system\ms_object.h"
#include "GUI\Menu_system\osd_rendering.h"

/**************************************************************************
*	Function : _ContainerFillOsdSeg
*	In		:
*	Out 	:
*	Desc	: Fill the container with the specified background image.
***************************************************************************/
BOOL CMisc_ContainerStandardBackgroundFill(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pThisAbsArea)
{
	// To avoid compiler warning:
    pThis = pThis;
    
	// Fill the container with the standard background image.
	OSDR_FillOsdSegBitmap(	BMP_BG_1,
    						pThisAbsArea,
                            0,0,
                            ALIGN_H_LEFT,
                            ALIGN_V_TOP,
                            ((MS_AREA __NEAR*)pThisAbsArea)->mwW,
                            ((MS_AREA __NEAR*)pThisAbsArea)->mwH);
	return FALSE;
}

INT16 CMisc_OffsetToAlignObjectInContainer(	INT8 iAlignment,
                                            INT16 iObject,
                                            INT16 iContainer)
{
	INT16 retval;

// This function assumes the following...
#if ((ALIGN_H_LEFT != ALIGN_V_TOP) || (ALIGN_H_CENTER != ALIGN_V_CENTER) || (ALIGN_H_RIGHT != ALIGN_V_BOTTOM))
#error "Definition change - this function needs re-writing"
#endif


    switch(iAlignment)
    {
    	case ALIGN_H_LEFT:	// or ALIGN_V_TOP:
        	// No offset required.
            retval = 0;
        	break;

    	case ALIGN_H_CENTER:	// or ALIGN_V_CENTER:
            if(iObject == iContainer)
            {
                // The widths/heights are the same - no offset required.
                retval = 0;
            }
            else if(iObject > iContainer)
            {
                // The object is bigger than the container. We will return a negative number.
                retval = 0 - ((iContainer - iObject) / 2);
            }
            else
            {
                retval = ((iContainer - iObject) / 2);
            }
            break;

        case ALIGN_H_RIGHT:	// or ALIGN_V_BOTTOM:
        	if(iObject == iContainer)
            {
                // The widths/heights are the same - no offset required.
                retval = 0;
            }
            else
            {
                retval = (iContainer - iObject);
            }
            break;
    }

    return(retval);
}

⌨️ 快捷键说明

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