I'm sorry about not CCing last message. On 15 June 2011 21:47, Michael Meeks <michael.me...@novell.com> wrote: > > On Wed, 2011-06-15 at 13:13 +0200, Matúš Kukan wrote: >> What do you mean by testing? So far I have just a little knowledge of >> what I'm doing. > > Oh - we need to check the toolkit components really still work and are > activated correctly when we try to use the toolkit pieces. ie. try > dropping some GUI/form controls (buttons etc.) onto a spreadsheet - if > that works, we're fine :-) > I have problems with customize options. Tools -> Customize.. -> Toolbars or Events tab -> crash. But I don't know if this is toolkit related and caused by my patch.
>> Did you mean which libraries are loaded? >> Mostly bootstrap.uno.so, stocservices.uno.so, configmgr.uno.so, >> libvclli.so, libfwkli.so and others. > > Sure - so it is easy to get this data; > > Just do: > > LD_DEBUG=files ./soffice.bin -writer 2>&1 | tee /tmp/log > > and some sedding on that should get us a nice list of library names. > We want just to get all the library names? >> And then somehow change that and merge some libraries? > > Lets defer the merging until we have list of what to merge. > > Oh - and can you CC the dev. list on all these mails ? :-) Sorry about that. >> I will try to describe how I understand this. We want to use some >> service, so we know its implementation and in which component it is. >> So we load some library and use it. > > Sure :-) of course, if it is already loaded, then 'dlopen' just > succeeds instantly, and there is ~no cost. > >> And if we want another service we must unload the first library and >> load other. (if they differ). > > Nah - but we have to load another library - which is a pain, causes > seeks on the disk, and also means we can't optimise ordering of sections > inside shared objects, and more that we can do with fewer, bigger DLLs. > Firefox is (mostly) just one huge dll FWIW - and we want to move closer > to that, > > Is that clearer :-) > Sure, thanks. I'm also sending patches. But I created them in my second workdir. I have recently done ./g pull -r there. And I'm getting the same error as last time: dllcomponentloader.cxx:(.text+0x1bf): undefined reference to `cppu::loadSharedLibComponentFactory(rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory> const&, com::sun::star::uno::Reference<com::sun::star::registry::XRegistryKey> const&)' collect2: ld returned 1 exit status But this time I'm not successful with that. In my older workdir I just added _ZN4cppu29loadSharedLibComponentFactoryERKN3rtl8OUStringES3_S3_RKN3com3sun4star3uno9ReferenceINS6_4lang20XMultiServiceFactoryEEERKNS8_INS6_8registry12XRegistryKeyEEES3_ into cppuhelper/source/gcc3.map. But It's not working now this way. I found that string with objdump -T ./solver/350/unxlngi6.pro/lib/libuno_cppuhelpergcc3.so. Thanks, Matus
From c38d0995dc19c1f9888aa34a68977086888a08d8 Mon Sep 17 00:00:00 2001 From: Matus Kukan <matus.ku...@gmail.com> Date: Thu, 16 Jun 2011 17:07:02 +0200 Subject: [PATCH] Start using toolkit component prefix --- toolkit/source/helper/registerservices.cxx | 4 ++-- toolkit/util/tk.component | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/toolkit/source/helper/registerservices.cxx b/toolkit/source/helper/registerservices.cxx index 75b6e8b..736031b 100644 --- a/toolkit/source/helper/registerservices.cxx +++ b/toolkit/source/helper/registerservices.cxx @@ -236,12 +236,12 @@ extern void * SAL_CALL comp_Layout_component_getFactory( const char * implName, extern "C" { -TOOLKIT_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment( const sal_Char** ppEnvTypeName, uno_Environment** ) +TOOLKIT_DLLPUBLIC void SAL_CALL toolkit_component_getImplementationEnvironment( const sal_Char** ppEnvTypeName, uno_Environment** ) { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -TOOLKIT_DLLPUBLIC void* SAL_CALL component_getFactory( const sal_Char* sImplementationName, void* _pServiceManager, void* _pRegistryKey ) +TOOLKIT_DLLPUBLIC void* SAL_CALL toolkit_component_getFactory( const sal_Char* sImplementationName, void* _pServiceManager, void* _pRegistryKey ) { void* pRet = NULL; diff --git a/toolkit/util/tk.component b/toolkit/util/tk.component index 4d4713e..d21fbd4 100644 --- a/toolkit/util/tk.component +++ b/toolkit/util/tk.component @@ -26,7 +26,7 @@ * **********************************************************************--> -<component loader="com.sun.star.loader.SharedLibrary" +<component loader="com.sun.star.loader.SharedLibrary" prefix="toolkit" xmlns="http://openoffice.org/2010/uno-components"> <implementation name="com.sun.star.awt.comp.AsyncCallback"> <service name="com.sun.star.awt.AsyncCallback"/> -- 1.7.1
From a404936acef5891143d9cb8b5d732c5338bf6096 Mon Sep 17 00:00:00 2001 From: Matus Kukan <matus.ku...@gmail.com> Date: Thu, 16 Jun 2011 16:59:17 +0200 Subject: [PATCH 1/2] Add prefix information about component into registry --- stoc/source/simpleregistry/textualservices.cxx | 47 ++++++++++++++++++++---- 1 files changed, 40 insertions(+), 7 deletions(-) diff --git a/stoc/source/simpleregistry/textualservices.cxx b/stoc/source/simpleregistry/textualservices.cxx index 483c8ba..a5dd8f5 100644 --- a/stoc/source/simpleregistry/textualservices.cxx +++ b/stoc/source/simpleregistry/textualservices.cxx @@ -63,6 +63,7 @@ namespace css = com::sun::star; struct Implementation { rtl::OUString uri; rtl::OUString loader; + rtl::OUString prefix; std::vector< rtl::OUString > services; std::vector< rtl::OUString > singletons; }; @@ -103,6 +104,7 @@ private: rtl::Reference< Data > data_; rtl::OUString attrUri_; rtl::OUString attrLoader_; + rtl::OUString attrPrefix_; rtl::OUString attrImplementation_; }; @@ -238,6 +240,7 @@ Parser::Parser(rtl::OUString const & uri, rtl::Reference< Data > const & data): void Parser::handleComponent() { attrUri_ = rtl::OUString(); attrLoader_ = rtl::OUString(); + attrPrefix_ = rtl::OUString(); xmlreader::Span name; int nsId; while (reader_.nextAttribute(&nsId, &name)) { @@ -282,8 +285,29 @@ void Parser::handleComponent() { ": <component> has empty \"loader\" attribute"))), css::uno::Reference< css::uno::XInterface >()); } + } else if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && + name.equals(RTL_CONSTASCII_STRINGPARAM("prefix"))) + { + if (attrPrefix_.getLength() != 0) { + throw css::registry::InvalidRegistryException( + (reader_.getUrl() + + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + ": <component> has multiple \"prefix\"" + " attributes"))), + css::uno::Reference< css::uno::XInterface >()); + } + attrPrefix_ = reader_.getAttributeValue(false).convertFromUtf8(); + if (attrPrefix_.getLength() == 0) { + throw css::registry::InvalidRegistryException( + (reader_.getUrl() + + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + ": <component> has empty \"prefix\" attribute"))), + css::uno::Reference< css::uno::XInterface >()); + } } else { - OSL_FAIL ("unexpected component attribute, expected 'uri' or 'loader'"); + OSL_FAIL ("unexpected component attribute, expected 'uri' or 'loader' or 'prefix'"); } } if (attrUri_.getLength() == 0) { @@ -330,6 +354,7 @@ void Parser::handleImplementation() { } data_->implementations[attrImplementation_].uri = attrUri_; data_->implementations[attrImplementation_].loader = attrLoader_; + data_->implementations[attrImplementation_].prefix = attrPrefix_; } void Parser::handleService() { @@ -419,6 +444,7 @@ private: UNO LOCATION utf-8 ACTIVATOR utf-8 + PREFIX utf-8 SERVICES <service> ... @@ -436,7 +462,7 @@ private: */ enum State { STATE_ROOT, STATE_IMPLEMENTATIONS, STATE_IMPLEMENTATION, STATE_UNO, - STATE_LOCATION, STATE_ACTIVATOR, STATE_IMPLEMENTATION_SERVICES, + STATE_LOCATION, STATE_ACTIVATOR, STATE_PREFIX, STATE_IMPLEMENTATION_SERVICES, STATE_IMPLEMENTATION_SERVICE, STATE_IMPLEMENTATION_SINGLETONS, STATE_IMPLEMENTATION_SINGLETON, STATE_SERVICES, STATE_SERVICE, STATE_SINGLETONS, STATE_SINGLETON, STATE_REGISTEREDBY }; @@ -668,6 +694,8 @@ rtl::OUString Key::getAsciiValue() throw ( return data_->implementations[path_[1]].uri; case STATE_ACTIVATOR: return data_->implementations[path_[1]].loader; + case STATE_PREFIX: + return data_->implementations[path_[1]].prefix; default: throw css::registry::InvalidValueException( rtl::OUString( @@ -948,7 +976,7 @@ bool Key::find( if (path != 0) { *path = p; } - std::size_t const MAX_TRANSITIONS = 4; + std::size_t const MAX_TRANSITIONS = 5; struct StateInfo { css::registry::RegistryValueType type; std::size_t count; @@ -968,15 +996,18 @@ bool Key::find( { css::registry::RegistryValueType_NOT_DEFINED, 1, { { "UNO", STATE_UNO } } }, // STATE_UNO: - { css::registry::RegistryValueType_NOT_DEFINED, 4, + { css::registry::RegistryValueType_NOT_DEFINED, 5, { { "LOCATION", STATE_LOCATION }, { "ACTIVATOR", STATE_ACTIVATOR }, + { "PREFIX", STATE_PREFIX }, { "SERVICES", STATE_IMPLEMENTATION_SERVICES }, { "SINGLETONS", STATE_IMPLEMENTATION_SINGLETONS } } }, // STATE_LOCATION: { css::registry::RegistryValueType_ASCII, 0, {} }, // STATE_ACTIVATOR: { css::registry::RegistryValueType_ASCII, 0, {} }, + // STATE_PREFIX: + { css::registry::RegistryValueType_ASCII, 0, {} }, // STATE_IMPLEMENTATION_SERVICES: { css::registry::RegistryValueType_NOT_DEFINED, 1, { { 0, STATE_IMPLEMENTATION_SERVICE } } }, @@ -1084,15 +1115,17 @@ css::uno::Sequence< rtl::OUString > Key::getChildren() { } case STATE_UNO: { - css::uno::Sequence< rtl::OUString > seq(4); + css::uno::Sequence< rtl::OUString > seq(5); seq[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LOCATION")); seq[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ACTIVATOR")); - seq[2] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SERVICES")); - seq[3] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SINGLETONS")); + seq[2] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PREFIX")); + seq[3] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SERVICES")); + seq[4] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SINGLETONS")); return seq; } case STATE_LOCATION: case STATE_ACTIVATOR: + case STATE_PREFIX: case STATE_IMPLEMENTATION_SERVICE: case STATE_IMPLEMENTATION_SINGLETON: case STATE_SERVICE: -- 1.7.1
From 4428efcb6de48c714f2bf20ef53a33e14663f9dc Mon Sep 17 00:00:00 2001 From: Matus Kukan <matus.ku...@gmail.com> Date: Thu, 16 Jun 2011 17:01:51 +0200 Subject: [PATCH 2/2] Allows using prefix information about component --- cppuhelper/inc/cppuhelper/shlib.hxx | 4 +++- cppuhelper/source/factory.cxx | 23 +++++++++++++++++++++++ cppuhelper/source/gcc3.map | 2 +- cppuhelper/source/gcc3os2.map | 2 +- cppuhelper/source/shlib.cxx | 14 ++++++++------ 5 files changed, 36 insertions(+), 9 deletions(-) diff --git a/cppuhelper/inc/cppuhelper/shlib.hxx b/cppuhelper/inc/cppuhelper/shlib.hxx index a092ce3..002ce94 100644 --- a/cppuhelper/inc/cppuhelper/shlib.hxx +++ b/cppuhelper/inc/cppuhelper/shlib.hxx @@ -48,6 +48,7 @@ namespace cppu @param rImplName implementation to be retrieved from the library @param xMgr service manager to be provided to the component @param xKey registry key to be provided to the component + @param rPrefix optional component prefix @return factory instance (::com::sun::star::lang::XSingleComponentFactory or ::com::sun::star::lang::XSingleComponentFactory) @@ -57,7 +58,8 @@ SAL_CALL loadSharedLibComponentFactory( ::rtl::OUString const & rLibName, ::rtl::OUString const & rPath, ::rtl::OUString const & rImplName, ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > const & xMgr, - ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > const & xKey ) + ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > const & xKey, + ::rtl::OUString const & rPrefix = ::rtl::OUString() ) SAL_THROW( (::com::sun::star::loader::CannotActivateFactoryException) ); /** Invokes component_writeInfo() function of specified component library. You can give either diff --git a/cppuhelper/source/factory.cxx b/cppuhelper/source/factory.cxx index 63d22c8..4344222 100644 --- a/cppuhelper/source/factory.cxx +++ b/cppuhelper/source/factory.cxx @@ -31,9 +31,11 @@ #include <osl/diagnose.h> #include <osl/mutex.hxx> #include <cppuhelper/weak.hxx> +#include <cppuhelper/bootstrap.hxx> #include <cppuhelper/component.hxx> #include <cppuhelper/factory.hxx> #include <cppuhelper/implbase3.hxx> +#include <cppuhelper/shlib.hxx> #include <cppuhelper/typeprovider.hxx> #include <rtl/instance.hxx> #include <rtl/unload.h> @@ -832,6 +834,7 @@ Reference< XInterface > ORegistryFactoryHelper::createModuleFactory() OUString aActivatorUrl; OUString aActivatorName; OUString aLocation; + OUString aPrefix; Reference<XRegistryKey > xActivatorKey = xImplementationKey->openKey( OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/ACTIVATOR") ) ); @@ -847,6 +850,15 @@ Reference< XInterface > ORegistryFactoryHelper::createModuleFactory() OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/LOCATION") ) ); if( xLocationKey.is() && xLocationKey->getValueType() == RegistryValueType_ASCII ) aLocation = xLocationKey->getAsciiValue(); + + Reference<XRegistryKey > xPrefixKey = xImplementationKey->openKey( + OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/PREFIX") ) ); + if( xPrefixKey.is() && xPrefixKey->getValueType() == RegistryValueType_ASCII ) + { + aPrefix = xPrefixKey->getAsciiValue(); + if (aPrefix.getLength() != 0) + aPrefix = aPrefix + OUSTR("_"); + } } else { @@ -881,6 +893,17 @@ Reference< XInterface > ORegistryFactoryHelper::createModuleFactory() Reference<XInterface > x = xSMgr->createInstance( aActivatorName ); Reference<XImplementationLoader > xLoader( x, UNO_QUERY ); Reference<XInterface > xMF; + if( aActivatorName == OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.loader.SharedLibrary") ) ) + { + try + { + return loadSharedLibComponentFactory( bootstrap_expandUri( aLocation ), OUString(), aImplementationName, xSMgr, xImplementationKey, aPrefix ); + } + catch ( IllegalArgumentException & e ) + { + throw RuntimeException( e.Message, e.Context ); + } + } if (xLoader.is()) { xFactory = xLoader->activate( aImplementationName, aActivatorUrl, aLocation, xImplementationKey ); diff --git a/cppuhelper/source/gcc3.map b/cppuhelper/source/gcc3.map index 0aee996..ff1388e 100644 --- a/cppuhelper/source/gcc3.map +++ b/cppuhelper/source/gcc3.map @@ -157,7 +157,7 @@ _ZN4cppu28createRegistryServiceFactoryERKN3rtl8OUStringES3_hS3_; _ZN4cppu28createSingleComponentFactoryEPFN3com3sun4star3uno9ReferenceINS3_10XInterfaceEEERKNS4_INS3_17XComponentContextEEEERKN3rtl8OUStringERKNS3_8SequenceISE_EEP16_rtl_ModuleCount; _ZN4cppu29WeakComponentImplHelper_queryERKN3com3sun4star3uno4TypeEPNS_10class_dataEPvPNS_27WeakComponentImplHelperBaseE; _ZN4cppu29installTypeDescriptionManagerERKN3com3sun4star3uno9ReferenceINS2_9container23XHierarchicalNameAccessEEE; -_ZN4cppu29loadSharedLibComponentFactoryERKN3rtl8OUStringES3_S3_RKN3com3sun4star3uno9ReferenceINS6_4lang20XMultiServiceFactoryEEERKNS8_INS6_8registry12XRegistryKeyEEE; +_ZN4cppu29loadSharedLibComponentFactoryERKN3rtl8OUStringES3_S3_RKN3com3sun4star3uno9ReferenceINS6_4lang20XMultiServiceFactoryEEERKNS8_INS6_8registry12XRegistryKeyEEES3_; _ZN4cppu30ImplHelper_getImplementationIdEPNS_10class_dataE; _ZN4cppu30WeakAggComponentImplHelperBase14queryInterfaceERKN3com3sun4star3uno4TypeE; _ZN4cppu30WeakAggComponentImplHelperBase16addEventListenerERKN3com3sun4star3uno9ReferenceINS3_4lang14XEventListenerEEE; diff --git a/cppuhelper/source/gcc3os2.map b/cppuhelper/source/gcc3os2.map index 2c3bd2d..dd93466 100644 --- a/cppuhelper/source/gcc3os2.map +++ b/cppuhelper/source/gcc3os2.map @@ -157,7 +157,7 @@ _ZN4cppu28createRegistryServiceFactoryERKN3rtl8OUStringES3_hS3_; _ZN4cppu28createSingleComponentFactoryEPFN3com3sun4star3uno9ReferenceINS3_10XInterfaceEEERKNS4_INS3_17XComponentContextEEEERKN3rtl8OUStringERKNS3_8SequenceISE_EEP16_rtl_ModuleCount; _ZN4cppu29WeakComponentImplHelper_queryERKN3com3sun4star3uno4TypeEPNS_10class_dataEPvPNS_27WeakComponentImplHelperBaseE; _ZN4cppu29installTypeDescriptionManagerERKN3com3sun4star3uno9ReferenceINS2_9container23XHierarchicalNameAccessEEE; -_ZN4cppu29loadSharedLibComponentFactoryERKN3rtl8OUStringES3_S3_RKN3com3sun4star3uno9ReferenceINS6_4lang20XMultiServiceFactoryEEERKNS8_INS6_8registry12XRegistryKeyEEE; +_ZN4cppu29loadSharedLibComponentFactoryERKN3rtl8OUStringES3_S3_RKN3com3sun4star3uno9ReferenceINS6_4lang20XMultiServiceFactoryEEERKNS8_INS6_8registry12XRegistryKeyEEES3_; _ZN4cppu30ImplHelper_getImplementationIdEPNS_10class_dataE; _ZN4cppu30WeakAggComponentImplHelperBase14queryInterfaceERKN3com3sun4star3uno4TypeE; _ZN4cppu30WeakAggComponentImplHelperBase16addEventListenerERKN3com3sun4star3uno9ReferenceINS3_4lang14XEventListenerEEE; diff --git a/cppuhelper/source/shlib.cxx b/cppuhelper/source/shlib.cxx index 358aac1..6f83bac 100644 --- a/cppuhelper/source/shlib.cxx +++ b/cppuhelper/source/shlib.cxx @@ -275,13 +275,14 @@ static OUString getLibEnv(OUString const & aModulePath, uno::Environment * pEnv, OUString * pSourceEnv_name, uno::Environment const & cTargetEnv, - OUString const & cImplName = OUString()) + OUString const & cImplName = OUString(), + OUString const & rPrefix = OUString()) { OUString aExcMsg; sal_Char const * pEnvTypeName = NULL; - OUString aGetEnvNameExt = OUSTR(COMPONENT_GETENVEXT); + OUString aGetEnvNameExt = rPrefix + OUSTR(COMPONENT_GETENVEXT); component_getImplementationEnvironmentExtFunc pGetImplEnvExt = (component_getImplementationEnvironmentExtFunc)osl_getFunctionSymbol(lib, aGetEnvNameExt.pData); @@ -292,7 +293,7 @@ static OUString getLibEnv(OUString const & aModulePath, } else { - OUString aGetEnvName = OUSTR(COMPONENT_GETENV); + OUString aGetEnvName = rPrefix + OUSTR(COMPONENT_GETENV); component_getImplementationEnvironmentFunc pGetImplEnv = (component_getImplementationEnvironmentFunc)osl_getFunctionSymbol( lib, aGetEnvName.pData ); @@ -348,7 +349,8 @@ Reference< XInterface > SAL_CALL loadSharedLibComponentFactory( OUString const & rLibName, OUString const & rPath, OUString const & rImplName, Reference< lang::XMultiServiceFactory > const & xMgr, - Reference< registry::XRegistryKey > const & xKey ) + Reference< registry::XRegistryKey > const & xKey, + OUString const & rPrefix ) SAL_THROW( (loader::CannotActivateFactoryException) ) { OUString aModulePath( makeComponentPath( rLibName, rPath ) ); @@ -376,10 +378,10 @@ Reference< XInterface > SAL_CALL loadSharedLibComponentFactory( OUString aEnvTypeName; - OUString aExcMsg = getLibEnv(aModulePath, lib, &env, &aEnvTypeName, currentEnv, rImplName); + OUString aExcMsg = getLibEnv(aModulePath, lib, &env, &aEnvTypeName, currentEnv, rImplName, rPrefix); if (!aExcMsg.getLength()) { - OUString aGetFactoryName = OUSTR(COMPONENT_GETFACTORY); + OUString aGetFactoryName = rPrefix + OUSTR(COMPONENT_GETFACTORY); oslGenericFunction pSym = osl_getFunctionSymbol( lib, aGetFactoryName.pData ); if (pSym != 0) { -- 1.7.1
_______________________________________________ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice