/** @file * Header file for GEL subtitle related API. * * @author mandy.wu 2010/08/16 (SUBT Y pos adjustment refinement) * @version 0.1 */ #ifndef __GEL_SUBTITLE__ #define __GEL_SUBTITLE__ #include "gui_eng/stddefs.h" #include "gui_eng/gui_engine.h" #define GEL_SUB_RGN_WIDTH (720) #define GEL_SUB_RGN_HEIGHT (480) /** Subtitle size */ typedef enum { GEL_SUB_SIZE_1 = 0, /**< Large */ GEL_SUB_SIZE_2, /**< */ GEL_SUB_SIZE_3, /**< */ GEL_SUB_SIZE_4, /**< */ GEL_SUB_SIZE_5, /**< */ GEL_SUB_SIZE_6, /**< Small */ GEL_SUB_SIZE_LAST } GEL_SUB_Size_e; /** Subtitle display position in vertical */ typedef enum { GEL_SUB_POSY_1 = 0, /**< Top */ GEL_SUB_POSY_2, /**< */ GEL_SUB_POSY_3, /**< */ GEL_SUB_POSY_4, /**< */ GEL_SUB_POSY_5, /**< */ GEL_SUB_POSY_6, /**< Bottom */ GEL_SUB_POSY_LAST } GEL_SUB_PosY_e; /** Subtitle color */ typedef enum { GEL_SUB_COLOR_RED = 0, /**< R:255 G:0 B:0 A:255*/ GEL_SUB_COLOR_GREEN, /**< R:0 G:255 B:0 A:255 */ GEL_SUB_COLOR_YELLOW, /**< R:255 G:255 B:0 A:255 */ GEL_SUB_COLOR_BLUE, /**< R:0 G:255 B:0 A:255 */ GEL_SUB_COLOR_PINK, /**< R:255 G:0 B:255 A:255 */ GEL_SUB_COLOR_CYAN, /**< R:255 G:255 B:255 A:255 */ GEL_SUB_COLOR_LAST } GEL_SUB_Color_e; /* Subtitle attributes */ extern LANGName_t gstSubCodepage; extern GEL_SUB_PosY_e geSubPosY; extern UINT8 gbSubLineSpacing; /* Subtitle resources */ extern PALENTRY gstSubPal[256]; /** * Initialize a region for subtitle rendering. * * @return GUI_SUCCESS if succeed, error codes otherwise. */ GUIResult_e GEL_SUB_InitializeRgn(void)__attribute__ ((warn_unused_result)); /** * Finalize the region for subtitle rendering. * @return GUI_SUCCESS if succeed, error codes otherwise. */ GUIResult_e GEL_SUB_FinalizeRgn(void)__attribute__ ((warn_unused_result)); /** * Clear subtitle . * * @return GUI_SUCCESS if succeed, error codes otherwise. */ GUIResult_e GEL_SUB_ClearAllString(UINT8 bUpdateNow); /** * Set a fontbase group number for subtitle rendering. * * @param eFontStyleNum The fontbase group to indicate an index of UI fontbase resources for subtitle rendering. * the param should be one of TV_Standard, TV_Small, TV_Large or TV_Game(the TV_FONT_Style_t); * @return GUI_SUCCESS if succeed, error codes otherwise. */ GUIResult_e GEL_SUB_SetFontbase(FontStyle_e eFontStyleNum)__attribute__ ((warn_unused_result)); /** * Get the subtitle fontbase group number. * * @param pdFontSizeNum The pointer to get subtitle fontbase index of the UI fontbase resources. * @return GUI_SUCCESS if succeed, error codes otherwise. */ GUIResult_e GEL_SUB_GetFontbase(UINT32 *pdFontSizeNum)__attribute__ ((warn_unused_result)); #if 0 /** * Set subtitle codepage for native string rendering. * * @param pstCodepage The codepage to be set to subtitle native string rendering. * @return GUI_SUCCESS if succeed, error codes otherwise. */ GUIResult_e GEL_SUB_SetCodepage(LANGName_t pstCodepage)__attribute__ ((warn_unused_result)); /** * Get subtitle codepage. * * @param pstCodepage The pointer to get subtitle native string displayed codepage. * @return GUI_SUCCESS if succeed, error codes otherwise. */ GUIResult_e GEL_SUB_GetCodepage(LANGName_t *pstCodepage)__attribute__ ((warn_unused_result)); #endif /** * Change subtitle color. * * @param eColor The String color to be drawn. * @return GUI_SUCCESS if succeed, error codes otherwise. */ GUIResult_e GEL_SUB_ChangeColor(GEL_SUB_Color_e eColor)__attribute__ ((warn_unused_result)); /** * Change subtitle size. * * @param eSize The String size to be drawn. * @return GUI_SUCCESS if succeed, error codes otherwise. */ GUIResult_e GEL_SUB_ChangeSize(GEL_SUB_Size_e eSize)__attribute__ ((warn_unused_result)); /** * Change subtitle position. * * @param ePosY The target position in vertical to be rendered. * @return GUI_SUCCESS if succeed, error codes otherwise. */ GUIResult_e GEL_SUB_ChangePos(GEL_SUB_PosY_e ePosY)__attribute__ ((warn_unused_result)); /** * Change subtitle line spacing. * @param bLineSpacing Spacing between each subtitle line, legal values [0,30]. * @return GUI_SUCCESS if succeed, error codes otherwise. */ GUIResult_e GEL_SUB_ChangeLineSpacing(UINT8 bLineSpacing)__attribute__ ((warn_unused_result)); /** * Change subtitle character spacing. * @param bCharSpacing Spacing between each character, set 0 to disable this setting, that is, * use the default character spacing of target fontbase. * @return GUI_SUCCESS if succeed, error codes otherwise. */ GUIResult_e GEL_SUB_ChangeCharSpacing(UINT8 bCharSpacing)__attribute__ ((warn_unused_result)); /** * Subtitle rendering. * * @param pStr Pointer to the string to be rendered. * @param eStrType The String type. * @return GUI_SUCCESS if succeed, error codes otherwise. */ GUIResult_e GEL_SUB_DrawString(UINT8 *pStr, GEL_DynStrType_e eStrType); /** * Set subtitle background to a specific color and on/off. * The 255th color in subtitle palette will be replaced by the specific color. * * @param pHandle Handle to a control object. * @param stColor The color to be set. * @param bBGDraw The flag to specific whether draw background. * @return GUI_SUCCESS if succeed, error codes otherwise. */ GUIResult_e GEL_SUB_SetBackground(GEL_Color_t stColor, BOOLEAN bBGDraw)__attribute__ ((warn_unused_result)); //GUIResult_e GEL_SUB_SetCodepage(LANGName_t stCodepage); #endif /* __GEL_SUBTITLE__ */