├── .gitignore
├── LICENSE.txt
├── README.txt
├── WebKit.NET.sln
├── WebKit.NET.snk
├── WebKit.NET_2010.sln
├── WebKitBrowser
├── ActivationContext.cs
├── NativeMethods.cs
├── PrintManager.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
├── WebDownloadDelegate.cs
├── WebFrameLoadDelegate.cs
├── WebKitBrowser.Designer.cs
├── WebKitBrowser.cs
├── WebKitBrowser.csproj
├── WebKitBrowser.dll.manifest
├── WebKitBrowser.resx
├── WebKitBrowserEvents.cs
├── WebKitDOMCoreClasses.cs
├── WebKitDOMHTMLClasses.cs
├── WebKitDownload.cs
├── WebKitDownloadEvents.cs
├── WebPolicyDelegate.cs
├── WebResourceLoadDelegate.cs
└── WebUIDelegate.cs
├── WebKitBrowserDoc.shfbproj
├── WebKitBrowserTest
├── DownloadForm.Designer.cs
├── DownloadForm.cs
├── DownloadForm.resx
├── MainForm.Designer.cs
├── MainForm.cs
├── MainForm.resx
├── NavigationBar.Designer.cs
├── NavigationBar.cs
├── NavigationBar.resx
├── Program.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── SourceViewForm.Designer.cs
├── SourceViewForm.cs
├── SourceViewForm.resx
├── WebBrowserTabPage.Designer.cs
├── WebBrowserTabPage.cs
├── WebBrowserTabPage.resx
├── WebKitBrowserTest.csproj
└── app.config
├── WebKitCore
├── Properties
│ └── AssemblyInfo.cs
└── WebKitCore.csproj
├── WebKitWpf
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── Themes
│ └── Generic.xaml
├── WebKitBrowser.cs
├── WebKitWpf.csproj
└── WebKitWpf.dll.manifest
├── WebKitWpfTest
├── App.xaml
├── App.xaml.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
└── WebKitWpfTest.csproj
├── bin
└── .gitignore
├── docs
└── .gitignore
└── webkit
└── .gitignore
/.gitignore:
--------------------------------------------------------------------------------
1 | _ReSharper.*
2 | StyleCop.Cache
3 | *.cache
4 | *.user
5 | *.suo
6 | bin/
7 | obj/
8 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | All source code provided in this release of WebKit.NET is subject to the
2 | following licensing terms:
3 |
4 | Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
5 | All rights reserved.
6 |
7 | Redistribution and use in source and binary forms, with or without
8 | modification, are permitted provided that the following conditions are met:
9 |
10 | * Redistributions of source code must retain the above copyright notice,
11 | this list of conditions and the following disclaimer.
12 | * Redistributions in binary form must reproduce the above copyright notice,
13 | this list of conditions and the following disclaimer in the documentation
14 | and/or other materials provided with the distribution.
15 |
16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | POSSIBILITY OF SUCH DAMAGE.
27 |
--------------------------------------------------------------------------------
/README.txt:
--------------------------------------------------------------------------------
1 | WebKit.NET README
2 | *****************
3 |
4 | WebKit.NET is a control library wrapper for WebKit written in C#.
5 |
6 | Currently the source code is licensed under a BSD open source license, see
7 | LICENSE.txt for details.
8 |
9 | This package currently contains two Visual C# 2008 projects and a build of the
10 | WebKit library (including dependencies) in the following folders:
11 |
12 | WebKitBrowser - WebKit.NET control library.
13 |
14 | WebKitBrowserTest - A simple application that uses the WebKit.NET control
15 | to display web pages.
16 |
17 | webkit - The WebKit library and dependencies.
18 |
19 | The current releases are at a very early stage of development and are not
20 | recommended for production level use yet.
21 |
22 | Please send any questions or feedback to webkitdotnet@peterdn.com.
23 |
--------------------------------------------------------------------------------
/WebKit.NET.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 10.00
3 | # Visual Studio 2008
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebKitBrowser", "WebKitBrowser\WebKitBrowser.csproj", "{44AFE214-12C7-4280-898D-A7C4AABF1533}"
5 | EndProject
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebKitBrowserTest", "WebKitBrowserTest\WebKitBrowserTest.csproj", "{0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}"
7 | EndProject
8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{9A0D75E0-65F8-4777-B5A0-B84937944551}"
9 | ProjectSection(SolutionItems) = preProject
10 | LICENSE.txt = LICENSE.txt
11 | README.txt = README.txt
12 | WebKitBrowserDoc.shfbproj = WebKitBrowserDoc.shfbproj
13 | EndProjectSection
14 | EndProject
15 | Global
16 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
17 | Debug|Any CPU = Debug|Any CPU
18 | Release|Any CPU = Release|Any CPU
19 | EndGlobalSection
20 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
21 | {44AFE214-12C7-4280-898D-A7C4AABF1533}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
22 | {44AFE214-12C7-4280-898D-A7C4AABF1533}.Debug|Any CPU.Build.0 = Debug|Any CPU
23 | {44AFE214-12C7-4280-898D-A7C4AABF1533}.Release|Any CPU.ActiveCfg = Release|Any CPU
24 | {44AFE214-12C7-4280-898D-A7C4AABF1533}.Release|Any CPU.Build.0 = Release|Any CPU
25 | {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
26 | {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Debug|Any CPU.Build.0 = Debug|Any CPU
27 | {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Release|Any CPU.ActiveCfg = Release|Any CPU
28 | {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Release|Any CPU.Build.0 = Release|Any CPU
29 | EndGlobalSection
30 | GlobalSection(SolutionProperties) = preSolution
31 | HideSolutionNode = FALSE
32 | EndGlobalSection
33 | EndGlobal
34 |
--------------------------------------------------------------------------------
/WebKit.NET.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lanwin/webkitdotnet/2431d81f74bb2725c6ffd99b1eaf60de3ad4e0a7/WebKit.NET.snk
--------------------------------------------------------------------------------
/WebKit.NET_2010.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual Studio 2010
4 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{9A0D75E0-65F8-4777-B5A0-B84937944551}"
5 | ProjectSection(SolutionItems) = preProject
6 | LICENSE.txt = LICENSE.txt
7 | README.txt = README.txt
8 | WebKitBrowserDoc.shfbproj = WebKitBrowserDoc.shfbproj
9 | EndProjectSection
10 | EndProject
11 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebKitBrowser", "WebKitBrowser\WebKitBrowser.csproj", "{44AFE214-12C7-4280-898D-A7C4AABF1533}"
12 | EndProject
13 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebKitBrowserTest", "WebKitBrowserTest\WebKitBrowserTest.csproj", "{0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}"
14 | EndProject
15 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebKitCore", "WebKitCore\WebKitCore.csproj", "{4CBEE897-7218-49F4-A678-B41BF2E42F06}"
16 | EndProject
17 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebKitWpf", "WebKitWpf\WebKitWpf.csproj", "{71C925FA-37AE-4DC0-9743-0C001E2BA0AE}"
18 | EndProject
19 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebKitWpfTest", "WebKitWpfTest\WebKitWpfTest.csproj", "{AFEB7955-0F8D-441B-8185-B8B337EE627A}"
20 | EndProject
21 | Global
22 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
23 | Debug|Any CPU = Debug|Any CPU
24 | Debug|Mixed Platforms = Debug|Mixed Platforms
25 | Debug|x86 = Debug|x86
26 | Release|Any CPU = Release|Any CPU
27 | Release|Mixed Platforms = Release|Mixed Platforms
28 | Release|x86 = Release|x86
29 | EndGlobalSection
30 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
31 | {44AFE214-12C7-4280-898D-A7C4AABF1533}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
32 | {44AFE214-12C7-4280-898D-A7C4AABF1533}.Debug|Any CPU.Build.0 = Debug|Any CPU
33 | {44AFE214-12C7-4280-898D-A7C4AABF1533}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
34 | {44AFE214-12C7-4280-898D-A7C4AABF1533}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
35 | {44AFE214-12C7-4280-898D-A7C4AABF1533}.Debug|x86.ActiveCfg = Debug|Any CPU
36 | {44AFE214-12C7-4280-898D-A7C4AABF1533}.Release|Any CPU.ActiveCfg = Release|Any CPU
37 | {44AFE214-12C7-4280-898D-A7C4AABF1533}.Release|Any CPU.Build.0 = Release|Any CPU
38 | {44AFE214-12C7-4280-898D-A7C4AABF1533}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
39 | {44AFE214-12C7-4280-898D-A7C4AABF1533}.Release|Mixed Platforms.Build.0 = Release|Any CPU
40 | {44AFE214-12C7-4280-898D-A7C4AABF1533}.Release|x86.ActiveCfg = Release|Any CPU
41 | {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
42 | {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Debug|Any CPU.Build.0 = Debug|Any CPU
43 | {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
44 | {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
45 | {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Debug|x86.ActiveCfg = Debug|Any CPU
46 | {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Release|Any CPU.ActiveCfg = Release|Any CPU
47 | {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Release|Any CPU.Build.0 = Release|Any CPU
48 | {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
49 | {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Release|Mixed Platforms.Build.0 = Release|Any CPU
50 | {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Release|x86.ActiveCfg = Release|Any CPU
51 | {4CBEE897-7218-49F4-A678-B41BF2E42F06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
52 | {4CBEE897-7218-49F4-A678-B41BF2E42F06}.Debug|Any CPU.Build.0 = Debug|Any CPU
53 | {4CBEE897-7218-49F4-A678-B41BF2E42F06}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
54 | {4CBEE897-7218-49F4-A678-B41BF2E42F06}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
55 | {4CBEE897-7218-49F4-A678-B41BF2E42F06}.Debug|x86.ActiveCfg = Debug|Any CPU
56 | {4CBEE897-7218-49F4-A678-B41BF2E42F06}.Release|Any CPU.ActiveCfg = Release|Any CPU
57 | {4CBEE897-7218-49F4-A678-B41BF2E42F06}.Release|Any CPU.Build.0 = Release|Any CPU
58 | {4CBEE897-7218-49F4-A678-B41BF2E42F06}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
59 | {4CBEE897-7218-49F4-A678-B41BF2E42F06}.Release|Mixed Platforms.Build.0 = Release|Any CPU
60 | {4CBEE897-7218-49F4-A678-B41BF2E42F06}.Release|x86.ActiveCfg = Release|Any CPU
61 | {71C925FA-37AE-4DC0-9743-0C001E2BA0AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
62 | {71C925FA-37AE-4DC0-9743-0C001E2BA0AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
63 | {71C925FA-37AE-4DC0-9743-0C001E2BA0AE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
64 | {71C925FA-37AE-4DC0-9743-0C001E2BA0AE}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
65 | {71C925FA-37AE-4DC0-9743-0C001E2BA0AE}.Debug|x86.ActiveCfg = Debug|Any CPU
66 | {71C925FA-37AE-4DC0-9743-0C001E2BA0AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
67 | {71C925FA-37AE-4DC0-9743-0C001E2BA0AE}.Release|Any CPU.Build.0 = Release|Any CPU
68 | {71C925FA-37AE-4DC0-9743-0C001E2BA0AE}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
69 | {71C925FA-37AE-4DC0-9743-0C001E2BA0AE}.Release|Mixed Platforms.Build.0 = Release|Any CPU
70 | {71C925FA-37AE-4DC0-9743-0C001E2BA0AE}.Release|x86.ActiveCfg = Release|Any CPU
71 | {AFEB7955-0F8D-441B-8185-B8B337EE627A}.Debug|Any CPU.ActiveCfg = Debug|x86
72 | {AFEB7955-0F8D-441B-8185-B8B337EE627A}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
73 | {AFEB7955-0F8D-441B-8185-B8B337EE627A}.Debug|Mixed Platforms.Build.0 = Debug|x86
74 | {AFEB7955-0F8D-441B-8185-B8B337EE627A}.Debug|x86.ActiveCfg = Debug|x86
75 | {AFEB7955-0F8D-441B-8185-B8B337EE627A}.Debug|x86.Build.0 = Debug|x86
76 | {AFEB7955-0F8D-441B-8185-B8B337EE627A}.Release|Any CPU.ActiveCfg = Release|x86
77 | {AFEB7955-0F8D-441B-8185-B8B337EE627A}.Release|Mixed Platforms.ActiveCfg = Release|x86
78 | {AFEB7955-0F8D-441B-8185-B8B337EE627A}.Release|Mixed Platforms.Build.0 = Release|x86
79 | {AFEB7955-0F8D-441B-8185-B8B337EE627A}.Release|x86.ActiveCfg = Release|x86
80 | {AFEB7955-0F8D-441B-8185-B8B337EE627A}.Release|x86.Build.0 = Release|x86
81 | EndGlobalSection
82 | GlobalSection(SolutionProperties) = preSolution
83 | HideSolutionNode = FALSE
84 | EndGlobalSection
85 | EndGlobal
86 |
--------------------------------------------------------------------------------
/WebKitBrowser/ActivationContext.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 | * POSSIBILITY OF SUCH DAMAGE.
25 | */
26 |
27 | // TODO:
28 | // possible race conditions?
29 | // either find out if we can remove the need for this stuff altogether -
30 | // embedding the manifest into a client application seems to work but is
31 | // not an ideal solution - or work out how to load it from a resource -
32 | // I've tried this already by getting CreateActCtx to load this assembly,
33 | // but it can't seem to find the manifest resource.
34 |
35 | using System;
36 | using System.Collections.Generic;
37 | using System.Text;
38 | using System.Runtime.InteropServices;
39 | using WebKit;
40 | using System.ComponentModel;
41 |
42 | namespace WebKit
43 | {
44 | ///
45 | /// A simple interface to the Windows Activation Context API.
46 | ///
47 | ///
48 | /// Activation context switching is required here to support registration
49 | /// free COM interop. Ordinarily this can be achieved by embedding an
50 | /// application manifest with mappings to COM objects in the assembly,
51 | /// however this does not work in a class library.
52 | /// Instead we create an activation context which explicitly loads a
53 | /// manifest and activate this context when we need to create a COM object.
54 | ///
55 | internal class ActivationContext : IDisposable
56 | {
57 | // Read-only state properties
58 | public string ManifestFileName { get; private set; }
59 | public bool Activated { get; private set; }
60 | public bool Initialized { get; private set; }
61 |
62 | // Private stuff...
63 | private NativeMethods.ACTCTX activationContext;
64 | private IntPtr contextHandle = IntPtr.Zero;
65 | private uint lastCookie = 0;
66 | private bool disposed = false;
67 |
68 | ///
69 | /// Constructor for ActivationContext.
70 | ///
71 | /// Path of the manifest file to load.
72 | public ActivationContext(string ManifestFileName)
73 | {
74 | this.ManifestFileName = ManifestFileName;
75 | this.Activated = false;
76 | this.Initialized = false;
77 | }
78 |
79 | ///
80 | /// Activates the activation context.
81 | ///
82 | public void Activate()
83 | {
84 | if (disposed)
85 | throw new ObjectDisposedException(this.ToString());
86 | if (!Initialized)
87 | throw new InvalidOperationException("ActivationContext has not been initialized");
88 | if (!Activated)
89 | {
90 | lastCookie = 0;
91 | Activated = NativeMethods.ActivateActCtx(contextHandle, out lastCookie);
92 | int winError = Marshal.GetLastWin32Error();
93 |
94 | if (!Activated)
95 | throw new Win32Exception(winError, "Failed to activate activation context");
96 | }
97 | }
98 |
99 | ///
100 | /// Deactivates the activation context, activating the next one down
101 | /// on the 'stack'.
102 | ///
103 | public void Deactivate()
104 | {
105 | if (disposed)
106 | throw new ObjectDisposedException(this.ToString());
107 | if (!Initialized)
108 | throw new InvalidOperationException("ActivationContext has not been initialized");
109 | if (Activated)
110 | {
111 | if (!NativeMethods.DeactivateActCtx(0, lastCookie))
112 | throw new Win32Exception(Marshal.GetLastWin32Error(), "Failed to deactivate activation context");
113 | Activated = false;
114 | }
115 | }
116 |
117 | ///
118 | /// Initializes the activation context.
119 | ///
120 | public void Initialize()
121 | {
122 | if (disposed)
123 | throw new ObjectDisposedException(this.ToString());
124 | if (!Initialized)
125 | {
126 | activationContext = new NativeMethods.ACTCTX();
127 | activationContext.cbSize = Marshal.SizeOf(typeof(NativeMethods.ACTCTX));
128 | activationContext.lpSource = this.ManifestFileName;
129 |
130 | contextHandle = NativeMethods.CreateActCtx(ref activationContext);
131 | int winError = Marshal.GetLastWin32Error();
132 |
133 | Initialized = (contextHandle != (IntPtr) NativeMethods.INVALID_HANDLE_VALUE);
134 |
135 | if (!Initialized)
136 | throw new Win32Exception(winError, "Failed to initialize activation context");
137 | }
138 | }
139 |
140 | #region Garbage collection stuff
141 |
142 | ~ActivationContext()
143 | {
144 | Dispose(false);
145 | }
146 |
147 | public void Dispose()
148 | {
149 | Dispose(true);
150 | GC.SuppressFinalize(this);
151 | }
152 |
153 | protected virtual void Dispose(bool disposing)
154 | {
155 | if (!disposed)
156 | {
157 | NativeMethods.ReleaseActCtx(contextHandle);
158 | disposed = true;
159 | }
160 | }
161 |
162 | #endregion
163 | }
164 | }
165 |
--------------------------------------------------------------------------------
/WebKitBrowser/NativeMethods.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 | * POSSIBILITY OF SUCH DAMAGE.
25 | */
26 |
27 | using System;
28 | using System.Runtime.InteropServices;
29 |
30 | namespace WebKit
31 | {
32 | ///
33 | /// Win32 API functions.
34 | ///
35 | ///
36 | /// See the MSDN Windows SDK documentation for more information about
37 | /// these functions.
38 | ///
39 | internal static class NativeMethods
40 | {
41 | public static int INVALID_HANDLE_VALUE = (-1);
42 |
43 | [DllImport("Kernel32.dll", SetLastError = true)]
44 | public static extern bool ActivateActCtx(IntPtr hActCtx, out uint lpCookie);
45 |
46 | [DllImport("Kernel32.dll", SetLastError = true)]
47 | public static extern IntPtr CreateActCtx(ref ACTCTX actctx);
48 |
49 | [DllImport("Kernel32.dll", SetLastError = true)]
50 | public static extern bool DeactivateActCtx(uint dwFlags, uint lpCookie);
51 |
52 | [DllImport("Kernel32.dll", SetLastError = true)]
53 | public static extern void ReleaseActCtx(IntPtr hActCtx);
54 |
55 | [DllImport("user32.dll")]
56 | public static extern bool MoveWindow(IntPtr hwnd, int x, int y, int width, int height,
57 | [MarshalAs(UnmanagedType.Bool)] bool repaint);
58 |
59 | [DllImport("user32.dll")]
60 | public static extern IntPtr SetFocus(IntPtr hwnd);
61 |
62 | [DllImport("user32.dll")]
63 | public static extern IntPtr SendMessage(IntPtr hwnd, uint msg, IntPtr wParam, IntPtr lParam);
64 |
65 | [StructLayout(LayoutKind.Sequential)]
66 | public struct ACTCTX
67 | {
68 | public int cbSize;
69 | public uint dwFlags;
70 | public string lpSource;
71 | public ushort wProcessorArchitecture;
72 | public ushort wLangId;
73 | public string lpAssemblyDirectory;
74 | public string lpResourceName;
75 | public string lpApplicationName;
76 | public IntPtr hModule;
77 | }
78 |
79 | [DllImport("WebKit.dll")]
80 | public static extern IntPtr WebKitCreateInstance(ref Guid param0, ref IntPtr pUnkOuter, ref Guid param2, ref IntPtr ppvObject);
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/WebKitBrowser/PrintManager.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Drawing.Printing;
5 | using System.ComponentModel;
6 | using WebKit.Interop;
7 | using System.Drawing;
8 | using System.Windows.Forms;
9 |
10 | namespace WebKit
11 | {
12 | internal class PrintManager
13 | {
14 | private PrintDocument _document;
15 | private IWebFramePrivate _webFramePrivate;
16 | private WebKitBrowser _owner;
17 | private Graphics _printGfx;
18 | private uint _nPages;
19 | private uint _page;
20 | private int _hDC;
21 | private bool _printing = false;
22 |
23 | public PrintManager(PrintDocument Document, WebKitBrowser Owner)
24 | {
25 | this._document = Document;
26 | this._owner = Owner;
27 | this._webFramePrivate =
28 | (IWebFramePrivate)((IWebView)_owner.GetWebView()).mainFrame();
29 | }
30 |
31 | public void Print()
32 | {
33 | // potential concurrency issues with shared state variable
34 | if (_printing)
35 | return;
36 | _printing = true;
37 |
38 | BackgroundWorker worker = new BackgroundWorker();
39 | worker.DoWork += new DoWorkEventHandler(worker_DoWork);
40 | worker.RunWorkerAsync();
41 | }
42 |
43 | private void worker_DoWork(object sender, DoWorkEventArgs e)
44 | {
45 | _document.PrintPage += new PrintPageEventHandler(_document_PrintPage);
46 | _document.Print();
47 |
48 | _printing = false;
49 | }
50 |
51 | private delegate uint GetPrintedPageCountDelegate();
52 |
53 | private void _document_PrintPage(object sender, PrintPageEventArgs e)
54 | {
55 | // running on a seperate thread, so we invoke _webFramePrivate
56 | // methods on the owners ui thread
57 |
58 | if (_printGfx == null)
59 | {
60 | // initialise printing
61 | _printGfx = e.Graphics;
62 | _hDC = _printGfx.GetHdc().ToInt32();
63 |
64 | _owner.Invoke(new MethodInvoker(delegate() {
65 | _webFramePrivate.setInPrintingMode(1, _hDC);
66 | }));
67 |
68 | _nPages = (uint)_owner.Invoke(
69 | new GetPrintedPageCountDelegate(delegate() {
70 | return _webFramePrivate.getPrintedPageCount(_hDC);
71 | }));
72 |
73 | _page = 1;
74 | }
75 |
76 | _owner.Invoke(new MethodInvoker(delegate() {
77 | _webFramePrivate.spoolPages(_hDC, _page, _page, 0);
78 | }));
79 |
80 | ++_page;
81 | if (_page <= _nPages)
82 | {
83 | e.HasMorePages = true;
84 | }
85 | else
86 | {
87 | _owner.Invoke(new MethodInvoker(delegate() {
88 | _webFramePrivate.setInPrintingMode(0, _hDC);
89 | }));
90 | e.HasMorePages = false;
91 | }
92 | }
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/WebKitBrowser/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 | * POSSIBILITY OF SUCH DAMAGE.
25 | */
26 |
27 | using System.Reflection;
28 | using System.Runtime.CompilerServices;
29 | using System.Runtime.InteropServices;
30 |
31 | // General Information about an assembly is controlled through the following
32 | // set of attributes. Change these attribute values to modify the information
33 | // associated with an assembly.
34 | [assembly: AssemblyTitle("WebKitBrowser")]
35 | [assembly: AssemblyDescription(".NET Wrapper for WebKit")]
36 | [assembly: AssemblyConfiguration("")]
37 | [assembly: AssemblyCompany("")]
38 | [assembly: AssemblyProduct("WebKit .NET")]
39 | [assembly: AssemblyCopyright("Copyright © Peter Nelson 2010")]
40 | [assembly: AssemblyTrademark("")]
41 | [assembly: AssemblyCulture("")]
42 |
43 | // Setting ComVisible to false makes the types in this assembly not visible
44 | // to COM components. If you need to access a type in this assembly from
45 | // COM, set the ComVisible attribute to true on that type.
46 | [assembly: ComVisible(false)]
47 |
48 | // The following GUID is for the ID of the typelib if this project is exposed to COM
49 | [assembly: Guid("64a334d8-c2e8-483d-885c-bb1ffaa3a3b9")]
50 |
51 | // Version information for an assembly consists of the following four values:
52 | //
53 | // Major Version
54 | // Minor Version
55 | // Build Number
56 | // Revision
57 | //
58 | // You can specify all the values or you can default the Build and Revision Numbers
59 | // by using the '*' as shown below:
60 | // [assembly: AssemblyVersion("1.0.*")]
61 | [assembly: AssemblyVersion("0.4.9.1")]
62 | [assembly: AssemblyFileVersion("0.4.9.1")]
63 |
--------------------------------------------------------------------------------
/WebKitBrowser/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.1
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace WebKit.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | public class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | public static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WebKit.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | public static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/WebKitBrowser/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/WebKitBrowser/WebDownloadDelegate.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 | * POSSIBILITY OF SUCH DAMAGE.
25 | */
26 |
27 | // TODO: currently, calling WebDownload.cancel() in the 'decideDestinationWithSuggestedFilename'
28 | // method causes a crash - I've seen examples of this method being used here with no problems.
29 | // Find out whether this is a bug in webkit or what else is going on. Various useful information at
30 | // http://developer.apple.com/documentation/Cocoa/Conceptual/URLLoadingSystem/Tasks/UsingNSURLDownload.html
31 | // Also note that currently (as of revision ~45680), download stuff is not implemented in the
32 | // cairo build of WebKit yet.
33 |
34 |
35 | using System;
36 | using System.Collections.Generic;
37 | using System.Text;
38 | using WebKit.Interop;
39 | using System.Windows.Forms;
40 | using System.Diagnostics;
41 |
42 | namespace WebKit
43 | {
44 | internal delegate void DecideDestinationWithSuggestedFilenameEvent(WebDownload download, string fileName);
45 | internal delegate void DidBeginEvent(WebDownload download);
46 | internal delegate void DidCancelAuthenticationChallengeEvent(WebDownload download, IWebURLAuthenticationChallenge challenge);
47 | internal delegate void DidCreateDestinationEvent(WebDownload download, string destination);
48 | internal delegate void DidFailWithErrorEvent(WebDownload download, WebError error);
49 | internal delegate void DidFinishEvent(WebDownload download);
50 | internal delegate void DidReceiveAuthenticationChallengeEvent(WebDownload download, IWebURLAuthenticationChallenge challenge);
51 | internal delegate void DidReceiveDataOfLengthEvent(WebDownload download, uint length);
52 | internal delegate void DidReceiveResponseEvent(WebDownload download, WebURLResponse response);
53 | internal delegate int ShouldDecodeSourceDataOfMIMETypeEvent(WebDownload download, string encodingType);
54 | internal delegate void WillResumeWithResponseEvent(WebDownload download, WebURLResponse response, long fromByte);
55 | internal delegate void WillSendRequestEvent(WebDownload download, WebMutableURLRequest request, WebURLResponse redirectResponse, out WebMutableURLRequest finalRequest);
56 |
57 | internal class WebDownloadDelegate : IWebDownloadDelegate
58 | {
59 | public event DecideDestinationWithSuggestedFilenameEvent DecideDestinationWithSuggestedFilename = delegate { };
60 | public event DidBeginEvent DidBegin = delegate { };
61 | public event DidCancelAuthenticationChallengeEvent DidCancelAuthenticationChallenge = delegate { };
62 | public event DidCreateDestinationEvent DidCreateDestination = delegate { };
63 | public event DidFailWithErrorEvent DidFailWithError = delegate { };
64 | public event DidFinishEvent DidFinish = delegate { };
65 | public event DidReceiveAuthenticationChallengeEvent DidReceiveAuthenticationChallenge = delegate { };
66 | public event DidReceiveDataOfLengthEvent DidReceiveDataOfLength = delegate { };
67 | public event DidReceiveResponseEvent DidReceiveResponse = delegate { };
68 | public event WillResumeWithResponseEvent WillResumeWithResponse = delegate { };
69 |
70 | #region IWebDownloadDelegate Members
71 |
72 | public void decideDestinationWithSuggestedFilename(WebDownload download, string fileName)
73 | {
74 | DecideDestinationWithSuggestedFilename(download, fileName);
75 | }
76 |
77 | public void didBegin(WebDownload download)
78 | {
79 | DidBegin(download);
80 | }
81 |
82 | public void didCancelAuthenticationChallenge(WebDownload download, IWebURLAuthenticationChallenge challenge)
83 | {
84 | DidCancelAuthenticationChallenge(download, challenge);
85 | }
86 |
87 | public void didCreateDestination(WebDownload download, string destination)
88 | {
89 | DidCreateDestination(download, destination);
90 | }
91 |
92 | public void didFailWithError(WebDownload download, WebError error)
93 | {
94 | DidFailWithError(download, error);
95 | }
96 |
97 | public void didFinish(WebDownload download)
98 | {
99 | DidFinish(download);
100 | }
101 |
102 | public void didReceiveAuthenticationChallenge(WebDownload download, IWebURLAuthenticationChallenge challenge)
103 | {
104 | DidReceiveAuthenticationChallenge(download, challenge);
105 | }
106 |
107 | public void didReceiveDataOfLength(WebDownload download, uint length)
108 | {
109 | DidReceiveDataOfLength(download, length);
110 | }
111 |
112 | public void didReceiveResponse(WebDownload download, WebURLResponse response)
113 | {
114 | DidReceiveResponse(download, response);
115 | }
116 |
117 | public int shouldDecodeSourceDataOfMIMEType(WebDownload download, string encodingType)
118 | {
119 | // TODO
120 | return 0;
121 | }
122 |
123 | public void willResumeWithResponse(WebDownload download, WebURLResponse response, long fromByte)
124 | {
125 | WillResumeWithResponse(download, response, fromByte);
126 | }
127 |
128 | public void willSendRequest(WebDownload download, WebMutableURLRequest request, WebURLResponse redirectResponse, out WebMutableURLRequest finalRequest)
129 | {
130 | finalRequest = request;
131 | }
132 |
133 | #endregion
134 | }
135 | }
136 |
--------------------------------------------------------------------------------
/WebKitBrowser/WebFrameLoadDelegate.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 | * POSSIBILITY OF SUCH DAMAGE.
25 | */
26 |
27 | // Handles frame-level events that occur from loading a web page. More info at
28 | // http://developer.apple.com/documentation/Cocoa/Reference/WebKit/Protocols/WebFrameLoadDelegate_Protocol
29 |
30 | using System;
31 | using System.Collections.Generic;
32 | using System.Text;
33 | using WebKit;
34 | using WebKit.Interop;
35 | using System.Diagnostics;
36 |
37 | namespace WebKit
38 | {
39 | // Delegate definitions WebFrameLoadDelegate events
40 | internal delegate void DidCancelClientRedirectForFrameEvent(WebView WebView, webFrame frame);
41 | internal delegate void DidChangeLocationWithinPageForFrameEvent(WebView WebView, webFrame frame);
42 | internal delegate void DidCommitLoadForFrameEvent(WebView WebView, webFrame frame);
43 | internal delegate void DidFailLoadWithErrorEvent(WebView WebView, IWebError error, webFrame frame);
44 | internal delegate void DidFailProvisionalLoadWithErrorEvent(WebView WebView, IWebError error, webFrame frame);
45 | internal delegate void DidFinishLoadForFrameEvent(WebView WebView, webFrame frame);
46 | internal delegate void DidRecieveIconEvent(WebView WebView, int hBitMap, webFrame frame);
47 | internal delegate void DidRecieveServerRedirectForProvisionalLoadForFrameEvent(WebView WebView, webFrame frame);
48 | internal delegate void DidRecieveTitleEvent(WebView WebView, string title, webFrame frame);
49 | internal delegate void DidStartProvisionalLoadForFrameEvent(WebView WebView, webFrame frame);
50 | internal delegate void WillCloseFrameEvent(WebView WebView, webFrame frame);
51 | internal delegate void WillPerformClientRedirectToURLEvent(WebView WebView, string url, double delaySeconds, DateTime fireDate, webFrame frame);
52 | internal delegate void WindowScriptObjectAvailableEvent(WebView WebView, IntPtr context, IntPtr windowScriptObject);
53 | internal delegate void DidClearWindowObjectEvent(WebView WebView, IntPtr context, IntPtr windowScriptObject, webFrame frame);
54 |
55 | internal class WebFrameLoadDelegate : IWebFrameLoadDelegate
56 | {
57 | public event DidCancelClientRedirectForFrameEvent DidCancelClientRedirectForFrame = delegate { };
58 | public event DidChangeLocationWithinPageForFrameEvent DidChangeLocationWithinPageForFrame = delegate { };
59 | public event DidCommitLoadForFrameEvent DidCommitLoadForFrame = delegate { };
60 | public event DidFailLoadWithErrorEvent DidFailLoadWithError = delegate { };
61 | public event DidFailProvisionalLoadWithErrorEvent DidFailProvisionalLoadWithError = delegate { };
62 | public event DidFinishLoadForFrameEvent DidFinishLoadForFrame = delegate { };
63 | public event DidRecieveIconEvent DidRecieveIcon = delegate { };
64 | public event DidRecieveServerRedirectForProvisionalLoadForFrameEvent DidRecieveServerRedirectForProvisionalLoadForFrame = delegate { };
65 | public event DidRecieveTitleEvent DidRecieveTitle = delegate { };
66 | public event DidStartProvisionalLoadForFrameEvent DidStartProvisionalLoadForFrame = delegate { };
67 | public event WillCloseFrameEvent WillCloseFrame = delegate { };
68 | public event WillPerformClientRedirectToURLEvent WillPerformClientRedirectToURL = delegate { };
69 | public event WindowScriptObjectAvailableEvent WindowScriptObjectAvailable = delegate { };
70 | public event DidClearWindowObjectEvent DidClearWindowObject = delegate { };
71 |
72 | #region webFrameLoadDelegate Members
73 |
74 | public void didCancelClientRedirectForFrame(WebView WebView, webFrame frame)
75 | {
76 | DidCancelClientRedirectForFrame(WebView, frame);
77 | }
78 |
79 | public void didChangeLocationWithinPageForFrame(WebView WebView, webFrame frame)
80 | {
81 | DidChangeLocationWithinPageForFrame(WebView, frame);
82 | }
83 |
84 | public void didCommitLoadForFrame(WebView WebView, webFrame frame)
85 | {
86 | DidCommitLoadForFrame(WebView, frame);
87 | }
88 |
89 | public void didFailLoadWithError(WebView WebView, WebError error, webFrame forFrame)
90 | {
91 | DidFailLoadWithError(WebView, error, forFrame);
92 | }
93 |
94 | public void didFailProvisionalLoadWithError(WebView WebView, WebError error, webFrame frame)
95 | {
96 | DidFailProvisionalLoadWithError(WebView, error, frame);
97 | }
98 |
99 | public void didFinishLoadForFrame(WebView WebView, webFrame frame)
100 | {
101 | DidFinishLoadForFrame(WebView, frame);
102 | }
103 |
104 | public void didReceiveIcon(WebView WebView, int hBitmap, webFrame frame)
105 | {
106 | DidRecieveIcon(WebView, hBitmap, frame);
107 | }
108 |
109 | public void didReceiveServerRedirectForProvisionalLoadForFrame(WebView WebView, webFrame frame)
110 | {
111 | DidRecieveServerRedirectForProvisionalLoadForFrame(WebView, frame);
112 | }
113 |
114 | public void didReceiveTitle(WebView WebView, string title, webFrame frame)
115 | {
116 | DidRecieveTitle(WebView, title, frame);
117 | }
118 |
119 | public void didStartProvisionalLoadForFrame(WebView WebView, webFrame frame)
120 | {
121 | DidStartProvisionalLoadForFrame(WebView, frame);
122 | }
123 |
124 | public void willCloseFrame(WebView WebView, webFrame frame)
125 | {
126 | WillCloseFrame(WebView, frame);
127 | }
128 |
129 | public void willPerformClientRedirectToURL(WebView WebView, string url, double delaySeconds, DateTime fireDate, webFrame frame)
130 | {
131 | WillPerformClientRedirectToURL(WebView, url, delaySeconds, fireDate, frame);
132 | }
133 |
134 | public void windowScriptObjectAvailable(WebView WebView, IntPtr context, IntPtr windowScriptObject)
135 | {
136 | WindowScriptObjectAvailable(WebView, context, windowScriptObject);
137 | }
138 |
139 | public void didClearWindowObject(WebView WebView, IntPtr context, IntPtr windowScriptObject, webFrame frame)
140 | {
141 | DidClearWindowObject(WebView, context, windowScriptObject, frame);
142 | }
143 |
144 | #endregion
145 | }
146 | }
147 |
--------------------------------------------------------------------------------
/WebKitBrowser/WebKitBrowser.Designer.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 | * POSSIBILITY OF SUCH DAMAGE.
25 | */
26 |
27 | namespace WebKit
28 | {
29 | partial class WebKitBrowser
30 | {
31 | ///
32 | /// Required designer variable.
33 | ///
34 | private System.ComponentModel.IContainer components = null;
35 |
36 | ///
37 | /// Clean up any resources being used.
38 | ///
39 | /// true if managed resources should be disposed; otherwise, false.
40 | protected override void Dispose(bool disposing)
41 | {
42 | if (!disposed)
43 | {
44 | if (disposing && (components != null))
45 | {
46 | components.Dispose();
47 | }
48 | if ((--actCtxRefCount) == 0 && activationContext != null)
49 | {
50 | activationContext.Dispose();
51 | }
52 |
53 | disposed = true;
54 | base.Dispose(disposing);
55 | }
56 | }
57 |
58 | #region Component Designer generated code
59 |
60 | ///
61 | /// Required method for Designer support - do not modify
62 | /// the contents of this method with the code editor.
63 | ///
64 | private void InitializeComponent()
65 | {
66 | this.SuspendLayout();
67 | //
68 | // WebKitBrowser
69 | //
70 | this.BackColor = System.Drawing.Color.White;
71 | this.Name = "WebKitBrowser";
72 | this.Size = new System.Drawing.Size(319, 255);
73 | this.ResumeLayout(false);
74 | }
75 |
76 | #endregion
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/WebKitBrowser/WebKitBrowser.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 9.0.30729
7 | 2.0
8 | {44AFE214-12C7-4280-898D-A7C4AABF1533}
9 | Library
10 | Properties
11 | WebKit
12 | WebKitBrowser
13 | v2.0
14 | 512
15 | WebKitBrowser.dll.manifest
16 | true
17 |
18 |
19 |
20 |
21 | 3.5
22 |
23 | publish\
24 | true
25 | Disk
26 | false
27 | Foreground
28 | 7
29 | Days
30 | false
31 | false
32 | true
33 | 0
34 | 1.0.0.%2a
35 | false
36 | false
37 | true
38 |
39 |
40 | true
41 | full
42 | false
43 | ..\bin\Debug\
44 | DEBUG;TRACE
45 | prompt
46 | 4
47 | x86
48 |
49 |
50 | AllRules.ruleset
51 |
52 |
53 | pdbonly
54 | true
55 | ..\bin\Release\
56 | TRACE
57 | prompt
58 | 4
59 | x86
60 | ..\bin\Release\WebKitBrowser.XML
61 | AllRules.ruleset
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 | False
71 | True
72 | ..\webkit\WebKit.Interop.dll
73 |
74 |
75 |
76 |
77 |
78 |
79 | True
80 | True
81 | Resources.resx
82 |
83 |
84 |
85 |
86 |
87 | UserControl
88 |
89 |
90 | WebKitBrowser.cs
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 | PublicResXFileCodeGenerator
106 | Resources.Designer.cs
107 |
108 |
109 | WebKitBrowser.cs
110 |
111 |
112 |
113 |
114 | PreserveNewest
115 |
116 |
117 |
118 |
119 | WebKit.NET.snk
120 |
121 |
122 |
123 |
124 | False
125 | .NET Framework 3.5 SP1 Client Profile
126 | false
127 |
128 |
129 | False
130 | .NET Framework 3.5 SP1
131 | true
132 |
133 |
134 | False
135 | Windows Installer 3.1
136 | true
137 |
138 |
139 |
140 |
141 | {4CBEE897-7218-49F4-A678-B41BF2E42F06}
142 | WebKitCore
143 |
144 |
145 |
146 |
153 |
154 | echo WebKitBrowser > temp_exclude_files.txt
155 | xcopy /E /Y /EXCLUDE:temp_exclude_files.txt "$(SolutionDir)webkit\*" "$(SolutionDir)bin\$(ConfigurationName)"
156 | del temp_exclude_files.txt
157 |
158 |
159 |
160 |
--------------------------------------------------------------------------------
/WebKitBrowser/WebKitBrowser.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/WebKitBrowser/WebKitBrowserEvents.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 | * POSSIBILITY OF SUCH DAMAGE.
25 | */
26 |
27 | // Various event handlers and argument classes used by WebKitBrowser to
28 | // communicate with the client.
29 |
30 | using System;
31 | using WebKit.Interop;
32 |
33 | namespace WebKit
34 | {
35 | #region Event handler delegates
36 |
37 | ///
38 | /// Represents the method that will handle the WebKitBrowser.Error event.
39 | ///
40 | /// The source of the event.
41 | /// A WebKitBrowserErrorEventArgs that contains the event data.
42 | public delegate void WebKitBrowserErrorEventHandler (object sender, WebKitBrowserErrorEventArgs e);
43 |
44 | ///
45 | /// Represents the method that will handle the WebKitBrowser.FileDownloadBegin event.
46 | ///
47 | /// The source of the event.
48 | /// A FileDownloadBeginEventArgs that contains the event data.
49 | public delegate void FileDownloadBeginEventHandler (object sender, FileDownloadBeginEventArgs e);
50 |
51 | ///
52 | /// Represents the method that will handle the WebKitBrowser.NewWindowRequest event.
53 | ///
54 | /// The source of the event.
55 | /// A NewWindowRequestEventArgs that contains the event data.
56 | public delegate void NewWindowRequestEventHandler (object sender, NewWindowRequestEventArgs e);
57 |
58 | ///
59 | /// Represents the method that will handle the WebKitBrowser.NewWindowCreated event.
60 | ///
61 | /// The source of the event.
62 | /// A NewWindowCreatedEventArgs that contains the event data.
63 | public delegate void NewWindowCreatedEventHandler (object sender, NewWindowCreatedEventArgs e);
64 |
65 | #endregion
66 |
67 | #region EventArgs classes
68 |
69 | ///
70 | /// Provides data for the WebKitBrowser.Error event.
71 | ///
72 | public class WebKitBrowserErrorEventArgs : EventArgs
73 | {
74 | ///
75 | /// Gets a description of the error that occurred.
76 | ///
77 | public string Description { get; private set; }
78 |
79 | ///
80 | /// Initializes a new instance of the WebKitBrowserErrorEventArgs class.
81 | ///
82 | /// A description of the error that occurred.
83 | public WebKitBrowserErrorEventArgs(string description)
84 | {
85 | this.Description = description;
86 | }
87 | }
88 |
89 | ///
90 | /// Provides data for the WebKitBrowser.FileDownloadBegin event.
91 | ///
92 | public class FileDownloadBeginEventArgs : EventArgs
93 | {
94 | ///
95 | /// Gets the WebKitDownload representing the download.
96 | ///
97 | public WebKitDownload Download { get; private set; }
98 |
99 | ///
100 | /// Gets or sets a value indicating whether the download should be cancelled.
101 | ///
102 | public bool Cancel { get; set; }
103 |
104 | ///
105 | /// Initializes a new instance of the FileDownloadBeginEventArgs class.
106 | ///
107 | /// A WebKitDownload representing the download.
108 | public FileDownloadBeginEventArgs(WebKitDownload download)
109 | {
110 | this.Download = Download;
111 | this.Cancel = false;
112 | }
113 | }
114 |
115 | ///
116 | /// Provides data for the WebKitBrowser.NewWindowRequest event.
117 | ///
118 | public class NewWindowRequestEventArgs : EventArgs
119 | {
120 | ///
121 | /// Gets or sets a value indicating whether opening the new window should be cancelled.
122 | ///
123 | public bool Cancel { get; set; }
124 |
125 | ///
126 | /// Gets the Url that the new window will attempt to navigate to.
127 | ///
128 | public string Url { get; private set; }
129 |
130 | ///
131 | /// Initializes a new instance of the NewWindowRequestEventArgs class.
132 | ///
133 | /// The Url that the new window will attempt to navigate to.
134 | public NewWindowRequestEventArgs(string url)
135 | {
136 | this.Cancel = false;
137 | this.Url = url;
138 | }
139 | }
140 |
141 | ///
142 | /// Provides data for the WebKitBrowser.NewWindowCreated event.
143 | ///
144 | public class NewWindowCreatedEventArgs : EventArgs
145 | {
146 | ///
147 | /// Gets the WebKitBrowser showing the contents of the new window.
148 | ///
149 | public WebKitBrowser WebKitBrowser { get; private set; }
150 |
151 | ///
152 | /// Initializes a new instance of the NewWindowCreatedEventArgs class.
153 | ///
154 | /// The WebKitBrowser showing the contents of the new window.
155 | public NewWindowCreatedEventArgs(WebKitBrowser browser)
156 | {
157 | WebKitBrowser = browser;
158 | }
159 | }
160 |
161 | #endregion
162 | }
163 |
--------------------------------------------------------------------------------
/WebKitBrowser/WebKitDOMHTMLClasses.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 | * POSSIBILITY OF SUCH DAMAGE.
25 | */
26 |
27 | using System;
28 | using System.Collections.Generic;
29 | using System.Text;
30 | using WebKit.Interop;
31 |
32 | namespace WebKit.DOM
33 | {
34 | ///
35 | /// Represents an HTML Document.
36 | ///
37 | class HTMLDocument : Document
38 | {
39 | ///
40 | /// HTMLDocument constructor.
41 | ///
42 | /// WebKit IDOMHTMLDocument object.
43 | protected HTMLDocument(IDOMDocument Document)
44 | : base(Document)
45 | {
46 | }
47 | }
48 |
49 | ///
50 | /// Represents an HTML Element
51 | ///
52 | class HTMLElement : Element
53 | {
54 | private IDOMHTMLElement htmlElement;
55 |
56 | ///
57 | /// HTMLElement constructor.
58 | ///
59 | /// WebKit IDOMHTMLElement object.
60 | protected HTMLElement(IDOMHTMLElement HTMLElement)
61 | : base(HTMLElement)
62 | {
63 | this.htmlElement = HTMLElement;
64 | }
65 |
66 | internal static HTMLElement Create(IDOMHTMLElement HTMLElement)
67 | {
68 | return new HTMLElement(HTMLElement);
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/WebKitBrowser/WebKitDownload.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 | * POSSIBILITY OF SUCH DAMAGE.
25 | */
26 |
27 | // TODO: make more robust, support for more options etc...
28 | // Design feels a little messy at the moment.
29 |
30 | using System;
31 | using System.Collections.Generic;
32 | using System.Text;
33 | using WebKit.Interop;
34 |
35 | namespace WebKit
36 | {
37 | ///
38 | /// Represents a file download.
39 | ///
40 | public class WebKitDownload
41 | {
42 | #region FileDownload events
43 |
44 | ///
45 | /// Gets a value indicating whether the download was cancelled.
46 | ///
47 | public bool DidCancel { get; private set; }
48 |
49 | ///
50 | /// Gets the destination file path.
51 | ///
52 | public string FilePath { get; private set; }
53 |
54 | ///
55 | /// Occurs when file data transfer begins.
56 | ///
57 | public event DownloadStartedEventHandler DownloadStarted;
58 |
59 | ///
60 | /// Occurs when file data arrives.
61 | ///
62 | public event DownloadReceiveDataEventHandler DownloadReceiveData;
63 |
64 | ///
65 | /// Occurs when the file is downloaded successfully.
66 | ///
67 | public event DownloadFinishedEventHandler DownloadFinished;
68 |
69 | #endregion
70 |
71 | internal WebKitDownload()
72 | {
73 | FilePath = "";
74 | }
75 |
76 | internal void NotifyDidFailWithError(WebDownload download, WebError error)
77 | {
78 | // Todo
79 | }
80 |
81 | internal void NotifyDidFinish(WebDownload download)
82 | {
83 | DownloadFinished(this, new DownloadFinishedEventArgs());
84 | }
85 |
86 | internal void NotifyDecideDestinationWithSuggestedFilename(WebDownload download, string fileName)
87 | {
88 | if (FilePath.Length != 0)
89 | download.setDestination(FilePath, 1);
90 | else
91 | download.setDestination(fileName, 1);
92 | }
93 |
94 | internal bool NotifyDidReceiveDataOfLength(WebDownload download, uint length)
95 | {
96 | if (DidCancel)
97 | {
98 | download.cancel();
99 | return false;
100 | }
101 | else
102 | {
103 | DownloadReceiveData(this, new DownloadReceiveDataEventArgs(length));
104 | return true;
105 | }
106 | }
107 |
108 | internal void NotifyDidReceiveResponse(WebDownload download, WebURLResponse response)
109 | {
110 | DownloadStarted(this, new DownloadStartedEventArgs(response.suggestedFilename(), response.expectedContentLength()));
111 | }
112 |
113 | ///
114 | /// Cancel the file download.
115 | ///
116 | public void Cancel()
117 | {
118 | DidCancel = true;
119 | }
120 | }
121 | }
122 |
--------------------------------------------------------------------------------
/WebKitBrowser/WebKitDownloadEvents.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 | * POSSIBILITY OF SUCH DAMAGE.
25 | */
26 |
27 | // Various event handlers and argument classes used by WebKitDownload to
28 | // communicate with clients.
29 |
30 | using System;
31 | using WebKit.Interop;
32 |
33 | namespace WebKit
34 | {
35 | #region Event delegates
36 |
37 | ///
38 | /// Represents the method that will handle the WebKitDownload.DownloadStarted event.
39 | ///
40 | /// The source of the event.
41 | /// A DownloadStartedEventArgs that contains the event data.
42 | public delegate void DownloadStartedEventHandler(object sender, DownloadStartedEventArgs e);
43 |
44 | ///
45 | /// Represents the method that will handle the WebKitDownload.DownloadReceiveData event.
46 | ///
47 | /// The source of the event.
48 | /// A DownloadReceiveDataEventArgs that contains the event data.
49 | public delegate void DownloadReceiveDataEventHandler(object sender, DownloadReceiveDataEventArgs e);
50 |
51 | ///
52 | /// Represents the method that will handle the WebKitDownload.DownloadFinished event.
53 | ///
54 | /// The source of the event.
55 | /// A DownloadFinishedEventArgs that contains the event data.
56 | public delegate void DownloadFinishedEventHandler(object sender, DownloadFinishedEventArgs e);
57 |
58 | #endregion
59 |
60 | #region EventArg classes
61 |
62 | ///
63 | /// Provides data for the WebKitDownload.DownloadStarted event.
64 | ///
65 | public class DownloadStartedEventArgs : EventArgs
66 | {
67 | ///
68 | /// Gets the suggested name for the destination file.
69 | ///
70 | public string SuggestedFileName { get; private set; }
71 |
72 | ///
73 | /// Gets the file size in bytes.
74 | ///
75 | public long FileSize { get; private set; }
76 |
77 | ///
78 | /// Initializes a new instance of the DownloadStartedEventArgs class.
79 | ///
80 | /// The suggested name for the destination file.
81 | /// The file size in bytes.
82 | public DownloadStartedEventArgs(string suggestedFileName, long fileSize)
83 | {
84 | this.SuggestedFileName = suggestedFileName;
85 | this.FileSize = fileSize;
86 | }
87 | }
88 |
89 | ///
90 | /// Provides data for the WebKitDownload.DownloadReceiveData event.
91 | ///
92 | public class DownloadReceiveDataEventArgs : EventArgs
93 | {
94 | ///
95 | /// Gets the length of the data received in bytes.
96 | ///
97 | public uint Length { get; private set; }
98 |
99 | ///
100 | /// Initializes a new instance of the DownloadReceiveDataEventArgs class.
101 | ///
102 | /// The length of the data received in bytes.
103 | public DownloadReceiveDataEventArgs(uint length)
104 | {
105 | this.Length = Length;
106 | }
107 | }
108 |
109 | ///
110 | /// Provides data for the WebKitDownload.DownloadFinished event.
111 | ///
112 | public class DownloadFinishedEventArgs : EventArgs
113 | {
114 | }
115 |
116 | #endregion
117 | }
118 |
--------------------------------------------------------------------------------
/WebKitBrowser/WebPolicyDelegate.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 | * POSSIBILITY OF SUCH DAMAGE.
25 | */
26 |
27 | // Handles events that can be used to modify the policy decisions that the WebView
28 | // makes when handling various data types. More information can be found at:
29 | // http://developer.apple.com/documentation/Cocoa/Reference/WebKit/Protocols/WebPolicyDelegate_Protocol
30 |
31 | using System;
32 | using System.Collections.Generic;
33 | using System.Text;
34 | using WebKit.Interop;
35 | using System.Windows.Forms;
36 | using System.Diagnostics;
37 |
38 | namespace WebKit
39 | {
40 | internal class WebPolicyDelegate : IWebPolicyDelegate
41 | {
42 | public bool AllowDownloads;
43 | public bool AllowNewWindows;
44 | public bool AllowNavigation;
45 |
46 | // so that we can load and display the first page
47 | public bool AllowInitialNavigation;
48 |
49 | public WebPolicyDelegate(bool AllowNavigation, bool AllowDownloads, bool AllowNewWindows)
50 | {
51 | this.AllowDownloads = AllowDownloads;
52 | this.AllowNavigation = AllowNavigation;
53 | this.AllowNewWindows = AllowNewWindows;
54 | AllowInitialNavigation = true;
55 | }
56 |
57 | #region IWebPolicyDelegate Members
58 |
59 | public void decidePolicyForMIMEType(WebView WebView, string type, IWebURLRequest request, webFrame frame, IWebPolicyDecisionListener listener)
60 | {
61 | // todo: add support for showing custom MIME type documents
62 | // and for changing which MIME types are handled here
63 | if (WebView.canShowMIMEType(type) == 0)
64 | {
65 | if (AllowDownloads)
66 | listener.download();
67 | else
68 | listener.ignore();
69 | }
70 | else
71 | {
72 | listener.use();
73 | }
74 | }
75 |
76 | public void decidePolicyForNavigationAction(WebView WebView, CFDictionaryPropertyBag actionInformation, IWebURLRequest request, webFrame frame, IWebPolicyDecisionListener listener)
77 | {
78 | if (AllowNavigation || AllowInitialNavigation)
79 | listener.use();
80 | else
81 | listener.ignore();
82 | }
83 |
84 | public void decidePolicyForNewWindowAction(WebView WebView, CFDictionaryPropertyBag actionInformation, IWebURLRequest request, string frameName, IWebPolicyDecisionListener listener)
85 | {
86 | if (AllowNewWindows)
87 | listener.use();
88 | else
89 | listener.ignore();
90 | }
91 |
92 | public void unableToImplementPolicyWithError(WebView WebView, WebError error, webFrame frame)
93 | {
94 | }
95 |
96 | #endregion
97 | }
98 | }
99 |
--------------------------------------------------------------------------------
/WebKitBrowser/WebResourceLoadDelegate.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 | * POSSIBILITY OF SUCH DAMAGE.
25 | */
26 |
27 | // Not used yet. More info at
28 | // http://developer.apple.com/documentation/Cocoa/Reference/WebKit/Protocols/WebResourceLoadDelegate_Protocol
29 |
30 | using System;
31 | using System.Collections.Generic;
32 | using System.Text;
33 | using WebKit;
34 | using WebKit.Interop;
35 |
36 | namespace WebKit
37 | {
38 | internal class WebResourceLoadDelegate : IWebResourceLoadDelegate
39 | {
40 | #region IWebResourceLoadDelegate Members
41 |
42 | public void didCancelAuthenticationChallenge(WebView WebView, uint identifier, IWebURLAuthenticationChallenge challenge, IWebDataSource dataSource)
43 | {
44 | throw new NotImplementedException();
45 | }
46 |
47 | public void didFailLoadingWithError(WebView WebView, uint identifier, WebError error, IWebDataSource dataSource)
48 | {
49 | throw new NotImplementedException();
50 | }
51 |
52 | public void didFinishLoadingFromDataSource(WebView WebView, uint identifier, IWebDataSource dataSource)
53 | {
54 | throw new NotImplementedException();
55 | }
56 |
57 | public void didReceiveAuthenticationChallenge(WebView WebView, uint identifier, IWebURLAuthenticationChallenge challenge, IWebDataSource dataSource)
58 | {
59 | throw new NotImplementedException();
60 | }
61 |
62 | public void didReceiveContentLength(WebView WebView, uint identifier, uint length, IWebDataSource dataSource)
63 | {
64 | throw new NotImplementedException();
65 | }
66 |
67 | public void didReceiveResponse(WebView WebView, uint identifier, WebURLResponse response, IWebDataSource dataSource)
68 | {
69 | throw new NotImplementedException();
70 | }
71 |
72 | public void identifierForInitialRequest(WebView WebView, IWebURLRequest request, IWebDataSource dataSource, uint identifier)
73 | {
74 | throw new NotImplementedException();
75 | }
76 |
77 | public void plugInFailedWithError(WebView WebView, WebError error, IWebDataSource dataSource)
78 | {
79 | throw new NotImplementedException();
80 | }
81 |
82 | public IWebURLRequest willSendRequest(WebView WebView, uint identifier, IWebURLRequest request, WebURLResponse redirectResponse, IWebDataSource dataSource)
83 | {
84 | throw new NotImplementedException();
85 | }
86 |
87 | #endregion
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/WebKitBrowserDoc.shfbproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 | Debug
7 | AnyCPU
8 | 2.0
9 | {0816c726-296f-4320-a155-a7633d184d4a}
10 | 1.8.0.3
11 |
13 | Documentation
14 | Documentation
15 | Documentation
16 |
17 | .\docs\
18 | Documentation
19 | WebKit .NET
20 | MemberName
21 | 2.0.50727
22 | HtmlHelp1, Website
23 |
24 |
25 |
26 |
27 | True
28 | Copyright ©%3b 2009 WebKit .NET Project
29 | webkitdotnet%40peterdn.com
30 | Peter Nelson
31 | WebKit .NET is a WinForms control library wrapper for WebKit written in C#. The aim is to make it easy for developers to incorporate WebKit into their .NET applications.
32 |
33 | Contains classes for creating instances of and managing communication with WebKit COM components.
34 | Contains information about the WebKitBrowser assembly.
35 |
36 |
37 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/WebKitBrowserTest/DownloadForm.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace WebKitBrowserTest
2 | {
3 | partial class DownloadForm
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.progressBar1 = new System.Windows.Forms.ProgressBar();
32 | this.label1 = new System.Windows.Forms.Label();
33 | this.label2 = new System.Windows.Forms.Label();
34 | this.button1 = new System.Windows.Forms.Button();
35 | this.SuspendLayout();
36 | //
37 | // progressBar1
38 | //
39 | this.progressBar1.Location = new System.Drawing.Point(12, 61);
40 | this.progressBar1.Name = "progressBar1";
41 | this.progressBar1.Size = new System.Drawing.Size(328, 44);
42 | this.progressBar1.TabIndex = 0;
43 | //
44 | // label1
45 | //
46 | this.label1.AutoSize = true;
47 | this.label1.Location = new System.Drawing.Point(12, 9);
48 | this.label1.Name = "label1";
49 | this.label1.Size = new System.Drawing.Size(35, 13);
50 | this.label1.TabIndex = 1;
51 | this.label1.Text = "label1";
52 | //
53 | // label2
54 | //
55 | this.label2.AutoSize = true;
56 | this.label2.Location = new System.Drawing.Point(12, 45);
57 | this.label2.Name = "label2";
58 | this.label2.Size = new System.Drawing.Size(35, 13);
59 | this.label2.TabIndex = 2;
60 | this.label2.Text = "label2";
61 | //
62 | // button1
63 | //
64 | this.button1.Location = new System.Drawing.Point(134, 115);
65 | this.button1.Name = "button1";
66 | this.button1.Size = new System.Drawing.Size(75, 39);
67 | this.button1.TabIndex = 3;
68 | this.button1.Text = "Cancel";
69 | this.button1.UseVisualStyleBackColor = true;
70 | this.button1.Click += new System.EventHandler(this.button1_Click);
71 | //
72 | // DownloadForm
73 | //
74 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
75 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
76 | this.ClientSize = new System.Drawing.Size(355, 162);
77 | this.Controls.Add(this.button1);
78 | this.Controls.Add(this.label2);
79 | this.Controls.Add(this.label1);
80 | this.Controls.Add(this.progressBar1);
81 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
82 | this.MaximizeBox = false;
83 | this.Name = "DownloadForm";
84 | this.Text = "DownloadForm";
85 | this.ResumeLayout(false);
86 | this.PerformLayout();
87 |
88 | }
89 |
90 | #endregion
91 |
92 | private System.Windows.Forms.ProgressBar progressBar1;
93 | private System.Windows.Forms.Label label1;
94 | private System.Windows.Forms.Label label2;
95 | private System.Windows.Forms.Button button1;
96 | }
97 | }
--------------------------------------------------------------------------------
/WebKitBrowserTest/DownloadForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Text;
7 | using System.Windows.Forms;
8 | using WebKit;
9 |
10 | namespace WebKitBrowserTest
11 | {
12 | public partial class DownloadForm : Form
13 | {
14 | private WebKitDownload Download;
15 | private long size, recv;
16 |
17 | public DownloadForm(WebKitDownload Download)
18 | {
19 | this.Download = Download;
20 | InitializeComponent();
21 |
22 | this.Visible = false;
23 |
24 | Download.DownloadStarted += new DownloadStartedEventHandler(Download_DownloadStarted);
25 | Download.DownloadReceiveData += new DownloadReceiveDataEventHandler(Download_DownloadReceiveData);
26 | Download.DownloadFinished += new DownloadFinishedEventHandler(Download_DownloadFinished);
27 | }
28 |
29 | void Download_DownloadFinished(object sender, EventArgs args)
30 | {
31 | progressBar1.Value = progressBar1.Maximum;
32 | label2.Text = "Finished!";
33 | }
34 |
35 | void Download_DownloadReceiveData(object sender, DownloadReceiveDataEventArgs args)
36 | {
37 | recv += args.Length;
38 | label2.Text = recv.ToString() + " / " + size.ToString() + " bytes downloaded";
39 | progressBar1.Value = (int)((((float)recv) / ((float)size)) * progressBar1.Maximum);
40 | }
41 |
42 | void Download_DownloadStarted(object sender, DownloadStartedEventArgs args)
43 | {
44 | if (MessageBox.Show("Download file " + args.SuggestedFileName + "?", "Download", MessageBoxButtons.YesNo) == DialogResult.Yes)
45 | {
46 | size = args.FileSize;
47 | label1.Text = args.SuggestedFileName;
48 | this.Text = "Download " + args.SuggestedFileName;
49 | label2.Text = "0";
50 | this.Show();
51 | }
52 | else
53 | {
54 | Download.Cancel();
55 | this.Close();
56 | }
57 | }
58 |
59 | private void button1_Click(object sender, EventArgs e)
60 | {
61 | Download.Cancel();
62 | this.Close();
63 | }
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/WebKitBrowserTest/DownloadForm.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/WebKitBrowserTest/MainForm.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 17, 17
122 |
123 |
--------------------------------------------------------------------------------
/WebKitBrowserTest/NavigationBar.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 | * POSSIBILITY OF SUCH DAMAGE.
25 | */
26 |
27 | using System;
28 | using System.Collections.Generic;
29 | using System.ComponentModel;
30 | using System.Drawing;
31 | using System.Data;
32 | using System.Text;
33 | using System.Windows.Forms;
34 |
35 | namespace WebKitBrowserTest
36 | {
37 | public delegate void Default();
38 |
39 | public partial class NavigationBar : UserControl
40 | {
41 | public event Default Back;
42 | public event Default Forward;
43 | public new event Default Refresh;
44 | public event Default Stop;
45 | public event Default Home;
46 | public event Default Go;
47 |
48 | public string UrlText
49 | {
50 | get
51 | {
52 | return comboBoxAddress.Text;
53 | }
54 | set
55 | {
56 | comboBoxAddress.Text = value;
57 | }
58 | }
59 |
60 | public bool CanGoBack
61 | {
62 | set
63 | {
64 | buttonBack.Enabled = value;
65 | }
66 | }
67 |
68 | public bool CanGoForward
69 | {
70 | set
71 | {
72 | buttonFwd.Enabled = value;
73 | }
74 | }
75 |
76 | public NavigationBar()
77 | {
78 | InitializeComponent();
79 |
80 | // null event handlers
81 | Back += () => { };
82 | Forward += () => { };
83 | Refresh += () => { };
84 | Stop += () => { };
85 | Home += () => { };
86 | Go += () => { };
87 | }
88 |
89 | private void buttonBack_Click(object sender, EventArgs e)
90 | {
91 | Back();
92 | }
93 |
94 | private void buttonFwd_Click(object sender, EventArgs e)
95 | {
96 | Forward();
97 | }
98 |
99 | private void buttonRefresh_Click(object sender, EventArgs e)
100 | {
101 | Refresh();
102 | }
103 |
104 | private void buttonStop_Click(object sender, EventArgs e)
105 | {
106 | Stop();
107 | }
108 |
109 | private void buttonHome_Click(object sender, EventArgs e)
110 | {
111 | Home();
112 | }
113 |
114 | private void button1_Click(object sender, EventArgs e)
115 | {
116 | Go();
117 | }
118 |
119 | private void comboBoxAddress_KeyPress(object sender, KeyPressEventArgs e)
120 | {
121 | if (e.KeyChar == '\n' || e.KeyChar == '\r')
122 | {
123 | e.Handled = true;
124 | Go();
125 | }
126 | }
127 | }
128 | }
129 |
--------------------------------------------------------------------------------
/WebKitBrowserTest/NavigationBar.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/WebKitBrowserTest/Program.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 | * POSSIBILITY OF SUCH DAMAGE.
25 | */
26 |
27 | using System;
28 | using System.Collections.Generic;
29 | using System.Windows.Forms;
30 |
31 | namespace WebKitBrowserTest
32 | {
33 | static class Program
34 | {
35 | ///
36 | /// The main entry point for the application.
37 | ///
38 | [STAThread]
39 | static void Main()
40 | {
41 | Application.EnableVisualStyles();
42 | Application.SetCompatibleTextRenderingDefault(false);
43 | Application.Run(new MainForm());
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/WebKitBrowserTest/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 | * POSSIBILITY OF SUCH DAMAGE.
25 | */
26 |
27 | using System.Reflection;
28 | using System.Runtime.CompilerServices;
29 | using System.Runtime.InteropServices;
30 |
31 | // General Information about an assembly is controlled through the following
32 | // set of attributes. Change these attribute values to modify the information
33 | // associated with an assembly.
34 | [assembly: AssemblyTitle("WebKitBrowserTest")]
35 | [assembly: AssemblyDescription("WebKit .NET Test Browser")]
36 | [assembly: AssemblyConfiguration("")]
37 | [assembly: AssemblyCompany("Peter Nelson")]
38 | [assembly: AssemblyProduct("WebKitBrowserTest")]
39 | [assembly: AssemblyCopyright("Copyright © Peter Nelson 2009")]
40 | [assembly: AssemblyTrademark("")]
41 | [assembly: AssemblyCulture("")]
42 |
43 | // Setting ComVisible to false makes the types in this assembly not visible
44 | // to COM components. If you need to access a type in this assembly from
45 | // COM, set the ComVisible attribute to true on that type.
46 | [assembly: ComVisible(false)]
47 |
48 | // The following GUID is for the ID of the typelib if this project is exposed to COM
49 | [assembly: Guid("b864a67c-1720-4755-a907-967da28fe1bb")]
50 |
51 | // Version information for an assembly consists of the following four values:
52 | //
53 | // Major Version
54 | // Minor Version
55 | // Build Number
56 | // Revision
57 | //
58 | // You can specify all the values or you can default the Build and Revision Numbers
59 | // by using the '*' as shown below:
60 | // [assembly: AssemblyVersion("1.0.*")]
61 | [assembly: AssemblyVersion("0.4.0.0")]
62 | [assembly: AssemblyFileVersion("0.4.0.0")]
63 |
--------------------------------------------------------------------------------
/WebKitBrowserTest/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.1
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace WebKitBrowserTest.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WebKitBrowserTest.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/WebKitBrowserTest/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/WebKitBrowserTest/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.1
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace WebKitBrowserTest.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/WebKitBrowserTest/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/WebKitBrowserTest/SourceViewForm.Designer.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 | * POSSIBILITY OF SUCH DAMAGE.
25 | */
26 |
27 | namespace WebKitBrowserTest
28 | {
29 | partial class SourceViewForm
30 | {
31 | ///
32 | /// Required designer variable.
33 | ///
34 | private System.ComponentModel.IContainer components = null;
35 |
36 | ///
37 | /// Clean up any resources being used.
38 | ///
39 | /// true if managed resources should be disposed; otherwise, false.
40 | protected override void Dispose(bool disposing)
41 | {
42 | if (disposing && (components != null))
43 | {
44 | components.Dispose();
45 | }
46 | base.Dispose(disposing);
47 | }
48 |
49 | #region Windows Form Designer generated code
50 |
51 | ///
52 | /// Required method for Designer support - do not modify
53 | /// the contents of this method with the code editor.
54 | ///
55 | private void InitializeComponent()
56 | {
57 | this.textBox = new System.Windows.Forms.TextBox();
58 | this.menuStrip1 = new System.Windows.Forms.MenuStrip();
59 | this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
60 | this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
61 | this.closeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
62 | this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
63 | this.menuStrip1.SuspendLayout();
64 | this.SuspendLayout();
65 | //
66 | // textBox
67 | //
68 | this.textBox.AcceptsReturn = true;
69 | this.textBox.AcceptsTab = true;
70 | this.textBox.AllowDrop = true;
71 | this.textBox.Dock = System.Windows.Forms.DockStyle.Fill;
72 | this.textBox.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
73 | this.textBox.Location = new System.Drawing.Point(0, 24);
74 | this.textBox.Multiline = true;
75 | this.textBox.Name = "textBox";
76 | this.textBox.Size = new System.Drawing.Size(578, 415);
77 | this.textBox.TabIndex = 0;
78 | this.textBox.WordWrap = false;
79 | //
80 | // menuStrip1
81 | //
82 | this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
83 | this.fileToolStripMenuItem});
84 | this.menuStrip1.Location = new System.Drawing.Point(0, 0);
85 | this.menuStrip1.Name = "menuStrip1";
86 | this.menuStrip1.Size = new System.Drawing.Size(578, 24);
87 | this.menuStrip1.TabIndex = 1;
88 | this.menuStrip1.Text = "menuStrip1";
89 | //
90 | // fileToolStripMenuItem
91 | //
92 | this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
93 | this.saveToolStripMenuItem,
94 | this.toolStripMenuItem1,
95 | this.closeToolStripMenuItem});
96 | this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
97 | this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
98 | this.fileToolStripMenuItem.Text = "&File";
99 | //
100 | // saveToolStripMenuItem
101 | //
102 | this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
103 | this.saveToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
104 | this.saveToolStripMenuItem.Text = "&Save";
105 | this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click);
106 | //
107 | // closeToolStripMenuItem
108 | //
109 | this.closeToolStripMenuItem.Name = "closeToolStripMenuItem";
110 | this.closeToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
111 | this.closeToolStripMenuItem.Text = "&Close";
112 | this.closeToolStripMenuItem.Click += new System.EventHandler(this.closeToolStripMenuItem_Click);
113 | //
114 | // toolStripMenuItem1
115 | //
116 | this.toolStripMenuItem1.Name = "toolStripMenuItem1";
117 | this.toolStripMenuItem1.Size = new System.Drawing.Size(149, 6);
118 | //
119 | // SourceViewForm
120 | //
121 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
122 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
123 | this.ClientSize = new System.Drawing.Size(578, 439);
124 | this.Controls.Add(this.textBox);
125 | this.Controls.Add(this.menuStrip1);
126 | this.MainMenuStrip = this.menuStrip1;
127 | this.Name = "SourceViewForm";
128 | this.Text = "Page Source";
129 | this.menuStrip1.ResumeLayout(false);
130 | this.menuStrip1.PerformLayout();
131 | this.ResumeLayout(false);
132 | this.PerformLayout();
133 |
134 | }
135 |
136 | #endregion
137 |
138 | private System.Windows.Forms.TextBox textBox;
139 | private System.Windows.Forms.MenuStrip menuStrip1;
140 | private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
141 | private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem;
142 | private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1;
143 | private System.Windows.Forms.ToolStripMenuItem closeToolStripMenuItem;
144 | }
145 | }
--------------------------------------------------------------------------------
/WebKitBrowserTest/SourceViewForm.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 | * POSSIBILITY OF SUCH DAMAGE.
25 | */
26 |
27 | using System;
28 | using System.Collections.Generic;
29 | using System.ComponentModel;
30 | using System.Data;
31 | using System.Drawing;
32 | using System.Text;
33 | using System.Windows.Forms;
34 | using WebKit;
35 |
36 | namespace WebKitBrowserTest
37 | {
38 | public partial class SourceViewForm : Form
39 | {
40 | WebKitBrowser current;
41 |
42 | public SourceViewForm(string text, WebKitBrowser current)
43 | {
44 | InitializeComponent();
45 | textBox.Text = text;
46 | this.current = current;
47 | }
48 |
49 | private void closeToolStripMenuItem_Click(object sender, EventArgs e)
50 | {
51 | this.Close();
52 | }
53 |
54 | private void saveToolStripMenuItem_Click(object sender, EventArgs e)
55 | {
56 | current.DocumentText = textBox.Text;
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/WebKitBrowserTest/SourceViewForm.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 17, 17
122 |
123 |
--------------------------------------------------------------------------------
/WebKitBrowserTest/WebBrowserTabPage.Designer.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 | * POSSIBILITY OF SUCH DAMAGE.
25 | */
26 |
27 | namespace WebKitBrowserTest
28 | {
29 | partial class WebBrowserTabPage
30 | {
31 | ///
32 | /// Required designer variable.
33 | ///
34 | private System.ComponentModel.IContainer components = null;
35 |
36 | ///
37 | /// Clean up any resources being used.
38 | ///
39 | /// true if managed resources should be disposed; otherwise, false.
40 | protected override void Dispose(bool disposing)
41 | {
42 | if (disposing && (components != null))
43 | {
44 | components.Dispose();
45 | }
46 | base.Dispose(disposing);
47 | }
48 |
49 | #region Component Designer generated code
50 |
51 | ///
52 | /// Required method for Designer support - do not modify
53 | /// the contents of this method with the code editor.
54 | ///
55 | private void InitializeComponent()
56 | {
57 | this.SuspendLayout();
58 | this.ResumeLayout(false);
59 |
60 | }
61 |
62 | #endregion
63 |
64 |
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/WebKitBrowserTest/WebBrowserTabPage.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 | * POSSIBILITY OF SUCH DAMAGE.
25 | */
26 |
27 | using System;
28 | using System.Collections.Generic;
29 | using System.ComponentModel;
30 | using System.Drawing;
31 | using System.Data;
32 | using System.Text;
33 | using System.Windows.Forms;
34 | using WebKit;
35 |
36 | namespace WebKitBrowserTest
37 | {
38 | public partial class WebBrowserTabPage : TabPage
39 | {
40 | public WebKitBrowser browser;
41 |
42 | private StatusStrip statusStrip;
43 | private ToolStripLabel statusLabel;
44 | private ToolStripLabel iconLabel;
45 | private ToolStripContainer container;
46 |
47 | public WebBrowserTabPage() : this(new WebKitBrowser(), true)
48 | {
49 | }
50 |
51 | public WebBrowserTabPage(WebKitBrowser browserControl, bool goHome)
52 | {
53 | InitializeComponent();
54 |
55 | statusStrip = new StatusStrip();
56 | statusStrip.Name = "statusStrip";
57 | statusStrip.Visible = true;
58 | statusStrip.SizingGrip = false;
59 |
60 | container = new ToolStripContainer();
61 | container.Name = "container";
62 | container.Visible = true;
63 | container.Dock = DockStyle.Fill;
64 |
65 | statusLabel = new ToolStripLabel();
66 | statusLabel.Name = "statusLabel";
67 | statusLabel.Text = "Done";
68 | statusLabel.Visible = true;
69 |
70 | iconLabel = new ToolStripLabel();
71 | iconLabel.Name = "iconLabel";
72 | iconLabel.Text = "No Icon";
73 | iconLabel.Visible = true;
74 |
75 | statusStrip.Items.Add(statusLabel);
76 | statusStrip.Items.Add(iconLabel);
77 |
78 | container.BottomToolStripPanel.Controls.Add(statusStrip);
79 |
80 | // create webbrowser control
81 | browser = browserControl;
82 | browser.Visible = true;
83 | browser.Dock = DockStyle.Fill;
84 | browser.Name = "browser";
85 | container.ContentPanel.Controls.Add(browser);
86 |
87 | // context menu
88 |
89 | this.Controls.Add(container);
90 | this.Text = "";
91 |
92 | // events
93 | browser.DocumentTitleChanged += (s, e) => this.Text = browser.DocumentTitle;
94 | browser.Navigating += (s, e) => statusLabel.Text = "Loading...";
95 | browser.Navigated += (s, e) => { statusLabel.Text = "Downloading..."; };
96 | browser.DocumentCompleted += (s, e) => { statusLabel.Text = "Done"; };
97 | if (goHome)
98 | browser.Navigate("http://www.google.com");
99 | }
100 |
101 | public void Stop()
102 | {
103 | browser.Stop();
104 | statusLabel.Text = "Stopped";
105 | }
106 | }
107 | }
108 |
--------------------------------------------------------------------------------
/WebKitBrowserTest/WebBrowserTabPage.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | False
122 |
123 |
--------------------------------------------------------------------------------
/WebKitBrowserTest/WebKitBrowserTest.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 9.0.30729
7 | 2.0
8 | {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}
9 | WinExe
10 | Properties
11 | WebKitBrowserTest
12 | WebKitBrowserTest
13 | v2.0
14 | 512
15 |
16 |
17 | 3.5
18 |
19 | publish\
20 | true
21 | Disk
22 | false
23 | Foreground
24 | 7
25 | Days
26 | false
27 | false
28 | true
29 | 0
30 | 1.0.0.%2a
31 | false
32 | false
33 | true
34 |
35 |
36 | true
37 | full
38 | false
39 | ..\bin\Debug\
40 | DEBUG;TRACE
41 | prompt
42 | 4
43 | x86
44 | AllRules.ruleset
45 |
46 |
47 | pdbonly
48 | true
49 | ..\bin\Release\
50 | TRACE
51 | prompt
52 | 4
53 | x86
54 | AllRules.ruleset
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 | Form
67 |
68 |
69 | DownloadForm.cs
70 |
71 |
72 | Form
73 |
74 |
75 | MainForm.cs
76 |
77 |
78 | UserControl
79 |
80 |
81 | NavigationBar.cs
82 |
83 |
84 |
85 |
86 | DownloadForm.cs
87 |
88 |
89 | MainForm.cs
90 |
91 |
92 | NavigationBar.cs
93 |
94 |
95 | ResXFileCodeGenerator
96 | Resources.Designer.cs
97 | Designer
98 |
99 |
100 | SourceViewForm.cs
101 |
102 |
103 | WebBrowserTabPage.cs
104 |
105 |
106 | True
107 | Resources.resx
108 | True
109 |
110 |
111 |
112 | SettingsSingleFileGenerator
113 | Settings.Designer.cs
114 |
115 |
116 | True
117 | Settings.settings
118 | True
119 |
120 |
121 | Form
122 |
123 |
124 | SourceViewForm.cs
125 |
126 |
127 | Component
128 |
129 |
130 | WebBrowserTabPage.cs
131 |
132 |
133 |
134 |
135 | {44AFE214-12C7-4280-898D-A7C4AABF1533}
136 | WebKitBrowser
137 |
138 |
139 |
140 |
141 | False
142 | .NET Framework 3.5 SP1 Client Profile
143 | false
144 |
145 |
146 | False
147 | .NET Framework 3.5 SP1
148 | true
149 |
150 |
151 | False
152 | Windows Installer 3.1
153 | true
154 |
155 |
156 |
157 |
164 |
--------------------------------------------------------------------------------
/WebKitBrowserTest/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/WebKitCore/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("WebKitCore")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Microsoft")]
12 | [assembly: AssemblyProduct("WebKitCore")]
13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("73a44dcc-9475-40b3-95b5-3202e63f0a64")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
38 | [assembly: InternalsVisibleTo("WebKitBrowser")]
39 | [assembly: InternalsVisibleTo("WebKitWpf")]
40 |
--------------------------------------------------------------------------------
/WebKitCore/WebKitCore.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.30703
7 | 2.0
8 | {4CBEE897-7218-49F4-A678-B41BF2E42F06}
9 | Library
10 | Properties
11 | WebKitCore
12 | WebKitCore
13 | v2.0
14 | 512
15 |
16 |
17 |
18 | true
19 | full
20 | false
21 | bin\Debug\
22 | DEBUG;TRACE
23 | prompt
24 | 4
25 |
26 |
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 |
37 |
38 |
39 | ..\webkit\WebKit.Interop.dll
40 | True
41 |
42 |
43 |
44 |
45 |
46 |
47 |
54 |
--------------------------------------------------------------------------------
/WebKitWpf/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 | using System.Windows;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 |
9 | [assembly: AssemblyTitle("WebKitWpf")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("Microsoft")]
13 | [assembly: AssemblyProduct("WebKitWpf")]
14 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 |
18 | // Setting ComVisible to false makes the types in this assembly not visible
19 | // to COM components. If you need to access a type in this assembly from
20 | // COM, set the ComVisible attribute to true on that type.
21 |
22 | [assembly: ComVisible(false)]
23 |
24 | //In order to begin building localizable applications, set
25 | //CultureYouAreCodingWith in your .csproj file
26 | //inside a . For example, if you are using US english
27 | //in your source files, set the to en-US. Then uncomment
28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in
29 | //the line below to match the UICulture setting in the project file.
30 |
31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32 |
33 | [assembly: ThemeInfo(
34 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
35 | //(used if a resource is not found in the page,
36 | // or application resource dictionaries)
37 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
38 | //(used if a resource is not found in the page,
39 | // app, or any theme specific resource dictionaries)
40 | )]
41 |
42 | // Version information for an assembly consists of the following four values:
43 | //
44 | // Major Version
45 | // Minor Version
46 | // Build Number
47 | // Revision
48 | //
49 | // You can specify all the values or you can default the Build and Revision Numbers
50 | // by using the '*' as shown below:
51 | // [assembly: AssemblyVersion("1.0.*")]
52 |
53 | [assembly: AssemblyVersion("1.0.0.0")]
54 | [assembly: AssemblyFileVersion("1.0.0.0")]
--------------------------------------------------------------------------------
/WebKitWpf/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.1
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace WebKitWpf.Properties
12 | {
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources
26 | {
27 |
28 | private static global::System.Resources.ResourceManager resourceMan;
29 |
30 | private static global::System.Globalization.CultureInfo resourceCulture;
31 |
32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33 | internal Resources()
34 | {
35 | }
36 |
37 | ///
38 | /// Returns the cached ResourceManager instance used by this class.
39 | ///
40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41 | internal static global::System.Resources.ResourceManager ResourceManager
42 | {
43 | get
44 | {
45 | if((resourceMan == null))
46 | {
47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WebKitWpf.Properties.Resources", typeof(Resources).Assembly);
48 | resourceMan = temp;
49 | }
50 | return resourceMan;
51 | }
52 | }
53 |
54 | ///
55 | /// Overrides the current thread's CurrentUICulture property for all
56 | /// resource lookups using this strongly typed resource class.
57 | ///
58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59 | internal static global::System.Globalization.CultureInfo Culture
60 | {
61 | get
62 | {
63 | return resourceCulture;
64 | }
65 | set
66 | {
67 | resourceCulture = value;
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/WebKitWpf/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/WebKitWpf/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.1
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace WebKitWpf.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/WebKitWpf/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/WebKitWpf/Themes/Generic.xaml:
--------------------------------------------------------------------------------
1 |
5 |
17 |
--------------------------------------------------------------------------------
/WebKitWpf/WebKitBrowser.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Controls;
3 |
4 | namespace WebKitWpf
5 | {
6 | ///
7 | /// Follow steps 1a or 1b and then 2 to use this custom control in a XAML file.
8 | ///
9 | /// Step 1a) Using this custom control in a XAML file that exists in the current project.
10 | /// Add this XmlNamespace attribute to the root element of the markup file where it is
11 | /// to be used:
12 | ///
13 | /// xmlns:MyNamespace="clr-namespace:WebKitWpf"
14 | ///
15 | ///
16 | /// Step 1b) Using this custom control in a XAML file that exists in a different project.
17 | /// Add this XmlNamespace attribute to the root element of the markup file where it is
18 | /// to be used:
19 | ///
20 | /// xmlns:MyNamespace="clr-namespace:WebKitWpf;assembly=WebKitWpf"
21 | ///
22 | /// You will also need to add a project reference from the project where the XAML file lives
23 | /// to this project and Rebuild to avoid compilation errors:
24 | ///
25 | /// Right click on the target project in the Solution Explorer and
26 | /// "Add Reference"->"Projects"->[Select this project]
27 | ///
28 | ///
29 | /// Step 2)
30 | /// Go ahead and use your control in the XAML file.
31 | ///
32 | ///
33 | ///
34 | public class WebKitBrowser : Control
35 | {
36 | static WebKitBrowser()
37 | {
38 | DefaultStyleKeyProperty.OverrideMetadata(typeof(WebKitBrowser), new FrameworkPropertyMetadata(typeof(WebKitBrowser)));
39 | }
40 | }
41 | }
--------------------------------------------------------------------------------
/WebKitWpf/WebKitWpf.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.30703
7 | 2.0
8 | {71C925FA-37AE-4DC0-9743-0C001E2BA0AE}
9 | library
10 | Properties
11 | WebKitWpf
12 | WebKitWpf
13 | v4.0
14 | Client
15 | 512
16 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
17 | 4
18 |
19 |
20 | true
21 | full
22 | false
23 | bin\Debug\
24 | DEBUG;TRACE
25 | prompt
26 | 4
27 |
28 |
29 | pdbonly
30 | true
31 | bin\Release\
32 | TRACE
33 | prompt
34 | 4
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | 4.0
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 | MSBuild:Compile
53 | Designer
54 |
55 |
56 | Code
57 |
58 |
59 |
60 |
61 | Code
62 |
63 |
64 | True
65 | True
66 | Resources.resx
67 |
68 |
69 | True
70 | Settings.settings
71 | True
72 |
73 |
74 | ResXFileCodeGenerator
75 | Resources.Designer.cs
76 |
77 |
78 | SettingsSingleFileGenerator
79 | Settings.Designer.cs
80 |
81 |
82 |
83 |
84 |
85 | {4CBEE897-7218-49F4-A678-B41BF2E42F06}
86 | WebKitCore
87 |
88 |
89 |
90 |
97 |
--------------------------------------------------------------------------------
/WebKitWpfTest/App.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/WebKitWpfTest/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Windows;
7 |
8 | namespace WebKitWpfTest
9 | {
10 | ///
11 | /// Interaction logic for App.xaml
12 | ///
13 | public partial class App : Application
14 | {
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/WebKitWpfTest/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/WebKitWpfTest/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Windows;
6 | using System.Windows.Controls;
7 | using System.Windows.Data;
8 | using System.Windows.Documents;
9 | using System.Windows.Input;
10 | using System.Windows.Media;
11 | using System.Windows.Media.Imaging;
12 | using System.Windows.Navigation;
13 | using System.Windows.Shapes;
14 |
15 | namespace WebKitWpfTest
16 | {
17 | ///
18 | /// Interaction logic for MainWindow.xaml
19 | ///
20 | public partial class MainWindow : Window
21 | {
22 | public MainWindow()
23 | {
24 | InitializeComponent();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/WebKitWpfTest/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 | using System.Windows;
6 |
7 | // General Information about an assembly is controlled through the following
8 | // set of attributes. Change these attribute values to modify the information
9 | // associated with an assembly.
10 | [assembly: AssemblyTitle("WebKitWpfTest")]
11 | [assembly: AssemblyDescription("")]
12 | [assembly: AssemblyConfiguration("")]
13 | [assembly: AssemblyCompany("Microsoft")]
14 | [assembly: AssemblyProduct("WebKitWpfTest")]
15 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
16 | [assembly: AssemblyTrademark("")]
17 | [assembly: AssemblyCulture("")]
18 |
19 | // Setting ComVisible to false makes the types in this assembly not visible
20 | // to COM components. If you need to access a type in this assembly from
21 | // COM, set the ComVisible attribute to true on that type.
22 | [assembly: ComVisible(false)]
23 |
24 | //In order to begin building localizable applications, set
25 | //CultureYouAreCodingWith in your .csproj file
26 | //inside a . For example, if you are using US english
27 | //in your source files, set the to en-US. Then uncomment
28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in
29 | //the line below to match the UICulture setting in the project file.
30 |
31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32 |
33 |
34 | [assembly: ThemeInfo(
35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36 | //(used if a resource is not found in the page,
37 | // or application resource dictionaries)
38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39 | //(used if a resource is not found in the page,
40 | // app, or any theme specific resource dictionaries)
41 | )]
42 |
43 |
44 | // Version information for an assembly consists of the following four values:
45 | //
46 | // Major Version
47 | // Minor Version
48 | // Build Number
49 | // Revision
50 | //
51 | // You can specify all the values or you can default the Build and Revision Numbers
52 | // by using the '*' as shown below:
53 | // [assembly: AssemblyVersion("1.0.*")]
54 | [assembly: AssemblyVersion("1.0.0.0")]
55 | [assembly: AssemblyFileVersion("1.0.0.0")]
56 |
--------------------------------------------------------------------------------
/WebKitWpfTest/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.1
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace WebKitWpfTest.Properties
12 | {
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources
26 | {
27 |
28 | private static global::System.Resources.ResourceManager resourceMan;
29 |
30 | private static global::System.Globalization.CultureInfo resourceCulture;
31 |
32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33 | internal Resources()
34 | {
35 | }
36 |
37 | ///
38 | /// Returns the cached ResourceManager instance used by this class.
39 | ///
40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41 | internal static global::System.Resources.ResourceManager ResourceManager
42 | {
43 | get
44 | {
45 | if((resourceMan == null))
46 | {
47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WebKitWpfTest.Properties.Resources", typeof(Resources).Assembly);
48 | resourceMan = temp;
49 | }
50 | return resourceMan;
51 | }
52 | }
53 |
54 | ///
55 | /// Overrides the current thread's CurrentUICulture property for all
56 | /// resource lookups using this strongly typed resource class.
57 | ///
58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59 | internal static global::System.Globalization.CultureInfo Culture
60 | {
61 | get
62 | {
63 | return resourceCulture;
64 | }
65 | set
66 | {
67 | resourceCulture = value;
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/WebKitWpfTest/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/WebKitWpfTest/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.1
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace WebKitWpfTest.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/WebKitWpfTest/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/WebKitWpfTest/WebKitWpfTest.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | x86
6 | 8.0.30703
7 | 2.0
8 | {AFEB7955-0F8D-441B-8185-B8B337EE627A}
9 | WinExe
10 | Properties
11 | WebKitWpfTest
12 | WebKitWpfTest
13 | v4.0
14 | Client
15 | 512
16 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
17 | 4
18 |
19 |
20 | x86
21 | true
22 | full
23 | false
24 | bin\Debug\
25 | DEBUG;TRACE
26 | prompt
27 | 4
28 |
29 |
30 | x86
31 | pdbonly
32 | true
33 | bin\Release\
34 | TRACE
35 | prompt
36 | 4
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | 4.0
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 | MSBuild:Compile
56 | Designer
57 |
58 |
59 | MSBuild:Compile
60 | Designer
61 |
62 |
63 | App.xaml
64 | Code
65 |
66 |
67 | MainWindow.xaml
68 | Code
69 |
70 |
71 |
72 |
73 | Code
74 |
75 |
76 | True
77 | True
78 | Resources.resx
79 |
80 |
81 | True
82 | Settings.settings
83 | True
84 |
85 |
86 | ResXFileCodeGenerator
87 | Resources.Designer.cs
88 |
89 |
90 | SettingsSingleFileGenerator
91 | Settings.Designer.cs
92 |
93 |
94 |
95 |
96 |
103 |
--------------------------------------------------------------------------------
/bin/.gitignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lanwin/webkitdotnet/2431d81f74bb2725c6ffd99b1eaf60de3ad4e0a7/bin/.gitignore
--------------------------------------------------------------------------------
/docs/.gitignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lanwin/webkitdotnet/2431d81f74bb2725c6ffd99b1eaf60de3ad4e0a7/docs/.gitignore
--------------------------------------------------------------------------------
/webkit/.gitignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lanwin/webkitdotnet/2431d81f74bb2725c6ffd99b1eaf60de3ad4e0a7/webkit/.gitignore
--------------------------------------------------------------------------------