Kaydet (Commit) 138b9c36 authored tarafından Michael Meeks's avatar Michael Meeks

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.
üst ff3904f6
......@@ -144,3 +144,4 @@ mkdir: %_DEST%\xml%_EXT%\registry\spool\org\openoffice\Office\Jobs
..\%__SRC%\misc\productregistration.jar.component %_DEST%\xml%_EXT%\productregistration.jar.component
..\%__SRC%\misc\socomp.component %_DEST%\xml%_EXT%\socomp.component
..\%__SRC%\misc\spl.component %_DEST%\xml%_EXT%\spl.component
..\%__SRC%\misc\splash.component %_DEST%\xml%_EXT%\splash.component
......@@ -48,7 +48,7 @@ static struct {
unsigned int bInhibitSplash : 1;
unsigned int bInhibitPagein : 1;
unsigned int bInhibitJavaLdx : 1;
const char *pagein_type;
const char *pPageinType;
} pArgDescr[] = {
/* have a trailing argument */
{ "pt", 1, 0, 0, 0, NULL },
......@@ -73,14 +73,16 @@ static struct {
{ "?", 0, 1, 1, 1, NULL },
};
Args *parse_args (void)
Args *args_parse (void)
{
Args *args;
sal_uInt32 nArgs, i, j;
sal_Bool skipNextArg;
nArgs = osl_getCommandArgCount();
args = malloc (sizeof (Args) + sizeof (rtl_uString *) * nArgs);
i = sizeof (Args) + sizeof (rtl_uString *) * nArgs;
args = malloc (i);
memset (args, 0, i);
args->nArgsTotal = nArgs;
/* sort the -env: args to the front */
......@@ -130,8 +132,8 @@ Args *parse_args (void)
args->bInhibitSplash |= pArgDescr[j].bInhibitSplash;
args->bInhibitPagein |= pArgDescr[j].bInhibitPagein;
args->bInhibitJavaLdx |= pArgDescr[j].bInhibitJavaLdx;
if (pArgDescr[j].pagein_type)
args->pagein_type = pArgDescr[j].pagein_type;
if (pArgDescr[j].pPageinType)
args->pPageinType = pArgDescr[j].pPageinType;
skipNextArg = pArgDescr[j].bTwoArgs;
}
......@@ -141,4 +143,12 @@ Args *parse_args (void)
return args;
}
void
args_free (Args *args)
{
/* FIXME: free ppArgs */
rtl_uString_release( args->pAppPath );
free (args);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -33,7 +33,8 @@
#include <rtl/ustring.h>
typedef struct {
const char *pagein_type; // @pagein-writer for - writer etc. else NULL
rtl_uString *pAppPath;
const char *pPageinType; // @pagein-writer for - writer etc. else NULL
sal_Bool bInhibitSplash; // should we show a splash screen
sal_Bool bInhibitPagein; // should we run pagein ?
sal_Bool bInhibitJavaLdx; // should we run javaldx ?
......@@ -43,6 +44,7 @@ typedef struct {
rtl_uString *ppArgs[1]; // sorted argument array
} Args;
Args *parse_args (void);
Args *args_parse (void);
void args_free (Args *args);
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -32,7 +32,7 @@ NO_DEFAULT_STL=TRUE
.INCLUDE : settings.mk
.IF "$(ENABLE_QUICKSTART_LIBPNG)"!="TRUE"
.IF "$(ENABLE_QUICKSTART_LIBPNG)"=="TRUE"
CFLAGS+=-DENABLE_QUICKSTART_LIBPNG
.ENDIF
......@@ -53,7 +53,7 @@ APP1RPATH = BRAND
APP1OBJS = $(OBJFILES) $(PAGEIN_OBJS)
APP1LIBSALCPPRT=
APP1CODETYPE = C
APP1STDLIBS = $(STDLIBGUIMT) $(SALLIB) $(LIBPNG_LIBS)
APP1STDLIBS = $(PTHREAD_LIBS) $(X11LINK_DYNAMIC) $(SALLIB) $(LIBPNG_LIBS)
.IF "$(OS)"=="SOLARIS"
APP1STDLIBS+= -lsocket
.ENDIF
......
......@@ -629,13 +629,16 @@ void splash_close_window()
int splash_load_bmp( const char *filename )
{
(void)filename;
return 1;
}
void splash_setup( int barc[3], int framec[3], int posx, int posy, int w, int h )
{
(void)barc; (void)framec; (void)posx; (void)posy; (void)w; (void)h;
}
int splash_create_window( int argc, char** argv )
{
(void)argc; (void)argv;
return 1;
}
void splash_close_window()
......@@ -643,6 +646,7 @@ void splash_close_window()
}
void splash_draw_progress( int progress )
{
(void)progress;
}
#endif // ENABLE_QUICKSTART_LIBPNG
......
This diff is collapsed.
......@@ -3,7 +3,6 @@ UDK_3_0_0 {
GetVersionInfo;
component_getImplementationEnvironment;
component_getFactory;
component_writeInfo;
local:
*;
......
......@@ -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
/* -*- 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: */
......@@ -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: */
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment