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

📄 osddg.c

📁 ct952 source code use for Digital Frame Photo
💻 C
📖 第 1 页 / 共 3 页
字号:
//  Side Effect :   none.//  Notes       :   //*********************************************************************************************************WORD _OSDDG_DLG_GetDlgHeight(void){    _wOSDDGTemp1 = 0;    for (_bOSDDGTemp = 0; _bOSDDGTemp < OSDDG_DLG_BUTTON_NUM; _bOSDDGTemp++)    {        _wOSDDGTemp1 += OSDDG_DLG_BUTTON_HEIGHT;    }    _wOSDDGTemp1 += OSDDG_DLG_BUTTON_BUTTON_DISTANCE_V * (OSDDG_DLG_BUTTON_NUM - 1);    _wOSDDGTemp1 += (OSDDG_DLG_BACKGROUND_BUTTON_DISTANCE_V << 1);    return _wOSDDGTemp1;}//***************************************************************************//  Function    :   _OSDDG_DLG_UpdateBackground//  Abstract    :   This function will draw/clear the dialog background.//  Arguments   :   bUpdate: OSDDG_DRAW/OSDDG_CLEAR.//  Return		:   none.//  Side Effect :   none.//  Notes       :   //***************************************************************************void _OSDDG_DLG_UpdateBackground(BYTE bUpdate){    if (bUpdate == OSDDG_DRAW)        _OSDDLGRect.bColor = OSDDG_PALETTE_ENTRY_DLG_BACKGROUND;        else        _OSDDLGRect.bColor = PAL_ENTRY_COLOR_TRANSPARENT;        _OSDDLGRect.rect.wLeft = _OSDDLGAttribute.wStartH;    _OSDDLGRect.rect.wTop = _OSDDLGAttribute.wStartV;    _OSDDLGRect.rect.wRight = _OSDDLGRect.rect.wLeft + _OSDDLGAttribute.wWidth;    _OSDDLGRect.rect.wBottom = _OSDDLGRect.rect.wTop+_OSDDLGAttribute.wHeight;    GDI_FillRoundRect(0, OSDDG_DLG_ARC_VALUE, &_OSDDLGRect);    //Fill the frame of round rectangle    if (bUpdate == OSDDG_DRAW)        _OSDDLGRect.bColor = OSDDG_PALETTE_ENTRY_DLG_FRAME;    else        _OSDDLGRect.bColor = PAL_ENTRY_COLOR_TRANSPARENT;    _OSDDLGRect.rect.wLeft -= OSDDG_DLG_OUTER_INNER_ARC_PIXEL;    _OSDDLGRect.rect.wTop -= OSDDG_DLG_OUTER_INNER_ARC_PIXEL;    _OSDDLGRect.rect.wRight += OSDDG_DLG_OUTER_INNER_ARC_PIXEL;    _OSDDLGRect.rect.wBottom += OSDDG_DLG_OUTER_INNER_ARC_PIXEL;    GDI_DrawRoundRect(0, OSDDG_DLG_OUTER_ARC_VALUE, OSDDG_DLG_ARC_VALUE, &_OSDDLGRect);}//*********************************************************************************************************//  Function    :   _OSDDG_DLG_DrawButton//  Abstract    :   This function will draw the button.//  Arguments   :   bIndex: the index of the button. bButtonState: The state of the button.  //  Return		:   none.//  Side Effect :   none.//  Notes       :   //*********************************************************************************************************void _OSDDG_DLG_DrawButton(BYTE bIndex, BYTE bHightlight){        _wOSDDLGButtonWidth = _OSDDG_DLG_GetMaxButtonWidth();    if (bHightlight) //Highlighted button state    {        _OSDDLGRect.bColor = OSDDG_PALETTE_ENTRY_DLG_HIGHLIGHT_BUTTON_BACKGROUND;        _OSDDLGStringAttr.bBackground = OSDDG_PALETTE_ENTRY_DLG_HIGHLIGHT_BUTTON_BACKGROUND;        _OSDDLGStringAttr.bTextColor = OSDDG_PALETTE_ENTRY_DLG_HIGHLIGHT_BUTTON_STRING;    }    else //Normal button state. Enabled/Disabled.    {        if (__DigestUIAttr.bButtonEnable[bIndex] == 1)        {            _OSDDLGRect.bColor = OSDDG_PALETTE_ENTRY_DLG_ENABLE_BUTTON_BACKGROUND;            _OSDDLGStringAttr.bBackground = OSDDG_PALETTE_ENTRY_DLG_ENABLE_BUTTON_BACKGROUND;            _OSDDLGStringAttr.bTextColor = OSDDG_PALETTE_ENTRY_DLG_ENABLE_BUTTON_STRING;        }        else        {            _OSDDLGRect.bColor = OSDDG_PALETTE_ENTRY_DLG_DISABLE_BUTTON_BACKGROUND;            _OSDDLGStringAttr.bTextColor = OSDDG_PALETTE_ENTRY_DLG_DISABLE_BUTTON_STRING;            _OSDDLGStringAttr.bBackground = OSDDG_PALETTE_ENTRY_DLG_DISABLE_BUTTON_BACKGROUND;        }    }    _OSDDLGRect.rect.wLeft = _OSDDLGAttribute.wStartH+OSDDG_DLG_BACKGROUND_BUTTON_DISTANCE_H;    _OSDDLGRect.rect.wTop = _OSDDLGAttribute.wStartV+OSDDG_DLG_BACKGROUND_BUTTON_DISTANCE_V+(bIndex*(OSDDG_DLG_BUTTON_HEIGHT+OSDDG_DLG_BUTTON_BUTTON_DISTANCE_V));    _OSDDLGRect.rect.wRight = _OSDDLGRect.rect.wLeft+_wOSDDLGButtonWidth;    _OSDDLGRect.rect.wBottom = _OSDDLGRect.rect.wTop+OSDDG_DLG_BUTTON_HEIGHT;    GDI_FillRoundRect(0, OSDDG_DLG_ARC_VALUE, &_OSDDLGRect);    //Fill the frame of round rectangle    _OSDDLGRect.bColor = OSDDG_PALETTE_ENTRY_BUTTON_FRAME;    _OSDDLGRect.rect.wLeft -= OSDDG_BUTTON_OUTER_INNER_ARC_PIXEL;    _OSDDLGRect.rect.wTop -= OSDDG_BUTTON_OUTER_INNER_ARC_PIXEL;    _OSDDLGRect.rect.wRight += OSDDG_BUTTON_OUTER_INNER_ARC_PIXEL;    _OSDDLGRect.rect.wBottom += OSDDG_BUTTON_OUTER_INNER_ARC_PIXEL;    GDI_DrawRoundRect(0, OSDDG_BUTTON_OUTER_ARC_VALUE, OSDDG_BUTTON_ARC_VALUE, &_OSDDLGRect);    //Fill string    _OSDDG_DLG_FillButtonString(bIndex);    _OSDDLGStringAttr.bShadow1 = PAL_ENTRY_COLOR_TRANSPARENT;    _OSDDLGStringAttr.bShadow2 = PAL_ENTRY_COLOR_TRANSPARENT;    _OSDDLGStringAttr.bColorKey = 0;    _OSDDLGStringAttr.wX = _OSDDLGRect.rect.wLeft + OSDDG_BUTTON_OUTER_INNER_ARC_PIXEL+((_wOSDDLGButtonWidth - GDI_GetStringWidth_909(__pOSDUTLOutputString)) >> 1);    _OSDDLGStringAttr.wY = _OSDDLGRect.rect.wTop + OSDDG_BUTTON_OUTER_INNER_ARC_PIXEL+((OSDDG_DLG_BUTTON_HEIGHT - GDI_GetStringHeight_909(__pOSDUTLOutputString)) >> 1);            GDI_DrawString_909(0, &_OSDDLGStringAttr, __pOSDUTLOutputString);}//***************************************************************************//  Function    :   _OSDDG_Initial//  Abstract    :   This function will be called when entering the Digest's main //              :   menu at the first time.//  Arguments   :   none.//  Return		:   none.//  Side Effect :   none.//  Notes       :   //***************************************************************************void _OSDDG_Initial(void){    //Must initialize GDI because it may be covered by other UI like SETUP.    _OSDDG_InitializeGDI();    //Set the attributes for normal upper message and normal bottom message.    _OSDDG_InitializeNDAttribute();    //Draw the title    _OSDDG_DisplayTitle();    //Draw the page info.    _OSDDG_DisplayPageInfo();    //Draw the info. region    _OSDDG_DrawInfoRegion();    //Draw the buttons.    for (_bOSDDGTemp = 0; _bOSDDGTemp < OSDDG_BUTTON_NUM; _bOSDDGTemp++)    {        _OSDDG_DrawButton(_bOSDDGTemp, FALSE);    }    //Set the frame's tuning position.    _OSDDG_TuneFramePosition();}//***************************************************************************//  Function    :   _OSDDG_InitializeStringTransparentAttr//  Abstract    :   This function will set the common attributes of transparent//              :   part for string output.//  Arguments   :   none.//  Return		:   none.//  Side Effect :   none.//  Notes       :   //***************************************************************************void _OSDDG_InitializeStringTransparentAttr(void){    _OSDDGStringAttr.bBackground = PAL_ENTRY_COLOR_TRANSPARENT;    _OSDDGStringAttr.bColorKey = 0;    _OSDDGStringAttr.bShadow1 = PAL_ENTRY_COLOR_TRANSPARENT;    _OSDDGStringAttr.bShadow2 = PAL_ENTRY_COLOR_TRANSPARENT;}//***************************************************************************//  Function    :   _OSDDG_DisplayTitle//  Abstract    :   This function will display the title.//  Arguments   :   none.//  Return		:   none.//  Side Effect :   none.//  Notes       :   //***************************************************************************void _OSDDG_DisplayTitle(void){    switch (__DigestUIAttr.bDigestMode)    {    case DIGEST_MODE_TRACK: //Track Digest        __pOSDUTLOutputString = aDGTitleTrackDigest;        break;    case DIGEST_MODE_DISCINTERVAL: //Disc Interval        __pOSDUTLOutputString = aDGTitleDiscInterval;        break;    default:        return;    }    _OSDDG_InitializeStringTransparentAttr();    _OSDDGStringAttr.bTextColor = OSDDG_PALETTE_ENTRY_TITLE_STRING;    _OSDDGStringAttr.wX = OSDDG_TITLE_START_H;    _OSDDGStringAttr.wY = OSDDG_TITLE_START_V+_OSDDG_TuneForTVType(OSDDG_TUNE_POS_TYPE_TITLE);    GDI_DrawString_909(0, &_OSDDGStringAttr, __pOSDUTLOutputString);}//***************************************************************************//  Function    :   _OSDDG_DisplayPageInfo//  Abstract    :   This function will show the page info.//  Arguments   :   none.//  Return		:   none.//  Side Effect :   none.//  Notes       :   //***************************************************************************void _OSDDG_DisplayPageInfo(void){    OSDUTL_PrepareOutputString();    OSDUTL_CopyStringFromIndex(aDGPage);        OSDUTL_OutputNumFromIndex(__DigestUIAttr.bCurPageNo+1);    OSDUTL_CopyStringFromIndex(aDGSlash);    OSDUTL_OutputNumFromIndex(__DigestUIAttr.bTotalPageNo);    _OSDDG_InitializeStringTransparentAttr();    _OSDDGStringAttr.bTextColor = OSDDG_PALETTE_ENTRY_TITLE_STRING;    _OSDDGStringAttr.wX = OSDDG_PAGE_INFO_END_H - GDI_GetStringWidth_909(__pOSDUTLOutputString);    _OSDDGStringAttr.wY = OSDDG_PAGE_INFO_START_V+_OSDDG_TuneForTVType(OSDDG_TUNE_POS_TYPE_TITLE);    GDI_DrawString_909(0, &_OSDDGStringAttr, __pOSDUTLOutputString);}//***************************************************************************//  Function    :   _OSDDG_DrawInfoRegion//  Abstract    :   This function will draw the info. region.//  Arguments   :   none.//  Return		:   none.//  Side Effect :   none.//  Notes       :   //***************************************************************************void _OSDDG_DrawInfoRegion(void){    _OSDDGRect.rect.wLeft = OSDDG_INFO_REGION_START_H;    _OSDDGRect.rect.wTop = OSDDG_INFO_REGION_START_V+_OSDDG_TuneForTVType(OSDDG_TUNE_POS_TYPE_HELP);    _OSDDGRect.rect.wRight = OSDDG_INFO_REGION_START_H+OSDDG_INFO_REGION_WIDTH;    _OSDDGRect.rect.wBottom = _OSDDGRect.rect.wTop+OSDDG_INFO_REGION_HEIGHT;    _OSDDGRect.bColor = OSDDG_PALETTE_ENTRY_INFO_REGION_BACKGROUND;        GDI_FillRoundRect(0, OSDDG_INFO_REGION_ARC_VALUE, &_OSDDGRect);    //Fill the frame of round rectangle    _OSDDGRect.bColor = OSDDG_PALETTE_ENTRY_INFO_REGION_FRAME;    _OSDDGRect.rect.wLeft -= OSDDG_INFO_REGION_OUTER_INNER_ARC_PIXEL;    _OSDDGRect.rect.wTop -= OSDDG_INFO_REGION_OUTER_INNER_ARC_PIXEL;    _OSDDGRect.rect.wRight += OSDDG_INFO_REGION_OUTER_INNER_ARC_PIXEL;    _OSDDGRect.rect.wBottom += OSDDG_INFO_REGION_OUTER_INNER_ARC_PIXEL;    GDI_DrawRoundRect(0, OSDDG_INFO_REGION_OUTER_ARC_VALUE, OSDDG_INFO_REGION_ARC_VALUE, &_OSDDGRect);}//***************************************************************************//  Function    :   _OSDDG_DrawButton//  Abstract    :   This function will draw the button.//  Arguments   :   bIndex: index of the button.//  Return		:   none.//  Side Effect :   none.//  Notes       :   //***************************************************************************void _OSDDG_DrawButton(BYTE bIndex, BYTE bHighlight){    //Draw the rectangle to represent the button. For PC-908 test only.    _OSDDGRect.rect.wLeft = OSDDG_BUTTON_START_H+bIndex*OSDDG_BUTTON_BUTTON_DISTANCE+bIndex*OSDDG_BUTTON_WIDTH;    _OSDDGRect.rect.wTop = OSDDG_BUTTON_START_V+_OSDDG_TuneForTVType(OSDDG_TUNE_POS_TYPE_BUTTON);          _OSDDGRect.rect.wRight = _OSDDGRect.rect.wLeft+OSDDG_BUTTON_WIDTH;    _OSDDGRect.rect.wBottom = _OSDDGRect.rect.wTop+OSDDG_BUTTON_HEIGHT;        if (bHighlight)    {        _OSDDGRect.bColor = OSDDG_PALETTE_ENTRY_HIGHLIGHT_BUTTON_BACKGROUND;        _OSDDGStringAttr.bTextColor = OSDDG_PALETTE_ENTRY_HIGHLIGHT_BUTTON_STRING;        _OSDDGStringAttr.bBackground = OSDDG_PALETTE_ENTRY_HIGHLIGHT_BUTTON_BACKGROUND;    }    else    {        _OSDDGRect.bColor = OSDDG_PALETTE_ENTRY_ENABLE_BUTTON_BACKGROUND;        _OSDDGStringAttr.bTextColor = OSDDG_PALETTE_ENTRY_ENABLE_BUTTON_STRING;        _OSDDGStringAttr.bBackground = OSDDG_PALETTE_ENTRY_ENABLE_BUTTON_BACKGROUND;    }        GDI_FillRoundRect(0, OSDDG_BUTTON_ARC_VALUE, &_OSDDGRect);    //Fill the frame of round rectangle    _OSDDGRect.bColor = OSDDG_PALETTE_ENTRY_BUTTON_FRAME;    _OSDDGRect.rect.wLeft -= OSDDG_BUTTON_OUTER_INNER_ARC_PIXEL;    _OSDDGRect.rect.wTop -= OSDDG_BUTTON_OUTER_INNER_ARC_PIXEL;    _OSDDGRect.rect.wRight += OSDDG_BUTTON_OUTER_INNER_ARC_PIXEL;    _OSDDGRect.rect.wBottom += OSDDG_BUTTON_OUTER_INNER_ARC_PIXEL;    GDI_DrawRoundRect(0, OSDDG_BUTTON_OUTER_ARC_VALUE, OSDDG_BUTTON_ARC_VALUE, &_OSDDGRect);    _OSDDGStringAttr.bColorKey = 0;    _OSDDGStringAttr.bShadow1 = PAL_ENTRY_COLOR_TRANSPARENT;    _OSDDGStringAttr.bShadow2 = PAL_ENTRY_COLOR_TRANSPARENT;    switch (bIndex)    {    case 0: //"Menu" button        __pOSDUTLOutputString = aDGBtnMenu;        break;    case 1: //"Exit" button        __pOSDUTLOutputString = aDGBtnExit;        break;    default:        return;    }    _OSDDGStringAttr.wX = _OSDDGRect.rect.wLeft+OSDDG_BUTTON_OUTER_INNER_ARC_PIXEL+((OSDDG_BUTTON_WIDTH-GDI_GetStringWidth_909(__pOSDUTLOutputString)) >> 1);    _OSDDGStringAttr.wY = _OSDDGRect.rect.wTop+OSDDG_BUTTON_OUTER_INNER_ARC_PIXEL+((OSDDG_BUTTON_HEIGHT-GDI_GetStringHeight_909(__pOSDUTLOutputString)) >> 1);    GDI_DrawString_909(0, &_OSDDGStringAttr, __pOSDUTLOutputString);}//***************************************************************************//  Function    :   _OSDDG_DrawFrame//  Abstract    :   This function will draw the frame.//  Arguments   :   bIndex: index of the frame.//              :   bUpdate: OSDDG_FRAME_NORMAL/OSDDG_FRAME_SELECT.//  Return		:   none.//  Side Effect :   none.//  Notes       :   //***************************************************************************void _OSDDG_DrawFrame(BYTE bIndex, BYTE bUpdate){/* LJY0.76 no need to draw frame for now but may be needed for CT909s    _OSDDGFrame.bStyle = FRAME_PUSH;    _OSDDGFrame.bThickness = OSDDG_FRAME_THICKNESS;    _OSDDGFrame.bColorCenter = PAL_ENTRY_COLOR_TRANSPARENT;    _OSDDGFrame.rect.wLeft = DIGEST_FIRST_FRAME_POS_H+(bIndex%OSDDG_COLUMN_NUM)*DIGEST_FRAME_SIZE_H+(bIndex%OSDDG_COLUMN_NUM)*DIGEST_FRAME_SPACING_H;    _OSDDGFrame.rect.wTop = DIGEST_FIRST_FRAME_POS_V+(bIndex/OSDDG_COLUMN_NUM)*DIGEST_FRAME_SIZE_V+(bIndex/OSDDG_COLUMN_NUM)*DIGEST_FRAME_SPACING_V;    //Note: Need to tune the position for NTSC/PAL, Interlace/P-SCAN    _OSDDGFrame.rect.wLeft -= _bDGTuneFrame_H;    _OSDDGFrame.rect.wTop -= _bDGTuneFrame_V;    if (__bTVType == SETUP_SCREEN_TV_SYSTEM_NTSC)    {        _OSDDGFrame.rect.wRight = _OSDDGFrame.rect.wLeft+DIGEST_FRAME_SIZE_H+OSDDG_TUNE_WIDTH_NTSC;        _OSDDGFrame.rect.wBottom = _OSDDGFrame.rect.wTop+DIGEST_FRAME_SIZE_V+OSDDG_TUNE_HEIGHT_NTSC;    }     else //PAL    {

⌨️ 快捷键说明

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