diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2010-05-26 16:11:12 +0200 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2010-05-26 16:11:12 +0200 |
commit | 0f25ca6953033d641eab32ffe3a3dffea585cb57 (patch) | |
tree | 03802a1bdce59f885fc50cf7410f9f33cf220363 /desktop/source/splash | |
parent | f9892606da5135ce04f8ec8a9993b7fc6822189d (diff) | |
parent | f9561071999b3c5c8505d648c14fff7b1bcd0caa (diff) |
l10ntooling18: merge
Diffstat (limited to 'desktop/source/splash')
-rw-r--r-- | desktop/source/splash/exports.map | 10 | ||||
-rw-r--r-- | desktop/source/splash/makefile.mk | 3 | ||||
-rw-r--r-- | desktop/source/splash/splash.cxx | 65 | ||||
-rw-r--r-- | desktop/source/splash/splash.hxx | 5 |
4 files changed, 59 insertions, 24 deletions
diff --git a/desktop/source/splash/exports.map b/desktop/source/splash/exports.map deleted file mode 100644 index ba501f9ae076..000000000000 --- a/desktop/source/splash/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/desktop/source/splash/makefile.mk b/desktop/source/splash/makefile.mk index 518ccc11ad0c..2f163fe7b9d6 100644 --- a/desktop/source/splash/makefile.mk +++ b/desktop/source/splash/makefile.mk @@ -54,7 +54,7 @@ SHL1OBJS= $(SLOFILES) \ SHL1TARGET=$(TARGET)$(DLLPOSTFIX) SHL1IMPLIB=i$(TARGET) -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) @@ -63,6 +63,7 @@ SHL1STDLIBS= \ $(SVLLIB) \ $(SVTOOLLIB) \ $(COMPHELPERLIB) \ + $(CONFIGMGRLIB) \ $(UNOTOOLSLIB) \ $(TOOLSLIB) \ $(UCBHELPERLIB) \ diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx index 6e949c1bf00c..5fee3028b4f6 100644 --- a/desktop/source/splash/splash.cxx +++ b/desktop/source/splash/splash.cxx @@ -44,6 +44,8 @@ #include <rtl/logfile.hxx> #include <rtl/ustrbuf.hxx> #include <rtl/math.hxx> +#include <vcl/graph.hxx> +#include <svtools/filter.hxx> #define NOT_LOADED ((long)-1) @@ -58,6 +60,7 @@ SplashScreen::SplashScreen(const Reference< XMultiServiceFactory >& rSMgr) , _vdev(*((IntroWindow*)this)) , _cProgressFrameColor(sal::static_int_cast< ColorData >(NOT_LOADED)) , _cProgressBarColor(sal::static_int_cast< ColorData >(NOT_LOADED)) + , _bNativeProgress(true) , _iMax(100) , _iProgress(0) , _eBitmapMode(BM_DEFAULTMODE) @@ -295,6 +298,9 @@ void SplashScreen::loadConfig() OUString( RTL_CONSTASCII_USTRINGPARAM( "ProgressPosition" ) ) ); OUString sFullScreenSplash = implReadBootstrapKey( OUString( RTL_CONSTASCII_USTRINGPARAM( "FullScreenSplash" ) ) ); + OUString sNativeProgress = implReadBootstrapKey( + OUString( RTL_CONSTASCII_USTRINGPARAM( "NativeProgress" ) ) ); + // Determine full screen splash mode _bFullScreenSplash = (( sFullScreenSplash.getLength() > 0 ) && @@ -345,6 +351,11 @@ void SplashScreen::loadConfig() } } + if( sNativeProgress.getLength() ) + { + _bNativeProgress = sNativeProgress.toBoolean(); + } + if ( sSize.getLength() ) { sal_Int32 idx = 0; @@ -418,9 +429,15 @@ bool SplashScreen::loadBitmap( SvFileStream aStrm( aObj.PathToFileName(), STREAM_STD_READ ); if ( !aStrm.GetError() ) { + // Use graphic class to also support more graphic formats (bmp,png,...) + Graphic aGraphic; + + GraphicFilter* pGF = GraphicFilter::GetGraphicFilter(); + pGF->ImportGraphic( aGraphic, String(), aStrm, GRFILTER_FORMAT_DONTKNOW ); + // Default case, we load the intro bitmap from a seperate file // (e.g. staroffice_intro.bmp or starsuite_intro.bmp) - aStrm >> _aIntroBmp; + _aIntroBmp = aGraphic.GetBitmapEx(); return true; } @@ -438,8 +455,14 @@ bool SplashScreen::findBitmap(rtl::OUString const & path) { haveBitmap = findAppBitmap(path); } if ( !haveBitmap ) + { haveBitmap = loadBitmap( - path, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("intro.bmp"))); + path, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("intro.png"))); + if ( !haveBitmap ) + haveBitmap = loadBitmap( + path, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("intro.bmp"))); + } + return haveBitmap; } @@ -469,21 +492,34 @@ bool SplashScreen::findScreenBitmap(rtl::OUString const & path) aStrBuf.append( OUString::valueOf( nWidth )); aStrBuf.appendAscii( "x" ); aStrBuf.append( OUString::valueOf( nHeight )); - aStrBuf.appendAscii( ".bmp" ); - OUString aBmpFileName = aStrBuf.makeStringAndClear(); + + OUString aRootIntroFileName = aStrBuf.makeStringAndClear(); + OUString aBmpFileName = aRootIntroFileName + OUString::createFromAscii(".png"); bool haveBitmap = loadBitmap( path, aBmpFileName ); if ( !haveBitmap ) { + aBmpFileName = aRootIntroFileName + OUString::createFromAscii(".bmp"); + haveBitmap = loadBitmap( path, aBmpFileName ); + } + + if ( !haveBitmap ) + { aStrBuf.appendAscii( "intro_" ); aStrBuf.appendAscii( "_" ); aStrBuf.append( OUString::valueOf( nWidth )); aStrBuf.appendAscii( "x" ); aStrBuf.append( OUString::valueOf( nHeight )); - aStrBuf.appendAscii( ".bmp" ); - aBmpFileName = aStrBuf.makeStringAndClear(); + + aRootIntroFileName = aStrBuf.makeStringAndClear(); + aBmpFileName = aRootIntroFileName + OUString::createFromAscii(".png"); haveBitmap = loadBitmap( path, aBmpFileName ); + if ( !haveBitmap ) + { + aBmpFileName = aRootIntroFileName + OUString::createFromAscii(".bmp"); + haveBitmap = loadBitmap( path, aBmpFileName ); + } } return haveBitmap; } @@ -498,9 +534,16 @@ bool SplashScreen::findAppBitmap(rtl::OUString const & path) aStrBuf.appendAscii( "intro_" ); aStrBuf.appendAscii( "_" ); aStrBuf.append( _sAppName ); - aStrBuf.appendAscii( ".bmp" ); - OUString aBmpFileName = aStrBuf.makeStringAndClear(); + + OUString aRootIntroFileName = aStrBuf.makeStringAndClear(); + + OUString aBmpFileName = aRootIntroFileName + OUString::createFromAscii( ".png" ); haveBitmap = loadBitmap( path, aBmpFileName ); + if ( !haveBitmap ) + { + aBmpFileName = aRootIntroFileName + OUString::createFromAscii( ".bmp" ); + haveBitmap = loadBitmap( path, aBmpFileName ); + } } return haveBitmap; } @@ -584,9 +627,9 @@ void SplashScreen::Paint( const Rectangle&) BOOL bNativeOK = FALSE; // in case of native controls we need to draw directly to the window - if( IsNativeControlSupported( CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL ) ) + if( _bNativeProgress && IsNativeControlSupported( CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL ) ) { - DrawBitmap( Point(), _aIntroBmp ); + DrawBitmapEx( Point(), _aIntroBmp ); ImplControlValue aValue( _iProgress * _barwidth / _iMax); Rectangle aDrawRect( Point(_tlx, _tly), Size( _barwidth, _barheight ) ); @@ -612,7 +655,7 @@ void SplashScreen::Paint( const Rectangle&) //non native drawing // draw bitmap if (_bPaintBitmap) - _vdev.DrawBitmap( Point(), _aIntroBmp ); + _vdev.DrawBitmapEx( Point(), _aIntroBmp ); if (_bPaintProgress) { // draw progress... diff --git a/desktop/source/splash/splash.hxx b/desktop/source/splash/splash.hxx index f56fff54b931..99677aa107f1 100644 --- a/desktop/source/splash/splash.hxx +++ b/desktop/source/splash/splash.hxx @@ -34,7 +34,7 @@ #include <cppuhelper/implbase2.hxx> #include <cppuhelper/interfacecontainer.h> #include <vcl/introwin.hxx> -#include <vcl/bitmap.hxx> +#include <vcl/bitmapex.hxx> #include <com/sun/star/lang/XSingleServiceFactory.hpp> #include <osl/mutex.hxx> #include <vcl/virdev.hxx> @@ -86,9 +86,10 @@ private: Reference< XMultiServiceFactory > _rFactory; VirtualDevice _vdev; - Bitmap _aIntroBmp; + BitmapEx _aIntroBmp; Color _cProgressFrameColor; Color _cProgressBarColor; + bool _bNativeProgress; OUString _sAppName; std::vector< FullScreenProgressRatioValue > _sFullScreenProgressRatioValues; |