summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-09-22 16:39:08 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-09-22 16:39:08 (EDT)
commitc6ac335990389ebbc8a67629ebe3b6ca6bf921a3 (patch)
tree8aace4a7996eeb2523c7d2af1cbc04afd23cec33
parentcd666da9fb700189c7b4596599e62e970867bdc6 (diff)
downloadmarquee-c6ac335990389ebbc8a67629ebe3b6ca6bf921a3.zip
marquee-c6ac335990389ebbc8a67629ebe3b6ca6bf921a3.tar.gz
marquee-c6ac335990389ebbc8a67629ebe3b6ca6bf921a3.tar.bz2
Save MqApplication in MqTab
-rw-r--r--src/tab.c3
-rw-r--r--src/tab.h4
-rw-r--r--src/window.c8
3 files changed, 9 insertions, 6 deletions
diff --git a/src/tab.c b/src/tab.c
index 2bb9cac..79308c1 100644
--- a/src/tab.c
+++ b/src/tab.c
@@ -200,11 +200,12 @@ title_cb(WebKitWebView __attribute__((unused)) *web_view,
}
MqTab *
-mq_tab_new(gchar *uri)
+mq_tab_new(MqApplication *application, gchar *uri)
{
MqTab *tab;
tab = malloc(sizeof(*tab));
+ tab->application = application;
mq_tab_populate_tab(tab);
diff --git a/src/tab.h b/src/tab.h
index 3361acc..813f3fb 100644
--- a/src/tab.h
+++ b/src/tab.h
@@ -24,10 +24,12 @@
#include <gtk/gtk.h>
+#include "application.h"
#include "tab-chrome.h"
#include "tab-body.h"
typedef struct {
+ MqApplication *application;
GtkWidget *container;
MqTabChrome *chrome;
MqTabBody *body;
@@ -41,7 +43,7 @@ typedef struct {
} MqTab;
MqTab *
-mq_tab_new(gchar *uri);
+mq_tab_new(MqApplication *application, gchar *uri);
GtkWidget *
mq_tab_get_tab(MqTab *tab);
diff --git a/src/window.c b/src/window.c
index 8f0d5c6..3c05330 100644
--- a/src/window.c
+++ b/src/window.c
@@ -28,12 +28,12 @@
#include "tab.h"
static void
-add_tab(MqWindow *window, gchar *uri, gint position)
+add_tab(MqApplication *application, MqWindow *window, gchar *uri, gint position)
{
MqTab *tab;
GtkWidget *tab_widget;
- tab = mq_tab_new(uri);
+ tab = mq_tab_new(application, uri);
tab_widget = mq_tab_get_container(tab);
position = gtk_notebook_insert_page(GTK_NOTEBOOK(window->notebook),
@@ -83,10 +83,10 @@ mq_window_new(MqApplication *application, gchar **uris)
if (uris && uris[0]) {
for (i = 0; uris && uris[i]; ++i) {
- add_tab(window, uris[i], -1);
+ add_tab(application, window, uris[i], -1);
}
} else {
- add_tab(window, NULL, -1);
+ add_tab(application, window, NULL, -1);
}
gtk_widget_show_all(window->window);