icon.h 905 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #pragma once
  2. #include <stdint.h>
  3. #include <stdbool.h>
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. typedef struct IconData IconData;
  8. typedef struct Icon Icon;
  9. /*
  10. * Allocate icon instance with const icon data.
  11. * always returns Icon or stops system if not enough memory
  12. */
  13. Icon* icon_alloc(const IconData* data);
  14. /*
  15. * Release icon instance
  16. */
  17. void icon_free(Icon* icon);
  18. /*
  19. * Get icon width
  20. */
  21. uint8_t icon_get_width(Icon* icon);
  22. /*
  23. * Get icon height
  24. */
  25. uint8_t icon_get_height(Icon* icon);
  26. /*
  27. * Check if icon is animated
  28. */
  29. bool icon_is_animated(Icon* icon);
  30. /*
  31. * Start icon animation
  32. */
  33. void icon_start_animation(Icon* icon);
  34. /*
  35. * Stop icon animation
  36. */
  37. void icon_stop_animation(Icon* icon);
  38. /*
  39. * Get current frame
  40. */
  41. uint8_t icon_get_current_frame(Icon* icon);
  42. /*
  43. * Returns true if current frame is a last one
  44. */
  45. bool icon_is_last_frame(Icon* icon);
  46. #ifdef __cplusplus
  47. }
  48. #endif