summaryrefslogtreecommitdiff
path: root/desktop/unx/splash
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@novell.com>2011-03-21 17:42:51 +0000
committerMichael Meeks <michael.meeks@novell.com>2011-03-21 21:18:41 +0000
commit138b9c36f7148680dd46fe71ec1aeb6b9013bb27 (patch)
tree09f43e02e05c0ecb0c28f297241c9b2ac335f29f /desktop/unx/splash
parentff3904f63805811a0b48aa1b1e767ed777d8bdd2 (diff)
misc fixes, and un-conditionally enable the splash reporting component
Lots of re-work here; un-conditionally use the splash component to do more intelligent fast starting. Throw up the splash screen before we start doing 'pagein' work (to get better progress / launch feedback), and hide javaldx too.
Diffstat (limited to 'desktop/unx/splash')
-rwxr-xr-xdesktop/unx/splash/exports.map1
-rwxr-xr-xdesktop/unx/splash/makefile.mk20
-rwxr-xr-xdesktop/unx/splash/services_unxsplash.cxx160
-rwxr-xr-xdesktop/unx/splash/unxsplash.cxx68
-rwxr-xr-xdesktop/unx/splash/unxsplash.hxx12
5 files changed, 62 insertions, 199 deletions
diff --git a/desktop/unx/splash/exports.map b/desktop/unx/splash/exports.map
index ba501f9ae076..218f0536d7e2 100755
--- a/desktop/unx/splash/exports.map
+++ b/desktop/unx/splash/exports.map
@@ -3,7 +3,6 @@ UDK_3_0_0 {
GetVersionInfo;
component_getImplementationEnvironment;
component_getFactory;
- component_writeInfo;
local:
*;
diff --git a/desktop/unx/splash/makefile.mk b/desktop/unx/splash/makefile.mk
index d182173de1ff..23a9d98ae5bb 100755
--- a/desktop/unx/splash/makefile.mk
+++ b/desktop/unx/splash/makefile.mk
@@ -36,17 +36,9 @@ ENABLE_EXCEPTIONS=TRUE
.INCLUDE : settings.mk
-.IF "$(ENABLE_UNIX_QUICKSTARTER)"!="TRUE"
-
-dummy:
- @echo "Unix quickstarter disabled"
-
-.ELSE
-
# --- Files --------------------------------------------------------
-SLOFILES = $(SLO)$/unxsplash.obj \
- $(SLO)$/services_unxsplash.obj
+SLOFILES = $(SLO)$/unxsplash.obj
SHL1DEPN= makefile.mk
SHL1OBJS= $(SLOFILES)
@@ -64,8 +56,14 @@ SHL1STDLIBS= \
$(CPPULIB) \
$(SALLIB)
-.ENDIF # ENABLE_UNIX_QUICKSTARTER
-
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/splash.component
+
+$(MISC)/splash.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ splash.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt splash.component
diff --git a/desktop/unx/splash/services_unxsplash.cxx b/desktop/unx/splash/services_unxsplash.cxx
deleted file mode 100755
index d370b452b4f3..000000000000
--- a/desktop/unx/splash/services_unxsplash.cxx
+++ /dev/null
@@ -1,160 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * Copyright 2010, Novell Inc.
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- * Contributor(s): Jan Holesovsky <kendy@novell.com>
- *
- ************************************************************************/
-#include <com/sun/star/beans/NamedValue.hpp>
-#include <com/sun/star/registry/XRegistryKey.hpp>
-#include <com/sun/star/util/Date.hpp>
-#include <uno/environment.h>
-#include <cppuhelper/factory.hxx>
-#include <unotools/configmgr.hxx>
-
-#include <string.h>
-
-#include "unxsplash.hxx"
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::registry;
-using namespace ::desktop;
-
-using ::rtl::OUString;
-
-static const char* pServices[] =
-{
- UnxSplashScreen::serviceName,
- NULL
-};
-
-static const char* pImplementations[] =
-{
- UnxSplashScreen::implementationName,
- NULL
-};
-
-typedef Reference<XInterface>(* fProvider)( const Reference<XMultiServiceFactory>& );
-
-static const fProvider pInstanceProviders[] =
-{
- UnxSplashScreen::getInstance,
- NULL
-};
-
-
-static const char** pSupportedServices[] =
-{
- UnxSplashScreen::interfaces,
- NULL
-};
-
-static Sequence<OUString>
-getSupportedServiceNames( int p ) {
- const char **names = pSupportedServices[p];
- Sequence<OUString> aSeq;
- for ( int i = 0; names[i] != NULL; i++ )
- {
- aSeq.realloc( i+1 );
- aSeq[i] = OUString::createFromAscii( names[i] );
- }
- return aSeq;
-}
-
-extern "C"
-{
-void SAL_CALL
-component_getImplementationEnvironment(
- const sal_Char** ppEnvironmentTypeName,
- uno_Environment** /*ppEnvironment*/ )
-{
- *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ;
-}
-
-sal_Bool SAL_CALL
-component_writeInfo(
- void* pServiceManager,
- void* pRegistryKey )
-{
- Reference<XMultiServiceFactory> xMan(
- reinterpret_cast< XMultiServiceFactory* >( pServiceManager ) ) ;
- Reference<XRegistryKey> xKey(
- reinterpret_cast< XRegistryKey* >( pRegistryKey ) ) ;
-
- // iterate over service names and register them...
- OUString aImpl;
- const char* pServiceName = NULL;
- const char* pImplName = NULL;
- for ( int i = 0; ( pServices[i] != NULL ) && ( pImplementations[i] != NULL ); i++ )
- {
- pServiceName= pServices[i];
- pImplName = pImplementations[i];
- aImpl = OUString(RTL_CONSTASCII_USTRINGPARAM( "/" ))
- + OUString::createFromAscii( pImplName )
- + OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES" ));
- Reference<XRegistryKey> xNewKey = xKey->createKey( aImpl );
- xNewKey->createKey( OUString::createFromAscii( pServiceName ) );
- }
- return sal_True;
-}
-
-void* SAL_CALL
-component_getFactory(
- const sal_Char* pImplementationName,
- void* pServiceManager,
- void* /*pRegistryKey*/ )
-{
- // Set default return value for this operation - if it failed.
- if ( pImplementationName && pServiceManager )
- {
- Reference< XSingleServiceFactory > xFactory;
- Reference< XMultiServiceFactory > xServiceManager(
- reinterpret_cast< XMultiServiceFactory* >( pServiceManager ) ) ;
-
- // search implementation
- for ( int i = 0; ( pImplementations[i] != NULL ); i++ )
- {
- if ( strcmp( pImplementations[i], pImplementationName ) == 0 )
- {
- // found implementation
- xFactory = Reference<XSingleServiceFactory>( cppu::createSingleFactory(
- xServiceManager, OUString::createFromAscii( pImplementationName ),
- pInstanceProviders[i], getSupportedServiceNames( i ) ) );
- if ( xFactory.is() )
- {
- // Factory is valid - service was found.
- xFactory->acquire();
- return xFactory.get();
- }
- }
- }
- }
-
- return NULL;
-}
-} // extern "C"
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/unx/splash/unxsplash.cxx b/desktop/unx/splash/unxsplash.cxx
index f51e22a7c13a..de703ba5c3de 100755
--- a/desktop/unx/splash/unxsplash.cxx
+++ b/desktop/unx/splash/unxsplash.cxx
@@ -34,6 +34,7 @@
#include <tools/stream.hxx>
#include <sfx2/sfx.hrc>
#include <com/sun/star/registry/XRegistryKey.hpp>
+#include <cppuhelper/implementationentry.hxx>
#include <rtl/logfile.hxx>
#include <rtl/ustrbuf.hxx>
#include <rtl/math.hxx>
@@ -41,13 +42,13 @@
#define PIPE_ARG "--splash-pipe="
using namespace ::rtl;
+using namespace ::com::sun::star;
using namespace ::com::sun::star::registry;
namespace desktop
{
-
-UnxSplashScreen::UnxSplashScreen( const Reference< XMultiServiceFactory >& rSMgr )
- : m_rFactory( rSMgr ),
+ UnxSplashScreen::UnxSplashScreen( const Reference< uno::XComponentContext >& xCtx )
+ : m_xCtx( xCtx ),
m_pOutFd( NULL )
{
}
@@ -131,34 +132,65 @@ UnxSplashScreen::initialize( const ::com::sun::star::uno::Sequence< ::com::sun::
}
}
}
+}
+
+using namespace desktop;
// get service instance...
-UnxSplashScreen *UnxSplashScreen::m_pINSTANCE = NULL;
-osl::Mutex UnxSplashScreen::m_aMutex;
+static uno::Reference< uno::XInterface > m_xINSTANCE;
-Reference< XInterface > UnxSplashScreen::getInstance( const Reference< XMultiServiceFactory >& rSMgr )
+uno::Reference< uno::XInterface > SAL_CALL UnxSplash_createInstance(const uno::Reference< uno::XComponentContext > & xCtx ) throw( uno::Exception )
{
- if ( m_pINSTANCE == NULL )
+ static osl::Mutex m_aMutex;
+ if ( !m_xINSTANCE.is() )
{
osl::MutexGuard guard( m_aMutex );
- if ( m_pINSTANCE == NULL )
- return (XComponent*) new UnxSplashScreen( rSMgr );
+ if ( !m_xINSTANCE.is() )
+ m_xINSTANCE = (cppu::OWeakObject*) new UnxSplashScreen( xCtx );
}
- return (XComponent*)NULL;
+ return m_xINSTANCE;
+}
+
+OUString UnxSplash_getImplementationName()
+{
+ return OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.office.comp.PipeSplashScreen" ) );
+}
+
+uno::Sequence< OUString > SAL_CALL UnxSplash_getSupportedServiceNames() throw()
+{
+ const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.office.PipeSplashScreen" ) );
+ const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
+ return aSeq;
}
-// static service info...
-const char* UnxSplashScreen::interfaces[] =
+::cppu::ImplementationEntry aEntries[] =
{
- "com.sun.star.task.XStartusIndicator",
- "com.sun.star.lang.XInitialization",
- NULL,
+ {
+ UnxSplash_createInstance, UnxSplash_getImplementationName,
+ UnxSplash_getSupportedServiceNames,
+ ::cppu::createSingleComponentFactory,
+ 0, 0
+ },
+ { 0, 0, 0, 0, 0, 0 }
};
-const sal_Char *UnxSplashScreen::serviceName = "com.sun.star.office.PipeSplashScreen";
-const sal_Char *UnxSplashScreen::implementationName = "com.sun.star.office.comp.PipeSplashScreen";
-const sal_Char *UnxSplashScreen::supportedServiceNames[] = { "com.sun.star.office.PipeSplashScreen", NULL };
+extern "C"
+{
+
+SAL_DLLPUBLIC_EXPORT void SAL_CALL
+component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName,
+ uno_Environment ** )
+{ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; }
+
+SAL_DLLPUBLIC_EXPORT void* SAL_CALL
+component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* pRegistryKey )
+{
+ return ::cppu::component_getFactoryHelper( pImplName, pServiceManager,
+ pRegistryKey, aEntries );
}
+} // extern "C"
+
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/unx/splash/unxsplash.hxx b/desktop/unx/splash/unxsplash.hxx
index abe5a8cac2bd..b25e858d9bac 100755
--- a/desktop/unx/splash/unxsplash.hxx
+++ b/desktop/unx/splash/unxsplash.hxx
@@ -31,6 +31,7 @@
#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/task/XStatusIndicator.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <cppuhelper/implbase2.hxx>
@@ -54,24 +55,17 @@ private:
UnxSplashScreen( void );
UnxSplashScreen operator =( const UnxSplashScreen& );
- UnxSplashScreen( const Reference< XMultiServiceFactory >& xFactory );
-
virtual ~UnxSplashScreen();
static UnxSplashScreen *m_pINSTANCE;
static osl::Mutex m_aMutex;
- Reference< XMultiServiceFactory > m_rFactory;
+ Reference< XComponentContext > m_xCtx;
FILE *m_pOutFd;
public:
- static const char* interfaces[];
- static const sal_Char *serviceName;
- static const sal_Char *implementationName;
- static const sal_Char *supportedServiceNames[];
-
- static Reference< XInterface > getInstance( const Reference < XMultiServiceFactory >& xFactory );
+ UnxSplashScreen( const Reference< XComponentContext >& xCtx );
// XStatusIndicator
virtual void SAL_CALL start( const OUString& aText, sal_Int32 nRange ) throw ( RuntimeException );