Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

mono-webbrowser is a support module containing browser backends

for Mono.WebBrowser. It currently includes a WebKit backend and
will in the future also include the existing Gecko backend (the
Mono.Mozilla namespace that currently resides on Mono.WebBrowser).
This code can't be in Mono.WebBrowser directly because the webkit
backend uses webkit-sharp and gtk, and 1) those libraries are not
yet available when Mono.WebBrowser is getting built and 2) this
avoids adding hard dependencies on winforms.

svn path=/trunk/mono-webbrowser/; revision=118255
  • Loading branch information...
commit 29f1120541c93d594edc2fc9604bee2726f4476c 0 parents
Andreia Gaita authored
1  AUTHORS
@@ -0,0 +1 @@
+Andreia Gaita <shana@jitted.com>
20 COPYING
@@ -0,0 +1,20 @@
+Copyright (c) 2008 Novell, Inc. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10 ChangeLog
@@ -0,0 +1,10 @@
+2008-11-08 Andreia Gaita <shana@jitted.com>
+
+ * mono-webbrowser is a support module containing browser
+ backends for Mono.WebBrowser. It currently includes a WebKit backend and
+ will in the future also include the existing Gecko backend (the
+ Mono.Mozilla namespace that currently resides on Mono.WebBrowser). This
+ code can't be in Mono.WebBrowser directly because the webkit backend
+ uses webkit-sharp and gtk, and 1) those libraries are not yet available
+ when Mono.WebBrowser is getting built and 2) this avoids adding hard
+ dependencies on winforms.
19 Makefile.am
@@ -0,0 +1,19 @@
+SUBDIRS =
+
+if BUILD_WEBKIT
+SUBDIRS += mono-webkit
+endif
+
+if BUILD_TESTS
+SUBDIRS += tests
+endif
+
+MAINTAINERCLEANFILES = \
+ Makefile.in \
+ aclocal.m4 \
+ configure \
+ config.* \
+ INSTALL \
+ install-sh \
+ missing
+
1  NEWS
@@ -0,0 +1 @@
+
2  README
@@ -0,0 +1,2 @@
+This package contains a set of browser backends to support Mono.WebBrowser. They are privately GAC'd assemblies
+used by Mono.WebBrowser directly, and are not meant to be linked to directly (hence no .pc files)
61 autogen.sh
@@ -0,0 +1,61 @@
+#!/bin/bash
+
+PROJECT=mono-webrowser
+
+function error () {
+ echo "Error: $1" 1>&2
+ exit 1
+}
+
+function check_autotool_version () {
+ which $1 &>/dev/null || {
+ error "$1 is not installed, and is required to configure $PACKAGE"
+ }
+
+ version=$($1 --version | head -n 1 | cut -f4 -d' ')
+ major=$(echo $version | cut -f1 -d.)
+ minor=$(echo $version | cut -f2 -d.)
+ major_check=$(echo $2 | cut -f1 -d.)
+ minor_check=$(echo $2 | cut -f2 -d.)
+
+ if [ $major -lt $major_check ]; then
+ do_bail=yes
+ elif [[ $minor -lt $minor_check && $major = $major_check ]]; then
+ do_bail=yes
+ fi
+
+ if [ x"$do_bail" = x"yes" ]; then
+ error "$1 version $2 or better is required to configure $PROJECT"
+ fi
+}
+
+function run () {
+ echo "Running $@ ..."
+ $@ 2>.autogen.log || {
+ cat .autogen.log 1>&2
+ rm .autogen.log
+ error "Could not run $1, which is required to configure $PROJECT"
+ }
+ rm .autogen.log
+}
+
+srcdir=$(dirname $0)
+test -z "$srcdir" && srcdir=.
+
+(test -f $srcdir/configure.ac) || {
+ error "Directory \"$srcdir\" does not look like the top-level $PROJECT directory"
+}
+
+check_autotool_version aclocal 1.9
+check_autotool_version automake 1.9
+check_autotool_version autoconf 2.13
+
+run aclocal -I .
+run autoconf
+run automake -a --gnu
+
+if [ $# = 0 ]; then
+ echo "WARNING: I am going to run configure without any arguments."
+fi
+
+run ./configure --enable-maintainer-mode $@
119 configure.ac
@@ -0,0 +1,119 @@
+AC_INIT([mono-webbrowser], [0.1.0])
+AC_PREREQ(2.50)
+AC_CONFIG_AUX_DIR(.)
+AM_INIT_AUTOMAKE([1.9 tar-ustar])
+AM_MAINTAINER_MODE
+
+AC_PROG_INSTALL
+
+DISTCHECK_CONFIGURE_FLAGS="--disable-docs"
+AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)
+
+API_VERSION="0.5.0.0"
+POLICY_VERSIONS="1.0 2.0"
+ASSEMBLY_COMPANY="Novell, Inc."
+ASSEMBLY_COPYRIGHT="2008 Novell, Inc."
+ASSEMBLY_PRODUCT="Mono.WebBrowser"
+MONO_PACKAGE="2.0"
+
+AC_SUBST(API_VERSION)
+AC_SUBST(POLICY_VERSIONS)
+AC_SUBST(ASSEMBLY_COMPANY)
+AC_SUBST(ASSEMBLY_COPYRIGHT)
+AC_SUBST(ASSEMBLY_PRODUCT)
+AC_SUBST(MONO_PACKAGE)
+
+AC_PATH_PROG(GACUTIL, gacutil, no)
+if test "x$GACUTIL" = "xno"; then
+ AC_MSG_ERROR([You need to install gacutil])
+fi
+GACUTIL_FLAGS=
+#'-package $(MONO_PACKAGE) -root $(DESTDIR)$(prefix)/lib'
+GACUTIL_POLICY_FLAGS='-root $(DESTDIR)$(prefix)/lib'
+AC_SUBST(GACUTIL_FLAGS)
+AC_SUBST(GACUTIL_POLICY_FLAGS)
+
+SHAMROCK_CHECK_MONO_MODULE(1.1.10)
+SHAMROCK_FIND_MONO_2_0_COMPILER
+SHAMROCK_FIND_MONO_RUNTIME
+SHAMROCK_CHECK_MONODOC
+
+
+AC_ARG_ENABLE([webkit],
+ AC_HELP_STRING([--enable-webkit], [Build WebKit backend (default=yes)]),
+ [
+ case "${enableval}" in
+ yes) webkit=yes ;;
+ no) webkit=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-webkit) ;;
+ esac
+ ],
+ [webkit=yes]
+)
+
+if test ! -d "$srcdir/mono-webkit" ; then
+ if test x"$webkit" = x"yes"; then
+ webkit=no
+ AC_MSG_NOTICE(WebKit backend not available to build)
+ fi
+fi
+
+if test x$webkit = x"yes"; then
+ AC_MSG_NOTICE(Configuring the WebKit backend)
+ WEBKIT_NAME="mono-webkit"
+ WEBKIT_PRODUCT="mono-webkit"
+ WEBKIT_DESCRIPTION="Managed Wrapper for the webkit engine"
+
+ AC_SUBST(WEBKIT_NAME)
+ AC_SUBST(WEBKIT_PRODUCT)
+ AC_SUBST(WEBKIT_DESCRIPTION)
+
+
+ SHAMROCK_CHECK_MONO_2_0_GAC_ASSEMBLIES(System Mono.WebBrowser)
+
+ WEBKIT_REFERENCES="-r:System -r:Mono.WebBrowser"
+ AC_SUBST(WEBKIT_REFERENCES)
+
+ PKG_CHECK_MODULES(GTKSHARP, gtk-sharp-2.0 glib-sharp-2.0 glade-sharp-2.0)
+ AC_SUBST(GTKSHARP_LIBS)
+
+ PKG_CHECK_MODULES(WEBKITSHARP, webkit-sharp-1.0)
+ AC_SUBST(WEBKITSHARP_LIBS)
+
+ AC_CONFIG_FILES([
+ mono-webkit/Makefile
+ mono-webkit/AssemblyInfo.cs
+ ])
+fi
+
+AM_CONDITIONAL(BUILD_WEBKIT, test x$webkit = xyes)
+
+AC_ARG_ENABLE([tests],
+ AC_HELP_STRING([--enable-tests], [Build tests (default=yes)]),
+ [
+ case "${enableval}" in
+ yes) tests=yes ;;
+ no) tests=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-tests) ;;
+ esac
+ ],
+ [tests=yes]
+)
+
+if test [ x$tests = x"yes" ]; then
+ AC_CONFIG_FILES([
+ tests/Makefile
+ tests/simple/Makefile
+ ])
+fi
+
+AM_CONDITIONAL(BUILD_TESTS, test x$tests = xyes)
+
+SHAMROCK_EXPAND_LIBDIR
+
+AC_CONFIG_FILES([
+Makefile
+])
+
+
+AC_OUTPUT
11 mono-webkit/AssemblyInfo.cs.in
@@ -0,0 +1,11 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+[assembly: AssemblyTitle("@WEBKIT_NAME@")]
+[assembly: AssemblyDescription("@WEBKIT_DESCRIPTION@")]
+[assembly: AssemblyCompany("@ASSEMBLY_COMPANY@")]
+[assembly: AssemblyCopyright("@ASSEMBLY_COPYRIGHT@")]
+[assembly: AssemblyProduct("@WEBKIT_PRODUCT@")]
+[assembly: AssemblyVersion("@API_VERSION@")]
+[assembly: AssemblyDelaySign(false)]
+[assembly: AssemblyKeyFile("@srcdir@/@WEBKIT_NAME@.snk")]
3  mono-webkit/ChangeLog
@@ -0,0 +1,3 @@
+2008-11-08 Andreia Gaita <shana@jitted.com>
+
+ * mono-webkit: mono-webkit is the WebKit backend for Mono.WebBrowser.
291 mono-webkit/DebugHelper.cs
@@ -0,0 +1,291 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2008 Novell, Inc.
+//
+// Authors:
+// Andreia Gaita (shana@jitted.com)
+//
+
+//#define DEBUG
+//#define TRACE
+
+using System;
+#if NET_2_0
+using System.Collections.Generic;
+#else
+using System.Collections;
+#endif
+using System.Reflection;
+using System.Text;
+using System.IO;
+using System.Diagnostics;
+
+namespace Mono.WebKit
+{
+ internal class DebugHelper
+ {
+ static DebugHelper () {
+ Debug.AutoFlush = true;
+ }
+
+ struct Data {
+ public MethodBase method;
+ public object[] args;
+ public Data (MethodBase m, object[] a) {
+ this.method = m;
+ this.args = a;
+ }
+ }
+#if NET_2_0
+ static Stack<Data> methods = new Stack<Data>();
+#else
+ class DataStack : System.Collections.Stack {
+ public new Data Peek () {
+ return (Data) base.Peek ();
+ }
+ public new Data Pop () {
+ return (Data) base.Pop ();
+ }
+ public DataStack (int initialCapacity) : base (initialCapacity) {}
+ public DataStack () : base () {}
+ public DataStack (ICollection icol) : base (icol) {}
+ }
+ static DataStack methods = new DataStack();
+#endif
+
+ [Conditional("DEBUG")]
+ internal static void DumpCallers () {
+ StackTrace trace = new StackTrace(true);
+ int count = trace.FrameCount;
+ Debug.Indent ();
+ for (int i = 1; i < count; i++) {
+ StackFrame parentFrame = trace.GetFrame(i);
+ MethodBase parentMethod = parentFrame.GetMethod();
+ string file = parentFrame.GetFileName();
+ if (file != null && file.Length > 1)
+ file = file.Substring (file.LastIndexOf (Path.DirectorySeparatorChar) + 1);
+ Debug.WriteLine(parentMethod.DeclaringType.Name + "." + parentMethod.Name +
+ " at " + file + ":" + parentFrame.GetFileLineNumber()
+ );
+ }
+
+ Debug.Unindent ();
+ }
+
+ [Conditional("DEBUG")]
+ internal static void DumpCallers (int count) {
+ StackTrace trace = new StackTrace(true);
+ int c = (count > trace.FrameCount ? trace.FrameCount : count);
+ Debug.Indent ();
+ for (int i = 1; i < c; i++) {
+ StackFrame parentFrame = trace.GetFrame(i);
+ MethodBase parentMethod = parentFrame.GetMethod();
+ string file = parentFrame.GetFileName();
+ if (file != null && file.Length > 1)
+ file = file.Substring (file.LastIndexOf (Path.DirectorySeparatorChar) + 1);
+ Debug.WriteLine(parentMethod.DeclaringType.Name + "." + parentMethod.Name +
+ " at " + file + ":" + parentFrame.GetFileLineNumber()
+ );
+ }
+
+ Debug.Unindent ();
+ }
+
+ [Conditional("DEBUG")]
+ internal static void Enter ()
+ {
+ StackTrace trace = new StackTrace();
+ methods.Push (new Data (trace.GetFrame(1).GetMethod(), null));
+ Debug.WriteLine ("Entering " + Current);
+ Debug.Indent ();
+ }
+
+ [Conditional("DEBUG")]
+ internal static void Enter (object[] args)
+ {
+ StackTrace trace = new StackTrace();
+ methods.Push (new Data (trace.GetFrame(1).GetMethod(), args));
+ Debug.WriteLine ("Entering " + Current);
+ Debug.Indent ();
+ }
+
+ [Conditional("DEBUG")]
+ internal static void Leave ()
+ {
+ if (methods.Count > 0) {
+
+ Debug.Unindent ();
+ Debug.WriteLine ("Leaving " + Current);
+ methods.Pop ();
+ }
+ }
+
+
+ static string Current
+ {
+ get {
+ if (methods.Count == 0)
+ return "";
+
+ Data data = methods.Peek ();
+ return data.method.DeclaringType.Name + "." + data.method.Name;
+ }
+ }
+
+ [Conditional("DEBUG")]
+ internal static void Print ()
+ {
+ Debug.WriteLine (Current);
+ }
+
+ [Conditional("DEBUG")]
+ internal static void Print (int index)
+ {
+ if (methods.Count == 0 || methods.Count <= index || index < 0)
+ return;
+
+#if NET_2_0
+ Stack<Data> temp = new Stack<Data>(index-1);
+#else
+ DataStack temp = new DataStack(index-1);
+#endif
+ for (int i = 0; i < index; i++)
+ temp.Push (methods.Pop ());
+
+ Data data = methods.Peek ();
+ for (int i = 0; i < temp.Count; i++)
+ methods.Push (temp.Pop());
+ temp = null;
+
+ Debug.WriteLine (data.method.DeclaringType.Name + "." + data.method.Name);
+ }
+
+ [Conditional("DEBUG")]
+ internal static void Print (string methodName, string parameterName)
+ {
+ if (methods.Count == 0)
+ return;
+
+#if NET_2_0
+ Stack<Data> temp = new Stack<Data>();
+#else
+ DataStack temp = new DataStack();
+#endif
+ Data data = methods.Peek ();
+ bool foundit = false;
+ for (int i = 0; i < methods.Count; i++)
+ {
+ data = methods.Peek ();
+ if (data.method.Name.Equals (methodName)) {
+ foundit = true;
+ break;
+ }
+ temp.Push (methods.Pop ());
+ }
+
+ for (int i = 0; i < temp.Count; i++)
+ methods.Push (temp.Pop());
+ temp = null;
+
+ if (!foundit)
+ return;
+
+ Debug.WriteLine (data.method.DeclaringType.Name + "." + data.method.Name);
+ ParameterInfo[] pi = data.method.GetParameters ();
+
+ for (int i = 0; i < pi.Length; i++) {
+ if (pi[i].Name == parameterName) {
+ Debug.Indent ();
+ Debug.Write (parameterName + "=");
+ if (pi[i].ParameterType == typeof(IntPtr))
+ Debug.WriteLine (String.Format ("0x{0:x}", ((IntPtr)data.args[i]).ToInt32()));
+ else
+ Debug.WriteLine (data.args[i]);
+ Debug.Unindent ();
+ }
+ }
+ }
+
+ [Conditional("DEBUG")]
+ internal static void Print (string parameterName)
+ {
+ if (methods.Count == 0)
+ return;
+ Data data = methods.Peek ();
+
+ ParameterInfo[] pi = data.method.GetParameters ();
+
+ for (int i = 0; i < pi.Length; i++) {
+ if (pi[i].Name == parameterName) {
+ Debug.Indent ();
+ Debug.Write (parameterName + "=");
+ if (pi[i].ParameterType == typeof(IntPtr))
+ Debug.WriteLine (String.Format ("0x{0:x}", data.args[i]));
+ else
+ Debug.WriteLine (data.args[i]);
+ Debug.Unindent ();
+ }
+ }
+ }
+
+ [Conditional("DEBUG")]
+ internal static void WriteLine (object arg)
+ {
+ Debug.WriteLine (arg);
+ }
+
+ [Conditional("DEBUG")]
+ internal static void WriteLine (string format, params object[] arg)
+ {
+ Debug.WriteLine (String.Format (format, arg));
+ }
+
+ [Conditional("DEBUG")]
+ internal static void WriteLine (string message)
+ {
+ Debug.WriteLine (message);
+ }
+
+ [Conditional("DEBUG")]
+ internal static void Indent ()
+ {
+ Debug.Indent ();
+ }
+
+ [Conditional("DEBUG")]
+ internal static void Unindent ()
+ {
+ Debug.Unindent ();
+ }
+
+ [Conditional("TRACE")]
+ internal static void TraceWriteLine (string format, params object[] arg)
+ {
+ Debug.WriteLine (String.Format (format, arg));
+ }
+
+ [Conditional("TRACE")]
+ internal static void TraceWriteLine (string message)
+ {
+ Debug.WriteLine (message);
+ }
+
+ }
+}
153 mono-webkit/EmbedWidget.cs
@@ -0,0 +1,153 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2008 Novell, Inc.
+//
+// Authors:
+// Andreia Gaita (shana@jitted.com)
+//
+
+using System;
+using Gdk;
+using Gtk;
+
+
+namespace Mono.WebKit
+{
+ internal class EmbedWidget : Gtk.Window
+ {
+ static GLib.GType gtype;
+ IntPtr handle;
+ Widget webview;
+ ScrolledWindow window;
+
+ public EmbedWidget (IntPtr handle, Adjustment h, Adjustment v) : base (Gtk.WindowType.Toplevel)
+ {
+ this.handle = handle;
+ window = new Gtk.ScrolledWindow (h, v);
+ }
+
+ public void Init ()
+ {
+ this.ParentWindow = Gdk.Window.ForeignNewForDisplay (Gdk.Display.Default, (uint)handle.ToInt32 ());
+ Gdk.Color col = new Gdk.Color();
+ Gdk.Color.Parse("White", ref col);
+ this.ModifyBg (Gtk.StateType.Normal, col);
+
+// this.ButtonPressEvent += delegate (object sender, ButtonPressEventArgs e) {
+// DebugHelper.WriteLine ("ButtonPress");
+// };
+//
+// this.FocusInEvent += delegate (object sender, FocusInEventArgs e) {
+// DebugHelper.WriteLine ("FocusInEvent");
+// };
+//
+
+// ((Widget)this).WidgetEvent += delegate (object sender, WidgetEventArgs e) {
+// DebugHelper.WriteLine ("WidgetEvent " + e.Event.Type);
+// while (Gtk.Application.EventsPending ())
+// Gtk.Application.RunIteration ();
+// };
+ }
+
+ protected override void OnRealized ()
+ {
+ DebugHelper.WriteLine ("OnRealized");
+
+ SetFlag (WidgetFlags.Realized);
+ Gdk.WindowAttr attributes = new WindowAttr();
+
+ attributes.WindowType = Gdk.WindowType.Toplevel;
+ attributes.X = this.Allocation.X;
+ attributes.Y = this.Allocation.Y;
+ attributes.Width = this.Allocation.Width;
+ attributes.Height = this.Allocation.Height;
+ attributes.Wclass = WindowClass.InputOutput;
+ attributes.Visual = this.Visual;
+ attributes.Colormap = this.Colormap;
+ attributes.EventMask = (int)this.Events;
+
+ attributes.EventMask |= (int)(Gdk.EventMask.AllEventsMask);
+
+ this.GdkWindow = new Gdk.Window(this.ParentWindow, attributes,
+ (Gdk.WindowAttributesType.X |
+ Gdk.WindowAttributesType.Y |
+ Gdk.WindowAttributesType.Visual |
+ Gdk.WindowAttributesType.Colormap));
+ this.GdkWindow.UserData = this.Handle;
+ this.Style.Attach (this.GdkWindow);
+ this.Style.SetBackground (this.GdkWindow, StateType.Normal);
+
+ ParentWindow.Events = (Gdk.EventMask) (GdkEventMask.StructureNotifyMask | GdkEventMask.SubstructureNotifyMask);
+ }
+
+
+ protected override void OnMapped ()
+ {
+ DebugHelper.WriteLine ("OnMapped");
+ base.OnMapped ();
+ GdkWindow.Show ();
+ }
+
+ protected override void OnUnmapped ()
+ {
+ DebugHelper.WriteLine ("OnUnmapped");
+ base.OnUnmapped ();
+ GdkWindow.Hide ();
+ }
+
+ protected override void OnUnrealized ()
+ {
+ DebugHelper.WriteLine ("OnUnrealized");
+ base.OnUnrealized ();
+
+ }
+
+ protected override void OnSizeAllocated (Rectangle allocation)
+ {
+ DebugHelper.DumpCallers ();
+ DebugHelper.WriteLine ("OnSizeAllocated");
+
+ if (webview != null && (WidgetFlags & WidgetFlags.Realized) != 0) {
+
+ GdkWindow.MoveResize (allocation);
+ webview.SizeAllocate (allocation);
+ }
+ base.OnSizeAllocated (allocation);
+ }
+
+ protected override void OnAdded (Widget webview)
+ {
+ this.webview = webview;
+ this.window.Add (webview);
+ base.OnAdded (window);
+ }
+
+
+
+
+ public static new GLib.GType Type {
+ get {
+ if (gtype == GLib.GType.Invalid)
+ gtype = RegisterGType (typeof (Widget));
+ return gtype;
+ }
+ }
+ }
+}
33 mono-webkit/Makefile.am
@@ -0,0 +1,33 @@
+noinst_DATA=$(WEBKIT_NAME).dll
+
+DIST_SOURCES = \
+ DebugHelper.cs \
+ EmbedWidget.cs \
+ WebBrowser.cs \
+ XEvent.cs
+
+mono_webkit_sources_in=AssemblyInfo.cs.in
+mono_webkit_generated_sources=$(mono_webkit_sources_in:.in=)
+mono_webkit_build_sources = $(addprefix $(srcdir)/, $(DIST_SOURCES))
+mono_webkit_build_sources += $(mono_webkit_generated_sources)
+
+mono-webkit.dll: $(mono_webkit_build_sources)
+ $(MCS) -debug -define:DEBUG -target:library -out:$@ $(WEBKIT_REFERENCES) $(GTKSHARP_LIBS) $(WEBKITSHARP_LIBS) $(mono_webkit_build_sources)
+
+EXTRA_DIST = mono-webkit.snk
+
+CLEANFILES = *.dll *.mdb
+
+DISTCLEANFILES = *.pidb $mono_webkit_sources_in
+
+MAINTAINERCLEANFILES = Makefile.in
+
+noinst_DATA = $(WEBKIT_NAME).dll
+
+install-data-local:
+ echo "$(GACUTIL) /i $(WEBKIT_NAME).dll /f $(GACUTIL_FLAGS)"; \
+ $(GACUTIL) /i $(WEBKIT_NAME).dll /f $(GACUTIL_FLAGS) || exit 1;
+
+uninstall-local:
+ echo "$(GACUTIL) /u $(WEBKIT_NAME) $(GACUTIL_FLAGS)"; \
+ $(GACUTIL) /u $(WEBKIT_NAME) $(GACUTIL_FLAGS) || exit 1;
514 mono-webkit/WebBrowser.cs
@@ -0,0 +1,514 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2008 Novell, Inc.
+//
+// Authors:
+// Andreia Gaita (shana@jitted.com)
+//
+
+
+using System;
+using System.ComponentModel;
+using Mono.WebBrowser;
+using Mono.WebBrowser.DOM;
+using webkit=WebKit;
+
+namespace Mono.WebKit
+{
+ internal class WebBrowser : IDisposable, IWebBrowser, INavigation
+ {
+ private IntPtr handle;
+ private int width, height;
+
+ internal webkit.WebView webview;
+ internal EmbedWidget widget;
+ private bool disposed = false;
+ private bool initialized = false;
+ private static bool started = false;
+ private static object initLock = new object ();
+ private static int widgetCount = 0;
+ private static object widgetLock = new object ();
+
+ public WebBrowser()
+ {
+ }
+
+ ~WebBrowser () {
+ Dispose (false);
+ }
+
+ #region IDisposable Members
+
+ private void Dispose (bool disposing)
+ {
+ if (!disposed) {
+ if (disposing) {
+ lock (widgetLock) {
+ widgetCount--;
+ if (widgetCount == 0) {
+ Gdk.Threads.Enter ();
+ Gtk.Application.Quit ();
+ Gdk.Threads.Leave ();
+ }
+ }
+ }
+ disposed = true;
+ }
+ }
+
+ public void Dispose ()
+ {
+ Dispose (true);
+ GC.SuppressFinalize (this);
+ }
+
+ #endregion
+
+ #region IWebBrowser
+
+ /// <summary>
+ /// Initialize a browser instance.
+ /// </summary>
+ /// <param name="handle">
+ /// A <see cref="IntPtr"/> to the native window handle of the widget
+ /// where the browser engine will draw
+ /// </param>
+ /// <param name="width">
+ /// A <see cref="System.Int32"/>. Initial width
+ /// </param>
+ /// <param name="height">
+ /// A <see cref="System.Int32"/>. Initial height
+ /// </param>
+ /// <returns>
+ /// A <see cref="System.Boolean"/>
+ /// </returns>
+ public bool Load (IntPtr handle, int width, int height)
+ {
+ this.handle = handle;
+ this.width = width;
+ this.height = height;
+
+ System.Threading.ThreadStart start = delegate () {
+ lock (widgetLock) {
+ if (!GLib.Thread.Supported)
+ GLib.Thread.Init ();
+ Gdk.Threads.Init ();
+ Gtk.Application.Init ();
+ started = true;
+ }
+ Gtk.Application.Run ();
+ };
+
+ lock (initLock) {
+ if (!started) {
+ System.Threading.Thread t = new System.Threading.Thread (start);
+ t.Start ();
+ }
+ }
+
+ while (!initialized) {
+ lock (widgetLock) {
+ if (!started)
+ continue;
+ Gdk.Threads.Enter ();
+ InitializeWindow (null, null);
+ Gdk.Threads.Leave ();
+ widgetCount++;
+ }
+ }
+// Gdk.Window.DebugUpdates = true;
+ return true;
+ }
+
+ void InitializeWindow (object _sender, EventArgs ev) {
+ Gtk.Adjustment h = new Gtk.Adjustment(0, 0, 0, 0, 0, 0);
+ Gtk.Adjustment v = new Gtk.Adjustment(0, 0, 0, 0, 0, 0);
+ v.Changed += delegate (object sender, EventArgs e) {
+ DebugHelper.WriteLine ("vertical scroll Changed " + v.Value);
+ };
+ v.ValueChanged += delegate (object sender, EventArgs e) {
+ DebugHelper.WriteLine ("vertical scroll ValueChanged " + v.Value);
+ };
+
+ widget = new EmbedWidget(handle, h, v);
+ widget.Unrealized += delegate {
+ Dispose (true);
+ };
+
+ widget.Init ();
+ webview = new webkit.WebView();
+
+ webview.LoadCommitted += delegate (object o, webkit.LoadCommittedArgs args) {
+ };
+ webview.LoadProgressChanged += delegate (object o, webkit.LoadProgressChangedArgs args) {
+ };
+
+ webview.SetScrollAdjustments (h, v);
+ widget.Add (webview);
+ widget.ShowAll ();
+ initialized = true;
+ }
+
+
+ public void Shutdown ()
+ {
+ }
+ public void FocusIn (FocusOption focus)
+ {
+ }
+ public void FocusOut ()
+ {
+ }
+ public void Activate ()
+ {
+ }
+ public void Deactivate ()
+ {
+ }
+ public void Resize (int width, int height)
+ {
+ DebugHelper.WriteLine ("Resizing to " + widget.Allocation.X + " " + widget.Allocation.Y + " " + width + " " + height);
+
+ Gdk.Threads.Enter ();
+ widget.SizeAllocate (new Gdk.Rectangle (widget.Allocation.X, widget.Allocation.Y, width, height));
+ Gdk.Threads.Leave ();
+ }
+ public void Render (byte[] data)
+ {
+ }
+ public void Render (string html)
+ {
+ }
+ public void Render (string html, string uri, string contentType)
+ {
+ }
+
+ public bool Initialized {
+ get { return initialized; }
+ }
+
+ public IWindow Window {
+ get { return null; }
+ }
+
+ public IDocument Document {
+ get { return null; }
+ }
+
+ public INavigation Navigation {
+ get {
+ return this;
+ }
+ }
+
+ public bool Offline {
+ get { return false; }
+ set { }
+ }
+
+
+ #region Events
+ public event NodeEventHandler KeyDown;
+ public event NodeEventHandler KeyPress;
+ public event NodeEventHandler KeyUp;
+ public event NodeEventHandler MouseClick;
+ public event NodeEventHandler MouseDoubleClick;
+ public event NodeEventHandler MouseDown;
+ public event NodeEventHandler MouseEnter;
+ public event NodeEventHandler MouseLeave;
+ public event NodeEventHandler MouseMove;
+ public event NodeEventHandler MouseUp;
+ public event EventHandler Focus;
+ public event EventHandler Blur;
+ public event CreateNewWindowEventHandler CreateNewWindow;
+ public event AlertEventHandler Alert;
+ public event EventHandler Loaded;
+ public event EventHandler Unloaded;
+ public event StatusChangedEventHandler StatusChanged;
+ public event LoadStartedEventHandler LoadStarted;
+ public event LoadCommitedEventHandler LoadCommited;
+ public event Mono.WebBrowser.ProgressChangedEventHandler ProgressChanged;
+ public event LoadFinishedEventHandler LoadFinished;
+ public event SecurityChangedEventHandler SecurityChanged;
+ public event ContextMenuEventHandler ContextMenuShown;
+
+ void OnKeyDown () {
+ if (KeyDown != null) {
+ KeyDown (this, new NodeEventArgs (null));
+ }
+ }
+
+ void OnKeyPress () {
+ if (KeyPress != null) {
+ KeyPress (this, new NodeEventArgs (null));
+ }
+ }
+ void OnKeyUp () {
+ if (KeyUp != null) {
+ KeyUp (this, new NodeEventArgs (null));
+ }
+ }
+ void OnMouseClick () {
+ if (MouseClick != null) {
+ MouseClick (this, new NodeEventArgs (null));
+ }
+ }
+ void OnMouseDoubleClick () {
+ if (MouseDoubleClick != null) {
+ MouseDoubleClick (this, new NodeEventArgs (null));
+ }
+ }
+ void OnMouseDown () {
+ if (MouseDown != null) {
+ MouseDown (this, new NodeEventArgs (null));
+ }
+ }
+ void OnMouseEnter () {
+ if (MouseEnter != null) {
+ MouseEnter (this, new NodeEventArgs (null));
+ }
+ }
+ void OnMouseLeave () {
+ if (MouseLeave != null) {
+ MouseLeave (this, new NodeEventArgs (null));
+ }
+ }
+ void OnMouseMove () {
+ if (MouseMove != null) {
+ MouseMove (this, new NodeEventArgs (null));
+ }
+ }
+ void OnMouseUp () {
+ if (MouseUp != null) {
+ MouseUp (this, new NodeEventArgs (null));
+ }
+ }
+ void OnFocus () {
+ if (Focus != null) {
+ Focus (this, new EventArgs ());
+ }
+ }
+ void OnBlur () {
+ if (Blur != null) {
+ Blur (this, new EventArgs ());
+ }
+ }
+ void OnCreateNewWindow () {
+ if (CreateNewWindow != null) {
+ CreateNewWindow (this, new CreateNewWindowEventArgs (false));
+ }
+ }
+ void OnAlert () {
+ if (Alert != null) {
+ Alert (this, new AlertEventArgs ());
+ }
+ }
+ void OnLoaded () {
+ if (Loaded != null) {
+ Loaded (this, new EventArgs ());
+ }
+ }
+ void OnUnloaded () {
+ if (Unloaded != null) {
+ Unloaded (this, new EventArgs ());
+ }
+ }
+ void OnStatusChanged (string message, int status) {
+ if (StatusChanged != null) {
+ StatusChanged (this, new StatusChangedEventArgs (message, status));
+ }
+ }
+ void OnLoadStarted (string uri, string frameName) {
+ if (LoadStarted != null) {
+ LoadStarted (this, new LoadStartedEventArgs (uri, frameName));
+ }
+ }
+ void OnLoadCommited (string uri) {
+ if (LoadCommited != null) {
+ LoadCommited (this, new LoadCommitedEventArgs (uri));
+ }
+ }
+ void OnProgressChanged (int progress, int maxProgress) {
+ if (ProgressChanged != null) {
+ ProgressChanged (this, new Mono.WebBrowser.ProgressChangedEventArgs (progress, maxProgress));
+ }
+ }
+ void OnLoadFinished () {
+ if (LoadFinished != null) {
+ LoadFinished (this, new LoadFinishedEventArgs (null));
+ }
+ }
+ void OnSecurityChanged (SecurityLevel state) {
+ if (SecurityChanged != null) {
+ SecurityChanged (this, new SecurityChangedEventArgs (state));
+ }
+ }
+ void OnContextMenuShown () {
+ if (ContextMenuShown != null) {
+ ContextMenuShown (this, new ContextMenuEventArgs (0, 0));
+ }
+ }
+
+ #endregion
+
+ #endregion
+
+ #region INavigation
+ public bool CanGoBack {
+ get { return webview.CanGoBack ();}
+ }
+
+ public bool CanGoForward {
+ get { return webview.CanGoForward ();}
+ }
+
+ public bool Back () {
+ if (!CanGoBack) return false;
+ Gdk.Threads.Enter ();
+ webview.GoBack ();
+ Gdk.Threads.Leave ();
+ return true;
+ }
+
+ public bool Forward () {
+ if (!CanGoForward) return false;
+ Gdk.Threads.Enter ();
+ webview.GoForward ();
+ Gdk.Threads.Leave ();
+ return true;
+ }
+
+ public void Home () {
+ }
+
+ public void Reload () {
+ DebugHelper.DumpCallers ();
+ DebugHelper.WriteLine ("Reloading...");
+
+ Gdk.Threads.Enter ();
+ webview.Reload ();
+ Gdk.Threads.Leave ();
+ }
+
+ // TODO: see if it's possible to reload from cache
+ public void Reload (ReloadOption option) {
+ DebugHelper.DumpCallers ();
+ DebugHelper.WriteLine ("Reloading...");
+
+ Gdk.Threads.Enter ();
+ webview.Reload ();
+ Gdk.Threads.Leave ();
+ }
+
+ public void Stop () {
+ Gdk.Threads.Enter ();
+ webview.StopLoading ();
+ Gdk.Threads.Leave ();
+ }
+
+ /// <summary>
+ /// Navigate to the page in the history, by index.
+ /// </summary>
+ /// <param name="index">
+ /// A <see cref="System.Int32"/> representing an absolute index in the
+ /// history (that is, > -1 and < history length
+ /// </param>
+ public void Go (int index) {
+ if (index < 0)
+ return;
+
+
+ webkit.WebBackForwardList history = webview.BackForwardList;
+ int len = history.ForwardLength + history.BackLength + 1;
+ if (index > len) {
+ return;
+ }
+ webkit.WebHistoryItem item = history.GetNthItem (index);
+ Gdk.Threads.Enter ();
+ webview.GoToBackForwardItem (item);
+ Gdk.Threads.Leave ();
+ }
+
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="index">
+ /// A <see cref="System.Int32"/> representing an index in the
+ /// history, that can be relative or absolute depending on the relative argument
+ /// </param>
+ /// <param name="relative">
+ /// A <see cref="System.Boolean"/> indicating whether the index is relative to
+ /// the current place in history or not (i.e., if relative = true, index can be
+ /// positive or negative, and index=-1 means load the previous page in the history.
+ /// if relative = false, index must be > -1, and index = 0 means load the first
+ /// page of the history.
+ /// </param>
+ public void Go (int index, bool relative) {
+ if (!relative)
+ Go (index);
+ else {
+ if (!webview.CanGoBackOrForward (index)) {
+ return;
+ }
+ Gdk.Threads.Enter ();
+ webview.GoBackOrForward (index);
+ Gdk.Threads.Leave ();
+ }
+ }
+
+
+ /// <summary>
+ /// Navigate to an Url. Uses default loading flags, so the page might come
+ /// from cache
+ /// </summary>
+ /// <param name="url">
+ /// A <see cref="System.String"/> representing an Url
+ /// </param>
+ public void Go (string url) {
+ Gdk.Threads.Enter ();
+ webview.Open (url);
+ Gdk.Threads.Leave ();
+ }
+
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="url">
+ /// A <see cref="System.String"/> representing an Url.
+ /// </param>
+ /// <param name="flags">
+ /// A <see cref="LoadFlags"/> that control if the page comes from cache or not.
+ /// </param>
+ public void Go (string url, LoadFlags flags) {
+ Gdk.Threads.Enter ();
+ webview.Open (url);
+ Gdk.Threads.Leave ();
+ }
+
+ public int HistoryCount {
+ get {
+ webkit.WebBackForwardList history = webview.BackForwardList;
+ return history.ForwardLength + history.BackLength + 1;
+ }
+ }
+ #endregion
+
+ }
+}
858 mono-webkit/XEvent.cs
@@ -0,0 +1,858 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2008 Novell, Inc.
+//
+// Authors:
+// Andreia Gaita (shana@jitted.com)
+//
+
+using System;
+using System.ComponentModel;
+using System.Runtime.InteropServices;
+
+namespace Mono.WebKit
+{
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct XAnyEvent {
+ internal XEventName type;
+ internal IntPtr serial;
+ internal bool send_event;
+ internal IntPtr display;
+ internal IntPtr window;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct XKeyEvent {
+ internal XEventName type;
+ internal IntPtr serial;
+ internal bool send_event;
+ internal IntPtr display;
+ internal IntPtr window;
+ internal IntPtr root;
+ internal IntPtr subwindow;
+ internal IntPtr time;
+ internal int x;
+ internal int y;
+ internal int x_root;
+ internal int y_root;
+ internal int state;
+ internal int keycode;
+ internal bool same_screen;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct XButtonEvent {
+ internal XEventName type;
+ internal IntPtr serial;
+ internal bool send_event;
+ internal IntPtr display;
+ internal IntPtr window;
+ internal IntPtr root;
+ internal IntPtr subwindow;
+ internal IntPtr time;
+ internal int x;
+ internal int y;
+ internal int x_root;
+ internal int y_root;
+ internal int state;
+ internal int button;
+ internal bool same_screen;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct XMotionEvent {
+ internal XEventName type;
+ internal IntPtr serial;
+ internal bool send_event;
+ internal IntPtr display;
+ internal IntPtr window;
+ internal IntPtr root;
+ internal IntPtr subwindow;
+ internal IntPtr time;
+ internal int x;
+ internal int y;
+ internal int x_root;
+ internal int y_root;
+ internal int state;
+ internal byte is_hint;
+ internal bool same_screen;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct XCrossingEvent {
+ internal XEventName type;
+ internal IntPtr serial;
+ internal bool send_event;
+ internal IntPtr display;
+ internal IntPtr window;
+ internal IntPtr root;
+ internal IntPtr subwindow;
+ internal IntPtr time;
+ internal int x;
+ internal int y;
+ internal int x_root;
+ internal int y_root;
+ internal NotifyMode mode;
+ internal NotifyDetail detail;
+ internal bool same_screen;
+ internal bool focus;
+ internal int state;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct XFocusChangeEvent {
+ internal XEventName type;
+ internal IntPtr serial;
+ internal bool send_event;
+ internal IntPtr display;
+ internal IntPtr window;
+ internal int mode;
+ internal NotifyDetail detail;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct XKeymapEvent {
+ internal XEventName type;
+ internal IntPtr serial;
+ internal bool send_event;
+ internal IntPtr display;
+ internal IntPtr window;
+ internal byte key_vector0;
+ internal byte key_vector1;
+ internal byte key_vector2;
+ internal byte key_vector3;
+ internal byte key_vector4;
+ internal byte key_vector5;
+ internal byte key_vector6;
+ internal byte key_vector7;
+ internal byte key_vector8;
+ internal byte key_vector9;
+ internal byte key_vector10;
+ internal byte key_vector11;
+ internal byte key_vector12;
+ internal byte key_vector13;
+ internal byte key_vector14;
+ internal byte key_vector15;
+ internal byte key_vector16;
+ internal byte key_vector17;
+ internal byte key_vector18;
+ internal byte key_vector19;
+ internal byte key_vector20;
+ internal byte key_vector21;
+ internal byte key_vector22;
+ internal byte key_vector23;
+ internal byte key_vector24;
+ internal byte key_vector25;
+ internal byte key_vector26;
+ internal byte key_vector27;
+ internal byte key_vector28;
+ internal byte key_vector29;
+ internal byte key_vector30;
+ internal byte key_vector31;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct XExposeEvent {
+ internal XEventName type;
+ internal IntPtr serial;
+ internal bool send_event;
+ internal IntPtr display;
+ internal IntPtr window;
+ internal int x;
+ internal int y;
+ internal int width;
+ internal int height;
+ internal int count;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct XGraphicsExposeEvent {
+ internal XEventName type;
+ internal IntPtr serial;
+ internal bool send_event;
+ internal IntPtr display;
+ internal IntPtr drawable;
+ internal int x;
+ internal int y;
+ internal int width;
+ internal int height;
+ internal int count;
+ internal int major_code;
+ internal int minor_code;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct XNoExposeEvent {
+ internal XEventName type;
+ internal IntPtr serial;
+ internal bool send_event;
+ internal IntPtr display;
+ internal IntPtr drawable;
+ internal int major_code;
+ internal int minor_code;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct XVisibilityEvent {
+ internal XEventName type;
+ internal IntPtr serial;
+ internal bool send_event;
+ internal IntPtr display;
+ internal IntPtr window;
+ internal int state;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct XCreateWindowEvent {
+ internal XEventName type;
+ internal IntPtr serial;
+ internal bool send_event;
+ internal IntPtr display;
+ internal IntPtr parent;
+ internal IntPtr window;
+ internal int x;
+ internal int y;
+ internal int width;
+ internal int height;
+ internal int border_width;
+ internal bool override_redirect;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct XDestroyWindowEvent {
+ internal XEventName type;
+ internal IntPtr serial;
+ internal bool send_event;
+ internal IntPtr display;
+ internal IntPtr xevent;
+ internal IntPtr window;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct XUnmapEvent {
+ internal XEventName type;
+ internal IntPtr serial;
+ internal bool send_event;
+ internal IntPtr display;
+ internal IntPtr xevent;
+ internal IntPtr window;
+ internal bool from_configure;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct XMapEvent {
+ internal XEventName type;
+ internal IntPtr serial;
+ internal bool send_event;
+ internal IntPtr display;
+ internal IntPtr xevent;
+ internal IntPtr window;
+ internal bool override_redirect;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct XMapRequestEvent {
+ internal XEventName type;
+ internal IntPtr serial;
+ internal bool send_event;
+ internal IntPtr display;
+ internal IntPtr parent;
+ internal IntPtr window;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct XReparentEvent {
+ internal XEventName type;
+ internal IntPtr serial;
+ internal bool send_event;
+ internal IntPtr display;
+ internal IntPtr xevent;
+ internal IntPtr window;
+ internal IntPtr parent;
+ internal int x;
+ internal int y;
+ internal bool override_redirect;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct XConfigureEvent {
+ internal XEventName type;
+ internal IntPtr serial;
+ internal bool send_event;
+ internal IntPtr display;
+ internal IntPtr xevent;
+ internal IntPtr window;
+ internal int x;
+ internal int y;
+ internal int width;
+ internal int height;
+ internal int border_width;
+ internal IntPtr above;
+ internal bool override_redirect;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct XGravityEvent {
+ internal XEventName type;
+ internal IntPtr serial;
+ internal bool send_event;
+ internal IntPtr display;
+ internal IntPtr xevent;
+ internal IntPtr window;
+ internal int x;
+ internal int y;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct XResizeRequestEvent {
+ internal XEventName type;
+ internal IntPtr serial;
+ internal bool send_event;
+ internal IntPtr display;
+ internal IntPtr window;
+ internal int width;
+ internal int height;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct XConfigureRequestEvent {
+ internal XEventName type;
+ internal IntPtr serial;
+ internal bool send_event;
+ internal IntPtr display;
+ internal IntPtr parent;
+ internal IntPtr window;
+ internal int x;
+ internal int y;
+ internal int width;
+ internal int height;
+ internal int border_width;
+ internal IntPtr above;
+ internal int detail;
+ internal IntPtr value_mask;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct XCirculateEvent {
+ internal XEventName type;
+ internal IntPtr serial;
+ internal bool send_event;
+ internal IntPtr display;
+ internal IntPtr xevent;
+ internal IntPtr window;
+ internal int place;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct XCirculateRequestEvent {
+ internal XEventName type;
+ internal IntPtr serial;
+ internal bool send_event;
+ internal IntPtr display;
+ internal IntPtr parent;
+ internal IntPtr window;
+ internal int place;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct XPropertyEvent {
+ internal XEventName type;
+ internal IntPtr serial;
+ internal bool send_event;
+ internal IntPtr display;
+ internal IntPtr window;
+ internal IntPtr atom;
+ internal IntPtr time;
+ internal int state;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct XSelectionClearEvent {
+ internal XEventName type;
+ internal IntPtr serial;
+ internal bool send_event;
+ internal IntPtr display;
+ internal IntPtr window;
+ internal IntPtr selection;
+ internal IntPtr time;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct XSelectionRequestEvent {
+ internal XEventName type;
+ internal IntPtr serial;
+ internal bool send_event;
+ internal IntPtr display;
+ internal IntPtr owner;
+ internal IntPtr requestor;
+ internal IntPtr selection;
+ internal IntPtr target;
+ internal IntPtr property;
+ internal IntPtr time;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct XSelectionEvent {
+ internal XEventName type;
+ internal IntPtr serial;
+ internal bool send_event;
+ internal IntPtr display;
+ internal IntPtr requestor;
+ internal IntPtr selection;
+ internal IntPtr target;
+ internal IntPtr property;
+ internal IntPtr time;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct XColormapEvent {
+ internal XEventName type;
+ internal IntPtr serial;
+ internal bool send_event;
+ internal IntPtr display;
+ internal IntPtr window;
+ internal IntPtr colormap;
+ internal bool c_new;
+ internal int state;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct XClientMessageEvent {
+ internal XEventName type;
+ internal IntPtr serial;
+ internal bool send_event;
+ internal IntPtr display;
+ internal IntPtr window;
+ internal IntPtr message_type;
+ internal int format;
+ internal IntPtr ptr1;
+ internal IntPtr ptr2;
+ internal IntPtr ptr3;
+ internal IntPtr ptr4;
+ internal IntPtr ptr5;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct XMappingEvent {
+ internal XEventName type;
+ internal IntPtr serial;
+ internal bool send_event;
+ internal IntPtr display;
+ internal IntPtr window;
+ internal int request;
+ internal int first_keycode;
+ internal int count;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct XErrorEvent {
+ internal XEventName type;
+ internal IntPtr display;
+ internal IntPtr resourceid;
+ internal IntPtr serial;
+ internal byte error_code;
+ internal XRequest request_code;
+ internal byte minor_code;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct XEventPad {
+ internal IntPtr pad0;
+ internal IntPtr pad1;
+ internal IntPtr pad2;
+ internal IntPtr pad3;
+ internal IntPtr pad4;
+ internal IntPtr pad5;
+ internal IntPtr pad6;
+ internal IntPtr pad7;
+ internal IntPtr pad8;
+ internal IntPtr pad9;
+ internal IntPtr pad10;
+ internal IntPtr pad11;
+ internal IntPtr pad12;
+ internal IntPtr pad13;
+ internal IntPtr pad14;
+ internal IntPtr pad15;
+ internal IntPtr pad16;
+ internal IntPtr pad17;
+ internal IntPtr pad18;
+ internal IntPtr pad19;
+ internal IntPtr pad20;
+ internal IntPtr pad21;
+ internal IntPtr pad22;
+ internal IntPtr pad23;
+ }
+
+ [StructLayout(LayoutKind.Explicit)]
+ internal struct XEvent {
+ [ FieldOffset(0) ] internal XEventName type;
+ [ FieldOffset(0) ] internal XAnyEvent AnyEvent;
+ [ FieldOffset(0) ] internal XKeyEvent KeyEvent;
+ [ FieldOffset(0) ] internal XButtonEvent ButtonEvent;
+ [ FieldOffset(0) ] internal XMotionEvent MotionEvent;
+ [ FieldOffset(0) ] internal XCrossingEvent CrossingEvent;
+ [ FieldOffset(0) ] internal XFocusChangeEvent FocusChangeEvent;
+ [ FieldOffset(0) ] internal XExposeEvent ExposeEvent;
+ [ FieldOffset(0) ] internal XGraphicsExposeEvent GraphicsExposeEvent;
+ [ FieldOffset(0) ] internal XNoExposeEvent NoExposeEvent;
+ [ FieldOffset(0) ] internal XVisibilityEvent VisibilityEvent;
+ [ FieldOffset(0) ] internal XCreateWindowEvent CreateWindowEvent;
+ [ FieldOffset(0) ] internal XDestroyWindowEvent DestroyWindowEvent;
+ [ FieldOffset(0) ] internal XUnmapEvent UnmapEvent;
+ [ FieldOffset(0) ] internal XMapEvent MapEvent;
+ [ FieldOffset(0) ] internal XMapRequestEvent MapRequestEvent;
+ [ FieldOffset(0) ] internal XReparentEvent ReparentEvent;
+ [ FieldOffset(0) ] internal XConfigureEvent ConfigureEvent;
+ [ FieldOffset(0) ] internal XGravityEvent GravityEvent;
+ [ FieldOffset(0) ] internal XResizeRequestEvent ResizeRequestEvent;
+ [ FieldOffset(0) ] internal XConfigureRequestEvent ConfigureRequestEvent;
+ [ FieldOffset(0) ] internal XCirculateEvent CirculateEvent;
+ [ FieldOffset(0) ] internal XCirculateRequestEvent CirculateRequestEvent;
+ [ FieldOffset(0) ] internal XPropertyEvent PropertyEvent;
+ [ FieldOffset(0) ] internal XSelectionClearEvent SelectionClearEvent;
+ [ FieldOffset(0) ] internal XSelectionRequestEvent SelectionRequestEvent;
+ [ FieldOffset(0) ] internal XSelectionEvent SelectionEvent;
+ [ FieldOffset(0) ] internal XColormapEvent ColormapEvent;
+ [ FieldOffset(0) ] internal XClientMessageEvent ClientMessageEvent;
+ [ FieldOffset(0) ] internal XMappingEvent MappingEvent;
+ [ FieldOffset(0) ] internal XErrorEvent ErrorEvent;
+ [ FieldOffset(0) ] internal XKeymapEvent KeymapEvent;
+
+ //[MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=24)]
+ //[ FieldOffset(0) ] internal int[] pad;
+ [ FieldOffset(0) ] internal XEventPad Pad;
+ public override string ToString() {
+ switch (type)
+ {
+ case XEventName.ButtonPress:
+ case XEventName.ButtonRelease:
+ return ToString (ButtonEvent);
+ case XEventName.CirculateNotify:
+ case XEventName.CirculateRequest:
+ return ToString (CirculateEvent);
+ case XEventName.ClientMessage:
+ return ToString (ClientMessageEvent);
+ case XEventName.ColormapNotify:
+ return ToString (ColormapEvent);
+ case XEventName.ConfigureNotify:
+ return ToString (ConfigureEvent);
+ case XEventName.ConfigureRequest:
+ return ToString (ConfigureRequestEvent);
+ case XEventName.CreateNotify:
+ return ToString (CreateWindowEvent);
+ case XEventName.DestroyNotify:
+ return ToString (DestroyWindowEvent);
+ case XEventName.Expose:
+ return ToString (ExposeEvent);
+ case XEventName.FocusIn:
+ case XEventName.FocusOut:
+ return ToString (FocusChangeEvent);
+ case XEventName.GraphicsExpose:
+ return ToString (GraphicsExposeEvent);
+ case XEventName.GravityNotify:
+ return ToString (GravityEvent);
+ case XEventName.KeymapNotify:
+ return ToString (KeymapEvent);
+ case XEventName.MapNotify:
+ return ToString (MapEvent);
+ case XEventName.MappingNotify:
+ return ToString (MappingEvent);
+ case XEventName.MapRequest:
+ return ToString (MapRequestEvent);
+ case XEventName.MotionNotify:
+ return ToString (MotionEvent);
+ case XEventName.NoExpose:
+ return ToString (NoExposeEvent);
+ case XEventName.PropertyNotify:
+ return ToString (PropertyEvent);
+ case XEventName.ReparentNotify:
+ return ToString (ReparentEvent);
+ case XEventName.ResizeRequest:
+ return ToString (ResizeRequestEvent);
+ case XEventName.SelectionClear:
+ return ToString (SelectionClearEvent);
+ case XEventName.SelectionNotify:
+ return ToString (SelectionEvent);
+ case XEventName.SelectionRequest:
+ return ToString (SelectionRequestEvent);
+ case XEventName.UnmapNotify:
+ return ToString (UnmapEvent);
+ case XEventName.VisibilityNotify:
+ return ToString (VisibilityEvent);
+ case XEventName.EnterNotify:
+ case XEventName.LeaveNotify:
+ return ToString (CrossingEvent);
+ default:
+ return type.ToString ();
+ }
+ }
+
+ public static string ToString (object ev)
+ {
+ string result = string.Empty;
+ Type type = ev.GetType ();
+ System.Reflection.FieldInfo [] fields = type.GetFields (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Instance);
+ for (int i = 0; i < fields.Length; i++) {
+ if (result != string.Empty) {
+ result += ", ";
+ }
+ object value = fields [i].GetValue (ev);
+ if (fields[i].FieldType == typeof(IntPtr))
+ result += String.Format (fields [i].Name + "= 0x{0:x}", (value == null ? 0 : ((IntPtr)value).ToInt32()));
+ else
+ result += fields [i].Name + "=" + (value == null ? "<null>" : value.ToString ());
+ }
+ return type.Name + " (" + result + ")";
+ }
+ }
+
+ internal enum XEventName {
+ KeyPress = 2,
+ KeyRelease = 3,
+ ButtonPress = 4,
+ ButtonRelease = 5,
+ MotionNotify = 6,
+ EnterNotify = 7,
+ LeaveNotify = 8,
+ FocusIn = 9,
+ FocusOut = 10,
+ KeymapNotify = 11,
+ Expose = 12,
+ GraphicsExpose = 13,
+ NoExpose = 14,
+ VisibilityNotify = 15,
+ CreateNotify = 16,
+ DestroyNotify = 17,
+ UnmapNotify = 18,
+ MapNotify = 19,
+ MapRequest = 20,
+ ReparentNotify = 21,
+ ConfigureNotify = 22,
+ ConfigureRequest = 23,
+ GravityNotify = 24,
+ ResizeRequest = 25,
+ CirculateNotify = 26,
+ CirculateRequest = 27,
+ PropertyNotify = 28,
+ SelectionClear = 29,
+ SelectionRequest = 30,
+ SelectionNotify = 31,
+ ColormapNotify = 32,
+ ClientMessage = 33,
+ MappingNotify = 34,
+
+ LASTEvent
+ }
+
+ internal enum NotifyMode {
+ NotifyNormal = 0,
+ NotifyGrab = 1,
+ NotifyUngrab = 2
+ }
+
+ internal enum NotifyDetail {
+ NotifyAncestor = 0,
+ NotifyVirtual = 1,
+ NotifyInferior = 2,
+ NotifyNonlinear = 3,
+ NotifyNonlinearVirtual = 4,
+ NotifyPointer = 5,
+ NotifyPointerRoot = 6,
+ NotifyDetailNone = 7
+ }
+
+ internal enum XRequest : byte {
+ X_CreateWindow = 1,
+ X_ChangeWindowAttributes = 2,
+ X_GetWindowAttributes = 3,
+ X_DestroyWindow = 4,
+ X_DestroySubwindows = 5,
+ X_ChangeSaveSet = 6,
+ X_ReparentWindow = 7,
+ X_MapWindow = 8,
+ X_MapSubwindows = 9,
+ X_UnmapWindow = 10,
+ X_UnmapSubwindows = 11,
+ X_ConfigureWindow = 12,
+ X_CirculateWindow = 13,
+ X_GetGeometry = 14,
+ X_QueryTree = 15,
+ X_InternAtom = 16,
+ X_GetAtomName = 17,
+ X_ChangeProperty = 18,
+ X_DeleteProperty = 19,
+ X_GetProperty = 20,
+ X_ListProperties = 21,
+ X_SetSelectionOwner = 22,
+ X_GetSelectionOwner = 23,
+ X_ConvertSelection = 24,
+ X_SendEvent = 25,
+ X_GrabPointer = 26,
+ X_UngrabPointer = 27,
+ X_GrabButton = 28,
+ X_UngrabButton = 29,
+ X_ChangeActivePointerGrab = 30,
+ X_GrabKeyboard = 31,
+ X_UngrabKeyboard = 32,
+ X_GrabKey = 33,
+ X_UngrabKey = 34,
+ X_AllowEvents = 35,
+ X_GrabServer = 36,
+ X_UngrabServer = 37,
+ X_QueryPointer = 38,
+ X_GetMotionEvents = 39,
+ X_TranslateCoords = 40,
+ X_WarpPointer = 41,
+ X_SetInputFocus = 42,
+ X_GetInputFocus = 43,
+ X_QueryKeymap = 44,
+ X_OpenFont = 45,
+ X_CloseFont = 46,
+ X_QueryFont = 47,
+ X_QueryTextExtents = 48,
+ X_ListFonts = 49,
+ X_ListFontsWithInfo = 50,
+ X_SetFontPath = 51,
+ X_GetFontPath = 52,
+ X_CreatePixmap = 53,
+ X_FreePixmap = 54,
+ X_CreateGC = 55,
+ X_ChangeGC = 56,
+ X_CopyGC = 57,
+ X_SetDashes = 58,
+ X_SetClipRectangles = 59,
+ X_FreeGC = 60,
+ X_ClearArea = 61,
+ X_CopyArea = 62,
+ X_CopyPlane = 63,
+ X_PolyPoint = 64,
+ X_PolyLine = 65,
+ X_PolySegment = 66,
+ X_PolyRectangle = 67,
+ X_PolyArc = 68,
+ X_FillPoly = 69,
+ X_PolyFillRectangle = 70,
+ X_PolyFillArc = 71,
+ X_PutImage = 72,
+ X_GetImage = 73,
+ X_PolyText8 = 74,
+ X_PolyText16 = 75,
+ X_ImageText8 = 76,
+ X_ImageText16 = 77,
+ X_CreateColormap = 78,
+ X_FreeColormap = 79,
+ X_CopyColormapAndFree = 80,
+ X_InstallColormap = 81,
+ X_UninstallColormap = 82,
+ X_ListInstalledColormaps = 83,
+ X_AllocColor = 84,
+ X_AllocNamedColor = 85,
+ X_AllocColorCells = 86,
+ X_AllocColorPlanes = 87,
+ X_FreeColors = 88,
+ X_StoreColors = 89,
+ X_StoreNamedColor = 90,
+ X_QueryColors = 91,
+ X_LookupColor = 92,
+ X_CreateCursor = 93,
+ X_CreateGlyphCursor = 94,
+ X_FreeCursor = 95,
+ X_RecolorCursor = 96,
+ X_QueryBestSize = 97,
+ X_QueryExtension = 98,
+ X_ListExtensions = 99,
+ X_ChangeKeyboardMapping = 100,
+ X_GetKeyboardMapping = 101,
+ X_ChangeKeyboardControl = 102,
+ X_GetKeyboardControl = 103,
+ X_Bell = 104,
+ X_ChangePointerControl = 105,
+ X_GetPointerControl = 106,
+ X_SetScreenSaver = 107,
+ X_GetScreenSaver = 108,
+ X_ChangeHosts = 109,
+ X_ListHosts = 110,
+ X_SetAccessControl = 111,
+ X_SetCloseDownMode = 112,
+ X_KillClient = 113,
+ X_RotateProperties = 114,
+ X_ForceScreenSaver = 115,
+ X_SetPointerMapping = 116,
+ X_GetPointerMapping = 117,
+ X_SetModifierMapping = 118,
+ X_GetModifierMapping = 119,
+ X_NoOperation = 127
+ }
+
+ [Flags]
+ internal enum EventMask {
+ NoEventMask = 0,
+ KeyPressMask = 1<<0,
+ KeyReleaseMask = 1<<1,
+ ButtonPressMask = 1<<2,
+ ButtonReleaseMask = 1<<3,
+ EnterWindowMask = 1<<4,
+ LeaveWindowMask = 1<<5,
+ PointerMotionMask = 1<<6,
+ PointerMotionHintMask = 1<<7,
+ Button1MotionMask = 1<<8,
+ Button2MotionMask = 1<<9,
+ Button3MotionMask = 1<<10,
+ Button4MotionMask = 1<<11,
+ Button5MotionMask = 1<<12,
+ ButtonMotionMask = 1<<13,
+ KeymapStateMask = 1<<14,
+ ExposureMask = 1<<15,
+ VisibilityChangeMask = 1<<16,
+ StructureNotifyMask = 1<<17,
+ ResizeRedirectMask = 1<<18,
+ SubstructureNotifyMask = 1<<19,
+ SubstructureRedirectMask= 1<<20,
+ FocusChangeMask = 1<<21,
+ PropertyChangeMask = 1<<22,
+ ColormapChangeMask = 1<<23,
+ OwnerGrabButtonMask = 1<<24
+ }
+
+ [Flags]
+ internal enum GdkEventMask {
+ ExposureMask = EventMask.ExposureMask,
+ PointerMotionMask = EventMask.PointerMotionMask,
+ PointerMotionHintMask = EventMask.PointerMotionHintMask,
+ ButtonMotionMask = EventMask.ButtonMotionMask,
+ Button1MotionMask = EventMask.Button1MotionMask,
+ Button2MotionMask = EventMask.Button2MotionMask,
+ Button3MotionMask = EventMask.Button3MotionMask,
+ ButtonPressMask = EventMask.ButtonPressMask,
+ ButtonReleaseMask = EventMask.ButtonReleaseMask,
+ KeyPressMask = EventMask.KeyPressMask,
+ KeyReleaseMask = EventMask.KeyReleaseMask,
+ EnterWindowMask = EventMask.EnterWindowMask,
+ LeaveWindowMask = EventMask.LeaveWindowMask,
+ FocusChangeMask = EventMask.FocusChangeMask,
+ StructureNotifyMask = EventMask.StructureNotifyMask,
+ PropertyChangeMask = EventMask.PropertyChangeMask,
+ VisibilityChangeMask = EventMask.VisibilityChangeMask,
+ PROXIMITY_IN = 0,
+ PROXIMTY_OUT = 0,
+ SubstructureNotifyMask = EventMask.SubstructureNotifyMask,
+ ButtonPressMask2 = EventMask.ButtonPressMask
+ }
+}
BIN  mono-webkit/mono-webkit.snk
Binary file not shown
102 shamrock.m4
@@ -0,0 +1,102 @@
+AC_DEFUN([SHAMROCK_EXPAND_LIBDIR],
+[
+ expanded_libdir=`(
+ case $prefix in
+ NONE) prefix=$ac_default_prefix ;;
+ *) ;;
+ esac
+ case $exec_prefix in
+ NONE) exec_prefix=$prefix ;;
+ *) ;;
+ esac
+ eval echo $libdir
+ )`
+ AC_SUBST(expanded_libdir)
+])
+
+AC_DEFUN([SHAMROCK_FIND_PROGRAM],
+[
+ AC_PATH_PROG($1, $2, $3)
+ AC_SUBST($1)
+])
+
+AC_DEFUN([SHAMROCK_FIND_PROGRAM_OR_BAIL],
+[
+ SHAMROCK_FIND_PROGRAM($1, $2, no)
+ if test "x$1" = "xno"; then
+ AC_MSG_ERROR([You need to install '$2'])
+ fi
+])
+
+AC_DEFUN([SHAMROCK_FIND_MONO_1_0_COMPILER],
+[
+ SHAMROCK_FIND_PROGRAM_OR_BAIL(MCS, mcs)
+])
+
+AC_DEFUN([SHAMROCK_FIND_MONO_2_0_COMPILER],
+[
+ SHAMROCK_FIND_PROGRAM_OR_BAIL(MCS, gmcs)
+])
+
+AC_DEFUN([SHAMROCK_FIND_MONO_RUNTIME],
+[
+ SHAMROCK_FIND_PROGRAM_OR_BAIL(MONO, mono)
+])
+
+AC_DEFUN([SHAMROCK_CHECK_MONO_MODULE],
+[
+ PKG_CHECK_MODULES(MONO_MODULE, mono >= $1)
+])
+
+AC_DEFUN([_SHAMROCK_CHECK_MONO_GAC_ASSEMBLIES],
+[
+ for asm in $(echo "$*" | cut -d, -f2- | sed 's/\,/ /g')
+ do
+ AC_MSG_CHECKING([for Mono $1 GAC for $asm.dll])
+ if test \
+ -e "$($PKG_CONFIG --variable=libdir mono)/mono/$1/$asm.dll" -o \
+ -e "$($PKG_CONFIG --variable=prefix mono)/lib/mono/$1/$asm.dll"; \
+ then \
+ AC_MSG_RESULT([found])
+ else
+ AC_MSG_RESULT([not found])
+ AC_MSG_ERROR([missing reqired Mono $1 assembly: $asm.dll])
+ fi
+ done
+])
+
+AC_DEFUN([SHAMROCK_CHECK_MONO_1_0_GAC_ASSEMBLIES],
+[
+ _SHAMROCK_CHECK_MONO_GAC_ASSEMBLIES(1.0, $*)
+])
+
+AC_DEFUN([SHAMROCK_CHECK_MONO_2_0_GAC_ASSEMBLIES],
+[
+ _SHAMROCK_CHECK_MONO_GAC_ASSEMBLIES(2.0, $*)
+])
+
+AC_DEFUN([SHAMROCK_CHECK_MONODOC],
+[
+ AC_ARG_ENABLE(docs, AC_HELP_STRING([--disable-docs],
+ [Do not build documentation]), , enable_docs=yes)
+
+ if test "x$enable_docs" = "xyes"; then
+ AC_PATH_PROG(MONODOCER, monodocer, no)
+ if test "x$MONODOCER" = "xno"; then
+ AC_MSG_ERROR([You need to install monodoc, or pass --disable-docs to configure to skip documentation installation])
+ fi
+
+ AC_PATH_PROG(MDASSEMBLER, mdassembler, no)
+ if test "x$MDASSEMBLER" = "xno"; then
+ AC_MSG_ERROR([You need to install mdassembler, or pass --disable-docs to configure to skip documentation installation])
+ fi
+
+ DOCDIR=`$PKG_CONFIG monodoc --variable=sourcesdir`
+ AC_SUBST(DOCDIR)
+ AM_CONDITIONAL(BUILD_DOCS, true)
+ else
+ AC_MSG_NOTICE([not building API documentation])
+ AM_CONDITIONAL(BUILD_DOCS, false)
+ fi
+])
+
2  tests/Makefile.am
@@ -0,0 +1,2 @@
+SUBDIRS = simple
+MAINTAINERCLEANFILES = Makefile.in
17 tests/simple/Makefile.am
@@ -0,0 +1,17 @@
+noinst_DATA = browser.exe
+
+DIST_SOURCES = browser.cs
+
+simple_sources_in=
+simple_generated_sources=$(simple_sources_in:.in=)
+simple_build_sources = $(addprefix $(srcdir)/, $(DIST_SOURCES))
+simple_build_sources += $(simple_generated_sources)
+
+browser.exe: $(simple_build_sources)
+ $(MCS) -debug -target:winexe -out:$@ -pkg:dotnet $(simple_build_sources)
+
+CLEANFILES = *.exe *.mdb
+
+DISTCLEANFILES = *.pidb $simple_sources_in
+
+MAINTAINERCLEANFILES = Makefile.in
24 tests/simple/browser.cs
@@ -0,0 +1,24 @@
+using System;
+using System.Windows.Forms;
+using System.Drawing;
+
+namespace tests.simple {
+
+ public class browser : Form {
+ public static void Main () {
+ Application.Run (new browser ());
+ }
+
+ WebBrowser webbrowser;
+ public browser () {
+ webbrowser = new WebBrowser ();
+ webbrowser.Dock = DockStyle.Fill;
+
+ this.Controls.Add (webbrowser);
+ webbrowser.Navigate ("http://www.google.com");
+
+ }
+ }
+
+
+}

1 comment on commit 29f1120

aleclearmind

Hi, I'm trying to use webkit as a backend for the WebBrowser control. I don't use gecko because it's based on libgluezilla, which uses xulrunner, which is an abandoned project (nowadays the npapi-sdk should be used).

Here's a test case:

public static void Main(string[] args)
{
    Form asd = new Form();
    WebBrowser wb = new WebBrowser();
    wb.Navigate("http://google.com/");
    wb.Dock = DockStyle.Fill;
    asd.Controls.Add(wb);
    asd.ShowDialog();
}

I'm using:

  • mono 2.10.9
  • webkit-sharp 0.3
  • gtk-sharp 2.12.10

mono-webkit and my project target .Net 4.0.

Here's the output I get when I run the application using MONO_BROWSER_ENGINE="webkit":

Could not set X locale modifiers
KDE colorscheme read failure, using built-in colorscheme
Stacktrace:


Native stacktrace:

    mono() [0x492707]
    mono() [0x4e391f]
    mono() [0x41bd09]
    /lib64/libpthread.so.0(+0x10460) [0x7f9113e65460]
    /usr/lib64/libwebkitgtk-1.0.so.0(+0xadec5c) [0x7f90fb09fc5c]
    /usr/lib64/libwebkitgtk-1.0.so.0(+0xade633) [0x7f90fb09f633]
    /usr/lib64/libwebkitgtk-1.0.so.0(+0xade758) [0x7f90fb09f758]
    /usr/lib64/libwebkitgtk-1.0.so.0(+0x3b56c6) [0x7f90fa9766c6]
    /usr/lib64/libwebkitgtk-1.0.so.0(+0xaca4c6) [0x7f90fb08b4c6]
    /usr/lib64/libwebkitgtk-1.0.so.0(+0x9f0228) [0x7f90fafb1228]
    /usr/lib64/libwebkitgtk-1.0.so.0(+0x9f271d) [0x7f90fafb371d]
    /usr/lib64/libwebkitgtk-1.0.so.0(+0x9f3752) [0x7f90fafb4752]
    /usr/lib64/libwebkitgtk-1.0.so.0(+0x3b6f78) [0x7f90fa977f78]
    /usr/lib64/libwebkitgtk-1.0.so.0(+0x3b77bb) [0x7f90fa9787bb]
    /usr/lib64/libglib-2.0.so.0(+0x4b44b) [0x7f910ea7644b]
    /usr/lib64/libglib-2.0.so.0(g_main_context_dispatch+0x143) [0x7f910ea75883]
    /usr/lib64/libglib-2.0.so.0(+0x4abc8) [0x7f910ea75bc8]
    /usr/lib64/libglib-2.0.so.0(g_main_loop_run+0x6a) [0x7f910ea75fba]
    /usr/lib64/libgtk-x11-2.0.so.0(gtk_main+0xa7) [0x7f91059d3827]
    [0x41f3e475]

Debug info from gdb:

warning: File "/usr/bin/mono-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[New LWP 20074]
[New LWP 20035]
[New LWP 20033]
[New LWP 20026]
[New LWP 20024]
[New LWP 19953]
[New LWP 19638]
[New LWP 19632]
[New LWP 19631]
[New LWP 19630]
[New LWP 19628]
[New LWP 19627]
[New LWP 19626]
[New LWP 19625]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
0x00007f91149a3993 in strcmp () from /lib64/ld-linux-x86-64.so.2
Id   Target Id         Frame 
15   Thread 0x7f9113aa9700 (LWP 19625) "mono" 0x00007f9113e615ec in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
14   Thread 0x7f91132a8700 (LWP 19626) "mono" 0x00007f9113e615ec in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
13   Thread 0x7f9112aa7700 (LWP 19627) "mono" 0x00007f9113e615ec in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
12   Thread 0x7f91122a6700 (LWP 19628) "mono" 0x00007f9113e615ec in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
11   Thread 0x7f9111aa5700 (LWP 19630) "mono" 0x00007f9113e615ec in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
10   Thread 0x7f91112a4700 (LWP 19631) "mono" 0x00007f9113e615ec in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
9    Thread 0x7f9110aa3700 (LWP 19632) "mono" 0x00007f9113e615ec in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
8    Thread 0x7f910f730700 (LWP 19638) "mono" 0x00007f9113e637e0 in sem_wait () from /lib64/libpthread.so.0
7    Thread 0x7f9101026700 (LWP 19953) "mono" 0x00007f9113e6501d in waitpid () from /lib64/libpthread.so.0
6    Thread 0x7f90f6d71700 (LWP 20024) "mono" 0x00007f9113e615ec in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
5    Thread 0x7f90b646e700 (LWP 20026) "mono" 0x00007f9113e615ec in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
4    Thread 0x7f90b5193700 (LWP 20033) "dconf worker" 0x00007f9113b8ca53 in poll () from /lib64/libc.so.6
3    Thread 0x7f90b4992700 (LWP 20035) "gdbus" 0x00007f9113b8ca53 in poll () from /lib64/libc.so.6
2    Thread 0x7f90a7df7700 (LWP 20074) "pool" 0x00007f9113e6196e in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
* 1    Thread 0x7f9114b6c740 (LWP 19623) "mono" 0x00007f91149a3993 in strcmp () from /lib64/ld-linux-x86-64.so.2

Thread 15 (Thread 0x7f9113aa9700 (LWP 19625)):
#0  0x00007f9113e615ec in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00000000005e1663 in GC_wait_marker () at pthread_support.c:1863
#2  0x00000000005db9f5 in GC_help_marker (my_mark_no=9) at mark.c:1116
#3  0x00000000005dfe87 in GC_mark_thread (id=<optimized out>) at pthread_support.c:552
#4  0x00007f9113e5cda6 in start_thread () from /lib64/libpthread.so.0
#5  0x00007f9113b9595d in clone () from /lib64/libc.so.6

Thread 14 (Thread 0x7f91132a8700 (LWP 19626)):
#0  0x00007f9113e615ec in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00000000005e1663 in GC_wait_marker () at pthread_support.c:1863
#2  0x00000000005db9f5 in GC_help_marker (my_mark_no=9) at mark.c:1116
#3  0x00000000005dfe87 in GC_mark_thread (id=<optimized out>) at pthread_support.c:552
#4  0x00007f9113e5cda6 in start_thread () from /lib64/libpthread.so.0
#5  0x00007f9113b9595d in clone () from /lib64/libc.so.6

Thread 13 (Thread 0x7f9112aa7700 (LWP 19627)):
#0  0x00007f9113e615ec in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00000000005e1663 in GC_wait_marker () at pthread_support.c:1863
#2  0x00000000005db9f5 in GC_help_marker (my_mark_no=9) at mark.c:1116
#3  0x00000000005dfe87 in GC_mark_thread (id=<optimized out>) at pthread_support.c:552
#4  0x00007f9113e5cda6 in start_thread () from /lib64/libpthread.so.0
#5  0x00007f9113b9595d in clone () from /lib64/libc.so.6

Thread 12 (Thread 0x7f91122a6700 (LWP 19628)):
#0  0x00007f9113e615ec in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00000000005e1663 in GC_wait_marker () at pthread_support.c:1863
#2  0x00000000005db9f5 in GC_help_marker (my_mark_no=9) at mark.c:1116
#3  0x00000000005dfe87 in GC_mark_thread (id=<optimized out>) at pthread_support.c:552
#4  0x00007f9113e5cda6 in start_thread () from /lib64/libpthread.so.0
#5  0x00007f9113b9595d in clone () from /lib64/libc.so.6

Thread 11 (Thread 0x7f9111aa5700 (LWP 19630)):
#0  0x00007f9113e615ec in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00000000005e1663 in GC_wait_marker () at pthread_support.c:1863
#2  0x00000000005db9f5 in GC_help_marker (my_mark_no=9) at mark.c:1116
#3  0x00000000005dfe87 in GC_mark_thread (id=<optimized out>) at pthread_support.c:552
#4  0x00007f9113e5cda6 in start_thread () from /lib64/libpthread.so.0
#5  0x00007f9113b9595d in clone () from /lib64/libc.so.6

Thread 10 (Thread 0x7f91112a4700 (LWP 19631)):
#0  0x00007f9113e615ec in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00000000005e1663 in GC_wait_marker () at pthread_support.c:1863
#2  0x00000000005db9f5 in GC_help_marker (my_mark_no=9) at mark.c:1116
#3  0x00000000005dfe87 in GC_mark_thread (id=<optimized out>) at pthread_support.c:552
#4  0x00007f9113e5cda6 in start_thread () from /lib64/libpthread.so.0
#5  0x00007f9113b9595d in clone () from /lib64/libc.so.6

Thread 9 (Thread 0x7f9110aa3700 (LWP 19632)):
#0  0x00007f9113e615ec in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00000000005e1663 in GC_wait_marker () at pthread_support.c:1863
#2  0x00000000005db9f5 in GC_help_marker (my_mark_no=9) at mark.c:1116
#3  0x00000000005dfe87 in GC_mark_thread (id=<optimized out>) at pthread_support.c:552
#4  0x00007f9113e5cda6 in start_thread () from /lib64/libpthread.so.0
#5  0x00007f9113b9595d in clone () from /lib64/libc.so.6

Thread 8 (Thread 0x7f910f730700 (LWP 19638)):
#0  0x00007f9113e637e0 in sem_wait () from /lib64/libpthread.so.0
#1  0x00000000005c6728 in mono_sem_wait (sem=0x8f00c0 <finalizer_sem>, alertable=1) at mono-semaphore.c:113
#2  0x0000000000512dab in finalizer_thread (unused=<optimized out>) at gc.c:1066
#3  0x00000000005965c5 in start_wrapper_internal (data=<optimized out>) at threads.c:784
#4  start_wrapper (data=0x1783450) at threads.c:832
#5  0x00000000005c1004 in thread_start_routine (args=0x1765e40) at wthreads.c:287
#6  0x00000000005e0d41 in GC_start_routine (arg=<optimized out>) at pthread_support.c:1468
#7  0x00007f9113e5cda6 in start_thread () from /lib64/libpthread.so.0
#8  0x00007f9113b9595d in clone () from /lib64/libc.so.6

Thread 7 (Thread 0x7f9101026700 (LWP 19953)):
#0  0x00007f9113e6501d in waitpid () from /lib64/libpthread.so.0
#1  0x000000000049284e in mono_handle_native_sigsegv (signal=<optimized out>, ctx=<optimized out>) at mini-exceptions.c:2192
#2  0x00000000004e391f in mono_arch_handle_altstack_exception (sigctx=0x7f9105ee3ac0, fault_addr=<optimized out>, stack_ovf=0) at exceptions-amd64.c:953
#3  0x000000000041bd09 in mono_sigsegv_signal_handler (_dummy=11, info=0x7f9105ee3bf0, context=0x7f9105ee3ac0) at mini.c:5909
#4  <signal handler called>
#5  0x00007f90fb09fc5c in void std::__push_heap<WebCore::TimerHeapIterator, long, WebCore::TimerBase*, WebCore::TimerHeapLessThanFunction>(WebCore::TimerHeapIterator, long, long, WebCore::TimerBase*, WebCore::TimerHeapLessThanFunction) () from /usr/lib64/libwebkitgtk-1.0.so.0
#6  0x00007f90fb09f633 in WebCore::TimerBase::heapDecreaseKey() () from /usr/lib64/libwebkitgtk-1.0.so.0
#7  0x00007f90fb09f758 in WebCore::TimerBase::setNextFireTime(double) () from /usr/lib64/libwebkitgtk-1.0.so.0
#8  0x00007f90fa9766c6 in WebKit::ChromeClient::invalidateContentsAndRootView(WebCore::IntRect const&, bool) () from /usr/lib64/libwebkitgtk-1.0.so.0
#9  0x00007f90fb08b4c6 in WebCore::ScrollView::repaintContentRectangle(WebCore::IntRect const&, bool) () from /usr/lib64/libwebkitgtk-1.0.so.0
#10 0x00007f90fafb1228 in WebCore::FrameView::doDeferredRepaints() () from /usr/lib64/libwebkitgtk-1.0.so.0
#11 0x00007f90fafb371d in WebCore::FrameView::layout(bool) () from /usr/lib64/libwebkitgtk-1.0.so.0
#12 0x00007f90fafb4752 in WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive() () from /usr/lib64/libwebkitgtk-1.0.so.0
#13 0x00007f90fa977f78 in WebKit::ChromeClient::paint(WebCore::Timer<WebKit::ChromeClient>*) () from /usr/lib64/libwebkitgtk-1.0.so.0
#14 0x00007f90fa9787bb in WebKit::repaintEverythingSoonTimeout(WebKit::ChromeClient*) () from /usr/lib64/libwebkitgtk-1.0.so.0
#15 0x00007f910ea7644b in g_timeout_dispatch () from /usr/lib64/libglib-2.0.so.0
#16 0x00007f910ea75883 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#17 0x00007f910ea75bc8 in g_main_context_iterate.clone.5 () from /usr/lib64/libglib-2.0.so.0
#18 0x00007f910ea75fba in g_main_loop_run () from /usr/lib64/libglib-2.0.so.0
#19 0x00007f91059d3827 in gtk_main () from /usr/lib64/libgtk-x11-2.0.so.0
#20 0x0000000041f3e475 in ?? ()
#21 0x00007f90fc000c20 in ?? ()
#22 0x00007f9114b7bcc0 in ?? ()
#23 0x00007f9105f88410 in ?? ()
#24 0x00007f9105f88410 in ?? ()
#25 0x00007f90fc000cb0 in ?? ()
#26 0x00007f9101025b40 in ?? ()
#27 0x00007f9101025aa0 in ?? ()
#28 0x00007f9114b7bcc0 in ?? ()
#29 0x00007f9105f88410 in ?? ()
#30 0x00007f9105f88410 in ?? ()
#31 0x00007f9105f88410 in ?? ()
#32 0x0000000041f3e40c in ?? ()
#33 0x00007f9101025b40 in ?? ()
#34 0x0000000041f3b750 in ?? ()
#35 0x00007f9105f88410 in ?? ()
#36 0x01007f9114b7bcc8 in ?? ()
#37 0x00007f91149cf200 in ?? ()
#38 0x0000000001b13a98 in ?? ()
#39 0x0000000041f3aedc in ?? ()
#40 0x00007f9101025b00 in ?? ()
#41 0x00007f9101025bc0 in ?? ()
#42 0x0000000041f3b652 in ?? ()
#43 0x0000000000000000 in ?? ()

Thread 6 (Thread 0x7f90f6d71700 (LWP 20024)):
#0  0x00007f9113e615ec in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007f90fa2d33a4 in WTF::TCMalloc_PageHeap::scavengerThread() () from /usr/lib64/libjavascriptcoregtk-1.0.so.0
#2  0x00007f90fa2d33c9 in WTF::TCMalloc_PageHeap::runScavengerThread(void*) () from /usr/lib64/libjavascriptcoregtk-1.0.so.0
#3  0x00007f9113e5cda6 in start_thread () from /lib64/libpthread.so.0
#4  0x00007f9113b9595d in clone () from /lib64/libc.so.6

Thread 5 (Thread 0x7f90b646e700 (LWP 20026)):
#0  0x00007f9113e615ec in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007f90faf2977b in WebCore::IconDatabase::syncThreadMainLoop() () from /usr/lib64/libwebkitgtk-1.0.so.0
#2  0x00007f90faf29a1c in WebCore::IconDatabase::iconDatabaseSyncThread() () from /usr/lib64/libwebkitgtk-1.0.so.0
#3  0x00007f90fa2f2251 in WTF::wtfThreadEntryPoint(void*) () from /usr/lib64/libjavascriptcoregtk-1.0.so.0
#4  0x00007f9113e5cda6 in start_thread () from /lib64/libpthread.so.0
#5  0x00007f9113b9595d in clone () from /lib64/libc.so.6

Thread 4 (Thread 0x7f90b5193700 (LWP 20033)):
#0  0x00007f9113b8ca53 in poll () from /lib64/libc.so.6
#1  0x00007f910ea75b66 in g_main_context_iterate.clone.5 () from /usr/lib64/libglib-2.0.so.0
#2  0x00007f910ea75c84 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007f90b539fa5d in dconf_gdbus_worker_thread () from /usr/lib64/gio/modules/libdconfsettings.so
#4  0x00007f910ea9a4c5 in g_thread_proxy () from /usr/lib64/libglib-2.0.so.0
#5  0x00007f9113e5cda6 in start_thread () from /lib64/libpthread.so.0
#6  0x00007f9113b9595d in clone () from /lib64/libc.so.6

Thread 3 (Thread 0x7f90b4992700 (LWP 20035)):
#0  0x00007f9113b8ca53 in poll () from /lib64/libc.so.6
#1  0x00007f910ea75b66 in g_main_context_iterate.clone.5 () from /usr/lib64/libglib-2.0.so.0
#2  0x00007f910ea75fba in g_main_loop_run () from /usr/lib64/libglib-2.0.so.0
#3  0x00007f9104d0a166 in gdbus_shared_thread_func () from /usr/lib64/libgio-2.0.so.0
#4  0x00007f910ea9a4c5 in g_thread_proxy () from /usr/lib64/libglib-2.0.so.0
#5  0x00007f9113e5cda6 in start_thread () from /lib64/libpthread.so.0
#6  0x00007f9113b9595d in clone () from /lib64/libc.so.6

Thread 2 (Thread 0x7f90a7df7700 (LWP 20074)):
#0  0x00007f9113e6196e in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007f910eab4dfa in g_cond_wait_until () from /usr/lib64/libglib-2.0.so.0
#2  0x00007f910ea4b781 in g_async_queue_pop_intern_unlocked () from /usr/lib64/libglib-2.0.so.0
#3  0x00007f910ea9adde in g_thread_pool_thread_proxy () from /usr/lib64/libglib-2.0.so.0
#4  0x00007f910ea9a4c5 in g_thread_proxy () from /usr/lib64/libglib-2.0.so.0
#5  0x00007f9113e5cda6 in start_thread () from /lib64/libpthread.so.0
#6  0x00007f9113b9595d in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7f9114b6c740 (LWP 19623)):
#0  0x00007f91149a3993 in strcmp () from /lib64/ld-linux-x86-64.so.2
#1  0x00007f911499444c in _dl_map_object () from /lib64/ld-linux-x86-64.so.2
#2  0x00007f911499e79c in dl_open_worker () from /lib64/ld-linux-x86-64.so.2
#3  0x00007f911499a286 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2
#4  0x00007f911499e22a in _dl_open () from /lib64/ld-linux-x86-64.so.2
#5  0x00007f91140730c6 in dlopen_doit () from /lib64/libdl.so.2
#6  0x00007f911499a286 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2
#7  0x00007f911407366c in _dlerror_run () from /lib64/libdl.so.2
#8  0x00007f9114073171 in dlopen@@GLIBC_2.2.5 () from /lib64/libdl.so.2
#9  0x00000000005c1d09 in mono_dl_open (name=0x1cc1750 "/usr/lib64/mono/gac/System.Drawing/4.0.0.0__b03f5f7f11d50a3a/libgdiplus.dll", flags=<optimized out>, error_msg=0x7fff3e1c4cf8) at mono-dl.c:328
#10 0x0000000000526c38 in cached_module_load (name=0x1cc1750 "/usr/lib64/mono/gac/System.Drawing/4.0.0.0__b03f5f7f11d50a3a/libgdiplus.dll", err=0x7fff3e1c4cf8, flags=1) at loader.c:1260
#11 0x00000000005272a3 in mono_lookup_pinvoke_call (method=0x1ceed60, exc_class=0x7fff3e1c4d90, exc_arg=0x7fff3e1c4d88) at loader.c:1375
#12 0x0000000000540900 in mono_marshal_get_native_wrapper (method=0x1ceed60, check_exceptions=0, aot=0) at marshal.c:8297
#13 0x000000000043ea68 in mono_method_to_ir (cfg=<optimized out>, method=0x1af3f38, start_bblock=0x1cdbd30, end_bblock=0x1cdbe58, return_var=0x0, dont_inline=0x1ce73f0, inline_args=0x0, inline_offset=0, is_virtual_call=0) at method-to-ir.c:6643
#14 0x000000000041db27 in mini_method_compile (method=0x1af3f38, opts=51472895, domain=0x7f9114b7bcc0, run_cctors=<optimized out>, compile_aot=0, parts=0) at mini.c:4474
#15 0x000000000041f34c in mono_jit_compile_method_inner (jit_ex=0x7fff3e1c53c8, opt=51472895, target_domain=0x7f9114b7bcc0, method=0x1af3f38) at mini.c:5180
#16 mono_jit_compile_method_with_opt (method=0x1af3f38, opt=51472895, ex=0x7fff3e1c53c8) at mini.c:5404
#17 0x000000000041fbcd in mono_jit_compile_method (method=<optimized out>) at mini.c:5429
#18 0x0000000000494581 in common_call_trampoline (regs=0x7fff3e1c5668, code=0x4116bc3c "H\213\370", <incomplete sequence \350\254>, m=0x1af3f38, vt=0x0, vtable_slot=<optimized out>, need_rgctx_tramp=0, tramp=<optimized out>) at mini-trampolines.c:492
#19 0x000000004041216a in ?? ()
#20 0x00007f91149ca400 in ?? ()
#21 0x00007f91000d5b40 in ?? ()
#22 0x00007fff3e1c5750 in ?? ()
#23 0x00000000005943e3 in mono_thread_interruption_checkpoint_request (bypass_abort_protection=1042044688) at threads.c:4185
#24 0x0000000040412177 in ?? ()
#25 0x00007fff3e1c54a0 in ?? ()
#26 0x0000000000000000 in ?? ()

=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

Any help is appreciated.
Thanks.

Please sign in to comment.
Something went wrong with that request. Please try again.