summaryrefslogtreecommitdiff
path: root/fw/fe310/eos/eve/widget
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/widget
parent8c61343677d2ed8f929372863016524707b8ab93 (diff)
window hierarchy
Diffstat (limited to 'fw/fe310/eos/eve/widget')
-rw-r--r--fw/fe310/eos/eve/widget/freew.c2
-rw-r--r--fw/fe310/eos/eve/widget/label.c2
-rw-r--r--fw/fe310/eos/eve/widget/pagew.c2
-rw-r--r--fw/fe310/eos/eve/widget/selectw.c6
-rw-r--r--fw/fe310/eos/eve/widget/spacerw.c2
-rw-r--r--fw/fe310/eos/eve/widget/strw.c21
-rw-r--r--fw/fe310/eos/eve/widget/textw.c22
-rw-r--r--fw/fe310/eos/eve/widget/widget.c2
8 files changed, 21 insertions, 38 deletions
diff --git a/fw/fe310/eos/eve/widget/freew.c b/fw/fe310/eos/eve/widget/freew.c
index 2100fce..f129af0 100644
--- a/fw/fe310/eos/eve/widget/freew.c
+++ b/fw/fe310/eos/eve/widget/freew.c
@@ -7,9 +7,7 @@
#include "eve_kbd.h"
#include "eve_font.h"
-#include "screen/screen.h"
#include "screen/window.h"
-#include "screen/view.h"
#include "screen/page.h"
#include "label.h"
diff --git a/fw/fe310/eos/eve/widget/label.c b/fw/fe310/eos/eve/widget/label.c
index c52027c..cc05487 100644
--- a/fw/fe310/eos/eve/widget/label.c
+++ b/fw/fe310/eos/eve/widget/label.c
@@ -7,9 +7,7 @@
#include "eve_kbd.h"
#include "eve_font.h"
-#include "screen/screen.h"
#include "screen/window.h"
-#include "screen/view.h"
#include "screen/page.h"
#include "label.h"
diff --git a/fw/fe310/eos/eve/widget/pagew.c b/fw/fe310/eos/eve/widget/pagew.c
index 51528da..6754338 100644
--- a/fw/fe310/eos/eve/widget/pagew.c
+++ b/fw/fe310/eos/eve/widget/pagew.c
@@ -7,9 +7,7 @@
#include "eve_kbd.h"
#include "eve_font.h"
-#include "screen/screen.h"
#include "screen/window.h"
-#include "screen/view.h"
#include "screen/page.h"
#include "label.h"
diff --git a/fw/fe310/eos/eve/widget/selectw.c b/fw/fe310/eos/eve/widget/selectw.c
index 7157e85..35192a4 100644
--- a/fw/fe310/eos/eve/widget/selectw.c
+++ b/fw/fe310/eos/eve/widget/selectw.c
@@ -7,9 +7,7 @@
#include "eve_kbd.h"
#include "eve_font.h"
-#include "screen/screen.h"
#include "screen/window.h"
-#include "screen/view.h"
#include "screen/page.h"
#include "label.h"
@@ -134,9 +132,9 @@ uint8_t eve_selectw_draw(EVEWidget *_widget, EVEPage *page, uint8_t tag0) {
eve_cmd_dl(VERTEX2F(x2, y2));
}
eve_cmd_dl(END());
- if (s) eve_cmd_dl(COLOR_RGBC(page->v.window->color_bg));
+ if (s) eve_cmd_dl(COLOR_RGBC(page->v.color_bg));
eve_cmd(CMD_TEXT, "hhhhs", x1, y1, _widget->font->id, 0, widget->option + o_curr);
- if (s) eve_cmd_dl(COLOR_RGBC(page->v.window->color_fg));
+ if (s) eve_cmd_dl(COLOR_RGBC(page->v.color_fg));
o_curr += o_len + 1;
i++;
diff --git a/fw/fe310/eos/eve/widget/spacerw.c b/fw/fe310/eos/eve/widget/spacerw.c
index 3affe24..992ab5b 100644
--- a/fw/fe310/eos/eve/widget/spacerw.c
+++ b/fw/fe310/eos/eve/widget/spacerw.c
@@ -7,9 +7,7 @@
#include "eve_kbd.h"
#include "eve_font.h"
-#include "screen/screen.h"
#include "screen/window.h"
-#include "screen/view.h"
#include "screen/page.h"
#include "label.h"
diff --git a/fw/fe310/eos/eve/widget/strw.c b/fw/fe310/eos/eve/widget/strw.c
index 65baf67..862d524 100644
--- a/fw/fe310/eos/eve/widget/strw.c
+++ b/fw/fe310/eos/eve/widget/strw.c
@@ -8,9 +8,7 @@
#include "eve_kbd.h"
#include "eve_font.h"
-#include "screen/screen.h"
#include "screen/window.h"
-#include "screen/view.h"
#include "screen/page.h"
#include "label.h"
@@ -172,7 +170,7 @@ int eve_strw_touch(EVEWidget *_widget, EVEPage *page, EVETouch *t, uint16_t evt)
return ret;
}
-static void _draw_str(EVEStrWidget *widget, EVEWindow *window, uint16_t ch, uint16_t len, uint16_t x1, uint16_t x2, char s) {
+static void _draw_str(EVEStrWidget *widget, EVEPage *page, uint16_t ch, uint16_t len, uint16_t x1, uint16_t x2, char s) {
int16_t x;
EVEWidget *_widget = &widget->w;
@@ -190,9 +188,9 @@ static void _draw_str(EVEStrWidget *widget, EVEWindow *window, uint16_t ch, uint
}
eve_cmd_dl(END());
if (len) {
- if (s) eve_cmd_dl(COLOR_RGBC(window->color_bg));
+ if (s) eve_cmd_dl(COLOR_RGBC(page->v.color_bg));
eve_cmd(CMD_TEXT, "hhhhpb", x + x1, _widget->g.y, _widget->font->id, 0, widget->str + ch, len, 0);
- if (s) eve_cmd_dl(COLOR_RGBC(window->color_fg));
+ if (s) eve_cmd_dl(COLOR_RGBC(page->v.color_fg));
}
}
}
@@ -223,7 +221,6 @@ uint8_t eve_strw_draw(EVEWidget *_widget, EVEPage *page, uint8_t tag0) {
if (cut) {
EVEWindow *window = page->v.window;
- EVEScreen *screen = window->screen;
int16_t x = eve_page_scr_x(page, _widget->g.x);
int16_t y = eve_page_scr_y(page, _widget->g.y);
uint16_t w = _widget->g.w;
@@ -235,8 +232,8 @@ uint8_t eve_strw_draw(EVEWidget *_widget, EVEPage *page, uint8_t tag0) {
if (win_x1 < 0) win_x1 = 0;
if (win_y1 < 0) win_y1 = 0;
- if (win_x2 > screen->w) win_x2 = screen->w;
- if (win_y2 > screen->h) win_y2 = screen->h;
+ if (win_x2 > window->root->g.w) win_x2 = window->root->g.w;
+ if (win_y2 > window->root->g.h) win_y2 = window->root->g.h;
if (x < win_x1) {
w += x - win_x1;
x = win_x1;
@@ -268,12 +265,12 @@ uint8_t eve_strw_draw(EVEWidget *_widget, EVEPage *page, uint8_t tag0) {
l1 = c1->ch;
l2 = c2->ch - c1->ch;
l3 = widget->str_len - c2->ch;
- _draw_str(widget, page->v.window, 0, l1, 0, c1->x, 0);
- _draw_str(widget, page->v.window, c1->ch, l2, c1->x, c2->x, 1);
- _draw_str(widget, page->v.window, c2->ch, l3, c2->x, widget->str_g.x + _widget->g.w, 0);
+ _draw_str(widget, page, 0, l1, 0, c1->x, 0);
+ _draw_str(widget, page, c1->ch, l2, c1->x, c2->x, 1);
+ _draw_str(widget, page, c2->ch, l3, c2->x, widget->str_g.x + _widget->g.w, 0);
} else {
if (widget->cursor1.on) _draw_cursor(widget, &widget->cursor1);
- _draw_str(widget, page->v.window, 0, widget->str_len, 0, widget->str_g.x + _widget->g.w, 0);
+ _draw_str(widget, page, 0, widget->str_len, 0, widget->str_g.x + _widget->g.w, 0);
}
if (cut) {
diff --git a/fw/fe310/eos/eve/widget/textw.c b/fw/fe310/eos/eve/widget/textw.c
index a650415..7e18475 100644
--- a/fw/fe310/eos/eve/widget/textw.c
+++ b/fw/fe310/eos/eve/widget/textw.c
@@ -8,9 +8,7 @@
#include "eve_kbd.h"
#include "eve_font.h"
-#include "screen/screen.h"
#include "screen/window.h"
-#include "screen/view.h"
#include "screen/page.h"
#include "label.h"
@@ -169,7 +167,7 @@ int eve_textw_touch(EVEWidget *_widget, EVEPage *page, EVETouch *t, uint16_t evt
return ret;
}
-static void _draw_line(EVETextWidget *widget, EVEWindow *window, uint16_t l, uint16_t ch, uint16_t len, uint16_t x1, uint16_t x2, char s) {
+static void _draw_line(EVETextWidget *widget, EVEPage *page, uint16_t l, uint16_t ch, uint16_t len, uint16_t x1, uint16_t x2, char s) {
EVEWidget *_widget = &widget->w;
if (x1 != x2) {
@@ -185,9 +183,9 @@ static void _draw_line(EVETextWidget *widget, EVEWindow *window, uint16_t l, uin
}
eve_cmd_dl(END());
if (len) {
- if (s) eve_cmd_dl(COLOR_RGBC(window->color_bg));
+ if (s) eve_cmd_dl(COLOR_RGBC(page->v.color_bg));
eve_cmd(CMD_TEXT, "hhhhpb", _widget->g.x + x1, _widget->g.y + l * _widget->font->h, _widget->font->id, 0, widget->text + ch, len, 0);
- if (s) eve_cmd_dl(COLOR_RGBC(window->color_fg));
+ if (s) eve_cmd_dl(COLOR_RGBC(page->v.color_fg));
}
}
}
@@ -258,10 +256,10 @@ uint8_t eve_textw_draw(EVEWidget *_widget, EVEPage *page, uint8_t tag0) {
l3 = 0;
s = 1;
}
- _draw_line(widget, page->v.window, i, LINE_START(widget, i), l1, 0, c1->x, 0);
- _draw_line(widget, page->v.window, i, c1->ch, l2, c1->x, s ? _widget->g.w : c2->x, 1);
+ _draw_line(widget, page, i, LINE_START(widget, i), l1, 0, c1->x, 0);
+ _draw_line(widget, page, i, c1->ch, l2, c1->x, s ? _widget->g.w : c2->x, 1);
if (!s) {
- _draw_line(widget, page->v.window, i, c2->ch, l3, c2->x, _widget->g.w, 0);
+ _draw_line(widget, page, i, c2->ch, l3, c2->x, _widget->g.w, 0);
c1 = NULL;
c2 = NULL;
}
@@ -269,14 +267,14 @@ uint8_t eve_textw_draw(EVEWidget *_widget, EVEPage *page, uint8_t tag0) {
int l1 = c2->ch - LINE_START(widget, i);
int l2 = LINE_START(widget, i) + LINE_LEN(widget, i) - c2->ch;
- _draw_line(widget, page->v.window, i, LINE_START(widget, i), l1, 0, c2->x, 1);
- _draw_line(widget, page->v.window, i, c2->ch, l2, c2->x, _widget->g.w, 0);
+ _draw_line(widget, page, i, LINE_START(widget, i), l1, 0, c2->x, 1);
+ _draw_line(widget, page, i, c2->ch, l2, c2->x, _widget->g.w, 0);
c1 = NULL;
c2 = NULL;
s = 0;
} else {
if (widget->cursor1.on && (widget->cursor1.line == i)) _draw_cursor(widget, &widget->cursor1);
- _draw_line(widget, page->v.window, i, LINE_START(widget, i), LINE_LEN(widget, i), 0, _widget->g.w, s);
+ _draw_line(widget, page, i, LINE_START(widget, i), LINE_LEN(widget, i), 0, _widget->g.w, s);
}
}
if (lineNvisible) {
@@ -285,7 +283,7 @@ uint8_t eve_textw_draw(EVEWidget *_widget, EVEPage *page, uint8_t tag0) {
eve_touch_set_opt(_widget->tagN, TEXTW_TOUCH_OPT);
_widget->tagN++;
}
- _draw_line(widget, page->v.window, lineN, 0, 0, 0, _widget->g.w, 0);
+ _draw_line(widget, page, lineN, 0, 0, 0, _widget->g.w, 0);
}
} else {
widget->line0 = 0;
diff --git a/fw/fe310/eos/eve/widget/widget.c b/fw/fe310/eos/eve/widget/widget.c
index 9f1e888..09894bc 100644
--- a/fw/fe310/eos/eve/widget/widget.c
+++ b/fw/fe310/eos/eve/widget/widget.c
@@ -7,9 +7,7 @@
#include "eve_kbd.h"
#include "eve_font.h"
-#include "screen/screen.h"
#include "screen/window.h"
-#include "screen/view.h"
#include "screen/page.h"
#include "widgets.h"