diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-09-15 04:50:46 (EDT) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-09-15 04:50:46 (EDT) |
commit | 81662e9024463bd15b0aac6d202f71cac5620c15 (patch) | |
tree | 380d96f172ae679dc8c44c849bee7e53d9dfcf2b | |
parent | 352f14686f7cf0e8b54426f982c59e170f79cd7a (diff) | |
download | marquee-81662e9024463bd15b0aac6d202f71cac5620c15.zip marquee-81662e9024463bd15b0aac6d202f71cac5620c15.tar.gz marquee-81662e9024463bd15b0aac6d202f71cac5620c15.tar.bz2 |
mq_main_window_new(): Take args and return struct pointer
-rw-r--r-- | src/main-window.c | 20 | ||||
-rw-r--r-- | src/main-window.h | 6 | ||||
-rw-r--r-- | src/main.c | 2 |
3 files changed, 20 insertions, 8 deletions
diff --git a/src/main-window.c b/src/main-window.c index 4ecbf6c..ee4dd27 100644 --- a/src/main-window.c +++ b/src/main-window.c @@ -19,16 +19,24 @@ * along with Marquee. If not, see <http://www.gnu.org/licenses/>. */ +#include <stdlib.h> + #include <gtk/gtk.h> #include "main-window.h" -void -mq_main_window_new() +MqWindow * +mq_main_window_new(gint __attribute__((unused)) uri_c, + gchar __attribute__((unused)) *uri_v[]) { - GtkWidget *window; + MqWindow *window; + + window = malloc(sizeof(*window)); + + window->gtk_window = gtk_window_new(GTK_WINDOW_TOPLEVEL); + g_signal_connect(window->gtk_window, "destroy", + G_CALLBACK(gtk_main_quit), NULL); + gtk_widget_show_all(window->gtk_window); - window = gtk_window_new(GTK_WINDOW_TOPLEVEL); - g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL); - gtk_widget_show_all(window); + return window; } diff --git a/src/main-window.h b/src/main-window.h index e5a7de5..fb31ac4 100644 --- a/src/main-window.h +++ b/src/main-window.h @@ -19,4 +19,8 @@ * along with Marquee. If not, see <http://www.gnu.org/licenses/>. */ -void mq_main_window_new(); +typedef struct { + GtkWidget *gtk_window; +} MqWindow; + +MqWindow *mq_main_window_new(gint uri_c, gchar *uri_v[]); @@ -73,7 +73,7 @@ main(int argc, char *argv[]) return EXIT_SUCCESS; } - mq_main_window_new(); + mq_main_window_new(argc, argv); gtk_main(); |