summaryrefslogtreecommitdiff
path: root/fw/fe310/eos/eve/screen/view.c
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2021-03-24 23:13:42 +0100
committerUros Majstorovic <majstor@majstor.org>2021-03-24 23:13:42 +0100
commit95f69d4f83ad8f7fbb56349f29e902928510362b (patch)
tree51f4848b0518d138368af30f8e7abeebb89ebd5f /fw/fe310/eos/eve/screen/view.c
parent8c61343677d2ed8f929372863016524707b8ab93 (diff)
window hierarchy
Diffstat (limited to 'fw/fe310/eos/eve/screen/view.c')
-rw-r--r--fw/fe310/eos/eve/screen/view.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/fw/fe310/eos/eve/screen/view.c b/fw/fe310/eos/eve/screen/view.c
index 30229e5..ce4101f 100644
--- a/fw/fe310/eos/eve/screen/view.c
+++ b/fw/fe310/eos/eve/screen/view.c
@@ -4,18 +4,38 @@
#include "eve.h"
#include "eve_kbd.h"
-#include "screen.h"
#include "window.h"
-#include "view.h"
-void eve_view_init(EVEView *view, EVEWindow *window, eve_view_touch_t touch, eve_view_draw_t draw, void *param) {
+void eve_view_init(EVEView *view, EVEWindow *window, eve_view_draw_t draw, eve_view_touch_t touch, void *param) {
view->touch = touch;
view->draw = draw;
view->param = param;
view->window = window;
+ view->color_bg = 0x000000;
+ view->color_fg = 0xffffff;
window->view = view;
}
+void eve_view_set_color_bg(EVEView *view, uint8_t r, uint8_t g, uint8_t b) {
+ view->color_bg = (r << 16) | (g << 8) | b;
+}
+
+void eve_view_set_color_fg(EVEView *view, uint8_t r, uint8_t g, uint8_t b) {
+ view->color_fg = (r << 16) | (g << 8) | b;
+}
+
+uint8_t eve_view_clear(EVEView *view, uint8_t tag0) {
+ eve_cmd_dl(CLEAR_COLOR_RGBC(view->color_bg));
+ eve_cmd_dl(COLOR_RGBC(view->color_fg));
+ view->tag = tag0;
+ if (tag0 != EVE_TAG_NOTAG) {
+ eve_cmd_dl(CLEAR_TAG(tag0));
+ tag0++;
+ }
+ eve_cmd_dl(CLEAR(1,1,1));
+ return tag0;
+}
+
void eve_view_stack_init(EVEViewStack *stack) {
memset(stack, 0, sizeof(EVEViewStack));
}