elements.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #pragma once
  2. #include <stdint.h>
  3. #include "canvas.h"
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. /*
  8. * Draw scrollbar on canvas.
  9. * width 3px, height equal to canvas height
  10. * @param pos - current element of total elements
  11. * @param total - total elements
  12. */
  13. void elements_scrollbar(Canvas* canvas, uint8_t pos, uint8_t total);
  14. /*
  15. * Draw rounded frame
  16. * @param x, y - top left corner coordinates
  17. * @param width, height - frame width and height
  18. */
  19. void elements_frame(Canvas* canvas, uint8_t x, uint8_t y, uint8_t width, uint8_t height);
  20. /*
  21. * Draw button in left corner
  22. * @param str - button text
  23. */
  24. void elements_button_left(Canvas* canvas, const char* str);
  25. /*
  26. * Draw button in right corner
  27. * @param str - button text
  28. */
  29. void elements_button_right(Canvas* canvas, const char* str);
  30. /*
  31. * Draw button in center
  32. * @param str - button text
  33. */
  34. void elements_button_center(Canvas* canvas, const char* str);
  35. /*
  36. * Draw aligned multiline text
  37. * @param x, y - coordinates based on align param
  38. * @param horizontal, vertical - aligment of multiline text
  39. * @param text - string (possible multiline)
  40. */
  41. void elements_multiline_text_aligned(
  42. Canvas* canvas,
  43. uint8_t x,
  44. uint8_t y,
  45. Align horizontal,
  46. Align vertical,
  47. const char* text);
  48. /*
  49. * Draw multiline text
  50. * @param x, y - top left corner coordinates
  51. * @param text - string (possible multiline)
  52. */
  53. void elements_multiline_text(Canvas* canvas, uint8_t x, uint8_t y, char* text);
  54. #ifdef __cplusplus
  55. }
  56. #endif