Rebased ref, commits from common ancestor: commit 5d81d48cfd6d436e77ffa732440119723c3054a3 Author: Armin Le Grand (Allotropia) <armin.le.gr...@me.com> AuthorDate: Sat May 1 15:21:00 2021 +0200 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Wed May 5 21:44:09 2021 +0200
Remove RecoveryCore Change-Id: I523ff4db762589e6fe57a736c32cdbfb2b102157 diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk index 61d9d39066c7..1f1c820cd4f2 100644 --- a/svx/Library_svx.mk +++ b/svx/Library_svx.mk @@ -85,6 +85,7 @@ $(eval $(call gb_Library_use_externals,svx,\ ifneq ($(ENABLE_WASM_STRIP),TRUE) $(eval $(call gb_Library_add_exception_objects,svx,\ + svx/source/dialog/docrecovery \ svx/source/unodraw/recoveryui \ )) endif @@ -133,7 +134,6 @@ $(eval $(call gb_Library_add_exception_objects,svx,\ svx/source/dialog/dialcontrol \ svx/source/dialog/dlgctl3d \ svx/source/dialog/dlgctrl \ - svx/source/dialog/docrecovery \ svx/source/dialog/fntctrl \ svx/source/dialog/fontwork \ svx/source/dialog/frmdirlbox \ commit 7ddc75826d244987d185f9126a9cbde73996c415 Author: Armin Le Grand (Allotropia) <armin.le.gr...@me.com> AuthorDate: Sat May 1 14:03:32 2021 +0200 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Wed May 5 21:44:09 2021 +0200 Remove RecoveryUI, correct spl stuff Also removed components, learned a lot about doing so, corrected spl stuff. Also had to take a deep look at static linking mechanism/native-code.py Change-Id: I3ff9b29feba93f011f8699f6ae3f6e39061f9e81 diff --git a/Repository.mk b/Repository.mk index 558cb3be3ed0..95235d879a4d 100644 --- a/Repository.mk +++ b/Repository.mk @@ -417,7 +417,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \ slideshow \ sot \ spell \ - $(if $(DISABLE_GUI) || $(ENABLE_WASM_STRIP),,spl) \ + $(if $(or $(DISABLE_GUI),$(ENABLE_WASM_STRIP)),,spl) \ storagefd \ $(call gb_Helper_optional,SCRIPTING,stringresource) \ svgio \ diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index a76e6f80cb1b..af383bad1626 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -957,6 +957,7 @@ struct RefClearGuard @param bEmergencySave differs between EMERGENCY_SAVE and RECOVERY */ +#ifndef ENABLE_WASM_STRIP bool impl_callRecoveryUI(bool bEmergencySave , bool bExistsRecoveryData) { @@ -988,6 +989,7 @@ bool impl_callRecoveryUI(bool bEmergencySave , aRet >>= bRet; return bRet; } +#endif bool impl_bringToFrontRecoveryUI() { @@ -1137,9 +1139,11 @@ void Desktop::Exception(ExceptionCategory nCategory) // Save all open documents so they will be reopened // the next time the application is started // returns true if at least one document could be saved... +#ifndef ENABLE_WASM_STRIP bRestart = impl_callRecoveryUI( true , // force emergency save false); +#endif } FlushConfiguration(); @@ -2007,6 +2011,7 @@ void Desktop::OpenClients() impl_checkRecoveryState(bCrashed, bExistsRecoveryData, bExistsSessionData); +#ifndef ENABLE_WASM_STRIP if ( !bDisableRecovery && ( bExistsRecoveryData || // => crash with files => recovery @@ -2025,6 +2030,7 @@ void Desktop::OpenClients() TOOLS_WARN_EXCEPTION( "desktop.app", "Error during recovery"); } } +#endif Reference< XSessionManagerListener2 > xSessionListener; try diff --git a/postprocess/Rdb_services.mk b/postprocess/Rdb_services.mk index c30199ec0234..2bc78aebb12f 100644 --- a/postprocess/Rdb_services.mk +++ b/postprocess/Rdb_services.mk @@ -271,7 +271,7 @@ $(eval $(call gb_Rdb_add_components,services,\ desktop/source/migration/services/migrationoo2 \ desktop/source/migration/services/migrationoo3 \ desktop/source/offacc/offacc \ - $(if $(DISABLE_GUI) || $(ENABLE_WASM_STRIP),,desktop/source/splash/spl) \ + $(if $(or $(DISABLE_GUI),$(ENABLE_WASM_STRIP)),,desktop/source/splash/spl) \ $(if $(ENABLE_LDAP),extensions/source/config/ldap/ldapbe2) \ $(if $(filter WNT,$(OS)),\ extensions/source/config/WinUserInfo/WinUserInfoBe \ diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py index 20526f3db8ba..bcddaf566b46 100755 --- a/solenv/bin/native-code.py +++ b/solenv/bin/native-code.py @@ -819,7 +819,7 @@ desktop_constructor_list = [ "com_sun_star_comp_svx_Impl_FindbarDispatcher_get_implementation", "com_sun_star_comp_svx_LineSpacingToolBoxControl_get_implementation", "com_sun_star_comp_svx_NumberingToolBoxControl_get_implementation", - "com_sun_star_comp_svx_RecoveryUI_get_implementation", + ("com_sun_star_comp_svx_RecoveryUI_get_implementation", "#ifndef ENABLE_WASM_STRIP"), "com_sun_star_comp_svx_StyleToolBoxControl_get_implementation", "com_sun_star_comp_svx_TableToolBoxControl_get_implementation", "com_sun_star_comp_svx_TableToolBoxControl_get_implementation", diff --git a/solenv/gbuild/extensions/pre_MergedLibsList.mk b/solenv/gbuild/extensions/pre_MergedLibsList.mk index 12fd14edf522..81c1d97ff283 100644 --- a/solenv/gbuild/extensions/pre_MergedLibsList.mk +++ b/solenv/gbuild/extensions/pre_MergedLibsList.mk @@ -70,7 +70,7 @@ MERGE_LIBRARY_LIST := \ sofficeapp \ sot \ spell \ - $(if $(DISABLE_GUI),,spl) \ + $(if $(or $(DISABLE_GUI),$(ENABLE_WASM_STRIP)),,spl) \ srtrs1 \ $(call gb_Helper_optional,SCRIPTING,stringresource) \ svgio \ diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk index c951d91169f3..61d9d39066c7 100644 --- a/svx/Library_svx.mk +++ b/svx/Library_svx.mk @@ -21,6 +21,10 @@ $(eval $(call gb_Library_Library,svx)) $(eval $(call gb_Library_set_componentfile,svx,svx/util/svx)) +ifneq ($(ENABLE_WASM_STRIP),TRUE) +$(eval $(call gb_Library_set_componentfile,svx,svx/util/svx.extended)) +endif + $(eval $(call gb_Library_set_include,svx,\ -I$(SRCDIR)/svx/inc \ -I$(SRCDIR)/svx/source/inc \ @@ -79,6 +83,12 @@ $(eval $(call gb_Library_use_externals,svx,\ icu_headers \ )) +ifneq ($(ENABLE_WASM_STRIP),TRUE) +$(eval $(call gb_Library_add_exception_objects,svx,\ + svx/source/unodraw/recoveryui \ +)) +endif + $(eval $(call gb_Library_add_exception_objects,svx,\ svx/source/accessibility/AccessibleControlShape \ svx/source/accessibility/AccessibleEmptyEditSource \ @@ -242,7 +252,6 @@ $(eval $(call gb_Library_add_exception_objects,svx,\ svx/source/tbxctrls/tbxdrctl \ svx/source/tbxctrls/verttexttbxctrl \ svx/source/uitest/uiobject \ - svx/source/unodraw/recoveryui \ svx/source/unodraw/unoctabl \ svx/source/unodraw/UnoNamespaceMap \ svx/source/unodraw/unopool \ diff --git a/svx/util/svx.component b/svx/util/svx.component index ff8d802394ac..262e9d6b9bc9 100644 --- a/svx/util/svx.component +++ b/svx/util/svx.component @@ -28,10 +28,6 @@ <service name="com.sun.star.comp.svx.FindbarDispatcher"/> <service name="com.sun.star.frame.ProtocolHandler"/> </implementation> - <implementation name="com.sun.star.comp.svx.RecoveryUI" - constructor="com_sun_star_comp_svx_RecoveryUI_get_implementation"> - <service name="com.sun.star.dialog.RecoveryUI"/> - </implementation> <implementation name="com.sun.star.comp.svx.CrashReportUI" constructor="com_sun_star_comp_svx_CrashReportUI_get_implementation"> <service name="com.sun.star.dialog.CrashReportUI"/> diff --git a/svx/util/svx.extended.component b/svx/util/svx.extended.component new file mode 100644 index 000000000000..fe07d346be18 --- /dev/null +++ b/svx/util/svx.extended.component @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + --> + +<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.svx.RecoveryUI" + constructor="com_sun_star_comp_svx_RecoveryUI_get_implementation"> + <service name="com.sun.star.dialog.RecoveryUI"/> + </implementation> +</component> diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 9d1f869c1467..cd463613b4d6 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -149,7 +149,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/source/window/dockwin \ vcl/source/window/event \ vcl/source/window/floatwin \ - vcl/source/window/introwin \ + $(if $(ENABLE_WASM_STRIP),,vcl/source/window/introwin) \ vcl/source/window/keycod \ vcl/source/window/keyevent \ vcl/source/window/layout \ commit c9760700b03c11d133964e84ec647fb9d7a507d3 Author: Armin Le Grand (Allotropia) <armin.le.gr...@me.com> AuthorDate: Fri Apr 30 17:26:41 2021 +0200 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Wed May 5 21:44:08 2021 +0200 SplashScreen and Startup SplashScreens spl.lib removed, services no longer register to UNO services (services.rdb) Startup uses hard-coded flags "-nolockcheck -norestore -nologo -writer" Change-Id: I276f8775176e750e56f76b66aece2169bada3652 diff --git a/Repository.mk b/Repository.mk index 84c3aff700c7..558cb3be3ed0 100644 --- a/Repository.mk +++ b/Repository.mk @@ -417,7 +417,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \ slideshow \ sot \ spell \ - $(if $(DISABLE_GUI),,spl) \ + $(if $(DISABLE_GUI) || $(ENABLE_WASM_STRIP),,spl) \ storagefd \ $(call gb_Helper_optional,SCRIPTING,stringresource) \ svgio \ diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx index e2ecf5920aa0..ba9d6eafaa63 100644 --- a/desktop/inc/app.hxx +++ b/desktop/inc/app.hxx @@ -142,8 +142,10 @@ class Desktop final : public Application static OUString CreateErrorMsgString( utl::Bootstrap::FailureCode nFailureCode, const OUString& aFileURL ); +#ifndef ENABLE_WASM_STRIP css::uno::Reference<css::task::XStatusIndicator> m_rSplashScreen; void OpenSplashScreen(); +#endif void CloseSplashScreen(); DECL_STATIC_LINK( Desktop, ImplInitFilterHdl, ::ConvertData&, bool ); diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index b0c4fac53e10..a76e6f80cb1b 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1153,8 +1153,10 @@ void Desktop::Exception(ExceptionCategory nCategory) osl_removeSignalHandler( pSignalHandler ); restartOnMac(false); +#ifndef ENABLE_WASM_STRIP if ( m_rSplashScreen.is() ) m_rSplashScreen->reset(); +#endif _exit( EXITHELPER_CRASH_WITH_RESTART ); } @@ -1257,7 +1259,9 @@ int Desktop::Main() Translate::SetReadStringHook(ReplaceStringHookProc); // Startup screen +#ifndef ENABLE_WASM_STRIP OpenSplashScreen(); +#endif SetSplashScreenProgress(10); @@ -1697,8 +1701,10 @@ int Desktop::doShutdown() if ( bRR ) { restartOnMac(true); +#ifndef ENABLE_WASM_STRIP if ( m_rSplashScreen.is() ) m_rSplashScreen->reset(); +#endif return EXITHELPER_NORMAL_RESTART; } @@ -2377,6 +2383,7 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent ) } } +#ifndef ENABLE_WASM_STRIP void Desktop::OpenSplashScreen() { const CommandLineArgs &rCmdLine = GetCommandLineArgs(); @@ -2426,33 +2433,39 @@ void Desktop::OpenSplashScreen() if(m_rSplashScreen.is()) m_rSplashScreen->start("SplashScreen", 100); - } +#endif void Desktop::SetSplashScreenProgress(sal_Int32 iProgress) { +#ifndef ENABLE_WASM_STRIP if(m_rSplashScreen.is()) { m_rSplashScreen->setValue(iProgress); } +#endif } void Desktop::SetSplashScreenText( const OUString& rText ) { +#ifndef ENABLE_WASM_STRIP if( m_rSplashScreen.is() ) { m_rSplashScreen->setText( rText ); } +#endif } void Desktop::CloseSplashScreen() { +#ifndef ENABLE_WASM_STRIP if(m_rSplashScreen.is()) { SolarMutexGuard ensureSolarMutex; m_rSplashScreen->end(); m_rSplashScreen = nullptr; } +#endif } diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx index 4d5a3bb78396..6c64502e9d38 100644 --- a/desktop/source/app/cmdlineargs.cxx +++ b/desktop/source/app/cmdlineargs.cxx @@ -275,6 +275,26 @@ CommandLineArgs::CommandLineArgs( Supplier& supplier ) void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) { +#ifdef ENABLE_WASM_STRIP + // use hard-coded init-params for wasm '-nolockcheck -norestore -nologo -writer' + // no restore tries + m_norestore = true; + // no logo needed + m_nologo = true; +#if HAVE_FEATURE_MULTIUSER_ENVIRONMENT + // no lock-checks needed + m_nolockcheck = true; +#endif + // start with writer only + m_writer = true; + m_bDocumentArgs = true; + + m_bEmpty = false; + + // return to avoid #elif + return; +#endif + m_cwdUrl = supplier.getCwdUrl(); CommandLineEvent eCurrentEvent = CommandLineEvent::Open; diff --git a/postprocess/Rdb_services.mk b/postprocess/Rdb_services.mk index ddfb22a84ae5..c30199ec0234 100644 --- a/postprocess/Rdb_services.mk +++ b/postprocess/Rdb_services.mk @@ -271,7 +271,7 @@ $(eval $(call gb_Rdb_add_components,services,\ desktop/source/migration/services/migrationoo2 \ desktop/source/migration/services/migrationoo3 \ desktop/source/offacc/offacc \ - $(if $(DISABLE_GUI),,desktop/source/splash/spl) \ + $(if $(DISABLE_GUI) || $(ENABLE_WASM_STRIP),,desktop/source/splash/spl) \ $(if $(ENABLE_LDAP),extensions/source/config/ldap/ldapbe2) \ $(if $(filter WNT,$(OS)),\ extensions/source/config/WinUserInfo/WinUserInfoBe \ commit 27bbfcc1de69409d9878ec4940c81c41a64cc962 Author: Jan-Marek Glogowski <glo...@fbihome.de> AuthorDate: Thu Mar 25 13:13:53 2021 +0100 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Wed May 5 21:44:06 2021 +0200 Hack Windows static build stuff Change-Id: Ied05b72e95fceb47881f080d2b10eca29dfce73f diff --git a/configure.ac b/configure.ac index 5b89993046da..62aca8b1fad2 100644 --- a/configure.ac +++ b/configure.ac @@ -3724,7 +3724,7 @@ fi if test "$_os" = "iOS" -o "$build_cpu" != "$host_cpu"; then # To allow building Windows multi-arch releases without cross-tooling - if test -z "$WIN_MULTI_ARCH" -a -z "$WIN_OTHER_ARCH"; then + if test -z "$WIN_MULTI_ARCH" -a -z "$WIN_OTHER_ARCH" -o -n "$DISABLE_DYNLOADING"; then cross_compiling="yes" fi fi @@ -5579,8 +5579,23 @@ if test "$USING_X11" != TRUE; then test_qt5=no test_gtk3_kde5=no enable_cairo_canvas=no + test_gtk3_kde5=no + if test "$DISABLE_DYNLOADING" = "TRUE" -a "$OS" != "WNT"; then + enable_cairo_canvas=yes + test_qt5=yes + enable_qt5=yes + else + enable_cairo_canvas=no + test_qt5=no + fi fi +if test "$OS" = "EMSCRIPTEN"; then + test_qt5=yes + enable_cairo_canvas=yes + enable_qt5=yes +sfi + if test "$OS" = "HAIKU"; then enable_cairo_canvas=yes test_kf5=yes diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 1bc2c22e1b1c..9d1f869c1467 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -775,7 +775,7 @@ endif ifeq ($(OS),WNT) $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/source/opengl/win/WinDeviceInfo \ - vcl/source/app/salplug \ + $(if $(DISABLE_DYNLOADING),vcl/wasm/salplug,vcl/source/app/salplug) \ vcl/win/app/fileregistration \ )) commit 759b936f2f8b05316dc6650ee0aa15bab1052721 Author: Jan-Marek Glogowski <glo...@fbihome.de> AuthorDate: Thu Mar 25 09:59:51 2021 +0100 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Wed May 5 21:41:52 2021 +0200 Working static Writer (use SAL_VCL_QT5_USE_CAIRO) Change-Id: Ie1aab718cbf36b43621e2be644328fdc3fa1c90b diff --git a/configure.ac b/configure.ac index aa033a0c13ea..5b89993046da 100644 --- a/configure.ac +++ b/configure.ac @@ -5172,7 +5172,7 @@ if test "$enable_gui" = "no"; then fi USING_X11= DISABLE_GUI=TRUE - AC_DEFINE(HAVE_FEATURE_UI,0) +# AC_DEFINE(HAVE_FEATURE_UI,0) test_cairo=yes fi AC_SUBST(DISABLE_GUI) diff --git a/cppuhelper/source/paths.cxx b/cppuhelper/source/paths.cxx index 0172e4c94a16..25e006d07c96 100644 --- a/cppuhelper/source/paths.cxx +++ b/cppuhelper/source/paths.cxx @@ -20,6 +20,7 @@ #include <config_folders.h> #include <sal/config.h> +#include <sal/log.hxx> #include <cassert> @@ -85,7 +86,9 @@ OUString cppu::getUnoIniUri() { } #endif #endif - return uri + "/" SAL_CONFIGFILE("uno"); + uri += "/" SAL_CONFIGFILE("uno"); + SAL_INFO("cppuhelper", "expected uno config: " << uri); + return uri; } bool cppu::nextDirectoryItem(osl::Directory & directory, OUString * url) { diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index a8c0f078c6a7..4bb63a89054e 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3157,7 +3157,7 @@ static void doc_paintTile(LibreOfficeKitDocument* pThis, return; } -#if defined(UNX) && !defined(MACOSX) && !defined(ENABLE_HEADLESS) +#if defined(UNX) && !defined(MACOSX) && !defined(DISABLE_GUI) // Painting of zoomed or HiDPI spreadsheets is special, we actually draw everything at 100%, // and only set cairo's (or CoreGraphic's, in the iOS case) scale factor accordingly, so that diff --git a/postprocess/Rdb_services.mk b/postprocess/Rdb_services.mk index be437b9801b1..ddfb22a84ae5 100644 --- a/postprocess/Rdb_services.mk +++ b/postprocess/Rdb_services.mk @@ -284,8 +284,8 @@ $(eval $(call gb_Rdb_add_components,services,\ shell/source/unix/exec/syssh \ ) \ $(if $(filter-out MACOSX WNT,$(OS)), \ - $(if $(DISABLE_GUI),, \ shell/source/backends/desktopbe/desktopbe1 \ + $(if $(DISABLE_GUI),, \ vcl/vcl.unx \ ) \ ) \ diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py index 9ee5d41cc234..20526f3db8ba 100755 --- a/solenv/bin/native-code.py +++ b/solenv/bin/native-code.py @@ -739,7 +739,187 @@ desktop_factory_list = [ ] desktop_constructor_list = [ + "com_sun_star_comp_bridge_BridgeFactory_get_implementation", + "com_sun_star_comp_bridge_BridgeFactory_get_implementation", + "com_sun_star_comp_configuration_ConfigurationProvider_get_implementation", + "com_sun_star_comp_configuration_ConfigurationRegistry_get_implementation", + "com_sun_star_comp_configuration_DefaultProvider_get_implementation", + "com_sun_star_comp_configuration_ReadOnlyAccess_get_implementation", + "com_sun_star_comp_configuration_ReadWriteAccess_get_implementation", + "com_sun_star_comp_deployment_component_PackageRegistryBackend_get_implementation", + "com_sun_star_comp_deployment_configuration_PackageRegistryBackend_get_implementation", + "com_sun_star_comp_deployment_executable_PackageRegistryBackend_get_implementation", "com_sun_star_comp_deployment_ExtensionManager_get_implementation", + "com_sun_star_comp_deployment_ExtensionManager_get_implementation", + "com_sun_star_comp_deployment_help_PackageRegistryBackend_get_implementation", + "com_sun_star_comp_deployment_PackageManagerFactory_get_implementation", + "com_sun_star_comp_deployment_PackageManagerFactory_get_implementation", + "com_sun_star_comp_deployment_ProgressLog_get_implementation", + "com_sun_star_comp_deployment_script_PackageRegistryBackend_get_implementation", + "com_sun_star_comp_deployment_sfwk_PackageRegistryBackend_get_implementation", + "com_sun_star_comp_extensions_xml_sax_ParserExpat_get_implementation", + "com_sun_star_comp_frame_SessionListener_get_implementation", + "com_sun_star_comp_framework_AddonsToolBarFactory_get_implementation", + "com_sun_star_comp_framework_Desktop_get_implementation", + "com_sun_star_comp_framework_DocumentAcceleratorConfiguration_get_implementation", + "com_sun_star_comp_framework_Frame_get_implementation", + "com_sun_star_comp_framework_GenericPopupToolbarController_get_implementation", + "com_sun_star_comp_framework_GenericPopupToolbarController_get_implementation", + "com_sun_star_comp_framework_GlobalAcceleratorConfiguration_get_implementation", + "com_sun_star_comp_framework_JobExecutor_get_implementation", + "com_sun_star_comp_framework_LangSelectionStatusbarController_get_implementation", + "com_sun_star_comp_framework_LayoutManager_get_implementation", + "com_sun_star_comp_framework_MenuBarFactory_get_implementation", + "com_sun_star_comp_framework_MenuBarFactory_get_implementation", + "com_sun_star_comp_framework_ModuleAcceleratorConfiguration_get_implementation", + "com_sun_star_comp_framework_ModuleManager_get_implementation", + "com_sun_star_comp_framework_ModuleUIConfigurationManager_get_implementation", + "com_sun_star_comp_framework_ModuleUIConfigurationManagerSupplier_get_implementation", + "com_sun_star_comp_framework_ObjectMenuController_get_implementation", + "com_sun_star_comp_framework_PathSettings_get_implementation", + "com_sun_star_comp_framework_PathSubstitution_get_implementation", + "com_sun_star_comp_framework_PopupMenuControllerFactory_get_implementation", + "com_sun_star_comp_framework_RecentFilesMenuController_get_implementation", + "com_sun_star_comp_framework_RecentFilesMenuController_get_implementation", + "com_sun_star_comp_framework_ResourceMenuController_get_implementation", + "com_sun_star_comp_framework_SaveToolbarController_get_implementation", + "com_sun_star_comp_framework_SaveToolbarController_get_implementation", + "com_sun_star_comp_framework_StatusBarControllerFactory_get_implementation", + "com_sun_star_comp_framework_StatusBarFactory_get_implementation", + "com_sun_star_comp_framework_StatusIndicatorFactory_get_implementation", + "com_sun_star_comp_framework_SubToolBarController_get_implementation", + "com_sun_star_comp_framework_SubToolBarController_get_implementation", + "com_sun_star_comp_framework_TaskCreator_get_implementation", + "com_sun_star_comp_framework_ToolbarAsMenuController_get_implementation", + "com_sun_star_comp_framework_ToolBarControllerFactory_get_implementation", + "com_sun_star_comp_framework_ToolBarFactory_get_implementation", + "com_sun_star_comp_framework_ToolBarFactory_get_implementation", + "com_sun_star_comp_framework_UICommandDescription_get_implementation", + "com_sun_star_comp_framework_UICommandDescription_get_implementation", + "com_sun_star_comp_framework_UIConfigurationManager_get_implementation", + "com_sun_star_comp_framework_UIElementFactoryManager_get_implementation", + "com_sun_star_comp_framework_URLTransformer_get_implementation", + "com_sun_star_comp_framework_WindowListMenuController_get_implementation", + "com_sun_star_comp_framework_WindowListMenuController_get_implementation", + "com_sun_star_comp_framework_WindowStateConfiguration_get_implementation", + "com_sun_star_comp_graphic_GraphicProvider_get_implementation", + "com_sun_star_comp_office_FrameLoader_get_implementation", + "com_sun_star_comp_sfx2_AppDispatchProvider_get_implementation", + "com_sun_star_comp_sfx2_BackingComp_get_implementation", + "com_sun_star_comp_sfx2_GlobalEventBroadcaster_get_implementation", + "com_sun_star_comp_sfx2_InsertSymbolToolBoxControl_get_implementation", + "com_sun_star_comp_sfx2_InsertSymbolToolBoxControl_get_implementation", + "com_sun_star_comp_stoc_CoreReflection_get_implementation", + "com_sun_star_comp_stoc_Introspection_get_implementation", + "com_sun_star_comp_svx_CharacterSpacingToolBoxControl_get_implementation", + "com_sun_star_comp_svx_ColorToolBoxControl_get_implementation", + "com_sun_star_comp_svx_CTLToolBoxControl_get_implementation", + "com_sun_star_comp_svx_FontNameToolBoxControl_get_implementation", + "com_sun_star_comp_svx_Impl_FindbarDispatcher_get_implementation", + "com_sun_star_comp_svx_Impl_FindbarDispatcher_get_implementation", + "com_sun_star_comp_svx_LineSpacingToolBoxControl_get_implementation", + "com_sun_star_comp_svx_NumberingToolBoxControl_get_implementation", + "com_sun_star_comp_svx_RecoveryUI_get_implementation", + "com_sun_star_comp_svx_StyleToolBoxControl_get_implementation", + "com_sun_star_comp_svx_TableToolBoxControl_get_implementation", + "com_sun_star_comp_svx_TableToolBoxControl_get_implementation", + "com_sun_star_comp_svx_UnderlineToolBoxControl_get_implementation", + "com_sun_star_comp_svx_UndoRedoToolBoxControl_get_implementation", + "com_sun_star_comp_svx_UndoRedoToolBoxControl_get_implementation", + "com_sun_star_comp_svx_VertTextToolBoxControl_get_implementation", + "com_sun_star_comp_svx_VertTextToolBoxControl_get_implementation", + "com_sun_star_comp_uri_ExternalUriReferenceTranslator_get_implementation", + "com_sun_star_comp_uri_UriReferenceFactory_get_implementation", + "com_sun_star_comp_uri_UriSchemeParser_vndDOTsunDOTstarDOTexpand_get_implementation", + "com_sun_star_comp_uri_UriSchemeParser_vndDOTsunDOTstarDOTscript_get_implementation", + "com_sun_star_comp_uui_UUIInteractionHandler_get_implementation", + "com_sun_star_extensions_xml_sax_Writer_get_implementation", + "com_sun_star_frame_VCLSessionManagerClient_get_implementation", + "com_sun_star_i18n_BreakIterator_get_implementation", + "com_sun_star_i18n_BreakIterator_Unicode_get_implementation", + "com_sun_star_i18n_CharacterClassification_get_implementation", + "com_sun_star_i18n_CharacterClassification_Unicode_get_implementation", + "com_sun_star_i18n_Collator_get_implementation", + "com_sun_star_i18n_LocaleDataImpl_get_implementation", + "com_sun_star_i18n_NumberFormatCodeMapper_get_implementation", + "com_sun_star_i18n_Transliteration_get_implementation", + "com_sun_star_i18n_Transliteration_IGNORE_CASE_get_implementation", + "com_sun_star_i18n_Transliteration_IGNORE_KANA_get_implementation", + "com_sun_star_i18n_Transliteration_IGNORE_WIDTH_get_implementation", + "com_sun_star_svx_DownSearchToolboxController_get_implementation", + "com_sun_star_svx_ExitFindbarToolboxController_get_implementation", + "com_sun_star_svx_FindAllToolboxController_get_implementation", + "com_sun_star_svx_FindTextToolboxController_get_implementation", + "com_sun_star_svx_FontHeightToolBoxController_get_implementation", + "com_sun_star_svx_MatchCaseToolboxController_get_implementation", + "com_sun_star_svx_SearchLabelToolboxController_get_implementation", + "com_sun_star_svx_UpSearchToolboxController_get_implementation", + "com_sun_star_text_DefaultNumberingProvider_get_implementation", + "dtrans_CMimeContentTypeFactory_get_implementation", + "filter_ConfigFlush_get_implementation", + "filter_ContentHandlerFactory_get_implementation", + "filter_FilterFactory_get_implementation", + "filter_FrameLoaderFactory_get_implementation", + "filter_TypeDetection_get_implementation", + "framework_FooterMenuController_get_implementation", + "framework_FooterMenuController_get_implementation", + "framework_HeaderMenuController_get_implementation", + "framework_HeaderMenuController_get_implementation", + "framework_LanguageSelectionMenuController_get_implementation", + "framework_LanguageSelectionMenuController_get_implementation", + "framework_MacrosMenuController_get_implementation", + "framework_MacrosMenuController_get_implementation", + "framework_NewMenuController_get_implementation", + "framework_NewMenuController_get_implementation", + "framework_ServiceHandler_get_implementation", + "framework_ServiceHandler_get_implementation", + "framework_ToolbarsMenuController_get_implementation", + "framework_ToolbarsMenuController_get_implementation", + "i18npool_Collator_Unicode_get_implementation", + "IndexedPropertyValuesContainer_get_implementation", + "lingucomponent_Hyphenator_get_implementation", + "lingucomponent_LangGuess_get_implementation", + "lingucomponent_SpellChecker_get_implementation", + "lingucomponent_Thesaurus_get_implementation", + "linguistic_DicList_get_implementation", + "linguistic_GrammarCheckingIterator_get_implementation", + "linguistic_LinguProps_get_implementation", + "linguistic_LngSvcMgr_get_implementation", + "lo_writer_NavElementToolBoxController_get_implementation", + "lo_writer_NextScrollToolboxController_get_implementation", + "lo_writer_PreviousScrollToolboxController_get_implementation", + "org_apache_openoffice_comp_framework_ContextChangeEventMultiplexer_get_implementation", + "org_apache_openoffice_comp_framework_NewToolbarController_get_implementation", + "org_apache_openoffice_comp_framework_NewToolbarController_get_implementation", + "org_apache_openoffice_comp_svx_sidebar_PanelFactory_get_implementation", + "package_ManifestReader_get_implementation", + "package_OStorageFactory_get_implementation", + "package_OZipFileAccess_get_implementation", + "package_ZipPackage_get_implementation", + "SfxDocumentMetaData_get_implementation", + "shell_DesktopBackend_get_implementation", + "shell_LocaleBackend_get_implementation", + "stardiv_Toolkit_VCLXPopupMenu_get_implementation", + "stardiv_Toolkit_VCLXToolkit_get_implementation", + "stoc_FactoryImpl_get_implementation", + "svl_FSStorageFactory_get_implementation", + "ucb_expand_ExpandContentProviderImpl_get_implementation", + "ucb_file_FileProvider_get_implementation", + "ucb_OFileAccess_get_implementation", + "ucb_tdoc_ContentProvider_get_implementation", + "ucb_tdoc_DocumentContentFactory_get_implementation", + "ucb_UcbContentProviderProxyFactory_get_implementation", + "ucb_UcbStore_get_implementation", + "ucb_UniversalContentBroker_get_implementation", + "unotools_OTempFileService_get_implementation", + "unoxml_CDocumentBuilder_get_implementation", + "unoxml_CURI_get_implementation", + "unoxml_CXPathAPI_get_implementation", + "unoxml_rdfRepository_get_implementation", + "vcl_SystemClipboard_get_implementation", + "Writer_SwTextDocument_get_implementation", + "com_sun_star_comp_svx_FrameToolBoxControl_get_implementation", + "com_sun_star_i18n_InputSequenceChecker_get_implementation", ] factory_map = { diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx index f8e5c016db90..55d795719cc8 100644 --- a/sw/source/uibase/app/swmodule.cxx +++ b/sw/source/uibase/app/swmodule.cxx @@ -176,9 +176,14 @@ OUString SwResId(const char* pId, int nCardinality) uno::Reference< scanner::XScannerManager2 > const & SwModule::GetScannerManager() { - if (!m_xScannerManager.is()) + static bool bTestScannerManager = true; + if (bTestScannerManager && !m_xScannerManager.is()) { - m_xScannerManager = scanner::ScannerManager::create( comphelper::getProcessComponentContext() ); + try { + m_xScannerManager = scanner::ScannerManager::create( comphelper::getProcessComponentContext() ); + } + catch (...) {} + bTestScannerManager = false; } return m_xScannerManager; } commit 793fb3beba8e0bcb87228ceda344d387e09e47f4 Author: Jan-Marek Glogowski <glo...@fbihome.de> AuthorDate: Wed Mar 24 16:46:09 2021 +0100 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Wed May 5 21:41:52 2021 +0200 catchall vcldemo Change-Id: I07c8b12b9926e2228fc69b173ac4acf3dd6ef075 diff --git a/bin/run b/bin/run index ea3a551d9e50..1fcbd07a8626 100755 --- a/bin/run +++ b/bin/run @@ -64,7 +64,7 @@ else export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}"${dir}"/instdir/program SEARCH_PATH="${LD_LIBRARY_PATH}" - + export UNO_HOME="file://${dir}/instdir/program" fi # echo "setting URE_BOOTSTRAP to: ${URE_BOOTSTRAP}" diff --git a/cppu/source/uno/lbmap.cxx b/cppu/source/uno/lbmap.cxx index cdaa21ff7200..685bf6d4a2a8 100644 --- a/cppu/source/uno/lbmap.cxx +++ b/cppu/source/uno/lbmap.cxx @@ -328,14 +328,12 @@ static void setNegativeBridge( const OUString & rBridgeName ) static uno_ext_getMappingFunc selectMapFunc( const OUString & rBridgeName ) { -#if 0 if (rBridgeName.equalsAscii( CPPU_CURRENT_LANGUAGE_BINDING_NAME "_uno" )) return CPPU_ENV_uno_ext_getMapping; #if HAVE_FEATURE_JAVA if (rBridgeName.equalsAscii( "java" "_uno" )) return java_uno_ext_getMapping; #endif -#endif #if 0 // I don't think the affine or log bridges will be needed on any diff --git a/cppuhelper/source/paths.cxx b/cppuhelper/source/paths.cxx index 0f59fb1272da..0172e4c94a16 100644 --- a/cppuhelper/source/paths.cxx +++ b/cppuhelper/source/paths.cxx @@ -26,6 +26,7 @@ #include <com/sun/star/uno/DeploymentException.hpp> #include <osl/file.hxx> #include <osl/module.hxx> +#include <osl/thread.h> #include <rtl/ustring.hxx> #include <sal/types.h> @@ -62,7 +63,14 @@ OUString cppu::getUnoIniUri() { // clean here is hardish. OUString uri("file:///assets/program"); #else + OUString uri(get_this_libpath()); + static const char* uno_home = getenv("UNO_HOME"); + if (!uno_home) + uri = get_this_libpath(); + else + uri = OStringToOUString(uno_home, osl_getThreadTextEncoding()); + #ifdef MACOSX // We keep both the LO and URE dylibs directly in "Frameworks" // (that is, LIBO_LIB_FOLDER) and rc files in "Resources" diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py index 30e62b99ef32..9ee5d41cc234 100755 --- a/solenv/bin/native-code.py +++ b/solenv/bin/native-code.py @@ -735,6 +735,13 @@ writer_constructor_list = [ "com_sun_star_comp_Writer_EPUBExportFilter_get_implementation", ] +desktop_factory_list = [ + ] + +desktop_constructor_list = [ + "com_sun_star_comp_deployment_ExtensionManager_get_implementation", + ] + factory_map = { 'core' : core_factory_list, 'edit' : edit_factory_list, @@ -742,6 +749,7 @@ factory_map = { 'calc' : calc_factory_list, 'draw' : draw_factory_list, 'writer' : writer_factory_list, + 'desktop' : desktop_factory_list, } constructor_map = { @@ -751,6 +759,7 @@ constructor_map = { 'calc' : calc_constructor_list, 'draw' : draw_constructor_list, 'writer' : writer_constructor_list, + 'desktop' : desktop_constructor_list, } custom_widgets = [ diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk index 296b8e379a0c..711509cd846d 100644 --- a/solenv/gbuild/CppunitTest.mk +++ b/solenv/gbuild/CppunitTest.mk @@ -80,6 +80,7 @@ gb_CppunitTest_CPPTESTCOMMAND := $(call gb_Executable_get_target_for_build,cppun else gb_CppunitTest_RUNTIMEDEPS := gb_CppunitTest_CPPTESTCOMMAND := +#gb_CppunitTest_CPPTESTCOMMAND := strace -o trace.log endif # i18npool dlopens localedata_* libraries. diff --git a/static/CustomTarget_components.mk b/static/CustomTarget_components.mk index 384985426a2a..9bd72a0b1f26 100644 --- a/static/CustomTarget_components.mk +++ b/static/CustomTarget_components.mk @@ -19,6 +19,6 @@ $(static_WORKDIR)/component_maps.cxx: \ $(SRCDIR)/solenv/bin/native-code.py \ | $(static_WORKDIR)/.dir $(call gb_Output_announce,$(subst $(BUILDDIR)/,,$@),$(true),GEN,2) - $(call gb_Helper_abbreviate_dirs,$(call gb_ExternalExecutable_get_command,python) $< -g core -g writer) > $@ + $(call gb_Helper_abbreviate_dirs,$(call gb_ExternalExecutable_get_command,python) $< -g core -g writer -g desktop) > $@ # vim: set noet sw=4: diff --git a/vcl/wasm/salplug.cxx b/vcl/wasm/salplug.cxx index b5ba480dd104..6e498742b5c1 100644 --- a/vcl/wasm/salplug.cxx +++ b/vcl/wasm/salplug.cxx @@ -33,7 +33,12 @@ const OUString& SalGetDesktopEnvironment() return aEnv; } -SalInstance* CreateSalInstance() { return create_SalInstance(); } +SalInstance* CreateSalInstance() +{ + SalInstance* pInst = create_SalInstance(); + pInst->AcquireYieldMutex(); + return pInst; +} void DestroySalInstance(SalInstance* pInst) { commit 5c8fe6488a4a2e90f5f3dbbadd0dff3e77d85dd4 Author: Thorsten Behrens <thorsten.behr...@allotropia.de> AuthorDate: Mon Mar 15 00:17:41 2021 +0100 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Wed May 5 21:41:52 2021 +0200 Add docs for container build setup Change-Id: Ib250ae58e0dc36169125707a8c523d59239cabf6 diff --git a/README.wasm b/README.wasm index 525a9baf1864..c1f1c618a973 100644 --- a/README.wasm +++ b/README.wasm @@ -121,6 +121,36 @@ The lode setup expects, inside the lode/docker subdir, the following directories - tarballs (external project tarballs gets written and cached there) +== Using Docker to cross-build with emscripten == + +If you prefer a controlled environment (sadly emsdk install/activate +is _not_ stable over time, as e.g. nodejs versions evolve), that is +easy to replicate across different machines - consider the docker +images we're providing. + +Config/setup file see +https://git.libreoffice.org/lode/+/ccb36979563635b51215477455953252c99ec013 + +Run + + docker-compose build + +in the lode/docker dir to get the container prepared. Run + + PARALLELISM=4 BUILD_OPTIONS= BUILD_TARGET=build docker-compose run --rm -e PARALLELISM -e BUILD_TARGET -e BUILD_OPTIONS builder + +to perform an actual srcdir != buildir build; the container mounts +checked-out git repo and output dir via docker-compose.yml (so make +sure the path names there match your setup): + +The lode setup expects, inside the lode/docker subdir, the following directories: + +- core (git checkout) +- workdir (the output dir - gets written into) +- cache (ccache tree) +- tarballs (external project tarballs gets written and cached there) + + = Ideas for an UNO bridge implementation = My post to Discord #emscripten: "I'm looking for a way to do an abstract call commit e4c05e03c05cd2ceb0b68d52e5e2d9ee2fd9b173 Author: Jan-Marek Glogowski <glo...@fbihome.de> AuthorDate: Sat Mar 13 00:13:30 2021 +0100 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Wed May 5 21:41:50 2021 +0200 catchall Change-Id: I8b4dea6870dc6698a03cd2607f98eb57971eca4b diff --git a/Repository.mk b/Repository.mk index fdaa075101dc..84c3aff700c7 100644 --- a/Repository.mk +++ b/Repository.mk @@ -201,9 +201,7 @@ $(eval $(call gb_Helper_register_executables_for_install,OOO,ooo, \ gengal \ $(if $(filter WNT,$(OS)),,uri-encode) \ $(if $(ENABLE_MACOSX_SANDBOX),, \ - $(if $(DISABLE_GUI),, \ ui-previewer \ - ) \ ) \ $(if $(filter WNT,$(OS)), \ senddoc \ @@ -326,7 +324,6 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ogltrans, \ )) $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \ - acc \ $(call gb_Helper_optional,AVMEDIA,avmedia) \ $(if $(filter MACOSX,$(OS)),\ avmediaMacAVF \ @@ -345,10 +342,8 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \ $(call gb_Helper_optional,OPENCL,clew) \ $(if $(filter $(OS),WNT),,cmdmail) \ cppcanvas \ - $(if $(filter $(OS),EMSCRIPTEN),components) \ configmgr \ ctl \ - cui \ dba \ dbahsql \ $(call gb_Helper_optional,DBCONNECTIVITY, \ @@ -480,12 +475,15 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \ )) $(eval $(call gb_Helper_register_plugins_for_install,OOOLIBS,ooo, \ + acc \ + $(if $(DISABLE_DYNLOADING),components) \ + cui \ gie \ sdui \ $(if $(USING_X11),vclplug_gen) \ $(if $(filter $(OS),WNT),vclplug_win) \ $(if $(filter $(OS),MACOSX),vclplug_osx) \ - $(if $(filter EMSCRIPTEN,$(OS)),vclplug_qt5) \ + vclplug_qt5 \ )) $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,postgresqlsdbc, \ diff --git a/RepositoryFixes.mk b/RepositoryFixes.mk index 741f6bbfee21..5f149631919a 100644 --- a/RepositoryFixes.mk +++ b/RepositoryFixes.mk @@ -69,11 +69,6 @@ else # libpyuno_wrapper.so => pyuno.so gb_Library_FILENAMES := $(patsubst pyuno_wrapper:libpyuno_wrapper.so,pyuno_wrapper:pyuno.so,$(gb_Library_FILENAMES)) endif - -ifneq ($(OS),ANDROID) -gb_Library_FILENAMES := $(patsubst unobootstrapprotector:libuno%,unobootstrapprotector:uno%,$(gb_Library_FILENAMES)) -gb_Library_FILENAMES := $(patsubst unoexceptionprotector:libuno%,unoexceptionprotector:uno%,$(gb_Library_FILENAMES)) -endif endif ifeq ($(OS),WNT) diff --git a/RepositoryModule_host.mk b/RepositoryModule_host.mk index 64068ffc0e49..ff07e415e25f 100644 --- a/RepositoryModule_host.mk +++ b/RepositoryModule_host.mk @@ -111,6 +111,7 @@ $(eval $(call gb_Module_add_moduledirs,libreoffice,\ solenv \ soltools \ sot \ + static \ stoc \ store \ svl \ @@ -140,20 +141,20 @@ $(eval $(call gb_Module_add_moduledirs,libreoffice,\ uui \ vbahelper \ vcl \ - wasm \ wasm-qt \ winaccessibility \ wizards \ writerfilter \ writerperfect \ xmerge \ - $(call gb_Helper_optional,DESKTOP,xmlhelp) \ + $(call gb_Helper_optional,DESKTOP,$(if $(DISABLE_DYNLOADING),,xmlhelp)) \ xmloff \ xmlreader \ xmlscript \ xmlsecurity \ )) +ifeq (,$(DISABLE_DYNLOADING)) # Especially when building everything with symbols, the linking of the largest # libraries takes enormous amounts of RAM. To prevent annoying OOM situations # etc., try to prevent linking these in parallel by adding artificial build @@ -186,5 +187,6 @@ $(eval $(call repositorymodule_serialize,\ svx svxcore xo sfx fwk svt vcl) \ )) endif +endif # !$(DISABLE_DYNLOADING) # vim: set noet sw=4 ts=4: diff --git a/accessibility/Library_acc.mk b/accessibility/Library_acc.mk index 6e4c90eba50d..cf63cf5836a8 100644 --- a/accessibility/Library_acc.mk +++ b/accessibility/Library_acc.mk @@ -9,6 +9,8 @@ $(eval $(call gb_Library_Library,acc)) +$(eval $(call gb_Library_set_plugin_for,acc,tk)) + $(eval $(call gb_Library_set_include,acc,\ $$(INCLUDE) \ -I$(SRCDIR)/accessibility/inc \ @@ -31,7 +33,6 @@ $(eval $(call gb_Library_use_libraries,acc,\ sot \ svl \ svt \ - tk \ tl \ utl \ vcl \ diff --git a/bin/run b/bin/run index 523da3c0e178..ea3a551d9e50 100755 --- a/bin/run +++ b/bin/run @@ -71,6 +71,7 @@ fi # echo "setting search path to: ${SEARCH_PATH}" # echo "execing: ${exedir}/$1" +env | sort exec ${LO_TRACE} "${exedir}/$@" # vi:set shiftwidth=4 expandtab: diff --git a/chart2/Module_chart2.mk b/chart2/Module_chart2.mk index 37acfdc3730f..02a56e276205 100644 --- a/chart2/Module_chart2.mk +++ b/chart2/Module_chart2.mk @@ -24,23 +24,6 @@ $(eval $(call gb_Module_add_check_targets,chart2,\ CppunitTest_chart2_common_functors \ )) -$(eval $(call gb_Module_add_slowcheck_targets,chart2,\ - CppunitTest_chart2_export \ - CppunitTest_chart2_import \ - CppunitTest_chart2_trendcalculators \ - CppunitTest_chart2_dump \ - CppunitTest_chart2_pivot_chart_test \ - CppunitTest_chart2_geometry \ -)) - -ifeq ($(ENABLE_CHART_TESTS),TRUE) -ifeq ($(WITH_FONTS), TRUE) -$(eval $(call gb_Module_add_slowcheck_targets,chart2,\ - CppunitTest_chart2_xshape \ -)) -endif -endif - $(eval $(call gb_Module_add_subsequentcheck_targets,chart2,\ JunitTest_chart2_unoapi \ )) diff --git a/cppu/Module_cppu.mk b/cppu/Module_cppu.mk index 17f6936f7878..f00558a4056a 100644 --- a/cppu/Module_cppu.mk +++ b/cppu/Module_cppu.mk @@ -26,7 +26,6 @@ $(eval $(call gb_Module_add_check_targets,cppu,\ CppunitTest_cppu_qa_recursion \ CppunitTest_cppu_qa_reference \ CppunitTest_cppu_qa_unotype \ - CppunitTest_cppu_test_cppumaker \ CppunitTest_cppu_typelib \ )) diff --git a/cpputools/Module_cpputools.mk b/cpputools/Module_cpputools.mk index de043ea9bf45..72b2b4307dbf 100644 --- a/cpputools/Module_cpputools.mk +++ b/cpputools/Module_cpputools.mk @@ -14,7 +14,6 @@ ifneq ($(OS),EMSCRIPTEN) $(eval $(call gb_Module_add_targets,cpputools,\ Executable_sp2bv \ - Executable_uno \ )) endif diff --git a/cui/Library_cui.mk b/cui/Library_cui.mk index d6fa68e0d194..01e2bd8cd191 100644 --- a/cui/Library_cui.mk +++ b/cui/Library_cui.mk @@ -9,6 +9,8 @@ $(eval $(call gb_Library_Library,cui)) +$(eval $(call gb_Library_set_plugin_for,cui,vcl)) + $(eval $(call gb_Library_set_componentfile,cui,cui/util/cui)) $(eval $(call gb_Library_set_include,cui,\ @@ -58,7 +60,6 @@ $(eval $(call gb_Library_use_libraries,cui,\ tl \ ucbhelper \ utl \ - vcl \ $(if $(ENABLE_BREAKPAD), \ crashreport \ ) \ diff --git a/desktop/Executable_oosplash.mk b/desktop/Executable_oosplash.mk index a14acd626b74..ae7b3dfaa74e 100644 --- a/desktop/Executable_oosplash.mk +++ b/desktop/Executable_oosplash.mk @@ -56,6 +56,8 @@ endif ifeq ($(OS),LINUX) $(eval $(call gb_Executable_add_libs,oosplash,\ -lm \ + -lstdc++ \ + -pthread \ )) endif diff --git a/desktop/Module_desktop.mk b/desktop/Module_desktop.mk index 31bbf9d3a472..64717578b26f 100644 --- a/desktop/Module_desktop.mk +++ b/desktop/Module_desktop.mk @@ -33,7 +33,6 @@ $(eval $(call gb_Module_add_l10n_targets,desktop,\ ifneq (,$(filter DESKTOP,$(BUILD_TYPE))) $(eval $(call gb_Module_add_targets,desktop,\ Executable_soffice_bin \ - Executable_unopkg_bin \ $(if $(ENABLE_BREAKPAD),Executable_minidump_upload) \ Library_migrationoo2 \ Library_migrationoo3 \ @@ -44,10 +43,7 @@ $(eval $(call gb_Module_add_targets,desktop,\ ifneq ($(OS),MACOSX) ifneq ($(OS),WNT) $(eval $(call gb_Module_add_targets,desktop,\ - Pagein_calc \ Pagein_common \ - Pagein_draw \ - Pagein_impress \ Pagein_writer \ CustomTarget_soffice \ )) @@ -142,7 +138,6 @@ $(eval $(call gb_Module_add_check_targets,desktop, \ ifeq ($(OS),LINUX) $(eval $(call gb_Module_add_check_targets,desktop, \ - CppunitTest_desktop_lib \ CppunitTest_desktop_lokinit \ )) endif diff --git a/extensions/Module_extensions.mk b/extensions/Module_extensions.mk index c3f87aca815c..f0a4784b8b56 100644 --- a/extensions/Module_extensions.mk +++ b/extensions/Module_extensions.mk @@ -13,7 +13,7 @@ $(eval $(call gb_Module_add_l10n_targets,extensions,\ AllLangMoTarget_pcr \ )) -ifneq ($(filter-out EMSCRIPTEN iOS ANDROID,$(OS)),) +ifeq (,$(DISABLE_DYNLOADING)) $(eval $(call gb_Module_add_targets,extensions,\ Library_abp \ Library_scn \ diff --git a/postprocess/Rdb_services.mk b/postprocess/Rdb_services.mk index 1f5d530a81f6..be437b9801b1 100644 --- a/postprocess/Rdb_services.mk +++ b/postprocess/Rdb_services.mk @@ -196,9 +196,6 @@ $(eval $(call gb_Rdb_add_components,services,\ extensions/source/update/check/updchk.uno \ extensions/source/update/ui/updchk \ ) \ - $(if $(ENABLE_OPENGL_TRANSITIONS), \ - slideshow/source/engine/opengl/ogltrans \ - ) \ $(if $(ENABLE_JAVA), \ xmerge/source/bridge/XMergeBridge \ scripting/java/ScriptFramework \ @@ -275,15 +272,11 @@ $(eval $(call gb_Rdb_add_components,services,\ desktop/source/migration/services/migrationoo3 \ desktop/source/offacc/offacc \ $(if $(DISABLE_GUI),,desktop/source/splash/spl) \ - extensions/source/abpilot/abp \ $(if $(ENABLE_LDAP),extensions/source/config/ldap/ldapbe2) \ $(if $(filter WNT,$(OS)),\ extensions/source/config/WinUserInfo/WinUserInfoBe \ ) \ extensions/source/logging/log \ - extensions/source/scanner/scn \ - extensions/source/update/feed/updatefeed \ - xmlhelp/util/ucpchelp1 \ $(if $(filter-out WNT,$(OS)),\ shell/source/cmdmail/cmdmail \ ) \ diff --git a/sal/StaticLibrary_cppunitmain.mk b/sal/Library_cppunitmain.mk similarity index 60% rename from sal/StaticLibrary_cppunitmain.mk rename to sal/Library_cppunitmain.mk index 30c64d7b3980..07f51e0c4821 100644 --- a/sal/StaticLibrary_cppunitmain.mk +++ b/sal/Library_cppunitmain.mk @@ -8,30 +8,32 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -$(eval $(call gb_StaticLibrary_StaticLibrary,cppunitmain)) +$(eval $(call gb_Library_Library,cppunitmain)) -$(eval $(call gb_StaticLibrary_set_include,cppunitmain,\ +$(eval $(call gb_Library_set_include,cppunitmain,\ $$(INCLUDE) \ -I$(SRCDIR)/sal/inc \ )) -$(eval $(call gb_StaticLibrary_use_libraries,cppunitmain,\ +$(eval $(call gb_Library_use_libraries,cppunitmain,\ sal \ unoexceptionprotector \ + unobootstrapprotector \ + vclbootstrapprotector \ )) -$(eval $(call gb_StaticLibrary_use_externals,cppunitmain,\ +$(eval $(call gb_Library_use_externals,cppunitmain,\ boost_headers \ cppunit \ )) -$(eval $(call gb_StaticLibrary_add_exception_objects,cppunitmain,\ +$(eval $(call gb_Library_add_exception_objects,cppunitmain,\ sal/cppunittester/cppunittester \ )) ifeq ($(COM),MSC) -$(eval $(call gb_StaticLibrary_add_ldflags,cppunitmain,\ +$(eval $(call gb_Library_add_ldflags,cppunitmain,\ /STACK:10000000 \ )) diff --git a/sal/Module_sal.mk b/sal/Module_sal.mk index a24fe27ab869..d7076bf31e70 100644 --- a/sal/Module_sal.mk +++ b/sal/Module_sal.mk @@ -10,7 +10,7 @@ $(eval $(call gb_Module_Module,sal)) $(eval $(call gb_Module_add_targets,sal,\ - $(if $(or $(CROSS_COMPILING),$(DISABLE_DYNLOADING)),StaticLibrary_cppunitmain,Executable_cppunittester) \ + $(if $(or $(CROSS_COMPILING),$(DISABLE_DYNLOADING)),Library_cppunitmain,Executable_cppunittester) \ $(if $(filter $(OS),ANDROID), \ Library_lo-bootstrap) \ Library_sal \ diff --git a/solenv/bin/image-sort.py b/solenv/bin/image-sort.py index 75b5da6ce0e7..5d248684b4a6 100644 --- a/solenv/bin/image-sort.py +++ b/solenv/bin/image-sort.py @@ -30,7 +30,7 @@ def read_icons(fname): full_path = os.path.join(args.base_path, fname) if not os.path.exists(full_path): if not args.quiet: - print("Skipping non-existent {}\n".format(full_path), file=sys.stderr) + print("Skipping non-existent {}".format(full_path), file=sys.stderr) return images with open(full_path) as fp: for line in fp: diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk index 6255fc0544c8..296b8e379a0c 100644 --- a/solenv/gbuild/CppunitTest.mk +++ b/solenv/gbuild/CppunitTest.mk @@ -74,8 +74,13 @@ endif # defined by platform # gb_CppunitTest_get_filename +ifeq (,$(DISABLE_DYNLOADING)) gb_CppunitTest_RUNTIMEDEPS := $(call gb_Executable_get_runtime_dependencies,cppunittester) gb_CppunitTest_CPPTESTCOMMAND := $(call gb_Executable_get_target_for_build,cppunittester) +else +gb_CppunitTest_RUNTIMEDEPS := +gb_CppunitTest_CPPTESTCOMMAND := +endif # i18npool dlopens localedata_* libraries. gb_CppunitTest_RUNTIMEDEPS += \ @@ -206,7 +211,8 @@ $(call gb_CppunitTest_get_target,$(1)) : EXTRA_ENV_VARS := $$(eval $$(call gb_Module_register_target,$(call gb_CppunitTest_get_target,$(1)),$(call gb_CppunitTest_get_clean_target,$(1)))) $(call gb_Helper_make_userfriendly_targets,$(1),CppunitTest) ifneq (,$(DISABLE_DYNLOADING)) -$$(eval $$(call gb_CppunitTest_use_static_libraries,$(1),cppunitmain)) +$$(eval $$(call gb_CppunitTest_use_libraries,$(1),cppunitmain)) +$$(eval $$(call gb_CppunitTest_add_defs,$(1),-D__EMSCRIPTEN__)) endif $(if $(filter $(1),$(gb_CppunitTest_KNOWN)),,gb_CppunitTest_KNOWN += $(1)) diff --git a/solenv/gbuild/platform/linux.mk b/solenv/gbuild/platform/linux.mk index ece7a88bd71f..823190490589 100644 --- a/solenv/gbuild/platform/linux.mk +++ b/solenv/gbuild/platform/linux.mk @@ -17,12 +17,20 @@ gb_LinkTarget_LDFLAGS += $(gb__LinkTarget_LDFLAGS_zdefs) include $(GBUILDDIR)/platform/unxgcc.mk +gb_STDLIBS := + ifeq ($(DISABLE_DYNLOADING),TRUE) -gb_STDLIBS := -ldl +gb_STDLIBS += -ldl -lm endif +gb_STDLIBS_CXX := + ifneq ($(ATOMIC_LIB),) -gb_STDLIBS_CXX := $(ATOMIC_LIB) +gb_STDLIBS_CXX += $(ATOMIC_LIB) +endif + +ifeq ($(DISABLE_DYNLOADING),TRUE) +gb_STDLIBS_CXX += -lstdc++ endif # vim: set noet sw=4 ts=4: diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk index 515a2b37c9d4..43579bd0c6aa 100644 --- a/solenv/gbuild/platform/unxgcc.mk +++ b/solenv/gbuild/platform/unxgcc.mk @@ -136,7 +136,7 @@ $(call gb_Helper_abbreviate_dirs,\ $(patsubst lib%.a,-l%,$(patsubst lib%.so,-l%,$(patsubst %.$(gb_Library_UDK_MAJORVER),%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib)))))) \ $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) \ $(T_LIBS) \ - $(if $(CXXOBJECTS)$(GENCXXOBJECTS)$(EXTRAOBJECTLISTS)$(filter-out XTRUE,X$(ENABLE_RUNTIME_OPTIMIZATIONS)),$(T_STDLIBS_CXX)) \ + $(T_STDLIBS_CXX) $(T_STDLIBS) \ -Wl$(COMMA)--end-group \ , \ -Wl$(COMMA)--start-group \ diff --git a/solenv/gbuild/static.mk b/solenv/gbuild/static.mk index 7928a699d42f..be30960b0d3e 100644 --- a/solenv/gbuild/static.mk +++ b/solenv/gbuild/static.mk @@ -83,9 +83,9 @@ $(if $(strip $(filter-out GBUILD_TOUCHED, \ ifeq (,$(gb_PARTIAL_BUILD)) -ifeq ($(OS),EMSCRIPTEN) +#ifeq ($(OS),EMSCRIPTEN) $(foreach lib,$(gb_Library_KNOWNLIBS),$(if $(call gb_Library__get_component,$(lib)),$(eval $(call gb_Library_use_libraries,components,$(lib))))) -endif +#endif define gb_LinkTarget__add_x_template @@ -147,6 +147,7 @@ endef define gb_LinkTarget__remove_touch $(call gb_LinkTarget__get_all_libraries_var,$(1)) := $(filter-out GBUILD_TOUCHED,$(call gb_LinkTarget__get_all_libraries,$(1))) $(call gb_LinkTarget__get_all_externals_var,$(1)) := $(filter-out GBUILD_TOUCHED,$(call gb_LinkTarget__get_all_externals,$(1))) +$(call gb_LinkTarget__get_all_statics_var,$(1)) := $(filter-out GBUILD_TOUCHED,$(call gb_LinkTarget__get_all_statics,$(1))) endef @@ -160,9 +161,10 @@ endef define gb_LinkTarget__fill_all_x_template define gb_LinkTarget__fill_all_$(if $(5),$(5),$(1)) -$$(if $$(filter GBUILD_TOUCHED,$$(call gb_$(2)__get_all_$(1),$$(1))),, +$$(if $$(filter GBUILD_TOUCHED,$$(call gb_$(if $(6),$(6),$(2))__get_all_$(1),$$(1))),, $(if $(gb_DEBUG_STATIC),$$(info gb_LinkTarget__fill_all_$(if $(5),$(5),$(1)) $(1) for $$(1) in: $$(call gb_$(if $(6),$(6),$(2))__get_all_$(1),$$(1)))) $(if $(gb_DEBUG_STATIC),$$(info gb_LinkTarget__fill_all_$(if $(5),$(5),$(1)) $(3) for $$(1) in: $$(call gb_$(if $(6),$(6),$(2))__get_all_$(3),$$(1)))) + $$(eval $$(call gb_LinkTarget__add_touch,$$(call gb_$(if $(6),$(6),$(2))__get_workdir_linktargetname,$$(1)))) $$(foreach item,$$(call gb_$(if $(6),$(6),$(2))__get_all_$(1),$$(1)), $$(call gb_LinkTarget__fill_all_$(1),$$(item)) $$(foreach dep,$$(call gb_$(2)__get_all_$(1),$$(item)), @@ -179,7 +181,6 @@ $$(if $$(filter GBUILD_TOUCHED,$$(call gb_$(2)__get_all_$(1),$$(1))),, $$(foreach dep,$$(call gb_$(4)__get_all_$(3),$$(item)), $$(if $$(filter $$(dep),GBUILD_TOUCHED $$(call gb_$(if $(6),$(6),$(2))__get_all_$(3),$$(1))),, $$(eval $$(call gb_LinkTarget__add_$(3),$$(call gb_$(if $(6),$(6),$(2))__get_workdir_linktargetname,$$(1)),$$(dep)))))) - $$(eval $$(call gb_LinkTarget__add_touch,$$(call gb_$(if $(6),$(6),$(2))__get_workdir_linktargetname,$$(1)))) $(if $(gb_DEBUG_STATIC),$$(info gb_LinkTarget__fill_all_$(if $(5),$(5),$(1)) $(1) for $$(1) out: $$(call gb_$(if $(6),$(6),$(2))__get_all_$(1),$$(1)))) $(if $(gb_DEBUG_STATIC),$$(info gb_LinkTarget__fill_all_$(if $(5),$(5),$(1)) $(3) for $$(1) out: $$(call gb_$(if $(6),$(6),$(2))__get_all_$(3),$$(1))))) @@ -203,13 +204,17 @@ $(eval $(call gb_LinkTarget__fill_all_x_template,libraries,Library,externals,Ext gb_Executable__LAST_KNOWN = gb_CppunitTest__LAST_KNOWN = +#$(eval $(call gb_Library_use_libraries,cppuhelper,components)) + # The comment exists To help decipering / verifying the following block. Most later items depends on previous one(s). # # * Expand all libraries. It's not strictly needed, as we only need the info for the executables, # but this way we can implement updating single gbuild-module dependencies as needed. # * For all executables (incl. CppunitTest(s)): -# * For EMSCRIPTEN, add components library to any cppuhelper user, as it contains the call to the mapper functions -# * Find any loader libraries and add the needed plugin dependences +# * Expand all normal dependencies +# * Check if cppuhelper loader for components is requested and add the needed plugin dependences +# This is a *HACK*, so we don't have to recursively check loader libraries - at least currently +# * Find any other loader libraries and add the needed plugin dependences # * Add all statics to the executables # * Add icudata as needed (it should be a plugin somehow declared in RepositoryExternal.mk, but that didn't work) # * Serialize the linking of executables for EMSCRIPTEN, because wasm-opt is multi-threaded using all cores. @@ -217,10 +222,11 @@ gb_CppunitTest__LAST_KNOWN = $(foreach lib,$(gb_Library_KNOWNLIBS),$(eval $(call gb_LinkTarget__fill_all_libraries,$(lib)))) define gb_LinkTarget__expand_executable -$$(if $$(and $$(filter EMSCRIPTEN,$$(OS)),$$(filter cppuhelper,$$(call gb_$(2)__get_all_libraries,$(3)))), \ - $$(eval $$(call gb_$(2)_use_libraries,$(3),components))) \ $$(eval $$(call gb_LinkTarget__fill_all_$(1),$(3))) \ -$$(foreach loader,$$(filter $$(gb_Library_KNOWNLOADERS),$$(call gb_$(2)__get_all_libraries,$(3))), \ +$$(if $$(filter cppuhelper,$$(filter $$(gb_Library_KNOWNLOADERS),$$(call gb_$(2)__get_all_libraries,$(3)))), \ + $$(eval $$(call gb_$(2)_use_libraries,$(3),$$(call gb_Library__get_plugins,cppuhelper))) \ + $$(eval $$(call gb_$(2)__add_libraries,$(3),$$(call gb_Library__get_plugins,cppuhelper)))) \ +$$(foreach loader,$$(filter $$(filter-out cppuhelper,$$(gb_Library_KNOWNLOADERS)),$$(call gb_$(2)__get_all_libraries,$(3))), \ $$(eval $$(call gb_$(2)_use_libraries,$(3),$$(call gb_Library__get_plugins,$$(loader)))) \ $$(eval $$(call gb_$(2)__add_libraries,$(3),$$(call gb_Library__get_plugins,$$(loader))))) \ $$(if $$(filter-out GBUILD_TOUCHED,$$(call gb_$(2)__get_all_libraries,$(3))), \ diff --git a/wasm/CustomTarget_components.mk b/static/CustomTarget_components.mk similarity index 67% rename from wasm/CustomTarget_components.mk rename to static/CustomTarget_components.mk index cb188166d894..384985426a2a 100644 --- a/wasm/CustomTarget_components.mk +++ b/static/CustomTarget_components.mk @@ -8,16 +8,16 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -$(eval $(call gb_CustomTarget_CustomTarget,wasm/components)) +$(eval $(call gb_CustomTarget_CustomTarget,static/components)) -wasm_WORKDIR := $(call gb_CustomTarget_get_workdir,wasm) +static_WORKDIR := $(call gb_CustomTarget_get_workdir,static) -$(call gb_CustomTarget_get_target,wasm/components): \ - $(wasm_WORKDIR)/component_maps.cxx +$(call gb_CustomTarget_get_target,static/components): \ + $(static_WORKDIR)/component_maps.cxx -$(wasm_WORKDIR)/component_maps.cxx: \ +$(static_WORKDIR)/component_maps.cxx: \ $(SRCDIR)/solenv/bin/native-code.py \ - | $(wasm_WORKDIR)/.dir + | $(static_WORKDIR)/.dir $(call gb_Output_announce,$(subst $(BUILDDIR)/,,$@),$(true),GEN,2) $(call gb_Helper_abbreviate_dirs,$(call gb_ExternalExecutable_get_command,python) $< -g core -g writer) > $@ diff --git a/wasm/Library_components.mk b/static/Library_components.mk similarity index 72% rename from wasm/Library_components.mk rename to static/Library_components.mk index 128a3c12c2df..d3e7a0d149c1 100644 --- a/wasm/Library_components.mk +++ b/static/Library_components.mk @@ -9,8 +9,14 @@ $(eval $(call gb_Library_Library,components)) +$(eval $(call gb_Library_set_plugin_for,components,cppuhelper)) + $(eval $(call gb_Library_add_generated_exception_objects,components,\ - CustomTarget/wasm/component_maps \ + CustomTarget/static/component_maps \ +)) + +$(eval $(call gb_Library_use_libraries,acc,\ + $(gb_CPPU_ENV)_uno \ )) # vim: set noet sw=4 ts=4: diff --git a/wasm/Makefile b/static/Makefile similarity index 100% rename from wasm/Makefile rename to static/Makefile diff --git a/wasm/Module_wasm.mk b/static/Module_static.mk similarity index 77% rename from wasm/Module_wasm.mk rename to static/Module_static.mk index eff9d0d7d1e9..f8909994ab7b 100644 --- a/wasm/Module_wasm.mk +++ b/static/Module_static.mk @@ -6,11 +6,11 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -$(eval $(call gb_Module_Module,wasm)) +$(eval $(call gb_Module_Module,static)) -ifeq ($(OS),EMSCRIPTEN) +ifeq ($(DISABLE_DYNLOADING),TRUE) -$(eval $(call gb_Module_add_targets,wasm,\ +$(eval $(call gb_Module_add_targets,static,\ CustomTarget_components \ Library_components \ )) diff --git a/static/README b/static/README new file mode 100644 index 000000000000..d1254dd22da3 --- /dev/null +++ b/static/README @@ -0,0 +1,2 @@ +Static components library, containing a map from all component names +to their constructor function calls. diff --git a/sw/CppunitTest_sw_apitests.mk b/sw/CppunitTest_sw_apitests.mk index d65c058fc97c..4124c32be618 100644 --- a/sw/CppunitTest_sw_apitests.mk +++ b/sw/CppunitTest_sw_apitests.mk @@ -53,7 +53,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_apitests, \ ucbhelper \ unotest \ utl \ - vbahelper \ + $(call gb_Helper_optional,SCRIPTING,vbahelper) \ vcl \ xo \ )) diff --git a/sw/CppunitTest_sw_macros_test.mk b/sw/CppunitTest_sw_macros_test.mk index 7f38c45180bb..bb675c609df3 100644 --- a/sw/CppunitTest_sw_macros_test.mk +++ b/sw/CppunitTest_sw_macros_test.mk @@ -48,7 +48,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_macros_test, \ ucbhelper \ unotest \ utl \ - vbahelper \ + $(call gb_Helper_optional,SCRIPTING,vbahelper) \ vcl \ xo \ )) diff --git a/sw/CppunitTest_sw_uwriter.mk b/sw/CppunitTest_sw_uwriter.mk index e6a490c5dff1..b0c36f396ba0 100644 --- a/sw/CppunitTest_sw_uwriter.mk +++ b/sw/CppunitTest_sw_uwriter.mk @@ -56,7 +56,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_uwriter, \ ucbhelper \ unotest \ utl \ - vbahelper \ + $(call gb_Helper_optional,SCRIPTING,vbahelper) \ vcl \ xmlreader \ xo \ diff --git a/unotest/source/cpp/bootstrapfixturebase.cxx b/unotest/source/cpp/bootstrapfixturebase.cxx index 5c5b3bcc3a9c..348ecb796e85 100644 --- a/unotest/source/cpp/bootstrapfixturebase.cxx +++ b/unotest/source/cpp/bootstrapfixturebase.cxx @@ -8,10 +8,13 @@ */ #include <sal/config.h> +#include <config_features.h> #include <unotest/bootstrapfixturebase.hxx> #include <comphelper/processfactory.hxx> +#if HAVE_FEATURE_SCRIPTING #include <basic/sbstar.hxx> +#endif using namespace ::com::sun::star; @@ -30,6 +33,11 @@ void test::BootstrapFixtureBase::setUp() m_xSFactory.set(m_xFactory, uno::UNO_QUERY_THROW); } -void test::BootstrapFixtureBase::tearDown() { StarBASIC::DetachAllDocBasicItems(); } +void test::BootstrapFixtureBase::tearDown() +{ +#if HAVE_FEATURE_SCRIPTING + StarBASIC::DetachAllDocBasicItems() +#endif +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/Executable_ui-previewer.mk b/vcl/Executable_ui-previewer.mk index f853ce40864e..7b846a2d3c29 100644 --- a/vcl/Executable_ui-previewer.mk +++ b/vcl/Executable_ui-previewer.mk @@ -41,6 +41,7 @@ $(eval $(call gb_Executable_add_defs,ui-previewer,\ )) ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS))) +ifneq (,$(USING_X11)) $(eval $(call gb_Executable_add_libs,ui-previewer,\ -lm $(DLOPEN_LIBS) \ -lX11 \ @@ -50,6 +51,7 @@ $(eval $(call gb_Executable_use_static_libraries,ui-previewer,\ glxtest \ )) endif +endif $(eval $(call gb_Executable_add_default_nativeres,ui-previewer)) diff --git a/vcl/Executable_vcldemo.mk b/vcl/Executable_vcldemo.mk index a9a8d195fdc9..7b8ecadab3cf 100644 --- a/vcl/Executable_vcldemo.mk +++ b/vcl/Executable_vcldemo.mk @@ -55,6 +55,7 @@ $(eval $(call gb_Executable_use_static_libraries,vcldemo,\ )) ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS))) +ifneq (,$(USING_X11)) $(eval $(call gb_Executable_add_libs,vcldemo,\ -lm $(DLOPEN_LIBS) \ -lX11 \ @@ -64,5 +65,6 @@ $(eval $(call gb_Executable_use_static_libraries,vcldemo,\ glxtest \ )) endif +endif # vim: set noet sw=4 ts=4: diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 95a6cf9ab878..1bc2c22e1b1c 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -580,7 +580,7 @@ vcl_headless_freetype_code=\ ifeq ($(USING_X11),TRUE) $(eval $(call gb_Library_add_exception_objects,vcl,\ - vcl/source/app/salplug \ + $(if $(DISABLE_DYNLOADING),,vcl/source/app/salplug) \ vcl/unx/generic/printer/jobdata \ vcl/unx/generic/printer/ppdparser \ vcl/unx/generic/window/screensaverinhibitor \ @@ -622,6 +622,12 @@ $(eval $(call gb_Library_use_externals,vcl,\ fontconfig \ freetype \ )) +else +ifneq (,$(DISABLE_DYNLOADING)) +$(eval $(call gb_Library_add_exception_objects,vcl,\ + vcl/wasm/salplug \ +)) +endif endif ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS))) diff --git a/vcl/Library_vclplug_qt5.mk b/vcl/Library_vclplug_qt5.mk index a91841ec32e4..cbf279ca179e 100644 --- a/vcl/Library_vclplug_qt5.mk +++ b/vcl/Library_vclplug_qt5.mk @@ -99,7 +99,6 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\ vcl/qt5/Qt5MainWindow \ vcl/qt5/Qt5Menu \ vcl/qt5/Qt5Object \ - vcl/qt5/Qt5OpenGLContext \ vcl/qt5/Qt5Painter \ vcl/qt5/Qt5Printer \ vcl/qt5/Qt5SvpGraphics \ diff --git a/vcl/Module_vcl.mk b/vcl/Module_vcl.mk index f01de5e0a89c..2e2034d131f9 100644 --- a/vcl/Module_vcl.mk +++ b/vcl/Module_vcl.mk @@ -32,19 +32,9 @@ $(eval $(call gb_Module_add_targets,vcl,\ $(if $(filter DESKTOP,$(BUILD_TYPE))$(filter EMSCRIPTEN,$(OS)), \ StaticLibrary_vclmain \ $(if $(ENABLE_MACOSX_SANDBOX),, \ - $(if $(DISABLE_GUI),, \ - Executable_ui-previewer)) \ + Executable_ui-previewer) \ $(if $(filter EMSCRIPTEN LINUX MACOSX SOLARIS WNT %BSD,$(OS)), \ - $(if $(DISABLE_GUI),, \ - Executable_vcldemo ))) \ -)) - -$(eval $(call gb_Module_add_targets,vcl,\ - $(if $(filter-out EMSCRIPTEN ANDROID iOS WNT,$(OS)), \ - Executable_svdemo \ - Executable_fftester \ - Executable_svptest \ - Executable_svpclient) \ + Executable_vcldemo )) \ )) $(eval $(call gb_Module_add_l10n_targets,vcl,\ diff --git a/wasm/README b/wasm/README deleted file mode 100644 index a23bd6a45ea9..000000000000 --- a/wasm/README +++ /dev/null @@ -1 +0,0 @@ -See /README.wasm commit bf8f4cd1000e77b997c51d85b40b16c69e90bc6c Author: Jan-Marek Glogowski <glo...@fbihome.de> AuthorDate: Fri Feb 26 14:42:02 2021 +0100 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Wed May 5 21:41:11 2021 +0200 catchall Change-Id: If3eadcc396ab500f1a08a334a957ee0494aef033 diff --git a/RepositoryModule_host.mk b/RepositoryModule_host.mk index 25a314e9785a..64068ffc0e49 100644 --- a/RepositoryModule_host.mk +++ b/RepositoryModule_host.mk @@ -107,12 +107,10 @@ $(eval $(call gb_Module_add_moduledirs,libreoffice,\ $(call gb_Helper_optional,DESKTOP,setup_native) \ sfx2 \ shell \ - slideshow \ smoketest \ solenv \ soltools \ sot \ - starmath \ stoc \ store \ svl \ @@ -143,6 +141,7 @@ $(eval $(call gb_Module_add_moduledirs,libreoffice,\ vbahelper \ vcl \ wasm \ + wasm-qt \ winaccessibility \ wizards \ writerfilter \ @@ -177,11 +176,10 @@ endef # the default goal is build (see Module.mk) ifeq (,$(filter-out build check unitcheck slowcheck screenshot subsequentcheck uicheck,$(MAKECMDGOALS))) $(eval $(call repositorymodule_serialize,\ - scfilt \ $(call gb_Helper_optional,SCRIPTING,vbaobj) \ - sc msword \ + msword \ $(call gb_Helper_optional,DESKTOP,swui) \ - sw sd \ + sw \ $(call gb_Helper_optional,DBCONNECTIVITY,dbu) \ writerfilter cui chartcontroller chartcore oox \ $(if $(MERGELIBS), merged, \ diff --git a/configure.ac b/configure.ac index 7e714ccc78f5..aa033a0c13ea 100644 --- a/configure.ac +++ b/configure.ac @@ -4401,6 +4401,10 @@ if test -n "$ENABLE_DBGUTIL" -o \( -n "$enable_debug" -a "$enable_debug" != "no" else AC_MSG_RESULT([yes]) fi + if test "$_os" = "Emscripten" -a -z "$enable_optimized"; then + # Otherwise binaries simply become too large (linker OOM + browser fails to load) + enable_optimized=debug + fi else ENABLE_DEBUG="" AC_MSG_RESULT([no]) diff --git a/postprocess/Rdb_services.mk b/postprocess/Rdb_services.mk index 0154db097caf..1f5d530a81f6 100644 --- a/postprocess/Rdb_services.mk +++ b/postprocess/Rdb_services.mk @@ -101,20 +101,6 @@ $(eval $(call gb_Rdb_add_components,services,\ lotuswordpro/util/lwpfilter \ ) \ oox/util/oox \ - sc/util/sc \ - sc/util/scd \ - sc/util/scfilt \ - scaddins/source/analysis/analysis \ - scaddins/source/datefunc/date \ - scaddins/source/pricing/pricing \ - sd/util/sd \ - sd/util/sdd \ - sd/util/sdfilt \ - sdext/source/presenter/presenter \ - sdext/source/minimizer/minimizer \ - slideshow/util/slideshow \ - starmath/util/sm \ - starmath/util/smd \ svx/util/svx \ svx/util/textconversiondlgs \ sw/util/msword \ @@ -144,7 +130,6 @@ $(eval $(call gb_Rdb_add_components,services,\ $(if $(ENABLE_LPSOLVE), \ sccomp/source/solver/lpsolvesolver \ ) \ - sccomp/source/solver/swarmsolver \ writerfilter/util/writerfilter \ writerperfect/source/draw/wpftdraw \ writerperfect/source/impress/wpftimpress \ diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk index 404b394d4e0c..f71525c835de 100644 --- a/solenv/gbuild/LinkTarget.mk +++ b/solenv/gbuild/LinkTarget.mk @@ -45,10 +45,9 @@ gb_LinkTarget__symbols_enabled = \ # debug flags, if the LinkTarget is named in the list of libraries of ENABLE_SYMBOLS_FOR gb_LinkTarget__get_debugflags= \ -$(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS), \ -$(if $(ENABLE_OPTIMIZED_DEBUG),$(gb_COMPILERDEBUGOPTFLAGS), \ -$(gb_COMPILERNOOPTFLAGS))) \ -$(if $(call gb_LinkTarget__symbols_enabled,$(1)),$(gb_DEBUGINFO_FLAGS)) + $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS), \ + $(if $(ENABLE_OPTIMIZED_DEBUG),$(gb_COMPILERDEBUGOPTFLAGS),$(gb_COMPILERNOOPTFLAGS))) \ + $(if $(call gb_LinkTarget__symbols_enabled,$(1)),$(gb_DEBUGINFO_FLAGS)) # T_LDFLAGS is just expanded once. Override the flags here, so that the linker and compiler use the same. ifeq (EMSCRIPTEN,$(OS)) diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk index d56b642382d2..515a2b37c9d4 100644 --- a/solenv/gbuild/platform/unxgcc.mk +++ b/solenv/gbuild/platform/unxgcc.mk @@ -158,7 +158,7 @@ $(call gb_Helper_abbreviate_dirs,\ $(WORKDIR)/LinkTarget/$(2).exports,$(1)))) $(if $(and $(filter CppunitTest Executable,$(TARGETTYPE)),$(filter EMSCRIPTEN,$(OS)),$(filter TRUE,$(ENABLE_QT5))), \ cp $(QT5_PLATFORMS_SRCDIR)/qtlogo.svg $(QT5_PLATFORMS_SRCDIR)/qtloader.js $(dir $(1)) ; \ - sed -e 's/@APPNAME@/$(subst $(gb_Executable_EXT),,$(notdir $(1)))/' $(QT5_PLATFORMS_SRCDIR)/wasm_shell.html > $(1)) + sed -e 's/@APPNAME@/$(subst $(gb_Executable_EXT),,$(notdir $(1)))/' $(QT5_PLATFORMS_SRCDIR)/wasm_shell.html > $(dir $(1))qt_$(notdir $(1))) endef define gb_LinkTarget__command_staticlink diff --git a/solenv/gbuild/static.mk b/solenv/gbuild/static.mk index da16724520d2..7928a699d42f 100644 --- a/solenv/gbuild/static.mk +++ b/solenv/gbuild/static.mk @@ -232,7 +232,7 @@ $$(if $$(filter-out GBUILD_TOUCHED,$$(call gb_$(2)__get_all_externals,$(3))), \ $$(eval $$(call gb_$(2)_use_externals,$(3),$$(filter-out GBUILD_TOUCHED,$$(call gb_$(2)__get_all_externals,$(3)))))) \ $$(if $$(filter icui28n icuuc,$$(call gb_$(2)__get_all_externals,$(3))), \ $$(eval $$(call gb_$(2)_use_externals,$(3),icudata))) \ -$$(if $$(and $$(filter EMSCRIPTEN,$$(OS)),$$(call gb_$(2)__has_any_dependencies,$(3))), \ +$$(if $$(and $$(filter EMSCRIPTEN,$$(OS)),$$(call gb_$(2)__has_any_dependencies,$(3)),), \ $$(if $$(gb_$(2)__LAST_KNOWN), \ $$(if $$(gb_DEBUG_STATIC),$$(info $$(call gb_$(2)_get_linktargetfile,$(3)) => $$(call gb_$(2)_get_linktargetfile,$$(gb_$(2)__LAST_KNOWN)))) \ $$(eval $$(call gb_$(2)_get_linktargetfile,$(3)) : $$(call gb_$(2)_get_linktargetfile,$$(gb_$(2)__LAST_KNOWN)))) \ diff --git a/vcl/Module_vcl.mk b/vcl/Module_vcl.mk index 3cf84ac21210..f01de5e0a89c 100644 --- a/vcl/Module_vcl.mk +++ b/vcl/Module_vcl.mk @@ -31,6 +31,9 @@ $(eval $(call gb_Module_add_targets,vcl,\ Package_skia_denylist ) \ $(if $(filter DESKTOP,$(BUILD_TYPE))$(filter EMSCRIPTEN,$(OS)), \ StaticLibrary_vclmain \ + $(if $(ENABLE_MACOSX_SANDBOX),, \ + $(if $(DISABLE_GUI),, \ + Executable_ui-previewer)) \ $(if $(filter EMSCRIPTEN LINUX MACOSX SOLARIS WNT %BSD,$(OS)), \ $(if $(DISABLE_GUI),, \ Executable_vcldemo ))) \ diff --git a/wasm/CustomTarget_wasm-qt5-mandelbrot_moc.mk b/wasm/CustomTarget_wasm-qt5-mandelbrot_moc.mk deleted file mode 100644 index 52b7447d22e9..000000000000 --- a/wasm/CustomTarget_wasm-qt5-mandelbrot_moc.mk +++ /dev/null @@ -1,37 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# - -$(eval $(call gb_CustomTarget_CustomTarget,wasm/qt5-mandelbrot)) - -$(call gb_CustomTarget_get_target,wasm/qt5-mandelbrot) : \ - $(call gb_CustomTarget_get_workdir,wasm/qt5-mandelbrot)/renderthread.moc \ - $(call gb_CustomTarget_get_workdir,wasm/qt5-mandelbrot)/mandelbrotwidget.moc \ - -qt5_mandelbrot_MOCDEFS_H := $(call gb_CustomTarget_get_workdir,wasm/qt5-mandelbrot)/moc_predefs.h -qt5_mandelbrot_MOCDEFS_CXX := $(call gb_CustomTarget_get_workdir,wasm/qt5-mandelbrot)/moc_dummy.cxx -qt5_mandelbrot_WORKDIR := $(call gb_CustomTarget_get_workdir,wasm/qt5-mandelbrot)/.dir - -$(qt5_mandelbrot_MOCDEFS_CXX): | $(qt5_mandelbrot_WORKDIR) - touch $@ - -$(qt5_mandelbrot_MOCDEFS_H): $(qt5_mandelbrot_MOCDEFS_CXX) | $(qt5_mandelbrot_WORKDIR) - $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),CXX,1) - $(call gb_Trace_StartRange,$(subst $(WORKDIR)/,,$@),CXX) - $(CXX) -pipe -O2 -std=gnu++11 -fno-exceptions $(gb_EMSCRIPTEN_CPPFLAGS) -dM -E -o $@ $< - $(call gb_Trace_EndRange,$(subst $(WORKDIR)/,,$@),MOC) - -$(call gb_CustomTarget_get_workdir,wasm/qt5-mandelbrot)/%.moc : \ - $(SRCDIR)/wasm/source/qt5-mandelbrot/%.h \ - $(qt5_mandelbrot_MOCDEFS_H) | $(qt5_mandelbrot_WORKDIR) - $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),MOC,1) - $(call gb_Trace_StartRange,$(subst $(WORKDIR)/,,$@),MOC) - $(MOC5) --include $(qt5_mandelbrot_MOCDEFS_H) $(gb_EMSCRIPTEN_QTDEFS) $< -o $@ - $(call gb_Trace_EndRange,$(subst $(WORKDIR)/,,$@),MOC) - -# vim: set noet sw=4: diff --git a/wasm/Executable_wasm-qt5-mandelbrot.mk b/wasm/Executable_wasm-qt5-mandelbrot.mk deleted file mode 100644 index 7afaa81c0dc4..000000000000 --- a/wasm/Executable_wasm-qt5-mandelbrot.mk +++ /dev/null @@ -1,32 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# - -$(eval $(call gb_Executable_Executable,wasm-qt5-mandelbrot)) - -$(eval $(call gb_Executable_use_custom_headers,wasm-qt5-mandelbrot,wasm/qt5-mandelbrot)) - -$(eval $(call gb_Executable_use_externals,wasm-qt5-mandelbrot,\ - graphite \ - freetype \ - harfbuzz \ - libpng \ - qt5 \ -)) - -$(eval $(call gb_Executable_add_exception_objects,wasm-qt5-mandelbrot,\ - wasm/source/qt5-mandelbrot/main \ - wasm/source/qt5-mandelbrot/mandelbrotwidget \ - wasm/source/qt5-mandelbrot/renderthread \ -)) - -$(eval $(call gb_Executable_add_defs,wasm-qt5-mandelbrot,\ - -DVCL_INTERNALS \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/wasm/Module_wasm.mk b/wasm/Module_wasm.mk index d6f507a005df..eff9d0d7d1e9 100644 --- a/wasm/Module_wasm.mk +++ b/wasm/Module_wasm.mk @@ -11,8 +11,6 @@ $(eval $(call gb_Module_Module,wasm)) ifeq ($(OS),EMSCRIPTEN) $(eval $(call gb_Module_add_targets,wasm,\ - CustomTarget_wasm-qt5-mandelbrot_moc \ - Executable_wasm-qt5-mandelbrot \ CustomTarget_components \ Library_components \ )) diff --git a/wasm/source/qt5-mandelbrot/main.cxx b/wasm/source/qt5-mandelbrot/main.cxx deleted file mode 100644 index 037c63153cf2..000000000000 --- a/wasm/source/qt5-mandelbrot/main.cxx +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "mandelbrotwidget.h" - -#include <QtWidgets/QApplication> -#include <QtCore/QtPlugin> - -Q_IMPORT_PLUGIN(QWasmIntegrationPlugin) - -int main(int argc, char* argv[]) -{ - QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); - QApplication app(argc, argv); - MandelbrotWidget widget; - widget.show(); - return app.exec(); -} diff --git a/wasm/source/qt5-mandelbrot/mandelbrotwidget.cxx b/wasm/source/qt5-mandelbrot/mandelbrotwidget.cxx deleted file mode 100644 index 5886dd2664c0..000000000000 --- a/wasm/source/qt5-mandelbrot/mandelbrotwidget.cxx +++ /dev/null @@ -1,228 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "mandelbrotwidget.h" -#include "mandelbrotwidget.moc" - -#include <QtGui/QPainter> -#include <QtGui/QKeyEvent> - -#include <math.h> - -const double DefaultCenterX = -0.637011; -const double DefaultCenterY = -0.0395159; -const double DefaultScale = 0.00403897; - -const double ZoomInFactor = 0.8; -const double ZoomOutFactor = 1 / ZoomInFactor; -const int ScrollStep = 20; - -MandelbrotWidget::MandelbrotWidget(QWidget* parent) - : QWidget(parent) - , centerX(DefaultCenterX) - , centerY(DefaultCenterY) - , pixmapScale(DefaultScale) - , curScale(DefaultScale) -{ - connect(&thread, &RenderThread::renderedImage, this, &MandelbrotWidget::updatePixmap); - - setWindowTitle(tr("Mandelbrot")); -#if QT_CONFIG(cursor) - setCursor(Qt::CrossCursor); -#endif - resize(550, 400); -} - -void MandelbrotWidget::paintEvent(QPaintEvent* /* event */) -{ - QPainter painter(this); - painter.fillRect(rect(), Qt::black); - - if (pixmap.isNull()) - { - painter.setPen(Qt::white); - painter.drawText(rect(), Qt::AlignCenter, tr("Rendering initial image, please wait...")); - return; - } - - if (qFuzzyCompare(curScale, pixmapScale)) - { - painter.drawPixmap(pixmapOffset, pixmap); - } - else - { - auto previewPixmap = qFuzzyCompare(pixmap.devicePixelRatioF(), qreal(1)) - ? pixmap - : pixmap.scaled(pixmap.size() / pixmap.devicePixelRatioF(), - Qt::KeepAspectRatio, Qt::SmoothTransformation); - double scaleFactor = pixmapScale / curScale; - int newWidth = int(previewPixmap.width() * scaleFactor); - int newHeight = int(previewPixmap.height() * scaleFactor); - int newX = pixmapOffset.x() + (previewPixmap.width() - newWidth) / 2; - int newY = pixmapOffset.y() + (previewPixmap.height() - newHeight) / 2; - - painter.save(); - painter.translate(newX, newY); - painter.scale(scaleFactor, scaleFactor); - - QRectF exposed = painter.transform().inverted().mapRect(rect()).adjusted(-1, -1, 1, 1); - painter.drawPixmap(exposed, previewPixmap, exposed); - painter.restore(); - } - - QString text = tr("Use mouse wheel or the '+' and '-' keys to zoom. " - "Press and hold left mouse button to scroll."); - QFontMetrics metrics = painter.fontMetrics(); - int textWidth = metrics.horizontalAdvance(text); - - painter.setPen(Qt::NoPen); - painter.setBrush(QColor(0, 0, 0, 127)); - painter.drawRect((width() - textWidth) / 2 - 5, 0, textWidth + 10, metrics.lineSpacing() + 5); - painter.setPen(Qt::white); - painter.drawText((width() - textWidth) / 2, metrics.leading() + metrics.ascent(), text); -} - -void MandelbrotWidget::resizeEvent(QResizeEvent* /* event */) -{ - thread.render(centerX, centerY, curScale, size(), devicePixelRatioF()); -} - -void MandelbrotWidget::keyPressEvent(QKeyEvent* event) -{ - switch (event->key()) - { - case Qt::Key_Plus: - zoom(ZoomInFactor); - break; - case Qt::Key_Minus: - zoom(ZoomOutFactor); - break; - case Qt::Key_Left: - scroll(-ScrollStep, 0); - break; - case Qt::Key_Right: - scroll(+ScrollStep, 0); - break; - case Qt::Key_Down: - scroll(0, -ScrollStep); - break; - case Qt::Key_Up: - scroll(0, +ScrollStep); - break; - default: - QWidget::keyPressEvent(event); - } -} - -#if QT_CONFIG(wheelevent) -void MandelbrotWidget::wheelEvent(QWheelEvent* event) -{ - const int numDegrees = event->angleDelta().y() / 8; - const double numSteps = numDegrees / double(15); - zoom(pow(ZoomInFactor, numSteps)); -} -#endif - -void MandelbrotWidget::mousePressEvent(QMouseEvent* event) -{ - if (event->button() == Qt::LeftButton) - lastDragPos = event->pos(); -} - -void MandelbrotWidget::mouseMoveEvent(QMouseEvent* event) -{ - if (event->buttons() & Qt::LeftButton) - { - pixmapOffset += event->pos() - lastDragPos; - lastDragPos = event->pos(); - update(); - } -} - -void MandelbrotWidget::mouseReleaseEvent(QMouseEvent* event) -{ - if (event->button() == Qt::LeftButton) - { - pixmapOffset += event->pos() - lastDragPos; - lastDragPos = QPoint(); - - const auto pixmapSize = pixmap.size() / pixmap.devicePixelRatioF(); - int deltaX = (width() - pixmapSize.width()) / 2 - pixmapOffset.x(); - int deltaY = (height() - pixmapSize.height()) / 2 - pixmapOffset.y(); - scroll(deltaX, deltaY); - } -} - -void MandelbrotWidget::updatePixmap(const QImage& image, double scaleFactor) -{ - if (!lastDragPos.isNull()) - return; - - pixmap = QPixmap::fromImage(image); - pixmapOffset = QPoint(); - lastDragPos = QPoint(); - pixmapScale = scaleFactor; - update(); -} - -void MandelbrotWidget::zoom(double zoomFactor) -{ - curScale *= zoomFactor; - update(); - thread.render(centerX, centerY, curScale, size(), devicePixelRatioF()); -} - -void MandelbrotWidget::scroll(int deltaX, int deltaY) -{ - centerX += deltaX * curScale; - centerY += deltaY * curScale; - update(); - thread.render(centerX, centerY, curScale, size(), devicePixelRatioF()); -} diff --git a/wasm/source/qt5-mandelbrot/mandelbrotwidget.h b/wasm/source/qt5-mandelbrot/mandelbrotwidget.h deleted file mode 100644 index 72e95568b522..000000000000 --- a/wasm/source/qt5-mandelbrot/mandelbrotwidget.h +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#pragma once - -#include <QtGui/QPixmap> -#include <QtWidgets/QWidget> - -#include "renderthread.h" - -class MandelbrotWidget : public QWidget -{ - Q_OBJECT - -public: - MandelbrotWidget(QWidget* parent = nullptr); - -protected: - void paintEvent(QPaintEvent* event) override; - void resizeEvent(QResizeEvent* event) override; - void keyPressEvent(QKeyEvent* event) override; -#if QT_CONFIG(wheelevent) - void wheelEvent(QWheelEvent* event) override; -#endif - void mousePressEvent(QMouseEvent* event) override; - void mouseMoveEvent(QMouseEvent* event) override; - void mouseReleaseEvent(QMouseEvent* event) override; - -private slots: - void updatePixmap(const QImage& image, double scaleFactor); - void zoom(double zoomFactor); - -private: - void scroll(int deltaX, int deltaY); - - RenderThread thread; - QPixmap pixmap; - QPoint pixmapOffset; - QPoint lastDragPos; - double centerX; - double centerY; - double pixmapScale; - double curScale; -}; diff --git a/wasm/source/qt5-mandelbrot/renderthread.cxx b/wasm/source/qt5-mandelbrot/renderthread.cxx deleted file mode 100644 index 398e43ded15d..000000000000 --- a/wasm/source/qt5-mandelbrot/renderthread.cxx +++ /dev/null @@ -1,232 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "renderthread.h" -#include "renderthread.moc" - -#include <QtGui/QImage> -#include <cmath> - -RenderThread::RenderThread(QObject* parent) - : QThread(parent) -{ - for (int i = 0; i < ColormapSize; ++i) - m_colormap[i] = rgbFromWaveLength(380.0 + (i * 400.0 / ColormapSize)); -} - -RenderThread::~RenderThread() -{ - m_mutex.lock(); - m_abort = true; - m_condition.wakeOne(); - m_mutex.unlock(); - - wait(); -} - -void RenderThread::render(double centerX, double centerY, double scaleFactor, QSize resultSize, - double devicePixelRatio) -{ - QMutexLocker locker(&m_mutex); - - m_centerX = centerX; - m_centerY = centerY; - m_scaleFactor = scaleFactor; - m_devicePixelRatio = devicePixelRatio; - m_resultSize = resultSize; - - if (!isRunning()) - { - start(LowPriority); - } - else - { - m_restart = true; - m_condition.wakeOne(); - } -} - -void RenderThread::run() -{ - forever - { - m_mutex.lock(); - const double devicePixelRatio = m_devicePixelRatio; - const QSize resultSize = m_resultSize * devicePixelRatio; - const double requestedScaleFactor = m_scaleFactor; - const double scaleFactor = requestedScaleFactor / devicePixelRatio; - const double centerX = m_centerX; - const double centerY = m_centerY; - m_mutex.unlock(); - - int halfWidth = resultSize.width() / 2; - int halfHeight = resultSize.height() / 2; - QImage image(resultSize, QImage::Format_RGB32); - image.setDevicePixelRatio(devicePixelRatio); - - const int NumPasses = 8; - int pass = 0; - while (pass < NumPasses) - { - const int MaxIterations = (1 << (2 * pass + 6)) + 32; - const int Limit = 4; - bool allBlack = true; - - for (int y = -halfHeight; y < halfHeight; ++y) - { - if (m_restart) - break; - if (m_abort) - return; - - auto scanLine = reinterpret_cast<uint*>(image.scanLine(y + halfHeight)); - const double ay = centerY + (y * scaleFactor); - - for (int x = -halfWidth; x < halfWidth; ++x) - { - const double ax = centerX + (x * scaleFactor); - double a1 = ax; - double b1 = ay; - int numIterations = 0; - - do - { - ++numIterations; - const double a2 = (a1 * a1) - (b1 * b1) + ax; - const double b2 = (2 * a1 * b1) + ay; - if ((a2 * a2) + (b2 * b2) > Limit) - break; - - ++numIterations; - a1 = (a2 * a2) - (b2 * b2) + ax; - b1 = (2 * a2 * b2) + ay; - if ((a1 * a1) + (b1 * b1) > Limit) - break; - } while (numIterations < MaxIterations); - - if (numIterations < MaxIterations) - { - *scanLine++ = m_colormap[numIterations % ColormapSize]; - allBlack = false; - } - else - { - *scanLine++ = qRgb(0, 0, 0); - } - } - } - - if (allBlack && pass == 0) - { - pass = 4; - } - else - { - if (!m_restart) - emit renderedImage(image, requestedScaleFactor); - ++pass; - } - } - - m_mutex.lock(); - if (!m_restart) - m_condition.wait(&m_mutex); - m_restart = false; - m_mutex.unlock(); - } -} - -uint RenderThread::rgbFromWaveLength(double wave) -{ - double r = 0; - double g = 0; - double b = 0; - - if (wave >= 380.0 && wave <= 440.0) - { - r = -1.0 * (wave - 440.0) / (440.0 - 380.0); - b = 1.0; - } - else if (wave >= 440.0 && wave <= 490.0) - { - g = (wave - 440.0) / (490.0 - 440.0); - b = 1.0; - } - else if (wave >= 490.0 && wave <= 510.0) - { - g = 1.0; - b = -1.0 * (wave - 510.0) / (510.0 - 490.0); - } - else if (wave >= 510.0 && wave <= 580.0) - { - r = (wave - 510.0) / (580.0 - 510.0); - g = 1.0; - } - else if (wave >= 580.0 && wave <= 645.0) - { - r = 1.0; - g = -1.0 * (wave - 645.0) / (645.0 - 580.0); - } - else if (wave >= 645.0 && wave <= 780.0) - { - r = 1.0; - } - ... etc. - the rest is truncated _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits