Permalink
Browse files

Fix up the WPF browser implementation

  • Loading branch information...
1 parent ba21b86 commit d0938ea99f820919a8cd1bda5094531dd7dbe856 @paulcbetts committed Jan 17, 2012
@@ -10,14 +10,15 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CefSharp.WpfExample</RootNamespace>
<AssemblyName>CefSharp.WpfExample</AssemblyName>
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
+ <TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -42,6 +43,7 @@
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
+ <Reference Include="System.Xaml" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
@@ -94,6 +96,7 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
+ <None Include="app.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
View
@@ -9,6 +9,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CefSharp.Tests", "CefSharp.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CefSharp.Example", "CefSharp.Example\CefSharp.Example.csproj", "{C043FFF7-5F71-4FFC-989A-E09E18548589}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CefSharp.WpfExample", "CefSharp.WpfExample\CefSharp.WpfExample.csproj", "{4828DAEC-EF99-4553-B674-4374F77C6D66}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -59,6 +61,16 @@ Global
{C043FFF7-5F71-4FFC-989A-E09E18548589}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{C043FFF7-5F71-4FFC-989A-E09E18548589}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{C043FFF7-5F71-4FFC-989A-E09E18548589}.Release|Win32.ActiveCfg = Release|Any CPU
+ {4828DAEC-EF99-4553-B674-4374F77C6D66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {4828DAEC-EF99-4553-B674-4374F77C6D66}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {4828DAEC-EF99-4553-B674-4374F77C6D66}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {4828DAEC-EF99-4553-B674-4374F77C6D66}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {4828DAEC-EF99-4553-B674-4374F77C6D66}.Debug|Win32.ActiveCfg = Debug|Any CPU
+ {4828DAEC-EF99-4553-B674-4374F77C6D66}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {4828DAEC-EF99-4553-B674-4374F77C6D66}.Release|Any CPU.Build.0 = Release|Any CPU
+ {4828DAEC-EF99-4553-B674-4374F77C6D66}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {4828DAEC-EF99-4553-B674-4374F77C6D66}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {4828DAEC-EF99-4553-B674-4374F77C6D66}.Release|Win32.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -130,7 +130,6 @@ namespace CefSharp
GetClientRect(hWnd, &rect);
windowInfo.SetAsChild(hWnd, rect);
-
CefBrowser::CreateBrowser(windowInfo, static_cast<CefRefPtr<CefClient>>(ptr), urlStr, *_settings->_browserSettings);
}
}
@@ -131,6 +131,7 @@
<ClCompile Include="BindingHandler.cpp" />
<ClCompile Include="CefFormsWebBrowser.cpp" />
<ClCompile Include="CefSharp.cpp" />
+ <ClCompile Include="CefWpfWebBrowser.cpp" />
<ClCompile Include="ClientAdapter.cpp" />
<ClCompile Include="JsTask.cpp" />
<ClCompile Include="Request.cpp" />
@@ -144,12 +145,14 @@
</ClCompile>
<ClCompile Include="StreamAdapter.cpp" />
<ClCompile Include="Utils.cpp" />
+ <ClCompile Include="WpfClientAdapter.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="BindingHandler.h" />
<ClInclude Include="BrowserSettings.h" />
<ClInclude Include="CefFormsWebBrowser.h" />
<ClInclude Include="CefSharp.h" />
+ <ClInclude Include="CefWpfWebBrowser.h" />
<ClInclude Include="ClientAdapter.h" />
<ClInclude Include="IAfterResponse.h" />
<ClInclude Include="IBeforeMenu.h" />
@@ -168,6 +171,7 @@
<ClInclude Include="Stdafx.h" />
<ClInclude Include="StreamAdapter.h" />
<ClInclude Include="Utils.h" />
+ <ClInclude Include="WpfClientAdapter.h" />
</ItemGroup>
<ItemGroup>
<None Include="app.ico" />
@@ -19,12 +19,15 @@ namespace CefSharp
return false;
}
- void WpfClientAdapter::OnPaint(CefRefPtr<CefBrowser> browser, PaintElementType type, const CefRect& dirtyRect, const void* buffer)
+ void WpfClientAdapter::OnPaint(CefRefPtr<CefBrowser> browser, PaintElementType type, const RectList& dirtyRects, const void* buffer)
{
int width, height;
browser->GetSize(type, width, height);
+ CefRect dummy;
- _wpfBrowserControl->SetBuffer(width, height, dirtyRect, buffer);
+ // NB: We don't actually use dirtyRect, we rerender the entire buffer
+ // in the SetBuffer call regardless
+ _wpfBrowserControl->SetBuffer(width, height, dummy, buffer);
}
void WpfClientAdapter::OnCursorChange(CefRefPtr<CefBrowser> browser, CefCursorHandle cursor)
@@ -31,7 +31,7 @@ namespace CefSharp
virtual bool GetScreenPoint(CefRefPtr<CefBrowser> browser, int viewX, int viewY, int& screenX, int& screenY) OVERRIDE;
//virtual void OnPopupShow(CefRefPtr<CefBrowser> browser, bool show) OVERRIDE;
//virtual void OnPopupSize(CefRefPtr<CefBrowser> browser, const CefRect& rect) OVERRIDE;
- virtual void OnPaint(CefRefPtr<CefBrowser> browser, PaintElementType type, const CefRect& dirtyRect, const void* buffer) OVERRIDE;
+ virtual void OnPaint(CefRefPtr<CefBrowser> browser, PaintElementType type, const RectList& dirtyRects, const void* buffer) OVERRIDE;
virtual void OnCursorChange(CefRefPtr<CefBrowser> browser, CefCursorHandle cursor) OVERRIDE;
IMPLEMENT_LOCKING(WpfClientAdapter);

0 comments on commit d0938ea

Please sign in to comment.