Update CEF documentation

This commit is contained in:
Tobias Taschner 2018-02-20 20:50:33 +01:00
parent 744b68a990
commit 8d5ca40151
No known key found for this signature in database
GPG key ID: AE6ECD71294F87FD
2 changed files with 19 additions and 106 deletions

View file

@ -10,7 +10,7 @@
wxWebViewChromium is a Chromium backend for wxWebView based on the
Chromium Embedded Framework (CEF3). The current CEF3 required version is
3.1750.1738. This backend is available for Windows, Linux and OS X only.
3.3239.1723. This backend is available for Windows, Linux and OS X only.
@section requirements CEF3 Requirements
@ -23,8 +23,7 @@
- C/C++ - Code Generation - Enable C++ Exceptions - Yes
- C/C++ - Language - Enable Run-Time Type Information - Yes
The following release branches of CEF have been tested: 1650, 1750, 1916,
2062 and 2171.
The following release branches of CEF have been tested: 3.3239.1723.
@section instructions Build Instructions
@ -32,24 +31,30 @@
The wxWebViewChromium backend is built into a separate webview_chromium
library which depends on the webview library.
When building with CMake enable wxUSE_WEBVIEW_CHROMIUM and CEF will
automatically downloaded during configuration based on your platform.
For other build systems please follow the following instructions:
Once you have a copy of CEF3, either from compiling it yourself or using
prebuilt binaries you should copy it into `wx_root/src/cef`. To run the
prebuilt binaries you should copy it into `wx_root/3rdparty/cef`. To run the
webview_chromium sample you need to copy the CEF3 resources into the
sample directory. The following files need to be copied:
- The shared objects in the wx_root/src/cef/Debug or
wx_root/src/cef/Release folder, depending on your build type.
- The contents of the wx_root/src/cef/Resources folder.
- The shared objects in the wx_root/3rdparty/cef/Debug or
wx_root/3rdparty/cef/Release folder, depending on your build type.
- The contents of the wx_root/3rdparty/cef/Resources folder.
When building wxWidgets you need to ensure wxWebViewChromium is enabled,
either by passing --enable-webviewchromium for autoconf based builds or
setting wxUSE_WEBVIEW_CHROMIUM equal to 1 in setup.h for Visual Studio
based builds.
__Mac OS X Platform__
OS X 10.8 or above is required.
OS X 10.9 or above is required.
Due to the application bundle structure on OS X, wxWebviewChromium is a
little complicated than on Windows/Linux platforms. An extra helper
@ -94,22 +99,6 @@
| | `-- Resources\
| |-- libwx_osx_cocoau_webviewchromium-3.1.dylib <= wxWebviewChromium library supports webviewChromium backend.
| |-- libwx_osx_cocoau_webview-3.1.dylib <= wxWebview library supports other backends.
| |-- webview_chromium Helper EH.app <= helper app
| | `-- Contents
| | |-- Info.plist
| | |-- MacOS
| | | `-- webview_chromium Helper EH
| | |-- PkgInfo
| | `-- Resources
| | `-- wxmac.icns
| |-- webview_chromium Helper NP.app <= helper app
| | `-- Contents
| | |-- Info.plist
| | |-- MacOS
| | | `-- webview_chromium Helper NP
| | |-- PkgInfo
| | `-- Resources
| | `-- wxmac.icns
| `-- webview_chromium Helper.app <= helper app
| `-- Contents
| |-- Info.plist
@ -136,7 +125,7 @@
- CanUndo/CanRedo/CanCut/CanCopy/CanPaste: returns true
- Find: returns -1
@since 3.1.0
@since 3.1.2
@library{wxwebview_chromium}
@category{webview}
@ -165,85 +154,4 @@ public:
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxWebViewNameStr);
/**
StartUp function
Setup CEF3 environment, creating and initializing browser/renderer processes.
*/
static bool StartUp(int &code, const wxString &path = "");
/**
Shutdown CEF
The function should be called before client application exits.
Since there is a bug of CEF3, the behavior is different between
Mac OS X with Linux/Windows platforms. On Mac OS X, it should
be called in wxFrame::OnClose. On Linux/Windows, it shuold be
called in wxApp::OnExit.
*/
static void Shutdown();
/**
Run the CEF3 message loop once.
The client app using wxWebviewChromium should integrate the CEF message
loop in its own message loop to give CEF3 a chance to run.
Developers can integrate the message loop through the following two ways:
1. Implement wxApp::ProcessIdle
@code
class WebApp
{
bool ProcessIdle()
{
wxWebViewChromium::DoCEFWork();
return wxApp::ProcessIdle();
}
};
@endcode
2. Set a timer to run CEF messageloop each time interval:
@code
class WebFrame: public wxFrame
{
void OnTimer(wxTimerEvent& evt)
{
wxWebViewChromium::DoCEFWork();
}
WebFrame()
{
Connect(wxID_ANY, wxEVT_TIMER, wxTimerEventHandler(WebFrame::OnTimer), NULL, this);
m_timer = new wxTimer(this);
}
wxTimer* m_timer;
};
@endcode
*/
static void DoCEFWork();
};
/**
@class wxWebViewFactoryChromium
A factory class for creating wxWebViewChromium backend.
By default, wxWebViewFactoryChromium is not registered in wxWebView, developer should register the
factory class in wxWebView before using.
@code
wxWebView::RegisterFactory(wxWebViewBackendChromium,
wxSharedPtr<wxWebViewFactory>(new wxWebViewFactoryChromium));
@endcode
*/
class wxWebViewFactoryChromium : public wxWebViewFactory
{
public:
virtual wxWebView* Create();
virtual wxWebView* Create(wxWindow* parent,
wxWindowID id,
const wxString& url = wxWebViewDefaultURLStr,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxWebViewNameStr);
};