aboutsummaryrefslogtreecommitdiffstats
path: root/src/runes.c
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2016-05-10 17:25:12 -0400
committerJesse Luehrs <doy@tozt.net>2016-05-10 17:31:39 -0400
commitec77a7037586864ece6505c448ab5c15bf8a57d9 (patch)
treead23ca8d2ded6ffc0a9d9c6c5320e457c37ece32 /src/runes.c
parent9118ead5ae15548c8a5b96340f9a0a24b3104e32 (diff)
downloadrunes-ec77a7037586864ece6505c448ab5c15bf8a57d9.tar.gz
runes-ec77a7037586864ece6505c448ab5c15bf8a57d9.zip
refactor how submodules are handled
let them own their own memory, so that they can free themselves once they exit the loop. also split out the parts of the terminal that we only want to initialize once, even if we open multiple terminal windows
Diffstat (limited to 'src/runes.c')
-rw-r--r--src/runes.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/runes.c b/src/runes.c
index af32778..46aaf41 100644
--- a/src/runes.c
+++ b/src/runes.c
@@ -1,27 +1,27 @@
#include <locale.h>
-#include <stdlib.h>
#include "runes.h"
#include "loop.h"
#include "term.h"
+#include "window-xlib.h"
int main (int argc, char *argv[])
{
- RunesLoop loop;
- RunesTerm *t;
+ RunesLoop *loop;
+ RunesWindowBackendGlobal *wg;
setlocale(LC_ALL, "");
- runes_loop_init(&loop);
+ loop = runes_loop_new();
+ wg = runes_window_backend_global_init();
+ runes_term_register_with_loop(runes_term_new(argc, argv, wg), loop);
- t = calloc(1, sizeof(RunesTerm));
- runes_term_init(t, &loop, argc, argv);
-
- runes_loop_run(&loop);
+ runes_loop_run(loop);
#ifdef RUNES_VALGRIND
- runes_loop_cleanup(&loop);
+ runes_loop_cleanup(loop);
+ runes_window_backend_global_cleanup(wg);
#endif
return 0;