gui.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef __GUI_H__
  2. #define __GUI_H__
  3. #define GLCD_WIDTH 160
  4. #define GLCD_HEIGHT 128
  5. //定义一�56颜色�RGB)
  6. #define COLOR_BLACK 0x000000
  7. #define COLOR_WHITE 0xFFFFFF
  8. #define COLOR_RED 0xFF0000
  9. #define COLOR_GREEN 0x00FF00
  10. #define COLOR_BLUE 0x0000FF
  11. #define COLOR_YELLOW 0x00FFFF
  12. #define COLOR_PURPLE 0x800080
  13. #define COLOR_GRAY 0xa4a4a4
  14. #define COLOR_STATUS_BAR 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 guiShowTwoMessage(char *msg1, char *msg2);
  48. void guiTest(void);
  49. #endif