summaryrefslogtreecommitdiff
path: root/fw/fe310/eos/eve/screen/form.h
blob: 62e10f778e22f4a93bf633740d9795dc9080eea7 (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
#include <stdint.h>

#include "../widget/widget.h"

struct EVEWidget;
struct EVEForm;
struct EVEFormSpec;

typedef int (*eve_form_uievt_t) (struct EVEForm *, uint16_t, void *);
typedef void (*eve_form_action_t) (struct EVEForm *);
typedef void (*eve_form_destructor_t) (struct EVEForm *);

typedef struct EVEForm {
    EVEPage p;
    eve_form_action_t action;
} EVEForm;

typedef struct EVEFormSpec {
    EVELabelSpec label;
    EVEWidgetSpec widget;
} EVEFormSpec;

EVEForm *eve_form_create(EVEWindow *window, EVEViewStack *stack, EVEFormSpec *spec, uint16_t spec_size, eve_form_uievt_t uievt, eve_form_action_t action, eve_form_destructor_t destructor);
void eve_form_init(EVEForm *form, EVEWindow *window, EVEViewStack *stack, EVEWidget *widget, uint16_t widget_size, eve_form_uievt_t uievt, eve_form_action_t action, eve_form_destructor_t destructor);
void eve_form_set_widget(EVEForm *form, EVEWidget *widget, uint16_t widget_size);
void eve_form_destroy(EVEForm *form);

int eve_form_uievt(EVEForm *form, uint16_t evt, void *param);