gui.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifndef __GUI_H__
  2. #define __GUI_H__
  3. //#define USE_12X12_FONT_ONLY
  4. #define GLCD_WIDTH 128
  5. #define GLCD_HEIGHT 130 //128
  6. //定义一�56颜色�RGB)
  7. #define COLOR_BLACK 0x000000
  8. #define COLOR_WHITE 0xFFFFFF
  9. #define COLOR_RED 0xFF0000
  10. #define COLOR_GREEN 0x00FF00
  11. #define COLOR_BLUE 0x0000FF
  12. #define COLOR_YELLOW 0x00FFFF
  13. #define COLOR_PURPLE 0x800080
  14. #define COLOR_STATUS_BAR 0x000000//0x8B0000
  15. #define COLOR_DEEP_GREEN 0x008040
  16. typedef enum{
  17. ARROW_LEFT,
  18. ARROW_RIGHT,
  19. ARROW_UP,
  20. ARROW_DOWN
  21. }ARROW_ENUM;
  22. typedef enum{
  23. FONT_MODE_12X12,
  24. FONT_MODE_16X16
  25. }FONT_MODEENUM;
  26. typedef enum{
  27. REVERSED_NO,
  28. REVERSED_YES
  29. }REV_ENUM;
  30. void guiInit(void);
  31. void guiClearAll(unsigned int colorID);
  32. void guiShowStr(unsigned short x, unsigned short y,const char *string, FONT_MODEENUM fontMode, REV_ENUM rev,unsigned int frontColorID,unsigned int backColorID);
  33. void guiShowButton(unsigned short x, unsigned short y,const char *str, FONT_MODEENUM fontMode,unsigned int buttonColorID, unsigned int strColorID);
  34. void guiFillRect(unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2,unsigned int colorData);
  35. void guiDrawHLine(unsigned short x1, unsigned short x2, unsigned short y, unsigned short ysize, unsigned int colorID);
  36. void guiDrawVLine(unsigned short y1, unsigned short y2, unsigned short x, unsigned short xsize, unsigned int colorID);
  37. void guiDrawRect(unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2,unsigned char width, unsigned int colorID);
  38. void guiDrawArrow(unsigned short x, unsigned short y,unsigned short len, ARROW_ENUM direction, unsigned int colorID);
  39. void guiShowCaption(unsigned short xType ,const char *str, unsigned short y, unsigned int frontColorID, unsigned int backColorID, FONT_MODEENUM fontMode);
  40. void guiShowBmp(unsigned short x, unsigned short y, char *bmp);
  41. void guiClearArea(unsigned short x, unsigned short y, unsigned short width, unsigned short height,unsigned int colorID);
  42. unsigned int guiGetBackColor(void);
  43. unsigned int guiGetForeColor(void);
  44. short guiGetStrXLen(char *str, FONT_MODEENUM fontMode);
  45. void guiClearRect(unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2, unsigned int colorData);
  46. void guiShowMessageBox(char *msg);
  47. void guiDrawQRimage(unsigned short x1, unsigned short y1,unsigned char multiple,unsigned char **data, int size);
  48. void guiTest(void);
  49. #endif