| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468 |
- /** @file
- * Header file for gel internal used functions.
- *
- * @author mandy.wu 2010/12/06 (Add duplicate controls' core struct)
- * @version 0.1
- */
- #ifndef __GEL_PRIVATE__
- #define __GEL_PRIVATE__
- #include "gel_text.h"
- #include "device_font.h"
- #include "gl_types.h"
- #define GUIENG_MAX_BLIT_ID (0x7FFFFFFF)
- #define GUIENG_INVALID_BLIT_ID (-1)
- #define GUI_RENDER_STACK_SIZE (8192)
- #define GUI_RENDER_POLLING_STACK_SIZE (2048)
- #define KEEP_WIDGET_STYLE (0xFFE00000)
- #define KEEP_COMMON_STYLE (0x001FFFFF)
- #define GET_COMMON_STYLE(control) ((control)->c_style)
- #define GET_WIDGET_STYLE(control) ((control)->p_style)
- #define COMMON_STYLE(control) ((control)->c_style)
- #define WIDGET_STYLE(control) ((control)->p_style)
- /* 32 bits control flags for control rendering */
- #define GENG_CF_PARENT_STATE (0x000000FF) // parent's state
- #define GENG_CF_CLEAR_BG (0x100 << 2) //0x400
- #define GENG_CF_RGNBUF_PAINT (0x100 << 3) //0x800
- #define GENG_CF_BORDER_PAINT (0x100 << 4) //0x1000
- #define GENG_CF_FLIP_HORIZ (0x100 << 5) //0x2000
- /* Marquee internal control */
- #define GENG_MARQUEE_ALTERNATE_FORWARD (0x1000000)
- #define GENG_MARQUEE_ALTERNATE_BACKWARD (0x1000000 << 1)
- #define GENG_MARQUEE_ALTERNATE_IN_BITS (0x3000000) // internal control bits
- /* Animation controls */
- #define MARQUEE_BUF_BPP (8)
- #define MARQUEE_BUF_FORMAT (PF_LUT8)
- #define MAX_TIMER_ACCUMULATOR (0xFFFF)
- #define GENG_TIMER_PERIOD (50) //50 ms
- //#define WM_MARQUEE (WM_MSG_MAX - 1)
- /* Value checking */
- #define GENG_MAX_UINT8_VALUE (0xFF)// The max INT8 value limitation
- #define GENG_MAX_INT16_VALUE (0x7FFF)// The max INT16 value limitation
- /* The max supported bar size for SCROLL bar */
- #define GENG_MAX_BAR_RESIZE_H (1920) // The max bar resized total size in horizontal
- #define GENG_MAX_BAR_RESIZE_V (1080) // The max bar resized total size in vertical
- /* Render sleep control */
- #define GENG_RENDER_SLEEP (2)
- #define STR_LINE_LIMIT (64) // Line limitation for direct rendering.
- /* Multiline textbox buffer size definition */
- #define TXT_BUF_SIZE_BOUND (1024) // 1K, size limit of a string buffer.
- #define FOCUSED_STR_BORDER_OFFSET_LEFT (8)
- #define FOCUSED_STR_BORDER_OFFSET_RIGHT (16)
- typedef struct _GENG_Vector_Font_Info_t {
- GEL_TextStyle_e eTextStyle;
- FONT_AA_Info_t stAAInfo;
- FONTSize_t bFontSize;
- } GENG_VFInfo_t;
- /* Text attributes description */
- typedef struct _GENG_TextInfo_t {
- UINT8 bTextAlign; // The text alignment style
- UINT8 bFixCharWidth; // Fix char width, disabled if equals to 0.
- FontStyle_e eFontStyle; // Font style, an enumeration value.
- BOOLEAN bDrawBorder; // Draw border or not.
- BOOLEAN bEpg; // This is an EPG string or not.
- BOOLEAN bStatic; // If it is a static string.
- GEL_TextBordType_e eBordType; // The type of the text border.
- GENG_VFInfo_t *pVFInfo; // Informations about vector font.
- } GENG_TextInfo_t;
- typedef struct _GENG_TxtColor_t{
- UINT8 bFgColor; // The index value of text filling color.
- UINT8 bBgColor; // The index value of text bg color.
- UINT8 bBordColor; // The index value of text border color.
- } GENG_TxtColor_t;
- typedef struct _GENG_PgrhInfo_t {
- LANGName_t stEpgCodepage; // To indicate epg string codepage.
- UINT8 bRowSpace; // The row spacing to be applied when rendering.
- UINT8 bFixLineHeight; // The fix line height to be applied when rendering.
- UINT16 wMaxLineNum; // The limitation of the max line number of the paragraph.
- INT16 swCurrLine; // Indicate the line index of the current page.
- } GENG_PgrhInfo_t;
- typedef struct _GENG_StrBuf_t {
- UINT8 *pAddr;
- UINT16 wWidth;
- UINT16 wHeight;
- UINT16 wXOffset; // Real char start offset x
- UINT16 wYOffset; // Real char start offset y
- } GENG_StrBuf_t;
- /* Control of GUI render task/ queue/ timer */
- typedef struct gui_engine_core_t_
- {
- //Queue Handle
- GL_Queue_t queueHandle;
- //Semaphores
- GL_Semaphore_t timerSemaphore;
- GL_Semaphore_t dataAccessSemaphore;
- GL_Semaphore_t textPreparseSemaphore; // TODO: 12/01
- //Mutex
- GL_Mutex_t sendMsgMutex;
- //Task Handle
- GL_Task_t taskHandle;
- GL_Task_t timerTaskHandle;
- // Timer
- GL_Timer_t timer;
- // Others
- UINT8 bGuiengBreakCondition;
- UINT8 bGuiTimerProcessBreakCondition;
- UINT8 bGuiengInitFlg;
- UINT8 bGuiTimerInitFlg;
- } GuiEngCore_t;
- /* Control of animation registr */
- typedef struct _animation_register_t {
- LIST link;
- HWND handle;
- BOOLEAN bActive;
- } AnimReg_t;
- /* Global variable */
- extern GuiEngCore_t *gpGuiEngCore;
- extern LISTHEAD gClassList;
- extern LISTHEAD gAnimList;
- extern HWND gRootWindow;
- extern HWND gActiveWindow;
- // blit id control
- extern INT32 gBlitId;
- extern INT32 gCurrFinishBlitId;
- // rendering delay control
- extern BOOLEAN gbRenderSleep;
- // string buffer
- extern DRAWDRIVER ddriver;
- /* Subtitle related variables */
- extern BOOLEAN gbSubDraw;
- extern UINT8 gbSubLineSpacing;
- extern UINT8 gbSubCharSpacing;
- /* Register a specific class of widgets. */
- GUIResult_e register_class_background(void);
- GUIResult_e register_class_icon(void);
- GUIResult_e register_class_text(void);
- GUIResult_e register_class_animation(void);
- GUIResult_e register_class_border(void);
- GUIResult_e register_class_button(void);
- GUIResult_e register_class_button_group(void);
- GUIResult_e register_class_listview(void);
- GUIResult_e register_class_progress(void);
- GUIResult_e register_class_scroll(void);
- GUIResult_e register_class_combo(void);
- GUIResult_e register_class_edit(void);
- /* Set params to a menu or popup menu. */
- GUIResult_e set_params_class_menu(HWND handle, ParamType_e eParamType, void *pParam);
- /* Set params to a specified class of widgets. */
- GUIResult_e set_params_class_background(HWND handle, ParamType_e eParamType, void *pParam);
- GUIResult_e set_params_class_icon(HWND handle, ParamType_e eParamType, void *pParam);
- GUIResult_e set_params_class_text(HWND handle, ParamType_e eParamType, void *pParam);
- GUIResult_e set_params_class_animation(HWND handle, ParamType_e eParamType, void *pParam);
- GUIResult_e set_params_class_border(HWND handle, ParamType_e eParamType, void *pParam);
- GUIResult_e set_params_class_button(HWND handle, ParamType_e eParamType, void *pParam);
- GUIResult_e set_params_class_button_group(HWND handle, ParamType_e eParamType, void *pParam);
- GUIResult_e set_params_class_listview(HWND handle, ParamType_e eParamType, void *pParam);
- GUIResult_e set_params_class_progress(HWND handle, ParamType_e eParamType, void *pParam);
- GUIResult_e set_params_class_scroll(HWND handle, ParamType_e eParamType, void *pParam);
- GUIResult_e set_params_class_combo(HWND handle, ParamType_e eParamType, void *pParam);
- GUIResult_e set_params_class_edit(HWND handle, ParamType_e eParamType, void *pParam);
- /* Get params from a specified class of widgets. */
- GUIResult_e get_params_class_background(HWND handle, ParamType_e eParamType, void *pParam);
- GUIResult_e get_params_class_icon(HWND handle, ParamType_e eParamType, void *pParam);
- GUIResult_e get_params_class_text(HWND handle, ParamType_e eParamType, void *pParam);
- GUIResult_e get_params_class_animation(HWND handle, ParamType_e eParamType, void *pParam);
- GUIResult_e get_params_class_border(HWND handle, ParamType_e eParamType, void *pParam);
- GUIResult_e get_params_class_button(HWND handle, ParamType_e eParamType, void *pParam);
- GUIResult_e get_params_class_button_group(HWND handle, ParamType_e eParamType, void *pParam);
- GUIResult_e get_params_class_listview(HWND handle, ParamType_e eParamType, void *pParam);
- GUIResult_e get_params_class_progress(HWND handle, ParamType_e eParamType, void *pParam);
- GUIResult_e get_params_class_scroll(HWND handle, ParamType_e eParamType, void *pParam);
- GUIResult_e get_params_class_combo(HWND handle, ParamType_e eParamType, void *pParam);
- GUIResult_e get_params_class_edit(HWND handle, ParamType_e eParamType, void *pParam);
- /* Add menu offset to a specified class of widgets. */
- void add_menu_offset_class_background(HWND pHandle, INT16 wMenuOffsetX, INT16 wMenuOffsetY);
- void add_menu_offset_class_icon(HWND pHandle, INT16 wMenuOffsetX, INT16 wMenuOffsetY);
- void add_menu_offset_class_text(HWND pHandle, INT16 wMenuOffsetX, INT16 wMenuOffsetY);
- void add_menu_offset_class_animation(HWND pHandle, INT16 wMenuOffsetX, INT16 wMenuOffsetY);
- void add_menu_offset_class_border(HWND pHandle, INT16 wMenuOffsetX, INT16 wMenuOffsetY);
- void add_menu_offset_class_button(HWND pHandle, INT16 wMenuOffsetX, INT16 wMenuOffsetY);
- void add_menu_offset_class_button_group(HWND pHandle, INT16 wMenuOffsetX, INT16 wMenuOffsetY);
- void add_menu_offset_class_listview(HWND pHandle, INT16 wMenuOffsetX, INT16 wMenuOffsetY);
- void add_menu_offset_class_progress(HWND pHandle, INT16 wMenuOffsetX, INT16 wMenuOffsetY);
- void add_menu_offset_class_scroll(HWND pHandle, INT16 wMenuOffsetX, INT16 wMenuOffsetY);
- void add_menu_offset_class_combo(HWND pHandle, INT16 wMenuOffsetX, INT16 wMenuOffsetY);
- void add_menu_offset_class_edit(HWND pHandle, INT16 wMenuOffsetX, INT16 wMenuOffsetY);
- /* Create duplicate core struct to a specified class of widgets. */
- GUIResult_e create_core_struct_class_background(WinControl_t *pDefaultWinCtl, HWND handle);
- GUIResult_e create_core_struct_class_icon(WinControl_t *pDefaultWinCtl, HWND handle);
- GUIResult_e create_core_struct_class_text(WinControl_t *pDefaultWinCtl, HWND handle);
- GUIResult_e create_core_struct_class_animation(WinControl_t *pDefaultWinCtl, HWND handle);
- GUIResult_e create_core_struct_class_border(WinControl_t *pDefaultWinCtl, HWND handle);
- GUIResult_e create_core_struct_class_button(WinControl_t *pDefaultWinCtl, HWND handle);
- GUIResult_e create_core_struct_class_button_group(WinControl_t *pDefaultWinCtl, HWND handle);
- GUIResult_e create_core_struct_class_listview(WinControl_t *pDefaultWinCtl, HWND handle);
- GUIResult_e create_core_struct_class_progress(WinControl_t *pDefaultWinCtl, HWND handle);
- GUIResult_e create_core_struct_class_scroll(WinControl_t *pDefaultWinCtl, HWND handle);
- GUIResult_e create_core_struct_class_combo(WinControl_t *pDefaultWinCtl, HWND handle);
- GUIResult_e create_core_struct_class_edit(WinControl_t *pDefaultWinCtl, HWND handle);
- /* Destroy duplicate core struct to a specified class of widgets. */
- GUIResult_e destroy_core_struct_class_background(WinControl_t *pDefaultWinCtl, HWND handle);
- GUIResult_e destroy_core_struct_class_icon(WinControl_t *pDefaultWinCtl, HWND handle);
- GUIResult_e destroy_core_struct_class_text(WinControl_t *pDefaultWinCtl, HWND handle);
- GUIResult_e destroy_core_struct_class_animation(WinControl_t *pDefaultWinCtl, HWND handle);
- GUIResult_e destroy_core_struct_class_border(WinControl_t *pDefaultWinCtl, HWND handle);
- GUIResult_e destroy_core_struct_class_button(WinControl_t *pDefaultWinCtl, HWND handle);
- GUIResult_e destroy_core_struct_class_button_group(WinControl_t *pDefaultWinCtl, HWND handle);
- GUIResult_e destroy_core_struct_class_listview(WinControl_t *pDefaultWinCtl, HWND handle);
- GUIResult_e destroy_core_struct_class_progress(WinControl_t *pDefaultWinCtl, HWND handle);
- GUIResult_e destroy_core_struct_class_scroll(WinControl_t *pDefaultWinCtl, HWND handle);
- GUIResult_e destroy_core_struct_class_combo(WinControl_t *pDefaultWinCtl, HWND handle);
- GUIResult_e destroy_core_struct_class_edit(WinControl_t *pDefaultWinCtl, HWND handle);
- /**
- * Find if a class is a registed type of widget control.
- *
- * @param eClassType The class of the widget control
- * @return Structure of WNDCLASS
- */
- PWNDCLASS gel_find_class(ClassType_e eClassType);
- /**
- * Register a class of widget control.
- *
- * @param pWinClass Pointer to the structure WNDCLASS
- * @return SUCCESS if succeed, error codes of FAILURE otherwise.
- */
- GUIResult_e gel_register_class(const WNDCLASS *pWinClass);
- /**
- * Unregister a class of widget control.
- *
- * @param eClassType The class of the widget control
- * @return SUCCESS if succeed, error codes of FAILURE otherwise.
- */
- GUIResult_e gel_unregister_class(ClassType_e eClassType);
- /**
- * Check a class whether is in registered class list.
- *
- * @param pWinClass Pointer to the structure WNDCLASS
- * @return SUCCESS if succeed, error codes of FAILURE otherwise.
- */
- GUIResult_e gel_check_class_validity(const WNDCLASS *pWinClass);
- /**
- * Check gAnimList to ensure if the given handle is already in the anim list.
- *
- * @param pHandle The handle of an animation control to be checked.
- * @return The pointer of the registration node if the handle is already registered.
- */
- AnimReg_t* gel_find_animation(HWND pHandle);
- /**
- * Register an animation to gAnimList.
- *
- * @param pAnimReg The pointer to the registration information.
- */
- void gel_register_animation(AnimReg_t *pAnimReg);
- /**
- * Unregister an animation to gAnimList.
- *
- * @param pAnimHandle The handle of an animation to be unregistered.
- */
- void gel_unregister_animation(HWND pAnimHandle);
- /**
- * Enable/disable the animation in the gAnimList.
- *
- * @param pAnimHandle The handle of an animation.
- * @param bEnable Whether to enable the animation.
- */
- void gel_set_anim_enable(HWND pAnimHandle, BOOLEAN bEnable);
- /**
- * Check the animation is active or not.
- *
- * @param pAnimHandle The handle of an animation.
- * @return TRUE if the animation is active, FALSE otherwise.
- */
- BOOLEAN gel_check_anim_active(HWND pAnimHandle);
- /**
- * Fill the x, y, width and height to the specified RECT structure.
- *
- * @param pRect Pointer to a RECT structure.
- * @param swX X position.
- * @param swY Y position.
- * @param wWidth Width of the rectangle.
- * @param wHeight Height of the rectangle.
- * @return GUI_SUCCESS if succeed, error codes otherwise.
- */
- GUIResult_e gel_set_rect(LPRECT pRect, INT16 swX, INT16 swY, UINT16 wWidth, UINT16 wHeight);
- /**
- * Show all controls in a WINDOW/POPUP.
- *
- * @param pWinCtrl A WinControl_t pointer to a WINDOW/POPUP.
- * @param dControlFlags Control flags for the rendering.
- * @param bDirect Direct rendering or send msg.
- * @return GUI_SUCCESS if succeed, error codes otherwise.
- */
- GUIResult_e gel_show_window(WinControl_t *pWinCtrl, UINT32 dControlFlags, BOOLEAN bDirect);
- /**
- * Create a control handle.
- *
- * @param pstControl The pointer of WinControl_t to a control.
- * @param pParentHandle The HWND pointer to the control's parent menu.
- * @return GUI_SUCCESS if succeed, error codes otherwise.
- */
- GUIResult_e gel_create_handle(WinControl_t *pstControl, HWND pParentHandle);
- /**
- * Destroy a control handle.
- *
- * @param pHandle The handle of a control to be destroyed.
- * @return GUI_SUCCESS if succeed, error codes otherwise.
- */
- GUIResult_e gel_destroy_handle(HWND pHandle);
- /**
- * Private message sending function used by GUI Engine internal.
- *
- * @param pHandle The handle of a region.
- * @param dMsg Pointer to the structure WNDCLASS (to get message)
- * @param dParam1 Parameters for the extra infomation
- * @param dParam2 Parameters for the extra infomation
- * @param bUrgent Boolean value that indicates it is an urgent message or not.
- * @return GUI_SUCCESS if succeed, error codes otherwise.
- */
- GUIResult_e gel_send_update_message(RegionHandle_t sdRegionHandle, UINT32 dMsg, UINT32 dParam1, UINT32 dParam2, BOOLEAN bUrgent);
- /**
- * Private message sending function used by GUI Engine internal.
- *
- * @param pHandle The handle of a control.
- * @param dMsg Pointer to the structure WNDCLASS (to get message)
- * @param dControlFlags Parameters for the extra infomation
- * @param dInputKey Parameters for the extra infomation
- * @param bUrgent Boolean value that indicates it is an urgent message or not.
- * @return GUI_SUCCESS if succeed, error codes otherwise.
- */
- GUIResult_e gel_send_message(HWND pHandle, UINT32 dMsg, UINT32 dControlFlags, UINT32 dInputKey, BOOLEAN bUrgent);
- /**
- * Create a duplicate control data structure.
- *
- * @param pDefaultWinCtl Pointer to the default win control struct.
- * @param pHandle Pointer to the control's handle.
- */
- GUIResult_e gel_CreateDuplControl(WinControl_t *pDefaultWinCtl, HWND pHandle);
- /**
- * Destroy the duplicate control data structure.
- *
- * @param pDuplWinCtl Pointer to the duplicate win control struct.
- * @param pHandle Pointer to the control's handle.
- */
- GUIResult_e gel_DestroyDuplControl(WinControl_t *pDuplWinCtl, HWND pHandle);
- /**
- * Draw a string to an OSD region.
- *
- * @param pstHdc The pointer to the target dc handle.
- * @param pStr The string data.
- * @param eStrType The encoded type of the string.
- * @param pstTextInfo The text rendering info of the string.
- * @param pstVFInfo The vector font related settings.
- * @param pStrRect The area of the OSD region to be rendered the string to.
- * @return GUI_SUCCESS if succeed, error codes otherwise.
- */
- GUIResult_e gel_DrawString(HDC pstHdc, UINT8 *pStr, GEL_DynStrType_e eStrType,
- GEL_TextInfo_t *pstTextInfo, GEL_VFInfo_t *pstVFInfo, PRECT pStrRect, INT32 *pBlockId);
- /**
- * Draw a bitmap to an OSD region.
- *
- * @param pstHdc The pointer to the target dc handle.
- * @param pstBitmapHandle The string data.
- * @param dFlags The flag to indicate the bmp rendering style.
- * @param pstSrcRect The pointer to a rect area of the source bitmap to be blited.
- * @param pstDstRect The pointer to a rect area of the OSD region to be blited to.
- * @return GUI_SUCCESS if succeed, error codes otherwise.
- */
- GUIResult_e gel_DrawBitmap(HDC pstHdc, GEL_BitmapHandle_t *pstBitmapHandle, UINT32 dFlags,
- PRECT pstSrcRect, PRECT pstDstRect, INT32 *pBlockId);
- /**
- * Fill a color to the rect area of an OSD region.
- *
- * @param pstHdc The pointer to the target dc handle.
- * @param stColor The color to be filled with.
- * @param pstDstRect The pointer to a rect area of the OSD region to be rendered to.
- * @return GUI_SUCCESS if succeed, error codes otherwise.
- */
- GUIResult_e gel_FillRect(HDC pstHdc, GEL_Color_t stColor, PRECT pstDstRect, INT32 *pBlockId);
- /**
- * draw hole rect area of an OSD region.
- *
- * @param pstHdc The pointer to the target dc handle.
- * @param nLineWidth The line width to be drawed with.
- * @param pstDstRect The pointer to a rect area of the OSD region to be rendered to.
- * @return GUI_SUCCESS if succeed, error codes otherwise.
- */
- GUIResult_e gel_DrawHoleRectangle(HDC pstHdc, PRECT pstDstRect, UINT16 nLineWidth, INT32 *pBlockId, INT32 isEvenAlign);
- /**
- * Draw a line between two points of an OSD region.
- *
- * @param pstHdc The pointer to the target dc handle.
- * @param stColor The color to be filled with.
- * @param swX1 The x coordinate of the start point.
- * @param swY1 The y coordinate of the start point.
- * @param swX2 The x coordinate of the end point.
- * @param swY2 The y coordinate of the end point.
- * @param wThickness The thickness of a line.
- * @return GUI_SUCCESS if succeed, error codes otherwise.
- */
- GUIResult_e gel_DrawLine(HDC pstHdc, GEL_Color_t stColor, INT16 swX1, INT16 swY1,
- INT16 swX2, INT16 swY2, UINT16 wThickness, INT32 *pBlockId);
- /**
- * Enable or Disable OSD.
- *
- * @param ShowOS
- * @return GUI_SUCCESS if succeed, error codes otherwise.
- */
- GUIResult_e gel_SetDispaly(HDC pstHdc, BOOL ShowOSD);
- #endif /* __GEL_PRIVATE__ */
|