icon.h 986 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. * Check if icon animation is active
  32. */
  33. bool icon_is_animating(Icon* icon);
  34. /*
  35. * Start icon animation
  36. */
  37. void icon_start_animation(Icon* icon);
  38. /*
  39. * Stop icon animation
  40. */
  41. void icon_stop_animation(Icon* icon);
  42. /*
  43. * Get current frame
  44. */
  45. uint8_t icon_get_current_frame(Icon* icon);
  46. /*
  47. * Returns true if current frame is a last one
  48. */
  49. bool icon_is_last_frame(Icon* icon);
  50. #ifdef __cplusplus
  51. }
  52. #endif