summaryrefslogtreecommitdiff
path: root/fw/fe310/eos/eve/widget/widgets.h
blob: 2f8d3cae30ed5e00f1c0d1b11b78a97c6037820f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include "label.h"
#include "widget.h"

#include "freew.h"
#include "spacerw.h"
#include "pagew.h"
#include "strw.h"
#include "textw.h"
#include "selectw.h"

typedef union EVEWidgetSpecT {
    EVEFreeSpec free;
    EVESpacerSpec spacer;
    EVEPageSpec page;
    EVEStrSpec str;
    EVETextSpec text;
    EVESelectSpec select;
} EVEWidgetSpecT;

typedef struct EVELabelSpec {
    EVERect g;
    EVEFont *font;
    char *title;
} APPLabelSpec;

typedef struct EVEWidgetSpec {
    APPLabelSpec label;
    struct {
        EVERect g;
        EVEWidgetSpecT spec;
        uint8_t type;
    } widget;
} EVEWidgetSpec;

typedef int (*eve_widget_create_t) (EVEWidget *, EVERect *, EVEPage *, EVEWidgetSpecT *);
typedef void (*eve_widget_destroy_t) (EVEWidget *);

int eve_widget_create(EVEWidget *widget, uint8_t type, EVERect *g, EVEPage *page, EVEWidgetSpecT *spec);
void eve_widget_destroy(EVEWidget *widget);