2021-07-07 08:57:49 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <assets_icons.h>
|
|
|
|
|
|
|
|
typedef struct IconAnimation IconAnimation;
|
|
|
|
|
2021-10-02 17:00:56 +00:00
|
|
|
typedef void (*IconAnimationCallback)(IconAnimation* instance, void* context);
|
|
|
|
|
|
|
|
/** Allocate icon animation instance with const icon data.
|
2021-07-07 08:57:49 +00:00
|
|
|
* always returns Icon or stops system if not enough memory
|
|
|
|
*/
|
|
|
|
IconAnimation* icon_animation_alloc(const Icon* icon);
|
|
|
|
|
2021-10-02 17:00:56 +00:00
|
|
|
/** Release icon animation instance
|
2021-07-07 08:57:49 +00:00
|
|
|
*/
|
|
|
|
void icon_animation_free(IconAnimation* instance);
|
|
|
|
|
2021-10-02 17:00:56 +00:00
|
|
|
/** Get icon animation width
|
2021-07-07 08:57:49 +00:00
|
|
|
*/
|
2021-10-02 17:00:56 +00:00
|
|
|
void icon_animation_set_update_callback(
|
|
|
|
IconAnimation* instance,
|
|
|
|
IconAnimationCallback callback,
|
|
|
|
void* context);
|
2021-07-07 08:57:49 +00:00
|
|
|
|
2021-10-02 17:00:56 +00:00
|
|
|
/** Get icon animation width
|
2021-07-07 08:57:49 +00:00
|
|
|
*/
|
2021-10-02 17:00:56 +00:00
|
|
|
uint8_t icon_animation_get_width(IconAnimation* instance);
|
2021-07-07 08:57:49 +00:00
|
|
|
|
2021-10-02 17:00:56 +00:00
|
|
|
/** Get icon animation height
|
2021-07-07 08:57:49 +00:00
|
|
|
*/
|
2021-10-02 17:00:56 +00:00
|
|
|
uint8_t icon_animation_get_height(IconAnimation* instance);
|
2021-07-07 08:57:49 +00:00
|
|
|
|
2021-10-02 17:00:56 +00:00
|
|
|
/** Start icon animation
|
2021-07-07 08:57:49 +00:00
|
|
|
*/
|
|
|
|
void icon_animation_start(IconAnimation* instance);
|
|
|
|
|
2021-10-02 17:00:56 +00:00
|
|
|
/** Stop icon animation
|
2021-07-07 08:57:49 +00:00
|
|
|
*/
|
|
|
|
void icon_animation_stop(IconAnimation* instance);
|
|
|
|
|
2021-10-02 17:00:56 +00:00
|
|
|
/** Returns true if current frame is a last one
|
2021-07-07 08:57:49 +00:00
|
|
|
*/
|
|
|
|
bool icon_animation_is_last_frame(IconAnimation* instance);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|