From 95440a3be135d1b34e1fe8b8f06315e65f26c168 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 6 Apr 2015 12:26:17 -0400 Subject: Renamed some files. More TODOs. --- new/init_unix.c | 28 ++++++++++++++++++++++++++++ new/main_unix.c | 12 ++++++++++++ new/uiinit_unix.c | 28 ---------------------------- new/uimain_unix.c | 12 ------------ new/window_unix.c | 1 + 5 files changed, 41 insertions(+), 40 deletions(-) create mode 100644 new/init_unix.c create mode 100644 new/main_unix.c delete mode 100644 new/uiinit_unix.c delete mode 100644 new/uimain_unix.c diff --git a/new/init_unix.c b/new/init_unix.c new file mode 100644 index 0000000..4d951af --- /dev/null +++ b/new/init_unix.c @@ -0,0 +1,28 @@ +// 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; + g_free(e); + return NULL; +} + +const char *uiInitErrorMessage(uiInitError *e) +{ + return e->err->message; +} + +void uiInitErrorFree(uiInitError *e) +{ + g_error_free(e->err); + g_free(e); +} diff --git a/new/main_unix.c b/new/main_unix.c new file mode 100644 index 0000000..988519a --- /dev/null +++ b/new/main_unix.c @@ -0,0 +1,12 @@ +// 6 april 2015 +#include "ui_unix.h" + +void uiMain(void) +{ + gtk_main(); +} + +void uiQuit(void) +{ + gtk_main_quit(); +} diff --git a/new/uiinit_unix.c b/new/uiinit_unix.c deleted file mode 100644 index 4d951af..0000000 --- a/new/uiinit_unix.c +++ /dev/null @@ -1,28 +0,0 @@ -// 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; - g_free(e); - return NULL; -} - -const char *uiInitErrorMessage(uiInitError *e) -{ - return e->err->message; -} - -void uiInitErrorFree(uiInitError *e) -{ - g_error_free(e->err); - g_free(e); -} diff --git a/new/uimain_unix.c b/new/uimain_unix.c deleted file mode 100644 index 988519a..0000000 --- a/new/uimain_unix.c +++ /dev/null @@ -1,12 +0,0 @@ -// 6 april 2015 -#include "ui_unix.h" - -void uiMain(void) -{ - gtk_main(); -} - -void uiQuit(void) -{ - gtk_main_quit(); -} diff --git a/new/window_unix.c b/new/window_unix.c index 5ace5a5..f3d4ec3 100644 --- a/new/window_unix.c +++ b/new/window_unix.c @@ -41,6 +41,7 @@ void uiWindowHide(uiWindow *w) gtk_widget_hide(w->widget); } +// TODO will not free w static gboolean onClosing(GtkWidget *win, GdkEvent *e, gpointer data) { uiWindow *w = (uiWindow *) data; -- cgit v1.2.3