wxWebViewChromioum Instructions
wxWebViewChromium is a Chromium backend for wxWebView using the Chromium Embedded Framework(CEF3).
Chromium Embedded Framework: 3.1750.1738
- Windows: 3.1750.1738 or 3.1650.1562
- Linux: 3.1750.1738 or 3.1650.1562
- Mac OS X: 3.1750.1738(64bits)
On Windows platform, you will need to change the vistual stdio building
properties of libcef_dll_wrapper
to consistent with wxWidgets, see following steps:
- C/C++ - General - Treat Warngings as Error - No
- C/C++ - Code Generation - Runtime Library - Multithreaded [Debug] DLL
- C/C++ - Code Generation - Enable C++ Exceptions - Yes
- C/C++ - Language - Enable Run-Time Type Information - Yes
For more details, you can refer to wxWebViewChromium's wiki.
wxWebViewChromium supports Windows/Linux/Mac OS X platforms. For developers who want to use webviewChromium feature, they need to link to webviewchromium library on Windows/Linux platforms(On Mac OS X, they need to do more, see below section).
###Common Steps
-
Clone the repository by running
git clone https://github.com/hokein/wxWidgets.git
-
Copy the CEF3 directory to wxWidgets src directory(wxWidgets sets
<wxWidgets_src>/src/cef
as a default library).
###Windows Platform
By default, wxWidgets provides Visual Stdio 2010 project file to build wxWebViewChromium, and set Chromium Embedded Framework in <wxWidgets_src>/cef
directory.
-
Open
build/msw/wc_vc10.sln
project file in Visual Stdio 2010, and buildwxWidgets
library. -
Open
samples/webview_chromium/webview_chromium_vc10.vcxproj
file in Visual Stdio 2010, and build it. -
Copy CEF3 related resources(libcef.dll, libffmpegsumo.so, locales/*, cef.apk, devtools_resources.pak) to webview_chromium binary directory.
###Linux Platform
By default, wxWebviewChromium feature is disabled in makefile build, you should enable it through enable-webviewchromium
option.
-
Regenerate the building files by running
bakefile_gen -f autoconf
command underbuild/bakefiles
directory. -
Run
./autogen.sh
under<wxWidgets_src>
. -
Run
./configure --enable-webviewchromium
andmake
commands. -
Copy CEF3 related resources as above step5 in windows Platform.
###Mac OS X Platform
wxWidgets supports xcode/makefile builds, requre OS X 10.8 or above.
-
Xcode builds: open
samples/webview_chromium/webview_chromium.xcodeproj
, and buildwebview_chromium
sample target. -
Makefile: the same as linux platform mentioned above.
Due to the application bundle structure on OS X, wxWebviewChromium is a little complicated than win/linux platfroms.
We need an extra helper
application for executing separate other chromim processes(renderer, plugin, etc), so they
have separated app bundles and Info.plist.
For application using webviewChromium, below are details steps, you can retrieve it in webview_chromium.bkl
(samples/webview_chromium/webview_chromium.bkl) files:
-
Build webviewchromium library.
- Use system tool
install_name_tool -change
to correctChromium Embedded Framework.framework/Chromium Embedded Framework
location.
- Use system tool
-
Compiled/link/package the
helper
app:- Require
process_helper_mac.cpp
- Reuqire link frameworks: Chromium Embedded Framework.framework, AppKit.frameworks.
- Reuqire app bundle configuration: Info.plist
- Use system tool
install_name_tool -change
to correctChromium Embedded Framework.framework/Chromium Embedded Framework
location.
- Require
-
Compiled/link/package the
webviewchromium
app:- Require
webview.cpp
- Reuqire link frameworks: Chromium Embedded Framework.framework, AppKit.frameworks.
- Reuqire app bundle configuration: Info.plist
- Use system tool
install_name_tool -change
to correctChromium Embedded Framework.framework/Chromium Embedded Framework
location.
- Require
-
Create a
Contents/Frameworks
directory inwebviewchromium.app
bundle and copyhelper.app
,webviewchromium.dylib
andChromium Embedded Framework
in it. -
Use
samples/webview_chromium/mac/tools/make_more_helper.sh
to make sub-process helper app bundles based onhelper
app.
Below is the wxWebviewChromium sample app bundle directory structure:
webview_chromium.app
`-- Contents
|-- Frameworks
| |-- Chromium Embedded Framework.framework <= CEF framework
| | |-- Chromium Embedded Framework
| | |-- Libraries
| | | `-- ffmpegsumo.so
| | `-- Resources\
| |-- libwx_osx_cocoau_webviewchromium-3.1.dylib <= wxWebviewChromium library supports webviewChromium backend.
| |-- 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
| |-- MacOS
| | `-- webview_chromium Helper
| |-- PkgInfo
| `-- Resources
| `-- wxmac.icns
|-- Info.plist
|-- MacOS
| `-- webview_chromium <= webviewchromium sample executable
|-- PkgInfo
`-- Resources
`-- wxmac.icns <= resources.
##Notes
wxWidgets will set wxWidgets_src/src/cef
directory as default CEF path. If you want to specify your custom CEF path, please follow the steps:
-
Specify your CEF path to
CEF_INCLUDE_DIR
variable inbuild/bakefiles/config.bkl
file. -
Regenerate the building files by running
bakefile_gen -f <formats>
.