From dacf6e0625d10ff47d2aad0ca8d705f90f030119 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20Tom=C3=A1s?= Date: Wed, 22 Jul 2020 22:52:51 -0300 Subject: Update architecture --- src/client/jetc.cpp | 45 ++++----------------------------------------- 1 file changed, 4 insertions(+), 41 deletions(-) (limited to 'src/client/jetc.cpp') diff --git a/src/client/jetc.cpp b/src/client/jetc.cpp index 2dd6074..8a649b0 100644 --- a/src/client/jetc.cpp +++ b/src/client/jetc.cpp @@ -4,48 +4,11 @@ #include #include #include - -#define NORMAL_MODE 0 -#define INSERT_MODE 1 +#include +#include int main(int argc, char *argv[]) { - Window window; - - int mode = NORMAL_MODE; - - int quit = 0; - while (!quit) { - window.redraw(); - - int input = getch(); - if (mode == NORMAL_MODE) { - switch (input) { - case '': - quit = 1; - break; - case 'i': - mode = INSERT_MODE; - break; - case 'h': - window.move_left(); - break; - case 'l': - window.move_right(); - break; - } - } else { - switch (input) { - case '': - mode = NORMAL_MODE; - break; - case KEY_BACKSPACE: - window.delete_element(); - break; - default: - window.insert_element(input); - } - } - } - + Interface interface; + interface.run(); return 0; } -- cgit v1.2.3