summaryrefslogtreecommitdiff
path: root/code/fe310/eos/eve/screen/window.c
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2020-06-09 00:32:34 +0200
committerUros Majstorovic <majstor@majstor.org>2020-06-09 00:32:34 +0200
commitb5aa60b256dd2b328515779883ba365aba3d995f (patch)
treeb937738559310e19fa79e927825810b4c4af1e97 /code/fe310/eos/eve/screen/window.c
parentd9bf3b288ce5f6e84f7e6079948fdf0735b4711f (diff)
EVEView iface fixed; screen keyboard window implemented
Diffstat (limited to 'code/fe310/eos/eve/screen/window.c')
-rw-r--r--code/fe310/eos/eve/screen/window.c34
1 files changed, 22 insertions, 12 deletions
diff --git a/code/fe310/eos/eve/screen/window.c b/code/fe310/eos/eve/screen/window.c
index 8341e8a..5c329a9 100644
--- a/code/fe310/eos/eve/screen/window.c
+++ b/code/fe310/eos/eve/screen/window.c
@@ -17,22 +17,32 @@ void eve_window_init(EVEWindow *window, EVERect *g, EVEView *view, EVEScreen *sc
window->screen = screen;
}
-void eve_window_get_visible(EVEWindow *window, EVERect *g) {
+int eve_window_visible(EVEWindow *window) {
+ if (window->g.x >= window->screen->w) return 0;
+ if (window->g.y >= window->screen->h) return 0;
+ if ((window->g.x + window->g.w) <= 0) return 0;
+ if ((window->g.y + window->g.h) <= 0) return 0;
+ return 1;
+}
+
+void eve_window_visible_g(EVEWindow *window, EVERect *g) {
EVEWindow *w = window->next;
*g = window->g;
while (w) {
- if (w->g.x > g->x) g->w = MIN(g->w, w->g.x - g->x);
- if (w->g.y > g->y) g->h = MIN(g->h, w->g.y - g->y);
- if (w->g.x + w->g.w < g->x + g->w) {
- uint16_t x0 = g->w - MIN(g->w, (g->x + g->w) - (w->g.x + w->g.w));
- g->x += x0;
- g->w -= x0;
- }
- if (w->g.y + w->g.h < g->y + g->h) {
- uint16_t y0 = g->h - MIN(g->h, (g->y + g->h) - (w->g.y + w->g.h));
- g->y += y0;
- g->h -= y0;
+ if (eve_window_visible(w)) {
+ if (w->g.x > g->x) g->w = MIN(g->w, w->g.x - g->x);
+ if (w->g.y > g->y) g->h = MIN(g->h, w->g.y - g->y);
+ if (w->g.x + w->g.w < g->x + g->w) {
+ uint16_t x0 = g->w - MIN(g->w, (g->x + g->w) - (w->g.x + w->g.w));
+ g->x += x0;
+ g->w -= x0;
+ }
+ if (w->g.y + w->g.h < g->y + g->h) {
+ uint16_t y0 = g->h - MIN(g->h, (g->y + g->h) - (w->g.y + w->g.h));
+ g->y += y0;
+ g->h -= y0;
+ }
}
w = w->next;
}