Moved SoupSettings down to core
+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
+#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);
+}
using System.Reflection;
using System.IO;
using System.Text.RegularExpressions;
+using System.Runtime.InteropServices;
using Gtk;
using GtkSharp;
using WebKit;
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(); };
_WebView.TitleChanged += delegate(object o, TitleChangedArgs e) {
_Window.Title = e.Title + " - WebThing";
};
+ soup_settings();
+
_ScrolledWindow.Add(_WebView);
_Window.ShowAll();
+<configuration>
+ <dllmap dll="SoupSettings.dll" target="SoupSettings.so"/>
+</configuration>
-SoupSettings
LoadProgress
Vimish
FFNav
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
-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 $@ ../
-#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);
-}
-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();
- }
-}