summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--codemaker/source/cppumaker/cpputype.cxx31
-rw-r--r--include/osl/detail/component-defines.h44
2 files changed, 72 insertions, 3 deletions
diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx
index 0a710a88e4df..dc5874c35f52 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -3408,6 +3408,17 @@ void ServiceType::dumpHxxFile(
OUString headerDefine(dumpHeaderDefine(o, "HPP"));
o << "\n";
includes.dump(o, 0);
+ if (!entity_->getConstructors().empty()) {
+ o << ("\n#if defined ANDROID || defined IOS //TODO\n"
+ "#include <osl/detail/component-defines.h>\n#endif\n\n"
+ "#if defined LO_URE_CURRENT_ENV && defined LO_URE_CTOR_ENV_")
+ << name_.replaceAll(".", "_dot_")
+ << " && (LO_URE_CURRENT_ENV) == (LO_URE_CTOR_ENV_"
+ << name_.replaceAll(".", "_dot_") << ") && defined LO_URE_CTOR_FUN_"
+ << name_.replaceAll(".", "_dot_")
+ << "\nextern \"C\" void * SAL_CALL LO_URE_CTOR_FUN_"
+ << name_.replaceAll(".", "_dot_") << "(void *, void *);\n#endif\n";
+ }
o << "\n";
if (codemaker::cppumaker::dumpNamespaceOpen(o, name_, false)) {
o << "\n";
@@ -3436,14 +3447,28 @@ void ServiceType::dumpHxxFile(
<< "::css::uno::Reference< " << scopedBaseName
<< " > the_instance;\n" << indent() << "try {\n";
inc();
- o << indent()
- << "the_instance = ::css::uno::Reference< "
+ o << ("#if defined LO_URE_CURRENT_ENV && defined "
+ "LO_URE_CTOR_ENV_")
+ << name_.replaceAll(".", "_dot_")
+ << " && (LO_URE_CURRENT_ENV) == (LO_URE_CTOR_ENV_"
+ << name_.replaceAll(".", "_dot_")
+ << ") && defined LO_URE_CTOR_FUN_"
+ << name_.replaceAll(".", "_dot_") << "\n" << indent()
+ << "the_instance = ::css::uno::Reference< " << scopedBaseName
+ << (" >(::css::uno::Reference< ::css::uno::XInterface >("
+ "static_cast< ::css::uno::XInterface * >((*"
+ "LO_URE_CTOR_FUN_")
+ << name_.replaceAll(".", "_dot_")
+ << (")(the_context.get(), ::css::uno::Sequence<"
+ " ::css::uno::Any >().get())), ::SAL_NO_ACQUIRE),"
+ " ::css::uno::UNO_QUERY);\n#else\n")
+ << indent() << "the_instance = ::css::uno::Reference< "
<< scopedBaseName
<< (" >(the_context->getServiceManager()->"
"createInstanceWithContext(::rtl::OUString("
" \"")
<< name_
- << "\" ), the_context), ::css::uno::UNO_QUERY);\n";
+ << "\" ), the_context), ::css::uno::UNO_QUERY);\n#endif\n";
dec();
o << indent()
<< "} catch (const ::css::uno::RuntimeException &) {\n";
diff --git a/include/osl/detail/component-defines.h b/include/osl/detail/component-defines.h
new file mode 100644
index 000000000000..63893eac7b06
--- /dev/null
+++ b/include/osl/detail/component-defines.h
@@ -0,0 +1,44 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ */
+
+#ifndef INCLUDED_OSL_DETAIL_COMPONENT_DEFINES_H
+#define INCLUDED_OSL_DETAIL_COMPONENT_DEFINES_H
+
+/* Experimental direct constructor calls, under construction */
+
+#define LO_URE_CURRENT_ENV 1 /*TODO*/
+
+#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_comp_dot_extensions_dot_xml_dot_sax_dot_FastParser 1 /*TODO*/
+#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_comp_dot_extensions_dot_xml_dot_sax_dot_FastParser com_sun_star_comp_extensions_xml_sax_FastParser
+#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_comp_dot_extensions_dot_xml_dot_sax_dot_ParserExpat 1 /*TODO*/
+#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_comp_dot_extensions_dot_xml_dot_sax_dot_ParserExpat com_sun_star_comp_extensions_xml_sax_ParserExpat
+#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_comp_dot_stoc_dot_DLLComponentLoader 1 /*TODO*/
+#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_comp_dot_stoc_dot_DLLComponentLoader com_sun_star_comp_stoc_DLLComponentLoader
+#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_comp_dot_stoc_dot_ImplementationRegistration 1 /*TODO*/
+#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_comp_dot_stoc_dot_ImplementationRegistration com_sun_star_comp_stoc_ImplementationRegistration
+#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_comp_dot_stoc_dot_NestedRegistry 1 /*TODO*/
+#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_comp_dot_stoc_dot_NestedRegistry com_sun_star_comp_stoc_NestedRegistry
+#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_comp_dot_stoc_dot_ORegistryServiceManager 1 /*TODO*/
+#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_comp_dot_stoc_dot_ORegistryServiceManager com_sun_star_comp_stoc_ORegistryServiceManager
+#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_comp_dot_stoc_dot_OServiceManager 1 /*TODO*/
+#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_comp_dot_stoc_dot_OServiceManager com_sun_star_comp_stoc_OServiceManager
+#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_comp_dot_stoc_dot_OServiceManagerWrapper 1 /*TODO*/
+#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_comp_dot_stoc_dot_OServiceManagerWrapper com_sun_star_comp_stoc_OServiceManagerWrapper
+#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_comp_dot_stoc_dot_SimpleRegistry 1 /*TODO*/
+#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_comp_dot_stoc_dot_SimpleRegistry com_sun_star_comp_stoc_SimpleRegistry
+#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_extensions_dot_xml_dot_sax_dot_Writer 1 /*TODO*/
+#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_extensions_dot_xml_dot_sax_dot_Writer com_sun_star_extensions_xml_sax_Writer
+#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_security_dot_comp_dot_stoc_dot_AccessController 1 /*TODO*/
+#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_security_dot_comp_dot_stoc_dot_AccessController com_sun_star_security_comp_stoc_AccessController
+#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_security_dot_comp_dot_stoc_dot_FilePolicy 1 /*TODO*/
+#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_security_dot_comp_dot_stoc_dot_FilePolicy com_sun_star_security_comp_stoc_FilePolicy
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */