summaryrefslogtreecommitdiff
path: root/fw/fe310/eos/eve/widget/selectw.h
blob: f1b707166794c1d397949f506c59c5dac8e554d8 (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
#include <stdint.h>

struct EVEWidgetSpec;

typedef struct EVESelectWidget {
    EVEWidget w;
    EVEFont *font;
    utf8_t *option;
    uint16_t option_size;
    uint16_t option_count;
    uint32_t select;
    uint16_t line0;
    uint8_t multi;
} EVESelectWidget;

typedef struct EVESelectSpec {
    EVEFont *font;
    uint16_t option_size;
    uint8_t multi;
} EVESelectSpec;

void eve_selectw_init(EVESelectWidget *widget, EVERect *g, EVEPage *page, EVEFont *font, utf8_t *option, uint16_t option_size, uint8_t multi);

int eve_selectw_create(EVEWidget *_widget, struct EVEWidgetSpec *spec, EVEPage *page);
void eve_selectw_destroy(EVEWidget *_widget);
uint8_t eve_selectw_draw(EVEWidget *_widget, uint8_t tag0);
int eve_selectw_touch(EVEWidget *_widget, EVETouch *touch, uint16_t evt);

utf8_t *eve_selectw_option(EVESelectWidget *widget, int idx);
utf8_t *eve_selectw_option_selected(EVESelectWidget *widget);
int eve_selectw_add_option(EVESelectWidget *widget, utf8_t *option);
int eve_selectw_set_option(EVESelectWidget *widget, utf8_t *option, uint16_t option_size);