12#define RECORD_CANVAS "CANVAS"
13#define CANVAS_MAX_PRIORITY LOADER_MAX_PRIORITY
14#define CANVAS_MAX_ELEMENTS 100
20 CanvasResultBadParameters,
21 CanvasResultLowPriority,
22 CanvasResultEmptyScreen,
23 CanvasResultTooManyElements,
24 CanvasResultNonexistentElementId,
25 CanvasResultWrongAppId,
31 CanvasElementTypeImage,
32 CanvasElementTypeAnimPlayer,
33 CanvasElementTypeText,
34 CanvasElementTypeCountdown,
35 CanvasElementTypeRectangle,
36 CanvasElementTypeRawImage,
49 CanvasElementType type;
54 FuriString* file_path;
59 FuriString* file_path;
61 AnimFilePlayFlag flags;
70 size_t scroll_rate_cpm;
71 size_t scroll_start_delay;
72 size_t scroll_repeat_delay;
78 CountdownDirection direction;
79 CountdownShowHour hours;
90 RectangleFillGradientH,
91 RectangleFillGradientV,
115 if(obj->type == CanvasElementTypeImage) {
116 if(obj->image.file_path) furi_string_free(obj->image.file_path);
117 }
else if(obj->type == CanvasElementTypeText) {
118 if(obj->text.text_str) free(obj->text.text_str);
119 if(obj->text.font_path) free(obj->text.font_path);
120 }
else if(obj->type == CanvasElementTypeAnimPlayer) {
121 if(obj->anim_player.file_path) furi_string_free(obj->anim_player.file_path);
122 if(obj->anim_player.section) furi_string_free(obj->anim_player.section);
123 }
else if(obj->type == CanvasElementTypeRawImage) {
124 if(obj->raw_image.data) free(obj->raw_image.data);
130 if(src->id) obj->id = strdup(src->id);
131 if(src->type == CanvasElementTypeImage) {
132 if(src->image.file_path) {
133 obj->image.file_path = furi_string_alloc_set(src->image.file_path);
135 }
else if(src->type == CanvasElementTypeText) {
136 if(src->text.text_str) obj->text.text_str = strdup(src->text.text_str);
137 if(src->text.font_path) obj->text.font_path = strdup(src->text.font_path);
138 }
else if(src->type == CanvasElementTypeAnimPlayer) {
139 if(src->anim_player.file_path) {
140 obj->anim_player.file_path = furi_string_alloc_set(src->anim_player.file_path);
142 if(src->anim_player.section) {
143 obj->anim_player.section = furi_string_alloc_set(src->anim_player.section);
145 }
else if(src->type == CanvasElementTypeRawImage) {
146 if(src->raw_image.data) {
147 obj->raw_image.data = malloc(src->raw_image.data_size);
148 memcpy(obj->raw_image.data, src->raw_image.data, src->raw_image.data_size);
158 CLEAR(API_2(canvas_element_clear)),
159 INIT_SET(API_6(canvas_element_clone))))
161typedef void (*CanvasDrawCallback)(CanvasResult result,
void* ctx);
163CanvasResult canvas_show_elements(
167 CanvasElementsArray_t elements);
169void canvas_show_elements_async(
173 CanvasElementsArray_t elements,
174 CanvasDrawCallback callback,
191 canvas_delete_elements(
CanvasSrv* canvas,
const char* app_id,
const char*
const* element_ids);
193CanvasResult canvas_get_app_id(
CanvasSrv* canvas, FuriString*
string);
195void canvas_set_clear_on_back(
CanvasSrv* canvas,
bool is_clear_on_back);
A widget that plays an AnimFile.
A widget that displays time until or from the specified timestamp.
GuiDisplayId
Enumeration of available display identifiers.
Definition gui.h:18
A widget that displays a static image.
ImageColorFormat
Pixel format of raw image data passed to image_set_source_raw().
Definition image.h:17
Definition canvas/canvas.h:41
Definition canvas/canvas.c:48
RGB color structure.
Definition color.h:42
TIME (Simple Network Time Protocol) service API.