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
40
41
42
43
44
45
46
47
48
49
50
51
52
|
#include <stdint.h>
#include "uievt.h"
#define EVE_VIEW_SIZE_STACK 16
struct EVEView;
struct EVEVStack;
struct EVEWindow;
typedef uint8_t (*eve_view_draw_t) (struct EVEView *, uint8_t);
typedef int (*eve_view_touch_t) (struct EVEView *, EVETouch *, uint16_t);
typedef void (*eve_view_uievt_t) (struct EVEView *, uint16_t, void *);
typedef struct EVEView *(*eve_view_constructor_t) (struct EVEWindow *window, struct EVEVStack *);
typedef struct EVEView {
eve_view_draw_t draw;
eve_view_touch_t touch;
eve_view_uievt_t uievt;
struct EVEWindow *window;
void *param;
uint32_t color_bg;
uint32_t color_fg;
uint8_t tag;
} EVEView;
typedef struct EVEVStack {
eve_view_constructor_t constructor[EVE_VIEW_SIZE_STACK];
uint8_t level;
} EVEVStack;
void eve_view_init(EVEView *view, struct EVEWindow *window, eve_view_draw_t draw, eve_view_touch_t touch, eve_view_uievt_t uievt, void *param);
void eve_view_attach(EVEView *view, struct EVEWindow *window, void *view_id);
void eve_view_detach(EVEView *view);
void eve_view_set_param(EVEView *view, void *param);
void eve_view_set_color_bg(EVEView *view, uint8_t r, uint8_t g, uint8_t b);
void eve_view_set_color_fg(EVEView *view, uint8_t r, uint8_t g, uint8_t b);
uint8_t eve_view_clear(EVEView *view, uint8_t tag0, uint8_t tag_opt);
uint8_t eve_view_tag(EVEView *view, uint8_t tag, uint8_t tag_opt);
void eve_view_uievt_push(EVEView *view, uint16_t evt, void *param);
void eve_view_uievt_push_gest(EVEView *view, uint16_t evt, EVETouch *touch, uint16_t t_evt);
void eve_vstack_init(EVEVStack *stack);
int eve_vstack_push(EVEVStack *stack, eve_view_constructor_t constructor);
eve_view_constructor_t eve_vstack_pull(EVEVStack *stack);
eve_view_constructor_t eve_vstack_get(EVEVStack *stack);
int eve_vstack_empty(EVEVStack *stack);
int eve_vstack_full(EVEVStack *stack);
int eve_vstack_level(EVEVStack *stack);
int eve_vstack_create_view(EVEVStack *stack, struct EVEWindow *window, eve_view_constructor_t constructor);
int eve_vstack_back(EVEVStack *stack, struct EVEWindow *window);
|