From 725ed5b0353eaeb3301aa9690d6803a78e18dfb2 Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Sat, 11 Jul 2020 04:04:16 +0200 Subject: kbdwin source added --- code/fe310/eos/eve/screen/kbdwin.c | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 code/fe310/eos/eve/screen/kbdwin.c (limited to 'code/fe310/eos/eve/screen/kbdwin.c') 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 +#include + +#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); +} -- cgit v1.2.3