diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | events.c | 21 | ||||
-rw-r--r-- | events.h | 14 | ||||
-rw-r--r-- | pty-unix.c | 4 | ||||
-rw-r--r-- | runes.h | 5 | ||||
-rw-r--r-- | window-xlib.c | 4 |
6 files changed, 9 insertions, 41 deletions
@@ -1,5 +1,5 @@ OUT = runes -OBJ = runes.o display.o term.o events.o vt100.o window-xlib.o pty-unix.o +OBJ = runes.o display.o term.o vt100.o window-xlib.o pty-unix.o LIBS = cairo cairo-xlib libuv CFLAGS ?= -g -Wall -Wextra -Werror LDFLAGS ?= -g -Wall -Wextra -Werror diff --git a/events.c b/events.c deleted file mode 100644 index 32ca790..0000000 --- a/events.c +++ /dev/null @@ -1,21 +0,0 @@ -#include "runes.h" - -void runes_handle_keyboard_event(RunesTerm *t, char *buf, size_t len) -{ - runes_pty_backend_write(t, buf, len); -} - -void runes_handle_pty_read(RunesTerm *t, char *buf, ssize_t len) -{ - runes_vt100_process_string(t, buf, len); -} - -void runes_handle_pty_close(RunesTerm *t) -{ - runes_window_backend_request_close(t); -} - -void runes_handle_close_window(RunesTerm *t) -{ - runes_pty_backend_request_close(t); -} diff --git a/events.h b/events.h deleted file mode 100644 index 4307b4f..0000000 --- a/events.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef _RUNES_EVENTS_H -#define _RUNES_EVENTS_H - -struct runes_loop_data { - uv_work_t req; - RunesTerm *t; -}; - -void runes_handle_keyboard_event(RunesTerm *t, char *buf, size_t len); -void runes_handle_pty_read(RunesTerm *t, char *buf, ssize_t len); -void runes_handle_pty_close(RunesTerm *t); -void runes_handle_close_window(RunesTerm *t); - -#endif @@ -116,12 +116,12 @@ static void runes_pty_backend_got_data(uv_work_t *req, int status) t = data->data.t; if (data->len > 0) { - runes_handle_pty_read(t, data->buf, data->len); + runes_vt100_process_string(t, data->buf, data->len); uv_queue_work( t->loop, req, runes_pty_backend_read, runes_pty_backend_got_data); } else { - runes_handle_pty_close(t); + runes_window_backend_request_close(t); free(req); } } @@ -14,7 +14,10 @@ typedef struct runes_window RunesWindowBackend; typedef struct runes_pty RunesPtyBackend; typedef struct runes_loop_data RunesLoopData; -#include "events.h" +struct runes_loop_data { + uv_work_t req; + RunesTerm *t; +}; #include "window-xlib.h" #include "pty-unix.h" diff --git a/window-xlib.c b/window-xlib.c index 76f97bf..958bb26 100644 --- a/window-xlib.c +++ b/window-xlib.c @@ -214,7 +214,7 @@ static void runes_window_backend_process_event(uv_work_t *req, int status) break; } - runes_handle_keyboard_event(t, buf, chars); + runes_pty_backend_write(t, buf, chars); free(buf); break; } @@ -255,7 +255,7 @@ static void runes_window_backend_process_event(uv_work_t *req, int status) runes_window_backend_process_event); } else { - runes_handle_close_window(t); + runes_pty_backend_request_close(t); free(req); } } |