Loading...
Searching...
No Matches
widget.h
Go to the documentation of this file.
1
6#pragma once
7#include <gui/view.h>
8#include "widget_elements/widget_element.h"
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14typedef struct Widget Widget;
15typedef struct WidgetElement WidgetElement;
16
21Widget* widget_alloc(void);
22
28void widget_free(Widget* widget);
29
34void widget_reset(Widget* widget);
35
43
55 Widget* widget,
56 uint8_t x,
57 uint8_t y,
58 Align horizontal,
59 Align vertical,
60 Font font,
61 const char* text);
62
74 Widget* widget,
75 uint8_t x,
76 uint8_t y,
77 Align horizontal,
78 Align vertical,
79 Font font,
80 const char* text);
81
98 Widget* widget,
99 uint8_t x,
100 uint8_t y,
101 uint8_t width,
102 uint8_t height,
103 Align horizontal,
104 Align vertical,
105 const char* text,
106 bool strip_to_dots);
107
123 Widget* widget,
124 uint8_t x,
125 uint8_t y,
126 uint8_t width,
127 uint8_t height,
128 const char* text);
129
139 Widget* widget,
140 GuiButtonType button_type,
141 const char* text,
142 ButtonCallback callback,
143 void* context);
144
152void widget_add_icon_element(Widget* widget, uint8_t x, uint8_t y, const Icon* icon);
153
164 Widget* widget,
165 uint8_t x,
166 uint8_t y,
167 uint8_t width,
168 uint8_t height,
169 uint8_t radius);
170
171#ifdef __cplusplus
172}
173#endif
Font
Fonts enumeration.
Definition canvas.h:25
Align
Alignment enumeration.
Definition canvas.h:36
Definition icon_i.h:9
Definition view_i.h:16
Definition widget_element_i.h:21
Definition widget.c:8
GUI: View API.
void widget_add_string_multiline_element(Widget *widget, uint8_t x, uint8_t y, Align horizontal, Align vertical, Font font, const char *text)
Add Multi String Element.
Definition widget.c:122
void widget_add_text_scroll_element(Widget *widget, uint8_t x, uint8_t y, uint8_t width, uint8_t height, const char *text)
Add Text Scroll Element.
Definition widget.c:166
void widget_add_icon_element(Widget *widget, uint8_t x, uint8_t y, const Icon *icon)
Add Icon Element.
Definition widget.c:191
void widget_add_frame_element(Widget *widget, uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint8_t radius)
Add Frame Element.
Definition widget.c:198
View * widget_get_view(Widget *widget)
Get Widget view.
Definition widget.c:103
void widget_free(Widget *widget)
Free Widget.
Definition widget.c:91
void widget_add_button_element(Widget *widget, GuiButtonType button_type, const char *text, ButtonCallback callback, void *context)
Add Button Element.
Definition widget.c:179
void widget_add_string_element(Widget *widget, uint8_t x, uint8_t y, Align horizontal, Align vertical, Font font, const char *text)
Add String Element.
Definition widget.c:136
void widget_reset(Widget *widget)
Reset Widget.
Definition widget.c:71
Widget * widget_alloc(void)
Allocate Widget that holds Widget Elements.
Definition widget.c:57
void widget_add_text_box_element(Widget *widget, uint8_t x, uint8_t y, uint8_t width, uint8_t height, Align horizontal, Align vertical, const char *text, bool strip_to_dots)
Add Text Box Element.
Definition widget.c:150