Permalink
Browse files

Added progress bar to WebKitBrowserTest.

  • Loading branch information...
1 parent 935b84a commit b2bd1c53aae4ce3e08fffdda62922a0cb2c70204 @herbmillerjr herbmillerjr committed Mar 18, 2011
View
6 JSCore.sln
@@ -1,7 +1,7 @@

-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual C++ Express 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "JSCore", "JSCore\JSCore.vcxproj", "{287EEE45-1390-44D5-982F-0B96D4A077DA}"
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual C++ Express 2008
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "JSCore", "JSCore\JSCore.vcproj", "{287EEE45-1390-44D5-982F-0B96D4A077DA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
View
163 WebKit.NET.sln
@@ -1,78 +1,85 @@
-
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebKitBrowser", "WebKitBrowser\WebKitBrowser.csproj", "{44AFE214-12C7-4280-898D-A7C4AABF1533}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebKitBrowserTest", "WebKitBrowserTest\WebKitBrowserTest.csproj", "{0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{9A0D75E0-65F8-4777-B5A0-B84937944551}"
- ProjectSection(SolutionItems) = preProject
- LICENSE.txt = LICENSE.txt
- LocalTestRun.testrunconfig = LocalTestRun.testrunconfig
- README.txt = README.txt
- WebKit.NET.vsmdi = WebKit.NET.vsmdi
- WebKitBrowserDoc.shfbproj = WebKitBrowserDoc.shfbproj
- EndProjectSection
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebKitCore", "WebKitCore\WebKitCore.csproj", "{D1C8CE15-4279-45DA-989A-54561E0FD842}"
- ProjectSection(ProjectDependencies) = postProject
- {287EEE45-1390-44D5-982F-0B96D4A077DA} = {287EEE45-1390-44D5-982F-0B96D4A077DA}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "JSCore", "JSCore\JSCore.vcproj", "{287EEE45-1390-44D5-982F-0B96D4A077DA}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Debug|Mixed Platforms = Debug|Mixed Platforms
- Debug|Win32 = Debug|Win32
- Release|Any CPU = Release|Any CPU
- Release|Mixed Platforms = Release|Mixed Platforms
- Release|Win32 = Release|Win32
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {44AFE214-12C7-4280-898D-A7C4AABF1533}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {44AFE214-12C7-4280-898D-A7C4AABF1533}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {44AFE214-12C7-4280-898D-A7C4AABF1533}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {44AFE214-12C7-4280-898D-A7C4AABF1533}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {44AFE214-12C7-4280-898D-A7C4AABF1533}.Debug|Win32.ActiveCfg = Debug|Any CPU
- {44AFE214-12C7-4280-898D-A7C4AABF1533}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {44AFE214-12C7-4280-898D-A7C4AABF1533}.Release|Any CPU.Build.0 = Release|Any CPU
- {44AFE214-12C7-4280-898D-A7C4AABF1533}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {44AFE214-12C7-4280-898D-A7C4AABF1533}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {44AFE214-12C7-4280-898D-A7C4AABF1533}.Release|Win32.ActiveCfg = Release|Any CPU
- {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Debug|Win32.ActiveCfg = Debug|Any CPU
- {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Release|Any CPU.Build.0 = Release|Any CPU
- {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Release|Win32.ActiveCfg = Release|Any CPU
- {D1C8CE15-4279-45DA-989A-54561E0FD842}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {D1C8CE15-4279-45DA-989A-54561E0FD842}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {D1C8CE15-4279-45DA-989A-54561E0FD842}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {D1C8CE15-4279-45DA-989A-54561E0FD842}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {D1C8CE15-4279-45DA-989A-54561E0FD842}.Debug|Win32.ActiveCfg = Debug|Any CPU
- {D1C8CE15-4279-45DA-989A-54561E0FD842}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {D1C8CE15-4279-45DA-989A-54561E0FD842}.Release|Any CPU.Build.0 = Release|Any CPU
- {D1C8CE15-4279-45DA-989A-54561E0FD842}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {D1C8CE15-4279-45DA-989A-54561E0FD842}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {D1C8CE15-4279-45DA-989A-54561E0FD842}.Release|Win32.ActiveCfg = Release|Any CPU
- {287EEE45-1390-44D5-982F-0B96D4A077DA}.Debug|Any CPU.ActiveCfg = Debug|Win32
- {287EEE45-1390-44D5-982F-0B96D4A077DA}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
- {287EEE45-1390-44D5-982F-0B96D4A077DA}.Debug|Mixed Platforms.Build.0 = Debug|Win32
- {287EEE45-1390-44D5-982F-0B96D4A077DA}.Debug|Win32.ActiveCfg = Debug|Win32
- {287EEE45-1390-44D5-982F-0B96D4A077DA}.Debug|Win32.Build.0 = Debug|Win32
- {287EEE45-1390-44D5-982F-0B96D4A077DA}.Release|Any CPU.ActiveCfg = Release|Win32
- {287EEE45-1390-44D5-982F-0B96D4A077DA}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {287EEE45-1390-44D5-982F-0B96D4A077DA}.Release|Mixed Platforms.Build.0 = Release|Win32
- {287EEE45-1390-44D5-982F-0B96D4A077DA}.Release|Win32.ActiveCfg = Release|Win32
- {287EEE45-1390-44D5-982F-0B96D4A077DA}.Release|Win32.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
+
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual C# Express 2008
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebKitBrowser", "WebKitBrowser\WebKitBrowser.csproj", "{44AFE214-12C7-4280-898D-A7C4AABF1533}"
+ ProjectSection(ProjectDependencies) = postProject
+ {D1C8CE15-4279-45DA-989A-54561E0FD842} = {D1C8CE15-4279-45DA-989A-54561E0FD842}
+ EndProjectSection
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebKitBrowserTest", "WebKitBrowserTest\WebKitBrowserTest.csproj", "{0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}"
+ ProjectSection(ProjectDependencies) = postProject
+ {44AFE214-12C7-4280-898D-A7C4AABF1533} = {44AFE214-12C7-4280-898D-A7C4AABF1533}
+ {D1C8CE15-4279-45DA-989A-54561E0FD842} = {D1C8CE15-4279-45DA-989A-54561E0FD842}
+ EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{9A0D75E0-65F8-4777-B5A0-B84937944551}"
+ ProjectSection(SolutionItems) = preProject
+ LICENSE.txt = LICENSE.txt
+ LocalTestRun.testrunconfig = LocalTestRun.testrunconfig
+ README.txt = README.txt
+ WebKit.NET.vsmdi = WebKit.NET.vsmdi
+ WebKitBrowserDoc.shfbproj = WebKitBrowserDoc.shfbproj
+ EndProjectSection
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebKitCore", "WebKitCore\WebKitCore.csproj", "{D1C8CE15-4279-45DA-989A-54561E0FD842}"
+ ProjectSection(ProjectDependencies) = postProject
+ {287EEE45-1390-44D5-982F-0B96D4A077DA} = {287EEE45-1390-44D5-982F-0B96D4A077DA}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "JSCore", "JSCore\JSCore.vcproj", "{287EEE45-1390-44D5-982F-0B96D4A077DA}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Debug|Mixed Platforms = Debug|Mixed Platforms
+ Debug|Win32 = Debug|Win32
+ Release|Any CPU = Release|Any CPU
+ Release|Mixed Platforms = Release|Mixed Platforms
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {44AFE214-12C7-4280-898D-A7C4AABF1533}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {44AFE214-12C7-4280-898D-A7C4AABF1533}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {44AFE214-12C7-4280-898D-A7C4AABF1533}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {44AFE214-12C7-4280-898D-A7C4AABF1533}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {44AFE214-12C7-4280-898D-A7C4AABF1533}.Debug|Win32.ActiveCfg = Debug|Any CPU
+ {44AFE214-12C7-4280-898D-A7C4AABF1533}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {44AFE214-12C7-4280-898D-A7C4AABF1533}.Release|Any CPU.Build.0 = Release|Any CPU
+ {44AFE214-12C7-4280-898D-A7C4AABF1533}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {44AFE214-12C7-4280-898D-A7C4AABF1533}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {44AFE214-12C7-4280-898D-A7C4AABF1533}.Release|Win32.ActiveCfg = Release|Any CPU
+ {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Debug|Win32.ActiveCfg = Debug|Any CPU
+ {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Release|Any CPU.Build.0 = Release|Any CPU
+ {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}.Release|Win32.ActiveCfg = Release|Any CPU
+ {D1C8CE15-4279-45DA-989A-54561E0FD842}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D1C8CE15-4279-45DA-989A-54561E0FD842}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D1C8CE15-4279-45DA-989A-54561E0FD842}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {D1C8CE15-4279-45DA-989A-54561E0FD842}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {D1C8CE15-4279-45DA-989A-54561E0FD842}.Debug|Win32.ActiveCfg = Debug|Any CPU
+ {D1C8CE15-4279-45DA-989A-54561E0FD842}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D1C8CE15-4279-45DA-989A-54561E0FD842}.Release|Any CPU.Build.0 = Release|Any CPU
+ {D1C8CE15-4279-45DA-989A-54561E0FD842}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {D1C8CE15-4279-45DA-989A-54561E0FD842}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {D1C8CE15-4279-45DA-989A-54561E0FD842}.Release|Win32.ActiveCfg = Release|Any CPU
+ {287EEE45-1390-44D5-982F-0B96D4A077DA}.Debug|Any CPU.ActiveCfg = Debug|Win32
+ {287EEE45-1390-44D5-982F-0B96D4A077DA}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
+ {287EEE45-1390-44D5-982F-0B96D4A077DA}.Debug|Mixed Platforms.Build.0 = Debug|Win32
+ {287EEE45-1390-44D5-982F-0B96D4A077DA}.Debug|Win32.ActiveCfg = Debug|Win32
+ {287EEE45-1390-44D5-982F-0B96D4A077DA}.Debug|Win32.Build.0 = Debug|Win32
+ {287EEE45-1390-44D5-982F-0B96D4A077DA}.Release|Any CPU.ActiveCfg = Release|Win32
+ {287EEE45-1390-44D5-982F-0B96D4A077DA}.Release|Mixed Platforms.ActiveCfg = Release|Win32
+ {287EEE45-1390-44D5-982F-0B96D4A077DA}.Release|Mixed Platforms.Build.0 = Release|Win32
+ {287EEE45-1390-44D5-982F-0B96D4A077DA}.Release|Win32.ActiveCfg = Release|Win32
+ {287EEE45-1390-44D5-982F-0B96D4A077DA}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
View
9 WebKit.NET_2010.sln
@@ -1,6 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
+# Visual C# Express 2010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{9A0D75E0-65F8-4777-B5A0-B84937944551}"
ProjectSection(SolutionItems) = preProject
LICENSE.txt = LICENSE.txt
@@ -9,8 +9,15 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebKitBrowser", "WebKitBrowser\WebKitBrowser.csproj", "{44AFE214-12C7-4280-898D-A7C4AABF1533}"
+ ProjectSection(ProjectDependencies) = postProject
+ {D1C8CE15-4279-45DA-989A-54561E0FD842} = {D1C8CE15-4279-45DA-989A-54561E0FD842}
+ EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebKitBrowserTest", "WebKitBrowserTest\WebKitBrowserTest.csproj", "{0F92D5BB-D2FC-42D5-8938-7A9D26BF3315}"
+ ProjectSection(ProjectDependencies) = postProject
+ {44AFE214-12C7-4280-898D-A7C4AABF1533} = {44AFE214-12C7-4280-898D-A7C4AABF1533}
+ {D1C8CE15-4279-45DA-989A-54561E0FD842} = {D1C8CE15-4279-45DA-989A-54561E0FD842}
+ EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebKitCore", "WebKitCore\WebKitCore.csproj", "{D1C8CE15-4279-45DA-989A-54561E0FD842}"
EndProject
View
16 WebKitBrowser/WebKitBrowser.csproj
@@ -35,6 +35,8 @@
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
+ <TargetFrameworkSubset>
+ </TargetFrameworkSubset>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -70,8 +72,12 @@
<Reference Include="System.Xml" />
<Reference Include="WebKit.Interop, Version=533.0.0.0, Culture=neutral, PublicKeyToken=b967213f6d29a3be, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <EmbedInteropTypes>False</EmbedInteropTypes>
- <HintPath>..\webkit\WebKit.Interop.dll</HintPath>
+ <EmbedInteropTypes>True</EmbedInteropTypes>
+ <HintPath>..\bin\Debug\WebKit.Interop.dll</HintPath>
+ </Reference>
+ <Reference Include="WebKitCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b967213f6d29a3be, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\bin\Debug\WebKitCore.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
@@ -126,12 +132,6 @@
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\WebKitCore\WebKitCore.csproj">
- <Project>{D1C8CE15-4279-45DA-989A-54561E0FD842}</Project>
- <Name>WebKitCore</Name>
- </ProjectReference>
- </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
View
17 WebKitBrowserTest/WebBrowserTabPage.cs
@@ -43,7 +43,8 @@ public partial class WebBrowserTabPage : TabPage
private StatusStrip statusStrip;
private ToolStripLabel statusLabel;
- private ToolStripLabel iconLabel;
+ private ToolStripLabel iconLabel;
+ private ToolStripProgressBar progressBar;
private ToolStripContainer container;
public WebBrowserTabPage() : this(new WebKitBrowser(), true)
@@ -72,10 +73,15 @@ public WebBrowserTabPage(WebKitBrowser browserControl, bool goHome)
iconLabel = new ToolStripLabel();
iconLabel.Name = "iconLabel";
iconLabel.Text = "No Icon";
- iconLabel.Visible = true;
+ iconLabel.Visible = true;
+
+ progressBar = new ToolStripProgressBar();
+ progressBar.Name = "progressBar";
+ progressBar.Visible = true;
statusStrip.Items.Add(statusLabel);
- statusStrip.Items.Add(iconLabel);
+ statusStrip.Items.Add(iconLabel);
+ statusStrip.Items.Add(progressBar);
container.BottomToolStripPanel.Controls.Add(statusStrip);
@@ -99,7 +105,10 @@ public WebBrowserTabPage(WebKitBrowser browserControl, bool goHome)
browser.DocumentTitleChanged += (s, e) => this.Text = browser.DocumentTitle;
browser.Navigating += (s, e) => statusLabel.Text = "Loading...";
browser.Navigated += (s, e) => { statusLabel.Text = "Downloading..."; };
- browser.DocumentCompleted += (s, e) => { statusLabel.Text = "Done"; };
+ browser.DocumentCompleted += (s, e) => { statusLabel.Text = "Done"; };
+ browser.ProgressStarted += (s, e) => { progressBar.Visible = true; };
+ browser.ProgressChanged += (s, e) => { progressBar.Value = e.ProgressPercentage; };
+ browser.ProgressFinished += (s, e) => { progressBar.Visible = false; };
if (goHome)
browser.Navigate("http://www.google.com");
View
22 WebKitBrowserTest/WebKitBrowserTest.csproj
@@ -32,6 +32,8 @@
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
+ <TargetFrameworkSubset>
+ </TargetFrameworkSubset>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -55,7 +57,7 @@
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
- <Reference Include="JSCore, Version=1.0.4090.818, Culture=neutral, PublicKeyToken=b967213f6d29a3be, processorArchitecture=x86">
+ <Reference Include="JSCore, Version=1.0.4092.42699, Culture=neutral, PublicKeyToken=b967213f6d29a3be, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\bin\Debug\JSCore.dll</HintPath>
</Reference>
@@ -65,6 +67,14 @@
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
+ <Reference Include="WebKitBrowser, Version=0.5.0.0, Culture=neutral, PublicKeyToken=b967213f6d29a3be, processorArchitecture=x86">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\bin\Debug\WebKitBrowser.dll</HintPath>
+ </Reference>
+ <Reference Include="WebKitCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b967213f6d29a3be, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\bin\Debug\WebKitCore.dll</HintPath>
+ </Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="DownloadForm.cs">
@@ -145,16 +155,6 @@
</Compile>
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="..\WebKitBrowser\WebKitBrowser.csproj">
- <Project>{44AFE214-12C7-4280-898D-A7C4AABF1533}</Project>
- <Name>WebKitBrowser</Name>
- </ProjectReference>
- <ProjectReference Include="..\WebKitCore\WebKitCore.csproj">
- <Project>{D1C8CE15-4279-45DA-989A-54561E0FD842}</Project>
- <Name>WebKitCore</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
View
11 WebKitCore/WebKitCore.csproj
@@ -15,6 +15,8 @@
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\WebKit.NET.snk</AssemblyOriginatorKeyFile>
<TargetFrameworkProfile />
+ <TargetFrameworkSubset>
+ </TargetFrameworkSubset>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -34,7 +36,7 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
- <Reference Include="JSCore, Version=1.0.4090.818, Culture=neutral, PublicKeyToken=b967213f6d29a3be, processorArchitecture=x86">
+ <Reference Include="JSCore, Version=1.0.4092.42041, Culture=neutral, PublicKeyToken=b967213f6d29a3be, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\bin\Debug\JSCore.dll</HintPath>
</Reference>
@@ -43,9 +45,9 @@
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
- <Reference Include="WebKit.Interop">
- <HintPath>..\webkit\WebKit.Interop.dll</HintPath>
- <EmbedInteropTypes>False</EmbedInteropTypes>
+ <Reference Include="WebKit.Interop, Version=533.0.0.0, Culture=neutral, PublicKeyToken=b967213f6d29a3be, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\bin\Debug\WebKit.Interop.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
@@ -72,6 +74,7 @@
<None Include="..\WebKit.NET.snk">
<Link>WebKit.NET.snk</Link>
</None>
+ <None Include="app.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
View
1 WebKitCore/WebNotificationObserver.cs
@@ -26,7 +26,6 @@
using System;
using System.Collections.Generic;
-using System.Linq;
using System.Text;
using WebKit;
using WebKit.Interop;
View
7 WebKitCore/WebPolicyDelegate.cs
@@ -51,7 +51,7 @@ public WebPolicyDelegate(bool AllowNavigation, bool AllowDownloads, bool AllowNe
#region IWebPolicyDelegate Members
- public void decidePolicyForMIMEType(WebView WebView, string type, WebURLRequest request, webFrame frame, IWebPolicyDecisionListener listener)
+ public void decidePolicyForMIMEType(WebView WebView, string type, IWebURLRequest request, webFrame frame, IWebPolicyDecisionListener listener)
{
// todo: add support for showing custom MIME type documents
// and for changing which MIME types are handled here
@@ -68,15 +68,15 @@ public void decidePolicyForMIMEType(WebView WebView, string type, WebURLRequest
}
}
- public void decidePolicyForNavigationAction(WebView WebView, CFDictionaryPropertyBag actionInformation, WebURLRequest request, webFrame frame, IWebPolicyDecisionListener listener)
+ public void decidePolicyForNavigationAction(WebView WebView, CFDictionaryPropertyBag actionInformation, IWebURLRequest request, webFrame frame, IWebPolicyDecisionListener listener)
{
if (AllowNavigation || AllowInitialNavigation)
listener.use();
else
listener.ignore();
}
- public void decidePolicyForNewWindowAction(WebView WebView, CFDictionaryPropertyBag actionInformation, WebURLRequest request, string frameName, IWebPolicyDecisionListener listener)
+ public void decidePolicyForNewWindowAction(WebView WebView, CFDictionaryPropertyBag actionInformation, IWebURLRequest request, string frameName, IWebPolicyDecisionListener listener)
{
if (AllowNewWindows)
listener.use();
@@ -89,5 +89,6 @@ public void unableToImplementPolicyWithError(WebView WebView, WebError error, we
}
#endregion
+
}
}
View
177 WebKitCore/WebResourceLoadDelegate.cs
@@ -1,91 +1,90 @@
-/*
- * Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
-*/
-
-// Not used yet. More info at
-// http://developer.apple.com/documentation/Cocoa/Reference/WebKit/Protocols/WebResourceLoadDelegate_Protocol
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using WebKit;
-using WebKit.Interop;
-
-namespace WebKit
-{
- internal class WebResourceLoadDelegate : IWebResourceLoadDelegate
- {
- #region IWebResourceLoadDelegate Members
-
- public void didCancelAuthenticationChallenge(WebView WebView, uint identifier, IWebURLAuthenticationChallenge challenge, IWebDataSource dataSource)
- {
- throw new NotImplementedException();
- }
-
- public void didFailLoadingWithError(WebView WebView, uint identifier, WebError error, IWebDataSource dataSource)
- {
- throw new NotImplementedException();
- }
-
- public void didFinishLoadingFromDataSource(WebView WebView, uint identifier, IWebDataSource dataSource)
- {
- throw new NotImplementedException();
- }
-
- public void didReceiveAuthenticationChallenge(WebView WebView, uint identifier, IWebURLAuthenticationChallenge challenge, IWebDataSource dataSource)
- {
- throw new NotImplementedException();
- }
-
- public void didReceiveContentLength(WebView WebView, uint identifier, uint length, IWebDataSource dataSource)
- {
- throw new NotImplementedException();
- }
-
- public void didReceiveResponse(WebView WebView, uint identifier, WebURLResponse response, IWebDataSource dataSource)
- {
- throw new NotImplementedException();
- }
-
- public void identifierForInitialRequest(WebView WebView, WebURLRequest request, IWebDataSource dataSource, uint identifier)
- {
- throw new NotImplementedException();
- }
-
- public void plugInFailedWithError(WebView WebView, WebError error, IWebDataSource dataSource)
- {
- throw new NotImplementedException();
- }
-
- public WebURLRequest willSendRequest(WebView WebView, uint identifier, WebURLRequest request, WebURLResponse redirectResponse, IWebDataSource dataSource)
- {
- throw new NotImplementedException();
- }
-
- #endregion
+/*
+ * Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+*/
+
+// Not used yet. More info at
+// http://developer.apple.com/documentation/Cocoa/Reference/WebKit/Protocols/WebResourceLoadDelegate_Protocol
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using WebKit;
+using WebKit.Interop;
+
+namespace WebKit
+{
+ internal class WebResourceLoadDelegate : IWebResourceLoadDelegate
+ {
+ #region IWebResourceLoadDelegate Members
+
+ public void didCancelAuthenticationChallenge(WebView WebView, uint identifier, IWebURLAuthenticationChallenge challenge, IWebDataSource dataSource)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void didFailLoadingWithError(WebView WebView, uint identifier, WebError error, IWebDataSource dataSource)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void didFinishLoadingFromDataSource(WebView WebView, uint identifier, IWebDataSource dataSource)
+ {
+ throw new NotImplementedException();
+ }
+ public void didReceiveAuthenticationChallenge(WebView WebView, uint identifier, IWebURLAuthenticationChallenge challenge, IWebDataSource dataSource)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void didReceiveContentLength(WebView WebView, uint identifier, uint length, IWebDataSource dataSource)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void didReceiveResponse(WebView WebView, uint identifier, WebURLResponse response, IWebDataSource dataSource)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void identifierForInitialRequest(WebView WebView, IWebURLRequest request, IWebDataSource dataSource, uint identifier)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void plugInFailedWithError(WebView WebView, WebError error, IWebDataSource dataSource)
+ {
+ throw new NotImplementedException();
+ }
+
+ public IWebURLRequest willSendRequest(WebView WebView, uint identifier, IWebURLRequest request, WebURLResponse redirectResponse, IWebDataSource dataSource)
+ {
+ throw new NotImplementedException();
+ }
+
+ #endregion
- }
-}
+ }
+}
View
739 WebKitCore/WebUIDelegate.cs
@@ -1,369 +1,370 @@
-/*
- * Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
-*/
-
-// Handles events relating to UI changes. More info at
-// http://developer.apple.com/documentation/Cocoa/Reference/WebKit/Protocols/WebUIDelegate_Protocol
-
-// TODO: most of these events aren't used at all (yet). Find out what they
-// do and whether they are actually working in WebKit.
-
-using System;
-using System.Drawing.Printing;
-using WebKit.Interop;
-
-namespace WebKit
-{
- internal delegate void CreateWebViewWithRequestEvent(IWebURLRequest request, out WebView webView);
- internal delegate void RunJavaScriptAlertPanelWithMessageEvent(WebView sender, string message);
- internal delegate int RunJavaScriptConfirmPanelWithMessageEvent(WebView sender, string message);
- internal delegate string RunJavaScriptTextInputPanelWithPromptEvent(WebView sender, string message, string defaultText);
-
- internal class WebUIDelegate : IWebUIDelegate
- {
- public event CreateWebViewWithRequestEvent CreateWebViewWithRequest;
- public event RunJavaScriptAlertPanelWithMessageEvent RunJavaScriptAlertPanelWithMessage;
- public event RunJavaScriptConfirmPanelWithMessageEvent RunJavaScriptConfirmPanelWithMessage;
- public event RunJavaScriptTextInputPanelWithPromptEvent RunJavaScriptTextInputPanelWithPrompt;
-
- private WebKitBrowserCore owner;
-
- public WebUIDelegate(WebKitBrowserCore browser)
- {
- this.owner = browser;
- }
-
- #region IWebUIDelegate Members
-
- public void addCustomMenuDrawingData(WebView sender, int hMenu)
- {
- }
-
- public int canRedo()
- {
- throw new NotImplementedException();
- }
-
- public int canRunModal(WebView WebView)
- {
- throw new NotImplementedException();
- }
-
- public void canTakeFocus(WebView sender, int forward, out int result)
- {
- throw new NotImplementedException();
- }
-
- public int canUndo()
- {
- throw new NotImplementedException();
- }
-
- public void cleanUpCustomMenuDrawingData(WebView sender, int hMenu)
- {
- }
-
- public void contextMenuItemSelected(WebView sender, IntPtr item, CFDictionaryPropertyBag element)
- {
- }
-
- public int contextMenuItemsForElement(WebView sender, CFDictionaryPropertyBag element, int defaultItemsHMenu)
- {
- return owner.IsWebBrowserContextMenuEnabled ? defaultItemsHMenu : 0;
- }
-
- public WebView createModalDialog(WebView sender, WebURLRequest request)
- {
- throw new NotImplementedException();
- }
-
- public WebView createWebViewWithRequest(WebView sender, WebURLRequest request)
- {
- // this should be caught in the WebPolicyDelegate, but isn't in the Cairo build
- if (owner.AllowNewWindows)
- {
- WebView view;
- CreateWebViewWithRequest(request, out view);
- return view;
- }
- else
- {
- return null;
- }
- }
-
- public WebDragDestinationAction dragDestinationActionMaskForDraggingInfo(WebView WebView, IDataObject draggingInfo)
- {
- throw new NotImplementedException();
- }
-
- public WebDragSourceAction dragSourceActionMaskForPoint(WebView WebView, ref tagPOINT point)
- {
- throw new NotImplementedException();
- }
-
- public void drawCustomMenuItem(WebView sender, IntPtr drawItem)
- {
- }
-
- public void drawFooterInRect(WebView WebView, ref tagRECT rect, int drawingContext, uint pageIndex, uint pageCount)
- {
- }
-
- public void drawHeaderInRect(WebView WebView, ref tagRECT rect, int drawingContext)
- {
- }
-
- public string ftpDirectoryTemplatePath(WebView WebView)
- {
- throw new NotImplementedException();
- }
-
- public int hasCustomMenuImplementation()
- {
- throw new NotImplementedException();
- }
-
- public int isMenuBarVisible(WebView WebView)
- {
- throw new NotImplementedException();
- }
-
- public void makeFirstResponder(WebView sender, int responderHWnd)
- {
- }
-
- public void measureCustomMenuItem(WebView sender, IntPtr measureItem)
- {
- }
-
- public void mouseDidMoveOverElement(WebView sender, CFDictionaryPropertyBag elementInformation, uint modifierFlags)
- {
- }
-
- public void paintCustomScrollCorner(WebView WebView, int hDC, tagRECT rect)
- {
- }
-
- public void paintCustomScrollbar(WebView WebView, int hDC, tagRECT rect, WebScrollBarControlSize size, uint state, WebScrollbarControlPart pressedPart, int vertical, float value, float proportion, uint parts)
- {
- }
-
- public void printFrame(WebView WebView, webFrame frame)
- {
- }
-
- public void redo()
- {
- }
-
- public void registerUndoWithTarget(IWebUndoTarget target, string actionName, object actionArg)
- {
- }
-
- public void removeAllActionsWithTarget(IWebUndoTarget target)
- {
- }
-
- public int runBeforeUnloadConfirmPanelWithMessage(WebView sender, string message, webFrame initiatedByFrame)
- {
- throw new NotImplementedException();
- }
-
- public int runDatabaseSizeLimitPrompt(WebView WebView, string displayName, webFrame initiatedByFrame)
- {
- throw new NotImplementedException();
- }
-
- public void runJavaScriptAlertPanelWithMessage(WebView sender, string message)
- {
- RunJavaScriptAlertPanelWithMessage(sender, message);
- }
-
- public int runJavaScriptConfirmPanelWithMessage(WebView sender, string message)
- {
- return RunJavaScriptConfirmPanelWithMessage(sender, message);
- }
-
- public string runJavaScriptTextInputPanelWithPrompt(WebView sender, string message, string defaultText)
- {
- return RunJavaScriptTextInputPanelWithPrompt(sender, message, defaultText);
- }
-
- public void runModal(WebView WebView)
- {
- }
-
- public void runOpenPanelForFileButtonWithResultListener(WebView sender, IWebOpenPanelResultListener resultListener)
- {
- }
-
- public void setActionTitle(string actionTitle)
- {
- }
-
- public void setContentRect(WebView sender, ref tagRECT contentRect)
- {
- }
-
- public void setFrame(WebView sender, ref tagRECT frame)
- {
- }
-
- public void setMenuBarVisible(WebView WebView, int visible)
- {
- }
-
- public void setResizable(WebView sender, int resizable)
- {
- }
-
- public void setStatusBarVisible(WebView sender, int visible)
- {
- }
-
- public void setStatusText(WebView sender, string text)
- {
- }
-
- public void setToolbarsVisible(WebView sender, int visible)
- {
- }
-
- public void shouldPerformAction(WebView WebView, uint itemCommandID, uint sender)
- {
- }
-
- public void takeFocus(WebView sender, int forward)
- {
- }
-
- public void trackCustomPopupMenu(WebView sender, int hMenu, ref tagPOINT point)
- {
- }
-
- public void undo()
- {
- }
-
- public int validateUserInterfaceItem(WebView WebView, uint itemCommandID, int defaultValidation)
- {
- throw new NotImplementedException();
- }
-
- public int webViewAreToolbarsVisible(WebView sender)
- {
- throw new NotImplementedException();
- }
-
- public void webViewClose(WebView sender)
- {
- }
-
- public tagRECT webViewContentRect(WebView sender)
- {
- throw new NotImplementedException();
- }
-
- public int webViewFirstResponder(WebView sender)
- {
- throw new NotImplementedException();
- }
-
- public void webViewFocus(WebView sender)
- {
- }
-
- public float webViewFooterHeight(WebView WebView)
- {
- throw new NotImplementedException();
- }
-
- public tagRECT webViewFrame(WebView sender)
- {
- throw new NotImplementedException();
- }
-
- public float webViewHeaderHeight(WebView WebView)
- {
- throw new NotImplementedException();
- }
-
- public int webViewIsResizable(WebView sender)
- {
- throw new NotImplementedException();
- }
-
- public int webViewIsStatusBarVisible(WebView sender)
- {
- return 0;
- }
-
- public tagRECT webViewPrintingMarginRect(WebView WebView)
- {
- PageSettings settings = owner.PageSettings;
-
- // WebKit specifies margins in 1000ths of an inch.
- // PrinterResolution.Y returns 0 for some reason,
- // on Adobe distiller anyway, so we'll use X for the moment.
- int dpi = settings.PrinterResolution.X;
- int marginLeft = settings.Margins.Left;
- int marginRight = settings.Margins.Right;
- int marginTop = settings.Margins.Top;
- int marginBottom = settings.Margins.Bottom;
-
- tagRECT rect = new tagRECT();
- rect.left = marginLeft * 10;
- rect.top = marginTop * 10;
- rect.right = marginRight * 10;
- rect.bottom = marginBottom * 10;
- return rect;
- }
-
- public void webViewShow(WebView sender)
- {
- }
-
- public string webViewStatusText(WebView sender)
- {
- throw new NotImplementedException();
- }
-
- public void webViewUnfocus(WebView sender)
- {
- }
-
- public void willPerformDragDestinationAction(WebView WebView, WebDragDestinationAction action, IDataObject draggingInfo)
- {
- }
-
- public IDataObject willPerformDragSourceAction(WebView WebView, WebDragSourceAction action, ref tagPOINT point, IDataObject pasteboard)
- {
- throw new NotImplementedException();
- }
-
- #endregion
- }
-}
+/*
+ * Copyright (c) 2009, Peter Nelson (charn.opcode@gmail.com)
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+*/
+
+// Handles events relating to UI changes. More info at
+// http://developer.apple.com/documentation/Cocoa/Reference/WebKit/Protocols/WebUIDelegate_Protocol
+
+// TODO: most of these events aren't used at all (yet). Find out what they
+// do and whether they are actually working in WebKit.
+
+using System;
+using System.Drawing.Printing;
+using WebKit.Interop;
+
+namespace WebKit
+{
+ internal delegate void CreateWebViewWithRequestEvent(IWebURLRequest request, out WebView webView);
+ internal delegate void RunJavaScriptAlertPanelWithMessageEvent(WebView sender, string message);
+ internal delegate int RunJavaScriptConfirmPanelWithMessageEvent(WebView sender, string message);
+ internal delegate string RunJavaScriptTextInputPanelWithPromptEvent(WebView sender, string message, string defaultText);
+
+ internal class WebUIDelegate : IWebUIDelegate
+ {
+ public event CreateWebViewWithRequestEvent CreateWebViewWithRequest;
+ public event RunJavaScriptAlertPanelWithMessageEvent RunJavaScriptAlertPanelWithMessage;
+ public event RunJavaScriptConfirmPanelWithMessageEvent RunJavaScriptConfirmPanelWithMessage;
+ public event RunJavaScriptTextInputPanelWithPromptEvent RunJavaScriptTextInputPanelWithPrompt;
+
+ private WebKitBrowserCore owner;
+
+ public WebUIDelegate(WebKitBrowserCore browser)
+ {
+ this.owner = browser;
+ }
+
+ #region IWebUIDelegate Members
+
+ public void addCustomMenuDrawingData(WebView sender, int hMenu)
+ {
+ }
+
+ public int canRedo()
+ {
+ throw new NotImplementedException();
+ }
+
+ public int canRunModal(WebView WebView)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void canTakeFocus(WebView sender, int forward, out int result)
+ {
+ throw new NotImplementedException();
+ }
+
+ public int canUndo()
+ {
+ throw new NotImplementedException();
+ }
+
+ public void cleanUpCustomMenuDrawingData(WebView sender, int hMenu)
+ {
+ }
+
+ public void contextMenuItemSelected(WebView sender, IntPtr item, CFDictionaryPropertyBag element)
+ {
+ }
+
+ public int contextMenuItemsForElement(WebView sender, CFDictionaryPropertyBag element, int defaultItemsHMenu)
+ {
+ return owner.IsWebBrowserContextMenuEnabled ? defaultItemsHMenu : 0;
+ }
+
+ public WebView createModalDialog(WebView sender, IWebURLRequest request)
+ {
+ throw new NotImplementedException();
+ }
+
+ public WebView createWebViewWithRequest(WebView sender, IWebURLRequest request)
+ {
+ // this should be caught in the WebPolicyDelegate, but isn't in the Cairo build
+ if (owner.AllowNewWindows)
+ {
+ WebView view;
+ CreateWebViewWithRequest(request, out view);
+ return view;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public WebDragDestinationAction dragDestinationActionMaskForDraggingInfo(WebView WebView, IDataObject draggingInfo)
+ {
+ throw new NotImplementedException();
+ }
+
+ public WebDragSourceAction dragSourceActionMaskForPoint(WebView WebView, ref tagPOINT point)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void drawCustomMenuItem(WebView sender, IntPtr drawItem)
+ {
+ }
+
+ public void drawFooterInRect(WebView WebView, ref tagRECT rect, int drawingContext, uint pageIndex, uint pageCount)
+ {
+ }
+
+ public void drawHeaderInRect(WebView WebView, ref tagRECT rect, int drawingContext)
+ {
+ }
+
+ public string ftpDirectoryTemplatePath(WebView WebView)
+ {
+ throw new NotImplementedException();
+ }
+
+ public int hasCustomMenuImplementation()
+ {
+ throw new NotImplementedException();
+ }
+
+ public int isMenuBarVisible(WebView WebView)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void makeFirstResponder(WebView sender, int responderHWnd)
+ {
+ }
+
+ public void measureCustomMenuItem(WebView sender, IntPtr measureItem)
+ {
+ }
+
+ public void mouseDidMoveOverElement(WebView sender, CFDictionaryPropertyBag elementInformation, uint modifierFlags)
+ {
+ }
+
+ public void paintCustomScrollCorner(WebView WebView, int hDC, tagRECT rect)
+ {
+ }
+
+ public void paintCustomScrollbar(WebView WebView, int hDC, tagRECT rect, WebScrollBarControlSize size, uint state, WebScrollbarControlPart pressedPart, int vertical, float value, float proportion, uint parts)
+ {
+ }
+
+ public void printFrame(WebView WebView, webFrame frame)
+ {
+ }
+
+ public void redo()
+ {
+ }
+
+ public void registerUndoWithTarget(IWebUndoTarget target, string actionName, object actionArg)
+ {
+ }
+
+ public void removeAllActionsWithTarget(IWebUndoTarget target)
+ {
+ }
+
+ public int runBeforeUnloadConfirmPanelWithMessage(WebView sender, string message, webFrame initiatedByFrame)
+ {
+ throw new NotImplementedException();
+ }
+
+ public int runDatabaseSizeLimitPrompt(WebView WebView, string displayName, webFrame initiatedByFrame)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void runJavaScriptAlertPanelWithMessage(WebView sender, string message)
+ {
+ RunJavaScriptAlertPanelWithMessage(sender, message);
+ }
+
+ public int runJavaScriptConfirmPanelWithMessage(WebView sender, string message)
+ {
+ return RunJavaScriptConfirmPanelWithMessage(sender, message);
+ }
+
+ public string runJavaScriptTextInputPanelWithPrompt(WebView sender, string message, string defaultText)
+ {
+ return RunJavaScriptTextInputPanelWithPrompt(sender, message, defaultText);
+ }
+
+ public void runModal(WebView WebView)
+ {
+ }
+
+ public void runOpenPanelForFileButtonWithResultListener(WebView sender, IWebOpenPanelResultListener resultListener)
+ {
+ }
+
+ public void setActionTitle(string actionTitle)
+ {
+ }
+
+ public void setContentRect(WebView sender, ref tagRECT contentRect)
+ {
+ }
+
+ public void setFrame(WebView sender, ref tagRECT frame)
+ {
+ }
+
+ public void setMenuBarVisible(WebView WebView, int visible)
+ {
+ }
+
+ public void setResizable(WebView sender, int resizable)
+ {
+ }
+
+ public void setStatusBarVisible(WebView sender, int visible)
+ {
+ }
+
+ public void setStatusText(WebView sender, string text)
+ {
+ }
+
+ public void setToolbarsVisible(WebView sender, int visible)
+ {
+ }
+
+ public void shouldPerformAction(WebView WebView, uint itemCommandID, uint sender)
+ {
+ }
+
+ public void takeFocus(WebView sender, int forward)
+ {
+ }
+
+ public void trackCustomPopupMenu(WebView sender, int hMenu, ref tagPOINT point)
+ {
+ }
+
+ public void undo()
+ {
+ }
+
+ public int validateUserInterfaceItem(WebView WebView, uint itemCommandID, int defaultValidation)
+ {
+ throw new NotImplementedException();
+ }
+
+ public int webViewAreToolbarsVisible(WebView sender)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void webViewClose(WebView sender)
+ {
+ }
+
+ public tagRECT webViewContentRect(WebView sender)
+ {
+ throw new NotImplementedException();
+ }
+
+ public int webViewFirstResponder(WebView sender)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void webViewFocus(WebView sender)
+ {
+ }
+
+ public float webViewFooterHeight(WebView WebView)
+ {
+ throw new NotImplementedException();
+ }
+
+ public tagRECT webViewFrame(WebView sender)
+ {
+ throw new NotImplementedException();
+ }
+
+ public float webViewHeaderHeight(WebView WebView)
+ {
+ throw new NotImplementedException();
+ }
+
+ public int webViewIsResizable(WebView sender)
+ {
+ throw new NotImplementedException();
+ }
+
+ public int webViewIsStatusBarVisible(WebView sender)
+ {
+ return 0;
+ }
+
+ public tagRECT webViewPrintingMarginRect(WebView WebView)
+ {
+ PageSettings settings = owner.PageSettings;
+
+ // WebKit specifies margins in 1000ths of an inch.
+ // PrinterResolution.Y returns 0 for some reason,
+ // on Adobe distiller anyway, so we'll use X for the moment.
+ int dpi = settings.PrinterResolution.X;
+ int marginLeft = settings.Margins.Left;
+ int marginRight = settings.Margins.Right;
+ int marginTop = settings.Margins.Top;
+ int marginBottom = settings.Margins.Bottom;
+
+ tagRECT rect = new tagRECT();
+ rect.left = marginLeft * 10;
+ rect.top = marginTop * 10;
+ rect.right = marginRight * 10;
+ rect.bottom = marginBottom * 10;
+ return rect;
+ }
+
+ public void webViewShow(WebView sender)
+ {
+ }
+
+ public string webViewStatusText(WebView sender)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void webViewUnfocus(WebView sender)
+ {
+ }
+
+ public void willPerformDragDestinationAction(WebView WebView, WebDragDestinationAction action, IDataObject draggingInfo)
+ {
+ }
+
+ public IDataObject willPerformDragSourceAction(WebView WebView, WebDragSourceAction action, ref tagPOINT point, IDataObject pasteboard)
+ {
+ throw new NotImplementedException();
+ }
+
+ #endregion
+
+ }
+}
View
3 WebKitCore/app.config
@@ -0,0 +1,3 @@
+<?xml version="1.0"?>
+<configuration>
+<startup><supportedRuntime version="v2.0.50727"/></startup></configuration>

0 comments on commit b2bd1c5

Please sign in to comment.