diff options
author | Matúš Kukan <matus.kukan@gmail.com> | 2011-07-21 13:28:01 +0200 |
---|---|---|
committer | Matúš Kukan <matus.kukan@gmail.com> | 2011-07-21 13:28:54 +0200 |
commit | c302693bb67d7064f9c472a53a34b0f6219e119f (patch) | |
tree | dd6b8597d1d25638095fa5e46ebb71bd9f6efcfa /extensions/source | |
parent | f8c503e629c2ba59335f7a23737ae6b6246d85d5 (diff) |
Do not use macros from comphelper's componentmodule.hxx
Diffstat (limited to 'extensions/source')
-rw-r--r-- | extensions/source/logging/log_module.cxx | 19 | ||||
-rw-r--r-- | extensions/source/logging/log_module.hxx | 50 | ||||
-rw-r--r-- | extensions/source/logging/log_services.cxx | 7 | ||||
-rw-r--r-- | extensions/source/oooimprovecore/core.cxx | 1 | ||||
-rw-r--r-- | extensions/source/oooimprovecore/oooimprovecore_module.cxx | 19 | ||||
-rw-r--r-- | extensions/source/oooimprovecore/oooimprovecore_module.hxx | 51 | ||||
-rw-r--r-- | extensions/source/oooimprovecore/oooimprovecore_services.cxx | 7 |
7 files changed, 147 insertions, 7 deletions
diff --git a/extensions/source/logging/log_module.cxx b/extensions/source/logging/log_module.cxx index 5cdf5e737..8fbdb094a 100644 --- a/extensions/source/logging/log_module.cxx +++ b/extensions/source/logging/log_module.cxx @@ -36,7 +36,24 @@ namespace logging { //........................................................................ - IMPLEMENT_COMPONENT_MODULE( LogModule ); + struct LogModuleCreator + { + LogModule m_aLogModule; + }; + namespace + { + class theLogModuleInstance : public rtl::Static<LogModuleCreator, theLogModuleInstance> {}; + } + + LogModule::LogModule() + :BaseClass() + { + } + + LogModule& LogModule::getInstance() + { + return theLogModuleInstance::get().m_aLogModule; + } //........................................................................ } // namespace logging diff --git a/extensions/source/logging/log_module.hxx b/extensions/source/logging/log_module.hxx index dbc06816c..7f825dabf 100644 --- a/extensions/source/logging/log_module.hxx +++ b/extensions/source/logging/log_module.hxx @@ -36,7 +36,55 @@ namespace logging { //........................................................................ - DECLARE_COMPONENT_MODULE( LogModule, LogModuleClient ) + class LogModule : public ::comphelper::OModule + { + friend struct LogModuleCreator; + typedef ::comphelper::OModule BaseClass; + + public: + static LogModule& getInstance(); + + private: + LogModule(); + }; + + /* -------------------------------------------------------------------- */ + class LogModuleClient : public ::comphelper::OModuleClient + { + private: + typedef ::comphelper::OModuleClient BaseClass; + + public: + LogModuleClient() : BaseClass( LogModule::getInstance() ) + { + } + }; + + /* -------------------------------------------------------------------- */ + template < class TYPE > + class OAutoRegistration : public ::comphelper::OAutoRegistration< TYPE > + { + private: + typedef ::comphelper::OAutoRegistration< TYPE > BaseClass; + + public: + OAutoRegistration() : BaseClass( LogModule::getInstance() ) + { + } + }; + + /* -------------------------------------------------------------------- */ + template < class TYPE > + class OSingletonRegistration : public ::comphelper::OSingletonRegistration< TYPE > + { + private: + typedef ::comphelper::OSingletonRegistration< TYPE > BaseClass; + + public: + OSingletonRegistration() : BaseClass( LogModule::getInstance() ) + { + } + }; //........................................................................ } // namespace logging diff --git a/extensions/source/logging/log_services.cxx b/extensions/source/logging/log_services.cxx index 224febd0d..f568f634b 100644 --- a/extensions/source/logging/log_services.cxx +++ b/extensions/source/logging/log_services.cxx @@ -59,6 +59,11 @@ namespace logging } // namespace logging //........................................................................ -IMPLEMENT_COMPONENT_LIBRARY_API( ::logging::LogModule, ::logging::initializeModule ) +extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( + const sal_Char* pImplementationName, void* pServiceManager, void* pRegistryKey ) +{ + ::logging::initializeModule(); + return ::logging::LogModule::getInstance().getComponentFactory( pImplementationName, pServiceManager, pRegistryKey ); +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/source/oooimprovecore/core.cxx b/extensions/source/oooimprovecore/core.cxx index ac8363b56..1836e4dc2 100644 --- a/extensions/source/oooimprovecore/core.cxx +++ b/extensions/source/oooimprovecore/core.cxx @@ -36,7 +36,6 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/oooimprovement/XCoreController.hpp> #include <com/sun/star/uno/XComponentContext.hpp> -#include <comphelper/componentmodule.hxx> #include <comphelper/configurationhelper.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/uieventslogger.hxx> diff --git a/extensions/source/oooimprovecore/oooimprovecore_module.cxx b/extensions/source/oooimprovecore/oooimprovecore_module.cxx index c686bee94..6457da10d 100644 --- a/extensions/source/oooimprovecore/oooimprovecore_module.cxx +++ b/extensions/source/oooimprovecore/oooimprovecore_module.cxx @@ -33,7 +33,24 @@ namespace oooimprovecore { - IMPLEMENT_COMPONENT_MODULE( OooimprovecoreModule ); + struct OooimprovecoreModuleCreator + { + OooimprovecoreModule m_aOooimprovecoreModule; + }; + namespace + { + class theOooimprovecoreModuleInstance : public rtl::Static<OooimprovecoreModuleCreator, theOooimprovecoreModuleInstance> {}; + } + + OooimprovecoreModule::OooimprovecoreModule() + :BaseClass() + { + } + + OooimprovecoreModule& OooimprovecoreModule::getInstance() + { + return theOooimprovecoreModuleInstance::get().m_aOooimprovecoreModule; + } } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/source/oooimprovecore/oooimprovecore_module.hxx b/extensions/source/oooimprovecore/oooimprovecore_module.hxx index 3cf4d7155..aeb1ff0ed 100644 --- a/extensions/source/oooimprovecore/oooimprovecore_module.hxx +++ b/extensions/source/oooimprovecore/oooimprovecore_module.hxx @@ -33,7 +33,56 @@ namespace oooimprovecore { - DECLARE_COMPONENT_MODULE( OooimprovecoreModule, OooimprovecoreModuleClient ) + /* -------------------------------------------------------------------- */ + class OooimprovecoreModule : public ::comphelper::OModule + { + friend struct OooimprovecoreModuleCreator; + typedef ::comphelper::OModule BaseClass; + + public: + static OooimprovecoreModule& getInstance(); + + private: + OooimprovecoreModule(); + }; + + /* -------------------------------------------------------------------- */ + class OooimprovecoreModuleClient : public ::comphelper::OModuleClient + { + private: + typedef ::comphelper::OModuleClient BaseClass; + + public: + OooimprovecoreModuleClient() : BaseClass( OooimprovecoreModule::getInstance() ) + { + } + }; + + /* -------------------------------------------------------------------- */ + template < class TYPE > + class OAutoRegistration : public ::comphelper::OAutoRegistration< TYPE > + { + private: + typedef ::comphelper::OAutoRegistration< TYPE > BaseClass; + + public: + OAutoRegistration() : BaseClass( OooimprovecoreModule::getInstance() ) + { + } + }; + + /* -------------------------------------------------------------------- */ + template < class TYPE > + class OSingletonRegistration : public ::comphelper::OSingletonRegistration< TYPE > + { + private: + typedef ::comphelper::OSingletonRegistration< TYPE > BaseClass; + + public: + OSingletonRegistration() : BaseClass( OooimprovecoreModule::getInstance() ) + { + } + }; } #endif diff --git a/extensions/source/oooimprovecore/oooimprovecore_services.cxx b/extensions/source/oooimprovecore/oooimprovecore_services.cxx index dbfdd4ea9..d0800869f 100644 --- a/extensions/source/oooimprovecore/oooimprovecore_services.cxx +++ b/extensions/source/oooimprovecore/oooimprovecore_services.cxx @@ -43,6 +43,11 @@ namespace oooimprovecore } -IMPLEMENT_COMPONENT_LIBRARY_API( ::oooimprovecore::OooimprovecoreModule, ::oooimprovecore::initializeModule) +extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( + const sal_Char* pImplementationName, void* pServiceManager, void* pRegistryKey ) +{ + ::oooimprovecore::initializeModule(); + return ::oooimprovecore::OooimprovecoreModule::getInstance().getComponentFactory( pImplementationName, pServiceManager, pRegistryKey ); +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |