Repository.mk
| 7
RepositoryFixes.mk
| 4
RepositoryModule_build.mk
| 1
android/CustomTarget_lo_android.mk
| 2
bin/find-unneeded-includes
| 208 +
bridges/CustomTarget_gcc3_linux_arm.mk
| 12
bridges/CustomTarget_gcc3_wasm.mk
| 30
bridges/Library_cpp_uno.mk
| 15
bridges/Module_bridges.mk
| 4
bridges/StaticLibrary_emscriptencxxabi.mk
| 16
bridges/inc/wasm/generated.hxx
| 27
bridges/source/cpp_uno/gcc3_wasm/abi.cxx
| 89
bridges/source/cpp_uno/gcc3_wasm/abi.hxx
| 141 +
bridges/source/cpp_uno/gcc3_wasm/cpp2uno.cxx
| 512 +++
bridges/source/cpp_uno/gcc3_wasm/uno2cpp.cxx
| 276 +
bridges/source/emscriptencxxabi/cxxabi.cxx
| 53
cli_ure/CustomTarget_cli_ure_assemblies.mk
| 24
codemaker/source/commoncpp/commoncpp.cxx
| 241 -
codemaker/source/cppumaker/cppuoptions.cxx
| 18
codemaker/source/cppumaker/cpputype.cxx
| 213 -
codemaker/source/cppumaker/cpputype.hxx
| 3
codemaker/source/cppumaker/dumputils.cxx
| 14
codemaker/source/cppumaker/dumputils.hxx
| 3
config_host.mk.in
| 5
config_host/config_emscripten.h.in
| 14
configmgr/source/components.cxx
| 84
configure.ac
| 89
cppu/qa/cppumaker/test_cppumaker.cxx
| 1
cppu/qa/cppumaker/types.idl
| 4
cppu/source/uno/sequence.cxx
| 16
cppuhelper/source/exc_thrower.cxx
| 4
cui/source/dialogs/QrCodeGenDialog.cxx
| 3
desktop/CustomTarget_desktop_unopackages_install.mk
| 6
desktop/CustomTarget_soffice.mk
| 6
desktop/CustomTarget_soffice_bin-emscripten-exports.mk
| 25
desktop/Executable_soffice_bin.mk
| 43
desktop/GeneratedPackage_desktop_unopackages_install.mk
| 2
desktop/Library_sofficeapp.mk
| 6
desktop/Module_desktop.mk
| 6
desktop/Package_soffice_sh.mk
| 2
desktop/source/app/app.cxx
| 41
desktop/source/app/appinit.cxx
| 81
desktop/source/app/sofficemain.cxx
| 17
desktop/util/Executable_soffice_bin-emscripten-exports
| 14
distro-configs/LibreOfficeWASM32.conf
| 1
download.lst
| 4
drawinglayer/CppunitTest_drawinglayer_processors.mk
| 2
editeng/CustomTarget_generated.mk
| 2
extensions/CustomTarget_automationtest.mk
| 2
extensions/CustomTarget_so_activex_idl.mk
| 2
extensions/CustomTarget_so_activex_x64.mk
| 16
external/argon2/UnpackedTarball_argon2.mk
| 1
external/argon2/private-symbols.patch.0
| 192 +
external/curl/ExternalProject_curl.mk
| 5
external/curl/UnpackedTarball_curl.mk
| 6
external/curl/emscripten-proxy-poll.patch.0
| 20
external/onlineupdate/CustomTarget_generated.mk
| 2
external/redland/ExternalProject_raptor.mk
| 13
external/redland/ExternalProject_redland.mk
| 6
external/redland/Library_raptor.mk
| 2
external/redland/README
| 2
external/redland/UnpackedTarball_raptor.mk
| 5
external/redland/raptor/0001-CVE-2020-25713-raptor2-malformed-input-file-can-lead.patch.1
| 33
external/redland/raptor/0001-Calcualte-max-nspace-declarations-correctly-for-XML-.patch.1
| 43
external/redland/raptor/Wint-conversion.patch
| 22
external/redland/raptor/libtool.patch
| 27
external/redland/raptor/raptor-android.patch.1
| 10
external/redland/raptor/raptor-bundled-soname.patch.1
| 12
external/redland/raptor/raptor-emscripten.patch.1
| 8
external/redland/raptor/raptor-freebsd.patch.1
| 31
external/redland/raptor/raptor-icu.patch
| 11
external/redland/raptor/raptor-msvc.patch.1
| 10
external/redland/raptor/raptor2.h
| 32
external/redland/raptor/raptor_config.h
| 46
external/redland/raptor/ubsan.patch
| 14
external/redland/raptor/xml2-config.patch
| 6
external/redland/rasqal/rasqal-pkgconfig.patch.1
| 3
extras/AllLangPackage_autotextshare.mk
| 2
extras/CustomTarget_autocorr.mk
| 12
extras/CustomTarget_autotextshare.mk
| 16
extras/CustomTarget_autotextuser.mk
| 12
extras/CustomTarget_gallsystem.mk
| 6
extras/CustomTarget_glade.mk
| 2
extras/CustomTarget_opensymbol.mk
| 4
extras/CustomTarget_templates.mk
| 30
extras/CustomTarget_tplpresnt.mk
| 20
extras/CustomTarget_tplwizard.mk
| 36
extras/Package_autocorr.mk
| 2
extras/Package_autotextuser.mk
| 2
extras/Package_fonts.mk
| 2
extras/Package_gallsystemstr.mk
| 2
extras/Package_glade.mk
| 2
extras/Package_resource_fonts.mk
| 2
extras/Package_templates.mk
| 2
extras/Package_tplpresnt.mk
| 2
extras/Package_tplwizard.mk
| 2
filter/Configuration_filter.mk
| 8
filter/CustomTarget_svg.mk
| 2
i18npool/CustomTarget_breakiterator.mk
| 2
i18npool/CustomTarget_collator.mk
| 2
i18npool/CustomTarget_indexentry.mk
| 6
i18npool/CustomTarget_localedata.mk
| 8
i18npool/CustomTarget_textconversion.mk
| 6
i18npool/Library_i18npool.mk
| 12
include/bridges/emscriptencxxabi/cxxabi.hxx
| 108
include/codemaker/commoncpp.hxx
| 3
include/codemaker/typemanager.hxx
| 5
include/comphelper/threadpool.hxx
| 8
include/sal/types.h
| 6
include/static/unoembindhelpers/PrimaryBindings.hxx
| 133
include/systools/curlinit.hxx
| 17
include/systools/opensslinit.hxx
| 2
instsetoo_native/CustomTarget_emscripten-install.mk
| 37
instsetoo_native/CustomTarget_install.mk
| 46
instsetoo_native/CustomTarget_setup.mk
| 38
instsetoo_native/Module_instsetoo_native.mk
| 6
instsetoo_native/Package_setup.mk
| 2
instsetoo_native/Package_setup_ure.mk
| 2
jvmfwk/CustomTarget_jreproperties.mk
| 6
jvmfwk/CustomTarget_jvmfwk_jvmfwk3_ini.mk
| 2
jvmfwk/Package_jreproperties.mk
| 2
jvmfwk/Package_jvmfwk_jvmfwk3_ini.mk
| 2
librelogo/CustomTarget_librelogo.mk
| 2
librelogo/Package_librelogo_properties.mk
| 2
odk/CustomTarget_allheaders.mk
| 2
odk/CustomTarget_check.mk
| 4
odk/CustomTarget_classes.mk
| 2
odk/CustomTarget_config_win.mk
| 2
odk/CustomTarget_doxygen.mk
| 16
odk/CustomTarget_html.mk
| 2
odk/CustomTarget_javadoc.mk
| 12
odk/CustomTarget_settings.mk
| 2
odk/GeneratedPackage_odk_doxygen.mk
| 2
odk/GeneratedPackage_odk_javadoc.mk
| 2
odk/GeneratedPackage_uno_loader_classes.mk
| 2
odk/Package_config_win.mk
| 2
odk/Package_html.mk
| 2
odk/Package_settings_generated.mk
| 2
odk/Package_share_readme.mk
| 2
odk/build-examples_common.mk
| 16
offapi/UnoApi_offapi.mk
| 19
offapi/com/sun/star/awt/XTopWindow3.idl
| 23
offapi/org/libreoffice/embindtest/BridgeTest.idl
| 16
offapi/org/libreoffice/embindtest/Constants.idl
| 27
offapi/org/libreoffice/embindtest/Enum.idl
| 21
offapi/org/libreoffice/embindtest/Exception.idl
| 20
offapi/org/libreoffice/embindtest/Struct.idl
| 36
offapi/org/libreoffice/embindtest/StructLong.idl
| 18
offapi/org/libreoffice/embindtest/StructString.idl
| 18
offapi/org/libreoffice/embindtest/Template.idl
| 21
offapi/org/libreoffice/embindtest/Test.idl
| 16
offapi/org/libreoffice/embindtest/XAttributes.idl
| 20
offapi/org/libreoffice/embindtest/XTest.idl
| 141 +
officecfg/Configuration_officecfg.mk
| 50
officecfg/CustomTarget_registry.mk
| 6
oox/CustomTarget_generated.mk
| 2
oox/Package_generated.mk
| 2
oox/source/crypto/CryptTools.cxx
| 11
postprocess/CustomTarget_check_dynamic_objects.mk
| 2
postprocess/CustomTarget_components.mk
| 2
postprocess/CustomTarget_fontconfig.mk
| 8
postprocess/CustomTarget_images.mk
| 2
postprocess/CustomTarget_registry.mk
| 87
postprocess/CustomTarget_signing.mk
| 4
postprocess/Package_fontconfig.mk
| 2
postprocess/Package_images.mk
| 2
pyuno/CustomTarget_python_shell.mk
| 6
pyuno/CustomTarget_pyuno_pythonloader_ini.mk
| 2
pyuno/Package_python_shell.mk
| 2
pyuno/Package_pyuno_pythonloader_ini.mk
| 2
readlicense_oo/CustomTarget_license.mk
| 2
readlicense_oo/CustomTarget_readme.mk
| 2
readlicense_oo/Package_license.mk
| 2
readlicense_oo/Package_readlicense_oo_readmes.mk
| 2
ridljar/CustomTarget_javamaker.mk
| 2
ridljar/CustomTarget_test_urp.mk
| 2
ridljar/Jar_libreoffice.mk
| 4
ridljar/JunitTest_bridgefactory.mk
| 2
ridljar/JunitTest_connections.mk
| 2
ridljar/JunitTest_java.mk
| 2
ridljar/JunitTest_java_remote.mk
| 2
ridljar/JunitTest_remote.mk
| 2
ridljar/JunitTest_urp.mk
| 2
sal/osl/unx/process_impl.cxx
| 4
sal/osl/unx/thread.cxx
| 2
sal/rtl/byteseq.cxx
| 7
sal/rtl/hash.cxx
| 2
sc/source/ui/view/tabvwshh.cxx
| 2
scp2/CustomTarget_langmacros.mk
| 6
sdext/CustomTarget_pdfimport.mk
| 6
setup_native/CustomTarget_mac.mk
| 2
setup_native/CustomTarget_scripts.mk
| 2
setup_native/CustomTarget_spell.mk
| 2
sfx2/CustomTarget_classification.mk
| 2
sfx2/source/appl/app.cxx
| 1
sfx2/source/control/thumbnailview.cxx
| 2
sfx2/source/view/viewfrm.cxx
| 2
shell/CustomTarget_shlxthdl_res.mk
| 6
shell/CustomTarget_spsupp_idl.mk
| 2
shell/CustomTarget_x64.mk
| 6
shell/WinResTarget_spsupp.mk
| 2
solenv/bin/concat-deps.c
| 5
solenv/bin/removereportbuilder.xslt
| 19
solenv/gbuild/CustomTarget.mk
| 50
solenv/gbuild/Executable.mk
| 4
solenv/gbuild/InstallModuleTarget.mk
| 2
solenv/gbuild/JavaClassSet.mk
| 2
solenv/gbuild/JunitTest.mk
| 2
solenv/gbuild/Library.mk
| 1
solenv/gbuild/LinkTarget.mk
| 65
solenv/gbuild/Module.mk
| 2
solenv/gbuild/PythonTest.mk
| 2
solenv/gbuild/TargetLocations.mk
| 4
solenv/gbuild/UITest.mk
| 2
solenv/gbuild/UnoApi.mk
| 17
solenv/gbuild/UnoApiTarget.mk
| 26
solenv/gbuild/WinResTarget.mk
| 2
solenv/gbuild/extensions/post_GbuildToJson.mk
| 2
solenv/gbuild/extensions/post_SpeedUpTargets.mk
| 3
solenv/gbuild/extensions/pre_BuildTools.mk
| 1
solenv/gbuild/gbuild.mk
| 8
solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
| 48
solenv/gbuild/platform/android.mk
| 1
solenv/gbuild/platform/com_MSC_class.mk
| 9
solenv/gbuild/platform/iOS.mk
| 10
solenv/gbuild/platform/macosx.mk
| 10
solenv/gbuild/platform/solaris.mk
| 10
solenv/gbuild/platform/unxgcc.mk
| 29
static/CustomTarget_components.mk
| 4
static/CustomTarget_emscripten_fs_image.mk
| 3
static/CustomTarget_unoembind.mk
| 28
static/CustomTarget_wasm-qt5-mandelbrot_moc.mk
| 37
static/Executable_embindmaker.mk
| 26
static/Executable_wasm-qt5-mandelbrot.mk
| 32
static/Executable_wasmbridgegen.mk
| 26
static/Module_static.mk
| 15
static/Package_favicon.mk
| 16
static/Package_unoembind.mk
| 18
static/README.wasm.md
| 214 -
static/StaticLibrary_unoembind.mk
| 31
static/emscripten/environment.js
| 3
static/emscripten/favicon.ico
|binary
static/emscripten/soffice_args.js
| 6
static/emscripten/uno.js
| 117
static/source/embindmaker/embindmaker.cxx
| 1398 ++++++++++
static/source/qt5-mandelbrot/main.cxx
| 66
static/source/qt5-mandelbrot/mandelbrotwidget.cxx
| 228 -
static/source/qt5-mandelbrot/mandelbrotwidget.h
| 91
static/source/qt5-mandelbrot/renderthread.cxx
| 232 -
static/source/qt5-mandelbrot/renderthread.h
| 97
static/source/unoembindhelpers/PrimaryBindings.cxx
| 483 ++-
static/source/wasmbridgegen/wasmbridgegen.cxx
| 1047 +++++++
sw/CustomTarget_generated.mk
| 2
sw/source/core/layout/tabfrm.cxx
| 6
sw/source/uibase/inc/translatehelper.hxx
| 2
sw/source/uibase/shells/translatehelper.cxx
| 4
sysui/CustomTarget_deb.mk
| 6
sysui/CustomTarget_infoplist.mk
| 2
sysui/CustomTarget_rpm.mk
| 6
sysui/CustomTarget_share.mk
| 2
sysui/CustomTarget_solaris.mk
| 6
sysui/Package_infoplist.mk
| 2
sysui/Package_osxicons.mk
| 4
testtools/CustomTarget_bridgetest.mk
| 2
testtools/CustomTarget_bridgetest_climaker.mk
| 2
testtools/CustomTarget_bridgetest_javamaker.mk
| 2
testtools/Jar_testComponent.mk
| 2
toolkit/inc/awt/vclxtopwindow.hxx
| 8
toolkit/source/awt/vclxtopwindow.cxx
| 14
tools/CustomTarget_reversemap.mk
| 6
unoidl/CustomTarget_unoidl-check_test.mk
| 148 -
unoidl/CustomTarget_unoidl-write_test.mk
| 46
unoidl/source/unoidl-check.cxx
| 2
unoidl/source/unoidl-read.cxx
| 2
unoidl/source/unoidl-write.cxx
| 4
unoil/CustomTarget_javamaker.mk
| 2
unotest/Library_embindtest.mk
| 28
unotest/Module_unotest.mk
| 6
unotest/source/embindtest/embindtest.component
| 25
unotest/source/embindtest/embindtest.cxx
| 1224 ++++++++
unotest/source/embindtest/embindtest.js
| 1348 +++++++++
vcl/CustomTarget_gtk3_kde5_moc.mk
| 8
vcl/CustomTarget_kf5_moc.mk
| 6
vcl/CustomTarget_kf6_moc.mk
| 6
vcl/CustomTarget_nativecalc.mk
| 4
vcl/CustomTarget_nativecore.mk
| 4
vcl/CustomTarget_nativedraw.mk
| 4
vcl/CustomTarget_nativemath.mk
| 4
vcl/CustomTarget_nativewriter.mk
| 4
vcl/CustomTarget_qt5_moc.mk
| 24
vcl/CustomTarget_qt6_moc.mk
| 24
vcl/headless/svpinst.cxx
| 32
vcl/inc/headless/svpinst.hxx
| 8
vcl/inc/salinst.hxx
| 2
vcl/qt5/QtInstance.cxx
| 11
vcl/source/app/salvtables.cxx
| 2
vcl/source/app/svapp.cxx
| 2
vcl/source/app/svmain.cxx
| 17
vcl/unx/generic/app/geninst.cxx
| 10
vcl/win/gdi/salprn.cxx
| 2
winaccessibility/CustomTarget_ia2_idl.mk
| 2
wizards/CustomTarget_share.mk
| 8
wizards/CustomTarget_wizards.mk
| 2
wizards/Package_share.mk
| 2
wizards/Package_wizards_properties.mk
| 2
writerfilter/CustomTarget_source.mk
| 4
writerperfect/CppunitTest_writerperfect_epubexport.mk
| 2
xmloff/CustomTarget_generated.mk
| 4
xmlsecurity/source/xmlsec/xmlsec_init.cxx
| 1
309 files changed, 9635 insertions(+), 2385 deletions(-)
New commits:
commit 80a44ed45822a716fd4e7906ca232052531af918
Author: Stephan Bergmann <[email protected]>
AuthorDate: Tue Sep 10 12:49:49 2024 +0200
Commit: Stephan Bergmann <[email protected]>
CommitDate: Fri Sep 13 11:11:42 2024 +0200
Demonstrate that Embind is not multi-threading capable
Enabling the line commented out with "TODO" in embindtest.js would fail with
something like
> Aborted(Assertion failed: invalid handle: 8)
> worker.js onmessage() captured an uncaught exception: RuntimeError:
unreachable
> RuntimeError: unreachable
> at soffice.wasm.__trap
(http://localhost:6931/soffice.wasm:wasm-function[446445]:0x8f952b3)
> at ___trap
(blob:http://localhost:6931/7e945427-df90-49c0-a2b5-28c5ecfbe1a5:16657:54)
> at abort
(blob:http://localhost:6931/7e945427-df90-49c0-a2b5-28c5ecfbe1a5:1091:5)
> at assert
(blob:http://localhost:6931/7e945427-df90-49c0-a2b5-28c5ecfbe1a5:731:5)
> at HandleAllocator.get
(blob:http://localhost:6931/7e945427-df90-49c0-a2b5-28c5ecfbe1a5:7212:11)
> at Object.toValue
(blob:http://localhost:6931/7e945427-df90-49c0-a2b5-28c5ecfbe1a5:7270:30)
> at __emval_call_void_method
(blob:http://localhost:6931/7e945427-df90-49c0-a2b5-28c5ecfbe1a5:10183:22)
> at
soffice.wasm.the_wrappers::com::sun::star::task::XJobExecutor::trigger(rtl::OUString
const&) (http://localhost:6931/soffice.wasm:wasm-function[77042]:0xafbb24)
> at soffice.wasm.(anonymous namespace)::JobExecutorThread::execute()
(http://localhost:6931/soffice.wasm:wasm-function[243534]:0x43250b5)
> at soffice.wasm.non-virtual thunk to salhelper::Thread::run()
(http://localhost:6931/soffice.wasm:wasm-function[87641]:0xdff5cf)
(cherry-picked from b418f3d8d332276e6990cf7532a8f66aeb1d2f6c)
Change-Id: I4e35dc19c5c0f97de7158bf9c07fd31716ffff84
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173132
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <[email protected]>
diff --git a/offapi/org/libreoffice/embindtest/XTest.idl
b/offapi/org/libreoffice/embindtest/XTest.idl
index 276ce260a8e1..e579a606202a 100644
--- a/offapi/org/libreoffice/embindtest/XTest.idl
+++ b/offapi/org/libreoffice/embindtest/XTest.idl
@@ -129,7 +129,7 @@ interface XTest {
[out] XTest value18);
void throwRuntimeException();
void passJob([in] com::sun::star::task::XJob object);
- void passJobExecutor([in] com::sun::star::task::XJobExecutor object);
+ void passJobExecutor([in] com::sun::star::task::XJobExecutor object, [in]
boolean newThread);
void passInterface([in] com::sun::star::uno::XInterface object);
boolean checkAttributes([in] org::libreoffice::embindtest::XAttributes
object);
[attribute] string StringAttribute;
diff --git a/unotest/source/embindtest/embindtest.cxx
b/unotest/source/embindtest/embindtest.cxx
index 60150dcd2ad9..4a335f6f6be3 100644
--- a/unotest/source/embindtest/embindtest.cxx
+++ b/unotest/source/embindtest/embindtest.cxx
@@ -67,6 +67,21 @@ private:
}
};
+class JobExecutorThread : public salhelper::Thread
+{
+public:
+ JobExecutorThread(css::uno::Reference<css::task::XJobExecutor> const&
object)
+ : Thread("jobexecutor")
+ , object_(object)
+ {
+ }
+
+private:
+ void execute() override { object_->trigger(u"executor thread"_ustr); }
+
+ css::uno::Reference<css::task::XJobExecutor> object_;
+};
+
class Test : public cppu::WeakImplHelper<org::libreoffice::embindtest::XTest>
{
sal_Bool SAL_CALL getBoolean() override { return true; }
@@ -861,10 +876,19 @@ class Test : public
cppu::WeakImplHelper<org::libreoffice::embindtest::XTest>
}
}
- void SAL_CALL
- passJobExecutor(css::uno::Reference<css::task::XJobExecutor> const&
object) override
+ void SAL_CALL passJobExecutor(css::uno::Reference<css::task::XJobExecutor>
const& object,
+ sal_Bool newThread) override
{
- object->trigger(u"executor"_ustr);
+ if (newThread)
+ {
+ JobExecutorThread t(object);
+ t.launch();
+ t.join();
+ }
+ else
+ {
+ object->trigger(u"executor"_ustr);
+ }
}
void SAL_CALL passInterface(css::uno::Reference<css::uno::XInterface>
const& object) override
diff --git a/unotest/source/embindtest/embindtest.js
b/unotest/source/embindtest/embindtest.js
index 9551a9a56bca..082150ff6605 100644
--- a/unotest/source/embindtest/embindtest.js
+++ b/unotest/source/embindtest/embindtest.js
@@ -878,7 +878,8 @@ Module.uno_init.then(function() {
s.delete();
}
test.passJob(css.task.XJob.query(obj));
- test.passJobExecutor(css.task.XJobExecutor.query(obj));
+ test.passJobExecutor(css.task.XJobExecutor.query(obj), false);
+ //TODO: test.passJobExecutor(css.task.XJobExecutor.query(obj), true);
test.passInterface(obj);
css.task.XJobExecutor.query(obj).trigger('from JS');
{
commit 01fc7c047c907c038a3744439d72ea5e924c74d5
Author: Stephan Bergmann <[email protected]>
AuthorDate: Tue Sep 3 15:24:50 2024 +0200
Commit: Stephan Bergmann <[email protected]>
CommitDate: Fri Sep 13 11:05:28 2024 +0200
Emscripten: Move -sEXPORT_EXCEPTION_HANDLING_HELPERS to
gb_LinkTarget_LDFLAGS
...following up on 95e719730dc62cee3edc959bd9d96edfb992a642 "Emscripten:
Explicitly set -sEXPORT_EXCEPTION_HANDLING_HELPERS". For one, it should
indeed
only be relevant for linking. For another, the previous change had caused
at
least ExternalProject_libtiff to fail with "checking whether the C compiler
works... no" because of "emcc: error: EXPORT_EXCEPTION_HANDLING_HELPERS
requires
either of -fexceptions or -fwasm-exceptions".
(cherry-picked from 7d3251adf2e95768c9169b92c8b3366c95f71bfa)
Change-Id: I477731c1cffd2b6ee895116043eda91fca44d08f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172825
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <[email protected]>
diff --git a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
index 313b7280a0fe..37d23aabcfe9 100644
--- a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
@@ -23,7 +23,7 @@ gb_EMSCRIPTEN_LDFLAGS += -sSTACK_SIZE=131072
-sDEFAULT_PTHREAD_STACK_SIZE=65536
# To keep the link time (and memory) down, prevent all rewriting options from
wasm-emscripten-finalize
# See emscripten.py, finalize_wasm, modify_wasm = True
# So we need WASM_BIGINT=1 and ASSERTIONS=1 (2 implies STACK_OVERFLOW_CHECK)
-gb_EMSCRIPTEN_LDFLAGS += --bind -s FORCE_FILESYSTEM=1 -s WASM_BIGINT=1 -s
ERROR_ON_UNDEFINED_SYMBOLS=1 -s FETCH=1 -s ASSERTIONS=1 -s EXIT_RUNTIME=0 -s
EXPORTED_RUNTIME_METHODS=["UTF16ToString","stringToUTF16","UTF8ToString","ccall","cwrap","addOnPreMain","addOnPostRun","registerType","throwBindingError"$(if
$(ENABLE_QT6),$(COMMA)"callMain"$(COMMA)"specialHTMLTargets")]
-sEXPORT_EXCEPTION_HANDLING_HELPERS
+gb_EMSCRIPTEN_LDFLAGS += --bind -s FORCE_FILESYSTEM=1 -s WASM_BIGINT=1 -s
ERROR_ON_UNDEFINED_SYMBOLS=1 -s FETCH=1 -s ASSERTIONS=1 -s EXIT_RUNTIME=0 -s
EXPORTED_RUNTIME_METHODS=["UTF16ToString","stringToUTF16","UTF8ToString","ccall","cwrap","addOnPreMain","addOnPostRun","registerType","throwBindingError"$(if
$(ENABLE_QT6),$(COMMA)"callMain"$(COMMA)"specialHTMLTargets")]
gb_EMSCRIPTEN_QTDEFS := -DQT_NO_LINKED_LIST -DQT_NO_JAVA_STYLE_ITERATORS
-DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB
ifeq ($(ENABLE_EMSCRIPTEN_PROXY_POSIX_SOCKETS),TRUE)
@@ -45,7 +45,8 @@ ifeq ($(ENABLE_QT5),TRUE)
gb_LinkTarget_CFLAGS += $(gb_EMSCRIPTEN_QTDEFS)
gb_LinkTarget_CXXFLAGS += $(gb_EMSCRIPTEN_QTDEFS)
endif
-gb_LinkTarget_LDFLAGS += $(gb_EMSCRIPTEN_LDFLAGS) $(gb_EMSCRIPTEN_CPPFLAGS)
$(gb_EMSCRIPTEN_EXCEPT)
+gb_LinkTarget_LDFLAGS += $(gb_EMSCRIPTEN_LDFLAGS) $(gb_EMSCRIPTEN_CPPFLAGS) \
+ $(gb_EMSCRIPTEN_EXCEPT) -sEXPORT_EXCEPTION_HANDLING_HELPERS
# Linker and compiler optimize + debug flags are handled in LinkTarget.mk
gb_LINKEROPTFLAGS :=
commit 6038a1523cfc67c585c510366fe40bef44acf90d
Author: Stephan Bergmann <[email protected]>
AuthorDate: Tue Sep 3 09:38:58 2024 +0200
Commit: Stephan Bergmann <[email protected]>
CommitDate: Fri Sep 13 11:05:26 2024 +0200
Emscripten: workerID is only defined under -sASSERTIONS
...and explicitly passing in pthread_self() on the calling side is better
than
trying to identify the calling thread on the callee side, anyway
(cherry-picked from 24a3a7c72714c4f45c46cd2b6274013503d444d6)
Change-Id: Ib26a7cbdede246280b6985b6eb1582baf172bf59
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172786
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <[email protected]>
diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx
index 510610070d9f..b7e7f0e921dd 100644
--- a/desktop/source/app/appinit.cxx
+++ b/desktop/source/app/appinit.cxx
@@ -102,20 +102,13 @@ EM_JS(void, setupMainChannel, (), {
};
});
-extern "C" void resolveUnoMain() {
- EM_ASM(
- let sofficeMain;
- for (const i in PThread.pthreads) {
- const worker = PThread.pthreads[i];
- if (worker.workerID === 1) {
- sofficeMain = worker;
- break;
- }
- }
+extern "C" void resolveUnoMain(pthread_t id) {
+ EM_ASM({
+ const sofficeMain = PThread.pthreads[$0];
const channel = new MessageChannel();
sofficeMain.postMessage({cmd:"LOWA-channel"}, [channel.port2]);
Module.uno_main$resolve(channel.port1);
- );
+ }, id);
}
void initUno() {
@@ -129,7 +122,7 @@ void initUno() {
runUnoScriptUrl(url.getStr());
}
setupMainChannel();
- emscripten_async_run_in_main_runtime_thread(EM_FUNC_SIG_V, resolveUnoMain);
+ emscripten_async_run_in_main_runtime_thread(EM_FUNC_SIG_VI,
resolveUnoMain, pthread_self());
}
}
commit ed640e928263eb945f794078a9d70eeee5a41372
Author: Stephan Bergmann <[email protected]>
AuthorDate: Tue Sep 3 09:52:12 2024 +0200
Commit: Stephan Bergmann <[email protected]>
CommitDate: Fri Sep 13 11:05:25 2024 +0200
Emscripten: Explicitly set -sEXPORT_EXCEPTION_HANDLING_HELPERS
...so that getCppExceptionTag and
getCppExceptionThrownObjectFromWebAssemblyException are available in
static/emscripten/uno.js. Those apparently happen to already be available
due
to -sASSERTIONS=1, but better make that explicit (e.g., when we ever want
to do
-sASSERTIONS=0 builds).
(cherry-picked from 95e719730dc62cee3edc959bd9d96edfb992a642)
Change-Id: I3d94580930603eaf0f609d7878f97d12fb026714
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172788
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <[email protected]>
diff --git a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
index 416cdbc4c1a4..313b7280a0fe 100644
--- a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
@@ -23,7 +23,7 @@ gb_EMSCRIPTEN_LDFLAGS += -sSTACK_SIZE=131072
-sDEFAULT_PTHREAD_STACK_SIZE=65536
# To keep the link time (and memory) down, prevent all rewriting options from
wasm-emscripten-finalize
# See emscripten.py, finalize_wasm, modify_wasm = True
# So we need WASM_BIGINT=1 and ASSERTIONS=1 (2 implies STACK_OVERFLOW_CHECK)
-gb_EMSCRIPTEN_LDFLAGS += --bind -s FORCE_FILESYSTEM=1 -s WASM_BIGINT=1 -s
ERROR_ON_UNDEFINED_SYMBOLS=1 -s FETCH=1 -s ASSERTIONS=1 -s EXIT_RUNTIME=0 -s
EXPORTED_RUNTIME_METHODS=["UTF16ToString","stringToUTF16","UTF8ToString","ccall","cwrap","addOnPreMain","addOnPostRun","registerType","throwBindingError"$(if
$(ENABLE_QT6),$(COMMA)"callMain"$(COMMA)"specialHTMLTargets")]
+gb_EMSCRIPTEN_LDFLAGS += --bind -s FORCE_FILESYSTEM=1 -s WASM_BIGINT=1 -s
ERROR_ON_UNDEFINED_SYMBOLS=1 -s FETCH=1 -s ASSERTIONS=1 -s EXIT_RUNTIME=0 -s
EXPORTED_RUNTIME_METHODS=["UTF16ToString","stringToUTF16","UTF8ToString","ccall","cwrap","addOnPreMain","addOnPostRun","registerType","throwBindingError"$(if
$(ENABLE_QT6),$(COMMA)"callMain"$(COMMA)"specialHTMLTargets")]
-sEXPORT_EXCEPTION_HANDLING_HELPERS
gb_EMSCRIPTEN_QTDEFS := -DQT_NO_LINKED_LIST -DQT_NO_JAVA_STYLE_ITERATORS
-DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB
ifeq ($(ENABLE_EMSCRIPTEN_PROXY_POSIX_SOCKETS),TRUE)
commit e4904848c158fa17ce192a0030e94fe098301b92
Author: Stephan Bergmann <[email protected]>
AuthorDate: Mon Sep 2 08:48:21 2024 +0200
Commit: Stephan Bergmann <[email protected]>
CommitDate: Fri Sep 13 11:05:23 2024 +0200
Explicitly .delete() one more interface object in uno.js
...accidentally left over from 91842724235bca73690d67d8084ec7581512d791
"Explicitly .delete() type and interface objects in uno.js"
(cherry-picked from 32ce555c9daff2d4044c041e220fde44cf4aff67)
Change-Id: I84b1b7b5ee283a1a87f5d3aa894776b1bf23c607
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172731
Reviewed-by: Stephan Bergmann <[email protected]>
Tested-by: Jenkins
diff --git a/static/emscripten/uno.js b/static/emscripten/uno.js
index 6591a7441220..714dbf20dc3a 100644
--- a/static/emscripten/uno.js
+++ b/static/emscripten/uno.js
@@ -40,10 +40,13 @@ Module.unoObject = function(interfaces, obj) {
obj.queryInterface = function(type) {
for (const i in obj.impl_typemap) {
if (i === type.toString()) {
- return new Module.uno_Any(
- type,
- Module['uno_Type_' + i.replace(/\./g, '$')].reference(
- obj.impl_interfaces[obj.impl_typemap[i]]));
+ const ifc = Module['uno_Type_' + i.replace(/\./g,
'$')].reference(
+ obj.impl_interfaces[obj.impl_typemap[i]]);
+ try {
+ return new Module.uno_Any(type, ifc);
+ } finally {
+ ifc.delete();
+ }
}
}
const ty = Module.uno_Type.Void();
commit a671aa2ed4b3d215f53cfd8a02ef9796fbbc46f1
Author: Stephan Bergmann <[email protected]>
AuthorDate: Fri Aug 30 16:19:10 2024 +0200
Commit: Stephan Bergmann <[email protected]>
CommitDate: Fri Sep 13 11:05:22 2024 +0200
Explicitly .delete() type and interface objects in uno.js
These objects use smart proxies, so Embind adds them to a JS finalizer (in
JS
runtimes where FinalizationRegistry is available), so it shouldn't be
necessary
to manually .delete() them, but Embind then emits "Embind found a leaked C++
instance..." warnings about them, which clutter the JS console.
While it is probably impractical for client code to manually .delete() all
such
instances, we can at least explicitly .delete() those that occur in uno.js
itself.
(cherry-picked from 91842724235bca73690d67d8084ec7581512d791)
Change-Id: Ia21ca5f0bdb246cc5ea272599befd9a16bc970a8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172661
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <[email protected]>
diff --git a/static/emscripten/uno.js b/static/emscripten/uno.js
index fb634cc63c9d..6591a7441220 100644
--- a/static/emscripten/uno.js
+++ b/static/emscripten/uno.js
@@ -46,7 +46,10 @@ Module.unoObject = function(interfaces, obj) {
obj.impl_interfaces[obj.impl_typemap[i]]));
}
}
- return new Module.uno_Any(Module.uno_Type.Void(), undefined);
+ const ty = Module.uno_Type.Void();
+ const ret = new Module.uno_Any(ty, undefined);
+ ty.delete();
+ return ret;
};
obj.acquire = function() { ++obj.impl_refcount; };
obj.release = function() {
@@ -59,7 +62,9 @@ Module.unoObject = function(interfaces, obj) {
obj.getTypes = function() {
const types = new Module.uno_Sequence_type(interfaces.length,
Module.uno_Sequence.FromSize);
for (let i = 0; i !== interfaces.length; ++i) {
- types.set(i, Module.uno_Type.Interface(interfaces[i]));
+ const type = Module.uno_Type.Interface(interfaces[i]);
+ types.set(i, type);
+ type.delete();
}
return types;
};
@@ -76,23 +81,32 @@ Module.unoObject = function(interfaces, obj) {
throw new Error('not a UNO interface type: ' + name);
}
obj.impl_typemap[name] = impl;
- const bases =
Module.uno.com.sun.star.reflection.XInterfaceTypeDescription2.query(td)
- .getBaseTypes();
+ const itd =
Module.uno.com.sun.star.reflection.XInterfaceTypeDescription2.query(td);
+ const bases = itd.getBaseTypes();
+ itd.delete();
for (let i = 0; i !== bases.size(); ++i) {
walk(bases.get(i), impl);
}
bases.delete();
}
+ td.delete();
};
- const tdmAny = Module.getUnoComponentContext().getValueByName(
+ const ctx = Module.getUnoComponentContext();
+ const tdmAny = ctx.getValueByName(
'/singletons/com.sun.star.reflection.theTypeDescriptionManager');
- const tdm =
Module.uno.com.sun.star.container.XHierarchicalNameAccess.query(tdmAny.get());
+ ctx.delete();
+ const ifc = tdmAny.get();
+ tdmAny.delete();
+ const tdm =
Module.uno.com.sun.star.container.XHierarchicalNameAccess.query(ifc);
+ ifc.delete();
interfaces.forEach((i) => {
const td = tdm.getByHierarchicalName(i);
-
walk(Module.uno.com.sun.star.reflection.XTypeDescription.query(td.get()), i);
+ const ifc = td.get();
td.delete();
+ walk(Module.uno.com.sun.star.reflection.XTypeDescription.query(ifc),
i);
+ ifc.delete();
})
- tdmAny.delete();
+ tdm.delete();
return Module.uno.com.sun.star.uno.XInterface.reference(
obj.impl_interfaces[obj.impl_typemap['com.sun.star.uno.XInterface']]);
};
commit 82d2cba3cf3ab801b87334f312c53e867989a5e1
Author: Stephan Bergmann <[email protected]>
AuthorDate: Fri Aug 30 16:24:43 2024 +0200
Commit: Stephan Bergmann <[email protected]>
CommitDate: Fri Sep 13 11:05:21 2024 +0200
Consistenly terminate statements with semicolons in JS code
(cherry-picked from 1732bf1c47d7b53cee55097620aa574ab78d85b8)
Change-Id: Ie52917f6f487f5de2d67179f67f2935a1f6c838a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172662
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <[email protected]>
diff --git a/static/emscripten/uno.js b/static/emscripten/uno.js
index af1f20dd5cdb..fb634cc63c9d 100644
--- a/static/emscripten/uno.js
+++ b/static/emscripten/uno.js
@@ -79,7 +79,7 @@ Module.unoObject = function(interfaces, obj) {
const bases =
Module.uno.com.sun.star.reflection.XInterfaceTypeDescription2.query(td)
.getBaseTypes();
for (let i = 0; i !== bases.size(); ++i) {
- walk(bases.get(i), impl)
+ walk(bases.get(i), impl);
}
bases.delete();
}
commit 453e900f5a294c5630cee4d2d55a7982cb13fbb2
Author: Moritz Duge <[email protected]>
AuthorDate: Wed Aug 28 16:47:46 2024 +0200
Commit: Stephan Bergmann <[email protected]>
CommitDate: Fri Sep 13 11:05:20 2024 +0200
use emrun with explicit "--hostname 127.0.0.1" for testing
Minor security improvement. See
https://github.com/emscripten-core/emscripten/issues/22077
(cherry-picked from c888329adf68d8459d19784779cb6b5eea4f9195)
Change-Id: I05d632f6023883672d0e1b2586f53df87dd7d874
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172540
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <[email protected]>
Reviewed-by: Moritz Duge <[email protected]>
diff --git a/static/README.wasm.md b/static/README.wasm.md
index 8eb226f6e97e..23e1d92db207 100644
--- a/static/README.wasm.md
+++ b/static/README.wasm.md
@@ -20,11 +20,10 @@ populated with just the relevant files from `instdir`.
The build generates a Writer-only LO build. You should be able to run either
- $ emrun --serve_after_close
workdir/installation/LibreOffice/emscripten/qt_soffice.html
- $ emrun --serve_after_close workdir/LinkTarget/Executable/qt_vcldemo.html
+ $ emrun --hostname 127.0.0.1 --serve_after_close
workdir/installation/LibreOffice/emscripten/qt_soffice.html
+ $ emrun --hostname 127.0.0.1 --serve_after_close
workdir/LinkTarget/Executable/qt_vcldemo.html
REMINDER: Always start new tabs in the browser, reload might fail / cache!
-INFO: latest browser won't work anymore with 0.0.0.0 and need 127.0.0.1.
## Setup for the LO WASM build (with Qt)
commit f30860062323ca4061cb47223ebdb579fef74e11
Author: Stephan Bergmann <[email protected]>
AuthorDate: Wed Aug 28 16:30:10 2024 +0200
Commit: Stephan Bergmann <[email protected]>
CommitDate: Fri Sep 13 11:05:19 2024 +0200
Emscripten: Support --disable-gui
(cherry-picked from 858fed2a98ad5a04ca65dc504722e2db52746e64)
Conflicts:
vcl/inc/headless/svpinst.hxx
Change-Id: Iab28ee0bb533b0cdabb374c982fbb898bf04aac5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172537
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <[email protected]>
diff --git a/desktop/Executable_soffice_bin.mk
b/desktop/Executable_soffice_bin.mk
index f50cfb17633e..fcf16e041fb9 100644
--- a/desktop/Executable_soffice_bin.mk
+++ b/desktop/Executable_soffice_bin.mk
@@ -63,7 +63,8 @@ $(call gb_Executable_get_linktarget_target,soffice_bin): \
$(eval $(call gb_Executable_add_ldflags,soffice_bin,\
-s
EXPORTED_FUNCTIONS=@$(gb_CustomTarget_workdir)/desktop/soffice_bin-emscripten-exports/exports
-Wl$(COMMA)--whole-archive $(call gb_StaticLibrary_get_target,unoembind)
-Wl$(COMMA)--no-whole-archive \
- -sPROXY_TO_PTHREAD=1 -sOFFSCREENCANVAS_SUPPORT=1
-sOFFSCREENCANVASES_TO_PTHREAD=\#qtcanvas \
+ -sPROXY_TO_PTHREAD=1 \
+ $(if $(DISABLE_GUI),,-sOFFSCREENCANVAS_SUPPORT=1
-sOFFSCREENCANVASES_TO_PTHREAD=\#qtcanvas) \
))
ifeq ($(ENABLE_QT6),TRUE)
$(eval $(call gb_Executable_add_ldflags,soffice_bin, \
diff --git a/instsetoo_native/CustomTarget_emscripten-install.mk
b/instsetoo_native/CustomTarget_emscripten-install.mk
index 23a5ee81885b..f4e63f729ab6 100644
--- a/instsetoo_native/CustomTarget_emscripten-install.mk
+++ b/instsetoo_native/CustomTarget_emscripten-install.mk
@@ -14,15 +14,17 @@ $(if $(or $(gb_not $(filter
emscripten,$(PKGFORMAT))),$(filter-out emscripten,$(
emscripten_install_files := \
favicon.ico \
- qt_soffice.html \
- qtloader.js \
- qtlogo.svg \
soffice.data \
soffice.data.js.metadata \
soffice.js \
soffice.wasm \
soffice.worker.js \
$(if $(ENABLE_SYMBOLS_FOR),soffice.wasm.dwp) \
+ $(if $(DISABLE_GUI), \
+ soffice.html, \
+ qt_soffice.html \
+ qtloader.js \
+ qtlogo.svg) \
.PHONY: $(call gb_CustomTarget_get_target,instsetoo_native/emscripten-install)
$(call gb_CustomTarget_get_target,instsetoo_native/emscripten-install): \
diff --git a/vcl/headless/svpinst.cxx b/vcl/headless/svpinst.cxx
index 19eef8997689..4bd20d2673ba 100644
--- a/vcl/headless/svpinst.cxx
+++ b/vcl/headless/svpinst.cxx
@@ -53,6 +53,11 @@
#include <unx/salunxtime.h>
#include <comphelper/lok.hxx>
#include <tools/debug.hxx>
+#include <o3tl/unreachable.hxx>
+
+#if defined EMSCRIPTEN
+#include <emscripten.h>
+#endif
SvpSalInstance* SvpSalInstance::s_pDefaultInstance = nullptr;
@@ -98,6 +103,9 @@ SvpSalInstance::SvpSalInstance(
std::unique_ptr<SalYieldMutex> pMutex )
#if !defined(ANDROID) && !defined(IOS) && !defined(EMSCRIPTEN)
pthread_atfork(nullptr, nullptr, atfork_child);
#endif
+#if defined EMSCRIPTEN
+ ImplGetSVData()->maAppData.m_bUseSystemLoop = true;
+#endif
}
SvpSalInstance::~SvpSalInstance()
@@ -275,6 +283,30 @@ void SvpSalInstance::ProcessEvent( SalUserEvent aEvent )
pMutex->m_NonMainWaitingYieldCond.set();
}
+#if defined EMSCRIPTEN
+
+static void loop(void * arg) {
+ SolarMutexGuard g;
+ static_cast<SvpSalInstance *>(arg)->ImplYield(false, false);
+}
+
+bool SvpSalInstance::DoExecute(int &) {
+ assert(Application::IsOnSystemEventLoop());
+ // emscripten_set_main_loop will unwind the stack by throwing a JavaScript
exception, so we need
+ // to manually undo the call of AcquireYieldMutex() done in InitVCL:
+ ReleaseYieldMutex(false);
+ // Somewhat randomly use an fps=100 argument so the loop callback is
called 100 times per
+ // second:
+ emscripten_set_main_loop_arg(loop, this, 100, 1);
+ O3TL_UNREACHABLE;
+}
+
+void SvpSalInstance::DoQuit() {
+ assert(Application::IsOnSystemEventLoop());
+}
+
+#endif
+
SvpSalYieldMutex::SvpSalYieldMutex()
{
}
diff --git a/vcl/inc/headless/svpinst.hxx b/vcl/inc/headless/svpinst.hxx
index efe32761f5c1..e812ee9a2722 100644
--- a/vcl/inc/headless/svpinst.hxx
+++ b/vcl/inc/headless/svpinst.hxx
@@ -100,7 +100,11 @@ class VCL_DLLPUBLIC SvpSalInstance : public
SalGenericInstance, public SalUserEv
virtual void TriggerUserEventProcessing() override;
virtual void ProcessEvent( SalUserEvent aEvent ) override;
- bool ImplYield(bool bWait, bool bHandleAllCurrentEvents);
+
+#if defined EMSCRIPTEN
+ bool DoExecute(int &nExitCode) override;
+ void DoQuit() override;
+#endif
public:
static SvpSalInstance* s_pDefaultInstance;
@@ -108,6 +112,8 @@ public:
SvpSalInstance( std::unique_ptr<SalYieldMutex> pMutex );
virtual ~SvpSalInstance() override;
+ bool ImplYield(bool bWait, bool bHandleAllCurrentEvents);
+
void CloseWakeupPipe();
void Wakeup(SvpRequest request = SvpRequest::NONE);
commit 6dd2422dc1a1def44f2af549b48433ebf632f656
Author: Stephan Bergmann <[email protected]>
AuthorDate: Mon Aug 26 09:04:04 2024 +0200
Commit: Stephan Bergmann <[email protected]>
CommitDate: Fri Sep 13 11:05:18 2024 +0200
+WARN is the default with an unset SAL_LOG env var, anyway
(cherry-picked from 39de116b733685881f0defe9cc10070c826ad9c2)
Change-Id: Ia8bbc1bdc09705f1ecab783d0d73a417f0ef84e5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172378
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <[email protected]>
diff --git a/static/emscripten/environment.js b/static/emscripten/environment.js
index 29f2dfaa0bc8..de978115af75 100644
--- a/static/emscripten/environment.js
+++ b/static/emscripten/environment.js
@@ -1,6 +1,5 @@
if (!('preRun' in Module)) Module['preRun'] = [];
Module.preRun.push(function() {
ENV.MAX_CONCURRENCY = '4';
- ENV.SAL_LOG = "+WARN"
});
Module.ignoreApplicationExit = true;
commit c4ed2fd8aa31f23226a4ef4aef126fd72d9b7c2d
Author: Stephan Bergmann <[email protected]>
AuthorDate: Mon Aug 26 09:24:34 2024 +0200
Commit: Stephan Bergmann <[email protected]>
CommitDate: Fri Sep 13 11:05:16 2024 +0200
'use strict' is of no use here...
...in snippets that are included with --pre-js/--post-js
(cherry-picked from a3a71ed916994df700f42b58b6400dafed3db8e4)
Change-Id: I928aa16b78284314796a0645479dce0dfc7b42cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172383
Reviewed-by: Stephan Bergmann <[email protected]>
Tested-by: Jenkins
diff --git a/static/emscripten/environment.js b/static/emscripten/environment.js
index 74536a665ccc..29f2dfaa0bc8 100644
--- a/static/emscripten/environment.js
+++ b/static/emscripten/environment.js
@@ -1,5 +1,3 @@
-'use strict';
-
if (!('preRun' in Module)) Module['preRun'] = [];
Module.preRun.push(function() {
ENV.MAX_CONCURRENCY = '4';
diff --git a/static/emscripten/uno.js b/static/emscripten/uno.js
index 84b301f3e3b3..af1f20dd5cdb 100644
--- a/static/emscripten/uno.js
+++ b/static/emscripten/uno.js
@@ -7,8 +7,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-'use strict';
-
Module.unoTagSymbol = Symbol('unoTag');
Module.uno_init = new Promise(function (resolve, reject) {
diff --git a/unotest/source/embindtest/embindtest.js
b/unotest/source/embindtest/embindtest.js
index f75653a897cf..9551a9a56bca 100644
--- a/unotest/source/embindtest/embindtest.js
+++ b/unotest/source/embindtest/embindtest.js
@@ -7,8 +7,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-'use strict';
-
Module.uno_init.then(function() {
console.log('Running embindtest');
let css = Module.uno.com.sun.star;
commit a1fb5da4efa42ba52f3b3b9b17ff22c1626045e4
Author: Stephan Bergmann <[email protected]>
AuthorDate: Fri Aug 23 17:49:39 2024 +0200
Commit: Stephan Bergmann <[email protected]>
CommitDate: Fri Sep 13 11:05:15 2024 +0200
Emscripten: Only resolve Module.uno_init after Module.uno_mainPort is set
Otherwise, client code (which is run as soon as Module.uno_init is resolved)
could try to use Module.uno_mainPort before it has been set.
(cherry-picked from 96f3aeaa70d91b26861ac28f0b077b46546d3676)
Change-Id: Ibac992d965f43e9f6766d06e3bd80f1964258b19
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172326
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <[email protected]>
diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx
index 99aa2019d375..510610070d9f 100644
--- a/desktop/source/app/appinit.cxx
+++ b/desktop/source/app/appinit.cxx
@@ -95,6 +95,7 @@ EM_JS(void, setupMainChannel, (), {
if (e.data.cmd === "LOWA-channel") {
self.onmessage = orig;
Module.uno_mainPort = e.ports[0];
+ Module.uno_init$resolve();
} else if (orig) {
orig(e);
}
@@ -128,7 +129,6 @@ void initUno() {
runUnoScriptUrl(url.getStr());
}
setupMainChannel();
- EM_ASM(Module.uno_init$resolve(););
emscripten_async_run_in_main_runtime_thread(EM_FUNC_SIG_V, resolveUnoMain);
}
commit 15d6ed8226a120c0c1ce25959b30b3cf36c639c6
Author: Stephan Bergmann <[email protected]>
AuthorDate: Fri Aug 23 14:09:41 2024 +0200
Commit: Stephan Bergmann <[email protected]>
CommitDate: Fri Sep 13 11:05:14 2024 +0200
Emscripten: Module.uno_scripts are relative to document.baseURI
...so explicitly make them absolute, in case the WorkerGlboalScope used in
runUnoScriptUrl would make them absolute relative to a different base URL.
(See <https://github.com/mdn/content/issues/35568>
"WorkerGlobalScope.importScripts URLs relative to what base URL?" for my
confusion of what base URL should actually be used there. But at least
with an
emsdk that uses recent Emscripten trunk towards 3.1.65, and where meanwhile
worker threads no longer load an soffice.worker.js but instead use some
blob:
URL, a
> Module.uno_scripts = ['example.js'];
now failed with
> Error: Failed to execute 'importScripts' on 'WorkerGlobalScope': The URL
'example.js' is invalid.
on Chrome 127.)
(cherry-picked from 7d37241dcb7aa20adfa7510323cfd7984ff5e911)
Change-Id: I9f9b43d501a7b5d933c8506debdebe67ff1b5795
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172325
Reviewed-by: Stephan Bergmann <[email protected]>
Tested-by: Jenkins
diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx
index 2bef64330443..99aa2019d375 100644
--- a/desktop/source/app/appinit.cxx
+++ b/desktop/source/app/appinit.cxx
@@ -37,6 +37,7 @@
#include <officecfg/Setup.hxx>
#include <osl/file.hxx>
#include <rtl/bootstrap.hxx>
+#include <rtl/uri.hxx>
#include <sal/log.hxx>
#include <comphelper/diagnose_ex.hxx>
@@ -66,13 +67,14 @@ using namespace ::com::sun::star::ucb;
namespace {
-extern "C" void getUnoScriptUrls(std::vector<std::u16string> * urls) {
+extern "C" void getUnoScriptUrls(std::vector<OUString> * urls) {
assert(urls != nullptr);
+ OUString const
base(emscripten::val::global("document")["baseURI"].as<std::u16string>());
auto const val = emscripten::val::module_property("uno_scripts");
if (!val.isUndefined()) {
auto const len = val["length"].as<std::uint32_t>();
for (std::uint32_t i = 0; i != len; ++i) {
- urls->push_back(val[i].as<std::u16string>());
+ urls->push_back(rtl::Uri::convertRelToAbs(base,
OUString(val[i].as<std::u16string>())));
}
}
}
@@ -117,13 +119,13 @@ extern "C" void resolveUnoMain() {
void initUno() {
init_unoembind_uno();
- std::vector<std::u16string> urls;
+ std::vector<OUString> urls;
emscripten_sync_run_in_main_runtime_thread(EM_FUNC_SIG_VI,
getUnoScriptUrls, &urls);
for (auto const & url: urls) {
- if (url.find('
+ if (url.indexOf('
throw std::invalid_argument("Module.uno_scripts element contains
embedded NUL");
}
- runUnoScriptUrl(url.c_str());
+ runUnoScriptUrl(url.getStr());
}
setupMainChannel();
EM_ASM(Module.uno_init$resolve(););
commit 4acecb7d23be1d68c68044343b58c20782b36529
Author: Stephan Bergmann <[email protected]>
AuthorDate: Thu Aug 22 11:49:08 2024 +0200
Commit: Stephan Bergmann <[email protected]>
CommitDate: Fri Sep 13 11:05:13 2024 +0200
Emscripten: Experimental -sPROXY_POSIX_SOCKETS support
...see
<https://emscripten.org/docs/porting/networking.html#full-posix-sockets-over-websocket-proxy-server>.
This requires
<https://github.com/stbergmann/emscripten/commit/4aff1f28b88480791236adcc6d5cb2d919ad4bf3>
"-sPROXY_POSIX_SOCKETS: Add websocket_proxy_poll". When configured with
--disable-socketpair (which appears to have no negative consequences),
external/curl appears to only call poll(2) with socket-related file
descriptors,
so we can use websocket_proxy_poll instead.
The URL on which the websocket_to_posix_proxy process listens must be
specified
as Module.uno_websocket_to_posix_socket_url.
(cherry-picked from 2d9f8f45be0c9bc5f56864f66a37c3cc60069fe5)
Change-Id: I4ad23098b5bbc0646fa50859c0aeb9870d1cc92a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172243
Reviewed-by: Stephan Bergmann <[email protected]>
Tested-by: Jenkins
diff --git a/config_host.mk.in b/config_host.mk.in
index 3358dc24cba0..083309226177 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -166,6 +166,7 @@ export ENABLE_DCONF=@ENABLE_DCONF@
export ENABLE_DEBUG=@ENABLE_DEBUG@
SYSTEM_DRAGONBOX=@SYSTEM_DRAGONBOX@
SYSTEM_FROZEN=@SYSTEM_FROZEN@
+export
ENABLE_EMSCRIPTEN_PROXY_POSIX_SOCKETS=@ENABLE_EMSCRIPTEN_PROXY_POSIX_SOCKETS@
export ENABLE_EPOXY=@ENABLE_EPOXY@
export ENABLE_EOT=@ENABLE_EOT@
export ENABLE_EVOAB2=@ENABLE_EVOAB2@
diff --git a/config_host/config_emscripten.h.in
b/config_host/config_emscripten.h.in
new file mode 100644
index 000000000000..24d1a9ca5dd8
--- /dev/null
+++ b/config_host/config_emscripten.h.in
@@ -0,0 +1,14 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4;
fill-column: 100 -*- */
+/*
+ * 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/.
+ */
+
+#pragma once
+
+#define HAVE_EMSCRIPTEN_PROXY_POSIX_SOCKETS 0
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s
cinkeys+=0=break: */
diff --git a/configure.ac b/configure.ac
index 14b6fdc7e094..e6e69f047c83 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2091,6 +2091,15 @@ AC_ARG_WITH(main-module,
Default value is 'writer'.]),
,)
+if test "$_os" = Emscripten; then
+ AC_ARG_ENABLE(emscripten-proxy-posix-sockets,
+ AS_HELP_STRING([--enable-emscripten-proxy-posix-sockets],
+ [Enable experimental Emscripten support for full POSIX sockets
over WebSocket proxy
+ server (-sPROXY_POSIX_SOCKETS).]))
+else
+ enable_emscripten_proxy_posix_sockets=
+fi
+
AC_ARG_ENABLE(xmlhelp,
AS_HELP_STRING([--disable-xmlhelp],
[Disable XML help support]),
@@ -4041,6 +4050,14 @@ AC_SUBST(ENABLE_WASM_STRIP)
AC_SUBST(ENABLE_WASM_STRIP_WRITER)
AC_SUBST(ENABLE_WASM_STRIP_CALC)
+if test "$enable_emscripten_proxy_posix_sockets" = yes; then
+ ENABLE_EMSCRIPTEN_PROXY_POSIX_SOCKETS=TRUE
+ AC_DEFINE(HAVE_EMSCRIPTEN_PROXY_POSIX_SOCKETS)
+else
+ ENABLE_EMSCRIPTEN_PROXY_POSIX_SOCKETS=
+fi
+AC_SUBST(ENABLE_EMSCRIPTEN_PROXY_POSIX_SOCKETS)
+
# Use -isystem (gcc) if possible, to avoid warnings in 3rd party headers.
# NOTE: must _not_ be used for bundled external libraries!
ISYSTEM=
@@ -15176,6 +15193,7 @@ AC_CONFIG_HEADERS([config_host/config_cairo_canvas.h])
AC_CONFIG_HEADERS([config_host/config_cairo_rgba.h])
AC_CONFIG_HEADERS([config_host/config_cxxabi.h])
AC_CONFIG_HEADERS([config_host/config_dbus.h])
+AC_CONFIG_HEADERS([config_host/config_emscripten.h])
AC_CONFIG_HEADERS([config_host/config_features.h])
AC_CONFIG_HEADERS([config_host/config_feature_desktop.h])
AC_CONFIG_HEADERS([config_host/config_feature_opencl.h])
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 323bb4c291fa..14b29ba028aa 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -18,6 +18,7 @@
*/
#include <memory>
+#include <config_emscripten.h>
#include <config_features.h>
#include <config_feature_desktop.h>
#include <config_feature_opencl.h>
@@ -148,6 +149,15 @@
#define GETPID getpid
#endif
+#if HAVE_EMSCRIPTEN_PROXY_POSIX_SOCKETS
+#include <stdexcept>
+#include <string>
+#include <emscripten/posix_socket.h>
+#include <emscripten/threading.h>
+#include <emscripten/val.h>
+#include <emscripten/websocket.h>
+#endif
+
#include <strings.hxx>
using namespace ::com::sun::star::awt;
@@ -539,6 +549,35 @@ void Desktop::Init()
RequestHandler::Disable();
}
pSignalHandler = osl_addSignalHandler(SalMainPipeExchangeSignal_impl,
nullptr);
+
+#if HAVE_EMSCRIPTEN_PROXY_POSIX_SOCKETS
+ {
+ auto const val =
emscripten::val::module_property("uno_websocket_to_posix_socket_url");
+ if (val.isUndefined()) {
+ throw std::runtime_error("Module.uno_websocket_to_posix_socket_url
is undefined");
+ } else {
+ auto const url = val.as<std::string>();
+ if (url.find('
+ throw std::runtime_error(
+ "Module.uno_websocket_to_posix_socket_url contains
embedded NUL");
+ }
+ SAL_INFO("desktop.app", "connecting to <" << url << ">");
+ static auto const socket =
emscripten_init_websocket_to_posix_socket_bridge(
+ url.c_str());
+ // 0 is CONNECTING, 1 is OPEN, see
+ // <https://websockets.spec.whatwg.org/#websocket-ready-state>:
+ unsigned short readyState = 0;
+ do {
+ emscripten_websocket_get_ready_state(socket, &readyState);
+ emscripten_thread_sleep(100);
+ } while (readyState == 0);
+ if (readyState != 1) {
+ throw std::runtime_error("could not connect to <" + url + ">");
+ }
+ SAL_INFO("desktop.app", "connected to <" << url << ">");
+ }
+ }
+#endif
}
void Desktop::InitFinished()
diff --git a/external/curl/ExternalProject_curl.mk
b/external/curl/ExternalProject_curl.mk
index 1a94aa7a71d1..739f73dcc25a 100644
--- a/external/curl/ExternalProject_curl.mk
+++ b/external/curl/ExternalProject_curl.mk
@@ -65,6 +65,7 @@ $(call gb_ExternalProject_get_state_target,curl,build):
$(if $(filter
MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO)
\
$(if $(filter MACOSX,$(OS)),CFLAGS='$(CFLAGS) \
-mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET)') \
+ $(if
$(ENABLE_EMSCRIPTEN_PROXY_POSIX_SOCKETS),--disable-socketpair) \
$(if $(filter -fsanitize=undefined,$(CC)),CC='$(CC)
-fno-sanitize=function') \
CPPFLAGS='$(curl_CPPFLAGS)' \
CFLAGS="$(gb_CFLAGS) $(call
gb_ExternalProject_get_build_flags,curl)" \
diff --git a/external/curl/UnpackedTarball_curl.mk
b/external/curl/UnpackedTarball_curl.mk
index 4412857d36a0..4f21212eff8d 100644
--- a/external/curl/UnpackedTarball_curl.mk
+++ b/external/curl/UnpackedTarball_curl.mk
@@ -33,4 +33,10 @@ $(eval $(call gb_UnpackedTarball_add_patches,curl, \
))
endif
+ifeq ($(ENABLE_EMSCRIPTEN_PROXY_POSIX_SOCKETS),TRUE)
+$(eval $(call gb_UnpackedTarball_add_patches,curl, \
+ external/curl/emscripten-proxy-poll.patch.0 \
+))
+endif
+
# vim: set noet sw=4 ts=4:
diff --git a/external/curl/emscripten-proxy-poll.patch.0
b/external/curl/emscripten-proxy-poll.patch.0
new file mode 100644
index 000000000000..ac1f4a84d25c
--- /dev/null
+++ b/external/curl/emscripten-proxy-poll.patch.0
@@ -0,0 +1,20 @@
+--- lib/select.c
++++ lib/select.c
+@@ -51,6 +51,8 @@
+ #include "curl_printf.h"
+ #include "curl_memory.h"
+ #include "memdebug.h"
++
++int websocket_proxy_poll(struct pollfd *fds, nfds_t nfds, int timeout);
+
+ /*
+ * Internal function used for waiting a specific amount of ms
+@@ -318,7 +320,7 @@
+ pending_ms = -1;
+ else
+ pending_ms = 0;
+- r = poll(ufds, nfds, pending_ms);
++ r = websocket_proxy_poll(ufds, nfds, pending_ms);
+ if(r <= 0) {
+ if((r == -1) && (SOCKERRNO == EINTR))
+ /* make EINTR from select or poll not a "lethal" error */
diff --git a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
index 268d2dbf932e..416cdbc4c1a4 100644
--- a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
@@ -26,6 +26,10 @@ gb_EMSCRIPTEN_LDFLAGS += -sSTACK_SIZE=131072
-sDEFAULT_PTHREAD_STACK_SIZE=65536
gb_EMSCRIPTEN_LDFLAGS += --bind -s FORCE_FILESYSTEM=1 -s WASM_BIGINT=1 -s
ERROR_ON_UNDEFINED_SYMBOLS=1 -s FETCH=1 -s ASSERTIONS=1 -s EXIT_RUNTIME=0 -s
EXPORTED_RUNTIME_METHODS=["UTF16ToString","stringToUTF16","UTF8ToString","ccall","cwrap","addOnPreMain","addOnPostRun","registerType","throwBindingError"$(if
$(ENABLE_QT6),$(COMMA)"callMain"$(COMMA)"specialHTMLTargets")]
gb_EMSCRIPTEN_QTDEFS := -DQT_NO_LINKED_LIST -DQT_NO_JAVA_STYLE_ITERATORS
-DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB
+ifeq ($(ENABLE_EMSCRIPTEN_PROXY_POSIX_SOCKETS),TRUE)
+gb_EMSCRIPTEN_LDFLAGS += -sPROXY_POSIX_SOCKETS -lwebsocket.js
+endif
+
gb_Executable_EXT := .html
gb_EMSCRIPTEN_EXCEPT = -fwasm-exceptions -s SUPPORT_LONGJMP=wasm
commit bd3efcba0ba9aec4c3f9e553c5452ae3b1c89e89
Author: Stephan Bergmann <[email protected]>
AuthorDate: Wed Aug 21 20:22:47 2024 +0200
Commit: Stephan Bergmann <[email protected]>
CommitDate: Fri Sep 13 11:05:10 2024 +0200
Allow building against emsdk that uses Emscripten trunk
(see
<https://github.com/emscripten-core/emsdk/?tab=readme-ov-file#how-do-i-track-the-latest-emscripten-development-with-the-sdk>),
which has emscripten/main/ instead of upstream/emscripten/
(cherry-picked from 962c76d85bef03fb717914d8eddda9295427614a)
Change-Id: I10dfc7e30cddf8a798cb70104126b45757fcba63
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172219
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <[email protected]>
diff --git a/configure.ac b/configure.ac
index 6e708aedb6e6..14b6fdc7e094 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1388,6 +1388,9 @@ if test "$_os" = "Emscripten"; then
AS_IF([test -z "$EMSDK"],
[AC_MSG_ERROR([No \$EMSDK environment variable.])])
EMSCRIPTEN_VERSION_H=$EMSDK/upstream/emscripten/cache/sysroot/include/emscripten/version.h
+ if test ! -f "$EMSCRIPTEN_VERSION_H"; then
+
EMSCRIPTEN_VERSION_H=$EMSDK/emscripten/main/cache/sysroot/include/emscripten/version.h
+ fi
fi
if test -f "$EMSCRIPTEN_VERSION_H"; then
EMSCRIPTEN_MAJOR=$($GREP __EMSCRIPTEN_major__ "$EMSCRIPTEN_VERSION_H"
| $SED -ne 's/.*__EMSCRIPTEN_major__ //p')
commit df269e3dedb915c946a11f54c3f9a2ed4ded8fe3
Author: Stephan Bergmann <[email protected]>
AuthorDate: Wed Aug 21 08:00:48 2024 +0200
Commit: Stephan Bergmann <[email protected]>
CommitDate: Fri Sep 13 11:05:09 2024 +0200
Emscripten: Enable the WebDAV UCP
* Which also requires external/curl. But implicitly use --without-gssapi,
checking for it in configure.ac would fail with
> configure: error: could not find function 'gss_init_sec_context' required
for GSSAPI
And building ExternalProject_curl needs to see the -pthread from
gb_EMSCRIPTEN_CPPFLAGS, otherwise linking Executable_soffice_bin would fail
with
> wasm-ld: error: --shared-memory is disallowed by libcurl_la-easy.o
because it was not compiled with 'atomics' or 'bulk-memory' features.
* By default, GetCABundleFile in include/systools/opensslinit.hxx will fail
now. (But to make https work, applications could bring along their own such
file in the Emscripten FS, in one of the places where GetCABundleFile
checks for
it.) So, for Emscripten only, make failure of GetCABundleFile non-fatal in
InitCurl_easy.
* Some code in sw was erroneously hidden behind !ENABLE_WASM_STRIP_EXTRA
(off
by default for Emscripten), but is needed with HAVE_FEATURE_CURL.
* See <https://emscripten.org/docs/porting/networking.html> for how to
actually
use networking in an Emscripten application.
(cherry-picked from e180d2a8fda78d1373dc3ecec4bd69992bc4337c)
Conflicts:
include/systools/curlinit.hxx
include/systools/opensslinit.hxx
Change-Id: I2bbe9f3fd0e20143e18eb1e8104568b1c7a304de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172167
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <[email protected]>
diff --git a/configure.ac b/configure.ac
index 101cf85e4322..6e708aedb6e6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3101,7 +3101,6 @@ if test "$enable_wasm_strip" = "yes"; then
enable_libcmis=no
enable_coinmp=no
enable_cups=no
- test "$_os" = Emscripten && enable_curl=no
enable_database_connectivity=no
enable_dbus=no
enable_dconf=no
@@ -3136,10 +3135,9 @@ if test "$enable_wasm_strip" = "yes"; then
test_libqxp=no
test_libvisio=no
test_libzmf=no
- test_webdav=no
with_galleries=no
+ with_gssapi=no
with_templates=no
- with_webdav=no
with_x=no
test "${with_fonts+set}" = set || with_fonts=yes
diff --git a/external/curl/ExternalProject_curl.mk
b/external/curl/ExternalProject_curl.mk
index a7cd72e6bae3..1a94aa7a71d1 100644
--- a/external/curl/ExternalProject_curl.mk
+++ b/external/curl/ExternalProject_curl.mk
@@ -20,7 +20,11 @@ $(eval $(call gb_ExternalProject_register_targets,curl,\
ifneq ($(OS),WNT)
+ifeq ($(OS),EMSCRIPTEN)
+curl_CPPFLAGS := $(gb_EMSCRIPTEN_CPPFLAGS)
+else
curl_CPPFLAGS :=
+endif
curl_LDFLAGS := $(if $(filter LINUX FREEBSD,$(OS)),-Wl$(COMMA)-z$(COMMA)origin
-Wl$(COMMA)-rpath$(COMMA)\$$$$ORIGIN)
ifneq ($(OS),ANDROID)
diff --git a/include/systools/curlinit.hxx b/include/systools/curlinit.hxx
index 4b226c7a4218..5097832bd8df 100644
--- a/include/systools/curlinit.hxx
+++ b/include/systools/curlinit.hxx
@@ -34,10 +34,21 @@ static void InitCurl_easy(CURL* const pCURL)
#if defined(LO_CURL_NEEDS_CA_BUNDLE)
char const* const path = GetCABundleFile();
- rc = curl_easy_setopt(pCURL, CURLOPT_CAINFO, path);
- if (rc != CURLE_OK) // only if OOM?
+ if (path == nullptr)
{
- throw css::uno::RuntimeException("CURLOPT_CAINFO failed");
+#if defined EMSCRIPTEN
+ SAL_WARN("ucb.ucp.webdav.curl", "no OpenSSL CA certificate bundle
found");
+#else
+ throw css::uno::RuntimeException("no OpenSSL CA certificate bundle
found");
+#endif
+ }
+ else
+ {
+ rc = curl_easy_setopt(pCURL, CURLOPT_CAINFO, path);
+ if (rc != CURLE_OK) // only if OOM?
+ {
+ throw css::uno::RuntimeException("CURLOPT_CAINFO failed");
+ }
}
#endif
diff --git a/include/systools/opensslinit.hxx b/include/systools/opensslinit.hxx
index 48b38cf67512..45715d1bc0bf 100644
--- a/include/systools/opensslinit.hxx
+++ b/include/systools/opensslinit.hxx
@@ -36,7 +36,7 @@ static char const* GetCABundleFile()
}
}
- throw css::uno::RuntimeException("no OpenSSL CA certificate bundle found");
+ return nullptr;
}
#endif
diff --git a/sw/source/uibase/inc/translatehelper.hxx
b/sw/source/uibase/inc/translatehelper.hxx
index 9e473d68e039..8c0be7af8c9d 100644
--- a/sw/source/uibase/inc/translatehelper.hxx
+++ b/sw/source/uibase/inc/translatehelper.hxx
@@ -40,7 +40,7 @@ struct SW_DLLPUBLIC TranslateAPIConfig final
};
SW_DLLPUBLIC OString ExportPaMToHTML(SwPaM* pCursor);
SW_DLLPUBLIC void PasteHTMLToPaM(SwWrtShell& rWrtSh, SwPaM* pCursor, const
OString& rData);
-#if HAVE_FEATURE_CURL && !ENABLE_WASM_STRIP_EXTRA
+#if HAVE_FEATURE_CURL
SW_DLLPUBLIC void TranslateDocument(SwWrtShell& rWrtSh, const
TranslateAPIConfig& rConfig);
SW_DLLPUBLIC void TranslateDocumentCancellable(SwWrtShell& rWrtSh,
const TranslateAPIConfig&
rConfig,
diff --git a/sw/source/uibase/shells/translatehelper.cxx
b/sw/source/uibase/shells/translatehelper.cxx
index eb9bcaedbb05..79615f3b126e 100644
--- a/sw/source/uibase/shells/translatehelper.cxx
+++ b/sw/source/uibase/shells/translatehelper.cxx
@@ -94,7 +94,7 @@ void PasteHTMLToPaM(SwWrtShell& rWrtSh, SwPaM* pCursor, const
OString& rData)
}
}
-#if HAVE_FEATURE_CURL && !ENABLE_WASM_STRIP_EXTRA
+#if HAVE_FEATURE_CURL
void TranslateDocument(SwWrtShell& rWrtSh, const TranslateAPIConfig& rConfig)
{
bool bCancel = false;
@@ -212,5 +212,5 @@ void TranslateDocumentCancellable(SwWrtShell& rWrtSh, const
TranslateAPIConfig&
if (xStatusIndicator.is())
xStatusIndicator->end();
}
-#endif // HAVE_FEATURE_CURL && !ENABLE_WASM_STRIP_EXTRA
+#endif // HAVE_FEATURE_CURL
}
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index 129f99f3b295..99a6c4516d49 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -201,18 +201,17 @@ int ImplSVMain()
OUString temp;
if (osl_getEnvironment(name.pData, &temp.pData) ==
osl_Process_E_NotFound)
{
- try // to point bundled OpenSSL to some system certificate file
- { // ... this only works if the client actually calls
- // SSL_CTX_set_default_verify_paths() or similar; e.g. python
ssl.
- char const*const path = GetCABundleFile();
+ // Try to point bundled OpenSSL to some system certificate file
+ // ... this only works if the client actually calls
+ // SSL_CTX_set_default_verify_paths() or similar; e.g. python ssl.
+ char const*const path = GetCABundleFile();
+ if (path == nullptr) {
+ SAL_WARN("vcl", "no OpenSSL CA certificate bundle found");
+ } else {
OUString const filepath(::rtl::OStringToOUString(
::std::string_view(path), osl_getThreadTextEncoding()));
osl_setEnvironment(name.pData, filepath.pData);
}
- catch (uno::RuntimeException const& e)
- {
- SAL_WARN("vcl", e.Message);
- }
}
}
#endif
commit ca75bd867dccb6cb2810c54da52d7cd7d568c411
Author: Stephan Bergmann <[email protected]>
AuthorDate: Tue Aug 20 17:52:49 2024 +0200
Commit: Stephan Bergmann <[email protected]>
CommitDate: Fri Sep 13 11:05:08 2024 +0200
More useful to have an EMSCRIPTEN_EXTRA_SOFFICE_PRE_JS
...than an EMSCRIPTEN_EXTRA_SOFFICE_POST_JS. That way, we can e.g. set up
Module.arguments there.
(cherry-picked from b88b5f53a2e5a40a673bbb587571cc068cae6d6e)
Change-Id: I4990ab6daac2f74326ab2ee9508828f1b79bceb7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172154
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <[email protected]>
diff --git a/config_host.mk.in b/config_host.mk.in
index de55f297e00c..3358dc24cba0 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -142,7 +142,7 @@ export DPKG=@DPKG@
export EBOOK_CFLAGS=$(gb_SPACE)@EBOOK_CFLAGS@
export EBOOK_LIBS=$(gb_SPACE)@EBOOK_LIBS@
export EMSDK_FILE_PACKAGER=@EMSDK_FILE_PACKAGER@
-export EMSCRIPTEN_EXTRA_SOFFICE_POST_JS=@EMSCRIPTEN_EXTRA_SOFFICE_POST_JS@
+export EMSCRIPTEN_EXTRA_SOFFICE_PRE_JS=@EMSCRIPTEN_EXTRA_SOFFICE_PRE_JS@
export ENABLE_ANDROID_LOK=@ENABLE_ANDROID_LOK@
export ENABLE_ANDROID_EDITING=@ENABLE_ANDROID_EDITING@
export ENABLE_AVAHI=@ENABLE_AVAHI@
diff --git a/configure.ac b/configure.ac
index 1b6db1142184..101cf85e4322 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1431,7 +1431,7 @@ if test "$_os" = "Emscripten"; then
BUILD_TYPE="$BUILD_TYPE EMSCRIPTEN"
fi
AC_SUBST(EMSDK_FILE_PACKAGER)
-AC_SUBST(EMSCRIPTEN_EXTRA_SOFFICE_POST_JS)
+AC_SUBST(EMSCRIPTEN_EXTRA_SOFFICE_PRE_JS)
###############################################################################
# Extensions switches --enable/--disable
diff --git a/desktop/Executable_soffice_bin.mk
b/desktop/Executable_soffice_bin.mk
index be3b303190c2..f50cfb17633e 100644
--- a/desktop/Executable_soffice_bin.mk
+++ b/desktop/Executable_soffice_bin.mk
@@ -75,12 +75,12 @@ endif
$(call gb_Executable_get_linktarget_target,soffice_bin): \
$(gb_CustomTarget_workdir)/static/unoembind/bindings_uno.js \
$(SRCDIR)/static/emscripten/uno.js \
- $(EMSCRIPTEN_EXTRA_SOFFICE_POST_JS)
+ $(EMSCRIPTEN_EXTRA_SOFFICE_PRE_JS)
$(eval $(call gb_Executable_add_ldflags,soffice_bin, \
--post-js $(gb_CustomTarget_workdir)/static/unoembind/bindings_uno.js \
--post-js $(SRCDIR)/static/emscripten/uno.js \
- $(foreach i,$(EMSCRIPTEN_EXTRA_SOFFICE_POST_JS),--post-js $(i)) \
+ $(foreach i,$(EMSCRIPTEN_EXTRA_SOFFICE_PRE_JS),--pre-js $(i)) \
))
ifeq ($(ENABLE_DBGUTIL)-$(gb_SUPPRESS_TESTS),TRUE-)
diff --git a/static/README.wasm.md b/static/README.wasm.md
index 48a109bd8469..8eb226f6e97e 100644
--- a/static/README.wasm.md
+++ b/static/README.wasm.md
@@ -264,7 +264,7 @@ put next to the `qt_soffice.html` that you serve to the
browser (i.e., in
Module.uno_scripts = ['./example.js'];
```
And rebuild LO configured with an additional
-`EMSCRIPTEN_EXTRA_SOFFICE_POST_JS=/...path-to.../include.js`.
+`EMSCRIPTEN_EXTRA_SOFFICE_PRE_JS=/...path-to.../include.js`.
## Tools for problem diagnosis
commit 8cab2940566ae9720d61cece222d29634688885e
Author: Michael Weghorn <[email protected]>
AuthorDate: Tue Aug 20 12:29:56 2024 +0200
Commit: Stephan Bergmann <[email protected]>
CommitDate: Fri Sep 13 11:05:06 2024 +0200
emscripten: Show actual Emscripten version in "About"
Display the actual Emscripten version instead of a literal
"__EMSCRIPTEN_major__.__EMSCRIPTEN_minor__.__EMSCRIPTEN_tiny__"
for the environment information in "Help" -> "About LibreOfficeDev".
(cherry-picked from 81a9a5c5d24cf6825600d47cd5877f98e35d45b0)
Change-Id: I6a29e8c323e8874e89201b2cce7c28d2218fc8cb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172107
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <[email protected]>
diff --git a/vcl/unx/generic/app/geninst.cxx b/vcl/unx/generic/app/geninst.cxx
index 191d87ca76b7..42bff03131ee 100644
--- a/vcl/unx/generic/app/geninst.cxx
+++ b/vcl/unx/generic/app/geninst.cxx
@@ -25,6 +25,9 @@
#if defined(__FreeBSD__)
# include <sys/utsname.h>
#endif
+#if defined(EMSCRIPTEN)
+#include <emscripten/version.h>
+#endif
#include <config_features.h>
#if HAVE_FEATURE_OPENGL
@@ -88,10 +91,9 @@ OUString SalGenericInstance::getOSVersion()
}
aKernelVer = OUString::createFromAscii(stName.sysname) + " " +
aKernelVer.copy(0, nIndex);
#elif defined(EMSCRIPTEN)
-#define str(s) #s
-#define xstr(s) str(s)
- aKernelVer = "Emscripten " xstr(__EMSCRIPTEN_major__)
- "." xstr(__EMSCRIPTEN_minor__) "." xstr(__EMSCRIPTEN_tiny__);
+ aKernelVer = u"Emscripten "_ustr + OUString::number(__EMSCRIPTEN_major__)
+ u"."_ustr
+ + OUString::number(__EMSCRIPTEN_minor__) + u"."_ustr
+ + OUString::number(__EMSCRIPTEN_tiny__);
#endif
return aKernelVer;
}
commit c7810dc724906ec4f3df9e6e05f5fe381908bd60
Author: Stephan Bergmann <[email protected]>
AuthorDate: Mon Aug 19 22:25:29 2024 +0200
Commit: Stephan Bergmann <[email protected]>
CommitDate: Fri Sep 13 11:05:05 2024 +0200
Remove wasm-qt-mandelbrot demo
...that had been added with f90c68316c622971706568303a025bbc58351df3 "WASM:
add
Emscripten demo application". Whatever the original intention, it has
probably
served its purpose by now---and now only negatively impacts (re-)build
times.
(cherry-picked from af6a5ba20f7c69cb2f4818c780db9a60862d06a3)
Change-Id: I2bda8d12b91e741c4d0f7d3f02597e0e9505a73a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172087
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <[email protected]>
diff --git a/Repository.mk b/Repository.mk
index 844d36b70363..c062f1e41fc0 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -85,7 +85,6 @@ $(eval $(call gb_Helper_register_executables,NONE, \
listglyphs \
$(if $(and $(ENABLE_GTK3), $(filter LINUX %BSD SOLARIS,$(OS))),
gtktiledviewer) \
$(if $(and $(ENABLE_GTKTILEDVIEWER), $(filter WNT,$(OS))),
gtktiledviewer) \
- $(if $(filter EMSCRIPTEN,$(OS)),wasm-qt5-mandelbrot) \
))
$(eval $(call gb_Helper_register_executables_for_install,SDK,sdk, \
diff --git a/static/CustomTarget_wasm-qt5-mandelbrot_moc.mk
b/static/CustomTarget_wasm-qt5-mandelbrot_moc.mk
deleted file mode 100644
index 3d43dadb8832..000000000000
--- a/static/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,static/qt5-mandelbrot))
-
-$(call gb_CustomTarget_get_target,static/qt5-mandelbrot) : \
- $(gb_CustomTarget_workdir)/static/qt5-mandelbrot/renderthread.moc \
- $(gb_CustomTarget_workdir)/static/qt5-mandelbrot/mandelbrotwidget.moc \
-
-qt5_mandelbrot_MOCDEFS_H :=
$(gb_CustomTarget_workdir)/static/qt5-mandelbrot/moc_predefs.h
-qt5_mandelbrot_MOCDEFS_CXX :=
$(gb_CustomTarget_workdir)/static/qt5-mandelbrot/moc_dummy.cxx
-qt5_mandelbrot_WORKDIR :=
$(gb_CustomTarget_workdir)/static/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)/,,$@),CXX)
-
-$(gb_CustomTarget_workdir)/static/qt5-mandelbrot/%.moc : \
- $(SRCDIR)/static/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/static/Executable_wasm-qt5-mandelbrot.mk
b/static/Executable_wasm-qt5-mandelbrot.mk
deleted file mode 100644
index e7eac989110e..000000000000
--- a/static/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,static/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,\
- static/source/qt5-mandelbrot/main \
- static/source/qt5-mandelbrot/mandelbrotwidget \
- static/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/static/Module_static.mk b/static/Module_static.mk
index 337ca13945cb..4c57b94d7d21 100644
--- a/static/Module_static.mk
+++ b/static/Module_static.mk
@@ -22,10 +22,6 @@ $(eval $(call gb_Module_add_targets,static,\
Package_favicon \
Package_unoembind \
StaticLibrary_unoembind \
- $(if $(ENABLE_QT5), \
- CustomTarget_wasm-qt5-mandelbrot_moc \
- Executable_wasm-qt5-mandelbrot \
- ) \
))
endif
diff --git a/static/README.wasm.md b/static/README.wasm.md
index 64d5a361704f..48a109bd8469 100644
--- a/static/README.wasm.md
+++ b/static/README.wasm.md
@@ -22,7 +22,6 @@ The build generates a Writer-only LO build. You should be
able to run either
$ emrun --serve_after_close
workdir/installation/LibreOffice/emscripten/qt_soffice.html
$ emrun --serve_after_close workdir/LinkTarget/Executable/qt_vcldemo.html
- $ emrun --serve_after_close
workdir/LinkTarget/Executable/qt_wasm-qt5-mandelbrot.html
REMINDER: Always start new tabs in the browser, reload might fail / cache!
INFO: latest browser won't work anymore with 0.0.0.0 and need 127.0.0.1.
diff --git a/static/source/qt5-mandelbrot/main.cxx
b/static/source/qt5-mandelbrot/main.cxx
deleted file mode 100644
index 037c63153cf2..000000000000
--- a/static/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/static/source/qt5-mandelbrot/mandelbrotwidget.cxx
b/static/source/qt5-mandelbrot/mandelbrotwidget.cxx
deleted file mode 100644
index 5886dd2664c0..000000000000
--- a/static/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/static/source/qt5-mandelbrot/mandelbrotwidget.h
b/static/source/qt5-mandelbrot/mandelbrotwidget.h
deleted file mode 100644
index 72e95568b522..000000000000
--- a/static/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/static/source/qt5-mandelbrot/renderthread.cxx
b/static/source/qt5-mandelbrot/renderthread.cxx
deleted file mode 100644
index 398e43ded15d..000000000000
--- a/static/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;
- }
-
- double s = 1.0;
- if (wave > 700.0)
- s = 0.3 + 0.7 * (780.0 - wave) / (780.0 - 700.0);
- else if (wave < 420.0)
- s = 0.3 + 0.7 * (wave - 380.0) / (420.0 - 380.0);
-
- r = std::pow(r * s, 0.8);
- g = std::pow(g * s, 0.8);
- b = std::pow(b * s, 0.8);
- return qRgb(int(r * 255), int(g * 255), int(b * 255));
-}
diff --git a/static/source/qt5-mandelbrot/renderthread.h
b/static/source/qt5-mandelbrot/renderthread.h
deleted file mode 100644
index f344a9c2b224..000000000000
--- a/static/source/qt5-mandelbrot/renderthread.h
+++ /dev/null
@@ -1,94 +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 <QtCore/QMutex>
-#include <QtCore/QSize>
-#include <QtCore/QThread>
-#include <QtCore/QWaitCondition>
-
-QT_BEGIN_NAMESPACE
-class QImage;
-QT_END_NAMESPACE
-
-class RenderThread : public QThread
-{
- Q_OBJECT
-
-public:
- RenderThread(QObject* parent = nullptr);
- ~RenderThread();
-
- void render(double centerX, double centerY, double scaleFactor, QSize
resultSize,
- double devicePixelRatio);
-
-signals:
- void renderedImage(const QImage& image, double scaleFactor);
-
-protected:
- void run() override;
-
-private:
- static uint rgbFromWaveLength(double wave);
-
- QMutex m_mutex;
- QWaitCondition m_condition;
- double m_centerX;
- double m_centerY;
- double m_scaleFactor;
- double m_devicePixelRatio;
- QSize m_resultSize;
- bool m_restart = false;
- bool m_abort = false;
-
- static constexpr int ColormapSize = 512;
- uint m_colormap[ColormapSize];
-};
commit 15b5848af26e4c2de5f4844800d549c4d9a2bd8e
Author: Andrea Gelmini <[email protected]>
AuthorDate: Mon Aug 19 07:53:53 2024 +0200
Commit: Stephan Bergmann <[email protected]>
CommitDate: Fri Sep 13 11:05:03 2024 +0200
Fix typo
(cherry-picked from 1565181908a06dcdb8d97d6be8ff773acd1d05cb)
Change-Id: I3277386244f3a00c2756525829924870e3a3d2bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172030
Tested-by: Julien Nabet <[email protected]>
Reviewed-by: Julien Nabet <[email protected]>
diff --git a/static/README.wasm.md b/static/README.wasm.md
index 69ca55a74322..64d5a361704f 100644
--- a/static/README.wasm.md
+++ b/static/README.wasm.md
@@ -109,7 +109,7 @@
workdir/UnpackedTarball/freetype/instdir/lib/libfreetype.a), not against the Qt
$QT5DIR/lib/libqtfreetype.a). This mismatch between the include files that Qt
is compiled against,
vs. the archive actually linked in, seems to not cause issues in practice.
(If it did, we could
either try to make both Qt and LO link against e.g. -sUSE_FREETYPE from
emscripten-ports, or we
-could move Qt from a prequisite to a proper external/qt5 LO module built
during the LO build, and
+could move Qt from a prerequisite to a proper external/qt5 LO module built
during the LO build, and
hack its configuration to build against LO's external/freetype etc. The
former approach, building Qt
with -sUSE_FREETYPE, is even tried in qtbase/src/gui/configure.json, but
apparently fails for
reasons not studied further yet, cf. Qt's config.log.)
commit 4ee888801e1132069dcbbb72f66ad9a74939549f
Author: Andrea Gelmini <[email protected]>
AuthorDate: Mon Aug 19 07:53:12 2024 +0200
Commit: Stephan Bergmann <[email protected]>
CommitDate: Fri Sep 13 11:05:03 2024 +0200
Fix typo
(cherry-picked from 56c33b87e128804c6f0462063808e874880cd3cc)
Change-Id: I3fac3dcde5aad559dcbc4c64aeedfd0f6fc1cd6c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172029
Tested-by: Julien Nabet <[email protected]>
Reviewed-by: Julien Nabet <[email protected]>
diff --git a/static/README.wasm.md b/static/README.wasm.md
index 9d005fe7f286..69ca55a74322 100644
--- a/static/README.wasm.md
+++ b/static/README.wasm.md
@@ -110,7 +110,7 @@ $QT5DIR/lib/libqtfreetype.a). This mismatch between the
include files that Qt i
vs. the archive actually linked in, seems to not cause issues in practice.
(If it did, we could
either try to make both Qt and LO link against e.g. -sUSE_FREETYPE from
emscripten-ports, or we
could move Qt from a prequisite to a proper external/qt5 LO module built
during the LO build, and
-hack its configuration to build against LO's exernal/freetype etc. The former
approach, building Qt
+hack its configuration to build against LO's external/freetype etc. The
former approach, building Qt
with -sUSE_FREETYPE, is even tried in qtbase/src/gui/configure.json, but
apparently fails for
reasons not studied further yet, cf. Qt's config.log.)
commit 16c977cba65cdd810039abc92735265ce57d8916
Author: Stephan Bergmann <[email protected]>
AuthorDate: Sun Aug 18 15:45:26 2024 +0200
Commit: Stephan Bergmann <[email protected]>
CommitDate: Fri Sep 13 11:05:01 2024 +0200
Emscripten: Document how Qt builds its own freetype, but we link against
LO's
(cherry-picked from e0178cfdba827dafcb192fec005ea45bd041c485)
Change-Id: I6413c64db3d50f163ee9cc4feda395a54aab3cf2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172012
Reviewed-by: Stephan Bergmann <[email protected]>
Tested-by: Jenkins
diff --git a/static/README.wasm.md b/static/README.wasm.md
index c69129303aa5..9d005fe7f286 100644
--- a/static/README.wasm.md
+++ b/static/README.wasm.md
@@ -102,6 +102,18 @@ Current Qt fails to start the demo webserver:
<https://bugreports.qt.io/browse/Q
Use `emrun --serve_after_close` to run Qt WASM demos.
+Qt builds some 3rd-party libraries that it brings along (e.g.,
qt5/qtbase/src/3rdparty/freetype) and
+compiles its own code against the C/C++ include files of those 3rd-party
libraries. But when we
+link LO, we link against our own versions of those libraries' archives (e.g.,
+workdir/UnpackedTarball/freetype/instdir/lib/libfreetype.a), not against the
Qt ones (e.g.,
+$QT5DIR/lib/libqtfreetype.a). This mismatch between the include files that Qt
is compiled against,
+vs. the archive actually linked in, seems to not cause issues in practice.
(If it did, we could
+either try to make both Qt and LO link against e.g. -sUSE_FREETYPE from
emscripten-ports, or we
+could move Qt from a prequisite to a proper external/qt5 LO module built
during the LO build, and
+hack its configuration to build against LO's exernal/freetype etc. The former
approach, building Qt
+with -sUSE_FREETYPE, is even tried in qtbase/src/gui/configure.json, but
apparently fails for
+reasons not studied further yet, cf. Qt's config.log.)
+
### Setup LO
`autogen.sh` is patched to use emconfigure. That basically sets various
commit 1175cdd530083dd9c0ab85d7655328591198d17a
Author: Stephan Bergmann <[email protected]>
AuthorDate: Sun Aug 18 15:15:29 2024 +0200
Commit: Stephan Bergmann <[email protected]>
CommitDate: Fri Sep 13 11:05:00 2024 +0200
Emscripten: Increase the main thread stack size
At least when LO tries to download a document and
UUIInteractionHelper::handleErrorHandlerRequest wants to show a
MessageDialog
via Qt, the stack grows relatively large, and gray_convert_glyph
(workdir/UnpackedTarball/freetype/src/smooth/ftgrays.c) alone allocates on
the
stack a buffer of size FT_MAX_GRAY_POOL * sizeof(TCell) = 1024 * 16 = 16K,
which
causes (silent, due to no -sSTACK_OVERFLOW_CHECK=2) stack overflow.
So (somewhat randomly) double the size of the main thread stack to 128K;
but, at
least for now, keep the default value of 64K for other threads (which would
otherwise inherit the explicitly set -sSTACK_SIZE value via the
-sDEFUALT_PTHREAD_STACK_SIZE=0 default).
(cherry-picked from 4f41c19a03072b8c0ab7e882eea55a7f51619ef7)
Change-Id: I96583f4af93c84b15c67f310068c5631fb129d40
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172011
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <[email protected]>
diff --git a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
index 08ead6996a94..268d2dbf932e 100644
--- a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
@@ -17,6 +17,9 @@ gb_EMSCRIPTEN_LDFLAGS := $(gb_EMSCRIPTEN_CPPFLAGS)
# Initial memory size
gb_EMSCRIPTEN_LDFLAGS += -s TOTAL_MEMORY=1GB
+# Double the main thread stack size, but keep the default value for other
threads:
+gb_EMSCRIPTEN_LDFLAGS += -sSTACK_SIZE=131072 -sDEFAULT_PTHREAD_STACK_SIZE=65536
+
# To keep the link time (and memory) down, prevent all rewriting options from
wasm-emscripten-finalize
# See emscripten.py, finalize_wasm, modify_wasm = True
# So we need WASM_BIGINT=1 and ASSERTIONS=1 (2 implies STACK_OVERFLOW_CHECK)
commit 772456718bfc0fd51e6a4346260a7c19cb18d7ac
Author: Stephan Bergmann <[email protected]>
AuthorDate: Sun Aug 18 15:05:32 2024 +0200
Commit: Stephan Bergmann <[email protected]>
CommitDate: Fri Sep 13 11:04:59 2024 +0200
Drop obsolete comment
...after 6e6451ce96f47e0ef5e8ecf1750f394ff3fb48e4 "Emscripten: Move the Qt
event
loop off the JS main thread"
(cherry-picked from 3d27d68c21bb868e9571a75f219dd8eac0063b16)
Change-Id: Iea9cb74fa2fc3dd036ee865e1bd8ede93fb33c78
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172010
Reviewed-by: Stephan Bergmann <[email protected]>
Tested-by: Jenkins
diff --git a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
index 6ba9efe66a5c..08ead6996a94 100644
--- a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
@@ -14,7 +14,7 @@ gb_RUN_CONFIGURE := $(SRCDIR)/solenv/bin/run-configure
gb_EMSCRIPTEN_CPPFLAGS := -pthread -s USE_PTHREADS=1 -D_LARGEFILE64_SOURCE
-D_LARGEFILE_SOURCE -s SUPPORT_LONGJMP=wasm
gb_EMSCRIPTEN_LDFLAGS := $(gb_EMSCRIPTEN_CPPFLAGS)
-# Initial memory size and worker thread pool
+# Initial memory size
gb_EMSCRIPTEN_LDFLAGS += -s TOTAL_MEMORY=1GB
# To keep the link time (and memory) down, prevent all rewriting options from
wasm-emscripten-finalize
commit c0cf3cc08d1a28b5d5d13c10221aad5813dd25ba
Author: Stephan Bergmann <[email protected]>
AuthorDate: Fri Aug 16 15:02:15 2024 +0200
Commit: Stephan Bergmann <[email protected]>
CommitDate: Fri Sep 13 11:04:58 2024 +0200
Emscripten: Clean up SolarMutex
...before disappearing through the QApplication::exec() hole, or else the
SolarMutex would remain locked forever on the application's main thread.
This requires changing SalInstance::ReleaseYieldMutexAll() to
SalInstance::ReleaseYieldMutex(bool all). (Further recursive locking of the
SolarMutex via SolarMutexGuard instances that would be present on the call
stack
leading up to the call to QApplication::exec() would be released during the
stack unwinding, so just undo the one acquiring done in InitVCL, not all of
them.)
(cherry-picked from 50cd19debbd3f94df0fc4b370f6f6e69d4a1e085)
Change-Id: I9ef57abb7da7f840999700e4eaeeefd2da784645
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171956
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <[email protected]>
diff --git a/offapi/org/libreoffice/embindtest/XTest.idl
b/offapi/org/libreoffice/embindtest/XTest.idl
index 8d46c9e71d5a..276ce260a8e1 100644
--- a/offapi/org/libreoffice/embindtest/XTest.idl
+++ b/offapi/org/libreoffice/embindtest/XTest.idl
@@ -133,6 +133,7 @@ interface XTest {
void passInterface([in] com::sun::star::uno::XInterface object);
boolean checkAttributes([in] org::libreoffice::embindtest::XAttributes
object);
[attribute] string StringAttribute;
+ boolean testSolarMutex();
};
}; }; };
-e
... etc. - the rest is truncated