ui.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #pragma once
  2. #include <gui/gui.h>
  3. #include <toolbox/compress.h>
  4. #define GUI_DISPLAY_WIDTH 128
  5. #define GUI_DISPLAY_HEIGHT 64
  6. #define GUI_DISPLAY_CENTER_X 64
  7. typedef struct {
  8. uint8_t offset_x;
  9. uint8_t offset_y;
  10. uint8_t width;
  11. uint8_t height;
  12. } BoundingBox;
  13. void set_bounding_box(
  14. BoundingBox* box,
  15. uint8_t offset_x,
  16. uint8_t offset_y,
  17. uint8_t width,
  18. uint8_t height);
  19. const Icon* tile_to_icon(uint8_t tile, bool gameOver);
  20. void gray_canvas(Canvas* const canvas);
  21. void mask_canvas(Canvas* const canvas, uint8_t sx, uint8_t sy, uint8_t w, uint8_t h);
  22. void canvas_draw_hline_dotted(Canvas* const canvas, uint8_t x, uint8_t y, uint8_t w);
  23. void canvas_draw_vline_dotted(Canvas* const canvas, uint8_t x, uint8_t y, uint8_t h);
  24. void elements_button_right_back(Canvas* canvas, const char* str);
  25. void elements_multiline_text_aligned_limited(
  26. Canvas* canvas,
  27. BoundingBox* box,
  28. uint8_t x,
  29. uint8_t y,
  30. uint8_t h,
  31. Align horizontal,
  32. Align vertical,
  33. const char* text);
  34. void hint_pill_single(Canvas* canvas, const char* str);
  35. void hint_pill_double(Canvas* canvas, const char* str1, const char* str2, const Icon* icon);
  36. void menu_pill(
  37. Canvas* canvas,
  38. int no,
  39. int count,
  40. bool selected,
  41. bool masked,
  42. const char* label,
  43. const Icon* icon);
  44. void main_menu_pill(
  45. Canvas* canvas,
  46. uint8_t y,
  47. uint8_t w,
  48. bool selected,
  49. bool leftIni,
  50. bool rightIndi,
  51. const char* label);
  52. void panel_histogram(Canvas* canvas, const char* bricks, const uint8_t* values);
  53. uint8_t dialog_frame(
  54. Canvas* canvas,
  55. uint8_t w,
  56. uint8_t h,
  57. bool bigHeader,
  58. bool safeFrame,
  59. const char* label);