diff options
author | Uros Majstorovic <majstor@majstor.org> | 2020-07-11 04:04:16 +0200 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2020-07-11 04:04:16 +0200 |
commit | 725ed5b0353eaeb3301aa9690d6803a78e18dfb2 (patch) | |
tree | 16aae80f404aa6ec16b116d989f88f673cc747f1 /code/fe310/eos/eve/screen | |
parent | 7dcaf1f395a5720bb5c3d02f09a214cb3440023e (diff) |
kbdwin source added
Diffstat (limited to 'code/fe310/eos/eve/screen')
-rw-r--r-- | code/fe310/eos/eve/screen/kbdwin.c | 39 | ||||
-rw-r--r-- | code/fe310/eos/eve/screen/kbdwin.h | 14 |
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); |