From 81662e9024463bd15b0aac6d202f71cac5620c15 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Fri, 15 Sep 2017 04:50:46 -0400 Subject: mq_main_window_new(): Take args and return struct pointer --- 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 . */ +#include + #include #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 . */ -void mq_main_window_new(); +typedef struct { + GtkWidget *gtk_window; +} MqWindow; + +MqWindow *mq_main_window_new(gint uri_c, gchar *uri_v[]); diff --git a/src/main.c b/src/main.c index 2f3063a..f052463 100644 --- a/src/main.c +++ b/src/main.c @@ -73,7 +73,7 @@ main(int argc, char *argv[]) return EXIT_SUCCESS; } - mq_main_window_new(); + mq_main_window_new(argc, argv); gtk_main(); -- cgit v0.9.1