xref: /AOO41X/main/desktop/source/splash/splash.cxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_desktop.hxx"
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include <introbmpnames.hxx>
32*cdf0e10cSrcweir #include "splash.hxx"
33*cdf0e10cSrcweir #include <stdio.h>
34*cdf0e10cSrcweir #include <unotools/bootstrap.hxx>
35*cdf0e10cSrcweir #include <vos/process.hxx>
36*cdf0e10cSrcweir #include <tools/urlobj.hxx>
37*cdf0e10cSrcweir #include <tools/stream.hxx>
38*cdf0e10cSrcweir #include <sfx2/sfx.hrc>
39*cdf0e10cSrcweir #include <vcl/svapp.hxx>
40*cdf0e10cSrcweir #include <vcl/salnativewidgets.hxx>
41*cdf0e10cSrcweir 
42*cdf0e10cSrcweir #include <com/sun/star/registry/XRegistryKey.hpp>
43*cdf0e10cSrcweir #include <rtl/bootstrap.hxx>
44*cdf0e10cSrcweir #include <rtl/logfile.hxx>
45*cdf0e10cSrcweir #include <rtl/ustrbuf.hxx>
46*cdf0e10cSrcweir #include <rtl/math.hxx>
47*cdf0e10cSrcweir #include <vcl/graph.hxx>
48*cdf0e10cSrcweir #include <svtools/filter.hxx>
49*cdf0e10cSrcweir 
50*cdf0e10cSrcweir #define NOT_LOADED  ((long)-1)
51*cdf0e10cSrcweir 
52*cdf0e10cSrcweir using namespace ::rtl;
53*cdf0e10cSrcweir using namespace ::com::sun::star::registry;
54*cdf0e10cSrcweir 
55*cdf0e10cSrcweir namespace desktop
56*cdf0e10cSrcweir {
57*cdf0e10cSrcweir 
58*cdf0e10cSrcweir SplashScreen::SplashScreen(const Reference< XMultiServiceFactory >& rSMgr)
59*cdf0e10cSrcweir     : IntroWindow()
60*cdf0e10cSrcweir     , _vdev(*((IntroWindow*)this))
61*cdf0e10cSrcweir     , _cProgressFrameColor(sal::static_int_cast< ColorData >(NOT_LOADED))
62*cdf0e10cSrcweir     , _cProgressBarColor(sal::static_int_cast< ColorData >(NOT_LOADED))
63*cdf0e10cSrcweir     , _bNativeProgress(true)
64*cdf0e10cSrcweir 	, _iMax(100)
65*cdf0e10cSrcweir 	, _iProgress(0)
66*cdf0e10cSrcweir     , _eBitmapMode(BM_DEFAULTMODE)
67*cdf0e10cSrcweir 	, _bPaintBitmap(sal_True)
68*cdf0e10cSrcweir 	, _bPaintProgress(sal_False)
69*cdf0e10cSrcweir     , _bShowLogo(sal_True)
70*cdf0e10cSrcweir     , _bFullScreenSplash(sal_False)
71*cdf0e10cSrcweir     , _bProgressEnd(sal_False)
72*cdf0e10cSrcweir     , _tlx(NOT_LOADED)
73*cdf0e10cSrcweir     , _tly(NOT_LOADED)
74*cdf0e10cSrcweir     , _barwidth(NOT_LOADED)
75*cdf0e10cSrcweir     , _barheight(NOT_LOADED)
76*cdf0e10cSrcweir     , _barspace(2)
77*cdf0e10cSrcweir     , _fXPos(-1.0)
78*cdf0e10cSrcweir     , _fYPos(-1.0)
79*cdf0e10cSrcweir     , _fWidth(-1.0)
80*cdf0e10cSrcweir     , _fHeight(-1.0)
81*cdf0e10cSrcweir     , _xoffset(12)
82*cdf0e10cSrcweir 	, _yoffset(18)
83*cdf0e10cSrcweir {
84*cdf0e10cSrcweir 	_rFactory = rSMgr;
85*cdf0e10cSrcweir 
86*cdf0e10cSrcweir     loadConfig();
87*cdf0e10cSrcweir }
88*cdf0e10cSrcweir 
89*cdf0e10cSrcweir SplashScreen::~SplashScreen()
90*cdf0e10cSrcweir {
91*cdf0e10cSrcweir 	Application::RemoveEventListener(
92*cdf0e10cSrcweir 		LINK( this, SplashScreen, AppEventListenerHdl ) );
93*cdf0e10cSrcweir 	Hide();
94*cdf0e10cSrcweir 
95*cdf0e10cSrcweir }
96*cdf0e10cSrcweir 
97*cdf0e10cSrcweir void SAL_CALL SplashScreen::start(const OUString&, sal_Int32 nRange)
98*cdf0e10cSrcweir 	throw (RuntimeException)
99*cdf0e10cSrcweir {
100*cdf0e10cSrcweir     _iMax = nRange;
101*cdf0e10cSrcweir     if (_bVisible) {
102*cdf0e10cSrcweir         _bProgressEnd = sal_False;
103*cdf0e10cSrcweir         ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
104*cdf0e10cSrcweir         if ( _eBitmapMode == BM_FULLSCREEN )
105*cdf0e10cSrcweir             ShowFullScreenMode( sal_True );
106*cdf0e10cSrcweir         Show();
107*cdf0e10cSrcweir         Paint(Rectangle());
108*cdf0e10cSrcweir         Flush();
109*cdf0e10cSrcweir     }
110*cdf0e10cSrcweir }
111*cdf0e10cSrcweir 
112*cdf0e10cSrcweir void SAL_CALL SplashScreen::end()
113*cdf0e10cSrcweir 	throw (RuntimeException)
114*cdf0e10cSrcweir {
115*cdf0e10cSrcweir     _iProgress = _iMax;
116*cdf0e10cSrcweir     if (_bVisible )
117*cdf0e10cSrcweir     {
118*cdf0e10cSrcweir         if ( _eBitmapMode == BM_FULLSCREEN )
119*cdf0e10cSrcweir             EndFullScreenMode();
120*cdf0e10cSrcweir         Hide();
121*cdf0e10cSrcweir     }
122*cdf0e10cSrcweir     _bProgressEnd = sal_True;
123*cdf0e10cSrcweir }
124*cdf0e10cSrcweir 
125*cdf0e10cSrcweir void SAL_CALL SplashScreen::reset()
126*cdf0e10cSrcweir 	throw (RuntimeException)
127*cdf0e10cSrcweir {
128*cdf0e10cSrcweir     _iProgress = 0;
129*cdf0e10cSrcweir     if (_bVisible && !_bProgressEnd )
130*cdf0e10cSrcweir     {
131*cdf0e10cSrcweir         if ( _eBitmapMode == BM_FULLSCREEN )
132*cdf0e10cSrcweir             ShowFullScreenMode( sal_True );
133*cdf0e10cSrcweir         Show();
134*cdf0e10cSrcweir         updateStatus();
135*cdf0e10cSrcweir     }
136*cdf0e10cSrcweir }
137*cdf0e10cSrcweir 
138*cdf0e10cSrcweir void SAL_CALL SplashScreen::setText(const OUString& rText)
139*cdf0e10cSrcweir 	throw (RuntimeException)
140*cdf0e10cSrcweir {
141*cdf0e10cSrcweir     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
142*cdf0e10cSrcweir     if ( _sProgressText != rText )
143*cdf0e10cSrcweir     {
144*cdf0e10cSrcweir         _sProgressText = rText;
145*cdf0e10cSrcweir 
146*cdf0e10cSrcweir         if (_bVisible && !_bProgressEnd)
147*cdf0e10cSrcweir         {
148*cdf0e10cSrcweir             if ( _eBitmapMode == BM_FULLSCREEN )
149*cdf0e10cSrcweir                 ShowFullScreenMode( sal_True );
150*cdf0e10cSrcweir             Show();
151*cdf0e10cSrcweir             updateStatus();
152*cdf0e10cSrcweir         }
153*cdf0e10cSrcweir     }
154*cdf0e10cSrcweir }
155*cdf0e10cSrcweir 
156*cdf0e10cSrcweir void SAL_CALL SplashScreen::setValue(sal_Int32 nValue)
157*cdf0e10cSrcweir 	throw (RuntimeException)
158*cdf0e10cSrcweir {
159*cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT( aLog, "::SplashScreen::setValue (lo119109)" );
160*cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_TRACE1( aLog, "value=%d", nValue );
161*cdf0e10cSrcweir 
162*cdf0e10cSrcweir     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
163*cdf0e10cSrcweir     if (_bVisible && !_bProgressEnd) {
164*cdf0e10cSrcweir         if ( _eBitmapMode == BM_FULLSCREEN )
165*cdf0e10cSrcweir             ShowFullScreenMode( sal_True );
166*cdf0e10cSrcweir         Show();
167*cdf0e10cSrcweir         if (nValue >= _iMax) _iProgress = _iMax;
168*cdf0e10cSrcweir 	else _iProgress = nValue;
169*cdf0e10cSrcweir 	updateStatus();
170*cdf0e10cSrcweir     }
171*cdf0e10cSrcweir }
172*cdf0e10cSrcweir 
173*cdf0e10cSrcweir // XInitialize
174*cdf0e10cSrcweir void SAL_CALL
175*cdf0e10cSrcweir SplashScreen::initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any>& aArguments )
176*cdf0e10cSrcweir 	throw (RuntimeException)
177*cdf0e10cSrcweir {
178*cdf0e10cSrcweir 	::osl::ClearableMutexGuard	aGuard(	_aMutex );
179*cdf0e10cSrcweir 	if (aArguments.getLength() > 0)
180*cdf0e10cSrcweir     {
181*cdf0e10cSrcweir         aArguments[0] >>= _bVisible;
182*cdf0e10cSrcweir         if (aArguments.getLength() > 1 )
183*cdf0e10cSrcweir             aArguments[1] >>= _sAppName;
184*cdf0e10cSrcweir 
185*cdf0e10cSrcweir         // start to determine bitmap and all other required value
186*cdf0e10cSrcweir         initBitmap();
187*cdf0e10cSrcweir 	    Size aSize = _aIntroBmp.GetSizePixel();
188*cdf0e10cSrcweir 	    SetOutputSizePixel( aSize );
189*cdf0e10cSrcweir         _vdev.SetOutputSizePixel( aSize );
190*cdf0e10cSrcweir 	    _height = aSize.Height();
191*cdf0e10cSrcweir 	    _width = aSize.Width();
192*cdf0e10cSrcweir         if (_width > 500)
193*cdf0e10cSrcweir         {
194*cdf0e10cSrcweir             Point xtopleft(212,216);
195*cdf0e10cSrcweir             if ( NOT_LOADED == _tlx || NOT_LOADED == _tly )
196*cdf0e10cSrcweir             {
197*cdf0e10cSrcweir                 _tlx = xtopleft.X();    // top-left x
198*cdf0e10cSrcweir                 _tly = xtopleft.Y();    // top-left y
199*cdf0e10cSrcweir             }
200*cdf0e10cSrcweir             if ( NOT_LOADED == _barwidth )
201*cdf0e10cSrcweir                 _barwidth = 263;
202*cdf0e10cSrcweir             if ( NOT_LOADED == _barheight )
203*cdf0e10cSrcweir                 _barheight = 8;
204*cdf0e10cSrcweir             if (( _eBitmapMode == BM_FULLSCREEN ) &&
205*cdf0e10cSrcweir                 _bFullScreenSplash )
206*cdf0e10cSrcweir             {
207*cdf0e10cSrcweir                 if( ( _fXPos >= 0.0 ) && ( _fYPos >= 0.0 ))
208*cdf0e10cSrcweir                 {
209*cdf0e10cSrcweir                     _tlx = sal_Int32( double( aSize.Width() ) * _fXPos );
210*cdf0e10cSrcweir                     _tly = sal_Int32( double( aSize.Height() ) * _fYPos );
211*cdf0e10cSrcweir                 }
212*cdf0e10cSrcweir                 if ( _fWidth >= 0.0 )
213*cdf0e10cSrcweir                     _barwidth  = sal_Int32( double( aSize.Width() ) * _fWidth );
214*cdf0e10cSrcweir                 if ( _fHeight >= 0.0 )
215*cdf0e10cSrcweir                     _barheight = sal_Int32( double( aSize.Width() ) * _fHeight );
216*cdf0e10cSrcweir             }
217*cdf0e10cSrcweir         }
218*cdf0e10cSrcweir         else
219*cdf0e10cSrcweir         {
220*cdf0e10cSrcweir             if ( NOT_LOADED == _barwidth )
221*cdf0e10cSrcweir                 _barwidth  = _width - (2 * _xoffset);
222*cdf0e10cSrcweir             if ( NOT_LOADED == _barheight )
223*cdf0e10cSrcweir                 _barheight = 6;
224*cdf0e10cSrcweir             if ( NOT_LOADED == _tlx || NOT_LOADED == _tly )
225*cdf0e10cSrcweir             {
226*cdf0e10cSrcweir                 _tlx = _xoffset;           // top-left x
227*cdf0e10cSrcweir                 _tly = _height - _yoffset; // top-left y
228*cdf0e10cSrcweir             }
229*cdf0e10cSrcweir         }
230*cdf0e10cSrcweir 
231*cdf0e10cSrcweir         if ( sal::static_int_cast< ColorData >(NOT_LOADED) ==
232*cdf0e10cSrcweir              _cProgressFrameColor.GetColor() )
233*cdf0e10cSrcweir             _cProgressFrameColor = Color( COL_LIGHTGRAY );
234*cdf0e10cSrcweir 
235*cdf0e10cSrcweir         if ( sal::static_int_cast< ColorData >(NOT_LOADED) ==
236*cdf0e10cSrcweir              _cProgressBarColor.GetColor() )
237*cdf0e10cSrcweir         {
238*cdf0e10cSrcweir             // progress bar: new color only for big bitmap format
239*cdf0e10cSrcweir             if ( _width > 500 )
240*cdf0e10cSrcweir                 _cProgressBarColor = Color( 157, 202, 18 );
241*cdf0e10cSrcweir             else
242*cdf0e10cSrcweir                 _cProgressBarColor = Color( COL_BLUE );
243*cdf0e10cSrcweir         }
244*cdf0e10cSrcweir 
245*cdf0e10cSrcweir         Application::AddEventListener(
246*cdf0e10cSrcweir 		    LINK( this, SplashScreen, AppEventListenerHdl ) );
247*cdf0e10cSrcweir 
248*cdf0e10cSrcweir         SetBackgroundBitmap( _aIntroBmp );
249*cdf0e10cSrcweir     }
250*cdf0e10cSrcweir }
251*cdf0e10cSrcweir 
252*cdf0e10cSrcweir void SplashScreen::updateStatus()
253*cdf0e10cSrcweir {
254*cdf0e10cSrcweir 	if (!_bVisible || _bProgressEnd) return;
255*cdf0e10cSrcweir 	if (!_bPaintProgress) _bPaintProgress = sal_True;
256*cdf0e10cSrcweir 	//_bPaintBitmap=sal_False;
257*cdf0e10cSrcweir 	Paint(Rectangle());
258*cdf0e10cSrcweir 	//_bPaintBitmap=sal_True;
259*cdf0e10cSrcweir     Flush();
260*cdf0e10cSrcweir }
261*cdf0e10cSrcweir 
262*cdf0e10cSrcweir // internal private methods
263*cdf0e10cSrcweir IMPL_LINK( SplashScreen, AppEventListenerHdl, VclWindowEvent *, inEvent )
264*cdf0e10cSrcweir {
265*cdf0e10cSrcweir 	if ( inEvent != 0 )
266*cdf0e10cSrcweir 	{
267*cdf0e10cSrcweir         // Paint( Rectangle() );
268*cdf0e10cSrcweir 		switch ( inEvent->GetId() )
269*cdf0e10cSrcweir 		{
270*cdf0e10cSrcweir 			case VCLEVENT_WINDOW_SHOW:
271*cdf0e10cSrcweir 				Paint( Rectangle() );
272*cdf0e10cSrcweir 				break;
273*cdf0e10cSrcweir 			default:
274*cdf0e10cSrcweir 				break;
275*cdf0e10cSrcweir 		}
276*cdf0e10cSrcweir 	}
277*cdf0e10cSrcweir 	return 0;
278*cdf0e10cSrcweir }
279*cdf0e10cSrcweir 
280*cdf0e10cSrcweir // Read keys from edition/edition.ini or soffice{.ini|rc}:
281*cdf0e10cSrcweir OUString implReadBootstrapKey( const OUString& _rKey )
282*cdf0e10cSrcweir {
283*cdf0e10cSrcweir     OUString sValue(
284*cdf0e10cSrcweir         rtl::OUString(
285*cdf0e10cSrcweir             RTL_CONSTASCII_USTRINGPARAM(
286*cdf0e10cSrcweir                 "${.override:${BRAND_BASE_DIR}/program/edition/edition.ini:")) +
287*cdf0e10cSrcweir         _rKey + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("}")));
288*cdf0e10cSrcweir     rtl::Bootstrap::expandMacros(sValue);
289*cdf0e10cSrcweir     return sValue;
290*cdf0e10cSrcweir }
291*cdf0e10cSrcweir 
292*cdf0e10cSrcweir void SplashScreen::loadConfig()
293*cdf0e10cSrcweir {
294*cdf0e10cSrcweir     _bShowLogo = !implReadBootstrapKey(
295*cdf0e10cSrcweir         rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Logo"))).
296*cdf0e10cSrcweir         equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("0"));
297*cdf0e10cSrcweir 
298*cdf0e10cSrcweir     OUString sProgressFrameColor = implReadBootstrapKey(
299*cdf0e10cSrcweir         OUString( RTL_CONSTASCII_USTRINGPARAM( "ProgressFrameColor" ) ) );
300*cdf0e10cSrcweir     OUString sProgressBarColor = implReadBootstrapKey(
301*cdf0e10cSrcweir         OUString( RTL_CONSTASCII_USTRINGPARAM( "ProgressBarColor" ) ) );
302*cdf0e10cSrcweir     OUString sSize = implReadBootstrapKey(
303*cdf0e10cSrcweir         OUString( RTL_CONSTASCII_USTRINGPARAM( "ProgressSize" ) ) );
304*cdf0e10cSrcweir     OUString sPosition = implReadBootstrapKey(
305*cdf0e10cSrcweir         OUString( RTL_CONSTASCII_USTRINGPARAM( "ProgressPosition" ) ) );
306*cdf0e10cSrcweir     OUString sFullScreenSplash = implReadBootstrapKey(
307*cdf0e10cSrcweir         OUString( RTL_CONSTASCII_USTRINGPARAM( "FullScreenSplash" ) ) );
308*cdf0e10cSrcweir     OUString sNativeProgress = implReadBootstrapKey(
309*cdf0e10cSrcweir         OUString( RTL_CONSTASCII_USTRINGPARAM( "NativeProgress" ) ) );
310*cdf0e10cSrcweir 
311*cdf0e10cSrcweir 
312*cdf0e10cSrcweir     // Determine full screen splash mode
313*cdf0e10cSrcweir     _bFullScreenSplash = (( sFullScreenSplash.getLength() > 0 ) &&
314*cdf0e10cSrcweir                           ( !sFullScreenSplash.equalsAsciiL( "0", 1 )));
315*cdf0e10cSrcweir 
316*cdf0e10cSrcweir     // Try to retrieve the relative values for the progress bar. The current
317*cdf0e10cSrcweir     // schema uses the screen ratio to retrieve the associated values.
318*cdf0e10cSrcweir     if ( _bFullScreenSplash )
319*cdf0e10cSrcweir         determineProgressRatioValues( _fXPos, _fYPos, _fWidth, _fHeight );
320*cdf0e10cSrcweir 
321*cdf0e10cSrcweir     if ( sProgressFrameColor.getLength() )
322*cdf0e10cSrcweir     {
323*cdf0e10cSrcweir         sal_uInt8 nRed = 0;
324*cdf0e10cSrcweir         sal_uInt8 nGreen = 0;
325*cdf0e10cSrcweir         sal_uInt8 nBlue = 0;
326*cdf0e10cSrcweir         sal_Int32 idx = 0;
327*cdf0e10cSrcweir         sal_Int32 temp = sProgressFrameColor.getToken( 0, ',', idx ).toInt32();
328*cdf0e10cSrcweir         if ( idx != -1 )
329*cdf0e10cSrcweir         {
330*cdf0e10cSrcweir             nRed = static_cast< sal_uInt8 >( temp );
331*cdf0e10cSrcweir             temp = sProgressFrameColor.getToken( 0, ',', idx ).toInt32();
332*cdf0e10cSrcweir         }
333*cdf0e10cSrcweir         if ( idx != -1 )
334*cdf0e10cSrcweir         {
335*cdf0e10cSrcweir             nGreen = static_cast< sal_uInt8 >( temp );
336*cdf0e10cSrcweir             nBlue = static_cast< sal_uInt8 >( sProgressFrameColor.getToken( 0, ',', idx ).toInt32() );
337*cdf0e10cSrcweir             _cProgressFrameColor = Color( nRed, nGreen, nBlue );
338*cdf0e10cSrcweir         }
339*cdf0e10cSrcweir     }
340*cdf0e10cSrcweir 
341*cdf0e10cSrcweir     if ( sProgressBarColor.getLength() )
342*cdf0e10cSrcweir     {
343*cdf0e10cSrcweir         sal_uInt8 nRed = 0;
344*cdf0e10cSrcweir         sal_uInt8 nGreen = 0;
345*cdf0e10cSrcweir         sal_uInt8 nBlue = 0;
346*cdf0e10cSrcweir         sal_Int32 idx = 0;
347*cdf0e10cSrcweir         sal_Int32 temp = sProgressBarColor.getToken( 0, ',', idx ).toInt32();
348*cdf0e10cSrcweir         if ( idx != -1 )
349*cdf0e10cSrcweir         {
350*cdf0e10cSrcweir             nRed = static_cast< sal_uInt8 >( temp );
351*cdf0e10cSrcweir             temp = sProgressBarColor.getToken( 0, ',', idx ).toInt32();
352*cdf0e10cSrcweir         }
353*cdf0e10cSrcweir         if ( idx != -1 )
354*cdf0e10cSrcweir         {
355*cdf0e10cSrcweir             nGreen = static_cast< sal_uInt8 >( temp );
356*cdf0e10cSrcweir             nBlue = static_cast< sal_uInt8 >( sProgressBarColor.getToken( 0, ',', idx ).toInt32() );
357*cdf0e10cSrcweir             _cProgressBarColor = Color( nRed, nGreen, nBlue );
358*cdf0e10cSrcweir         }
359*cdf0e10cSrcweir     }
360*cdf0e10cSrcweir 
361*cdf0e10cSrcweir     if( sNativeProgress.getLength() )
362*cdf0e10cSrcweir     {
363*cdf0e10cSrcweir         _bNativeProgress = sNativeProgress.toBoolean();
364*cdf0e10cSrcweir     }
365*cdf0e10cSrcweir 
366*cdf0e10cSrcweir     if ( sSize.getLength() )
367*cdf0e10cSrcweir     {
368*cdf0e10cSrcweir         sal_Int32 idx = 0;
369*cdf0e10cSrcweir         sal_Int32 temp = sSize.getToken( 0, ',', idx ).toInt32();
370*cdf0e10cSrcweir         if ( idx != -1 )
371*cdf0e10cSrcweir         {
372*cdf0e10cSrcweir             _barwidth = temp;
373*cdf0e10cSrcweir             _barheight = sSize.getToken( 0, ',', idx ).toInt32();
374*cdf0e10cSrcweir         }
375*cdf0e10cSrcweir     }
376*cdf0e10cSrcweir 
377*cdf0e10cSrcweir     if ( _barheight >= 10 )
378*cdf0e10cSrcweir         _barspace = 3;  // more space between frame and bar
379*cdf0e10cSrcweir 
380*cdf0e10cSrcweir     if ( sPosition.getLength() )
381*cdf0e10cSrcweir     {
382*cdf0e10cSrcweir         sal_Int32 idx = 0;
383*cdf0e10cSrcweir         sal_Int32 temp = sPosition.getToken( 0, ',', idx ).toInt32();
384*cdf0e10cSrcweir         if ( idx != -1 )
385*cdf0e10cSrcweir         {
386*cdf0e10cSrcweir             _tlx = temp;
387*cdf0e10cSrcweir             _tly = sPosition.getToken( 0, ',', idx ).toInt32();
388*cdf0e10cSrcweir         }
389*cdf0e10cSrcweir     }
390*cdf0e10cSrcweir }
391*cdf0e10cSrcweir 
392*cdf0e10cSrcweir void SplashScreen::initBitmap()
393*cdf0e10cSrcweir {
394*cdf0e10cSrcweir     if ( _bShowLogo )
395*cdf0e10cSrcweir     {
396*cdf0e10cSrcweir         OUString sExecutePath;
397*cdf0e10cSrcweir         ::rtl::Bootstrap::get(
398*cdf0e10cSrcweir             OUString( RTL_CONSTASCII_USTRINGPARAM( "BRAND_BASE_DIR" ) ),
399*cdf0e10cSrcweir             sExecutePath );
400*cdf0e10cSrcweir         sExecutePath += OUString( RTL_CONSTASCII_USTRINGPARAM( "/program/" ) );
401*cdf0e10cSrcweir 
402*cdf0e10cSrcweir         bool haveBitmap = false;
403*cdf0e10cSrcweir 
404*cdf0e10cSrcweir         // Try all bitmaps in INTRO_BITMAP_NAMES
405*cdf0e10cSrcweir         sal_Int32 nIndex = 0;
406*cdf0e10cSrcweir         OUString  aIntroBitmapFiles( RTL_CONSTASCII_USTRINGPARAM( INTRO_BITMAP_STRINGLIST ));
407*cdf0e10cSrcweir         do
408*cdf0e10cSrcweir         {
409*cdf0e10cSrcweir             haveBitmap = loadBitmap( sExecutePath, aIntroBitmapFiles.getToken( 0, ',', nIndex ) );
410*cdf0e10cSrcweir         }
411*cdf0e10cSrcweir         while ( !haveBitmap && ( nIndex >= 0 ) );
412*cdf0e10cSrcweir 
413*cdf0e10cSrcweir         if (!haveBitmap) {
414*cdf0e10cSrcweir             rtl::OUString edition(
415*cdf0e10cSrcweir                 rtl::OUString(
416*cdf0e10cSrcweir                     RTL_CONSTASCII_USTRINGPARAM(
417*cdf0e10cSrcweir                         "${BRAND_BASE_DIR}/program/edition")));
418*cdf0e10cSrcweir             rtl::Bootstrap::expandMacros(edition);
419*cdf0e10cSrcweir             haveBitmap = findBitmap(edition);
420*cdf0e10cSrcweir         }
421*cdf0e10cSrcweir         if (!haveBitmap) {
422*cdf0e10cSrcweir             findBitmap(sExecutePath);
423*cdf0e10cSrcweir         }
424*cdf0e10cSrcweir     }
425*cdf0e10cSrcweir }
426*cdf0e10cSrcweir 
427*cdf0e10cSrcweir bool SplashScreen::loadBitmap(
428*cdf0e10cSrcweir     rtl::OUString const & path, const rtl::OUString &rBmpFileName )
429*cdf0e10cSrcweir {
430*cdf0e10cSrcweir     if ( rBmpFileName.getLength() == 0 )
431*cdf0e10cSrcweir         return false;
432*cdf0e10cSrcweir 
433*cdf0e10cSrcweir     INetURLObject aObj( path, INET_PROT_FILE );
434*cdf0e10cSrcweir     aObj.insertName( rBmpFileName );
435*cdf0e10cSrcweir 
436*cdf0e10cSrcweir     SvFileStream aStrm( aObj.PathToFileName(), STREAM_STD_READ );
437*cdf0e10cSrcweir     if ( !aStrm.GetError() )
438*cdf0e10cSrcweir     {
439*cdf0e10cSrcweir         // Use graphic class to also support more graphic formats (bmp,png,...)
440*cdf0e10cSrcweir         Graphic aGraphic;
441*cdf0e10cSrcweir 
442*cdf0e10cSrcweir         GraphicFilter* pGF = GraphicFilter::GetGraphicFilter();
443*cdf0e10cSrcweir         pGF->ImportGraphic( aGraphic, String(), aStrm, GRFILTER_FORMAT_DONTKNOW );
444*cdf0e10cSrcweir 
445*cdf0e10cSrcweir         // Default case, we load the intro bitmap from a seperate file
446*cdf0e10cSrcweir         // (e.g. staroffice_intro.bmp or starsuite_intro.bmp)
447*cdf0e10cSrcweir         _aIntroBmp = aGraphic.GetBitmapEx();
448*cdf0e10cSrcweir         return true;
449*cdf0e10cSrcweir     }
450*cdf0e10cSrcweir 
451*cdf0e10cSrcweir     return false;
452*cdf0e10cSrcweir }
453*cdf0e10cSrcweir 
454*cdf0e10cSrcweir bool SplashScreen::findBitmap(rtl::OUString const & path) {
455*cdf0e10cSrcweir     bool haveBitmap = false;
456*cdf0e10cSrcweir     if ( _bFullScreenSplash )
457*cdf0e10cSrcweir     {
458*cdf0e10cSrcweir         haveBitmap = findScreenBitmap(path);
459*cdf0e10cSrcweir         if ( haveBitmap )
460*cdf0e10cSrcweir             _eBitmapMode = BM_FULLSCREEN;
461*cdf0e10cSrcweir         else
462*cdf0e10cSrcweir             haveBitmap = findAppBitmap(path);
463*cdf0e10cSrcweir     }
464*cdf0e10cSrcweir     if ( !haveBitmap )
465*cdf0e10cSrcweir     {
466*cdf0e10cSrcweir         haveBitmap = loadBitmap(
467*cdf0e10cSrcweir             path, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("intro.png")));
468*cdf0e10cSrcweir         if ( !haveBitmap )
469*cdf0e10cSrcweir             haveBitmap = loadBitmap(
470*cdf0e10cSrcweir                 path, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("intro.bmp")));
471*cdf0e10cSrcweir     }
472*cdf0e10cSrcweir 
473*cdf0e10cSrcweir     return haveBitmap;
474*cdf0e10cSrcweir }
475*cdf0e10cSrcweir 
476*cdf0e10cSrcweir bool SplashScreen::findScreenBitmap(rtl::OUString const & path)
477*cdf0e10cSrcweir {
478*cdf0e10cSrcweir     sal_Int32 nWidth( 0 );
479*cdf0e10cSrcweir     sal_Int32 nHeight( 0 );
480*cdf0e10cSrcweir 
481*cdf0e10cSrcweir     // determine desktop resolution
482*cdf0e10cSrcweir     sal_uInt32 nCount = Application::GetScreenCount();
483*cdf0e10cSrcweir     if ( nCount > 0 )
484*cdf0e10cSrcweir     {
485*cdf0e10cSrcweir         // retrieve size from first screen
486*cdf0e10cSrcweir         Rectangle aScreenArea = Application::GetScreenPosSizePixel((unsigned int)0);
487*cdf0e10cSrcweir         nWidth  = aScreenArea.GetWidth();
488*cdf0e10cSrcweir         nHeight = aScreenArea.GetHeight();
489*cdf0e10cSrcweir     }
490*cdf0e10cSrcweir 
491*cdf0e10cSrcweir     // create file name from screen resolution information
492*cdf0e10cSrcweir     OUStringBuffer aStrBuf( 128 );
493*cdf0e10cSrcweir     aStrBuf.appendAscii( "intro_" );
494*cdf0e10cSrcweir     if ( _sAppName.getLength() > 0 )
495*cdf0e10cSrcweir     {
496*cdf0e10cSrcweir         aStrBuf.append( _sAppName );
497*cdf0e10cSrcweir         aStrBuf.appendAscii( "_" );
498*cdf0e10cSrcweir     }
499*cdf0e10cSrcweir     aStrBuf.append( OUString::valueOf( nWidth ));
500*cdf0e10cSrcweir     aStrBuf.appendAscii( "x" );
501*cdf0e10cSrcweir     aStrBuf.append( OUString::valueOf( nHeight ));
502*cdf0e10cSrcweir 
503*cdf0e10cSrcweir     OUString aRootIntroFileName = aStrBuf.makeStringAndClear();
504*cdf0e10cSrcweir     OUString aBmpFileName       = aRootIntroFileName + OUString::createFromAscii(".png");
505*cdf0e10cSrcweir 
506*cdf0e10cSrcweir     bool haveBitmap = loadBitmap( path, aBmpFileName );
507*cdf0e10cSrcweir     if ( !haveBitmap )
508*cdf0e10cSrcweir     {
509*cdf0e10cSrcweir         aBmpFileName = aRootIntroFileName + OUString::createFromAscii(".bmp");
510*cdf0e10cSrcweir         haveBitmap   = loadBitmap( path, aBmpFileName );
511*cdf0e10cSrcweir     }
512*cdf0e10cSrcweir 
513*cdf0e10cSrcweir     if ( !haveBitmap )
514*cdf0e10cSrcweir     {
515*cdf0e10cSrcweir         aStrBuf.appendAscii( "intro_" );
516*cdf0e10cSrcweir         aStrBuf.appendAscii( "_" );
517*cdf0e10cSrcweir         aStrBuf.append( OUString::valueOf( nWidth ));
518*cdf0e10cSrcweir         aStrBuf.appendAscii( "x" );
519*cdf0e10cSrcweir         aStrBuf.append( OUString::valueOf( nHeight ));
520*cdf0e10cSrcweir 
521*cdf0e10cSrcweir         aRootIntroFileName = aStrBuf.makeStringAndClear();
522*cdf0e10cSrcweir         aBmpFileName = aRootIntroFileName + OUString::createFromAscii(".png");
523*cdf0e10cSrcweir 
524*cdf0e10cSrcweir         haveBitmap = loadBitmap( path, aBmpFileName );
525*cdf0e10cSrcweir         if ( !haveBitmap )
526*cdf0e10cSrcweir         {
527*cdf0e10cSrcweir             aBmpFileName = aRootIntroFileName + OUString::createFromAscii(".bmp");
528*cdf0e10cSrcweir             haveBitmap   = loadBitmap( path, aBmpFileName );
529*cdf0e10cSrcweir         }
530*cdf0e10cSrcweir     }
531*cdf0e10cSrcweir     return haveBitmap;
532*cdf0e10cSrcweir }
533*cdf0e10cSrcweir 
534*cdf0e10cSrcweir bool SplashScreen::findAppBitmap(rtl::OUString const & path)
535*cdf0e10cSrcweir {
536*cdf0e10cSrcweir     bool haveBitmap = false;
537*cdf0e10cSrcweir 
538*cdf0e10cSrcweir     if ( _sAppName.getLength() > 0 )
539*cdf0e10cSrcweir     {
540*cdf0e10cSrcweir         OUStringBuffer aStrBuf( 128 );
541*cdf0e10cSrcweir         aStrBuf.appendAscii( "intro_" );
542*cdf0e10cSrcweir         aStrBuf.appendAscii( "_" );
543*cdf0e10cSrcweir         aStrBuf.append( _sAppName );
544*cdf0e10cSrcweir 
545*cdf0e10cSrcweir         OUString aRootIntroFileName = aStrBuf.makeStringAndClear();
546*cdf0e10cSrcweir 
547*cdf0e10cSrcweir         OUString aBmpFileName = aRootIntroFileName + OUString::createFromAscii( ".png" );
548*cdf0e10cSrcweir         haveBitmap = loadBitmap( path, aBmpFileName );
549*cdf0e10cSrcweir         if ( !haveBitmap )
550*cdf0e10cSrcweir         {
551*cdf0e10cSrcweir             aBmpFileName = aRootIntroFileName + OUString::createFromAscii( ".bmp" );
552*cdf0e10cSrcweir             haveBitmap = loadBitmap( path, aBmpFileName );
553*cdf0e10cSrcweir         }
554*cdf0e10cSrcweir     }
555*cdf0e10cSrcweir     return haveBitmap;
556*cdf0e10cSrcweir }
557*cdf0e10cSrcweir 
558*cdf0e10cSrcweir void SplashScreen::determineProgressRatioValues(
559*cdf0e10cSrcweir     double& rXRelPos, double& rYRelPos,
560*cdf0e10cSrcweir     double& rRelWidth, double& rRelHeight )
561*cdf0e10cSrcweir {
562*cdf0e10cSrcweir     sal_Int32 nWidth( 0 );
563*cdf0e10cSrcweir     sal_Int32 nHeight( 0 );
564*cdf0e10cSrcweir     sal_Int32 nScreenRatio( 0 );
565*cdf0e10cSrcweir 
566*cdf0e10cSrcweir     // determine desktop resolution
567*cdf0e10cSrcweir     sal_uInt32 nCount = Application::GetScreenCount();
568*cdf0e10cSrcweir     if ( nCount > 0 )
569*cdf0e10cSrcweir     {
570*cdf0e10cSrcweir         // retrieve size from first screen
571*cdf0e10cSrcweir         Rectangle aScreenArea = Application::GetScreenPosSizePixel((unsigned int)0);
572*cdf0e10cSrcweir         nWidth  = aScreenArea.GetWidth();
573*cdf0e10cSrcweir         nHeight = aScreenArea.GetHeight();
574*cdf0e10cSrcweir         nScreenRatio  = sal_Int32( math::round( double( nWidth ) / double( nHeight ), 2 ) * 100 );
575*cdf0e10cSrcweir     }
576*cdf0e10cSrcweir 
577*cdf0e10cSrcweir     char szFullScreenProgressRatio[] = "FullScreenProgressRatio0";
578*cdf0e10cSrcweir     char szFullScreenProgressPos[]   = "FullScreenProgressPos0";
579*cdf0e10cSrcweir     char szFullScreenProgressSize[]  = "FullScreenProgressSize0";
580*cdf0e10cSrcweir     for ( sal_Int32 i = 0; i <= 9; i++ )
581*cdf0e10cSrcweir     {
582*cdf0e10cSrcweir         char cNum = '0' + char( i );
583*cdf0e10cSrcweir         szFullScreenProgressRatio[23] = cNum;
584*cdf0e10cSrcweir         szFullScreenProgressPos[21]   = cNum;
585*cdf0e10cSrcweir         szFullScreenProgressSize[22]  = cNum;
586*cdf0e10cSrcweir 
587*cdf0e10cSrcweir         OUString sFullScreenProgressRatio = implReadBootstrapKey(
588*cdf0e10cSrcweir             OUString::createFromAscii( szFullScreenProgressRatio ) );
589*cdf0e10cSrcweir 
590*cdf0e10cSrcweir         if ( sFullScreenProgressRatio.getLength() > 0 )
591*cdf0e10cSrcweir         {
592*cdf0e10cSrcweir             double fRatio = sFullScreenProgressRatio.toDouble();
593*cdf0e10cSrcweir             sal_Int32 nRatio = sal_Int32( math::round( fRatio, 2 ) * 100 );
594*cdf0e10cSrcweir             if ( nRatio == nScreenRatio )
595*cdf0e10cSrcweir             {
596*cdf0e10cSrcweir                 OUString sFullScreenProgressPos = implReadBootstrapKey(
597*cdf0e10cSrcweir                     OUString::createFromAscii( szFullScreenProgressPos ) );
598*cdf0e10cSrcweir                 OUString sFullScreenProgressSize = implReadBootstrapKey(
599*cdf0e10cSrcweir                     OUString::createFromAscii( szFullScreenProgressSize ) );
600*cdf0e10cSrcweir 
601*cdf0e10cSrcweir                 if ( sFullScreenProgressPos.getLength() )
602*cdf0e10cSrcweir                 {
603*cdf0e10cSrcweir                     sal_Int32 idx = 0;
604*cdf0e10cSrcweir                     double temp = sFullScreenProgressPos.getToken( 0, ',', idx ).toDouble();
605*cdf0e10cSrcweir                     if ( idx != -1 )
606*cdf0e10cSrcweir                     {
607*cdf0e10cSrcweir                         rXRelPos = temp;
608*cdf0e10cSrcweir                         rYRelPos = sFullScreenProgressPos.getToken( 0, ',', idx ).toDouble();
609*cdf0e10cSrcweir                     }
610*cdf0e10cSrcweir                 }
611*cdf0e10cSrcweir 
612*cdf0e10cSrcweir                 if ( sFullScreenProgressSize.getLength() )
613*cdf0e10cSrcweir                 {
614*cdf0e10cSrcweir                     sal_Int32 idx = 0;
615*cdf0e10cSrcweir                     double temp = sFullScreenProgressSize.getToken( 0, ',', idx ).toDouble();
616*cdf0e10cSrcweir                     if ( idx != -1 )
617*cdf0e10cSrcweir                     {
618*cdf0e10cSrcweir                         rRelWidth  = temp;
619*cdf0e10cSrcweir                         rRelHeight = sFullScreenProgressSize.getToken( 0, ',', idx ).toDouble();
620*cdf0e10cSrcweir                     }
621*cdf0e10cSrcweir                 }
622*cdf0e10cSrcweir             }
623*cdf0e10cSrcweir         }
624*cdf0e10cSrcweir         else
625*cdf0e10cSrcweir             break;
626*cdf0e10cSrcweir     }
627*cdf0e10cSrcweir }
628*cdf0e10cSrcweir 
629*cdf0e10cSrcweir void SplashScreen::Paint( const Rectangle&)
630*cdf0e10cSrcweir {
631*cdf0e10cSrcweir 	if(!_bVisible) return;
632*cdf0e10cSrcweir 
633*cdf0e10cSrcweir     //native drawing
634*cdf0e10cSrcweir     sal_Bool bNativeOK = sal_False;
635*cdf0e10cSrcweir 
636*cdf0e10cSrcweir     // in case of native controls we need to draw directly to the window
637*cdf0e10cSrcweir     if( _bNativeProgress && IsNativeControlSupported( CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL ) )
638*cdf0e10cSrcweir     {
639*cdf0e10cSrcweir         DrawBitmapEx( Point(), _aIntroBmp );
640*cdf0e10cSrcweir 
641*cdf0e10cSrcweir         ImplControlValue aValue( _iProgress * _barwidth / _iMax);
642*cdf0e10cSrcweir         Rectangle aDrawRect( Point(_tlx, _tly), Size( _barwidth, _barheight ) );
643*cdf0e10cSrcweir         Rectangle aNativeControlRegion, aNativeContentRegion;
644*cdf0e10cSrcweir 
645*cdf0e10cSrcweir         if( GetNativeControlRegion( CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL, aDrawRect,
646*cdf0e10cSrcweir                                              CTRL_STATE_ENABLED, aValue, rtl::OUString(),
647*cdf0e10cSrcweir                                              aNativeControlRegion, aNativeContentRegion ) )
648*cdf0e10cSrcweir         {
649*cdf0e10cSrcweir               long nProgressHeight = aNativeControlRegion.GetHeight();
650*cdf0e10cSrcweir               aDrawRect.Top() -= (nProgressHeight - _barheight)/2;
651*cdf0e10cSrcweir               aDrawRect.Bottom() += (nProgressHeight - _barheight)/2;
652*cdf0e10cSrcweir         }
653*cdf0e10cSrcweir 
654*cdf0e10cSrcweir         if( (bNativeOK = DrawNativeControl( CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL, aDrawRect,
655*cdf0e10cSrcweir                                             CTRL_STATE_ENABLED, aValue, _sProgressText )) != sal_False )
656*cdf0e10cSrcweir         {
657*cdf0e10cSrcweir             return;
658*cdf0e10cSrcweir         }
659*cdf0e10cSrcweir     }
660*cdf0e10cSrcweir     //non native drawing
661*cdf0e10cSrcweir 	// draw bitmap
662*cdf0e10cSrcweir 	if (_bPaintBitmap)
663*cdf0e10cSrcweir 		_vdev.DrawBitmapEx( Point(), _aIntroBmp );
664*cdf0e10cSrcweir 
665*cdf0e10cSrcweir 	if (_bPaintProgress) {
666*cdf0e10cSrcweir 		// draw progress...
667*cdf0e10cSrcweir 		long length = (_iProgress * _barwidth / _iMax) - (2 * _barspace);
668*cdf0e10cSrcweir 		if (length < 0) length = 0;
669*cdf0e10cSrcweir 
670*cdf0e10cSrcweir 		// border
671*cdf0e10cSrcweir 		_vdev.SetFillColor();
672*cdf0e10cSrcweir 		_vdev.SetLineColor( _cProgressFrameColor );
673*cdf0e10cSrcweir 		_vdev.DrawRect(Rectangle(_tlx, _tly, _tlx+_barwidth, _tly+_barheight));
674*cdf0e10cSrcweir 		_vdev.SetFillColor( _cProgressBarColor );
675*cdf0e10cSrcweir 		_vdev.SetLineColor();
676*cdf0e10cSrcweir 		_vdev.DrawRect(Rectangle(_tlx+_barspace, _tly+_barspace, _tlx+_barspace+length, _tly+_barheight-_barspace));
677*cdf0e10cSrcweir         _vdev.DrawText( Rectangle(_tlx, _tly+_barheight+5, _tlx+_barwidth, _tly+_barheight+5+20), _sProgressText, TEXT_DRAW_CENTER );
678*cdf0e10cSrcweir 	}
679*cdf0e10cSrcweir     Size aSize =  GetOutputSizePixel();
680*cdf0e10cSrcweir     Size bSize =  _vdev.GetOutputSizePixel();
681*cdf0e10cSrcweir     //_vdev.Flush();
682*cdf0e10cSrcweir     //_vdev.DrawOutDev(Point(), GetOutputSize(), Point(), GetOutputSize(), *((IntroWindow*)this) );
683*cdf0e10cSrcweir     DrawOutDev(Point(), GetOutputSizePixel(), Point(), _vdev.GetOutputSizePixel(), _vdev );
684*cdf0e10cSrcweir 	//Flush();
685*cdf0e10cSrcweir }
686*cdf0e10cSrcweir 
687*cdf0e10cSrcweir 
688*cdf0e10cSrcweir // get service instance...
689*cdf0e10cSrcweir SplashScreen *SplashScreen::_pINSTANCE = NULL;
690*cdf0e10cSrcweir osl::Mutex SplashScreen::_aMutex;
691*cdf0e10cSrcweir 
692*cdf0e10cSrcweir Reference< XInterface > SplashScreen::getInstance(const Reference< XMultiServiceFactory >& rSMgr)
693*cdf0e10cSrcweir {
694*cdf0e10cSrcweir 	if ( _pINSTANCE == 0 )
695*cdf0e10cSrcweir 	{
696*cdf0e10cSrcweir 		osl::MutexGuard guard(_aMutex);
697*cdf0e10cSrcweir 		if (_pINSTANCE == 0)
698*cdf0e10cSrcweir 			return (XComponent*)new SplashScreen(rSMgr);
699*cdf0e10cSrcweir 	}
700*cdf0e10cSrcweir 
701*cdf0e10cSrcweir 	return (XComponent*)0;
702*cdf0e10cSrcweir }
703*cdf0e10cSrcweir 
704*cdf0e10cSrcweir // static service info...
705*cdf0e10cSrcweir const char* SplashScreen::interfaces[] =
706*cdf0e10cSrcweir {
707*cdf0e10cSrcweir     "com.sun.star.task.XStartusIndicator",
708*cdf0e10cSrcweir     "com.sun.star.lang.XInitialization",
709*cdf0e10cSrcweir     NULL,
710*cdf0e10cSrcweir };
711*cdf0e10cSrcweir const sal_Char *SplashScreen::serviceName = "com.sun.star.office.SplashScreen";
712*cdf0e10cSrcweir const sal_Char *SplashScreen::implementationName = "com.sun.star.office.comp.SplashScreen";
713*cdf0e10cSrcweir const sal_Char *SplashScreen::supportedServiceNames[] = {"com.sun.star.office.SplashScreen", NULL};
714*cdf0e10cSrcweir 
715*cdf0e10cSrcweir }
716