summaryrefslogtreecommitdiff
path: root/code/fe310/eos/eve
diff options
context:
space:
mode:
Diffstat (limited to 'code/fe310/eos/eve')
-rw-r--r--code/fe310/eos/eve/screen/kbdwin.c39
-rw-r--r--code/fe310/eos/eve/screen/kbdwin.h14
2 files changed, 53 insertions, 0 deletions
diff --git a/code/fe310/eos/eve/screen/kbdwin.c b/code/fe310/eos/eve/screen/kbdwin.c
new file mode 100644
index 0000000..decedad
--- /dev/null
+++ b/code/fe310/eos/eve/screen/kbdwin.c
@@ -0,0 +1,39 @@
+#include <stdlib.h>
+#include <string.h>
+
+#include "eve.h"
+#include "eve_kbd.h"
+
+#include "screen.h"
+#include "window.h"
+#include "kbdwin.h"
+
+static int kbdwin_touch(EVEView *v, uint8_t tag0, int touch_idx) {
+ EVEKbdView *k_view = (EVEKbdView *)v;
+
+ return eve_kbd_touch(&k_view->kbd, tag0, touch_idx);
+}
+
+static uint8_t kbdwin_draw(EVEView *v, uint8_t tag0) {
+ EVEKbdView *k_view = (EVEKbdView *)v;
+
+ eve_kbd_draw(&k_view->kbd);
+ return tag0;
+}
+
+void eve_kbdwin_init(EVEKbdWin *kbd_win, EVEScreen *screen) {
+ EVEKbd *kbd = &kbd_win->view.kbd;
+
+ kbd_win->view.v.touch = kbdwin_touch;
+ kbd_win->view.v.draw = kbdwin_draw;
+ eve_kbd_init(kbd, NULL, screen->mem_next, &screen->mem_next);
+ eve_window_init(&kbd_win->win, &kbd->g, &kbd_win->view.v, screen);
+}
+
+void eve_kbdwin_append(EVEKbdWin *kbd_win) {
+ EVEKbd *kbd = &kbd_win->view.kbd;
+ EVEWindow *window = &kbd_win->win;
+
+ eve_screen_set_kbd(window->screen, kbd);
+ eve_window_append(window);
+}
diff --git a/code/fe310/eos/eve/screen/kbdwin.h b/code/fe310/eos/eve/screen/kbdwin.h
new file mode 100644
index 0000000..2cc14d9
--- /dev/null
+++ b/code/fe310/eos/eve/screen/kbdwin.h
@@ -0,0 +1,14 @@
+#include <stdint.h>
+
+typedef struct EVEKbdView {
+ EVEView v;
+ EVEKbd kbd;
+} EVEKbdView;
+
+typedef struct EVEKbdWin {
+ EVEWindow win;
+ EVEKbdView view;
+} EVEKbdWin;
+
+void eve_kbdwin_init(EVEKbdWin *kbd_win, EVEScreen *screen);
+void eve_kbdwin_append(EVEKbdWin *kbd_win);