| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307 |
- /** @file
- * GEL text related control API.
- *
- * @author mandy.wu 2010/08/31 (Add new marquee style GEL_MARQUEE_CIRCLE)
- * @author tzungming.lin
- * @version 0.1
- */
- #ifndef __GEL_TEXT__
- #define __GEL_TEXT__
- #include "device_font.h"
- /** Dynamic string types. */
- typedef enum {
- GEL_DYN_STR_NATIVE, /**< Follow the code page for static string */
- GEL_DYN_STR_EPG, /**< Dynamic strings will be regarded as epg strings */
- GEL_DYN_STR_UTF8, /**< Dynamic strings will be regarded as utf8 strings */
- GEL_DYN_STR_UTF16_LE, /**< Dynamic strings will be regarded as utf16 little endian strings */
- GEL_DYN_STR_UTF16_BE, /**< Dynamic strings will be regarded as utf16 big endian strings */
- GEL_DYN_STR_LAST
- } GEL_DynStrType_e;
- /** Marquee style. */
- typedef enum GEL_Marquee_Style_e_
- {
- GEL_MARQUEE_SCROLL_ONEWAY = 0, /**< */
- GEL_MARQUEE_SCROLL = 0x10000000, /**< */
- GEL_MARQUEE_ALTERNATE_ONEWAY =0x20000000, /**< */
- GEL_MARQUEE_ALTERNATE = 0x30000000, /**< */
- GEL_MARQUEE_CIRCLE = 0x40000000, /**< */
- GEL_MARQUEE_MAX = 0x40000000
- } GEL_Marquee_Style_e;
- /** Text alignment in horizontal. */
- typedef enum {
- GEL_TEXT_ALIGN_LEFT = 0, /**< Left aligned */
- GEL_TEXT_ALIGN_CENTER, /**< Center aligned */
- GEL_TEXT_ALIGN_RIGHT, /**< Right aligned */
- GEL_TEXT_ALIGN_CP_DIR, /**< Codepage display direction aligned */
- GEL_TEXT_ALIGN_LAST
- } GEL_TextAlign_e;
- /** Border text style. */
- typedef enum {
- GEL_TEXT_BORD_THIN = 0, /**< Thin text border */
- GEL_TEXT_BORD_MIDDLE, /**< Middle text border */
- GEL_TEXT_BORD_THICK, /**< Thick text border */
- GEL_TEXT_BORD_LAST
- } GEL_TextBordType_e;
- typedef enum {
- GEL_TEXT_STYLE_NORMAL = 0,
- GEL_TEXT_STYLE_BOLD,
- GEL_TEXT_STYLE_ITALIC,
- GEL_TEXT_STYLE_BOLD_ITALIC,
- GEL_TEXT_STYLE_BORDERING,
- GEL_TEXT_STYLE_LAST
- } GEL_TextStyle_e;
- typedef enum {
- GEL_TEXT_END_NO_POINT = 1, // Sync. value with DrawPoint_e
- GEL_TEXT_END_THREE_POINT,
- GEL_TEXT_END_NOT_ENOUGH,
- GEL_TEXT_END_STYLE_LAST
- } GEL_TextEndStyle_e;
- typedef enum {
- GEL_AALEVEL_NONE = 0,
- GEL_AALEVEL_4,
- GEL_AALEVEL_8,
- GEL_AALEVEL_FULL,
- GEL_AALEVEL_LAST
- } GEL_AALevel_e;
- /** GEL text info struct */
- typedef struct {
- BOOLEAN bDrawBorder; /**< Draw border or not. */
- UINT8 bBordColor; /**< The color index value for text border. */
- UINT8 bTextFgColor; /**< The color index value for text foreground filling. */
- UINT8 bTextBgColor; /**< The color index value for text background filling. */
- #if 0
- UINT32 dFontSize; /**< The font size to be used. */
- #else
- FontStyle_e eFontStyle; /**< The font style to be used. */
- #endif
- GEL_TextAlign_e eTextAlign; /**< The text alignment style. */
- GEL_TextBordType_e eBordType; /**< The type of text border. */
- } GEL_TextInfo_t;
- /** Vector font infor struct */
- typedef struct {
- FONTSize_t bFontSize; /**< The font size in 'pt' (only support for vector font config). */
- GEL_TextStyle_e eTextStyle; /**< The text style to be applied */
- GEL_AALevel_e eAALevel; /**< Grayscale color levels for AA. */
- GEL_AAEntry_t* pStartIndices; /**< List of start indices of each group. */
- UINT8 bAAGroupNum : 4;/**< Number of groups of grayscale colors for AA. */
- UINT8 bAAGroupIdx : 4;/**< Index of desired group. */
- UINT8 bAADisable : 4;/**< Force disable AA effect. If true, AA is disabled. */
- UINT8 bGenPal : 4;/**< Generate palette from vfont or not. */
- } GEL_VFInfo_t;
- #ifdef CONFIG_ENABLE_UMF_LANGUAGE_MODULES
- typedef INT32 (*LoadLangfun)(INT8 eLangName);
- void GEL_RegLoadGlobalLangCB (LoadLangfun fun);
- #endif
- /**
- * Set font information to GUI engine.
- *
- * @param pFontInfo Pointer of the font information array generated by tool.
- * @param dFontBlockNum The font block number generated by tool.
- * @param dFontSizeNum The font size number generated by tool.
- * @param bLangNum The language number generated by tool.
- * @return GUI_SUCCESS if succeed, error codes otherwise.
- */
- GUIResult_e GEL_SetFontInfo(FONTInfo_t *pFontInfo, UINT32 dFontStyleNum, OSDStringInfo_t *pStr,
- UINT16 usStrIDNum, UINT8 ucBasicBmpSize, UINT8 ucLangNum, UINT8 ucCharSpacing)__attribute__ ((warn_unused_result));
- /**
- * Set global language information to the whole project.
- *
- * @param sdLangName The language name to be set for global settings.
- * @return GUI_SUCCESS if succeed, error codes otherwise.
- */
- GUIResult_e GEL_SetGlobalLang (UiLANGName_t sdLangName)__attribute__ ((warn_unused_result));
- /**
- * Get global language information to the whole project.
- *
- * @param sdLangName Returned language name.
- * @return GUI_SUCCESS if succeed, error codes otherwise.
- */
- GUIResult_e GEL_GetGlobalLang (UiLANGName_t *sdLangName)__attribute__ ((warn_unused_result));
- /**
- * Set current language information of specific menu/popup.
- */
- GUIResult_e GEL_SetLang(WinControl_t *pWinCtrl, UiLANGName_t eLangName);
- /**
- * Get current language information of specific menu/popup.
- *
- * @param pWinCtrl A WinControl_t pointer to a WINDOW/POPUP.
- * @param pLangInfo Returned language information.
- * @return GUI_SUCCESS if succeed, error codes otherwise.
- */
- GUIResult_e GEL_GetLang(WinControl_t *pWinCtrl, UiLANGName_t *pLangInfo)__attribute__ ((warn_unused_result));
- /**
- * Set string type of dynamic strings.
- * GUI engine will display dynamic strings according to the set type.
- *
- * @param pHandle Handle to a control object.
- * @param eStringType The string type to be set (DYNStringType_t).
- * @return GUI_SUCCESS if succeed, error codes otherwise.
- * @see GEL_GetStrType()
- */
- GUIResult_e GEL_SetStrType (HWND pHandle, GEL_DynStrType_e eStringType)__attribute__ ((warn_unused_result));
- /**
- * Get string type of dynamic strings.
- * GUI engine will display dynamic strings according to the set type.
- *
- * @param pHandle Handle to a control object.
- * @param pStringType Return the current dynamic string type to be regarded as.
- * @return GUI_SUCCESS if succeed, error codes otherwise.
- * @see GEL_SetStrType()
- */
- GUIResult_e GEL_GetStrType (HWND pHandle, GEL_DynStrType_e *pStringType)__attribute__ ((warn_unused_result));
- /**
- * Get string data from a static string id.
- *
- * @param sdstrId A valid string id in the string list.
- * @param ppStr Pointer to a pointer of a string.
- * @return GUI_SUCCESS if succeed, error codes otherwise.
- */
- GUIResult_e GEL_GetStr(String_id_t sdstrId, UINT8 **ppStr)__attribute__ ((warn_unused_result));
- /**
- * Get string width and height according to the font configuration.
- *
- * @param pStr Pointer to a string.
- * @param pstTextInfo Text info of the string.
- * @param pWidth Return the string width.
- * @param pHeight Return the string height.
- * @return GUI_SUCCESS if succeed, error codes otherwise.
- */
- GUIResult_e GEL_GetStrSize(UINT8 *pStr, GEL_TextInfo_t *pstTextInfo,
- UINT16 *pWidth, UINT16 *pHeight)__attribute__ ((warn_unused_result));
- #if 0
- /**
- * Set marquee fps(frame per second).
- *
- * @param bFps Fps for marquee to be set.
- * @return GUI_SUCCESS if succeed, error codes otherwise.
- */
- GUIResult_e GEL_SetMarqueeFps(UINT8 bFps)__attribute__ ((warn_unused_result));
- #endif
- /**
- * Set marquee fps(frame per second) and move step.
- *
- * @param bFps Fps for marquee to be set.
- * @param step move step.
- * @return GUI_SUCCESS if succeed, error codes otherwise.
- */
- GUIResult_e GEL_SetMarqueeFpsAndStep(UINT8 bFps, INT16 step)__attribute__ ((warn_unused_result));
- /**
- * Set marquee style to a specific control.
- *
- * @param pHandle Handle to a control object.
- * @param eStyle The marquee style to be set.
- * @return GUI_SUCCESS if succeed, error codes otherwise.
- */
- GUIResult_e GEL_SetMarqueeStyle(HWND pHandle, GEL_Marquee_Style_e eStyle)__attribute__ ((warn_unused_result));
- /**
- * Release ebook related buffer.
- * @return GUI_SUCCESS if succeed, error codes otherwise.
- */
- GUIResult_e GEL_EBK_Finalize(void)__attribute__ ((warn_unused_result));
- /**
- * Accumulate the total lines according to the input string. This function would run on
- * caller's task.
- *
- * @param pHandle Handle to a CLASS_TEXT control widget with S_TXT_EBK style.
- * @param pString Desired string buffer.
- * @return GUI_SUCCESS if success, error codes otherwise.
- */
- GUIResult_e GEL_EBK_AccumPages(HWND handle, UINT8* pString,UINT32 bufferindex)__attribute__ ((warn_unused_result));
- /**
- * Reset the related attributes. Note that this function would ignore ebk_info->bSync flag.
- *
- * @param pHandle Handle to a CLASS_TEXT control widget with S_TXT_EBK style.
- * @return GUI_SUCCESS if success, error codes otherwise.
- */
- GUIResult_e GEL_EBK_Reset(HWND pHandle)__attribute__ ((warn_unused_result));
- /**
- * Perform ebook goto-page functionality. This function would run on
- * caller's task.
- *
- * @param pHandle Handle to a CLASS_TEXT control widget with S_TXT_EBK style.
- * @param dPage Desired page number.
- * @param sdBufIndex Returned buffer index related to text file.
- * @param bDataExist Returned flag that indicate whether the content of dPage exists in current loaded string buffer or not.
- * @return GUI_SUCCESS if success, error codes otherwise.
- */
- GUIResult_e GEL_EBK_Goto(HWND pHandle, UINT32 dPage, INT32 *sdBufIndex, BOOLEAN *bDataExist)__attribute__ ((warn_unused_result));
- GUIResult_e GEL_EBK_GetPageOffset(HWND handle, UINT32 dPage, UINT32 *pdFcpOffset,UINT32 *pdBufferIndex);
- GUIResult_e GEL_EBK_GetPagebyOffset(HWND handle, UINT32 dFcpOffset, UINT32 dBufferIndex, UINT32 *pdPage);
- /**
- * Check if given handle(textbox) is at synchronized condition. If not,
- * AP should reload the desired string buffer.
- *
- * @param pHandle Handle to a CLASS_TEXT control widget with S_TXT_EBK style.
- * @return TRUE or FALSE.
- */
- BOOLEAN GEL_EBK_IsSync(HWND pHandle)__attribute__ ((warn_unused_result));
- /**
- * AP notifies GUI engine that the data of buffer is synchronized now, and
- * engine would unlock the designate textbox.
- *
- * @param pHandle Handle to a CLASS_TEXT control widget with S_TXT_EBK style.
- * @return GUI_SUCCESS if success, error codes otherwise.
- */
- UINT32 GEL_EBK_Notify(HWND handle, UINT8 *pString, UINT32 *Stroffset,UINT32 *sdBufIndex);
- //<gunking>
- /**
- * Set how to show unknown character
- *
- * @param UnknownChar unknown character by user configuration
- * @return GUI_SUCCESS if succeed, error codes otherwise.
- */
- GUIResult_e GEL_SetUnknownChar(UINT16 chUnknownChar)__attribute__ ((warn_unused_result));
- //</gunking>
- GUIResult_e GEL_EBK_Preview(HWND handle);
- typedef BOOL (*EBookGetPartialCode_t)(UINT8 *pSrcStr,UINT32 uiSrcBufLen, UINT32 *pOffset);
- void GEL_RegPartialCodeCheckCallBackFunc(EBookGetPartialCode_t pGEL_EbookPartialCodeCheckCallBackFunc);
- typedef UINT8* (*EBookConvert_t)(UINT8* pSrcStr, INT32* puiLen);
- void GEL_RegConvertCodeCallBackFunc(EBookConvert_t pGEl_EBook_ConvertCodeCallBackFunc);
- void GEL_UnRegConvertCodeCallBackFunc(void);
- void GEL_UnRegPartialCodeCheckCallBackFunc(void);
- #endif /* __GEL_TEXT__ */
|