| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249 |
- /** @file
- * Header file for GEL control handling API.
- *
- * @author mandy.wu 2009/11/30 (Add anim enable/disable control)
- * @author tzungming.lin 2009/07/31 (last updated)
- * @version 0.1
- */
- #ifndef __GEL_CONTROL__
- #define __GEL_CONTROL__
- /**
- * Creates handles for all the controls in a menu/popup menu.
- *
- * @param pWinCtrl A WinControl_t pointer to a menu/popup menu.
- * @param sdRegionHandle The created region handle for the WINDOW/POPUP.
- * @return GUI_SUCCESS if succeed, error code otherwise.
- */
- GUIResult_e GEL_CreateMenu(WinControl_t *pWinCtrl, RegionHandle_t sdRegionHandle)__attribute__ ((warn_unused_result));
- /**
- * Destroy handles of all the controls in a menu/popup menu.
- *
- * @param pWinCtrl A WinControl_t pointer to a menu/popup menu.
- * @param bClear A boolean value that decide whether clear the menu area after destroy it or not.
- * @return GUI_SUCCESS if succeed, error code otherwise.
- */
- GUIResult_e GEL_DestroyMenu(WinControl_t *pWinCtrl, BOOLEAN bClear)__attribute__ ((warn_unused_result));
- /**
- * Show all the controls in a menu/popup menu.
- *
- * @param pWinCtrl A WinControl_t pointer to a WINDOW/POPUP.
- * @return GUI_SUCCESS if succeed, error code otherwise.
- */
- GUIResult_e GEL_ShowMenu(WinControl_t *pWinCtrl)__attribute__ ((warn_unused_result));
- /**
- * Change the coordinate of a specific menu and all controls of it.
- * Notes that GEL_CreateMenu should be called before GEL_SetMenuXY,
- * and GEL_ShowMenu should be called after GEL_SetMenuXY to refresh the whole menu!
- *
- * @param pWinCtrl A WinControl_t pointer to a WINDOW or a POPUP.
- * @param wMenuX X coordinate of the menu to be set.
- * @param wMenuY Y coordinate of the menu to be set.
- * @return GUI_SUCCESS if succeed, error code otherwise.
- */
- GUIResult_e GEL_SetMenuXY(WinControl_t *pWinCtrl, INT16 wMenuX, INT16 wMenuY)__attribute__ ((warn_unused_result));
- /**
- * Get the cuurent coordinate of the menu.
- *
- * @param pWinCtrl A WinControl_t pointer to a menu/popup menu.
- * @param pwMenuX Return the coordinate x coordinate of the menu.
- * @param pwMenuY Return the coordinate y coordinate of the menu.
- * @return GUI_SUCCESS if succeed, error code otherwise.
- */
- GUIResult_e GEL_GetMenuXY(WinControl_t *pWinCtrl, INT16 *pwMenuX, INT16 *pwMenuY)__attribute__ ((warn_unused_result));
- /**
- * Get the handle of a specific control.
- *
- * @param pWinCtrl A WinControl_t pointer to a control.
- * @param pHandle Return the HWND pointer of a control.
- * @return GUI_SUCCESS if succeed, error code otherwise.
- */
- GUIResult_e GEL_GetHandle(void *pWinCtrl, INT32 sdIdx, HWND *pHandle)__attribute__ ((warn_unused_result));
- /**
- * Set active window to the specific menu/popup menu.
- *
- * @param pWinCtrl A WinControl_t pointer to a menu/popup menu.
- * @return GUI_SUCCESS if succeed, error code otherwise.
- * @see GEL_GetActiveMenu()
- */
- GUIResult_e GEL_SetActiveMenu(WinControl_t *pWinCtrl)__attribute__ ((warn_unused_result));
- /**
- * Get current active menu/popup menu.
- *
- * @param ppWinCtrl Returned reference of a WinControl_t pointer to a menu/popup menu.
- * @return GUI_SUCCESS if succeed, error code otherwise.
- * @see GEL_SetActiveMenu()
- */
- GUIResult_e GEL_GetActiveMenu(WinControl_t **ppWinCtrl)__attribute__ ((warn_unused_result));
- /**
- * Set current focused id to the current active menu/popup menu.
- *
- * @param wCtrlId The control ID in the active menu/popup menu.
- * @return GUI_SUCCESS if succeed, error code otherwise.
- */
- GUIResult_e GEL_SetActiveHandle(UINT16 wCtrlId)__attribute__ ((warn_unused_result));
- /**
- * Get current focused handle in the active menu/popup menu.
- *
- * @param pHandle Handle to the current focused control object.
- * @return GUI_SUCCESS if succeed, error code otherwise.
- */
- GUIResult_e GEL_GetActiveHandle(HWND* pHandle)__attribute__ ((warn_unused_result));
- /**
- * Move a control to the given coordinate.
- *
- * @param pHandle Handle to a control to be moved.
- * @param swXPos x coordinate to be moved to.
- * @param swYPos y coordinate to be moved to.
- * @param wWidth Width to be resized to.
- * @param wHeight Height to be resized to.
- * @return GUI_SUCCESS if succeed, error code otherwise.
- */
- GUIResult_e GEL_MoveControl(HWND pHandle, INT16 swXPos, INT16 swYPos, UINT16 wWidth, UINT16 wHeight)__attribute__ ((warn_unused_result));
- /**
- * Set parameters to a specific control.
- *
- * @param pHandle Handle to a control object.
- * @param eParamType Type of the parameter to be set.
- * @param pParam Pointer to the value to be set.
- * @return GUI_SUCCESS if succeed, error code otherwise.
- */
- GUIResult_e GEL_SetParam(HWND pHandle, ParamType_e eParamType, void *pParam)__attribute__ ((warn_unused_result));
- /**
- * Get parameters from a specific control.
- *
- * @param pHandle Handle to a control object.
- * @param eParamType Type of the parameter to be got.
- * @param pParam Pointer to the specific type of structure for returned value.
- * @return GUI_SUCCESS if succeed, error code otherwise.
- */
- GUIResult_e GEL_GetParam(HWND pHandle, ParamType_e eParamType, void *pParam)__attribute__ ((warn_unused_result));
- /**
- * Send the message to the callback function for each type of widgets.
- *
- * @param pHandle Handle to the window.
- * @param dMsg Type of window message.
- * @param eInputKey Input key for CLASS_EDIT to use.
- * @return GUI_SUCCESS if succeed, error code otherwise.
- */
- GUIResult_e GEL_SendMsg (HWND pHandle, UINT32 dMsg, input_key_t eInputKey)__attribute__ ((warn_unused_result));
- /**
- * Set a palette to the handle. If it's NULL, the handle will refer to the default palette.
- * The palette is only valid when the drawn region is 16bit or 32bit.
- *
- * @param pHandle Handle to a control object.
- * @param pPal Pointer of a palette entry to be set.
- * @return GUI_SUCCESS if succeed, error code otherwise.
- */
- GUIResult_e GEL_SetPal(HWND pHandle, const PALENTRY *pPal)__attribute__ ((warn_unused_result));
- /**
- * Get the attached palette to the handle. If it's NULL, the handle will refer to the default palette.
- * The palette is only valid when the drawn region is 16bit or 32bit.
- *
- * @param pHandle Handle to a control object.
- * @param ppPal Return the pointer of the current assigned palette entry.
- * @return GUI_SUCCESS if succeed, error code otherwise.
- */
- GUIResult_e GEL_GetPal(HWND pHandle, PALENTRY **ppPal)__attribute__ ((warn_unused_result));
- /**
- * Set an animation to be active or not.
- *
- * @param pHandle Handle to a control object.
- * @param bEnable Set the animation to be enable or not.
- * @return GUI_SUCCESS if succeed, error code otherwise.
- */
- GUIResult_e GEL_SetAnimEnable(HWND pHandle, BOOLEAN bEnable)__attribute__ ((warn_unused_result));
- /**
- * Set sleep control to be enable or not when rendering.
-
- * @param bEnable Set the sleep to be enable or not when rendering.
- * @return GUI_SUCCESS if succeed, error code otherwise.
- */
- GUIResult_e GEL_SetSleepEnable(BOOLEAN bEnable)__attribute__ ((warn_unused_result));
- /**
- * Set rotation type to icon control.
- *
- * @param pHandle Handle to a control.
- * @param eRotate Rotation type.
- * @return GUI_SUCCESS if succeed, error code otherwise.
- */
- GUIResult_e GEL_SetIconRotate(HWND pHandle, GEL_IconRotate_e eRotate)__attribute__ ((warn_unused_result));
- /**
- * Get GUI engine version. Four leveled version number: 4 8 8 12 bits individually.
- *
- * @param pdVersion Returned version number.
- */
- void GEL_GetVersion(UINT32 *pdVersion);
- /**
- * Set editbox twinkling period.
- *
- * @param btwinkleperiod Set the twinkling period (100ms)
- * @return GUI_SUCCESS if succeed, error code otherwise.
- */
- GUIResult_e GEL_SetTwinklePeriod(UINT8 btwinkleperiod)__attribute__ ((warn_unused_result));
- /**
- * Update all OSD changes to Panel .
- * @param None
- * @return GUI_SUCCESS if succeed, error code otherwise.
- */
- GUIResult_e GEL_UpdateOSD(void)__attribute__ ((warn_unused_result));
- /**
- * Enable or Disable OSD.
- *
- * @param stRgnHandle The target region handle.
- * @param ShowOSD
- * @return GUI_SUCCESS if succeed, error codes otherwise.
- */
- GUIResult_e GEL_SetDisplay(GEL_RgnHandle_t stRgnHandle, BOOL ShowOSD)__attribute__ ((warn_unused_result));
- /**
- * Render a control to a region buffer.
- *
- * @param pstDstBuf The handle of the destination buffer.
- * @param pSrcHandle The handle of the source control.
- * @param pstDstRect Desire area of the destination buffer to be drawn.
- * @return GUI_SUCCESS if succeed, error codes otherwise.
- */
- GUIResult_e GEL_RGNBUF_RenderControl(HWND pSrcHandle)__attribute__ ((warn_unused_result));
- /* Internal functions declaration */
- GUIResult_e GEL_RGNBUF_DrawString(RegionHandle_t *sdRegionHandle, UINT8 *pStr, GEL_DynStrType_e eStrType,
- GEL_TextInfo_t *pstTextInfo, GEL_VFInfo_t *pstVFInfo, PRECT pstDstRect, BOOLEAN bSubDraw, INT32* pBlockId);
- UINT8 GEL_GetgTwinklePeriod(void);
- GUIResult_e GEL_SetOSDLayer(UINT32 dRegionHandle, OSD_Layer_t layer);
- GUIResult_e GEL_GetOSDLayer(UINT32 dRegionHandle);
- GUIResult_e GEL_SetOSDTransparency(INT8 i8OSDTransparency);
- void GEL_SetFocusedStrBorderParam(UINT32 state, Color_t color, UINT32 icon_id);
- void GEL_SetFocusedBorderParam(UINT32 state, Color_t color, UINT32 icon_id);
- GUIResult_e GEL_WaitRollDone(HWND pHandle);
- #ifdef CONFIG_SUPPORT_FLIP_HORIZ
- typedef UINT8 (*IsFlipHorizFun)(void);
- GUIResult_e GEL_RegisterFlipHorizCallback(IsFlipHorizFun callback);
- RECT GEL_GetRegionAreaByHandle(HWND handle);
- #endif
- #endif /* __GEL_CONTROL__ */
|