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
108void elements_button_up(Canvas* canvas, const char* str);
109
119void elements_button_down(Canvas* canvas, const char* str);
120
126void elements_button_center(Canvas* canvas, const char* str);
127
136 Canvas* canvas,
137 int32_t x,
138 int32_t y,
139 Align horizontal,
140 Align vertical,
141 const char* text);
142
150void elements_multiline_text(Canvas* canvas, int32_t x, int32_t y, const char* text);
151
159void elements_multiline_text_framed(Canvas* canvas, int32_t x, int32_t y, const char* text);
160
170 Canvas* canvas,
171 int32_t x,
172 int32_t y,
173 size_t width,
174 size_t height);
175
185 Canvas* canvas,
186 int32_t x,
187 int32_t y,
188 size_t width,
189 size_t height);
190
199void elements_bold_rounded_frame(Canvas* canvas, int32_t x, int32_t y, size_t width, size_t height);
200
209void elements_bubble(Canvas* canvas, int32_t x, int32_t y, size_t width, size_t height);
210
221 Canvas* canvas,
222 int32_t x,
223 int32_t y,
224 const char* text,
225 Align horizontal,
226 Align vertical);
227
234void elements_string_fit_width(Canvas* canvas, FuriString* string, size_t width);
235
247 Canvas* canvas,
248 int32_t x,
249 int32_t y,
250 size_t width,
251 FuriString* string,
252 size_t scroll,
253 bool ellipsis);
254
271 Canvas* canvas,
272 int32_t x,
273 int32_t y,
274 size_t width,
275 size_t height,
276 Align horizontal,
277 Align vertical,
278 const char* text,
279 bool strip_to_dots);
280
281#ifdef __cplusplus
282}
283#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:699
void elements_button_center(Canvas *canvas, const char *str)
Draw button in center.
Definition elements.c:252
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:331
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:499
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:442
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:649
void elements_button_up(Canvas *canvas, const char *str)
This function draws a button in the top left corner of the canvas with icon and string.
Definition elements.c:188
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:432
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_button_down(Canvas *canvas, const char *str)
This function draws a button in the top right corner of the canvas with icon and string.
Definition elements.c:220
void elements_multiline_text(Canvas *canvas, int32_t x, int32_t y, const char *text)
Draw multiline text.
Definition elements.c:383
void elements_multiline_text_framed(Canvas *canvas, int32_t x, int32_t y, const char *text)
Draw framed multiline text.
Definition elements.c:406
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:488
void elements_string_fit_width(Canvas *canvas, FuriString *string, size_t width)
Trim string buffer to fit width in pixels.
Definition elements.c:634
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:452
Canvas structure.
Definition canvas_i.h:40
Definition string.c:4