summaryrefslogtreecommitdiff
path: root/src/client/jetc.cpp
diff options
context:
space:
mode:
authorJuan Manuel Tomás <jtomas1815@gmail.com>2020-07-22 22:52:51 -0300
committerJuan Manuel Tomás <jtomas1815@gmail.com>2020-07-22 22:52:51 -0300
commitdacf6e0625d10ff47d2aad0ca8d705f90f030119 (patch)
treebfb7f55d024c96b2390bd5f999455b2285542828 /src/client/jetc.cpp
parentba2c428dca0080cd79ea3e6c7d0f48764076fd2c (diff)
downloadjet-dacf6e0625d10ff47d2aad0ca8d705f90f030119.tar.gz
jet-dacf6e0625d10ff47d2aad0ca8d705f90f030119.zip
Update architecture
Diffstat (limited to 'src/client/jetc.cpp')
-rw-r--r--src/client/jetc.cpp45
1 files changed, 4 insertions, 41 deletions
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 <common/ipc.cpp>
#include <common/socket.cpp>
#include <client/window.cpp>
-
-#define NORMAL_MODE 0
-#define INSERT_MODE 1
+#include <client/cursor.cpp>
+#include <client/interface.cpp>
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;
}