cc_font.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*****************************************************************************
  2. ** File: cc_font.h
  3. **
  4. ** Description: Contains prototypes for CC font related APIs.
  5. **
  6. ** Copyright(c) 2008 Sunmedia Technologies - All Rights Reserved
  7. **
  8. ** Author : jun.luo
  9. **
  10. ** $Id: cc_font.h,v 1.4 2009/03/13 09:13:43 junluo Exp $
  11. *****************************************************************************/
  12. #ifndef _CC_FONT_H_
  13. #define _CC_FONT_H_
  14. #include "gui_eng/stddefs.h"
  15. #include "gui_eng/gui_engine.h"
  16. typedef struct {
  17. FONTStyle_t cc_font_style;
  18. FONTSize_t cc_font_size;
  19. BOOLEAN cc_italic_flag; //junluo 08/12/22
  20. BOOLEAN cc_underline_flag; //junluo 08/12/22
  21. Color_t font_fg_color;
  22. Color_t font_bg_color;
  23. Color_t fill_color;
  24. } cc_font_settings_t;
  25. /* Used to control italic slope for italic style */
  26. //#define SLOPE_RATE (5) //junluo 08/12/22
  27. /* CC pallete Color #defines */
  28. #define COLOR_TRANSPARENT (0)
  29. #define COLOR_BLACK (129)
  30. #define COLOR_WHITE (66)
  31. #define COLOR_RED (126)
  32. #define COLOR_BLUE (81)
  33. #define COLOR_GREEN (117)
  34. #define COLOR_YELLOW (114)
  35. #define COLOR_MAGENTA (78)
  36. #define COLOR_CYAN (69)
  37. #define COLOR_GREY (65)
  38. #define COLOR_DESERT (130)
  39. typedef enum
  40. {
  41. COLOR_INDEX_INVALID = -1,
  42. COLOR_INDEX_FOUND = 0,
  43. //COLOR_INDEX_ADDED
  44. } pal_ret_t;
  45. /* Global variables */
  46. extern const PALENTRY cc_palette[];
  47. /* cc_font.c */
  48. INT32 set_cc_font_style(FONTSize_t font_size, FONTStyle_t font_style,
  49. BOOLEAN italic_flag, BOOLEAN underline_flag);
  50. INT32 set_cc_font_fg_bg_color(UINT32 cc_fgColor, UINT32 cc_bgColor);
  51. INT32 GDI_fill_rect_with_true_color(HDC hdc, RECT *rect, UINT32 color, INT32 *pBlockId);
  52. INT32 GDI_draw_rect_with_true_color(HDC hdc, UINT32 rect_x, UINT32 rect_y,
  53. UINT32 rect_width, UINT32 rect_height, INT32 border_width, UINT32 color, INT32 *pBlockId);
  54. INT32 FONT_get_cc_char_size(HDC hdc, UINT16 uch, GENG_TextInfo_t *pstTextInfo, UINT16 *data_width, UINT16 *data_height);
  55. INT32 FONT_get_cc_string_size(HDC hdc, UINT8 *str, GENG_TextInfo_t *pstTextInfo, UINT16 *str_width, UINT16 *str_height);
  56. INT32 FONT_char_ccdisplay(HDC hdc, UINT16 uch, GENG_TextInfo_t *pstTextInfo, UINT8 bBgColor, UINT32 x_pos, UINT32 y_pos, INT32 *pBlockId);
  57. INT32 FONT_string_ccdisplay(HDC hdc, UINT8 *string, GENG_TextInfo_t *pstTextInfo, UINT8 bBgColor, UINT32 x_pos, UINT32 y_pos, INT32 *pBlockId);
  58. pal_ret_t get_color_index(PALENTRY *palette, UINT32 color, UINT16 *index);
  59. #endif /* _CC_FONT_H_ */
  60. /*****************************************************************************
  61. ** $Log: cc_font.h,v $
  62. ** Revision 1.4 2009/03/13 09:13:43 junluo
  63. ** porting in phase 4 gui engine
  64. **
  65. ** Revision 1.2 2009/02/26 06:58:40 junluo
  66. ** adjust widgets and font engine's data structure to new demand
  67. **
  68. ** Revision 1.1.1.1 2009/02/10 06:06:49 junluo
  69. ** Used to implement the fourth development of Gui Engine
  70. **
  71. ** Revision 1.3 2008/12/22 12:11:55 junluo
  72. ** Added cc italic and underline display support
  73. **
  74. ** Revision 1.2 2008/10/24 08:03:57 anlzhao
  75. ** Modify FONT_get_cc_char_size prototype
  76. **
  77. ** Revision 1.1 2008/10/22 12:25:13 anlzhao
  78. ** Add cc_font.h to support cc font
  79. **
  80. **
  81. *****************************************************************************/