Flipper Zero Firmware
Loading...
Searching...
No Matches
elements.h
Go to the documentation of this file.
1
9#pragma once
10
11#include <stdint.h>
12#include <furi.h>
13#include "canvas.h"
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19#define ELEMENTS_MAX_LINES_NUM (7)
20#define ELEMENTS_BOLD_MARKER '#'
21#define ELEMENTS_MONO_MARKER '*'
22#define ELEMENTS_INVERSE_MARKER '!'
23
32void elements_progress_bar(Canvas* canvas, int32_t x, int32_t y, size_t width, float progress);
33
44 Canvas* canvas,
45 int32_t x,
46 int32_t y,
47 size_t width,
48 float progress,
49 const char* text);
50
61 Canvas* canvas,
62 int32_t x,
63 int32_t y,
64 size_t height,
65 size_t pos,
66 size_t total);
67
75void elements_scrollbar(Canvas* canvas, size_t pos, size_t total);
76
83void elements_frame(Canvas* canvas, int32_t x, int32_t y, size_t width, size_t height);
84
90void elements_button_left(Canvas* canvas, const char* str);
91
97void elements_button_right(Canvas* canvas, const char* str);
98
104void elements_button_center(Canvas* canvas, const char* str);
105
114 Canvas* canvas,
115 int32_t x,
116 int32_t y,
117 Align horizontal,
118 Align vertical,
119 const char* text);
120
128void elements_multiline_text(Canvas* canvas, int32_t x, int32_t y, const char* text);
129
137void elements_multiline_text_framed(Canvas* canvas, int32_t x, int32_t y, const char* text);
138
148 Canvas* canvas,
149 int32_t x,
150 int32_t y,
151 size_t width,
152 size_t height);
153
163 Canvas* canvas,
164 int32_t x,
165 int32_t y,
166 size_t width,
167 size_t height);
168
177void elements_bold_rounded_frame(Canvas* canvas, int32_t x, int32_t y, size_t width, size_t height);
178
187void elements_bubble(Canvas* canvas, int32_t x, int32_t y, size_t width, size_t height);
188
199 Canvas* canvas,
200 int32_t x,
201 int32_t y,
202 const char* text,
203 Align horizontal,
204 Align vertical);
205
212void elements_string_fit_width(Canvas* canvas, FuriString* string, size_t width);
213
225 Canvas* canvas,
226 int32_t x,
227 int32_t y,
228 size_t width,
229 FuriString* string,
230 size_t scroll,
231 bool ellipsis);
232
249 Canvas* canvas,
250 int32_t x,
251 int32_t y,
252 size_t width,
253 size_t height,
254 Align horizontal,
255 Align vertical,
256 const char* text,
257 bool strip_to_dots);
258
259#ifdef __cplusplus
260}
261#endif
GUI: Canvas API.
Align
Alignment enumeration.
Definition canvas.h:36
void elements_scrollbar(Canvas *canvas, size_t pos, size_t total)
Draw scrollbar on canvas.
Definition elements.c:95
void elements_text_box(Canvas *canvas, int32_t x, int32_t y, size_t width, size_t height, Align horizontal, Align vertical, const char *text, bool strip_to_dots)
Draw text box element.
Definition elements.c:635
void elements_button_center(Canvas *canvas, const char *str)
Draw button in center.
Definition elements.c:188
void elements_button_right(Canvas *canvas, const char *str)
Draw button in right corner.
Definition elements.c:160
void elements_scrollbar_pos(Canvas *canvas, int32_t x, int32_t y, size_t height, size_t pos, size_t total)
Draw scrollbar on canvas at specific position.
Definition elements.c:69
void elements_multiline_text_aligned(Canvas *canvas, int32_t x, int32_t y, Align horizontal, Align vertical, const char *text)
Draw aligned multiline text.
Definition elements.c:267
void elements_bubble_str(Canvas *canvas, int32_t x, int32_t y, const char *text, Align horizontal, Align vertical)
Draw bubble frame for text with corner.
Definition elements.c:435
void elements_slightly_rounded_box(Canvas *canvas, int32_t x, int32_t y, size_t width, size_t height)
Draw slightly rounded box.
Definition elements.c:378
void elements_progress_bar_with_text(Canvas *canvas, int32_t x, int32_t y, size_t width, float progress, const char *text)
Draw progress bar with text.
Definition elements.c:44
void elements_button_left(Canvas *canvas, const char *str)
Draw button in left corner.
Definition elements.c:132
void elements_scrollable_text_line(Canvas *canvas, int32_t x, int32_t y, size_t width, FuriString *string, size_t scroll, bool ellipsis)
Draw scrollable text line.
Definition elements.c:585
void elements_slightly_rounded_frame(Canvas *canvas, int32_t x, int32_t y, size_t width, size_t height)
Draw slightly rounded frame.
Definition elements.c:368
void elements_progress_bar(Canvas *canvas, int32_t x, int32_t y, size_t width, float progress)
Draw progress bar.
Definition elements.c:29
void elements_multiline_text(Canvas *canvas, int32_t x, int32_t y, const char *text)
Draw multiline text.
Definition elements.c:319
void elements_multiline_text_framed(Canvas *canvas, int32_t x, int32_t y, const char *text)
Draw framed multiline text.
Definition elements.c:342
void elements_frame(Canvas *canvas, int32_t x, int32_t y, size_t width, size_t height)
Draw rounded frame.
Definition elements.c:118
void elements_bubble(Canvas *canvas, int32_t x, int32_t y, size_t width, size_t height)
Draw bubble frame for text.
Definition elements.c:424
void elements_string_fit_width(Canvas *canvas, FuriString *string, size_t width)
Trim string buffer to fit width in pixels.
Definition elements.c:570
void elements_bold_rounded_frame(Canvas *canvas, int32_t x, int32_t y, size_t width, size_t height)
Draw bold rounded frame.
Definition elements.c:388
Canvas structure.
Definition canvas_i.h:40
Definition string.c:4