commit:83b79eb23390beda1fb04b00be48351fcf1b98af
author:Chip Black
committer:Chip Black
date:Wed Jun 3 03:07:11 2009 -0500
parents:7bcb5185ed09b9c691bd86d9666733723c1dc203
Moved SoupSettings down to core
diff --git a/Makefile b/Makefile
line changes: +6/-2
index 1ac11b5..48a29e5
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,19 @@
+CFLAGS = `pkg-config glib-2.0 libsoup-2.4 webkit-1.0 --cflags`
+LDFLAGS = `pkg-config glib-2.0 libsoup-2.4 webkit-1.0 --libs`
 CSFLAGS = -debug
 references = -r:webkit-sharp.dll -pkg:gtk-sharp-2.0
 
 all: main.exe plugins
 
-main.exe: main.cs WebThing.dll
+main.exe: main.cs WebThing.dll SoupSettings.so
 	gmcs $(CSFLAGS) -r:WebThing.dll main.cs
 
 WebThing.dll: WebThing.cs
 	gmcs $(CSFLAGS) $(references) -target:library -out:$@ $<
 
+SoupSettings.so: SoupSettings.c
+	$(CC) $(CFLAGS) -shared $(LDFLAGS) $< -o $@
+
 plugins:
 	make -C plugins
-
 .PHONY: plugins

diff --git a/SoupSettings.c b/SoupSettings.c
line changes: +17/-0
index 0000000..882b574
--- /dev/null
+++ b/SoupSettings.c
@@ -0,0 +1,17 @@
+#include <stdio.h>
+#include <glib.h>
+#include <webkit/webkit.h>
+#include <libsoup/soup.h>
+
+void soup_settings() {
+	SoupSession *soup_session = webkit_get_default_session();
+
+	/* Set up persistent cookies */
+	SoupCookieJar *jar = (SoupCookieJar *) soup_cookie_jar_text_new("cookies.txt", FALSE);
+	soup_session_add_feature(soup_session, SOUP_SESSION_FEATURE(jar));
+
+	GValue user_agent = {0,};
+	g_value_init(&user_agent, G_TYPE_STRING);
+	g_value_set_string(&user_agent, "WebThing 0.1");
+	g_object_set_property(G_OBJECT(soup_session), SOUP_SESSION_USER_AGENT, &user_agent);
+}

diff --git a/WebThing.cs b/WebThing.cs
line changes: +7/-1
index f325ec3..4bccfbb
--- a/WebThing.cs
+++ b/WebThing.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
 using System.Reflection;
 using System.IO;
 using System.Text.RegularExpressions;
+using System.Runtime.InteropServices;
 using Gtk;
 using GtkSharp;
 using WebKit;
@@ -47,13 +48,16 @@ namespace bytex64.WebThing {
 		public Dictionary<string,string> Options;
 		public string[] Arguments;
 
+		[DllImport ("SoupSettings.dll")]
+		private static extern void soup_settings();
+
 		public void Run() {
 			Application.Init();
 
 			ParseArgs();
 
 			_Window = new Gtk.Window("WebThing");
-			_Window.SetWmclass("WebThing", "webthing");
+			_Window.SetWmclass("webthing", "WebThing");
 			_Window.Role = "browser";
 			_Window.Destroyed += delegate { Quit(); };
 
@@ -70,6 +74,8 @@ namespace bytex64.WebThing {
 			_WebView.TitleChanged += delegate(object o, TitleChangedArgs e) {
 				_Window.Title = e.Title + " - WebThing";
 			};
+			soup_settings();
+
 			_ScrolledWindow.Add(_WebView);
 
 			_Window.ShowAll();

diff --git a/WebThing.dll.config b/WebThing.dll.config
line changes: +3/-0
index 0000000..77cd104
--- /dev/null
+++ b/WebThing.dll.config
@@ -0,0 +1,3 @@
+<configuration>
+    <dllmap dll="SoupSettings.dll" target="SoupSettings.so"/>
+</configuration>

diff --git a/plugins.conf b/plugins.conf
line changes: +0/-1
index 271eca5..e8d29e4
--- a/plugins.conf
+++ b/plugins.conf
@@ -1,4 +1,3 @@
-SoupSettings
 LoadProgress
 Vimish
 FFNav

diff --git a/plugins/Makefile b/plugins/Makefile
line changes: +1/-1
index 1583fde..993f955
--- a/plugins/Makefile
+++ b/plugins/Makefile
@@ -1,7 +1,7 @@
 CSFLAGS = -debug
 references = -r:../webkit-sharp.dll -pkg:gtk-sharp-2.0
 
-all: Vimish.dll FFNav.dll DefaultPage.dll SoupSettings.dll LoadProgress.dll
+all: Vimish.dll FFNav.dll DefaultPage.dll LoadProgress.dll
 
 clean:
 	rm -f *.dll *.mdb *.so

diff --git a/plugins/SoupSettings/Makefile b/plugins/SoupSettings/Makefile
line changes: +0/-16
index 6defa6a..0000000
--- a/plugins/SoupSettings/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-CFLAGS = `pkg-config glib-2.0 libsoup-2.4 webkit-1.0 --cflags`
-LDFLAGS = `pkg-config glib-2.0 libsoup-2.4 webkit-1.0 --libs`
-CSFLAGS = -debug
-references = -r:../../webkit-sharp.dll -pkg:gtk-sharp-2.0
-
-all: ../SoupSettings.dll
-
-clean:
-	rm -f *.dll *.mdb ../SoupSettings.dll ../SoupSettings.so
-
-../%.dll: %.cs %.so ../../WebThing.dll
-	gmcs $(CSFLAGS) $(references) -r:../../WebThing.dll -target:library -out:$@ $<
-
-%.so: %.c
-	$(CC) $(CFLAGS) -shared $(LDFLAGS) $< -o $@
-	cp $@ ../

diff --git a/plugins/SoupSettings/SoupSettings.c b/plugins/SoupSettings/SoupSettings.c
line changes: +0/-17
index 882b574..0000000
--- a/plugins/SoupSettings/SoupSettings.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#include <stdio.h>
-#include <glib.h>
-#include <webkit/webkit.h>
-#include <libsoup/soup.h>
-
-void soup_settings() {
-	SoupSession *soup_session = webkit_get_default_session();
-
-	/* Set up persistent cookies */
-	SoupCookieJar *jar = (SoupCookieJar *) soup_cookie_jar_text_new("cookies.txt", FALSE);
-	soup_session_add_feature(soup_session, SOUP_SESSION_FEATURE(jar));
-
-	GValue user_agent = {0,};
-	g_value_init(&user_agent, G_TYPE_STRING);
-	g_value_set_string(&user_agent, "WebThing 0.1");
-	g_object_set_property(G_OBJECT(soup_session), SOUP_SESSION_USER_AGENT, &user_agent);
-}

diff --git a/plugins/SoupSettings/SoupSettings.cs b/plugins/SoupSettings/SoupSettings.cs
line changes: +0/-12
index 1637c97..0000000
--- a/plugins/SoupSettings/SoupSettings.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-using System;
-using System.Runtime.InteropServices;
-using bytex64.WebThing;
-
-public class Plugin {
-	[DllImport ("SoupSettings.so")]
-	private static extern void soup_settings();
-
-	public Plugin(WebThing wt) {
-		soup_settings();
-	}
-}