From ee1653f542f0c070afb8310c9041267496bbdf05 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 6 Apr 2015 12:20:51 -0400 Subject: Started doing the C rewrite. Defined the basic initialization and main loop and window API and implemented them on GTK+. --- new/uiinit_unix.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 new/uiinit_unix.c (limited to 'new/uiinit_unix.c') diff --git a/new/uiinit_unix.c b/new/uiinit_unix.c new file mode 100644 index 0000000..bd2463d --- /dev/null +++ b/new/uiinit_unix.c @@ -0,0 +1,27 @@ +// 6 april 2015 +#include "ui_unix.h" + +struct uiInitError { + GError *err; +}; + +uiInitError *uiInit(uiInitOptions *o) +{ + uiInitError *e; + + e = g_new0(uiInitError, 1); + if (gtk_init_with_args(NULL, NULL, NULL, NULL, NULL, &(e->err)) == FALSE) + return e; + uiInitErrorFree(e); + return NULL; +} + +const char *uiInitErrorMessage(uiInitError *e) +{ + return e->err->message; +} + +void uiInitErrorFree(uiInitError *e) +{ + g_free(e); +} -- cgit v1.2.3