summaryrefslogtreecommitdiff
path: root/fw/fe310/eos/eve/screen/page.h
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2020-08-23 22:37:16 +0200
committerUros Majstorovic <majstor@majstor.org>2020-08-23 22:37:16 +0200
commit1e5eb7cb910e6f23c69c2c986b6373e9f9abb980 (patch)
tree5e8ed0ad6b2fcba747c626c1c51afebbf76b3b9d /fw/fe310/eos/eve/screen/page.h
parent57c1824affca858023c65c84e188ea7dc6c0a5f2 (diff)
dynamic memory alloc for gui added; page navigation added
Diffstat (limited to 'fw/fe310/eos/eve/screen/page.h')
-rw-r--r--fw/fe310/eos/eve/screen/page.h25
1 files changed, 19 insertions, 6 deletions
diff --git a/fw/fe310/eos/eve/screen/page.h b/fw/fe310/eos/eve/screen/page.h
index eebedfd..227375c 100644
--- a/fw/fe310/eos/eve/screen/page.h
+++ b/fw/fe310/eos/eve/screen/page.h
@@ -1,25 +1,38 @@
#include <stdint.h>
+#define EVE_PAGE_SIZE_STACK 16
+
struct EVEPage;
struct EVEWidget;
+struct EVEPageStack;
-typedef void (*eve_page_open_t) (struct EVEPage *, struct EVEPage *);
-typedef void (*eve_page_close_t) (struct EVEPage *);
-typedef void (*eve_page_evt_handler_t) (struct EVEPage *, struct EVEWidget *, EVETouch *, uint16_t, uint8_t, int);
+typedef void (*eve_page_constructor_t) (EVEWindow *window, struct EVEPageStack *);
+typedef void (*eve_page_destructor_t) (struct EVEPage *);
+typedef int (*eve_page_evt_handler_t) (struct EVEPage *, struct EVEWidget *, EVETouch *, uint16_t, uint8_t, int);
typedef void (*eve_page_g_updater_t) (struct EVEPage *, struct EVEWidget *);
typedef struct EVEPage {
EVEView v;
int16_t win_x;
int16_t win_y;
- eve_page_open_t open;
- eve_page_close_t close;
eve_page_evt_handler_t handle_evt;
eve_page_g_updater_t update_g;
+ eve_page_destructor_t destructor;
+ struct EVEPageStack *stack;
struct EVEWidget *widget_f;
} EVEPage;
-void eve_page_init(EVEPage *page, EVEWindow *window, eve_view_touch_t touch, eve_view_draw_t draw, eve_page_open_t open, eve_page_close_t close, eve_page_evt_handler_t handle_evt, eve_page_g_updater_t update_g);
+typedef struct EVEPageStack {
+ eve_page_constructor_t constructor[EVE_PAGE_SIZE_STACK];
+ uint8_t level;
+} EVEPageStack;
+
+void eve_page_init(EVEPage *page, EVEWindow *window, EVEPageStack *stack, eve_view_touch_t touch, eve_view_draw_t draw, eve_page_evt_handler_t handle_evt, eve_page_g_updater_t update_g, eve_page_destructor_t destructor);
+void eve_page_stack_init(EVEPageStack *stack);
+void eve_page_create(EVEWindow *window, EVEPageStack *stack, eve_page_constructor_t constructor);
+void eve_page_open(EVEPage *parent, eve_page_constructor_t constructor);
+void eve_page_close(EVEPage *page);
+
int16_t eve_page_x(EVEPage *page, int16_t x);
int16_t eve_page_y(EVEPage *page, int16_t y);
int16_t eve_page_scr_x(EVEPage *page, int16_t x);