region.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /** @file
  2. * Definition of region related information.
  3. *
  4. * @author mandy.wu
  5. * @version 0.1
  6. */
  7. #ifndef _REGION_H
  8. #define _REGION_H
  9. #include "datatypes.h"
  10. #include "gui_eng/font_common.h"
  11. //#include "gui_eng/device_gdi.h"
  12. #define ALPHA (0xFF)
  13. /* Regions */
  14. typedef enum {
  15. REGION_MENU_MIN = (1 << 0),
  16. REGION_LAST = 0x8000
  17. } Region_t;
  18. /* Osd window */
  19. typedef enum _OSD_Layer_t {
  20. OSD_LAYER1 = 0,
  21. OSD_LAYER2,
  22. OSD_LAYER3,
  23. OSD_SUBTITLE,
  24. OSD_LAYER_GAME,
  25. OSD_LAYER_ESTICKER,
  26. OSD_LAYER_LAST
  27. } OSD_Layer_t;
  28. /* Used to store the osd backup buffer info*/
  29. typedef struct _osd_backup_buffer_info
  30. {
  31. const BOOLEAN used_flag; /* indificate this buffer whether be used*/
  32. UINT8 *addresss; /* buffer addresss */
  33. const UINT16 backup_region_width;
  34. const UINT16 backup_region_height;
  35. const UINT32 buffer_size;
  36. } osd_backup_buffer_info;
  37. typedef struct _OSD_Layer_Memory_Size_info {
  38. const BOOLEAN used_flag; /* indificate this buffer whether be used*/
  39. const UINT32 mem_size; /* memory size on each OSD layer */
  40. } OSD_Layer_Memory_Size_info;
  41. typedef struct {
  42. UINT8 A;
  43. UINT8 R;
  44. UINT8 G;
  45. UINT8 B;
  46. } PALENTRY;
  47. typedef struct {
  48. UINT16 width; /* image width in pixels */
  49. UINT16 height; /* image height in pixels */
  50. UINT16 bpp; /* bits per pixel */
  51. UINT32 format; /* pixel format of the icon, see pixel_format_t */
  52. void *imagebits; /* must be 4 bytes aligned */
  53. UINT16 first; /* the started index number of the bitmap */
  54. UINT16 count; /* the color number of the bitmap */
  55. const PALENTRY *palette; /* palette for the icon */
  56. #ifdef CONFIG_FONT_ENGINE_HARFBUZZ
  57. UINT8 bFgColor; /* The index value of text filling color. */
  58. UINT8 bBgColor; /* The index value of text bg color. */
  59. #endif
  60. } IMAGEHDR, *PIMAGEHDR;
  61. typedef UINT8 ** OSDStringInfo_t;
  62. typedef struct {
  63. Region_t region; /* region index */
  64. RegionHandle_t handle; /* region handle index */
  65. INT16 x; /* x position of the region*/
  66. INT16 y; /* y position of the region */
  67. UINT16 width; /* width of the region */
  68. UINT16 height; /* height of the region */
  69. PixelFormat_e format; /* format of pixel value*/
  70. UINT8 bpp; /* bits per pixel */
  71. UINT8 transparency; /* 0~MAX_REGION_TRANSPARENCY 0: OPaque */
  72. UINT8 active;
  73. UINT8 preserve; /* Backup buffer indicator */
  74. const PALENTRY *palette; /* The palette for the region */
  75. const IMAGEHDR *bitmap; /* The bitmaps for the region */
  76. OSD_Layer_t osd_layer; /* OSD window layer */
  77. } RegionInfo_t;
  78. /* temporarily used by resource generated by uiDesign Tool */
  79. typedef RegionInfo_t region_info_t;
  80. #endif