From 0bab5cda2123ecc7f3775d05ca5103bdef23bfe8 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 1 Mar 2024 14:30:38 +0100 Subject: Add Embing'ing of UNO Any getter for enums ...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 --- include/static/unoembindhelpers/PrimaryBindings.hxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include') diff --git a/include/static/unoembindhelpers/PrimaryBindings.hxx b/include/static/unoembindhelpers/PrimaryBindings.hxx index 80b55d5278ac..13ddd05cce26 100644 --- a/include/static/unoembindhelpers/PrimaryBindings.hxx +++ b/include/static/unoembindhelpers/PrimaryBindings.hxx @@ -14,11 +14,14 @@ #include #include #include +#include #include #include #include +#include +#include #include template struct emscripten::smart_ptr_trait> @@ -33,6 +36,11 @@ template struct emscripten::smart_ptr_trait> namespace unoembindhelpers { +namespace detail +{ +void registerUnoType(css::uno::Type const& type, std::type_info const* id); +} + enum class uno_Reference { FromAny @@ -76,6 +84,11 @@ void checkSequenceAccess(css::uno::Sequence const& sequence, sal_Int32 index) } } +template void registerUnoType() +{ + detail::registerUnoType(cppu::UnoType::get(), &typeid(T)); +} + template void registerSequence(char const* name) { emscripten::class_>(name) -- cgit