summaryrefslogtreecommitdiff
path: root/include/static
AgeCommit message (Collapse)AuthorFilesLines
2024-04-30Embind: Fix out-param handlingStephan Bergmann1-0/+6
...by using UnoInOutParam in all cases. Some types whose Embind mappings don't employ any smart pointers (like any and sequence) would have worked directly with pointers, but others (like string and type) would have caused Embind errors at runtime. So consistently use UnoInOutParam in all cases (and generate bindings for all the used cases in embindmaker). Change-Id: If26551bf4e99d10748aec1597d6e99f994dfd86e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166854 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-04-18Embind: We no longer need interface FromAny ctorStephan Bergmann1-5/+0
...now that we have uno_Any get() since 8428368d79118f1d0e09615c5d2b92065b8838d4 "Improve Embing'ing of UNO Any somewhat" Change-Id: I06572e1ca152117c5c93a1552e50b1399af84780 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166244 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-03-04Add Embind'ing of UNO Any getter for sequencesStephan Bergmann1-0/+1
Change-Id: I5b81ad3d5f1351062aef43105ea7ec4678045a90 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164360 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-03-04Add Embing'ing of UNO Any getter for enumsStephan Bergmann1-0/+13
...which taps into the internals of emscripten::val, which is based on std::type_info identifiers, so we need an additional statically-built mapping between UNO (enum, for now) types and std::type_info Change-Id: I9fc1ff33fe31a1e1052504905de446ed2193e014 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164359 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-02-23Propagate by-ref Sequence::operator[] return type through lambdaStephan Bergmann1-1/+1
Change-Id: I029ae2ff5ab6f73681afc5920dc9aba90cd32539 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163814 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-02-08Embind: Allow UNO sequences to be constructed from JS arraysStephan Bergmann1-1/+22
...though > let seq = new Module.uno_Sequence_string(["foo", "bar", "baz"]); > // ... > delete seq; is still ugly. And Embind only allows for overload resolution by number of parameters, not by their type, so using the original sequence constructor had to be changed to > let seq = new Module.uno_Sequence_string(3, Module.uno_Sequence.FromSize); > seq.set(0, "foo"); > seq.set(1, "bar"); > seq.set(2, "baz"); > // ... > delete seq; Change-Id: If26ff4a485ba16b65cf24b6fe729d379c733c473 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163097 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-02-06Prevent JS from creating css::uno::Sequence of negative sizeStephan Bergmann1-5/+13
Change-Id: I2449723162744e9ce3cb3e3172ce8acae0adf4db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162998 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-02-01embindmaker: Add support for sequence typesStephan Bergmann1-0/+36
Ideally, JS code would have a way to create instances of arbitrary UNO sequence types (to e.g. put them into Anys), but that goes against the static nature of Embind. So at least register JS support for all those UNO sequence types that are actually used in the UNO API. (This would cause duplicate failures, though, if we generated multiple separate .cxx files from embindmaker invocations, with registration code for the same UNO sequence types.) (Even more ideally, UNO sequence types could map to JS arrays, and/oror be garbage-collected on the JS side rather than needing explicit delete(). The resize/size/get/set interface in unoembindhelpers::registerSequence is modelled after Embind's emscripten::register_vector.) Change-Id: Icd38b2e03db442dd613b9222b9bd092f947f7bec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162849 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-01-31Embind in-out/out params of primitive type apparently need a wrapperStephan Bergmann1-0/+16
> let translit = css.i18n.Transliteration.create(Module.getUnoComponentContext()); > let match1; > let match2; > let eq = translit.equals(new Module.OUString("test1"), 0, 5, match1, new Module.OUString("test2"), 0, 5, match2); > console.log('match ' + eq + ', ' + match1 + ', ' + match2); caused an uncaught UnboundTypeError with message "Cannot call uno_Type_com$sun$star$i18n$XTransliteration.equals due to unbound types: Pl", so use > let translit = css.i18n.Transliteration.create(Module.getUnoComponentContext()); > let match1 = new Module.UnoInOutParamLong; > let match2 = new Module.UnoInOutParamLong; > let eq = translit.equals(new Module.OUString("test1"), 0, 5, match1, new Module.OUString("test2"), 0, 5, match2); > console.log('match ' + eq + ', ' + match1.val + ', ' + match2.val); > delete match1; > delete match2; instead Change-Id: Ic5a0a9e37e884817158069702510eab0d29adefa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162784 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-01-30Rework the Embind mapping of UNO interfacesStephan Bergmann1-0/+37
...to make use of the automatic finalization clean-up of smart pointers available with recent versions of Embind (so that explicitly calling delete() on them should largely be optional now). See the changes to static/README.wasm.md for how code should look like now. (The Module.uno_Reference.FromAny dummy argument for the interface constructor converting from an Any is only necessary to distinguish it from the other constructor, as otherwise Embind complains because: "Overload resolution is currently only performed using the parameter count, not actual type info!") Change-Id: Ia8a8c12e38af1093948bf8a20ecd31aa6591e912 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162697 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>