Commit Graph

54 Commits

Author SHA1 Message Date
Alex Maitland 65534275b7 Core - Upgrade to newer SDK Style project
- Upgrade CefSharp.Core.csproj
- Upgrade CefSharp.csproj
- Ensure pdbs are generated for release builds with same settings as before

Issue #3791
2021-09-20 11:32:14 +10:00
Alex Maitland 172ee5afe8 Migrate from GitLink to Source link
Resolves #3036
2021-09-07 12:08:56 +10:00
Alex Maitland e4e0f22ca7 WinForms/WPF/OffScreen - Upgrade to SDK style projects and multi-target net452 and net462
Haven't tested the output nuget packages yet, we might still need to change the nuspec files to add a
dependency group.

Issue #3791
2021-09-05 15:09:35 +10:00
Alex Maitland d350cad52a Update to M93 (#3781)
* Upgrade to CEF 93.1.7+g9117d6a+chromium-93.0.4577.42 / Chromium 93.0.4577.42

- Core - Add basic ref counting implementation

IMPLEMENT_REFCOUNTING implementation uses atomic which
forces the VC++ compiler to compile as native which doesn't work for our managed ref classes.

    - Use InterlockedCompareExchange for custom ref count reads
    - Use InterlockedIncrement/InterlockedDecrement directly
    - There's no memory barrier for HasOneRef/HasAtLeastOneRef as the read of a LONG should happen in one operation
on 32/64 bit architectures (at least that's my understanding at this point in time).

    References:
    https://github.com/chromiumembedded/cef/blob/4472/include/base/internal/cef_atomicops_x86_msvc.h#L125
    https://github.com/chromiumembedded/cef/blob/4472/include/base/internal/cef_atomicops_arm64_msvc.h#L107
    https://github.com/chromiumembedded/cef/blob/4472/include/base/cef_atomic_ref_count.h#L114
    https://github.com/chromiumembedded/cef/blob/4472/include/cef_base.h#L91

-  Remove Microsoft.Net.Compilers package from projects
Now that we require a min of VS2019 to build there's no need for a custom compiler package
- Start removing VS2015/VC++2015 references
- Remove RegisterWidevineCdm
This is a breaking change. CEF will now automatically download the Widevine CDM component
Resolves #3767

- RequestContext.LoadExtension now uses managed to code spawn on CEF UI Thread
Avoid having to use cef_callback.h which was causing problems for x86 builds
2021-09-03 10:51:18 +10:00
Alex Maitland 8a367fbdc4 Refactor CefSharp.Core into CefSharp.Core.Runtime (#3311)
* Net Core - Rename CefSharp.Core.dll to CefSharp.Core.Runtime.dll

Partial rename, only Net Core, folder not renamed

* Net Core - Rename CefSharp.Core.RefAssembly to CefSharp.Core.netcore

Remove GenApi

* Core - Rename CefDragDataWrapper to DragData

Move into CefSharp.Core namespace

* WinForms/WPF/OffScreen - Migrate from GitLink command line to Nuget package

* Net Core - Refactor to have CefSharp.Core.dll contain only public Api

* Net Core - Remove CefSharp.Core.RefAssembly

* Net Core - Change CefSharp.Core.netcore output folder

* Net Core - Restructure nuget packages

* Net Core - Add Cefsharp.Core.Runtime.RefAssembly

* Net Core - Hide CLI/C++ classes from intellisense

Make sure users don't attempt to load them directly

* Rename CefSharp.Core to CefSharp.Core.Runtime

* Core - Restructure Net 4.5.2 packages to use CefSharp.Core.dll anycpu variant

Attempt to load CefSharp.Core.Runtime at runtime rather than having to use msbuild to copy the correct version

* Rename CefSharp.Core.netcore to CefSharp.Core

* WPF/WinForms/OffScreen - Change from x86/64 to AnyCPU

As they are all managed assemblies they can target AnyCPU.
Includes CefSharp.dll

* Convert RequestContextBuilder from C++ to C#

Now part of the CefSharp.Core PublicApi

* Update version number to 87.1.11

* Migrate more of the public Api to C#

* Net Core - Basic restructure complete

* Net Core - ModuleInitializer (Doesn't work yet)

* Remove direct references to BrowserSettings

* Net Core - ModuleInitializer load CefShar.Core.Runtime.dl

* Net Core - Load libcef.dll via CLR Module initializer

If no RID is specified then we can load libcef.dll using the module initializer

* Add version to CefSharp.Core

* Remove dependency on CefSharp.Core.Runtime
Rewrite common targets

* AnyCPU app.config transform

Improve AnyCPU support

* Improve Net Core 3 support
Only delete CefSharp.Core.Runtime.dll when AnyCPU

* Nuget - Add CefSharp.Core.Runtime reference when TargetFramework = NetCore

* Fix Typos

Based on #3306

* Net Core - Rename CefSharp.Core.Runtime RefAssembly source file

* Net Full - Generate CefSharp.Core.Runtime Ref Assembly

For now the powershell build script generates the .cs file based on a x86 release build.ps1
It's not possible to directly install GenApi as it requires a Sdk style project

* Net Core - Old packages copy files to required folders

* Test - Install newer .Net Compiler and set Lang Version to 7.3

* Net Core - Exclude Net 452 Runtime generated reference source

* Core - Add Refactoring TODO

* Ref Assembly - Generate source as part of build

- Move ref assembly source generate into GenerateRefAssemblySource.ps1
- Call before project build

Runs locally, see if Appveyor has a problem with the powershell script execution

* Core - Add more factory methods to create instances of managed wrappers

* Net Core - Make Initialzier properties internal

Not quite sure what the public API should look like as yet, so making internal for now.
2020-12-16 10:47:34 +10:00
Alex Maitland c0ef404213 Core - VS2019 Invalid option '7.3' for /langversion
When building CefSharp3.sln under VS2019 the Microsoft.Net.Compilers (version 2.4) is passed version 7.3 for c# version
Version 2.4 supports a maximum of version 7.1, the issue doesn't happen on VS2015 or VS2017
Hard code LangVersion in csproj files

CS1617	Invalid option '7.3' for /langversion; must be ISO-1, ISO-2, Default, Latest or a valid version in range 1 to 7.1.

https://stackoverflow.com/questions/46419760/using-c-sharp-7-1-with-msbuild
2020-11-06 13:13:28 +10:00
amaitland fb289d49d8 WPF - Add AllocHGlobalWritableBitmapRenderHandler
A port of WritableBitmapRenderHandler to use Marshal.AllocHGlobal instead of MemoryMappedFile

Remove disable-gpu-compositing command line arg

Resovles #3114
2020-10-28 15:39:33 +10:00
amaitland 59b8e7fbdd WPF - Default to using WritableBitmapRenderHandler for DPI 100%
- No longer use InteropBitmapRenderHandler as the default (InteropBitmap doesn't support DPI scaling).
- Remove old IncreaseBufferInteropRenderHandler as reusing the buffer causing glitching as detailed in https://github.com/cefsharp/CefSharp/issues/3114#issuecomment-717334316

Issue #3114
2020-10-28 13:42:01 +10:00
amaitland 3372ce8a57 Build - Generate Ref Assemblies for .Net 4.5.2 assemblies
Only for Release builds.

This appears to work as expected under VS2017, not sure about VS2015
Roslny .Net compiler upgraded to 2.4 allows for Ref Assembly generation
2020-10-21 18:10:04 +10:00
amaitland 5d4897f4c6 Core - Add Microsoft.Net.Compilers 2.4
This is the last version to support .Net 4.5.2
Set allowedVersions="2.4"  to stop from updating to a newer version which won't compile under VS2015
2020-10-21 17:55:29 +10:00
amaitland 0183c429e0 WPF/WinForms/OffScreen - Reduce Code Duplication Initial
- Add ChromiumWebBrowser.Partial.cs and include in all three projects
- Remove InternalsVisibleTo from Cefsharp.dll start moving code into the partial class
  (We don't want to publish our internals as part of our Ref Assembly so this goings together)

#3082
#3197
2020-08-07 14:24:07 +10:00
amaitland da8ad192a4 WPF - Add Experimental Accessibility Handler 2020-07-27 20:32:24 +10:00
amaitland 57ab2ec982 WPF - Add CompositionTargetRenderHandler (experimental) 2019-12-13 21:07:25 +10:00
amaitland 55c825efdc WPF - Add new DirectWritableBitmapRenderHandler implementation
Use as default when MultiThreadedMessageLoop = false
2019-09-07 15:41:13 +10:00
Alex Maitland 002edfb058 WPF - Add IME Support (#2757)
* WPF - Add initial IME implementation

* WPF - WpfImeKeyboardHandler handler code cleanup

- Restructure ImeHandler to be a static class as it really didn't maintain any state, now hwnd is passed in as param
- Renamed many of the methods to Ime for consistency (IME in all caps doesn't patch the naming convention used)
- The WpfIMEKeyboardHandler implementation is pretty much self contained now, only a single reference in ChromiumWebBrowser
also moved into Experimental folder/namespace
2019-05-04 12:32:38 +10:00
amaitland 3d14f19867 WPF - Add Experimental ChromiumWebBrowserWithTouchSupport
Based on #2745

Original author https://github.com/GSonofNun
2019-04-26 08:14:45 +10:00
amaitland cddece0cdc WPF - Add VirtualKeyboardRequested and corresponding VirtualKeyboardRequestedEventArgs 2019-04-06 11:48:33 +10:00
João Neves 6692749728 WPF - Implement UpdateDragCursor (#2691)
* Close cefsharp subprocess if main process dies

* Implemented UpdateDragCursor

* Fixed braces position

* Added license header

* Fixed cursor flickering

* Added test

* Fixed build

* Fixed move cursor

* Fixed braces

* Simplified solution

* Fixed dropping Link effect

* Fixed encoding + Removed leftovers
2019-04-05 11:58:27 +10:00
Chris 5c292cd707 WPF - Refactor RenderHandler implementations (#2652)
* WPF - Refactored the RenderHandler implementations

* Added a AbstractRenderHandler
* Refactored the RenderHandlers to inherit from AbstractRenderHandler
* Implemented the correct and thread safe dispose pattern

* WPF - AbstractRenderHandler updated xml documentation

* WPF - ByteArrayWritableBitmapRenderHandler: Removed incorrect PixelFormat

* WPF - AbstractRenderHandler: Added missing GC.SuppressFinalize
2019-03-01 13:03:52 +10:00
amaitland a10a5ef897 WPF - ChromiumWebBrowser.GetScreenInfo provide Rect and AvailableRect
Get monitor info based on handle (hwnd).

It's unclear if the coordinates need to be dpi scaled, revisit later if they do
2018-10-29 20:13:02 +10:00
amaitland 308603e788 Merge branch 'wpf/basecontrolandpopupchange' of https://github.com/amaitland/CefSharp 2018-08-02 18:23:04 +10:00
amaitland d87e795000 WinForms/Wpf/OffScreen - Create specific CefSettings class for each version
- This is a breaking change as there is no common `CefSharp.CefSettings`, there is no `CefSharp.Wpf.CefSettings`, `CefSharp.WinForms.CefSettings` and `CefSharp.OffScreen.CefSettings`
 - Cef.Initialize has been removed, the `ChromiumWebBrowser` constructor will call the `Cef.Initialize` with the defaults for your flavour
 - CefSettings.FocusedNodeChangedEnabled has been moved to CefSharpSettings.FocusedNodeChangedEnabled

Resolves #2477
2018-08-02 10:47:12 +10:00
amaitland b97c0c54b5 WPF - Add ByteArrayWritableBitmapRenderHandler
Copies every bitmap into a unique byte[], no locking is used.
Will use lots of memory
2018-04-05 16:53:55 +10:00
amaitland 895ad8d94f WPF OSR - Rename IBitmapFactory to IRenderHandler
At some point it would be nice to expose the whole of the CefRenderHandler API, this should at some point make that easier.

Issue #2237
2018-03-21 14:36:30 +10:00
amaitland 73894a592d WPF OSR Rendering - InteropBitmapFactory split the experimental resize on increase option into IncreaseBufferInteropBitmapFactory
Also some minor threading improvements and buffer validation (check if closed and invalid)
2018-03-18 00:07:37 +10:00
amaitland a2451960d3 WPF IWpfKeyboardHandler Changes
- Make public so users can implement their own handler (the OSR IME patch can be rewritten as a IWpfKeyboardHandler)
- Formatting for consistency
- Make methods virtual

Follow up to #2056
2018-01-18 16:28:53 +10:00
João Neves a845e75432 Prevent accelerator keys to work when typing text (#2056)
* Call correct base method and handle text input in case event wasn't handled
* Removed SourceHook method
* Added previous keyboard handling logic and ability to use it through a property
2018-01-18 16:25:24 +10:00
amaitland c021be6c8d WPF - ChromiumWebBrowser inherits from Control rather than UserControl
Based on #1499

Popup is created in xaml
Canvas used to absolute position the two images, one on top of the other
No Mouse.Capture required
2018-01-18 13:24:29 +10:00
amaitland 127c00554f Rewrite WPF/OffScreen OnPaint
OffScreen
  - Now maintains a raw Byte[] buffer that is used to create the GDI bitmaps
can be overridden and raw buffer access granted (eliminates the forced memory copy to the memory mapped view)

WPF
  - MemoryMappedFile.CreateNew is now used to create the in memory view and copy the buffer
  - InteropBitmapFactory only create new MemoryMappedFile selectively. If the MemoryMappedFile is larger than we require then just reuse it rather than
    releasing then allocating a smaller section of memory that's used for double buffering with InteropBitmap and WritableBitmap
  - Removed CefDirtyRect and used existing Rect class
  - Rename rendering event to Paint, still preferable to implement IBitmapFactory or subclass ChromiumWebBrowser
  - Update ChromiumWebBrowserWithScreenshotSupport to support new rendering method - not very well tested.

Resolves #2237
2018-01-18 11:29:12 +10:00
amaitland 54f7fccdaa Upgrade to .Net 4.5.2
Resolve #1572
2016-05-10 20:28:21 +10:00
amaitland cd322af03d Switch to using SizeChanged event rather than being notified of changes to the ActualWidth and ActualHeight (not really sure the original reason that method was choose)
Remove no longer used DisposableEventWrapper
2016-03-21 08:58:57 +10:00
amaitland 71ce888073 First steps to publishing a symbols package
Add pdb files to nuspec - they're only included when the -symbol flag is used
Add src files to nuspec - they're only included when the -symbol flag is used
Update appveyor.yml to push symbol packages to the MyGet feed
Add -symbol flag to build.ps1 so the symbol packages are generated
WinForms project not outputs pdb files
WinForms release builds are not optimized - probably should have been already
2016-02-26 11:49:52 +10:00
amaitland c00eeb82f5 Remove some stray AnyCPU targets from the csprojcts 2015-11-27 11:35:41 +10:00
amaitland 4a70afeca3 WPF control - move some of the mapping methods into extensions, they could potentially be reused 2015-07-27 11:58:14 +10:00
amaitland bfec2c95b1 Add IBitmapFactory so that different Rendering methods can be plugged in (potentially a .Net 4.5 InteropBitmapInfo can be created)
Move into Rendering namespace
2015-01-29 15:25:08 +10:00
amaitland 899e991a0a First attempt at WritableBitmapInfo implementation - uses dirty rects to determine which part of the screen to update 2015-01-16 14:02:08 +10:00
amaitland c2242e5158 Create another layer of abstraction around BitmapInfo - Allow for future possibility of implementing WritableBitmap in WPF 2015-01-16 12:22:40 +10:00
amaitland 520349d643 Make BitmapInfo abstract and implement a strongly typed version in WPF and OffScreen 2014-12-16 23:19:21 +10:00
amaitland 5f0277033e Remove RenderingEventHandler and replace with generic EventHandler
Take reference to EventHandler in OnRendering before null check - best practice
2014-11-05 11:40:42 +10:00
Bodekaer 705da02d7f Added overridable OnRendering method, to allow parent app to know when the browser is redrawing/updating 2014-11-03 20:56:22 +08:00
amaitland 72517f17f6 Merge remote-tracking branch 'remotes/upstream/master' into JsBinding_WIP 2014-10-07 11:07:19 +10:00
jornh 311cb9c9dd Generate XML documentation for x64/Release builds 2014-10-05 09:38:56 +02:00
Per Lundberg d662860344 Merge branch 'master' into JsBinding_WIP. This was a bit of work but not *that* hard after all. Let's see if it compiles also, but I'll keep any required changes for that in a changeset of its own (so that it's easier to follow for you guys).
Conflicts:
	CefSharp.Core/CefSharp.Core.vcxproj
	CefSharp/CefErrorCode.cs
	CefSharp/CefEventFlags.cs
	CefSharp/CefSettingsBase.cs
	CefSharp/Internals/IWebBrowserInternal.cs
2014-06-12 02:07:27 +03:00
amaitland 305ebfbefb Extract DisposableEventWrapper into separate internal class 2014-06-12 01:21:10 +03:00
Per Lundberg 4b865946c3 Renamed the WPF control also, in line with how System.Windows.Controls.WebBrowser is actually named. 2014-06-02 13:00:03 -07:00
JanEggers 731ebf67a9 reversed subprocess communication now Browser is host and renderer is client 2014-05-24 19:43:34 +02:00
JanEggers 52bfa60c23 remaining stuff that i desired to put in on changeset 2014-03-09 14:11:37 +01:00
Per Lundberg 19f86dfca8 Removed the Debug x64 target, since it shouldn't have been added in the first place... 2013-10-23 22:43:47 +03:00
Per Lundberg 362c6fd3e3 Harmonized the targets so that all projects compile for either x64 or x86. No "AnyCPU" projects for the time being. 2013-10-23 22:38:03 +03:00
Per Lundberg e5f951ae4a Changed to support x64. (and for the time being, unfortunately *only* x64…) A proper Win32 target should also be added asap. 2013-09-23 21:40:46 +02:00