Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

No commit message

  • Loading branch information...
commit efdd79f1027fe22d5c9c05f3719c65578184ff8f 0 parents
peterdn authored
Showing with 4,776 additions and 0 deletions.
  1. +26 −0 LICENSE.txt
  2. +22 −0 README.txt
  3. +32 −0 WebKit.NET.sln
  4. +125 −0 WebKitBrowser/ActivationContext.cs
  5. +62 −0 WebKitBrowser/Properties/AssemblyInfo.cs
  6. +63 −0 WebKitBrowser/Properties/Resources.Designer.cs
  7. +101 −0 WebKitBrowser/Properties/Resources.resx
  8. +94 −0 WebKitBrowser/W32API.cs
  9. +135 −0 WebKitBrowser/WebDownloadDelegate.cs
  10. +153 −0 WebKitBrowser/WebFrameLoadDelegate.cs
  11. +69 −0 WebKitBrowser/WebKitBrowser.Designer.cs
  12. +535 −0 WebKitBrowser/WebKitBrowser.cs
  13. +97 −0 WebKitBrowser/WebKitBrowser.csproj
  14. +141 −0 WebKitBrowser/WebKitBrowser.manifest
  15. +120 −0 WebKitBrowser/WebKitBrowser.resx
  16. +56 −0 WebKitBrowser/WebKitBrowserEvents.cs
  17. +96 −0 WebKitBrowser/WebKitDownload.cs
  18. +61 −0 WebKitBrowser/WebKitDownloadEvents.cs
  19. +71 −0 WebKitBrowser/WebPolicyDelegate.cs
  20. +89 −0 WebKitBrowser/WebResourceLoadDelegate.cs
  21. +356 −0 WebKitBrowser/WebUIDelegate.cs
  22. +97 −0 WebKitBrowserTest/DownloadForm.Designer.cs
  23. +65 −0 WebKitBrowserTest/DownloadForm.cs
  24. +120 −0 WebKitBrowserTest/DownloadForm.resx
  25. +218 −0 WebKitBrowserTest/MainForm.Designer.cs
  26. +163 −0 WebKitBrowserTest/MainForm.cs
  27. +123 −0 WebKitBrowserTest/MainForm.resx
  28. +178 −0 WebKitBrowserTest/NavigationBar.Designer.cs
  29. +112 −0 WebKitBrowserTest/NavigationBar.cs
  30. +120 −0 WebKitBrowserTest/NavigationBar.resx
  31. +46 −0 WebKitBrowserTest/Program.cs
  32. +62 −0 WebKitBrowserTest/Properties/AssemblyInfo.cs
  33. +71 −0 WebKitBrowserTest/Properties/Resources.Designer.cs
  34. +117 −0 WebKitBrowserTest/Properties/Resources.resx
  35. +30 −0 WebKitBrowserTest/Properties/Settings.Designer.cs
  36. +7 −0 WebKitBrowserTest/Properties/Settings.settings
  37. +145 −0 WebKitBrowserTest/SourceViewForm.Designer.cs
  38. +59 −0 WebKitBrowserTest/SourceViewForm.cs
  39. +123 −0 WebKitBrowserTest/SourceViewForm.resx
  40. +66 −0 WebKitBrowserTest/WebBrowserTabPage.Designer.cs
  41. +103 −0 WebKitBrowserTest/WebBrowserTabPage.cs
  42. +123 −0 WebKitBrowserTest/WebBrowserTabPage.resx
  43. +124 −0 WebKitBrowserTest/WebKitBrowserTest.csproj
  44. BIN  webkit/WebKit.Interop.dll
26 LICENSE.txt
@@ -0,0 +1,26 @@
+All source code provided in this release of WebKit.NET is subject to the
+following licensing terms:
+
+Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
22 README.txt
@@ -0,0 +1,22 @@
+WebKit.NET README
+*****************
+
+WebKit.NET is a control library wrapper for WebKit written in C#.
+
+Currently the source code is licensed under a BSD open source license, see
+LICENSE.txt for details.
+
+This package currently contains two Visual C# 2008 projects and a build of the
+WebKit library (including dependencies) in the following folders:
+
+ WebKitBrowser - WebKit.NET control library.
+
+ WebKitBrowserTest - A simple application that uses the WebKit.NET control
+ to display web pages.
+
+ webkit - The WebKit library and dependencies.
+
+The current releases are at a very early stage of development and are not
+recommended for production level use yet.
+
+Please send any questions or feedback to Peter Nelson at charn.opcode@gmail.com
32 WebKit.NET.sln
@@ -0,0 +1,32 @@
+
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebKitBrowser", "WebKitBrowser\WebKitBrowser.csproj", "{44AFE214-12C7-4280-898D-A7C4AABF1533}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebKitBrowserTest", "WebKitBrowserTest\WebKitBrowserTest.csproj", "{0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{9A0D75E0-65F8-4777-B5A0-B84937944551}"
+ ProjectSection(SolutionItems) = preProject
+ LICENSE.txt = LICENSE.txt
+ README.txt = README.txt
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {44AFE214-12C7-4280-898D-A7C4AABF1533}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {44AFE214-12C7-4280-898D-A7C4AABF1533}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {44AFE214-12C7-4280-898D-A7C4AABF1533}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {44AFE214-12C7-4280-898D-A7C4AABF1533}.Release|Any CPU.Build.0 = Release|Any CPU
+ {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
125 WebKitBrowser/ActivationContext.cs
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/// TODO:
+/// garbage collection / deinitialization
+/// support for manifest resource
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Runtime.InteropServices;
+using WebKit;
+
+namespace WebKit
+{
+ /// <summary>
+ /// A simple interface to the Windows Activation Context API.
+ /// </summary>
+ /// <remarks>
+ /// Activation context switching is required here to support registration
+ /// free COM interop. Ordinarily this can be achieved by embedding an
+ /// application manifest with mappings to COM objects in the assembly,
+ /// however this does not work in a class library. (TODO: verify this...)
+ /// Instead we create an activation context which explicitly loads a
+ /// manifest and activate this context when we need to create a COM object.
+ /// </remarks>
+ internal class ActivationContext
+ {
+ // Read-only state properties
+ public string ManifestFileName { get; private set; }
+ public bool Activated { get; private set; }
+ public bool Initialized { get; private set; }
+
+ // Private stuff...
+ private W32API.ACTCTX activationContext;
+ private IntPtr contextHandle;
+ private uint lastCookie;
+
+ /// <summary>
+ /// Constructor for ActivationContext.
+ /// </summary>
+ /// <param name="ManifestFileName">Path of the manifest file to load.</param>
+ public ActivationContext(string ManifestFileName)
+ {
+ this.ManifestFileName = ManifestFileName;
+ this.Activated = false;
+ this.Initialized = false;
+ }
+
+ /// <summary>
+ /// Activates the activation context.
+ /// </summary>
+ /// <returns>Success value.</returns>
+ public bool Activate()
+ {
+ if (!Initialized)
+ throw new InvalidOperationException("ActivationContext has not been initialized");
+ if (!Activated)
+ {
+ lastCookie = 0;
+ Activated = W32API.ActivateActCtx(contextHandle, out lastCookie);
+ }
+ return Activated;
+ }
+
+ /// <summary>
+ /// Deactivates the activation context, activating the next one down
+ /// on the 'stack'.
+ /// </summary>
+ /// <returns>Success value.</returns>
+ public bool Deactivate()
+ {
+ if (!Initialized)
+ throw new InvalidOperationException("ActivationContext has not been initialized");
+ if (Activated)
+ {
+ // TODO: Error handling?
+ W32API.DeactivateActCtx(0, lastCookie);
+ Activated = false;
+ }
+ return true;
+ }
+
+ /// <summary>
+ /// Initializes the activation context.
+ /// </summary>
+ public void Initialize()
+ {
+ if (!Initialized)
+ {
+ activationContext = new W32API.ACTCTX();
+
+ activationContext.cbSize = Marshal.SizeOf(typeof(W32API.ACTCTX));
+ activationContext.lpSource = this.ManifestFileName;
+
+ contextHandle = W32API.CreateActCtx(ref activationContext);
+
+ Initialized = (contextHandle.ToInt32() != -1);
+ }
+ }
+ }
+}
62 WebKitBrowser/Properties/AssemblyInfo.cs
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+*/
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("WebKitBrowser")]
+[assembly: AssemblyDescription(".NET Wrapper for WebKit")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Peter Nelson")]
+[assembly: AssemblyProduct("WebKit.NET")]
+[assembly: AssemblyCopyright("Copyright © Peter Nelson 2009")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("64a334d8-c2e8-483d-885c-bb1ffaa3a3b9")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("0.2.0.0")]
+[assembly: AssemblyFileVersion("0.2.0.0")]
63 WebKitBrowser/Properties/Resources.Designer.cs
@@ -0,0 +1,63 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:2.0.50727.3074
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace WebKit.Properties {
+ using System;
+
+
+ /// <summary>
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ /// </summary>
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources() {
+ }
+
+ /// <summary>
+ /// Returns the cached ResourceManager instance used by this class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WebKit.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ /// <summary>
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+ }
+}
101 WebKitBrowser/Properties/Resources.resx
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 1.3
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">1.3</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1">this is my long string</data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ [base64 mime encoded serialized .NET Framework object]
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ [base64 mime encoded string representing a byte array form of the .NET Framework object]
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>1.3</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
94 WebKitBrowser/W32API.cs
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+*/
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace WebKit
+{
+ /// <summary>
+ /// Win32 API functions.
+ /// </summary>
+ /// <remarks>
+ /// See the MSDN Windows SDK documentation for more information about
+ /// these functions.
+ /// </remarks>
+ internal class W32API
+ {
+ [DllImport("Kernel32.dll", SetLastError = true)]
+ public static extern bool ActivateActCtx(IntPtr hActCtx, out uint lpCookie);
+
+ [DllImport("Kernel32.dll", SetLastError = true)]
+ public static extern IntPtr CreateActCtx(ref ACTCTX actctx);
+
+ [DllImport("Kernel32.dll", SetLastError = true)]
+ public static extern bool DeactivateActCtx(uint dwFlags, uint lpCookie);
+
+ [DllImport("user32.dll")]
+ public static extern bool ShowWindow(IntPtr hwnd, int nCmdShow);
+
+ [DllImport("user32.dll")]
+ public static extern bool UpdateWindow(IntPtr hwnd);
+
+ [DllImport("user32.dll")]
+ public static extern bool MoveWindow(IntPtr hwnd, int x, int y, int width, int height, bool repaint);
+
+ [DllImport("user32.dll")]
+ public static extern IntPtr SetFocus(IntPtr hwnd);
+
+ [DllImport("user32.dll")]
+ public static extern int SendMessage(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam);
+
+ [DllImport("uxtheme.dll")]
+ public static extern int SetWindowTheme(IntPtr hwnd, string textSubAppName, string textSubIdList);
+
+ [DllImport("comctl32.dll")]
+ public static extern bool InitCommonControlsEx(ref INITCOMMONCONTROLSEX lpInitCtrls);
+
+ [DllImport("user32.dll")]
+ public static extern IntPtr SetActiveWindow(IntPtr hwnd);
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct ACTCTX
+ {
+ public int cbSize;
+ public uint dwFlags;
+ public string lpSource;
+ public ushort wProcessorArchitecture;
+ public ushort wLangId;
+ public string lpAssemblyDirectory;
+ public string lpResourceName;
+ public string lpApplicationName;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct INITCOMMONCONTROLSEX
+ {
+ public int dwSize;
+ public uint dwICC;
+ }
+ }
+}
135 WebKitBrowser/WebDownloadDelegate.cs
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+*/
+
+// TODO: currently, calling WebDownload.cancel() in the 'decideDestinationWithSuggestedFilename'
+// method causes a crash - I've seen examples of this method being used here with no problems.
+// Find out whether this is a bug in webkit or what else is going on. Various useful information at
+// http://developer.apple.com/documentation/Cocoa/Conceptual/URLLoadingSystem/Tasks/UsingNSURLDownload.html
+// Also note that currently (as of revision ~45680), download stuff is not implemented in the
+// cairo build of WebKit yet.
+
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using WebKit.Interop;
+using System.Windows.Forms;
+using System.Diagnostics;
+
+namespace WebKit
+{
+ delegate void DecideDestinationWithSuggestedFilenameEvent(WebDownload download, string fileName);
+ delegate void DidBeginEvent(WebDownload download);
+ delegate void DidCancelAuthenticationChallengeEvent(WebDownload download, IWebURLAuthenticationChallenge challenge);
+ delegate void DidCreateDestinationEvent(WebDownload download, string destination);
+ delegate void DidFailWithErrorEvent(WebDownload download, WebError error);
+ delegate void DidFinishEvent(WebDownload download);
+ delegate void DidReceiveAuthenticationChallengeEvent(WebDownload download, IWebURLAuthenticationChallenge challenge);
+ delegate void DidReceiveDataOfLengthEvent(WebDownload download, uint length);
+ delegate void DidReceiveResponseEvent(WebDownload download, WebURLResponse response);
+ delegate int ShouldDecodeSourceDataOfMIMETypeEvent(WebDownload download, string encodingType);
+ delegate void WillResumeWithResponseEvent(WebDownload download, WebURLResponse response, long fromByte);
+ delegate void WillSendRequestEvent(WebDownload download, WebMutableURLRequest request, WebURLResponse redirectResponse, out WebMutableURLRequest finalRequest);
+
+ internal class WebDownloadDelegate : IWebDownloadDelegate
+ {
+ public event DecideDestinationWithSuggestedFilenameEvent DecideDestinationWithSuggestedFilename = delegate { };
+ public event DidBeginEvent DidBegin = delegate { };
+ public event DidCancelAuthenticationChallengeEvent DidCancelAuthenticationChallenge = delegate { };
+ public event DidCreateDestinationEvent DidCreateDestination = delegate { };
+ public event DidFailWithErrorEvent DidFailWithError = delegate { };
+ public event DidFinishEvent DidFinish = delegate { };
+ public event DidReceiveAuthenticationChallengeEvent DidReceiveAuthenticationChallenge = delegate { };
+ public event DidReceiveDataOfLengthEvent DidReceiveDataOfLength = delegate { };
+ public event DidReceiveResponseEvent DidReceiveResponse = delegate { };
+ public event WillResumeWithResponseEvent WillResumeWithResponse = delegate { };
+
+ #region IWebDownloadDelegate Members
+
+ public void decideDestinationWithSuggestedFilename(WebDownload download, string fileName)
+ {
+ DecideDestinationWithSuggestedFilename(download, fileName);
+ }
+
+ public void didBegin(WebDownload download)
+ {
+ DidBegin(download);
+ }
+
+ public void didCancelAuthenticationChallenge(WebDownload download, IWebURLAuthenticationChallenge challenge)
+ {
+ DidCancelAuthenticationChallenge(download, challenge);
+ }
+
+ public void didCreateDestination(WebDownload download, string destination)
+ {
+ DidCreateDestination(download, destination);
+ }
+
+ public void didFailWithError(WebDownload download, WebError error)
+ {
+ DidFailWithError(download, error);
+ }
+
+ public void didFinish(WebDownload download)
+ {
+ DidFinish(download);
+ }
+
+ public void didReceiveAuthenticationChallenge(WebDownload download, IWebURLAuthenticationChallenge challenge)
+ {
+ DidReceiveAuthenticationChallenge(download, challenge);
+ }
+
+ public void didReceiveDataOfLength(WebDownload download, uint length)
+ {
+ DidReceiveDataOfLength(download, length);
+ }
+
+ public void didReceiveResponse(WebDownload download, WebURLResponse response)
+ {
+ DidReceiveResponse(download, response);
+ }
+
+ public int shouldDecodeSourceDataOfMIMEType(WebDownload download, string encodingType)
+ {
+ // err...
+ return 0;
+ }
+
+ public void willResumeWithResponse(WebDownload download, WebURLResponse response, long fromByte)
+ {
+ WillResumeWithResponse(download, response, fromByte);
+ }
+
+ public void willSendRequest(WebDownload download, WebMutableURLRequest request, WebURLResponse redirectResponse, out WebMutableURLRequest finalRequest)
+ {
+ finalRequest = request;
+ }
+
+ #endregion
+ }
+}
153 WebKitBrowser/WebFrameLoadDelegate.cs
@@ -0,0 +1,153 @@
+/*
+ * Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+*/
+
+// info at
+// http://developer.apple.com/documentation/Cocoa/Reference/WebKit/Protocols/WebFrameLoadDelegate_Protocol
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using WebKit;
+using WebKit.Interop;
+using System.Diagnostics;
+
+namespace WebKit
+{
+ // Delegate definitions WebFrameLoadDelegate events
+ delegate void DidCancelClientRedirectForFrameEvent(WebView WebView, IWebFrame frame);
+ delegate void DidChangeLocationWithinPageForFrameEvent(WebView WebView, IWebFrame frame);
+ delegate void DidCommitLoadForFrameEvent(WebView WebView, IWebFrame frame);
+ delegate void DidFailLoadWithErrorEvent(WebView WebView, IWebError error, IWebFrame frame);
+ delegate void DidFailProvisionalLoadWithErrorEvent(WebView WebView, IWebError error, IWebFrame frame);
+ delegate void DidFinishLoadForFrameEvent(WebView WebView, IWebFrame frame);
+ delegate void DidRecieveIconEvent(WebView WebView, int hBitMap, IWebFrame frame);
+ delegate void DidRecieveServerRedirectForProvisionalLoadForFrameEvent(WebView WebView, IWebFrame frame);
+ delegate void DidRecieveTitleEvent(WebView WebView, string title, IWebFrame frame);
+ delegate void DidStartProvisionalLoadForFrameEvent(WebView WebView, IWebFrame frame);
+ delegate void WillCloseFrameEvent(WebView WebView, IWebFrame frame);
+ delegate void WillPerformClientRedirectToURLEvent(WebView WebView, string url, double delaySeconds, DateTime fireDate, IWebFrame frame);
+ delegate void WindowScriptObjectAvailableEvent(WebView WebView, IntPtr context, IntPtr windowScriptObject);
+ delegate void DidClearWindowObjectEvent(WebView WebView, IntPtr context, IntPtr windowScriptObject, IWebFrame frame);
+
+ /// <summary>
+ /// Handles frame-level events that occur from loading a web page.
+ /// </summary>
+ /// <remarks>
+ /// See Apple's WebKit documentation for detailed information about each
+ /// event.
+ /// </remarks>
+ internal class WebFrameLoadDelegate : IWebFrameLoadDelegate
+ {
+ public event DidCancelClientRedirectForFrameEvent DidCancelClientRedirectForFrame = delegate { };
+ public event DidChangeLocationWithinPageForFrameEvent DidChangeLocationWithinPageForFrame = delegate { };
+ public event DidCommitLoadForFrameEvent DidCommitLoadForFrame = delegate { };
+ public event DidFailLoadWithErrorEvent DidFailLoadWithError = delegate { };
+ public event DidFailProvisionalLoadWithErrorEvent DidFailProvisionalLoadWithError = delegate { };
+ public event DidFinishLoadForFrameEvent DidFinishLoadForFrame = delegate { };
+ public event DidRecieveIconEvent DidRecieveIcon = delegate { };
+ public event DidRecieveServerRedirectForProvisionalLoadForFrameEvent DidRecieveServerRedirectForProvisionalLoadForFrame = delegate { };
+ public event DidRecieveTitleEvent DidRecieveTitle = delegate { };
+ public event DidStartProvisionalLoadForFrameEvent DidStartProvisionalLoadForFrame = delegate { };
+ public event WillCloseFrameEvent WillCloseFrame = delegate { };
+ public event WillPerformClientRedirectToURLEvent WillPerformClientRedirectToURL = delegate { };
+ public event WindowScriptObjectAvailableEvent WindowScriptObjectAvailable = delegate { };
+ public event DidClearWindowObjectEvent DidClearWindowObject = delegate { };
+
+ #region IWebFrameLoadDelegate Members
+
+ public void didCancelClientRedirectForFrame(WebView WebView, IWebFrame frame)
+ {
+ DidCancelClientRedirectForFrame(WebView, frame);
+ }
+
+ public void didChangeLocationWithinPageForFrame(WebView WebView, IWebFrame frame)
+ {
+ DidChangeLocationWithinPageForFrame(WebView, frame);
+ }
+
+ public void didCommitLoadForFrame(WebView WebView, IWebFrame frame)
+ {
+ DidCommitLoadForFrame(WebView, frame);
+ }
+
+ public void didFailLoadWithError(WebView WebView, WebError error, IWebFrame forFrame)
+ {
+ DidFailLoadWithError(WebView, error, forFrame);
+ }
+
+ public void didFailProvisionalLoadWithError(WebView WebView, WebError error, IWebFrame frame)
+ {
+ DidFailProvisionalLoadWithError(WebView, error, frame);
+ }
+
+ public void didFinishLoadForFrame(WebView WebView, IWebFrame frame)
+ {
+ DidFinishLoadForFrame(WebView, frame);
+ }
+
+ public void didReceiveIcon(WebView WebView, int hBitmap, IWebFrame frame)
+ {
+ DidRecieveIcon(WebView, hBitmap, frame);
+ }
+
+ public void didReceiveServerRedirectForProvisionalLoadForFrame(WebView WebView, IWebFrame frame)
+ {
+ DidRecieveServerRedirectForProvisionalLoadForFrame(WebView, frame);
+ }
+
+ public void didReceiveTitle(WebView WebView, string title, IWebFrame frame)
+ {
+ DidRecieveTitle(WebView, title, frame);
+ }
+
+ public void didStartProvisionalLoadForFrame(WebView WebView, IWebFrame frame)
+ {
+ DidStartProvisionalLoadForFrame(WebView, frame);
+ }
+
+ public void willCloseFrame(WebView WebView, IWebFrame frame)
+ {
+ WillCloseFrame(WebView, frame);
+ }
+
+ public void willPerformClientRedirectToURL(WebView WebView, string url, double delaySeconds, DateTime fireDate, IWebFrame frame)
+ {
+ WillPerformClientRedirectToURL(WebView, url, delaySeconds, fireDate, frame);
+ }
+
+ public void windowScriptObjectAvailable(WebView WebView, IntPtr context, IntPtr windowScriptObject)
+ {
+ WindowScriptObjectAvailable(WebView, context, windowScriptObject);
+ }
+
+ public void didClearWindowObject(WebView WebView, IntPtr context, IntPtr windowScriptObject, IWebFrame frame)
+ {
+ DidClearWindowObject(WebView, context, windowScriptObject, frame);
+ }
+
+ #endregion
+ }
+}
69 WebKitBrowser/WebKitBrowser.Designer.cs
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+*/
+
+namespace WebKit
+{
+ partial class WebKitBrowser
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.SuspendLayout();
+ //
+ // WebKitBrowser
+ //
+ this.BackColor = System.Drawing.Color.White;
+ this.Name = "WebKitBrowser";
+ this.Size = new System.Drawing.Size(319, 255);
+ this.ResumeLayout(false);
+ }
+
+ #endregion
+ }
+}
535 WebKitBrowser/WebKitBrowser.cs
@@ -0,0 +1,535 @@
+/*
+ * Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+*/
+
+// TODO: work out why focused controls in the browser window are not
+// highlighted, and other graphical anomalies.
+
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Text;
+using System.Windows.Forms;
+using System.Runtime.InteropServices;
+using WebKit;
+using WebKit.Interop;
+using System.Diagnostics;
+
+namespace WebKit
+{
+ /// <summary>
+ /// WebKit Browser Control.
+ /// </summary>
+ public partial class WebKitBrowser : UserControl
+ {
+ // static variables
+ private static bool hasAlreadyLoaded = false;
+ private static ActivationContext activationContext;
+
+ // private member variables...
+ private IWebView webView;
+ private IntPtr webViewHWND;
+ private Dictionary<WebDownload, WebKitDownload> downloads = new Dictionary<WebDownload, WebKitDownload>();
+ private string url = "";
+
+ // delegates for WebKit events
+ private WebFrameLoadDelegate frameLoadDelegate;
+ private WebDownloadDelegate downloadDelegate;
+ private WebPolicyDelegate policyDelegate;
+ private WebUIDelegate uiDelegate;
+
+ // public events, roughly the same as in WebBrowser class
+ // using the null object pattern to avoid null tests
+ public event EventHandler DocumentTitleChanged = delegate { };
+ public event WebBrowserDocumentCompletedEventHandler DocumentCompleted = delegate { };
+ public event WebBrowserNavigatedEventHandler Navigated = delegate { };
+ public event WebBrowserNavigatingEventHandler Navigating = delegate { };
+ public event WebKitBrowserErrorEventHandler Error = delegate { };
+ public event FileDownloadBeginEventHandler DownloadBegin = delegate { };
+
+ // redirects relevant key strokes to the webkit control
+ // bit more work is needed here perhaps
+ protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
+ {
+ Keys key = (Keys)msg.WParam.ToInt32();
+ if (key == Keys.Left || key == Keys.Right || key == Keys.Up ||
+ key == Keys.Down || key == Keys.Tab)
+ {
+ W32API.SendMessage(webViewHWND, msg.Msg, msg.WParam, msg.LParam);
+ return true;
+ }
+
+ return base.ProcessCmdKey(ref msg, keyData);
+ }
+
+ #region Public properties
+
+ /// <summary>
+ /// Gets the title of the current document.
+ /// </summary>
+ public string DocumentTitle { get; private set; }
+
+ /// <summary>
+ /// Gets or sets the current Url.
+ /// </summary>
+ public Uri Url
+ {
+ get
+ {
+ if (webView != null)
+ {
+ // TODO: find out what's supposed to happen here...
+ string url = webView.mainFrame().dataSource().request().url();
+ if (url == "")
+ return null;
+ return new Uri(webView.mainFrame().dataSource().request().url());
+ }
+ else
+ return new Uri(this.url);
+ }
+ set
+ {
+ if (webView != null)
+ {
+ if (Url != null && LicenseManager.UsageMode != LicenseUsageMode.Designtime)
+ Navigate(Url.AbsoluteUri);
+ }
+ else
+ url = value.AbsoluteUri;
+ }
+ }
+
+ /// <summary>
+ /// Gets a value indicating whether a web page is currently being loaded.
+ /// </summary>
+ public bool IsBusy
+ {
+ get
+ {
+ if (webView != null)
+ return (webView.isLoading() > 0);
+ else
+ return false;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the HTML content of the current document.
+ /// </summary>
+ public string DocumentText
+ {
+ get
+ {
+ // TODO: more...
+ try
+ {
+ return webView.mainFrame().dataSource().representation().documentSource();
+ }
+ catch (Exception)
+ {
+ return "";
+ }
+ }
+ set
+ {
+ if (webView != null)
+ webView.mainFrame().loadHTMLString(value, null);
+ }
+ }
+
+ /// <summary>
+ /// Returns the currently selected text.
+ /// </summary>
+ public string SelectedText
+ {
+ get
+ {
+ // TODO: error handling
+ if (webView != null)
+ return webView.selectedText();
+ else
+ return "";
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the application name for user agent.
+ /// </summary>
+ public string ApplicationName
+ {
+ get
+ {
+ if (webView != null)
+ return webView.applicationNameForUserAgent();
+ else
+ return "";
+ }
+ set
+ {
+ if (webView != null)
+ webView.setApplicationNameForUserAgent(value);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the user agent.
+ /// </summary>
+ public string UserAgent
+ {
+ get
+ {
+ if (webView != null)
+ return webView.userAgentForURL("");
+ else
+ return "";
+ }
+ set
+ {
+ if (webView != null)
+ webView.setCustomUserAgent(value);
+ }
+ }
+
+ /// <summary>
+ /// Text size multiplier (1.0 is normal size).
+ /// </summary>
+ public float TextSize
+ {
+ get
+ {
+ if (webView != null)
+ return webView.textSizeMultiplier();
+ else
+ return 1.0f;
+ }
+ set
+ {
+ if (webView != null)
+ webView.setTextSizeMultiplier(value);
+ }
+ }
+
+ public readonly string Version = "0.2";
+
+ #endregion
+
+ #region Constructors / initialization functions
+
+ public WebKitBrowser()
+ {
+ InitializeComponent();
+
+ // Control Events
+ this.Load += new EventHandler(WebKitBrowser_Load);
+ this.Resize += new EventHandler(WebKitBrowser_Resize);
+
+ if (LicenseManager.UsageMode != LicenseUsageMode.Designtime)
+ {
+ // If this is the first time the library has been loaded,
+ // initialize the activation context required to load the
+ // WebKit COM component registration free
+ if (!hasAlreadyLoaded)
+ {
+ hasAlreadyLoaded = true;
+ activationContext = new ActivationContext("WebKitBrowser.manifest");
+ activationContext.Initialize();
+
+ // TODO: more error handling here
+
+ // Enable OLE for drag and drop functionality - WebKit
+ // will throw an OutOfMemory exception if we don't...
+ Application.OleRequired();
+ }
+ }
+
+ // If this control is brought to focus, focus our webkit child window
+ this.GotFocus += (s, e) =>
+ {
+ W32API.SetFocus(webViewHWND);
+ };
+ }
+
+ private void WebKitBrowser_Load(object sender, EventArgs e)
+ {
+ // Create the WebKit browser component
+ InitializeWebKit();
+
+ if (url != "")
+ Navigate(url);
+ }
+
+
+ private void InitializeWebKit()
+ {
+ activationContext.Activate();
+
+ webView = new WebViewClass();
+
+ frameLoadDelegate = new WebFrameLoadDelegate();
+ Marshal.AddRef(Marshal.GetIUnknownForObject(frameLoadDelegate));
+
+ downloadDelegate = new WebDownloadDelegate();
+ Marshal.AddRef(Marshal.GetIUnknownForObject(downloadDelegate));
+
+ policyDelegate = new WebPolicyDelegate();
+ Marshal.AddRef(Marshal.GetIUnknownForObject(policyDelegate));
+
+ uiDelegate = new WebUIDelegate();
+ Marshal.AddRef(Marshal.GetIUnknownForObject(uiDelegate));
+
+ webView.setPolicyDelegate(policyDelegate);
+ webView.setFrameLoadDelegate(frameLoadDelegate);
+ webView.setDownloadDelegate(downloadDelegate);
+
+ // haven't implemented this stuff yet
+ // webView.setUIDelegate(uiDelegate);
+
+ webView.setHostWindow(this.Handle.ToInt32());
+
+ tagRECT rect = new tagRECT();
+ rect.top = rect.left = 0;
+ rect.bottom = this.Height - 1;
+ rect.right = this.Width - 1;
+ webView.initWithFrame(rect, null, null);
+
+ IWebViewPrivate webViewPrivate = (IWebViewPrivate)webView;
+ webViewHWND = (IntPtr) webViewPrivate.viewWindow();
+
+ // Subscribe to FrameLoadDelegate events
+ frameLoadDelegate.DidRecieveTitle += new DidRecieveTitleEvent(frameLoadDelegate_DidRecieveTitle);
+ frameLoadDelegate.DidFinishLoadForFrame += new DidFinishLoadForFrameEvent(frameLoadDelegate_DidFinishLoadForFrame);
+ frameLoadDelegate.DidStartProvisionalLoadForFrame += new DidStartProvisionalLoadForFrameEvent(frameLoadDelegate_DidStartProvisionalLoadForFrame);
+ frameLoadDelegate.DidCommitLoadForFrame += new DidCommitLoadForFrameEvent(frameLoadDelegate_DidCommitLoadForFrame);
+ frameLoadDelegate.DidFailLoadWithError += new DidFailLoadWithErrorEvent(frameLoadDelegate_DidFailLoadWithError);
+ frameLoadDelegate.DidFailProvisionalLoadWithError += new DidFailProvisionalLoadWithErrorEvent(frameLoadDelegate_DidFailProvisionalLoadWithError);
+
+ // DownloadDelegate events
+ downloadDelegate.DidReceiveResponse += new DidReceiveResponseEvent(downloadDelegate_DidReceiveResponse);
+ downloadDelegate.DidReceiveDataOfLength += new DidReceiveDataOfLengthEvent(downloadDelegate_DidReceiveDataOfLength);
+ downloadDelegate.DecideDestinationWithSuggestedFilename += new DecideDestinationWithSuggestedFilenameEvent(downloadDelegate_DecideDestinationWithSuggestedFilename);
+ downloadDelegate.DidBegin += new DidBeginEvent(downloadDelegate_DidBegin);
+ downloadDelegate.DidFinish += new DidFinishEvent(downloadDelegate_DidFinish);
+ downloadDelegate.DidFailWithError += new DidFailWithErrorEvent(downloadDelegate_DidFailWithError);
+
+ activationContext.Deactivate();
+ }
+
+ #endregion
+
+ #region Control event handers
+
+ private void WebKitBrowser_Resize(object sender, EventArgs e)
+ {
+ if (LicenseManager.UsageMode != LicenseUsageMode.Designtime)
+ {
+ // Resize the WebKit control
+ W32API.MoveWindow(webViewHWND, 0, 0, this.Width - 1, this.Height - 1, true);
+ }
+ }
+
+ #endregion
+
+ #region WebFrameLoadDelegate event handlers
+
+ private void frameLoadDelegate_DidCommitLoadForFrame(WebView WebView, IWebFrame frame)
+ {
+ if (frame == webView.mainFrame())
+ {
+ this.UseWaitCursor = true;
+ Navigated(this, new WebBrowserNavigatedEventArgs(this.Url));
+ }
+ }
+
+ private void frameLoadDelegate_DidStartProvisionalLoadForFrame(WebView WebView, IWebFrame frame)
+ {
+ if (frame == webView.mainFrame())
+ {
+ this.UseWaitCursor = true;
+ Navigating(this, new WebBrowserNavigatingEventArgs(this.Url, frame.name()));
+ }
+ }
+
+ private void frameLoadDelegate_DidFinishLoadForFrame(WebView WebView, IWebFrame frame)
+ {
+ if (frame == webView.mainFrame())
+ {
+ this.UseWaitCursor = false;
+ DocumentCompleted(this, new WebBrowserDocumentCompletedEventArgs(this.Url));
+ }
+ }
+
+ private void frameLoadDelegate_DidRecieveTitle(WebView WebView, string title, IWebFrame frame)
+ {
+ if (frame == webView.mainFrame())
+ {
+ DocumentTitle = title;
+ DocumentTitleChanged(this, new EventArgs());
+ }
+ }
+
+ private void frameLoadDelegate_DidFailProvisionalLoadWithError(WebView WebView, IWebError error, IWebFrame frame)
+ {
+ // ignore an "error" where the page loading is interrupted by a policy change when dowloading a file
+ if (!(frame == WebView.mainFrame() && error.Domain() == "WebKitErrorDomain" && error.code() == 102))
+ {
+ Error(this, new WebKitBrowserErrorEventArgs(error.localizedDescription()));
+ }
+ }
+
+ private void frameLoadDelegate_DidFailLoadWithError(WebView WebView, IWebError error, IWebFrame frame)
+ {
+ Error(this, new WebKitBrowserErrorEventArgs(error.localizedDescription()));
+ }
+
+ #endregion
+
+ #region WebDownloadDelegate event handlers
+
+ private void downloadDelegate_DidFailWithError(WebDownload download, WebError error)
+ {
+ downloads[download].NotifyDidFailWithError(download, error);
+ }
+
+ private void downloadDelegate_DidFinish(WebDownload download)
+ {
+ downloads[download].NotifyDidFinish(download);
+ // remove from list
+ downloads.Remove(download);
+ }
+
+ private void downloadDelegate_DidBegin(WebDownload download)
+ {
+ // create WebKitDownload object to handle this download and notify listeners
+ WebKitDownload d = new WebKitDownload(download);
+ downloads.Add(download, d);
+ DownloadBegin(this, new FileDownloadBeginEventArgs(d));
+ }
+
+ private void downloadDelegate_DecideDestinationWithSuggestedFilename(WebDownload download, string fileName)
+ {
+ downloads[download].NotifyDecideDestinationWithSuggestedFilename(download, fileName);
+ }
+
+ private void downloadDelegate_DidReceiveDataOfLength(WebDownload download, uint length)
+ {
+ // returns false if we cancelled the download at this point
+ if (!downloads[download].NotifyDidReceiveDataOfLength(download, length))
+ downloads.Remove(download);
+ }
+
+ private void downloadDelegate_DidReceiveResponse(WebDownload download, WebURLResponse response)
+ {
+ downloads[download].NotifyDidReceiveResponse(download, response);
+ }
+
+ #endregion
+
+ #region Public Methods
+
+ /// <summary>
+ /// Navigates to the specified Url.
+ /// </summary>
+ /// <param name="Url">Url to navigate to.</param>
+ public void Navigate(string Url)
+ {
+ if (webView != null)
+ {
+ // TODO: a bit more rigorous checking here...
+ //if (!Url.StartsWith("http://"))
+ if (!Url.Contains("://"))
+ Url = "http://" + Url;
+
+ activationContext.Activate();
+
+ WebMutableURLRequest request = new WebMutableURLRequestClass();
+ request.initWithURL(Url, _WebURLRequestCachePolicy.WebURLRequestUseProtocolCachePolicy, 60);
+ request.setHTTPMethod("GET");
+
+ webView.mainFrame().loadRequest(request);
+
+ activationContext.Deactivate();
+ }
+ else
+ url = Url;
+ }
+
+ /// <summary>
+ /// Navigates to the previous page in the page history, if available.
+ /// </summary>
+ /// <returns>Success value.</returns>
+ public bool GoBack()
+ {
+ // TODO: return value
+ webView.goBack();
+ return true;
+ }
+
+ /// <summary>
+ /// Navigates to the next page in the page history, if available.
+ /// </summary>
+ /// <returns>Success value.</returns>
+ public bool GoForward()
+ {
+ // TODO: return value
+ webView.goForward();
+ return true;
+ }
+
+ /// <summary>
+ /// Refreshes the current web page.
+ /// </summary>
+ public override void Refresh()
+ {
+ base.Refresh();
+ webView.mainFrame().reload();
+ }
+
+ /// <summary>
+ /// Refreshes the current web page.
+ /// </summary>
+ /// <param name="Option">Options for refreshing the page.</param>
+ public void Refresh(WebBrowserRefreshOption Option)
+ {
+ // TODO: implement
+ Refresh();
+ }
+
+ /// <summary>
+ /// Stops loading the current web page and any resources associated
+ /// with it.
+ /// </summary>
+ public void Stop()
+ {
+ if (webView.isLoading() != 0)
+ {
+ webView.mainFrame().stopLoading();
+ }
+ }
+
+ #endregion Public Methods
+ }
+}
97 WebKitBrowser/WebKitBrowser.csproj
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{44AFE214-12C7-4280-898D-A7C4AABF1533}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>WebKit</RootNamespace>
+ <AssemblyName>WebKitBrowser</AssemblyName>
+ <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <ApplicationManifest>WebKitBrowser.manifest</ApplicationManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>..\bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <PlatformTarget>x86</PlatformTarget>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>..\bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <PlatformTarget>x86</PlatformTarget>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Windows.Forms" />
+ <Reference Include="System.Xml" />
+ <Reference Include="WebKit.Interop, Version=531.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\webkit\WebKit.Interop.dll</HintPath>
+ </Reference>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="ActivationContext.cs" />
+ <Compile Include="Properties\Resources.Designer.cs">
+ <AutoGen>True</AutoGen>
+ <DesignTime>True</DesignTime>
+ <DependentUpon>Resources.resx</DependentUpon>
+ </Compile>
+ <Compile Include="W32API.cs" />
+ <Compile Include="WebDownloadDelegate.cs" />
+ <Compile Include="WebFrameLoadDelegate.cs" />
+ <Compile Include="WebKitBrowser.cs">
+ <SubType>UserControl</SubType>
+ </Compile>
+ <Compile Include="WebKitBrowser.Designer.cs">
+ <DependentUpon>WebKitBrowser.cs</DependentUpon>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="WebKitBrowserEvents.cs" />
+ <Compile Include="WebKitDownload.cs" />
+ <Compile Include="WebKitDownloadEvents.cs" />
+ <Compile Include="WebPolicyDelegate.cs" />
+ <Compile Include="WebResourceLoadDelegate.cs" />
+ <Compile Include="WebUIDelegate.cs" />
+ <Service Include="{94E38DFF-614B-4cbd-B67C-F211BB35CE8B}" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Properties\Resources.resx">
+ <Generator>ResXFileCodeGenerator</Generator>
+ <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+ </EmbeddedResource>
+ <EmbeddedResource Include="WebKitBrowser.resx">
+ <DependentUpon>WebKitBrowser.cs</DependentUpon>
+ </EmbeddedResource>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="WebKitBrowser.manifest">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <PropertyGroup>
+ <PostBuildEvent>xcopy /E /Y "$(SolutionDir)webkit\*" "$(SolutionDir)bin\$(ConfigurationName)"</PostBuildEvent>
+ </PropertyGroup>
+</Project>
141 WebKitBrowser/WebKitBrowser.manifest
@@ -0,0 +1,141 @@
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+ <dependency>
+ <dependentAssembly>
+ <assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50727.762" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
+ </dependentAssembly>
+ </dependency>
+ <file name="WebKit" hashalg="SHA1">
+ <comClass clsid="{D6BCA079-F61C-4E1E-B453-32A0477D02E3}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass clsid="{66827EC1-3AEF-4241-BAC5-F776B44F030F}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass clsid="{A062ECC3-BB1B-4694-A569-F59E0AD6BE0C}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass clsid="{BA590766-0A6F-46C7-B96E-743490D94CB7}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass clsid="{A4B9B45D-949F-4C8C-9B92-6FBFCC1CAAA2}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass clsid="{DD653964-4D37-4FB2-9CB6-6A9A97719332}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass clsid="{6BE190E9-1725-4E4A-88DB-6A9FE242C9E5}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass clsid="{F71071FD-A51B-4B69-9EB6-44374405E80C}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass clsid="{1820D883-42FE-4B78-88C8-5456BB19D224}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass clsid="{67B89F90-F778-438B-ABBF-34D1ACBF8651}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass clsid="{E93AA8D7-F362-4A4A-A95D-325906BEB5F0}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass clsid="{6C6AF3F9-36B4-4BF7-8BDE-74DCD4AD75A4}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass clsid="{7433F53B-7FE9-484A-9432-72909457A646}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass clsid="{C0F98BD9-3B1C-413D-904A-E2D1453EAF1F}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass clsid="{2FB5499A-BB5D-4469-8517-789FEC8FD9BA}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass clsid="{F366A6E8-E43C-4FD4-AAB0-8E6E79C73E6E}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass clsid="{24A53AD5-AA9F-44E6-AA22-2C7C250B661A}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass clsid="{715636C4-59E7-4B85-BBC5-B555888787D7}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass clsid="{AB201196-8DD2-4D45-AEBD-029B6A37AA27}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass clsid="{24040CD6-AFF4-4A51-9C8B-71539580EE76}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass clsid="{C2A1BFC2-1E7C-49FE-8592-D0C7FB440BC0}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass clsid="{1B63D781-9BC4-4A04-899F-C4B05BBD3BE5}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass clsid="{96B93356-9D61-4B3F-A6CF-A78283AC9649}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass clsid="{3F35F332-BB2B-49B3-AEDD-27B317687E07}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <typelib tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" version="530.0" helpdir="" flags="HASDISKIMAGE"></typelib>
+ </file>
+ <comInterfaceExternalProxyStub name="IWebView" iid="{174BBEFD-058E-49C7-91DF-6F110AA4AC28}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDataObject" iid="{0000010E-0000-0000-C000-000000000046}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{0000010E-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IEnumFORMATETC" iid="{00000103-0000-0000-C000-000000000046}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00000103-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IAdviseSink" iid="{0000010F-0000-0000-C000-000000000046}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{0000010F-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IMoniker" iid="{0000000F-0000-0000-C000-000000000046}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{0000000F-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IPersistStream" iid="{00000109-0000-0000-C000-000000000046}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00000109-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IPersist" iid="{0000010C-0000-0000-C000-000000000046}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{0000010C-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IStream" iid="{0000000C-0000-0000-C000-000000000046}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{0000000C-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="ISequentialStream" iid="{0C733A30-2A1C-11CE-ADE5-00AA0044773D}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{0C733A30-2A1C-11CE-ADE5-00AA0044773D}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IBindCtx" iid="{0000000E-0000-0000-C000-000000000046}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{0000000E-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IRunningObjectTable" iid="{00000010-0000-0000-C000-000000000046}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00000010-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IEnumMoniker" iid="{00000102-0000-0000-C000-000000000046}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00000102-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IEnumString" iid="{00000101-0000-0000-C000-000000000046}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00000101-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IEnumSTATDATA" iid="{00000105-0000-0000-C000-000000000046}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00000105-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebUIDelegate" iid="{2452A889-A74A-4FBC-9617-326A0A953630}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebURLRequest" iid="{F4B85F1D-F3B2-493D-B786-0930E804A3BA}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IPropertyBag" iid="{55272A00-42CB-11CE-8135-00AA004BB851}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{55272A00-42CB-11CE-8135-00AA004BB851}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IErrorLog" iid="{3127CA40-446E-11CE-8135-00AA004BB851}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{3127CA40-446E-11CE-8135-00AA004BB851}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebMutableURLRequest" iid="{C4042773-371F-427E-AFA9-9D4B358A0D93}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebFrame" iid="{B4B22EF7-DD43-4D01-A992-99C4A8B1F845}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebFrameView" iid="{E23E1B15-78F6-4E89-AD2E-49992A040A35}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebDocumentView" iid="{0A6397A7-90FE-49A0-B9C1-44693DD779F7}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebDataSource" iid="{5221A975-AE09-4A7B-A4DF-E3B1B5F38A21}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebDocumentRepresentation" iid="{3C9F6251-CFD8-447A-B429-6B6AE627436C}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebError" iid="{89E3B189-0B60-4D6B-A87A-3F1172CB5538}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebURLResponse" iid="{9814930B-E037-4477-8DF1-4D898B648995}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebArchive" iid="{F07D5252-F66E-4A4D-B9DC-33BD11DCC138}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebResource" iid="{09567E0E-7859-494A-B0E4-92C13CFE5574}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMNode" iid="{3EEA3E20-72DA-4BE7-954F-79B5A14AD726}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMObject" iid="{A27FA225-F34E-425D-88EB-A35BD105A527}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebScriptObject" iid="{7022340A-649C-43FC-9214-85CA7D3BE3C7}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMNodeList" iid="{10A05A96-CBD9-4493-83AD-FAFB952615CE}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMNamedNodeMap" iid="{E6CBF396-C9F9-431B-A8D6-BCB525067E9F}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMDocument" iid="{A83C2C44-0BAC-45C7-8E17-6A49975D5CCA}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMDocumentType" iid="{17FCE6EA-4164-4BD4-9DBF-0395FBF37FD3}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMImplementation" iid="{6E48C25D-E542-4D1A-BC73-ACDC21E39C56}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMElement" iid="{E053A35B-7775-4859-80EA-C35D02D145A2}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMAttr" iid="{B587E098-8206-4B5A-A7DB-422F218571A0}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMDocumentFragment" iid="{09D35665-8396-4868-949E-8AA2407A6E10}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMText" iid="{74638F45-1AA0-4DB5-958C-82066E00BD2B}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMCharacterData" iid="{F4DED047-FE61-461A-BDBD-BB87F79DB713}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMComment" iid="{118002E8-847F-4B1A-968C-B25A6AC7B128}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMCDATASection" iid="{31B506C1-45A3-4D72-815A-311B0A897E58}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMProcessingInstruction" iid="{D99D2F48-ABF3-426A-9339-54681E1AFCA9}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMEntityReference" iid="{0593CE45-15B2-44AF-BBD0-5A1654F8240E}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMHTMLElement" iid="{EBD5F41D-FF65-41D8-97C9-FCE3A3D4CC3E}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebOpenPanelResultListener" iid="{634198C7-9DFC-4ABA-9E8C-90AEEA7A4144}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebUndoTarget" iid="{BF7F516E-E75D-4E3A-83E2-8F694D83C72D}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebResourceLoadDelegate" iid="{AF3289AA-90DB-4CA4-A112-A1E5F0517953}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebURLAuthenticationChallenge" iid="{5382DABA-C3C3-40C5-AA40-04079F11A844}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebURLAuthenticationChallengeSender" iid="{9360D6FB-186C-4FF7-AE57-D1B973DA0D1C}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebURLCredential" iid="{A1E9D765-FACE-4189-BBE3-AED7EBF65EBD}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebURLProtectionSpace" iid="{71D2622A-3FF2-404B-BD45-C60659C901AF}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebDownloadDelegate" iid="{16A32AE6-C862-40CD-9225-2CAF823F40F9}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebDownload" iid="{65EFE83B-A9E4-4516-8F3B-BAA25DA90FFD}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebFrameLoadDelegate" iid="{4CD809C2-73A5-44EE-B0D7-D1863DFE9F57}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebPolicyDelegate" iid="{9B0BAE6C-A496-4000-9E22-2E89F0747401}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebPolicyDecisionListener" iid="{DFCDE523-FD96-4F95-958B-151540FE122A}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebBackForwardList" iid="{C278A16D-B502-4131-B551-DCE3F4ED2B36}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebHistoryItem" iid="{1E2970AE-72B7-4500-A7A0-12B0FFEB91FC}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebPreferences" iid="{0930D594-A5A3-46E1-858E-AB17A13CD28E}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebIBActions" iid="{8F0E3A30-B924-44F8-990A-1AE61ED6C632}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebViewCSS" iid="{ADF68A8C-336F-405C-A053-3D11A9D5B092}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMCSSStyleDeclaration" iid="{DBBE9A6B-D505-4647-B4AB-40A7CF3EE63E}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMCSSValue" iid="{51D29553-2AF7-4F52-AFE6-3C59196A8BAA}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMCSSRule" iid="{05947A31-9E1C-4C98-8608-6688959D6542}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMCSSStyleSheet" iid="{14B1C213-1458-48A1-AD8F-54BFE64F9ECF}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMCSSRuleList" iid="{D45DA43D-5EDB-4315-A097-3ED3FA089193}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebViewEditing" iid="{07BDAC9A-19A1-4086-864D-BAD9E0F00D5C}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMRange" iid="{2F33E42C-0B39-48B3-B7B6-E910CDB325AD}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebUndoManager" iid="{D25D748C-6C1E-478D-9832-FDA26E8F7EE4}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebInvocation" iid="{67B067BE-4DE6-45C2-AD39-A91DFA84FF4E}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebMethodSignature" iid="{431DD6B2-56BF-4F48-943B-78CCEAC418E4}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebEditingDelegate" iid="{2C75A1E3-EE9D-45C8-A385-19DE68AC5675}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebNotification" iid="{93598207-3E34-49EC-97EC-EFA9A1E16335}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IEnumWebGrammarDetails" iid="{FABCC69A-5917-4242-A19A-42E8B62227A7}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebGrammarDetail" iid="{8B95C1B3-E1B3-4F97-80D6-2240417E3E0C}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IEnumSpellingGuesses" iid="{B0F960E7-FB81-447F-A958-E02DA02ADBB7}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebViewUndoableEditing" iid="{639E7121-13C8-4A12-BC18-6E1F3D68F3C3}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebViewEditingActions" iid="{7E066C42-8E81-4778-888D-D6CC93E27D4C}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebNotificationObserver" iid="{1BA491C4-58A7-4091-9F56-9AED118DB4C1}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebViewPrivate" iid="{44914369-DEB5-4FCF-A6A3-30C02E73154F}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebFormDelegate" iid="{4CBEC1BD-ABC3-4BDB-8E5E-4D3BCF9E8C1E}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMHTMLInputElement" iid="{80C40AC5-1755-4894-812F-479269C262A2}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMHTMLTextAreaElement" iid="{298B02B7-3EB5-4BA4-AD3F-7FA53241AADE}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebFormSubmissionListener" iid="{1911D650-035E-4204-8746-ABECF77A4C9B}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebFrameLoadDelegatePrivate" iid="{32DC2531-948D-400E-A82F-FE6668B61A0B}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IEnumTextMatches" iid="{C0CDE63A-5ED1-453F-B937-93B1A61AD3B3}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDropTarget" iid="{00000122-0000-0000-C000-000000000046}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00000122-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebInspector" iid="{68159FF1-9037-45EC-9992-B2E455CF39F3}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebIconDatabase" iid="{E93F2616-2560-47D9-BD4D-6E2F1E1D3174}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebNotificationCenter" iid="{1E411ABE-DAA0-4A83-BCCA-D94E0704F193}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebHistory" iid="{F34E4B1A-361D-4B9F-9A3F-D869DCD97F9A}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebCache" iid="{0673E6F5-AE63-4871-AAC6-6A1E0E6A99AB}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebJavaScriptCollector" iid="{E6A1D169-F44A-4D11-B55B-F0A406F47612}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebKitStatistics" iid="{955C1042-BCF7-4F51-8AE7-66C2D0D47C44}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebScrollBarPrivate" iid="{6C585B08-2E4F-4594-9B90-0425E3A33FD0}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebScrollBarDelegatePrivate" iid="{2E8D56AF-3BF5-4E17-BDA6-01692ACBE3D5}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebScriptDebugServer" iid="{E24111D6-3668-4C8B-B921-D644524945F8}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebScriptDebugListener" iid="{09612B56-BE17-4867-A441-1C5C4E0F5302}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebScriptCallFrame" iid="{029D0676-162A-4140-8917-9574E09F66EB}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebTextRenderer" iid="{5B26ABBB-C27A-4527-A313-CB733E2CD257}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebDatabaseManager" iid="{5724F010-A77B-4A42-8F89-A5095B61D469}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebSecurityOrigin" iid="{304D4462-A921-4E85-BC11-BCE1462B159D}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebCoreStatistics" iid="{9607001D-6EEF-4C2C-AD22-94E9DA587973}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IPropertyBag2" iid="{22F55882-280B-11D0-A8A9-00A0C90C2004}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{22F55882-280B-11D0-A8A9-00A0C90C2004}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebCookieManager" iid="{7053FE94-3623-444F-A298-209A90879A8C}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+</assembly>
120 WebKitBrowser/WebKitBrowser.resx
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
56 WebKitBrowser/WebKitBrowserEvents.cs
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+*/
+
+using System;
+using WebKit.Interop;
+
+namespace WebKit
+{
+ public delegate void WebKitBrowserErrorEventHandler (object sender, WebKitBrowserErrorEventArgs args);
+
+ public class WebKitBrowserErrorEventArgs : EventArgs
+ {
+ public string Description { get; private set; }
+
+ public WebKitBrowserErrorEventArgs(string Description)
+ {
+ this.Description = Description;
+ }
+ }
+
+
+ public delegate void FileDownloadBeginEventHandler (object sender, FileDownloadBeginEventArgs args);
+
+ public class FileDownloadBeginEventArgs : EventArgs
+ {
+ public WebKitDownload Download { get; private set; }
+
+ public FileDownloadBeginEventArgs(WebKitDownload Download)
+ {
+ this.Download = Download;
+ }
+ }
+}
96 WebKitBrowser/WebKitDownload.cs
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+*/
+
+// TODO: make more robust, support for more options etc...
+// Design feels a little messy at the moment.
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using WebKit.Interop;
+
+namespace WebKit
+{
+ public class WebKitDownload
+ {
+ private WebDownload download;
+
+ public bool DidCancel { get; private set; }
+ public string FilePath { get; private set; }
+
+ public event DownloadStartedEvent DownloadStarted;
+ public event DownloadReceiveDataEvent DownloadReceiveData;
+ public event DownloadFinishedEvent DownloadFinished;
+
+ internal WebKitDownload(WebDownload download)
+ {
+ this.download = download;
+ FilePath = "";
+ }
+
+ internal void NotifyDidFailWithError(WebDownload download, WebError error)
+ {
+ // Todo
+ }
+
+ internal void NotifyDidFinish(WebDownload download)
+ {
+ DownloadFinished(this, new EventArgs());
+ }
+
+ internal void NotifyDecideDestinationWithSuggestedFilename(WebDownload download, string fileName)
+ {
+ if (FilePath != "")
+ download.setDestination(FilePath, 1);
+ else
+ download.setDestination(fileName, 1);
+ }
+
+ internal bool NotifyDidReceiveDataOfLength(WebDownload download, uint length)
+ {
+ if (DidCancel)
+ {
+ download.cancel();
+ return false;
+ }
+ else
+ {
+ DownloadReceiveData(this, new DownloadReceiveDataEventArgs(length));
+ return true;
+ }
+ }
+
+ internal void NotifyDidReceiveResponse(WebDownload download, WebURLResponse response)
+ {
+ DownloadStarted(this, new DownloadStartedEventArgs(response.suggestedFilename(), response.expectedContentLength()));
+ }
+
+ public void Cancel()
+ {
+ DidCancel = true;
+ }
+ }
+}
61 WebKitBrowser/WebKitDownloadEvents.cs
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+*/
+
+using System;
+using WebKit.Interop;
+
+namespace WebKit
+{
+ public delegate void DownloadStartedEvent(object sender, DownloadStartedEventArgs args);
+
+ public class DownloadStartedEventArgs : EventArgs
+ {
+ public string SuggestedFileName { get; private set; }
+ public long FileSize { get; private set; }
+
+ public DownloadStartedEventArgs(string SuggestedFileName, long FileSize)
+ {
+ this.SuggestedFileName = SuggestedFileName;
+ this.FileSize = FileSize;
+ }
+ }
+
+
+ public delegate void DownloadReceiveDataEvent(object sender, DownloadReceiveDataEventArgs args);
+
+ public class DownloadReceiveDataEventArgs : EventArgs
+ {
+ public uint Length { get; private set; }
+
+ public DownloadReceiveDataEventArgs(uint Length)
+ {
+ this.Length = Length;
+ }
+ }
+
+
+ public delegate void DownloadFinishedEvent(object sender, EventArgs args);
+}
71 WebKitBrowser/WebPolicyDelegate.cs
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+*/
+
+// info at
+// http://developer.apple.com/documentation/Cocoa/Reference/WebKit/Protocols/WebPolicyDelegate_Protocol
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using WebKit.Interop;
+using System.Windows.Forms;
+using System.Diagnostics;
+
+namespace WebKit
+{
+ internal class WebPolicyDelegate : IWebPolicyDelegate
+ {
+ #region IWebPolicyDelegate Members
+
+ public void decidePolicyForMIMEType(WebView WebView, string type, IWebURLRequest request, IWebFrame frame, IWebPolicyDecisionListener listener)
+ {
+ // todo: add support for showing custom MIME type documents
+ // and for changing which MIME types are handled here
+ if (WebView.canShowMIMEType(type) == 0)
+ listener.download();
+ else
+ listener.use();
+ }
+
+ public void decidePolicyForNavigationAction(WebView WebView, CFDictionaryPropertyBag actionInformation, IWebURLRequest request, IWebFrame frame, IWebPolicyDecisionListener listener)
+ {
+ listener.use();
+ }
+
+ public void decidePolicyForNewWindowAction(WebView WebView, CFDictionaryPropertyBag actionInformation, IWebURLRequest request, string frameName, IWebPolicyDecisionListener listener)
+ {
+ // ignore requests to open new windows for the moment,
+ // until we have implemented this stuff (see WebKitUIDelegate)
+ listener.ignore();
+ }
+
+ public void unableToImplementPolicyWithError(WebView WebView, WebError error, IWebFrame frame)
+ {
+ }
+
+ #endregion
+ }
+}
89 WebKitBrowser/WebResourceLoadDelegate.cs
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+*/
+
+// Not implemented yet. More info at
+// http://developer.apple.com/documentation/Cocoa/Reference/WebKit/Protocols/WebResourceLoadDelegate_Protocol
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using WebKit;
+using WebKit.Interop;
+
+namespace WebKit
+{
+ internal class WebResourceLoadDelegate : IWebResourceLoadDelegate
+ {
+ #region IWebResourceLoadDelegate Members
+
+ public void didCancelAuthenticationChallenge(WebView WebView, uint identifier, IWebURLAuthenticationChallenge challenge, IWebDataSource dataSource)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void didFailLoadingWithError(WebView WebView, uint identifier, WebError error, IWebDataSource dataSource)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void didFinishLoadingFromDataSource(WebView WebView, uint identifier, IWebDataSource dataSource)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void didReceiveAuthenticationChallenge(WebView WebView, uint identifier, IWebURLAuthenticationChallenge challenge, IWebDataSource dataSource)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void didReceiveContentLength(WebView WebView, uint identifier, uint length, IWebDataSource dataSource)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void didReceiveResponse(WebView WebView, uint identifier, WebURLResponse response, IWebDataSource dataSource)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void identifierForInitialRequest(WebView WebView, IWebURLRequest request, IWebDataSource dataSource, uint identifier)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void plugInFailedWithError(WebView WebView, WebError error, IWebDataSource dataSource)
+ {
+ throw new NotImplementedException();
+ }
+
+ public IWebURLRequest willSendRequest(WebView WebView, uint identifier, IWebURLRequest request, WebURLResponse redirectResponse, IWebDataSource dataSource)
+ {
+ throw new NotImplementedException();
+ }
+
+ #endregion
+ }
+}
356 WebKitBrowser/WebUIDelegate.cs
@@ -0,0 +1,356 @@
+/*
+ * Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+*/
+
+// Not implemented yet. More info at
+// http://developer.apple.com/documentation/Cocoa/Reference/WebKit/Protocols/WebUIDelegate_Protocol
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using WebKit.Interop;
+
+namespace WebKit
+{
+ internal class WebUIDelegate : IWebUIDelegate
+ {
+ #region IWebUIDelegate Members
+
+ public void addCustomMenuDrawingData(WebView sender, int hMenu)
+ {
+ throw new NotImplementedException();
+ }
+
+ public int canRedo()
+ {
+ throw new NotImplementedException();
+ }
+
+ public int canRunModal(WebView WebView)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void canTakeFocus(WebView sender, int forward, out int result)
+ {
+ throw new NotImplementedException();
+ }
+
+ public int canUndo()
+ {
+ throw new NotImplementedException();
+ }
+
+ public void cleanUpCustomMenuDrawingData(WebView sender, int hMenu)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void contextMenuItemSelected(WebView sender, IntPtr item, CFDictionaryPropertyBag element)
+ {
+ throw new NotImplementedException();
+ }
+
+ public int contextMenuItemsForElement(WebView sender, CFDictionaryPropertyBag element, int defaultItemsHMenu)
+ {
+ throw new NotImplementedException();
+ }
+
+ public WebView createModalDialog(WebView sender, IWebURLRequest request)
+ {
+ throw new NotImplementedException();
+ }
+
+ public WebView createWebViewWithRequest(WebView sender, IWebURLRequest request)
+ {
+ throw new NotImplementedException();
+ }
+
+ public WebDragDestinationAction dragDestinationActionMaskForDraggingInfo(WebView WebView, IDataObject draggingInfo)
+ {
+ throw new NotImplementedException();
+ }
+
+ public WebDragSourceAction dragSourceActionMaskForPoint(WebView WebView, ref tagPOINT point)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void drawCustomMenuItem(WebView sender, IntPtr drawItem)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void drawFooterInRect(WebView WebView, ref tagRECT rect, int drawingContext, uint pageIndex, uint pageCount)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void drawHeaderInRect(WebView WebView, ref tagRECT rect, int drawingContext)
+ {
+ throw new NotImplementedException();
+ }
+
+ public string ftpDirectoryTemplatePath(WebView WebView)
+ {
+ throw new NotImplementedException();
+ }
+
+ public int hasCustomMenuImplementation()
+ {
+ throw new NotImplementedException();
+ }
+
+ public int isMenuBarVisible(WebView WebView)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void makeFirstResponder(WebView sender, int responderHWnd)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void measureCustomMenuItem(WebView sender, IntPtr measureItem)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void mouseDidMoveOverElement(WebView sender, CFDictionaryPropertyBag elementInformation, uint modifierFlags)
+ {
+ }
+
+ public void paintCustomScrollCorner(WebView WebView, ref _RemotableHandle hDC, tagRECT rect)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void paintCustomScrollbar(WebView WebView, ref _RemotableHandle hDC, tagRECT rect, WebScrollBarControlSize size, uint state, WebScrollbarControlPart pressedPart, int vertical, float value, float proportion, uint parts)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void printFrame(WebView WebView, IWebFrame frame)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void redo()
+ {
+ throw new NotImplementedException();
+ }
+
+ public void registerUndoWithTarget(IWebUndoTarget target, string actionName, object actionArg)
+ {
+ throw new NotImplementedException();