gui.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #ifndef __GUI_H__
  2. #define __GUI_H__
  3. //#define USE_12X12_FONT_ONLY
  4. #define GLCD_WIDTH 160
  5. #define GLCD_HEIGHT 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 0x8B0000
  15. typedef enum{
  16. ARROW_LEFT,
  17. ARROW_RIGHT,
  18. ARROW_UP,
  19. ARROW_DOWN
  20. }ARROW_ENUM;
  21. typedef enum{
  22. FONT_MODE_12X12,
  23. FONT_MODE_16X16
  24. }FONT_MODEENUM;
  25. typedef enum{
  26. REVERSED_NO,
  27. REVERSED_YES
  28. }REV_ENUM;
  29. void guiInit(void);
  30. void guiClearAll(unsigned int colorID);
  31. void guiShowStr(unsigned short x, unsigned short y,const char *string, FONT_MODEENUM fontMode, REV_ENUM rev,unsigned int frontColorID,unsigned int backColorID);
  32. void guiShowButton(unsigned short x, unsigned short y,const char *str, FONT_MODEENUM fontMode,unsigned int buttonColorID, unsigned int strColorID);
  33. void guiFillRect(unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2,unsigned int colorData);
  34. void guiDrawHLine(unsigned short x1, unsigned short x2, unsigned short y, unsigned short ysize, unsigned int colorID);
  35. void guiDrawVLine(unsigned short y1, unsigned short y2, unsigned short x, unsigned short xsize, unsigned int colorID);
  36. void guiDrawRect(unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2,unsigned char width, unsigned int colorID);
  37. void guiDrawArrow(unsigned short x, unsigned short y,unsigned short len, ARROW_ENUM direction, unsigned int colorID);
  38. void guiShowCaption(unsigned short xType ,const char *str, unsigned short y, unsigned int frontColorID, unsigned int backColorID, FONT_MODEENUM fontMode);
  39. void guiShowBmp(unsigned short x, unsigned short y, char *bmp);
  40. void guiClearArea(unsigned short x, unsigned short y, unsigned short width, unsigned short height,unsigned int colorID);
  41. unsigned int guiGetBackColor(void);
  42. unsigned int guiGetForeColor(void);
  43. short guiGetStrXLen(char *str, FONT_MODEENUM fontMode);
  44. void guiClearRect(unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2, unsigned int colorData);
  45. void guiShowMessageBox(char *msg);
  46. void guiDrawQRimage(unsigned short x1, unsigned short y1,unsigned char multiple,unsigned char **data, int size);
  47. void guiDrawPngImage(unsigned char x, unsigned char y,unsigned char width,unsigned char height,char* bmpBuf);
  48. void guiLefItem(unsigned int x,int y,unsigned int frontColorID, unsigned int backColorID, FONT_MODEENUM fontMode,char *str);
  49. int guishow_png(unsigned short x,unsigned short y,char* filename);
  50. void guiTest(void);
  51. #endif