gel_region.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /** @file
  2. * Header file for GEL region handling API.
  3. *
  4. * @author mandy.wu 2010/03/30 (GEL_CreateRegionEx only on OSD layer2)
  5. * @version 0.1
  6. */
  7. #ifndef __GEL_REGION__
  8. #define __GEL_REGION__
  9. #include "gui_eng/stddefs.h"
  10. #include "gui_eng/gui_engine.h"
  11. #define GUI_MAX_REGIONS (12) // SUPPORT_OSD_REGION + SUPPORT_G2D_REGION in osd8600_hw.h
  12. /* Global variables for region handling */
  13. extern const UINT8 gRegions;
  14. extern RegionParams_t gRegionDetails[GUI_MAX_REGIONS];
  15. /**
  16. * Get current panel width and height.
  17. *
  18. * @param pwWidth The width of OSD plane.
  19. * @param pwHeight The height of OSD plane.
  20. */
  21. GUIResult_e GEL_GetOsdPlaneSize (UINT16 *pwWidth, UINT16 *pwHeight)__attribute__ ((warn_unused_result));
  22. /**
  23. * Resize the UI from the original size to the desired size.
  24. *
  25. * @param wWidth The original width of UI.
  26. * @param wHeight The original height of UI.
  27. * @param wTargetWidth The desired width of UI to be scaled.
  28. * @param wTargetHeight The desired height of UI to be scaled.
  29. * @return GUI_SUCCESS if succeed, error code otherwise.
  30. */
  31. GUIResult_e GEL_ResizeUI(OSD_Layer_t osd_layer, UINT16 wWidth, UINT16 wHeight, UINT16 wTargetWidth,
  32. UINT16 wTargetHeight) __attribute__ ((warn_unused_result));
  33. /**
  34. * Get the region index from a window control.
  35. *
  36. * @param pWinCtrl Pointer to WinControl_t of a menu/popup.
  37. * @param pRegionIndex Return the region index of a win_control.
  38. * @return The region index belongs to a menu.
  39. */
  40. GUIResult_e GEL_GetRegionIndex(WinControl_t *pWinCtrl, UINT32 *pRegionIndex)__attribute__ ((warn_unused_result));
  41. /**
  42. * Create a region with the specific region index from UI resources.
  43. *
  44. * @param pRegionInfo Region information
  45. * @param dRegionIndex Region index
  46. * @param pRegionHandle Returned region handle.
  47. * @return GUI_SUCCESS if succeed, error code otherwise.
  48. */
  49. GUIResult_e GEL_CreateRegion (RegionInfo_t *pRegionInfo, UINT32 dRegionIndex,
  50. RegionHandle_t* pRegionHandle)__attribute__ ((warn_unused_result));
  51. /**
  52. * Create a region on OSD layer1/2. Only support LUT8/ARGB4444/ARGB format regions.
  53. *
  54. * @param eLayer The region layer to be created.
  55. * @param eFormat Format of the region to be created.
  56. * @param wWidth Width(pixel) of the region to be created.
  57. * @param wHeight Height(pixel) of the region to be created.
  58. * @param pRegionHandle The returned region handle.
  59. * @return GUI_SUCCESS if succeed, error code otherwise.
  60. */
  61. GUIResult_e GEL_CreateRegionEx(OSD_Layer_t eLayer, GEL_PixelFormat_e eFormat,
  62. UINT16 wWidth, UINT16 wHeight, RegionHandle_t * pRegionHandle)
  63. __attribute__ ((warn_unused_result));
  64. /**
  65. * Destroy a created region by its region handle.
  66. *
  67. * @param sdRegionHandle The region handle index of a region to be closed.
  68. * @return GUI_SUCCESS if succeed, error code otherwise.
  69. */
  70. GUIResult_e GEL_CloseRegion (RegionHandle_t sdRegionHandle)__attribute__ ((warn_unused_result));
  71. /**
  72. * Get the region_handle from a region_index to a region_info array.
  73. *
  74. * @param pRegionInfo Region information
  75. * @param dRegionIndex Region index
  76. * @param pRegionHandle Returned region handle.
  77. * @return GUI_SUCCESS if succeed, error code otherwise.
  78. */
  79. GUIResult_e GEL_GetRegionHandle(RegionInfo_t *pRegionInfo, INT32 sdRegionIndex,
  80. RegionHandle_t *pRegionHandle)__attribute__ ((warn_unused_result));
  81. /**
  82. * Move a region to the given x and y position.
  83. *
  84. * @param sdRegionHandle The region handle index of a region to be moved.
  85. * @param swXPos x coordinate to be moved to.
  86. * @param swYPos y coordinate to be moved to.
  87. * @return GUI_SUCCESS if succeed, error code otherwise.
  88. */
  89. GUIResult_e GEL_MoveRegion (RegionHandle_t sdRegionHandle, INT16 swXPos, INT16 swYPos)__attribute__ ((warn_unused_result));
  90. /**
  91. * Change the region's palette to the given palette.
  92. *
  93. * @param sdRegionHandle The region handle index of a region to be moved.
  94. * @param pPal The pointer to a palette which is generated by uiDesign tool.
  95. * @return GUI_SUCCESS if succeed, error code otherwise.
  96. */
  97. GUIResult_e GEL_SetRegionPal(RegionHandle_t sdRegionHandle, const PALENTRY *pPal)__attribute__ ((warn_unused_result));
  98. /**
  99. * Set a transparency value to an OSD region.
  100. *
  101. * @param sdRegionHandle The region handle index of an OSD region.
  102. * @param bTransValue The transparency value to be set to the OSD region.
  103. * @param bEnable Wether to enable the OSD region blend mode.
  104. * @return GUI_SUCCESS if succeed, error code otherwise.
  105. */
  106. GUIResult_e GEL_SetRegionTransparency(RegionHandle_t sdRegionHandle, UINT8 bTransValue,
  107. BOOLEAN bEnable)__attribute__ ((warn_unused_result));
  108. /**
  109. * Get the position and width/height of a region related to an OSD/G2D plane.
  110. *
  111. * @param sdRegionHandle The region handle index of an OSD region.
  112. * @param pstRect Return the position and width/height coordinate of the region.
  113. * @return GUI_SUCCESS if succeed, error code otherwise.
  114. */
  115. GUIResult_e GEL_GetRegionArea(RegionHandle_t sdRegionHandle, PRECT pstRect)__attribute__ ((warn_unused_result));
  116. #endif /* __GEL_REGION__ */