diff --git a/.gitignore b/.gitignore index e8320b7403..2cd7359aab 100644 --- a/.gitignore +++ b/.gitignore @@ -298,6 +298,8 @@ /src/*.opt /src/*.plg +/3rdparty/cef + # /src/common/ /src/common/y_tab.c diff --git a/CMakeLists.txt b/CMakeLists.txt index f6ae7f6210..78a7ef6a76 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ # Licence: wxWindows licence ############################################################################# -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.5) if(NOT CMAKE_CONFIGURATION_TYPES) get_property(HAVE_MULTI_CONFIG_GENERATOR GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) diff --git a/Makefile.in b/Makefile.in index d000d08142..6a0147bd26 100644 --- a/Makefile.in +++ b/Makefile.in @@ -66,6 +66,7 @@ EXTRALIBS_OPENGL = @EXTRALIBS_OPENGL@ EXTRALIBS_SDL = @EXTRALIBS_SDL@ EXTRALIBS_STC = @EXTRALIBS_STC@ EXTRALIBS_WEBVIEW = @EXTRALIBS_WEBVIEW@ +EXTRALDFLAGS_WEBVIEW = @EXTRALDFLAGS_WEBVIEW@ WX_CPPFLAGS = @WX_CPPFLAGS@ WX_CFLAGS = @WX_CFLAGS@ WX_CXXFLAGS = @WX_CXXFLAGS@ @@ -1774,21 +1775,24 @@ WEBVIEWDLL_CXXFLAGS = $(__webviewdll_PCH_INC) $(__INC_TIFF_BUILD_p) \ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) \ $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) -DWXBUILDING \ $(__webview_additional_include_wrl_p) $(__webview_additional_include_p) \ - -DWXUSINGDLL -DWXMAKINGDLL_WEBVIEW $(PIC_FLAG) $(WX_CXXFLAGS) \ - $(webview_edge_pragma_warning) $(CPPFLAGS) $(CXXFLAGS) + -DWXUSINGDLL -DWXMAKINGDLL_WEBVIEW -I$(top_srcdir)//3rdparty/cef \ + $(PIC_FLAG) $(WX_CXXFLAGS) $(webview_edge_pragma_warning) $(CPPFLAGS) \ + $(CXXFLAGS) WEBVIEWDLL_OBJCXXFLAGS = $(__webviewdll_PCH_INC) $(__INC_TIFF_BUILD_p) \ $(__INC_TIFF_p) $(__INC_JPEG_p) $(__INC_PNG_p) $(__INC_ZLIB_p) \ $(__INC_REGEX_p) $(__INC_EXPAT_p) $(WX_CPPFLAGS) -D__WX$(TOOLKIT)__ \ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) \ $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) -DWXBUILDING \ $(__webview_additional_include_wrl_p) $(__webview_additional_include_p) \ - -DWXUSINGDLL -DWXMAKINGDLL_WEBVIEW $(PIC_FLAG) $(CPPFLAGS) $(OBJCXXFLAGS) + -DWXUSINGDLL -DWXMAKINGDLL_WEBVIEW -I$(top_srcdir)//3rdparty/cef \ + $(PIC_FLAG) $(CPPFLAGS) $(OBJCXXFLAGS) WEBVIEWDLL_OBJECTS = \ - $(__webviewdll___win32rc) \ $(__WEBVIEW_SRC_PLATFORM_OBJECTS_2) \ webviewdll_webview.o \ webviewdll_webviewarchivehandler.o \ - webviewdll_webviewfshandler.o + webviewdll_webviewfshandler.o \ + webviewdll_common_webview_chromium.o \ + $(__webviewdll___win32rc) WEBVIEWDLL_ODEP = $(_____pch_wxprec_webviewdll_wx_wxprec_h_gch___depname) WEBVIEWLIB_CXXFLAGS = $(__webviewlib_PCH_INC) $(__INC_TIFF_BUILD_p) \ $(__INC_TIFF_p) $(__INC_JPEG_p) $(__INC_PNG_p) $(__INC_ZLIB_p) \ @@ -1796,19 +1800,21 @@ WEBVIEWLIB_CXXFLAGS = $(__webviewlib_PCH_INC) $(__INC_TIFF_BUILD_p) \ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) \ $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) -DWXBUILDING \ $(__webview_additional_include_wrl_p) $(__webview_additional_include_p) \ - $(WX_CXXFLAGS) $(webview_edge_pragma_warning) $(CPPFLAGS) $(CXXFLAGS) + -I$(top_srcdir)//3rdparty/cef $(WX_CXXFLAGS) \ + $(webview_edge_pragma_warning) $(CPPFLAGS) $(CXXFLAGS) WEBVIEWLIB_OBJCXXFLAGS = $(__webviewlib_PCH_INC) $(__INC_TIFF_BUILD_p) \ $(__INC_TIFF_p) $(__INC_JPEG_p) $(__INC_PNG_p) $(__INC_ZLIB_p) \ $(__INC_REGEX_p) $(__INC_EXPAT_p) $(WX_CPPFLAGS) -D__WX$(TOOLKIT)__ \ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) \ $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) -DWXBUILDING \ $(__webview_additional_include_wrl_p) $(__webview_additional_include_p) \ - $(CPPFLAGS) $(OBJCXXFLAGS) + -I$(top_srcdir)//3rdparty/cef $(CPPFLAGS) $(OBJCXXFLAGS) WEBVIEWLIB_OBJECTS = \ $(__WEBVIEW_SRC_PLATFORM_OBJECTS_3) \ webviewlib_webview.o \ webviewlib_webviewarchivehandler.o \ - webviewlib_webviewfshandler.o + webviewlib_webviewfshandler.o \ + webviewlib_common_webview_chromium.o WEBVIEWLIB_ODEP = $(_____pch_wxprec_webviewlib_wx_wxprec_h_gch___depname) QADLL_CXXFLAGS = $(__qadll_PCH_INC) $(__INC_TIFF_BUILD_p) $(__INC_TIFF_p) \ $(__INC_JPEG_p) $(__INC_PNG_p) $(__INC_ZLIB_p) $(__INC_REGEX_p) \ @@ -4051,7 +4057,8 @@ COND_USE_GUI_1_ALL_GUI_HEADERS = \ $(WEBVIEW_HDR_PLATFORM) \ wx/webview.h \ wx/webviewarchivehandler.h \ - wx/webviewfshandler.h + wx/webviewfshandler.h \ + wx/webview_chromium.h @COND_USE_GUI_1@ALL_GUI_HEADERS = $(COND_USE_GUI_1_ALL_GUI_HEADERS) COND_MONOLITHIC_1_SHARED_1___monodll___depname = \ $(LIBDIRNAME)/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(dll___targetsuf3) @@ -4240,6 +4247,7 @@ COND_USE_GUI_1___MONOLIB_GUI_SRC_OBJECTS = \ monodll_webview.o \ monodll_webviewarchivehandler.o \ monodll_webviewfshandler.o \ + monodll_common_webview_chromium.o \ monodll_debugrpt.o \ monodll_dbgrptg.o \ monodll_xh_activityindicator.o \ @@ -5846,7 +5854,8 @@ COND_TOOLKIT_X11___LOWLEVEL_SRC_OBJECTS_1 = \ @COND_TOOLKIT_MSW@__HTML_SRC_PLATFORM_OBJECTS = \ @COND_TOOLKIT_MSW@ monodll_helpbest.o monodll_chm.o @COND_PLATFORM_MACOSX_1@__WEBVIEW_SRC_PLATFORM_OBJECTS \ -@COND_PLATFORM_MACOSX_1@ = monodll_osx_webview_webkit.o +@COND_PLATFORM_MACOSX_1@ = monodll_osx_webview_chromium.o \ +@COND_PLATFORM_MACOSX_1@ monodll_osx_webview_webkit.o @COND_TOOLKIT_GTK@__WEBVIEW_SRC_PLATFORM_OBJECTS = \ @COND_TOOLKIT_GTK@ monodll_gtk_webview_webkit.o monodll_webview_webkit2.o @COND_TOOLKIT_MSW@__WEBVIEW_SRC_PLATFORM_OBJECTS = \ @@ -6004,6 +6013,7 @@ COND_USE_GUI_1___MONOLIB_GUI_SRC_OBJECTS_1 = \ monolib_webview.o \ monolib_webviewarchivehandler.o \ monolib_webviewfshandler.o \ + monolib_common_webview_chromium.o \ monolib_debugrpt.o \ monolib_dbgrptg.o \ monolib_xh_activityindicator.o \ @@ -7610,7 +7620,8 @@ COND_TOOLKIT_X11___LOWLEVEL_SRC_OBJECTS_3 = \ @COND_TOOLKIT_MSW@__HTML_SRC_PLATFORM_OBJECTS_1 = \ @COND_TOOLKIT_MSW@ monolib_helpbest.o monolib_chm.o @COND_PLATFORM_MACOSX_1@__WEBVIEW_SRC_PLATFORM_OBJECTS_1 \ -@COND_PLATFORM_MACOSX_1@ = monolib_osx_webview_webkit.o +@COND_PLATFORM_MACOSX_1@ = monolib_osx_webview_chromium.o \ +@COND_PLATFORM_MACOSX_1@ monolib_osx_webview_webkit.o @COND_TOOLKIT_GTK@__WEBVIEW_SRC_PLATFORM_OBJECTS_1 = \ @COND_TOOLKIT_GTK@ monolib_gtk_webview_webkit.o monolib_webview_webkit2.o @COND_TOOLKIT_MSW@__WEBVIEW_SRC_PLATFORM_OBJECTS_1 = \ @@ -11362,14 +11373,15 @@ COND_USE_SOTWOSYMLINKS_1___webviewdll___so_symlinks_uninst_cmd = rm -f \ COND_USE_SOVERSOLARIS_1___webviewdll___so_symlinks_uninst_cmd = rm -f \ $(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_webview-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX) @COND_USE_SOVERSOLARIS_1@__webviewdll___so_symlinks_uninst_cmd = $(COND_USE_SOVERSOLARIS_1___webviewdll___so_symlinks_uninst_cmd) -@COND_PLATFORM_WIN32_1@__webviewdll___win32rc = webviewdll_version_rc.o @COND_PLATFORM_MACOSX_1@__WEBVIEW_SRC_PLATFORM_OBJECTS_2 \ -@COND_PLATFORM_MACOSX_1@ = webviewdll_osx_webview_webkit.o +@COND_PLATFORM_MACOSX_1@ = webviewdll_osx_webview_chromium.o \ +@COND_PLATFORM_MACOSX_1@ webviewdll_osx_webview_webkit.o @COND_TOOLKIT_GTK@__WEBVIEW_SRC_PLATFORM_OBJECTS_2 = \ @COND_TOOLKIT_GTK@ webviewdll_gtk_webview_webkit.o \ @COND_TOOLKIT_GTK@ webviewdll_webview_webkit2.o @COND_TOOLKIT_MSW@__WEBVIEW_SRC_PLATFORM_OBJECTS_2 = \ @COND_TOOLKIT_MSW@ webviewdll_webview_ie.o webviewdll_webview_edge.o +@COND_PLATFORM_WIN32_1@__webviewdll___win32rc = webviewdll_version_rc.o COND_MONOLITHIC_0_SHARED_0_USE_GUI_1_USE_WEBVIEW_1___webviewlib___depname = \ $(LIBDIRNAME)/$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_webview-$(WX_RELEASE)$(HOST_SUFFIX)$(LIBEXT) @COND_MONOLITHIC_0_SHARED_0_USE_GUI_1_USE_WEBVIEW_1@__webviewlib___depname = $(COND_MONOLITHIC_0_SHARED_0_USE_GUI_1_USE_WEBVIEW_1___webviewlib___depname) @@ -11384,7 +11396,8 @@ COND_MONOLITHIC_0_SHARED_0_USE_GUI_1_USE_WEBVIEW_1___webviewlib___depname = \ @COND_USE_PCH_1@_____pch_wxprec_webviewlib_wx_wxprec_h_gch___depname \ @COND_USE_PCH_1@ = ./.pch/wxprec_webviewlib/wx/wxprec.h.gch @COND_PLATFORM_MACOSX_1@__WEBVIEW_SRC_PLATFORM_OBJECTS_3 \ -@COND_PLATFORM_MACOSX_1@ = webviewlib_osx_webview_webkit.o +@COND_PLATFORM_MACOSX_1@ = webviewlib_osx_webview_chromium.o \ +@COND_PLATFORM_MACOSX_1@ webviewlib_osx_webview_webkit.o @COND_TOOLKIT_GTK@__WEBVIEW_SRC_PLATFORM_OBJECTS_3 = \ @COND_TOOLKIT_GTK@ webviewlib_gtk_webview_webkit.o \ @COND_TOOLKIT_GTK@ webviewlib_webview_webkit2.o @@ -13079,7 +13092,7 @@ distclean: clean @COND_SHARED_0_USE_STC_1@ rm -f $(DESTDIR)$(libdir)/$(LIBPREFIX)wxlexilla$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX)$(LIBEXT) @COND_MONOLITHIC_1_SHARED_1@$(LIBDIRNAME)/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(dll___targetsuf3): $(MONODLL_OBJECTS) $(__wxexpat___depname) $(__wxzlib___depname) $(__wxregex___depname) $(__wxtiff___depname) $(__wxjpeg___depname) $(__wxpng___depname) $(__wxscintilla___depname) $(__wxlexilla___depname) $(__monodll___win32rc) $(__wxscintilla_library_link_DEP) $(__wxlexilla_library_link_DEP) -@COND_MONOLITHIC_1_SHARED_1@ $(SHARED_LD_CXX) $@ $(MONODLL_OBJECTS) $(__wx_0) $(__wx_0) -L$(LIBDIRNAME) $(__monodll___macinstnamecmd) $(__monodll___importlib) $(__monodll___soname_flags) $(WXMACVERSION_CMD) $(LDFLAGS) $(WX_LDFLAGS) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) $(EXTRALIBS_FOR_GUI) $(__LIB_ZLIB_p) $(__LIB_REGEX_p) $(__LIB_EXPAT_p) $(EXTRALIBS_FOR_BASE) $(EXTRALIBS_XML) $(EXTRALIBS_HTML) $(EXTRALIBS_MEDIA) $(EXTRALIBS_STC) $(PLUGIN_ADV_EXTRALIBS) $(EXTRALIBS_WEBVIEW) $(__wxscintilla_library_link_LIBR_1) $(__wxlexilla_library_link_LIBR_1) $(LIBS) +@COND_MONOLITHIC_1_SHARED_1@ $(SHARED_LD_CXX) $@ $(MONODLL_OBJECTS) $(__wx_0) $(__wx_0) -L$(LIBDIRNAME) $(__monodll___macinstnamecmd) $(__monodll___importlib) $(__monodll___soname_flags) $(WXMACVERSION_CMD) $(EXTRALDFLAGS_WEBVIEW) $(LDFLAGS) $(WX_LDFLAGS) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) $(EXTRALIBS_FOR_GUI) $(__LIB_ZLIB_p) $(__LIB_REGEX_p) $(__LIB_EXPAT_p) $(EXTRALIBS_FOR_BASE) $(EXTRALIBS_XML) $(EXTRALIBS_HTML) $(EXTRALIBS_MEDIA) $(EXTRALIBS_STC) $(PLUGIN_ADV_EXTRALIBS) $(EXTRALIBS_WEBVIEW) $(__wxscintilla_library_link_LIBR_1) $(__wxlexilla_library_link_LIBR_1) $(LIBS) @COND_MONOLITHIC_1_SHARED_1@ $(DYLIB_RPATH_POSTLINK) @COND_MONOLITHIC_1_SHARED_1@ @COND_MONOLITHIC_1_SHARED_1@ $(__monodll___so_symlinks_cmd) @@ -13342,8 +13355,8 @@ distclean: clean @COND_MONOLITHIC_0_USE_HTML_1@wxhtml: $(____wxhtml_namedll_DEP) $(____wxhtml_namelib_DEP) -@COND_MONOLITHIC_0_SHARED_1_USE_GUI_1_USE_WEBVIEW_1@$(LIBDIRNAME)/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_webview$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(dll___targetsuf3): $(WEBVIEWDLL_OBJECTS) $(__wxexpat___depname) $(__wxzlib___depname) $(__wxregex___depname) $(__wxtiff___depname) $(__wxjpeg___depname) $(__wxpng___depname) $(__wxscintilla___depname) $(__wxlexilla___depname) $(__webviewdll___win32rc) $(__coredll___depname) $(__basedll___depname) -@COND_MONOLITHIC_0_SHARED_1_USE_GUI_1_USE_WEBVIEW_1@ $(SHARED_LD_CXX) $@ $(WEBVIEWDLL_OBJECTS) -L$(LIBDIRNAME) -L$(LIBDIRNAME) -L$(LIBDIRNAME) $(__webviewdll___macinstnamecmd) $(__webviewdll___importlib) $(__webviewdll___soname_flags) $(WXMACVERSION_CMD) $(LDFLAGS) $(WX_LDFLAGS) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) $(EXTRALIBS_FOR_GUI) $(__LIB_ZLIB_p) $(__LIB_REGEX_p) $(__LIB_EXPAT_p) $(EXTRALIBS_FOR_BASE) -lwx_$(PORTNAME)$(WXUNIVNAME)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_core-$(WX_RELEASE)$(HOST_SUFFIX) -lwx_base$(WXBASEPORT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX) $(EXTRALIBS_WEBVIEW) $(LIBS) +@COND_MONOLITHIC_0_SHARED_1_USE_GUI_1_USE_WEBVIEW_1@$(LIBDIRNAME)/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_webview$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(dll___targetsuf3): $(WEBVIEWDLL_OBJECTS) $(__wxexpat___depname) $(__wxzlib___depname) $(__wxregex___depname) $(__wxtiff___depname) $(__wxjpeg___depname) $(__wxpng___depname) $(__wxscintilla___depname) $(__wxlexilla___depname) $(__coredll___depname) $(__basedll___depname) $(__webviewdll___win32rc) +@COND_MONOLITHIC_0_SHARED_1_USE_GUI_1_USE_WEBVIEW_1@ $(SHARED_LD_CXX) $@ $(WEBVIEWDLL_OBJECTS) -L$(LIBDIRNAME) -L$(LIBDIRNAME) -L$(LIBDIRNAME) $(__webviewdll___macinstnamecmd) $(__webviewdll___importlib) $(__webviewdll___soname_flags) $(WXMACVERSION_CMD) $(EXTRALDFLAGS_WEBVIEW) $(LDFLAGS) $(WX_LDFLAGS) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) $(EXTRALIBS_FOR_GUI) $(__LIB_ZLIB_p) $(__LIB_REGEX_p) $(__LIB_EXPAT_p) $(EXTRALIBS_FOR_BASE) -lwx_$(PORTNAME)$(WXUNIVNAME)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_core-$(WX_RELEASE)$(HOST_SUFFIX) -lwx_base$(WXBASEPORT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX) $(EXTRALIBS_WEBVIEW) $(LIBS) @COND_MONOLITHIC_0_SHARED_1_USE_GUI_1_USE_WEBVIEW_1@ $(DYLIB_RPATH_POSTLINK) @COND_MONOLITHIC_0_SHARED_1_USE_GUI_1_USE_WEBVIEW_1@ @COND_MONOLITHIC_0_SHARED_1_USE_GUI_1_USE_WEBVIEW_1@ $(__webviewdll___so_symlinks_cmd) @@ -16054,6 +16067,9 @@ monodll_gtk_webview_webkit.o: $(srcdir)/src/gtk/webview_webkit.cpp $(MONODLL_ODE monodll_webview_webkit2.o: $(srcdir)/src/gtk/webview_webkit2.cpp $(MONODLL_ODEP) $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/gtk/webview_webkit2.cpp +monodll_osx_webview_chromium.o: $(srcdir)/src/osx/webview_chromium.mm $(MONODLL_ODEP) + $(CXXC) -c -o $@ $(MONODLL_OBJCXXFLAGS) $(srcdir)/src/osx/webview_chromium.mm + monodll_osx_webview_webkit.o: $(srcdir)/src/osx/webview_webkit.mm $(MONODLL_ODEP) $(CXXC) -c -o $@ $(MONODLL_OBJCXXFLAGS) $(srcdir)/src/osx/webview_webkit.mm @@ -16066,6 +16082,9 @@ monodll_webviewarchivehandler.o: $(srcdir)/src/common/webviewarchivehandler.cpp monodll_webviewfshandler.o: $(srcdir)/src/common/webviewfshandler.cpp $(MONODLL_ODEP) $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/webviewfshandler.cpp +monodll_common_webview_chromium.o: $(srcdir)/src/common/webview_chromium.cpp $(MONODLL_ODEP) + $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/webview_chromium.cpp + monodll_debugrpt.o: $(srcdir)/src/common/debugrpt.cpp $(MONODLL_ODEP) $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/debugrpt.cpp @@ -20803,6 +20822,9 @@ monolib_gtk_webview_webkit.o: $(srcdir)/src/gtk/webview_webkit.cpp $(MONOLIB_ODE monolib_webview_webkit2.o: $(srcdir)/src/gtk/webview_webkit2.cpp $(MONOLIB_ODEP) $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/gtk/webview_webkit2.cpp +monolib_osx_webview_chromium.o: $(srcdir)/src/osx/webview_chromium.mm $(MONOLIB_ODEP) + $(CXXC) -c -o $@ $(MONOLIB_OBJCXXFLAGS) $(srcdir)/src/osx/webview_chromium.mm + monolib_osx_webview_webkit.o: $(srcdir)/src/osx/webview_webkit.mm $(MONOLIB_ODEP) $(CXXC) -c -o $@ $(MONOLIB_OBJCXXFLAGS) $(srcdir)/src/osx/webview_webkit.mm @@ -20815,6 +20837,9 @@ monolib_webviewarchivehandler.o: $(srcdir)/src/common/webviewarchivehandler.cpp monolib_webviewfshandler.o: $(srcdir)/src/common/webviewfshandler.cpp $(MONOLIB_ODEP) $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/webviewfshandler.cpp +monolib_common_webview_chromium.o: $(srcdir)/src/common/webview_chromium.cpp $(MONOLIB_ODEP) + $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/webview_chromium.cpp + monolib_debugrpt.o: $(srcdir)/src/common/debugrpt.cpp $(MONOLIB_ODEP) $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/debugrpt.cpp @@ -33013,9 +33038,6 @@ htmllib_htmllbox.o: $(srcdir)/src/generic/htmllbox.cpp $(HTMLLIB_ODEP) @COND_PLATFORM_MACOSX_1@htmllib_chm.o: $(srcdir)/src/html/chm.cpp $(HTMLLIB_ODEP) @COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(HTMLLIB_CXXFLAGS) $(srcdir)/src/html/chm.cpp -webviewdll_version_rc.o: $(srcdir)/src/msw/version.rc $(WEBVIEWDLL_ODEP) - $(WINDRES) -i$< -o$@ $(__INC_TIFF_BUILD_p_54) $(__INC_TIFF_p_54) $(__INC_JPEG_p_54) $(__INC_PNG_p_53) $(__INC_ZLIB_p_67) $(__INC_REGEX_p_65) $(__INC_EXPAT_p_65) --define __WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p_67) $(__DEBUG_DEFINE_p_67) $(__EXCEPTIONS_DEFINE_p_65) $(__RTTI_DEFINE_p_65) $(__THREAD_DEFINE_p_65) --define WXBUILDING --define WXDLLNAME=$(WXDLLNAMEPREFIXGUI)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_webview$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG) $(__RCDEFDIR_p) --include-dir $(top_srcdir)/include $(__webview_additional_include_wrl_p_0) $(__webview_additional_include_p_0) --define WXUSINGDLL --define WXMAKINGDLL_WEBVIEW - webviewdll_webview_ie.o: $(srcdir)/src/msw/webview_ie.cpp $(WEBVIEWDLL_ODEP) $(CXXC) -c -o $@ $(WEBVIEWDLL_CXXFLAGS) $(srcdir)/src/msw/webview_ie.cpp @@ -33028,6 +33050,9 @@ webviewdll_gtk_webview_webkit.o: $(srcdir)/src/gtk/webview_webkit.cpp $(WEBVIEWD webviewdll_webview_webkit2.o: $(srcdir)/src/gtk/webview_webkit2.cpp $(WEBVIEWDLL_ODEP) $(CXXC) -c -o $@ $(WEBVIEWDLL_CXXFLAGS) $(srcdir)/src/gtk/webview_webkit2.cpp +webviewdll_osx_webview_chromium.o: $(srcdir)/src/osx/webview_chromium.mm $(WEBVIEWDLL_ODEP) + $(CXXC) -c -o $@ $(WEBVIEWDLL_OBJCXXFLAGS) $(srcdir)/src/osx/webview_chromium.mm + webviewdll_osx_webview_webkit.o: $(srcdir)/src/osx/webview_webkit.mm $(WEBVIEWDLL_ODEP) $(CXXC) -c -o $@ $(WEBVIEWDLL_OBJCXXFLAGS) $(srcdir)/src/osx/webview_webkit.mm @@ -33040,6 +33065,12 @@ webviewdll_webviewarchivehandler.o: $(srcdir)/src/common/webviewarchivehandler.c webviewdll_webviewfshandler.o: $(srcdir)/src/common/webviewfshandler.cpp $(WEBVIEWDLL_ODEP) $(CXXC) -c -o $@ $(WEBVIEWDLL_CXXFLAGS) $(srcdir)/src/common/webviewfshandler.cpp +webviewdll_common_webview_chromium.o: $(srcdir)/src/common/webview_chromium.cpp $(WEBVIEWDLL_ODEP) + $(CXXC) -c -o $@ $(WEBVIEWDLL_CXXFLAGS) $(srcdir)/src/common/webview_chromium.cpp + +webviewdll_version_rc.o: $(srcdir)/src/msw/version.rc $(WEBVIEWDLL_ODEP) + $(WINDRES) -i$< -o$@ $(__INC_TIFF_BUILD_p_54) $(__INC_TIFF_p_54) $(__INC_JPEG_p_54) $(__INC_PNG_p_53) $(__INC_ZLIB_p_67) $(__INC_REGEX_p_65) $(__INC_EXPAT_p_65) --define __WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p_67) $(__DEBUG_DEFINE_p_67) $(__EXCEPTIONS_DEFINE_p_65) $(__RTTI_DEFINE_p_65) $(__THREAD_DEFINE_p_65) --define WXBUILDING --define WXDLLNAME=$(WXDLLNAMEPREFIXGUI)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_webview$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG) $(__RCDEFDIR_p) --include-dir $(top_srcdir)/include $(__webview_additional_include_wrl_p_0) $(__webview_additional_include_p_0) --define WXUSINGDLL --define WXMAKINGDLL_WEBVIEW --include-dir $(top_srcdir)//3rdparty/cef + webviewlib_webview_ie.o: $(srcdir)/src/msw/webview_ie.cpp $(WEBVIEWLIB_ODEP) $(CXXC) -c -o $@ $(WEBVIEWLIB_CXXFLAGS) $(srcdir)/src/msw/webview_ie.cpp @@ -33052,6 +33083,9 @@ webviewlib_gtk_webview_webkit.o: $(srcdir)/src/gtk/webview_webkit.cpp $(WEBVIEWL webviewlib_webview_webkit2.o: $(srcdir)/src/gtk/webview_webkit2.cpp $(WEBVIEWLIB_ODEP) $(CXXC) -c -o $@ $(WEBVIEWLIB_CXXFLAGS) $(srcdir)/src/gtk/webview_webkit2.cpp +webviewlib_osx_webview_chromium.o: $(srcdir)/src/osx/webview_chromium.mm $(WEBVIEWLIB_ODEP) + $(CXXC) -c -o $@ $(WEBVIEWLIB_OBJCXXFLAGS) $(srcdir)/src/osx/webview_chromium.mm + webviewlib_osx_webview_webkit.o: $(srcdir)/src/osx/webview_webkit.mm $(WEBVIEWLIB_ODEP) $(CXXC) -c -o $@ $(WEBVIEWLIB_OBJCXXFLAGS) $(srcdir)/src/osx/webview_webkit.mm @@ -33064,6 +33098,9 @@ webviewlib_webviewarchivehandler.o: $(srcdir)/src/common/webviewarchivehandler.c webviewlib_webviewfshandler.o: $(srcdir)/src/common/webviewfshandler.cpp $(WEBVIEWLIB_ODEP) $(CXXC) -c -o $@ $(WEBVIEWLIB_CXXFLAGS) $(srcdir)/src/common/webviewfshandler.cpp +webviewlib_common_webview_chromium.o: $(srcdir)/src/common/webview_chromium.cpp $(WEBVIEWLIB_ODEP) + $(CXXC) -c -o $@ $(WEBVIEWLIB_CXXFLAGS) $(srcdir)/src/common/webview_chromium.cpp + qadll_version_rc.o: $(srcdir)/src/msw/version.rc $(QADLL_ODEP) $(WINDRES) -i$< -o$@ $(__INC_TIFF_BUILD_p_54) $(__INC_TIFF_p_54) $(__INC_JPEG_p_54) $(__INC_PNG_p_53) $(__INC_ZLIB_p_67) $(__INC_REGEX_p_65) $(__INC_EXPAT_p_65) --define __WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p_67) $(__DEBUG_DEFINE_p_67) $(__EXCEPTIONS_DEFINE_p_65) $(__RTTI_DEFINE_p_65) $(__THREAD_DEFINE_p_65) --define WXBUILDING --define WXDLLNAME=$(WXDLLNAMEPREFIXGUI)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_qa$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG) $(__RCDEFDIR_p) --include-dir $(top_srcdir)/include --define WXUSINGDLL --define WXMAKINGDLL_QA diff --git a/autoconf_inc.m4 b/autoconf_inc.m4 index acd43d1e67..6c6ba76c12 100644 --- a/autoconf_inc.m4 +++ b/autoconf_inc.m4 @@ -302,6 +302,12 @@ dnl ### begin block 20_COND_MONOLITHIC_0_USE_WEBVIEW_1[../../demos/bombs/bombs.b COND_MONOLITHIC_0_USE_WEBVIEW_1="" fi AC_SUBST(COND_MONOLITHIC_0_USE_WEBVIEW_1) +dnl ### begin block 20_COND_MONOLITHIC_0_USE_WEBVIEW_CHROMIUM_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl] ### + COND_MONOLITHIC_0_USE_WEBVIEW_CHROMIUM_1="#" + if test "x$MONOLITHIC" = "x0" -a "x$USE_WEBVIEW_CHROMIUM" = "x1" ; then + COND_MONOLITHIC_0_USE_WEBVIEW_CHROMIUM_1="" + fi + AC_SUBST(COND_MONOLITHIC_0_USE_WEBVIEW_CHROMIUM_1) dnl ### begin block 20_COND_MONOLITHIC_0_USE_XML_1[wx.bkl] ### COND_MONOLITHIC_0_USE_XML_1="#" if test "x$MONOLITHIC" = "x0" -a "x$USE_XML" = "x1" ; then @@ -362,7 +368,7 @@ dnl ### begin block 20_COND_PLATFORM_MACOSX_0_USE_SOVERSION_1[wx.bkl] ### COND_PLATFORM_MACOSX_0_USE_SOVERSION_1="" fi AC_SUBST(COND_PLATFORM_MACOSX_0_USE_SOVERSION_1) -dnl ### begin block 20_COND_PLATFORM_MACOSX_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_PLATFORM_MACOSX_1[../../demos/bombs/bombs.bkl,../../demos/demos.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/html_samples.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/opengl_samples.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/utils.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_PLATFORM_MACOSX_1="#" if test "x$PLATFORM_MACOSX" = "x1" ; then COND_PLATFORM_MACOSX_1="" @@ -434,6 +440,12 @@ dnl ### begin block 20_COND_PLATFORM_MACOSX_1_USE_SOVERSION_1[wx.bkl] ### COND_PLATFORM_MACOSX_1_USE_SOVERSION_1="" fi AC_SUBST(COND_PLATFORM_MACOSX_1_USE_SOVERSION_1) +dnl ### begin block 20_COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1[../../samples/webview/webview.bkl] ### + COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1="#" + if test "x$PLATFORM_MACOSX" = "x1" -a "x$USE_WEBVIEW_CHROMIUM" = "x1" ; then + COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1="" + fi + AC_SUBST(COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1) dnl ### begin block 20_COND_PLATFORM_OS2_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,wx.bkl] ### COND_PLATFORM_OS2_1="#" if test "x$PLATFORM_OS2" = "x1" ; then @@ -446,7 +458,7 @@ dnl ### begin block 20_COND_PLATFORM_UNIX_0[../../demos/bombs/bombs.bkl,../../de COND_PLATFORM_UNIX_0="" fi AC_SUBST(COND_PLATFORM_UNIX_0) -dnl ### begin block 20_COND_PLATFORM_UNIX_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_PLATFORM_UNIX_1[../../demos/bombs/bombs.bkl,../../demos/demos.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/html_samples.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/opengl_samples.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/utils.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_PLATFORM_UNIX_1="#" if test "x$PLATFORM_UNIX" = "x1" ; then COND_PLATFORM_UNIX_1="" @@ -488,6 +500,12 @@ dnl ### begin block 20_COND_PLATFORM_UNIX_1_USE_PLUGINS_0[wx.bkl] ### COND_PLATFORM_UNIX_1_USE_PLUGINS_0="" fi AC_SUBST(COND_PLATFORM_UNIX_1_USE_PLUGINS_0) +dnl ### begin block 20_COND_PLATFORM_UNIX_1_USE_WEBVIEW_CHROMIUM_1[../../samples/webview/webview.bkl] ### + COND_PLATFORM_UNIX_1_USE_WEBVIEW_CHROMIUM_1="#" + if test "x$PLATFORM_UNIX" = "x1" -a "x$USE_WEBVIEW_CHROMIUM" = "x1" ; then + COND_PLATFORM_UNIX_1_USE_WEBVIEW_CHROMIUM_1="" + fi + AC_SUBST(COND_PLATFORM_UNIX_1_USE_WEBVIEW_CHROMIUM_1) dnl ### begin block 20_COND_PLATFORM_WIN32_0[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_PLATFORM_WIN32_0="#" if test "x$PLATFORM_WIN32" = "x0" ; then @@ -506,7 +524,7 @@ dnl ### begin block 20_COND_PLATFORM_WIN32_0_TOOLKIT_GTK_TOOLKIT_VERSION_4[wx.bk COND_PLATFORM_WIN32_0_TOOLKIT_GTK_TOOLKIT_VERSION_4="" fi AC_SUBST(COND_PLATFORM_WIN32_0_TOOLKIT_GTK_TOOLKIT_VERSION_4) -dnl ### begin block 20_COND_PLATFORM_WIN32_1[../../demos/bombs/bombs.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### +dnl ### begin block 20_COND_PLATFORM_WIN32_1[../../demos/bombs/bombs.bkl,../../demos/demos.bkl,../../demos/forty/forty.bkl,../../demos/fractal/fractal.bkl,../../demos/life/life.bkl,../../demos/poem/poem.bkl,../../samples/access/access.bkl,../../samples/animate/anitest.bkl,../../samples/archive/archive.bkl,../../samples/artprov/artprov.bkl,../../samples/aui/auidemo.bkl,../../samples/calendar/calendar.bkl,../../samples/caret/caret.bkl,../../samples/clipboard/clipboard.bkl,../../samples/collpane/collpane.bkl,../../samples/combo/combo.bkl,../../samples/config/config.bkl,../../samples/console/console.bkl,../../samples/dataview/dataview.bkl,../../samples/debugrpt/debugrpt.bkl,../../samples/dialogs/dialogs.bkl,../../samples/dialup/dialup.bkl,../../samples/display/display.bkl,../../samples/dll/dll.bkl,../../samples/dnd/dnd.bkl,../../samples/docview/docview.bkl,../../samples/dragimag/dragimag.bkl,../../samples/drawing/drawing.bkl,../../samples/erase/erase.bkl,../../samples/event/event.bkl,../../samples/except/except.bkl,../../samples/exec/exec.bkl,../../samples/font/font.bkl,../../samples/fswatcher/fswatcher.bkl,../../samples/grid/grid.bkl,../../samples/help/help.bkl,../../samples/htlbox/htlbox.bkl,../../samples/html/about/about.bkl,../../samples/html/help/help.bkl,../../samples/html/helpview/helpview.bkl,../../samples/html/html_samples.bkl,../../samples/html/printing/printing.bkl,../../samples/html/test/test.bkl,../../samples/html/virtual/virtual.bkl,../../samples/html/widget/widget.bkl,../../samples/html/zip/zip.bkl,../../samples/image/image.bkl,../../samples/internat/internat.bkl,../../samples/ipc/ipc.bkl,../../samples/joytest/joytest.bkl,../../samples/keyboard/keyboard.bkl,../../samples/layout/layout.bkl,../../samples/listctrl/listctrl.bkl,../../samples/mdi/mdi.bkl,../../samples/mediaplayer/mediaplayer.bkl,../../samples/menu/menu.bkl,../../samples/minimal/minimal.bkl,../../samples/nativdlg/nativdlg.bkl,../../samples/notebook/notebook.bkl,../../samples/oleauto/oleauto.bkl,../../samples/opengl/cube/cube.bkl,../../samples/opengl/isosurf/isosurf.bkl,../../samples/opengl/opengl_samples.bkl,../../samples/opengl/penguin/penguin.bkl,../../samples/opengl/pyramid/pyramid.bkl,../../samples/ownerdrw/ownerdrw.bkl,../../samples/popup/popup.bkl,../../samples/power/power.bkl,../../samples/preferences/preferences.bkl,../../samples/printing/printing.bkl,../../samples/propgrid/propgrid.bkl,../../samples/regtest/regtest.bkl,../../samples/render/render.bkl,../../samples/ribbon/ribbon.bkl,../../samples/richtext/richtext.bkl,../../samples/sashtest/sashtest.bkl,../../samples/scroll/scroll.bkl,../../samples/secretstore/secretstore.bkl,../../samples/shaped/shaped.bkl,../../samples/sockets/sockets.bkl,../../samples/sound/sound.bkl,../../samples/splash/splash.bkl,../../samples/splitter/splitter.bkl,../../samples/statbar/statbar.bkl,../../samples/stc/stctest.bkl,../../samples/svg/svgtest.bkl,../../samples/taborder/taborder.bkl,../../samples/taskbar/taskbar.bkl,../../samples/taskbarbutton/taskbarbutton.bkl,../../samples/text/text.bkl,../../samples/thread/thread.bkl,../../samples/toolbar/toolbar.bkl,../../samples/treectrl/treectrl.bkl,../../samples/treelist/treelist.bkl,../../samples/typetest/typetest.bkl,../../samples/uiaction/uiaction.bkl,../../samples/validate/validate.bkl,../../samples/vscroll/vscroll.bkl,../../samples/webrequest/webrequest.bkl,../../samples/webview/webview.bkl,../../samples/widgets/widgets.bkl,../../samples/wizard/wizard.bkl,../../samples/wrapsizer/wrapsizer.bkl,../../samples/xrc/xrcdemo.bkl,../../samples/xti/xti.bkl,../../tests/benchmarks/bench.bkl,../../tests/test.bkl,../../utils/helpview/src/helpview.bkl,../../utils/hhp2cached/hhp2cached.bkl,../../utils/ifacecheck/src/ifacecheck.bkl,../../utils/screenshotgen/src/screenshotgen.bkl,../../utils/utils.bkl,../../utils/wxrc/wxrc.bkl,wx.bkl] ### COND_PLATFORM_WIN32_1="#" if test "x$PLATFORM_WIN32" = "x1" ; then COND_PLATFORM_WIN32_1="" diff --git a/build/bakefiles/Bakefiles.bkgen b/build/bakefiles/Bakefiles.bkgen index 8915f68f4e..79ae3b87ae 100644 --- a/build/bakefiles/Bakefiles.bkgen +++ b/build/bakefiles/Bakefiles.bkgen @@ -229,7 +229,7 @@ gnu - + gnu >$(BUILD_CFG_FILE) @echo USE_STC=$(USE_STC) >>$(BUILD_CFG_FILE) @echo USE_WEBVIEW=$(USE_WEBVIEW) >>$(BUILD_CFG_FILE) + @echo USE_WEBVIEW_CHROMIUM=$(USE_WEBVIEW_CHROMIUM) >>$(BUILD_CFG_FILE) @echo USE_XML=$(USE_XML) >>$(BUILD_CFG_FILE) @echo USE_XRC=$(USE_XRC) >>$(BUILD_CFG_FILE) @echo COMPILER=$(COMPILER) >>$(BUILD_CFG_FILE) diff --git a/build/bakefiles/common.bkl b/build/bakefiles/common.bkl index eae0fe4d8c..5290ca7190 100644 --- a/build/bakefiles/common.bkl +++ b/build/bakefiles/common.bkl @@ -880,7 +880,8 @@ $(TAB)cl /EP /nologo "$(DOLLAR)(InputPath)" > "$(SETUPHDIR)\wx\msw\rcdefs.h" $(wxwin.libToLink(value)) - $(wxwin.extraLdflags(value)) + $(wxwin.extraLdflags(value)) + $(wxwin.extraLdlibs(value)) $(wxwin.makeDspDependency(value)) diff --git a/build/bakefiles/config.bkl b/build/bakefiles/config.bkl index f94121b885..3963e7e3f3 100644 --- a/build/bakefiles/config.bkl +++ b/build/bakefiles/config.bkl @@ -229,6 +229,11 @@ Default is to use debug CRT if and only if BUILD==debug. + + + + + $(TOP_SRCDIR)/3rdparty/cef + diff --git a/build/bakefiles/files.bkl b/build/bakefiles/files.bkl index 204afb5c45..352bcb2414 100644 --- a/build/bakefiles/files.bkl +++ b/build/bakefiles/files.bkl @@ -2671,12 +2671,16 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! src/gtk/webview_webkit.cpp src/gtk/webview_webkit2.cpp - src/osx/webview_webkit.mm + + src/osx/webview_chromium.mm + src/osx/webview_webkit.mm + src/common/webview.cpp src/common/webviewarchivehandler.cpp src/common/webviewfshandler.cpp + src/common/webview_chromium.cpp $(WEBVIEW_SRC_PLATFORM) @@ -2702,6 +2706,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! wx/webview.h wx/webviewarchivehandler.h wx/webviewfshandler.h + wx/webview_chromium.h $(WEBVIEW_HDR_PLATFORM) diff --git a/build/bakefiles/monolithic.bkl b/build/bakefiles/monolithic.bkl index 2505829049..d70a07004f 100644 --- a/build/bakefiles/monolithic.bkl +++ b/build/bakefiles/monolithic.bkl @@ -33,6 +33,7 @@ $(EXTRALIBS_MEDIA) $(EXTRALIBS_STC) $(PLUGIN_MONOLIB_EXTRALIBS) + $(EXTRALDFLAGS_WEBVIEW) $(EXTRALIBS_WEBVIEW) $(wxscintilla_library_link) $(wxlexilla_library_link) diff --git a/build/bakefiles/multilib.bkl b/build/bakefiles/multilib.bkl index 815e65dac0..1a9a454cb4 100644 --- a/build/bakefiles/multilib.bkl +++ b/build/bakefiles/multilib.bkl @@ -183,20 +183,21 @@ $(WEBVIEW_SRC) coredll basedll + $(EXTRALDFLAGS_WEBVIEW) $(EXTRALIBS_WEBVIEW) $(WEBVIEW_HDR) + $(CEF_DIR) $(WEBVIEW_SRC) $(WEBVIEW_HDR) + $(CEF_DIR) - webview=webviewlib+webviewdll - diff --git a/build/bakefiles/wxwin.py b/build/bakefiles/wxwin.py index 2836335f78..bcf1207ffc 100644 --- a/build/bakefiles/wxwin.py +++ b/build/bakefiles/wxwin.py @@ -44,6 +44,10 @@ MAIN_LIBS = ['mono', 'base', 'core', 'adv', 'html', 'xml', 'net', 'webview', LIBS_NOGUI = ['xml', 'net'] LIBS_GUI = ['core', 'adv', 'html', 'gl', 'qa', 'xrc', 'media', 'aui', 'propgrid', 'richtext', 'stc', 'ribbon', 'webview'] +# Additional ld flags +EXTRALDFLAGS = { + 'webview' : '$(EXTRALDFLAGS_WEBVIEW)', +} # Additional libraries that must be linked in: EXTRALIBS = { 'gl' : '$(EXTRALIBS_OPENGL)', @@ -93,6 +97,12 @@ def libToLink(wxlibname): def extraLdflags(wxlibname): + if wxlibname in EXTRALDFLAGS: + return EXTRALDFLAGS[wxlibname] + else: + return '' + +def extraLdlibs(wxlibname): if wxlibname in EXTRALIBS: return EXTRALIBS[wxlibname] else: diff --git a/build/cmake/files.cmake b/build/cmake/files.cmake index 25be771479..80097d10f3 100644 --- a/build/cmake/files.cmake +++ b/build/cmake/files.cmake @@ -2518,6 +2518,7 @@ set(WEBVIEW_CMN_SRC src/common/webview.cpp src/common/webviewarchivehandler.cpp src/common/webviewfshandler.cpp + src/common/webview_chromium.cpp ) set(WEBVIEW_MSW_HDR @@ -2530,6 +2531,7 @@ set(WEBVIEW_CMN_HDR wx/webview.h wx/webviewarchivehandler.h wx/webviewfshandler.h + wx/webview_chromium.h ) set(WEBVIEW_OSX_SHARED_HDR @@ -2539,6 +2541,7 @@ set(WEBVIEW_OSX_SHARED_HDR set(WEBVIEW_OSX_SHARED_SRC src/osx/webview_webkit.mm + src/osx/webview_chromium.mm ) set(WEBVIEW_GTK_HDR @@ -2558,6 +2561,17 @@ set(WEBVIEW_WEBKIT2_EXTENSION_SRC src/gtk/webview_webkit2_extension.cpp ) +set(WEBVIEWCHROMIUM_HDR + wx/webview.h + wx/webview_chromium.h +) +set(WEBVIEWCHROMIUM_SRC + src/common/webview_chromium.cpp +) +set(WEBVIEWCHROMIUM_OSX_SHARED_SRC + src/osx/webview_chromium.mm +) + set(XRC_SRC src/xrc/xh_activityindicator.cpp src/xrc/xh_animatctrl.cpp diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake index f5dab11199..5faa49a806 100644 --- a/build/cmake/init.cmake +++ b/build/cmake/init.cmake @@ -245,9 +245,9 @@ if(wxUSE_MEDIACTRL AND DEFINED wxUSE_ACTIVEX AND NOT wxUSE_ACTIVEX) wx_option_force_value(wxUSE_MEDIACTRL OFF) endif() -if(wxUSE_WEBVIEW AND DEFINED wxUSE_ACTIVEX AND NOT wxUSE_ACTIVEX) - message(WARNING "wxWebView requires wxActiveXContainer... disabled") - wx_option_force_value(wxUSE_WEBVIEW OFF) +if(wxUSE_WEBVIEW AND wxUSE_WEBVIEW_IE AND DEFINED wxUSE_ACTIVEX AND NOT wxUSE_ACTIVEX) + message(WARNING "wxWebViewIE requires wxActiveXContainer... disabled") + wx_option_force_value(wxUSE_WEBVIEW_IE OFF) endif() if(wxUSE_OPENGL) @@ -486,21 +486,32 @@ if(wxUSE_GUI) set(wxUSE_WEBVIEW_WEBKIT ON) elseif(WEBKIT2_FOUND AND LIBSOUP_FOUND) set(wxUSE_WEBVIEW_WEBKIT2 ON) - else() - message(WARNING "webkit not found or enabled, wxWebview won't be available") + elseif(NOT wxUSE_WEBVIEW_CHROMIUM) + message(WARNING "webkit or chromium not found or enabled, wxWebview won't be available") wx_option_force_value(wxUSE_WEBVIEW OFF) endif() elseif(WXMSW) - if(NOT wxUSE_WEBVIEW_IE AND NOT wxUSE_WEBVIEW_EDGE) - message(WARNING "WebviewIE and WebviewEdge not found or enabled, wxWebview won't be available") + if(NOT wxUSE_WEBVIEW_IE AND NOT wxUSE_WEBVIEW_EDGE AND NOT wxUSE_WEBVIEW_CHROMIUM) + message(WARNING "WebviewIE and WebviewEdge and WebviewChromium not found or enabled, wxWebview won't be available") wx_option_force_value(wxUSE_WEBVIEW OFF) endif() elseif(APPLE) - if(NOT wxUSE_WEBVIEW_WEBKIT) - message(WARNING "webkit not found or enabled, wxWebview won't be available") + if(NOT wxUSE_WEBVIEW_WEBKIT AND NOT wxUSE_WEBVIEW_CHROMIUM) + message(WARNING "webkit and chromium not found or enabled, wxWebview won't be available") wx_option_force_value(wxUSE_WEBVIEW OFF) endif() endif() + + if(wxUSE_WEBVIEW_CHROMIUM AND WIN32 AND NOT MSVC) + message(WARNING "WebviewChromium libcef_dll_wrapper can only be built with MSVC... disabled") + wx_option_force_value(wxUSE_WEBVIEW_CHROMIUM OFF) + endif() + if(wxUSE_WEBVIEW_CHROMIUM AND CMAKE_CXX_STANDARD LESS 14) + # We shouldn't disable this option as it's disabled by default and + # if it is on, it means that CEF is meant to be used, but we can't + # continue neither as libcef_dll_wrapper will fail to build. + message(FATAL_ERROR "WebviewChromium requires at least C++14 but configured to use C++${CMAKE_CXX_STANDARD}") + endif() endif() if(wxUSE_PRIVATE_FONTS AND WXGTK) diff --git a/build/cmake/lib/CMakeLists.txt b/build/cmake/lib/CMakeLists.txt index 4b40d7652e..bd234dc13c 100644 --- a/build/cmake/lib/CMakeLists.txt +++ b/build/cmake/lib/CMakeLists.txt @@ -29,8 +29,14 @@ endforeach() # add_opt_lib() # Add library which may have been disabled by wxUSE_... -macro(add_opt_lib name var_name) - if(${var_name}) +macro(add_opt_lib name) + set(add_lib ON) + foreach(var_name ${ARGN}) + if(NOT ${var_name}) + set(add_lib OFF) + endif() + endforeach() + if(add_lib) list(APPEND LIBS ${name}) endif() endmacro() @@ -58,6 +64,7 @@ if(wxUSE_GUI) add_opt_lib(media wxUSE_MEDIACTRL) add_opt_lib(gl wxUSE_OPENGL) add_opt_lib(qa wxUSE_DEBUGREPORT) + add_opt_lib(webview_chromium wxUSE_WEBVIEW wxUSE_WEBVIEW_CHROMIUM) endif() # wxUSE_GUI # Include XML library last diff --git a/build/cmake/lib/webview_chromium/CMakeLists.txt b/build/cmake/lib/webview_chromium/CMakeLists.txt new file mode 100644 index 0000000000..1c9e28314c --- /dev/null +++ b/build/cmake/lib/webview_chromium/CMakeLists.txt @@ -0,0 +1,103 @@ +############################################################################# +# Name: build/cmake/lib/webview_chromium/CMakeLists.txt +# Purpose: CMake file for webview_chromium library +# Author: Tobias Taschner +# Created: 2018-02-03 +# Copyright: (c) 2018 wxWidgets development team +# Licence: wxWindows licence +############################################################################# + +include(../../source_groups.cmake) + +include(cef_version_info.cmake) + +find_path(CEF_ROOT + NAMES libcef_dll + HINTS + $ENV{CEF_ROOT} + ${wxSOURCE_DIR}/3rdparty/cef + DOC "CEF Binary Root directory" + ) + +set(CEF_DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/cef-download) +set(CEF_SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/cef-source) +set(CEF_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/cef-build) + +if(NOT CEF_ROOT) + message("Downloading CEF binary distribution...") + + configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/cef_download.cmake.in + ${CEF_DOWNLOAD_DIR}/CMakeLists.txt + ) + + execute_process( + COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . + RESULT_VARIABLE result + WORKING_DIRECTORY ${CEF_DOWNLOAD_DIR} + ) + if(result) + message(FATAL_ERROR "CMake step for cef failed: ${result}") + endif() + + execute_process( + COMMAND ${CMAKE_COMMAND} --build . + RESULT_VARIABLE result + WORKING_DIRECTORY ${CEF_DOWNLOAD_DIR} + ) + if(result) + message(FATAL_ERROR "Build step for cef failed: ${result}") + endif() + + set(CEF_ROOT ${CEF_SOURCE_DIR} CACHE PATH "CEF Binary Root directory" FORCE) +endif() + +# CEF settings +set(USE_ATL OFF) # Disable usage of ATL in CEF +set(USE_SANDBOX OFF) # Disable usage of sandbox on windows + +add_subdirectory(${CEF_ROOT} ${CEF_BUILD_DIR} EXCLUDE_FROM_ALL) +set_target_properties(libcef_dll_wrapper PROPERTIES + FOLDER "Third Party Libraries" + COMPILE_FLAGS "-Wno-extra" + OUTPUT_NAME "libcef_dll_wrapper" +) + +if(MSVC) + # Modify CEF compiler options to match VC runtime + get_target_property(cef_compile_options libcef_dll_wrapper COMPILE_OPTIONS) + string(REGEX REPLACE "/MTd?;" "" cef_compile_options "${cef_compile_options}") + set_target_properties(libcef_dll_wrapper PROPERTIES COMPILE_OPTIONS "${cef_compile_options}") +endif() + +add_library(libcef SHARED IMPORTED GLOBAL) +if(APPLE) + set_target_properties(libcef PROPERTIES + IMPORTED_LOCATION_DEBUG "${CEF_ROOT}/Debug/Chromium Embedded Framework.framework/Chromium Embedded Framework" + IMPORTED_LOCATION_RELEASE "${CEF_ROOT}/Release/Chromium Embedded Framework.framework/Chromium Embedded Framework" + ) +else() + set_target_properties(libcef PROPERTIES + IMPORTED_LOCATION ${CEF_ROOT}/Release/libcef${CMAKE_SHARED_LIBRARY_SUFFIX} + IMPORTED_LOCATION_DEBUG ${CEF_ROOT}/Debug/libcef${CMAKE_SHARED_LIBRARY_SUFFIX} + IMPORTED_IMPLIB_DEBUG ${CEF_ROOT}/Debug/libcef${CMAKE_IMPORT_LIBRARY_SUFFIX} + IMPORTED_LOCATION_RELEASE ${CEF_ROOT}/Release/libcef${CMAKE_SHARED_LIBRARY_SUFFIX} + IMPORTED_IMPLIB_RELEASE ${CEF_ROOT}/Release/libcef${CMAKE_IMPORT_LIBRARY_SUFFIX} + ) +endif() + +wx_install(TARGETS libcef_dll_wrapper + EXPORT wxWidgetsTargets + ARCHIVE DESTINATION "lib${GEN_EXPR_DIR}${wxPLATFORM_LIB_DIR}" +) + +wx_lib_include_directories(wxwebview PRIVATE ${CEF_ROOT}) +wx_add_dependencies(wxwebview libcef_dll_wrapper) +wx_lib_link_libraries(wxwebview PUBLIC libcef libcef_dll_wrapper) + +mark_as_advanced(USE_ATL) +mark_as_advanced(USE_SANDBOX) +mark_as_advanced(OPTION_USE_ARC) +mark_as_advanced(CEF_ROOT) +mark_as_advanced(CEF_DEBUG_INFO_FLAG) +mark_as_advanced(CEF_RUNTIME_LIBRARY_FLAG) diff --git a/build/cmake/lib/webview_chromium/cef_download.cmake.in b/build/cmake/lib/webview_chromium/cef_download.cmake.in new file mode 100644 index 0000000000..98641fb6fd --- /dev/null +++ b/build/cmake/lib/webview_chromium/cef_download.cmake.in @@ -0,0 +1,28 @@ +############################################################################# +# Name: build/cmake/lib/webview_chromium/cef_download.cmake.in +# Purpose: CMakeLists.txt template to download CEF +# Author: Tobias Taschner +# Created: 2018-02-19 +# Copyright: (c) 2018 wxWidgets development team +# Licence: wxWindows licence +############################################################################# + +cmake_minimum_required(VERSION 3.5) +if(POLICY CMP0135) + cmake_policy(SET CMP0135 NEW) +endif() + +project(cef-download NONE) + +include(ExternalProject) + +ExternalProject_Add(cef + URL ${CEF_URL} + URL_HASH SHA1=${CEF_SHA1} + SOURCE_DIR "${CEF_SOURCE_DIR}" + BINARY_DIR "${CEF_BUILD_DIR}" + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND "" + TEST_COMMAND "" +) diff --git a/build/cmake/lib/webview_chromium/cef_update_version_info.cmake b/build/cmake/lib/webview_chromium/cef_update_version_info.cmake new file mode 100644 index 0000000000..792b184f82 --- /dev/null +++ b/build/cmake/lib/webview_chromium/cef_update_version_info.cmake @@ -0,0 +1,34 @@ +############################################################################# +# Name: build/cmake/lib/webview_chromium/cef_update_version_info.cmake +# Purpose: Script to update +# Author: Tobias Taschner +# Created: 2018-02-03 +# Copyright: (c) 2018 wxWidgets development team +# Licence: wxWindows licence +############################################################################# + +# Use this script to automatically update cef_version_info.cmake +# +# Run this script with cmake script mode +# cmake -D CEF_VERSION=3.x.y.z.h -P cef_update_version_info.cmake + +if(NOT DEFINED CEF_VERSION) + message(FATAL_ERROR "CEF_VERSION not defined") +endif() + +set(CEF_BASE_URL "https://cef-builds.spotifycdn.com/cef_binary_") +set(CEF_FILE_EXT ".tar.bz2") + +set(sha_file ${CMAKE_BINARY_DIR}/__info_sha.txt) +foreach(platform windows64 windowsarm64 windows32 macosx64 macosarm64 linux64 linuxarm64 linuxarm) + file(DOWNLOAD "${CEF_BASE_URL}${CEF_VERSION}_${platform}${CEF_FILE_EXT}.sha1" "${sha_file}") + file(READ "${sha_file}" CEF_SHA1_${platform}) +endforeach() + +file(REMOVE ${sha_file}) + +configure_file( + cef_version_info.cmake.in + cef_version_info.cmake + @ONLY NEWLINE_STYLE LF +) diff --git a/build/cmake/lib/webview_chromium/cef_version_info.cmake b/build/cmake/lib/webview_chromium/cef_version_info.cmake new file mode 100644 index 0000000000..6139575bb1 --- /dev/null +++ b/build/cmake/lib/webview_chromium/cef_version_info.cmake @@ -0,0 +1,64 @@ +############################################################################# +# Name: build/cmake/lib/webview_chromium/cef_version_info.cmake +# Purpose: CMake file CEF version information +# Author: Tobias Taschner +# Created: 2018-02-03 +# Copyright: (c) 2018 wxWidgets development team +# Licence: wxWindows licence +############################################################################# + +# +# DO NOT MODIFY MANUALLY +# +# To update the include file see cef_update_version_info.cmake + +if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + if(CMAKE_SIZEOF_VOID_P LESS 8) + message(ERROR "Unsupported macOS system") + else() + if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm64") + set(CEF_PLATFORM "macosarm64") + set(CEF_SHA1 "289ba3c54d801f757ef527f581ce49bd135c37d6") + else() + set(CEF_PLATFORM "macosx64") + set(CEF_SHA1 "d52703aa67772ef8cbb9d1a264a454f930df795b") + endif() + endif() +elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") + if(CMAKE_SIZEOF_VOID_P LESS 8) + if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm") + set(CEF_PLATFORM "linuxarm") + set(CEF_SHA1 "4173bc576d34258e7de8624b216c36bfd5b7cbf0") + else() + message(ERROR "Unsupported Linux system") + endif() + else() + if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm64") + set(CEF_PLATFORM "linuxarm64") + set(CEF_SHA1 "1a375eeb5d5c8a6df2e5911d5f6cfa25719ec140") + else() + set(CEF_PLATFORM "linux64") + set(CEF_SHA1 "a6b4166a5622a650165fa09c553ddaa9ade2338b") + endif() + endif() +elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows") + if(CMAKE_SIZEOF_VOID_P LESS 8) + if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm") + message(ERROR "Unsupported Windows system") + else() + set(CEF_PLATFORM "windows32") + set(CEF_SHA1 "f7a9f407108eeefc1469b0b51ada59c38b135de9") + endif() + else() + if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm64") + set(CEF_PLATFORM "windowsarm64") + set(CEF_SHA1 "0a6286fafdf30f560bfff6a9bd6604ddaa9ff433") + else() + set(CEF_PLATFORM "windows64") + set(CEF_SHA1 "5053b25559fbb310d0858e21fd81a2067e7b79b6") + endif() + endif() +else() + message(ERROR "Unsupported CEF system") +endif() +set(CEF_URL "https://cef-builds.spotifycdn.com/cef_binary_119.4.7+g55e15c8+chromium-119.0.6045.199_${CEF_PLATFORM}.tar.bz2") diff --git a/build/cmake/lib/webview_chromium/cef_version_info.cmake.in b/build/cmake/lib/webview_chromium/cef_version_info.cmake.in new file mode 100644 index 0000000000..7877725302 --- /dev/null +++ b/build/cmake/lib/webview_chromium/cef_version_info.cmake.in @@ -0,0 +1,64 @@ +############################################################################# +# Name: build/cmake/lib/webview_chromium/cef_version_info.cmake +# Purpose: CMake file CEF version information +# Author: Tobias Taschner +# Created: 2018-02-03 +# Copyright: (c) 2018 wxWidgets development team +# Licence: wxWindows licence +############################################################################# + +# +# DO NOT MODIFY MANUALLY +# +# To update the include file see cef_update_version_info.cmake + +if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + if(CMAKE_SIZEOF_VOID_P LESS 8) + message(ERROR "Unsupported macOS system") + else() + if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm64") + set(CEF_PLATFORM "macosarm64") + set(CEF_SHA1 "@CEF_SHA1_macosarm64@") + else() + set(CEF_PLATFORM "macosx64") + set(CEF_SHA1 "@CEF_SHA1_macosx64@") + endif() + endif() +elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") + if(CMAKE_SIZEOF_VOID_P LESS 8) + if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm") + set(CEF_PLATFORM "linuxarm") + set(CEF_SHA1 "@CEF_SHA1_linuxarm@") + else() + message(ERROR "Unsupported Linux system") + endif() + else() + if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm64") + set(CEF_PLATFORM "linuxarm64") + set(CEF_SHA1 "@CEF_SHA1_linuxarm64@") + else() + set(CEF_PLATFORM "linux64") + set(CEF_SHA1 "@CEF_SHA1_linux64@") + endif() + endif() +elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows") + if(CMAKE_SIZEOF_VOID_P LESS 8) + if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm") + message(ERROR "Unsupported Windows system") + else() + set(CEF_PLATFORM "windows32") + set(CEF_SHA1 "@CEF_SHA1_windows32@") + endif() + else() + if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm64") + set(CEF_PLATFORM "windowsarm64") + set(CEF_SHA1 "@CEF_SHA1_windowsarm64@") + else() + set(CEF_PLATFORM "windows64") + set(CEF_SHA1 "@CEF_SHA1_windows64@") + endif() + endif() +else() + message(ERROR "Unsupported CEF system") +endif() +set(CEF_URL "@CEF_BASE_URL@@CEF_VERSION@_${CEF_PLATFORM}@CEF_FILE_EXT@") diff --git a/build/cmake/main.cmake b/build/cmake/main.cmake index 770546b65a..6cdffd2bbe 100644 --- a/build/cmake/main.cmake +++ b/build/cmake/main.cmake @@ -63,7 +63,7 @@ if(MSVC OR MINGW OR CYGWIN) endif() elseif(APPLE AND NOT IPHONE) if(DEFINED CMAKE_OSX_DEPLOYMENT_TARGET) - set(wxREQUIRED_OS_DESC "macOS ${CMAKE_OSX_DEPLOYMENT_TARGET}") + set(wxREQUIRED_OS_DESC "macOS ${CMAKE_OSX_DEPLOYMENT_TARGET} ${CMAKE_SYSTEM_PROCESSOR}") endif() endif() diff --git a/build/cmake/options.cmake b/build/cmake/options.cmake index bde248f25c..a1f2baaaa9 100644 --- a/build/cmake/options.cmake +++ b/build/cmake/options.cmake @@ -269,6 +269,7 @@ wx_option(wxUSE_AFM_FOR_POSTSCRIPT "in wxPostScriptDC class use AFM (adobe font wx_option(wxUSE_PRINTING_ARCHITECTURE "use printing architecture") wx_option(wxUSE_SVG "use wxSVGFileDC device context") wx_option(wxUSE_WEBVIEW "use wxWebView library") +wx_option(wxUSE_WEBVIEW_CHROMIUM "Enable CEF based wxWebViewChromium" OFF) # wxDC is implemented in terms of wxGraphicsContext in wxOSX so the latter # can't be disabled, don't even provide an option to do it diff --git a/build/cmake/policies.cmake b/build/cmake/policies.cmake index e72c02f2f4..9ea1d995c0 100644 --- a/build/cmake/policies.cmake +++ b/build/cmake/policies.cmake @@ -74,6 +74,11 @@ if(POLICY CMP0072) cmake_policy(SET CMP0072 NEW) endif() +if(POLICY CMP0079) + # target_link_libraries() allows use with targets in other directories. + cmake_policy(SET CMP0079 NEW) +endif() + if(POLICY CMP0092) # MSVC warning flags are not in CMAKE__FLAGS by default. cmake_policy(SET CMP0092 NEW) diff --git a/build/cmake/samples/CMakeLists.txt b/build/cmake/samples/CMakeLists.txt index 362cd9a111..26139390a3 100644 --- a/build/cmake/samples/CMakeLists.txt +++ b/build/cmake/samples/CMakeLists.txt @@ -151,11 +151,8 @@ wx_add_sample(typetest typetest.cpp typetest.h) wx_add_sample(uiaction DEPENDS wxUSE_UIACTIONSIMULATOR) wx_add_sample(validate validate.cpp validate.h DEPENDS wxUSE_VALIDATORS) wx_add_sample(vscroll vstest.cpp) -wx_add_sample(webview LIBRARIES wxwebview - DATA ../help/doc.zip:doc.zip handler_advanced.html - NAME webviewsample DEPENDS wxUSE_WEBVIEW) -if(TARGET webviewsample AND wxUSE_STC) - wx_exe_link_libraries(webviewsample wxstc) +if(wxUSE_WEBVIEW) + include(webview.cmake) endif() wx_add_sample(webrequest LIBRARIES wxnet DEPENDS wxUSE_WEBREQUEST) # widgets Sample diff --git a/build/cmake/samples/webview.cmake b/build/cmake/samples/webview.cmake new file mode 100644 index 0000000000..9469fee8d3 --- /dev/null +++ b/build/cmake/samples/webview.cmake @@ -0,0 +1,103 @@ +############################################################################# +# Name: build/cmake/samples/webview.cmake +# Purpose: CMake script to build webview samples +# Author: Tobias Taschner +# Created: 2018-02-17 +# Copyright: (c) 2018 wxWidgets development team +# Licence: wxWindows licence +############################################################################# + +wx_add_sample(webview LIBRARIES wxwebview + DATA ../help/doc.zip:doc.zip handler_advanced.html + NAME webviewsample) +if(wxUSE_STC) + wx_exe_link_libraries(webviewsample wxstc) +endif() + +if(wxUSE_WEBVIEW_CHROMIUM AND TARGET webviewsample) + if(WIN32 OR (UNIX AND NOT APPLE)) + # Copy CEF libraries and resources next to the executable. + add_custom_command( + TARGET webviewsample + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CEF_ROOT}/$ $ + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CEF_ROOT}/Resources $ + COMMENT "Copying webviewsample CEF resources..." + ) + if(UNIX) + # Set rpath so that libraries can be placed next to the executable. + # Fixes error: "Invalid file descriptor to ICU data received." + set_target_properties(webviewsample PROPERTIES + INSTALL_RPATH "$ORIGIN" + BUILD_WITH_INSTALL_RPATH TRUE + ) + endif() + elseif(APPLE) + # Copy the CEF framework into the Frameworks directory. + add_custom_command( + TARGET webviewsample + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory + "${CEF_ROOT}/$/Chromium Embedded Framework.framework" + "$/../Frameworks/Chromium Embedded Framework.framework" + ) + + # CEF Helper app suffixes. + # Format is "::". + set(CEF_HELPER_APP_SUFFIXES + "::" + " (Alerts):_alerts:.alerts" + " (GPU):_gpu:.gpu" + " (Plugin):_plugin:.plugin" + " (Renderer):_renderer:.renderer" + ) + set(CEF_HELPER_TARGET "webviewsample_Helper") + set(CEF_HELPER_OUTPUT_NAME "webviewsample Helper") + + # Create the multiple Helper app bundle targets. + foreach(_suffix_list ${CEF_HELPER_APP_SUFFIXES}) + # Convert to a list and extract the suffix values. + string(REPLACE ":" ";" _suffix_list ${_suffix_list}) + list(GET _suffix_list 0 _name_suffix) + list(GET _suffix_list 1 _target_suffix) + list(GET _suffix_list 2 _plist_suffix) + + # Define Helper target and output names. + set(_helper_target "${CEF_HELPER_TARGET}${_target_suffix}") + set(_helper_output_name "${CEF_HELPER_OUTPUT_NAME}${_name_suffix}") + + # Create Helper-specific variants of the helper-Info.plist file. Do this + # manually because the configure_file command (which is executed as part of + # MACOSX_BUNDLE_INFO_PLIST) uses global env variables and would insert the + # wrong values with multiple targets. + set(_helper_info_plist "${CMAKE_CURRENT_BINARY_DIR}/helper-Info${_target_suffix}.plist") + file(READ "${wxSOURCE_DIR}/samples/webview/cef_helper_info.plist.in" _plist_contents) + string(REPLACE "\${EXECUTABLE_NAME}" "${_helper_output_name}" _plist_contents ${_plist_contents}) + string(REPLACE "\${PRODUCT_NAME}" "${_helper_output_name}" _plist_contents ${_plist_contents}) + string(REPLACE "\${BUNDLE_ID_SUFFIX}" "${_plist_suffix}" _plist_contents ${_plist_contents}) + file(WRITE ${_helper_info_plist} ${_plist_contents}) + + # Create Helper executable target. + add_executable(${_helper_target} MACOSX_BUNDLE ${wxSOURCE_DIR}/samples/webview/cef_process_helper.cpp) + target_include_directories(${_helper_target} PRIVATE "${CEF_ROOT}") + target_link_libraries(${_helper_target} libcef_dll_wrapper) + set_target_properties(${_helper_target} PROPERTIES + MACOSX_BUNDLE_INFO_PLIST ${_helper_info_plist} + OUTPUT_NAME ${_helper_output_name} + ) + + # Add the Helper as a dependency of the main executable target. + add_dependencies(webviewsample "${_helper_target}") + + # Copy the Helper app bundle into the Frameworks directory. + add_custom_command( + TARGET webviewsample + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory + "$/../../../${_helper_output_name}.app" + "$/../Frameworks/${_helper_output_name}.app" + VERBATIM + ) + endforeach() + endif() +endif() diff --git a/build/cmake/setup.cmake b/build/cmake/setup.cmake index 89976aecb0..59899bff9a 100644 --- a/build/cmake/setup.cmake +++ b/build/cmake/setup.cmake @@ -613,6 +613,13 @@ check_type_size(ssize_t SSIZE_T) test_big_endian(WORDS_BIGENDIAN) +if(wxUSE_WEBVIEW_CHROMIUM) + string(TOUPPER ${CMAKE_BUILD_TYPE} build_type) + if(${build_type} STREQUAL DEBUG) + set(wxHAVE_CEF_DEBUG ON) + endif() +endif() + configure_file(build/cmake/setup.h.in ${wxSETUP_HEADER_FILE}) if(DEFINED wxSETUP_HEADER_FILE_DEBUG) # The debug version may be configured with different values in the future diff --git a/build/cmake/setup.h.in b/build/cmake/setup.h.in index 5a520896ca..666e3d46e0 100644 --- a/build/cmake/setup.h.in +++ b/build/cmake/setup.h.in @@ -283,6 +283,8 @@ #cmakedefine01 wxUSE_WEBVIEW +#cmakedefine01 wxUSE_WEBVIEW_CHROMIUM + #ifdef __WXMSW__ #cmakedefine01 wxUSE_WEBVIEW_IE #else @@ -596,6 +598,11 @@ #cmakedefine01 wxUSE_SELECT_DISPATCHER #cmakedefine01 wxUSE_EPOLL_DISPATCHER +/* + Use debug version of CEF in wxWebViewChromium. + */ +#cmakedefine wxHAVE_CEF_DEBUG + /* Use GStreamer for Unix. diff --git a/build/files b/build/files index 536ec62d8a..9f214b05ea 100644 --- a/build/files +++ b/build/files @@ -2474,6 +2474,7 @@ WEBVIEW_CMN_SRC = src/common/webview.cpp src/common/webviewarchivehandler.cpp src/common/webviewfshandler.cpp + src/common/webview_chromium.cpp WEBVIEW_MSW_HDR = wx/msw/webviewhistoryitem_ie.h @@ -2483,12 +2484,14 @@ WEBVIEW_CMN_HDR = wx/webview.h wx/webviewarchivehandler.h wx/webviewfshandler.h + wx/webview_chromium.h WEBVIEW_OSX_SHARED_HDR = wx/osx/webviewhistoryitem_webkit.h wx/osx/webview_webkit.h WEBVIEW_OSX_SHARED_SRC = + src/osx/webview_chromium.mm src/osx/webview_webkit.mm WEBVIEW_GTK_HDR = diff --git a/build/msw/config.gcc b/build/msw/config.gcc index 3cf5a80fe9..027e75bfb8 100644 --- a/build/msw/config.gcc +++ b/build/msw/config.gcc @@ -71,6 +71,9 @@ USE_HTML ?= 1 # Build wxWebView library (USE_GUI must be 1)? [0,1] USE_WEBVIEW ?= 1 +# [0,1] +USE_WEBVIEW_CHROMIUM ?= 0 + # Build multimedia library (USE_GUI must be 1)? [0,1] USE_MEDIA ?= 1 diff --git a/build/msw/config.vc b/build/msw/config.vc index 5da3916148..ca187ea7f3 100644 --- a/build/msw/config.vc +++ b/build/msw/config.vc @@ -85,6 +85,9 @@ USE_HTML = 1 # Build wxWebView library (USE_GUI must be 1)? [0,1] USE_WEBVIEW = 1 +# [0,1] +USE_WEBVIEW_CHROMIUM = 0 + # Build multimedia library (USE_GUI must be 1)? [0,1] USE_MEDIA = 1 diff --git a/build/msw/makefile.gcc b/build/msw/makefile.gcc index 0e041c137b..3eab28dea9 100644 --- a/build/msw/makefile.gcc +++ b/build/msw/makefile.gcc @@ -19,10 +19,12 @@ MAKEARGS = LINK_DLL_FLAGS="$(LINK_DLL_FLAGS)" \ TOOLKIT_VERSION="$(TOOLKIT_VERSION)" WXUNIV="$(WXUNIV)" BUILD="$(BUILD)" \ DEBUG_INFO="$(DEBUG_INFO)" DEBUG_FLAG="$(DEBUG_FLAG)" \ MONOLITHIC="$(MONOLITHIC)" USE_GUI="$(USE_GUI)" USE_HTML="$(USE_HTML)" \ - USE_WEBVIEW="$(USE_WEBVIEW)" USE_MEDIA="$(USE_MEDIA)" USE_XML="$(USE_XML)" \ - USE_XRC="$(USE_XRC)" USE_AUI="$(USE_AUI)" USE_RIBBON="$(USE_RIBBON)" \ - USE_PROPGRID="$(USE_PROPGRID)" USE_RICHTEXT="$(USE_RICHTEXT)" \ - USE_STC="$(USE_STC)" USE_OPENGL="$(USE_OPENGL)" USE_QA="$(USE_QA)" \ + USE_WEBVIEW="$(USE_WEBVIEW)" \ + USE_WEBVIEW_CHROMIUM="$(USE_WEBVIEW_CHROMIUM)" USE_MEDIA="$(USE_MEDIA)" \ + USE_XML="$(USE_XML)" USE_XRC="$(USE_XRC)" USE_AUI="$(USE_AUI)" \ + USE_RIBBON="$(USE_RIBBON)" USE_PROPGRID="$(USE_PROPGRID)" \ + USE_RICHTEXT="$(USE_RICHTEXT)" USE_STC="$(USE_STC)" \ + USE_OPENGL="$(USE_OPENGL)" USE_QA="$(USE_QA)" \ USE_EXCEPTIONS="$(USE_EXCEPTIONS)" USE_RTTI="$(USE_RTTI)" \ USE_DPI_AWARE_MANIFEST="$(USE_DPI_AWARE_MANIFEST)" \ USE_THREADS="$(USE_THREADS)" USE_CAIRO="$(USE_CAIRO)" \ @@ -1188,16 +1190,18 @@ WEBVIEWDLL_CXXFLAGS = -I..\..\src\tiff\libtiff -I..\..\src\jpeg \ $(__THREAD_DEFINE_p) -I$(SETUPHDIR) -I..\..\include \ $(____CAIRO_INCLUDEDIR_FILENAMES) -W -Wall -DWXBUILDING \ -I..\..\include\wx\msw\wrl -I..\..\3rdparty\webview2\build\native\include \ - -DWXUSINGDLL -DWXMAKINGDLL_WEBVIEW $(__RTTIFLAG) $(__EXCEPTIONSFLAG) \ - -Wno-ctor-dtor-privacy -Wno-unknown-pragmas $(CPPFLAGS) $(CXXFLAGS) + -DWXUSINGDLL -DWXMAKINGDLL_WEBVIEW -I..\..\\3rdparty\cef $(__RTTIFLAG) \ + $(__EXCEPTIONSFLAG) -Wno-ctor-dtor-privacy -Wno-unknown-pragmas $(CPPFLAGS) \ + $(CXXFLAGS) WEBVIEWDLL_OBJECTS = \ $(OBJS)\webviewdll_dummy.o \ - $(OBJS)\webviewdll_version_rc.o \ $(OBJS)\webviewdll_webview_ie.o \ $(OBJS)\webviewdll_webview_edge.o \ $(OBJS)\webviewdll_webview.o \ $(OBJS)\webviewdll_webviewarchivehandler.o \ - $(OBJS)\webviewdll_webviewfshandler.o + $(OBJS)\webviewdll_webviewfshandler.o \ + $(OBJS)\webviewdll_webview_chromium.o \ + $(OBJS)\webviewdll_version_rc.o WEBVIEWLIB_CXXFLAGS = -I..\..\src\tiff\libtiff -I..\..\src\jpeg \ -I..\..\src\png -I..\..\src\zlib -I..\..\3rdparty\pcre\src\wx \ -I..\..\src\expat\expat\lib $(__DEBUGINFO) $(__OPTIMIZEFLAG) \ @@ -1206,15 +1210,16 @@ WEBVIEWLIB_CXXFLAGS = -I..\..\src\tiff\libtiff -I..\..\src\jpeg \ $(__THREAD_DEFINE_p) -I$(SETUPHDIR) -I..\..\include \ $(____CAIRO_INCLUDEDIR_FILENAMES) -W -Wall -DWXBUILDING \ -I..\..\include\wx\msw\wrl -I..\..\3rdparty\webview2\build\native\include \ - $(__RTTIFLAG) $(__EXCEPTIONSFLAG) -Wno-ctor-dtor-privacy \ - -Wno-unknown-pragmas $(CPPFLAGS) $(CXXFLAGS) + -I..\..\\3rdparty\cef $(__RTTIFLAG) $(__EXCEPTIONSFLAG) \ + -Wno-ctor-dtor-privacy -Wno-unknown-pragmas $(CPPFLAGS) $(CXXFLAGS) WEBVIEWLIB_OBJECTS = \ $(OBJS)\webviewlib_dummy.o \ $(OBJS)\webviewlib_webview_ie.o \ $(OBJS)\webviewlib_webview_edge.o \ $(OBJS)\webviewlib_webview.o \ $(OBJS)\webviewlib_webviewarchivehandler.o \ - $(OBJS)\webviewlib_webviewfshandler.o + $(OBJS)\webviewlib_webviewfshandler.o \ + $(OBJS)\webviewlib_webview_chromium.o QADLL_CXXFLAGS = -I..\..\src\tiff\libtiff -I..\..\src\jpeg -I..\..\src\png \ -I..\..\src\zlib -I..\..\3rdparty\pcre\src\wx -I..\..\src\expat\expat\lib \ $(__DEBUGINFO) $(__OPTIMIZEFLAG) $(__THREADSFLAG) -D__WXMSW__ \ @@ -1754,6 +1759,7 @@ ____MONOLIB_GUI_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_webview.o \ $(OBJS)\monodll_webviewarchivehandler.o \ $(OBJS)\monodll_webviewfshandler.o \ + $(OBJS)\monodll_webview_chromium.o \ $(OBJS)\monodll_debugrpt.o \ $(OBJS)\monodll_dbgrptg.o \ $(OBJS)\monodll_xh_activityindicator.o \ @@ -2609,6 +2615,7 @@ ____MONOLIB_GUI_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_webview.o \ $(OBJS)\monolib_webviewarchivehandler.o \ $(OBJS)\monolib_webviewfshandler.o \ + $(OBJS)\monolib_webview_chromium.o \ $(OBJS)\monolib_debugrpt.o \ $(OBJS)\monolib_dbgrptg.o \ $(OBJS)\monolib_xh_activityindicator.o \ @@ -5443,7 +5450,7 @@ ifeq ($(SHARED),1) $(LIBDIRNAME)\wx$(PORTNAME)$(WXUNIVNAME)$(WX_VERSION_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)$(WXCOMPILER)$(VENDORTAG).dll: $(MONODLL_OBJECTS) $(LIBDIRNAME)\libwxexpat$(WXDEBUGFLAG).a $(LIBDIRNAME)\libwxzlib$(WXDEBUGFLAG).a $(LIBDIRNAME)\libwxregexu$(WXDEBUGFLAG).a $(__wxtiff___depname) $(__wxjpeg___depname) $(__wxpng___depname) $(__wxscintilla) $(__wxlexilla) $(OBJS)\monodll_version_rc.o $(__wxscintilla_library_link_DEP) $(__wxlexilla_library_link_DEP) $(foreach f,$(subst \,/,$(MONODLL_OBJECTS)),$(shell echo $f >> $(subst \,/,$@).rsp.tmp)) @move /y $@.rsp.tmp $@.rsp >nul - $(CXX) $(LINK_DLL_FLAGS) -fPIC -o $@ @$@.rsp $(__DEBUGINFO) $(__THREADSFLAG) -L$(LIBDIRNAME) -Wl,--out-implib=$(LIBDIRNAME)\libwx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR).a $(____CAIRO_LIBDIR_FILENAMES) $(LDFLAGS) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) -lwxzlib$(WXDEBUGFLAG) -lwxregexu$(WXDEBUGFLAG) -lwxexpat$(WXDEBUGFLAG) $(EXTRALIBS_FOR_BASE) $(__CAIRO_LIB_p) -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lversion -lws2_32 -lwininet -loleacc -luxtheme -limm32 $(__wxscintilla) $(__wxlexilla) + $(CXX) $(LINK_DLL_FLAGS) -fPIC -o $@ @$@.rsp $(__DEBUGINFO) $(__THREADSFLAG) -L$(LIBDIRNAME) -Wl,--out-implib=$(LIBDIRNAME)\libwx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR).a $(____CAIRO_LIBDIR_FILENAMES) $(LDFLAGS) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) -lwxzlib$(WXDEBUGFLAG) -lwxregexu$(WXDEBUGFLAG) -lwxexpat$(WXDEBUGFLAG) $(EXTRALIBS_FOR_BASE) $(__CAIRO_LIB_p) -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lversion -lws2_32 -lwininet -loleacc -luxtheme -limm32 $(__wxscintilla) $(__wxlexilla) @-del $@.rsp endif endif @@ -5654,10 +5661,10 @@ ifeq ($(MONOLITHIC),0) ifeq ($(SHARED),1) ifeq ($(USE_GUI),1) ifeq ($(USE_WEBVIEW),1) -$(LIBDIRNAME)\wx$(PORTNAME)$(WXUNIVNAME)$(WX_VERSION_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_webview$(WXCOMPILER)$(VENDORTAG).dll: $(WEBVIEWDLL_OBJECTS) $(LIBDIRNAME)\libwxexpat$(WXDEBUGFLAG).a $(LIBDIRNAME)\libwxzlib$(WXDEBUGFLAG).a $(LIBDIRNAME)\libwxregexu$(WXDEBUGFLAG).a $(__wxtiff___depname) $(__wxjpeg___depname) $(__wxpng___depname) $(__wxscintilla) $(__wxlexilla) $(OBJS)\webviewdll_version_rc.o $(__coredll___depname) $(__basedll___depname) +$(LIBDIRNAME)\wx$(PORTNAME)$(WXUNIVNAME)$(WX_VERSION_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_webview$(WXCOMPILER)$(VENDORTAG).dll: $(WEBVIEWDLL_OBJECTS) $(LIBDIRNAME)\libwxexpat$(WXDEBUGFLAG).a $(LIBDIRNAME)\libwxzlib$(WXDEBUGFLAG).a $(LIBDIRNAME)\libwxregexu$(WXDEBUGFLAG).a $(__wxtiff___depname) $(__wxjpeg___depname) $(__wxpng___depname) $(__wxscintilla) $(__wxlexilla) $(__coredll___depname) $(__basedll___depname) $(OBJS)\webviewdll_version_rc.o $(foreach f,$(subst \,/,$(WEBVIEWDLL_OBJECTS)),$(shell echo $f >> $(subst \,/,$@).rsp.tmp)) @move /y $@.rsp.tmp $@.rsp >nul - $(CXX) $(LINK_DLL_FLAGS) -fPIC -o $@ @$@.rsp $(__DEBUGINFO) $(__THREADSFLAG) -L$(LIBDIRNAME) -Wl,--out-implib=$(LIBDIRNAME)\libwx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_webview.a $(____CAIRO_LIBDIR_FILENAMES) $(LDFLAGS) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) -lwxzlib$(WXDEBUGFLAG) -lwxregexu$(WXDEBUGFLAG) -lwxexpat$(WXDEBUGFLAG) $(EXTRALIBS_FOR_BASE) $(__CAIRO_LIB_p) -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lversion -lws2_32 -lwininet -loleacc -luxtheme $(LIBDIRNAME)\libwx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_core.a $(LIBDIRNAME)\libwxbase$(WX_RELEASE_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR).a + $(CXX) $(LINK_DLL_FLAGS) -fPIC -o $@ @$@.rsp $(__DEBUGINFO) $(__THREADSFLAG) -L$(LIBDIRNAME) -Wl,--out-implib=$(LIBDIRNAME)\libwx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_webview.a $(____CAIRO_LIBDIR_FILENAMES) $(LDFLAGS) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) -lwxzlib$(WXDEBUGFLAG) -lwxregexu$(WXDEBUGFLAG) -lwxexpat$(WXDEBUGFLAG) $(EXTRALIBS_FOR_BASE) $(__CAIRO_LIB_p) -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lversion -lws2_32 -lwininet -loleacc -luxtheme $(LIBDIRNAME)\libwx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_core.a $(LIBDIRNAME)\libwxbase$(WX_RELEASE_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR).a @-del $@.rsp endif endif @@ -6034,6 +6041,7 @@ build_cfg_file: $(SETUPHDIR) @echo USE_RICHTEXT=$(USE_RICHTEXT) >>$(BUILD_CFG_FILE) @echo USE_STC=$(USE_STC) >>$(BUILD_CFG_FILE) @echo USE_WEBVIEW=$(USE_WEBVIEW) >>$(BUILD_CFG_FILE) + @echo USE_WEBVIEW_CHROMIUM=$(USE_WEBVIEW_CHROMIUM) >>$(BUILD_CFG_FILE) @echo USE_XML=$(USE_XML) >>$(BUILD_CFG_FILE) @echo USE_XRC=$(USE_XRC) >>$(BUILD_CFG_FILE) @echo COMPILER=gcc >>$(BUILD_CFG_FILE) @@ -7815,6 +7823,9 @@ $(OBJS)\monodll_webviewarchivehandler.o: ../../src/common/webviewarchivehandler. $(OBJS)\monodll_webviewfshandler.o: ../../src/common/webviewfshandler.cpp $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\monodll_webview_chromium.o: ../../src/common/webview_chromium.cpp + $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\monodll_debugrpt.o: ../../src/common/debugrpt.cpp $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< @@ -10409,6 +10420,9 @@ $(OBJS)\monolib_webviewarchivehandler.o: ../../src/common/webviewarchivehandler. $(OBJS)\monolib_webviewfshandler.o: ../../src/common/webviewfshandler.cpp $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\monolib_webview_chromium.o: ../../src/common/webview_chromium.cpp + $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\monolib_debugrpt.o: ../../src/common/debugrpt.cpp $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< @@ -16694,9 +16708,6 @@ $(OBJS)\htmllib_htmllbox.o: ../../src/generic/htmllbox.cpp $(OBJS)\webviewdll_dummy.o: ../../src/common/dummy.cpp $(CXX) -c -o $@ $(WEBVIEWDLL_CXXFLAGS) $(CPPDEPS) $< -$(OBJS)\webviewdll_version_rc.o: ../../src/msw/version.rc - $(WINDRES) -i$< -o$@ --include-dir ../../src/tiff/libtiff --include-dir ../../src/jpeg --include-dir ../../src/png --include-dir ../../src/zlib --include-dir ../../3rdparty/pcre/src/wx --include-dir ../../src/expat/expat/lib --define __WXMSW__ $(__WXUNIV_DEFINE_p_67) $(__DEBUG_DEFINE_p_67) $(__NDEBUG_DEFINE_p_65) $(__EXCEPTIONS_DEFINE_p_65) $(__RTTI_DEFINE_p_65) $(__THREAD_DEFINE_p_65) --include-dir $(SETUPHDIR) --include-dir ../../include $(__CAIRO_INCLUDEDIR_p) --define WXBUILDING --define WXDLLNAME=wx$(PORTNAME)$(WXUNIVNAME)$(WX_VERSION_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_webview$(WXCOMPILER)$(VENDORTAG) --include-dir ../../include/wx/msw/wrl --include-dir ../../3rdparty/webview2/build/native/include --define WXUSINGDLL --define WXMAKINGDLL_WEBVIEW - $(OBJS)\webviewdll_webview_ie.o: ../../src/msw/webview_ie.cpp $(CXX) -c -o $@ $(WEBVIEWDLL_CXXFLAGS) $(CPPDEPS) $< @@ -16712,6 +16723,12 @@ $(OBJS)\webviewdll_webviewarchivehandler.o: ../../src/common/webviewarchivehandl $(OBJS)\webviewdll_webviewfshandler.o: ../../src/common/webviewfshandler.cpp $(CXX) -c -o $@ $(WEBVIEWDLL_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\webviewdll_webview_chromium.o: ../../src/common/webview_chromium.cpp + $(CXX) -c -o $@ $(WEBVIEWDLL_CXXFLAGS) $(CPPDEPS) $< + +$(OBJS)\webviewdll_version_rc.o: ../../src/msw/version.rc + $(WINDRES) -i$< -o$@ --include-dir ../../src/tiff/libtiff --include-dir ../../src/jpeg --include-dir ../../src/png --include-dir ../../src/zlib --include-dir ../../3rdparty/pcre/src/wx --include-dir ../../src/expat/expat/lib --define __WXMSW__ $(__WXUNIV_DEFINE_p_67) $(__DEBUG_DEFINE_p_67) $(__NDEBUG_DEFINE_p_65) $(__EXCEPTIONS_DEFINE_p_65) $(__RTTI_DEFINE_p_65) $(__THREAD_DEFINE_p_65) --include-dir $(SETUPHDIR) --include-dir ../../include $(__CAIRO_INCLUDEDIR_p) --define WXBUILDING --define WXDLLNAME=wx$(PORTNAME)$(WXUNIVNAME)$(WX_VERSION_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_webview$(WXCOMPILER)$(VENDORTAG) --include-dir ../../include/wx/msw/wrl --include-dir ../../3rdparty/webview2/build/native/include --define WXUSINGDLL --define WXMAKINGDLL_WEBVIEW --include-dir ../..//3rdparty/cef + $(OBJS)\webviewlib_dummy.o: ../../src/common/dummy.cpp $(CXX) -c -o $@ $(WEBVIEWLIB_CXXFLAGS) $(CPPDEPS) $< @@ -16730,6 +16747,9 @@ $(OBJS)\webviewlib_webviewarchivehandler.o: ../../src/common/webviewarchivehandl $(OBJS)\webviewlib_webviewfshandler.o: ../../src/common/webviewfshandler.cpp $(CXX) -c -o $@ $(WEBVIEWLIB_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\webviewlib_webview_chromium.o: ../../src/common/webview_chromium.cpp + $(CXX) -c -o $@ $(WEBVIEWLIB_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\qadll_dummy.o: ../../src/common/dummy.cpp $(CXX) -c -o $@ $(QADLL_CXXFLAGS) $(CPPDEPS) $< diff --git a/build/msw/makefile.vc b/build/msw/makefile.vc index 32a5ef9cc4..3efead9883 100644 --- a/build/msw/makefile.vc +++ b/build/msw/makefile.vc @@ -19,10 +19,12 @@ MAKEARGS = CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" \ VISUALSTUDIOPLATFORM="$(VISUALSTUDIOPLATFORM)" DEBUG_INFO="$(DEBUG_INFO)" \ DEBUG_FLAG="$(DEBUG_FLAG)" DEBUG_RUNTIME_LIBS="$(DEBUG_RUNTIME_LIBS)" \ MONOLITHIC="$(MONOLITHIC)" USE_GUI="$(USE_GUI)" USE_HTML="$(USE_HTML)" \ - USE_WEBVIEW="$(USE_WEBVIEW)" USE_MEDIA="$(USE_MEDIA)" USE_XML="$(USE_XML)" \ - USE_XRC="$(USE_XRC)" USE_AUI="$(USE_AUI)" USE_RIBBON="$(USE_RIBBON)" \ - USE_PROPGRID="$(USE_PROPGRID)" USE_RICHTEXT="$(USE_RICHTEXT)" \ - USE_STC="$(USE_STC)" USE_OPENGL="$(USE_OPENGL)" USE_QA="$(USE_QA)" \ + USE_WEBVIEW="$(USE_WEBVIEW)" \ + USE_WEBVIEW_CHROMIUM="$(USE_WEBVIEW_CHROMIUM)" USE_MEDIA="$(USE_MEDIA)" \ + USE_XML="$(USE_XML)" USE_XRC="$(USE_XRC)" USE_AUI="$(USE_AUI)" \ + USE_RIBBON="$(USE_RIBBON)" USE_PROPGRID="$(USE_PROPGRID)" \ + USE_RICHTEXT="$(USE_RICHTEXT)" USE_STC="$(USE_STC)" \ + USE_OPENGL="$(USE_OPENGL)" USE_QA="$(USE_QA)" \ USE_EXCEPTIONS="$(USE_EXCEPTIONS)" USE_RTTI="$(USE_RTTI)" \ USE_DPI_AWARE_MANIFEST="$(USE_DPI_AWARE_MANIFEST)" \ USE_THREADS="$(USE_THREADS)" USE_CAIRO="$(USE_CAIRO)" \ @@ -1305,15 +1307,17 @@ WEBVIEWDLL_CXXFLAGS = /M$(__RUNTIME_LIBS_348)$(__DEBUGRUNTIME) /DWIN32 \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ /I$(SETUPHDIR) /I..\..\include $(____CAIRO_INCLUDEDIR_FILENAMES) /W4 \ /DWXBUILDING /I..\..\3rdparty\webview2\build\native\include /DWXUSINGDLL \ - /DWXMAKINGDLL_WEBVIEW $(__RTTIFLAG) $(__EXCEPTIONSFLAG) /Yu"wx/wxprec.h" \ - /Fp"$(OBJS)\wxprec_webviewdll.pch" $(CPPFLAGS) $(CXXFLAGS) + /DWXMAKINGDLL_WEBVIEW /I..\..\\3rdparty\cef $(__RTTIFLAG) \ + $(__EXCEPTIONSFLAG) /Yu"wx/wxprec.h" /Fp"$(OBJS)\wxprec_webviewdll.pch" \ + $(CPPFLAGS) $(CXXFLAGS) WEBVIEWDLL_OBJECTS = \ $(OBJS)\webviewdll_dummy.obj \ $(OBJS)\webviewdll_webview_ie.obj \ $(OBJS)\webviewdll_webview_edge.obj \ $(OBJS)\webviewdll_webview.obj \ $(OBJS)\webviewdll_webviewarchivehandler.obj \ - $(OBJS)\webviewdll_webviewfshandler.obj + $(OBJS)\webviewdll_webviewfshandler.obj \ + $(OBJS)\webviewdll_webview_chromium.obj WEBVIEWDLL_RESOURCES = \ $(OBJS)\webviewdll_version.res WEBVIEWLIB_CXXFLAGS = /M$(__RUNTIME_LIBS_363)$(__DEBUGRUNTIME) /DWIN32 \ @@ -1326,16 +1330,17 @@ WEBVIEWLIB_CXXFLAGS = /M$(__RUNTIME_LIBS_363)$(__DEBUGRUNTIME) /DWIN32 \ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) $(__NDEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ /I$(SETUPHDIR) /I..\..\include $(____CAIRO_INCLUDEDIR_FILENAMES) /W4 \ - /DWXBUILDING /I..\..\3rdparty\webview2\build\native\include $(__RTTIFLAG) \ - $(__EXCEPTIONSFLAG) /Yu"wx/wxprec.h" /Fp"$(OBJS)\wxprec_webviewlib.pch" \ - $(CPPFLAGS) $(CXXFLAGS) + /DWXBUILDING /I..\..\3rdparty\webview2\build\native\include \ + /I..\..\\3rdparty\cef $(__RTTIFLAG) $(__EXCEPTIONSFLAG) /Yu"wx/wxprec.h" \ + /Fp"$(OBJS)\wxprec_webviewlib.pch" $(CPPFLAGS) $(CXXFLAGS) WEBVIEWLIB_OBJECTS = \ $(OBJS)\webviewlib_dummy.obj \ $(OBJS)\webviewlib_webview_ie.obj \ $(OBJS)\webviewlib_webview_edge.obj \ $(OBJS)\webviewlib_webview.obj \ $(OBJS)\webviewlib_webviewarchivehandler.obj \ - $(OBJS)\webviewlib_webviewfshandler.obj + $(OBJS)\webviewlib_webviewfshandler.obj \ + $(OBJS)\webviewlib_webview_chromium.obj QADLL_CXXFLAGS = /M$(__RUNTIME_LIBS_379)$(__DEBUGRUNTIME) /DWIN32 \ /I..\..\src\tiff\libtiff /I..\..\src\jpeg /I..\..\src\png /I..\..\src\zlib \ /I..\..\3rdparty\pcre\src\wx /I..\..\src\expat\expat\lib $(__DEBUGINFO) \ @@ -2088,6 +2093,7 @@ ____MONOLIB_GUI_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_webview.obj \ $(OBJS)\monodll_webviewarchivehandler.obj \ $(OBJS)\monodll_webviewfshandler.obj \ + $(OBJS)\monodll_webview_chromium.obj \ $(OBJS)\monodll_debugrpt.obj \ $(OBJS)\monodll_dbgrptg.obj \ $(OBJS)\monodll_xh_activityindicator.obj \ @@ -2943,6 +2949,7 @@ ____MONOLIB_GUI_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_webview.obj \ $(OBJS)\monolib_webviewarchivehandler.obj \ $(OBJS)\monolib_webviewfshandler.obj \ + $(OBJS)\monolib_webview_chromium.obj \ $(OBJS)\monolib_debugrpt.obj \ $(OBJS)\monolib_dbgrptg.obj \ $(OBJS)\monolib_xh_activityindicator.obj \ @@ -6132,7 +6139,7 @@ $(LIBDIRNAME)\wxlexilla$(WXDEBUGFLAG).lib: $(WXLEXILLA_OBJECTS) !if "$(MONOLITHIC)" == "1" && "$(SHARED)" == "1" $(LIBDIRNAME)\wx$(PORTNAME)$(WXUNIVNAME)$(WX_VERSION_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)$(WXCOMPILER)$(VENDORTAG).dll: $(OBJS)\monodll_dummy.obj $(MONODLL_OBJECTS) $(LIBDIRNAME)\wxexpat$(WXDEBUGFLAG).lib $(LIBDIRNAME)\wxzlib$(WXDEBUGFLAG).lib $(LIBDIRNAME)\wxregexu$(WXDEBUGFLAG).lib $(__wxtiff___depname) $(__wxjpeg___depname) $(__wxpng___depname) $(__wxscintilla) $(__wxlexilla) $(OBJS)\monodll_version.res $(__wxscintilla_library_link_DEP) $(__wxlexilla_library_link_DEP) - link /DLL /NOLOGO /OUT:$@ $(__DEBUGINFO_6) /pdb:"$(LIBDIRNAME)\wx$(PORTNAME)$(WXUNIVNAME)$(WX_VERSION_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)$(WXCOMPILER)$(VENDORTAG).pdb" $(__DEBUGINFO_123) $(LINK_TARGET_CPU) /LIBPATH:$(LIBDIRNAME) $(____CAIRO_LIBDIR_FILENAMES) /LIBPATH:..\..\3rdparty\webview2\build\native\$(__webview_additional_libdirs_arch_FILENAMES) $(LDFLAGS) @<< + link /DLL /NOLOGO /OUT:$@ $(__DEBUGINFO_6) /pdb:"$(LIBDIRNAME)\wx$(PORTNAME)$(WXUNIVNAME)$(WX_VERSION_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)$(WXCOMPILER)$(VENDORTAG).pdb" $(__DEBUGINFO_123) $(LINK_TARGET_CPU) /LIBPATH:$(LIBDIRNAME) $(____CAIRO_LIBDIR_FILENAMES) /LIBPATH:..\..\3rdparty\webview2\build\native\$(__webview_additional_libdirs_arch_FILENAMES) $(LDFLAGS) @<< $(MONODLL_OBJECTS) $(MONODLL_RESOURCES) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) wxzlib$(WXDEBUGFLAG).lib wxregexu$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib $(EXTRALIBS_FOR_BASE) $(__CAIRO_LIB_p) kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib ws2_32.lib wininet.lib imm32.lib $(__wxscintilla) $(__wxlexilla) /IMPLIB:$(LIBDIRNAME)\wx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR).lib << !endif @@ -6260,8 +6267,8 @@ wxhtml: $(____wxhtml_namedll_DEP) $(____wxhtml_namelib_DEP) !endif !if "$(MONOLITHIC)" == "0" && "$(SHARED)" == "1" && "$(USE_GUI)" == "1" && "$(USE_WEBVIEW)" == "1" -$(LIBDIRNAME)\wx$(PORTNAME)$(WXUNIVNAME)$(WX_VERSION_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_webview$(WXCOMPILER)$(VENDORTAG).dll: $(OBJS)\webviewdll_dummy.obj $(WEBVIEWDLL_OBJECTS) $(LIBDIRNAME)\wxexpat$(WXDEBUGFLAG).lib $(LIBDIRNAME)\wxzlib$(WXDEBUGFLAG).lib $(LIBDIRNAME)\wxregexu$(WXDEBUGFLAG).lib $(__wxtiff___depname) $(__wxjpeg___depname) $(__wxpng___depname) $(__wxscintilla) $(__wxlexilla) $(OBJS)\webviewdll_version.res $(__coredll___depname) $(__basedll___depname) - link /DLL /NOLOGO /OUT:$@ $(__DEBUGINFO_6) /pdb:"$(LIBDIRNAME)\wx$(PORTNAME)$(WXUNIVNAME)$(WX_VERSION_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_webview$(WXCOMPILER)$(VENDORTAG).pdb" $(__DEBUGINFO_340) $(LINK_TARGET_CPU) /LIBPATH:$(LIBDIRNAME) $(____CAIRO_LIBDIR_FILENAMES) /LIBPATH:..\..\3rdparty\webview2\build\native\$(__webview_additional_libdirs_arch_FILENAMES) $(LDFLAGS) @<< +$(LIBDIRNAME)\wx$(PORTNAME)$(WXUNIVNAME)$(WX_VERSION_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_webview$(WXCOMPILER)$(VENDORTAG).dll: $(OBJS)\webviewdll_dummy.obj $(WEBVIEWDLL_OBJECTS) $(LIBDIRNAME)\wxexpat$(WXDEBUGFLAG).lib $(LIBDIRNAME)\wxzlib$(WXDEBUGFLAG).lib $(LIBDIRNAME)\wxregexu$(WXDEBUGFLAG).lib $(__wxtiff___depname) $(__wxjpeg___depname) $(__wxpng___depname) $(__wxscintilla) $(__wxlexilla) $(__coredll___depname) $(__basedll___depname) $(OBJS)\webviewdll_version.res + link /DLL /NOLOGO /OUT:$@ $(__DEBUGINFO_6) /pdb:"$(LIBDIRNAME)\wx$(PORTNAME)$(WXUNIVNAME)$(WX_VERSION_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_webview$(WXCOMPILER)$(VENDORTAG).pdb" $(__DEBUGINFO_340) $(LINK_TARGET_CPU) /LIBPATH:$(LIBDIRNAME) $(____CAIRO_LIBDIR_FILENAMES) /LIBPATH:..\..\3rdparty\webview2\build\native\$(__webview_additional_libdirs_arch_FILENAMES) $(LDFLAGS) @<< $(WEBVIEWDLL_OBJECTS) $(WEBVIEWDLL_RESOURCES) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) wxzlib$(WXDEBUGFLAG).lib wxregexu$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib $(EXTRALIBS_FOR_BASE) $(__CAIRO_LIB_p) kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib ws2_32.lib wininet.lib $(LIBDIRNAME)\wx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_core.lib $(LIBDIRNAME)\wxbase$(WX_RELEASE_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR).lib /IMPLIB:$(LIBDIRNAME)\wx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_webview.lib << !endif @@ -6503,6 +6510,7 @@ build_cfg_file: $(SETUPHDIR) @echo USE_RICHTEXT=$(USE_RICHTEXT) >>$(BUILD_CFG_FILE) @echo USE_STC=$(USE_STC) >>$(BUILD_CFG_FILE) @echo USE_WEBVIEW=$(USE_WEBVIEW) >>$(BUILD_CFG_FILE) + @echo USE_WEBVIEW_CHROMIUM=$(USE_WEBVIEW_CHROMIUM) >>$(BUILD_CFG_FILE) @echo USE_XML=$(USE_XML) >>$(BUILD_CFG_FILE) @echo USE_XRC=$(USE_XRC) >>$(BUILD_CFG_FILE) @echo COMPILER=vc >>$(BUILD_CFG_FILE) @@ -8272,6 +8280,9 @@ $(OBJS)\monodll_webviewarchivehandler.obj: ..\..\src\common\webviewarchivehandle $(OBJS)\monodll_webviewfshandler.obj: ..\..\src\common\webviewfshandler.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\common\webviewfshandler.cpp +$(OBJS)\monodll_webview_chromium.obj: ..\..\src\common\webview_chromium.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\common\webview_chromium.cpp + $(OBJS)\monodll_debugrpt.obj: ..\..\src\common\debugrpt.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\common\debugrpt.cpp @@ -10866,6 +10877,9 @@ $(OBJS)\monolib_webviewarchivehandler.obj: ..\..\src\common\webviewarchivehandle $(OBJS)\monolib_webviewfshandler.obj: ..\..\src\common\webviewfshandler.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\common\webviewfshandler.cpp +$(OBJS)\monolib_webview_chromium.obj: ..\..\src\common\webview_chromium.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\common\webview_chromium.cpp + $(OBJS)\monolib_debugrpt.obj: ..\..\src\common\debugrpt.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\common\debugrpt.cpp @@ -17151,9 +17165,6 @@ $(OBJS)\htmllib_htmllbox.obj: ..\..\src\generic\htmllbox.cpp $(OBJS)\webviewdll_dummy.obj: ..\..\src\common\dummy.cpp $(CXX) /c /nologo /TP /Fo$@ $(WEBVIEWDLL_CXXFLAGS) /Ycwx/wxprec.h ..\..\src\common\dummy.cpp -$(OBJS)\webviewdll_version.res: ..\..\src\msw\version.rc - rc /fo$@ /d WIN32 /i ..\..\src\tiff\libtiff /i ..\..\src\jpeg /i ..\..\src\png /i ..\..\src\zlib /i ..\..\3rdparty\pcre\src\wx /i ..\..\src\expat\expat\lib $(____DEBUGRUNTIME_6) /d _CRT_SECURE_NO_DEPRECATE=1 /d _CRT_NON_CONFORMING_SWPRINTFS=1 /d _SCL_SECURE_NO_WARNINGS=1 $(__NO_VC_CRTDBG_p_73) $(__TARGET_CPU_COMPFLAG_p_73) /d __WXMSW__ $(__WXUNIV_DEFINE_p_67) $(__DEBUG_DEFINE_p_67) $(__NDEBUG_DEFINE_p_65) $(__EXCEPTIONS_DEFINE_p_65) $(__RTTI_DEFINE_p_65) $(__THREAD_DEFINE_p_65) /i $(SETUPHDIR) /i ..\..\include $(____CAIRO_INCLUDEDIR_FILENAMES_4) /d WXBUILDING /d WXDLLNAME=wx$(PORTNAME)$(WXUNIVNAME)$(WX_VERSION_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_webview$(WXCOMPILER)$(VENDORTAG) /i ..\..\3rdparty\webview2\build\native\include /d WXUSINGDLL /d WXMAKINGDLL_WEBVIEW ..\..\src\msw\version.rc - $(OBJS)\webviewdll_webview_ie.obj: ..\..\src\msw\webview_ie.cpp $(CXX) /c /nologo /TP /Fo$@ $(WEBVIEWDLL_CXXFLAGS) ..\..\src\msw\webview_ie.cpp @@ -17169,6 +17180,12 @@ $(OBJS)\webviewdll_webviewarchivehandler.obj: ..\..\src\common\webviewarchivehan $(OBJS)\webviewdll_webviewfshandler.obj: ..\..\src\common\webviewfshandler.cpp $(CXX) /c /nologo /TP /Fo$@ $(WEBVIEWDLL_CXXFLAGS) ..\..\src\common\webviewfshandler.cpp +$(OBJS)\webviewdll_webview_chromium.obj: ..\..\src\common\webview_chromium.cpp + $(CXX) /c /nologo /TP /Fo$@ $(WEBVIEWDLL_CXXFLAGS) ..\..\src\common\webview_chromium.cpp + +$(OBJS)\webviewdll_version.res: ..\..\src\msw\version.rc + rc /fo$@ /d WIN32 /i ..\..\src\tiff\libtiff /i ..\..\src\jpeg /i ..\..\src\png /i ..\..\src\zlib /i ..\..\3rdparty\pcre\src\wx /i ..\..\src\expat\expat\lib $(____DEBUGRUNTIME_6) /d _CRT_SECURE_NO_DEPRECATE=1 /d _CRT_NON_CONFORMING_SWPRINTFS=1 /d _SCL_SECURE_NO_WARNINGS=1 $(__NO_VC_CRTDBG_p_73) $(__TARGET_CPU_COMPFLAG_p_73) /d __WXMSW__ $(__WXUNIV_DEFINE_p_67) $(__DEBUG_DEFINE_p_67) $(__NDEBUG_DEFINE_p_65) $(__EXCEPTIONS_DEFINE_p_65) $(__RTTI_DEFINE_p_65) $(__THREAD_DEFINE_p_65) /i $(SETUPHDIR) /i ..\..\include $(____CAIRO_INCLUDEDIR_FILENAMES_4) /d WXBUILDING /d WXDLLNAME=wx$(PORTNAME)$(WXUNIVNAME)$(WX_VERSION_NODOT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_webview$(WXCOMPILER)$(VENDORTAG) /i ..\..\3rdparty\webview2\build\native\include /d WXUSINGDLL /d WXMAKINGDLL_WEBVIEW /i ..\..\\3rdparty\cef ..\..\src\msw\version.rc + $(OBJS)\webviewlib_dummy.obj: ..\..\src\common\dummy.cpp $(CXX) /c /nologo /TP /Fo$@ $(WEBVIEWLIB_CXXFLAGS) /Ycwx/wxprec.h ..\..\src\common\dummy.cpp @@ -17187,6 +17204,9 @@ $(OBJS)\webviewlib_webviewarchivehandler.obj: ..\..\src\common\webviewarchivehan $(OBJS)\webviewlib_webviewfshandler.obj: ..\..\src\common\webviewfshandler.cpp $(CXX) /c /nologo /TP /Fo$@ $(WEBVIEWLIB_CXXFLAGS) ..\..\src\common\webviewfshandler.cpp +$(OBJS)\webviewlib_webview_chromium.obj: ..\..\src\common\webview_chromium.cpp + $(CXX) /c /nologo /TP /Fo$@ $(WEBVIEWLIB_CXXFLAGS) ..\..\src\common\webview_chromium.cpp + $(OBJS)\qadll_dummy.obj: ..\..\src\common\dummy.cpp $(CXX) /c /nologo /TP /Fo$@ $(QADLL_CXXFLAGS) /Ycwx/wxprec.h ..\..\src\common\dummy.cpp diff --git a/build/msw/wx_webview.vcxproj b/build/msw/wx_webview.vcxproj index 3080e50531..66a15ee1c5 100644 --- a/build/msw/wx_webview.vcxproj +++ b/build/msw/wx_webview.vcxproj @@ -138,7 +138,7 @@ Disabled - $(OutDir)$(wxIncSubDir);..\..\include;..\..\src\tiff\libtiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\3rdparty\pcre\src;..\..\src\expat\lib;..\..\3rdparty\webview2\build\native\include;%(AdditionalIncludeDirectories) + $(OutDir)$(wxIncSubDir);..\..\include;..\..\src\tiff\libtiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\3rdparty\pcre\src;..\..\src\expat\lib;..\..\3rdparty\webview2\build\native\include;..\..\3rdparty\cef;%(AdditionalIncludeDirectories) WIN32;_LIB;_DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;_UNICODE;WXBUILDING;%(PreprocessorDefinitions) Sync EnableFastChecks @@ -173,7 +173,7 @@ Disabled - $(OutDir)$(wxIncSubDir);..\..\include;..\..\src\tiff\libtiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\3rdparty\pcre\src;..\..\src\expat\lib;..\..\3rdparty\webview2\build\native\include;%(AdditionalIncludeDirectories) + $(OutDir)$(wxIncSubDir);..\..\include;..\..\src\tiff\libtiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\3rdparty\pcre\src;..\..\src\expat\lib;..\..\3rdparty\webview2\build\native\include;..\..\3rdparty\cef;%(AdditionalIncludeDirectories) WIN32;_LIB;_DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;_UNICODE;WXBUILDING;%(PreprocessorDefinitions) Sync EnableFastChecks @@ -209,7 +209,7 @@ MaxSpeed - $(OutDir)$(wxIncSubDir);..\..\include;..\..\src\tiff\libtiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\3rdparty\pcre\src;..\..\src\expat\lib;..\..\3rdparty\webview2\build\native\include;%(AdditionalIncludeDirectories) + $(OutDir)$(wxIncSubDir);..\..\include;..\..\src\tiff\libtiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\3rdparty\pcre\src;..\..\src\expat\lib;..\..\3rdparty\webview2\build\native\include;..\..\3rdparty\cef;%(AdditionalIncludeDirectories) WIN32;_LIB;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;NDEBUG;_UNICODE;WXBUILDING;%(PreprocessorDefinitions) Sync $(wxReleaseRuntimeLibrary) @@ -247,7 +247,7 @@ MaxSpeed - $(OutDir)$(wxIncSubDir);..\..\include;..\..\src\tiff\libtiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\3rdparty\pcre\src;..\..\src\expat\lib;..\..\3rdparty\webview2\build\native\include;%(AdditionalIncludeDirectories) + $(OutDir)$(wxIncSubDir);..\..\include;..\..\src\tiff\libtiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\3rdparty\pcre\src;..\..\src\expat\lib;..\..\3rdparty\webview2\build\native\include;..\..\3rdparty\cef;%(AdditionalIncludeDirectories) WIN32;_LIB;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;NDEBUG;_UNICODE;WXBUILDING;%(PreprocessorDefinitions) Sync $(wxReleaseRuntimeLibrary) @@ -284,7 +284,7 @@ Disabled - $(OutDir)$(wxIncSubDir);..\..\include;..\..\src\tiff\libtiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\3rdparty\pcre\src;..\..\src\expat\lib;..\..\3rdparty\webview2\build\native\include;%(AdditionalIncludeDirectories) + $(OutDir)$(wxIncSubDir);..\..\include;..\..\src\tiff\libtiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\3rdparty\pcre\src;..\..\src\expat\lib;..\..\3rdparty\webview2\build\native\include;..\..\3rdparty\cef;%(AdditionalIncludeDirectories) WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_WEBVIEW;%(PreprocessorDefinitions) Sync EnableFastChecks @@ -325,7 +325,7 @@ Disabled - $(OutDir)$(wxIncSubDir);..\..\include;..\..\src\tiff\libtiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\3rdparty\pcre\src;..\..\src\expat\lib;..\..\3rdparty\webview2\build\native\include;%(AdditionalIncludeDirectories) + $(OutDir)$(wxIncSubDir);..\..\include;..\..\src\tiff\libtiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\3rdparty\pcre\src;..\..\src\expat\lib;..\..\3rdparty\webview2\build\native\include;..\..\3rdparty\cef;%(AdditionalIncludeDirectories) WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_WEBVIEW;%(PreprocessorDefinitions) Sync EnableFastChecks @@ -365,7 +365,7 @@ MaxSpeed - $(OutDir)$(wxIncSubDir);..\..\include;..\..\src\tiff\libtiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\3rdparty\pcre\src;..\..\src\expat\lib;..\..\3rdparty\webview2\build\native\include;%(AdditionalIncludeDirectories) + $(OutDir)$(wxIncSubDir);..\..\include;..\..\src\tiff\libtiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\3rdparty\pcre\src;..\..\src\expat\lib;..\..\3rdparty\webview2\build\native\include;..\..\3rdparty\cef;%(AdditionalIncludeDirectories) WIN32;_USRDLL;DLL_EXPORTS;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_WEBVIEW;%(PreprocessorDefinitions) Sync $(wxReleaseRuntimeLibrary) @@ -409,7 +409,7 @@ MaxSpeed - $(OutDir)$(wxIncSubDir);..\..\include;..\..\src\tiff\libtiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\3rdparty\pcre\src;..\..\src\expat\lib;..\..\3rdparty\webview2\build\native\include;%(AdditionalIncludeDirectories) + $(OutDir)$(wxIncSubDir);..\..\include;..\..\src\tiff\libtiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\3rdparty\pcre\src;..\..\src\expat\lib;..\..\3rdparty\webview2\build\native\include;..\..\3rdparty\cef;%(AdditionalIncludeDirectories) WIN32;_USRDLL;DLL_EXPORTS;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_WEBVIEW;%(PreprocessorDefinitions) Sync $(wxReleaseRuntimeLibrary) @@ -459,6 +459,7 @@ + @@ -496,6 +497,7 @@ + diff --git a/build/msw/wx_webview.vcxproj.filters b/build/msw/wx_webview.vcxproj.filters index 50260adacc..d92aa9bd94 100644 --- a/build/msw/wx_webview.vcxproj.filters +++ b/build/msw/wx_webview.vcxproj.filters @@ -24,6 +24,9 @@ Common Sources + + Common Sources + Common Sources @@ -55,6 +58,9 @@ Common Headers + + Common Headers + Common Headers diff --git a/configure b/configure index 35668ba36e..7743158c8f 100755 --- a/configure +++ b/configure @@ -755,6 +755,7 @@ COND_PLATFORM_WIN32_1 COND_PLATFORM_WIN32_0_TOOLKIT_GTK_TOOLKIT_VERSION_4 COND_PLATFORM_WIN32_0_TOOLKIT_GTK_TOOLKIT_VERSION_3 COND_PLATFORM_WIN32_0 +COND_PLATFORM_UNIX_1_USE_WEBVIEW_CHROMIUM_1 COND_PLATFORM_UNIX_1_USE_PLUGINS_0 COND_PLATFORM_UNIX_1_USE_GUI_1 COND_PLATFORM_UNIX_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0 @@ -764,6 +765,7 @@ COND_PLATFORM_UNIX_1_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1 COND_PLATFORM_UNIX_1 COND_PLATFORM_UNIX_0 COND_PLATFORM_OS2_1 +COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1 COND_PLATFORM_MACOSX_1_USE_SOVERSION_1 COND_PLATFORM_MACOSX_1_USE_OPENGL_1 COND_PLATFORM_MACOSX_1_USE_GUI_1 @@ -786,6 +788,7 @@ COND_MONOLITHIC_1_SHARED_0 COND_MONOLITHIC_1 COND_MONOLITHIC_0_USE_XRC_1 COND_MONOLITHIC_0_USE_XML_1 +COND_MONOLITHIC_0_USE_WEBVIEW_CHROMIUM_1 COND_MONOLITHIC_0_USE_WEBVIEW_1 COND_MONOLITHIC_0_USE_STC_1 COND_MONOLITHIC_0_USE_RICHTEXT_1 @@ -896,6 +899,7 @@ TOOLKIT_LOWERCASE DEBUG_FLAG DEBUG_INFO WITH_PLUGIN_SDL +EXTRALDFLAGS_WEBVIEW EXTRALIBS_WEBVIEW EXTRALIBS_STC EXTRALIBS_SDL @@ -1233,6 +1237,8 @@ enable_postscript enable_printarch enable_svg enable_webview +enable_webviewchromium +enable_cef_debug enable_graphics_ctx enable_graphics_d2d enable_clipboard @@ -2200,6 +2206,8 @@ Optional Features: --enable-printarch use printing architecture --enable-svg use wxSVGFileDC device context --enable-webview use wxWebView library + --enable-webviewchromium use wxWebView Chromium backend + --enable-cef_debug use debug build of CEF wrapper --enable-graphics_ctx use graphics context 2D drawing API --enable-graphics-d2d use Direct2D-based graphics context --enable-clipboard use wxClipboard class @@ -8815,6 +8823,66 @@ fi eval "$wx_cv_use_webview" + + enablestring= + defaultval= + if test -z "$defaultval"; then + if test x"$enablestring" = xdisable; then + defaultval=yes + else + defaultval=no + fi + fi + + # Check whether --enable-webviewchromium was given. +if test "${enable_webviewchromium+set}" = set; then : + enableval=$enable_webviewchromium; + if test "$enableval" = yes; then + wx_cv_use_webviewchromium='wxUSE_WEBVIEW_CHROMIUM=yes' + else + wx_cv_use_webviewchromium='wxUSE_WEBVIEW_CHROMIUM=no' + fi + +else + + wx_cv_use_webviewchromium='wxUSE_WEBVIEW_CHROMIUM=${'DEFAULT_wxUSE_WEBVIEW_CHROMIUM":-$defaultval}" + +fi + + + eval "$wx_cv_use_webviewchromium" + + + + enablestring= + defaultval= + if test -z "$defaultval"; then + if test x"$enablestring" = xdisable; then + defaultval=yes + else + defaultval=no + fi + fi + + # Check whether --enable-cef_debug was given. +if test "${enable_cef_debug+set}" = set; then : + enableval=$enable_cef_debug; + if test "$enableval" = yes; then + wx_cv_use_cef_debug='wxUSE_CEF_DEBUG=yes' + else + wx_cv_use_cef_debug='wxUSE_CEF_DEBUG=no' + fi + +else + + wx_cv_use_cef_debug='wxUSE_CEF_DEBUG=${'DEFAULT_wxUSE_CEF_DEBUG":-$defaultval}" + +fi + + + eval "$wx_cv_use_cef_debug" + + if test "$wxUSE_MAC" != 1; then enablestring= @@ -12616,6 +12684,11 @@ fi eval "$wx_cv_use_wxdib" +if test "$wxUSE_MSW" != 1; then + DEFAULT_wxUSE_WEBVIEW_IE=no +fi + + enablestring= defaultval=$wxUSE_ALL_FEATURES if test -z "$defaultval"; then @@ -15296,8 +15369,18 @@ if test "$CXX" = "g++" -a "$GXX" != "yes"; then as_fn_error $? "C++ compiler is needed to build wxWidgets" "$LINENO" 5 fi -case "${wxWITH_CXX-11}" in +if test "$wxUSE_WEBVIEW_CHROMIUM" = "yes"; then + wxDEFAULT_CXXSTD=14 +else + wxDEFAULT_CXXSTD=11 +fi + +case "${wxWITH_CXX-$wxDEFAULT_CXXSTD}" in 11) + if test "$wxUSE_WEBVIEW_CHROMIUM" = "yes"; then + as_fn_error $? "Using wxWebView Chromium backend requires C++14 or later." "$LINENO" 5 + fi + ax_cxx_compile_alternatives="11 0x" ax_cxx_compile_cxx11_required=true ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' @@ -38991,7 +39074,7 @@ if test "$wxUSE_RICHTEXT" = "yes"; then fi if test "$wxUSE_WEBVIEW" = "yes"; then - USE_WEBVIEW_WEBKIT=0 + USE_WEBVIEW_WEBKIT=0 USE_WEBVIEW_WEBKIT2=0 if test "$wxUSE_WEBVIEW_WEBKIT" = "yes"; then if test "$wxUSE_GTK" = 1; then @@ -39258,9 +39341,6 @@ fi wxUSE_WEBVIEW="yes" $as_echo "#define wxUSE_WEBVIEW_WEBKIT2 1" >>confdefs.h - else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: WebKit not available, disabling wxWebView" >&5 -$as_echo "$as_me: WARNING: WebKit not available, disabling wxWebView" >&2;} fi elif test "$wxUSE_MSW" = 1; then if test "$wxUSE_WEBVIEW_IE" = "yes"; then @@ -39273,7 +39353,130 @@ $as_echo "$as_me: WARNING: WebKit not available, disabling wxWebView" >&2;} $as_echo "#define wxUSE_WEBVIEW_EDGE 1" >>confdefs.h fi + else + if test "$wxUSE_WEBVIEW_IE" = "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: wxWebView IE backend only available under MSW, ignoring --enable-webviewie" >&5 +$as_echo "$as_me: WARNING: wxWebView IE backend only available under MSW, ignoring --enable-webviewie" >&2;} + wxUSE_WEBVIEW_IE=no + fi + if test "$wxUSE_WEBVIEW_EDGE" = "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: wxWebView Edge backend only available under MSW, ignoring --enable-webviewedge" >&5 +$as_echo "$as_me: WARNING: wxWebView Edge backend only available under MSW, ignoring --enable-webviewedge" >&2;} + wxUSE_WEBVIEW_EDGE=no + fi fi + + if test "$wxUSE_WEBVIEW_CHROMIUM" = "yes"; then + CEF_DIR="$srcdir/3rdparty/cef" + CEF_DLL_WRAPPER_DIR="$CEF_DIR/libcef_dll_wrapper" + + EXTRALIBS_WEBVIEW="-L$CEF_DLL_WRAPPER_DIR -lcef_dll_wrapper $EXTRALIBS_WEBVIEW" + if test "$wxUSE_MAC" != 1; then + EXTRALDFLAGS_WEBVIEW="-L$CEF_DIR/Release -Wl,--no-as-needed -lcef -Wl,--as-needed" + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CEF" >&5 +$as_echo_n "checking for CEF... " >&6; } +if ${wx_cv_lib_cef+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + old_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="-I$CEF_DIR $CPPFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "include/cef_version.h" +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + wx_cv_lib_cef=yes +else + cef_error="Chromium headers not found" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + if test "$wx_cv_lib_cef" = "yes"; then + old_LIBS="$LIBS" + + LIBS="$EXTRALDFLAGS_WEBVIEW $EXTRALIBS_WEBVIEW $LIBS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #include "include/cef_app.h" + + int main() + { + CefShutdown(); + } + +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + +else + + wx_cv_lib_cef=no, + cef_error="Linking with CEF failed, check that CEF wrapper library is in $CEF_DLL_WRAPPER_DIR" + + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$old_LIBS" + fi + + CPPFLAGS="$old_CPPFLAGS" + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wx_cv_lib_cef" >&5 +$as_echo "$wx_cv_lib_cef" >&6; } + + if test "$wx_cv_lib_cef" = "yes"; then + if test "$wxUSE_MAC" = 1; then + EXTRALIBS_WEBVIEW="-F$CEF_DIR/Release -framework Chromium\ Embedded\ Framework $EXTRALIBS_WEBVIEW" + fi + + wxUSE_WEBVIEW="yes" + USE_WEBVIEW_CHROMIUM=1 + $as_echo "#define wxUSE_WEBVIEW_CHROMIUM 1" >>confdefs.h + + + if test "$wxUSE_CEF_DEBUG" = "yes"; then + $as_echo "#define wxHAVE_CEF_DEBUG 1" >>confdefs.h + + fi + else + as_fn_error $? "CEF not detected: $cef_error + +Please install it following the instructions in the manual or remove the +--enable-webviewchromium option from configure command line" "$LINENO" 5 + fi + fi + fi if test "$wxUSE_WEBVIEW" = "yes"; then @@ -39283,6 +39486,8 @@ if test "$wxUSE_WEBVIEW" = "yes"; then SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS webview" else USE_WEBVIEW=0 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No wxWebView backends found, disabling wxWebView" >&5 +$as_echo "$as_me: WARNING: No wxWebView backends found, disabling wxWebView" >&2;} fi @@ -40479,6 +40684,7 @@ fi + TOOLKIT_LOWERCASE=`echo $TOOLKIT | tr '[A-Z]' '[a-z]'` @@ -42109,6 +42315,11 @@ EOF COND_MONOLITHIC_0_USE_WEBVIEW_1="" fi + COND_MONOLITHIC_0_USE_WEBVIEW_CHROMIUM_1="#" + if test "x$MONOLITHIC" = "x0" -a "x$USE_WEBVIEW_CHROMIUM" = "x1" ; then + COND_MONOLITHIC_0_USE_WEBVIEW_CHROMIUM_1="" + fi + COND_MONOLITHIC_0_USE_XML_1="#" if test "x$MONOLITHIC" = "x0" -a "x$USE_XML" = "x1" ; then COND_MONOLITHIC_0_USE_XML_1="" @@ -42219,6 +42430,11 @@ EOF COND_PLATFORM_MACOSX_1_USE_SOVERSION_1="" fi + COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1="#" + if test "x$PLATFORM_MACOSX" = "x1" -a "x$USE_WEBVIEW_CHROMIUM" = "x1" ; then + COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1="" + fi + COND_PLATFORM_OS2_1="#" if test "x$PLATFORM_OS2" = "x1" ; then COND_PLATFORM_OS2_1="" @@ -42264,6 +42480,11 @@ EOF COND_PLATFORM_UNIX_1_USE_PLUGINS_0="" fi + COND_PLATFORM_UNIX_1_USE_WEBVIEW_CHROMIUM_1="#" + if test "x$PLATFORM_UNIX" = "x1" -a "x$USE_WEBVIEW_CHROMIUM" = "x1" ; then + COND_PLATFORM_UNIX_1_USE_WEBVIEW_CHROMIUM_1="" + fi + COND_PLATFORM_WIN32_0="#" if test "x$PLATFORM_WIN32" = "x0" ; then COND_PLATFORM_WIN32_0="" @@ -44709,6 +44930,27 @@ echo " zlib ${wxUSE_ZLIB}" echo " expat ${wxUSE_EXPAT}" echo " libmspack ${wxUSE_LIBMSPACK}" echo " sdl ${wxUSE_LIBSDL}" - +echo $ECHO_N " webview ${wxUSE_WEBVIEW}$ECHO_C" +if test "$wxUSE_WEBVIEW" = "yes"; then + echo $ECHO_N " (with backends:$ECHO_C" + if test "$wxUSE_WEBVIEW_WEBKIT" = "yes"; then + echo $ECHO_N " WebKit$ECHO_C" + fi + if test "$wxUSE_WEBVIEW_WEBKIT2" = "yes"; then + echo $ECHO_N " WebKit2$ECHO_C" + fi + if test "$wxUSE_WEBVIEW_EDGE" = "yes"; then + echo $ECHO_N " Edge$ECHO_C" + fi + if test "$wxUSE_WEBVIEW_IE" = "yes"; then + echo $ECHO_N " IE$ECHO_C" + fi + if test "$wxUSE_WEBVIEW_CHROMIUM" = "yes"; then + echo $ECHO_N " Chromium$ECHO_C" + fi + echo ")" +else + echo "no" +fi echo "" diff --git a/configure.ac b/configure.ac index 3f0e97a91b..d02a0c8c93 100644 --- a/configure.ac +++ b/configure.ac @@ -785,6 +785,15 @@ WX_ARG_FEATURE(printarch, [ --enable-printarch use printing architecture WX_ARG_FEATURE(svg, [ --enable-svg use wxSVGFileDC device context], wxUSE_SVG) WX_ARG_FEATURE(webview, [ --enable-webview use wxWebView library], wxUSE_WEBVIEW) +dnl This one is not enabled by default as it requires CEF to be available under +dnl 3rdparty/cef. +WX_ARG_ENABLE(webviewchromium, [ --enable-webviewchromium use wxWebView Chromium backend], wxUSE_WEBVIEW_CHROMIUM) + +dnl When using wxWebViewChromium, we assume that CEF wrapper DLL was built in +dnl release mode, use this option if it was built in debug one, i.e. with +dnl -DCMAKE_BUILD_TYPE=Debug +WX_ARG_ENABLE(cef_debug, [ --enable-cef_debug use debug build of CEF wrapper], wxUSE_CEF_DEBUG) + dnl wxDC is implemented in terms of wxGraphicsContext in wxOSX so the latter dnl can't be disabled, don't even provide an option to do it if test "$wxUSE_MAC" != 1; then @@ -1027,6 +1036,13 @@ WX_ARG_FEATURE(ownerdrawn, [ --enable-ownerdrawn use owner drawn controls WX_ARG_FEATURE(taskbarbutton,[ --enable-taskbarbutton enable wxTaskBarButton (Win32 only)], wxUSE_TASKBARBUTTON) WX_ARG_FEATURE(uxtheme, [ --enable-uxtheme enable support for Windows XP themed look (Win32 only)], wxUSE_UXTHEME) WX_ARG_FEATURE(wxdib, [ --enable-wxdib use wxDIB class (Win32 only)], wxUSE_DIB) + +dnl Turn off MSW-only IE webview backend here to avoid reporting it as "on" in +dnl the final summary message (Edge is turned off by default). +if test "$wxUSE_MSW" != 1; then + DEFAULT_wxUSE_WEBVIEW_IE=no +fi + WX_ARG_FEATURE(webviewie, [ --enable-webviewie use wxWebView IE backend (Win32 only)], wxUSE_WEBVIEW_IE) WX_ARG_FEATURE(webviewedge, [ --enable-webviewedge use wxWebView Edge backend (Win32 only)], wxUSE_WEBVIEW_EDGE) @@ -1081,10 +1097,22 @@ if test "$CXX" = "g++" -a "$GXX" != "yes"; then AC_MSG_ERROR([C++ compiler is needed to build wxWidgets]) fi +dnl CEF requires at least C++14, so default to it and not C++11 when using it. +if test "$wxUSE_WEBVIEW_CHROMIUM" = "yes"; then + wxDEFAULT_CXXSTD=14 +else + dnl By default we just need C++11. + wxDEFAULT_CXXSTD=11 +fi + dnl AX_CXX_COMPILE_STDCXX requires its VERSION argument to be specified at dnl autoconf, not run, time. -case "${wxWITH_CXX-11}" in +case "${wxWITH_CXX-$wxDEFAULT_CXXSTD}" in 11) + if test "$wxUSE_WEBVIEW_CHROMIUM" = "yes"; then + AC_MSG_ERROR([Using wxWebView Chromium backend requires C++14 or later.]) + fi + AX_CXX_COMPILE_STDCXX(11) ;; @@ -6784,6 +6812,8 @@ if test "$wxUSE_RICHTEXT" = "yes"; then fi if test "$wxUSE_WEBVIEW" = "yes"; then + dnl Work through the backends and see if any are available, if not then + dnl disable wxWebView and print a warning. USE_WEBVIEW_WEBKIT=0 USE_WEBVIEW_WEBKIT2=0 if test "$wxUSE_WEBVIEW_WEBKIT" = "yes"; then @@ -6843,8 +6873,6 @@ if test "$wxUSE_WEBVIEW" = "yes"; then elif test "$USE_WEBVIEW_WEBKIT2" = 1; then wxUSE_WEBVIEW="yes" AC_DEFINE(wxUSE_WEBVIEW_WEBKIT2) - else - AC_MSG_WARN([WebKit not available, disabling wxWebView]) fi elif test "$wxUSE_MSW" = 1; then if test "$wxUSE_WEBVIEW_IE" = "yes"; then @@ -6857,7 +6885,99 @@ if test "$wxUSE_WEBVIEW" = "yes"; then wxUSE_WEBVIEW="yes" AC_DEFINE(wxUSE_WEBVIEW_EDGE) fi + else + if test "$wxUSE_WEBVIEW_IE" = "yes"; then + AC_MSG_WARN([wxWebView IE backend only available under MSW, ignoring --enable-webviewie]) + wxUSE_WEBVIEW_IE=no + fi + if test "$wxUSE_WEBVIEW_EDGE" = "yes"; then + AC_MSG_WARN([wxWebView Edge backend only available under MSW, ignoring --enable-webviewedge]) + wxUSE_WEBVIEW_EDGE=no + fi fi + + if test "$wxUSE_WEBVIEW_CHROMIUM" = "yes"; then + CEF_DIR="$srcdir/3rdparty/cef" + CEF_DLL_WRAPPER_DIR="$CEF_DIR/libcef_dll_wrapper" + + EXTRALIBS_WEBVIEW="-L$CEF_DLL_WRAPPER_DIR -lcef_dll_wrapper $EXTRALIBS_WEBVIEW" + if test "$wxUSE_MAC" != 1; then + dnl We need to make sure that libcef.so is loaded + dnl first, so ensure that it is always linked in. + EXTRALDFLAGS_WEBVIEW="-L$CEF_DIR/Release -Wl,--no-as-needed -lcef -Wl,--as-needed" + fi + + AC_CACHE_CHECK([for CEF], wx_cv_lib_cef, + [ + AC_LANG_PUSH(C++) + + dnl Search for the Chromium headers in 3rdparty/cef + old_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="-I$CEF_DIR $CPPFLAGS" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([#include "include/cef_version.h"], [])], + [wx_cv_lib_cef=yes], + [cef_error="Chromium headers not found"] + ) + + dnl And that we can link with CEF. + if test "$wx_cv_lib_cef" = "yes"; then + old_LIBS="$LIBS" + + LIBS="$EXTRALDFLAGS_WEBVIEW $EXTRALIBS_WEBVIEW $LIBS" + + AC_LINK_IFELSE([ + AC_LANG_SOURCE([ + #include "include/cef_app.h" + + int main() + { + CefShutdown(); + }]) + ], + [], + [ + wx_cv_lib_cef=no, + cef_error="Linking with CEF failed, check that CEF wrapper library is in $CEF_DLL_WRAPPER_DIR" + ] + ) + + LIBS="$old_LIBS" + fi + + CPPFLAGS="$old_CPPFLAGS" + + AC_LANG_POP() + ] + ) + + if test "$wx_cv_lib_cef" = "yes"; then + dnl This is a horrible hack but there simply doesn't seem to be a + dnl way to pass a string containing spaces as a single argument, so + dnl we can't include it in LIBS above, but luckily the test program + dnl actually links under Mac even without it, so we just add it + dnl here after the test, so it's used when linking our actual code. + if test "$wxUSE_MAC" = 1; then + EXTRALIBS_WEBVIEW="-F$CEF_DIR/Release -framework Chromium\ Embedded\ Framework $EXTRALIBS_WEBVIEW" + fi + + wxUSE_WEBVIEW="yes" + USE_WEBVIEW_CHROMIUM=1 + AC_DEFINE(wxUSE_WEBVIEW_CHROMIUM) + + dnl Just trust the option value, we don't really have any simple + dnl way to check the CEF wrapper DLL build type. + if test "$wxUSE_CEF_DEBUG" = "yes"; then + AC_DEFINE(wxHAVE_CEF_DEBUG) + fi + else + AC_MSG_ERROR([CEF not detected: $cef_error + +Please install it following the instructions in the manual or remove the +--enable-webviewchromium option from configure command line]) + fi + fi + fi if test "$wxUSE_WEBVIEW" = "yes"; then @@ -6866,6 +6986,7 @@ if test "$wxUSE_WEBVIEW" = "yes"; then SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS webview" else USE_WEBVIEW=0 + AC_MSG_WARN([No wxWebView backends found, disabling wxWebView]) fi dnl --------------------------------------------------------------------------- @@ -7676,6 +7797,7 @@ AC_SUBST(EXTRALIBS_OPENGL) AC_SUBST(EXTRALIBS_SDL) AC_SUBST(EXTRALIBS_STC) AC_SUBST(EXTRALIBS_WEBVIEW) +AC_SUBST(EXTRALDFLAGS_WEBVIEW) AC_SUBST(WITH_PLUGIN_SDL) AC_SUBST(DEBUG_INFO) AC_SUBST(DEBUG_FLAG) @@ -8143,7 +8265,28 @@ echo " zlib ${wxUSE_ZLIB}" echo " expat ${wxUSE_EXPAT}" echo " libmspack ${wxUSE_LIBMSPACK}" echo " sdl ${wxUSE_LIBSDL}" - +echo $ECHO_N " webview ${wxUSE_WEBVIEW}$ECHO_C" +if test "$wxUSE_WEBVIEW" = "yes"; then + echo $ECHO_N " (with backends:$ECHO_C" + if test "$wxUSE_WEBVIEW_WEBKIT" = "yes"; then + echo $ECHO_N " WebKit$ECHO_C" + fi + if test "$wxUSE_WEBVIEW_WEBKIT2" = "yes"; then + echo $ECHO_N " WebKit2$ECHO_C" + fi + if test "$wxUSE_WEBVIEW_EDGE" = "yes"; then + echo $ECHO_N " Edge$ECHO_C" + fi + if test "$wxUSE_WEBVIEW_IE" = "yes"; then + echo $ECHO_N " IE$ECHO_C" + fi + if test "$wxUSE_WEBVIEW_CHROMIUM" = "yes"; then + echo $ECHO_N " Chromium$ECHO_C" + fi + echo ")" +else + echo "no" +fi echo "" dnl vi: set et sts=4 sw=4 com=\:dnl: diff --git a/include/wx/android/setup.h b/include/wx/android/setup.h index 2bd971a541..652b874574 100644 --- a/include/wx/android/setup.h +++ b/include/wx/android/setup.h @@ -711,6 +711,13 @@ // Recommended setting: 1 #define wxUSE_WEBVIEW 1 +// Use the Chromium Embedded Framework wxWebview backend +// +// Default is 0 +// +// Recommended setting: 0 +#define wxUSE_WEBVIEW_CHROMIUM 0 + // Use the IE wxWebView backend // // Default is 1 on MSW diff --git a/include/wx/chkconf.h b/include/wx/chkconf.h index e4c69faa80..9cf435a3f2 100644 --- a/include/wx/chkconf.h +++ b/include/wx/chkconf.h @@ -2280,7 +2280,8 @@ #endif /* wxUSE_TREELISTCTRL */ #if wxUSE_WEBVIEW && !(wxUSE_WEBVIEW_WEBKIT || wxUSE_WEBVIEW_WEBKIT2 || \ - wxUSE_WEBVIEW_IE || wxUSE_WEBVIEW_EDGE) + wxUSE_WEBVIEW_IE || wxUSE_WEBVIEW_EDGE || \ + wxUSE_WEBVIEW_CHROMIUM) # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_WEBVIEW requires at least one backend" # else diff --git a/include/wx/gtk/setup.h b/include/wx/gtk/setup.h index 07fbc7b4e4..7a75f1e1ea 100644 --- a/include/wx/gtk/setup.h +++ b/include/wx/gtk/setup.h @@ -711,6 +711,13 @@ // Recommended setting: 1 #define wxUSE_WEBVIEW 1 +// Use the Chromium Embedded Framework wxWebview backend +// +// Default is 0 +// +// Recommended setting: 0 +#define wxUSE_WEBVIEW_CHROMIUM 0 + // Use the IE wxWebView backend // // Default is 1 on MSW diff --git a/include/wx/gtk/webviewhistoryitem_webkit.h b/include/wx/gtk/webviewhistoryitem_webkit.h index 3137b3ae83..08a0628adc 100644 --- a/include/wx/gtk/webviewhistoryitem_webkit.h +++ b/include/wx/gtk/webviewhistoryitem_webkit.h @@ -11,7 +11,7 @@ #include "wx/setup.h" -#if wxUSE_WEBVIEW && (wxUSE_WEBVIEW_WEBKIT || wxUSE_WEBVIEW_WEBKIT2) && defined(__WXGTK__) +#if wxUSE_WEBVIEW && defined(__WXGTK__) class WXDLLIMPEXP_WEBVIEW wxWebViewHistoryItem { @@ -28,6 +28,6 @@ private: void* m_histItem; }; -#endif // wxUSE_WEBVIEW && wxUSE_WEBVIEW_WEBKIT && defined(__WXGTK__) +#endif // wxUSE_WEBVIEW && defined(__WXGTK__) #endif // _WX_GTK_WEBVIEWHISTORYITEM_H_ diff --git a/include/wx/msw/chkconf.h b/include/wx/msw/chkconf.h index 8110a2e10d..326945386a 100644 --- a/include/wx/msw/chkconf.h +++ b/include/wx/msw/chkconf.h @@ -339,12 +339,12 @@ # define wxUSE_MEDIACTRL 0 # endif # endif -# if wxUSE_WEBVIEW +# if wxUSE_WEBVIEW && wxUSE_WEBVIEW_IE # ifdef wxABORT_ON_CONFIG_ERROR -# error "wxWebView requires wxActiveXContainer under MSW" +# error "wxWebViewIE requires wxActiveXContainer under MSW" # else -# undef wxUSE_WEBVIEW -# define wxUSE_WEBVIEW 0 +# undef wxUSE_WEBVIEW_IE +# define wxUSE_WEBVIEW_IE 0 # endif # endif #endif /* !wxUSE_ACTIVEX */ diff --git a/include/wx/msw/setup.h b/include/wx/msw/setup.h index 51679db1ef..c503c75a9b 100644 --- a/include/wx/msw/setup.h +++ b/include/wx/msw/setup.h @@ -711,6 +711,13 @@ // Recommended setting: 1 #define wxUSE_WEBVIEW 1 +// Use the Chromium Embedded Framework wxWebview backend +// +// Default is 0 +// +// Recommended setting: 0 +#define wxUSE_WEBVIEW_CHROMIUM 0 + // Use the IE wxWebView backend // // Default is 1 on MSW diff --git a/include/wx/osx/private/webview_chromium.h b/include/wx/osx/private/webview_chromium.h new file mode 100644 index 0000000000..736b0a1a79 --- /dev/null +++ b/include/wx/osx/private/webview_chromium.h @@ -0,0 +1,25 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/osx/private/webview_chromium.h +// Purpose: Functions used in wxWebViewChromium Mac implementation +// Author: Vadim Zeitlin +// Created: 2023-09-05 +// Copyright: (c) 2023 Vadim Zeitlin +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_OSX_PRIVATE_WEBVIEW_CHROMIUM_H_ +#define _WX_OSX_PRIVATE_WEBVIEW_CHROMIUM_H_ + +wxGCC_WARNING_SUPPRESS(unused-parameter) + +#include "include/cef_base.h" + +wxGCC_WARNING_RESTORE(unused-parameter) + +// Called during startup to add CefAppProtocol support to wxNSApplication. +void wxWebViewChromium_InitOSX(); + +// Called to resize the given NSView to fit its parent. +void wxWebViewChromium_Resize(cef_window_handle_t handle, wxSize size); + +#endif // _WX_OSX_PRIVATE_WEBVIEW_CHROMIUM_H_ diff --git a/include/wx/osx/setup.h b/include/wx/osx/setup.h index fe2f2f6ead..298b64233e 100644 --- a/include/wx/osx/setup.h +++ b/include/wx/osx/setup.h @@ -718,6 +718,13 @@ // Recommended setting: 1 #define wxUSE_WEBVIEW 1 +// Use the Chromium Embedded Framework wxWebview backend +// +// Default is 0 +// +// Recommended setting: 0 +#define wxUSE_WEBVIEW_CHROMIUM 0 + // Use the IE wxWebView backend // // Default is 1 on MSW diff --git a/include/wx/private/init.h b/include/wx/private/init.h index 19fa540e05..c6a02ca8f9 100644 --- a/include/wx/private/init.h +++ b/include/wx/private/init.h @@ -66,4 +66,19 @@ struct WXDLLIMPEXP_BASE wxInitData wxDECLARE_NO_COPY_CLASS(wxInitData); }; +// Type of the hook function, see wxAddEntryHook(). If this function returns +// a value different from -1, the process exits using it as error code. +using wxEntryHook = int (*)(); + +// Set a special hook function which will be called before performing any +// normal initialization. Note that this hook can't use any wxWidgets +// functionality because nothing has been initialized yet, but can use +// wxInitData to examine the command line arguments and determine if it should +// be applied. +// +// This is currently used only by wxWebViewChromium to allow running Chromium +// helper applications without initializing GTK under Linux but could, in +// principle, be used for any other similar purpose. +WXDLLIMPEXP_BASE void wxAddEntryHook(wxEntryHook hook); + #endif // _WX_PRIVATE_INIT_H_ diff --git a/include/wx/setup_inc.h b/include/wx/setup_inc.h index f6200c70f4..4888a0c146 100644 --- a/include/wx/setup_inc.h +++ b/include/wx/setup_inc.h @@ -707,6 +707,13 @@ // Recommended setting: 1 #define wxUSE_WEBVIEW 1 +// Use the Chromium Embedded Framework wxWebview backend +// +// Default is 0 +// +// Recommended setting: 0 +#define wxUSE_WEBVIEW_CHROMIUM 0 + // Use the IE wxWebView backend // // Default is 1 on MSW diff --git a/include/wx/univ/setup.h b/include/wx/univ/setup.h index 6d3ffa8723..0464646037 100644 --- a/include/wx/univ/setup.h +++ b/include/wx/univ/setup.h @@ -711,6 +711,13 @@ // Recommended setting: 1 #define wxUSE_WEBVIEW 1 +// Use the Chromium Embedded Framework wxWebview backend +// +// Default is 0 +// +// Recommended setting: 0 +#define wxUSE_WEBVIEW_CHROMIUM 0 + // Use the IE wxWebView backend // // Default is 1 on MSW diff --git a/include/wx/webview.h b/include/wx/webview.h index 33bd1485fd..561b8ae85b 100644 --- a/include/wx/webview.h +++ b/include/wx/webview.h @@ -334,6 +334,9 @@ protected: void SendScriptResult(void* clientData, bool success, const wxString& output) const; + // Send wxEVT_WEBVIEW_CREATED event. This function is MT-safe. + void NotifyWebViewCreated(); + private: static void InitFactoryMap(); static wxStringWebViewFactoryMap::iterator FindFactory(const wxString &backend); @@ -377,6 +380,13 @@ class WXDLLIMPEXP_WEBVIEW wxWebViewEvent : public wxNotifyEvent { public: wxWebViewEvent() = default; + + wxWebViewEvent(wxWebView& webview, wxEventType type) + : wxNotifyEvent(type, webview.GetId()) + { + SetEventObject(&webview); + } + wxWebViewEvent(wxEventType type, int id, const wxString& url, const wxString target, wxWebViewNavigationActionFlags flags = wxWEBVIEW_NAV_ACTION_NONE, @@ -405,6 +415,7 @@ private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN_DEF_COPY(wxWebViewEvent); }; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_WEBVIEW_CREATED, wxWebViewEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_WEBVIEW_NAVIGATING, wxWebViewEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_WEBVIEW_NAVIGATED, wxWebViewEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_WEBVIEW_LOADED, wxWebViewEvent ); @@ -423,6 +434,10 @@ typedef void (wxEvtHandler::*wxWebViewEventFunction) #define wxWebViewEventHandler(func) \ wxEVENT_HANDLER_CAST(wxWebViewEventFunction, func) +#define EVT_WEBVIEW_CREATED(id, fn) \ + wx__DECLARE_EVT1(wxEVT_WEBVIEW_CREATED, id, \ + wxWebViewEventHandler(fn)) + #define EVT_WEBVIEW_NAVIGATING(id, fn) \ wx__DECLARE_EVT1(wxEVT_WEBVIEW_NAVIGATING, id, \ wxWebViewEventHandler(fn)) diff --git a/include/wx/webview_chromium.h b/include/wx/webview_chromium.h new file mode 100644 index 0000000000..1a587f76e7 --- /dev/null +++ b/include/wx/webview_chromium.h @@ -0,0 +1,250 @@ +///////////////////////////////////////////////////////////////////////////// +// Author: Steven Lamerton +// Copyright: (c) 2013 -2015 Steven Lamerton +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_WEBVIEWCHROMIUM_H_ +#define _WX_WEBVIEWCHROMIUM_H_ + +#include "wx/defs.h" + +#if wxUSE_WEBVIEW && wxUSE_WEBVIEW_CHROMIUM + +#include "wx/webview.h" +#include "wx/timer.h" + +class WXDLLIMPEXP_FWD_BASE wxFileName; + +extern WXDLLIMPEXP_DATA_WEBVIEW(const char) wxWebViewBackendChromium[]; + +// Private namespace containing classes used only in the implementation. +namespace wxCEF +{ +class ClientHandler; +struct ImplData; +} + +class WXDLLIMPEXP_WEBVIEW wxWebViewChromium : public wxWebView +{ +public: + wxWebViewChromium() { Init(); } + + explicit wxWebViewChromium(const wxWebViewConfiguration& config); + + wxWebViewChromium(wxWindow* parent, + wxWindowID id, + const wxString& url = wxWebViewDefaultURLStr, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxString& name = wxWebViewNameStr) + { + Init(); + + Create(parent, id, url, pos, size, style, name); + } + + ~wxWebViewChromium(); + + void SetPageSource(const wxString& pageSource); + + void SetPageText(const wxString& pageText); + + bool Create(wxWindow* parent, + wxWindowID id, + const wxString& url = wxWebViewDefaultURLStr, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxString& name = wxWebViewNameStr) override; + + virtual void LoadURL(const wxString& url) override; + virtual void LoadHistoryItem(wxSharedPtr item) override; + virtual wxVector > GetBackwardHistory() override; + virtual wxVector > GetForwardHistory() override; + + virtual bool CanGoForward() const override; + virtual bool CanGoBack() const override; + virtual void GoBack() override; + virtual void GoForward() override; + virtual void ClearHistory() override; + virtual void EnableHistory(bool enable = true) override; + virtual void Stop() override; + virtual void Reload(wxWebViewReloadFlags flags = wxWEBVIEW_RELOAD_DEFAULT) override; + virtual bool SetProxy(const wxString& proxy) override; + + virtual wxString GetPageSource() const override; + virtual wxString GetPageText() const override; + + virtual bool IsBusy() const override; + virtual wxString GetCurrentURL() const override; + virtual wxString GetCurrentTitle() const override; + + virtual void SetZoomType(wxWebViewZoomType type) override; + virtual wxWebViewZoomType GetZoomType() const override; + virtual bool CanSetZoomType(wxWebViewZoomType type) const override; + + virtual void Print() override; + + virtual wxWebViewZoom GetZoom() const override; + virtual void SetZoom(wxWebViewZoom zoom) override; + virtual float GetZoomFactor() const override; + virtual void SetZoomFactor(float zoom) override; + + virtual void* GetNativeBackend() const override; + + virtual long Find(const wxString& WXUNUSED(text), int WXUNUSED(flags) = wxWEBVIEW_FIND_DEFAULT) override { return wxNOT_FOUND; } + + //Clipboard functions + virtual bool CanCut() const override { return true; } + virtual bool CanCopy() const override { return true; } + virtual bool CanPaste() const override { return true; } + virtual void Cut() override; + virtual void Copy() override; + virtual void Paste() override; + + //Undo / redo functionality + virtual bool CanUndo() const override { return true; } + virtual bool CanRedo() const override { return true; } + virtual void Undo() override; + virtual void Redo() override; + + //Editing functions + virtual void SetEditable(bool enable = true) override; + virtual bool IsEditable() const override { return false; } + + //Selection + virtual void SelectAll() override; + virtual bool HasSelection() const override { return false; } + virtual void DeleteSelection() override; + virtual wxString GetSelectedText() const override { return ""; } + virtual wxString GetSelectedSource() const override { return ""; } + virtual void ClearSelection() override; + + virtual bool RunScript(const wxString& javascript, wxString* output = nullptr) const override; + + //Virtual Filesystem Support + virtual void RegisterHandler(wxSharedPtr handler) override; + + // Chromium-specific functions. + void SetRoot(const wxFileName& rootDir); + +#ifdef __WXGTK__ + virtual void GTKHandleRealized() override; +#endif + +protected: + virtual void DoSetPage(const wxString& html, const wxString& baseUrl) override; + +private: + // Common part of all ctors. + void Init(); + + void OnSize(wxSizeEvent& event); + + // Actually create the browser: this can only be done once the window is + // created in wxGTK. + bool DoCreateBrowser(const wxString& url); + + //History related variables, we currently use our own implementation + wxVector > m_historyList; + int m_historyPosition = -1; + bool m_historyLoadingFromList = false; + bool m_historyEnabled = true; + + //We need to store the title and zoom ourselves + wxString m_title; + wxWebViewZoom m_zoomLevel = wxWEBVIEW_ZOOM_MEDIUM; + + // Current main frame page source + wxString m_pageSource; + + // The text of the current page + wxString m_pageText; + + // Private data used by wxCEFClientHandler. + struct wxCEF::ImplData* m_implData = nullptr; + + // We also friend wxCEFClientHandler so it can access m_implData. + friend class wxCEF::ClientHandler; + wxCEF::ClientHandler* m_clientHandler = nullptr; + + friend class wxWebViewChromiumModule; + static bool ms_cefInitialized; + + static bool InitCEF(const wxWebViewConfiguration& config); + + static void ShutdownCEF(); + + wxDECLARE_DYNAMIC_CLASS(wxWebViewChromium); +}; + + +// Chrome-specific configuration class: a pointer to this object can be +// retrieved using wxWebViewConfiguration::GetNativeConfiguration() and used to +// configure some CEF-specific initialization options. +// +// Note that, contrary to the name of the accessor, this class is not native in +// this backend, although it contains data found in native (i.e. defined in +// Chrome) structs. +class wxWebViewConfigurationChromium +{ +public: + wxWebViewConfigurationChromium() = default; + + // Log file location: by default debug.log under data path is used. + wxString m_logFile; + + // Logging level must be one of cef_log_severity_t values (0 means default). + int m_logLevel = 0; +}; + + +class CefFrame; +class CefProcessMessage; + +// Chrome-specific event sent when a message from renderer process is received. +// +// It provides the message received from another process and a frame that can +// be used to send the reply back. +class WXDLLIMPEXP_WEBVIEW wxWebViewChromiumEvent : public wxCommandEvent +{ +public: + wxWebViewChromiumEvent() = default; + + wxWebViewChromiumEvent( + wxWebViewChromium& webview, + CefFrame& frame, + CefProcessMessage& message + ); + + CefFrame& GetFrame() const { return *m_frame; } + CefProcessMessage& GetMessage() const { return *m_message; } + + wxString GetMessageName() const; + +private: + CefFrame* const m_frame = nullptr; + CefProcessMessage* const m_message = nullptr; + + wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN_DEF_COPY(wxWebViewChromiumEvent); +}; + +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, + wxEVT_WEBVIEW_CHROMIUM_MESSAGE_RECEIVED, + wxWebViewChromiumEvent ); + +typedef void (wxEvtHandler::*wxWebViewChromiumEventFunction) + (wxWebViewChromiumEvent&); + +#define wxWebViewChromiumEventHandler(func) \ + wxEVENT_HANDLER_CAST(wxWebViewChromiumEventFunction, func) + +#define EVT_WEBVIEW_CHROMIUM_MESSAGE_RECEIVED(id, fn) \ + wx__DECLARE_EVT1(wxEVT_WEBVIEW_CHROMIUM_MESSAGE_RECEIVED, id, \ + wxWebViewChromiumEventHandler(fn)) + +#endif // wxUSE_WEBVIEW && wxUSE_WEBVIEW_CHROMIUM + +#endif // _WX_WEBVIEWCHROMIUM_H_ diff --git a/interface/wx/webview.h b/interface/wx/webview.h index da27d946c3..b37d237247 100644 --- a/interface/wx/webview.h +++ b/interface/wx/webview.h @@ -339,7 +339,8 @@ public: local storage, etc. @param path The path to the data directory. - @note This is only used by the Edge and WebKit2GTK+ backend. + @note This is used by Edge, WebKit2GTK+ and Chromium backends (the + latter creates "UserData" subdirectory under the given path). */ void SetDataPath(const wxString& path); @@ -350,7 +351,8 @@ public: local storage, etc. @return The path to the data directory. - @note This is only used by the Edge and WebKit2GTK+ backend. + @note This is used by Edge, WebKit2GTK+ and Chromium backends and + always returns empty string for the other ones. */ wxString GetDataPath() const; }; @@ -871,6 +873,11 @@ public: The predefined @c wxWebViewBackendWebKit constant contains the name of this backend. + @par wxWEBVIEW_CHROMIUM (MSW, OSX, GTK) + + The Chromium Embedded Framework backend has to be enabled when building wxWidgets, + see wxWebViewChromium for additional usage and build instructions. + @section async Asynchronous Notifications Many of the methods in wxWebView are asynchronous, i.e. they return @@ -899,6 +906,11 @@ public: @c scheme:///C:/example/docs.zip;protocol=zip/main.htm @beginEventEmissionTable{wxWebViewEvent} + @event{EVT_WEBVIEW_CREATED(id, func)} + Process a @c wxEVT_WEBVIEW_CREATED event, generated when the object is + fully initialized. For the backends using asynchronous initialization, + such as wxWebViewChromium, most of this class member functions can be + only used once this event is received. @event{EVT_WEBVIEW_NAVIGATING(id, func)} Process a @c wxEVT_WEBVIEW_NAVIGATING event, generated before trying to get a resource. This event may be vetoed to prevent navigating to this @@ -962,6 +974,12 @@ public: /** Creation function for two-step creation. + + Please note that the object creation may be asynchronous when using + some backends (currently this is the case only for wxWebViewChromium) + and the object is not really created until wxEVT_WEBVIEW_CREATED event + is received, so any non-trivial calls to its member functions should be + delayed until then. */ virtual bool Create(wxWindow* parent, wxWindowID id, @@ -994,6 +1012,10 @@ public: /** Factory function to create a new wxWebView using a wxWebViewFactory. + + Note that the returned object may not be immediately usable yet, see + Create() and wxEVT_WEBVIEW_CREATED. + @param parent Parent window for the control @param id ID of this control @param url Initial URL to load @@ -1217,8 +1239,17 @@ public: The @a proxy string must be a valid proxy specification, e.g. @c http://my.local.proxy.corp:8080 - @note Currently this function is only implemented in WebKit2 and Edge - backends and must be called before Create() for the latter one. + Currently this function is only implemented in WebKit2, Edge and + Chromium backends and only WebKit2 backend allows to set the proxy + after creating the webview, so it is recommended to call it before + Create(): + @code + auto webview = wxWebView::New(); + if ( !webview->SetProxy("http://127.0.0.1:8080") ) { + wxLogWarning("Setting proxy failed!"); + } + webview->Create(parent, wxID_ANY); + @endcode @return @true if proxy was set successfully or @false if it failed, e.g. because this is not supported by the currently used backend. @@ -1271,6 +1302,10 @@ public: - When using WebKit under macOS, code execution is limited to at most 10MiB of memory and 10 seconds of execution time. + - When using Chromium backend, retrieving the result of JavaScript + execution is unsupported and this function will always return false + if @a output is non-null to indicate this. + - When using IE backend under MSW, scripts can only be executed when the current page is fully loaded (i.e. @c wxEVT_WEBVIEW_LOADED event was received). A script tag inside the page HTML is required in order @@ -1790,6 +1825,11 @@ public: wxWebView objects. @beginEventEmissionTable{wxWebViewEvent} + @event{EVT_WEBVIEW_CREATED(id, func)} + Process a @c wxEVT_WEBVIEW_CREATED event, generated when the object is + fully initialized. For the backends using asynchronous initialization, + such as wxWebViewChromium, most of this class member functions can be + only used once this event is received. @event{EVT_WEBVIEW_NAVIGATING(id, func)} Process a @c wxEVT_WEBVIEW_NAVIGATING event, generated before trying to get a resource. This event may be vetoed to prevent navigating to this @@ -1916,6 +1956,7 @@ public: }; +wxEventType wxEVT_WEBVIEW_CREATED; wxEventType wxEVT_WEBVIEW_NAVIGATING; wxEventType wxEVT_WEBVIEW_NAVIGATED; wxEventType wxEVT_WEBVIEW_LOADED; diff --git a/interface/wx/webview_chromium.h b/interface/wx/webview_chromium.h new file mode 100644 index 0000000000..09a2bdab14 --- /dev/null +++ b/interface/wx/webview_chromium.h @@ -0,0 +1,443 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: webview_chromium.h +// Purpose: interface of wxWebViewChromium +// Author: wxWidgets team +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +/** + @class wxWebViewChromium + + wxWebViewChromium is a Chromium-based backend for wxWebView using the + Chromium Embedded Framework (CEF). + + This backend is only available for Windows, Linux and macOS and currently + requires CEF version 116. + + Using CEF also requires a compiler with C++14 support. + + @section requirements Building CEF + + If you are compiling your own copy of CEF then your compile flags must + match those you are using to compile wxWidgets. Specifically on Windows + it is likely you will need to adjust the following properties in the CEF + provided build files: + + - 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 + + @section instructions Build Instructions + + __General__ + + When wxWebViewChromium backend is enabled, it is compiled as part of the + webview library which means that this library depends on CEF and all + applications using it must be linked with it. + + Currently building wxWebViewChromium is possible only with configure-based + build system under Unix (including macOS) and using the provided MSVS + project files under MSW. Notably building it using CMake does not work. + + Before enabling wxWebViewChromium you need to ensure that CEF is available: + + 1. Download the binaries for your platform from the CEF official site at + https://cef-builds.spotifycdn.com/index.html ("Minimal Distribution" is + sufficient) + 2. Unpack the archive into `3rdparty/cef` directory under wxWidgets source + directory. + 3. Build `libcef_dll_wrapper` using the instructions provided in the CEF + distribution, but, in short, just by using `cmake` to do it. Please note + that if you use `-DCMAKE_BUILD_TYPE=Debug` under Unix when building it, you + need to pass `--enable-cef_debug` option to wxWidgets configure to avoid + mismatches between various definitions in the wrapper itself and in + wxWidgets. + 4. Copy the static library binary in the platform-dependent location: + - Under MSW, copy `libcefl_dll_wrapper.lib` file to either + `3rdparty/cef/Release` or `3rdparty/cef/Debug` depending on the build + configuration (it's recommended to build CEF wrapper in both + configurations and so copy the two files to both locations). + - Under Unix (including macOS), copy `libcef_dll_wrapper.a` file to + `3rdparty/cef/libcef_dll_wrapper` directory. + + Then enable wxWebViewChromium support: + + - Under MSW, set `wxUSE_WEBVIEW_CHROMIUM` to 1 in `wx/msw/setup.h`. + - Under Unix, add `--enable-webviewchromium` option to configure command + line. + + Finally, build wxWidgets as usual: the resulting webview library will + include wxWebViewChromium. + + It is recommended to build webview sample to check that everything is + working as expected. Under Unix, the required CEF files will be copied to + the sample directory as part of the build process, but under MSW you need + to copy them manually before running the sample: please copy + + - All files from either `3rdparty/cef/Debug` or + `3rdparty/cef/Release` folder, depending on your build type + - The contents of the wx_root/3rdparty/cef/Resources folder. + + to the directory containing `webview` executable. + + Please see CEF `README.txt` for more details and also note that when + redistributing CEF you must abide by the terms of its `LICENSE.txt`. + + Note that by default the webview sample uses the default platform-dependent + wxWebView backend and to use Chromium backend in it you need to set + `WX_WEBVIEW_BACKEND` environment variable to the value `wxWebViewChromium`. + + + __CEF Helper Process__ + + CEF uses multiple processes. The main process, using wxWidgets and creating + wxWebViewChromium, is known as the "browser process" but CEF also creates + additional helper processes for other tasks it needs to perform. Under + non-Mac platforms by default the main process itself is also used as the + helper process: if the main process detects the presence of the special + `--type=` command line option, it considers that it is executed as "CEF + helper" and just passes the command line to CEF instead of executing as + usual. This happens before executing any application-specific code and so + makes it impossible to use `--type` option for the application itself. + + Under macOS main process cannot be used as the helper process and a + separate executable with the fixed name must be built to be used instead. + wxWidgets provides a trivial source of such helper process in + `samples/webview/cef_process_helper.cpp` file, which has to be compiled and + linked with CEF at least under macOS. + + It may also be desirable to use a separate helper process under the other + platforms too and if an executable called `yourapp_cef_helper` (Unix) or + `yourapp_cef_helper.exe` (MSW), where `yourapp` is the name of the + application such as returned by wxApp::GetAppName(), is found in the same + directory as the main application executable itself, it will be used as the + CEF helper process. + + + __Microsoft Windows Platform__ + + Windows 10 or newer is required to run applications using wxWebViewChromium. + Such applications should also have an application manifest declaring compatibility + with supported Windows versions. + + Microsoft Visual C++ 2022 must be used to build wxWebViewChromium. + + When linking an application using it, both `libcef.lib` and + `libcef_dll_wrapper.lib` should be included in the libraries list. + + __Linux with GTK__ + + wxWebviewChromium currently only supports X11 and not Wayland, i.e. you + need to either ensure that `GDK_BACKEND` environment variable is set to + "x11" before running your program using it or call + + @code + gdk_set_allowed_backends("x11") + @endcode + + in your application code, otherwise wxWebView::IsBackendAvailable() will + return @false when the application is running under Wayland and creating + wxWebviewChromium will fail in this case. + + Moreover, the actual browser is only created once the window is shown, and + can't be used until then. You can bind an event handler for wxEVT_CREATE to + know when it is usable. + + + __Mac OS X Platform__ + + OS X 10.13 or above is required. + + Due to the application bundle structure on OS X, wxWebviewChromium is a + little more complicated than on Windows/Linux platforms as extra helper + applications for executing separate Chromium processes(renderer, plugin, + etc) are required. + + For applications using wxWebviewChromium, below are the steps to make + it work, based off the webview sample bakefile. + + 1. Build the webview library with CEF support. + 2. Compile/link/package the `YourApp helper` app: + - Require `cef_process_helper.cpp` + - Require link frameworks: Chromium Embedded Framework.framework, + AppKit.frameworks. + - Require app bundle configuration: Info.plist + - Use system tool `install_name_tool -change` to correct `Chromium + Embedded Framework.framework/Chromium Embedded Framework` location. + 3. Compile/link/package `YourApp` itself as usual under macOS. + 4. Create a `Contents/Frameworks` directory in `YourApp.app` bundle + and copy `Chromium Embedded Framework` and `YourApp helper.app` into it. + 5. Create clones of `YourApp helper.app`, in the same directory, with the + names `YourApp helper (Alerts).app`, `YourApp helper (GUI).app` etc. It + is possible to use symbolic links to `YourApp helper` binary for the + executable files of these extra helpers. + + Below is the wxWebviewChromium sample app bundle directory structure, + omitting some resource files + + webview.app + |____Contents + |____MacOS + | |____webview + |____Resources + | |____wxmac.icns + |____Frameworks + | |____webview Helper.app + | | |____Contents + | | |____MacOS + | | | |____webview Helper + | | |____Resources + | | | |____wxmac.icns + | | |____Info.plist + | |____webview Helper (GPU).app + | | |____Contents + | | |____MacOS + | | | |____webview Helper (GPU) + | | |____Resources + | | | |____wxmac.icns + | | |____Info.plist + | |____webview Helper (Plugin).app + | | |____Contents + | | |____MacOS + | | | |____webview Helper (Plugin) + | | |____Resources + | | | |____wxmac.icns + | | |____Info.plist + | |____Chromium Embedded Framework.framework + | | |____Resources + | | | |____chrome_200_percent.pak + | | | |____chrome_100_percent.pak + | | | |____icudtl.dat + | | | |____snapshot_blob.bin + | | | |____v8_context_snapshot.arm64.bin + | | | |____resources.pak + | | | |____gpu_shader_cache.bin + | | | |____Info.plist + | | |____Libraries + | | | |____libEGL.dylib + | | | |____vk_swiftshader_icd.json + | | | |____libvk_swiftshader.dylib + | | | |____libGLESv2.dylib + | | |____Chromium Embedded Framework + | |____webview Helper (Renderer).app + | | |____Contents + | | |____MacOS + | | | |____webview Helper (Renderer) + | | |____Resources + | | | |____wxmac.icns + | | |____Info.plist + | |____webview Helper (Alerts).app + | |____Contents + | |____MacOS + | | |____webview Helper (Alerts) + | |____Resources + | | |____wxmac.icns + | |____Info.plist + |____Info.plist + + + + @section differences API Differences + + wxWebViewChromium aims to support the full wxWebView API, but there are + some features which are currently unsupported: + + - GetSelectedSource/GetSelectedText: Always returns "". + - HasSelection: Always returns false. + - IsEditable: Always returns false. + - CanUndo/CanRedo/CanCut/CanCopy/CanPaste: Always returns true. + - Find: Always returns -1. + - RunScript: Retrieving the result of JavaScript execution is not supported and + if the @a output parameter is non-null, the function will always return false. + + wxWebView also provides some functions not available in the base class: + + - SetRoot() allows to use the given directory for all application files. + + + @section events Events + + wxWebViewChromiumEvent is a specific event generated when a message from + the renderer process (in which any user-defined JavaScript functions are + executing) is received in the browser process (containing UI). Such + messages are sent using `CefFrame::SendProcessMessage(PID_BROWSER)` from + the renderer process, but describing Chromium IPC in details is out of + scope of this document, please see Chromium documentation for more + information. + + @since 3.3.0 + @library{wxwebview} + @category{webview} + +**/ +class wxWebViewChromium : public wxWebView +{ +public: + /** + Default constructor. + + Use Create() to actually create the web view object later. + */ + wxWebViewChromium(); + + /** + Constructor allowing to specify extra configuration parameters. + + You must use Create() to really initialize the object created with this + constructor. + + Chromium-specific configuration parameters can be specified by setting + wxWebViewConfigurationChromium fields before passing @a config to this + function, e.g. + + @code + wxWebViewConfiguration config = + wxWebView::NewConfiguration(wxWebViewBackendChromium); + + auto configChrome = + static_cast(config.GetNativeConfiguration()); + configChrome->m_logFile = "/my/custom/CEF/log/file/path.txt"; + + auto webview = new wxWebViewChromium(config); + webview->Create(this, wxID_ANY, url); + @endcode + */ + explicit wxWebViewChromium(const wxWebViewConfiguration& config); + + /** + wxWebViewChromium constructor, arguments as per wxWebView::New. + */ + wxWebViewChromium(wxWindow* parent, + wxWindowID id, + const wxString& url = wxWebViewDefaultURLStr, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxString& name = wxWebViewNameStr); + + /** + Creation function for two-step creation. + */ + virtual bool Create(wxWindow* parent, + wxWindowID id, + const wxString& url = wxWebViewDefaultURLStr, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxString& name = wxWebViewNameStr); + + /** + Use the specified directory as root for the file:// URLs. + + After calling this function, all file paths will be resolved relatively + to the given @a rootDir rather than to the actual file system root. + */ + void SetRoot(const wxFileName& rootDir); +}; + + +/** + Chromium-specific configuration parameters. + + This simple class contains parameters that can be passed to the function + initializing CEF when wxWebView is used for the first time. + + To use this struct you need to cast the value returned from + wxWebViewConfiguration::GetNativeConfiguration() to this type: + @code + wxWebViewConfiguration config = + wxWebView::NewConfiguration(wxWebViewBackendChromium); + + auto configChrome = + static_cast(config.GetNativeConfiguration()); + configChrome->m_logLevel = 99; // Disable all logging. + @endcode + + @since 3.3.0 + */ +class wxWebViewConfigurationChromium +{ +public: + /** + Default constructor initializes the object to default parameters. + */ + wxWebViewConfigurationChromium(); + + /** + CEF log file location. + + Should be an absolute path if specified. + + If this variable is empty, `debug.log` under the data directory is + used. + */ + wxString m_logFile; + + /** + Logging level to use for CEF. + + This must be one of `cef_log_severity_t` values. + + Default value 0 means to use default "INFO" log level. + */ + int m_logLevel = 0; +}; + +/** + Event class for events generated exclusively by wxWebViewChromium. + + See wxWebViewEvent for other events also generated by wxWebViewEvent. + + Currently there is a single event type corresponding to this event: + `wxEVT_WEBVIEW_CHROMIUM_MESSAGE_RECEIVED`. To use it (this example assumes + that the required CEF headers are included): + + @code + webview->Bind( + wxEVT_WEBVIEW_CHROMIUM_MESSAGE_RECEIVED, + [this](wxWebViewChromiumEvent& event) { + if ( event.GetMessageName() == "MyCustomRequest" ) { + CefRefPtr arguments = event.GetMessage().GetArgumentList(); + CefRefPtr response = CefProcessMessage::Create("MyCustomResponse"); + + // ... do whatever is needed to construct the response ... + + event.GetFrame().SendProcessMessage(PID_RENDERER, response); + } else { + // Not our message. + event.Skip(); + } + } + ); + @endcode + + @since 3.3.0 + @library{wxwebview} + @category{webview} +**/ +class wxWebViewChromiumEvent : public wxCommandEvent +{ +public: + /** + Get the associated browser frame. + + This object can be used to call `SendProcessMessage(PID_RENDERER)` on + it to send the reply back to the renderer process. + */ + CefFrame& GetFrame() const; + + /** + Get the actual message. + + Message arguments can be used in the event handler to get information + associated with this message. + */ + CefProcessMessage& GetMessage() const; + + /** + Get the message name. + + This is just a convenient wrapper for `GetMessage().GetName()`. + */ + wxString GetMessageName() const; +}; diff --git a/samples/docview/Info.plist.in b/samples/docview/Info.plist.in index dfed6e326f..b5e320555b 100644 --- a/samples/docview/Info.plist.in +++ b/samples/docview/Info.plist.in @@ -2,75 +2,75 @@ - CFBundleDevelopmentRegion - English - CFBundleDocumentTypes - - - CFBundleTypeExtensions - - drw - - CFBundleTypeIconFile - chart.icns - CFBundleTypeName - DocView Drawing - CFBundleTypeOSTypes - - WXMB - - CFBundleTypeRole - Editor - LSTypeIsPackage - - NSPersistentStoreTypeKey - Binary - - - CFBundleTypeExtensions - - txt - text - - CFBundleTypeIconFile - notepad.icns - CFBundleTypeName - DocView Text - CFBundleTypeOSTypes - - TEXT - - CFBundleTypeRole - Editor - LSTypeIsPackage - - NSPersistentStoreTypeKey - Binary - - - CFBundleExecutable - ${MACOSX_BUNDLE_EXECUTABLE_NAME} - CFBundleGetInfoString - ${MACOSX_BUNDLE_INFO_STRING} - CFBundleIconFile - wxmac.icns - CFBundleIdentifier - ${MACOSX_BUNDLE_GUI_IDENTIFIER} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleLongVersionString - ${MACOSX_BUNDLE_LONG_VERSION_STRING} - CFBundleName - ${MACOSX_BUNDLE_BUNDLE_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - ${MACOSX_BUNDLE_SHORT_VERSION_STRING} - CFBundleVersion - ${MACOSX_BUNDLE_BUNDLE_VERSION} - NSHumanReadableCopyright - ${MACOSX_BUNDLE_COPYRIGHT} - NSPrincipalClass - wxNSApplication + CFBundleDevelopmentRegion + English + CFBundleDocumentTypes + + + CFBundleTypeExtensions + + drw + + CFBundleTypeIconFile + chart.icns + CFBundleTypeName + DocView Drawing + CFBundleTypeOSTypes + + WXMB + + CFBundleTypeRole + Editor + LSTypeIsPackage + + NSPersistentStoreTypeKey + Binary + + + CFBundleTypeExtensions + + txt + text + + CFBundleTypeIconFile + notepad.icns + CFBundleTypeName + DocView Text + CFBundleTypeOSTypes + + TEXT + + CFBundleTypeRole + Editor + LSTypeIsPackage + + NSPersistentStoreTypeKey + Binary + + + CFBundleExecutable + ${MACOSX_BUNDLE_EXECUTABLE_NAME} + CFBundleGetInfoString + ${MACOSX_BUNDLE_INFO_STRING} + CFBundleIconFile + wxmac.icns + CFBundleIdentifier + ${MACOSX_BUNDLE_GUI_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleLongVersionString + ${MACOSX_BUNDLE_LONG_VERSION_STRING} + CFBundleName + ${MACOSX_BUNDLE_BUNDLE_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + ${MACOSX_BUNDLE_SHORT_VERSION_STRING} + CFBundleVersion + ${MACOSX_BUNDLE_BUNDLE_VERSION} + NSHumanReadableCopyright + ${MACOSX_BUNDLE_COPYRIGHT} + NSPrincipalClass + wxNSApplication diff --git a/samples/internat/Info.plist.in b/samples/internat/Info.plist.in index e06f424b0b..621d3a7dd9 100644 --- a/samples/internat/Info.plist.in +++ b/samples/internat/Info.plist.in @@ -2,48 +2,48 @@ - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${MACOSX_BUNDLE_EXECUTABLE_NAME} - CFBundleGetInfoString - ${MACOSX_BUNDLE_INFO_STRING} - CFBundleIconFile - wxmac.icns - CFBundleIdentifier - ${MACOSX_BUNDLE_GUI_IDENTIFIER} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleLocalizations - - ar - bg - cs - de - en - fr - it - ka - pl - ru - sv - ja - - CFBundleLongVersionString - ${MACOSX_BUNDLE_LONG_VERSION_STRING} - CFBundleName - ${MACOSX_BUNDLE_BUNDLE_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - ${MACOSX_BUNDLE_SHORT_VERSION_STRING} - CFBundleVersion - ${MACOSX_BUNDLE_BUNDLE_VERSION} - NSHumanReadableCopyright - ${MACOSX_BUNDLE_COPYRIGHT} - ATSApplicationFontsPath - Fonts - NSPrincipalClass - wxNSApplication + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${MACOSX_BUNDLE_EXECUTABLE_NAME} + CFBundleGetInfoString + ${MACOSX_BUNDLE_INFO_STRING} + CFBundleIconFile + wxmac.icns + CFBundleIdentifier + ${MACOSX_BUNDLE_GUI_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleLocalizations + + ar + bg + cs + de + en + fr + it + ka + pl + ru + sv + ja + + CFBundleLongVersionString + ${MACOSX_BUNDLE_LONG_VERSION_STRING} + CFBundleName + ${MACOSX_BUNDLE_BUNDLE_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + ${MACOSX_BUNDLE_SHORT_VERSION_STRING} + CFBundleVersion + ${MACOSX_BUNDLE_BUNDLE_VERSION} + NSHumanReadableCopyright + ${MACOSX_BUNDLE_COPYRIGHT} + ATSApplicationFontsPath + Fonts + NSPrincipalClass + wxNSApplication diff --git a/samples/makefile.gcc b/samples/makefile.gcc index 5c6353e79b..d02460f1b2 100644 --- a/samples/makefile.gcc +++ b/samples/makefile.gcc @@ -19,10 +19,12 @@ MAKEARGS = LINK_DLL_FLAGS="$(LINK_DLL_FLAGS)" \ TOOLKIT_VERSION="$(TOOLKIT_VERSION)" WXUNIV="$(WXUNIV)" BUILD="$(BUILD)" \ DEBUG_INFO="$(DEBUG_INFO)" DEBUG_FLAG="$(DEBUG_FLAG)" \ MONOLITHIC="$(MONOLITHIC)" USE_GUI="$(USE_GUI)" USE_HTML="$(USE_HTML)" \ - USE_WEBVIEW="$(USE_WEBVIEW)" USE_MEDIA="$(USE_MEDIA)" USE_XML="$(USE_XML)" \ - USE_XRC="$(USE_XRC)" USE_AUI="$(USE_AUI)" USE_RIBBON="$(USE_RIBBON)" \ - USE_PROPGRID="$(USE_PROPGRID)" USE_RICHTEXT="$(USE_RICHTEXT)" \ - USE_STC="$(USE_STC)" USE_OPENGL="$(USE_OPENGL)" USE_QA="$(USE_QA)" \ + USE_WEBVIEW="$(USE_WEBVIEW)" \ + USE_WEBVIEW_CHROMIUM="$(USE_WEBVIEW_CHROMIUM)" USE_MEDIA="$(USE_MEDIA)" \ + USE_XML="$(USE_XML)" USE_XRC="$(USE_XRC)" USE_AUI="$(USE_AUI)" \ + USE_RIBBON="$(USE_RIBBON)" USE_PROPGRID="$(USE_PROPGRID)" \ + USE_RICHTEXT="$(USE_RICHTEXT)" USE_STC="$(USE_STC)" \ + USE_OPENGL="$(USE_OPENGL)" USE_QA="$(USE_QA)" \ USE_EXCEPTIONS="$(USE_EXCEPTIONS)" USE_RTTI="$(USE_RTTI)" \ USE_DPI_AWARE_MANIFEST="$(USE_DPI_AWARE_MANIFEST)" \ USE_THREADS="$(USE_THREADS)" USE_CAIRO="$(USE_CAIRO)" \ diff --git a/samples/makefile.vc b/samples/makefile.vc index 67ca5e35e2..bb2ac63ab4 100644 --- a/samples/makefile.vc +++ b/samples/makefile.vc @@ -19,10 +19,12 @@ MAKEARGS = CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" \ VISUALSTUDIOPLATFORM="$(VISUALSTUDIOPLATFORM)" DEBUG_INFO="$(DEBUG_INFO)" \ DEBUG_FLAG="$(DEBUG_FLAG)" DEBUG_RUNTIME_LIBS="$(DEBUG_RUNTIME_LIBS)" \ MONOLITHIC="$(MONOLITHIC)" USE_GUI="$(USE_GUI)" USE_HTML="$(USE_HTML)" \ - USE_WEBVIEW="$(USE_WEBVIEW)" USE_MEDIA="$(USE_MEDIA)" USE_XML="$(USE_XML)" \ - USE_XRC="$(USE_XRC)" USE_AUI="$(USE_AUI)" USE_RIBBON="$(USE_RIBBON)" \ - USE_PROPGRID="$(USE_PROPGRID)" USE_RICHTEXT="$(USE_RICHTEXT)" \ - USE_STC="$(USE_STC)" USE_OPENGL="$(USE_OPENGL)" USE_QA="$(USE_QA)" \ + USE_WEBVIEW="$(USE_WEBVIEW)" \ + USE_WEBVIEW_CHROMIUM="$(USE_WEBVIEW_CHROMIUM)" USE_MEDIA="$(USE_MEDIA)" \ + USE_XML="$(USE_XML)" USE_XRC="$(USE_XRC)" USE_AUI="$(USE_AUI)" \ + USE_RIBBON="$(USE_RIBBON)" USE_PROPGRID="$(USE_PROPGRID)" \ + USE_RICHTEXT="$(USE_RICHTEXT)" USE_STC="$(USE_STC)" \ + USE_OPENGL="$(USE_OPENGL)" USE_QA="$(USE_QA)" \ USE_EXCEPTIONS="$(USE_EXCEPTIONS)" USE_RTTI="$(USE_RTTI)" \ USE_DPI_AWARE_MANIFEST="$(USE_DPI_AWARE_MANIFEST)" \ USE_THREADS="$(USE_THREADS)" USE_CAIRO="$(USE_CAIRO)" \ diff --git a/samples/webview/Makefile.in b/samples/webview/Makefile.in index e213785719..bedd9614b9 100644 --- a/samples/webview/Makefile.in +++ b/samples/webview/Makefile.in @@ -34,6 +34,7 @@ EXTRALIBS_XML = @EXTRALIBS_XML@ EXTRALIBS_GUI = @EXTRALIBS_GUI@ EXTRALIBS_STC = @EXTRALIBS_STC@ EXTRALIBS_WEBVIEW = @EXTRALIBS_WEBVIEW@ +EXTRALDFLAGS_WEBVIEW = @EXTRALDFLAGS_WEBVIEW@ WX_CPPFLAGS = @WX_CPPFLAGS@ WX_CXXFLAGS = @WX_CXXFLAGS@ WX_LDFLAGS = @WX_LDFLAGS@ @@ -55,6 +56,10 @@ WEBVIEW_CXXFLAGS = $(WX_CPPFLAGS) -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ WEBVIEW_OBJECTS = \ $(__webview___win32rc) \ webview_webview.o +WEBVIEW_HELPER_CXXFLAGS = -I$(top_srcdir)//3rdparty/cef $(CPPFLAGS) \ + $(CXXFLAGS) +WEBVIEW_HELPER_OBJECTS = \ + webview_helper_cef_process_helper.o ### Conditionally set variables: ### @@ -116,6 +121,10 @@ COND_MONOLITHIC_0___WXLIB_CORE_p = \ COND_MONOLITHIC_0___WXLIB_BASE_p = \ -lwx_base$(WXBASEPORT)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX) @COND_MONOLITHIC_0@__WXLIB_BASE_p = $(COND_MONOLITHIC_0___WXLIB_BASE_p) +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@__package___depname \ +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@ = package +@COND_PLATFORM_UNIX_1_USE_WEBVIEW_CHROMIUM_1@__copy_cef_files___depname \ +@COND_PLATFORM_UNIX_1_USE_WEBVIEW_CHROMIUM_1@ = copy_cef_files COND_MONOLITHIC_1___WXLIB_MONO_p = \ -lwx_$(PORTNAME)$(WXUNIVNAME)u$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX) @COND_MONOLITHIC_1@__WXLIB_MONO_p = $(COND_MONOLITHIC_1___WXLIB_MONO_p) @@ -137,6 +146,10 @@ COND_MONOLITHIC_1___WXLIB_MONO_p = \ @COND_wxUSE_REGEX_builtin@ -lwxregexu$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX) @COND_wxUSE_EXPAT_builtin@__LIB_EXPAT_p = \ @COND_wxUSE_EXPAT_builtin@ -lwxexpat$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX) +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@__webview_helper___depname \ +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@ = webview_helper$(EXEEXT) +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@__fix_cef_link___depname \ +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@ = fix_cef_link @COND_USE_STC_1@__LIB_SCINTILLA_p = \ @COND_USE_STC_1@ -lwxscintilla$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX) @COND_USE_STC_1@__LIB_LEXILLA_p = \ @@ -144,7 +157,7 @@ COND_MONOLITHIC_1___WXLIB_MONO_p = \ ### Targets: ### -all: webview$(EXEEXT) $(__webview_bundle___depname) data +all: webview$(EXEEXT) $(__webview_bundle___depname) $(__package___depname) $(__copy_cef_files___depname) data $(__webview_helper___depname) $(__fix_cef_link___depname) install: @@ -157,12 +170,14 @@ clean: rm -f ./*.o rm -f webview$(EXEEXT) rm -rf webview.app + rm -f webview_helper$(EXEEXT) + rm -rf webview_helper.app distclean: clean rm -f config.cache config.log config.status bk-deps bk-make-pch Makefile webview$(EXEEXT): $(WEBVIEW_OBJECTS) $(__webview___win32rc) - $(CXX) -o $@ $(WEBVIEW_OBJECTS) -L$(LIBDIRNAME) $(LDFLAGS_GUI) $(SAMPLES_RPATH_FLAG) $(LDFLAGS) $(WX_LDFLAGS) $(__WXLIB_WEBVIEW_p) $(EXTRALIBS_WEBVIEW) $(__WXLIB_STC_p) $(EXTRALIBS_STC) $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__LIB_SCINTILLA_p) $(__LIB_LEXILLA_p) $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_LEXILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) $(EXTRALIBS_FOR_GUI) $(__LIB_ZLIB_p) $(__LIB_REGEX_p) $(__LIB_EXPAT_p) $(EXTRALIBS_FOR_BASE) $(LIBS) + $(CXX) -o $@ $(WEBVIEW_OBJECTS) -L$(LIBDIRNAME) $(LDFLAGS_GUI) $(SAMPLES_RPATH_FLAG) $(EXTRALDFLAGS_WEBVIEW) $(EXTRALDFLAGS_WEBVIEW) $(LDFLAGS) $(WX_LDFLAGS) $(__WXLIB_WEBVIEW_p) $(EXTRALIBS_WEBVIEW) $(__WXLIB_STC_p) $(EXTRALIBS_STC) $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__LIB_SCINTILLA_p) $(__LIB_LEXILLA_p) $(EXTRALIBS_WEBVIEW) $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_LEXILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) $(EXTRALIBS_FOR_GUI) $(__LIB_ZLIB_p) $(__LIB_REGEX_p) $(__LIB_EXPAT_p) $(EXTRALIBS_FOR_BASE) $(LIBS) $(__webview___os2_emxbindcmd) @COND_PLATFORM_MACOSX_1@webview.app/Contents/PkgInfo: webview$(EXEEXT) $(top_srcdir)/src/osx/carbon/Info.plist.in $(top_srcdir)/src/osx/carbon/wxmac.icns @@ -192,6 +207,27 @@ webview$(EXEEXT): $(WEBVIEW_OBJECTS) $(__webview___win32rc) @COND_PLATFORM_MACOSX_1@webview_bundle: $(____webview_BUNDLE_TGT_REF_DEP) +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@package: $(__webview_helper___depname) +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@ mkdir -p webview.app/Contents/Frameworks/ +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@ mkdir -p webview.app/Contents/Frameworks/webview\ Helper.app +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@ cp -Rf $(top_srcdir)//3rdparty/cef/Release/Chromium\ Embedded\ Framework.framework webview.app/Contents/Frameworks/ +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@ +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@ cp -Rf webview_helper.app/ webview.app/Contents/Frameworks/webview\ Helper.app/ +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@ for name in Alerts GPU Plugin Renderer; do \ +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@ helper_name="webview Helper ($$name)"; \ +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@ helper_contents="webview.app/Contents/Frameworks/$$helper_name.app/Contents"; \ +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@ mkdir -p "$$helper_contents/MacOS"; \ +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@ ln -fs "../../../webview Helper.app/Contents/MacOS/webview Helper" "$$helper_contents/MacOS/$$helper_name"; \ +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@ sed -e "s/\$${PRODUCT_NAME}/$$helper_name/" \ +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@ -e "s/\$${EXECUTABLE_NAME}/$$helper_name/" \ +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@ $(top_srcdir)//samples/webview/cef_helper_info.plist.in > "$$helper_contents/Info.plist"; \ +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@ cp webview_helper.app/Contents/PkgInfo "$$helper_contents"; \ +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@ cp -Rf webview_helper.app/Contents/Resources "$$helper_contents"; \ +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@ done + +@COND_PLATFORM_UNIX_1_USE_WEBVIEW_CHROMIUM_1@copy_cef_files: webview$(EXEEXT) +@COND_PLATFORM_UNIX_1_USE_WEBVIEW_CHROMIUM_1@ @for f in $(top_srcdir)//3rdparty/cef/Release/* $(top_srcdir)//3rdparty/cef/Resources/*; do [ -e $$f ] || ln -s $$f .; done + data: @mkdir -p . @for f in handler_advanced.html; do \ @@ -204,12 +240,34 @@ data: esac; \ done +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@webview_helper$(EXEEXT): $(WEBVIEW_HELPER_OBJECTS) +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@ $(CXX) -o $@ $(WEBVIEW_HELPER_OBJECTS) $(EXTRALDFLAGS_WEBVIEW) $(LDFLAGS) $(EXTRALIBS_WEBVIEW) $(LIBS) + +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@fix_cef_link: $(__webview_helper___depname) +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@ mkdir -p webview_helper.app +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@ mkdir -p webview_helper.app/Contents/MacOS +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@ mkdir -p webview_helper.app/Contents/Resources +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@ sed -e "s/\$${PRODUCT_NAME}/webview Helper/" \ +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@ -e "s/\$${EXECUTABLE_NAME}/webview Helper/" \ +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@ $(top_srcdir)//samples/webview/cef_helper_info.plist.in >webview_helper.app/Contents/Info.plist +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@ /bin/echo "APPL????" >webview_helper.app/Contents/PkgInfo +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@ +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@ install_name_tool -change \ +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@ "@executable_path/../Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework" \ +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@ "@executable_path/../../../../Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework" \ +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@ webview_helper +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@ cp -f webview_helper webview_helper.app/Contents/MacOS/webview\ Helper +@COND_PLATFORM_MACOSX_1_USE_WEBVIEW_CHROMIUM_1@ cp -f $(top_srcdir)//src/osx/carbon/wxmac.icns webview_helper.app/Contents/Resources/wxmac.icns + webview_sample_rc.o: $(srcdir)/../../samples/sample.rc $(WINDRES) -i$< -o$@ --define __WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p_1) $(__DEBUG_DEFINE_p_1) $(__EXCEPTIONS_DEFINE_p_1) $(__RTTI_DEFINE_p_1) $(__THREAD_DEFINE_p_1) --include-dir $(srcdir) $(__DLLFLAG_p_1) $(__WIN32_DPI_MANIFEST_p) --include-dir $(srcdir)/../../samples $(__RCDEFDIR_p) --include-dir $(top_srcdir)/include webview_webview.o: $(srcdir)/webview.cpp $(CXXC) -c -o $@ $(WEBVIEW_CXXFLAGS) $(srcdir)/webview.cpp +webview_helper_cef_process_helper.o: $(srcdir)/cef_process_helper.cpp + $(CXXC) -c -o $@ $(WEBVIEW_HELPER_CXXFLAGS) $(srcdir)/cef_process_helper.cpp + # Include dependency info, if present: @IF_GNU_MAKE@-include ./.deps/*.d diff --git a/samples/webview/cef_helper_info.plist.in b/samples/webview/cef_helper_info.plist.in new file mode 100644 index 0000000000..3ed98af440 --- /dev/null +++ b/samples/webview/cef_helper_info.plist.in @@ -0,0 +1,30 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${EXECUTABLE_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + org.wxwidgets.webviewsample.helper${BUNDLE_ID_SUFFIX} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleSignature + ???? + LSFileQuarantineEnabled + + LSMinimumSystemVersion + 10.5.0 + LSUIElement + 1 + NSSupportsAutomaticGraphicsSwitching + + + diff --git a/samples/webview/cef_process_helper.cpp b/samples/webview/cef_process_helper.cpp new file mode 100644 index 0000000000..1e86516b05 --- /dev/null +++ b/samples/webview/cef_process_helper.cpp @@ -0,0 +1,63 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: samples/webview/cef_process_helper.cpp +// Purpose: Simplest possible CEF helper. +// Author: Haojian Wu +// Created: 2014-06-22 +// Copyright: (c) 2014 - 2023 wxWidgets development team +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// This application doesn't use wxWidgets at all but does require CEF and its +// wrapper DLL. +// +// To build it using MSVC under MSW use +// +// > cl /Fewebview_cef_helper /MD /DNDEBUG /EHsc /I../../3rdparty/cef cef_process_helper.cpp ../../3rdparty/cef/Release/libcef.lib ../../3rdparty/cef/Release/libcef_dll_wrapper.lib +// +// in release mode and +// +// > cl /Fewebview_cef_helper /MDd /D_DEBUG /EHsc /I../../3rdparty/cef cef_process_helper.cpp ../../3rdparty/cef/Debug/libcef.lib ../../3rdparty/cef/Debug/libcef_dll_wrapper.lib +// +// in debug. +// +// Under Unix use +// +// $ c++ -o webview_cef_helper -I../../3rdparty/cef cef_process_helper.cpp -L../../3rdparty/cef/Release -lcef -L../../3rdparty/cef/libcef_dll_wrapper -lcef_dll_wrapper +// +// and under macOS see the commands executed by the sample makefile. + +#include "include/cef_app.h" +#if defined(__APPLE__) + #include "include/wrapper/cef_library_loader.h" +#endif + +// Define simplest possible process entry point just forwarding to CEF. +#if defined(_WIN32) + +extern "C" int WINAPI +WinMain(HINSTANCE hInstance, HINSTANCE, char*, int) +{ + CefMainArgs cefArgs(hInstance); + + return CefExecuteProcess(cefArgs, nullptr, nullptr); +} + +#else // !Windows + +int main(int argc, char* argv[]) +{ +#if defined(__APPLE__) + // Load the CEF framework library at runtime instead of linking directly + // as required by the macOS sandbox implementation. + CefScopedLibraryLoader library_loader; + if (!library_loader.LoadInHelper()) { + return 1; + } +#endif + + CefMainArgs cefArgs(argc, argv); + + return CefExecuteProcess(cefArgs, nullptr, nullptr); +} + +#endif // Windows/!Windows diff --git a/samples/webview/makefile.gcc b/samples/webview/makefile.gcc index aa0bbfbab7..d12b17f893 100644 --- a/samples/webview/makefile.gcc +++ b/samples/webview/makefile.gcc @@ -219,7 +219,7 @@ clean: $(OBJS)\webview.exe: $(WEBVIEW_OBJECTS) $(OBJS)\webview_sample_rc.o $(foreach f,$(subst \,/,$(WEBVIEW_OBJECTS)),$(shell echo $f >> $(subst \,/,$@).rsp.tmp)) @move /y $@.rsp.tmp $@.rsp >nul - $(CXX) -o $@ @$@.rsp $(__DEBUGINFO) $(__THREADSFLAG) -L$(LIBDIRNAME) -Wl,--subsystem,windows -mwindows $(____CAIRO_LIBDIR_FILENAMES_p) $(LDFLAGS) $(__WXLIB_WEBVIEW_p) $(__WXLIB_STC_p) -limm32 $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) -lwxscintilla$(WXDEBUGFLAG) $(__LIB_LEXILLA_p) $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_LEXILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) -lwxzlib$(WXDEBUGFLAG) -lwxregexu$(WXDEBUGFLAG) -lwxexpat$(WXDEBUGFLAG) $(EXTRALIBS_FOR_BASE) $(__CAIRO_LIB_p) -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lversion -lws2_32 -lwininet -loleacc -luxtheme + $(CXX) -o $@ @$@.rsp $(__DEBUGINFO) $(__THREADSFLAG) -L$(LIBDIRNAME) -Wl,--subsystem,windows -mwindows $(____CAIRO_LIBDIR_FILENAMES_p) $(LDFLAGS) $(__WXLIB_WEBVIEW_p) $(__WXLIB_STC_p) -limm32 $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) -lwxscintilla$(WXDEBUGFLAG) $(__LIB_LEXILLA_p) $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_LEXILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) -lwxzlib$(WXDEBUGFLAG) -lwxregexu$(WXDEBUGFLAG) -lwxexpat$(WXDEBUGFLAG) $(EXTRALIBS_FOR_BASE) $(__CAIRO_LIB_p) -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lversion -lws2_32 -lwininet -loleacc -luxtheme @-del $@.rsp data: diff --git a/samples/webview/makefile.vc b/samples/webview/makefile.vc index 0f314f7396..ac8486f1be 100644 --- a/samples/webview/makefile.vc +++ b/samples/webview/makefile.vc @@ -422,8 +422,8 @@ clean: -if exist $(OBJS)\webview.pdb del $(OBJS)\webview.pdb $(OBJS)\webview.exe: $(WEBVIEW_OBJECTS) $(OBJS)\webview_sample.res - link /NOLOGO /OUT:$@ $(__DEBUGINFO_1) /pdb:"$(OBJS)\webview.pdb" $(__DEBUGINFO_2) $(LINK_TARGET_CPU) /LIBPATH:$(LIBDIRNAME) $(WIN32_DPI_LINKFLAG) /SUBSYSTEM:WINDOWS $(____CAIRO_LIBDIR_FILENAMES_p) $(LDFLAGS) @<< - $(WEBVIEW_OBJECTS) $(WEBVIEW_RESOURCES) $(__WXLIB_WEBVIEW_p) $(__WXLIB_STC_p) imm32.lib $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) wxscintilla$(WXDEBUGFLAG).lib $(__LIB_LEXILLA_p) $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_LEXILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) wxzlib$(WXDEBUGFLAG).lib wxregexu$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib $(EXTRALIBS_FOR_BASE) $(__CAIRO_LIB_p) kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib ws2_32.lib wininet.lib + link /NOLOGO /OUT:$@ $(__DEBUGINFO_1) /pdb:"$(OBJS)\webview.pdb" $(__DEBUGINFO_2) $(LINK_TARGET_CPU) /LIBPATH:$(LIBDIRNAME) $(WIN32_DPI_LINKFLAG) /SUBSYSTEM:WINDOWS $(____CAIRO_LIBDIR_FILENAMES_p) $(LDFLAGS) @<< + $(WEBVIEW_OBJECTS) $(WEBVIEW_RESOURCES) $(__WXLIB_WEBVIEW_p) $(__WXLIB_STC_p) imm32.lib $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) wxscintilla$(WXDEBUGFLAG).lib $(__LIB_LEXILLA_p) $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_LEXILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) wxzlib$(WXDEBUGFLAG).lib wxregexu$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib $(EXTRALIBS_FOR_BASE) $(__CAIRO_LIB_p) kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib ws2_32.lib wininet.lib << data: diff --git a/samples/webview/webview.bkl b/samples/webview/webview.bkl index f9924e69ce..129834c5fc 100644 --- a/samples/webview/webview.bkl +++ b/samples/webview/webview.bkl @@ -15,7 +15,52 @@ $(LIB_SCINTILLA) $(LIB_LEXILLA) + $(EXTRALDFLAGS_WEBVIEW) + $(EXTRALIBS_WEBVIEW) + + + + webview_helper + all + + mkdir -p webview.app/Contents/Frameworks/ + mkdir -p webview.app/Contents/Frameworks/webview\ Helper.app + cp -Rf $(CEF_DIR)/Release/Chromium\ Embedded\ Framework.framework webview.app/Contents/Frameworks/ + + cp -Rf webview_helper.app/ webview.app/Contents/Frameworks/webview\ Helper.app/ + for name in Alerts GPU Plugin Renderer; do \ + helper_name="webview Helper ($$name)"; \ + helper_contents="webview.app/Contents/Frameworks/$$helper_name.app/Contents"; \ + mkdir -p "$$helper_contents/MacOS"; \ + ln -fs "../../../webview Helper.app/Contents/MacOS/webview Helper" "$$helper_contents/MacOS/$$helper_name"; \ + sed -e "s/\$${PRODUCT_NAME}/$$helper_name/" \ + -e "s/\$${EXECUTABLE_NAME}/$$helper_name/" \ + -e "s/\$${BUNDLE_ID_SUFFIX}/.$$helper_name/" \ + $(TOP_SRCDIR)/samples/webview/cef_helper_info.plist.in > "$$helper_contents/Info.plist"; \ + cp webview_helper.app/Contents/PkgInfo "$$helper_contents"; \ + cp -Rf webview_helper.app/Contents/Resources "$$helper_contents"; \ + done + + + + + + webview + all + + @for f in $(CEF_DIR)/Release/* $(CEF_DIR)/Resources/*; do [ -e $$f ] || ln -s $$f .; done + + + @@ -24,4 +69,42 @@ + + + cef_process_helper.cpp + + + $(CEF_DIR) + $(EXTRALDFLAGS_WEBVIEW) + $(EXTRALIBS_WEBVIEW) + + + webview_helper + all + + + mkdir -p webview_helper.app + mkdir -p webview_helper.app/Contents/MacOS + mkdir -p webview_helper.app/Contents/Resources + sed -e "s/\$${PRODUCT_NAME}/webview Helper/" \ + -e "s/\$${EXECUTABLE_NAME}/webview Helper/" \ + -e "s/\$${BUNDLE_ID_SUFFIX}//" \ + $(TOP_SRCDIR)/samples/webview/cef_helper_info.plist.in >webview_helper.app/Contents/Info.plist + /bin/echo "APPL????" >webview_helper.app/Contents/PkgInfo + + install_name_tool -change \ + "@executable_path/../Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework" \ + "@executable_path/../../../../Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework" \ + webview_helper + cp -f webview_helper webview_helper.app/Contents/MacOS/webview\ Helper + cp -f $(TOP_SRCDIR)/src/osx/carbon/wxmac.icns webview_helper.app/Contents/Resources/wxmac.icns + + + + rm -rf $(id).app + + + diff --git a/samples/webview/webview.cpp b/samples/webview/webview.cpp index c9c134bfb3..e0d08c3c17 100644 --- a/samples/webview/webview.cpp +++ b/samples/webview/webview.cpp @@ -18,7 +18,9 @@ #include "wx/wx.h" #endif -#if !wxUSE_WEBVIEW_WEBKIT && !wxUSE_WEBVIEW_WEBKIT2 && !wxUSE_WEBVIEW_IE && !wxUSE_WEBVIEW_EDGE +#if !wxUSE_WEBVIEW_WEBKIT && !wxUSE_WEBVIEW_WEBKIT2 && \ + !wxUSE_WEBVIEW_IE && !wxUSE_WEBVIEW_EDGE && \ + !wxUSE_WEBVIEW_CHROMIUM #error "A wxWebView backend is required by this sample" #endif @@ -27,6 +29,9 @@ #include "wx/notifmsg.h" #include "wx/settings.h" #include "wx/webview.h" +#if wxUSE_WEBVIEW_CHROMIUM +#include "wx/webview_chromium.h" +#endif #if wxUSE_WEBVIEW_IE #include "wx/msw/webview_ie.h" #endif @@ -41,6 +46,7 @@ #include "wx/fs_arc.h" #include "wx/fs_mem.h" #include "wx/stdpaths.h" +#include "wx/utils.h" #ifndef wxHAS_IMAGES_IN_RESOURCES #include "../sample.xpm" @@ -56,6 +62,14 @@ #include +// This sample can be built with and without wxUSE_WEBVIEW_CHROMIUM, so we +// can't put the libraries in the project linker options and have to link them +// from here. +#if defined(_MSC_VER) && wxUSE_WEBVIEW_CHROMIUM + #pragma comment(lib, "libcef") + #pragma comment(lib, "libcef_dll_wrapper") +#endif + //We map menu items to their history items using wxMenuHistoryMap = std::map>; @@ -330,6 +344,24 @@ bool WebApp::OnInit() "

Page 1 was better.

"); wxMemoryFSHandler::AddFile("test.css", "h1 {color: red;}"); + // Set log target which only logs debugging messages in the usual way: all + // the rest will be shown in wxLogWindow created by WebFrame. + class DebugOnlyLog : public wxLog + { + public: + DebugOnlyLog() = default; + + protected: + void DoLogTextAtLevel(wxLogLevel level, const wxString& msg) override + { + // Ignore all non-debug/trace messages. + if ( level == wxLOG_Debug || level == wxLOG_Trace ) + wxLog::DoLogTextAtLevel(level, msg); + } + }; + + delete wxLog::SetActiveTarget(new DebugOnlyLog); + WebFrame *frame = new WebFrame(m_url); frame->Show(); @@ -407,7 +439,7 @@ WebFrame::WebFrame(const wxString& url, bool isMain, wxWebViewWindowFeatures* wi // Create a log window if (m_isMainFrame) - new wxLogWindow(this, _("Logging"), true, false); + new wxLogWindow(this, _("Logging")); #if wxUSE_WEBVIEW_EDGE // Check if a fixed version of edge is present in @@ -421,8 +453,39 @@ WebFrame::WebFrame(const wxString& url, bool isMain, wxWebViewWindowFeatures* wi wxLogMessage("Using fixed edge version"); } #endif - // Create the webview - m_browser = (windowFeatures) ? windowFeatures->GetChildWebView() : wxWebView::New(); + + // Create the webview: WX_WEBVIEW_BACKEND environment variable allows to + // select the backend to use if there is more than one available. + wxString backend; + if ( !wxGetEnv("WX_WEBVIEW_BACKEND", &backend) ) + backend = wxWebViewBackendDefault; +#if wxUSE_WEBVIEW_CHROMIUM + // Allow specifying shorter "CEF" instead of having to type the full class + // name. + // + // Note that this is more than just a minor convenience: this also ensures + // that we reference wxWebViewBackendChromium from this file and this means + // that MSVC linker keeps wxWebViewChromium code when using static + // libraries while without it, it could discard it completely and it + // wouldn't be available during run-time at all. + else if ( backend.CmpNoCase("cef") ) + backend = wxWebViewBackendChromium; +#endif // wxUSE_WEBVIEW_CHROMIUM + + if ( backend != wxWebViewBackendDefault && + !wxWebView::IsBackendAvailable(backend) ) + { + wxLogWarning("Requested backend \"%s\" is not available, using default " + "backend instead.", backend); + backend = wxWebViewBackendDefault; + } + + m_browser = (windowFeatures) ? windowFeatures->GetChildWebView() + : wxWebView::New(backend); + if ( !m_browser ) + { + wxLogFatalError("Failed to create wxWebView object using \"%s\" backend", backend); + } // With several backends the proxy can only be set before creation, so do // it here if the standard environment variable is defined. @@ -443,15 +506,33 @@ WebFrame::WebFrame(const wxString& url, bool isMain, wxWebViewWindowFeatures* wi m_browser->RegisterHandler(wxSharedPtr(new AdvancedWebViewHandler())); } #endif - m_browser->Create(this, wxID_ANY, url, wxDefaultPosition, wxDefaultSize); + if ( !m_browser->Create(this, wxID_ANY, url) ) + { + wxLogFatalError("Failed to create wxWebView"); + } + topsizer->Add(m_browser, wxSizerFlags().Expand().Proportion(1)); if (m_isMainFrame) { // Log backend information wxLogMessage("Backend: %s Version: %s", m_browser->GetClassInfo()->GetClassName(), - wxWebView::GetBackendVersionInfo().ToString()); - wxLogMessage("User Agent: %s", m_browser->GetUserAgent()); + wxWebView::GetBackendVersionInfo(backend).ToString()); + + // Chromium backend can't be used immediately after creation, so wait + // until the browser is created before calling GetUserAgent(). + m_browser->Bind(wxEVT_WEBVIEW_CREATED, [this](wxWebViewEvent& event) { + wxLogMessage("Web view created, user agent is \"%s\"", m_browser->GetUserAgent()); + + // We need to synchronize this call with GetUserAgent() one, as + // otherwise the results of executing JavaScript inside + // GetUserAgent() and AddScriptMessageHandler() could arrive out of + // order and we'd get the wrong user agent string back. + if (!m_browser->AddScriptMessageHandler("wx")) + wxLogError("Could not add script message handler"); + + event.Skip(); + }); #ifndef __WXMAC__ //We register the wxfs:// protocol for testing purposes @@ -460,8 +541,6 @@ WebFrame::WebFrame(const wxString& url, bool isMain, wxWebViewWindowFeatures* wi m_browser->RegisterHandler(wxSharedPtr(new wxWebViewFSHandler("memory"))); m_browser->RegisterHandler(wxSharedPtr(new AdvancedWebViewHandler())); #endif - if (!m_browser->AddScriptMessageHandler("wx")) - wxLogError("Could not add script message handler"); } else wxLogMessage("Created new window"); @@ -1372,7 +1451,7 @@ void WebFrame::OnAddUserScript(wxCommandEvent & WXUNUSED(evt)) void WebFrame::OnSetCustomUserAgent(wxCommandEvent& WXUNUSED(evt)) { - wxString customUserAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 13_1_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.1 Mobile/15E148 Safari/604.1"; + wxString customUserAgent = m_browser->GetUserAgent(); wxTextEntryDialog dialog ( this, diff --git a/samples/webview/webview.vcxproj b/samples/webview/webview.vcxproj new file mode 100644 index 0000000000..21c223ed4c --- /dev/null +++ b/samples/webview/webview.vcxproj @@ -0,0 +1,449 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + DLL Debug + Win32 + + + DLL Debug + x64 + + + DLL Release + Win32 + + + DLL Release + x64 + + + Release + Win32 + + + Release + x64 + + + + {7688215B-1082-5681-9D37-E950D6210117} + + + + + Application + + + Application + + + Application + + + Application + + + Application + + + Application + + + Application + + + Application + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>14.0.24720.0 + $(wxIntRootDir) + $(wxIntRootDir)$(ProjectName)\ + true + + + true + + + false + + + true + + + false + + + true + + + false + + + true + + + false + + + + WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;_UNICODE;_WINDOWS;NOPCH;%(PreprocessorDefinitions) + .\..\..\lib\$(wxOutDirName)\$(wxIncSubDir);.\..\..\include;.;.\..\..\samples;%(AdditionalIncludeDirectories) + + + Disabled + .\..\..\lib\$(wxOutDirName)\$(wxIncSubDir);.\..\..\include;.;.\..\..\samples;%(AdditionalIncludeDirectories) + wxWEBVIEW_SAMPLE_CHROMIUM;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;_UNICODE;_WINDOWS;NOPCH;%(PreprocessorDefinitions) + Sync + EnableFastChecks + MultiThreadedDebugDLL + true + true + Level4 + true + ProgramDatabase + true + + + _DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;_UNICODE;_WINDOWS;NOPCH;%(PreprocessorDefinitions) + 0x0409 + .\..\..\lib\$(wxOutDirName)\$(wxIncSubDir);.\..\..\include;.;.\..\..\samples;%(AdditionalIncludeDirectories) + + + $(wxToolkitLibNamePrefix)webview.lib;$(wxToolkitLibNamePrefix)stc.lib;$(wxToolkitLibNamePrefix)core.lib;$(wxBaseLibNamePrefix).lib;wxtiff$(wxSuffixDebug).lib;wxjpeg$(wxSuffixDebug).lib;wxpng$(wxSuffixDebug).lib;wxzlib$(wxSuffixDebug).lib;wxregexu$(wxSuffixDebug).lib;wxexpat$(wxSuffixDebug).lib;wxscintilla$(wxSuffixDebug).lib;wxlexilla$(wxSuffixDebug).lib;%(AdditionalDependencies) + true + .\..\..\lib\$(wxOutDirName);..\..\3rdparty\cef\$(Configuration);%(AdditionalLibraryDirectories) + true + Windows + MachineX86 + + + true + + + ./../../include/wx/msw/wx_dpi_aware_pmv2.manifest + + + + + WIN32;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;NDEBUG;_UNICODE;_WINDOWS;NOPCH;%(PreprocessorDefinitions) + .\..\..\lib\$(wxOutDirName)\$(wxIncSubDir);.\..\..\include;.;.\..\..\samples;%(AdditionalIncludeDirectories) + + + MaxSpeed + .\..\..\lib\$(wxOutDirName)\$(wxIncSubDir);.\..\..\include;.;.\..\..\samples;%(AdditionalIncludeDirectories) + wxWEBVIEW_SAMPLE_CHROMIUM;WIN32;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;NDEBUG;_UNICODE;_WINDOWS;NOPCH;%(PreprocessorDefinitions) + Sync + MultiThreadedDLL + true + Level4 + true + ProgramDatabase + true + + + _CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;NDEBUG;_UNICODE;_WINDOWS;NOPCH;%(PreprocessorDefinitions) + 0x0409 + .\..\..\lib\$(wxOutDirName)\$(wxIncSubDir);.\..\..\include;.;.\..\..\samples;%(AdditionalIncludeDirectories) + + + $(wxToolkitLibNamePrefix)webview.lib;$(wxToolkitLibNamePrefix)stc.lib;$(wxToolkitLibNamePrefix)core.lib;$(wxBaseLibNamePrefix).lib;wxtiff$(wxSuffixDebug).lib;wxjpeg$(wxSuffixDebug).lib;wxpng$(wxSuffixDebug).lib;wxzlib$(wxSuffixDebug).lib;wxregexu$(wxSuffixDebug).lib;wxexpat$(wxSuffixDebug).lib;wxscintilla$(wxSuffixDebug).lib;wxlexilla$(wxSuffixDebug).lib;%(AdditionalDependencies) + true + .\..\..\lib\$(wxOutDirName);..\..\3rdparty\cef\$(Configuration);%(AdditionalLibraryDirectories) + true + Windows + MachineX86 + true + true + + + true + + + ./../../include/wx/msw/wx_dpi_aware_pmv2.manifest + + + + + WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;_UNICODE;WXUSINGDLL;_WINDOWS;NOPCH;%(PreprocessorDefinitions) + .\..\..\lib\$(wxOutDirName)\$(wxIncSubDir);.\..\..\include;.;.\..\..\samples;%(AdditionalIncludeDirectories) + + + Disabled + .\..\..\lib\$(wxOutDirName)\$(wxIncSubDir);.\..\..\include;.;.\..\..\samples;%(AdditionalIncludeDirectories) + wxWEBVIEW_SAMPLE_CHROMIUM;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;_UNICODE;WXUSINGDLL;_WINDOWS;NOPCH;%(PreprocessorDefinitions) + Sync + EnableFastChecks + MultiThreadedDebugDLL + true + true + Level4 + true + ProgramDatabase + true + + + _DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;_UNICODE;WXUSINGDLL;_WINDOWS;NOPCH;%(PreprocessorDefinitions) + 0x0409 + .\..\..\lib\$(wxOutDirName)\$(wxIncSubDir);.\..\..\include;.;.\..\..\samples;%(AdditionalIncludeDirectories) + + + $(wxToolkitLibNamePrefix)webview.lib;$(wxToolkitLibNamePrefix)stc.lib;$(wxToolkitLibNamePrefix)core.lib;$(wxBaseLibNamePrefix).lib;wxtiff$(wxSuffixDebug).lib;wxjpeg$(wxSuffixDebug).lib;wxpng$(wxSuffixDebug).lib;wxzlib$(wxSuffixDebug).lib;wxregexu$(wxSuffixDebug).lib;wxexpat$(wxSuffixDebug).lib;wxscintilla$(wxSuffixDebug).lib;wxlexilla$(wxSuffixDebug).lib;%(AdditionalDependencies) + true + .\..\..\lib\$(wxOutDirName);..\..\3rdparty\cef\$(Configuration);%(AdditionalLibraryDirectories) + true + Windows + MachineX86 + + + true + + + ./../../include/wx/msw/wx_dpi_aware_pmv2.manifest + + + + + WIN32;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;NDEBUG;_UNICODE;WXUSINGDLL;_WINDOWS;NOPCH;%(PreprocessorDefinitions) + .\..\..\lib\$(wxOutDirName)\$(wxIncSubDir);.\..\..\include;.;.\..\..\samples;%(AdditionalIncludeDirectories) + + + MaxSpeed + .\..\..\lib\$(wxOutDirName)\$(wxIncSubDir);.\..\..\include;.;.\..\..\samples;%(AdditionalIncludeDirectories) + wxWEBVIEW_SAMPLE_CHROMIUM;WIN32;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;NDEBUG;_UNICODE;WXUSINGDLL;_WINDOWS;NOPCH;%(PreprocessorDefinitions) + Sync + MultiThreadedDLL + true + Level4 + true + ProgramDatabase + true + + + _CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;NDEBUG;_UNICODE;WXUSINGDLL;_WINDOWS;NOPCH;%(PreprocessorDefinitions) + 0x0409 + .\..\..\lib\$(wxOutDirName)\$(wxIncSubDir);.\..\..\include;.;.\..\..\samples;%(AdditionalIncludeDirectories) + + + $(wxToolkitLibNamePrefix)webview.lib;$(wxToolkitLibNamePrefix)stc.lib;$(wxToolkitLibNamePrefix)core.lib;$(wxBaseLibNamePrefix).lib;wxtiff$(wxSuffixDebug).lib;wxjpeg$(wxSuffixDebug).lib;wxpng$(wxSuffixDebug).lib;wxzlib$(wxSuffixDebug).lib;wxregexu$(wxSuffixDebug).lib;wxexpat$(wxSuffixDebug).lib;wxscintilla$(wxSuffixDebug).lib;wxlexilla$(wxSuffixDebug).lib;%(AdditionalDependencies) + true + .\..\..\lib\$(wxOutDirName);..\..\3rdparty\cef\$(Configuration);%(AdditionalLibraryDirectories) + true + Windows + MachineX86 + true + true + + + true + + + ./../../include/wx/msw/wx_dpi_aware_pmv2.manifest + + + + + WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;_UNICODE;_WINDOWS;NOPCH;%(PreprocessorDefinitions) + .\..\..\lib\$(wxOutDirName)\$(wxIncSubDir);.\..\..\include;.;.\..\..\samples;%(AdditionalIncludeDirectories) + + + Disabled + .\..\..\lib\$(wxOutDirName)\$(wxIncSubDir);.\..\..\include;.;.\..\..\samples;%(AdditionalIncludeDirectories) + wxWEBVIEW_SAMPLE_CHROMIUM;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;_UNICODE;_WINDOWS;NOPCH;%(PreprocessorDefinitions) + Sync + EnableFastChecks + MultiThreadedDebugDLL + true + true + Level4 + true + ProgramDatabase + true + + + _DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;_UNICODE;_WINDOWS;NOPCH;%(PreprocessorDefinitions) + 0x0409 + .\..\..\lib\$(wxOutDirName)\$(wxIncSubDir);.\..\..\include;.;.\..\..\samples;%(AdditionalIncludeDirectories) + + + $(wxToolkitLibNamePrefix)webview.lib;$(wxToolkitLibNamePrefix)stc.lib;$(wxToolkitLibNamePrefix)core.lib;$(wxBaseLibNamePrefix).lib;wxtiff$(wxSuffixDebug).lib;wxjpeg$(wxSuffixDebug).lib;wxpng$(wxSuffixDebug).lib;wxzlib$(wxSuffixDebug).lib;wxregexu$(wxSuffixDebug).lib;wxexpat$(wxSuffixDebug).lib;wxscintilla$(wxSuffixDebug).lib;wxlexilla$(wxSuffixDebug).lib;%(AdditionalDependencies) + true + .\..\..\lib\$(wxOutDirName);..\..\3rdparty\cef\$(Configuration);%(AdditionalLibraryDirectories) + true + Windows + MachineX64 + + + true + + + ./../../include/wx/msw/wx_dpi_aware_pmv2.manifest + + + + + WIN32;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;NDEBUG;_UNICODE;_WINDOWS;NOPCH;%(PreprocessorDefinitions) + .\..\..\lib\$(wxOutDirName)\$(wxIncSubDir);.\..\..\include;.;.\..\..\samples;%(AdditionalIncludeDirectories) + + + MaxSpeed + .\..\..\lib\$(wxOutDirName)\$(wxIncSubDir);.\..\..\include;.;.\..\..\samples;%(AdditionalIncludeDirectories) + wxWEBVIEW_SAMPLE_CHROMIUM;WIN32;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;NDEBUG;_UNICODE;_WINDOWS;NOPCH;%(PreprocessorDefinitions) + Sync + MultiThreadedDLL + true + Level4 + true + ProgramDatabase + true + + + _CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;NDEBUG;_UNICODE;_WINDOWS;NOPCH;%(PreprocessorDefinitions) + 0x0409 + .\..\..\lib\$(wxOutDirName)\$(wxIncSubDir);.\..\..\include;.;.\..\..\samples;%(AdditionalIncludeDirectories) + + + $(wxToolkitLibNamePrefix)webview.lib;$(wxToolkitLibNamePrefix)stc.lib;$(wxToolkitLibNamePrefix)core.lib;$(wxBaseLibNamePrefix).lib;wxtiff$(wxSuffixDebug).lib;wxjpeg$(wxSuffixDebug).lib;wxpng$(wxSuffixDebug).lib;wxzlib$(wxSuffixDebug).lib;wxregexu$(wxSuffixDebug).lib;wxexpat$(wxSuffixDebug).lib;wxscintilla$(wxSuffixDebug).lib;wxlexilla$(wxSuffixDebug).lib;%(AdditionalDependencies) + true + .\..\..\lib\$(wxOutDirName);..\..\3rdparty\cef\$(Configuration);%(AdditionalLibraryDirectories) + true + Windows + MachineX64 + true + true + + + true + + + ./../../include/wx/msw/wx_dpi_aware_pmv2.manifest + + + + + WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;_UNICODE;WXUSINGDLL;_WINDOWS;NOPCH;%(PreprocessorDefinitions) + .\..\..\lib\$(wxOutDirName)\$(wxIncSubDir);.\..\..\include;.;.\..\..\samples;%(AdditionalIncludeDirectories) + + + Disabled + .\..\..\lib\$(wxOutDirName)\$(wxIncSubDir);.\..\..\include;.;.\..\..\samples;%(AdditionalIncludeDirectories) + wxWEBVIEW_SAMPLE_CHROMIUM;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;_UNICODE;WXUSINGDLL;_WINDOWS;NOPCH;%(PreprocessorDefinitions) + Sync + EnableFastChecks + MultiThreadedDebugDLL + true + true + Level4 + true + ProgramDatabase + true + + + _DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;_UNICODE;WXUSINGDLL;_WINDOWS;NOPCH;%(PreprocessorDefinitions) + 0x0409 + .\..\..\lib\$(wxOutDirName)\$(wxIncSubDir);.\..\..\include;.;.\..\..\samples;%(AdditionalIncludeDirectories) + + + $(wxToolkitLibNamePrefix)webview.lib;$(wxToolkitLibNamePrefix)stc.lib;$(wxToolkitLibNamePrefix)core.lib;$(wxBaseLibNamePrefix).lib;wxtiff$(wxSuffixDebug).lib;wxjpeg$(wxSuffixDebug).lib;wxpng$(wxSuffixDebug).lib;wxzlib$(wxSuffixDebug).lib;wxregexu$(wxSuffixDebug).lib;wxexpat$(wxSuffixDebug).lib;wxscintilla$(wxSuffixDebug).lib;wxlexilla$(wxSuffixDebug).lib;%(AdditionalDependencies) + true + .\..\..\lib\$(wxOutDirName);..\..\3rdparty\cef\$(Configuration);%(AdditionalLibraryDirectories) + true + Windows + MachineX64 + + + true + + + ./../../include/wx/msw/wx_dpi_aware_pmv2.manifest + + + + + WIN32;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;NDEBUG;_UNICODE;WXUSINGDLL;_WINDOWS;NOPCH;%(PreprocessorDefinitions) + .\..\..\lib\$(wxOutDirName)\$(wxIncSubDir);.\..\..\include;.;.\..\..\samples;%(AdditionalIncludeDirectories) + + + MaxSpeed + .\..\..\lib\$(wxOutDirName)\$(wxIncSubDir);.\..\..\include;.;.\..\..\samples;%(AdditionalIncludeDirectories) + wxWEBVIEW_SAMPLE_CHROMIUM;WIN32;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;NDEBUG;_UNICODE;WXUSINGDLL;_WINDOWS;NOPCH;%(PreprocessorDefinitions) + Sync + MultiThreadedDLL + true + Level4 + true + ProgramDatabase + true + + + _CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;NDEBUG;_UNICODE;WXUSINGDLL;_WINDOWS;NOPCH;%(PreprocessorDefinitions) + 0x0409 + .\..\..\lib\$(wxOutDirName)\$(wxIncSubDir);.\..\..\include;.;.\..\..\samples;%(AdditionalIncludeDirectories) + + + $(wxToolkitLibNamePrefix)webview.lib;$(wxToolkitLibNamePrefix)stc.lib;$(wxToolkitLibNamePrefix)core.lib;$(wxBaseLibNamePrefix).lib;wxtiff$(wxSuffixDebug).lib;wxjpeg$(wxSuffixDebug).lib;wxpng$(wxSuffixDebug).lib;wxzlib$(wxSuffixDebug).lib;wxregexu$(wxSuffixDebug).lib;wxexpat$(wxSuffixDebug).lib;wxscintilla$(wxSuffixDebug).lib;wxlexilla$(wxSuffixDebug).lib;%(AdditionalDependencies) + true + .\..\..\lib\$(wxOutDirName);..\..\3rdparty\cef\$(Configuration);%(AdditionalLibraryDirectories) + true + Windows + MachineX64 + true + true + + + true + + + ./../../include/wx/msw/wx_dpi_aware_pmv2.manifest + + + + + + + + + + + + diff --git a/setup.h.in b/setup.h.in index b3bc67dbe9..884830cd23 100644 --- a/setup.h.in +++ b/setup.h.in @@ -286,6 +286,8 @@ #define wxUSE_WEBVIEW 0 +#define wxUSE_WEBVIEW_CHROMIUM 0 + #ifdef __WXMSW__ #define wxUSE_WEBVIEW_IE 0 #else @@ -599,6 +601,11 @@ #define wxUSE_SELECT_DISPATCHER 0 #define wxUSE_EPOLL_DISPATCHER 0 +/* + Use debug version of CEF in wxWebViewChromium. + */ +#undef wxHAVE_CEF_DEBUG + /* Use GStreamer for Unix. diff --git a/src/common/init.cpp b/src/common/init.cpp index cb214bad41..3a6a645cb2 100644 --- a/src/common/init.cpp +++ b/src/common/init.cpp @@ -512,6 +512,29 @@ void wxEntryCleanup() DoCommonPostCleanup(); } +// ---------------------------------------------------------------------------- +// Entry hook support +// ---------------------------------------------------------------------------- + +namespace +{ + +// All registered entry hooks. +std::vector& GetEntryHooks() +{ + static std::vector s_entryHooks; + return s_entryHooks; +} + +} // anonymous namespace + +void wxAddEntryHook(wxEntryHook hook) +{ + // Order doesn't really matter, we suppose that we're never going to have + // more than one hook that would apply to the same program run. + GetEntryHooks().push_back(hook); +} + // ---------------------------------------------------------------------------- // wxEntry // ---------------------------------------------------------------------------- @@ -523,6 +546,17 @@ void wxEntryCleanup() int wxEntryReal(int& argc, wxChar **argv) { + // Do this before trying the hooks as they may use command line arguments. + wxInitData::Get().InitIfNecessary(argc, argv); + + // Check if we have any hooks that can hijack the application execution. + for ( auto& hook : GetEntryHooks() ) + { + const int rc = (*hook)(); + if ( rc != -1 ) + return rc; + } + // library initialization wxInitializer initializer(argc, argv); diff --git a/src/common/webview.cpp b/src/common/webview.cpp index 33fb2b8de0..b57d23f0fa 100644 --- a/src/common/webview.cpp +++ b/src/common/webview.cpp @@ -45,6 +45,7 @@ extern WXDLLIMPEXP_DATA_WEBVIEW(const char) wxWebViewBackendDefault[] = "wxWebVi wxIMPLEMENT_ABSTRACT_CLASS(wxWebView, wxControl); wxIMPLEMENT_DYNAMIC_CLASS(wxWebViewEvent, wxCommandEvent); +wxDEFINE_EVENT( wxEVT_WEBVIEW_CREATED, wxWebViewEvent ); wxDEFINE_EVENT( wxEVT_WEBVIEW_NAVIGATING, wxWebViewEvent ); wxDEFINE_EVENT( wxEVT_WEBVIEW_NAVIGATED, wxWebViewEvent ); wxDEFINE_EVENT( wxEVT_WEBVIEW_LOADED, wxWebViewEvent ); @@ -446,6 +447,13 @@ wxWebView* wxWebView::New(wxWindow* parent, wxWindowID id, const wxString& url, } +void wxWebView::NotifyWebViewCreated() +{ + GetEventHandler()->QueueEvent( + new wxWebViewEvent{*this, wxEVT_WEBVIEW_CREATED} + ); +} + // static void wxWebView::RegisterFactory(const wxString& backend, wxSharedPtr factory) @@ -521,7 +529,7 @@ void wxWebView::InitFactoryMap() (new wxWebViewFactoryEdge)); #endif -#else +#elif wxUSE_WEBVIEW_WEBKIT || wxUSE_WEBVIEW_WEBKIT2 if(m_factoryMap.find(wxWebViewBackendWebKit) == m_factoryMap.end()) RegisterFactory(wxWebViewBackendWebKit, wxSharedPtr (new wxWebViewFactoryWebKit)); diff --git a/src/common/webview_chromium.cpp b/src/common/webview_chromium.cpp new file mode 100644 index 0000000000..5bb4b11721 --- /dev/null +++ b/src/common/webview_chromium.cpp @@ -0,0 +1,2004 @@ +///////////////////////////////////////////////////////////////////////////// +// Author: Steven Lamerton +// Copyright: (c) 2013 - 2015 Steven Lamerton +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#include "wx/wxprec.h" + +#if wxUSE_WEBVIEW && wxUSE_WEBVIEW_CHROMIUM + +#include "wx/webview.h" +#include "wx/webview_chromium.h" +#include "wx/eventfilter.h" +#include "wx/filename.h" +#include "wx/filesys.h" +#include "wx/rtti.h" +#include "wx/stdpaths.h" +#include "wx/app.h" +#include "wx/base64.h" +#include "wx/module.h" + +#include "wx/private/init.h" +#ifdef __WXMSW__ +#include "wx/msw/private.h" +#endif +#include "wx/private/webview.h" + +#ifdef __WXGTK__ +#include +#include +#endif + +// With MSVC we are always using debug CEF build in debug wx builds (i.e. when +// _DEBUG is defined), as otherwise we'd be using incompatible variants of CRT. +#ifdef _DEBUG + #ifndef wxHAVE_CEF_DEBUG + #define wxHAVE_CEF_DEBUG + #endif +#endif + +// When not using debug version of CEF under Unix we need to make sure to +// predefine NDEBUG before including its headers to avoid ODR violations. +#ifndef wxHAVE_CEF_DEBUG + #ifndef NDEBUG + #define NDEBUG + #define wxUNDEF_NDEBUG + #endif +#endif + +#ifdef __WXOSX__ +#include "wx/osx/private/webview_chromium.h" +#endif + +#ifdef __VISUALC__ +#pragma warning(push) +#pragma warning(disable:4100) +#endif + +wxGCC_WARNING_SUPPRESS(unused-parameter) + +#include "include/cef_app.h" +#include "include/cef_browser.h" +#include "include/cef_client.h" +#include "include/cef_request_context_handler.h" +#include "include/cef_scheme.h" +#include "include/cef_string_visitor.h" +#include "include/cef_version.h" +#include "include/base/cef_lock.h" +#include "include/wrapper/cef_resource_manager.h" + +wxGCC_WARNING_RESTORE(unused-parameter) + +#ifdef __VISUALC__ +#pragma warning(pop) +#endif + +#ifdef wxUNDEF_NDEBUG + #undef NDEBUG +#endif + +#if CHROME_VERSION_BUILD < 5845 +#error "Unsupported CEF version" +#endif + +namespace +{ + +constexpr const char* TRACE_CEF = "cef"; + +#define TRACE_CEF_FUNCTION() wxLogTrace(TRACE_CEF, "%s called", __FUNCTION__) + +} // anonymous namespace + +extern WXDLLIMPEXP_DATA_WEBVIEW(const char) wxWebViewBackendChromium[] = "wxWebViewChromium"; + +bool wxWebViewChromium::ms_cefInitialized = false; + +wxIMPLEMENT_DYNAMIC_CLASS(wxWebViewChromium, wxWebView); + +namespace wxCEF +{ + +// ---------------------------------------------------------------------------- +// AppImplData contains data shared by all wxWebViewChromium objects +// ---------------------------------------------------------------------------- + +struct AppImplData : wxEventFilter +{ + // This function is called to dispatch events to the browser. + void DoMessageLoopWork(); + + // Call the function above before processing every event. + // + // This is a bit brutal, but DoMessageLoopWork() should return pretty + // quickly if it has nothing to do and not doing this results in weird + // bugs, e.g. clicking embedded text boxes doesn't give focus to them. + virtual int FilterEvent(wxEvent& event) override + { + // But we can at least skip doing it for the idle events, as they don't + // correspond to anything CEF is interested in. + if ( event.GetEventType() != wxEVT_IDLE ) + DoMessageLoopWork(); + + return Event_Skip; + } + +#ifdef __WXGTK__ + // Called from DoMessageLoopWork() if the thread context is allocated. + void StartThreadDispatch(GMainContext* threadContext); + + // Called from DoMessageLoopWork() when the thread context is freed. + void StopThreadDispatch(); + + + // Thread context we're dispatching the events for, if non-null. + GMainContext* m_threadContext = nullptr; + + // The special source used to wake us up. + GSource* m_wakeupSource = nullptr; +#endif // __WXGTK__ +}; + +#ifdef __WXGTK__ + +extern "C" +{ + +gboolean WakeupSourcePrepare(GSource*, gint* timeout) +{ + if ( timeout ) + { + // No need to call us again sooner than necessary, so don't set any + // timeout for the poll. + *timeout = -1; + } + + // Always poll, don't dispatch right now. + return FALSE; +} + +gboolean WakeupSourceCheck(GSource*) +{ + // We can't dispatch events from check function, but we can wake up our + // idle handler to do it next. + wxWakeUpIdle(); + + // Still don't dispatch. + return FALSE; +} + +} // extern "C" + +// We don't want to initialize private fields of GSourceFuncs, but not doing +// this results in this warning. +wxGCC_WARNING_SUPPRESS(missing-field-initializers) + +GSourceFuncs wakeupSourceVtbl = +{ + WakeupSourcePrepare, + WakeupSourceCheck, + nullptr, // No WakeupSourceDispatch as it should never be called. + nullptr, // No WakeupSourceFinalize because we don't have anything to free. +}; + +wxGCC_WARNING_RESTORE(missing-field-initializers) + +void AppImplData::StartThreadDispatch(GMainContext* threadContext) +{ + if ( !g_main_context_acquire(threadContext) ) + { + // This really shouldn't happen, no idea what to do if it does. + wxLogDebug("Failed to acquire thread-specific context."); + return; + } + + wxLogTrace(TRACE_CEF, "Acquired thread-specific context"); + m_threadContext = threadContext; + + // Create the special source which will wake us up whenever there + // are any events to dispatch: otherwise our main message loop could be + // woken up due to the events for Chrome being received from X server, but + // would do nothing with them as it doesn't know how to process them, and + // not even wake us up to do it. + m_wakeupSource = g_source_new(&wakeupSourceVtbl, sizeof(GSource)); + + // Note that we need to attach it to the main context, not the thread one + // (otherwise this source itself would be never used neither). + g_source_attach(m_wakeupSource, nullptr /* main context */); +} + +void AppImplData::StopThreadDispatch() +{ + g_source_destroy(m_wakeupSource); + g_source_unref(m_wakeupSource); + m_wakeupSource = nullptr; + + g_main_context_release(m_threadContext); + m_threadContext = nullptr; + wxLogTrace(TRACE_CEF, "Released thread-specific context"); +} + +#endif // __WXGTK__ + +AppImplData gs_appData; + +void AppImplData::DoMessageLoopWork() +{ +#ifdef __WXGTK__ + // Chrome may/will create its own GMainContext when it's used from the + // non-main thread and normal GTK message loop run by gtk_main() doesn't + // dispatch the events for it, as it only uses the default application + // context. So check for this case and do it ourselves if necessary. + auto const threadContext = g_main_context_get_thread_default(); + if ( threadContext != m_threadContext ) + { + if ( threadContext ) + StartThreadDispatch(threadContext); + else + StopThreadDispatch(); + } + + while ( threadContext ) + { + if ( !g_main_context_iteration(threadContext, FALSE /* don't block */) ) + break; + } +#endif // __WXGTK__ + + CefDoMessageLoopWork(); +} + +// ---------------------------------------------------------------------------- +// Chromium-specific configuration data +// ---------------------------------------------------------------------------- + +class wxWebViewConfigurationImplChromium : public wxWebViewConfigurationImpl, + public wxWebViewConfigurationChromium +{ +public: + static wxWebViewConfiguration MakeConfig() + { + return wxWebViewConfiguration(wxWebViewBackendChromium, + new wxWebViewConfigurationImplChromium); + } + + virtual void* GetNativeConfiguration() const + { + // Our "native" configuration is our own Chromium-specific class from + // which we inherit. + const wxWebViewConfigurationChromium* self = this; + return const_cast(self); + } + + virtual void SetDataPath(const wxString& path) override + { + m_dataPath = path; + } + + virtual wxString GetDataPath() const override + { + return m_dataPath; + } + +private: + wxString m_dataPath; +}; + +// ---------------------------------------------------------------------------- +// ImplData contains data for a single wxWebViewChromium instance +// ---------------------------------------------------------------------------- + +struct ImplData +{ + explicit ImplData(const wxWebViewConfiguration& config = + wxWebViewConfigurationImplChromium::MakeConfig()) + : m_config{config} + { + } + + wxWebViewConfiguration m_config; + +#ifdef __WXGTK__ + // Due to delayed creation of the browser in wxGTK we need to remember the + // URL passed to Create() as we can't use it there directly. + // + // We also use this as a flag: it will be non-empty if the browser needs to + // be created. + wxString m_initialURL; +#endif // __WXGTK__ + + // We also remember the proxy passed to wxWebView::SetProxy() as we can + // only set it when creating the browser currently. + wxString m_proxy; + + // These flags are used when destroying wxWebViewChromium, see its dtor. + bool m_calledDoClose = false; + bool m_calledOnBeforeClose = false; +}; + +// ---------------------------------------------------------------------------- +// ClientHandler +// ---------------------------------------------------------------------------- + +// ClientHandler implementation. +class ClientHandler : public CefClient, + public CefContextMenuHandler, + public CefDisplayHandler, + public CefLifeSpanHandler, + public CefLoadHandler, + public CefRequestHandler, + public CefResourceRequestHandler +{ +public: + // Ctor must be given a backpointer to wxWebView which must remain valid + // for the entire lifetime of this object. + explicit ClientHandler(wxWebViewChromium& webview) : m_webview{webview} {} + + // Overridden CefClient methods + virtual CefRefPtr GetContextMenuHandler() override { return this; } + virtual CefRefPtr GetDisplayHandler() override { return this; } + virtual CefRefPtr GetLifeSpanHandler() override { return this; } + virtual CefRefPtr GetLoadHandler() override { return this; } + virtual CefRefPtr GetRequestHandler() override { return this; } + + virtual bool OnProcessMessageReceived(CefRefPtr browser, + CefRefPtr frame, + CefProcessId source_process, + CefRefPtr message) override; + + // CefDisplayHandler methods + virtual void OnLoadingStateChange(CefRefPtr browser, + bool isLoading, bool canGoBack, + bool canGoForward) override; + virtual void OnAddressChange(CefRefPtr browser, + CefRefPtr frame, + const CefString& url) override; + virtual void OnTitleChange(CefRefPtr browser, + const CefString& title) override; + virtual bool OnConsoleMessage(CefRefPtr browser, + cef_log_severity_t level, + const CefString& message, + const CefString& source, + int line) override; + + // CefContextMenuHandler methods + virtual void OnBeforeContextMenu(CefRefPtr browser, + CefRefPtr frame, + CefRefPtr params, + CefRefPtr model) override; + virtual bool OnContextMenuCommand(CefRefPtr browser, + CefRefPtr frame, + CefRefPtr params, + int command_id, + CefContextMenuHandler::EventFlags event_flags) override; + virtual void OnContextMenuDismissed(CefRefPtr browser, + CefRefPtr frame) override; + + // CefLifeSpanHandler methods + virtual bool OnBeforePopup(CefRefPtr browser, + CefRefPtr frame, + const CefString& target_url, + const CefString& target_frame_name, + cef_window_open_disposition_t target_disposition, + bool user_gesture, + const CefPopupFeatures& popupFeatures, + CefWindowInfo& windowInfo, + CefRefPtr& client, + CefBrowserSettings& settings, + CefRefPtr& extra_info, + bool* no_javascript_access) override; + virtual void OnAfterCreated(CefRefPtr browser) override; + virtual bool DoClose(CefRefPtr browser) override; + virtual void OnBeforeClose(CefRefPtr browser) override; + + // CefLoadHandler methods + virtual void OnLoadStart(CefRefPtr browser, + CefRefPtr frame, + TransitionType transition_type) override; + virtual void OnLoadEnd(CefRefPtr browser, + CefRefPtr frame, + int httpStatusCode) override; + virtual void OnLoadError(CefRefPtr browser, + CefRefPtr frame, + ErrorCode errorCode, + const CefString& errorText, + const CefString& failedUrl) override; + + // CefRequestHandler methods + virtual CefRefPtr GetResourceRequestHandler( + CefRefPtr WXUNUSED(browser), + CefRefPtr WXUNUSED(frame), + CefRefPtr WXUNUSED(request), + bool WXUNUSED(is_navigation), + bool WXUNUSED(is_download), + const CefString& WXUNUSED(request_initiator), + bool& WXUNUSED(disable_default_handling)) override + { + return this; + } + + // CefResourceRequestHandler methods + virtual cef_return_value_t OnBeforeResourceLoad( + CefRefPtr browser, + CefRefPtr frame, + CefRefPtr request, + CefRefPtr callback) override; + virtual CefRefPtr GetResourceHandler( + CefRefPtr browser, + CefRefPtr frame, + CefRefPtr request) override; + + + // Our own functions. + + // Initialize the resource manager, creating it if necessary (so don't call + // this if you don't want it to be created). + CefRefPtr GetResourceManager() + { + if ( !m_resourceManager ) + m_resourceManager = new CefResourceManager{}; + + return m_resourceManager; + } + + CefRefPtr GetBrowser() const { return m_browser; } + + // Return the main frame. May be null. + CefRefPtr GetMainFrame() const + { + if ( !m_browser ) + return {}; + + return m_browser->GetMainFrame(); + } + + // Return the browser host. May be null. + CefRefPtr GetHost() const + { + if ( !m_browser ) + return {}; + + return m_browser->GetHost(); + } + + // Return the underlying window handle: HWND under MSW, X11 Window under + // GTK. + // + // The handle can be 0. + CefWindowHandle GetWindowHandle() const + { + auto host = GetHost(); + if ( !host ) + return 0; + + return host->GetWindowHandle(); + } + +private: + CefRefPtr m_browser; + wxWebViewChromium& m_webview; + int m_browserId; + // Record the load error code: enum wxWebViewNavigationError + // -1 means no error. + int m_loadErrorCode = -1; + + CefRefPtr m_resourceManager; + + IMPLEMENT_REFCOUNTING(ClientHandler); +}; + +class SchemeHandler : public CefResourceHandler +{ +public: + SchemeHandler(const wxSharedPtr& handler) : m_handler(handler), m_offset(0) {} + + // CefResourceHandler methods + virtual bool ProcessRequest(CefRefPtr request, + CefRefPtr callback) override; + virtual void GetResponseHeaders(CefRefPtr response, + int64_t& response_length, + CefString& redirectUrl) override; + virtual bool ReadResponse(void* data_out, + int bytes_to_read, + int& bytes_read, + CefRefPtr callback) override; + virtual void Cancel() override {} + +private: + wxSharedPtr m_handler; + std::string m_data; + std::string m_mime_type; + size_t m_offset; + + IMPLEMENT_REFCOUNTING(SchemeHandler); + base::Lock m_lock; +}; + +class SchemeHandlerFactory : public CefSchemeHandlerFactory +{ +public: + SchemeHandlerFactory(wxSharedPtr handler) : m_handler(handler) {} + + // Return a new scheme handler instance to handle the request. + virtual CefRefPtr Create(CefRefPtr WXUNUSED(browser), + CefRefPtr WXUNUSED(frame), + const CefString& WXUNUSED(scheme_name), + CefRefPtr WXUNUSED(request)) override + { + return new SchemeHandler(m_handler); + } + + IMPLEMENT_REFCOUNTING(SchemeHandlerFactory); +private: + wxSharedPtr m_handler; +}; + +class wxStringVisitor : public CefStringVisitor +{ +public: + enum StringType + { + PAGE_SOURCE, + PAGE_TEXT, + }; + wxStringVisitor(wxWebViewChromium& webview, StringType type) : + m_type(type), m_webview(webview) {} + void Visit(const CefString& string) override + { + switch(m_type) + { + case PAGE_SOURCE: + m_webview.SetPageSource(string.ToWString()); + break; + case PAGE_TEXT: + m_webview.SetPageText(string.ToWString()); + break; + } + } +private: + StringType m_type; + wxWebViewChromium& m_webview; + IMPLEMENT_REFCOUNTING(wxStringVisitor); +}; + +class wxBrowserProcessHandler : public CefBrowserProcessHandler +{ +public: + wxBrowserProcessHandler() = default; + + void OnScheduleMessagePumpWork(int64_t delay_ms) override + { + if ( delay_ms > 0 ) + { + // Time when we should do work. + const auto scheduledTime = wxGetUTCTimeMillis() + delay_ms; + + if ( m_timer.IsRunning() ) + { + if ( m_nextTimer > scheduledTime ) + { + // Existing timer will expire too late, restart it. + m_timer.Stop(); + } + else + { + wxLogTrace(TRACE_CEF, + "work already scheduled before %lldms", + delay_ms); + return; + } + } + + wxLogTrace(TRACE_CEF, "schedule work in %lldms", delay_ms); + m_timer.StartOnce(delay_ms); + + m_nextTimer = scheduledTime; + } + else + { + if ( wxTheApp ) + wxTheApp->CallAfter([]() { gs_appData.DoMessageLoopWork(); }); + else + wxLogTrace(TRACE_CEF, "can't schedule message pump work"); + } + } + +private: + class CEFTimer : public wxTimer + { + public: + CEFTimer() = default; + + void Notify() override + { + gs_appData.DoMessageLoopWork(); + } + } m_timer; + + // Time when the currently running timer will expire. + wxLongLong m_nextTimer = 0; + + IMPLEMENT_REFCOUNTING(wxBrowserProcessHandler); +}; + +// Application class used in the browser process. +class wxCefBrowserApp : public CefApp +{ +public: + wxCefBrowserApp() + : m_browserProcessHandler(new wxBrowserProcessHandler{}) + { + } + + CefRefPtr GetBrowserProcessHandler() override + { + return m_browserProcessHandler; + } + +private: + CefRefPtr m_browserProcessHandler; + + IMPLEMENT_REFCOUNTING(wxCefBrowserApp); +}; + +} // namespace wxCEF + +using namespace wxCEF; + +void wxWebViewChromium::Init() +{ + m_implData = new ImplData{}; +} + +wxWebViewChromium::wxWebViewChromium(const wxWebViewConfiguration& config) +{ + m_implData = new ImplData{config}; +} + +bool wxWebViewChromium::Create(wxWindow* parent, + wxWindowID id, + const wxString& url, + const wxPoint& pos, + const wxSize& size, + long style, + const wxString& name) +{ +#ifdef __WXGTK__ + // Currently CEF works only with X11. + if ( wxGetDisplayInfo().type != wxDisplayX11 ) + return false; + + style |= wxHSCROLL | wxVSCROLL; + + // Hide the window while creating it, so that its GTKHandleRealized() is + // not called immediately, but only later, once we show it when exiting + // this function. + class DelayedShow + { + public: + explicit DelayedShow(wxWindow& self) : self_{self} + { + self_.wxWindowBase::Hide(); + } + + ~DelayedShow() + { + self_.Show(); + } + + private: + wxWindowBase& self_; + } delayedShow{*this}; +#endif + + if ( !wxControl::Create(parent, id, pos, size, style, + wxDefaultValidator, name) ) + { + return false; + } + if ( !InitCEF(m_implData->m_config) ) + return false; + +#ifdef __WXMSW__ + MSWDisableComposited(); +#endif // __WXMSW__ + + m_clientHandler = new ClientHandler{*this}; + m_clientHandler->AddRef(); + +#ifdef __WXGTK__ + +#ifdef __WXGTK3__ + // CEF window creation fails with Match error unless we use the default X11 + // visual, which is not the case by default since GTK 3.15, see dae447728d + // (X11: Pick better system and rgba visuals for GL, 2014-10-29). + // + // We do this unconditionally instead of checking for GTK version because + // it shouldn't hurt even with earlier version and nobody uses them anyhow. + GdkScreen* screen = gdk_screen_get_default(); + GdkX11Screen* x11_screen = GDK_X11_SCREEN(screen); + Visual* default_xvisual = DefaultVisual(GDK_SCREEN_XDISPLAY(x11_screen), + GDK_SCREEN_XNUMBER(x11_screen)); + GdkVisual* default_visual = nullptr; + + for ( GList* visuals = gdk_screen_list_visuals(screen); + visuals; + visuals = visuals->next) + { + GdkVisual* visual = GDK_X11_VISUAL (visuals->data); + Visual* xvisual = gdk_x11_visual_get_xvisual(GDK_X11_VISUAL (visuals->data)); + + if ( xvisual->visualid == default_xvisual->visualid ) + { + default_visual = visual; + break; + } + } + + if ( default_visual ) + gtk_widget_set_visual(m_widget, default_visual); +#endif // wxGTK3 + + // Under wxGTK we need to wait until the window becomes realized in order + // to get the X11 window handle, so postpone calling DoCreateBrowser() + // until GTKHandleRealized(). + m_implData->m_initialURL = url.empty() ? wxString(" ") : url; +#else + // Under the other platforms we can call it immediately. + if ( !DoCreateBrowser(url) ) + return false; +#endif + + Bind(wxEVT_SIZE, &wxWebViewChromium::OnSize, this); + + return true; +} + +#ifdef __WXGTK__ + +void wxWebViewChromium::GTKHandleRealized() +{ + auto& initialURL = m_implData->m_initialURL; + + if ( initialURL.empty() ) + return; + + // Unfortunately there is nothing we can do here if it fails, so just + // ignore the return value. + DoCreateBrowser(initialURL); + + // Ensure we don't call it any more. + initialURL.clear(); +} + +#endif // __WXGTK__ + +bool wxWebViewChromium::DoCreateBrowser(const wxString& url) +{ + CefBrowserSettings browsersettings; + + // Initialize window info to the defaults for a child window + CefWindowInfo info; + + // In wxGTK the handle returned by GetHandle() is the GtkWidget, but we + // need the underlying X11 window here. +#ifdef __WXGTK__ + const auto handle = GDK_WINDOW_XID(GTKGetDrawingWindow()); + const auto handleValue = static_cast(handle); +#else + const auto handle = GetHandle(); + const auto handleValue = wxPtrToUInt(handle); +#endif + + const wxSize sz = GetClientSize(); + info.SetAsChild(handle, {0, 0, sz.x, sz.y}); + + // Create a request context (which will possibly remain empty) to allow + // setting the proxy if it was specified. + CefRefPtr reqContext; + + const auto& proxy = m_implData->m_proxy; + if ( !proxy.empty() ) + { + CefRequestContextSettings reqSettings; + reqContext = CefRequestContext::CreateContext(reqSettings, nullptr); + + // The structure of "proxy" dictionary seems to be documented at + // + // https://developer.chrome.com/docs/extensions/reference/proxy/ + // + // but it looks like we can also use a much simpler dictionary instead + // of defining "ProxyRules" sub-dictionary as documented there, so just + // do this instead. + auto proxyDict = CefDictionaryValue::Create(); + auto proxyVal = CefValue::Create(); + + if ( !proxyDict->SetString("mode", "fixed_servers") || + !proxyDict->SetString("server", proxy.ToStdWstring()) || + !proxyVal->SetDictionary(proxyDict) ) + { + // This is really not supposed to happen. + wxFAIL_MSG("constructing proxy value failed?"); + } + + CefString error; + if ( !reqContext->SetPreference("proxy", proxyVal, error) ) + { + wxLogError(_("Failed to set proxy \"%s\": %s"), proxy, error.ToWString()); + } + } + + if ( !CefBrowserHost::CreateBrowser( + info, + CefRefPtr{m_clientHandler}, + url.ToStdString(), + browsersettings, + nullptr, // No extra info + reqContext + ) ) + { + wxLogTrace(TRACE_CEF, "CefBrowserHost::CreateBrowser() failed"); + return false; + } + + wxLogTrace(TRACE_CEF, "Browser created as child of %zx", handleValue); + return true; +} + +wxWebViewChromium::~wxWebViewChromium() +{ + if (m_clientHandler) + { + wxLogTrace(TRACE_CEF, "closing browser"); + + const auto handle = m_clientHandler->GetWindowHandle(); + + constexpr bool forceClose = true; + m_clientHandler->GetHost()->CloseBrowser(forceClose); + m_clientHandler->Release(); + + // We need to wait until the browser is really closed, which happens + // asynchronously, as otherwise we could exit the program and call + // CefShutdown() before ClientHandler is destroyed, which would kill + // the program with "Object reference incorrectly held at CefShutdown" + // error message. + + // First wait until our ClientHandler::DoClose() is called: it will + // reset our m_clientHandler when this happens. + while ( !m_implData->m_calledDoClose ) + CefDoMessageLoopWork(); + +#ifdef __WXMSW__ + // Under MSW we need to destroy the window: if we don't do this, + // OnBeforeClose() won't get called at all, no matter how many messages + // we dispatch or how many times we call CefDoMessageLoopWork(). + ::DestroyWindow(handle); + + while ( !m_implData->m_calledOnBeforeClose ) + CefDoMessageLoopWork(); +#elif defined(__WXGTK__) + wxLogTrace(TRACE_CEF, "Destroying %lx", handle); + + // This doesn't seem to be necessary, the window gets destroyed on its + // own when dispatching the events, but still do it as it might speed + // up the shutdown and we can also do this if there is no active event + // loop (which should never happen, of course). + ::XDestroyWindow(wxGetX11Display(), handle); + + const auto threadContext = gs_appData.m_threadContext; + while ( !m_implData->m_calledOnBeforeClose ) + { + // Under GTK just calling CefDoMessageLoopWork() isn't enough, + // we need to dispatch the lower level (e.g. X11) events + // notifying CEF about the window destruction. + // + // Note that we do it whether or not thread context is null: if it + // is, the main application context is used, which is what we need + // when running in the main thread. + g_main_context_iteration(threadContext, TRUE /* block */); + } +#elif defined(__WXOSX__) + // There doesn't seem to be any way to force OnBeforeClose() to be + // called from here under Mac as it's referenced by an autorelease pool + // in the outer frame, so just return and count on that pool dtor + // really destroying the object before CefShutdown() is called. + wxUnusedVar(handle); +#endif + } + + delete m_implData; +} + +// This Linux-specific section exists in order to check that we're not going to +// hang after calling CefInitialize(), as happens if libcef.so doesn't come +// first (or at least before libc.so) in the load order. As debugging this is +// if it happens is not fun at all, it justifies having all this extra code +// just to check for this. +#ifdef __LINUX__ + +#include "wx/dynlib.h" + +bool CheckCEFLoadOrder() +{ + bool foundLibc = false; + + for ( const auto& det : wxDynamicLibrary::ListLoaded() ) + { + const auto& name = det.GetName(); + if ( name.StartsWith("libc.so") ) + { + foundLibc = true; + } + else if ( name.StartsWith("libcef.so") ) + { + if ( foundLibc ) + { + wxLogError( + _("Chromium can't be used because libcef.so was't " + "loaded early enough; please relink the application " + "or use LD_PRELOAD to load it earlier.") + ); + return false; + } + + // We've found libcef.so before libc.so, no need to continue. + break; + } + //else: some other library, ignore + } + + return true; +} + +#endif // __LINUX__ + +bool wxWebViewChromium::InitCEF(const wxWebViewConfiguration& config) +{ + if (ms_cefInitialized) + return true; + +#ifdef __LINUX__ + if ( !CheckCEFLoadOrder() ) + return false; +#endif + + // Construct the path to the confusingly named "root cache" CEF directory + // which is actually called "user data" directory in Chrome. It is the + // directory containing "cache" CEF directories (more clearly called + // "profile" directories in Chrome) and this is the only directory which we + // can set. + // + // It contains both "config" and "cache" files, but as it doesn't contain + // only the latter, don't put it under GetUserDir(Dir_Cache) by default, + // although applications that know that they are not going to have any + // important data there should probably change this by specifying a + // different directory to use via wxWebViewConfiguration. + wxFileName cefDataFolder; + const wxString& dataDir = config.GetDataPath(); + if ( !dataDir.empty() ) + { + cefDataFolder = wxFileName::DirName(dataDir); + } + else + { + cefDataFolder = wxFileName::DirName( + wxStandardPaths::Get().GetUserLocalDataDir() + ); + cefDataFolder.AppendDir("CEF"); + } + + if ( !cefDataFolder.Mkdir(wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL) ) + { + wxLogTrace(TRACE_CEF, "Failed to create CEF directory \"%s\"", + cefDataFolder.GetFullPath()); + } + + CefSettings settings; + + const auto app = wxApp::GetInstance(); + wxCHECK_MSG(app, false, "Can't use wxWebViewChromium without wxApp"); + + // Check for the presence of a separate helper application under non-macOS + // platforms (under the latter the helper process must always be present + // inside the application bundle). +#ifndef __WXOSX__ + wxFileName helperApp(wxStandardPaths::Get().GetExecutablePath()); + helperApp.SetName(app->GetAppName() + "_cef_helper"); + if ( helperApp.FileExists() ) + { + const wxString& helperPath = helperApp.GetAbsolutePath(); + + wxLogTrace(TRACE_CEF, "Using \"%s\" as CEF helper", helperPath); + CefString(&settings.browser_subprocess_path).FromWString(helperPath.ToStdWstring()); + } +#endif // !__WXOSX__ + + const wxString cefPath = cefDataFolder.GetFullPath(); + + wxFileName userDataPath(cefPath, "UserData"); + CefString(&settings.root_cache_path).FromWString(userDataPath.GetFullPath().ToStdWstring()); + + // Set up CEF for use inside another application, as is the case for us. + settings.multi_threaded_message_loop = false; + settings.external_message_pump = true; + + settings.no_sandbox = true; + + // Configure logging. + const auto configChrome = + static_cast(config.GetNativeConfiguration()); + wxCHECK_MSG( configChrome, false, "Should have Chromium-specific config" ); + + settings.log_severity = static_cast(configChrome->m_logLevel); + wxString logFile = configChrome->m_logFile; + if ( logFile.empty() ) + { + logFile = wxFileName(cefPath, "debug.log").GetFullPath(); + } + + CefString(&settings.log_file).FromWString(logFile.ToStdWstring()); + +#ifdef __WXMSW__ + CefMainArgs args(wxGetInstance()); +#else + CefMainArgs args(app->argc, app->argv); +#endif + + CefRefPtr cefApp{new wxCefBrowserApp{}}; + if ( !CefInitialize(args, settings, cefApp, nullptr) ) + { + wxLogError(_("Could not initialize Chromium")); + return false; + } + + wxEvtHandler::AddFilter(&gs_appData); + + ms_cefInitialized = true; + return true; +} + +void wxWebViewChromium::ShutdownCEF() +{ + if (ms_cefInitialized) + { + wxEvtHandler::RemoveFilter(&gs_appData); + + CefShutdown(); + } +} + +void wxWebViewChromium::OnSize(wxSizeEvent& event) +{ + event.Skip(); + + const auto handle = m_clientHandler ? m_clientHandler->GetWindowHandle() : 0; + if ( !handle ) + return; + + wxSize size = GetClientSize(); + +#ifdef __WXMSW__ + ::SetWindowPos(handle, nullptr, 0, 0, size.x, size.y, + SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER); +#elif defined(__WXGTK__) + size *= GetDPIScaleFactor(); + + ::XResizeWindow(wxGetX11Display(), handle, size.x, size.y); +#elif defined(__WXOSX__) + wxWebViewChromium_Resize(handle, size); +#endif +} + +void wxWebViewChromium::SetPageSource(const wxString& pageSource) +{ + m_pageSource = pageSource; +} + +void wxWebViewChromium::SetPageText(const wxString& pageText) +{ + m_pageText = pageText; +} + +void* wxWebViewChromium::GetNativeBackend() const +{ + return m_clientHandler->GetBrowser().get(); +} + +bool wxWebViewChromium::CanGoForward() const +{ + if ( m_historyEnabled ) + return m_historyPosition != static_cast(m_historyList.size()) - 1; + else + return false; +} + +bool wxWebViewChromium::CanGoBack() const +{ + if ( m_historyEnabled ) + return m_historyPosition > 0; + else + return false; +} + +void wxWebViewChromium::LoadHistoryItem(wxSharedPtr item) +{ + int pos = -1; + for ( unsigned int i = 0; i < m_historyList.size(); i++ ) + { + //We compare the actual pointers to find the correct item + if(m_historyList[i].get() == item.get()) + pos = i; + } + wxASSERT_MSG(pos != static_cast(m_historyList.size()), + "invalid history item"); + m_historyLoadingFromList = true; + LoadURL(item->GetUrl()); + m_historyPosition = pos; +} + +wxVector > wxWebViewChromium::GetBackwardHistory() +{ + wxVector > backhist; + //As we don't have std::copy or an iterator constructor in the wxwidgets + //native vector we construct it by hand + for ( int i = 0; i < m_historyPosition; i++ ) + { + backhist.push_back(m_historyList[i]); + } + return backhist; +} + +wxVector > wxWebViewChromium::GetForwardHistory() +{ + wxVector > forwardhist; + //As we don't have std::copy or an iterator constructor in the wxwidgets + //native vector we construct it by hand + for ( int i = m_historyPosition + 1; i < static_cast(m_historyList.size()); i++ ) + { + forwardhist.push_back(m_historyList[i]); + } + return forwardhist; +} + +void wxWebViewChromium::GoBack() +{ + LoadHistoryItem(m_historyList[m_historyPosition - 1]); +} + +void wxWebViewChromium::GoForward() +{ + LoadHistoryItem(m_historyList[m_historyPosition + 1]); +} + +void wxWebViewChromium::LoadURL(const wxString& url) +{ + auto frame = m_clientHandler->GetMainFrame(); + wxCHECK_RET( frame, "No valid frame" ); + + frame->LoadURL(url.ToStdString()); +} + +void wxWebViewChromium::ClearHistory() +{ + m_historyList.clear(); + m_historyPosition = -1; +} + +void wxWebViewChromium::EnableHistory(bool enable) +{ + m_historyEnabled = enable; +} + +void wxWebViewChromium::Stop() +{ + auto browser = m_clientHandler->GetBrowser(); + wxCHECK_RET( browser, "No valid browser object" ); + + browser->StopLoad(); +} + +void wxWebViewChromium::Reload(wxWebViewReloadFlags flags) +{ + auto browser = m_clientHandler->GetBrowser(); + wxCHECK_RET( browser, "No valid browser object" ); + + if ( flags == wxWEBVIEW_RELOAD_NO_CACHE ) + { + browser->ReloadIgnoreCache(); + } + else + { + browser->Reload(); + } +} + +bool wxWebViewChromium::SetProxy(const wxString& proxy) +{ + wxCHECK_MSG( !m_clientHandler, false, "should be called before Create()" ); + + m_implData->m_proxy = proxy; + + return true; +} + +wxString wxWebViewChromium::GetPageSource() const +{ + return m_pageSource; +} + +wxString wxWebViewChromium::GetPageText() const +{ + return m_pageText; +} + +wxString wxWebViewChromium::GetCurrentURL() const +{ + auto frame = m_clientHandler->GetMainFrame(); + wxCHECK_MSG( frame, {}, "No valid frame" ); + + return frame->GetURL().ToString(); +} + +wxString wxWebViewChromium::GetCurrentTitle() const +{ + return m_title; +} + +void wxWebViewChromium::Print() +{ + auto host = m_clientHandler->GetHost(); + wxCHECK_RET( host, "No valid host" ); + + host->Print(); +} + +void wxWebViewChromium::Cut() +{ + auto frame = m_clientHandler->GetMainFrame(); + wxCHECK_RET( frame, "No valid frame" ); + + frame->Cut(); +} + +void wxWebViewChromium::Copy() +{ + auto frame = m_clientHandler->GetMainFrame(); + wxCHECK_RET( frame, "No valid frame" ); + + frame->Copy(); +} + +void wxWebViewChromium::Paste() +{ + auto frame = m_clientHandler->GetMainFrame(); + wxCHECK_RET( frame, "No valid frame" ); + + frame->Paste(); +} + +void wxWebViewChromium::Undo() +{ + auto frame = m_clientHandler->GetMainFrame(); + wxCHECK_RET( frame, "No valid frame" ); + + frame->Undo(); +} + +void wxWebViewChromium::Redo() +{ + auto frame = m_clientHandler->GetMainFrame(); + wxCHECK_RET( frame, "No valid frame" ); + + frame->Redo(); +} + +void wxWebViewChromium::SelectAll() +{ + auto frame = m_clientHandler->GetMainFrame(); + wxCHECK_RET( frame, "No valid frame" ); + + frame->SelectAll(); +} + +void wxWebViewChromium::DeleteSelection() +{ + wxString jsdelete = "if (window.getSelection) { if (window.getSelection().deleteFromDocument) { window.getSelection().deleteFromDocument(); } }"; + RunScript(jsdelete); +} + +void wxWebViewChromium::ClearSelection() +{ + wxString jsclear = "if (window.getSelection) { if (window.getSelection().empty) { window.getSelection().empty(); } }"; + RunScript(jsclear); +} + +bool wxWebViewChromium::RunScript(const wxString& javascript, wxString* output) const +{ + auto frame = m_clientHandler->GetMainFrame(); + wxCHECK_MSG( frame, false, "No valid frame" ); + + frame->ExecuteJavaScript(javascript.ToStdString(), {}, 0); + + // Returning a result is currently unsupported + if (output) + return false; + else + return true; +} + +bool wxWebViewChromium::IsBusy() const +{ + auto browser = m_clientHandler->GetBrowser(); + if ( !browser ) + return false; + + return browser->IsLoading(); +} + +void wxWebViewChromium::SetEditable(bool enable) +{ + wxString mode = enable ? "\"on\"" : "\"off\""; + RunScript("document.designMode = " + mode); +} + +void wxWebViewChromium::DoSetPage(const wxString& html, const wxString& baseUrl) +{ + auto frame = m_clientHandler->GetMainFrame(); + wxCHECK_RET( frame, "No valid frame" ); + + wxUnusedVar(baseUrl); + + // This seems to be the only way to load a string in CEF now, see + // https://github.com/chromiumembedded/cef/issues/2586 + const wxScopedCharBuffer& buf = html.utf8_str(); + const wxString url{ + "data:text/html;base64," + wxBase64Encode(buf.data(), buf.length()) + }; + + frame->LoadURL(url.ToStdWstring()); +} + +wxWebViewZoom wxWebViewChromium::GetZoom() const +{ + return m_zoomLevel; +} + +float wxWebViewChromium::GetZoomFactor() const +{ + auto host = m_clientHandler->GetHost(); + wxCHECK_MSG( host, 0.0, "No valid host" ); + + return host->GetZoomLevel(); +} + +void wxWebViewChromium::SetZoomFactor(float mapzoom) +{ + auto host = m_clientHandler->GetHost(); + wxCHECK_RET( host, "No valid host" ); + + host->SetZoomLevel(mapzoom); +} + +void wxWebViewChromium::SetZoom(wxWebViewZoom zoom) +{ + m_zoomLevel = zoom; + + double mapzoom = 0.0; + // arbitrary way to map our common zoom enum to float zoom + switch ( zoom ) + { + case wxWEBVIEW_ZOOM_TINY: + mapzoom = -1.0; + break; + + case wxWEBVIEW_ZOOM_SMALL: + mapzoom = -0.5; + break; + + case wxWEBVIEW_ZOOM_MEDIUM: + mapzoom = 0.0; + break; + + case wxWEBVIEW_ZOOM_LARGE: + mapzoom = 0.5; + break; + + case wxWEBVIEW_ZOOM_LARGEST: + mapzoom = 1.0; + break; + } + + SetZoomFactor(mapzoom); +} + +void wxWebViewChromium::SetZoomType(wxWebViewZoomType type) +{ + // there is only one supported zoom type at the moment so this setter + // does nothing beyond checking sanity + wxASSERT(type == wxWEBVIEW_ZOOM_TYPE_LAYOUT); +} + +wxWebViewZoomType wxWebViewChromium::GetZoomType() const +{ + return wxWEBVIEW_ZOOM_TYPE_LAYOUT; +} + +bool wxWebViewChromium::CanSetZoomType(wxWebViewZoomType type) const +{ + return type == wxWEBVIEW_ZOOM_TYPE_LAYOUT; +} + +void wxWebViewChromium::RegisterHandler(wxSharedPtr handler) +{ + CefRegisterSchemeHandlerFactory( handler->GetName().ToStdWstring(), "", + new SchemeHandlerFactory(handler) ); +} + +namespace +{ + +// Called only by wxWebViewChromium::SetRoot() which ensures that it's called +// on the appropriate thread. +void +SetResourceRoot( + const CefRefPtr& resourceManager, + const wxFileName& rootDir +) +{ + resourceManager->AddDirectoryProvider( + "file:///", + rootDir.GetFullPath().utf8_string(), + 0, + "wxRootProvider" + ); +} + +} // anonymous namespace + +void wxWebViewChromium::SetRoot(const wxFileName& rootDir) +{ + CefPostTask( + TID_IO, + base::BindOnce( + &SetResourceRoot, + m_clientHandler->GetResourceManager(), + rootDir + ) + ); +} + +bool +ClientHandler::OnProcessMessageReceived(CefRefPtr WXUNUSED(browser), + CefRefPtr frame, + CefProcessId WXUNUSED(source_process), + CefRefPtr message) +{ + // This is not supposed to happen, but test for it nevertheless. + if ( !frame || !message ) + { + wxLogTrace(TRACE_CEF, "Ignoring null OnProcessMessageReceived() args"); + return false; + } + + wxWebViewChromiumEvent event(m_webview, *frame, *message); + + return m_webview.HandleWindowEvent(event); +} + +// CefDisplayHandler methods +void ClientHandler::OnLoadingStateChange(CefRefPtr WXUNUSED(browser), + bool WXUNUSED(isLoading), + bool WXUNUSED(canGoBack), + bool WXUNUSED(canGoForward)) +{} + +void ClientHandler::OnAddressChange(CefRefPtr WXUNUSED(browser), + CefRefPtr WXUNUSED(frame), + const CefString& WXUNUSED(url)) +{} + +void ClientHandler::OnTitleChange(CefRefPtr browser, const CefString& title) +{ + m_webview.m_title = title.ToWString(); + wxString target = browser->GetMainFrame()->GetName().ToString(); + + wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_TITLE_CHANGED, m_webview.GetId(), "", target); + event.SetString(title.ToWString()); + event.SetEventObject(&m_webview); + + m_webview.HandleWindowEvent(event); +} + +bool ClientHandler::OnConsoleMessage(CefRefPtr WXUNUSED(browser), + cef_log_severity_t WXUNUSED(level), + const CefString& WXUNUSED(message), + const CefString& WXUNUSED(source), int WXUNUSED(line)) +{ + return false; +} + +// CefContextMenuHandler methods +void ClientHandler::OnBeforeContextMenu(CefRefPtr WXUNUSED(browser), + CefRefPtr WXUNUSED(frame), + CefRefPtr WXUNUSED(params), + CefRefPtr model) +{ + if(!m_webview.IsContextMenuEnabled()) + model->Clear(); +} + +bool ClientHandler::OnContextMenuCommand(CefRefPtr WXUNUSED(browser), + CefRefPtr WXUNUSED(frame), + CefRefPtr WXUNUSED(params), + int WXUNUSED(command_id), + CefContextMenuHandler::EventFlags WXUNUSED(event_flags)) +{ + return false; +} + +void ClientHandler::OnContextMenuDismissed(CefRefPtr WXUNUSED(browser), + CefRefPtr WXUNUSED(frame)) +{} + +// CefLifeSpanHandler methods +bool ClientHandler::OnBeforePopup(CefRefPtr WXUNUSED(browser), + CefRefPtr WXUNUSED(frame), + const CefString& target_url, + const CefString& target_frame_name, + cef_window_open_disposition_t WXUNUSED(target_disposition), + bool WXUNUSED(user_gesture), + const CefPopupFeatures& WXUNUSED(popupFeatures), + CefWindowInfo& WXUNUSED(windowInfo), + CefRefPtr& WXUNUSED(client), + CefBrowserSettings& WXUNUSED(settings), + CefRefPtr& WXUNUSED(extra_info), + bool* WXUNUSED(no_javascript_access)) +{ + wxWebViewEvent *event = new wxWebViewEvent(wxEVT_WEBVIEW_NEWWINDOW, + m_webview.GetId(), + target_url.ToString(), + target_frame_name.ToString()); + event->SetEventObject(&m_webview); + // We use queue event as this function is called on the render thread + m_webview.GetEventHandler()->QueueEvent(event); + + return true; +} + +void ClientHandler::OnAfterCreated(CefRefPtr browser) +{ + TRACE_CEF_FUNCTION(); + + if ( !m_browser.get() ) + { + m_browser = browser; + m_browserId = browser->GetIdentifier(); + + m_webview.PostSizeEvent(); + + m_webview.NotifyWebViewCreated(); + } +} +bool ClientHandler::DoClose(CefRefPtr WXUNUSED(browser)) +{ + TRACE_CEF_FUNCTION(); + + m_webview.m_implData->m_calledDoClose = true; + + return false; +} + +void ClientHandler::OnBeforeClose(CefRefPtr browser) +{ + TRACE_CEF_FUNCTION(); + + // Under Mac the web view and its data might be already destroyed, so don't + // touch them there, see Mac-specific comment in wxWebViewChromium dtor. +#ifndef __WXOSX__ + m_webview.m_implData->m_calledOnBeforeClose = true; +#endif + + if ( browser->GetIdentifier() == m_browserId ) + { + m_browser = nullptr; + } +} + +// CefLoadHandler methods +void ClientHandler::OnLoadStart(CefRefPtr WXUNUSED(browser), + CefRefPtr frame, + TransitionType WXUNUSED(transition_type)) +{ + wxString url = frame->GetURL().ToString(); + wxString target = frame->GetName().ToString(); + + wxLogTrace(TRACE_CEF, "Starting to load \"%s\"", url); + + wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_NAVIGATING, m_webview.GetId(), url, target); + event.SetEventObject(&m_webview); + + m_webview.HandleWindowEvent(event); + + if ( !event.IsAllowed() ) + { + // We do not yet have support for vetoing pages + } +} + +void ClientHandler::OnLoadEnd(CefRefPtr WXUNUSED(browser), + CefRefPtr frame, + int WXUNUSED(httpStatusCode)) +{ + wxString url = frame->GetURL().ToString(); + wxString target = frame->GetName().ToString(); + + wxLogTrace(TRACE_CEF, "Loaded \"%s\"", url); + + // Send webview_error event in case of loading error. + if ( m_loadErrorCode != -1 ) + { + m_loadErrorCode = -1; + wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_ERROR, m_webview.GetId(), url, target); + event.SetEventObject(&m_webview); + m_webview.HandleWindowEvent(event); + } + + wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_NAVIGATED, m_webview.GetId(), url, target); + event.SetEventObject(&m_webview); + m_webview.HandleWindowEvent(event); + + if ( frame->IsMain() ) + { + //Get source code when main frame loads ended. + CefRefPtr source_visitor = new wxStringVisitor( + m_webview, wxStringVisitor::PAGE_SOURCE); + frame->GetSource(source_visitor); + + //Get page text when main frame loads ended. + CefRefPtr text_visitor = new wxStringVisitor( + m_webview, wxStringVisitor::PAGE_TEXT); + frame->GetText(text_visitor); + + //As we are complete we also add to the history list, but not if the + //page is not the main page, ie it is a subframe + if ( m_webview.m_historyEnabled && !m_webview.m_historyLoadingFromList ) + { + //If we are not at the end of the list, then erase everything + //between us and the end before adding the new page + if ( m_webview.m_historyPosition != static_cast(m_webview.m_historyList.size()) - 1 ) + { + m_webview.m_historyList.erase(m_webview.m_historyList.begin() + m_webview.m_historyPosition + 1, + m_webview.m_historyList.end()); + } + wxSharedPtr item(new wxWebViewHistoryItem(url, m_webview.GetCurrentTitle())); + m_webview.m_historyList.push_back(item); + m_webview.m_historyPosition++; + } + //Reset as we are done now + m_webview.m_historyLoadingFromList = false; + + wxWebViewEvent levent(wxEVT_COMMAND_WEBVIEW_LOADED, m_webview.GetId(), url, target); + levent.SetEventObject(&m_webview); + + m_webview.HandleWindowEvent(levent); + } +} + +void ClientHandler::OnLoadError(CefRefPtr WXUNUSED(browser), + CefRefPtr WXUNUSED(frame), + ErrorCode errorCode, + const CefString& WXUNUSED(errorText), + const CefString& WXUNUSED(failedUrl)) +{ + //We define a macro for convenience + #define ERROR_TYPE_CASE(error, wxtype) case(error): \ + m_loadErrorCode = wxtype;\ + break + + switch ( errorCode ) + { + case ERR_NONE: + m_loadErrorCode = -1; + break; + + ERROR_TYPE_CASE(ERR_ABORTED, wxWEBVIEW_NAV_ERR_USER_CANCELLED); + ERROR_TYPE_CASE(ERR_FILE_NOT_FOUND, wxWEBVIEW_NAV_ERR_NOT_FOUND); + ERROR_TYPE_CASE(ERR_TIMED_OUT, wxWEBVIEW_NAV_ERR_CONNECTION); + ERROR_TYPE_CASE(ERR_ACCESS_DENIED, wxWEBVIEW_NAV_ERR_AUTH); + ERROR_TYPE_CASE(ERR_CONNECTION_CLOSED, wxWEBVIEW_NAV_ERR_CONNECTION); + ERROR_TYPE_CASE(ERR_CONNECTION_RESET, wxWEBVIEW_NAV_ERR_CONNECTION); + ERROR_TYPE_CASE(ERR_CONNECTION_REFUSED, wxWEBVIEW_NAV_ERR_CONNECTION); + ERROR_TYPE_CASE(ERR_CONNECTION_ABORTED, wxWEBVIEW_NAV_ERR_CONNECTION); + ERROR_TYPE_CASE(ERR_CONNECTION_FAILED, wxWEBVIEW_NAV_ERR_CONNECTION); + ERROR_TYPE_CASE(ERR_NAME_NOT_RESOLVED, wxWEBVIEW_NAV_ERR_CONNECTION); + ERROR_TYPE_CASE(ERR_INTERNET_DISCONNECTED, wxWEBVIEW_NAV_ERR_CONNECTION); + ERROR_TYPE_CASE(ERR_SSL_PROTOCOL_ERROR, wxWEBVIEW_NAV_ERR_SECURITY); + ERROR_TYPE_CASE(ERR_ADDRESS_INVALID, wxWEBVIEW_NAV_ERR_REQUEST); + ERROR_TYPE_CASE(ERR_ADDRESS_UNREACHABLE, wxWEBVIEW_NAV_ERR_CONNECTION); + ERROR_TYPE_CASE(ERR_SSL_CLIENT_AUTH_CERT_NEEDED, wxWEBVIEW_NAV_ERR_AUTH); + ERROR_TYPE_CASE(ERR_TUNNEL_CONNECTION_FAILED, wxWEBVIEW_NAV_ERR_CONNECTION); + ERROR_TYPE_CASE(ERR_NO_SSL_VERSIONS_ENABLED, wxWEBVIEW_NAV_ERR_SECURITY); + ERROR_TYPE_CASE(ERR_SSL_VERSION_OR_CIPHER_MISMATCH, wxWEBVIEW_NAV_ERR_SECURITY); + ERROR_TYPE_CASE(ERR_SSL_RENEGOTIATION_REQUESTED, wxWEBVIEW_NAV_ERR_REQUEST); + ERROR_TYPE_CASE(ERR_CERT_COMMON_NAME_INVALID, wxWEBVIEW_NAV_ERR_CERTIFICATE); + ERROR_TYPE_CASE(ERR_CERT_DATE_INVALID, wxWEBVIEW_NAV_ERR_CERTIFICATE); + ERROR_TYPE_CASE(ERR_CERT_AUTHORITY_INVALID, wxWEBVIEW_NAV_ERR_CERTIFICATE); + ERROR_TYPE_CASE(ERR_CERT_CONTAINS_ERRORS, wxWEBVIEW_NAV_ERR_CERTIFICATE); + ERROR_TYPE_CASE(ERR_CERT_NO_REVOCATION_MECHANISM, wxWEBVIEW_NAV_ERR_CERTIFICATE); + ERROR_TYPE_CASE(ERR_CERT_UNABLE_TO_CHECK_REVOCATION, wxWEBVIEW_NAV_ERR_CERTIFICATE); + ERROR_TYPE_CASE(ERR_CERT_REVOKED, wxWEBVIEW_NAV_ERR_CERTIFICATE); + ERROR_TYPE_CASE(ERR_CERT_INVALID, wxWEBVIEW_NAV_ERR_CERTIFICATE); + ERROR_TYPE_CASE(ERR_CERT_END, wxWEBVIEW_NAV_ERR_CERTIFICATE); + ERROR_TYPE_CASE(ERR_INVALID_URL, wxWEBVIEW_NAV_ERR_REQUEST); + ERROR_TYPE_CASE(ERR_DISALLOWED_URL_SCHEME, wxWEBVIEW_NAV_ERR_REQUEST); + ERROR_TYPE_CASE(ERR_UNKNOWN_URL_SCHEME, wxWEBVIEW_NAV_ERR_REQUEST); + ERROR_TYPE_CASE(ERR_UNSAFE_REDIRECT, wxWEBVIEW_NAV_ERR_SECURITY); + ERROR_TYPE_CASE(ERR_UNSAFE_PORT, wxWEBVIEW_NAV_ERR_SECURITY); + ERROR_TYPE_CASE(ERR_INSECURE_RESPONSE, wxWEBVIEW_NAV_ERR_SECURITY); + + default: + m_loadErrorCode = wxWEBVIEW_NAV_ERR_OTHER; + } +} + +// CefResourceRequestHandler methods +cef_return_value_t ClientHandler::OnBeforeResourceLoad( + CefRefPtr browser, + CefRefPtr frame, + CefRefPtr request, + CefRefPtr callback) +{ + if ( !m_resourceManager ) + return RV_CONTINUE; + + return m_resourceManager->OnBeforeResourceLoad(browser, frame, request, callback); +} + +CefRefPtr ClientHandler::GetResourceHandler( + CefRefPtr browser, + CefRefPtr frame, + CefRefPtr request) +{ + if ( !m_resourceManager ) + return {}; + + return m_resourceManager->GetResourceHandler(browser, frame, request); +} + +bool SchemeHandler::ProcessRequest(CefRefPtr request, + CefRefPtr callback) +{ + bool handled = false; + + base::AutoLock lock_scope(m_lock); + + std::string url = request->GetURL(); + wxFSFile* file = m_handler->GetFile( url ); + + if ( file ) + { + m_mime_type = (file->GetMimeType()).ToStdString(); + + size_t size = file->GetStream()->GetLength(); + char* buf = new char[size]; + file->GetStream()->Read( buf, size ); + m_data = std::string( buf, buf+size ); + + delete[] buf; + handled = true; + } + + if ( handled ) + { + // Indicate the headers are available. + callback->Continue(); + return true; + } + return false; +} + +void SchemeHandler::GetResponseHeaders(CefRefPtr response, + int64_t& response_length, + CefString& WXUNUSED(redirectUrl)) +{ + if ( !m_mime_type.empty() ) + response->SetMimeType( m_mime_type ); + response->SetStatus( 200 ); + + // Set the resulting response length + response_length = m_data.length(); +} + +bool SchemeHandler::ReadResponse(void* data_out, + int bytes_to_read, + int& bytes_read, + CefRefPtr WXUNUSED(callback)) +{ + bool has_data = false; + bytes_read = 0; + + base::AutoLock lock_scope(m_lock); + + if ( m_offset < m_data.length() ) + { + // Copy the next block of data into the buffer. + int transfer_size = + std::min( bytes_to_read, static_cast( m_data.length() - m_offset ) ); + memcpy( data_out, m_data.c_str() + m_offset, transfer_size ); + m_offset += transfer_size; + + bytes_read = transfer_size; + has_data = true; + } + + return has_data; +} + +namespace +{ + +class wxWebViewChromiumEntry +{ +public: + wxWebViewChromiumEntry() + { + wxAddEntryHook(&wxWebViewChromiumEntry::Hook); + } + +private: + static int Hook() + { + const auto& initData = wxInitData::Get(); + for ( int n = 0; n < initData.argc; ++n ) + { + constexpr const wchar_t* TYPE_OPTION = L"--type="; + if ( wcsncmp(initData.argv[n], TYPE_OPTION, wcslen(TYPE_OPTION)) == 0 ) + { + // It looks like we have been launched by CEF as a helper + // process, so execute it now. +#ifdef __WXMSW__ + // Under MSW CEF wants to have HINSTANCE, so give it to it. + CefMainArgs args(wxGetInstance()); +#else + // Elsewhere it needs the actual arguments as narrow strings, + // and, serendipitously, we always have them under non-MSW. + CefMainArgs args(initData.argc, initData.argvA); +#endif + + // If there is no subprocess then we need to execute on this process + int code = CefExecuteProcess(args, nullptr, nullptr); + if (code < 0) + { + // This wasn't a CEF helper process finally, somehow. + break; + } + + // Exit immediately with the returned code. + return code; + } + } + +#ifdef __WXGTK__ + // We must ensure that we use thread-safe versions of X functions + // because CEF calls XInitThreads() during initialization and any X + // objects created before thread support is initialized can't be used + // after initializing it and doing this results in mysterious crashes + // (which is why X documentation states that XInitThreads() must be the + // first function called by the application). + // + // It's a bit wasteful to initialize threads if we're not going to use + // CEF in this run of the application, but it's a much better + // alternative than crashing, so do it now, before it is too late. + XInitThreads(); +#endif // !__WXGTK__ + + // Continue normal execution. + return -1; + } +}; + +wxWebViewChromiumEntry gs_chromiumEntryHook; + +} // anonymous namespace + +class WXDLLIMPEXP_WEBVIEW wxWebViewFactoryChromium : public wxWebViewFactory +{ +public: + virtual wxWebView* Create() override { return new wxWebViewChromium; } + + virtual wxWebView* CreateWithConfig(const wxWebViewConfiguration& config) override + { + return new wxWebViewChromium(config); + } + + 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) override + { return new wxWebViewChromium(parent, id, url, pos, size, style, name); } + + virtual bool IsAvailable() override + { +#ifdef __WXGTK__ + // Currently CEF works only with X11. + if ( wxGetDisplayInfo().type != wxDisplayX11 ) + return false; +#endif // __WXGTK__ + + return true; + } + + virtual wxVersionInfo GetVersionInfo() override + { + return { + "CEF", + CEF_VERSION_MAJOR, + CEF_VERSION_MINOR, + CEF_VERSION_PATCH, + CEF_COMMIT_NUMBER, + CEF_VERSION + }; + } + + virtual wxWebViewConfiguration CreateConfiguration() override + { + return wxWebViewConfigurationImplChromium::MakeConfig(); + } +}; + +class wxWebViewChromiumModule : public wxModule +{ +public: + wxWebViewChromiumModule() { } + virtual bool OnInit() override + { + // Register with wxWebView + wxWebView::RegisterFactory(wxWebViewBackendChromium, + wxSharedPtr(new wxWebViewFactoryChromium)); + +#ifdef __WXOSX__ + wxWebViewChromium_InitOSX(); +#endif + return true; + } + virtual void OnExit() override + { + wxWebViewChromium::ShutdownCEF(); + } +private: + wxDECLARE_DYNAMIC_CLASS(wxWebViewChromiumModule); +}; + +wxIMPLEMENT_DYNAMIC_CLASS(wxWebViewChromiumModule, wxModule); + +// ---------------------------------------------------------------------------- +// wxWebViewChromiumEvent +// ---------------------------------------------------------------------------- + +wxIMPLEMENT_DYNAMIC_CLASS(wxWebViewChromiumEvent, wxCommandEvent); + +wxDEFINE_EVENT( wxEVT_WEBVIEW_CHROMIUM_MESSAGE_RECEIVED, wxWebViewChromiumEvent ); + +wxWebViewChromiumEvent::wxWebViewChromiumEvent( + wxWebViewChromium& webview, + CefFrame& frame, + CefProcessMessage& message +) : wxCommandEvent(wxEVT_WEBVIEW_CHROMIUM_MESSAGE_RECEIVED, webview.GetId()), + m_frame(&frame), + m_message(&message) +{ + SetEventObject(&webview); +} + +wxString wxWebViewChromiumEvent::GetMessageName() const +{ + wxCHECK_MSG( m_message, {}, "No message" ); + + return m_message->GetName().ToWString(); +} + +#endif // wxUSE_WEBVIEW && wxUSE_WEBVIEW_CHROMIUM diff --git a/src/gtk/webview_webkit.cpp b/src/gtk/webview_webkit.cpp index 574028d9fe..2651ef7aa3 100644 --- a/src/gtk/webview_webkit.cpp +++ b/src/gtk/webview_webkit.cpp @@ -508,6 +508,8 @@ bool wxWebViewWebKit::Create(wxWindow *parent, G_CALLBACK(wxgtk_webview_webkit_load_status), this); + NotifyWebViewCreated(); + return true; } diff --git a/src/gtk/webview_webkit2.cpp b/src/gtk/webview_webkit2.cpp index ee015a0efa..354b2bd265 100644 --- a/src/gtk/webview_webkit2.cpp +++ b/src/gtk/webview_webkit2.cpp @@ -907,6 +907,8 @@ bool wxWebViewWebKit::Create(wxWindow *parent, PostCreation(size); + NotifyWebViewCreated(); + /* Open a webpage */ if (!isChildWebView) webkit_web_view_load_uri(m_web_view, url.utf8_str()); diff --git a/src/msw/webview_edge.cpp b/src/msw/webview_edge.cpp index adaaefb1e0..b9413714f9 100644 --- a/src/msw/webview_edge.cpp +++ b/src/msw/webview_edge.cpp @@ -1049,6 +1049,8 @@ bool wxWebViewEdge::Create(wxWindow* parent, if (topLevelParent) topLevelParent->Bind(wxEVT_ICONIZE, &wxWebViewEdge::OnTopLevelParentIconized, this); + NotifyWebViewCreated(); + LoadURL(url); return true; } diff --git a/src/msw/webview_ie.cpp b/src/msw/webview_ie.cpp index 4d863783f2..581b3c4f98 100644 --- a/src/msw/webview_ie.cpp +++ b/src/msw/webview_ie.cpp @@ -109,6 +109,8 @@ bool wxWebViewIE::Create(wxWindow* parent, // pages without any physical network connection. SetOfflineMode(false); + NotifyWebViewCreated(); + LoadURL(url); return true; } diff --git a/src/osx/carbon/Info.plist.in b/src/osx/carbon/Info.plist.in index 2485114502..7f770db5d8 100644 --- a/src/osx/carbon/Info.plist.in +++ b/src/osx/carbon/Info.plist.in @@ -2,33 +2,33 @@ - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${MACOSX_BUNDLE_EXECUTABLE_NAME} - CFBundleGetInfoString - ${MACOSX_BUNDLE_INFO_STRING} - CFBundleIconFile - wxmac.icns - CFBundleIdentifier - ${MACOSX_BUNDLE_GUI_IDENTIFIER} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleLongVersionString - ${MACOSX_BUNDLE_LONG_VERSION_STRING} - CFBundleName - ${MACOSX_BUNDLE_BUNDLE_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - ${MACOSX_BUNDLE_SHORT_VERSION_STRING} - CFBundleVersion - ${MACOSX_BUNDLE_BUNDLE_VERSION} - NSHumanReadableCopyright - ${MACOSX_BUNDLE_COPYRIGHT} - ATSApplicationFontsPath - Fonts - NSPrincipalClass - wxNSApplication + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${MACOSX_BUNDLE_EXECUTABLE_NAME} + CFBundleGetInfoString + ${MACOSX_BUNDLE_INFO_STRING} + CFBundleIconFile + wxmac.icns + CFBundleIdentifier + ${MACOSX_BUNDLE_GUI_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleLongVersionString + ${MACOSX_BUNDLE_LONG_VERSION_STRING} + CFBundleName + ${MACOSX_BUNDLE_BUNDLE_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + ${MACOSX_BUNDLE_SHORT_VERSION_STRING} + CFBundleVersion + ${MACOSX_BUNDLE_BUNDLE_VERSION} + NSHumanReadableCopyright + ${MACOSX_BUNDLE_COPYRIGHT} + ATSApplicationFontsPath + Fonts + NSPrincipalClass + wxNSApplication diff --git a/src/osx/iphone/Info.plist.in b/src/osx/iphone/Info.plist.in index d752993f88..d4f52d0f7b 100644 --- a/src/osx/iphone/Info.plist.in +++ b/src/osx/iphone/Info.plist.in @@ -2,40 +2,40 @@ - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${MACOSX_BUNDLE_EXECUTABLE_NAME} - CFBundleGetInfoString - ${MACOSX_BUNDLE_INFO_STRING} - CFBundleIdentifier - ${MACOSX_BUNDLE_GUI_IDENTIFIER} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleLongVersionString - ${MACOSX_BUNDLE_LONG_VERSION_STRING} - CFBundleName - ${MACOSX_BUNDLE_BUNDLE_NAME} - CFBundlePackageType - APPL - CFBundlePrimaryIcon - - CFBundleIconFiles - - AppIcon60x60 - - CFBundleIconName - AppIcon - - CFBundleShortVersionString - ${MACOSX_BUNDLE_SHORT_VERSION_STRING} - CFBundleVersion - ${MACOSX_BUNDLE_BUNDLE_VERSION} - NSHumanReadableCopyright - ${MACOSX_BUNDLE_COPYRIGHT} - LSRequiresIPhoneOS - - NSMainNibFile - + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${MACOSX_BUNDLE_EXECUTABLE_NAME} + CFBundleGetInfoString + ${MACOSX_BUNDLE_INFO_STRING} + CFBundleIdentifier + ${MACOSX_BUNDLE_GUI_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleLongVersionString + ${MACOSX_BUNDLE_LONG_VERSION_STRING} + CFBundleName + ${MACOSX_BUNDLE_BUNDLE_NAME} + CFBundlePackageType + APPL + CFBundlePrimaryIcon + + CFBundleIconFiles + + AppIcon60x60 + + CFBundleIconName + AppIcon + + CFBundleShortVersionString + ${MACOSX_BUNDLE_SHORT_VERSION_STRING} + CFBundleVersion + ${MACOSX_BUNDLE_BUNDLE_VERSION} + NSHumanReadableCopyright + ${MACOSX_BUNDLE_COPYRIGHT} + LSRequiresIPhoneOS + + NSMainNibFile + diff --git a/src/osx/webview_chromium.mm b/src/osx/webview_chromium.mm new file mode 100644 index 0000000000..3a4e36ac23 --- /dev/null +++ b/src/osx/webview_chromium.mm @@ -0,0 +1,89 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: src/osx/webview_chromium.mm +// Purpose: OSX specific code for wxWebViewChromium +// Author: Tobias Taschner +// Created: 2018-02-19 +// Copyright: (c) 2018 wxWidgets development team +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#include "wx/webview_chromium.h" + +#if wxUSE_WEBVIEW_CHROMIUM + +#import "Cocoa/Cocoa.h" +#include +#include "wx/log.h" + +#include "wx/osx/private.h" +#include "wx/osx/private/webview_chromium.h" + +#import "include/cef_application_mac.h" + +/* + The objective c runtime is used to add the required CefAppProtoco to the + wxNSApplication.sharedApplication + + This protocol is required by chromium in different places + (e.g.