gui: allow custom add_child callback

This commit is contained in:
Xavier Del Campo Romero 2022-07-02 00:45:51 +02:00
parent d55fb31e21
commit ec9f41f1ab
2 changed files with 4 additions and 0 deletions

View File

@ -12,6 +12,7 @@ extern "C"
struct gui_common
{
void (*add_child)(struct gui_common *parent, struct gui_common *child);
int (*update)(struct gui_common *, const union peripheral *,
const struct camera *);
int (*render)(const struct gui_common *);

View File

@ -69,6 +69,9 @@ void gui_add_child(struct gui_common *const p,
p->child = c;
c->parent = p;
if (p->add_child)
p->add_child(p, c);
}
int gui_update(struct gui_common *const g, const union peripheral *const p,